|
16 | 16 | $.extend($.ui, { datepicker: { version: "@VERSION" } }); |
17 | 17 |
|
18 | 18 | var PROP_NAME = 'datepicker'; |
| 19 | +var dpuuid = new Date().getTime(); |
19 | 20 |
|
20 | 21 | /* Date picker manager. |
21 | 22 | Use the singleton instance of this class, $.datepicker, to interact with the date picker. |
@@ -1357,24 +1358,28 @@ $.extend(Datepicker.prototype, { |
1357 | 1358 | this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), |
1358 | 1359 | this._getFormatConfig(inst))); |
1359 | 1360 | var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? |
1360 | | - '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' + |
| 1361 | + '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid + |
| 1362 | + '.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' + |
1361 | 1363 | ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' : |
1362 | 1364 | (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>')); |
1363 | 1365 | var nextText = this._get(inst, 'nextText'); |
1364 | 1366 | nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, |
1365 | 1367 | this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), |
1366 | 1368 | this._getFormatConfig(inst))); |
1367 | 1369 | var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? |
1368 | | - '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' + |
| 1370 | + '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid + |
| 1371 | + '.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' + |
1369 | 1372 | ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' : |
1370 | 1373 | (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>')); |
1371 | 1374 | var currentText = this._get(inst, 'currentText'); |
1372 | 1375 | var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); |
1373 | 1376 | currentText = (!navigationAsDateFormat ? currentText : |
1374 | 1377 | this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); |
1375 | | - var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : ''); |
| 1378 | + var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid + |
| 1379 | + '.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : ''); |
1376 | 1380 | var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') + |
1377 | | - (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' + |
| 1381 | + (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid + |
| 1382 | + '.datepicker._gotoToday(\'#' + inst.id + '\');"' + |
1378 | 1383 | '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : ''; |
1379 | 1384 | var firstDay = parseInt(this._get(inst, 'firstDay'),10); |
1380 | 1385 | firstDay = (isNaN(firstDay) ? 0 : firstDay); |
@@ -1447,7 +1452,7 @@ $.extend(Datepicker.prototype, { |
1447 | 1452 | (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day |
1448 | 1453 | (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) |
1449 | 1454 | ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title |
1450 | | - (unselectable ? '' : ' onclick="DP_jQuery.datepicker._selectDay(\'#' + |
| 1455 | + (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' + |
1451 | 1456 | inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions |
1452 | 1457 | (otherMonth && !showOtherMonths ? ' ' : // display for other months |
1453 | 1458 | (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + |
@@ -1492,8 +1497,8 @@ $.extend(Datepicker.prototype, { |
1492 | 1497 | var inMinYear = (minDate && minDate.getFullYear() == drawYear); |
1493 | 1498 | var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); |
1494 | 1499 | monthHtml += '<select class="ui-datepicker-month" ' + |
1495 | | - 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' + |
1496 | | - 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + |
| 1500 | + 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' + |
| 1501 | + 'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + |
1497 | 1502 | '>'; |
1498 | 1503 | for (var month = 0; month < 12; month++) { |
1499 | 1504 | if ((!inMinYear || month >= minDate.getMonth()) && |
@@ -1524,8 +1529,8 @@ $.extend(Datepicker.prototype, { |
1524 | 1529 | year = (minDate ? Math.max(year, minDate.getFullYear()) : year); |
1525 | 1530 | endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); |
1526 | 1531 | html += '<select class="ui-datepicker-year" ' + |
1527 | | - 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' + |
1528 | | - 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + |
| 1532 | + 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' + |
| 1533 | + 'onclick="DP_jQuery_' + dpuuid + '.datepicker._clickMonthYear(\'#' + inst.id + '\');"' + |
1529 | 1534 | '>'; |
1530 | 1535 | for (; year <= endYear; year++) { |
1531 | 1536 | html += '<option value="' + year + '"' + |
@@ -1685,6 +1690,6 @@ $.datepicker.version = "@VERSION"; |
1685 | 1690 |
|
1686 | 1691 | // Workaround for #4055 |
1687 | 1692 | // Add another global to avoid noConflict issues with inline event handlers |
1688 | | -window.DP_jQuery = $; |
| 1693 | +window['DP_jQuery_' + dpuuid] = $; |
1689 | 1694 |
|
1690 | 1695 | })(jQuery); |
0 commit comments