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
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/jquery/ui
File: datepicker.js
/* eslint-disable max-len, camelcase */
[0] Fix | Delete
/*!
[1] Fix | Delete
* jQuery UI Datepicker 1.13.3
[2] Fix | Delete
* https://jqueryui.com
[3] Fix | Delete
*
[4] Fix | Delete
* Copyright OpenJS Foundation and other contributors
[5] Fix | Delete
* Released under the MIT license.
[6] Fix | Delete
* https://jquery.org/license
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
//>>label: Datepicker
[10] Fix | Delete
//>>group: Widgets
[11] Fix | Delete
//>>description: Displays a calendar from an input or inline for selecting dates.
[12] Fix | Delete
//>>docs: https://api.jqueryui.com/datepicker/
[13] Fix | Delete
//>>demos: https://jqueryui.com/datepicker/
[14] Fix | Delete
//>>css.structure: ../../themes/base/core.css
[15] Fix | Delete
//>>css.structure: ../../themes/base/datepicker.css
[16] Fix | Delete
//>>css.theme: ../../themes/base/theme.css
[17] Fix | Delete
[18] Fix | Delete
( function( factory ) {
[19] Fix | Delete
"use strict";
[20] Fix | Delete
[21] Fix | Delete
if ( typeof define === "function" && define.amd ) {
[22] Fix | Delete
[23] Fix | Delete
// AMD. Register as an anonymous module.
[24] Fix | Delete
define( [
[25] Fix | Delete
"jquery",
[26] Fix | Delete
"../version",
[27] Fix | Delete
"../keycode"
[28] Fix | Delete
], factory );
[29] Fix | Delete
} else {
[30] Fix | Delete
[31] Fix | Delete
// Browser globals
[32] Fix | Delete
factory( jQuery );
[33] Fix | Delete
}
[34] Fix | Delete
} )( function( $ ) {
[35] Fix | Delete
"use strict";
[36] Fix | Delete
[37] Fix | Delete
$.extend( $.ui, { datepicker: { version: "1.13.3" } } );
[38] Fix | Delete
[39] Fix | Delete
var datepicker_instActive;
[40] Fix | Delete
[41] Fix | Delete
function datepicker_getZindex( elem ) {
[42] Fix | Delete
var position, value;
[43] Fix | Delete
while ( elem.length && elem[ 0 ] !== document ) {
[44] Fix | Delete
[45] Fix | Delete
// Ignore z-index if position is set to a value where z-index is ignored by the browser
[46] Fix | Delete
// This makes behavior of this function consistent across browsers
[47] Fix | Delete
// WebKit always returns auto if the element is positioned
[48] Fix | Delete
position = elem.css( "position" );
[49] Fix | Delete
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
[50] Fix | Delete
[51] Fix | Delete
// IE returns 0 when zIndex is not specified
[52] Fix | Delete
// other browsers return a string
[53] Fix | Delete
// we ignore the case of nested elements with an explicit value of 0
[54] Fix | Delete
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
[55] Fix | Delete
value = parseInt( elem.css( "zIndex" ), 10 );
[56] Fix | Delete
if ( !isNaN( value ) && value !== 0 ) {
[57] Fix | Delete
return value;
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
elem = elem.parent();
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
return 0;
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
/* Date picker manager.
[67] Fix | Delete
Use the singleton instance of this class, $.datepicker, to interact with the date picker.
[68] Fix | Delete
Settings for (groups of) date pickers are maintained in an instance object,
[69] Fix | Delete
allowing multiple different settings on the same page. */
[70] Fix | Delete
[71] Fix | Delete
function Datepicker() {
[72] Fix | Delete
this._curInst = null; // The current instance in use
[73] Fix | Delete
this._keyEvent = false; // If the last event was a key event
[74] Fix | Delete
this._disabledInputs = []; // List of date picker inputs that have been disabled
[75] Fix | Delete
this._datepickerShowing = false; // True if the popup picker is showing , false if not
[76] Fix | Delete
this._inDialog = false; // True if showing within a "dialog", false if not
[77] Fix | Delete
this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
[78] Fix | Delete
this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
[79] Fix | Delete
this._appendClass = "ui-datepicker-append"; // The name of the append marker class
[80] Fix | Delete
this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
[81] Fix | Delete
this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
[82] Fix | Delete
this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
[83] Fix | Delete
this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
[84] Fix | Delete
this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
[85] Fix | Delete
this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
[86] Fix | Delete
this.regional = []; // Available regional settings, indexed by language code
[87] Fix | Delete
this.regional[ "" ] = { // Default regional settings
[88] Fix | Delete
closeText: "Done", // Display text for close link
[89] Fix | Delete
prevText: "Prev", // Display text for previous month link
[90] Fix | Delete
nextText: "Next", // Display text for next month link
[91] Fix | Delete
currentText: "Today", // Display text for current month link
[92] Fix | Delete
monthNames: [ "January", "February", "March", "April", "May", "June",
[93] Fix | Delete
"July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting
[94] Fix | Delete
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
[95] Fix | Delete
dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
[96] Fix | Delete
dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
[97] Fix | Delete
dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday
[98] Fix | Delete
weekHeader: "Wk", // Column header for week of the year
[99] Fix | Delete
dateFormat: "mm/dd/yy", // See format options on parseDate
[100] Fix | Delete
firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
[101] Fix | Delete
isRTL: false, // True if right-to-left language, false if left-to-right
[102] Fix | Delete
showMonthAfterYear: false, // True if the year select precedes month, false for month then year
[103] Fix | Delete
yearSuffix: "", // Additional text to append to the year in the month headers,
[104] Fix | Delete
selectMonthLabel: "Select month", // Invisible label for month selector
[105] Fix | Delete
selectYearLabel: "Select year" // Invisible label for year selector
[106] Fix | Delete
};
[107] Fix | Delete
this._defaults = { // Global defaults for all the date picker instances
[108] Fix | Delete
showOn: "focus", // "focus" for popup on focus,
[109] Fix | Delete
// "button" for trigger button, or "both" for either
[110] Fix | Delete
showAnim: "fadeIn", // Name of jQuery animation for popup
[111] Fix | Delete
showOptions: {}, // Options for enhanced animations
[112] Fix | Delete
defaultDate: null, // Used when field is blank: actual date,
[113] Fix | Delete
// +/-number for offset from today, null for today
[114] Fix | Delete
appendText: "", // Display text following the input box, e.g. showing the format
[115] Fix | Delete
buttonText: "...", // Text for trigger button
[116] Fix | Delete
buttonImage: "", // URL for trigger button image
[117] Fix | Delete
buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
[118] Fix | Delete
hideIfNoPrevNext: false, // True to hide next/previous month links
[119] Fix | Delete
// if not applicable, false to just disable them
[120] Fix | Delete
navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
[121] Fix | Delete
gotoCurrent: false, // True if today link goes back to current selection instead
[122] Fix | Delete
changeMonth: false, // True if month can be selected directly, false if only prev/next
[123] Fix | Delete
changeYear: false, // True if year can be selected directly, false if only prev/next
[124] Fix | Delete
yearRange: "c-10:c+10", // Range of years to display in drop-down,
[125] Fix | Delete
// either relative to today's year (-nn:+nn), relative to currently displayed year
[126] Fix | Delete
// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
[127] Fix | Delete
showOtherMonths: false, // True to show dates in other months, false to leave blank
[128] Fix | Delete
selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
[129] Fix | Delete
showWeek: false, // True to show week of the year, false to not show it
[130] Fix | Delete
calculateWeek: this.iso8601Week, // How to calculate the week of the year,
[131] Fix | Delete
// takes a Date and returns the number of the week for it
[132] Fix | Delete
shortYearCutoff: "+10", // Short year values < this are in the current century,
[133] Fix | Delete
// > this are in the previous century,
[134] Fix | Delete
// string value starting with "+" for current year + value
[135] Fix | Delete
minDate: null, // The earliest selectable date, or null for no limit
[136] Fix | Delete
maxDate: null, // The latest selectable date, or null for no limit
[137] Fix | Delete
duration: "fast", // Duration of display/closure
[138] Fix | Delete
beforeShowDay: null, // Function that takes a date and returns an array with
[139] Fix | Delete
// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
[140] Fix | Delete
// [2] = cell title (optional), e.g. $.datepicker.noWeekends
[141] Fix | Delete
beforeShow: null, // Function that takes an input field and
[142] Fix | Delete
// returns a set of custom settings for the date picker
[143] Fix | Delete
onSelect: null, // Define a callback function when a date is selected
[144] Fix | Delete
onChangeMonthYear: null, // Define a callback function when the month or year is changed
[145] Fix | Delete
onClose: null, // Define a callback function when the datepicker is closed
[146] Fix | Delete
onUpdateDatepicker: null, // Define a callback function when the datepicker is updated
[147] Fix | Delete
numberOfMonths: 1, // Number of months to show at a time
[148] Fix | Delete
showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
[149] Fix | Delete
stepMonths: 1, // Number of months to step back/forward
[150] Fix | Delete
stepBigMonths: 12, // Number of months to step back/forward for the big links
[151] Fix | Delete
altField: "", // Selector for an alternate field to store selected dates into
[152] Fix | Delete
altFormat: "", // The date format to use for the alternate field
[153] Fix | Delete
constrainInput: true, // The input is constrained by the current date format
[154] Fix | Delete
showButtonPanel: false, // True to show button panel, false to not show it
[155] Fix | Delete
autoSize: false, // True to size the input for the date format, false to leave as is
[156] Fix | Delete
disabled: false // The initial disabled state
[157] Fix | Delete
};
[158] Fix | Delete
$.extend( this._defaults, this.regional[ "" ] );
[159] Fix | Delete
this.regional.en = $.extend( true, {}, this.regional[ "" ] );
[160] Fix | Delete
this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
[161] Fix | Delete
this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
$.extend( Datepicker.prototype, {
[165] Fix | Delete
[166] Fix | Delete
/* Class name added to elements to indicate already configured with a date picker. */
[167] Fix | Delete
markerClassName: "hasDatepicker",
[168] Fix | Delete
[169] Fix | Delete
//Keep track of the maximum number of rows displayed (see #7043)
[170] Fix | Delete
maxRows: 4,
[171] Fix | Delete
[172] Fix | Delete
// TODO rename to "widget" when switching to widget factory
[173] Fix | Delete
_widgetDatepicker: function() {
[174] Fix | Delete
return this.dpDiv;
[175] Fix | Delete
},
[176] Fix | Delete
[177] Fix | Delete
/* Override the default settings for all instances of the date picker.
[178] Fix | Delete
* @param settings object - the new settings to use as defaults (anonymous object)
[179] Fix | Delete
* @return the manager object
[180] Fix | Delete
*/
[181] Fix | Delete
setDefaults: function( settings ) {
[182] Fix | Delete
datepicker_extendRemove( this._defaults, settings || {} );
[183] Fix | Delete
return this;
[184] Fix | Delete
},
[185] Fix | Delete
[186] Fix | Delete
/* Attach the date picker to a jQuery selection.
[187] Fix | Delete
* @param target element - the target input field or division or span
[188] Fix | Delete
* @param settings object - the new settings to use for this date picker instance (anonymous)
[189] Fix | Delete
*/
[190] Fix | Delete
_attachDatepicker: function( target, settings ) {
[191] Fix | Delete
var nodeName, inline, inst;
[192] Fix | Delete
nodeName = target.nodeName.toLowerCase();
[193] Fix | Delete
inline = ( nodeName === "div" || nodeName === "span" );
[194] Fix | Delete
if ( !target.id ) {
[195] Fix | Delete
this.uuid += 1;
[196] Fix | Delete
target.id = "dp" + this.uuid;
[197] Fix | Delete
}
[198] Fix | Delete
inst = this._newInst( $( target ), inline );
[199] Fix | Delete
inst.settings = $.extend( {}, settings || {} );
[200] Fix | Delete
if ( nodeName === "input" ) {
[201] Fix | Delete
this._connectDatepicker( target, inst );
[202] Fix | Delete
} else if ( inline ) {
[203] Fix | Delete
this._inlineDatepicker( target, inst );
[204] Fix | Delete
}
[205] Fix | Delete
},
[206] Fix | Delete
[207] Fix | Delete
/* Create a new instance object. */
[208] Fix | Delete
_newInst: function( target, inline ) {
[209] Fix | Delete
var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
[210] Fix | Delete
return { id: id, input: target, // associated target
[211] Fix | Delete
selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
[212] Fix | Delete
drawMonth: 0, drawYear: 0, // month being drawn
[213] Fix | Delete
inline: inline, // is datepicker inline or not
[214] Fix | Delete
dpDiv: ( !inline ? this.dpDiv : // presentation div
[215] Fix | Delete
datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
[216] Fix | Delete
},
[217] Fix | Delete
[218] Fix | Delete
/* Attach the date picker to an input field. */
[219] Fix | Delete
_connectDatepicker: function( target, inst ) {
[220] Fix | Delete
var input = $( target );
[221] Fix | Delete
inst.append = $( [] );
[222] Fix | Delete
inst.trigger = $( [] );
[223] Fix | Delete
if ( input.hasClass( this.markerClassName ) ) {
[224] Fix | Delete
return;
[225] Fix | Delete
}
[226] Fix | Delete
this._attachments( input, inst );
[227] Fix | Delete
input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
[228] Fix | Delete
on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
[229] Fix | Delete
this._autoSize( inst );
[230] Fix | Delete
$.data( target, "datepicker", inst );
[231] Fix | Delete
[232] Fix | Delete
//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
[233] Fix | Delete
if ( inst.settings.disabled ) {
[234] Fix | Delete
this._disableDatepicker( target );
[235] Fix | Delete
}
[236] Fix | Delete
},
[237] Fix | Delete
[238] Fix | Delete
/* Make attachments based on settings. */
[239] Fix | Delete
_attachments: function( input, inst ) {
[240] Fix | Delete
var showOn, buttonText, buttonImage,
[241] Fix | Delete
appendText = this._get( inst, "appendText" ),
[242] Fix | Delete
isRTL = this._get( inst, "isRTL" );
[243] Fix | Delete
[244] Fix | Delete
if ( inst.append ) {
[245] Fix | Delete
inst.append.remove();
[246] Fix | Delete
}
[247] Fix | Delete
if ( appendText ) {
[248] Fix | Delete
inst.append = $( "<span>" )
[249] Fix | Delete
.addClass( this._appendClass )
[250] Fix | Delete
.text( appendText );
[251] Fix | Delete
input[ isRTL ? "before" : "after" ]( inst.append );
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
input.off( "focus", this._showDatepicker );
[255] Fix | Delete
[256] Fix | Delete
if ( inst.trigger ) {
[257] Fix | Delete
inst.trigger.remove();
[258] Fix | Delete
}
[259] Fix | Delete
[260] Fix | Delete
showOn = this._get( inst, "showOn" );
[261] Fix | Delete
if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
[262] Fix | Delete
input.on( "focus", this._showDatepicker );
[263] Fix | Delete
}
[264] Fix | Delete
if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
[265] Fix | Delete
buttonText = this._get( inst, "buttonText" );
[266] Fix | Delete
buttonImage = this._get( inst, "buttonImage" );
[267] Fix | Delete
[268] Fix | Delete
if ( this._get( inst, "buttonImageOnly" ) ) {
[269] Fix | Delete
inst.trigger = $( "<img>" )
[270] Fix | Delete
.addClass( this._triggerClass )
[271] Fix | Delete
.attr( {
[272] Fix | Delete
src: buttonImage,
[273] Fix | Delete
alt: buttonText,
[274] Fix | Delete
title: buttonText
[275] Fix | Delete
} );
[276] Fix | Delete
} else {
[277] Fix | Delete
inst.trigger = $( "<button type='button'>" )
[278] Fix | Delete
.addClass( this._triggerClass );
[279] Fix | Delete
if ( buttonImage ) {
[280] Fix | Delete
inst.trigger.html(
[281] Fix | Delete
$( "<img>" )
[282] Fix | Delete
.attr( {
[283] Fix | Delete
src: buttonImage,
[284] Fix | Delete
alt: buttonText,
[285] Fix | Delete
title: buttonText
[286] Fix | Delete
} )
[287] Fix | Delete
);
[288] Fix | Delete
} else {
[289] Fix | Delete
inst.trigger.text( buttonText );
[290] Fix | Delete
}
[291] Fix | Delete
}
[292] Fix | Delete
[293] Fix | Delete
input[ isRTL ? "before" : "after" ]( inst.trigger );
[294] Fix | Delete
inst.trigger.on( "click", function() {
[295] Fix | Delete
if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
[296] Fix | Delete
$.datepicker._hideDatepicker();
[297] Fix | Delete
} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
[298] Fix | Delete
$.datepicker._hideDatepicker();
[299] Fix | Delete
$.datepicker._showDatepicker( input[ 0 ] );
[300] Fix | Delete
} else {
[301] Fix | Delete
$.datepicker._showDatepicker( input[ 0 ] );
[302] Fix | Delete
}
[303] Fix | Delete
return false;
[304] Fix | Delete
} );
[305] Fix | Delete
}
[306] Fix | Delete
},
[307] Fix | Delete
[308] Fix | Delete
/* Apply the maximum length for the date format. */
[309] Fix | Delete
_autoSize: function( inst ) {
[310] Fix | Delete
if ( this._get( inst, "autoSize" ) && !inst.inline ) {
[311] Fix | Delete
var findMax, max, maxI, i,
[312] Fix | Delete
date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
[313] Fix | Delete
dateFormat = this._get( inst, "dateFormat" );
[314] Fix | Delete
[315] Fix | Delete
if ( dateFormat.match( /[DM]/ ) ) {
[316] Fix | Delete
findMax = function( names ) {
[317] Fix | Delete
max = 0;
[318] Fix | Delete
maxI = 0;
[319] Fix | Delete
for ( i = 0; i < names.length; i++ ) {
[320] Fix | Delete
if ( names[ i ].length > max ) {
[321] Fix | Delete
max = names[ i ].length;
[322] Fix | Delete
maxI = i;
[323] Fix | Delete
}
[324] Fix | Delete
}
[325] Fix | Delete
return maxI;
[326] Fix | Delete
};
[327] Fix | Delete
date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
[328] Fix | Delete
"monthNames" : "monthNamesShort" ) ) ) );
[329] Fix | Delete
date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
[330] Fix | Delete
"dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
[331] Fix | Delete
}
[332] Fix | Delete
inst.input.attr( "size", this._formatDate( inst, date ).length );
[333] Fix | Delete
}
[334] Fix | Delete
},
[335] Fix | Delete
[336] Fix | Delete
/* Attach an inline date picker to a div. */
[337] Fix | Delete
_inlineDatepicker: function( target, inst ) {
[338] Fix | Delete
var divSpan = $( target );
[339] Fix | Delete
if ( divSpan.hasClass( this.markerClassName ) ) {
[340] Fix | Delete
return;
[341] Fix | Delete
}
[342] Fix | Delete
divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
[343] Fix | Delete
$.data( target, "datepicker", inst );
[344] Fix | Delete
this._setDate( inst, this._getDefaultDate( inst ), true );
[345] Fix | Delete
this._updateDatepicker( inst );
[346] Fix | Delete
this._updateAlternate( inst );
[347] Fix | Delete
[348] Fix | Delete
//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
[349] Fix | Delete
if ( inst.settings.disabled ) {
[350] Fix | Delete
this._disableDatepicker( target );
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
[354] Fix | Delete
// https://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
[355] Fix | Delete
inst.dpDiv.css( "display", "block" );
[356] Fix | Delete
},
[357] Fix | Delete
[358] Fix | Delete
/* Pop-up the date picker in a "dialog" box.
[359] Fix | Delete
* @param input element - ignored
[360] Fix | Delete
* @param date string or Date - the initial date to display
[361] Fix | Delete
* @param onSelect function - the function to call when a date is selected
[362] Fix | Delete
* @param settings object - update the dialog date picker instance's settings (anonymous object)
[363] Fix | Delete
* @param pos int[2] - coordinates for the dialog's position within the screen or
[364] Fix | Delete
* event - with x/y coordinates or
[365] Fix | Delete
* leave empty for default (screen centre)
[366] Fix | Delete
* @return the manager object
[367] Fix | Delete
*/
[368] Fix | Delete
_dialogDatepicker: function( input, date, onSelect, settings, pos ) {
[369] Fix | Delete
var id, browserWidth, browserHeight, scrollX, scrollY,
[370] Fix | Delete
inst = this._dialogInst; // internal instance
[371] Fix | Delete
[372] Fix | Delete
if ( !inst ) {
[373] Fix | Delete
this.uuid += 1;
[374] Fix | Delete
id = "dp" + this.uuid;
[375] Fix | Delete
this._dialogInput = $( "<input type='text' id='" + id +
[376] Fix | Delete
"' style='position: absolute; top: -100px; width: 0px;'/>" );
[377] Fix | Delete
this._dialogInput.on( "keydown", this._doKeyDown );
[378] Fix | Delete
$( "body" ).append( this._dialogInput );
[379] Fix | Delete
inst = this._dialogInst = this._newInst( this._dialogInput, false );
[380] Fix | Delete
inst.settings = {};
[381] Fix | Delete
$.data( this._dialogInput[ 0 ], "datepicker", inst );
[382] Fix | Delete
}
[383] Fix | Delete
datepicker_extendRemove( inst.settings, settings || {} );
[384] Fix | Delete
date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
[385] Fix | Delete
this._dialogInput.val( date );
[386] Fix | Delete
[387] Fix | Delete
this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
[388] Fix | Delete
if ( !this._pos ) {
[389] Fix | Delete
browserWidth = document.documentElement.clientWidth;
[390] Fix | Delete
browserHeight = document.documentElement.clientHeight;
[391] Fix | Delete
scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
[392] Fix | Delete
scrollY = document.documentElement.scrollTop || document.body.scrollTop;
[393] Fix | Delete
this._pos = // should use actual width/height below
[394] Fix | Delete
[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
// Move input on screen for focus, but hidden behind dialog
[398] Fix | Delete
this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
[399] Fix | Delete
inst.settings.onSelect = onSelect;
[400] Fix | Delete
this._inDialog = true;
[401] Fix | Delete
this.dpDiv.addClass( this._dialogClass );
[402] Fix | Delete
this._showDatepicker( this._dialogInput[ 0 ] );
[403] Fix | Delete
if ( $.blockUI ) {
[404] Fix | Delete
$.blockUI( this.dpDiv );
[405] Fix | Delete
}
[406] Fix | Delete
$.data( this._dialogInput[ 0 ], "datepicker", inst );
[407] Fix | Delete
return this;
[408] Fix | Delete
},
[409] Fix | Delete
[410] Fix | Delete
/* Detach a datepicker from its control.
[411] Fix | Delete
* @param target element - the target input field or division or span
[412] Fix | Delete
*/
[413] Fix | Delete
_destroyDatepicker: function( target ) {
[414] Fix | Delete
var nodeName,
[415] Fix | Delete
$target = $( target ),
[416] Fix | Delete
inst = $.data( target, "datepicker" );
[417] Fix | Delete
[418] Fix | Delete
if ( !$target.hasClass( this.markerClassName ) ) {
[419] Fix | Delete
return;
[420] Fix | Delete
}
[421] Fix | Delete
[422] Fix | Delete
nodeName = target.nodeName.toLowerCase();
[423] Fix | Delete
$.removeData( target, "datepicker" );
[424] Fix | Delete
if ( nodeName === "input" ) {
[425] Fix | Delete
inst.append.remove();
[426] Fix | Delete
inst.trigger.remove();
[427] Fix | Delete
$target.removeClass( this.markerClassName ).
[428] Fix | Delete
off( "focus", this._showDatepicker ).
[429] Fix | Delete
off( "keydown", this._doKeyDown ).
[430] Fix | Delete
off( "keypress", this._doKeyPress ).
[431] Fix | Delete
off( "keyup", this._doKeyUp );
[432] Fix | Delete
} else if ( nodeName === "div" || nodeName === "span" ) {
[433] Fix | Delete
$target.removeClass( this.markerClassName ).empty();
[434] Fix | Delete
}
[435] Fix | Delete
[436] Fix | Delete
if ( datepicker_instActive === inst ) {
[437] Fix | Delete
datepicker_instActive = null;
[438] Fix | Delete
this._curInst = null;
[439] Fix | Delete
}
[440] Fix | Delete
},
[441] Fix | Delete
[442] Fix | Delete
/* Enable the date picker to a jQuery selection.
[443] Fix | Delete
* @param target element - the target input field or division or span
[444] Fix | Delete
*/
[445] Fix | Delete
_enableDatepicker: function( target ) {
[446] Fix | Delete
var nodeName, inline,
[447] Fix | Delete
$target = $( target ),
[448] Fix | Delete
inst = $.data( target, "datepicker" );
[449] Fix | Delete
[450] Fix | Delete
if ( !$target.hasClass( this.markerClassName ) ) {
[451] Fix | Delete
return;
[452] Fix | Delete
}
[453] Fix | Delete
[454] Fix | Delete
nodeName = target.nodeName.toLowerCase();
[455] Fix | Delete
if ( nodeName === "input" ) {
[456] Fix | Delete
target.disabled = false;
[457] Fix | Delete
inst.trigger.filter( "button" ).
[458] Fix | Delete
each( function() {
[459] Fix | Delete
this.disabled = false;
[460] Fix | Delete
} ).end().
[461] Fix | Delete
filter( "img" ).css( { opacity: "1.0", cursor: "" } );
[462] Fix | Delete
} else if ( nodeName === "div" || nodeName === "span" ) {
[463] Fix | Delete
inline = $target.children( "." + this._inlineClass );
[464] Fix | Delete
inline.children().removeClass( "ui-state-disabled" );
[465] Fix | Delete
inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
[466] Fix | Delete
prop( "disabled", false );
[467] Fix | Delete
}
[468] Fix | Delete
this._disabledInputs = $.map( this._disabledInputs,
[469] Fix | Delete
[470] Fix | Delete
// Delete entry
[471] Fix | Delete
function( value ) {
[472] Fix | Delete
return ( value === target ? null : value );
[473] Fix | Delete
} );
[474] Fix | Delete
},
[475] Fix | Delete
[476] Fix | Delete
/* Disable the date picker to a jQuery selection.
[477] Fix | Delete
* @param target element - the target input field or division or span
[478] Fix | Delete
*/
[479] Fix | Delete
_disableDatepicker: function( target ) {
[480] Fix | Delete
var nodeName, inline,
[481] Fix | Delete
$target = $( target ),
[482] Fix | Delete
inst = $.data( target, "datepicker" );
[483] Fix | Delete
[484] Fix | Delete
if ( !$target.hasClass( this.markerClassName ) ) {
[485] Fix | Delete
return;
[486] Fix | Delete
}
[487] Fix | Delete
[488] Fix | Delete
nodeName = target.nodeName.toLowerCase();
[489] Fix | Delete
if ( nodeName === "input" ) {
[490] Fix | Delete
target.disabled = true;
[491] Fix | Delete
inst.trigger.filter( "button" ).
[492] Fix | Delete
each( function() {
[493] Fix | Delete
this.disabled = true;
[494] Fix | Delete
} ).end().
[495] Fix | Delete
filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
[496] Fix | Delete
} else if ( nodeName === "div" || nodeName === "span" ) {
[497] Fix | Delete
inline = $target.children( "." + this._inlineClass );
[498] Fix | Delete
inline.children().addClass( "ui-state-disabled" );
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function