mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Merge remote-tracking branch 'origin/support/3.2' into develop
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
|
||||
/* Shortened version style */
|
||||
.ui-timepicker-div.ui-timepicker-oneLine { padding-right: 2px; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dt { display: none; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label { display: block; padding-top: 2px; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl { text-align: right; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd > div { display:inline-block; margin:0; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before { content:':'; display:inline-block; }
|
||||
|
||||
File diff suppressed because one or more lines are too long
6
js/jquery-ui-timepicker-addon-i18n.min.js
vendored
6
js/jquery-ui-timepicker-addon-i18n.min.js
vendored
File diff suppressed because one or more lines are too long
426
js/jquery-ui-timepicker-addon.js
vendored
426
js/jquery-ui-timepicker-addon.js
vendored
@@ -1,6 +1,6 @@
|
||||
/*! jQuery Timepicker Addon - v1.6.1 - 2015-11-14
|
||||
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
|
||||
* http://trentrichardson.com/examples/timepicker
|
||||
* Copyright (c) 2015 Trent Richardson; Licensed MIT */
|
||||
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', 'jquery-ui'], factory);
|
||||
@@ -22,11 +22,11 @@
|
||||
*/
|
||||
$.extend($.ui, {
|
||||
timepicker: {
|
||||
version: "1.6.1"
|
||||
version: "1.6.3"
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
/*
|
||||
* Timepicker manager.
|
||||
* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
|
||||
* Settings for (groups of) time pickers are maintained in an instance object,
|
||||
@@ -153,7 +153,7 @@
|
||||
support: {},
|
||||
control: null,
|
||||
|
||||
/*
|
||||
/*
|
||||
* Override the default settings for all instances of the time picker.
|
||||
* @param {Object} settings object - the new settings to use as defaults (anonymous object)
|
||||
* @return {Object} the manager object
|
||||
@@ -226,9 +226,9 @@
|
||||
|
||||
// detect which units are supported
|
||||
tp_inst.support = detectSupport(
|
||||
tp_inst._defaults.timeFormat +
|
||||
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
|
||||
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
|
||||
tp_inst._defaults.timeFormat +
|
||||
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
|
||||
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
|
||||
|
||||
// controlType is string - key to our this._controls
|
||||
if (typeof(tp_inst._defaults.controlType) === 'string') {
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
// prep the timezone options
|
||||
var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
|
||||
0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
|
||||
0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
|
||||
if (tp_inst._defaults.timezoneList !== null) {
|
||||
timezoneList = tp_inst._defaults.timezoneList;
|
||||
}
|
||||
@@ -259,17 +259,17 @@
|
||||
|
||||
// set the default units
|
||||
tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
|
||||
((new Date()).getTimezoneOffset() * -1);
|
||||
((new Date()).getTimezoneOffset() * -1);
|
||||
tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
|
||||
tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
|
||||
tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
|
||||
tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
|
||||
tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
|
||||
tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
|
||||
tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
|
||||
tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
|
||||
tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
|
||||
tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
|
||||
tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
|
||||
tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
|
||||
tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
|
||||
tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
|
||||
tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
|
||||
tp_inst.ampm = '';
|
||||
tp_inst.$input = $input;
|
||||
|
||||
@@ -341,9 +341,9 @@
|
||||
$.extend(this, parseRes.timeObj);
|
||||
} catch (err) {
|
||||
$.timepicker.log("Error parsing the date/time string: " + err +
|
||||
"\ndate/time string = " + timeString +
|
||||
"\ntimeFormat = " + this._defaults.timeFormat +
|
||||
"\ndateFormat = " + dp_dateFormat);
|
||||
"\ndate/time string = " + timeString +
|
||||
"\ntimeFormat = " + this._defaults.timeFormat +
|
||||
"\ndateFormat = " + dp_dateFormat);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -387,7 +387,7 @@
|
||||
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
|
||||
var noDisplay = ' ui_tpicker_unit_hide',
|
||||
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' +
|
||||
'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';
|
||||
'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';
|
||||
|
||||
// Create the markup
|
||||
for (i = 0, l = this.units.length; i < l; i++) {
|
||||
@@ -402,7 +402,7 @@
|
||||
gridSize[litem] = 0;
|
||||
|
||||
html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' +
|
||||
'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';
|
||||
'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';
|
||||
|
||||
if (show && o[litem + 'Grid'] > 0) {
|
||||
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
|
||||
@@ -425,7 +425,7 @@
|
||||
}
|
||||
html += '</dd>';
|
||||
}
|
||||
|
||||
|
||||
// Timezone
|
||||
var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
|
||||
html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>';
|
||||
@@ -440,7 +440,7 @@
|
||||
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
|
||||
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
|
||||
}
|
||||
|
||||
|
||||
// add sliders, adjust grids, add events
|
||||
for (i = 0, l = tp_inst.units.length; i < l; i++) {
|
||||
litem = tp_inst.units[i];
|
||||
@@ -459,42 +459,42 @@
|
||||
marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
|
||||
borderCollapse: 'collapse'
|
||||
}).find("td").click(function (e) {
|
||||
var $t = $(this),
|
||||
h = $t.html(),
|
||||
n = parseInt(h.replace(/[^0-9]/g), 10),
|
||||
ap = h.replace(/[^apm]/ig),
|
||||
f = $t.data('for'); // loses scope, so we use data-for
|
||||
var $t = $(this),
|
||||
h = $t.html(),
|
||||
n = parseInt(h.replace(/[^0-9]/g), 10),
|
||||
ap = h.replace(/[^apm]/ig),
|
||||
f = $t.data('for'); // loses scope, so we use data-for
|
||||
|
||||
if (f === 'hour') {
|
||||
if (ap.indexOf('p') !== -1 && n < 12) {
|
||||
n += 12;
|
||||
}
|
||||
else {
|
||||
if (ap.indexOf('a') !== -1 && n === 12) {
|
||||
n = 0;
|
||||
}
|
||||
if (f === 'hour') {
|
||||
if (ap.indexOf('p') !== -1 && n < 12) {
|
||||
n += 12;
|
||||
}
|
||||
else {
|
||||
if (ap.indexOf('a') !== -1 && n === 12) {
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
|
||||
}
|
||||
|
||||
tp_inst._onTimeChange();
|
||||
tp_inst._onSelectHandler();
|
||||
}).css({
|
||||
cursor: 'pointer',
|
||||
width: (100 / gridSize[litem]) + '%',
|
||||
textAlign: 'center',
|
||||
overflow: 'hidden'
|
||||
});
|
||||
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
|
||||
|
||||
tp_inst._onTimeChange();
|
||||
tp_inst._onSelectHandler();
|
||||
}).css({
|
||||
cursor: 'pointer',
|
||||
width: (100 / gridSize[litem]) + '%',
|
||||
textAlign: 'center',
|
||||
overflow: 'hidden'
|
||||
});
|
||||
} // end if grid > 0
|
||||
} // end for loop
|
||||
|
||||
// Add timezone options
|
||||
this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
|
||||
$.fn.append.apply(this.timezone_select,
|
||||
$.map(o.timezoneList, function (val, idx) {
|
||||
return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
|
||||
}));
|
||||
$.map(o.timezoneList, function (val, idx) {
|
||||
return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
|
||||
}));
|
||||
if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
|
||||
var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
|
||||
if (local_timezone === this.timezone) {
|
||||
@@ -515,7 +515,7 @@
|
||||
tp_inst._afterInject();
|
||||
});
|
||||
// End timezone options
|
||||
|
||||
|
||||
// inject timepicker into datepicker
|
||||
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
|
||||
if ($buttonPanel.length) {
|
||||
@@ -551,7 +551,7 @@
|
||||
var sliderAccessArgs = this._defaults.sliderAccessArgs,
|
||||
rtl = this._defaults.isRTL;
|
||||
sliderAccessArgs.isRTL = rtl;
|
||||
|
||||
|
||||
setTimeout(function () { // fix for inline mode
|
||||
if ($tp.find('.ui-slider-access').length === 0) {
|
||||
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
||||
@@ -703,44 +703,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (dp_inst.settings.minTime!==null) {
|
||||
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
|
||||
if (dp_inst.settings.minTime!==null) {
|
||||
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
|
||||
if (this.hour<tempMinTime.getHours()) {
|
||||
this.hour=this._defaults.hourMin=tempMinTime.getHours();
|
||||
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
|
||||
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
} else {
|
||||
} else {
|
||||
if (this._defaults.hourMin<tempMinTime.getHours()) {
|
||||
this._defaults.hourMin=tempMinTime.getHours();
|
||||
this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
|
||||
this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
this._defaults.minuteMin=tempMinTime.getMinutes();
|
||||
} else {
|
||||
this._defaults.minuteMin=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dp_inst.settings.maxTime!==null) {
|
||||
|
||||
if (dp_inst.settings.maxTime!==null) {
|
||||
var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
|
||||
if (this.hour>tempMaxTime.getHours()) {
|
||||
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
|
||||
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
|
||||
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
|
||||
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
|
||||
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
} else {
|
||||
if (this._defaults.hourMax>tempMaxTime.getHours()) {
|
||||
this._defaults.hourMax=tempMaxTime.getHours();
|
||||
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
|
||||
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
||||
} else {
|
||||
this._defaults.minuteMax=59;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (adjustSliders !== undefined && adjustSliders === true) {
|
||||
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
|
||||
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
|
||||
@@ -778,7 +778,7 @@
|
||||
*/
|
||||
_onTimeChange: function () {
|
||||
if (!this._defaults.showTimepicker) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
|
||||
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
|
||||
@@ -833,14 +833,14 @@
|
||||
// If the update was done in the input field, the input field should not be updated.
|
||||
// If the update was done using the sliders, update the input field.
|
||||
var hasChanged = (
|
||||
hour !== parseInt(this.hour,10) || // sliders should all be numeric
|
||||
minute !== parseInt(this.minute,10) ||
|
||||
second !== parseInt(this.second,10) ||
|
||||
millisec !== parseInt(this.millisec,10) ||
|
||||
microsec !== parseInt(this.microsec,10) ||
|
||||
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
|
||||
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
|
||||
);
|
||||
hour !== parseInt(this.hour,10) || // sliders should all be numeric
|
||||
minute !== parseInt(this.minute,10) ||
|
||||
second !== parseInt(this.second,10) ||
|
||||
millisec !== parseInt(this.millisec,10) ||
|
||||
microsec !== parseInt(this.microsec,10) ||
|
||||
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
|
||||
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
|
||||
);
|
||||
|
||||
if (hasChanged) {
|
||||
|
||||
@@ -876,15 +876,17 @@
|
||||
// Updates the time within the timepicker
|
||||
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
|
||||
if (this.$timeObj) {
|
||||
var sPos = this.$timeObj[0].selectionStart;
|
||||
var ePos = this.$timeObj[0].selectionEnd;
|
||||
if (pickerTimeFormat === o.timeFormat) {
|
||||
this.$timeObj.val(this.formattedTime + pickerTimeSuffix);
|
||||
}
|
||||
else {
|
||||
this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
|
||||
}
|
||||
this.$timeObj[0].setSelectionRange(sPos, ePos);
|
||||
if (this.$timeObj[0].setSelectionRange) {
|
||||
var sPos = this.$timeObj[0].selectionStart;
|
||||
var ePos = this.$timeObj[0].selectionEnd;
|
||||
this.$timeObj[0].setSelectionRange(sPos, ePos);
|
||||
}
|
||||
}
|
||||
|
||||
this.timeDefined = true;
|
||||
@@ -911,9 +913,9 @@
|
||||
*/
|
||||
_updateDateTime: function (dp_inst) {
|
||||
dp_inst = this.inst || dp_inst;
|
||||
var dtTmp = (dp_inst.currentYear > 0?
|
||||
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
|
||||
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
||||
var dtTmp = (dp_inst.currentYear > 0?
|
||||
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
|
||||
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
||||
dt = $.datepicker._daylightSavingAdjust(dtTmp),
|
||||
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
||||
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
|
||||
@@ -922,17 +924,17 @@
|
||||
timeAvailable = dt !== null && this.timeDefined;
|
||||
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
|
||||
var formattedDateTime = this.formattedDate;
|
||||
|
||||
|
||||
// if a slider was changed but datepicker doesn't have a value yet, set it
|
||||
if (dp_inst.lastVal === "") {
|
||||
dp_inst.currentYear = dp_inst.selectedYear;
|
||||
dp_inst.currentMonth = dp_inst.selectedMonth;
|
||||
dp_inst.currentDay = dp_inst.selectedDay;
|
||||
}
|
||||
dp_inst.currentYear = dp_inst.selectedYear;
|
||||
dp_inst.currentMonth = dp_inst.selectedMonth;
|
||||
dp_inst.currentDay = dp_inst.selectedDay;
|
||||
}
|
||||
|
||||
/*
|
||||
* remove following lines to force every changes in date picker to change the input value
|
||||
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
||||
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
||||
* If the user manually empty the value in the input field, the date picker will never change selected value.
|
||||
*/
|
||||
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
|
||||
@@ -957,7 +959,7 @@
|
||||
var altFormattedDateTime = '',
|
||||
altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
|
||||
altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
|
||||
|
||||
|
||||
if (!this._defaults.timeOnly) {
|
||||
if (this._defaults.altFormat) {
|
||||
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
|
||||
@@ -1024,7 +1026,7 @@
|
||||
stop: function (event, ui) {
|
||||
tp_inst._onSelectHandler();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
options: function (tp_inst, obj, unit, opts, val) {
|
||||
if (tp_inst._defaults.isRTL) {
|
||||
@@ -1037,7 +1039,7 @@
|
||||
}
|
||||
return obj.slider(opts);
|
||||
}
|
||||
var min = opts.min,
|
||||
var min = opts.min,
|
||||
max = opts.max;
|
||||
opts.min = opts.max = null;
|
||||
if (min !== undefined) {
|
||||
@@ -1075,7 +1077,6 @@
|
||||
for (var i = min; i <= max; i += step) {
|
||||
sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>';
|
||||
if (unit === 'hour') {
|
||||
format = format.replace(/'.'/g, '');
|
||||
sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults);
|
||||
}
|
||||
else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }
|
||||
@@ -1101,7 +1102,7 @@
|
||||
if (val === undefined) {
|
||||
return $t.data(opts);
|
||||
}
|
||||
o[opts] = val;
|
||||
o[opts] = val;
|
||||
}
|
||||
else { o = opts; }
|
||||
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
|
||||
@@ -1225,28 +1226,28 @@
|
||||
};
|
||||
|
||||
var regstr = '^' + f.toString()
|
||||
.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
|
||||
.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
|
||||
var ml = match.length;
|
||||
switch (match.charAt(0).toLowerCase()) {
|
||||
case 'h':
|
||||
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
||||
case 'm':
|
||||
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
||||
case 's':
|
||||
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
||||
case 'l':
|
||||
return '(\\d?\\d?\\d)';
|
||||
case 'c':
|
||||
return '(\\d?\\d?\\d)';
|
||||
case 'z':
|
||||
return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
|
||||
case 't':
|
||||
return getPatternAmpm(o.amNames, o.pmNames);
|
||||
default: // literal escaped in quotes
|
||||
return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
|
||||
case 'h':
|
||||
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
||||
case 'm':
|
||||
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
||||
case 's':
|
||||
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
||||
case 'l':
|
||||
return '(\\d?\\d?\\d)';
|
||||
case 'c':
|
||||
return '(\\d?\\d?\\d)';
|
||||
case 'z':
|
||||
return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
|
||||
case 't':
|
||||
return getPatternAmpm(o.amNames, o.pmNames);
|
||||
default: // literal escaped in quotes
|
||||
return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
|
||||
}
|
||||
})
|
||||
.replace(/\s/g, '\\s?') +
|
||||
.replace(/\s/g, '\\s?') +
|
||||
o.timeSuffix + '$',
|
||||
order = getFormatPositions(f),
|
||||
ampm = '',
|
||||
@@ -1336,11 +1337,11 @@
|
||||
}
|
||||
catch (err2) {
|
||||
$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}; // end looseParse
|
||||
|
||||
|
||||
if (typeof o.parse === "function") {
|
||||
return o.parse(timeFormat, timeString, o);
|
||||
}
|
||||
@@ -1379,40 +1380,40 @@
|
||||
|
||||
tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
|
||||
switch (match) {
|
||||
case 'HH':
|
||||
return ('0' + hour).slice(-2);
|
||||
case 'H':
|
||||
return hour;
|
||||
case 'hh':
|
||||
return ('0' + convert24to12(hour)).slice(-2);
|
||||
case 'h':
|
||||
return convert24to12(hour);
|
||||
case 'mm':
|
||||
return ('0' + time.minute).slice(-2);
|
||||
case 'm':
|
||||
return time.minute;
|
||||
case 'ss':
|
||||
return ('0' + time.second).slice(-2);
|
||||
case 's':
|
||||
return time.second;
|
||||
case 'l':
|
||||
return ('00' + time.millisec).slice(-3);
|
||||
case 'c':
|
||||
return ('00' + time.microsec).slice(-3);
|
||||
case 'z':
|
||||
return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
|
||||
case 'Z':
|
||||
return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
|
||||
case 'T':
|
||||
return ampmName.charAt(0).toUpperCase();
|
||||
case 'TT':
|
||||
return ampmName.toUpperCase();
|
||||
case 't':
|
||||
return ampmName.charAt(0).toLowerCase();
|
||||
case 'tt':
|
||||
return ampmName.toLowerCase();
|
||||
default:
|
||||
return match.replace(/'/g, "");
|
||||
case 'HH':
|
||||
return ('0' + hour).slice(-2);
|
||||
case 'H':
|
||||
return hour;
|
||||
case 'hh':
|
||||
return ('0' + convert24to12(hour)).slice(-2);
|
||||
case 'h':
|
||||
return convert24to12(hour);
|
||||
case 'mm':
|
||||
return ('0' + time.minute).slice(-2);
|
||||
case 'm':
|
||||
return time.minute;
|
||||
case 'ss':
|
||||
return ('0' + time.second).slice(-2);
|
||||
case 's':
|
||||
return time.second;
|
||||
case 'l':
|
||||
return ('00' + time.millisec).slice(-3);
|
||||
case 'c':
|
||||
return ('00' + time.microsec).slice(-3);
|
||||
case 'z':
|
||||
return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
|
||||
case 'Z':
|
||||
return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
|
||||
case 'T':
|
||||
return ampmName.charAt(0).toUpperCase();
|
||||
case 'TT':
|
||||
return ampmName.toUpperCase();
|
||||
case 't':
|
||||
return ampmName.charAt(0).toLowerCase();
|
||||
case 'tt':
|
||||
return ampmName.toLowerCase();
|
||||
default:
|
||||
return match.replace(/'/g, "");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1483,18 +1484,18 @@
|
||||
tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
|
||||
dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
|
||||
datetimeChars = tp_inst._defaults.timeFormat.toString()
|
||||
.replace(/[hms]/g, '')
|
||||
.replace(/TT/g, ampm ? 'APM' : '')
|
||||
.replace(/Tt/g, ampm ? 'AaPpMm' : '')
|
||||
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
||||
.replace(/T/g, ampm ? 'AP' : '')
|
||||
.replace(/tt/g, ampm ? 'apm' : '')
|
||||
.replace(/t/g, ampm ? 'ap' : '') +
|
||||
" " + tp_inst._defaults.separator +
|
||||
tp_inst._defaults.timeSuffix +
|
||||
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
||||
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
||||
dateChars,
|
||||
.replace(/[hms]/g, '')
|
||||
.replace(/TT/g, ampm ? 'APM' : '')
|
||||
.replace(/Tt/g, ampm ? 'AaPpMm' : '')
|
||||
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
||||
.replace(/T/g, ampm ? 'AP' : '')
|
||||
.replace(/tt/g, ampm ? 'apm' : '')
|
||||
.replace(/t/g, ampm ? 'ap' : '') +
|
||||
" " + tp_inst._defaults.separator +
|
||||
tp_inst._defaults.timeSuffix +
|
||||
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
||||
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
||||
dateChars,
|
||||
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
|
||||
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
||||
}
|
||||
@@ -1516,11 +1517,11 @@
|
||||
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
|
||||
date = this._getDate(inst),
|
||||
formatCfg = $.datepicker._getFormatConfig(inst),
|
||||
altFormattedDateTime = '',
|
||||
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
||||
altFormattedDateTime = '',
|
||||
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
||||
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
|
||||
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
|
||||
|
||||
|
||||
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
|
||||
if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
|
||||
if (tp_inst._defaults.altFormat) {
|
||||
@@ -1534,7 +1535,7 @@
|
||||
}
|
||||
}
|
||||
else {
|
||||
$.datepicker._base_updateAlternate(inst);
|
||||
$.datepicker._base_updateAlternate(inst);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1567,14 +1568,13 @@
|
||||
var inst = this._getInst($(id)[0]);
|
||||
this._base_gotoToday(id);
|
||||
var tp_inst = this._get(inst, 'timepicker');
|
||||
if (!tp_inst) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);
|
||||
var now = new Date();
|
||||
if (typeof tzoffset == 'string')
|
||||
{
|
||||
tzoffset = parseInt(tzoffset, 10);
|
||||
}
|
||||
console.log(tzoffset, now.getTimezoneOffset(), now);
|
||||
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + tzoffset);
|
||||
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));
|
||||
this._setTime(inst, now);
|
||||
this._setDate(inst, now);
|
||||
tp_inst._onSelectHandler();
|
||||
@@ -1629,7 +1629,7 @@
|
||||
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
|
||||
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
|
||||
|
||||
//check if within min/max times..
|
||||
//check if within min/max times..
|
||||
tp_inst._limitMinMaxDateTime(inst, true);
|
||||
|
||||
tp_inst._onTimeChange();
|
||||
@@ -1697,9 +1697,9 @@
|
||||
} else {
|
||||
tp_date = date;
|
||||
}
|
||||
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
// adjust it accordingly. If not using timezone option this won't matter..
|
||||
// If a timezone is different in tp, keep the timezone as is
|
||||
if (tp_inst && tp_date) {
|
||||
@@ -1707,8 +1707,8 @@
|
||||
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
||||
tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
|
||||
}
|
||||
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
|
||||
tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
|
||||
date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);
|
||||
tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone);
|
||||
}
|
||||
|
||||
this._updateDatepicker(inst);
|
||||
@@ -1735,20 +1735,39 @@
|
||||
}
|
||||
|
||||
var date = this._getDate(inst);
|
||||
var currDT = $.trim((tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) ? tp_inst.$input.val() + ' ' + tp_inst.$altInput.val() : tp_inst.$input.val());
|
||||
|
||||
var currDT = null;
|
||||
|
||||
if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {
|
||||
currDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val();
|
||||
}
|
||||
else if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) {
|
||||
/**
|
||||
* in case the datetimepicker has been applied to a non-input tag for inline UI,
|
||||
* and the user has not configured the plugin to display only time in altInput,
|
||||
* pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
|
||||
*
|
||||
* @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values
|
||||
*/
|
||||
currDT = tp_inst.$altInput.val();
|
||||
}
|
||||
else {
|
||||
currDT = tp_inst.$input.val();
|
||||
}
|
||||
|
||||
if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {
|
||||
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
||||
date.setMicroseconds(tp_inst.microsec);
|
||||
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
// adjust it accordingly. If not using timezone option this won't matter..
|
||||
if (tp_inst.timezone != null) {
|
||||
// look out for DST if tz wasn't specified
|
||||
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
||||
tp_inst.timezone = date.getTimezoneOffset() * -1;
|
||||
}
|
||||
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
|
||||
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()));
|
||||
}
|
||||
}
|
||||
return date;
|
||||
@@ -1872,8 +1891,8 @@
|
||||
tp_inst._defaults.onSelect = onselect;
|
||||
}
|
||||
|
||||
// Datepicker will override our date when we call _base_optionDatepicker when
|
||||
// calling minDate/maxDate, so we will first grab the value, call
|
||||
// Datepicker will override our date when we call _base_optionDatepicker when
|
||||
// calling minDate/maxDate, so we will first grab the value, call
|
||||
// _base_optionDatepicker, then set our value back.
|
||||
if(min || max){
|
||||
$target = $(target);
|
||||
@@ -1888,7 +1907,7 @@
|
||||
}
|
||||
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
|
||||
* it will return false for all objects
|
||||
@@ -1923,18 +1942,18 @@
|
||||
var detectSupport = function (timeFormat) {
|
||||
var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
|
||||
isIn = function (f, t) { // does the format contain the token?
|
||||
return f.indexOf(t) !== -1 ? true : false;
|
||||
};
|
||||
return {
|
||||
hour: isIn(tf, 'h'),
|
||||
minute: isIn(tf, 'm'),
|
||||
second: isIn(tf, 's'),
|
||||
millisec: isIn(tf, 'l'),
|
||||
microsec: isIn(tf, 'c'),
|
||||
timezone: isIn(tf, 'z'),
|
||||
ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
|
||||
iso8601: isIn(timeFormat, 'Z')
|
||||
return f.indexOf(t) !== -1 ? true : false;
|
||||
};
|
||||
return {
|
||||
hour: isIn(tf, 'h'),
|
||||
minute: isIn(tf, 'm'),
|
||||
second: isIn(tf, 's'),
|
||||
millisec: isIn(tf, 'l'),
|
||||
microsec: isIn(tf, 'c'),
|
||||
timezone: isIn(tf, 'z'),
|
||||
ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
|
||||
iso8601: isIn(timeFormat, 'Z')
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -2046,7 +2065,7 @@
|
||||
hours = (off - minutes) / 60,
|
||||
iso = iso8601 ? ':' : '',
|
||||
tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
|
||||
|
||||
|
||||
if (tz === '+00:00') {
|
||||
return 'Z';
|
||||
}
|
||||
@@ -2066,24 +2085,26 @@
|
||||
}
|
||||
|
||||
if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
|
||||
return tzString;
|
||||
return parseInt(tzString, 10);
|
||||
}
|
||||
|
||||
return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
|
||||
((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
|
||||
parseInt(normalized.substr(3, 2), 10))); // minutes
|
||||
((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
|
||||
parseInt(normalized.substr(3, 2), 10))); // minutes
|
||||
};
|
||||
|
||||
/**
|
||||
* No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
|
||||
* @param {Date} date
|
||||
* @param {string} fromTimezone formatted like "+0500", "-1245"
|
||||
* @param {string} toTimezone formatted like "+0500", "-1245"
|
||||
* @return {Date}
|
||||
*/
|
||||
$.timepicker.timezoneAdjust = function (date, toTimezone) {
|
||||
$.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) {
|
||||
var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);
|
||||
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
|
||||
if (!isNaN(toTz)) {
|
||||
date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
|
||||
date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz));
|
||||
}
|
||||
return date;
|
||||
};
|
||||
@@ -2190,7 +2211,7 @@
|
||||
date.setMilliseconds(date.getMilliseconds() - options.minInterval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (date.getTime) {
|
||||
other[method].call(other, 'option', option, date);
|
||||
}
|
||||
@@ -2216,7 +2237,7 @@
|
||||
}, options, options.end));
|
||||
|
||||
checkDates(startTime, endTime);
|
||||
|
||||
|
||||
selected(startTime, endTime, 'minDate');
|
||||
selected(endTime, startTime, 'maxDate');
|
||||
|
||||
@@ -2229,7 +2250,8 @@
|
||||
* @return {void}
|
||||
*/
|
||||
$.timepicker.log = function () {
|
||||
if (window.console) {
|
||||
// Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first.
|
||||
if (window.console && window.console.log && window.console.log.apply) {
|
||||
window.console.log.apply(window.console, Array.prototype.slice.call(arguments));
|
||||
}
|
||||
};
|
||||
@@ -2264,6 +2286,6 @@
|
||||
/*
|
||||
* Keep up with the version
|
||||
*/
|
||||
$.timepicker.version = "1.6.1";
|
||||
$.timepicker.version = "1.6.3";
|
||||
|
||||
}));
|
||||
|
||||
8
js/jquery-ui-timepicker-addon.min.js
vendored
8
js/jquery-ui-timepicker-addon.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
* jQuery blockUI plugin
|
||||
* Version 2.59.0-2013.04.05
|
||||
* @requires jQuery v1.7 or later
|
||||
* Version 2.70.0-2014.11.23
|
||||
* Requires jQuery v1.7 or later
|
||||
*
|
||||
* Examples at: http://malsup.com/jquery/block/
|
||||
* Copyright (c) 2007-2013 M. Alsup
|
||||
@@ -13,8 +13,8 @@
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
/*jshint eqeqeq:false curly:false latedef:false */
|
||||
"use strict";
|
||||
/*jshint eqeqeq:false curly:false latedef:false */
|
||||
"use strict";
|
||||
|
||||
function setup($) {
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
@@ -22,7 +22,7 @@
|
||||
var noOp = $.noop || function() {};
|
||||
|
||||
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
|
||||
// retarded userAgent strings on Vista)
|
||||
// confusing userAgent strings on Vista)
|
||||
var msie = /MSIE/.test(navigator.userAgent);
|
||||
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
|
||||
var mode = document.documentMode || 0;
|
||||
@@ -38,12 +38,38 @@
|
||||
if (title) $m.append('<h1>'+title+'</h1>');
|
||||
if (message) $m.append('<h2>'+message+'</h2>');
|
||||
if (timeout === undefined) timeout = 3000;
|
||||
$.blockUI({
|
||||
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
|
||||
timeout: timeout, showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
|
||||
// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
|
||||
var callBlock = function(opts) {
|
||||
opts = opts || {};
|
||||
|
||||
$.blockUI({
|
||||
message: $m,
|
||||
fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
|
||||
fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
|
||||
timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
|
||||
centerY: false,
|
||||
showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
||||
callBlock();
|
||||
var nonmousedOpacity = $m.css('opacity');
|
||||
$m.mouseover(function() {
|
||||
callBlock({
|
||||
fadeIn: 0,
|
||||
timeout: 30000
|
||||
});
|
||||
|
||||
var displayBlock = $('.blockMsg');
|
||||
displayBlock.stop(); // cancel fadeout if it has started
|
||||
displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
|
||||
}).mouseout(function() {
|
||||
$('.blockMsg').fadeOut(1000);
|
||||
});
|
||||
// End konapun additions
|
||||
};
|
||||
|
||||
// plugin method for blocking element content
|
||||
@@ -81,7 +107,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
$.blockUI.version = 2.59; // 2nd generation blocking at no extra cost!
|
||||
$.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!
|
||||
|
||||
// override these in your code to change the default behavior and style
|
||||
$.blockUI.defaults = {
|
||||
@@ -186,6 +212,9 @@
|
||||
// page blocking
|
||||
focusInput: true,
|
||||
|
||||
// elements that can receive focus
|
||||
focusableElements: ':input:enabled:visible',
|
||||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
// no longer needed in 2012
|
||||
// applyPlatformOpacityRules: true,
|
||||
@@ -231,8 +260,6 @@
|
||||
css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
|
||||
if (opts.onOverlayClick)
|
||||
opts.overlayCSS.cursor = 'pointer';
|
||||
if (opts.enableValidation)
|
||||
opts.overlayCSS.cursor = 'not-allowed';
|
||||
|
||||
themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
|
||||
msg = msg === undefined ? opts.message : msg;
|
||||
@@ -286,7 +313,7 @@
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
@@ -294,12 +321,7 @@
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
else {
|
||||
if (opts.enableValidation) {
|
||||
s = '<div class="blockUI blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
else{
|
||||
s = '<div class="blockUI '+opts.blockMsgClass+' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
lyr3 = $(s);
|
||||
|
||||
@@ -404,7 +426,7 @@
|
||||
if (msg)
|
||||
lyr3.show();
|
||||
if (opts.onBlock)
|
||||
opts.onBlock();
|
||||
opts.onBlock.bind(lyr3)();
|
||||
}
|
||||
|
||||
// bind key and mouse events
|
||||
@@ -412,7 +434,7 @@
|
||||
|
||||
if (full) {
|
||||
pageBlock = lyr3[0];
|
||||
pageBlockEls = $(':input:enabled:visible',pageBlock);
|
||||
pageBlockEls = $(opts.focusableElements,pageBlock);
|
||||
if (opts.focusInput)
|
||||
setTimeout(focus, 20);
|
||||
}
|
||||
@@ -469,7 +491,7 @@
|
||||
|
||||
if (opts.fadeOut) {
|
||||
count = els.length;
|
||||
els.fadeOut(opts.fadeOut, function() {
|
||||
els.stop().fadeOut(opts.fadeOut, function() {
|
||||
if ( --count === 0)
|
||||
reset(els,data,opts,el);
|
||||
});
|
||||
@@ -481,6 +503,9 @@
|
||||
// move blocking element back into the DOM where it started
|
||||
function reset(els,data,opts,el) {
|
||||
var $el = $(el);
|
||||
if ( $el.data('blockUI.isBlocked') )
|
||||
return;
|
||||
|
||||
els.each(function(i,o) {
|
||||
// remove via DOM calls so we don't lose event handlers
|
||||
if (this.parentNode)
|
||||
@@ -490,6 +515,7 @@
|
||||
if (data && data.el) {
|
||||
data.el.style.display = data.display;
|
||||
data.el.style.position = data.position;
|
||||
data.el.style.cursor = 'default'; // #59
|
||||
if (data.parent)
|
||||
data.parent.appendChild(data.el);
|
||||
$el.removeData('blockUI.history');
|
||||
@@ -529,15 +555,15 @@
|
||||
else
|
||||
$(document).unbind(events, handler);
|
||||
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
}
|
||||
|
||||
// event handler to suppress keyboard/mouse events when blocking
|
||||
function handler(e) {
|
||||
// allow tab navigation (conditionally)
|
||||
if (e.keyCode && e.keyCode == 9) {
|
||||
if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
|
||||
if (pageBlock && e.data.constrainTabKey) {
|
||||
var els = pageBlockEls;
|
||||
var fwd = !e.shiftKey && e.target === els[els.length-1];
|
||||
@@ -551,7 +577,7 @@
|
||||
var opts = e.data;
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
|
||||
opts.onOverlayClick();
|
||||
opts.onOverlayClick(e);
|
||||
|
||||
// allow events within the message content
|
||||
if (target.parents('div.' + opts.blockMsgClass).length > 0)
|
||||
|
||||
14
js/raphael-min.js
vendored
14
js/raphael-min.js
vendored
File diff suppressed because one or more lines are too long
2729
js/selectize.js
2729
js/selectize.js
File diff suppressed because it is too large
Load Diff
1056
js/selectize.min.js
vendored
1056
js/selectize.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user