Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu.../js/jquery/ui
File: datepicker.js
inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
[500] Fix | Delete
prop( "disabled", true );
[501] Fix | Delete
}
[502] Fix | Delete
this._disabledInputs = $.map( this._disabledInputs,
[503] Fix | Delete
[504] Fix | Delete
// Delete entry
[505] Fix | Delete
function( value ) {
[506] Fix | Delete
return ( value === target ? null : value );
[507] Fix | Delete
} );
[508] Fix | Delete
this._disabledInputs[ this._disabledInputs.length ] = target;
[509] Fix | Delete
},
[510] Fix | Delete
[511] Fix | Delete
/* Is the first field in a jQuery collection disabled as a datepicker?
[512] Fix | Delete
* @param target element - the target input field or division or span
[513] Fix | Delete
* @return boolean - true if disabled, false if enabled
[514] Fix | Delete
*/
[515] Fix | Delete
_isDisabledDatepicker: function( target ) {
[516] Fix | Delete
if ( !target ) {
[517] Fix | Delete
return false;
[518] Fix | Delete
}
[519] Fix | Delete
for ( var i = 0; i < this._disabledInputs.length; i++ ) {
[520] Fix | Delete
if ( this._disabledInputs[ i ] === target ) {
[521] Fix | Delete
return true;
[522] Fix | Delete
}
[523] Fix | Delete
}
[524] Fix | Delete
return false;
[525] Fix | Delete
},
[526] Fix | Delete
[527] Fix | Delete
/* Retrieve the instance data for the target control.
[528] Fix | Delete
* @param target element - the target input field or division or span
[529] Fix | Delete
* @return object - the associated instance data
[530] Fix | Delete
* @throws error if a jQuery problem getting data
[531] Fix | Delete
*/
[532] Fix | Delete
_getInst: function( target ) {
[533] Fix | Delete
try {
[534] Fix | Delete
return $.data( target, "datepicker" );
[535] Fix | Delete
} catch ( err ) {
[536] Fix | Delete
throw "Missing instance data for this datepicker";
[537] Fix | Delete
}
[538] Fix | Delete
},
[539] Fix | Delete
[540] Fix | Delete
/* Update or retrieve the settings for a date picker attached to an input field or division.
[541] Fix | Delete
* @param target element - the target input field or division or span
[542] Fix | Delete
* @param name object - the new settings to update or
[543] Fix | Delete
* string - the name of the setting to change or retrieve,
[544] Fix | Delete
* when retrieving also "all" for all instance settings or
[545] Fix | Delete
* "defaults" for all global defaults
[546] Fix | Delete
* @param value any - the new value for the setting
[547] Fix | Delete
* (omit if above is an object or to retrieve a value)
[548] Fix | Delete
*/
[549] Fix | Delete
_optionDatepicker: function( target, name, value ) {
[550] Fix | Delete
var settings, date, minDate, maxDate,
[551] Fix | Delete
inst = this._getInst( target );
[552] Fix | Delete
[553] Fix | Delete
if ( arguments.length === 2 && typeof name === "string" ) {
[554] Fix | Delete
return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
[555] Fix | Delete
( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
[556] Fix | Delete
this._get( inst, name ) ) : null ) );
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
settings = name || {};
[560] Fix | Delete
if ( typeof name === "string" ) {
[561] Fix | Delete
settings = {};
[562] Fix | Delete
settings[ name ] = value;
[563] Fix | Delete
}
[564] Fix | Delete
[565] Fix | Delete
if ( inst ) {
[566] Fix | Delete
if ( this._curInst === inst ) {
[567] Fix | Delete
this._hideDatepicker();
[568] Fix | Delete
}
[569] Fix | Delete
[570] Fix | Delete
date = this._getDateDatepicker( target, true );
[571] Fix | Delete
minDate = this._getMinMaxDate( inst, "min" );
[572] Fix | Delete
maxDate = this._getMinMaxDate( inst, "max" );
[573] Fix | Delete
datepicker_extendRemove( inst.settings, settings );
[574] Fix | Delete
[575] Fix | Delete
// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
[576] Fix | Delete
if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
[577] Fix | Delete
inst.settings.minDate = this._formatDate( inst, minDate );
[578] Fix | Delete
}
[579] Fix | Delete
if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
[580] Fix | Delete
inst.settings.maxDate = this._formatDate( inst, maxDate );
[581] Fix | Delete
}
[582] Fix | Delete
if ( "disabled" in settings ) {
[583] Fix | Delete
if ( settings.disabled ) {
[584] Fix | Delete
this._disableDatepicker( target );
[585] Fix | Delete
} else {
[586] Fix | Delete
this._enableDatepicker( target );
[587] Fix | Delete
}
[588] Fix | Delete
}
[589] Fix | Delete
this._attachments( $( target ), inst );
[590] Fix | Delete
this._autoSize( inst );
[591] Fix | Delete
this._setDate( inst, date );
[592] Fix | Delete
this._updateAlternate( inst );
[593] Fix | Delete
this._updateDatepicker( inst );
[594] Fix | Delete
}
[595] Fix | Delete
},
[596] Fix | Delete
[597] Fix | Delete
// Change method deprecated
[598] Fix | Delete
_changeDatepicker: function( target, name, value ) {
[599] Fix | Delete
this._optionDatepicker( target, name, value );
[600] Fix | Delete
},
[601] Fix | Delete
[602] Fix | Delete
/* Redraw the date picker attached to an input field or division.
[603] Fix | Delete
* @param target element - the target input field or division or span
[604] Fix | Delete
*/
[605] Fix | Delete
_refreshDatepicker: function( target ) {
[606] Fix | Delete
var inst = this._getInst( target );
[607] Fix | Delete
if ( inst ) {
[608] Fix | Delete
this._updateDatepicker( inst );
[609] Fix | Delete
}
[610] Fix | Delete
},
[611] Fix | Delete
[612] Fix | Delete
/* Set the dates for a jQuery selection.
[613] Fix | Delete
* @param target element - the target input field or division or span
[614] Fix | Delete
* @param date Date - the new date
[615] Fix | Delete
*/
[616] Fix | Delete
_setDateDatepicker: function( target, date ) {
[617] Fix | Delete
var inst = this._getInst( target );
[618] Fix | Delete
if ( inst ) {
[619] Fix | Delete
this._setDate( inst, date );
[620] Fix | Delete
this._updateDatepicker( inst );
[621] Fix | Delete
this._updateAlternate( inst );
[622] Fix | Delete
}
[623] Fix | Delete
},
[624] Fix | Delete
[625] Fix | Delete
/* Get the date(s) for the first entry in a jQuery selection.
[626] Fix | Delete
* @param target element - the target input field or division or span
[627] Fix | Delete
* @param noDefault boolean - true if no default date is to be used
[628] Fix | Delete
* @return Date - the current date
[629] Fix | Delete
*/
[630] Fix | Delete
_getDateDatepicker: function( target, noDefault ) {
[631] Fix | Delete
var inst = this._getInst( target );
[632] Fix | Delete
if ( inst && !inst.inline ) {
[633] Fix | Delete
this._setDateFromField( inst, noDefault );
[634] Fix | Delete
}
[635] Fix | Delete
return ( inst ? this._getDate( inst ) : null );
[636] Fix | Delete
},
[637] Fix | Delete
[638] Fix | Delete
/* Handle keystrokes. */
[639] Fix | Delete
_doKeyDown: function( event ) {
[640] Fix | Delete
var onSelect, dateStr, sel,
[641] Fix | Delete
inst = $.datepicker._getInst( event.target ),
[642] Fix | Delete
handled = true,
[643] Fix | Delete
isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
[644] Fix | Delete
[645] Fix | Delete
inst._keyEvent = true;
[646] Fix | Delete
if ( $.datepicker._datepickerShowing ) {
[647] Fix | Delete
switch ( event.keyCode ) {
[648] Fix | Delete
case 9: $.datepicker._hideDatepicker();
[649] Fix | Delete
handled = false;
[650] Fix | Delete
break; // hide on tab out
[651] Fix | Delete
case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
[652] Fix | Delete
$.datepicker._currentClass + ")", inst.dpDiv );
[653] Fix | Delete
if ( sel[ 0 ] ) {
[654] Fix | Delete
$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
[655] Fix | Delete
}
[656] Fix | Delete
[657] Fix | Delete
onSelect = $.datepicker._get( inst, "onSelect" );
[658] Fix | Delete
if ( onSelect ) {
[659] Fix | Delete
dateStr = $.datepicker._formatDate( inst );
[660] Fix | Delete
[661] Fix | Delete
// Trigger custom callback
[662] Fix | Delete
onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
[663] Fix | Delete
} else {
[664] Fix | Delete
$.datepicker._hideDatepicker();
[665] Fix | Delete
}
[666] Fix | Delete
[667] Fix | Delete
return false; // don't submit the form
[668] Fix | Delete
case 27: $.datepicker._hideDatepicker();
[669] Fix | Delete
break; // hide on escape
[670] Fix | Delete
case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
[671] Fix | Delete
-$.datepicker._get( inst, "stepBigMonths" ) :
[672] Fix | Delete
-$.datepicker._get( inst, "stepMonths" ) ), "M" );
[673] Fix | Delete
break; // previous month/year on page up/+ ctrl
[674] Fix | Delete
case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
[675] Fix | Delete
+$.datepicker._get( inst, "stepBigMonths" ) :
[676] Fix | Delete
+$.datepicker._get( inst, "stepMonths" ) ), "M" );
[677] Fix | Delete
break; // next month/year on page down/+ ctrl
[678] Fix | Delete
case 35: if ( event.ctrlKey || event.metaKey ) {
[679] Fix | Delete
$.datepicker._clearDate( event.target );
[680] Fix | Delete
}
[681] Fix | Delete
handled = event.ctrlKey || event.metaKey;
[682] Fix | Delete
break; // clear on ctrl or command +end
[683] Fix | Delete
case 36: if ( event.ctrlKey || event.metaKey ) {
[684] Fix | Delete
$.datepicker._gotoToday( event.target );
[685] Fix | Delete
}
[686] Fix | Delete
handled = event.ctrlKey || event.metaKey;
[687] Fix | Delete
break; // current on ctrl or command +home
[688] Fix | Delete
case 37: if ( event.ctrlKey || event.metaKey ) {
[689] Fix | Delete
$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
[690] Fix | Delete
}
[691] Fix | Delete
handled = event.ctrlKey || event.metaKey;
[692] Fix | Delete
[693] Fix | Delete
// -1 day on ctrl or command +left
[694] Fix | Delete
if ( event.originalEvent.altKey ) {
[695] Fix | Delete
$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
[696] Fix | Delete
-$.datepicker._get( inst, "stepBigMonths" ) :
[697] Fix | Delete
-$.datepicker._get( inst, "stepMonths" ) ), "M" );
[698] Fix | Delete
}
[699] Fix | Delete
[700] Fix | Delete
// next month/year on alt +left on Mac
[701] Fix | Delete
break;
[702] Fix | Delete
case 38: if ( event.ctrlKey || event.metaKey ) {
[703] Fix | Delete
$.datepicker._adjustDate( event.target, -7, "D" );
[704] Fix | Delete
}
[705] Fix | Delete
handled = event.ctrlKey || event.metaKey;
[706] Fix | Delete
break; // -1 week on ctrl or command +up
[707] Fix | Delete
case 39: if ( event.ctrlKey || event.metaKey ) {
[708] Fix | Delete
$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
[709] Fix | Delete
}
[710] Fix | Delete
handled = event.ctrlKey || event.metaKey;
[711] Fix | Delete
[712] Fix | Delete
// +1 day on ctrl or command +right
[713] Fix | Delete
if ( event.originalEvent.altKey ) {
[714] Fix | Delete
$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
[715] Fix | Delete
+$.datepicker._get( inst, "stepBigMonths" ) :
[716] Fix | Delete
+$.datepicker._get( inst, "stepMonths" ) ), "M" );
[717] Fix | Delete
}
[718] Fix | Delete
[719] Fix | Delete
// next month/year on alt +right
[720] Fix | Delete
break;
[721] Fix | Delete
case 40: if ( event.ctrlKey || event.metaKey ) {
[722] Fix | Delete
$.datepicker._adjustDate( event.target, +7, "D" );
[723] Fix | Delete
}
[724] Fix | Delete
handled = event.ctrlKey || event.metaKey;
[725] Fix | Delete
break; // +1 week on ctrl or command +down
[726] Fix | Delete
default: handled = false;
[727] Fix | Delete
}
[728] Fix | Delete
} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
[729] Fix | Delete
$.datepicker._showDatepicker( this );
[730] Fix | Delete
} else {
[731] Fix | Delete
handled = false;
[732] Fix | Delete
}
[733] Fix | Delete
[734] Fix | Delete
if ( handled ) {
[735] Fix | Delete
event.preventDefault();
[736] Fix | Delete
event.stopPropagation();
[737] Fix | Delete
}
[738] Fix | Delete
},
[739] Fix | Delete
[740] Fix | Delete
/* Filter entered characters - based on date format. */
[741] Fix | Delete
_doKeyPress: function( event ) {
[742] Fix | Delete
var chars, chr,
[743] Fix | Delete
inst = $.datepicker._getInst( event.target );
[744] Fix | Delete
[745] Fix | Delete
if ( $.datepicker._get( inst, "constrainInput" ) ) {
[746] Fix | Delete
chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
[747] Fix | Delete
chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
[748] Fix | Delete
return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
[749] Fix | Delete
}
[750] Fix | Delete
},
[751] Fix | Delete
[752] Fix | Delete
/* Synchronise manual entry and field/alternate field. */
[753] Fix | Delete
_doKeyUp: function( event ) {
[754] Fix | Delete
var date,
[755] Fix | Delete
inst = $.datepicker._getInst( event.target );
[756] Fix | Delete
[757] Fix | Delete
if ( inst.input.val() !== inst.lastVal ) {
[758] Fix | Delete
try {
[759] Fix | Delete
date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
[760] Fix | Delete
( inst.input ? inst.input.val() : null ),
[761] Fix | Delete
$.datepicker._getFormatConfig( inst ) );
[762] Fix | Delete
[763] Fix | Delete
if ( date ) { // only if valid
[764] Fix | Delete
$.datepicker._setDateFromField( inst );
[765] Fix | Delete
$.datepicker._updateAlternate( inst );
[766] Fix | Delete
$.datepicker._updateDatepicker( inst );
[767] Fix | Delete
}
[768] Fix | Delete
} catch ( err ) {
[769] Fix | Delete
}
[770] Fix | Delete
}
[771] Fix | Delete
return true;
[772] Fix | Delete
},
[773] Fix | Delete
[774] Fix | Delete
/* Pop-up the date picker for a given input field.
[775] Fix | Delete
* If false returned from beforeShow event handler do not show.
[776] Fix | Delete
* @param input element - the input field attached to the date picker or
[777] Fix | Delete
* event - if triggered by focus
[778] Fix | Delete
*/
[779] Fix | Delete
_showDatepicker: function( input ) {
[780] Fix | Delete
input = input.target || input;
[781] Fix | Delete
if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
[782] Fix | Delete
input = $( "input", input.parentNode )[ 0 ];
[783] Fix | Delete
}
[784] Fix | Delete
[785] Fix | Delete
if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
[786] Fix | Delete
return;
[787] Fix | Delete
}
[788] Fix | Delete
[789] Fix | Delete
var inst, beforeShow, beforeShowSettings, isFixed,
[790] Fix | Delete
offset, showAnim, duration;
[791] Fix | Delete
[792] Fix | Delete
inst = $.datepicker._getInst( input );
[793] Fix | Delete
if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
[794] Fix | Delete
$.datepicker._curInst.dpDiv.stop( true, true );
[795] Fix | Delete
if ( inst && $.datepicker._datepickerShowing ) {
[796] Fix | Delete
$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
[797] Fix | Delete
}
[798] Fix | Delete
}
[799] Fix | Delete
[800] Fix | Delete
beforeShow = $.datepicker._get( inst, "beforeShow" );
[801] Fix | Delete
beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
[802] Fix | Delete
if ( beforeShowSettings === false ) {
[803] Fix | Delete
return;
[804] Fix | Delete
}
[805] Fix | Delete
datepicker_extendRemove( inst.settings, beforeShowSettings );
[806] Fix | Delete
[807] Fix | Delete
inst.lastVal = null;
[808] Fix | Delete
$.datepicker._lastInput = input;
[809] Fix | Delete
$.datepicker._setDateFromField( inst );
[810] Fix | Delete
[811] Fix | Delete
if ( $.datepicker._inDialog ) { // hide cursor
[812] Fix | Delete
input.value = "";
[813] Fix | Delete
}
[814] Fix | Delete
if ( !$.datepicker._pos ) { // position below input
[815] Fix | Delete
$.datepicker._pos = $.datepicker._findPos( input );
[816] Fix | Delete
$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
[817] Fix | Delete
}
[818] Fix | Delete
[819] Fix | Delete
isFixed = false;
[820] Fix | Delete
$( input ).parents().each( function() {
[821] Fix | Delete
isFixed |= $( this ).css( "position" ) === "fixed";
[822] Fix | Delete
return !isFixed;
[823] Fix | Delete
} );
[824] Fix | Delete
[825] Fix | Delete
offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
[826] Fix | Delete
$.datepicker._pos = null;
[827] Fix | Delete
[828] Fix | Delete
//to avoid flashes on Firefox
[829] Fix | Delete
inst.dpDiv.empty();
[830] Fix | Delete
[831] Fix | Delete
// determine sizing offscreen
[832] Fix | Delete
inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
[833] Fix | Delete
$.datepicker._updateDatepicker( inst );
[834] Fix | Delete
[835] Fix | Delete
// fix width for dynamic number of date pickers
[836] Fix | Delete
// and adjust position before showing
[837] Fix | Delete
offset = $.datepicker._checkOffset( inst, offset, isFixed );
[838] Fix | Delete
inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
[839] Fix | Delete
"static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
[840] Fix | Delete
left: offset.left + "px", top: offset.top + "px" } );
[841] Fix | Delete
[842] Fix | Delete
if ( !inst.inline ) {
[843] Fix | Delete
showAnim = $.datepicker._get( inst, "showAnim" );
[844] Fix | Delete
duration = $.datepicker._get( inst, "duration" );
[845] Fix | Delete
inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
[846] Fix | Delete
$.datepicker._datepickerShowing = true;
[847] Fix | Delete
[848] Fix | Delete
if ( $.effects && $.effects.effect[ showAnim ] ) {
[849] Fix | Delete
inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
[850] Fix | Delete
} else {
[851] Fix | Delete
inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
[852] Fix | Delete
}
[853] Fix | Delete
[854] Fix | Delete
if ( $.datepicker._shouldFocusInput( inst ) ) {
[855] Fix | Delete
inst.input.trigger( "focus" );
[856] Fix | Delete
}
[857] Fix | Delete
[858] Fix | Delete
$.datepicker._curInst = inst;
[859] Fix | Delete
}
[860] Fix | Delete
},
[861] Fix | Delete
[862] Fix | Delete
/* Generate the date picker content. */
[863] Fix | Delete
_updateDatepicker: function( inst ) {
[864] Fix | Delete
this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
[865] Fix | Delete
datepicker_instActive = inst; // for delegate hover events
[866] Fix | Delete
inst.dpDiv.empty().append( this._generateHTML( inst ) );
[867] Fix | Delete
this._attachHandlers( inst );
[868] Fix | Delete
[869] Fix | Delete
var origyearshtml,
[870] Fix | Delete
numMonths = this._getNumberOfMonths( inst ),
[871] Fix | Delete
cols = numMonths[ 1 ],
[872] Fix | Delete
width = 17,
[873] Fix | Delete
activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ),
[874] Fix | Delete
onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" );
[875] Fix | Delete
[876] Fix | Delete
if ( activeCell.length > 0 ) {
[877] Fix | Delete
datepicker_handleMouseover.apply( activeCell.get( 0 ) );
[878] Fix | Delete
}
[879] Fix | Delete
[880] Fix | Delete
inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
[881] Fix | Delete
if ( cols > 1 ) {
[882] Fix | Delete
inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
[883] Fix | Delete
}
[884] Fix | Delete
inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
[885] Fix | Delete
"Class" ]( "ui-datepicker-multi" );
[886] Fix | Delete
inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
[887] Fix | Delete
"Class" ]( "ui-datepicker-rtl" );
[888] Fix | Delete
[889] Fix | Delete
if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
[890] Fix | Delete
inst.input.trigger( "focus" );
[891] Fix | Delete
}
[892] Fix | Delete
[893] Fix | Delete
// Deffered render of the years select (to avoid flashes on Firefox)
[894] Fix | Delete
if ( inst.yearshtml ) {
[895] Fix | Delete
origyearshtml = inst.yearshtml;
[896] Fix | Delete
setTimeout( function() {
[897] Fix | Delete
[898] Fix | Delete
//assure that inst.yearshtml didn't change.
[899] Fix | Delete
if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
[900] Fix | Delete
inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml );
[901] Fix | Delete
}
[902] Fix | Delete
origyearshtml = inst.yearshtml = null;
[903] Fix | Delete
}, 0 );
[904] Fix | Delete
}
[905] Fix | Delete
[906] Fix | Delete
if ( onUpdateDatepicker ) {
[907] Fix | Delete
onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] );
[908] Fix | Delete
}
[909] Fix | Delete
},
[910] Fix | Delete
[911] Fix | Delete
// #6694 - don't focus the input if it's already focused
[912] Fix | Delete
// this breaks the change event in IE
[913] Fix | Delete
// Support: IE and jQuery <1.9
[914] Fix | Delete
_shouldFocusInput: function( inst ) {
[915] Fix | Delete
return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
[916] Fix | Delete
},
[917] Fix | Delete
[918] Fix | Delete
/* Check positioning to remain on screen. */
[919] Fix | Delete
_checkOffset: function( inst, offset, isFixed ) {
[920] Fix | Delete
var dpWidth = inst.dpDiv.outerWidth(),
[921] Fix | Delete
dpHeight = inst.dpDiv.outerHeight(),
[922] Fix | Delete
inputWidth = inst.input ? inst.input.outerWidth() : 0,
[923] Fix | Delete
inputHeight = inst.input ? inst.input.outerHeight() : 0,
[924] Fix | Delete
viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
[925] Fix | Delete
viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
[926] Fix | Delete
[927] Fix | Delete
offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
[928] Fix | Delete
offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
[929] Fix | Delete
offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
[930] Fix | Delete
[931] Fix | Delete
// Now check if datepicker is showing outside window viewport - move to a better place if so.
[932] Fix | Delete
offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
[933] Fix | Delete
Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
[934] Fix | Delete
offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
[935] Fix | Delete
Math.abs( dpHeight + inputHeight ) : 0 );
[936] Fix | Delete
[937] Fix | Delete
return offset;
[938] Fix | Delete
},
[939] Fix | Delete
[940] Fix | Delete
/* Find an object's position on the screen. */
[941] Fix | Delete
_findPos: function( obj ) {
[942] Fix | Delete
var position,
[943] Fix | Delete
inst = this._getInst( obj ),
[944] Fix | Delete
isRTL = this._get( inst, "isRTL" );
[945] Fix | Delete
[946] Fix | Delete
while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) {
[947] Fix | Delete
obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
[948] Fix | Delete
}
[949] Fix | Delete
[950] Fix | Delete
position = $( obj ).offset();
[951] Fix | Delete
return [ position.left, position.top ];
[952] Fix | Delete
},
[953] Fix | Delete
[954] Fix | Delete
/* Hide the date picker from view.
[955] Fix | Delete
* @param input element - the input field attached to the date picker
[956] Fix | Delete
*/
[957] Fix | Delete
_hideDatepicker: function( input ) {
[958] Fix | Delete
var showAnim, duration, postProcess, onClose,
[959] Fix | Delete
inst = this._curInst;
[960] Fix | Delete
[961] Fix | Delete
if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
[962] Fix | Delete
return;
[963] Fix | Delete
}
[964] Fix | Delete
[965] Fix | Delete
if ( this._datepickerShowing ) {
[966] Fix | Delete
showAnim = this._get( inst, "showAnim" );
[967] Fix | Delete
duration = this._get( inst, "duration" );
[968] Fix | Delete
postProcess = function() {
[969] Fix | Delete
$.datepicker._tidyDialog( inst );
[970] Fix | Delete
};
[971] Fix | Delete
[972] Fix | Delete
// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
[973] Fix | Delete
if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
[974] Fix | Delete
inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
[975] Fix | Delete
} else {
[976] Fix | Delete
inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
[977] Fix | Delete
( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
[978] Fix | Delete
}
[979] Fix | Delete
[980] Fix | Delete
if ( !showAnim ) {
[981] Fix | Delete
postProcess();
[982] Fix | Delete
}
[983] Fix | Delete
this._datepickerShowing = false;
[984] Fix | Delete
[985] Fix | Delete
onClose = this._get( inst, "onClose" );
[986] Fix | Delete
if ( onClose ) {
[987] Fix | Delete
onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
[988] Fix | Delete
}
[989] Fix | Delete
[990] Fix | Delete
this._lastInput = null;
[991] Fix | Delete
if ( this._inDialog ) {
[992] Fix | Delete
this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
[993] Fix | Delete
if ( $.blockUI ) {
[994] Fix | Delete
$.unblockUI();
[995] Fix | Delete
$( "body" ).append( this.dpDiv );
[996] Fix | Delete
}
[997] Fix | Delete
}
[998] Fix | Delete
this._inDialog = false;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function