Version Description
Cette version est stable / This version is stable
=
Download this release
Release Info
Developer | Florent73 |
Plugin | WP Maintenance |
Version | 2.7.1 |
Comparing to | |
See all releases |
Code changes from version 2.7.0 to 2.7.1
- images/schedule_clock.png +0 -0
- js/jquery-ui-timepicker-addon.js +2263 -0
- jquery.sortable.js → js/jquery.sortable.js +0 -0
- js/jquery.ui.datepicker-fr.js +26 -0
- js/lib/compressed/legacy.js +10 -0
- js/lib/compressed/picker.date.js +5 -0
- js/lib/compressed/picker.js +7 -0
- js/lib/compressed/picker.time.js +5 -0
- js/lib/compressed/themes/classic.css +4 -0
- js/lib/compressed/themes/classic.date.css +1 -0
- js/lib/compressed/themes/classic.time.css +1 -0
- js/lib/compressed/themes/default.css +4 -0
- js/lib/compressed/themes/default.date.css +1 -0
- js/lib/compressed/themes/default.time.css +1 -0
- js/lib/compressed/themes/rtl.css +3 -0
- js/lib/compressed/translations/ar.js +1 -0
- js/lib/compressed/translations/bg_BG.js +1 -0
- js/lib/compressed/translations/bs_BA.js +1 -0
- js/lib/compressed/translations/ca_ES.js +1 -0
- js/lib/compressed/translations/cs_CZ.js +1 -0
- js/lib/compressed/translations/da_DK.js +1 -0
- js/lib/compressed/translations/de_DE.js +1 -0
- js/lib/compressed/translations/el_GR.js +1 -0
- js/lib/compressed/translations/es_ES.js +1 -0
- js/lib/compressed/translations/et_EE.js +1 -0
- js/lib/compressed/translations/eu_ES.js +1 -0
- js/lib/compressed/translations/fa_IR.js +1 -0
- js/lib/compressed/translations/fi_FI.js +1 -0
- js/lib/compressed/translations/fr_FR.js +1 -0
- js/lib/compressed/translations/gl_ES.js +1 -0
- js/lib/compressed/translations/he_IL.js +1 -0
- js/lib/compressed/translations/hi_IN.js +1 -0
- js/lib/compressed/translations/hr_HR.js +1 -0
- js/lib/compressed/translations/hu_HU.js +1 -0
- js/lib/compressed/translations/id_ID.js +1 -0
- js/lib/compressed/translations/is_IS.js +1 -0
- js/lib/compressed/translations/it_IT.js +1 -0
- js/lib/compressed/translations/ja_JP.js +1 -0
- js/lib/compressed/translations/ko_KR.js +1 -0
- js/lib/compressed/translations/lt_LT.js +1 -0
- js/lib/compressed/translations/lv_LV.js +1 -0
- js/lib/compressed/translations/nb_NO.js +1 -0
- js/lib/compressed/translations/ne_NP.js +1 -0
- js/lib/compressed/translations/nl_NL.js +1 -0
- js/lib/compressed/translations/no_NO.js +1 -0
- js/lib/compressed/translations/pl_PL.js +1 -0
- js/lib/compressed/translations/pt_BR.js +1 -0
- js/lib/compressed/translations/pt_PT.js +1 -0
- js/lib/compressed/translations/ro_RO.js +1 -0
- js/lib/compressed/translations/ru_RU.js +1 -0
- js/lib/compressed/translations/sk_SK.js +1 -0
- js/lib/compressed/translations/sl_SI.js +1 -0
- js/lib/compressed/translations/sv_SE.js +1 -0
- js/lib/compressed/translations/th_TH.js +1 -0
- js/lib/compressed/translations/tr_TR.js +1 -0
- js/lib/compressed/translations/uk_UA.js +1 -0
- js/lib/compressed/translations/vi_VN.js +1 -0
- js/lib/compressed/translations/zh_CN.js +1 -0
- js/lib/compressed/translations/zh_TW.js +1 -0
- js/lib/jquery.1.7.0.js +9300 -0
- js/lib/legacy.js +133 -0
- js/lib/picker.date.js +1354 -0
- js/lib/picker.js +1163 -0
- js/lib/picker.time.js +1013 -0
- js/lib/themes-source/_variables.less +171 -0
- js/lib/themes-source/base.date.less +333 -0
- js/lib/themes-source/base.less +55 -0
- js/lib/themes-source/base.time.less +119 -0
- js/lib/themes-source/classic.date.less +9 -0
- js/lib/themes-source/classic.less +103 -0
- js/lib/themes-source/classic.time.less +49 -0
- js/lib/themes-source/default.date.less +9 -0
- js/lib/themes-source/default.less +192 -0
- js/lib/themes-source/default.time.less +41 -0
- js/lib/themes-source/rtl.less +38 -0
- js/lib/themes/classic.css +99 -0
- js/lib/themes/classic.date.css +301 -0
- js/lib/themes/classic.time.css +132 -0
- js/lib/themes/default.css +168 -0
- js/lib/themes/default.date.css +301 -0
- js/lib/themes/default.time.css +126 -0
- js/lib/themes/rtl.css +29 -0
- js/lib/translations/FORMATTING.md +7 -0
- js/lib/translations/NAMING.md +21 -0
- js/lib/translations/ar.js +16 -0
- js/lib/translations/bg_BG.js +17 -0
- js/lib/translations/bs_BA.js +17 -0
- js/lib/translations/ca_ES.js +18 -0
- js/lib/translations/cs_CZ.js +17 -0
- js/lib/translations/da_DK.js +18 -0
- js/lib/translations/de_DE.js +18 -0
- js/lib/translations/el_GR.js +17 -0
- js/lib/translations/es_ES.js +18 -0
- js/lib/translations/et_EE.js +17 -0
- js/lib/translations/eu_ES.js +17 -0
- js/lib/translations/fa_ir.js +19 -0
- js/lib/translations/fi_FI.js +17 -0
- js/lib/translations/fr_FR.js +22 -0
- js/lib/translations/gl_ES.js +17 -0
- js/lib/translations/he_IL.js +16 -0
- js/lib/translations/hi_IN.js +20 -0
- js/lib/translations/hr_HR.js +17 -0
- js/lib/translations/hu_HU.js +17 -0
- js/lib/translations/id_ID.js +17 -0
- js/lib/translations/is_IS.js +17 -0
- js/lib/translations/it_IT.js +24 -0
- js/lib/translations/ja_JP.js +17 -0
- js/lib/translations/ko_KR.js +17 -0
- js/lib/translations/lt_LT.js +24 -0
- js/lib/translations/lv_LV.js +13 -0
- js/lib/translations/nb_NO.js +18 -0
- js/lib/translations/ne_NP.js +17 -0
- js/lib/translations/nl_NL.js +18 -0
- js/lib/translations/pl_PL.js +18 -0
- js/lib/translations/pt_BR.js +17 -0
- js/lib/translations/pt_PT.js +17 -0
- js/lib/translations/ro_RO.js +17 -0
- js/lib/translations/ru_RU.js +18 -0
- js/lib/translations/sk_SK.js +18 -0
- js/lib/translations/sl_SI.js +18 -0
- js/lib/translations/sv_SE.js +22 -0
- js/lib/translations/th_TH.js +16 -0
- js/lib/translations/tr_TR.js +18 -0
- js/lib/translations/uk_UA.js +17 -0
- js/lib/translations/vi_VN.js +15 -0
- js/lib/translations/zh_CN.js +18 -0
- js/lib/translations/zh_TW.js +18 -0
- wpm-admin-settings.js → js/wpm-admin-settings.js +0 -0
- wpm-color-options.js → js/wpm-color-options.js +0 -0
- wpm-cpt-script.js → js/wpm-cpt-script.js +0 -0
- js/wpm-footer-scripts.js +27 -0
- wpm-script.js → js/wpm-script.js +0 -0
- languages/wp-maintenance-fr_FR.mo +0 -0
- languages/wp-maintenance-fr_FR.po +84 -53
- languages/wp-maintenance.pot +79 -51
- readme.txt +7 -4
- wp-maintenance-admin.php +78 -36
- wp-maintenance.php +61 -13
images/schedule_clock.png
ADDED
Binary file
|
js/jquery-ui-timepicker-addon.js
ADDED
@@ -0,0 +1,2263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery Timepicker Addon - v1.6.1 - 2015-11-14
|
2 |
+
* http://trentrichardson.com/examples/timepicker
|
3 |
+
* Copyright (c) 2015 Trent Richardson; Licensed MIT */
|
4 |
+
(function (factory) {
|
5 |
+
if (typeof define === 'function' && define.amd) {
|
6 |
+
define(['jquery', 'jquery-ui'], factory);
|
7 |
+
} else {
|
8 |
+
//factory(jQuery);
|
9 |
+
}
|
10 |
+
}(jQuery(document).ready(function($){
|
11 |
+
|
12 |
+
/*
|
13 |
+
* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
|
14 |
+
*/
|
15 |
+
$.ui.timepicker = $.ui.timepicker || {};
|
16 |
+
if ($.ui.timepicker.version) {
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
/*
|
21 |
+
* Extend jQueryUI, get it started with our version number
|
22 |
+
*/
|
23 |
+
$.extend($.ui, {
|
24 |
+
timepicker: {
|
25 |
+
version: "1.6.1"
|
26 |
+
}
|
27 |
+
});
|
28 |
+
|
29 |
+
/*
|
30 |
+
* Timepicker manager.
|
31 |
+
* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
|
32 |
+
* Settings for (groups of) time pickers are maintained in an instance object,
|
33 |
+
* allowing multiple different settings on the same page.
|
34 |
+
*/
|
35 |
+
var Timepicker = function () {
|
36 |
+
this.regional = []; // Available regional settings, indexed by language code
|
37 |
+
this.regional[''] = { // Default regional settings
|
38 |
+
currentText: 'Auj.',
|
39 |
+
closeText: 'Valider',
|
40 |
+
amNames: ['AM', 'A'],
|
41 |
+
pmNames: ['PM', 'P'],
|
42 |
+
timeFormat: 'HH:mm',
|
43 |
+
timeSuffix: '',
|
44 |
+
timeOnlyTitle: 'Choisir heure',
|
45 |
+
timeText: 'Heure',
|
46 |
+
hourText: 'Hour',
|
47 |
+
minuteText: 'Minute',
|
48 |
+
secondText: 'Second',
|
49 |
+
millisecText: 'Millisecond',
|
50 |
+
microsecText: 'Microsecond',
|
51 |
+
timezoneText: 'Time Zone',
|
52 |
+
isRTL: false
|
53 |
+
};
|
54 |
+
this._defaults = { // Global defaults for all the datetime picker instances
|
55 |
+
showButtonPanel: true,
|
56 |
+
timeOnly: false,
|
57 |
+
timeOnlyShowDate: false,
|
58 |
+
showHour: null,
|
59 |
+
showMinute: null,
|
60 |
+
showSecond: null,
|
61 |
+
showMillisec: null,
|
62 |
+
showMicrosec: null,
|
63 |
+
showTimezone: null,
|
64 |
+
showTime: true,
|
65 |
+
stepHour: 1,
|
66 |
+
stepMinute: 1,
|
67 |
+
stepSecond: 1,
|
68 |
+
stepMillisec: 1,
|
69 |
+
stepMicrosec: 1,
|
70 |
+
hour: 0,
|
71 |
+
minute: 0,
|
72 |
+
second: 0,
|
73 |
+
millisec: 0,
|
74 |
+
microsec: 0,
|
75 |
+
timezone: null,
|
76 |
+
hourMin: 0,
|
77 |
+
minuteMin: 0,
|
78 |
+
secondMin: 0,
|
79 |
+
millisecMin: 0,
|
80 |
+
microsecMin: 0,
|
81 |
+
hourMax: 23,
|
82 |
+
minuteMax: 59,
|
83 |
+
secondMax: 59,
|
84 |
+
millisecMax: 999,
|
85 |
+
microsecMax: 999,
|
86 |
+
minDateTime: null,
|
87 |
+
maxDateTime: null,
|
88 |
+
maxTime: null,
|
89 |
+
minTime: null,
|
90 |
+
onSelect: null,
|
91 |
+
hourGrid: 0,
|
92 |
+
minuteGrid: 0,
|
93 |
+
secondGrid: 0,
|
94 |
+
millisecGrid: 0,
|
95 |
+
microsecGrid: 0,
|
96 |
+
alwaysSetTime: true,
|
97 |
+
separator: ' ',
|
98 |
+
altFieldTimeOnly: true,
|
99 |
+
altTimeFormat: null,
|
100 |
+
altSeparator: null,
|
101 |
+
altTimeSuffix: null,
|
102 |
+
altRedirectFocus: true,
|
103 |
+
pickerTimeFormat: null,
|
104 |
+
pickerTimeSuffix: null,
|
105 |
+
showTimepicker: true,
|
106 |
+
timezoneList: null,
|
107 |
+
addSliderAccess: false,
|
108 |
+
sliderAccessArgs: null,
|
109 |
+
controlType: 'slider',
|
110 |
+
oneLine: false,
|
111 |
+
defaultValue: null,
|
112 |
+
parse: 'strict',
|
113 |
+
afterInject: null
|
114 |
+
};
|
115 |
+
$.extend(this._defaults, this.regional['']);
|
116 |
+
};
|
117 |
+
|
118 |
+
$.extend(Timepicker.prototype, {
|
119 |
+
$input: null,
|
120 |
+
$altInput: null,
|
121 |
+
$timeObj: null,
|
122 |
+
inst: null,
|
123 |
+
hour_slider: null,
|
124 |
+
minute_slider: null,
|
125 |
+
second_slider: null,
|
126 |
+
millisec_slider: null,
|
127 |
+
microsec_slider: null,
|
128 |
+
timezone_select: null,
|
129 |
+
maxTime: null,
|
130 |
+
minTime: null,
|
131 |
+
hour: 0,
|
132 |
+
minute: 0,
|
133 |
+
second: 0,
|
134 |
+
millisec: 0,
|
135 |
+
microsec: 0,
|
136 |
+
timezone: null,
|
137 |
+
hourMinOriginal: null,
|
138 |
+
minuteMinOriginal: null,
|
139 |
+
secondMinOriginal: null,
|
140 |
+
millisecMinOriginal: null,
|
141 |
+
microsecMinOriginal: null,
|
142 |
+
hourMaxOriginal: null,
|
143 |
+
minuteMaxOriginal: null,
|
144 |
+
secondMaxOriginal: null,
|
145 |
+
millisecMaxOriginal: null,
|
146 |
+
microsecMaxOriginal: null,
|
147 |
+
ampm: '',
|
148 |
+
formattedDate: '',
|
149 |
+
formattedTime: '',
|
150 |
+
formattedDateTime: '',
|
151 |
+
timezoneList: null,
|
152 |
+
units: ['hour', 'minute', 'second', 'millisec', 'microsec'],
|
153 |
+
support: {},
|
154 |
+
control: null,
|
155 |
+
|
156 |
+
/*
|
157 |
+
* Override the default settings for all instances of the time picker.
|
158 |
+
* @param {Object} settings object - the new settings to use as defaults (anonymous object)
|
159 |
+
* @return {Object} the manager object
|
160 |
+
*/
|
161 |
+
setDefaults: function (settings) {
|
162 |
+
extendRemove(this._defaults, settings || {});
|
163 |
+
return this;
|
164 |
+
},
|
165 |
+
|
166 |
+
/*
|
167 |
+
* Create a new Timepicker instance
|
168 |
+
*/
|
169 |
+
_newInst: function ($input, opts) {
|
170 |
+
var tp_inst = new Timepicker(),
|
171 |
+
inlineSettings = {},
|
172 |
+
fns = {},
|
173 |
+
overrides, i;
|
174 |
+
|
175 |
+
for (var attrName in this._defaults) {
|
176 |
+
if (this._defaults.hasOwnProperty(attrName)) {
|
177 |
+
var attrValue = $input.attr('time:' + attrName);
|
178 |
+
if (attrValue) {
|
179 |
+
try {
|
180 |
+
inlineSettings[attrName] = eval(attrValue);
|
181 |
+
} catch (err) {
|
182 |
+
inlineSettings[attrName] = attrValue;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
overrides = {
|
189 |
+
beforeShow: function (input, dp_inst) {
|
190 |
+
if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
|
191 |
+
return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
|
192 |
+
}
|
193 |
+
},
|
194 |
+
onChangeMonthYear: function (year, month, dp_inst) {
|
195 |
+
// Update the time as well : this prevents the time from disappearing from the $input field.
|
196 |
+
// tp_inst._updateDateTime(dp_inst);
|
197 |
+
if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
|
198 |
+
tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
|
199 |
+
}
|
200 |
+
},
|
201 |
+
onClose: function (dateText, dp_inst) {
|
202 |
+
if (tp_inst.timeDefined === true && $input.val() !== '') {
|
203 |
+
tp_inst._updateDateTime(dp_inst);
|
204 |
+
}
|
205 |
+
if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
|
206 |
+
tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
|
207 |
+
}
|
208 |
+
}
|
209 |
+
};
|
210 |
+
for (i in overrides) {
|
211 |
+
if (overrides.hasOwnProperty(i)) {
|
212 |
+
fns[i] = opts[i] || this._defaults[i] || null;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
|
217 |
+
evnts: fns,
|
218 |
+
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
|
219 |
+
});
|
220 |
+
tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
|
221 |
+
return val.toUpperCase();
|
222 |
+
});
|
223 |
+
tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
|
224 |
+
return val.toUpperCase();
|
225 |
+
});
|
226 |
+
|
227 |
+
// detect which units are supported
|
228 |
+
tp_inst.support = detectSupport(
|
229 |
+
tp_inst._defaults.timeFormat +
|
230 |
+
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
|
231 |
+
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));
|
232 |
+
|
233 |
+
// controlType is string - key to our this._controls
|
234 |
+
if (typeof(tp_inst._defaults.controlType) === 'string') {
|
235 |
+
if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {
|
236 |
+
tp_inst._defaults.controlType = 'select';
|
237 |
+
}
|
238 |
+
tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
|
239 |
+
}
|
240 |
+
// controlType is an object and must implement create, options, value methods
|
241 |
+
else {
|
242 |
+
tp_inst.control = tp_inst._defaults.controlType;
|
243 |
+
}
|
244 |
+
|
245 |
+
// prep the timezone options
|
246 |
+
var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
|
247 |
+
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];
|
248 |
+
if (tp_inst._defaults.timezoneList !== null) {
|
249 |
+
timezoneList = tp_inst._defaults.timezoneList;
|
250 |
+
}
|
251 |
+
var tzl = timezoneList.length, tzi = 0, tzv = null;
|
252 |
+
if (tzl > 0 && typeof timezoneList[0] !== 'object') {
|
253 |
+
for (; tzi < tzl; tzi++) {
|
254 |
+
tzv = timezoneList[tzi];
|
255 |
+
timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
|
256 |
+
}
|
257 |
+
}
|
258 |
+
tp_inst._defaults.timezoneList = timezoneList;
|
259 |
+
|
260 |
+
// set the default units
|
261 |
+
tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
|
262 |
+
((new Date()).getTimezoneOffset() * -1);
|
263 |
+
tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
|
264 |
+
tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
|
265 |
+
tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
|
266 |
+
tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
|
267 |
+
tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
|
268 |
+
tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
|
269 |
+
tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
|
270 |
+
tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
|
271 |
+
tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
|
272 |
+
tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
|
273 |
+
tp_inst.ampm = '';
|
274 |
+
tp_inst.$input = $input;
|
275 |
+
|
276 |
+
if (tp_inst._defaults.altField) {
|
277 |
+
tp_inst.$altInput = $(tp_inst._defaults.altField);
|
278 |
+
if (tp_inst._defaults.altRedirectFocus === true) {
|
279 |
+
tp_inst.$altInput.css({
|
280 |
+
cursor: 'pointer'
|
281 |
+
}).focus(function () {
|
282 |
+
$input.trigger("focus");
|
283 |
+
});
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
|
288 |
+
tp_inst._defaults.minDate = new Date();
|
289 |
+
}
|
290 |
+
if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
|
291 |
+
tp_inst._defaults.maxDate = new Date();
|
292 |
+
}
|
293 |
+
|
294 |
+
// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
|
295 |
+
if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
|
296 |
+
tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
|
297 |
+
}
|
298 |
+
if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
|
299 |
+
tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
|
300 |
+
}
|
301 |
+
if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
|
302 |
+
tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
|
303 |
+
}
|
304 |
+
if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
|
305 |
+
tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
|
306 |
+
}
|
307 |
+
tp_inst.$input.bind('focus', function () {
|
308 |
+
tp_inst._onFocus();
|
309 |
+
});
|
310 |
+
|
311 |
+
return tp_inst;
|
312 |
+
},
|
313 |
+
|
314 |
+
/*
|
315 |
+
* add our sliders to the calendar
|
316 |
+
*/
|
317 |
+
_addTimePicker: function (dp_inst) {
|
318 |
+
var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());
|
319 |
+
|
320 |
+
this.timeDefined = this._parseTime(currDT);
|
321 |
+
this._limitMinMaxDateTime(dp_inst, false);
|
322 |
+
this._injectTimePicker();
|
323 |
+
this._afterInject();
|
324 |
+
},
|
325 |
+
|
326 |
+
/*
|
327 |
+
* parse the time string from input value or _setTime
|
328 |
+
*/
|
329 |
+
_parseTime: function (timeString, withDate) {
|
330 |
+
if (!this.inst) {
|
331 |
+
this.inst = $.datepicker._getInst(this.$input[0]);
|
332 |
+
}
|
333 |
+
|
334 |
+
if (withDate || !this._defaults.timeOnly) {
|
335 |
+
var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
|
336 |
+
try {
|
337 |
+
var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
|
338 |
+
if (!parseRes.timeObj) {
|
339 |
+
return false;
|
340 |
+
}
|
341 |
+
$.extend(this, parseRes.timeObj);
|
342 |
+
} catch (err) {
|
343 |
+
$.timepicker.log("Error parsing the date/time string: " + err +
|
344 |
+
"\ndate/time string = " + timeString +
|
345 |
+
"\ntimeFormat = " + this._defaults.timeFormat +
|
346 |
+
"\ndateFormat = " + dp_dateFormat);
|
347 |
+
return false;
|
348 |
+
}
|
349 |
+
return true;
|
350 |
+
} else {
|
351 |
+
var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
|
352 |
+
if (!timeObj) {
|
353 |
+
return false;
|
354 |
+
}
|
355 |
+
$.extend(this, timeObj);
|
356 |
+
return true;
|
357 |
+
}
|
358 |
+
},
|
359 |
+
|
360 |
+
/*
|
361 |
+
* Handle callback option after injecting timepicker
|
362 |
+
*/
|
363 |
+
_afterInject: function() {
|
364 |
+
var o = this.inst.settings;
|
365 |
+
if ($.isFunction(o.afterInject)) {
|
366 |
+
o.afterInject.call(this);
|
367 |
+
}
|
368 |
+
},
|
369 |
+
|
370 |
+
/*
|
371 |
+
* generate and inject html for timepicker into ui datepicker
|
372 |
+
*/
|
373 |
+
_injectTimePicker: function () {
|
374 |
+
var $dp = this.inst.dpDiv,
|
375 |
+
o = this.inst.settings,
|
376 |
+
tp_inst = this,
|
377 |
+
litem = '',
|
378 |
+
uitem = '',
|
379 |
+
show = null,
|
380 |
+
max = {},
|
381 |
+
gridSize = {},
|
382 |
+
size = null,
|
383 |
+
i = 0,
|
384 |
+
l = 0;
|
385 |
+
|
386 |
+
// Prevent displaying twice
|
387 |
+
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
|
388 |
+
var noDisplay = ' ui_tpicker_unit_hide',
|
389 |
+
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>' +
|
390 |
+
'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';
|
391 |
+
|
392 |
+
// Create the markup
|
393 |
+
for (i = 0, l = this.units.length; i < l; i++) {
|
394 |
+
litem = this.units[i];
|
395 |
+
uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
|
396 |
+
show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
|
397 |
+
|
398 |
+
// Added by Peter Medeiros:
|
399 |
+
// - Figure out what the hour/minute/second max should be based on the step values.
|
400 |
+
// - Example: if stepMinute is 15, then minMax is 45.
|
401 |
+
max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
|
402 |
+
gridSize[litem] = 0;
|
403 |
+
|
404 |
+
html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' +
|
405 |
+
'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';
|
406 |
+
|
407 |
+
if (show && o[litem + 'Grid'] > 0) {
|
408 |
+
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
|
409 |
+
|
410 |
+
if (litem === 'hour') {
|
411 |
+
for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
|
412 |
+
gridSize[litem]++;
|
413 |
+
var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
|
414 |
+
html += '<td data-for="' + litem + '">' + tmph + '</td>';
|
415 |
+
}
|
416 |
+
}
|
417 |
+
else {
|
418 |
+
for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
|
419 |
+
gridSize[litem]++;
|
420 |
+
html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
|
421 |
+
}
|
422 |
+
}
|
423 |
+
|
424 |
+
html += '</tr></table></div>';
|
425 |
+
}
|
426 |
+
html += '</dd>';
|
427 |
+
}
|
428 |
+
|
429 |
+
// Timezone
|
430 |
+
var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
|
431 |
+
html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>';
|
432 |
+
html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>';
|
433 |
+
|
434 |
+
// Create the elements from string
|
435 |
+
html += '</dl></div>';
|
436 |
+
var $tp = $(html);
|
437 |
+
|
438 |
+
// if we only want time picker...
|
439 |
+
if (o.timeOnly === true) {
|
440 |
+
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
|
441 |
+
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
|
442 |
+
}
|
443 |
+
|
444 |
+
// add sliders, adjust grids, add events
|
445 |
+
for (i = 0, l = tp_inst.units.length; i < l; i++) {
|
446 |
+
litem = tp_inst.units[i];
|
447 |
+
uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
|
448 |
+
show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];
|
449 |
+
|
450 |
+
// add the slider
|
451 |
+
tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);
|
452 |
+
|
453 |
+
// adjust the grid and add click event
|
454 |
+
if (show && o[litem + 'Grid'] > 0) {
|
455 |
+
size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
|
456 |
+
$tp.find('.ui_tpicker_' + litem + ' table').css({
|
457 |
+
width: size + "%",
|
458 |
+
marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"),
|
459 |
+
marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
|
460 |
+
borderCollapse: 'collapse'
|
461 |
+
}).find("td").click(function (e) {
|
462 |
+
var $t = $(this),
|
463 |
+
h = $t.html(),
|
464 |
+
n = parseInt(h.replace(/[^0-9]/g), 10),
|
465 |
+
ap = h.replace(/[^apm]/ig),
|
466 |
+
f = $t.data('for'); // loses scope, so we use data-for
|
467 |
+
|
468 |
+
if (f === 'hour') {
|
469 |
+
if (ap.indexOf('p') !== -1 && n < 12) {
|
470 |
+
n += 12;
|
471 |
+
}
|
472 |
+
else {
|
473 |
+
if (ap.indexOf('a') !== -1 && n === 12) {
|
474 |
+
n = 0;
|
475 |
+
}
|
476 |
+
}
|
477 |
+
}
|
478 |
+
|
479 |
+
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
|
480 |
+
|
481 |
+
tp_inst._onTimeChange();
|
482 |
+
tp_inst._onSelectHandler();
|
483 |
+
}).css({
|
484 |
+
cursor: 'pointer',
|
485 |
+
width: (100 / gridSize[litem]) + '%',
|
486 |
+
textAlign: 'center',
|
487 |
+
overflow: 'hidden'
|
488 |
+
});
|
489 |
+
} // end if grid > 0
|
490 |
+
} // end for loop
|
491 |
+
|
492 |
+
// Add timezone options
|
493 |
+
this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
|
494 |
+
$.fn.append.apply(this.timezone_select,
|
495 |
+
$.map(o.timezoneList, function (val, idx) {
|
496 |
+
return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
|
497 |
+
}));
|
498 |
+
if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
|
499 |
+
var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
|
500 |
+
if (local_timezone === this.timezone) {
|
501 |
+
selectLocalTimezone(tp_inst);
|
502 |
+
} else {
|
503 |
+
this.timezone_select.val(this.timezone);
|
504 |
+
}
|
505 |
+
} else {
|
506 |
+
if (typeof(this.hour) !== "undefined" && this.hour !== null && this.hour !== "") {
|
507 |
+
this.timezone_select.val(o.timezone);
|
508 |
+
} else {
|
509 |
+
selectLocalTimezone(tp_inst);
|
510 |
+
}
|
511 |
+
}
|
512 |
+
this.timezone_select.change(function () {
|
513 |
+
tp_inst._onTimeChange();
|
514 |
+
tp_inst._onSelectHandler();
|
515 |
+
tp_inst._afterInject();
|
516 |
+
});
|
517 |
+
// End timezone options
|
518 |
+
|
519 |
+
// inject timepicker into datepicker
|
520 |
+
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
|
521 |
+
if ($buttonPanel.length) {
|
522 |
+
$buttonPanel.before($tp);
|
523 |
+
} else {
|
524 |
+
$dp.append($tp);
|
525 |
+
}
|
526 |
+
|
527 |
+
this.$timeObj = $tp.find('.ui_tpicker_time_input');
|
528 |
+
this.$timeObj.change(function () {
|
529 |
+
var timeFormat = tp_inst.inst.settings.timeFormat;
|
530 |
+
var parsedTime = $.datepicker.parseTime(timeFormat, this.value);
|
531 |
+
var update = new Date();
|
532 |
+
if (parsedTime) {
|
533 |
+
update.setHours(parsedTime.hour);
|
534 |
+
update.setMinutes(parsedTime.minute);
|
535 |
+
update.setSeconds(parsedTime.second);
|
536 |
+
$.datepicker._setTime(tp_inst.inst, update);
|
537 |
+
} else {
|
538 |
+
this.value = tp_inst.formattedTime;
|
539 |
+
this.blur();
|
540 |
+
}
|
541 |
+
});
|
542 |
+
|
543 |
+
if (this.inst !== null) {
|
544 |
+
var timeDefined = this.timeDefined;
|
545 |
+
this._onTimeChange();
|
546 |
+
this.timeDefined = timeDefined;
|
547 |
+
}
|
548 |
+
|
549 |
+
// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
|
550 |
+
if (this._defaults.addSliderAccess) {
|
551 |
+
var sliderAccessArgs = this._defaults.sliderAccessArgs,
|
552 |
+
rtl = this._defaults.isRTL;
|
553 |
+
sliderAccessArgs.isRTL = rtl;
|
554 |
+
|
555 |
+
setTimeout(function () { // fix for inline mode
|
556 |
+
if ($tp.find('.ui-slider-access').length === 0) {
|
557 |
+
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
558 |
+
|
559 |
+
// fix any grids since sliders are shorter
|
560 |
+
var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
|
561 |
+
if (sliderAccessWidth) {
|
562 |
+
$tp.find('table:visible').each(function () {
|
563 |
+
var $g = $(this),
|
564 |
+
oldWidth = $g.outerWidth(),
|
565 |
+
oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
|
566 |
+
newWidth = oldWidth - sliderAccessWidth,
|
567 |
+
newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
|
568 |
+
css = { width: newWidth, marginRight: 0, marginLeft: 0 };
|
569 |
+
css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
|
570 |
+
$g.css(css);
|
571 |
+
});
|
572 |
+
}
|
573 |
+
}
|
574 |
+
}, 10);
|
575 |
+
}
|
576 |
+
// end slideAccess integration
|
577 |
+
|
578 |
+
tp_inst._limitMinMaxDateTime(this.inst, true);
|
579 |
+
}
|
580 |
+
},
|
581 |
+
|
582 |
+
/*
|
583 |
+
* This function tries to limit the ability to go outside the
|
584 |
+
* min/max date range
|
585 |
+
*/
|
586 |
+
_limitMinMaxDateTime: function (dp_inst, adjustSliders) {
|
587 |
+
var o = this._defaults,
|
588 |
+
dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
|
589 |
+
|
590 |
+
if (!this._defaults.showTimepicker) {
|
591 |
+
return;
|
592 |
+
} // No time so nothing to check here
|
593 |
+
|
594 |
+
if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
|
595 |
+
var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
|
596 |
+
minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
|
597 |
+
|
598 |
+
if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
|
599 |
+
this.hourMinOriginal = o.hourMin;
|
600 |
+
this.minuteMinOriginal = o.minuteMin;
|
601 |
+
this.secondMinOriginal = o.secondMin;
|
602 |
+
this.millisecMinOriginal = o.millisecMin;
|
603 |
+
this.microsecMinOriginal = o.microsecMin;
|
604 |
+
}
|
605 |
+
|
606 |
+
if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
|
607 |
+
this._defaults.hourMin = minDateTime.getHours();
|
608 |
+
if (this.hour <= this._defaults.hourMin) {
|
609 |
+
this.hour = this._defaults.hourMin;
|
610 |
+
this._defaults.minuteMin = minDateTime.getMinutes();
|
611 |
+
if (this.minute <= this._defaults.minuteMin) {
|
612 |
+
this.minute = this._defaults.minuteMin;
|
613 |
+
this._defaults.secondMin = minDateTime.getSeconds();
|
614 |
+
if (this.second <= this._defaults.secondMin) {
|
615 |
+
this.second = this._defaults.secondMin;
|
616 |
+
this._defaults.millisecMin = minDateTime.getMilliseconds();
|
617 |
+
if (this.millisec <= this._defaults.millisecMin) {
|
618 |
+
this.millisec = this._defaults.millisecMin;
|
619 |
+
this._defaults.microsecMin = minDateTime.getMicroseconds();
|
620 |
+
} else {
|
621 |
+
if (this.microsec < this._defaults.microsecMin) {
|
622 |
+
this.microsec = this._defaults.microsecMin;
|
623 |
+
}
|
624 |
+
this._defaults.microsecMin = this.microsecMinOriginal;
|
625 |
+
}
|
626 |
+
} else {
|
627 |
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
628 |
+
this._defaults.microsecMin = this.microsecMinOriginal;
|
629 |
+
}
|
630 |
+
} else {
|
631 |
+
this._defaults.secondMin = this.secondMinOriginal;
|
632 |
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
633 |
+
this._defaults.microsecMin = this.microsecMinOriginal;
|
634 |
+
}
|
635 |
+
} else {
|
636 |
+
this._defaults.minuteMin = this.minuteMinOriginal;
|
637 |
+
this._defaults.secondMin = this.secondMinOriginal;
|
638 |
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
639 |
+
this._defaults.microsecMin = this.microsecMinOriginal;
|
640 |
+
}
|
641 |
+
} else {
|
642 |
+
this._defaults.hourMin = this.hourMinOriginal;
|
643 |
+
this._defaults.minuteMin = this.minuteMinOriginal;
|
644 |
+
this._defaults.secondMin = this.secondMinOriginal;
|
645 |
+
this._defaults.millisecMin = this.millisecMinOriginal;
|
646 |
+
this._defaults.microsecMin = this.microsecMinOriginal;
|
647 |
+
}
|
648 |
+
}
|
649 |
+
|
650 |
+
if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
|
651 |
+
var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
|
652 |
+
maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
|
653 |
+
|
654 |
+
if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
|
655 |
+
this.hourMaxOriginal = o.hourMax;
|
656 |
+
this.minuteMaxOriginal = o.minuteMax;
|
657 |
+
this.secondMaxOriginal = o.secondMax;
|
658 |
+
this.millisecMaxOriginal = o.millisecMax;
|
659 |
+
this.microsecMaxOriginal = o.microsecMax;
|
660 |
+
}
|
661 |
+
|
662 |
+
if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
|
663 |
+
this._defaults.hourMax = maxDateTime.getHours();
|
664 |
+
if (this.hour >= this._defaults.hourMax) {
|
665 |
+
this.hour = this._defaults.hourMax;
|
666 |
+
this._defaults.minuteMax = maxDateTime.getMinutes();
|
667 |
+
if (this.minute >= this._defaults.minuteMax) {
|
668 |
+
this.minute = this._defaults.minuteMax;
|
669 |
+
this._defaults.secondMax = maxDateTime.getSeconds();
|
670 |
+
if (this.second >= this._defaults.secondMax) {
|
671 |
+
this.second = this._defaults.secondMax;
|
672 |
+
this._defaults.millisecMax = maxDateTime.getMilliseconds();
|
673 |
+
if (this.millisec >= this._defaults.millisecMax) {
|
674 |
+
this.millisec = this._defaults.millisecMax;
|
675 |
+
this._defaults.microsecMax = maxDateTime.getMicroseconds();
|
676 |
+
} else {
|
677 |
+
if (this.microsec > this._defaults.microsecMax) {
|
678 |
+
this.microsec = this._defaults.microsecMax;
|
679 |
+
}
|
680 |
+
this._defaults.microsecMax = this.microsecMaxOriginal;
|
681 |
+
}
|
682 |
+
} else {
|
683 |
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
684 |
+
this._defaults.microsecMax = this.microsecMaxOriginal;
|
685 |
+
}
|
686 |
+
} else {
|
687 |
+
this._defaults.secondMax = this.secondMaxOriginal;
|
688 |
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
689 |
+
this._defaults.microsecMax = this.microsecMaxOriginal;
|
690 |
+
}
|
691 |
+
} else {
|
692 |
+
this._defaults.minuteMax = this.minuteMaxOriginal;
|
693 |
+
this._defaults.secondMax = this.secondMaxOriginal;
|
694 |
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
695 |
+
this._defaults.microsecMax = this.microsecMaxOriginal;
|
696 |
+
}
|
697 |
+
} else {
|
698 |
+
this._defaults.hourMax = this.hourMaxOriginal;
|
699 |
+
this._defaults.minuteMax = this.minuteMaxOriginal;
|
700 |
+
this._defaults.secondMax = this.secondMaxOriginal;
|
701 |
+
this._defaults.millisecMax = this.millisecMaxOriginal;
|
702 |
+
this._defaults.microsecMax = this.microsecMaxOriginal;
|
703 |
+
}
|
704 |
+
}
|
705 |
+
|
706 |
+
if (dp_inst.settings.minTime!==null) {
|
707 |
+
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
|
708 |
+
if (this.hour<tempMinTime.getHours()) {
|
709 |
+
this.hour=this._defaults.hourMin=tempMinTime.getHours();
|
710 |
+
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
711 |
+
} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
|
712 |
+
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
|
713 |
+
} else {
|
714 |
+
if (this._defaults.hourMin<tempMinTime.getHours()) {
|
715 |
+
this._defaults.hourMin=tempMinTime.getHours();
|
716 |
+
this._defaults.minuteMin=tempMinTime.getMinutes();
|
717 |
+
} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
|
718 |
+
this._defaults.minuteMin=tempMinTime.getMinutes();
|
719 |
+
} else {
|
720 |
+
this._defaults.minuteMin=0;
|
721 |
+
}
|
722 |
+
}
|
723 |
+
}
|
724 |
+
|
725 |
+
if (dp_inst.settings.maxTime!==null) {
|
726 |
+
var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
|
727 |
+
if (this.hour>tempMaxTime.getHours()) {
|
728 |
+
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
|
729 |
+
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
730 |
+
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
|
731 |
+
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
|
732 |
+
} else {
|
733 |
+
if (this._defaults.hourMax>tempMaxTime.getHours()) {
|
734 |
+
this._defaults.hourMax=tempMaxTime.getHours();
|
735 |
+
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
736 |
+
} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
|
737 |
+
this._defaults.minuteMax=tempMaxTime.getMinutes();
|
738 |
+
} else {
|
739 |
+
this._defaults.minuteMax=59;
|
740 |
+
}
|
741 |
+
}
|
742 |
+
}
|
743 |
+
|
744 |
+
if (adjustSliders !== undefined && adjustSliders === true) {
|
745 |
+
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
|
746 |
+
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
|
747 |
+
secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
|
748 |
+
millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),
|
749 |
+
microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);
|
750 |
+
|
751 |
+
if (this.hour_slider) {
|
752 |
+
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });
|
753 |
+
this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
|
754 |
+
}
|
755 |
+
if (this.minute_slider) {
|
756 |
+
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });
|
757 |
+
this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
|
758 |
+
}
|
759 |
+
if (this.second_slider) {
|
760 |
+
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });
|
761 |
+
this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
|
762 |
+
}
|
763 |
+
if (this.millisec_slider) {
|
764 |
+
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });
|
765 |
+
this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
|
766 |
+
}
|
767 |
+
if (this.microsec_slider) {
|
768 |
+
this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });
|
769 |
+
this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
|
770 |
+
}
|
771 |
+
}
|
772 |
+
|
773 |
+
},
|
774 |
+
|
775 |
+
/*
|
776 |
+
* when a slider moves, set the internal time...
|
777 |
+
* on time change is also called when the time is updated in the text field
|
778 |
+
*/
|
779 |
+
_onTimeChange: function () {
|
780 |
+
if (!this._defaults.showTimepicker) {
|
781 |
+
return;
|
782 |
+
}
|
783 |
+
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
|
784 |
+
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
|
785 |
+
second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
|
786 |
+
millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
|
787 |
+
microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,
|
788 |
+
timezone = (this.timezone_select) ? this.timezone_select.val() : false,
|
789 |
+
o = this._defaults,
|
790 |
+
pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
|
791 |
+
pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
|
792 |
+
|
793 |
+
if (typeof(hour) === 'object') {
|
794 |
+
hour = false;
|
795 |
+
}
|
796 |
+
if (typeof(minute) === 'object') {
|
797 |
+
minute = false;
|
798 |
+
}
|
799 |
+
if (typeof(second) === 'object') {
|
800 |
+
second = false;
|
801 |
+
}
|
802 |
+
if (typeof(millisec) === 'object') {
|
803 |
+
millisec = false;
|
804 |
+
}
|
805 |
+
if (typeof(microsec) === 'object') {
|
806 |
+
microsec = false;
|
807 |
+
}
|
808 |
+
if (typeof(timezone) === 'object') {
|
809 |
+
timezone = false;
|
810 |
+
}
|
811 |
+
|
812 |
+
if (hour !== false) {
|
813 |
+
hour = parseInt(hour, 10);
|
814 |
+
}
|
815 |
+
if (minute !== false) {
|
816 |
+
minute = parseInt(minute, 10);
|
817 |
+
}
|
818 |
+
if (second !== false) {
|
819 |
+
second = parseInt(second, 10);
|
820 |
+
}
|
821 |
+
if (millisec !== false) {
|
822 |
+
millisec = parseInt(millisec, 10);
|
823 |
+
}
|
824 |
+
if (microsec !== false) {
|
825 |
+
microsec = parseInt(microsec, 10);
|
826 |
+
}
|
827 |
+
if (timezone !== false) {
|
828 |
+
timezone = timezone.toString();
|
829 |
+
}
|
830 |
+
|
831 |
+
var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
|
832 |
+
|
833 |
+
// If the update was done in the input field, the input field should not be updated.
|
834 |
+
// If the update was done using the sliders, update the input field.
|
835 |
+
var hasChanged = (
|
836 |
+
hour !== parseInt(this.hour,10) || // sliders should all be numeric
|
837 |
+
minute !== parseInt(this.minute,10) ||
|
838 |
+
second !== parseInt(this.second,10) ||
|
839 |
+
millisec !== parseInt(this.millisec,10) ||
|
840 |
+
microsec !== parseInt(this.microsec,10) ||
|
841 |
+
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
|
842 |
+
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
|
843 |
+
);
|
844 |
+
|
845 |
+
if (hasChanged) {
|
846 |
+
|
847 |
+
if (hour !== false) {
|
848 |
+
this.hour = hour;
|
849 |
+
}
|
850 |
+
if (minute !== false) {
|
851 |
+
this.minute = minute;
|
852 |
+
}
|
853 |
+
if (second !== false) {
|
854 |
+
this.second = second;
|
855 |
+
}
|
856 |
+
if (millisec !== false) {
|
857 |
+
this.millisec = millisec;
|
858 |
+
}
|
859 |
+
if (microsec !== false) {
|
860 |
+
this.microsec = microsec;
|
861 |
+
}
|
862 |
+
if (timezone !== false) {
|
863 |
+
this.timezone = timezone;
|
864 |
+
}
|
865 |
+
|
866 |
+
if (!this.inst) {
|
867 |
+
this.inst = $.datepicker._getInst(this.$input[0]);
|
868 |
+
}
|
869 |
+
|
870 |
+
this._limitMinMaxDateTime(this.inst, true);
|
871 |
+
}
|
872 |
+
if (this.support.ampm) {
|
873 |
+
this.ampm = ampm;
|
874 |
+
}
|
875 |
+
|
876 |
+
// Updates the time within the timepicker
|
877 |
+
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
|
878 |
+
if (this.$timeObj) {
|
879 |
+
var sPos = this.$timeObj[0].selectionStart;
|
880 |
+
var ePos = this.$timeObj[0].selectionEnd;
|
881 |
+
if (pickerTimeFormat === o.timeFormat) {
|
882 |
+
this.$timeObj.val(this.formattedTime + pickerTimeSuffix);
|
883 |
+
}
|
884 |
+
else {
|
885 |
+
this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
|
886 |
+
}
|
887 |
+
this.$timeObj[0].setSelectionRange(sPos, ePos);
|
888 |
+
}
|
889 |
+
|
890 |
+
this.timeDefined = true;
|
891 |
+
if (hasChanged) {
|
892 |
+
this._updateDateTime();
|
893 |
+
//this.$input.focus(); // may automatically open the picker on setDate
|
894 |
+
}
|
895 |
+
},
|
896 |
+
|
897 |
+
/*
|
898 |
+
* call custom onSelect.
|
899 |
+
* bind to sliders slidestop, and grid click.
|
900 |
+
*/
|
901 |
+
_onSelectHandler: function () {
|
902 |
+
var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
|
903 |
+
var inputEl = this.$input ? this.$input[0] : null;
|
904 |
+
if (onSelect && inputEl) {
|
905 |
+
onSelect.apply(inputEl, [this.formattedDateTime, this]);
|
906 |
+
}
|
907 |
+
},
|
908 |
+
|
909 |
+
/*
|
910 |
+
* update our input with the new date time..
|
911 |
+
*/
|
912 |
+
_updateDateTime: function (dp_inst) {
|
913 |
+
dp_inst = this.inst || dp_inst;
|
914 |
+
var dtTmp = (dp_inst.currentYear > 0?
|
915 |
+
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
|
916 |
+
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
917 |
+
dt = $.datepicker._daylightSavingAdjust(dtTmp),
|
918 |
+
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
|
919 |
+
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
|
920 |
+
dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
|
921 |
+
formatCfg = $.datepicker._getFormatConfig(dp_inst),
|
922 |
+
timeAvailable = dt !== null && this.timeDefined;
|
923 |
+
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
|
924 |
+
var formattedDateTime = this.formattedDate;
|
925 |
+
|
926 |
+
// if a slider was changed but datepicker doesn't have a value yet, set it
|
927 |
+
if (dp_inst.lastVal === "") {
|
928 |
+
dp_inst.currentYear = dp_inst.selectedYear;
|
929 |
+
dp_inst.currentMonth = dp_inst.selectedMonth;
|
930 |
+
dp_inst.currentDay = dp_inst.selectedDay;
|
931 |
+
}
|
932 |
+
|
933 |
+
/*
|
934 |
+
* remove following lines to force every changes in date picker to change the input value
|
935 |
+
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
936 |
+
* If the user manually empty the value in the input field, the date picker will never change selected value.
|
937 |
+
*/
|
938 |
+
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
|
939 |
+
// return;
|
940 |
+
//}
|
941 |
+
|
942 |
+
if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
|
943 |
+
formattedDateTime = this.formattedTime;
|
944 |
+
} else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
|
945 |
+
formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
|
946 |
+
}
|
947 |
+
|
948 |
+
this.formattedDateTime = formattedDateTime;
|
949 |
+
|
950 |
+
if (!this._defaults.showTimepicker) {
|
951 |
+
this.$input.val(this.formattedDate);
|
952 |
+
} else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
|
953 |
+
this.$altInput.val(this.formattedTime);
|
954 |
+
this.$input.val(this.formattedDate);
|
955 |
+
} else if (this.$altInput) {
|
956 |
+
this.$input.val(formattedDateTime);
|
957 |
+
var altFormattedDateTime = '',
|
958 |
+
altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
|
959 |
+
altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
|
960 |
+
|
961 |
+
if (!this._defaults.timeOnly) {
|
962 |
+
if (this._defaults.altFormat) {
|
963 |
+
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
|
964 |
+
}
|
965 |
+
else {
|
966 |
+
altFormattedDateTime = this.formattedDate;
|
967 |
+
}
|
968 |
+
|
969 |
+
if (altFormattedDateTime) {
|
970 |
+
altFormattedDateTime += altSeparator;
|
971 |
+
}
|
972 |
+
}
|
973 |
+
|
974 |
+
if (this._defaults.altTimeFormat !== null) {
|
975 |
+
altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
|
976 |
+
}
|
977 |
+
else {
|
978 |
+
altFormattedDateTime += this.formattedTime + altTimeSuffix;
|
979 |
+
}
|
980 |
+
this.$altInput.val(altFormattedDateTime);
|
981 |
+
} else {
|
982 |
+
this.$input.val(formattedDateTime);
|
983 |
+
}
|
984 |
+
|
985 |
+
this.$input.trigger("change");
|
986 |
+
},
|
987 |
+
|
988 |
+
_onFocus: function () {
|
989 |
+
if (!this.$input.val() && this._defaults.defaultValue) {
|
990 |
+
this.$input.val(this._defaults.defaultValue);
|
991 |
+
var inst = $.datepicker._getInst(this.$input.get(0)),
|
992 |
+
tp_inst = $.datepicker._get(inst, 'timepicker');
|
993 |
+
if (tp_inst) {
|
994 |
+
if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
|
995 |
+
try {
|
996 |
+
$.datepicker._updateDatepicker(inst);
|
997 |
+
} catch (err) {
|
998 |
+
$.timepicker.log(err);
|
999 |
+
}
|
1000 |
+
}
|
1001 |
+
}
|
1002 |
+
}
|
1003 |
+
},
|
1004 |
+
|
1005 |
+
/*
|
1006 |
+
* Small abstraction to control types
|
1007 |
+
* We can add more, just be sure to follow the pattern: create, options, value
|
1008 |
+
*/
|
1009 |
+
_controls: {
|
1010 |
+
// slider methods
|
1011 |
+
slider: {
|
1012 |
+
create: function (tp_inst, obj, unit, val, min, max, step) {
|
1013 |
+
var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
|
1014 |
+
return obj.prop('slide', null).slider({
|
1015 |
+
orientation: "horizontal",
|
1016 |
+
value: rtl ? val * -1 : val,
|
1017 |
+
min: rtl ? max * -1 : min,
|
1018 |
+
max: rtl ? min * -1 : max,
|
1019 |
+
step: step,
|
1020 |
+
slide: function (event, ui) {
|
1021 |
+
tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
|
1022 |
+
tp_inst._onTimeChange();
|
1023 |
+
},
|
1024 |
+
stop: function (event, ui) {
|
1025 |
+
tp_inst._onSelectHandler();
|
1026 |
+
}
|
1027 |
+
});
|
1028 |
+
},
|
1029 |
+
options: function (tp_inst, obj, unit, opts, val) {
|
1030 |
+
if (tp_inst._defaults.isRTL) {
|
1031 |
+
if (typeof(opts) === 'string') {
|
1032 |
+
if (opts === 'min' || opts === 'max') {
|
1033 |
+
if (val !== undefined) {
|
1034 |
+
return obj.slider(opts, val * -1);
|
1035 |
+
}
|
1036 |
+
return Math.abs(obj.slider(opts));
|
1037 |
+
}
|
1038 |
+
return obj.slider(opts);
|
1039 |
+
}
|
1040 |
+
var min = opts.min,
|
1041 |
+
max = opts.max;
|
1042 |
+
opts.min = opts.max = null;
|
1043 |
+
if (min !== undefined) {
|
1044 |
+
opts.max = min * -1;
|
1045 |
+
}
|
1046 |
+
if (max !== undefined) {
|
1047 |
+
opts.min = max * -1;
|
1048 |
+
}
|
1049 |
+
return obj.slider(opts);
|
1050 |
+
}
|
1051 |
+
if (typeof(opts) === 'string' && val !== undefined) {
|
1052 |
+
return obj.slider(opts, val);
|
1053 |
+
}
|
1054 |
+
return obj.slider(opts);
|
1055 |
+
},
|
1056 |
+
value: function (tp_inst, obj, unit, val) {
|
1057 |
+
if (tp_inst._defaults.isRTL) {
|
1058 |
+
if (val !== undefined) {
|
1059 |
+
return obj.slider('value', val * -1);
|
1060 |
+
}
|
1061 |
+
return Math.abs(obj.slider('value'));
|
1062 |
+
}
|
1063 |
+
if (val !== undefined) {
|
1064 |
+
return obj.slider('value', val);
|
1065 |
+
}
|
1066 |
+
return obj.slider('value');
|
1067 |
+
}
|
1068 |
+
},
|
1069 |
+
// select methods
|
1070 |
+
select: {
|
1071 |
+
create: function (tp_inst, obj, unit, val, min, max, step) {
|
1072 |
+
var sel = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
|
1073 |
+
format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
|
1074 |
+
|
1075 |
+
for (var i = min; i <= max; i += step) {
|
1076 |
+
sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>';
|
1077 |
+
if (unit === 'hour') {
|
1078 |
+
sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults);
|
1079 |
+
}
|
1080 |
+
else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }
|
1081 |
+
else {sel += '0' + i.toString(); }
|
1082 |
+
sel += '</option>';
|
1083 |
+
}
|
1084 |
+
sel += '</select>';
|
1085 |
+
|
1086 |
+
obj.children('select').remove();
|
1087 |
+
|
1088 |
+
$(sel).appendTo(obj).change(function (e) {
|
1089 |
+
tp_inst._onTimeChange();
|
1090 |
+
tp_inst._onSelectHandler();
|
1091 |
+
tp_inst._afterInject();
|
1092 |
+
});
|
1093 |
+
|
1094 |
+
return obj;
|
1095 |
+
},
|
1096 |
+
options: function (tp_inst, obj, unit, opts, val) {
|
1097 |
+
var o = {},
|
1098 |
+
$t = obj.children('select');
|
1099 |
+
if (typeof(opts) === 'string') {
|
1100 |
+
if (val === undefined) {
|
1101 |
+
return $t.data(opts);
|
1102 |
+
}
|
1103 |
+
o[opts] = val;
|
1104 |
+
}
|
1105 |
+
else { o = opts; }
|
1106 |
+
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'));
|
1107 |
+
},
|
1108 |
+
value: function (tp_inst, obj, unit, val) {
|
1109 |
+
var $t = obj.children('select');
|
1110 |
+
if (val !== undefined) {
|
1111 |
+
return $t.val(val);
|
1112 |
+
}
|
1113 |
+
return $t.val();
|
1114 |
+
}
|
1115 |
+
}
|
1116 |
+
} // end _controls
|
1117 |
+
|
1118 |
+
});
|
1119 |
+
|
1120 |
+
$.fn.extend({
|
1121 |
+
/*
|
1122 |
+
* shorthand just to use timepicker.
|
1123 |
+
*/
|
1124 |
+
timepicker: function (o) {
|
1125 |
+
o = o || {};
|
1126 |
+
var tmp_args = Array.prototype.slice.call(arguments);
|
1127 |
+
|
1128 |
+
if (typeof o === 'object') {
|
1129 |
+
tmp_args[0] = $.extend(o, {
|
1130 |
+
timeOnly: true
|
1131 |
+
});
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
return $(this).each(function () {
|
1135 |
+
$.fn.datetimepicker.apply($(this), tmp_args);
|
1136 |
+
});
|
1137 |
+
},
|
1138 |
+
|
1139 |
+
/*
|
1140 |
+
* extend timepicker to datepicker
|
1141 |
+
*/
|
1142 |
+
datetimepicker: function (o) {
|
1143 |
+
o = o || {};
|
1144 |
+
var tmp_args = arguments;
|
1145 |
+
|
1146 |
+
if (typeof(o) === 'string') {
|
1147 |
+
if (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {
|
1148 |
+
return $.fn.datepicker.apply($(this[0]), tmp_args);
|
1149 |
+
} else {
|
1150 |
+
return this.each(function () {
|
1151 |
+
var $t = $(this);
|
1152 |
+
$t.datepicker.apply($t, tmp_args);
|
1153 |
+
});
|
1154 |
+
}
|
1155 |
+
} else {
|
1156 |
+
return this.each(function () {
|
1157 |
+
var $t = $(this);
|
1158 |
+
$t.datepicker($.timepicker._newInst($t, o)._defaults);
|
1159 |
+
});
|
1160 |
+
}
|
1161 |
+
}
|
1162 |
+
});
|
1163 |
+
|
1164 |
+
/*
|
1165 |
+
* Public Utility to parse date and time
|
1166 |
+
*/
|
1167 |
+
$.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
|
1168 |
+
var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
|
1169 |
+
if (parseRes.timeObj) {
|
1170 |
+
var t = parseRes.timeObj;
|
1171 |
+
parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
|
1172 |
+
parseRes.date.setMicroseconds(t.microsec);
|
1173 |
+
}
|
1174 |
+
|
1175 |
+
return parseRes.date;
|
1176 |
+
};
|
1177 |
+
|
1178 |
+
/*
|
1179 |
+
* Public utility to parse time
|
1180 |
+
*/
|
1181 |
+
$.datepicker.parseTime = function (timeFormat, timeString, options) {
|
1182 |
+
var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
|
1183 |
+
iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1);
|
1184 |
+
|
1185 |
+
// Strict parse requires the timeString to match the timeFormat exactly
|
1186 |
+
var strictParse = function (f, s, o) {
|
1187 |
+
|
1188 |
+
// pattern for standard and localized AM/PM markers
|
1189 |
+
var getPatternAmpm = function (amNames, pmNames) {
|
1190 |
+
var markers = [];
|
1191 |
+
if (amNames) {
|
1192 |
+
$.merge(markers, amNames);
|
1193 |
+
}
|
1194 |
+
if (pmNames) {
|
1195 |
+
$.merge(markers, pmNames);
|
1196 |
+
}
|
1197 |
+
markers = $.map(markers, function (val) {
|
1198 |
+
return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
|
1199 |
+
});
|
1200 |
+
return '(' + markers.join('|') + ')?';
|
1201 |
+
};
|
1202 |
+
|
1203 |
+
// figure out position of time elements.. cause js cant do named captures
|
1204 |
+
var getFormatPositions = function (timeFormat) {
|
1205 |
+
var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),
|
1206 |
+
orders = {
|
1207 |
+
h: -1,
|
1208 |
+
m: -1,
|
1209 |
+
s: -1,
|
1210 |
+
l: -1,
|
1211 |
+
c: -1,
|
1212 |
+
t: -1,
|
1213 |
+
z: -1
|
1214 |
+
};
|
1215 |
+
|
1216 |
+
if (finds) {
|
1217 |
+
for (var i = 0; i < finds.length; i++) {
|
1218 |
+
if (orders[finds[i].toString().charAt(0)] === -1) {
|
1219 |
+
orders[finds[i].toString().charAt(0)] = i + 1;
|
1220 |
+
}
|
1221 |
+
}
|
1222 |
+
}
|
1223 |
+
return orders;
|
1224 |
+
};
|
1225 |
+
|
1226 |
+
var regstr = '^' + f.toString()
|
1227 |
+
.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
|
1228 |
+
var ml = match.length;
|
1229 |
+
switch (match.charAt(0).toLowerCase()) {
|
1230 |
+
case 'h':
|
1231 |
+
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
1232 |
+
case 'm':
|
1233 |
+
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
1234 |
+
case 's':
|
1235 |
+
return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
|
1236 |
+
case 'l':
|
1237 |
+
return '(\\d?\\d?\\d)';
|
1238 |
+
case 'c':
|
1239 |
+
return '(\\d?\\d?\\d)';
|
1240 |
+
case 'z':
|
1241 |
+
return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
|
1242 |
+
case 't':
|
1243 |
+
return getPatternAmpm(o.amNames, o.pmNames);
|
1244 |
+
default: // literal escaped in quotes
|
1245 |
+
return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
|
1246 |
+
}
|
1247 |
+
})
|
1248 |
+
.replace(/\s/g, '\\s?') +
|
1249 |
+
o.timeSuffix + '$',
|
1250 |
+
order = getFormatPositions(f),
|
1251 |
+
ampm = '',
|
1252 |
+
treg;
|
1253 |
+
|
1254 |
+
treg = s.match(new RegExp(regstr, 'i'));
|
1255 |
+
|
1256 |
+
var resTime = {
|
1257 |
+
hour: 0,
|
1258 |
+
minute: 0,
|
1259 |
+
second: 0,
|
1260 |
+
millisec: 0,
|
1261 |
+
microsec: 0
|
1262 |
+
};
|
1263 |
+
|
1264 |
+
if (treg) {
|
1265 |
+
if (order.t !== -1) {
|
1266 |
+
if (treg[order.t] === undefined || treg[order.t].length === 0) {
|
1267 |
+
ampm = '';
|
1268 |
+
resTime.ampm = '';
|
1269 |
+
} else {
|
1270 |
+
ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM';
|
1271 |
+
resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
|
1272 |
+
}
|
1273 |
+
}
|
1274 |
+
|
1275 |
+
if (order.h !== -1) {
|
1276 |
+
if (ampm === 'AM' && treg[order.h] === '12') {
|
1277 |
+
resTime.hour = 0; // 12am = 0 hour
|
1278 |
+
} else {
|
1279 |
+
if (ampm === 'PM' && treg[order.h] !== '12') {
|
1280 |
+
resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
|
1281 |
+
} else {
|
1282 |
+
resTime.hour = Number(treg[order.h]);
|
1283 |
+
}
|
1284 |
+
}
|
1285 |
+
}
|
1286 |
+
|
1287 |
+
if (order.m !== -1) {
|
1288 |
+
resTime.minute = Number(treg[order.m]);
|
1289 |
+
}
|
1290 |
+
if (order.s !== -1) {
|
1291 |
+
resTime.second = Number(treg[order.s]);
|
1292 |
+
}
|
1293 |
+
if (order.l !== -1) {
|
1294 |
+
resTime.millisec = Number(treg[order.l]);
|
1295 |
+
}
|
1296 |
+
if (order.c !== -1) {
|
1297 |
+
resTime.microsec = Number(treg[order.c]);
|
1298 |
+
}
|
1299 |
+
if (order.z !== -1 && treg[order.z] !== undefined) {
|
1300 |
+
resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
|
1304 |
+
return resTime;
|
1305 |
+
}
|
1306 |
+
return false;
|
1307 |
+
};// end strictParse
|
1308 |
+
|
1309 |
+
// First try JS Date, if that fails, use strictParse
|
1310 |
+
var looseParse = function (f, s, o) {
|
1311 |
+
try {
|
1312 |
+
var d = new Date('2012-01-01 ' + s);
|
1313 |
+
if (isNaN(d.getTime())) {
|
1314 |
+
d = new Date('2012-01-01T' + s);
|
1315 |
+
if (isNaN(d.getTime())) {
|
1316 |
+
d = new Date('01/01/2012 ' + s);
|
1317 |
+
if (isNaN(d.getTime())) {
|
1318 |
+
throw "Unable to parse time with native Date: " + s;
|
1319 |
+
}
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
return {
|
1324 |
+
hour: d.getHours(),
|
1325 |
+
minute: d.getMinutes(),
|
1326 |
+
second: d.getSeconds(),
|
1327 |
+
millisec: d.getMilliseconds(),
|
1328 |
+
microsec: d.getMicroseconds(),
|
1329 |
+
timezone: d.getTimezoneOffset() * -1
|
1330 |
+
};
|
1331 |
+
}
|
1332 |
+
catch (err) {
|
1333 |
+
try {
|
1334 |
+
return strictParse(f, s, o);
|
1335 |
+
}
|
1336 |
+
catch (err2) {
|
1337 |
+
$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
|
1338 |
+
}
|
1339 |
+
}
|
1340 |
+
return false;
|
1341 |
+
}; // end looseParse
|
1342 |
+
|
1343 |
+
if (typeof o.parse === "function") {
|
1344 |
+
return o.parse(timeFormat, timeString, o);
|
1345 |
+
}
|
1346 |
+
if (o.parse === 'loose') {
|
1347 |
+
return looseParse(timeFormat, timeString, o);
|
1348 |
+
}
|
1349 |
+
return strictParse(timeFormat, timeString, o);
|
1350 |
+
};
|
1351 |
+
|
1352 |
+
/**
|
1353 |
+
* Public utility to format the time
|
1354 |
+
* @param {string} format format of the time
|
1355 |
+
* @param {Object} time Object not a Date for timezones
|
1356 |
+
* @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm
|
1357 |
+
* @returns {string} the formatted time
|
1358 |
+
*/
|
1359 |
+
$.datepicker.formatTime = function (format, time, options) {
|
1360 |
+
options = options || {};
|
1361 |
+
options = $.extend({}, $.timepicker._defaults, options);
|
1362 |
+
time = $.extend({
|
1363 |
+
hour: 0,
|
1364 |
+
minute: 0,
|
1365 |
+
second: 0,
|
1366 |
+
millisec: 0,
|
1367 |
+
microsec: 0,
|
1368 |
+
timezone: null
|
1369 |
+
}, time);
|
1370 |
+
|
1371 |
+
var tmptime = format,
|
1372 |
+
ampmName = options.amNames[0],
|
1373 |
+
hour = parseInt(time.hour, 10);
|
1374 |
+
|
1375 |
+
if (hour > 11) {
|
1376 |
+
ampmName = options.pmNames[0];
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
|
1380 |
+
switch (match) {
|
1381 |
+
case 'HH':
|
1382 |
+
return ('0' + hour).slice(-2);
|
1383 |
+
case 'H':
|
1384 |
+
return hour;
|
1385 |
+
case 'hh':
|
1386 |
+
return ('0' + convert24to12(hour)).slice(-2);
|
1387 |
+
case 'h':
|
1388 |
+
return convert24to12(hour);
|
1389 |
+
case 'mm':
|
1390 |
+
return ('0' + time.minute).slice(-2);
|
1391 |
+
case 'm':
|
1392 |
+
return time.minute;
|
1393 |
+
case 'ss':
|
1394 |
+
return ('0' + time.second).slice(-2);
|
1395 |
+
case 's':
|
1396 |
+
return time.second;
|
1397 |
+
case 'l':
|
1398 |
+
return ('00' + time.millisec).slice(-3);
|
1399 |
+
case 'c':
|
1400 |
+
return ('00' + time.microsec).slice(-3);
|
1401 |
+
case 'z':
|
1402 |
+
return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
|
1403 |
+
case 'Z':
|
1404 |
+
return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
|
1405 |
+
case 'T':
|
1406 |
+
return ampmName.charAt(0).toUpperCase();
|
1407 |
+
case 'TT':
|
1408 |
+
return ampmName.toUpperCase();
|
1409 |
+
case 't':
|
1410 |
+
return ampmName.charAt(0).toLowerCase();
|
1411 |
+
case 'tt':
|
1412 |
+
return ampmName.toLowerCase();
|
1413 |
+
default:
|
1414 |
+
return match.replace(/'/g, "");
|
1415 |
+
}
|
1416 |
+
});
|
1417 |
+
|
1418 |
+
return tmptime;
|
1419 |
+
};
|
1420 |
+
|
1421 |
+
/*
|
1422 |
+
* the bad hack :/ override datepicker so it doesn't close on select
|
1423 |
+
// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
|
1424 |
+
*/
|
1425 |
+
$.datepicker._base_selectDate = $.datepicker._selectDate;
|
1426 |
+
$.datepicker._selectDate = function (id, dateStr) {
|
1427 |
+
var inst = this._getInst($(id)[0]),
|
1428 |
+
tp_inst = this._get(inst, 'timepicker'),
|
1429 |
+
was_inline;
|
1430 |
+
|
1431 |
+
if (tp_inst && inst.settings.showTimepicker) {
|
1432 |
+
tp_inst._limitMinMaxDateTime(inst, true);
|
1433 |
+
was_inline = inst.inline;
|
1434 |
+
inst.inline = inst.stay_open = true;
|
1435 |
+
//This way the onSelect handler called from calendarpicker get the full dateTime
|
1436 |
+
this._base_selectDate(id, dateStr);
|
1437 |
+
inst.inline = was_inline;
|
1438 |
+
inst.stay_open = false;
|
1439 |
+
this._notifyChange(inst);
|
1440 |
+
this._updateDatepicker(inst);
|
1441 |
+
} else {
|
1442 |
+
this._base_selectDate(id, dateStr);
|
1443 |
+
}
|
1444 |
+
};
|
1445 |
+
|
1446 |
+
/*
|
1447 |
+
* second bad hack :/ override datepicker so it triggers an event when changing the input field
|
1448 |
+
* and does not redraw the datepicker on every selectDate event
|
1449 |
+
*/
|
1450 |
+
$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
|
1451 |
+
$.datepicker._updateDatepicker = function (inst) {
|
1452 |
+
|
1453 |
+
// don't popup the datepicker if there is another instance already opened
|
1454 |
+
var input = inst.input[0];
|
1455 |
+
if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
|
1456 |
+
return;
|
1457 |
+
}
|
1458 |
+
|
1459 |
+
if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
|
1460 |
+
|
1461 |
+
this._base_updateDatepicker(inst);
|
1462 |
+
|
1463 |
+
// Reload the time control when changing something in the input text field.
|
1464 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1465 |
+
if (tp_inst) {
|
1466 |
+
tp_inst._addTimePicker(inst);
|
1467 |
+
}
|
1468 |
+
}
|
1469 |
+
};
|
1470 |
+
|
1471 |
+
/*
|
1472 |
+
* third bad hack :/ override datepicker so it allows spaces and colon in the input field
|
1473 |
+
*/
|
1474 |
+
$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
|
1475 |
+
$.datepicker._doKeyPress = function (event) {
|
1476 |
+
var inst = $.datepicker._getInst(event.target),
|
1477 |
+
tp_inst = $.datepicker._get(inst, 'timepicker');
|
1478 |
+
|
1479 |
+
if (tp_inst) {
|
1480 |
+
if ($.datepicker._get(inst, 'constrainInput')) {
|
1481 |
+
var ampm = tp_inst.support.ampm,
|
1482 |
+
tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
|
1483 |
+
dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
|
1484 |
+
datetimeChars = tp_inst._defaults.timeFormat.toString()
|
1485 |
+
.replace(/[hms]/g, '')
|
1486 |
+
.replace(/TT/g, ampm ? 'APM' : '')
|
1487 |
+
.replace(/Tt/g, ampm ? 'AaPpMm' : '')
|
1488 |
+
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
1489 |
+
.replace(/T/g, ampm ? 'AP' : '')
|
1490 |
+
.replace(/tt/g, ampm ? 'apm' : '')
|
1491 |
+
.replace(/t/g, ampm ? 'ap' : '') +
|
1492 |
+
" " + tp_inst._defaults.separator +
|
1493 |
+
tp_inst._defaults.timeSuffix +
|
1494 |
+
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
1495 |
+
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
1496 |
+
dateChars,
|
1497 |
+
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
|
1498 |
+
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
1499 |
+
}
|
1500 |
+
}
|
1501 |
+
|
1502 |
+
return $.datepicker._base_doKeyPress(event);
|
1503 |
+
};
|
1504 |
+
|
1505 |
+
/*
|
1506 |
+
* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
|
1507 |
+
* Update any alternate field to synchronise with the main field.
|
1508 |
+
*/
|
1509 |
+
$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
|
1510 |
+
$.datepicker._updateAlternate = function (inst) {
|
1511 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1512 |
+
if (tp_inst) {
|
1513 |
+
var altField = tp_inst._defaults.altField;
|
1514 |
+
if (altField) { // update alternate field too
|
1515 |
+
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
|
1516 |
+
date = this._getDate(inst),
|
1517 |
+
formatCfg = $.datepicker._getFormatConfig(inst),
|
1518 |
+
altFormattedDateTime = '',
|
1519 |
+
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
1520 |
+
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
|
1521 |
+
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
|
1522 |
+
|
1523 |
+
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
|
1524 |
+
if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
|
1525 |
+
if (tp_inst._defaults.altFormat) {
|
1526 |
+
altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
|
1527 |
+
}
|
1528 |
+
else {
|
1529 |
+
altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
|
1530 |
+
}
|
1531 |
+
}
|
1532 |
+
$(altField).val( inst.input.val() ? altFormattedDateTime : "");
|
1533 |
+
}
|
1534 |
+
}
|
1535 |
+
else {
|
1536 |
+
$.datepicker._base_updateAlternate(inst);
|
1537 |
+
}
|
1538 |
+
};
|
1539 |
+
|
1540 |
+
/*
|
1541 |
+
* Override key up event to sync manual input changes.
|
1542 |
+
*/
|
1543 |
+
$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
|
1544 |
+
$.datepicker._doKeyUp = function (event) {
|
1545 |
+
var inst = $.datepicker._getInst(event.target),
|
1546 |
+
tp_inst = $.datepicker._get(inst, 'timepicker');
|
1547 |
+
|
1548 |
+
if (tp_inst) {
|
1549 |
+
if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
|
1550 |
+
try {
|
1551 |
+
$.datepicker._updateDatepicker(inst);
|
1552 |
+
} catch (err) {
|
1553 |
+
$.timepicker.log(err);
|
1554 |
+
}
|
1555 |
+
}
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
return $.datepicker._base_doKeyUp(event);
|
1559 |
+
};
|
1560 |
+
|
1561 |
+
/*
|
1562 |
+
* override "Today" button to also grab the time and set it to input field.
|
1563 |
+
*/
|
1564 |
+
$.datepicker._base_gotoToday = $.datepicker._gotoToday;
|
1565 |
+
$.datepicker._gotoToday = function (id) {
|
1566 |
+
var inst = this._getInst($(id)[0]);
|
1567 |
+
this._base_gotoToday(id);
|
1568 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1569 |
+
var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);
|
1570 |
+
var now = new Date();
|
1571 |
+
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + tzoffset);
|
1572 |
+
this._setTime(inst, now);
|
1573 |
+
this._setDate(inst, now);
|
1574 |
+
tp_inst._onSelectHandler();
|
1575 |
+
};
|
1576 |
+
|
1577 |
+
/*
|
1578 |
+
* Disable & enable the Time in the datetimepicker
|
1579 |
+
*/
|
1580 |
+
$.datepicker._disableTimepickerDatepicker = function (target) {
|
1581 |
+
var inst = this._getInst(target);
|
1582 |
+
if (!inst) {
|
1583 |
+
return;
|
1584 |
+
}
|
1585 |
+
|
1586 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1587 |
+
$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
|
1588 |
+
if (tp_inst) {
|
1589 |
+
inst.settings.showTimepicker = false;
|
1590 |
+
tp_inst._defaults.showTimepicker = false;
|
1591 |
+
tp_inst._updateDateTime(inst);
|
1592 |
+
}
|
1593 |
+
};
|
1594 |
+
|
1595 |
+
$.datepicker._enableTimepickerDatepicker = function (target) {
|
1596 |
+
var inst = this._getInst(target);
|
1597 |
+
if (!inst) {
|
1598 |
+
return;
|
1599 |
+
}
|
1600 |
+
|
1601 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1602 |
+
$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
|
1603 |
+
if (tp_inst) {
|
1604 |
+
inst.settings.showTimepicker = true;
|
1605 |
+
tp_inst._defaults.showTimepicker = true;
|
1606 |
+
tp_inst._addTimePicker(inst); // Could be disabled on page load
|
1607 |
+
tp_inst._updateDateTime(inst);
|
1608 |
+
}
|
1609 |
+
};
|
1610 |
+
|
1611 |
+
/*
|
1612 |
+
* Create our own set time function
|
1613 |
+
*/
|
1614 |
+
$.datepicker._setTime = function (inst, date) {
|
1615 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1616 |
+
if (tp_inst) {
|
1617 |
+
var defaults = tp_inst._defaults;
|
1618 |
+
|
1619 |
+
// calling _setTime with no date sets time to defaults
|
1620 |
+
tp_inst.hour = date ? date.getHours() : defaults.hour;
|
1621 |
+
tp_inst.minute = date ? date.getMinutes() : defaults.minute;
|
1622 |
+
tp_inst.second = date ? date.getSeconds() : defaults.second;
|
1623 |
+
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
|
1624 |
+
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
|
1625 |
+
|
1626 |
+
//check if within min/max times..
|
1627 |
+
tp_inst._limitMinMaxDateTime(inst, true);
|
1628 |
+
|
1629 |
+
tp_inst._onTimeChange();
|
1630 |
+
tp_inst._updateDateTime(inst);
|
1631 |
+
}
|
1632 |
+
};
|
1633 |
+
|
1634 |
+
/*
|
1635 |
+
* Create new public method to set only time, callable as $().datepicker('setTime', date)
|
1636 |
+
*/
|
1637 |
+
$.datepicker._setTimeDatepicker = function (target, date, withDate) {
|
1638 |
+
var inst = this._getInst(target);
|
1639 |
+
if (!inst) {
|
1640 |
+
return;
|
1641 |
+
}
|
1642 |
+
|
1643 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1644 |
+
|
1645 |
+
if (tp_inst) {
|
1646 |
+
this._setDateFromField(inst);
|
1647 |
+
var tp_date;
|
1648 |
+
if (date) {
|
1649 |
+
if (typeof date === "string") {
|
1650 |
+
tp_inst._parseTime(date, withDate);
|
1651 |
+
tp_date = new Date();
|
1652 |
+
tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
1653 |
+
tp_date.setMicroseconds(tp_inst.microsec);
|
1654 |
+
} else {
|
1655 |
+
tp_date = new Date(date.getTime());
|
1656 |
+
tp_date.setMicroseconds(date.getMicroseconds());
|
1657 |
+
}
|
1658 |
+
if (tp_date.toString() === 'Invalid Date') {
|
1659 |
+
tp_date = undefined;
|
1660 |
+
}
|
1661 |
+
this._setTime(inst, tp_date);
|
1662 |
+
}
|
1663 |
+
}
|
1664 |
+
|
1665 |
+
};
|
1666 |
+
|
1667 |
+
/*
|
1668 |
+
* override setDate() to allow setting time too within Date object
|
1669 |
+
*/
|
1670 |
+
$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
|
1671 |
+
$.datepicker._setDateDatepicker = function (target, _date) {
|
1672 |
+
var inst = this._getInst(target);
|
1673 |
+
var date = _date;
|
1674 |
+
if (!inst) {
|
1675 |
+
return;
|
1676 |
+
}
|
1677 |
+
|
1678 |
+
if (typeof(_date) === 'string') {
|
1679 |
+
date = new Date(_date);
|
1680 |
+
if (!date.getTime()) {
|
1681 |
+
this._base_setDateDatepicker.apply(this, arguments);
|
1682 |
+
date = $(target).datepicker('getDate');
|
1683 |
+
}
|
1684 |
+
}
|
1685 |
+
|
1686 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1687 |
+
var tp_date;
|
1688 |
+
if (date instanceof Date) {
|
1689 |
+
tp_date = new Date(date.getTime());
|
1690 |
+
tp_date.setMicroseconds(date.getMicroseconds());
|
1691 |
+
} else {
|
1692 |
+
tp_date = date;
|
1693 |
+
}
|
1694 |
+
|
1695 |
+
// This is important if you are using the timezone option, javascript's Date
|
1696 |
+
// object will only return the timezone offset for the current locale, so we
|
1697 |
+
// adjust it accordingly. If not using timezone option this won't matter..
|
1698 |
+
// If a timezone is different in tp, keep the timezone as is
|
1699 |
+
if (tp_inst && tp_date) {
|
1700 |
+
// look out for DST if tz wasn't specified
|
1701 |
+
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
1702 |
+
tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
|
1703 |
+
}
|
1704 |
+
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
|
1705 |
+
tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
this._updateDatepicker(inst);
|
1709 |
+
this._base_setDateDatepicker.apply(this, arguments);
|
1710 |
+
this._setTimeDatepicker(target, tp_date, true);
|
1711 |
+
};
|
1712 |
+
|
1713 |
+
/*
|
1714 |
+
* override getDate() to allow getting time too within Date object
|
1715 |
+
*/
|
1716 |
+
$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
|
1717 |
+
$.datepicker._getDateDatepicker = function (target, noDefault) {
|
1718 |
+
var inst = this._getInst(target);
|
1719 |
+
if (!inst) {
|
1720 |
+
return;
|
1721 |
+
}
|
1722 |
+
|
1723 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1724 |
+
|
1725 |
+
if (tp_inst) {
|
1726 |
+
// if it hasn't yet been defined, grab from field
|
1727 |
+
if (inst.lastVal === undefined) {
|
1728 |
+
this._setDateFromField(inst, noDefault);
|
1729 |
+
}
|
1730 |
+
|
1731 |
+
var date = this._getDate(inst);
|
1732 |
+
var currDT = $.trim((tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) ? tp_inst.$input.val() + ' ' + tp_inst.$altInput.val() : tp_inst.$input.val());
|
1733 |
+
if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {
|
1734 |
+
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
1735 |
+
date.setMicroseconds(tp_inst.microsec);
|
1736 |
+
|
1737 |
+
// This is important if you are using the timezone option, javascript's Date
|
1738 |
+
// object will only return the timezone offset for the current locale, so we
|
1739 |
+
// adjust it accordingly. If not using timezone option this won't matter..
|
1740 |
+
if (tp_inst.timezone != null) {
|
1741 |
+
// look out for DST if tz wasn't specified
|
1742 |
+
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
|
1743 |
+
tp_inst.timezone = date.getTimezoneOffset() * -1;
|
1744 |
+
}
|
1745 |
+
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
|
1746 |
+
}
|
1747 |
+
}
|
1748 |
+
return date;
|
1749 |
+
}
|
1750 |
+
return this._base_getDateDatepicker(target, noDefault);
|
1751 |
+
};
|
1752 |
+
|
1753 |
+
/*
|
1754 |
+
* override parseDate() because UI 1.8.14 throws an error about "Extra characters"
|
1755 |
+
* An option in datapicker to ignore extra format characters would be nicer.
|
1756 |
+
*/
|
1757 |
+
$.datepicker._base_parseDate = $.datepicker.parseDate;
|
1758 |
+
$.datepicker.parseDate = function (format, value, settings) {
|
1759 |
+
var date;
|
1760 |
+
try {
|
1761 |
+
date = this._base_parseDate(format, value, settings);
|
1762 |
+
} catch (err) {
|
1763 |
+
// Hack! The error message ends with a colon, a space, and
|
1764 |
+
// the "extra" characters. We rely on that instead of
|
1765 |
+
// attempting to perfectly reproduce the parsing algorithm.
|
1766 |
+
if (err.indexOf(":") >= 0) {
|
1767 |
+
date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);
|
1768 |
+
$.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
|
1769 |
+
} else {
|
1770 |
+
throw err;
|
1771 |
+
}
|
1772 |
+
}
|
1773 |
+
return date;
|
1774 |
+
};
|
1775 |
+
|
1776 |
+
/*
|
1777 |
+
* override formatDate to set date with time to the input
|
1778 |
+
*/
|
1779 |
+
$.datepicker._base_formatDate = $.datepicker._formatDate;
|
1780 |
+
$.datepicker._formatDate = function (inst, day, month, year) {
|
1781 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1782 |
+
if (tp_inst) {
|
1783 |
+
tp_inst._updateDateTime(inst);
|
1784 |
+
return tp_inst.$input.val();
|
1785 |
+
}
|
1786 |
+
return this._base_formatDate(inst);
|
1787 |
+
};
|
1788 |
+
|
1789 |
+
/*
|
1790 |
+
* override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
|
1791 |
+
*/
|
1792 |
+
$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
|
1793 |
+
$.datepicker._optionDatepicker = function (target, name, value) {
|
1794 |
+
var inst = this._getInst(target),
|
1795 |
+
name_clone;
|
1796 |
+
if (!inst) {
|
1797 |
+
return null;
|
1798 |
+
}
|
1799 |
+
|
1800 |
+
var tp_inst = this._get(inst, 'timepicker');
|
1801 |
+
if (tp_inst) {
|
1802 |
+
var min = null,
|
1803 |
+
max = null,
|
1804 |
+
onselect = null,
|
1805 |
+
overrides = tp_inst._defaults.evnts,
|
1806 |
+
fns = {},
|
1807 |
+
prop,
|
1808 |
+
ret,
|
1809 |
+
oldVal,
|
1810 |
+
$target;
|
1811 |
+
if (typeof name === 'string') { // if min/max was set with the string
|
1812 |
+
if (name === 'minDate' || name === 'minDateTime') {
|
1813 |
+
min = value;
|
1814 |
+
} else if (name === 'maxDate' || name === 'maxDateTime') {
|
1815 |
+
max = value;
|
1816 |
+
} else if (name === 'onSelect') {
|
1817 |
+
onselect = value;
|
1818 |
+
} else if (overrides.hasOwnProperty(name)) {
|
1819 |
+
if (typeof (value) === 'undefined') {
|
1820 |
+
return overrides[name];
|
1821 |
+
}
|
1822 |
+
fns[name] = value;
|
1823 |
+
name_clone = {}; //empty results in exiting function after overrides updated
|
1824 |
+
}
|
1825 |
+
} else if (typeof name === 'object') { //if min/max was set with the JSON
|
1826 |
+
if (name.minDate) {
|
1827 |
+
min = name.minDate;
|
1828 |
+
} else if (name.minDateTime) {
|
1829 |
+
min = name.minDateTime;
|
1830 |
+
} else if (name.maxDate) {
|
1831 |
+
max = name.maxDate;
|
1832 |
+
} else if (name.maxDateTime) {
|
1833 |
+
max = name.maxDateTime;
|
1834 |
+
}
|
1835 |
+
for (prop in overrides) {
|
1836 |
+
if (overrides.hasOwnProperty(prop) && name[prop]) {
|
1837 |
+
fns[prop] = name[prop];
|
1838 |
+
}
|
1839 |
+
}
|
1840 |
+
}
|
1841 |
+
for (prop in fns) {
|
1842 |
+
if (fns.hasOwnProperty(prop)) {
|
1843 |
+
overrides[prop] = fns[prop];
|
1844 |
+
if (!name_clone) { name_clone = $.extend({}, name); }
|
1845 |
+
delete name_clone[prop];
|
1846 |
+
}
|
1847 |
+
}
|
1848 |
+
if (name_clone && isEmptyObject(name_clone)) { return; }
|
1849 |
+
if (min) { //if min was set
|
1850 |
+
if (min === 0) {
|
1851 |
+
min = new Date();
|
1852 |
+
} else {
|
1853 |
+
min = new Date(min);
|
1854 |
+
}
|
1855 |
+
tp_inst._defaults.minDate = min;
|
1856 |
+
tp_inst._defaults.minDateTime = min;
|
1857 |
+
} else if (max) { //if max was set
|
1858 |
+
if (max === 0) {
|
1859 |
+
max = new Date();
|
1860 |
+
} else {
|
1861 |
+
max = new Date(max);
|
1862 |
+
}
|
1863 |
+
tp_inst._defaults.maxDate = max;
|
1864 |
+
tp_inst._defaults.maxDateTime = max;
|
1865 |
+
} else if (onselect) {
|
1866 |
+
tp_inst._defaults.onSelect = onselect;
|
1867 |
+
}
|
1868 |
+
|
1869 |
+
// Datepicker will override our date when we call _base_optionDatepicker when
|
1870 |
+
// calling minDate/maxDate, so we will first grab the value, call
|
1871 |
+
// _base_optionDatepicker, then set our value back.
|
1872 |
+
if(min || max){
|
1873 |
+
$target = $(target);
|
1874 |
+
oldVal = $target.datetimepicker('getDate');
|
1875 |
+
ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
1876 |
+
$target.datetimepicker('setDate', oldVal);
|
1877 |
+
return ret;
|
1878 |
+
}
|
1879 |
+
}
|
1880 |
+
if (value === undefined) {
|
1881 |
+
return this._base_optionDatepicker.call($.datepicker, target, name);
|
1882 |
+
}
|
1883 |
+
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
1884 |
+
};
|
1885 |
+
|
1886 |
+
/*
|
1887 |
+
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
|
1888 |
+
* it will return false for all objects
|
1889 |
+
*/
|
1890 |
+
var isEmptyObject = function (obj) {
|
1891 |
+
var prop;
|
1892 |
+
for (prop in obj) {
|
1893 |
+
if (obj.hasOwnProperty(prop)) {
|
1894 |
+
return false;
|
1895 |
+
}
|
1896 |
+
}
|
1897 |
+
return true;
|
1898 |
+
};
|
1899 |
+
|
1900 |
+
/*
|
1901 |
+
* jQuery extend now ignores nulls!
|
1902 |
+
*/
|
1903 |
+
var extendRemove = function (target, props) {
|
1904 |
+
$.extend(target, props);
|
1905 |
+
for (var name in props) {
|
1906 |
+
if (props[name] === null || props[name] === undefined) {
|
1907 |
+
target[name] = props[name];
|
1908 |
+
}
|
1909 |
+
}
|
1910 |
+
return target;
|
1911 |
+
};
|
1912 |
+
|
1913 |
+
/*
|
1914 |
+
* Determine by the time format which units are supported
|
1915 |
+
* Returns an object of booleans for each unit
|
1916 |
+
*/
|
1917 |
+
var detectSupport = function (timeFormat) {
|
1918 |
+
var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
|
1919 |
+
isIn = function (f, t) { // does the format contain the token?
|
1920 |
+
return f.indexOf(t) !== -1 ? true : false;
|
1921 |
+
};
|
1922 |
+
return {
|
1923 |
+
hour: isIn(tf, 'h'),
|
1924 |
+
minute: isIn(tf, 'm'),
|
1925 |
+
second: isIn(tf, 's'),
|
1926 |
+
millisec: isIn(tf, 'l'),
|
1927 |
+
microsec: isIn(tf, 'c'),
|
1928 |
+
timezone: isIn(tf, 'z'),
|
1929 |
+
ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
|
1930 |
+
iso8601: isIn(timeFormat, 'Z')
|
1931 |
+
};
|
1932 |
+
};
|
1933 |
+
|
1934 |
+
/*
|
1935 |
+
* Converts 24 hour format into 12 hour
|
1936 |
+
* Returns 12 hour without leading 0
|
1937 |
+
*/
|
1938 |
+
var convert24to12 = function (hour) {
|
1939 |
+
hour %= 12;
|
1940 |
+
|
1941 |
+
if (hour === 0) {
|
1942 |
+
hour = 12;
|
1943 |
+
}
|
1944 |
+
|
1945 |
+
return String(hour);
|
1946 |
+
};
|
1947 |
+
|
1948 |
+
var computeEffectiveSetting = function (settings, property) {
|
1949 |
+
return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];
|
1950 |
+
};
|
1951 |
+
|
1952 |
+
/*
|
1953 |
+
* Splits datetime string into date and time substrings.
|
1954 |
+
* Throws exception when date can't be parsed
|
1955 |
+
* Returns {dateString: dateString, timeString: timeString}
|
1956 |
+
*/
|
1957 |
+
var splitDateTime = function (dateTimeString, timeSettings) {
|
1958 |
+
// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
|
1959 |
+
// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
|
1960 |
+
var separator = computeEffectiveSetting(timeSettings, 'separator'),
|
1961 |
+
format = computeEffectiveSetting(timeSettings, 'timeFormat'),
|
1962 |
+
timeParts = format.split(separator), // how many occurrences of separator may be in our format?
|
1963 |
+
timePartsLen = timeParts.length,
|
1964 |
+
allParts = dateTimeString.split(separator),
|
1965 |
+
allPartsLen = allParts.length;
|
1966 |
+
|
1967 |
+
if (allPartsLen > 1) {
|
1968 |
+
return {
|
1969 |
+
dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
|
1970 |
+
timeString: allParts.splice(0, timePartsLen).join(separator)
|
1971 |
+
};
|
1972 |
+
}
|
1973 |
+
|
1974 |
+
return {
|
1975 |
+
dateString: dateTimeString,
|
1976 |
+
timeString: ''
|
1977 |
+
};
|
1978 |
+
};
|
1979 |
+
|
1980 |
+
/*
|
1981 |
+
* Internal function to parse datetime interval
|
1982 |
+
* Returns: {date: Date, timeObj: Object}, where
|
1983 |
+
* date - parsed date without time (type Date)
|
1984 |
+
* timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional
|
1985 |
+
*/
|
1986 |
+
var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
|
1987 |
+
var date,
|
1988 |
+
parts,
|
1989 |
+
parsedTime;
|
1990 |
+
|
1991 |
+
parts = splitDateTime(dateTimeString, timeSettings);
|
1992 |
+
date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);
|
1993 |
+
|
1994 |
+
if (parts.timeString === '') {
|
1995 |
+
return {
|
1996 |
+
date: date
|
1997 |
+
};
|
1998 |
+
}
|
1999 |
+
|
2000 |
+
parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);
|
2001 |
+
|
2002 |
+
if (!parsedTime) {
|
2003 |
+
throw 'Wrong time format';
|
2004 |
+
}
|
2005 |
+
|
2006 |
+
return {
|
2007 |
+
date: date,
|
2008 |
+
timeObj: parsedTime
|
2009 |
+
};
|
2010 |
+
};
|
2011 |
+
|
2012 |
+
/*
|
2013 |
+
* Internal function to set timezone_select to the local timezone
|
2014 |
+
*/
|
2015 |
+
var selectLocalTimezone = function (tp_inst, date) {
|
2016 |
+
if (tp_inst && tp_inst.timezone_select) {
|
2017 |
+
var now = date || new Date();
|
2018 |
+
tp_inst.timezone_select.val(-now.getTimezoneOffset());
|
2019 |
+
}
|
2020 |
+
};
|
2021 |
+
|
2022 |
+
/*
|
2023 |
+
* Create a Singleton Instance
|
2024 |
+
*/
|
2025 |
+
$.timepicker = new Timepicker();
|
2026 |
+
|
2027 |
+
/**
|
2028 |
+
* Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
|
2029 |
+
* @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned
|
2030 |
+
* @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45"
|
2031 |
+
* @return {string}
|
2032 |
+
*/
|
2033 |
+
$.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {
|
2034 |
+
if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
|
2035 |
+
return tzMinutes;
|
2036 |
+
}
|
2037 |
+
|
2038 |
+
var off = tzMinutes,
|
2039 |
+
minutes = off % 60,
|
2040 |
+
hours = (off - minutes) / 60,
|
2041 |
+
iso = iso8601 ? ':' : '',
|
2042 |
+
tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
|
2043 |
+
|
2044 |
+
if (tz === '+00:00') {
|
2045 |
+
return 'Z';
|
2046 |
+
}
|
2047 |
+
return tz;
|
2048 |
+
};
|
2049 |
+
|
2050 |
+
/**
|
2051 |
+
* Get the number in minutes that represents a timezone string
|
2052 |
+
* @param {string} tzString formatted like "+0500", "-1245", "Z"
|
2053 |
+
* @return {number} the offset minutes or the original string if it doesn't match expectations
|
2054 |
+
*/
|
2055 |
+
$.timepicker.timezoneOffsetNumber = function (tzString) {
|
2056 |
+
var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245"
|
2057 |
+
|
2058 |
+
if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset
|
2059 |
+
return 0;
|
2060 |
+
}
|
2061 |
+
|
2062 |
+
if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
|
2063 |
+
return tzString;
|
2064 |
+
}
|
2065 |
+
|
2066 |
+
return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
|
2067 |
+
((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
|
2068 |
+
parseInt(normalized.substr(3, 2), 10))); // minutes
|
2069 |
+
};
|
2070 |
+
|
2071 |
+
/**
|
2072 |
+
* No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
|
2073 |
+
* @param {Date} date
|
2074 |
+
* @param {string} toTimezone formatted like "+0500", "-1245"
|
2075 |
+
* @return {Date}
|
2076 |
+
*/
|
2077 |
+
$.timepicker.timezoneAdjust = function (date, toTimezone) {
|
2078 |
+
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
|
2079 |
+
if (!isNaN(toTz)) {
|
2080 |
+
date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
|
2081 |
+
}
|
2082 |
+
return date;
|
2083 |
+
};
|
2084 |
+
|
2085 |
+
/**
|
2086 |
+
* Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
|
2087 |
+
* enforce date range limits.
|
2088 |
+
* n.b. The input value must be correctly formatted (reformatting is not supported)
|
2089 |
+
* @param {Element} startTime
|
2090 |
+
* @param {Element} endTime
|
2091 |
+
* @param {Object} options Options for the timepicker() call
|
2092 |
+
* @return {jQuery}
|
2093 |
+
*/
|
2094 |
+
$.timepicker.timeRange = function (startTime, endTime, options) {
|
2095 |
+
return $.timepicker.handleRange('timepicker', startTime, endTime, options);
|
2096 |
+
};
|
2097 |
+
|
2098 |
+
/**
|
2099 |
+
* Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
|
2100 |
+
* enforce date range limits.
|
2101 |
+
* @param {Element} startTime
|
2102 |
+
* @param {Element} endTime
|
2103 |
+
* @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
|
2104 |
+
* a boolean value that can be used to reformat the input values to the `dateFormat`.
|
2105 |
+
* @param {string} method Can be used to specify the type of picker to be added
|
2106 |
+
* @return {jQuery}
|
2107 |
+
*/
|
2108 |
+
$.timepicker.datetimeRange = function (startTime, endTime, options) {
|
2109 |
+
$.timepicker.handleRange('datetimepicker', startTime, endTime, options);
|
2110 |
+
};
|
2111 |
+
|
2112 |
+
/**
|
2113 |
+
* Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to
|
2114 |
+
* enforce date range limits.
|
2115 |
+
* @param {Element} startTime
|
2116 |
+
* @param {Element} endTime
|
2117 |
+
* @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
|
2118 |
+
* a boolean value that can be used to reformat the input values to the `dateFormat`.
|
2119 |
+
* @return {jQuery}
|
2120 |
+
*/
|
2121 |
+
$.timepicker.dateRange = function (startTime, endTime, options) {
|
2122 |
+
$.timepicker.handleRange('datepicker', startTime, endTime, options);
|
2123 |
+
};
|
2124 |
+
|
2125 |
+
/**
|
2126 |
+
* Calls `method` on the `startTime` and `endTime` elements, and configures them to
|
2127 |
+
* enforce date range limits.
|
2128 |
+
* @param {string} method Can be used to specify the type of picker to be added
|
2129 |
+
* @param {Element} startTime
|
2130 |
+
* @param {Element} endTime
|
2131 |
+
* @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,
|
2132 |
+
* a boolean value that can be used to reformat the input values to the `dateFormat`.
|
2133 |
+
* @return {jQuery}
|
2134 |
+
*/
|
2135 |
+
$.timepicker.handleRange = function (method, startTime, endTime, options) {
|
2136 |
+
options = $.extend({}, {
|
2137 |
+
minInterval: 0, // min allowed interval in milliseconds
|
2138 |
+
maxInterval: 0, // max allowed interval in milliseconds
|
2139 |
+
start: {}, // options for start picker
|
2140 |
+
end: {} // options for end picker
|
2141 |
+
}, options);
|
2142 |
+
|
2143 |
+
// for the mean time this fixes an issue with calling getDate with timepicker()
|
2144 |
+
var timeOnly = false;
|
2145 |
+
if(method === 'timepicker'){
|
2146 |
+
timeOnly = true;
|
2147 |
+
method = 'datetimepicker';
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
function checkDates(changed, other) {
|
2151 |
+
var startdt = startTime[method]('getDate'),
|
2152 |
+
enddt = endTime[method]('getDate'),
|
2153 |
+
changeddt = changed[method]('getDate');
|
2154 |
+
|
2155 |
+
if (startdt !== null) {
|
2156 |
+
var minDate = new Date(startdt.getTime()),
|
2157 |
+
maxDate = new Date(startdt.getTime());
|
2158 |
+
|
2159 |
+
minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
|
2160 |
+
maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);
|
2161 |
+
|
2162 |
+
if (options.minInterval > 0 && minDate > enddt) { // minInterval check
|
2163 |
+
endTime[method]('setDate', minDate);
|
2164 |
+
}
|
2165 |
+
else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check
|
2166 |
+
endTime[method]('setDate', maxDate);
|
2167 |
+
}
|
2168 |
+
else if (startdt > enddt) {
|
2169 |
+
other[method]('setDate', changeddt);
|
2170 |
+
}
|
2171 |
+
}
|
2172 |
+
}
|
2173 |
+
|
2174 |
+
function selected(changed, other, option) {
|
2175 |
+
if (!changed.val()) {
|
2176 |
+
return;
|
2177 |
+
}
|
2178 |
+
var date = changed[method].call(changed, 'getDate');
|
2179 |
+
if (date !== null && options.minInterval > 0) {
|
2180 |
+
if (option === 'minDate') {
|
2181 |
+
date.setMilliseconds(date.getMilliseconds() + options.minInterval);
|
2182 |
+
}
|
2183 |
+
if (option === 'maxDate') {
|
2184 |
+
date.setMilliseconds(date.getMilliseconds() - options.minInterval);
|
2185 |
+
}
|
2186 |
+
}
|
2187 |
+
|
2188 |
+
if (date.getTime) {
|
2189 |
+
other[method].call(other, 'option', option, date);
|
2190 |
+
}
|
2191 |
+
}
|
2192 |
+
|
2193 |
+
$.fn[method].call(startTime, $.extend({
|
2194 |
+
timeOnly: timeOnly,
|
2195 |
+
onClose: function (dateText, inst) {
|
2196 |
+
checkDates($(this), endTime);
|
2197 |
+
},
|
2198 |
+
onSelect: function (selectedDateTime) {
|
2199 |
+
selected($(this), endTime, 'minDate');
|
2200 |
+
}
|
2201 |
+
}, options, options.start));
|
2202 |
+
$.fn[method].call(endTime, $.extend({
|
2203 |
+
timeOnly: timeOnly,
|
2204 |
+
onClose: function (dateText, inst) {
|
2205 |
+
checkDates($(this), startTime);
|
2206 |
+
},
|
2207 |
+
onSelect: function (selectedDateTime) {
|
2208 |
+
selected($(this), startTime, 'maxDate');
|
2209 |
+
}
|
2210 |
+
}, options, options.end));
|
2211 |
+
|
2212 |
+
checkDates(startTime, endTime);
|
2213 |
+
|
2214 |
+
selected(startTime, endTime, 'minDate');
|
2215 |
+
selected(endTime, startTime, 'maxDate');
|
2216 |
+
|
2217 |
+
return $([startTime.get(0), endTime.get(0)]);
|
2218 |
+
};
|
2219 |
+
|
2220 |
+
/**
|
2221 |
+
* Log error or data to the console during error or debugging
|
2222 |
+
* @param {Object} err pass any type object to log to the console during error or debugging
|
2223 |
+
* @return {void}
|
2224 |
+
*/
|
2225 |
+
$.timepicker.log = function () {
|
2226 |
+
if (window.console) {
|
2227 |
+
window.console.log.apply(window.console, Array.prototype.slice.call(arguments));
|
2228 |
+
}
|
2229 |
+
};
|
2230 |
+
|
2231 |
+
/*
|
2232 |
+
* Add util object to allow access to private methods for testability.
|
2233 |
+
*/
|
2234 |
+
$.timepicker._util = {
|
2235 |
+
_extendRemove: extendRemove,
|
2236 |
+
_isEmptyObject: isEmptyObject,
|
2237 |
+
_convert24to12: convert24to12,
|
2238 |
+
_detectSupport: detectSupport,
|
2239 |
+
_selectLocalTimezone: selectLocalTimezone,
|
2240 |
+
_computeEffectiveSetting: computeEffectiveSetting,
|
2241 |
+
_splitDateTime: splitDateTime,
|
2242 |
+
_parseDateTimeInternal: parseDateTimeInternal
|
2243 |
+
};
|
2244 |
+
|
2245 |
+
/*
|
2246 |
+
* Microsecond support
|
2247 |
+
*/
|
2248 |
+
if (!Date.prototype.getMicroseconds) {
|
2249 |
+
Date.prototype.microseconds = 0;
|
2250 |
+
Date.prototype.getMicroseconds = function () { return this.microseconds; };
|
2251 |
+
Date.prototype.setMicroseconds = function (m) {
|
2252 |
+
this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));
|
2253 |
+
this.microseconds = m % 1000;
|
2254 |
+
return this;
|
2255 |
+
};
|
2256 |
+
}
|
2257 |
+
|
2258 |
+
/*
|
2259 |
+
* Keep up with the version
|
2260 |
+
*/
|
2261 |
+
$.timepicker.version = "1.6.1";
|
2262 |
+
|
2263 |
+
})));
|
jquery.sortable.js → js/jquery.sortable.js
RENAMED
File without changes
|
js/jquery.ui.datepicker-fr.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* French initialisation for the jQuery UI date picker plugin. */
|
2 |
+
/* Written by Keith Wood (kbwood{at}iinet.com.au),
|
3 |
+
Stéphane Nahmani (sholby@sholby.net),
|
4 |
+
Stéphane Raimbault <stephane.raimbault@gmail.com> */
|
5 |
+
jQuery(function($){
|
6 |
+
$.datepicker.regional['fr'] = {
|
7 |
+
closeText: 'Fermer',
|
8 |
+
prevText: 'Précédent',
|
9 |
+
nextText: 'Suivant',
|
10 |
+
currentText: 'Aujourd\'hui',
|
11 |
+
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
|
12 |
+
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
|
13 |
+
monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin',
|
14 |
+
'Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
|
15 |
+
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
|
16 |
+
dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],
|
17 |
+
dayNamesMin: ['D','L','M','M','J','V','S'],
|
18 |
+
weekHeader: 'Sem.',
|
19 |
+
dateFormat: 'dd/mm/yy',
|
20 |
+
firstDay: 1,
|
21 |
+
isRTL: false,
|
22 |
+
showMonthAfterYear: false,
|
23 |
+
yearSuffix: ''
|
24 |
+
};
|
25 |
+
$.datepicker.setDefaults($.datepicker.regional['fr']);
|
26 |
+
});
|
js/lib/compressed/legacy.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Legacy browser support
|
3 |
+
*/
|
4 |
+
[].map||(Array.prototype.map=function(a,b){for(var c=this,d=c.length,e=new Array(d),f=0;d>f;f++)f in c&&(e[f]=a.call(b,c[f],f,c));return e}),[].filter||(Array.prototype.filter=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments[1],f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),[].indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&d!=1/0&&d!=-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});/*!
|
5 |
+
* Cross-Browser Split 1.1.1
|
6 |
+
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
|
7 |
+
* Available under the MIT License
|
8 |
+
* http://blog.stevenlevithan.com/archives/cross-browser-split
|
9 |
+
*/
|
10 |
+
var nativeSplit=String.prototype.split,compliantExecNpcg=void 0===/()??/.exec("")[1];String.prototype.split=function(a,b){var c=this;if("[object RegExp]"!==Object.prototype.toString.call(a))return nativeSplit.call(c,a,b);var d,e,f,g,h=[],i=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":""),j=0;for(a=new RegExp(a.source,i+"g"),c+="",compliantExecNpcg||(d=new RegExp("^"+a.source+"$(?!\\s)",i)),b=void 0===b?-1>>>0:b>>>0;(e=a.exec(c))&&(f=e.index+e[0].length,!(f>j&&(h.push(c.slice(j,e.index)),!compliantExecNpcg&&e.length>1&&e[0].replace(d,function(){for(var a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(e[a]=void 0)}),e.length>1&&e.index<c.length&&Array.prototype.push.apply(h,e.slice(1)),g=e[0].length,j=f,h.length>=b)));)a.lastIndex===e.index&&a.lastIndex++;return j===c.length?(g||!a.test(""))&&h.push(""):h.push(c.slice(j)),h.length>b?h.slice(0,b):h};
|
js/lib/compressed/picker.date.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Date picker for pickadate.js v3.5.6
|
3 |
+
* http://amsul.github.io/pickadate.js/date.htm
|
4 |
+
*/
|
5 |
+
!function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):"object"==typeof exports?module.exports=a(require("./picker.js"),require("jquery")):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0],e=d.value,f=a.$node.data("value"),g=f||e,h=f?b.formatSubmit:b.format,i=function(){return d.currentStyle?"rtl"==d.currentStyle.direction:"rtl"==getComputedStyle(a.$root[0]).direction};c.settings=b,c.$node=a.$node,c.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},c.item={},c.item.clear=null,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),g?c.set("select",g,{format:h,defaultValue:!0}):c.set("select",null).set("highlight",c.item.now),c.key={40:7,38:-7,39:function(){return i()?-1:1},37:function(){return i()?1:-1},go:function(a){var b=c.item.highlight,d=new Date(b.year,b.month,b.date+a);c.set("highlight",d,{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){var c=this.value;c&&(a.set("highlight",[a.get("view").year,c,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus"))}),a.$root.find("."+b.klass.selectYear).on("change",function(){var c=this.value;c&&(a.set("highlight",[c,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus"))})},1).on("open",function(){var d="";c.disabled(c.get("now"))&&(d=":not(."+b.klass.buttonToday+")"),a.$root.find("button"+d+", select").attr("disabled",!1)},1).on("close",function(){a.$root.find("button, select").attr("disabled",!0)},1)}var d=7,e=6,f=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?("clear"==a&&(a="select"),e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):a.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,d){var e,g=this;return c=void 0===c?a:c,c==-(1/0)||c==1/0?e=c:b.isPlainObject(c)&&f.isInteger(c.pick)?c=c.obj:b.isArray(c)?(c=new Date(c[0],c[1],c[2]),c=f.isDate(c)?c:g.create().obj):c=f.isInteger(c)||f.isDate(c)?g.normalize(new Date(c),d):g.now(a,c,d),{year:e||c.getFullYear(),month:e||c.getMonth(),date:e||c.getDate(),day:e||c.getDay(),obj:e||c,pick:e||c.getTime()}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||f.isDate(a)?d.create(a):a};return f.isInteger(a)||(a=e(a)),f.isInteger(c)||(c=e(c)),f.isInteger(a)&&b.isPlainObject(c)?a=[c.year,c.month,c.date+a]:f.isInteger(c)&&b.isPlainObject(a)&&(c=[a.year,a.month,a.date+c]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(a,c,d){var e,f,g,h,i=b.isArray(c),j=b.isPlainObject(c),k=this.item.view;if(i||j){for(j?(f=c.year,g=c.month,h=c.date):(f=+c[0],g=+c[1],h=+c[2]),d&&d.nav&&k&&k.month!==g&&(f=k.year,g=k.month),e=new Date(f,g+(d&&d.nav?d.nav:0),1),f=e.getFullYear(),g=e.getMonth();new Date(f,g,h).getMonth()!==g;)h-=1;c=[f,g,h]}return c},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(a,b){var c=this;return b?"string"==typeof b?b=c.parse(a,b):f.isInteger(b)&&(b=c.now(a,b,{rel:b})):b="min"==a?-(1/0):1/0,b},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(a,c,d){var e,g,h,i,j=this,k=c,l=d&&d.interval?d.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(a){if(b.isArray(a)){var d=j.create(a).pick;d<c.pick?e=!0:d>c.pick&&(g=!0)}return f.isInteger(a)}).length;if((!d||!d.nav&&!d.defaultValue)&&(!m&&j.disabled(c)||m&&j.disabled(c)&&(p||e||g)||!m&&(c.pick<=n.pick||c.pick>=o.pick)))for(m&&!p&&(!g&&l>0||!e&&0>l)&&(l*=-1);j.disabled(c)&&(Math.abs(l)>1&&(c.month<k.month||c.month>k.month)&&(c=k,l=l>0?1:-1),c.pick<=n.pick?(h=!0,l=1,c=j.create([n.year,n.month,n.date+(c.pick===n.pick?0:-1)])):c.pick>=o.pick&&(i=!0,l=-1,c=j.create([o.year,o.month,o.date+(c.pick===o.pick?0:1)])),!h||!i);)c=j.create([c.year,c.month,c.date+l]);return c},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return f.isInteger(d)?a.day===(c.settings.firstDay?d:d-1)%7:b.isArray(d)||f.isDate(d)?a.pick===c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[3]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.parse=function(a,b,c){var d=this,e={};return b&&"string"==typeof b?(c&&c.format||(c=c||{},c.format=d.settings.format),d.formats.toArray(c.format).map(function(a){var c=d.formats[a],g=c?f.trigger(c,d,[b,e]):a.replace(/^!/,"").length;c&&(e[a]=b.substr(0,g)),b=b.substr(g)}),[e.yyyy||e.yy,+(e.mm||e.m)-1,e.dd||e.d]):b},c.prototype.formats=function(){function a(a,b,c){var d=a.match(/[^\x00-\x7F]+|\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)+1),d.length}function b(a){return a.match(/\w+/)[0].length}return{d:function(a,b){return a?f.digits(a):b.date},dd:function(a,b){return a?2:f.lead(b.date)},ddd:function(a,c){return a?b(a):this.settings.weekdaysShort[c.day]},dddd:function(a,c){return a?b(a):this.settings.weekdaysFull[c.day]},m:function(a,b){return a?f.digits(a):b.month+1},mm:function(a,b){return a?2:f.lead(b.month+1)},mmm:function(b,c){var d=this.settings.monthsShort;return b?a(b,d,c):d[c.month]},mmmm:function(b,c){var d=this.settings.monthsFull;return b?a(b,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return f.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}}}(),c.prototype.isDateExact=function(a,c){var d=this;return f.isInteger(a)&&f.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(f.isDate(a)||b.isArray(a))&&(f.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isDateExact(a.from,c.from)&&d.isDateExact(a.to,c.to):!1},c.prototype.isDateOverlap=function(a,c){var d=this,e=d.settings.firstDay?1:0;return f.isInteger(a)&&(f.isDate(c)||b.isArray(c))?(a=a%7+e,a===d.create(c).day+1):f.isInteger(c)&&(f.isDate(a)||b.isArray(a))?(c=c%7+e,c===d.create(a).day+1):b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,g=0;g<e.length;g+=1)if(d.isDateExact(a,e[g])){c=!0;break}c||(f.isInteger(a)||f.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,g=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,h,i,j;for(i=0;g>i;i+=1){if(h=e[i],d.isDateExact(h,a)){c=e[i]=null,j=!0;break}if(d.isDateOverlap(h,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[3]||c.push("inverted")):f.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;g>i;i+=1)if(d.isDateExact(e[i],a)){e[i]=null;break}if(j)for(i=0;g>i;i+=1)if(d.isDateOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.nodes=function(a){var b=this,c=b.settings,g=b.item,h=g.now,i=g.select,j=g.highlight,k=g.view,l=g.disable,m=g.min,n=g.max,o=function(a,b){return c.firstDay&&(a.push(a.shift()),b.push(b.shift())),f.node("thead",f.node("tr",f.group({min:0,max:d-1,i:1,node:"th",item:function(d){return[a[d],c.klass.weekdays,'scope=col title="'+b[d]+'"']}})))}((c.showWeekdaysFull?c.weekdaysFull:c.weekdaysShort).slice(0),c.weekdaysFull.slice(0)),p=function(a){return f.node("div"," ",c.klass["nav"+(a?"Next":"Prev")]+(a&&k.year>=n.year&&k.month>=n.month||!a&&k.year<=m.year&&k.month<=m.month?" "+c.klass.navDisabled:""),"data-nav="+(a||-1)+" "+f.ariaAttr({role:"button",controls:b.$node[0].id+"_table"})+' title="'+(a?c.labelMonthNext:c.labelMonthPrev)+'"')},q=function(){var d=c.showMonthsShort?c.monthsShort:c.monthsFull;return c.selectMonths?f.node("select",f.group({min:0,max:11,i:1,node:"option",item:function(a){return[d[a],0,"value="+a+(k.month==a?" selected":"")+(k.year==m.year&&a<m.month||k.year==n.year&&a>n.month?" disabled":"")]}}),c.klass.selectMonth,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelMonthSelect+'"'):f.node("div",d[k.month],c.klass.month)},r=function(){var d=k.year,e=c.selectYears===!0?5:~~(c.selectYears/2);if(e){var g=m.year,h=n.year,i=d-e,j=d+e;if(g>i&&(j+=g-i,i=g),j>h){var l=i-g,o=j-h;i-=l>o?o:l,j=h}return f.node("select",f.group({min:i,max:j,i:1,node:"option",item:function(a){return[a,0,"value="+a+(d==a?" selected":"")]}}),c.klass.selectYear,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelYearSelect+'"')}return f.node("div",d,c.klass.year)};return f.node("div",(c.selectYears?r()+q():q()+r())+p()+p(1),c.klass.header)+f.node("table",o+f.node("tbody",f.group({min:0,max:e-1,i:1,node:"tr",item:function(a){var e=c.firstDay&&0===b.create([k.year,k.month,1]).day?-7:0;return[f.group({min:d*a-k.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(a){a=b.create([k.year,k.month,a+(c.firstDay?1:0)]);var d=i&&i.pick==a.pick,e=j&&j.pick==a.pick,g=l&&b.disabled(a)||a.pick<m.pick||a.pick>n.pick,o=f.trigger(b.formats.toString,b,[c.format,a]);return[f.node("div",a.date,function(b){return b.push(k.month==a.month?c.klass.infocus:c.klass.outfocus),h.pick==a.pick&&b.push(c.klass.now),d&&b.push(c.klass.selected),e&&b.push(c.klass.highlighted),g&&b.push(c.klass.disabled),b.join(" ")}([c.klass.day]),"data-pick="+a.pick+" "+f.ariaAttr({role:"gridcell",label:o,selected:d&&b.$node.val()===o?!0:null,activedescendant:e?!0:null,disabled:g?!0:null})),"",f.ariaAttr({role:"presentation"})]}})]}})),c.klass.table,'id="'+b.$node[0].id+'_table" '+f.ariaAttr({role:"grid",controls:b.$node[0].id,readonly:!0}))+f.node("div",f.node("button",c.today,c.klass.buttonToday,"type=button data-pick="+h.pick+(a&&!b.disabled(h)?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.close,c.klass.buttonClose,"type=button data-close=true "+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id})),c.klass.footer)},c.defaults=function(a){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today",buttonClose:a+"button--close"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)});
|
js/lib/compressed/picker.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* pickadate.js v3.5.6, 2015/04/20
|
3 |
+
* By Amsul, http://amsul.ca
|
4 |
+
* Hosted on http://amsul.github.io/pickadate.js
|
5 |
+
* Licensed under MIT
|
6 |
+
*/
|
7 |
+
!function(a){"function"==typeof define&&define.amd?define("picker",["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):this.Picker=a(jQuery)}(function(a){function b(f,g,i,m){function n(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",B.component.nodes(w.open),y.box),y.wrap),y.frame),y.holder,'tabindex="-1"')}function o(){z.data(g,B).addClass(y.input).val(z.data("value")?B.get("select",x.format):f.value),x.editable||z.on("focus."+w.id+" click."+w.id,function(a){a.preventDefault(),B.open()}).on("keydown."+w.id,u),e(f,{haspopup:!0,expanded:!1,readonly:!1,owns:f.id+"_root"})}function p(){e(B.$root[0],"hidden",!0)}function q(){B.$holder.on({keydown:u,"focus.toOpen":t,blur:function(){z.removeClass(y.target)},focusin:function(a){B.$root.removeClass(y.focused),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=B.$holder[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is("input, select, textarea, button, option")||(b.preventDefault(),B.$holder[0].focus()))}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var b=a(this),c=b.data(),d=b.hasClass(y.navDisabled)||b.hasClass(y.disabled),e=h();e=e&&(e.type||e.href),(d||e&&!a.contains(B.$root[0],e))&&B.$holder[0].focus(),!d&&c.nav?B.set("highlight",B.component.item.highlight,{nav:c.nav}):!d&&"pick"in c?(B.set("select",c.pick),x.closeOnSelect&&B.close(!0)):c.clear?(B.clear(),x.closeOnClear&&B.close(!0)):c.close&&B.close(!0)})}function r(){var b;x.hiddenName===!0?(b=f.name,f.name=""):(b=["string"==typeof x.hiddenPrefix?x.hiddenPrefix:"","string"==typeof x.hiddenSuffix?x.hiddenSuffix:"_submit"],b=b[0]+f.name+b[1]),B._hidden=a('<input type=hidden name="'+b+'"'+(z.data("value")||f.value?' value="'+B.get("select",x.formatSubmit)+'"':"")+">")[0],z.on("change."+w.id,function(){B._hidden.value=f.value?B.get("select",x.formatSubmit):""})}function s(){v&&l?B.$holder.find("."+y.frame).one("transitionend",function(){B.$holder[0].focus()}):B.$holder[0].focus()}function t(a){a.stopPropagation(),z.addClass(y.target),B.$root.addClass(y.focused),B.open()}function u(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(B.close(!0),!1):void((32==b||c||!w.open&&B.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?B.clear().close():B.open()))}if(!f)return b;var v=!1,w={id:f.id||"P"+Math.abs(~~(Math.random()*new Date))},x=i?a.extend(!0,{},i.defaults,m):m||{},y=a.extend({},b.klasses(),x.klass),z=a(f),A=function(){return this.start()},B=A.prototype={constructor:A,$node:z,start:function(){return w&&w.start?B:(w.methods={},w.start=!0,w.open=!1,w.type=f.type,f.autofocus=f==h(),f.readOnly=!x.editable,f.id=f.id||w.id,"text"!=f.type&&(f.type="text"),B.component=new i(B,x),B.$root=a('<div class="'+y.picker+'" id="'+f.id+'_root" />'),p(),B.$holder=a(n()).appendTo(B.$root),q(),x.formatSubmit&&r(),o(),x.containerHidden?a(x.containerHidden).append(B._hidden):z.after(B._hidden),x.container?a(x.container).append(B.$root):z.after(B.$root),B.on({start:B.component.onStart,render:B.component.onRender,stop:B.component.onStop,open:B.component.onOpen,close:B.component.onClose,set:B.component.onSet}).on({start:x.onStart,render:x.onRender,stop:x.onStop,open:x.onOpen,close:x.onClose,set:x.onSet}),v=c(B.$holder[0]),f.autofocus&&B.open(),B.trigger("start").trigger("render"))},render:function(b){return b?(B.$holder=a(n()),q(),B.$root.html(B.$holder)):B.$root.find("."+y.box).html(B.component.nodes(w.open)),B.trigger("render")},stop:function(){return w.start?(B.close(),B._hidden&&B._hidden.parentNode.removeChild(B._hidden),B.$root.remove(),z.removeClass(y.input).removeData(g),setTimeout(function(){z.off("."+w.id)},0),f.type=w.type,f.readOnly=!1,B.trigger("stop"),w.methods={},w.start=!1,B):B},open:function(c){return w.open?B:(z.addClass(y.active),e(f,"expanded",!0),setTimeout(function(){B.$root.addClass(y.opened),e(B.$root[0],"hidden",!1)},0),c!==!1&&(w.open=!0,v&&k.css("overflow","hidden").css("padding-right","+="+d()),s(),j.on("click."+w.id+" focusin."+w.id,function(a){var b=a.target;b!=f&&b!=document&&3!=a.which&&B.close(b===B.$holder[0])}).on("keydown."+w.id,function(c){var d=c.keyCode,e=B.component.key[d],f=c.target;27==d?B.close(!0):f!=B.$holder[0]||!e&&13!=d?a.contains(B.$root[0],f)&&13==d&&(c.preventDefault(),f.click()):(c.preventDefault(),e?b._.trigger(B.component.key.go,B,[b._.trigger(e)]):B.$root.find("."+y.highlighted).hasClass(y.disabled)||(B.set("select",B.component.item.highlight),x.closeOnSelect&&B.close(!0)))})),B.trigger("open"))},close:function(a){return a&&(x.editable?f.focus():(B.$holder.off("focus.toOpen").focus(),setTimeout(function(){B.$holder.on("focus.toOpen",t)},0))),z.removeClass(y.active),e(f,"expanded",!1),setTimeout(function(){B.$root.removeClass(y.opened+" "+y.focused),e(B.$root[0],"hidden",!0)},0),w.open?(w.open=!1,v&&k.css("overflow","").css("padding-right","-="+d()),j.off("."+w.id),B.trigger("close")):B},clear:function(a){return B.set("clear",null,a)},set:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(d=g&&a.isPlainObject(c)?c:d||{},b){g||(h[b]=c);for(e in h)f=h[e],e in B.component.item&&(void 0===f&&(f=null),B.component.set(e,f,d)),("select"==e||"clear"==e)&&z.val("clear"==e?"":B.get(e,x.format)).trigger("change");B.render()}return d.muted?B:B.trigger("set",h)},get:function(a,c){if(a=a||"value",null!=w[a])return w[a];if("valueSubmit"==a){if(B._hidden)return B._hidden.value;a="value"}if("value"==a)return f.value;if(a in B.component.item){if("string"==typeof c){var d=B.component.get(a);return d?b._.trigger(B.component.formats.toString,B.component,[c,d]):""}return B.component.get(a)}},on:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(b){g||(h[b]=c);for(e in h)f=h[e],d&&(e="_"+e),w.methods[e]=w.methods[e]||[],w.methods[e].push(f)}return B},off:function(){var a,b,c=arguments;for(a=0,namesCount=c.length;a<namesCount;a+=1)b=c[a],b in w.methods&&delete w.methods[b];return B},trigger:function(a,c){var d=function(a){var d=w.methods[a];d&&d.map(function(a){b._.trigger(a,B,[c])})};return d("_"+a),d(a),B}};return new A}function c(a){var b,c="position";return a.currentStyle?b=a.currentStyle[c]:window.getComputedStyle&&(b=getComputedStyle(a)[c]),"fixed"==b}function d(){if(k.height()<=i.height())return 0;var b=a('<div style="visibility:hidden;width:100px" />').appendTo("body"),c=b[0].offsetWidth;b.css("overflow","scroll");var d=a('<div style="width:100%" />').appendTo(b),e=d[0].offsetWidth;return b.remove(),c-e}function e(b,c,d){if(a.isPlainObject(c))for(var e in c)f(b,e,c[e]);else f(b,c,d)}function f(a,b,c){a.setAttribute(("role"==b?"":"aria-")+b,c)}function g(b,c){a.isPlainObject(b)||(b={attribute:c}),c="";for(var d in b){var e=("role"==d?"":"aria-")+d,f=b[d];c+=null==f?"":e+'="'+b[d]+'"'}return c}function h(){try{return document.activeElement}catch(a){}}var i=a(window),j=a(document),k=a(document.documentElement),l=null!=document.documentElement.style.transition;return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",target:a+"__input--target",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+"</"+b+">"):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0},ariaAttr:g},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?b._.trigger(g[e],g,[f]):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b});
|
js/lib/compressed/picker.time.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Time picker for pickadate.js v3.5.6
|
3 |
+
* http://amsul.github.io/pickadate.js/time.htm
|
4 |
+
*/
|
5 |
+
!function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):"object"==typeof exports?module.exports=a(require("./picker.js"),require("jquery")):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format;c.settings=b,c.$node=a.$node,c.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"},c.item={},c.item.clear=null,c.item.interval=b.interval||30,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),f?c.set("select",f,{format:g}):c.set("select",null).set("highlight",c.item.now),c.key={40:1,38:-1,39:1,37:-1,go:function(a){c.set("highlight",c.item.highlight.pick+a*c.item.interval,{interval:a*c.item.interval}),this.render()}},a.on("render",function(){var c=a.$root.children(),d=c.find("."+b.klass.viewset),e=function(a){return["webkit","moz","ms","o",""].map(function(b){return(b?"-"+b+"-":"")+a})},f=function(a,b){e("transform").map(function(c){a.css(c,b)}),e("transition").map(function(c){a.css(c,b)})};d.length&&(f(c,"none"),c[0].scrollTop=~~d.position().top-2*d[0].clientHeight,f(c,""))},1).on("open",function(){a.$root.find("button").attr("disabled",!1)},1).on("close",function(){a.$root.find("button").attr("disabled",!0)},1)}var d=24,e=60,f=12,g=d*e,h=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?("clear"==a&&(a="select"),e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):"interval"==a?d.set("min",e.min,c).set("max",e.max,c):a.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&d.disabled(e.select)&&d.set("select",b,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",b,c),"min"==a&&d.set("max",e.max,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,f){var i=this;return c=void 0===c?a:c,h.isDate(c)&&(c=[c.getHours(),c.getMinutes()]),b.isPlainObject(c)&&h.isInteger(c.pick)?c=c.pick:b.isArray(c)?c=+c[0]*e+ +c[1]:h.isInteger(c)||(c=i.now(a,c,f)),"max"==a&&c<i.item.min.pick&&(c+=g),"min"!=a&&"max"!=a&&(c-i.item.min.pick)%i.item.interval!==0&&(c+=i.item.interval),c=i.normalize(a,c,f),{hour:~~(d+c/e)%d,mins:(e+c%e)%e,time:(g+c)%g,pick:c%g}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||h.isDate(a)?d.create(a):a};return h.isInteger(a)||(a=e(a)),h.isInteger(c)||(c=e(c)),h.isInteger(a)&&b.isPlainObject(c)?a=[c.hour,c.mins+a*d.settings.interval]:h.isInteger(c)&&b.isPlainObject(a)&&(c=[a.hour,a.mins+c*d.settings.interval]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b){var c,d=this.item.interval,f=new Date,g=f.getHours()*e+f.getMinutes(),i=h.isInteger(b);return g-=g%d,c=0>b&&-d>=d*b+g,g+="min"==a&&c?0:d,i&&(g+=d*(c&&"max"!=a?b+1:b)),g},c.prototype.normalize=function(a,b){var c=this.item.interval,d=this.item.min&&this.item.min.pick||0;return b-="min"==a?0:(b-d)%c},c.prototype.measure=function(a,c,f){var g=this;return c||(c="min"==a?[0,0]:[d-1,e-1]),"string"==typeof c?c=g.parse(a,c):c===!0||h.isInteger(c)?c=g.now(a,c,f):b.isPlainObject(c)&&h.isInteger(c.pick)&&(c=g.normalize(a,c.pick,f)),c},c.prototype.validate=function(a,b,c){var d=this,e=c&&c.interval?c.interval:d.item.interval;return d.disabled(b)&&(b=d.shift(b,e)),b=d.scope(b),d.disabled(b)&&(b=d.shift(b,-1*e)),b},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return h.isInteger(d)?a.hour==d:b.isArray(d)||h.isDate(d)?a.pick==c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[2]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.shift=function(a,b){var c=this,d=c.item.min.pick,e=c.item.max.pick;for(b=b||c.item.interval;c.disabled(a)&&(a=c.create(a.pick+=b),!(a.pick<=d||a.pick>=e)););return a},c.prototype.scope=function(a){var b=this.item.min.pick,c=this.item.max.pick;return this.create(a.pick>c?c:a.pick<b?b:a)},c.prototype.parse=function(a,b,c){var d,f,g,i,j,k=this,l={};if(!b||"string"!=typeof b)return b;c&&c.format||(c=c||{},c.format=k.settings.format),k.formats.toArray(c.format).map(function(a){var c,d=k.formats[a],e=d?h.trigger(d,k,[b,l]):a.replace(/^!/,"").length;d&&(c=b.substr(0,e),l[a]=c.match(/^\d+$/)?+c:c),b=b.substr(e)});for(i in l)j=l[i],h.isInteger(j)?i.match(/^(h|hh)$/i)?(d=j,("h"==i||"hh"==i)&&(d%=12)):"i"==i&&(f=j):i.match(/^a$/i)&&j.match(/^p/i)&&("h"in l||"hh"in l)&&(g=!0);return(g?d+12:d)*e+f},c.prototype.formats={h:function(a,b){return a?h.digits(a):b.hour%f||f},hh:function(a,b){return a?2:h.lead(b.hour%f||f)},H:function(a,b){return a?h.digits(a):""+b.hour%24},HH:function(a,b){return a?h.digits(a):h.lead(b.hour%24)},i:function(a,b){return a?2:h.lead(b.mins)},a:function(a,b){return a?4:g/2>b.time%g?"a.m.":"p.m."},A:function(a,b){return a?2:g/2>b.time%g?"AM":"PM"},toArray:function(a){return a.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return h.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}},c.prototype.isTimeExact=function(a,c){var d=this;return h.isInteger(a)&&h.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(h.isDate(a)||b.isArray(a))&&(h.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isTimeExact(a.from,c.from)&&d.isTimeExact(a.to,c.to):!1},c.prototype.isTimeOverlap=function(a,c){var d=this;return h.isInteger(a)&&(h.isDate(c)||b.isArray(c))?a===d.create(c).hour:h.isInteger(c)&&(h.isDate(a)||b.isArray(a))?c===d.create(a).hour:b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,f=0;f<e.length;f+=1)if(d.isTimeExact(a,e[f])){c=!0;break}c||(h.isInteger(a)||h.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,f=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,g,i,j;for(i=0;f>i;i+=1){if(g=e[i],d.isTimeExact(g,a)){c=e[i]=null,j=!0;break}if(d.isTimeOverlap(g,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[2]||c.push("inverted")):h.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;f>i;i+=1)if(d.isTimeExact(e[i],a)){e[i]=null;break}if(j)for(i=0;f>i;i+=1)if(d.isTimeOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.i=function(a,b){return h.isInteger(b)&&b>0?b:this.item.interval},c.prototype.nodes=function(a){var b=this,c=b.settings,d=b.item.select,e=b.item.highlight,f=b.item.view,g=b.item.disable;return h.node("ul",h.group({min:b.item.min.pick,max:b.item.max.pick,i:b.item.interval,node:"li",item:function(a){a=b.create(a);var i=a.pick,j=d&&d.pick==i,k=e&&e.pick==i,l=g&&b.disabled(a),m=h.trigger(b.formats.toString,b,[c.format,a]);return[h.trigger(b.formats.toString,b,[h.trigger(c.formatLabel,b,[a])||c.format,a]),function(a){return j&&a.push(c.klass.selected),k&&a.push(c.klass.highlighted),f&&f.pick==i&&a.push(c.klass.viewset),l&&a.push(c.klass.disabled),a.join(" ")}([c.klass.listItem]),"data-pick="+a.pick+" "+h.ariaAttr({role:"option",label:m,selected:j&&b.$node.val()===m?!0:null,activedescendant:k?!0:null,disabled:l?!0:null})]}})+h.node("li",h.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")+" "+h.ariaAttr({controls:b.$node[0].id})),"",h.ariaAttr({role:"presentation"})),c.klass.list,h.ariaAttr({role:"listbox",controls:b.$node[0].id}))},c.defaults=function(a){return{clear:"Clear",format:"h:i A",interval:30,closeOnSelect:!0,closeOnClear:!0,klass:{picker:a+" "+a+"--time",holder:a+"__holder",list:a+"__list",listItem:a+"__list-item",disabled:a+"__list-item--disabled",selected:a+"__list-item--selected",highlighted:a+"__list-item--highlighted",viewset:a+"__list-item--viewset",now:a+"__list-item--now",buttonClear:a+"__button--clear"}}}(a.klasses().picker),a.extend("pickatime",c)});
|
js/lib/compressed/themes/classic.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.picker,.picker__holder{width:100%;position:absolute}.picker{font-size:16px;text-align:left;line-height:1.2;color:#000;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{overflow-y:auto;-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #aaa;border-top-width:0;border-bottom-width:0;border-radius:0 0 5px 5px;box-sizing:border-box;min-width:176px;max-width:466px;max-height:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;-webkit-transform:translateY(-1em)perspective(600px)rotateX(10deg);transform:translateY(-1em)perspective(600px)rotateX(10deg);transition:-webkit-transform .15s ease-out,opacity .15s ease-out,max-height 0s .15s,border-width 0s .15s;transition:transform .15s ease-out,opacity .15s ease-out,max-height 0s .15s,border-width 0s .15s}/*!
|
2 |
+
* Classic picker styling for pickadate.js
|
3 |
+
* Demo: http://amsul.github.io/pickadate.js
|
4 |
+
*/.picker__frame{padding:1px}.picker__wrap{margin:-1px}.picker--opened .picker__holder{max-height:25em;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1;border-top-width:1px;border-bottom-width:1px;-webkit-transform:translateY(0)perspective(600px)rotateX(0);transform:translateY(0)perspective(600px)rotateX(0);transition:-webkit-transform .15s ease-out,opacity .15s ease-out,max-height 0s,border-width 0s;transition:transform .15s ease-out,opacity .15s ease-out,max-height 0s,border-width 0s;box-shadow:0 6px 18px 1px rgba(0,0,0,.12)}
|
js/lib/compressed/themes/classic.date.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.picker__footer,.picker__header,.picker__table{text-align:center}.picker__day--highlighted,.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__box{padding:0 1em}.picker__header{position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2em;padding:.5em;margin-left:.25em;margin-right:.25em}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__nav--next,.picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;box-sizing:content-box;top:-.25em}.picker__nav--prev{left:-1em;padding-right:1.25em}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{margin-top:-.5em}.picker__nav--next,.picker__nav--prev{top:-.33em}.picker__nav--prev{padding-right:1.5em}.picker__nav--next{padding-left:1.5em}}.picker__nav--next:before,.picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--next:hover,.picker__nav--prev:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:before,.picker__nav--disabled:before:hover,.picker__nav--disabled:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker--focused .picker__day--highlighted,.picker__day--highlighted:hover,.picker__day--infocus:hover,.picker__day--outfocus:hover{color:#000;cursor:pointer;background:#b1dcfb}.picker__table{border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker--focused .picker__day--selected,.picker__day--selected,.picker__day--selected:hover{background:#0089ec;color:#fff}.picker--focused .picker__day--disabled,.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__button--clear,.picker__button--close,.picker__button--today{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:33%;display:inline-block;vertical-align:bottom}.picker__button--clear:hover,.picker__button--close:hover,.picker__button--today:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--clear:focus,.picker__button--close:focus,.picker__button--today:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--clear:before,.picker__button--close:before,.picker__button--today:before{position:relative;display:inline-block;height:0}.picker__button--clear:before,.picker__button--today:before{content:" ";margin-right:.45em}.picker__button--today:before{top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{top:-.25em;width:.66em;border-top:3px solid #e20}.picker__button--close:before{content:"\D7";top:-.1em;vertical-align:top;font-size:1.1em;margin-right:.35em;color:#777}.picker__button--today[disabled],.picker__button--today[disabled]:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__button--today[disabled]:before{border-top-color:#aaa}
|
js/lib/compressed/themes/classic.time.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover,.picker__list-item:hover{background:#b1dcfb;cursor:pointer;color:#000}.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item--highlighted,.picker__list-item:hover{border-color:#0089ec;z-index:10}.picker--focused .picker__list-item--selected,.picker__list-item--selected,.picker__list-item--selected:hover{background:#0089ec;color:#fff;z-index:10}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff;border-color:#fff}.picker--time{min-width:256px;max-width:320px}.picker--time .picker__holder{background:#f2f2f2}@media (min-height:40.125em){.picker--time .picker__holder{font-size:.875em}}.picker--time .picker__box{padding:0;position:relative}
|
js/lib/compressed/themes/default.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.picker{font-size:16px;text-align:left;line-height:1.2;color:#000;position:absolute;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;position:fixed;transition:background .15s ease-out,-webkit-transform 0s .15s;transition:background .15s ease-out,transform 0s .15s;-webkit-backface-visibility:hidden}/*!
|
2 |
+
* Default mobile-first, responsive styling for pickadate.js
|
3 |
+
* Demo: http://amsul.github.io/pickadate.js
|
4 |
+
*/.picker__frame,.picker__holder{top:0;bottom:0;left:0;right:0;-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.picker__frame{position:absolute;margin:0 auto;min-width:256px;max-width:666px;width:100%;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;transition:all .15s ease-out}.picker__wrap{display:table;width:100%;height:100%}@media (min-height:33.875em){.picker__frame{overflow:visible;top:auto;bottom:-100%;max-height:80%}.picker__wrap{display:block}}.picker__box{background:#fff;display:table-cell;vertical-align:middle}@media (min-height:26.5em){.picker__box{font-size:1.25em}}@media (min-height:33.875em){.picker__box{display:block;font-size:1.33em;border:1px solid #777;border-top-color:#898989;border-bottom-width:0;border-radius:5px 5px 0 0;box-shadow:0 12px 36px 16px rgba(0,0,0,.24)}}@media (min-height:40.125em){.picker__frame{margin-bottom:7.5%}.picker__box{font-size:1.5em;border-bottom-width:1px;border-radius:5px}}.picker--opened .picker__holder{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);zoom:1;background:rgba(0,0,0,.32);transition:background .15s ease-out}.picker--opened .picker__frame{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1}@media (min-height:33.875em){.picker--opened .picker__frame{top:auto;bottom:0}}
|
js/lib/compressed/themes/default.date.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.picker__footer,.picker__header,.picker__table{text-align:center}.picker__day--highlighted,.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__box{padding:0 1em}.picker__header{position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2em;padding:.5em;margin-left:.25em;margin-right:.25em}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__nav--next,.picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;box-sizing:content-box;top:-.25em}.picker__nav--prev{left:-1em;padding-right:1.25em}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{margin-top:-.5em}.picker__nav--next,.picker__nav--prev{top:-.33em}.picker__nav--prev{padding-right:1.5em}.picker__nav--next{padding-left:1.5em}}.picker__nav--next:before,.picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--next:hover,.picker__nav--prev:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:before,.picker__nav--disabled:before:hover,.picker__nav--disabled:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker--focused .picker__day--highlighted,.picker__day--highlighted:hover,.picker__day--infocus:hover,.picker__day--outfocus:hover{color:#000;cursor:pointer;background:#b1dcfb}.picker__table{border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker--focused .picker__day--selected,.picker__day--selected,.picker__day--selected:hover{background:#0089ec;color:#fff}.picker--focused .picker__day--disabled,.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__button--clear,.picker__button--close,.picker__button--today{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:33%;display:inline-block;vertical-align:bottom}.picker__button--clear:hover,.picker__button--close:hover,.picker__button--today:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--clear:focus,.picker__button--close:focus,.picker__button--today:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--clear:before,.picker__button--close:before,.picker__button--today:before{position:relative;display:inline-block;height:0}.picker__button--clear:before,.picker__button--today:before{content:" ";margin-right:.45em}.picker__button--today:before{top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{top:-.25em;width:.66em;border-top:3px solid #e20}.picker__button--close:before{content:"\D7";top:-.1em;vertical-align:top;font-size:1.1em;margin-right:.35em;color:#777}.picker__button--today[disabled],.picker__button--today[disabled]:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__button--today[disabled]:before{border-top-color:#aaa}
|
js/lib/compressed/themes/default.time.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover,.picker__list-item:hover{background:#b1dcfb;cursor:pointer;color:#000}.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item--highlighted,.picker__list-item:hover{border-color:#0089ec;z-index:10}.picker--focused .picker__list-item--selected,.picker__list-item--selected,.picker__list-item--selected:hover{background:#0089ec;color:#fff;z-index:10}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff;border-color:#fff}.picker--time .picker__frame{min-width:256px;max-width:320px}.picker--time .picker__box{font-size:1em;background:#f2f2f2;padding:0}@media (min-height:40.125em){.picker--time .picker__box{margin-bottom:5em}}
|
js/lib/compressed/themes/rtl.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Styling for RTL (right-to-left) languages using pickadate.js
|
3 |
+
*/.picker{direction:rtl}.picker__nav--next{right:auto;left:-1em}.picker__nav--prev{left:auto;right:-1em}.picker__nav--next:before{border-left:0;border-right:.75em solid #000}.picker__nav--prev:before{border-right:0;border-left:.75em solid #000}
|
js/lib/compressed/translations/ar.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر"],monthsShort:["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر"],weekdaysFull:["الاحد","الاثنين","الثلاثاء","الاربعاء","الخميس","الجمعة","السبت"],weekdaysShort:["الاحد","الاثنين","الثلاثاء","الاربعاء","الخميس","الجمعة","السبت"],today:"اليوم",clear:"مسح",format:"yyyy mmmm dd",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"مسح"});
|
js/lib/compressed/translations/bg_BG.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],monthsShort:["янр","фев","мар","апр","май","юни","юли","авг","сеп","окт","ное","дек"],weekdaysFull:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],weekdaysShort:["нд","пн","вт","ср","чт","пт","сб"],today:"днес",clear:"изтривам",firstDay:1,format:"d mmmm yyyy г.",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"изтривам"});
|
js/lib/compressed/translations/bs_BA.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","mart","april","maj","juni","juli","august","septembar","oktobar","novembar","decembar"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["nedjelja","ponedjeljak","utorak","srijeda","cetvrtak","petak","subota"],weekdaysShort:["ne","po","ut","sr","če","pe","su"],today:"danas",clear:"izbrisati",firstDay:1,format:"dd. mmmm yyyy.",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"izbrisati"});
|
js/lib/compressed/translations/ca_ES.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Gener","Febrer","Març","Abril","Maig","juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],weekdaysFull:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],weekdaysShort:["diu","dil","dim","dmc","dij","div","dis"],today:"avui",clear:"esborrar",close:"tancar",firstDay:1,format:"dddd d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"esborrar"});
|
js/lib/compressed/translations/cs_CZ.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],monthsShort:["led","úno","bře","dub","kvě","čer","čvc","srp","zář","říj","lis","pro"],weekdaysFull:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],weekdaysShort:["ne","po","út","st","čt","pá","so"],today:"dnes",clear:"vymazat",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"vymazat"});
|
js/lib/compressed/translations/da_DK.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],weekdaysShort:["søn","man","tir","ons","tor","fre","lør"],today:"i dag",clear:"slet",close:"luk",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"slet"});
|
js/lib/compressed/translations/de_DE.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],weekdaysFull:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],today:"Heute",clear:"Löschen",close:"Schließen",firstDay:1,format:"dddd, dd. mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Löschen"});
|
js/lib/compressed/translations/el_GR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],monthsShort:["Ιαν","Φεβ","Μαρ","Απρ","Μαι","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],weekdaysFull:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],weekdaysShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],today:"σήμερα",clear:"Διαγραφή",firstDay:1,format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Διαγραφή"});
|
js/lib/compressed/translations/es_ES.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],weekdaysFull:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],weekdaysShort:["dom","lun","mar","mié","jue","vie","sáb"],today:"hoy",clear:"borrar",close:"cerrar",firstDay:1,format:"dddd d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"borrar"});
|
js/lib/compressed/translations/et_EE.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["jaanuar","veebruar","märts","aprill","mai","juuni","juuli","august","september","oktoober","november","detsember"],monthsShort:["jaan","veebr","märts","apr","mai","juuni","juuli","aug","sept","okt","nov","dets"],weekdaysFull:["pühapäev","esmaspäev","teisipäev","kolmapäev","neljapäev","reede","laupäev"],weekdaysShort:["püh","esm","tei","kol","nel","ree","lau"],today:"täna",clear:"kustutama",firstDay:1,format:"d. mmmm yyyy. a",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"kustutama"});
|
js/lib/compressed/translations/eu_ES.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["urtarrila","otsaila","martxoa","apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua"],monthsShort:["urt","ots","mar","api","mai","eka","uzt","abu","ira","urr","aza","abe"],weekdaysFull:["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],weekdaysShort:["ig.","al.","ar.","az.","og.","or.","lr."],today:"gaur",clear:"garbitu",firstDay:1,format:"dddd, yyyy(e)ko mmmmren da",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"garbitu"});
|
js/lib/compressed/translations/fa_IR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر","اکتبر","نوامبر","دسامبر"],monthsShort:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر","اکتبر","نوامبر","دسامبر"],weekdaysFull:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],weekdaysShort:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],today:"امروز",clear:"پاک کردن",close:"بستن",format:"yyyy mmmm dd",formatSubmit:"yyyy/mm/dd",labelMonthNext:"ماه بعدی",labelMonthPrev:"ماه قبلی"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"پاک کردن"});
|
js/lib/compressed/translations/fi_FI.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],weekdaysFull:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],weekdaysShort:["su","ma","ti","ke","to","pe","la"],today:"tänään",clear:"tyhjennä",firstDay:1,format:"d.m.yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"tyhjennä"});
|
js/lib/compressed/translations/fr_FR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aou","Sep","Oct","Nov","Dec"],weekdaysFull:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekdaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],today:"Aujourd'hui",clear:"Effacer",close:"Fermer",firstDay:1,format:"dd mmmm yyyy",formatSubmit:"yyyy/mm/dd",labelMonthNext:"Mois suivant",labelMonthPrev:"Mois précédent",labelMonthSelect:"Sélectionner un mois",labelYearSelect:"Sélectionner une année"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Effacer"});
|
js/lib/compressed/translations/gl_ES.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthsShort:["xan","feb","mar","abr","mai","xun","xul","ago","sep","out","nov","dec"],weekdaysFull:["domingo","luns","martes","mércores","xoves","venres","sábado"],weekdaysShort:["dom","lun","mar","mér","xov","ven","sab"],today:"hoxe",clear:"borrar",firstDay:1,format:"dddd d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"borrar"});
|
js/lib/compressed/translations/he_IL.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],monthsShort:["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ"],weekdaysFull:["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום ששי","יום שבת"],weekdaysShort:["א","ב","ג","ד","ה","ו","ש"],today:"היום",clear:"למחוק",format:"yyyy mmmmב d dddd",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"למחוק"});
|
js/lib/compressed/translations/hi_IN.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["जनवरी","फरवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितम्बर","अक्टूबर","नवम्बर","दिसम्बर"],monthsShort:["जन","फर","मार्च","अप्रैल","मई","जून","जु","अग","सित","अक्टू","नव","दिस"],weekdaysFull:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"],weekdaysShort:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],today:"आज की तारीख चयन करें",clear:"चुनी हुई तारीख को मिटाएँ",close:"विंडो बंद करे",firstDay:1,format:"dd/mm/yyyy",formatSubmit:"yyyy/mm/dd",labelMonthNext:"अगले माह का चयन करें",labelMonthPrev:"पिछले माह का चयन करें",labelMonthSelect:"किसि एक महीने का चयन करें",labelYearSelect:"किसि एक वर्ष का चयन करें"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"चुनी हुई तारीख को मिटाएँ"});
|
js/lib/compressed/translations/hr_HR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["sijećanj","veljača","ožujak","travanj","svibanj","lipanj","srpanj","kolovoz","rujan","listopad","studeni","prosinac"],monthsShort:["sij","velj","ožu","tra","svi","lip","srp","kol","ruj","lis","stu","pro"],weekdaysFull:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned","pon","uto","sri","čet","pet","sub"],today:"danas",clear:"izbrisati",firstDay:1,format:"d. mmmm yyyy.",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"izbrisati"});
|
js/lib/compressed/translations/hu_HU.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],monthsShort:["jan","febr","márc","ápr","máj","jún","júl","aug","szept","okt","nov","dec"],weekdaysFull:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],weekdaysShort:["V","H","K","SZe","CS","P","SZo"],today:"Ma",clear:"Törlés",firstDay:1,format:"yyyy. mmmm dd.",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Törlés"});
|
js/lib/compressed/translations/id_ID.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],weekdaysFull:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],weekdaysShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],today:"hari ini",clear:"menghapus",firstDay:1,format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"menghapus"});
|
js/lib/compressed/translations/is_IS.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],monthsShort:["jan","feb","mar","apr","maí","jún","júl","ágú","sep","okt","nóv","des"],weekdaysFull:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],weekdaysShort:["sun","mán","þri","mið","fim","fös","lau"],today:"Í dag",clear:"Hreinsa",firstDay:1,format:"dd. mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Hreinsa"});
|
js/lib/compressed/translations/it_IT.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],weekdaysFull:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],weekdaysShort:["dom","lun","mar","mer","gio","ven","sab"],today:"Oggi",clear:"Cancella",close:"Chiudi",firstDay:1,format:"dddd d mmmm yyyy",formatSubmit:"yyyy/mm/dd",labelMonthNext:"Mese successivo",labelMonthPrev:"Mese precedente",labelMonthSelect:"Seleziona un mese",labelYearSelect:"Seleziona un anno"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Cancella",format:"HH:i",formatSubmit:"HH:i"});
|
js/lib/compressed/translations/ja_JP.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdaysFull:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],weekdaysShort:["日","月","火","水","木","金","土"],today:"今日",clear:"消去",firstDay:1,format:"yyyy mm dd",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"消去"});
|
js/lib/compressed/translations/ko_KR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],weekdaysFull:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],weekdaysShort:["일","월","화","수","목","금","토"],today:"오늘",clear:"취소",firstDay:1,format:"yyyy 년 mm 월 dd 일",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"취소"});
|
js/lib/compressed/translations/lt_LT.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{labelMonthNext:"Sekantis mėnuo",labelMonthPrev:"Ankstesnis mėnuo",labelMonthSelect:"Pasirinkite mėnesį",labelYearSelect:"Pasirinkite metus",monthsFull:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rgp","Rgs","Spa","Lap","Grd"],weekdaysFull:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"],weekdaysShort:["Sk","Pr","An","Tr","Kt","Pn","Št"],today:"Šiandien",clear:"Išvalyti",close:"Uždaryti",firstDay:1,format:"yyyy-mm-dd",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Išvalyti",format:"HH:i"});
|
js/lib/compressed/translations/lv_LV.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],weekdaysFull:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"],weekdaysShort:["Sv","P","O","T","C","Pk","S"],today:"Šodiena",clear:"Atcelt",firstDay:1,format:"yyyy.mm.dd. dddd",formatSubmit:"yyyy/mm/dd"});
|
js/lib/compressed/translations/nb_NO.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthsShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],weekdaysFull:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],weekdaysShort:["søn","man","tir","ons","tor","fre","lør"],today:"i dag",clear:"nullstill",close:"lukk",firstDay:1,format:"dd. mmm. yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"nullstill"});
|
js/lib/compressed/translations/ne_NP.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["जनवरी","फेब्रुअरी","मार्च","अप्रिल","मे","जुन","जुलाई","अगस्त","सेप्टेम्बर","अक्टोबर","नोवेम्बर","डिसेम्बर"],monthsShort:["जन","फेब्रु","मार्च","अप्रिल","मे","जुन","जुल","अग","सेप्टे","अक्टो","नोभे","डिसे"],weekdaysFull:["सोमबार","मङ्लबार","बुधबार","बिहीबार","शुक्रबार","शनिबार","आईतबार"],weekdaysShort:["सोम","मंगल्","बुध","बिही","शुक्र","शनि","आईत"],numbers:["०","१","२","३","४","५","६","७","८","९"],today:"आज",clear:"मेटाउनुहोस्",format:"dddd, dd mmmm, yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"मेटाउनुहोस्"});
|
js/lib/compressed/translations/nl_NL.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","maa","apr","mei","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],weekdaysShort:["zo","ma","di","wo","do","vr","za"],today:"vandaag",clear:"verwijderen",close:"sluiten",firstDay:1,format:"dddd d mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"verwijderen"});
|
js/lib/compressed/translations/no_NO.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthsShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],weekdaysFull:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],weekdaysShort:["søn","man","tir","ons","tor","fre","lør"],today:"i dag",clear:"nullstill",firstDay:1,format:"dd. mmm. yyyy",formatSubmit:"yyyy/mm/dd"});
|
js/lib/compressed/translations/pl_PL.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],monthsShort:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],weekdaysFull:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],weekdaysShort:["niedz.","pn.","wt.","śr.","cz.","pt.","sob."],today:"Dzisiaj",clear:"Usuń",close:"Zamknij",firstDay:1,format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"usunąć"});
|
js/lib/compressed/translations/pt_BR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],monthsShort:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],weekdaysFull:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],weekdaysShort:["dom","seg","ter","qua","qui","sex","sab"],today:"hoje",clear:"limpar",close:"fechar",format:"dddd, d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"limpar"});
|
js/lib/compressed/translations/pt_PT.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],weekdaysFull:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekdaysShort:["dom","seg","ter","qua","qui","sex","sab"],today:"Hoje",clear:"Limpar",close:"Fechar",format:"d !de mmmm !de yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Limpar"});
|
js/lib/compressed/translations/ro_RO.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],monthsShort:["ian","feb","mar","apr","mai","iun","iul","aug","sep","oct","noi","dec"],weekdaysFull:["duminică","luni","marţi","miercuri","joi","vineri","sâmbătă"],weekdaysShort:["D","L","Ma","Mi","J","V","S"],today:"azi",clear:"șterge",firstDay:1,format:"dd mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"șterge"});
|
js/lib/compressed/translations/ru_RU.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],monthsShort:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],weekdaysFull:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],weekdaysShort:["вс","пн","вт","ср","чт","пт","сб"],today:"сегодня",clear:"удалить",close:"закрыть",firstDay:1,format:"d mmmm yyyy г.",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"удалить"});
|
js/lib/compressed/translations/sk_SK.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"],monthsShort:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],weekdaysFull:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],weekdaysShort:["Ne","Po","Ut","St","Št","Pi","So"],today:"dnes",clear:"vymazať",close:"zavrieť",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"vymazať"});
|
js/lib/compressed/translations/sl_SI.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec"],weekdaysFull:["nedelja","ponedeljek","torek","sreda","četrtek","petek","sobota"],weekdaysShort:["ned","pon","tor","sre","čet","pet","sob"],today:"danes",clear:"izbriši",close:"zapri",firstDay:1,format:"d. mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"izbriši"});
|
js/lib/compressed/translations/sv_SE.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],weekdaysFull:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],weekdaysShort:["sön","mån","tis","ons","tor","fre","lör"],today:"Idag",clear:"Rensa",close:"Stäng",firstDay:1,format:"yyyy-mm-dd",formatSubmit:"yyyy/mm/dd",labelMonthNext:"Nästa månad",labelMonthPrev:"Föregående månad",labelMonthSelect:"Välj månad",labelYearSelect:"Välj år"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Rensa"});
|
js/lib/compressed/translations/th_TH.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],weekdaysFull:["อาทติย","จันทร","องัคาร","พุธ","พฤหสั บดี","ศกุร","เสาร"],weekdaysShort:["อ.","จ.","อ.","พ.","พฤ.","ศ.","ส."],today:"วันนี้",clear:"ลบ",format:"d mmmm yyyy",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"ลบ"});
|
js/lib/compressed/translations/tr_TR.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],weekdaysFull:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],weekdaysShort:["Pzr","Pzt","Sal","Çrş","Prş","Cum","Cmt"],today:"Bugün",clear:"Sil",close:"Kapat",firstDay:1,format:"dd mmmm yyyy dddd",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"sil"});
|
js/lib/compressed/translations/uk_UA.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],monthsShort:["січ","лют","бер","кві","тра","чер","лип","сер","вер","жов","лис","гру"],weekdaysFull:["неділя","понеділок","вівторок","середа","четвер","п‘ятниця","субота"],weekdaysShort:["нд","пн","вт","ср","чт","пт","сб"],today:"сьогодні",clear:"викреслити",firstDay:1,format:"dd mmmm yyyy p.",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"викреслити"});
|
js/lib/compressed/translations/vi_VN.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Tháng Một","Tháng Hai","Tháng Ba","Tháng Tư","Tháng Năm","Tháng Sáu","Tháng Bảy","Tháng Tám","Tháng Chín","Tháng Mười","Tháng Mười Một","Tháng Mười Hai"],monthsShort:["Một","Hai","Ba","Tư","Năm","Sáu","Bảy","Tám","Chín","Mưới","Mười Một","Mười Hai"],weekdaysFull:["Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"],weekdaysShort:["C.Nhật","T.Hai","T.Ba","T.Tư","T.Năm","T.Sáu","T.Bảy"],today:"Hôm Nay",clear:"Xoá",firstDay:1}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"Xoá"});
|
js/lib/compressed/translations/zh_CN.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一","二","三","四","五","六","七","八","九","十","十一","十二"],weekdaysFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["日","一","二","三","四","五","六"],today:"今日",clear:"清除",close:"关闭",firstDay:1,format:"yyyy 年 mm 月 dd 日",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"清除"});
|
js/lib/compressed/translations/zh_TW.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一","二","三","四","五","六","七","八","九","十","十一","十二"],weekdaysFull:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["日","一","二","三","四","五","六"],today:"今天",clear:"清除",close:"关闭",firstDay:1,format:"yyyy 年 mm 月 dd 日",formatSubmit:"yyyy/mm/dd"}),jQuery.extend(jQuery.fn.pickatime.defaults,{clear:"清除"});
|
js/lib/jquery.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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery JavaScript Library v1.7
|
3 |
+
* http://jquery.com/
|
4 |
+
*
|
5 |
+
* Copyright 2011, John Resig
|
6 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
7 |
+
* http://jquery.org/license
|
8 |
+
*
|
9 |
+
* Includes Sizzle.js
|
10 |
+
* http://sizzlejs.com/
|
11 |
+
* Copyright 2011, The Dojo Foundation
|
12 |
+
* Released under the MIT, BSD, and GPL Licenses.
|
13 |
+
*
|
14 |
+
* Date: Thu Nov 3 16:18:21 2011 -0400
|
15 |
+
*/
|
16 |
+
(function( window, undefined ) {
|
17 |
+
|
18 |
+
// Use the correct document accordingly with window argument (sandbox)
|
19 |
+
var document = window.document,
|
20 |
+
navigator = window.navigator,
|
21 |
+
location = window.location;
|
22 |
+
var jQuery = (function() {
|
23 |
+
|
24 |
+
// Define a local copy of jQuery
|
25 |
+
var jQuery = function( selector, context ) {
|
26 |
+
// The jQuery object is actually just the init constructor 'enhanced'
|
27 |
+
return new jQuery.fn.init( selector, context, rootjQuery );
|
28 |
+
},
|
29 |
+
|
30 |
+
// Map over jQuery in case of overwrite
|
31 |
+
_jQuery = window.jQuery,
|
32 |
+
|
33 |
+
// Map over the $ in case of overwrite
|
34 |
+
_$ = window.$,
|
35 |
+
|
36 |
+
// A central reference to the root jQuery(document)
|
37 |
+
rootjQuery,
|
38 |
+
|
39 |
+
// A simple way to check for HTML strings or ID strings
|
40 |
+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
41 |
+
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
42 |
+
|
43 |
+
// Check if a string has a non-whitespace character in it
|
44 |
+
rnotwhite = /\S/,
|
45 |
+
|
46 |
+
// Used for trimming whitespace
|
47 |
+
trimLeft = /^\s+/,
|
48 |
+
trimRight = /\s+$/,
|
49 |
+
|
50 |
+
// Check for digits
|
51 |
+
rdigit = /\d/,
|
52 |
+
|
53 |
+
// Match a standalone tag
|
54 |
+
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
55 |
+
|
56 |
+
// JSON RegExp
|
57 |
+
rvalidchars = /^[\],:{}\s]*$/,
|
58 |
+
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
|
59 |
+
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
60 |
+
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
61 |
+
|
62 |
+
// Useragent RegExp
|
63 |
+
rwebkit = /(webkit)[ \/]([\w.]+)/,
|
64 |
+
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
|
65 |
+
rmsie = /(msie) ([\w.]+)/,
|
66 |
+
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
|
67 |
+
|
68 |
+
// Matches dashed string for camelizing
|
69 |
+
rdashAlpha = /-([a-z]|[0-9])/ig,
|
70 |
+
rmsPrefix = /^-ms-/,
|
71 |
+
|
72 |
+
// Used by jQuery.camelCase as callback to replace()
|
73 |
+
fcamelCase = function( all, letter ) {
|
74 |
+
return ( letter + "" ).toUpperCase();
|
75 |
+
},
|
76 |
+
|
77 |
+
// Keep a UserAgent string for use with jQuery.browser
|
78 |
+
userAgent = navigator.userAgent,
|
79 |
+
|
80 |
+
// For matching the engine and version of the browser
|
81 |
+
browserMatch,
|
82 |
+
|
83 |
+
// The deferred used on DOM ready
|
84 |
+
readyList,
|
85 |
+
|
86 |
+
// The ready event handler
|
87 |
+
DOMContentLoaded,
|
88 |
+
|
89 |
+
// Save a reference to some core methods
|
90 |
+
toString = Object.prototype.toString,
|
91 |
+
hasOwn = Object.prototype.hasOwnProperty,
|
92 |
+
push = Array.prototype.push,
|
93 |
+
slice = Array.prototype.slice,
|
94 |
+
trim = String.prototype.trim,
|
95 |
+
indexOf = Array.prototype.indexOf,
|
96 |
+
|
97 |
+
// [[Class]] -> type pairs
|
98 |
+
class2type = {};
|
99 |
+
|
100 |
+
jQuery.fn = jQuery.prototype = {
|
101 |
+
constructor: jQuery,
|
102 |
+
init: function( selector, context, rootjQuery ) {
|
103 |
+
var match, elem, ret, doc;
|
104 |
+
|
105 |
+
// Handle $(""), $(null), or $(undefined)
|
106 |
+
if ( !selector ) {
|
107 |
+
return this;
|
108 |
+
}
|
109 |
+
|
110 |
+
// Handle $(DOMElement)
|
111 |
+
if ( selector.nodeType ) {
|
112 |
+
this.context = this[0] = selector;
|
113 |
+
this.length = 1;
|
114 |
+
return this;
|
115 |
+
}
|
116 |
+
|
117 |
+
// The body element only exists once, optimize finding it
|
118 |
+
if ( selector === "body" && !context && document.body ) {
|
119 |
+
this.context = document;
|
120 |
+
this[0] = document.body;
|
121 |
+
this.selector = selector;
|
122 |
+
this.length = 1;
|
123 |
+
return this;
|
124 |
+
}
|
125 |
+
|
126 |
+
// Handle HTML strings
|
127 |
+
if ( typeof selector === "string" ) {
|
128 |
+
// Are we dealing with HTML string or an ID?
|
129 |
+
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
130 |
+
// Assume that strings that start and end with <> are HTML and skip the regex check
|
131 |
+
match = [ null, selector, null ];
|
132 |
+
|
133 |
+
} else {
|
134 |
+
match = quickExpr.exec( selector );
|
135 |
+
}
|
136 |
+
|
137 |
+
// Verify a match, and that no context was specified for #id
|
138 |
+
if ( match && (match[1] || !context) ) {
|
139 |
+
|
140 |
+
// HANDLE: $(html) -> $(array)
|
141 |
+
if ( match[1] ) {
|
142 |
+
context = context instanceof jQuery ? context[0] : context;
|
143 |
+
doc = ( context ? context.ownerDocument || context : document );
|
144 |
+
|
145 |
+
// If a single string is passed in and it's a single tag
|
146 |
+
// just do a createElement and skip the rest
|
147 |
+
ret = rsingleTag.exec( selector );
|
148 |
+
|
149 |
+
if ( ret ) {
|
150 |
+
if ( jQuery.isPlainObject( context ) ) {
|
151 |
+
selector = [ document.createElement( ret[1] ) ];
|
152 |
+
jQuery.fn.attr.call( selector, context, true );
|
153 |
+
|
154 |
+
} else {
|
155 |
+
selector = [ doc.createElement( ret[1] ) ];
|
156 |
+
}
|
157 |
+
|
158 |
+
} else {
|
159 |
+
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
|
160 |
+
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
|
161 |
+
}
|
162 |
+
|
163 |
+
return jQuery.merge( this, selector );
|
164 |
+
|
165 |
+
// HANDLE: $("#id")
|
166 |
+
} else {
|
167 |
+
elem = document.getElementById( match[2] );
|
168 |
+
|
169 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
170 |
+
// nodes that are no longer in the document #6963
|
171 |
+
if ( elem && elem.parentNode ) {
|
172 |
+
// Handle the case where IE and Opera return items
|
173 |
+
// by name instead of ID
|
174 |
+
if ( elem.id !== match[2] ) {
|
175 |
+
return rootjQuery.find( selector );
|
176 |
+
}
|
177 |
+
|
178 |
+
// Otherwise, we inject the element directly into the jQuery object
|
179 |
+
this.length = 1;
|
180 |
+
this[0] = elem;
|
181 |
+
}
|
182 |
+
|
183 |
+
this.context = document;
|
184 |
+
this.selector = selector;
|
185 |
+
return this;
|
186 |
+
}
|
187 |
+
|
188 |
+
// HANDLE: $(expr, $(...))
|
189 |
+
} else if ( !context || context.jquery ) {
|
190 |
+
return ( context || rootjQuery ).find( selector );
|
191 |
+
|
192 |
+
// HANDLE: $(expr, context)
|
193 |
+
// (which is just equivalent to: $(context).find(expr)
|
194 |
+
} else {
|
195 |
+
return this.constructor( context ).find( selector );
|
196 |
+
}
|
197 |
+
|
198 |
+
// HANDLE: $(function)
|
199 |
+
// Shortcut for document ready
|
200 |
+
} else if ( jQuery.isFunction( selector ) ) {
|
201 |
+
return rootjQuery.ready( selector );
|
202 |
+
}
|
203 |
+
|
204 |
+
if ( selector.selector !== undefined ) {
|
205 |
+
this.selector = selector.selector;
|
206 |
+
this.context = selector.context;
|
207 |
+
}
|
208 |
+
|
209 |
+
return jQuery.makeArray( selector, this );
|
210 |
+
},
|
211 |
+
|
212 |
+
// Start with an empty selector
|
213 |
+
selector: "",
|
214 |
+
|
215 |
+
// The current version of jQuery being used
|
216 |
+
jquery: "1.7",
|
217 |
+
|
218 |
+
// The default length of a jQuery object is 0
|
219 |
+
length: 0,
|
220 |
+
|
221 |
+
// The number of elements contained in the matched element set
|
222 |
+
size: function() {
|
223 |
+
return this.length;
|
224 |
+
},
|
225 |
+
|
226 |
+
toArray: function() {
|
227 |
+
return slice.call( this, 0 );
|
228 |
+
},
|
229 |
+
|
230 |
+
// Get the Nth element in the matched element set OR
|
231 |
+
// Get the whole matched element set as a clean array
|
232 |
+
get: function( num ) {
|
233 |
+
return num == null ?
|
234 |
+
|
235 |
+
// Return a 'clean' array
|
236 |
+
this.toArray() :
|
237 |
+
|
238 |
+
// Return just the object
|
239 |
+
( num < 0 ? this[ this.length + num ] : this[ num ] );
|
240 |
+
},
|
241 |
+
|
242 |
+
// Take an array of elements and push it onto the stack
|
243 |
+
// (returning the new matched element set)
|
244 |
+
pushStack: function( elems, name, selector ) {
|
245 |
+
// Build a new jQuery matched element set
|
246 |
+
var ret = this.constructor();
|
247 |
+
|
248 |
+
if ( jQuery.isArray( elems ) ) {
|
249 |
+
push.apply( ret, elems );
|
250 |
+
|
251 |
+
} else {
|
252 |
+
jQuery.merge( ret, elems );
|
253 |
+
}
|
254 |
+
|
255 |
+
// Add the old object onto the stack (as a reference)
|
256 |
+
ret.prevObject = this;
|
257 |
+
|
258 |
+
ret.context = this.context;
|
259 |
+
|
260 |
+
if ( name === "find" ) {
|
261 |
+
ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
|
262 |
+
} else if ( name ) {
|
263 |
+
ret.selector = this.selector + "." + name + "(" + selector + ")";
|
264 |
+
}
|
265 |
+
|
266 |
+
// Return the newly-formed element set
|
267 |
+
return ret;
|
268 |
+
},
|
269 |
+
|
270 |
+
// Execute a callback for every element in the matched set.
|
271 |
+
// (You can seed the arguments with an array of args, but this is
|
272 |
+
// only used internally.)
|
273 |
+
each: function( callback, args ) {
|
274 |
+
return jQuery.each( this, callback, args );
|
275 |
+
},
|
276 |
+
|
277 |
+
ready: function( fn ) {
|
278 |
+
// Attach the listeners
|
279 |
+
jQuery.bindReady();
|
280 |
+
|
281 |
+
// Add the callback
|
282 |
+
readyList.add( fn );
|
283 |
+
|
284 |
+
return this;
|
285 |
+
},
|
286 |
+
|
287 |
+
eq: function( i ) {
|
288 |
+
return i === -1 ?
|
289 |
+
this.slice( i ) :
|
290 |
+
this.slice( i, +i + 1 );
|
291 |
+
},
|
292 |
+
|
293 |
+
first: function() {
|
294 |
+
return this.eq( 0 );
|
295 |
+
},
|
296 |
+
|
297 |
+
last: function() {
|
298 |
+
return this.eq( -1 );
|
299 |
+
},
|
300 |
+
|
301 |
+
slice: function() {
|
302 |
+
return this.pushStack( slice.apply( this, arguments ),
|
303 |
+
"slice", slice.call(arguments).join(",") );
|
304 |
+
},
|
305 |
+
|
306 |
+
map: function( callback ) {
|
307 |
+
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
308 |
+
return callback.call( elem, i, elem );
|
309 |
+
}));
|
310 |
+
},
|
311 |
+
|
312 |
+
end: function() {
|
313 |
+
return this.prevObject || this.constructor(null);
|
314 |
+
},
|
315 |
+
|
316 |
+
// For internal use only.
|
317 |
+
// Behaves like an Array's method, not like a jQuery method.
|
318 |
+
push: push,
|
319 |
+
sort: [].sort,
|
320 |
+
splice: [].splice
|
321 |
+
};
|
322 |
+
|
323 |
+
// Give the init function the jQuery prototype for later instantiation
|
324 |
+
jQuery.fn.init.prototype = jQuery.fn;
|
325 |
+
|
326 |
+
jQuery.extend = jQuery.fn.extend = function() {
|
327 |
+
var options, name, src, copy, copyIsArray, clone,
|
328 |
+
target = arguments[0] || {},
|
329 |
+
i = 1,
|
330 |
+
length = arguments.length,
|
331 |
+
deep = false;
|
332 |
+
|
333 |
+
// Handle a deep copy situation
|
334 |
+
if ( typeof target === "boolean" ) {
|
335 |
+
deep = target;
|
336 |
+
target = arguments[1] || {};
|
337 |
+
// skip the boolean and the target
|
338 |
+
i = 2;
|
339 |
+
}
|
340 |
+
|
341 |
+
// Handle case when target is a string or something (possible in deep copy)
|
342 |
+
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
343 |
+
target = {};
|
344 |
+
}
|
345 |
+
|
346 |
+
// extend jQuery itself if only one argument is passed
|
347 |
+
if ( length === i ) {
|
348 |
+
target = this;
|
349 |
+
--i;
|
350 |
+
}
|
351 |
+
|
352 |
+
for ( ; i < length; i++ ) {
|
353 |
+
// Only deal with non-null/undefined values
|
354 |
+
if ( (options = arguments[ i ]) != null ) {
|
355 |
+
// Extend the base object
|
356 |
+
for ( name in options ) {
|
357 |
+
src = target[ name ];
|
358 |
+
copy = options[ name ];
|
359 |
+
|
360 |
+
// Prevent never-ending loop
|
361 |
+
if ( target === copy ) {
|
362 |
+
continue;
|
363 |
+
}
|
364 |
+
|
365 |
+
// Recurse if we're merging plain objects or arrays
|
366 |
+
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
367 |
+
if ( copyIsArray ) {
|
368 |
+
copyIsArray = false;
|
369 |
+
clone = src && jQuery.isArray(src) ? src : [];
|
370 |
+
|
371 |
+
} else {
|
372 |
+
clone = src && jQuery.isPlainObject(src) ? src : {};
|
373 |
+
}
|
374 |
+
|
375 |
+
// Never move original objects, clone them
|
376 |
+
target[ name ] = jQuery.extend( deep, clone, copy );
|
377 |
+
|
378 |
+
// Don't bring in undefined values
|
379 |
+
} else if ( copy !== undefined ) {
|
380 |
+
target[ name ] = copy;
|
381 |
+
}
|
382 |
+
}
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
// Return the modified object
|
387 |
+
return target;
|
388 |
+
};
|
389 |
+
|
390 |
+
jQuery.extend({
|
391 |
+
noConflict: function( deep ) {
|
392 |
+
if ( window.$ === jQuery ) {
|
393 |
+
window.$ = _$;
|
394 |
+
}
|
395 |
+
|
396 |
+
if ( deep && window.jQuery === jQuery ) {
|
397 |
+
window.jQuery = _jQuery;
|
398 |
+
}
|
399 |
+
|
400 |
+
return jQuery;
|
401 |
+
},
|
402 |
+
|
403 |
+
// Is the DOM ready to be used? Set to true once it occurs.
|
404 |
+
isReady: false,
|
405 |
+
|
406 |
+
// A counter to track how many items to wait for before
|
407 |
+
// the ready event fires. See #6781
|
408 |
+
readyWait: 1,
|
409 |
+
|
410 |
+
// Hold (or release) the ready event
|
411 |
+
holdReady: function( hold ) {
|
412 |
+
if ( hold ) {
|
413 |
+
jQuery.readyWait++;
|
414 |
+
} else {
|
415 |
+
jQuery.ready( true );
|
416 |
+
}
|
417 |
+
},
|
418 |
+
|
419 |
+
// Handle when the DOM is ready
|
420 |
+
ready: function( wait ) {
|
421 |
+
// Either a released hold or an DOMready/load event and not yet ready
|
422 |
+
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
|
423 |
+
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
424 |
+
if ( !document.body ) {
|
425 |
+
return setTimeout( jQuery.ready, 1 );
|
426 |
+
}
|
427 |
+
|
428 |
+
// Remember that the DOM is ready
|
429 |
+
jQuery.isReady = true;
|
430 |
+
|
431 |
+
// If a normal DOM Ready event fired, decrement, and wait if need be
|
432 |
+
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
433 |
+
return;
|
434 |
+
}
|
435 |
+
|
436 |
+
// If there are functions bound, to execute
|
437 |
+
readyList.fireWith( document, [ jQuery ] );
|
438 |
+
|
439 |
+
// Trigger any bound ready events
|
440 |
+
if ( jQuery.fn.trigger ) {
|
441 |
+
jQuery( document ).trigger( "ready" ).unbind( "ready" );
|
442 |
+
}
|
443 |
+
}
|
444 |
+
},
|
445 |
+
|
446 |
+
bindReady: function() {
|
447 |
+
if ( readyList ) {
|
448 |
+
return;
|
449 |
+
}
|
450 |
+
|
451 |
+
readyList = jQuery.Callbacks( "once memory" );
|
452 |
+
|
453 |
+
// Catch cases where $(document).ready() is called after the
|
454 |
+
// browser event has already occurred.
|
455 |
+
if ( document.readyState === "complete" ) {
|
456 |
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
457 |
+
return setTimeout( jQuery.ready, 1 );
|
458 |
+
}
|
459 |
+
|
460 |
+
// Mozilla, Opera and webkit nightlies currently support this event
|
461 |
+
if ( document.addEventListener ) {
|
462 |
+
// Use the handy event callback
|
463 |
+
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
464 |
+
|
465 |
+
// A fallback to window.onload, that will always work
|
466 |
+
window.addEventListener( "load", jQuery.ready, false );
|
467 |
+
|
468 |
+
// If IE event model is used
|
469 |
+
} else if ( document.attachEvent ) {
|
470 |
+
// ensure firing before onload,
|
471 |
+
// maybe late but safe also for iframes
|
472 |
+
document.attachEvent( "onreadystatechange", DOMContentLoaded );
|
473 |
+
|
474 |
+
// A fallback to window.onload, that will always work
|
475 |
+
window.attachEvent( "onload", jQuery.ready );
|
476 |
+
|
477 |
+
// If IE and not a frame
|
478 |
+
// continually check to see if the document is ready
|
479 |
+
var toplevel = false;
|
480 |
+
|
481 |
+
try {
|
482 |
+
toplevel = window.frameElement == null;
|
483 |
+
} catch(e) {}
|
484 |
+
|
485 |
+
if ( document.documentElement.doScroll && toplevel ) {
|
486 |
+
doScrollCheck();
|
487 |
+
}
|
488 |
+
}
|
489 |
+
},
|
490 |
+
|
491 |
+
// See test/unit/core.js for details concerning isFunction.
|
492 |
+
// Since version 1.3, DOM methods and functions like alert
|
493 |
+
// aren't supported. They return false on IE (#2968).
|
494 |
+
isFunction: function( obj ) {
|
495 |
+
return jQuery.type(obj) === "function";
|
496 |
+
},
|
497 |
+
|
498 |
+
isArray: Array.isArray || function( obj ) {
|
499 |
+
return jQuery.type(obj) === "array";
|
500 |
+
},
|
501 |
+
|
502 |
+
// A crude way of determining if an object is a window
|
503 |
+
isWindow: function( obj ) {
|
504 |
+
return obj && typeof obj === "object" && "setInterval" in obj;
|
505 |
+
},
|
506 |
+
|
507 |
+
isNumeric: function( obj ) {
|
508 |
+
return obj != null && rdigit.test( obj ) && !isNaN( obj );
|
509 |
+
},
|
510 |
+
|
511 |
+
type: function( obj ) {
|
512 |
+
return obj == null ?
|
513 |
+
String( obj ) :
|
514 |
+
class2type[ toString.call(obj) ] || "object";
|
515 |
+
},
|
516 |
+
|
517 |
+
isPlainObject: function( obj ) {
|
518 |
+
// Must be an Object.
|
519 |
+
// Because of IE, we also have to check the presence of the constructor property.
|
520 |
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
521 |
+
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
522 |
+
return false;
|
523 |
+
}
|
524 |
+
|
525 |
+
try {
|
526 |
+
// Not own constructor property must be Object
|
527 |
+
if ( obj.constructor &&
|
528 |
+
!hasOwn.call(obj, "constructor") &&
|
529 |
+
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
530 |
+
return false;
|
531 |
+
}
|
532 |
+
} catch ( e ) {
|
533 |
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
534 |
+
return false;
|
535 |
+
}
|
536 |
+
|
537 |
+
// Own properties are enumerated firstly, so to speed up,
|
538 |
+
// if last one is own, then all properties are own.
|
539 |
+
|
540 |
+
var key;
|
541 |
+
for ( key in obj ) {}
|
542 |
+
|
543 |
+
return key === undefined || hasOwn.call( obj, key );
|
544 |
+
},
|
545 |
+
|
546 |
+
isEmptyObject: function( obj ) {
|
547 |
+
for ( var name in obj ) {
|
548 |
+
return false;
|
549 |
+
}
|
550 |
+
return true;
|
551 |
+
},
|
552 |
+
|
553 |
+
error: function( msg ) {
|
554 |
+
throw msg;
|
555 |
+
},
|
556 |
+
|
557 |
+
parseJSON: function( data ) {
|
558 |
+
if ( typeof data !== "string" || !data ) {
|
559 |
+
return null;
|
560 |
+
}
|
561 |
+
|
562 |
+
// Make sure leading/trailing whitespace is removed (IE can't handle it)
|
563 |
+
data = jQuery.trim( data );
|
564 |
+
|
565 |
+
// Attempt to parse using the native JSON parser first
|
566 |
+
if ( window.JSON && window.JSON.parse ) {
|
567 |
+
return window.JSON.parse( data );
|
568 |
+
}
|
569 |
+
|
570 |
+
// Make sure the incoming data is actual JSON
|
571 |
+
// Logic borrowed from http://json.org/json2.js
|
572 |
+
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
|
573 |
+
.replace( rvalidtokens, "]" )
|
574 |
+
.replace( rvalidbraces, "")) ) {
|
575 |
+
|
576 |
+
return ( new Function( "return " + data ) )();
|
577 |
+
|
578 |
+
}
|
579 |
+
jQuery.error( "Invalid JSON: " + data );
|
580 |
+
},
|
581 |
+
|
582 |
+
// Cross-browser xml parsing
|
583 |
+
parseXML: function( data ) {
|
584 |
+
var xml, tmp;
|
585 |
+
try {
|
586 |
+
if ( window.DOMParser ) { // Standard
|
587 |
+
tmp = new DOMParser();
|
588 |
+
xml = tmp.parseFromString( data , "text/xml" );
|
589 |
+
} else { // IE
|
590 |
+
xml = new ActiveXObject( "Microsoft.XMLDOM" );
|
591 |
+
xml.async = "false";
|
592 |
+
xml.loadXML( data );
|
593 |
+
}
|
594 |
+
} catch( e ) {
|
595 |
+
xml = undefined;
|
596 |
+
}
|
597 |
+
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
|
598 |
+
jQuery.error( "Invalid XML: " + data );
|
599 |
+
}
|
600 |
+
return xml;
|
601 |
+
},
|
602 |
+
|
603 |
+
noop: function() {},
|
604 |
+
|
605 |
+
// Evaluates a script in a global context
|
606 |
+
// Workarounds based on findings by Jim Driscoll
|
607 |
+
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
608 |
+
globalEval: function( data ) {
|
609 |
+
if ( data && rnotwhite.test( data ) ) {
|
610 |
+
// We use execScript on Internet Explorer
|
611 |
+
// We use an anonymous function so that context is window
|
612 |
+
// rather than jQuery in Firefox
|
613 |
+
( window.execScript || function( data ) {
|
614 |
+
window[ "eval" ].call( window, data );
|
615 |
+
} )( data );
|
616 |
+
}
|
617 |
+
},
|
618 |
+
|
619 |
+
// Convert dashed to camelCase; used by the css and data modules
|
620 |
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
621 |
+
camelCase: function( string ) {
|
622 |
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
623 |
+
},
|
624 |
+
|
625 |
+
nodeName: function( elem, name ) {
|
626 |
+
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
|
627 |
+
},
|
628 |
+
|
629 |
+
// args is for internal usage only
|
630 |
+
each: function( object, callback, args ) {
|
631 |
+
var name, i = 0,
|
632 |
+
length = object.length,
|
633 |
+
isObj = length === undefined || jQuery.isFunction( object );
|
634 |
+
|
635 |
+
if ( args ) {
|
636 |
+
if ( isObj ) {
|
637 |
+
for ( name in object ) {
|
638 |
+
if ( callback.apply( object[ name ], args ) === false ) {
|
639 |
+
break;
|
640 |
+
}
|
641 |
+
}
|
642 |
+
} else {
|
643 |
+
for ( ; i < length; ) {
|
644 |
+
if ( callback.apply( object[ i++ ], args ) === false ) {
|
645 |
+
break;
|
646 |
+
}
|
647 |
+
}
|
648 |
+
}
|
649 |
+
|
650 |
+
// A special, fast, case for the most common use of each
|
651 |
+
} else {
|
652 |
+
if ( isObj ) {
|
653 |
+
for ( name in object ) {
|
654 |
+
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
|
655 |
+
break;
|
656 |
+
}
|
657 |
+
}
|
658 |
+
} else {
|
659 |
+
for ( ; i < length; ) {
|
660 |
+
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
|
661 |
+
break;
|
662 |
+
}
|
663 |
+
}
|
664 |
+
}
|
665 |
+
}
|
666 |
+
|
667 |
+
return object;
|
668 |
+
},
|
669 |
+
|
670 |
+
// Use native String.trim function wherever possible
|
671 |
+
trim: trim ?
|
672 |
+
function( text ) {
|
673 |
+
return text == null ?
|
674 |
+
"" :
|
675 |
+
trim.call( text );
|
676 |
+
} :
|
677 |
+
|
678 |
+
// Otherwise use our own trimming functionality
|
679 |
+
function( text ) {
|
680 |
+
return text == null ?
|
681 |
+
"" :
|
682 |
+
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
|
683 |
+
},
|
684 |
+
|
685 |
+
// results is for internal usage only
|
686 |
+
makeArray: function( array, results ) {
|
687 |
+
var ret = results || [];
|
688 |
+
|
689 |
+
if ( array != null ) {
|
690 |
+
// The window, strings (and functions) also have 'length'
|
691 |
+
// The extra typeof function check is to prevent crashes
|
692 |
+
// in Safari 2 (See: #3039)
|
693 |
+
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
|
694 |
+
var type = jQuery.type( array );
|
695 |
+
|
696 |
+
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
|
697 |
+
push.call( ret, array );
|
698 |
+
} else {
|
699 |
+
jQuery.merge( ret, array );
|
700 |
+
}
|
701 |
+
}
|
702 |
+
|
703 |
+
return ret;
|
704 |
+
},
|
705 |
+
|
706 |
+
inArray: function( elem, array, i ) {
|
707 |
+
var len;
|
708 |
+
|
709 |
+
if ( array ) {
|
710 |
+
if ( indexOf ) {
|
711 |
+
return indexOf.call( array, elem, i );
|
712 |
+
}
|
713 |
+
|
714 |
+
len = array.length;
|
715 |
+
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
716 |
+
|
717 |
+
for ( ; i < len; i++ ) {
|
718 |
+
// Skip accessing in sparse arrays
|
719 |
+
if ( i in array && array[ i ] === elem ) {
|
720 |
+
return i;
|
721 |
+
}
|
722 |
+
}
|
723 |
+
}
|
724 |
+
|
725 |
+
return -1;
|
726 |
+
},
|
727 |
+
|
728 |
+
merge: function( first, second ) {
|
729 |
+
var i = first.length,
|
730 |
+
j = 0;
|
731 |
+
|
732 |
+
if ( typeof second.length === "number" ) {
|
733 |
+
for ( var l = second.length; j < l; j++ ) {
|
734 |
+
first[ i++ ] = second[ j ];
|
735 |
+
}
|
736 |
+
|
737 |
+
} else {
|
738 |
+
while ( second[j] !== undefined ) {
|
739 |
+
first[ i++ ] = second[ j++ ];
|
740 |
+
}
|
741 |
+
}
|
742 |
+
|
743 |
+
first.length = i;
|
744 |
+
|
745 |
+
return first;
|
746 |
+
},
|
747 |
+
|
748 |
+
grep: function( elems, callback, inv ) {
|
749 |
+
var ret = [], retVal;
|
750 |
+
inv = !!inv;
|
751 |
+
|
752 |
+
// Go through the array, only saving the items
|
753 |
+
// that pass the validator function
|
754 |
+
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
755 |
+
retVal = !!callback( elems[ i ], i );
|
756 |
+
if ( inv !== retVal ) {
|
757 |
+
ret.push( elems[ i ] );
|
758 |
+
}
|
759 |
+
}
|
760 |
+
|
761 |
+
return ret;
|
762 |
+
},
|
763 |
+
|
764 |
+
// arg is for internal usage only
|
765 |
+
map: function( elems, callback, arg ) {
|
766 |
+
var value, key, ret = [],
|
767 |
+
i = 0,
|
768 |
+
length = elems.length,
|
769 |
+
// jquery objects are treated as arrays
|
770 |
+
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
|
771 |
+
|
772 |
+
// Go through the array, translating each of the items to their
|
773 |
+
if ( isArray ) {
|
774 |
+
for ( ; i < length; i++ ) {
|
775 |
+
value = callback( elems[ i ], i, arg );
|
776 |
+
|
777 |
+
if ( value != null ) {
|
778 |
+
ret[ ret.length ] = value;
|
779 |
+
}
|
780 |
+
}
|
781 |
+
|
782 |
+
// Go through every key on the object,
|
783 |
+
} else {
|
784 |
+
for ( key in elems ) {
|
785 |
+
value = callback( elems[ key ], key, arg );
|
786 |
+
|
787 |
+
if ( value != null ) {
|
788 |
+
ret[ ret.length ] = value;
|
789 |
+
}
|
790 |
+
}
|
791 |
+
}
|
792 |
+
|
793 |
+
// Flatten any nested arrays
|
794 |
+
return ret.concat.apply( [], ret );
|
795 |
+
},
|
796 |
+
|
797 |
+
// A global GUID counter for objects
|
798 |
+
guid: 1,
|
799 |
+
|
800 |
+
// Bind a function to a context, optionally partially applying any
|
801 |
+
// arguments.
|
802 |
+
proxy: function( fn, context ) {
|
803 |
+
if ( typeof context === "string" ) {
|
804 |
+
var tmp = fn[ context ];
|
805 |
+
context = fn;
|
806 |
+
fn = tmp;
|
807 |
+
}
|
808 |
+
|
809 |
+
// Quick check to determine if target is callable, in the spec
|
810 |
+
// this throws a TypeError, but we will just return undefined.
|
811 |
+
if ( !jQuery.isFunction( fn ) ) {
|
812 |
+
return undefined;
|
813 |
+
}
|
814 |
+
|
815 |
+
// Simulated bind
|
816 |
+
var args = slice.call( arguments, 2 ),
|
817 |
+
proxy = function() {
|
818 |
+
return fn.apply( context, args.concat( slice.call( arguments ) ) );
|
819 |
+
};
|
820 |
+
|
821 |
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
822 |
+
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
|
823 |
+
|
824 |
+
return proxy;
|
825 |
+
},
|
826 |
+
|
827 |
+
// Mutifunctional method to get and set values to a collection
|
828 |
+
// The value/s can optionally be executed if it's a function
|
829 |
+
access: function( elems, key, value, exec, fn, pass ) {
|
830 |
+
var length = elems.length;
|
831 |
+
|
832 |
+
// Setting many attributes
|
833 |
+
if ( typeof key === "object" ) {
|
834 |
+
for ( var k in key ) {
|
835 |
+
jQuery.access( elems, k, key[k], exec, fn, value );
|
836 |
+
}
|
837 |
+
return elems;
|
838 |
+
}
|
839 |
+
|
840 |
+
// Setting one attribute
|
841 |
+
if ( value !== undefined ) {
|
842 |
+
// Optionally, function values get executed if exec is true
|
843 |
+
exec = !pass && exec && jQuery.isFunction(value);
|
844 |
+
|
845 |
+
for ( var i = 0; i < length; i++ ) {
|
846 |
+
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
|
847 |
+
}
|
848 |
+
|
849 |
+
return elems;
|
850 |
+
}
|
851 |
+
|
852 |
+
// Getting an attribute
|
853 |
+
return length ? fn( elems[0], key ) : undefined;
|
854 |
+
},
|
855 |
+
|
856 |
+
now: function() {
|
857 |
+
return ( new Date() ).getTime();
|
858 |
+
},
|
859 |
+
|
860 |
+
// Use of jQuery.browser is frowned upon.
|
861 |
+
// More details: http://docs.jquery.com/Utilities/jQuery.browser
|
862 |
+
uaMatch: function( ua ) {
|
863 |
+
ua = ua.toLowerCase();
|
864 |
+
|
865 |
+
var match = rwebkit.exec( ua ) ||
|
866 |
+
ropera.exec( ua ) ||
|
867 |
+
rmsie.exec( ua ) ||
|
868 |
+
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
|
869 |
+
[];
|
870 |
+
|
871 |
+
return { browser: match[1] || "", version: match[2] || "0" };
|
872 |
+
},
|
873 |
+
|
874 |
+
sub: function() {
|
875 |
+
function jQuerySub( selector, context ) {
|
876 |
+
return new jQuerySub.fn.init( selector, context );
|
877 |
+
}
|
878 |
+
jQuery.extend( true, jQuerySub, this );
|
879 |
+
jQuerySub.superclass = this;
|
880 |
+
jQuerySub.fn = jQuerySub.prototype = this();
|
881 |
+
jQuerySub.fn.constructor = jQuerySub;
|
882 |
+
jQuerySub.sub = this.sub;
|
883 |
+
jQuerySub.fn.init = function init( selector, context ) {
|
884 |
+
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
885 |
+
context = jQuerySub( context );
|
886 |
+
}
|
887 |
+
|
888 |
+
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
889 |
+
};
|
890 |
+
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
891 |
+
var rootjQuerySub = jQuerySub(document);
|
892 |
+
return jQuerySub;
|
893 |
+
},
|
894 |
+
|
895 |
+
browser: {}
|
896 |
+
});
|
897 |
+
|
898 |
+
// Populate the class2type map
|
899 |
+
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
|
900 |
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
901 |
+
});
|
902 |
+
|
903 |
+
browserMatch = jQuery.uaMatch( userAgent );
|
904 |
+
if ( browserMatch.browser ) {
|
905 |
+
jQuery.browser[ browserMatch.browser ] = true;
|
906 |
+
jQuery.browser.version = browserMatch.version;
|
907 |
+
}
|
908 |
+
|
909 |
+
// Deprecated, use jQuery.browser.webkit instead
|
910 |
+
if ( jQuery.browser.webkit ) {
|
911 |
+
jQuery.browser.safari = true;
|
912 |
+
}
|
913 |
+
|
914 |
+
// IE doesn't match non-breaking spaces with \s
|
915 |
+
if ( rnotwhite.test( "\xA0" ) ) {
|
916 |
+
trimLeft = /^[\s\xA0]+/;
|
917 |
+
trimRight = /[\s\xA0]+$/;
|
918 |
+
}
|
919 |
+
|
920 |
+
// All jQuery objects should point back to these
|
921 |
+
rootjQuery = jQuery(document);
|
922 |
+
|
923 |
+
// Cleanup functions for the document ready method
|
924 |
+
if ( document.addEventListener ) {
|
925 |
+
DOMContentLoaded = function() {
|
926 |
+
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
927 |
+
jQuery.ready();
|
928 |
+
};
|
929 |
+
|
930 |
+
} else if ( document.attachEvent ) {
|
931 |
+
DOMContentLoaded = function() {
|
932 |
+
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
933 |
+
if ( document.readyState === "complete" ) {
|
934 |
+
document.detachEvent( "onreadystatechange", DOMContentLoaded );
|
935 |
+
jQuery.ready();
|
936 |
+
}
|
937 |
+
};
|
938 |
+
}
|
939 |
+
|
940 |
+
// The DOM ready check for Internet Explorer
|
941 |
+
function doScrollCheck() {
|
942 |
+
if ( jQuery.isReady ) {
|
943 |
+
return;
|
944 |
+
}
|
945 |
+
|
946 |
+
try {
|
947 |
+
// If IE is used, use the trick by Diego Perini
|
948 |
+
// http://javascript.nwbox.com/IEContentLoaded/
|
949 |
+
document.documentElement.doScroll("left");
|
950 |
+
} catch(e) {
|
951 |
+
setTimeout( doScrollCheck, 1 );
|
952 |
+
return;
|
953 |
+
}
|
954 |
+
|
955 |
+
// and execute any waiting functions
|
956 |
+
jQuery.ready();
|
957 |
+
}
|
958 |
+
|
959 |
+
// Expose jQuery as an AMD module, but only for AMD loaders that
|
960 |
+
// understand the issues with loading multiple versions of jQuery
|
961 |
+
// in a page that all might call define(). The loader will indicate
|
962 |
+
// they have special allowances for multiple jQuery versions by
|
963 |
+
// specifying define.amd.jQuery = true. Register as a named module,
|
964 |
+
// since jQuery can be concatenated with other files that may use define,
|
965 |
+
// but not use a proper concatenation script that understands anonymous
|
966 |
+
// AMD modules. A named AMD is safest and most robust way to register.
|
967 |
+
// Lowercase jquery is used because AMD module names are derived from
|
968 |
+
// file names, and jQuery is normally delivered in a lowercase file name.
|
969 |
+
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
|
970 |
+
define( "jquery", [], function () { return jQuery; } );
|
971 |
+
}
|
972 |
+
|
973 |
+
return jQuery;
|
974 |
+
|
975 |
+
})();
|
976 |
+
|
977 |
+
|
978 |
+
// String to Object flags format cache
|
979 |
+
var flagsCache = {};
|
980 |
+
|
981 |
+
// Convert String-formatted flags into Object-formatted ones and store in cache
|
982 |
+
function createFlags( flags ) {
|
983 |
+
var object = flagsCache[ flags ] = {},
|
984 |
+
i, length;
|
985 |
+
flags = flags.split( /\s+/ );
|
986 |
+
for ( i = 0, length = flags.length; i < length; i++ ) {
|
987 |
+
object[ flags[i] ] = true;
|
988 |
+
}
|
989 |
+
return object;
|
990 |
+
}
|
991 |
+
|
992 |
+
/*
|
993 |
+
* Create a callback list using the following parameters:
|
994 |
+
*
|
995 |
+
* flags: an optional list of space-separated flags that will change how
|
996 |
+
* the callback list behaves
|
997 |
+
*
|
998 |
+
* By default a callback list will act like an event callback list and can be
|
999 |
+
* "fired" multiple times.
|
1000 |
+
*
|
1001 |
+
* Possible flags:
|
1002 |
+
*
|
1003 |
+
* once: will ensure the callback list can only be fired once (like a Deferred)
|
1004 |
+
*
|
1005 |
+
* memory: will keep track of previous values and will call any callback added
|
1006 |
+
* after the list has been fired right away with the latest "memorized"
|
1007 |
+
* values (like a Deferred)
|
1008 |
+
*
|
1009 |
+
* unique: will ensure a callback can only be added once (no duplicate in the list)
|
1010 |
+
*
|
1011 |
+
* stopOnFalse: interrupt callings when a callback returns false
|
1012 |
+
*
|
1013 |
+
*/
|
1014 |
+
jQuery.Callbacks = function( flags ) {
|
1015 |
+
|
1016 |
+
// Convert flags from String-formatted to Object-formatted
|
1017 |
+
// (we check in cache first)
|
1018 |
+
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
|
1019 |
+
|
1020 |
+
var // Actual callback list
|
1021 |
+
list = [],
|
1022 |
+
// Stack of fire calls for repeatable lists
|
1023 |
+
stack = [],
|
1024 |
+
// Last fire value (for non-forgettable lists)
|
1025 |
+
memory,
|
1026 |
+
// Flag to know if list is currently firing
|
1027 |
+
firing,
|
1028 |
+
// First callback to fire (used internally by add and fireWith)
|
1029 |
+
firingStart,
|
1030 |
+
// End of the loop when firing
|
1031 |
+
firingLength,
|
1032 |
+
// Index of currently firing callback (modified by remove if needed)
|
1033 |
+
firingIndex,
|
1034 |
+
// Add one or several callbacks to the list
|
1035 |
+
add = function( args ) {
|
1036 |
+
var i,
|
1037 |
+
length,
|
1038 |
+
elem,
|
1039 |
+
type,
|
1040 |
+
actual;
|
1041 |
+
for ( i = 0, length = args.length; i < length; i++ ) {
|
1042 |
+
elem = args[ i ];
|
1043 |
+
type = jQuery.type( elem );
|
1044 |
+
if ( type === "array" ) {
|
1045 |
+
// Inspect recursively
|
1046 |
+
add( elem );
|
1047 |
+
} else if ( type === "function" ) {
|
1048 |
+
// Add if not in unique mode and callback is not in
|
1049 |
+
if ( !flags.unique || !self.has( elem ) ) {
|
1050 |
+
list.push( elem );
|
1051 |
+
}
|
1052 |
+
}
|
1053 |
+
}
|
1054 |
+
},
|
1055 |
+
// Fire callbacks
|
1056 |
+
fire = function( context, args ) {
|
1057 |
+
args = args || [];
|
1058 |
+
memory = !flags.memory || [ context, args ];
|
1059 |
+
firing = true;
|
1060 |
+
firingIndex = firingStart || 0;
|
1061 |
+
firingStart = 0;
|
1062 |
+
firingLength = list.length;
|
1063 |
+
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
1064 |
+
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
|
1065 |
+
memory = true; // Mark as halted
|
1066 |
+
break;
|
1067 |
+
}
|
1068 |
+
}
|
1069 |
+
firing = false;
|
1070 |
+
if ( list ) {
|
1071 |
+
if ( !flags.once ) {
|
1072 |
+
if ( stack && stack.length ) {
|
1073 |
+
memory = stack.shift();
|
1074 |
+
self.fireWith( memory[ 0 ], memory[ 1 ] );
|
1075 |
+
}
|
1076 |
+
} else if ( memory === true ) {
|
1077 |
+
self.disable();
|
1078 |
+
} else {
|
1079 |
+
list = [];
|
1080 |
+
}
|
1081 |
+
}
|
1082 |
+
},
|
1083 |
+
// Actual Callbacks object
|
1084 |
+
self = {
|
1085 |
+
// Add a callback or a collection of callbacks to the list
|
1086 |
+
add: function() {
|
1087 |
+
if ( list ) {
|
1088 |
+
var length = list.length;
|
1089 |
+
add( arguments );
|
1090 |
+
// Do we need to add the callbacks to the
|
1091 |
+
// current firing batch?
|
1092 |
+
if ( firing ) {
|
1093 |
+
firingLength = list.length;
|
1094 |
+
// With memory, if we're not firing then
|
1095 |
+
// we should call right away, unless previous
|
1096 |
+
// firing was halted (stopOnFalse)
|
1097 |
+
} else if ( memory && memory !== true ) {
|
1098 |
+
firingStart = length;
|
1099 |
+
fire( memory[ 0 ], memory[ 1 ] );
|
1100 |
+
}
|
1101 |
+
}
|
1102 |
+
return this;
|
1103 |
+
},
|
1104 |
+
// Remove a callback from the list
|
1105 |
+
remove: function() {
|
1106 |
+
if ( list ) {
|
1107 |
+
var args = arguments,
|
1108 |
+
argIndex = 0,
|
1109 |
+
argLength = args.length;
|
1110 |
+
for ( ; argIndex < argLength ; argIndex++ ) {
|
1111 |
+
for ( var i = 0; i < list.length; i++ ) {
|
1112 |
+
if ( args[ argIndex ] === list[ i ] ) {
|
1113 |
+
// Handle firingIndex and firingLength
|
1114 |
+
if ( firing ) {
|
1115 |
+
if ( i <= firingLength ) {
|
1116 |
+
firingLength--;
|
1117 |
+
if ( i <= firingIndex ) {
|
1118 |
+
firingIndex--;
|
1119 |
+
}
|
1120 |
+
}
|
1121 |
+
}
|
1122 |
+
// Remove the element
|
1123 |
+
list.splice( i--, 1 );
|
1124 |
+
// If we have some unicity property then
|
1125 |
+
// we only need to do this once
|
1126 |
+
if ( flags.unique ) {
|
1127 |
+
break;
|
1128 |
+
}
|
1129 |
+
}
|
1130 |
+
}
|
1131 |
+
}
|
1132 |
+
}
|
1133 |
+
return this;
|
1134 |
+
},
|
1135 |
+
// Control if a given callback is in the list
|
1136 |
+
has: function( fn ) {
|
1137 |
+
if ( list ) {
|
1138 |
+
var i = 0,
|
1139 |
+
length = list.length;
|
1140 |
+
for ( ; i < length; i++ ) {
|
1141 |
+
if ( fn === list[ i ] ) {
|
1142 |
+
return true;
|
1143 |
+
}
|
1144 |
+
}
|
1145 |
+
}
|
1146 |
+
return false;
|
1147 |
+
},
|
1148 |
+
// Remove all callbacks from the list
|
1149 |
+
empty: function() {
|
1150 |
+
list = [];
|
1151 |
+
return this;
|
1152 |
+
},
|
1153 |
+
// Have the list do nothing anymore
|
1154 |
+
disable: function() {
|
1155 |
+
list = stack = memory = undefined;
|
1156 |
+
return this;
|
1157 |
+
},
|
1158 |
+
// Is it disabled?
|
1159 |
+
disabled: function() {
|
1160 |
+
return !list;
|
1161 |
+
},
|
1162 |
+
// Lock the list in its current state
|
1163 |
+
lock: function() {
|
1164 |
+
stack = undefined;
|
1165 |
+
if ( !memory || memory === true ) {
|
1166 |
+
self.disable();
|
1167 |
+
}
|
1168 |
+
return this;
|
1169 |
+
},
|
1170 |
+
// Is it locked?
|
1171 |
+
locked: function() {
|
1172 |
+
return !stack;
|
1173 |
+
},
|
1174 |
+
// Call all callbacks with the given context and arguments
|
1175 |
+
fireWith: function( context, args ) {
|
1176 |
+
if ( stack ) {
|
1177 |
+
if ( firing ) {
|
1178 |
+
if ( !flags.once ) {
|
1179 |
+
stack.push( [ context, args ] );
|
1180 |
+
}
|
1181 |
+
} else if ( !( flags.once && memory ) ) {
|
1182 |
+
fire( context, args );
|
1183 |
+
}
|
1184 |
+
}
|
1185 |
+
return this;
|
1186 |
+
},
|
1187 |
+
// Call all the callbacks with the given arguments
|
1188 |
+
fire: function() {
|
1189 |
+
self.fireWith( this, arguments );
|
1190 |
+
return this;
|
1191 |
+
},
|
1192 |
+
// To know if the callbacks have already been called at least once
|
1193 |
+
fired: function() {
|
1194 |
+
return !!memory;
|
1195 |
+
}
|
1196 |
+
};
|
1197 |
+
|
1198 |
+
return self;
|
1199 |
+
};
|
1200 |
+
|
1201 |
+
|
1202 |
+
|
1203 |
+
|
1204 |
+
var // Static reference to slice
|
1205 |
+
sliceDeferred = [].slice;
|
1206 |
+
|
1207 |
+
jQuery.extend({
|
1208 |
+
|
1209 |
+
Deferred: function( func ) {
|
1210 |
+
var doneList = jQuery.Callbacks( "once memory" ),
|
1211 |
+
failList = jQuery.Callbacks( "once memory" ),
|
1212 |
+
progressList = jQuery.Callbacks( "memory" ),
|
1213 |
+
state = "pending",
|
1214 |
+
lists = {
|
1215 |
+
resolve: doneList,
|
1216 |
+
reject: failList,
|
1217 |
+
notify: progressList
|
1218 |
+
},
|
1219 |
+
promise = {
|
1220 |
+
done: doneList.add,
|
1221 |
+
fail: failList.add,
|
1222 |
+
progress: progressList.add,
|
1223 |
+
|
1224 |
+
state: function() {
|
1225 |
+
return state;
|
1226 |
+
},
|
1227 |
+
|
1228 |
+
// Deprecated
|
1229 |
+
isResolved: doneList.fired,
|
1230 |
+
isRejected: failList.fired,
|
1231 |
+
|
1232 |
+
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
|
1233 |
+
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
|
1234 |
+
return this;
|
1235 |
+
},
|
1236 |
+
always: function() {
|
1237 |
+
return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
|
1238 |
+
},
|
1239 |
+
pipe: function( fnDone, fnFail, fnProgress ) {
|
1240 |
+
return jQuery.Deferred(function( newDefer ) {
|
1241 |
+
jQuery.each( {
|
1242 |
+
done: [ fnDone, "resolve" ],
|
1243 |
+
fail: [ fnFail, "reject" ],
|
1244 |
+
progress: [ fnProgress, "notify" ]
|
1245 |
+
}, function( handler, data ) {
|
1246 |
+
var fn = data[ 0 ],
|
1247 |
+
action = data[ 1 ],
|
1248 |
+
returned;
|
1249 |
+
if ( jQuery.isFunction( fn ) ) {
|
1250 |
+
deferred[ handler ](function() {
|
1251 |
+
returned = fn.apply( this, arguments );
|
1252 |
+
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
1253 |
+
returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
|
1254 |
+
} else {
|
1255 |
+
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
|
1256 |
+
}
|
1257 |
+
});
|
1258 |
+
} else {
|
1259 |
+
deferred[ handler ]( newDefer[ action ] );
|
1260 |
+
}
|
1261 |
+
});
|
1262 |
+
}).promise();
|
1263 |
+
},
|
1264 |
+
// Get a promise for this deferred
|
1265 |
+
// If obj is provided, the promise aspect is added to the object
|
1266 |
+
promise: function( obj ) {
|
1267 |
+
if ( obj == null ) {
|
1268 |
+
obj = promise;
|
1269 |
+
} else {
|
1270 |
+
for ( var key in promise ) {
|
1271 |
+
obj[ key ] = promise[ key ];
|
1272 |
+
}
|
1273 |
+
}
|
1274 |
+
return obj;
|
1275 |
+
}
|
1276 |
+
},
|
1277 |
+
deferred = promise.promise({}),
|
1278 |
+
key;
|
1279 |
+
|
1280 |
+
for ( key in lists ) {
|
1281 |
+
deferred[ key ] = lists[ key ].fire;
|
1282 |
+
deferred[ key + "With" ] = lists[ key ].fireWith;
|
1283 |
+
}
|
1284 |
+
|
1285 |
+
// Handle state
|
1286 |
+
deferred.done( function() {
|
1287 |
+
state = "resolved";
|
1288 |
+
}, failList.disable, progressList.lock ).fail( function() {
|
1289 |
+
state = "rejected";
|
1290 |
+
}, doneList.disable, progressList.lock );
|
1291 |
+
|
1292 |
+
// Call given func if any
|
1293 |
+
if ( func ) {
|
1294 |
+
func.call( deferred, deferred );
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
// All done!
|
1298 |
+
return deferred;
|
1299 |
+
},
|
1300 |
+
|
1301 |
+
// Deferred helper
|
1302 |
+
when: function( firstParam ) {
|
1303 |
+
var args = sliceDeferred.call( arguments, 0 ),
|
1304 |
+
i = 0,
|
1305 |
+
length = args.length,
|
1306 |
+
pValues = new Array( length ),
|
1307 |
+
count = length,
|
1308 |
+
pCount = length,
|
1309 |
+
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
|
1310 |
+
firstParam :
|
1311 |
+
jQuery.Deferred(),
|
1312 |
+
promise = deferred.promise();
|
1313 |
+
function resolveFunc( i ) {
|
1314 |
+
return function( value ) {
|
1315 |
+
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
|
1316 |
+
if ( !( --count ) ) {
|
1317 |
+
deferred.resolveWith( deferred, args );
|
1318 |
+
}
|
1319 |
+
};
|
1320 |
+
}
|
1321 |
+
function progressFunc( i ) {
|
1322 |
+
return function( value ) {
|
1323 |
+
pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
|
1324 |
+
deferred.notifyWith( promise, pValues );
|
1325 |
+
};
|
1326 |
+
}
|
1327 |
+
if ( length > 1 ) {
|
1328 |
+
for ( ; i < length; i++ ) {
|
1329 |
+
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
|
1330 |
+
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
|
1331 |
+
} else {
|
1332 |
+
--count;
|
1333 |
+
}
|
1334 |
+
}
|
1335 |
+
if ( !count ) {
|
1336 |
+
deferred.resolveWith( deferred, args );
|
1337 |
+
}
|
1338 |
+
} else if ( deferred !== firstParam ) {
|
1339 |
+
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
|
1340 |
+
}
|
1341 |
+
return promise;
|
1342 |
+
}
|
1343 |
+
});
|
1344 |
+
|
1345 |
+
|
1346 |
+
|
1347 |
+
|
1348 |
+
jQuery.support = (function() {
|
1349 |
+
|
1350 |
+
var div = document.createElement( "div" ),
|
1351 |
+
documentElement = document.documentElement,
|
1352 |
+
all,
|
1353 |
+
a,
|
1354 |
+
select,
|
1355 |
+
opt,
|
1356 |
+
input,
|
1357 |
+
marginDiv,
|
1358 |
+
support,
|
1359 |
+
fragment,
|
1360 |
+
body,
|
1361 |
+
testElementParent,
|
1362 |
+
testElement,
|
1363 |
+
testElementStyle,
|
1364 |
+
tds,
|
1365 |
+
events,
|
1366 |
+
eventName,
|
1367 |
+
i,
|
1368 |
+
isSupported;
|
1369 |
+
|
1370 |
+
// Preliminary tests
|
1371 |
+
div.setAttribute("className", "t");
|
1372 |
+
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>";
|
1373 |
+
|
1374 |
+
|
1375 |
+
all = div.getElementsByTagName( "*" );
|
1376 |
+
a = div.getElementsByTagName( "a" )[ 0 ];
|
1377 |
+
|
1378 |
+
// Can't get basic test support
|
1379 |
+
if ( !all || !all.length || !a ) {
|
1380 |
+
return {};
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
// First batch of supports tests
|
1384 |
+
select = document.createElement( "select" );
|
1385 |
+
opt = select.appendChild( document.createElement("option") );
|
1386 |
+
input = div.getElementsByTagName( "input" )[ 0 ];
|
1387 |
+
|
1388 |
+
support = {
|
1389 |
+
// IE strips leading whitespace when .innerHTML is used
|
1390 |
+
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
|
1391 |
+
|
1392 |
+
// Make sure that tbody elements aren't automatically inserted
|
1393 |
+
// IE will insert them into empty tables
|
1394 |
+
tbody: !div.getElementsByTagName( "tbody" ).length,
|
1395 |
+
|
1396 |
+
// Make sure that link elements get serialized correctly by innerHTML
|
1397 |
+
// This requires a wrapper element in IE
|
1398 |
+
htmlSerialize: !!div.getElementsByTagName( "link" ).length,
|
1399 |
+
|
1400 |
+
// Get the style information from getAttribute
|
1401 |
+
// (IE uses .cssText instead)
|
1402 |
+
style: /top/.test( a.getAttribute("style") ),
|
1403 |
+
|
1404 |
+
// Make sure that URLs aren't manipulated
|
1405 |
+
// (IE normalizes it by default)
|
1406 |
+
hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
|
1407 |
+
|
1408 |
+
// Make sure that element opacity exists
|
1409 |
+
// (IE uses filter instead)
|
1410 |
+
// Use a regex to work around a WebKit issue. See #5145
|
1411 |
+
opacity: /^0.55/.test( a.style.opacity ),
|
1412 |
+
|
1413 |
+
// Verify style float existence
|
1414 |
+
// (IE uses styleFloat instead of cssFloat)
|
1415 |
+
cssFloat: !!a.style.cssFloat,
|
1416 |
+
|
1417 |
+
// Make sure unknown elements (like HTML5 elems) are handled appropriately
|
1418 |
+
unknownElems: !!div.getElementsByTagName( "nav" ).length,
|
1419 |
+
|
1420 |
+
// Make sure that if no value is specified for a checkbox
|
1421 |
+
// that it defaults to "on".
|
1422 |
+
// (WebKit defaults to "" instead)
|
1423 |
+
checkOn: ( input.value === "on" ),
|
1424 |
+
|
1425 |
+
// Make sure that a selected-by-default option has a working selected property.
|
1426 |
+
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
1427 |
+
optSelected: opt.selected,
|
1428 |
+
|
1429 |
+
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
1430 |
+
getSetAttribute: div.className !== "t",
|
1431 |
+
|
1432 |
+
// Tests for enctype support on a form(#6743)
|
1433 |
+
enctype: !!document.createElement("form").enctype,
|
1434 |
+
|
1435 |
+
// Will be defined later
|
1436 |
+
submitBubbles: true,
|
1437 |
+
changeBubbles: true,
|
1438 |
+
focusinBubbles: false,
|
1439 |
+
deleteExpando: true,
|
1440 |
+
noCloneEvent: true,
|
1441 |
+
inlineBlockNeedsLayout: false,
|
1442 |
+
shrinkWrapBlocks: false,
|
1443 |
+
reliableMarginRight: true
|
1444 |
+
};
|
1445 |
+
|
1446 |
+
// Make sure checked status is properly cloned
|
1447 |
+
input.checked = true;
|
1448 |
+
support.noCloneChecked = input.cloneNode( true ).checked;
|
1449 |
+
|
1450 |
+
// Make sure that the options inside disabled selects aren't marked as disabled
|
1451 |
+
// (WebKit marks them as disabled)
|
1452 |
+
select.disabled = true;
|
1453 |
+
support.optDisabled = !opt.disabled;
|
1454 |
+
|
1455 |
+
// Test to see if it's possible to delete an expando from an element
|
1456 |
+
// Fails in Internet Explorer
|
1457 |
+
try {
|
1458 |
+
delete div.test;
|
1459 |
+
} catch( e ) {
|
1460 |
+
support.deleteExpando = false;
|
1461 |
+
}
|
1462 |
+
|
1463 |
+
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
|
1464 |
+
div.attachEvent( "onclick", function() {
|
1465 |
+
// Cloning a node shouldn't copy over any
|
1466 |
+
// bound event handlers (IE does this)
|
1467 |
+
support.noCloneEvent = false;
|
1468 |
+
});
|
1469 |
+
div.cloneNode( true ).fireEvent( "onclick" );
|
1470 |
+
}
|
1471 |
+
|
1472 |
+
// Check if a radio maintains its value
|
1473 |
+
// after being appended to the DOM
|
1474 |
+
input = document.createElement("input");
|
1475 |
+
input.value = "t";
|
1476 |
+
input.setAttribute("type", "radio");
|
1477 |
+
support.radioValue = input.value === "t";
|
1478 |
+
|
1479 |
+
input.setAttribute("checked", "checked");
|
1480 |
+
div.appendChild( input );
|
1481 |
+
fragment = document.createDocumentFragment();
|
1482 |
+
fragment.appendChild( div.lastChild );
|
1483 |
+
|
1484 |
+
// WebKit doesn't clone checked state correctly in fragments
|
1485 |
+
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
1486 |
+
|
1487 |
+
div.innerHTML = "";
|
1488 |
+
|
1489 |
+
// Figure out if the W3C box model works as expected
|
1490 |
+
div.style.width = div.style.paddingLeft = "1px";
|
1491 |
+
|
1492 |
+
// We don't want to do body-related feature tests on frameset
|
1493 |
+
// documents, which lack a body. So we use
|
1494 |
+
// document.getElementsByTagName("body")[0], which is undefined in
|
1495 |
+
// frameset documents, while document.body isn’t. (7398)
|
1496 |
+
body = document.getElementsByTagName("body")[ 0 ];
|
1497 |
+
// We use our own, invisible, body unless the body is already present
|
1498 |
+
// in which case we use a div (#9239)
|
1499 |
+
testElement = document.createElement( body ? "div" : "body" );
|
1500 |
+
testElementStyle = {
|
1501 |
+
visibility: "hidden",
|
1502 |
+
width: 0,
|
1503 |
+
height: 0,
|
1504 |
+
border: 0,
|
1505 |
+
margin: 0,
|
1506 |
+
background: "none"
|
1507 |
+
};
|
1508 |
+
if ( body ) {
|
1509 |
+
jQuery.extend( testElementStyle, {
|
1510 |
+
position: "absolute",
|
1511 |
+
left: "-999px",
|
1512 |
+
top: "-999px"
|
1513 |
+
});
|
1514 |
+
}
|
1515 |
+
for ( i in testElementStyle ) {
|
1516 |
+
testElement.style[ i ] = testElementStyle[ i ];
|
1517 |
+
}
|
1518 |
+
testElement.appendChild( div );
|
1519 |
+
testElementParent = body || documentElement;
|
1520 |
+
testElementParent.insertBefore( testElement, testElementParent.firstChild );
|
1521 |
+
|
1522 |
+
// Check if a disconnected checkbox will retain its checked
|
1523 |
+
// value of true after appended to the DOM (IE6/7)
|
1524 |
+
support.appendChecked = input.checked;
|
1525 |
+
|
1526 |
+
support.boxModel = div.offsetWidth === 2;
|
1527 |
+
|
1528 |
+
if ( "zoom" in div.style ) {
|
1529 |
+
// Check if natively block-level elements act like inline-block
|
1530 |
+
// elements when setting their display to 'inline' and giving
|
1531 |
+
// them layout
|
1532 |
+
// (IE < 8 does this)
|
1533 |
+
div.style.display = "inline";
|
1534 |
+
div.style.zoom = 1;
|
1535 |
+
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
|
1536 |
+
|
1537 |
+
// Check if elements with layout shrink-wrap their children
|
1538 |
+
// (IE 6 does this)
|
1539 |
+
div.style.display = "";
|
1540 |
+
div.innerHTML = "<div style='width:4px;'></div>";
|
1541 |
+
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
|
1542 |
+
}
|
1543 |
+
|
1544 |
+
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
|
1545 |
+
tds = div.getElementsByTagName( "td" );
|
1546 |
+
|
1547 |
+
// Check if table cells still have offsetWidth/Height when they are set
|
1548 |
+
// to display:none and there are still other visible table cells in a
|
1549 |
+
// table row; if so, offsetWidth/Height are not reliable for use when
|
1550 |
+
// determining if an element has been hidden directly using
|
1551 |
+
// display:none (it is still safe to use offsets if a parent element is
|
1552 |
+
// hidden; don safety goggles and see bug #4512 for more information).
|
1553 |
+
// (only IE 8 fails this test)
|
1554 |
+
isSupported = ( tds[ 0 ].offsetHeight === 0 );
|
1555 |
+
|
1556 |
+
tds[ 0 ].style.display = "";
|
1557 |
+
tds[ 1 ].style.display = "none";
|
1558 |
+
|
1559 |
+
// Check if empty table cells still have offsetWidth/Height
|
1560 |
+
// (IE < 8 fail this test)
|
1561 |
+
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
|
1562 |
+
div.innerHTML = "";
|
1563 |
+
|
1564 |
+
// Check if div with explicit width and no margin-right incorrectly
|
1565 |
+
// gets computed margin-right based on width of container. For more
|
1566 |
+
// info see bug #3333
|
1567 |
+
// Fails in WebKit before Feb 2011 nightlies
|
1568 |
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
1569 |
+
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
1570 |
+
marginDiv = document.createElement( "div" );
|
1571 |
+
marginDiv.style.width = "0";
|
1572 |
+
marginDiv.style.marginRight = "0";
|
1573 |
+
div.appendChild( marginDiv );
|
1574 |
+
support.reliableMarginRight =
|
1575 |
+
( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
// Technique from Juriy Zaytsev
|
1579 |
+
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
|
1580 |
+
// We only care about the case where non-standard event systems
|
1581 |
+
// are used, namely in IE. Short-circuiting here helps us to
|
1582 |
+
// avoid an eval call (in setAttribute) which can cause CSP
|
1583 |
+
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
|
1584 |
+
if ( div.attachEvent ) {
|
1585 |
+
for( i in {
|
1586 |
+
submit: 1,
|
1587 |
+
change: 1,
|
1588 |
+
focusin: 1
|
1589 |
+
} ) {
|
1590 |
+
eventName = "on" + i;
|
1591 |
+
isSupported = ( eventName in div );
|
1592 |
+
if ( !isSupported ) {
|
1593 |
+
div.setAttribute( eventName, "return;" );
|
1594 |
+
isSupported = ( typeof div[ eventName ] === "function" );
|
1595 |
+
}
|
1596 |
+
support[ i + "Bubbles" ] = isSupported;
|
1597 |
+
}
|
1598 |
+
}
|
1599 |
+
|
1600 |
+
// Run fixed position tests at doc ready to avoid a crash
|
1601 |
+
// related to the invisible body in IE8
|
1602 |
+
jQuery(function() {
|
1603 |
+
var container, outer, inner, table, td, offsetSupport,
|
1604 |
+
conMarginTop = 1,
|
1605 |
+
ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
|
1606 |
+
vb = "visibility:hidden;border:0;",
|
1607 |
+
style = "style='" + ptlm + "border:5px solid #000;padding:0;'",
|
1608 |
+
html = "<div " + style + "><div></div></div>" +
|
1609 |
+
"<table " + style + " cellpadding='0' cellspacing='0'>" +
|
1610 |
+
"<tr><td></td></tr></table>";
|
1611 |
+
|
1612 |
+
// Reconstruct a container
|
1613 |
+
body = document.getElementsByTagName("body")[0];
|
1614 |
+
if ( !body ) {
|
1615 |
+
// Return for frameset docs that don't have a body
|
1616 |
+
// These tests cannot be done
|
1617 |
+
return;
|
1618 |
+
}
|
1619 |
+
|
1620 |
+
container = document.createElement("div");
|
1621 |
+
container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
|
1622 |
+
body.insertBefore( container, body.firstChild );
|
1623 |
+
|
1624 |
+
// Construct a test element
|
1625 |
+
testElement = document.createElement("div");
|
1626 |
+
testElement.style.cssText = ptlm + vb;
|
1627 |
+
|
1628 |
+
testElement.innerHTML = html;
|
1629 |
+
container.appendChild( testElement );
|
1630 |
+
outer = testElement.firstChild;
|
1631 |
+
inner = outer.firstChild;
|
1632 |
+
td = outer.nextSibling.firstChild.firstChild;
|
1633 |
+
|
1634 |
+
offsetSupport = {
|
1635 |
+
doesNotAddBorder: ( inner.offsetTop !== 5 ),
|
1636 |
+
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
|
1637 |
+
};
|
1638 |
+
|
1639 |
+
inner.style.position = "fixed";
|
1640 |
+
inner.style.top = "20px";
|
1641 |
+
|
1642 |
+
// safari subtracts parent border width here which is 5px
|
1643 |
+
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
|
1644 |
+
inner.style.position = inner.style.top = "";
|
1645 |
+
|
1646 |
+
outer.style.overflow = "hidden";
|
1647 |
+
outer.style.position = "relative";
|
1648 |
+
|
1649 |
+
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
|
1650 |
+
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
|
1651 |
+
|
1652 |
+
body.removeChild( container );
|
1653 |
+
testElement = container = null;
|
1654 |
+
|
1655 |
+
jQuery.extend( support, offsetSupport );
|
1656 |
+
});
|
1657 |
+
|
1658 |
+
testElement.innerHTML = "";
|
1659 |
+
testElementParent.removeChild( testElement );
|
1660 |
+
|
1661 |
+
// Null connected elements to avoid leaks in IE
|
1662 |
+
testElement = fragment = select = opt = body = marginDiv = div = input = null;
|
1663 |
+
|
1664 |
+
return support;
|
1665 |
+
})();
|
1666 |
+
|
1667 |
+
// Keep track of boxModel
|
1668 |
+
jQuery.boxModel = jQuery.support.boxModel;
|
1669 |
+
|
1670 |
+
|
1671 |
+
|
1672 |
+
|
1673 |
+
var rbrace = /^(?:\{.*\}|\[.*\])$/,
|
1674 |
+
rmultiDash = /([A-Z])/g;
|
1675 |
+
|
1676 |
+
jQuery.extend({
|
1677 |
+
cache: {},
|
1678 |
+
|
1679 |
+
// Please use with caution
|
1680 |
+
uuid: 0,
|
1681 |
+
|
1682 |
+
// Unique for each copy of jQuery on the page
|
1683 |
+
// Non-digits removed to match rinlinejQuery
|
1684 |
+
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
|
1685 |
+
|
1686 |
+
// The following elements throw uncatchable exceptions if you
|
1687 |
+
// attempt to add expando properties to them.
|
1688 |
+
noData: {
|
1689 |
+
"embed": true,
|
1690 |
+
// Ban all objects except for Flash (which handle expandos)
|
1691 |
+
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
|
1692 |
+
"applet": true
|
1693 |
+
},
|
1694 |
+
|
1695 |
+
hasData: function( elem ) {
|
1696 |
+
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
|
1697 |
+
return !!elem && !isEmptyDataObject( elem );
|
1698 |
+
},
|
1699 |
+
|
1700 |
+
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
|
1701 |
+
if ( !jQuery.acceptData( elem ) ) {
|
1702 |
+
return;
|
1703 |
+
}
|
1704 |
+
|
1705 |
+
var privateCache, thisCache, ret,
|
1706 |
+
internalKey = jQuery.expando,
|
1707 |
+
getByName = typeof name === "string",
|
1708 |
+
|
1709 |
+
// We have to handle DOM nodes and JS objects differently because IE6-7
|
1710 |
+
// can't GC object references properly across the DOM-JS boundary
|
1711 |
+
isNode = elem.nodeType,
|
1712 |
+
|
1713 |
+
// Only DOM nodes need the global jQuery cache; JS object data is
|
1714 |
+
// attached directly to the object so GC can occur automatically
|
1715 |
+
cache = isNode ? jQuery.cache : elem,
|
1716 |
+
|
1717 |
+
// Only defining an ID for JS objects if its cache already exists allows
|
1718 |
+
// the code to shortcut on the same path as a DOM node with no cache
|
1719 |
+
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando,
|
1720 |
+
isEvents = name === "events";
|
1721 |
+
|
1722 |
+
// Avoid doing any more work than we need to when trying to get data on an
|
1723 |
+
// object that has no data at all
|
1724 |
+
if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
|
1725 |
+
return;
|
1726 |
+
}
|
1727 |
+
|
1728 |
+
if ( !id ) {
|
1729 |
+
// Only DOM nodes need a new unique ID for each element since their data
|
1730 |
+
// ends up in the global cache
|
1731 |
+
if ( isNode ) {
|
1732 |
+
elem[ jQuery.expando ] = id = ++jQuery.uuid;
|
1733 |
+
} else {
|
1734 |
+
id = jQuery.expando;
|
1735 |
+
}
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
if ( !cache[ id ] ) {
|
1739 |
+
cache[ id ] = {};
|
1740 |
+
|
1741 |
+
// Avoids exposing jQuery metadata on plain JS objects when the object
|
1742 |
+
// is serialized using JSON.stringify
|
1743 |
+
if ( !isNode ) {
|
1744 |
+
cache[ id ].toJSON = jQuery.noop;
|
1745 |
+
}
|
1746 |
+
}
|
1747 |
+
|
1748 |
+
// An object can be passed to jQuery.data instead of a key/value pair; this gets
|
1749 |
+
// shallow copied over onto the existing cache
|
1750 |
+
if ( typeof name === "object" || typeof name === "function" ) {
|
1751 |
+
if ( pvt ) {
|
1752 |
+
cache[ id ] = jQuery.extend( cache[ id ], name );
|
1753 |
+
} else {
|
1754 |
+
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
|
1755 |
+
}
|
1756 |
+
}
|
1757 |
+
|
1758 |
+
privateCache = thisCache = cache[ id ];
|
1759 |
+
|
1760 |
+
// jQuery data() is stored in a separate object inside the object's internal data
|
1761 |
+
// cache in order to avoid key collisions between internal data and user-defined
|
1762 |
+
// data.
|
1763 |
+
if ( !pvt ) {
|
1764 |
+
if ( !thisCache.data ) {
|
1765 |
+
thisCache.data = {};
|
1766 |
+
}
|
1767 |
+
|
1768 |
+
thisCache = thisCache.data;
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
if ( data !== undefined ) {
|
1772 |
+
thisCache[ jQuery.camelCase( name ) ] = data;
|
1773 |
+
}
|
1774 |
+
|
1775 |
+
// Users should not attempt to inspect the internal events object using jQuery.data,
|
1776 |
+
// it is undocumented and subject to change. But does anyone listen? No.
|
1777 |
+
if ( isEvents && !thisCache[ name ] ) {
|
1778 |
+
return privateCache.events;
|
1779 |
+
}
|
1780 |
+
|
1781 |
+
// Check for both converted-to-camel and non-converted data property names
|
1782 |
+
// If a data property was specified
|
1783 |
+
if ( getByName ) {
|
1784 |
+
|
1785 |
+
// First Try to find as-is property data
|
1786 |
+
ret = thisCache[ name ];
|
1787 |
+
|
1788 |
+
// Test for null|undefined property data
|
1789 |
+
if ( ret == null ) {
|
1790 |
+
|
1791 |
+
// Try to find the camelCased property
|
1792 |
+
ret = thisCache[ jQuery.camelCase( name ) ];
|
1793 |
+
}
|
1794 |
+
} else {
|
1795 |
+
ret = thisCache;
|
1796 |
+
}
|
1797 |
+
|
1798 |
+
return ret;
|
1799 |
+
},
|
1800 |
+
|
1801 |
+
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
|
1802 |
+
if ( !jQuery.acceptData( elem ) ) {
|
1803 |
+
return;
|
1804 |
+
}
|
1805 |
+
|
1806 |
+
var thisCache, i, l,
|
1807 |
+
|
1808 |
+
// Reference to internal data cache key
|
1809 |
+
internalKey = jQuery.expando,
|
1810 |
+
|
1811 |
+
isNode = elem.nodeType,
|
1812 |
+
|
1813 |
+
// See jQuery.data for more information
|
1814 |
+
cache = isNode ? jQuery.cache : elem,
|
1815 |
+
|
1816 |
+
// See jQuery.data for more information
|
1817 |
+
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
|
1818 |
+
|
1819 |
+
// If there is already no cache entry for this object, there is no
|
1820 |
+
// purpose in continuing
|
1821 |
+
if ( !cache[ id ] ) {
|
1822 |
+
return;
|
1823 |
+
}
|
1824 |
+
|
1825 |
+
if ( name ) {
|
1826 |
+
|
1827 |
+
thisCache = pvt ? cache[ id ] : cache[ id ].data;
|
1828 |
+
|
1829 |
+
if ( thisCache ) {
|
1830 |
+
|
1831 |
+
// Support space separated names
|
1832 |
+
if ( jQuery.isArray( name ) ) {
|
1833 |
+
name = name;
|
1834 |
+
} else if ( name in thisCache ) {
|
1835 |
+
name = [ name ];
|
1836 |
+
} else {
|
1837 |
+
|
1838 |
+
// split the camel cased version by spaces
|
1839 |
+
name = jQuery.camelCase( name );
|
1840 |
+
if ( name in thisCache ) {
|
1841 |
+
name = [ name ];
|
1842 |
+
} else {
|
1843 |
+
name = name.split( " " );
|
1844 |
+
}
|
1845 |
+
}
|
1846 |
+
|
1847 |
+
for ( i = 0, l = name.length; i < l; i++ ) {
|
1848 |
+
delete thisCache[ name[i] ];
|
1849 |
+
}
|
1850 |
+
|
1851 |
+
// If there is no data left in the cache, we want to continue
|
1852 |
+
// and let the cache object itself get destroyed
|
1853 |
+
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
|
1854 |
+
return;
|
1855 |
+
}
|
1856 |
+
}
|
1857 |
+
}
|
1858 |
+
|
1859 |
+
// See jQuery.data for more information
|
1860 |
+
if ( !pvt ) {
|
1861 |
+
delete cache[ id ].data;
|
1862 |
+
|
1863 |
+
// Don't destroy the parent cache unless the internal data object
|
1864 |
+
// had been the only thing left in it
|
1865 |
+
if ( !isEmptyDataObject(cache[ id ]) ) {
|
1866 |
+
return;
|
1867 |
+
}
|
1868 |
+
}
|
1869 |
+
|
1870 |
+
// Browsers that fail expando deletion also refuse to delete expandos on
|
1871 |
+
// the window, but it will allow it on all other JS objects; other browsers
|
1872 |
+
// don't care
|
1873 |
+
// Ensure that `cache` is not a window object #10080
|
1874 |
+
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
|
1875 |
+
delete cache[ id ];
|
1876 |
+
} else {
|
1877 |
+
cache[ id ] = null;
|
1878 |
+
}
|
1879 |
+
|
1880 |
+
// We destroyed the cache and need to eliminate the expando on the node to avoid
|
1881 |
+
// false lookups in the cache for entries that no longer exist
|
1882 |
+
if ( isNode ) {
|
1883 |
+
// IE does not allow us to delete expando properties from nodes,
|
1884 |
+
// nor does it have a removeAttribute function on Document nodes;
|
1885 |
+
// we must handle all of these cases
|
1886 |
+
if ( jQuery.support.deleteExpando ) {
|
1887 |
+
delete elem[ jQuery.expando ];
|
1888 |
+
} else if ( elem.removeAttribute ) {
|
1889 |
+
elem.removeAttribute( jQuery.expando );
|
1890 |
+
} else {
|
1891 |
+
elem[ jQuery.expando ] = null;
|
1892 |
+
}
|
1893 |
+
}
|
1894 |
+
},
|
1895 |
+
|
1896 |
+
// For internal use only.
|
1897 |
+
_data: function( elem, name, data ) {
|
1898 |
+
return jQuery.data( elem, name, data, true );
|
1899 |
+
},
|
1900 |
+
|
1901 |
+
// A method for determining if a DOM node can handle the data expando
|
1902 |
+
acceptData: function( elem ) {
|
1903 |
+
if ( elem.nodeName ) {
|
1904 |
+
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
|
1905 |
+
|
1906 |
+
if ( match ) {
|
1907 |
+
return !(match === true || elem.getAttribute("classid") !== match);
|
1908 |
+
}
|
1909 |
+
}
|
1910 |
+
|
1911 |
+
return true;
|
1912 |
+
}
|
1913 |
+
});
|
1914 |
+
|
1915 |
+
jQuery.fn.extend({
|
1916 |
+
data: function( key, value ) {
|
1917 |
+
var parts, attr, name,
|
1918 |
+
data = null;
|
1919 |
+
|
1920 |
+
if ( typeof key === "undefined" ) {
|
1921 |
+
if ( this.length ) {
|
1922 |
+
data = jQuery.data( this[0] );
|
1923 |
+
|
1924 |
+
if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
|
1925 |
+
attr = this[0].attributes;
|
1926 |
+
for ( var i = 0, l = attr.length; i < l; i++ ) {
|
1927 |
+
name = attr[i].name;
|
1928 |
+
|
1929 |
+
if ( name.indexOf( "data-" ) === 0 ) {
|
1930 |
+
name = jQuery.camelCase( name.substring(5) );
|
1931 |
+
|
1932 |
+
dataAttr( this[0], name, data[ name ] );
|
1933 |
+
}
|
1934 |
+
}
|
1935 |
+
jQuery._data( this[0], "parsedAttrs", true );
|
1936 |
+
}
|
1937 |
+
}
|
1938 |
+
|
1939 |
+
return data;
|
1940 |
+
|
1941 |
+
} else if ( typeof key === "object" ) {
|
1942 |
+
return this.each(function() {
|
1943 |
+
jQuery.data( this, key );
|
1944 |
+
});
|
1945 |
+
}
|
1946 |
+
|
1947 |
+
parts = key.split(".");
|
1948 |
+
parts[1] = parts[1] ? "." + parts[1] : "";
|
1949 |
+
|
1950 |
+
if ( value === undefined ) {
|
1951 |
+
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
1952 |
+
|
1953 |
+
// Try to fetch any internally stored data first
|
1954 |
+
if ( data === undefined && this.length ) {
|
1955 |
+
data = jQuery.data( this[0], key );
|
1956 |
+
data = dataAttr( this[0], key, data );
|
1957 |
+
}
|
1958 |
+
|
1959 |
+
return data === undefined && parts[1] ?
|
1960 |
+
this.data( parts[0] ) :
|
1961 |
+
data;
|
1962 |
+
|
1963 |
+
} else {
|
1964 |
+
return this.each(function() {
|
1965 |
+
var $this = jQuery( this ),
|
1966 |
+
args = [ parts[0], value ];
|
1967 |
+
|
1968 |
+
$this.triggerHandler( "setData" + parts[1] + "!", args );
|
1969 |
+
jQuery.data( this, key, value );
|
1970 |
+
$this.triggerHandler( "changeData" + parts[1] + "!", args );
|
1971 |
+
});
|
1972 |
+
}
|
1973 |
+
},
|
1974 |
+
|
1975 |
+
removeData: function( key ) {
|
1976 |
+
return this.each(function() {
|
1977 |
+
jQuery.removeData( this, key );
|
1978 |
+
});
|
1979 |
+
}
|
1980 |
+
});
|
1981 |
+
|
1982 |
+
function dataAttr( elem, key, data ) {
|
1983 |
+
// If nothing was found internally, try to fetch any
|
1984 |
+
// data from the HTML5 data-* attribute
|
1985 |
+
if ( data === undefined && elem.nodeType === 1 ) {
|
1986 |
+
|
1987 |
+
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
|
1988 |
+
|
1989 |
+
data = elem.getAttribute( name );
|
1990 |
+
|
1991 |
+
if ( typeof data === "string" ) {
|
1992 |
+
try {
|
1993 |
+
data = data === "true" ? true :
|
1994 |
+
data === "false" ? false :
|
1995 |
+
data === "null" ? null :
|
1996 |
+
jQuery.isNumeric( data ) ? parseFloat( data ) :
|
1997 |
+
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
1998 |
+
data;
|
1999 |
+
} catch( e ) {}
|
2000 |
+
|
2001 |
+
// Make sure we set the data so it isn't changed later
|
2002 |
+
jQuery.data( elem, key, data );
|
2003 |
+
|
2004 |
+
} else {
|
2005 |
+
data = undefined;
|
2006 |
+
}
|
2007 |
+
}
|
2008 |
+
|
2009 |
+
return data;
|
2010 |
+
}
|
2011 |
+
|
2012 |
+
// checks a cache object for emptiness
|
2013 |
+
function isEmptyDataObject( obj ) {
|
2014 |
+
for ( var name in obj ) {
|
2015 |
+
|
2016 |
+
// if the public data object is empty, the private is still empty
|
2017 |
+
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
|
2018 |
+
continue;
|
2019 |
+
}
|
2020 |
+
if ( name !== "toJSON" ) {
|
2021 |
+
return false;
|
2022 |
+
}
|
2023 |
+
}
|
2024 |
+
|
2025 |
+
return true;
|
2026 |
+
}
|
2027 |
+
|
2028 |
+
|
2029 |
+
|
2030 |
+
|
2031 |
+
function handleQueueMarkDefer( elem, type, src ) {
|
2032 |
+
var deferDataKey = type + "defer",
|
2033 |
+
queueDataKey = type + "queue",
|
2034 |
+
markDataKey = type + "mark",
|
2035 |
+
defer = jQuery._data( elem, deferDataKey );
|
2036 |
+
if ( defer &&
|
2037 |
+
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
|
2038 |
+
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
|
2039 |
+
// Give room for hard-coded callbacks to fire first
|
2040 |
+
// and eventually mark/queue something else on the element
|
2041 |
+
setTimeout( function() {
|
2042 |
+
if ( !jQuery._data( elem, queueDataKey ) &&
|
2043 |
+
!jQuery._data( elem, markDataKey ) ) {
|
2044 |
+
jQuery.removeData( elem, deferDataKey, true );
|
2045 |
+
defer.fire();
|
2046 |
+
}
|
2047 |
+
}, 0 );
|
2048 |
+
}
|
2049 |
+
}
|
2050 |
+
|
2051 |
+
jQuery.extend({
|
2052 |
+
|
2053 |
+
_mark: function( elem, type ) {
|
2054 |
+
if ( elem ) {
|
2055 |
+
type = ( type || "fx" ) + "mark";
|
2056 |
+
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
|
2057 |
+
}
|
2058 |
+
},
|
2059 |
+
|
2060 |
+
_unmark: function( force, elem, type ) {
|
2061 |
+
if ( force !== true ) {
|
2062 |
+
type = elem;
|
2063 |
+
elem = force;
|
2064 |
+
force = false;
|
2065 |
+
}
|
2066 |
+
if ( elem ) {
|
2067 |
+
type = type || "fx";
|
2068 |
+
var key = type + "mark",
|
2069 |
+
count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
|
2070 |
+
if ( count ) {
|
2071 |
+
jQuery._data( elem, key, count );
|
2072 |
+
} else {
|
2073 |
+
jQuery.removeData( elem, key, true );
|
2074 |
+
handleQueueMarkDefer( elem, type, "mark" );
|
2075 |
+
}
|
2076 |
+
}
|
2077 |
+
},
|
2078 |
+
|
2079 |
+
queue: function( elem, type, data ) {
|
2080 |
+
var q;
|
2081 |
+
if ( elem ) {
|
2082 |
+
type = ( type || "fx" ) + "queue";
|
2083 |
+
q = jQuery._data( elem, type );
|
2084 |
+
|
2085 |
+
// Speed up dequeue by getting out quickly if this is just a lookup
|
2086 |
+
if ( data ) {
|
2087 |
+
if ( !q || jQuery.isArray(data) ) {
|
2088 |
+
q = jQuery._data( elem, type, jQuery.makeArray(data) );
|
2089 |
+
} else {
|
2090 |
+
q.push( data );
|
2091 |
+
}
|
2092 |
+
}
|
2093 |
+
return q || [];
|
2094 |
+
}
|
2095 |
+
},
|
2096 |
+
|
2097 |
+
dequeue: function( elem, type ) {
|
2098 |
+
type = type || "fx";
|
2099 |
+
|
2100 |
+
var queue = jQuery.queue( elem, type ),
|
2101 |
+
fn = queue.shift(),
|
2102 |
+
hooks = {};
|
2103 |
+
|
2104 |
+
// If the fx queue is dequeued, always remove the progress sentinel
|
2105 |
+
if ( fn === "inprogress" ) {
|
2106 |
+
fn = queue.shift();
|
2107 |
+
}
|
2108 |
+
|
2109 |
+
if ( fn ) {
|
2110 |
+
// Add a progress sentinel to prevent the fx queue from being
|
2111 |
+
// automatically dequeued
|
2112 |
+
if ( type === "fx" ) {
|
2113 |
+
queue.unshift( "inprogress" );
|
2114 |
+
}
|
2115 |
+
|
2116 |
+
jQuery._data( elem, type + ".run", hooks );
|
2117 |
+
fn.call( elem, function() {
|
2118 |
+
jQuery.dequeue( elem, type );
|
2119 |
+
}, hooks );
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
if ( !queue.length ) {
|
2123 |
+
jQuery.removeData( elem, type + "queue " + type + ".run", true );
|
2124 |
+
handleQueueMarkDefer( elem, type, "queue" );
|
2125 |
+
}
|
2126 |
+
}
|
2127 |
+
});
|
2128 |
+
|
2129 |
+
jQuery.fn.extend({
|
2130 |
+
queue: function( type, data ) {
|
2131 |
+
if ( typeof type !== "string" ) {
|
2132 |
+
data = type;
|
2133 |
+
type = "fx";
|
2134 |
+
}
|
2135 |
+
|
2136 |
+
if ( data === undefined ) {
|
2137 |
+
return jQuery.queue( this[0], type );
|
2138 |
+
}
|
2139 |
+
return this.each(function() {
|
2140 |
+
var queue = jQuery.queue( this, type, data );
|
2141 |
+
|
2142 |
+
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
2143 |
+
jQuery.dequeue( this, type );
|
2144 |
+
}
|
2145 |
+
});
|
2146 |
+
},
|
2147 |
+
dequeue: function( type ) {
|
2148 |
+
return this.each(function() {
|
2149 |
+
jQuery.dequeue( this, type );
|
2150 |
+
});
|
2151 |
+
},
|
2152 |
+
// Based off of the plugin by Clint Helfers, with permission.
|
2153 |
+
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
2154 |
+
delay: function( time, type ) {
|
2155 |
+
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
2156 |
+
type = type || "fx";
|
2157 |
+
|
2158 |
+
return this.queue( type, function( next, hooks ) {
|
2159 |
+
var timeout = setTimeout( next, time );
|
2160 |
+
hooks.stop = function() {
|
2161 |
+
clearTimeout( timeout );
|
2162 |
+
};
|
2163 |
+
});
|
2164 |
+
},
|
2165 |
+
clearQueue: function( type ) {
|
2166 |
+
return this.queue( type || "fx", [] );
|
2167 |
+
},
|
2168 |
+
// Get a promise resolved when queues of a certain type
|
2169 |
+
// are emptied (fx is the type by default)
|
2170 |
+
promise: function( type, object ) {
|
2171 |
+
if ( typeof type !== "string" ) {
|
2172 |
+
object = type;
|
2173 |
+
type = undefined;
|
2174 |
+
}
|
2175 |
+
type = type || "fx";
|
2176 |
+
var defer = jQuery.Deferred(),
|
2177 |
+
elements = this,
|
2178 |
+
i = elements.length,
|
2179 |
+
count = 1,
|
2180 |
+
deferDataKey = type + "defer",
|
2181 |
+
queueDataKey = type + "queue",
|
2182 |
+
markDataKey = type + "mark",
|
2183 |
+
tmp;
|
2184 |
+
function resolve() {
|
2185 |
+
if ( !( --count ) ) {
|
2186 |
+
defer.resolveWith( elements, [ elements ] );
|
2187 |
+
}
|
2188 |
+
}
|
2189 |
+
while( i-- ) {
|
2190 |
+
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
|
2191 |
+
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
|
2192 |
+
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
|
2193 |
+
jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
|
2194 |
+
count++;
|
2195 |
+
tmp.add( resolve );
|
2196 |
+
}
|
2197 |
+
}
|
2198 |
+
resolve();
|
2199 |
+
return defer.promise();
|
2200 |
+
}
|
2201 |
+
});
|
2202 |
+
|
2203 |
+
|
2204 |
+
|
2205 |
+
|
2206 |
+
var rclass = /[\n\t\r]/g,
|
2207 |
+
rspace = /\s+/,
|
2208 |
+
rreturn = /\r/g,
|
2209 |
+
rtype = /^(?:button|input)$/i,
|
2210 |
+
rfocusable = /^(?:button|input|object|select|textarea)$/i,
|
2211 |
+
rclickable = /^a(?:rea)?$/i,
|
2212 |
+
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
2213 |
+
getSetAttribute = jQuery.support.getSetAttribute,
|
2214 |
+
nodeHook, boolHook, fixSpecified;
|
2215 |
+
|
2216 |
+
jQuery.fn.extend({
|
2217 |
+
attr: function( name, value ) {
|
2218 |
+
return jQuery.access( this, name, value, true, jQuery.attr );
|
2219 |
+
},
|
2220 |
+
|
2221 |
+
removeAttr: function( name ) {
|
2222 |
+
return this.each(function() {
|
2223 |
+
jQuery.removeAttr( this, name );
|
2224 |
+
});
|
2225 |
+
},
|
2226 |
+
|
2227 |
+
prop: function( name, value ) {
|
2228 |
+
return jQuery.access( this, name, value, true, jQuery.prop );
|
2229 |
+
},
|
2230 |
+
|
2231 |
+
removeProp: function( name ) {
|
2232 |
+
name = jQuery.propFix[ name ] || name;
|
2233 |
+
return this.each(function() {
|
2234 |
+
// try/catch handles cases where IE balks (such as removing a property on window)
|
2235 |
+
try {
|
2236 |
+
this[ name ] = undefined;
|
2237 |
+
delete this[ name ];
|
2238 |
+
} catch( e ) {}
|
2239 |
+
});
|
2240 |
+
},
|
2241 |
+
|
2242 |
+
addClass: function( value ) {
|
2243 |
+
var classNames, i, l, elem,
|
2244 |
+
setClass, c, cl;
|
2245 |
+
|
2246 |
+
if ( jQuery.isFunction( value ) ) {
|
2247 |
+
return this.each(function( j ) {
|
2248 |
+
jQuery( this ).addClass( value.call(this, j, this.className) );
|
2249 |
+
});
|
2250 |
+
}
|
2251 |
+
|
2252 |
+
if ( value && typeof value === "string" ) {
|
2253 |
+
classNames = value.split( rspace );
|
2254 |
+
|
2255 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
2256 |
+
elem = this[ i ];
|
2257 |
+
|
2258 |
+
if ( elem.nodeType === 1 ) {
|
2259 |
+
if ( !elem.className && classNames.length === 1 ) {
|
2260 |
+
elem.className = value;
|
2261 |
+
|
2262 |
+
} else {
|
2263 |
+
setClass = " " + elem.className + " ";
|
2264 |
+
|
2265 |
+
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
2266 |
+
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
|
2267 |
+
setClass += classNames[ c ] + " ";
|
2268 |
+
}
|
2269 |
+
}
|
2270 |
+
elem.className = jQuery.trim( setClass );
|
2271 |
+
}
|
2272 |
+
}
|
2273 |
+
}
|
2274 |
+
}
|
2275 |
+
|
2276 |
+
return this;
|
2277 |
+
},
|
2278 |
+
|
2279 |
+
removeClass: function( value ) {
|
2280 |
+
var classNames, i, l, elem, className, c, cl;
|
2281 |
+
|
2282 |
+
if ( jQuery.isFunction( value ) ) {
|
2283 |
+
return this.each(function( j ) {
|
2284 |
+
jQuery( this ).removeClass( value.call(this, j, this.className) );
|
2285 |
+
});
|
2286 |
+
}
|
2287 |
+
|
2288 |
+
if ( (value && typeof value === "string") || value === undefined ) {
|
2289 |
+
classNames = ( value || "" ).split( rspace );
|
2290 |
+
|
2291 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
2292 |
+
elem = this[ i ];
|
2293 |
+
|
2294 |
+
if ( elem.nodeType === 1 && elem.className ) {
|
2295 |
+
if ( value ) {
|
2296 |
+
className = (" " + elem.className + " ").replace( rclass, " " );
|
2297 |
+
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
2298 |
+
className = className.replace(" " + classNames[ c ] + " ", " ");
|
2299 |
+
}
|
2300 |
+
elem.className = jQuery.trim( className );
|
2301 |
+
|
2302 |
+
} else {
|
2303 |
+
elem.className = "";
|
2304 |
+
}
|
2305 |
+
}
|
2306 |
+
}
|
2307 |
+
}
|
2308 |
+
|
2309 |
+
return this;
|
2310 |
+
},
|
2311 |
+
|
2312 |
+
toggleClass: function( value, stateVal ) {
|
2313 |
+
var type = typeof value,
|
2314 |
+
isBool = typeof stateVal === "boolean";
|
2315 |
+
|
2316 |
+
if ( jQuery.isFunction( value ) ) {
|
2317 |
+
return this.each(function( i ) {
|
2318 |
+
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
2319 |
+
});
|
2320 |
+
}
|
2321 |
+
|
2322 |
+
return this.each(function() {
|
2323 |
+
if ( type === "string" ) {
|
2324 |
+
// toggle individual class names
|
2325 |
+
var className,
|
2326 |
+
i = 0,
|
2327 |
+
self = jQuery( this ),
|
2328 |
+
state = stateVal,
|
2329 |
+
classNames = value.split( rspace );
|
2330 |
+
|
2331 |
+
while ( (className = classNames[ i++ ]) ) {
|
2332 |
+
// check each className given, space seperated list
|
2333 |
+
state = isBool ? state : !self.hasClass( className );
|
2334 |
+
self[ state ? "addClass" : "removeClass" ]( className );
|
2335 |
+
}
|
2336 |
+
|
2337 |
+
} else if ( type === "undefined" || type === "boolean" ) {
|
2338 |
+
if ( this.className ) {
|
2339 |
+
// store className if set
|
2340 |
+
jQuery._data( this, "__className__", this.className );
|
2341 |
+
}
|
2342 |
+
|
2343 |
+
// toggle whole className
|
2344 |
+
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
|
2345 |
+
}
|
2346 |
+
});
|
2347 |
+
},
|
2348 |
+
|
2349 |
+
hasClass: function( selector ) {
|
2350 |
+
var className = " " + selector + " ",
|
2351 |
+
i = 0,
|
2352 |
+
l = this.length;
|
2353 |
+
for ( ; i < l; i++ ) {
|
2354 |
+
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
|
2355 |
+
return true;
|
2356 |
+
}
|
2357 |
+
}
|
2358 |
+
|
2359 |
+
return false;
|
2360 |
+
},
|
2361 |
+
|
2362 |
+
val: function( value ) {
|
2363 |
+
var hooks, ret, isFunction,
|
2364 |
+
elem = this[0];
|
2365 |
+
|
2366 |
+
if ( !arguments.length ) {
|
2367 |
+
if ( elem ) {
|
2368 |
+
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
|
2369 |
+
|
2370 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
2371 |
+
return ret;
|
2372 |
+
}
|
2373 |
+
|
2374 |
+
ret = elem.value;
|
2375 |
+
|
2376 |
+
return typeof ret === "string" ?
|
2377 |
+
// handle most common string cases
|
2378 |
+
ret.replace(rreturn, "") :
|
2379 |
+
// handle cases where value is null/undef or number
|
2380 |
+
ret == null ? "" : ret;
|
2381 |
+
}
|
2382 |
+
|
2383 |
+
return undefined;
|
2384 |
+
}
|
2385 |
+
|
2386 |
+
isFunction = jQuery.isFunction( value );
|
2387 |
+
|
2388 |
+
return this.each(function( i ) {
|
2389 |
+
var self = jQuery(this), val;
|
2390 |
+
|
2391 |
+
if ( this.nodeType !== 1 ) {
|
2392 |
+
return;
|
2393 |
+
}
|
2394 |
+
|
2395 |
+
if ( isFunction ) {
|
2396 |
+
val = value.call( this, i, self.val() );
|
2397 |
+
} else {
|
2398 |
+
val = value;
|
2399 |
+
}
|
2400 |
+
|
2401 |
+
// Treat null/undefined as ""; convert numbers to string
|
2402 |
+
if ( val == null ) {
|
2403 |
+
val = "";
|
2404 |
+
} else if ( typeof val === "number" ) {
|
2405 |
+
val += "";
|
2406 |
+
} else if ( jQuery.isArray( val ) ) {
|
2407 |
+
val = jQuery.map(val, function ( value ) {
|
2408 |
+
return value == null ? "" : value + "";
|
2409 |
+
});
|
2410 |
+
}
|
2411 |
+
|
2412 |
+
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
|
2413 |
+
|
2414 |
+
// If set returns undefined, fall back to normal setting
|
2415 |
+
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
2416 |
+
this.value = val;
|
2417 |
+
}
|
2418 |
+
});
|
2419 |
+
}
|
2420 |
+
});
|
2421 |
+
|
2422 |
+
jQuery.extend({
|
2423 |
+
valHooks: {
|
2424 |
+
option: {
|
2425 |
+
get: function( elem ) {
|
2426 |
+
// attributes.value is undefined in Blackberry 4.7 but
|
2427 |
+
// uses .value. See #6932
|
2428 |
+
var val = elem.attributes.value;
|
2429 |
+
return !val || val.specified ? elem.value : elem.text;
|
2430 |
+
}
|
2431 |
+
},
|
2432 |
+
select: {
|
2433 |
+
get: function( elem ) {
|
2434 |
+
var value, i, max, option,
|
2435 |
+
index = elem.selectedIndex,
|
2436 |
+
values = [],
|
2437 |
+
options = elem.options,
|
2438 |
+
one = elem.type === "select-one";
|
2439 |
+
|
2440 |
+
// Nothing was selected
|
2441 |
+
if ( index < 0 ) {
|
2442 |
+
return null;
|
2443 |
+
}
|
2444 |
+
|
2445 |
+
// Loop through all the selected options
|
2446 |
+
i = one ? index : 0;
|
2447 |
+
max = one ? index + 1 : options.length;
|
2448 |
+
for ( ; i < max; i++ ) {
|
2449 |
+
option = options[ i ];
|
2450 |
+
|
2451 |
+
// Don't return options that are disabled or in a disabled optgroup
|
2452 |
+
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
|
2453 |
+
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
|
2454 |
+
|
2455 |
+
// Get the specific value for the option
|
2456 |
+
value = jQuery( option ).val();
|
2457 |
+
|
2458 |
+
// We don't need an array for one selects
|
2459 |
+
if ( one ) {
|
2460 |
+
return value;
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
// Multi-Selects return an array
|
2464 |
+
values.push( value );
|
2465 |
+
}
|
2466 |
+
}
|
2467 |
+
|
2468 |
+
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
|
2469 |
+
if ( one && !values.length && options.length ) {
|
2470 |
+
return jQuery( options[ index ] ).val();
|
2471 |
+
}
|
2472 |
+
|
2473 |
+
return values;
|
2474 |
+
},
|
2475 |
+
|
2476 |
+
set: function( elem, value ) {
|
2477 |
+
var values = jQuery.makeArray( value );
|
2478 |
+
|
2479 |
+
jQuery(elem).find("option").each(function() {
|
2480 |
+
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
|
2481 |
+
});
|
2482 |
+
|
2483 |
+
if ( !values.length ) {
|
2484 |
+
elem.selectedIndex = -1;
|
2485 |
+
}
|
2486 |
+
return values;
|
2487 |
+
}
|
2488 |
+
}
|
2489 |
+
},
|
2490 |
+
|
2491 |
+
attrFn: {
|
2492 |
+
val: true,
|
2493 |
+
css: true,
|
2494 |
+
html: true,
|
2495 |
+
text: true,
|
2496 |
+
data: true,
|
2497 |
+
width: true,
|
2498 |
+
height: true,
|
2499 |
+
offset: true
|
2500 |
+
},
|
2501 |
+
|
2502 |
+
attr: function( elem, name, value, pass ) {
|
2503 |
+
var ret, hooks, notxml,
|
2504 |
+
nType = elem.nodeType;
|
2505 |
+
|
2506 |
+
// don't get/set attributes on text, comment and attribute nodes
|
2507 |
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2508 |
+
return undefined;
|
2509 |
+
}
|
2510 |
+
|
2511 |
+
if ( pass && name in jQuery.attrFn ) {
|
2512 |
+
return jQuery( elem )[ name ]( value );
|
2513 |
+
}
|
2514 |
+
|
2515 |
+
// Fallback to prop when attributes are not supported
|
2516 |
+
if ( !("getAttribute" in elem) ) {
|
2517 |
+
return jQuery.prop( elem, name, value );
|
2518 |
+
}
|
2519 |
+
|
2520 |
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2521 |
+
|
2522 |
+
// All attributes are lowercase
|
2523 |
+
// Grab necessary hook if one is defined
|
2524 |
+
if ( notxml ) {
|
2525 |
+
name = name.toLowerCase();
|
2526 |
+
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
|
2527 |
+
}
|
2528 |
+
|
2529 |
+
if ( value !== undefined ) {
|
2530 |
+
|
2531 |
+
if ( value === null ) {
|
2532 |
+
jQuery.removeAttr( elem, name );
|
2533 |
+
return undefined;
|
2534 |
+
|
2535 |
+
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2536 |
+
return ret;
|
2537 |
+
|
2538 |
+
} else {
|
2539 |
+
elem.setAttribute( name, "" + value );
|
2540 |
+
return value;
|
2541 |
+
}
|
2542 |
+
|
2543 |
+
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
|
2544 |
+
return ret;
|
2545 |
+
|
2546 |
+
} else {
|
2547 |
+
|
2548 |
+
ret = elem.getAttribute( name );
|
2549 |
+
|
2550 |
+
// Non-existent attributes return null, we normalize to undefined
|
2551 |
+
return ret === null ?
|
2552 |
+
undefined :
|
2553 |
+
ret;
|
2554 |
+
}
|
2555 |
+
},
|
2556 |
+
|
2557 |
+
removeAttr: function( elem, value ) {
|
2558 |
+
var propName, attrNames, name, l,
|
2559 |
+
i = 0;
|
2560 |
+
|
2561 |
+
if ( elem.nodeType === 1 ) {
|
2562 |
+
attrNames = ( value || "" ).split( rspace );
|
2563 |
+
l = attrNames.length;
|
2564 |
+
|
2565 |
+
for ( ; i < l; i++ ) {
|
2566 |
+
name = attrNames[ i ].toLowerCase();
|
2567 |
+
propName = jQuery.propFix[ name ] || name;
|
2568 |
+
|
2569 |
+
// See #9699 for explanation of this approach (setting first, then removal)
|
2570 |
+
jQuery.attr( elem, name, "" );
|
2571 |
+
elem.removeAttribute( getSetAttribute ? name : propName );
|
2572 |
+
|
2573 |
+
// Set corresponding property to false for boolean attributes
|
2574 |
+
if ( rboolean.test( name ) && propName in elem ) {
|
2575 |
+
elem[ propName ] = false;
|
2576 |
+
}
|
2577 |
+
}
|
2578 |
+
}
|
2579 |
+
},
|
2580 |
+
|
2581 |
+
attrHooks: {
|
2582 |
+
type: {
|
2583 |
+
set: function( elem, value ) {
|
2584 |
+
// We can't allow the type property to be changed (since it causes problems in IE)
|
2585 |
+
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
|
2586 |
+
jQuery.error( "type property can't be changed" );
|
2587 |
+
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
2588 |
+
// Setting the type on a radio button after the value resets the value in IE6-9
|
2589 |
+
// Reset value to it's default in case type is set after value
|
2590 |
+
// This is for element creation
|
2591 |
+
var val = elem.value;
|
2592 |
+
elem.setAttribute( "type", value );
|
2593 |
+
if ( val ) {
|
2594 |
+
elem.value = val;
|
2595 |
+
}
|
2596 |
+
return value;
|
2597 |
+
}
|
2598 |
+
}
|
2599 |
+
},
|
2600 |
+
// Use the value property for back compat
|
2601 |
+
// Use the nodeHook for button elements in IE6/7 (#1954)
|
2602 |
+
value: {
|
2603 |
+
get: function( elem, name ) {
|
2604 |
+
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
|
2605 |
+
return nodeHook.get( elem, name );
|
2606 |
+
}
|
2607 |
+
return name in elem ?
|
2608 |
+
elem.value :
|
2609 |
+
null;
|
2610 |
+
},
|
2611 |
+
set: function( elem, value, name ) {
|
2612 |
+
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
|
2613 |
+
return nodeHook.set( elem, value, name );
|
2614 |
+
}
|
2615 |
+
// Does not return so that setAttribute is also used
|
2616 |
+
elem.value = value;
|
2617 |
+
}
|
2618 |
+
}
|
2619 |
+
},
|
2620 |
+
|
2621 |
+
propFix: {
|
2622 |
+
tabindex: "tabIndex",
|
2623 |
+
readonly: "readOnly",
|
2624 |
+
"for": "htmlFor",
|
2625 |
+
"class": "className",
|
2626 |
+
maxlength: "maxLength",
|
2627 |
+
cellspacing: "cellSpacing",
|
2628 |
+
cellpadding: "cellPadding",
|
2629 |
+
rowspan: "rowSpan",
|
2630 |
+
colspan: "colSpan",
|
2631 |
+
usemap: "useMap",
|
2632 |
+
frameborder: "frameBorder",
|
2633 |
+
contenteditable: "contentEditable"
|
2634 |
+
},
|
2635 |
+
|
2636 |
+
prop: function( elem, name, value ) {
|
2637 |
+
var ret, hooks, notxml,
|
2638 |
+
nType = elem.nodeType;
|
2639 |
+
|
2640 |
+
// don't get/set properties on text, comment and attribute nodes
|
2641 |
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2642 |
+
return undefined;
|
2643 |
+
}
|
2644 |
+
|
2645 |
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2646 |
+
|
2647 |
+
if ( notxml ) {
|
2648 |
+
// Fix name and attach hooks
|
2649 |
+
name = jQuery.propFix[ name ] || name;
|
2650 |
+
hooks = jQuery.propHooks[ name ];
|
2651 |
+
}
|
2652 |
+
|
2653 |
+
if ( value !== undefined ) {
|
2654 |
+
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2655 |
+
return ret;
|
2656 |
+
|
2657 |
+
} else {
|
2658 |
+
return ( elem[ name ] = value );
|
2659 |
+
}
|
2660 |
+
|
2661 |
+
} else {
|
2662 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
2663 |
+
return ret;
|
2664 |
+
|
2665 |
+
} else {
|
2666 |
+
return elem[ name ];
|
2667 |
+
}
|
2668 |
+
}
|
2669 |
+
},
|
2670 |
+
|
2671 |
+
propHooks: {
|
2672 |
+
tabIndex: {
|
2673 |
+
get: function( elem ) {
|
2674 |
+
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
2675 |
+
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
2676 |
+
var attributeNode = elem.getAttributeNode("tabindex");
|
2677 |
+
|
2678 |
+
return attributeNode && attributeNode.specified ?
|
2679 |
+
parseInt( attributeNode.value, 10 ) :
|
2680 |
+
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
2681 |
+
0 :
|
2682 |
+
undefined;
|
2683 |
+
}
|
2684 |
+
}
|
2685 |
+
}
|
2686 |
+
});
|
2687 |
+
|
2688 |
+
// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
|
2689 |
+
jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
|
2690 |
+
|
2691 |
+
// Hook for boolean attributes
|
2692 |
+
boolHook = {
|
2693 |
+
get: function( elem, name ) {
|
2694 |
+
// Align boolean attributes with corresponding properties
|
2695 |
+
// Fall back to attribute presence where some booleans are not supported
|
2696 |
+
var attrNode,
|
2697 |
+
property = jQuery.prop( elem, name );
|
2698 |
+
return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
2699 |
+
name.toLowerCase() :
|
2700 |
+
undefined;
|
2701 |
+
},
|
2702 |
+
set: function( elem, value, name ) {
|
2703 |
+
var propName;
|
2704 |
+
if ( value === false ) {
|
2705 |
+
// Remove boolean attributes when set to false
|
2706 |
+
jQuery.removeAttr( elem, name );
|
2707 |
+
} else {
|
2708 |
+
// value is true since we know at this point it's type boolean and not false
|
2709 |
+
// Set boolean attributes to the same name and set the DOM property
|
2710 |
+
propName = jQuery.propFix[ name ] || name;
|
2711 |
+
if ( propName in elem ) {
|
2712 |
+
// Only set the IDL specifically if it already exists on the element
|
2713 |
+
elem[ propName ] = true;
|
2714 |
+
}
|
2715 |
+
|
2716 |
+
elem.setAttribute( name, name.toLowerCase() );
|
2717 |
+
}
|
2718 |
+
return name;
|
2719 |
+
}
|
2720 |
+
};
|
2721 |
+
|
2722 |
+
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
2723 |
+
if ( !getSetAttribute ) {
|
2724 |
+
|
2725 |
+
fixSpecified = {
|
2726 |
+
name: true,
|
2727 |
+
id: true
|
2728 |
+
};
|
2729 |
+
|
2730 |
+
// Use this for any attribute in IE6/7
|
2731 |
+
// This fixes almost every IE6/7 issue
|
2732 |
+
nodeHook = jQuery.valHooks.button = {
|
2733 |
+
get: function( elem, name ) {
|
2734 |
+
var ret;
|
2735 |
+
ret = elem.getAttributeNode( name );
|
2736 |
+
return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
|
2737 |
+
ret.nodeValue :
|
2738 |
+
undefined;
|
2739 |
+
},
|
2740 |
+
set: function( elem, value, name ) {
|
2741 |
+
// Set the existing or create a new attribute node
|
2742 |
+
var ret = elem.getAttributeNode( name );
|
2743 |
+
if ( !ret ) {
|
2744 |
+
ret = document.createAttribute( name );
|
2745 |
+
elem.setAttributeNode( ret );
|
2746 |
+
}
|
2747 |
+
return ( ret.nodeValue = value + "" );
|
2748 |
+
}
|
2749 |
+
};
|
2750 |
+
|
2751 |
+
// Apply the nodeHook to tabindex
|
2752 |
+
jQuery.attrHooks.tabindex.set = nodeHook.set;
|
2753 |
+
|
2754 |
+
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
|
2755 |
+
// This is for removals
|
2756 |
+
jQuery.each([ "width", "height" ], function( i, name ) {
|
2757 |
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2758 |
+
set: function( elem, value ) {
|
2759 |
+
if ( value === "" ) {
|
2760 |
+
elem.setAttribute( name, "auto" );
|
2761 |
+
return value;
|
2762 |
+
}
|
2763 |
+
}
|
2764 |
+
});
|
2765 |
+
});
|
2766 |
+
|
2767 |
+
// Set contenteditable to false on removals(#10429)
|
2768 |
+
// Setting to empty string throws an error as an invalid value
|
2769 |
+
jQuery.attrHooks.contenteditable = {
|
2770 |
+
get: nodeHook.get,
|
2771 |
+
set: function( elem, value, name ) {
|
2772 |
+
if ( value === "" ) {
|
2773 |
+
value = "false";
|
2774 |
+
}
|
2775 |
+
nodeHook.set( elem, value, name );
|
2776 |
+
}
|
2777 |
+
};
|
2778 |
+
}
|
2779 |
+
|
2780 |
+
|
2781 |
+
// Some attributes require a special call on IE
|
2782 |
+
if ( !jQuery.support.hrefNormalized ) {
|
2783 |
+
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
|
2784 |
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2785 |
+
get: function( elem ) {
|
2786 |
+
var ret = elem.getAttribute( name, 2 );
|
2787 |
+
return ret === null ? undefined : ret;
|
2788 |
+
}
|
2789 |
+
});
|
2790 |
+
});
|
2791 |
+
}
|
2792 |
+
|
2793 |
+
if ( !jQuery.support.style ) {
|
2794 |
+
jQuery.attrHooks.style = {
|
2795 |
+
get: function( elem ) {
|
2796 |
+
// Return undefined in the case of empty string
|
2797 |
+
// Normalize to lowercase since IE uppercases css property names
|
2798 |
+
return elem.style.cssText.toLowerCase() || undefined;
|
2799 |
+
},
|
2800 |
+
set: function( elem, value ) {
|
2801 |
+
return ( elem.style.cssText = "" + value );
|
2802 |
+
}
|
2803 |
+
};
|
2804 |
+
}
|
2805 |
+
|
2806 |
+
// Safari mis-reports the default selected property of an option
|
2807 |
+
// Accessing the parent's selectedIndex property fixes it
|
2808 |
+
if ( !jQuery.support.optSelected ) {
|
2809 |
+
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
|
2810 |
+
get: function( elem ) {
|
2811 |
+
var parent = elem.parentNode;
|
2812 |
+
|
2813 |
+
if ( parent ) {
|
2814 |
+
parent.selectedIndex;
|
2815 |
+
|
2816 |
+
// Make sure that it also works with optgroups, see #5701
|
2817 |
+
if ( parent.parentNode ) {
|
2818 |
+
parent.parentNode.selectedIndex;
|
2819 |
+
}
|
2820 |
+
}
|
2821 |
+
return null;
|
2822 |
+
}
|
2823 |
+
});
|
2824 |
+
}
|
2825 |
+
|
2826 |
+
// IE6/7 call enctype encoding
|
2827 |
+
if ( !jQuery.support.enctype ) {
|
2828 |
+
jQuery.propFix.enctype = "encoding";
|
2829 |
+
}
|
2830 |
+
|
2831 |
+
// Radios and checkboxes getter/setter
|
2832 |
+
if ( !jQuery.support.checkOn ) {
|
2833 |
+
jQuery.each([ "radio", "checkbox" ], function() {
|
2834 |
+
jQuery.valHooks[ this ] = {
|
2835 |
+
get: function( elem ) {
|
2836 |
+
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
|
2837 |
+
return elem.getAttribute("value") === null ? "on" : elem.value;
|
2838 |
+
}
|
2839 |
+
};
|
2840 |
+
});
|
2841 |
+
}
|
2842 |
+
jQuery.each([ "radio", "checkbox" ], function() {
|
2843 |
+
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
|
2844 |
+
set: function( elem, value ) {
|
2845 |
+
if ( jQuery.isArray( value ) ) {
|
2846 |
+
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
|
2847 |
+
}
|
2848 |
+
}
|
2849 |
+
});
|
2850 |
+
});
|
2851 |
+
|
2852 |
+
|
2853 |
+
|
2854 |
+
|
2855 |
+
var rnamespaces = /\.(.*)$/,
|
2856 |
+
rformElems = /^(?:textarea|input|select)$/i,
|
2857 |
+
rperiod = /\./g,
|
2858 |
+
rspaces = / /g,
|
2859 |
+
rescape = /[^\w\s.|`]/g,
|
2860 |
+
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
|
2861 |
+
rhoverHack = /\bhover(\.\S+)?/,
|
2862 |
+
rkeyEvent = /^key/,
|
2863 |
+
rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
2864 |
+
rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
|
2865 |
+
quickParse = function( selector ) {
|
2866 |
+
var quick = rquickIs.exec( selector );
|
2867 |
+
if ( quick ) {
|
2868 |
+
// 0 1 2 3
|
2869 |
+
// [ _, tag, id, class ]
|
2870 |
+
quick[1] = ( quick[1] || "" ).toLowerCase();
|
2871 |
+
quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
|
2872 |
+
}
|
2873 |
+
return quick;
|
2874 |
+
},
|
2875 |
+
quickIs = function( elem, m ) {
|
2876 |
+
return (
|
2877 |
+
(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
|
2878 |
+
(!m[2] || elem.id === m[2]) &&
|
2879 |
+
(!m[3] || m[3].test( elem.className ))
|
2880 |
+
);
|
2881 |
+
},
|
2882 |
+
hoverHack = function( events ) {
|
2883 |
+
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
2884 |
+
};
|
2885 |
+
|
2886 |
+
/*
|
2887 |
+
* Helper functions for managing events -- not part of the public interface.
|
2888 |
+
* Props to Dean Edwards' addEvent library for many of the ideas.
|
2889 |
+
*/
|
2890 |
+
jQuery.event = {
|
2891 |
+
|
2892 |
+
add: function( elem, types, handler, data, selector ) {
|
2893 |
+
|
2894 |
+
var elemData, eventHandle, events,
|
2895 |
+
t, tns, type, namespaces, handleObj,
|
2896 |
+
handleObjIn, quick, handlers, special;
|
2897 |
+
|
2898 |
+
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
|
2899 |
+
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
|
2900 |
+
return;
|
2901 |
+
}
|
2902 |
+
|
2903 |
+
// Caller can pass in an object of custom data in lieu of the handler
|
2904 |
+
if ( handler.handler ) {
|
2905 |
+
handleObjIn = handler;
|
2906 |
+
handler = handleObjIn.handler;
|
2907 |
+
}
|
2908 |
+
|
2909 |
+
// Make sure that the handler has a unique ID, used to find/remove it later
|
2910 |
+
if ( !handler.guid ) {
|
2911 |
+
handler.guid = jQuery.guid++;
|
2912 |
+
}
|
2913 |
+
|
2914 |
+
// Init the element's event structure and main handler, if this is the first
|
2915 |
+
events = elemData.events;
|
2916 |
+
if ( !events ) {
|
2917 |
+
elemData.events = events = {};
|
2918 |
+
}
|
2919 |
+
eventHandle = elemData.handle;
|
2920 |
+
if ( !eventHandle ) {
|
2921 |
+
elemData.handle = eventHandle = function( e ) {
|
2922 |
+
// Discard the second event of a jQuery.event.trigger() and
|
2923 |
+
// when an event is called after a page has unloaded
|
2924 |
+
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
|
2925 |
+
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
|
2926 |
+
undefined;
|
2927 |
+
};
|
2928 |
+
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
|
2929 |
+
eventHandle.elem = elem;
|
2930 |
+
}
|
2931 |
+
|
2932 |
+
// Handle multiple events separated by a space
|
2933 |
+
// jQuery(...).bind("mouseover mouseout", fn);
|
2934 |
+
types = hoverHack(types).split( " " );
|
2935 |
+
for ( t = 0; t < types.length; t++ ) {
|
2936 |
+
|
2937 |
+
tns = rtypenamespace.exec( types[t] ) || [];
|
2938 |
+
type = tns[1];
|
2939 |
+
namespaces = ( tns[2] || "" ).split( "." ).sort();
|
2940 |
+
|
2941 |
+
// If event changes its type, use the special event handlers for the changed type
|
2942 |
+
special = jQuery.event.special[ type ] || {};
|
2943 |
+
|
2944 |
+
// If selector defined, determine special event api type, otherwise given type
|
2945 |
+
type = ( selector ? special.delegateType : special.bindType ) || type;
|
2946 |
+
|
2947 |
+
// Update special based on newly reset type
|
2948 |
+
special = jQuery.event.special[ type ] || {};
|
2949 |
+
|
2950 |
+
// handleObj is passed to all event handlers
|
2951 |
+
handleObj = jQuery.extend({
|
2952 |
+
type: type,
|
2953 |
+
origType: tns[1],
|
2954 |
+
data: data,
|
2955 |
+
handler: handler,
|
2956 |
+
guid: handler.guid,
|
2957 |
+
selector: selector,
|
2958 |
+
namespace: namespaces.join(".")
|
2959 |
+
}, handleObjIn );
|
2960 |
+
|
2961 |
+
// Delegated event; pre-analyze selector so it's processed quickly on event dispatch
|
2962 |
+
if ( selector ) {
|
2963 |
+
handleObj.quick = quickParse( selector );
|
2964 |
+
if ( !handleObj.quick && jQuery.expr.match.POS.test( selector ) ) {
|
2965 |
+
handleObj.isPositional = true;
|
2966 |
+
}
|
2967 |
+
}
|
2968 |
+
|
2969 |
+
// Init the event handler queue if we're the first
|
2970 |
+
handlers = events[ type ];
|
2971 |
+
if ( !handlers ) {
|
2972 |
+
handlers = events[ type ] = [];
|
2973 |
+
handlers.delegateCount = 0;
|
2974 |
+
|
2975 |
+
// Only use addEventListener/attachEvent if the special events handler returns false
|
2976 |
+
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
2977 |
+
// Bind the global event handler to the element
|
2978 |
+
if ( elem.addEventListener ) {
|
2979 |
+
elem.addEventListener( type, eventHandle, false );
|
2980 |
+
|
2981 |
+
} else if ( elem.attachEvent ) {
|
2982 |
+
elem.attachEvent( "on" + type, eventHandle );
|
2983 |
+
}
|
2984 |
+
}
|
2985 |
+
}
|
2986 |
+
|
2987 |
+
if ( special.add ) {
|
2988 |
+
special.add.call( elem, handleObj );
|
2989 |
+
|
2990 |
+
if ( !handleObj.handler.guid ) {
|
2991 |
+
handleObj.handler.guid = handler.guid;
|
2992 |
+
}
|
2993 |
+
}
|
2994 |
+
|
2995 |
+
// Add to the element's handler list, delegates in front
|
2996 |
+
if ( selector ) {
|
2997 |
+
handlers.splice( handlers.delegateCount++, 0, handleObj );
|
2998 |
+
} else {
|
2999 |
+
handlers.push( handleObj );
|
3000 |
+
}
|
3001 |
+
|
3002 |
+
// Keep track of which events have ever been used, for event optimization
|
3003 |
+
jQuery.event.global[ type ] = true;
|
3004 |
+
}
|
3005 |
+
|
3006 |
+
// Nullify elem to prevent memory leaks in IE
|
3007 |
+
elem = null;
|
3008 |
+
},
|
3009 |
+
|
3010 |
+
global: {},
|
3011 |
+
|
3012 |
+
// Detach an event or set of events from an element
|
3013 |
+
remove: function( elem, types, handler, selector ) {
|
3014 |
+
|
3015 |
+
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
|
3016 |
+
t, tns, type, namespaces, origCount,
|
3017 |
+
j, events, special, handle, eventType, handleObj;
|
3018 |
+
|
3019 |
+
if ( !elemData || !(events = elemData.events) ) {
|
3020 |
+
return;
|
3021 |
+
}
|
3022 |
+
|
3023 |
+
// Once for each type.namespace in types; type may be omitted
|
3024 |
+
types = hoverHack( types || "" ).split(" ");
|
3025 |
+
for ( t = 0; t < types.length; t++ ) {
|
3026 |
+
tns = rtypenamespace.exec( types[t] ) || [];
|
3027 |
+
type = tns[1];
|
3028 |
+
namespaces = tns[2];
|
3029 |
+
|
3030 |
+
// Unbind all events (on this namespace, if provided) for the element
|
3031 |
+
if ( !type ) {
|
3032 |
+
namespaces = namespaces? "." + namespaces : "";
|
3033 |
+
for ( j in events ) {
|
3034 |
+
jQuery.event.remove( elem, j + namespaces, handler, selector );
|
3035 |
+
}
|
3036 |
+
return;
|
3037 |
+
}
|
3038 |
+
|
3039 |
+
special = jQuery.event.special[ type ] || {};
|
3040 |
+
type = ( selector? special.delegateType : special.bindType ) || type;
|
3041 |
+
eventType = events[ type ] || [];
|
3042 |
+
origCount = eventType.length;
|
3043 |
+
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
|
3044 |
+
|
3045 |
+
// Only need to loop for special events or selective removal
|
3046 |
+
if ( handler || namespaces || selector || special.remove ) {
|
3047 |
+
for ( j = 0; j < eventType.length; j++ ) {
|
3048 |
+
handleObj = eventType[ j ];
|
3049 |
+
|
3050 |
+
if ( !handler || handler.guid === handleObj.guid ) {
|
3051 |
+
if ( !namespaces || namespaces.test( handleObj.namespace ) ) {
|
3052 |
+
if ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) {
|
3053 |
+
eventType.splice( j--, 1 );
|
3054 |
+
|
3055 |
+
if ( handleObj.selector ) {
|
3056 |
+
eventType.delegateCount--;
|
3057 |
+
}
|
3058 |
+
if ( special.remove ) {
|
3059 |
+
special.remove.call( elem, handleObj );
|
3060 |
+
}
|
3061 |
+
}
|
3062 |
+
}
|
3063 |
+
}
|
3064 |
+
}
|
3065 |
+
} else {
|
3066 |
+
// Removing all events
|
3067 |
+
eventType.length = 0;
|
3068 |
+
}
|
3069 |
+
|
3070 |
+
// Remove generic event handler if we removed something and no more handlers exist
|
3071 |
+
// (avoids potential for endless recursion during removal of special event handlers)
|
3072 |
+
if ( eventType.length === 0 && origCount !== eventType.length ) {
|
3073 |
+
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
|
3074 |
+
jQuery.removeEvent( elem, type, elemData.handle );
|
3075 |
+
}
|
3076 |
+
|
3077 |
+
delete events[ type ];
|
3078 |
+
}
|
3079 |
+
}
|
3080 |
+
|
3081 |
+
// Remove the expando if it's no longer used
|
3082 |
+
if ( jQuery.isEmptyObject( events ) ) {
|
3083 |
+
handle = elemData.handle;
|
3084 |
+
if ( handle ) {
|
3085 |
+
handle.elem = null;
|
3086 |
+
}
|
3087 |
+
|
3088 |
+
// removeData also checks for emptiness and clears the expando if empty
|
3089 |
+
// so use it instead of delete
|
3090 |
+
jQuery.removeData( elem, [ "events", "handle" ], true );
|
3091 |
+
}
|
3092 |
+
},
|
3093 |
+
|
3094 |
+
// Events that are safe to short-circuit if no handlers are attached.
|
3095 |
+
// Native DOM events should not be added, they may have inline handlers.
|
3096 |
+
customEvent: {
|
3097 |
+
"getData": true,
|
3098 |
+
"setData": true,
|
3099 |
+
"changeData": true
|
3100 |
+
},
|
3101 |
+
|
3102 |
+
trigger: function( event, data, elem, onlyHandlers ) {
|
3103 |
+
// Don't do events on text and comment nodes
|
3104 |
+
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
|
3105 |
+
return;
|
3106 |
+
}
|
3107 |
+
|
3108 |
+
// Event object or event type
|
3109 |
+
var type = event.type || event,
|
3110 |
+
namespaces = [],
|
3111 |
+
cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
|
3112 |
+
|
3113 |
+
if ( type.indexOf( "!" ) >= 0 ) {
|
3114 |
+
// Exclusive events trigger only for the exact event (no namespaces)
|
3115 |
+
type = type.slice(0, -1);
|
3116 |
+
exclusive = true;
|
3117 |
+
}
|
3118 |
+
|
3119 |
+
if ( type.indexOf( "." ) >= 0 ) {
|
3120 |
+
// Namespaced trigger; create a regexp to match event type in handle()
|
3121 |
+
namespaces = type.split(".");
|
3122 |
+
type = namespaces.shift();
|
3123 |
+
namespaces.sort();
|
3124 |
+
}
|
3125 |
+
|
3126 |
+
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
|
3127 |
+
// No jQuery handlers for this event type, and it can't have inline handlers
|
3128 |
+
return;
|
3129 |
+
}
|
3130 |
+
|
3131 |
+
// Caller can pass in an Event, Object, or just an event type string
|
3132 |
+
event = typeof event === "object" ?
|
3133 |
+
// jQuery.Event object
|
3134 |
+
event[ jQuery.expando ] ? event :
|
3135 |
+
// Object literal
|
3136 |
+
new jQuery.Event( type, event ) :
|
3137 |
+
// Just the event type (string)
|
3138 |
+
new jQuery.Event( type );
|
3139 |
+
|
3140 |
+
event.type = type;
|
3141 |
+
event.isTrigger = true;
|
3142 |
+
event.exclusive = exclusive;
|
3143 |
+
event.namespace = namespaces.join( "." );
|
3144 |
+
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
|
3145 |
+
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
|
3146 |
+
|
3147 |
+
// triggerHandler() and global events don't bubble or run the default action
|
3148 |
+
if ( onlyHandlers || !elem ) {
|
3149 |
+
event.preventDefault();
|
3150 |
+
}
|
3151 |
+
|
3152 |
+
// Handle a global trigger
|
3153 |
+
if ( !elem ) {
|
3154 |
+
|
3155 |
+
// TODO: Stop taunting the data cache; remove global events and always attach to document
|
3156 |
+
cache = jQuery.cache;
|
3157 |
+
for ( i in cache ) {
|
3158 |
+
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
|
3159 |
+
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
|
3160 |
+
}
|
3161 |
+
}
|
3162 |
+
return;
|
3163 |
+
}
|
3164 |
+
|
3165 |
+
// Clean up the event in case it is being reused
|
3166 |
+
event.result = undefined;
|
3167 |
+
if ( !event.target ) {
|
3168 |
+
event.target = elem;
|
3169 |
+
}
|
3170 |
+
|
3171 |
+
// Clone any incoming data and prepend the event, creating the handler arg list
|
3172 |
+
data = data != null ? jQuery.makeArray( data ) : [];
|
3173 |
+
data.unshift( event );
|
3174 |
+
|
3175 |
+
// Allow special events to draw outside the lines
|
3176 |
+
special = jQuery.event.special[ type ] || {};
|
3177 |
+
if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
|
3178 |
+
return;
|
3179 |
+
}
|
3180 |
+
|
3181 |
+
// Determine event propagation path in advance, per W3C events spec (#9951)
|
3182 |
+
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
3183 |
+
eventPath = [[ elem, special.bindType || type ]];
|
3184 |
+
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
3185 |
+
|
3186 |
+
bubbleType = special.delegateType || type;
|
3187 |
+
old = null;
|
3188 |
+
for ( cur = elem.parentNode; cur; cur = cur.parentNode ) {
|
3189 |
+
eventPath.push([ cur, bubbleType ]);
|
3190 |
+
old = cur;
|
3191 |
+
}
|
3192 |
+
|
3193 |
+
// Only add window if we got to document (e.g., not plain obj or detached DOM)
|
3194 |
+
if ( old && old === elem.ownerDocument ) {
|
3195 |
+
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
|
3196 |
+
}
|
3197 |
+
}
|
3198 |
+
|
3199 |
+
// Fire handlers on the event path
|
3200 |
+
for ( i = 0; i < eventPath.length; i++ ) {
|
3201 |
+
|
3202 |
+
cur = eventPath[i][0];
|
3203 |
+
event.type = eventPath[i][1];
|
3204 |
+
|
3205 |
+
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
|
3206 |
+
if ( handle ) {
|
3207 |
+
handle.apply( cur, data );
|
3208 |
+
}
|
3209 |
+
handle = ontype && cur[ ontype ];
|
3210 |
+
if ( handle && jQuery.acceptData( cur ) ) {
|
3211 |
+
handle.apply( cur, data );
|
3212 |
+
}
|
3213 |
+
|
3214 |
+
if ( event.isPropagationStopped() ) {
|
3215 |
+
break;
|
3216 |
+
}
|
3217 |
+
}
|
3218 |
+
event.type = type;
|
3219 |
+
|
3220 |
+
// If nobody prevented the default action, do it now
|
3221 |
+
if ( !event.isDefaultPrevented() ) {
|
3222 |
+
|
3223 |
+
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
|
3224 |
+
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
|
3225 |
+
|
3226 |
+
// Call a native DOM method on the target with the same name name as the event.
|
3227 |
+
// Can't use an .isFunction() check here because IE6/7 fails that test.
|
3228 |
+
// Don't do default actions on window, that's where global variables be (#6170)
|
3229 |
+
// IE<9 dies on focus/blur to hidden element (#1486)
|
3230 |
+
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
|
3231 |
+
|
3232 |
+
// Don't re-trigger an onFOO event when we call its FOO() method
|
3233 |
+
old = elem[ ontype ];
|
3234 |
+
|
3235 |
+
if ( old ) {
|
3236 |
+
elem[ ontype ] = null;
|
3237 |
+
}
|
3238 |
+
|
3239 |
+
// Prevent re-triggering of the same event, since we already bubbled it above
|
3240 |
+
jQuery.event.triggered = type;
|
3241 |
+
elem[ type ]();
|
3242 |
+
jQuery.event.triggered = undefined;
|
3243 |
+
|
3244 |
+
if ( old ) {
|
3245 |
+
elem[ ontype ] = old;
|
3246 |
+
}
|
3247 |
+
}
|
3248 |
+
}
|
3249 |
+
}
|
3250 |
+
|
3251 |
+
return event.result;
|
3252 |
+
},
|
3253 |
+
|
3254 |
+
dispatch: function( event ) {
|
3255 |
+
|
3256 |
+
// Make a writable jQuery.Event from the native event object
|
3257 |
+
event = jQuery.event.fix( event || window.event );
|
3258 |
+
|
3259 |
+
var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
|
3260 |
+
delegateCount = handlers.delegateCount,
|
3261 |
+
args = [].slice.call( arguments, 0 ),
|
3262 |
+
run_all = !event.exclusive && !event.namespace,
|
3263 |
+
specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle,
|
3264 |
+
handlerQueue = [],
|
3265 |
+
i, j, cur, ret, selMatch, matched, matches, handleObj, sel, hit, related;
|
3266 |
+
|
3267 |
+
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
3268 |
+
args[0] = event;
|
3269 |
+
event.delegateTarget = this;
|
3270 |
+
|
3271 |
+
// Determine handlers that should run if there are delegated events
|
3272 |
+
// Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
|
3273 |
+
if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
|
3274 |
+
|
3275 |
+
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
|
3276 |
+
selMatch = {};
|
3277 |
+
matches = [];
|
3278 |
+
for ( i = 0; i < delegateCount; i++ ) {
|
3279 |
+
handleObj = handlers[ i ];
|
3280 |
+
sel = handleObj.selector;
|
3281 |
+
hit = selMatch[ sel ];
|
3282 |
+
|
3283 |
+
if ( handleObj.isPositional ) {
|
3284 |
+
// Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/
|
3285 |
+
hit = ( hit || (selMatch[ sel ] = jQuery( sel )) ).index( cur ) >= 0;
|
3286 |
+
} else if ( hit === undefined ) {
|
3287 |
+
hit = selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jQuery( cur ).is( sel ) );
|
3288 |
+
}
|
3289 |
+
if ( hit ) {
|
3290 |
+
matches.push( handleObj );
|
3291 |
+
}
|
3292 |
+
}
|
3293 |
+
if ( matches.length ) {
|
3294 |
+
handlerQueue.push({ elem: cur, matches: matches });
|
3295 |
+
}
|
3296 |
+
}
|
3297 |
+
}
|
3298 |
+
|
3299 |
+
// Add the remaining (directly-bound) handlers
|
3300 |
+
if ( handlers.length > delegateCount ) {
|
3301 |
+
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
|
3302 |
+
}
|
3303 |
+
|
3304 |
+
// Run delegates first; they may want to stop propagation beneath us
|
3305 |
+
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
|
3306 |
+
matched = handlerQueue[ i ];
|
3307 |
+
event.currentTarget = matched.elem;
|
3308 |
+
|
3309 |
+
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
|
3310 |
+
handleObj = matched.matches[ j ];
|
3311 |
+
|
3312 |
+
// Triggered event must either 1) be non-exclusive and have no namespace, or
|
3313 |
+
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
|
3314 |
+
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
|
3315 |
+
|
3316 |
+
event.data = handleObj.data;
|
3317 |
+
event.handleObj = handleObj;
|
3318 |
+
|
3319 |
+
ret = ( specialHandle || handleObj.handler ).apply( matched.elem, args );
|
3320 |
+
|
3321 |
+
if ( ret !== undefined ) {
|
3322 |
+
event.result = ret;
|
3323 |
+
if ( ret === false ) {
|
3324 |
+
event.preventDefault();
|
3325 |
+
event.stopPropagation();
|
3326 |
+
}
|
3327 |
+
}
|
3328 |
+
}
|
3329 |
+
}
|
3330 |
+
}
|
3331 |
+
|
3332 |
+
return event.result;
|
3333 |
+
},
|
3334 |
+
|
3335 |
+
// Includes some event props shared by KeyEvent and MouseEvent
|
3336 |
+
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
|
3337 |
+
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
|
3338 |
+
|
3339 |
+
fixHooks: {},
|
3340 |
+
|
3341 |
+
keyHooks: {
|
3342 |
+
props: "char charCode key keyCode".split(" "),
|
3343 |
+
filter: function( event, original ) {
|
3344 |
+
|
3345 |
+
// Add which for key events
|
3346 |
+
if ( event.which == null ) {
|
3347 |
+
event.which = original.charCode != null ? original.charCode : original.keyCode;
|
3348 |
+
}
|
3349 |
+
|
3350 |
+
return event;
|
3351 |
+
}
|
3352 |
+
},
|
3353 |
+
|
3354 |
+
mouseHooks: {
|
3355 |
+
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),
|
3356 |
+
filter: function( event, original ) {
|
3357 |
+
var eventDoc, doc, body,
|
3358 |
+
button = original.button,
|
3359 |
+
fromElement = original.fromElement;
|
3360 |
+
|
3361 |
+
// Calculate pageX/Y if missing and clientX/Y available
|
3362 |
+
if ( event.pageX == null && original.clientX != null ) {
|
3363 |
+
eventDoc = event.target.ownerDocument || document;
|
3364 |
+
doc = eventDoc.documentElement;
|
3365 |
+
body = eventDoc.body;
|
3366 |
+
|
3367 |
+
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
|
3368 |
+
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
|
3369 |
+
}
|
3370 |
+
|
3371 |
+
// Add relatedTarget, if necessary
|
3372 |
+
if ( !event.relatedTarget && fromElement ) {
|
3373 |
+
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
|
3374 |
+
}
|
3375 |
+
|
3376 |
+
// Add which for click: 1 === left; 2 === middle; 3 === right
|
3377 |
+
// Note: button is not normalized, so don't use it
|
3378 |
+
if ( !event.which && button !== undefined ) {
|
3379 |
+
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
return event;
|
3383 |
+
}
|
3384 |
+
},
|
3385 |
+
|
3386 |
+
fix: function( event ) {
|
3387 |
+
if ( event[ jQuery.expando ] ) {
|
3388 |
+
return event;
|
3389 |
+
}
|
3390 |
+
|
3391 |
+
// Create a writable copy of the event object and normalize some properties
|
3392 |
+
var i, prop,
|
3393 |
+
originalEvent = event,
|
3394 |
+
fixHook = jQuery.event.fixHooks[ event.type ] || {},
|
3395 |
+
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
|
3396 |
+
|
3397 |
+
event = jQuery.Event( originalEvent );
|
3398 |
+
|
3399 |
+
for ( i = copy.length; i; ) {
|
3400 |
+
prop = copy[ --i ];
|
3401 |
+
event[ prop ] = originalEvent[ prop ];
|
3402 |
+
}
|
3403 |
+
|
3404 |
+
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
|
3405 |
+
if ( !event.target ) {
|
3406 |
+
event.target = originalEvent.srcElement || document;
|
3407 |
+
}
|
3408 |
+
|
3409 |
+
// Target should not be a text node (#504, Safari)
|
3410 |
+
if ( event.target.nodeType === 3 ) {
|
3411 |
+
event.target = event.target.parentNode;
|
3412 |
+
}
|
3413 |
+
|
3414 |
+
// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
|
3415 |
+
if ( event.metaKey === undefined ) {
|
3416 |
+
event.metaKey = event.ctrlKey;
|
3417 |
+
}
|
3418 |
+
|
3419 |
+
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
|
3420 |
+
},
|
3421 |
+
|
3422 |
+
special: {
|
3423 |
+
ready: {
|
3424 |
+
// Make sure the ready event is setup
|
3425 |
+
setup: jQuery.bindReady
|
3426 |
+
},
|
3427 |
+
|
3428 |
+
focus: {
|
3429 |
+
delegateType: "focusin",
|
3430 |
+
noBubble: true
|
3431 |
+
},
|
3432 |
+
blur: {
|
3433 |
+
delegateType: "focusout",
|
3434 |
+
noBubble: true
|
3435 |
+
},
|
3436 |
+
|
3437 |
+
beforeunload: {
|
3438 |
+
setup: function( data, namespaces, eventHandle ) {
|
3439 |
+
// We only want to do this special case on windows
|
3440 |
+
if ( jQuery.isWindow( this ) ) {
|
3441 |
+
this.onbeforeunload = eventHandle;
|
3442 |
+
}
|
3443 |
+
},
|
3444 |
+
|
3445 |
+
teardown: function( namespaces, eventHandle ) {
|
3446 |
+
if ( this.onbeforeunload === eventHandle ) {
|
3447 |
+
this.onbeforeunload = null;
|
3448 |
+
}
|
3449 |
+
}
|
3450 |
+
}
|
3451 |
+
},
|
3452 |
+
|
3453 |
+
simulate: function( type, elem, event, bubble ) {
|
3454 |
+
// Piggyback on a donor event to simulate a different one.
|
3455 |
+
// Fake originalEvent to avoid donor's stopPropagation, but if the
|
3456 |
+
// simulated event prevents default then we do the same on the donor.
|
3457 |
+
var e = jQuery.extend(
|
3458 |
+
new jQuery.Event(),
|
3459 |
+
event,
|
3460 |
+
{ type: type,
|
3461 |
+
isSimulated: true,
|
3462 |
+
originalEvent: {}
|
3463 |
+
}
|
3464 |
+
);
|
3465 |
+
if ( bubble ) {
|
3466 |
+
jQuery.event.trigger( e, null, elem );
|
3467 |
+
} else {
|
3468 |
+
jQuery.event.dispatch.call( elem, e );
|
3469 |
+
}
|
3470 |
+
if ( e.isDefaultPrevented() ) {
|
3471 |
+
event.preventDefault();
|
3472 |
+
}
|
3473 |
+
}
|
3474 |
+
};
|
3475 |
+
|
3476 |
+
// Some plugins are using, but it's undocumented/deprecated and will be removed.
|
3477 |
+
// The 1.7 special event interface should provide all the hooks needed now.
|
3478 |
+
jQuery.event.handle = jQuery.event.dispatch;
|
3479 |
+
|
3480 |
+
jQuery.removeEvent = document.removeEventListener ?
|
3481 |
+
function( elem, type, handle ) {
|
3482 |
+
if ( elem.removeEventListener ) {
|
3483 |
+
elem.removeEventListener( type, handle, false );
|
3484 |
+
}
|
3485 |
+
} :
|
3486 |
+
function( elem, type, handle ) {
|
3487 |
+
if ( elem.detachEvent ) {
|
3488 |
+
elem.detachEvent( "on" + type, handle );
|
3489 |
+
}
|
3490 |
+
};
|
3491 |
+
|
3492 |
+
jQuery.Event = function( src, props ) {
|
3493 |
+
// Allow instantiation without the 'new' keyword
|
3494 |
+
if ( !(this instanceof jQuery.Event) ) {
|
3495 |
+
return new jQuery.Event( src, props );
|
3496 |
+
}
|
3497 |
+
|
3498 |
+
// Event object
|
3499 |
+
if ( src && src.type ) {
|
3500 |
+
this.originalEvent = src;
|
3501 |
+
this.type = src.type;
|
3502 |
+
|
3503 |
+
// Events bubbling up the document may have been marked as prevented
|
3504 |
+
// by a handler lower down the tree; reflect the correct value.
|
3505 |
+
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
|
3506 |
+
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
|
3507 |
+
|
3508 |
+
// Event type
|
3509 |
+
} else {
|
3510 |
+
this.type = src;
|
3511 |
+
}
|
3512 |
+
|
3513 |
+
// Put explicitly provided properties onto the event object
|
3514 |
+
if ( props ) {
|
3515 |
+
jQuery.extend( this, props );
|
3516 |
+
}
|
3517 |
+
|
3518 |
+
// Create a timestamp if incoming event doesn't have one
|
3519 |
+
this.timeStamp = src && src.timeStamp || jQuery.now();
|
3520 |
+
|
3521 |
+
// Mark it as fixed
|
3522 |
+
this[ jQuery.expando ] = true;
|
3523 |
+
};
|
3524 |
+
|
3525 |
+
function returnFalse() {
|
3526 |
+
return false;
|
3527 |
+
}
|
3528 |
+
function returnTrue() {
|
3529 |
+
return true;
|
3530 |
+
}
|
3531 |
+
|
3532 |
+
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
|
3533 |
+
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
|
3534 |
+
jQuery.Event.prototype = {
|
3535 |
+
preventDefault: function() {
|
3536 |
+
this.isDefaultPrevented = returnTrue;
|
3537 |
+
|
3538 |
+
var e = this.originalEvent;
|
3539 |
+
if ( !e ) {
|
3540 |
+
return;
|
3541 |
+
}
|
3542 |
+
|
3543 |
+
// if preventDefault exists run it on the original event
|
3544 |
+
if ( e.preventDefault ) {
|
3545 |
+
e.preventDefault();
|
3546 |
+
|
3547 |
+
// otherwise set the returnValue property of the original event to false (IE)
|
3548 |
+
} else {
|
3549 |
+
e.returnValue = false;
|
3550 |
+
}
|
3551 |
+
},
|
3552 |
+
stopPropagation: function() {
|
3553 |
+
this.isPropagationStopped = returnTrue;
|
3554 |
+
|
3555 |
+
var e = this.originalEvent;
|
3556 |
+
if ( !e ) {
|
3557 |
+
return;
|
3558 |
+
}
|
3559 |
+
// if stopPropagation exists run it on the original event
|
3560 |
+
if ( e.stopPropagation ) {
|
3561 |
+
e.stopPropagation();
|
3562 |
+
}
|
3563 |
+
// otherwise set the cancelBubble property of the original event to true (IE)
|
3564 |
+
e.cancelBubble = true;
|
3565 |
+
},
|
3566 |
+
stopImmediatePropagation: function() {
|
3567 |
+
this.isImmediatePropagationStopped = returnTrue;
|
3568 |
+
this.stopPropagation();
|
3569 |
+
},
|
3570 |
+
isDefaultPrevented: returnFalse,
|
3571 |
+
isPropagationStopped: returnFalse,
|
3572 |
+
isImmediatePropagationStopped: returnFalse
|
3573 |
+
};
|
3574 |
+
|
3575 |
+
// Create mouseenter/leave events using mouseover/out and event-time checks
|
3576 |
+
jQuery.each({
|
3577 |
+
mouseenter: "mouseover",
|
3578 |
+
mouseleave: "mouseout"
|
3579 |
+
}, function( orig, fix ) {
|
3580 |
+
jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = {
|
3581 |
+
delegateType: fix,
|
3582 |
+
bindType: fix,
|
3583 |
+
|
3584 |
+
handle: function( event ) {
|
3585 |
+
var target = this,
|
3586 |
+
related = event.relatedTarget,
|
3587 |
+
handleObj = event.handleObj,
|
3588 |
+
selector = handleObj.selector,
|
3589 |
+
oldType, ret;
|
3590 |
+
|
3591 |
+
// For a real mouseover/out, always call the handler; for
|
3592 |
+
// mousenter/leave call the handler if related is outside the target.
|
3593 |
+
// NB: No relatedTarget if the mouse left/entered the browser window
|
3594 |
+
if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {
|
3595 |
+
oldType = event.type;
|
3596 |
+
event.type = handleObj.origType;
|
3597 |
+
ret = handleObj.handler.apply( this, arguments );
|
3598 |
+
event.type = oldType;
|
3599 |
+
}
|
3600 |
+
return ret;
|
3601 |
+
}
|
3602 |
+
};
|
3603 |
+
});
|
3604 |
+
|
3605 |
+
// IE submit delegation
|
3606 |
+
if ( !jQuery.support.submitBubbles ) {
|
3607 |
+
|
3608 |
+
jQuery.event.special.submit = {
|
3609 |
+
setup: function() {
|
3610 |
+
// Only need this for delegated form submit events
|
3611 |
+
if ( jQuery.nodeName( this, "form" ) ) {
|
3612 |
+
return false;
|
3613 |
+
}
|
3614 |
+
|
3615 |
+
// Lazy-add a submit handler when a descendant form may potentially be submitted
|
3616 |
+
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
|
3617 |
+
// Node name check avoids a VML-related crash in IE (#9807)
|
3618 |
+
var elem = e.target,
|
3619 |
+
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
|
3620 |
+
if ( form && !form._submit_attached ) {
|
3621 |
+
jQuery.event.add( form, "submit._submit", function( event ) {
|
3622 |
+
// Form was submitted, bubble the event up the tree
|
3623 |
+
if ( this.parentNode ) {
|
3624 |
+
jQuery.event.simulate( "submit", this.parentNode, event, true );
|
3625 |
+
}
|
3626 |
+
});
|
3627 |
+
form._submit_attached = true;
|
3628 |
+
}
|
3629 |
+
});
|
3630 |
+
// return undefined since we don't need an event listener
|
3631 |
+
},
|
3632 |
+
|
3633 |
+
teardown: function() {
|
3634 |
+
// Only need this for delegated form submit events
|
3635 |
+
if ( jQuery.nodeName( this, "form" ) ) {
|
3636 |
+
return false;
|
3637 |
+
}
|
3638 |
+
|
3639 |
+
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
|
3640 |
+
jQuery.event.remove( this, "._submit" );
|
3641 |
+
}
|
3642 |
+
};
|
3643 |
+
}
|
3644 |
+
|
3645 |
+
// IE change delegation and checkbox/radio fix
|
3646 |
+
if ( !jQuery.support.changeBubbles ) {
|
3647 |
+
|
3648 |
+
jQuery.event.special.change = {
|
3649 |
+
|
3650 |
+
setup: function() {
|
3651 |
+
|
3652 |
+
if ( rformElems.test( this.nodeName ) ) {
|
3653 |
+
// IE doesn't fire change on a check/radio until blur; trigger it on click
|
3654 |
+
// after a propertychange. Eat the blur-change in special.change.handle.
|
3655 |
+
// This still fires onchange a second time for check/radio after blur.
|
3656 |
+
if ( this.type === "checkbox" || this.type === "radio" ) {
|
3657 |
+
jQuery.event.add( this, "propertychange._change", function( event ) {
|
3658 |
+
if ( event.originalEvent.propertyName === "checked" ) {
|
3659 |
+
this._just_changed = true;
|
3660 |
+
}
|
3661 |
+
});
|
3662 |
+
jQuery.event.add( this, "click._change", function( event ) {
|
3663 |
+
if ( this._just_changed ) {
|
3664 |
+
this._just_changed = false;
|
3665 |
+
jQuery.event.simulate( "change", this, event, true );
|
3666 |
+
}
|
3667 |
+
});
|
3668 |
+
}
|
3669 |
+
return false;
|
3670 |
+
}
|
3671 |
+
// Delegated event; lazy-add a change handler on descendant inputs
|
3672 |
+
jQuery.event.add( this, "beforeactivate._change", function( e ) {
|
3673 |
+
var elem = e.target;
|
3674 |
+
|
3675 |
+
if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
|
3676 |
+
jQuery.event.add( elem, "change._change", function( event ) {
|
3677 |
+
if ( this.parentNode && !event.isSimulated ) {
|
3678 |
+
jQuery.event.simulate( "change", this.parentNode, event, true );
|
3679 |
+
}
|
3680 |
+
});
|
3681 |
+
elem._change_attached = true;
|
3682 |
+
}
|
3683 |
+
});
|
3684 |
+
},
|
3685 |
+
|
3686 |
+
handle: function( event ) {
|
3687 |
+
var elem = event.target;
|
3688 |
+
|
3689 |
+
// Swallow native change events from checkbox/radio, we already triggered them above
|
3690 |
+
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
|
3691 |
+
return event.handleObj.handler.apply( this, arguments );
|
3692 |
+
}
|
3693 |
+
},
|
3694 |
+
|
3695 |
+
teardown: function() {
|
3696 |
+
jQuery.event.remove( this, "._change" );
|
3697 |
+
|
3698 |
+
return rformElems.test( this.nodeName );
|
3699 |
+
}
|
3700 |
+
};
|
3701 |
+
}
|
3702 |
+
|
3703 |
+
// Create "bubbling" focus and blur events
|
3704 |
+
if ( !jQuery.support.focusinBubbles ) {
|
3705 |
+
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
3706 |
+
|
3707 |
+
// Attach a single capturing handler while someone wants focusin/focusout
|
3708 |
+
var attaches = 0,
|
3709 |
+
handler = function( event ) {
|
3710 |
+
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
|
3711 |
+
};
|
3712 |
+
|
3713 |
+
jQuery.event.special[ fix ] = {
|
3714 |
+
setup: function() {
|
3715 |
+
if ( attaches++ === 0 ) {
|
3716 |
+
document.addEventListener( orig, handler, true );
|
3717 |
+
}
|
3718 |
+
},
|
3719 |
+
teardown: function() {
|
3720 |
+
if ( --attaches === 0 ) {
|
3721 |
+
document.removeEventListener( orig, handler, true );
|
3722 |
+
}
|
3723 |
+
}
|
3724 |
+
};
|
3725 |
+
});
|
3726 |
+
}
|
3727 |
+
|
3728 |
+
jQuery.fn.extend({
|
3729 |
+
|
3730 |
+
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
3731 |
+
var origFn, type;
|
3732 |
+
|
3733 |
+
// Types can be a map of types/handlers
|
3734 |
+
if ( typeof types === "object" ) {
|
3735 |
+
// ( types-Object, selector, data )
|
3736 |
+
if ( typeof selector !== "string" ) {
|
3737 |
+
// ( types-Object, data )
|
3738 |
+
data = selector;
|
3739 |
+
selector = undefined;
|
3740 |
+
}
|
3741 |
+
for ( type in types ) {
|
3742 |
+
this.on( type, selector, data, types[ type ], one );
|
3743 |
+
}
|
3744 |
+
return this;
|
3745 |
+
}
|
3746 |
+
|
3747 |
+
if ( data == null && fn == null ) {
|
3748 |
+
// ( types, fn )
|
3749 |
+
fn = selector;
|
3750 |
+
data = selector = undefined;
|
3751 |
+
} else if ( fn == null ) {
|
3752 |
+
if ( typeof selector === "string" ) {
|
3753 |
+
// ( types, selector, fn )
|
3754 |
+
fn = data;
|
3755 |
+
data = undefined;
|
3756 |
+
} else {
|
3757 |
+
// ( types, data, fn )
|
3758 |
+
fn = data;
|
3759 |
+
data = selector;
|
3760 |
+
selector = undefined;
|
3761 |
+
}
|
3762 |
+
}
|
3763 |
+
if ( fn === false ) {
|
3764 |
+
fn = returnFalse;
|
3765 |
+
} else if ( !fn ) {
|
3766 |
+
return this;
|
3767 |
+
}
|
3768 |
+
|
3769 |
+
if ( one === 1 ) {
|
3770 |
+
origFn = fn;
|
3771 |
+
fn = function( event ) {
|
3772 |
+
// Can use an empty set, since event contains the info
|
3773 |
+
jQuery().off( event );
|
3774 |
+
return origFn.apply( this, arguments );
|
3775 |
+
};
|
3776 |
+
// Use same guid so caller can remove using origFn
|
3777 |
+
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
3778 |
+
}
|
3779 |
+
return this.each( function() {
|
3780 |
+
jQuery.event.add( this, types, fn, data, selector );
|
3781 |
+
});
|
3782 |
+
},
|
3783 |
+
one: function( types, selector, data, fn ) {
|
3784 |
+
return this.on.call( this, types, selector, data, fn, 1 );
|
3785 |
+
},
|
3786 |
+
off: function( types, selector, fn ) {
|
3787 |
+
if ( types && types.preventDefault && types.handleObj ) {
|
3788 |
+
// ( event ) dispatched jQuery.Event
|
3789 |
+
var handleObj = types.handleObj;
|
3790 |
+
jQuery( types.delegateTarget ).off(
|
3791 |
+
handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
|
3792 |
+
handleObj.selector,
|
3793 |
+
handleObj.handler
|
3794 |
+
);
|
3795 |
+
return this;
|
3796 |
+
}
|
3797 |
+
if ( typeof types === "object" ) {
|
3798 |
+
// ( types-object [, selector] )
|
3799 |
+
for ( var type in types ) {
|
3800 |
+
this.off( type, selector, types[ type ] );
|
3801 |
+
}
|
3802 |
+
return this;
|
3803 |
+
}
|
3804 |
+
if ( selector === false || typeof selector === "function" ) {
|
3805 |
+
// ( types [, fn] )
|
3806 |
+
fn = selector;
|
3807 |
+
selector = undefined;
|
3808 |
+
}
|
3809 |
+
if ( fn === false ) {
|
3810 |
+
fn = returnFalse;
|
3811 |
+
}
|
3812 |
+
return this.each(function() {
|
3813 |
+
jQuery.event.remove( this, types, fn, selector );
|
3814 |
+
});
|
3815 |
+
},
|
3816 |
+
|
3817 |
+
bind: function( types, data, fn ) {
|
3818 |
+
return this.on( types, null, data, fn );
|
3819 |
+
},
|
3820 |
+
unbind: function( types, fn ) {
|
3821 |
+
return this.off( types, null, fn );
|
3822 |
+
},
|
3823 |
+
|
3824 |
+
live: function( types, data, fn ) {
|
3825 |
+
jQuery( this.context ).on( types, this.selector, data, fn );
|
3826 |
+
return this;
|
3827 |
+
},
|
3828 |
+
die: function( types, fn ) {
|
3829 |
+
jQuery( this.context ).off( types, this.selector || "**", fn );
|
3830 |
+
return this;
|
3831 |
+
},
|
3832 |
+
|
3833 |
+
delegate: function( selector, types, data, fn ) {
|
3834 |
+
return this.on( types, selector, data, fn );
|
3835 |
+
},
|
3836 |
+
undelegate: function( selector, types, fn ) {
|
3837 |
+
// ( namespace ) or ( selector, types [, fn] )
|
3838 |
+
return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
|
3839 |
+
},
|
3840 |
+
|
3841 |
+
trigger: function( type, data ) {
|
3842 |
+
return this.each(function() {
|
3843 |
+
jQuery.event.trigger( type, data, this );
|
3844 |
+
});
|
3845 |
+
},
|
3846 |
+
triggerHandler: function( type, data ) {
|
3847 |
+
if ( this[0] ) {
|
3848 |
+
return jQuery.event.trigger( type, data, this[0], true );
|
3849 |
+
}
|
3850 |
+
},
|
3851 |
+
|
3852 |
+
toggle: function( fn ) {
|
3853 |
+
// Save reference to arguments for access in closure
|
3854 |
+
var args = arguments,
|
3855 |
+
guid = fn.guid || jQuery.guid++,
|
3856 |
+
i = 0,
|
3857 |
+
toggler = function( event ) {
|
3858 |
+
// Figure out which function to execute
|
3859 |
+
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
3860 |
+
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
3861 |
+
|
3862 |
+
// Make sure that clicks stop
|
3863 |
+
event.preventDefault();
|
3864 |
+
|
3865 |
+
// and execute the function
|
3866 |
+
return args[ lastToggle ].apply( this, arguments ) || false;
|
3867 |
+
};
|
3868 |
+
|
3869 |
+
// link all the functions, so any of them can unbind this click handler
|
3870 |
+
toggler.guid = guid;
|
3871 |
+
while ( i < args.length ) {
|
3872 |
+
args[ i++ ].guid = guid;
|
3873 |
+
}
|
3874 |
+
|
3875 |
+
return this.click( toggler );
|
3876 |
+
},
|
3877 |
+
|
3878 |
+
hover: function( fnOver, fnOut ) {
|
3879 |
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
3880 |
+
}
|
3881 |
+
});
|
3882 |
+
|
3883 |
+
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
3884 |
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
3885 |
+
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
|
3886 |
+
|
3887 |
+
// Handle event binding
|
3888 |
+
jQuery.fn[ name ] = function( data, fn ) {
|
3889 |
+
if ( fn == null ) {
|
3890 |
+
fn = data;
|
3891 |
+
data = null;
|
3892 |
+
}
|
3893 |
+
|
3894 |
+
return arguments.length > 0 ?
|
3895 |
+
this.bind( name, data, fn ) :
|
3896 |
+
this.trigger( name );
|
3897 |
+
};
|
3898 |
+
|
3899 |
+
if ( jQuery.attrFn ) {
|
3900 |
+
jQuery.attrFn[ name ] = true;
|
3901 |
+
}
|
3902 |
+
|
3903 |
+
if ( rkeyEvent.test( name ) ) {
|
3904 |
+
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
|
3905 |
+
}
|
3906 |
+
|
3907 |
+
if ( rmouseEvent.test( name ) ) {
|
3908 |
+
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
|
3909 |
+
}
|
3910 |
+
});
|
3911 |
+
|
3912 |
+
|
3913 |
+
|
3914 |
+
/*!
|
3915 |
+
* Sizzle CSS Selector Engine
|
3916 |
+
* Copyright 2011, The Dojo Foundation
|
3917 |
+
* Released under the MIT, BSD, and GPL Licenses.
|
3918 |
+
* More information: http://sizzlejs.com/
|
3919 |
+
*/
|
3920 |
+
(function(){
|
3921 |
+
|
3922 |
+
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
3923 |
+
expando = "sizcache" + (Math.random() + '').replace('.', ''),
|
3924 |
+
done = 0,
|
3925 |
+
toString = Object.prototype.toString,
|
3926 |
+
hasDuplicate = false,
|
3927 |
+
baseHasDuplicate = true,
|
3928 |
+
rBackslash = /\\/g,
|
3929 |
+
rReturn = /\r\n/g,
|
3930 |
+
rNonWord = /\W/;
|
3931 |
+
|
3932 |
+
// Here we check if the JavaScript engine is using some sort of
|
3933 |
+
// optimization where it does not always call our comparision
|
3934 |
+
// function. If that is the case, discard the hasDuplicate value.
|
3935 |
+
// Thus far that includes Google Chrome.
|
3936 |
+
[0, 0].sort(function() {
|
3937 |
+
baseHasDuplicate = false;
|
3938 |
+
return 0;
|
3939 |
+
});
|
3940 |
+
|
3941 |
+
var Sizzle = function( selector, context, results, seed ) {
|
3942 |
+
results = results || [];
|
3943 |
+
context = context || document;
|
3944 |
+
|
3945 |
+
var origContext = context;
|
3946 |
+
|
3947 |
+
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
|
3948 |
+
return [];
|
3949 |
+
}
|
3950 |
+
|
3951 |
+
if ( !selector || typeof selector !== "string" ) {
|
3952 |
+
return results;
|
3953 |
+
}
|
3954 |
+
|
3955 |
+
var m, set, checkSet, extra, ret, cur, pop, i,
|
3956 |
+
prune = true,
|
3957 |
+
contextXML = Sizzle.isXML( context ),
|
3958 |
+
parts = [],
|
3959 |
+
soFar = selector;
|
3960 |
+
|
3961 |
+
// Reset the position of the chunker regexp (start from head)
|
3962 |
+
do {
|
3963 |
+
chunker.exec( "" );
|
3964 |
+
m = chunker.exec( soFar );
|
3965 |
+
|
3966 |
+
if ( m ) {
|
3967 |
+
soFar = m[3];
|
3968 |
+
|
3969 |
+
parts.push( m[1] );
|
3970 |
+
|
3971 |
+
if ( m[2] ) {
|
3972 |
+
extra = m[3];
|
3973 |
+
break;
|
3974 |
+
}
|
3975 |
+
}
|
3976 |
+
} while ( m );
|
3977 |
+
|
3978 |
+
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
3979 |
+
|
3980 |
+
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
3981 |
+
set = posProcess( parts[0] + parts[1], context, seed );
|
3982 |
+
|
3983 |
+
} else {
|
3984 |
+
set = Expr.relative[ parts[0] ] ?
|
3985 |
+
[ context ] :
|
3986 |
+
Sizzle( parts.shift(), context );
|
3987 |
+
|
3988 |
+
while ( parts.length ) {
|
3989 |
+
selector = parts.shift();
|
3990 |
+
|
3991 |
+
if ( Expr.relative[ selector ] ) {
|
3992 |
+
selector += parts.shift();
|
3993 |
+
}
|
3994 |
+
|
3995 |
+
set = posProcess( selector, set, seed );
|
3996 |
+
}
|
3997 |
+
}
|
3998 |
+
|
3999 |
+
} else {
|
4000 |
+
// Take a shortcut and set the context if the root selector is an ID
|
4001 |
+
// (but not if it'll be faster if the inner selector is an ID)
|
4002 |
+
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
|
4003 |
+
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
|
4004 |
+
|
4005 |
+
ret = Sizzle.find( parts.shift(), context, contextXML );
|
4006 |
+
context = ret.expr ?
|
4007 |
+
Sizzle.filter( ret.expr, ret.set )[0] :
|
4008 |
+
ret.set[0];
|
4009 |
+
}
|
4010 |
+
|
4011 |
+
if ( context ) {
|
4012 |
+
ret = seed ?
|
4013 |
+
{ expr: parts.pop(), set: makeArray(seed) } :
|
4014 |
+
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
|
4015 |
+
|
4016 |
+
set = ret.expr ?
|
4017 |
+
Sizzle.filter( ret.expr, ret.set ) :
|
4018 |
+
ret.set;
|
4019 |
+
|
4020 |
+
if ( parts.length > 0 ) {
|
4021 |
+
checkSet = makeArray( set );
|
4022 |
+
|
4023 |
+
} else {
|
4024 |
+
prune = false;
|
4025 |
+
}
|
4026 |
+
|
4027 |
+
while ( parts.length ) {
|
4028 |
+
cur = parts.pop();
|
4029 |
+
pop = cur;
|
4030 |
+
|
4031 |
+
if ( !Expr.relative[ cur ] ) {
|
4032 |
+
cur = "";
|
4033 |
+
} else {
|
4034 |
+
pop = parts.pop();
|
4035 |
+
}
|
4036 |
+
|
4037 |
+
if ( pop == null ) {
|
4038 |
+
pop = context;
|
4039 |
+
}
|
4040 |
+
|
4041 |
+
Expr.relative[ cur ]( checkSet, pop, contextXML );
|
4042 |
+
}
|
4043 |
+
|
4044 |
+
} else {
|
4045 |
+
checkSet = parts = [];
|
4046 |
+
}
|
4047 |
+
}
|
4048 |
+
|
4049 |
+
if ( !checkSet ) {
|
4050 |
+
checkSet = set;
|
4051 |
+
}
|
4052 |
+
|
4053 |
+
if ( !checkSet ) {
|
4054 |
+
Sizzle.error( cur || selector );
|
4055 |
+
}
|
4056 |
+
|
4057 |
+
if ( toString.call(checkSet) === "[object Array]" ) {
|
4058 |
+
if ( !prune ) {
|
4059 |
+
results.push.apply( results, checkSet );
|
4060 |
+
|
4061 |
+
} else if ( context && context.nodeType === 1 ) {
|
4062 |
+
for ( i = 0; checkSet[i] != null; i++ ) {
|
4063 |
+
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
|
4064 |
+
results.push( set[i] );
|
4065 |
+
}
|
4066 |
+
}
|
4067 |
+
|
4068 |
+
} else {
|
4069 |
+
for ( i = 0; checkSet[i] != null; i++ ) {
|
4070 |
+
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
4071 |
+
results.push( set[i] );
|
4072 |
+
}
|
4073 |
+
}
|
4074 |
+
}
|
4075 |
+
|
4076 |
+
} else {
|
4077 |
+
makeArray( checkSet, results );
|
4078 |
+
}
|
4079 |
+
|
4080 |
+
if ( extra ) {
|
4081 |
+
Sizzle( extra, origContext, results, seed );
|
4082 |
+
Sizzle.uniqueSort( results );
|
4083 |
+
}
|
4084 |
+
|
4085 |
+
return results;
|
4086 |
+
};
|
4087 |
+
|
4088 |
+
Sizzle.uniqueSort = function( results ) {
|
4089 |
+
if ( sortOrder ) {
|
4090 |
+
hasDuplicate = baseHasDuplicate;
|
4091 |
+
results.sort( sortOrder );
|
4092 |
+
|
4093 |
+
if ( hasDuplicate ) {
|
4094 |
+
for ( var i = 1; i < results.length; i++ ) {
|
4095 |
+
if ( results[i] === results[ i - 1 ] ) {
|
4096 |
+
results.splice( i--, 1 );
|
4097 |
+
}
|
4098 |
+
}
|
4099 |
+
}
|
4100 |
+
}
|
4101 |
+
|
4102 |
+
return results;
|
4103 |
+
};
|
4104 |
+
|
4105 |
+
Sizzle.matches = function( expr, set ) {
|
4106 |
+
return Sizzle( expr, null, null, set );
|
4107 |
+
};
|
4108 |
+
|
4109 |
+
Sizzle.matchesSelector = function( node, expr ) {
|
4110 |
+
return Sizzle( expr, null, null, [node] ).length > 0;
|
4111 |
+
};
|
4112 |
+
|
4113 |
+
Sizzle.find = function( expr, context, isXML ) {
|
4114 |
+
var set, i, len, match, type, left;
|
4115 |
+
|
4116 |
+
if ( !expr ) {
|
4117 |
+
return [];
|
4118 |
+
}
|
4119 |
+
|
4120 |
+
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
|
4121 |
+
type = Expr.order[i];
|
4122 |
+
|
4123 |
+
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
|
4124 |
+
left = match[1];
|
4125 |
+
match.splice( 1, 1 );
|
4126 |
+
|
4127 |
+
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
4128 |
+
match[1] = (match[1] || "").replace( rBackslash, "" );
|
4129 |
+
set = Expr.find[ type ]( match, context, isXML );
|
4130 |
+
|
4131 |
+
if ( set != null ) {
|
4132 |
+
expr = expr.replace( Expr.match[ type ], "" );
|
4133 |
+
break;
|
4134 |
+
}
|
4135 |
+
}
|
4136 |
+
}
|
4137 |
+
}
|
4138 |
+
|
4139 |
+
if ( !set ) {
|
4140 |
+
set = typeof context.getElementsByTagName !== "undefined" ?
|
4141 |
+
context.getElementsByTagName( "*" ) :
|
4142 |
+
[];
|
4143 |
+
}
|
4144 |
+
|
4145 |
+
return { set: set, expr: expr };
|
4146 |
+
};
|
4147 |
+
|
4148 |
+
Sizzle.filter = function( expr, set, inplace, not ) {
|
4149 |
+
var match, anyFound,
|
4150 |
+
type, found, item, filter, left,
|
4151 |
+
i, pass,
|
4152 |
+
old = expr,
|
4153 |
+
result = [],
|
4154 |
+
curLoop = set,
|
4155 |
+
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
|
4156 |
+
|
4157 |
+
while ( expr && set.length ) {
|
4158 |
+
for ( type in Expr.filter ) {
|
4159 |
+
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
|
4160 |
+
filter = Expr.filter[ type ];
|
4161 |
+
left = match[1];
|
4162 |
+
|
4163 |
+
anyFound = false;
|
4164 |
+
|
4165 |
+
match.splice(1,1);
|
4166 |
+
|
4167 |
+
if ( left.substr( left.length - 1 ) === "\\" ) {
|
4168 |
+
continue;
|
4169 |
+
}
|
4170 |
+
|
4171 |
+
if ( curLoop === result ) {
|
4172 |
+
result = [];
|
4173 |
+
}
|
4174 |
+
|
4175 |
+
if ( Expr.preFilter[ type ] ) {
|
4176 |
+
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
|
4177 |
+
|
4178 |
+
if ( !match ) {
|
4179 |
+
anyFound = found = true;
|
4180 |
+
|
4181 |
+
} else if ( match === true ) {
|
4182 |
+
continue;
|
4183 |
+
}
|
4184 |
+
}
|
4185 |
+
|
4186 |
+
if ( match ) {
|
4187 |
+
for ( i = 0; (item = curLoop[i]) != null; i++ ) {
|
4188 |
+
if ( item ) {
|
4189 |
+
found = filter( item, match, i, curLoop );
|
4190 |
+
pass = not ^ found;
|
4191 |
+
|
4192 |
+
if ( inplace && found != null ) {
|
4193 |
+
if ( pass ) {
|
4194 |
+
anyFound = true;
|
4195 |
+
|
4196 |
+
} else {
|
4197 |
+
curLoop[i] = false;
|
4198 |
+
}
|
4199 |
+
|
4200 |
+
} else if ( pass ) {
|
4201 |
+
result.push( item );
|
4202 |
+
anyFound = true;
|
4203 |
+
}
|
4204 |
+
}
|
4205 |
+
}
|
4206 |
+
}
|
4207 |
+
|
4208 |
+
if ( found !== undefined ) {
|
4209 |
+
if ( !inplace ) {
|
4210 |
+
curLoop = result;
|
4211 |
+
}
|
4212 |
+
|
4213 |
+
expr = expr.replace( Expr.match[ type ], "" );
|
4214 |
+
|
4215 |
+
if ( !anyFound ) {
|
4216 |
+
return [];
|
4217 |
+
}
|
4218 |
+
|
4219 |
+
break;
|
4220 |
+
}
|
4221 |
+
}
|
4222 |
+
}
|
4223 |
+
|
4224 |
+
// Improper expression
|
4225 |
+
if ( expr === old ) {
|
4226 |
+
if ( anyFound == null ) {
|
4227 |
+
Sizzle.error( expr );
|
4228 |
+
|
4229 |
+
} else {
|
4230 |
+
break;
|
4231 |
+
}
|
4232 |
+
}
|
4233 |
+
|
4234 |
+
old = expr;
|
4235 |
+
}
|
4236 |
+
|
4237 |
+
return curLoop;
|
4238 |
+
};
|
4239 |
+
|
4240 |
+
Sizzle.error = function( msg ) {
|
4241 |
+
throw "Syntax error, unrecognized expression: " + msg;
|
4242 |
+
};
|
4243 |
+
|
4244 |
+
/**
|
4245 |
+
* Utility function for retreiving the text value of an array of DOM nodes
|
4246 |
+
* @param {Array|Element} elem
|
4247 |
+
*/
|
4248 |
+
var getText = Sizzle.getText = function( elem ) {
|
4249 |
+
var i, node,
|
4250 |
+
nodeType = elem.nodeType,
|
4251 |
+
ret = "";
|
4252 |
+
|
4253 |
+
if ( nodeType ) {
|
4254 |
+
if ( nodeType === 1 ) {
|
4255 |
+
// Use textContent || innerText for elements
|
4256 |
+
if ( typeof elem.textContent === 'string' ) {
|
4257 |
+
return elem.textContent;
|
4258 |
+
} else if ( typeof elem.innerText === 'string' ) {
|
4259 |
+
// Replace IE's carriage returns
|
4260 |
+
return elem.innerText.replace( rReturn, '' );
|
4261 |
+
} else {
|
4262 |
+
// Traverse it's children
|
4263 |
+
for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
|
4264 |
+
ret += getText( elem );
|
4265 |
+
}
|
4266 |
+
}
|
4267 |
+
} else if ( nodeType === 3 || nodeType === 4 ) {
|
4268 |
+
return elem.nodeValue;
|
4269 |
+
}
|
4270 |
+
} else {
|
4271 |
+
|
4272 |
+
// If no nodeType, this is expected to be an array
|
4273 |
+
for ( i = 0; (node = elem[i]); i++ ) {
|
4274 |
+
// Do not traverse comment nodes
|
4275 |
+
if ( node.nodeType !== 8 ) {
|
4276 |
+
ret += getText( node );
|
4277 |
+
}
|
4278 |
+
}
|
4279 |
+
}
|
4280 |
+
return ret;
|
4281 |
+
};
|
4282 |
+
|
4283 |
+
var Expr = Sizzle.selectors = {
|
4284 |
+
order: [ "ID", "NAME", "TAG" ],
|
4285 |
+
|
4286 |
+
match: {
|
4287 |
+
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
4288 |
+
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
4289 |
+
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
|
4290 |
+
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
|
4291 |
+
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
|
4292 |
+
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
|
4293 |
+
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
|
4294 |
+
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
|
4295 |
+
},
|
4296 |
+
|
4297 |
+
leftMatch: {},
|
4298 |
+
|
4299 |
+
attrMap: {
|
4300 |
+
"class": "className",
|
4301 |
+
"for": "htmlFor"
|
4302 |
+
},
|
4303 |
+
|
4304 |
+
attrHandle: {
|
4305 |
+
href: function( elem ) {
|
4306 |
+
return elem.getAttribute( "href" );
|
4307 |
+
},
|
4308 |
+
type: function( elem ) {
|
4309 |
+
return elem.getAttribute( "type" );
|
4310 |
+
}
|
4311 |
+
},
|
4312 |
+
|
4313 |
+
relative: {
|
4314 |
+
"+": function(checkSet, part){
|
4315 |
+
var isPartStr = typeof part === "string",
|
4316 |
+
isTag = isPartStr && !rNonWord.test( part ),
|
4317 |
+
isPartStrNotTag = isPartStr && !isTag;
|
4318 |
+
|
4319 |
+
if ( isTag ) {
|
4320 |
+
part = part.toLowerCase();
|
4321 |
+
}
|
4322 |
+
|
4323 |
+
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
|
4324 |
+
if ( (elem = checkSet[i]) ) {
|
4325 |
+
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
|
4326 |
+
|
4327 |
+
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
|
4328 |
+
elem || false :
|
4329 |
+
elem === part;
|
4330 |
+
}
|
4331 |
+
}
|
4332 |
+
|
4333 |
+
if ( isPartStrNotTag ) {
|
4334 |
+
Sizzle.filter( part, checkSet, true );
|
4335 |
+
}
|
4336 |
+
},
|
4337 |
+
|
4338 |
+
">": function( checkSet, part ) {
|
4339 |
+
var elem,
|
4340 |
+
isPartStr = typeof part === "string",
|
4341 |
+
i = 0,
|
4342 |
+
l = checkSet.length;
|
4343 |
+
|
4344 |
+
if ( isPartStr && !rNonWord.test( part ) ) {
|
4345 |
+
part = part.toLowerCase();
|
4346 |
+
|
4347 |
+
for ( ; i < l; i++ ) {
|
4348 |
+
elem = checkSet[i];
|
4349 |
+
|
4350 |
+
if ( elem ) {
|
4351 |
+
var parent = elem.parentNode;
|
4352 |
+
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
|
4353 |
+
}
|
4354 |
+
}
|
4355 |
+
|
4356 |
+
} else {
|
4357 |
+
for ( ; i < l; i++ ) {
|
4358 |
+
elem = checkSet[i];
|
4359 |
+
|
4360 |
+
if ( elem ) {
|
4361 |
+
checkSet[i] = isPartStr ?
|
4362 |
+
elem.parentNode :
|
4363 |
+
elem.parentNode === part;
|
4364 |
+
}
|
4365 |
+
}
|
4366 |
+
|
4367 |
+
if ( isPartStr ) {
|
4368 |
+
Sizzle.filter( part, checkSet, true );
|
4369 |
+
}
|
4370 |
+
}
|
4371 |
+
},
|
4372 |
+
|
4373 |
+
"": function(checkSet, part, isXML){
|
4374 |
+
var nodeCheck,
|
4375 |
+
doneName = done++,
|
4376 |
+
checkFn = dirCheck;
|
4377 |
+
|
4378 |
+
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
4379 |
+
part = part.toLowerCase();
|
4380 |
+
nodeCheck = part;
|
4381 |
+
checkFn = dirNodeCheck;
|
4382 |
+
}
|
4383 |
+
|
4384 |
+
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
|
4385 |
+
},
|
4386 |
+
|
4387 |
+
"~": function( checkSet, part, isXML ) {
|
4388 |
+
var nodeCheck,
|
4389 |
+
doneName = done++,
|
4390 |
+
checkFn = dirCheck;
|
4391 |
+
|
4392 |
+
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
4393 |
+
part = part.toLowerCase();
|
4394 |
+
nodeCheck = part;
|
4395 |
+
checkFn = dirNodeCheck;
|
4396 |
+
}
|
4397 |
+
|
4398 |
+
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
|
4399 |
+
}
|
4400 |
+
},
|
4401 |
+
|
4402 |
+
find: {
|
4403 |
+
ID: function( match, context, isXML ) {
|
4404 |
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4405 |
+
var m = context.getElementById(match[1]);
|
4406 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
4407 |
+
// nodes that are no longer in the document #6963
|
4408 |
+
return m && m.parentNode ? [m] : [];
|
4409 |
+
}
|
4410 |
+
},
|
4411 |
+
|
4412 |
+
NAME: function( match, context ) {
|
4413 |
+
if ( typeof context.getElementsByName !== "undefined" ) {
|
4414 |
+
var ret = [],
|
4415 |
+
results = context.getElementsByName( match[1] );
|
4416 |
+
|
4417 |
+
for ( var i = 0, l = results.length; i < l; i++ ) {
|
4418 |
+
if ( results[i].getAttribute("name") === match[1] ) {
|
4419 |
+
ret.push( results[i] );
|
4420 |
+
}
|
4421 |
+
}
|
4422 |
+
|
4423 |
+
return ret.length === 0 ? null : ret;
|
4424 |
+
}
|
4425 |
+
},
|
4426 |
+
|
4427 |
+
TAG: function( match, context ) {
|
4428 |
+
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
4429 |
+
return context.getElementsByTagName( match[1] );
|
4430 |
+
}
|
4431 |
+
}
|
4432 |
+
},
|
4433 |
+
preFilter: {
|
4434 |
+
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
|
4435 |
+
match = " " + match[1].replace( rBackslash, "" ) + " ";
|
4436 |
+
|
4437 |
+
if ( isXML ) {
|
4438 |
+
return match;
|
4439 |
+
}
|
4440 |
+
|
4441 |
+
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
|
4442 |
+
if ( elem ) {
|
4443 |
+
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
|
4444 |
+
if ( !inplace ) {
|
4445 |
+
result.push( elem );
|
4446 |
+
}
|
4447 |
+
|
4448 |
+
} else if ( inplace ) {
|
4449 |
+
curLoop[i] = false;
|
4450 |
+
}
|
4451 |
+
}
|
4452 |
+
}
|
4453 |
+
|
4454 |
+
return false;
|
4455 |
+
},
|
4456 |
+
|
4457 |
+
ID: function( match ) {
|
4458 |
+
return match[1].replace( rBackslash, "" );
|
4459 |
+
},
|
4460 |
+
|
4461 |
+
TAG: function( match, curLoop ) {
|
4462 |
+
return match[1].replace( rBackslash, "" ).toLowerCase();
|
4463 |
+
},
|
4464 |
+
|
4465 |
+
CHILD: function( match ) {
|
4466 |
+
if ( match[1] === "nth" ) {
|
4467 |
+
if ( !match[2] ) {
|
4468 |
+
Sizzle.error( match[0] );
|
4469 |
+
}
|
4470 |
+
|
4471 |
+
match[2] = match[2].replace(/^\+|\s*/g, '');
|
4472 |
+
|
4473 |
+
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
|
4474 |
+
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
|
4475 |
+
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
|
4476 |
+
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
|
4477 |
+
|
4478 |
+
// calculate the numbers (first)n+(last) including if they are negative
|
4479 |
+
match[2] = (test[1] + (test[2] || 1)) - 0;
|
4480 |
+
match[3] = test[3] - 0;
|
4481 |
+
}
|
4482 |
+
else if ( match[2] ) {
|
4483 |
+
Sizzle.error( match[0] );
|
4484 |
+
}
|
4485 |
+
|
4486 |
+
// TODO: Move to normal caching system
|
4487 |
+
match[0] = done++;
|
4488 |
+
|
4489 |
+
return match;
|
4490 |
+
},
|
4491 |
+
|
4492 |
+
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
|
4493 |
+
var name = match[1] = match[1].replace( rBackslash, "" );
|
4494 |
+
|
4495 |
+
if ( !isXML && Expr.attrMap[name] ) {
|
4496 |
+
match[1] = Expr.attrMap[name];
|
4497 |
+
}
|
4498 |
+
|
4499 |
+
// Handle if an un-quoted value was used
|
4500 |
+
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
|
4501 |
+
|
4502 |
+
if ( match[2] === "~=" ) {
|
4503 |
+
match[4] = " " + match[4] + " ";
|
4504 |
+
}
|
4505 |
+
|
4506 |
+
return match;
|
4507 |
+
},
|
4508 |
+
|
4509 |
+
PSEUDO: function( match, curLoop, inplace, result, not ) {
|
4510 |
+
if ( match[1] === "not" ) {
|
4511 |
+
// If we're dealing with a complex expression, or a simple one
|
4512 |
+
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
|
4513 |
+
match[3] = Sizzle(match[3], null, null, curLoop);
|
4514 |
+
|
4515 |
+
} else {
|
4516 |
+
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
|
4517 |
+
|
4518 |
+
if ( !inplace ) {
|
4519 |
+
result.push.apply( result, ret );
|
4520 |
+
}
|
4521 |
+
|
4522 |
+
return false;
|
4523 |
+
}
|
4524 |
+
|
4525 |
+
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
4526 |
+
return true;
|
4527 |
+
}
|
4528 |
+
|
4529 |
+
return match;
|
4530 |
+
},
|
4531 |
+
|
4532 |
+
POS: function( match ) {
|
4533 |
+
match.unshift( true );
|
4534 |
+
|
4535 |
+
return match;
|
4536 |
+
}
|
4537 |
+
},
|
4538 |
+
|
4539 |
+
filters: {
|
4540 |
+
enabled: function( elem ) {
|
4541 |
+
return elem.disabled === false && elem.type !== "hidden";
|
4542 |
+
},
|
4543 |
+
|
4544 |
+
disabled: function( elem ) {
|
4545 |
+
return elem.disabled === true;
|
4546 |
+
},
|
4547 |
+
|
4548 |
+
checked: function( elem ) {
|
4549 |
+
return elem.checked === true;
|
4550 |
+
},
|
4551 |
+
|
4552 |
+
selected: function( elem ) {
|
4553 |
+
// Accessing this property makes selected-by-default
|
4554 |
+
// options in Safari work properly
|
4555 |
+
if ( elem.parentNode ) {
|
4556 |
+
elem.parentNode.selectedIndex;
|
4557 |
+
}
|
4558 |
+
|
4559 |
+
return elem.selected === true;
|
4560 |
+
},
|
4561 |
+
|
4562 |
+
parent: function( elem ) {
|
4563 |
+
return !!elem.firstChild;
|
4564 |
+
},
|
4565 |
+
|
4566 |
+
empty: function( elem ) {
|
4567 |
+
return !elem.firstChild;
|
4568 |
+
},
|
4569 |
+
|
4570 |
+
has: function( elem, i, match ) {
|
4571 |
+
return !!Sizzle( match[3], elem ).length;
|
4572 |
+
},
|
4573 |
+
|
4574 |
+
header: function( elem ) {
|
4575 |
+
return (/h\d/i).test( elem.nodeName );
|
4576 |
+
},
|
4577 |
+
|
4578 |
+
text: function( elem ) {
|
4579 |
+
var attr = elem.getAttribute( "type" ), type = elem.type;
|
4580 |
+
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
|
4581 |
+
// use getAttribute instead to test this case
|
4582 |
+
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
|
4583 |
+
},
|
4584 |
+
|
4585 |
+
radio: function( elem ) {
|
4586 |
+
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
|
4587 |
+
},
|
4588 |
+
|
4589 |
+
checkbox: function( elem ) {
|
4590 |
+
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
|
4591 |
+
},
|
4592 |
+
|
4593 |
+
file: function( elem ) {
|
4594 |
+
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
|
4595 |
+
},
|
4596 |
+
|
4597 |
+
password: function( elem ) {
|
4598 |
+
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
|
4599 |
+
},
|
4600 |
+
|
4601 |
+
submit: function( elem ) {
|
4602 |
+
var name = elem.nodeName.toLowerCase();
|
4603 |
+
return (name === "input" || name === "button") && "submit" === elem.type;
|
4604 |
+
},
|
4605 |
+
|
4606 |
+
image: function( elem ) {
|
4607 |
+
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
|
4608 |
+
},
|
4609 |
+
|
4610 |
+
reset: function( elem ) {
|
4611 |
+
var name = elem.nodeName.toLowerCase();
|
4612 |
+
return (name === "input" || name === "button") && "reset" === elem.type;
|
4613 |
+
},
|
4614 |
+
|
4615 |
+
button: function( elem ) {
|
4616 |
+
var name = elem.nodeName.toLowerCase();
|
4617 |
+
return name === "input" && "button" === elem.type || name === "button";
|
4618 |
+
},
|
4619 |
+
|
4620 |
+
input: function( elem ) {
|
4621 |
+
return (/input|select|textarea|button/i).test( elem.nodeName );
|
4622 |
+
},
|
4623 |
+
|
4624 |
+
focus: function( elem ) {
|
4625 |
+
return elem === elem.ownerDocument.activeElement;
|
4626 |
+
}
|
4627 |
+
},
|
4628 |
+
setFilters: {
|
4629 |
+
first: function( elem, i ) {
|
4630 |
+
return i === 0;
|
4631 |
+
},
|
4632 |
+
|
4633 |
+
last: function( elem, i, match, array ) {
|
4634 |
+
return i === array.length - 1;
|
4635 |
+
},
|
4636 |
+
|
4637 |
+
even: function( elem, i ) {
|
4638 |
+
return i % 2 === 0;
|
4639 |
+
},
|
4640 |
+
|
4641 |
+
odd: function( elem, i ) {
|
4642 |
+
return i % 2 === 1;
|
4643 |
+
},
|
4644 |
+
|
4645 |
+
lt: function( elem, i, match ) {
|
4646 |
+
return i < match[3] - 0;
|
4647 |
+
},
|
4648 |
+
|
4649 |
+
gt: function( elem, i, match ) {
|
4650 |
+
return i > match[3] - 0;
|
4651 |
+
},
|
4652 |
+
|
4653 |
+
nth: function( elem, i, match ) {
|
4654 |
+
return match[3] - 0 === i;
|
4655 |
+
},
|
4656 |
+
|
4657 |
+
eq: function( elem, i, match ) {
|
4658 |
+
return match[3] - 0 === i;
|
4659 |
+
}
|
4660 |
+
},
|
4661 |
+
filter: {
|
4662 |
+
PSEUDO: function( elem, match, i, array ) {
|
4663 |
+
var name = match[1],
|
4664 |
+
filter = Expr.filters[ name ];
|
4665 |
+
|
4666 |
+
if ( filter ) {
|
4667 |
+
return filter( elem, i, match, array );
|
4668 |
+
|
4669 |
+
} else if ( name === "contains" ) {
|
4670 |
+
return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
|
4671 |
+
|
4672 |
+
} else if ( name === "not" ) {
|
4673 |
+
var not = match[3];
|
4674 |
+
|
4675 |
+
for ( var j = 0, l = not.length; j < l; j++ ) {
|
4676 |
+
if ( not[j] === elem ) {
|
4677 |
+
return false;
|
4678 |
+
}
|
4679 |
+
}
|
4680 |
+
|
4681 |
+
return true;
|
4682 |
+
|
4683 |
+
} else {
|
4684 |
+
Sizzle.error( name );
|
4685 |
+
}
|
4686 |
+
},
|
4687 |
+
|
4688 |
+
CHILD: function( elem, match ) {
|
4689 |
+
var first, last,
|
4690 |
+
doneName, parent, cache,
|
4691 |
+
count, diff,
|
4692 |
+
type = match[1],
|
4693 |
+
node = elem;
|
4694 |
+
|
4695 |
+
switch ( type ) {
|
4696 |
+
case "only":
|
4697 |
+
case "first":
|
4698 |
+
while ( (node = node.previousSibling) ) {
|
4699 |
+
if ( node.nodeType === 1 ) {
|
4700 |
+
return false;
|
4701 |
+
}
|
4702 |
+
}
|
4703 |
+
|
4704 |
+
if ( type === "first" ) {
|
4705 |
+
return true;
|
4706 |
+
}
|
4707 |
+
|
4708 |
+
node = elem;
|
4709 |
+
|
4710 |
+
case "last":
|
4711 |
+
while ( (node = node.nextSibling) ) {
|
4712 |
+
if ( node.nodeType === 1 ) {
|
4713 |
+
return false;
|
4714 |
+
}
|
4715 |
+
}
|
4716 |
+
|
4717 |
+
return true;
|
4718 |
+
|
4719 |
+
case "nth":
|
4720 |
+
first = match[2];
|
4721 |
+
last = match[3];
|
4722 |
+
|
4723 |
+
if ( first === 1 && last === 0 ) {
|
4724 |
+
return true;
|
4725 |
+
}
|
4726 |
+
|
4727 |
+
doneName = match[0];
|
4728 |
+
parent = elem.parentNode;
|
4729 |
+
|
4730 |
+
if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
|
4731 |
+
count = 0;
|
4732 |
+
|
4733 |
+
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
4734 |
+
if ( node.nodeType === 1 ) {
|
4735 |
+
node.nodeIndex = ++count;
|
4736 |
+
}
|
4737 |
+
}
|
4738 |
+
|
4739 |
+
parent[ expando ] = doneName;
|
4740 |
+
}
|
4741 |
+
|
4742 |
+
diff = elem.nodeIndex - last;
|
4743 |
+
|
4744 |
+
if ( first === 0 ) {
|
4745 |
+
return diff === 0;
|
4746 |
+
|
4747 |
+
} else {
|
4748 |
+
return ( diff % first === 0 && diff / first >= 0 );
|
4749 |
+
}
|
4750 |
+
}
|
4751 |
+
},
|
4752 |
+
|
4753 |
+
ID: function( elem, match ) {
|
4754 |
+
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
4755 |
+
},
|
4756 |
+
|
4757 |
+
TAG: function( elem, match ) {
|
4758 |
+
return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
|
4759 |
+
},
|
4760 |
+
|
4761 |
+
CLASS: function( elem, match ) {
|
4762 |
+
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
4763 |
+
.indexOf( match ) > -1;
|
4764 |
+
},
|
4765 |
+
|
4766 |
+
ATTR: function( elem, match ) {
|
4767 |
+
var name = match[1],
|
4768 |
+
result = Sizzle.attr ?
|
4769 |
+
Sizzle.attr( elem, name ) :
|
4770 |
+
Expr.attrHandle[ name ] ?
|
4771 |
+
Expr.attrHandle[ name ]( elem ) :
|
4772 |
+
elem[ name ] != null ?
|
4773 |
+
elem[ name ] :
|
4774 |
+
elem.getAttribute( name ),
|
4775 |
+
value = result + "",
|
4776 |
+
type = match[2],
|
4777 |
+
check = match[4];
|
4778 |
+
|
4779 |
+
return result == null ?
|
4780 |
+
type === "!=" :
|
4781 |
+
!type && Sizzle.attr ?
|
4782 |
+
result != null :
|
4783 |
+
type === "=" ?
|
4784 |
+
value === check :
|
4785 |
+
type === "*=" ?
|
4786 |
+
value.indexOf(check) >= 0 :
|
4787 |
+
type === "~=" ?
|
4788 |
+
(" " + value + " ").indexOf(check) >= 0 :
|
4789 |
+
!check ?
|
4790 |
+
value && result !== false :
|
4791 |
+
type === "!=" ?
|
4792 |
+
value !== check :
|
4793 |
+
type === "^=" ?
|
4794 |
+
value.indexOf(check) === 0 :
|
4795 |
+
type === "$=" ?
|
4796 |
+
value.substr(value.length - check.length) === check :
|
4797 |
+
type === "|=" ?
|
4798 |
+
value === check || value.substr(0, check.length + 1) === check + "-" :
|
4799 |
+
false;
|
4800 |
+
},
|
4801 |
+
|
4802 |
+
POS: function( elem, match, i, array ) {
|
4803 |
+
var name = match[2],
|
4804 |
+
filter = Expr.setFilters[ name ];
|
4805 |
+
|
4806 |
+
if ( filter ) {
|
4807 |
+
return filter( elem, i, match, array );
|
4808 |
+
}
|
4809 |
+
}
|
4810 |
+
}
|
4811 |
+
};
|
4812 |
+
|
4813 |
+
var origPOS = Expr.match.POS,
|
4814 |
+
fescape = function(all, num){
|
4815 |
+
return "\\" + (num - 0 + 1);
|
4816 |
+
};
|
4817 |
+
|
4818 |
+
for ( var type in Expr.match ) {
|
4819 |
+
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
|
4820 |
+
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
|
4821 |
+
}
|
4822 |
+
|
4823 |
+
var makeArray = function( array, results ) {
|
4824 |
+
array = Array.prototype.slice.call( array, 0 );
|
4825 |
+
|
4826 |
+
if ( results ) {
|
4827 |
+
results.push.apply( results, array );
|
4828 |
+
return results;
|
4829 |
+
}
|
4830 |
+
|
4831 |
+
return array;
|
4832 |
+
};
|
4833 |
+
|
4834 |
+
// Perform a simple check to determine if the browser is capable of
|
4835 |
+
// converting a NodeList to an array using builtin methods.
|
4836 |
+
// Also verifies that the returned array holds DOM nodes
|
4837 |
+
// (which is not the case in the Blackberry browser)
|
4838 |
+
try {
|
4839 |
+
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
|
4840 |
+
|
4841 |
+
// Provide a fallback method if it does not work
|
4842 |
+
} catch( e ) {
|
4843 |
+
makeArray = function( array, results ) {
|
4844 |
+
var i = 0,
|
4845 |
+
ret = results || [];
|
4846 |
+
|
4847 |
+
if ( toString.call(array) === "[object Array]" ) {
|
4848 |
+
Array.prototype.push.apply( ret, array );
|
4849 |
+
|
4850 |
+
} else {
|
4851 |
+
if ( typeof array.length === "number" ) {
|
4852 |
+
for ( var l = array.length; i < l; i++ ) {
|
4853 |
+
ret.push( array[i] );
|
4854 |
+
}
|
4855 |
+
|
4856 |
+
} else {
|
4857 |
+
for ( ; array[i]; i++ ) {
|
4858 |
+
ret.push( array[i] );
|
4859 |
+
}
|
4860 |
+
}
|
4861 |
+
}
|
4862 |
+
|
4863 |
+
return ret;
|
4864 |
+
};
|
4865 |
+
}
|
4866 |
+
|
4867 |
+
var sortOrder, siblingCheck;
|
4868 |
+
|
4869 |
+
if ( document.documentElement.compareDocumentPosition ) {
|
4870 |
+
sortOrder = function( a, b ) {
|
4871 |
+
if ( a === b ) {
|
4872 |
+
hasDuplicate = true;
|
4873 |
+
return 0;
|
4874 |
+
}
|
4875 |
+
|
4876 |
+
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
|
4877 |
+
return a.compareDocumentPosition ? -1 : 1;
|
4878 |
+
}
|
4879 |
+
|
4880 |
+
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
|
4881 |
+
};
|
4882 |
+
|
4883 |
+
} else {
|
4884 |
+
sortOrder = function( a, b ) {
|
4885 |
+
// The nodes are identical, we can exit early
|
4886 |
+
if ( a === b ) {
|
4887 |
+
hasDuplicate = true;
|
4888 |
+
return 0;
|
4889 |
+
|
4890 |
+
// Fallback to using sourceIndex (in IE) if it's available on both nodes
|
4891 |
+
} else if ( a.sourceIndex && b.sourceIndex ) {
|
4892 |
+
return a.sourceIndex - b.sourceIndex;
|
4893 |
+
}
|
4894 |
+
|
4895 |
+
var al, bl,
|
4896 |
+
ap = [],
|
4897 |
+
bp = [],
|
4898 |
+
aup = a.parentNode,
|
4899 |
+
bup = b.parentNode,
|
4900 |
+
cur = aup;
|
4901 |
+
|
4902 |
+
// If the nodes are siblings (or identical) we can do a quick check
|
4903 |
+
if ( aup === bup ) {
|
4904 |
+
return siblingCheck( a, b );
|
4905 |
+
|
4906 |
+
// If no parents were found then the nodes are disconnected
|
4907 |
+
} else if ( !aup ) {
|
4908 |
+
return -1;
|
4909 |
+
|
4910 |
+
} else if ( !bup ) {
|
4911 |
+
return 1;
|
4912 |
+
}
|
4913 |
+
|
4914 |
+
// Otherwise they're somewhere else in the tree so we need
|
4915 |
+
// to build up a full list of the parentNodes for comparison
|
4916 |
+
while ( cur ) {
|
4917 |
+
ap.unshift( cur );
|
4918 |
+
cur = cur.parentNode;
|
4919 |
+
}
|
4920 |
+
|
4921 |
+
cur = bup;
|
4922 |
+
|
4923 |
+
while ( cur ) {
|
4924 |
+
bp.unshift( cur );
|
4925 |
+
cur = cur.parentNode;
|
4926 |
+
}
|
4927 |
+
|
4928 |
+
al = ap.length;
|
4929 |
+
bl = bp.length;
|
4930 |
+
|
4931 |
+
// Start walking down the tree looking for a discrepancy
|
4932 |
+
for ( var i = 0; i < al && i < bl; i++ ) {
|
4933 |
+
if ( ap[i] !== bp[i] ) {
|
4934 |
+
return siblingCheck( ap[i], bp[i] );
|
4935 |
+
}
|
4936 |
+
}
|
4937 |
+
|
4938 |
+
// We ended someplace up the tree so do a sibling check
|
4939 |
+
return i === al ?
|
4940 |
+
siblingCheck( a, bp[i], -1 ) :
|
4941 |
+
siblingCheck( ap[i], b, 1 );
|
4942 |
+
};
|
4943 |
+
|
4944 |
+
siblingCheck = function( a, b, ret ) {
|
4945 |
+
if ( a === b ) {
|
4946 |
+
return ret;
|
4947 |
+
}
|
4948 |
+
|
4949 |
+
var cur = a.nextSibling;
|
4950 |
+
|
4951 |
+
while ( cur ) {
|
4952 |
+
if ( cur === b ) {
|
4953 |
+
return -1;
|
4954 |
+
}
|
4955 |
+
|
4956 |
+
cur = cur.nextSibling;
|
4957 |
+
}
|
4958 |
+
|
4959 |
+
return 1;
|
4960 |
+
};
|
4961 |
+
}
|
4962 |
+
|
4963 |
+
// Check to see if the browser returns elements by name when
|
4964 |
+
// querying by getElementById (and provide a workaround)
|
4965 |
+
(function(){
|
4966 |
+
// We're going to inject a fake input element with a specified name
|
4967 |
+
var form = document.createElement("div"),
|
4968 |
+
id = "script" + (new Date()).getTime(),
|
4969 |
+
root = document.documentElement;
|
4970 |
+
|
4971 |
+
form.innerHTML = "<a name='" + id + "'/>";
|
4972 |
+
|
4973 |
+
// Inject it into the root element, check its status, and remove it quickly
|
4974 |
+
root.insertBefore( form, root.firstChild );
|
4975 |
+
|
4976 |
+
// The workaround has to do additional checks after a getElementById
|
4977 |
+
// Which slows things down for other browsers (hence the branching)
|
4978 |
+
if ( document.getElementById( id ) ) {
|
4979 |
+
Expr.find.ID = function( match, context, isXML ) {
|
4980 |
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4981 |
+
var m = context.getElementById(match[1]);
|
4982 |
+
|
4983 |
+
return m ?
|
4984 |
+
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
|
4985 |
+
[m] :
|
4986 |
+
undefined :
|
4987 |
+
[];
|
4988 |
+
}
|
4989 |
+
};
|
4990 |
+
|
4991 |
+
Expr.filter.ID = function( elem, match ) {
|
4992 |
+
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
4993 |
+
|
4994 |
+
return elem.nodeType === 1 && node && node.nodeValue === match;
|
4995 |
+
};
|
4996 |
+
}
|
4997 |
+
|
4998 |
+
root.removeChild( form );
|
4999 |
+
|
5000 |
+
// release memory in IE
|
5001 |
+
root = form = null;
|
5002 |
+
})();
|
5003 |
+
|
5004 |
+
(function(){
|
5005 |
+
// Check to see if the browser returns only elements
|
5006 |
+
// when doing getElementsByTagName("*")
|
5007 |
+
|
5008 |
+
// Create a fake element
|
5009 |
+
var div = document.createElement("div");
|
5010 |
+
div.appendChild( document.createComment("") );
|
5011 |
+
|
5012 |
+
// Make sure no comments are found
|
5013 |
+
if ( div.getElementsByTagName("*").length > 0 ) {
|
5014 |
+
Expr.find.TAG = function( match, context ) {
|
5015 |
+
var results = context.getElementsByTagName( match[1] );
|
5016 |
+
|
5017 |
+
// Filter out possible comments
|
5018 |
+
if ( match[1] === "*" ) {
|
5019 |
+
var tmp = [];
|
5020 |
+
|
5021 |
+
for ( var i = 0; results[i]; i++ ) {
|
5022 |
+
if ( results[i].nodeType === 1 ) {
|
5023 |
+
tmp.push( results[i] );
|
5024 |
+
}
|
5025 |
+
}
|
5026 |
+
|
5027 |
+
results = tmp;
|
5028 |
+
}
|
5029 |
+
|
5030 |
+
return results;
|
5031 |
+
};
|
5032 |
+
}
|
5033 |
+
|
5034 |
+
// Check to see if an attribute returns normalized href attributes
|
5035 |
+
div.innerHTML = "<a href='#'></a>";
|
5036 |
+
|
5037 |
+
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
|
5038 |
+
div.firstChild.getAttribute("href") !== "#" ) {
|
5039 |
+
|
5040 |
+
Expr.attrHandle.href = function( elem ) {
|
5041 |
+
return elem.getAttribute( "href", 2 );
|
5042 |
+
};
|
5043 |
+
}
|
5044 |
+
|
5045 |
+
// release memory in IE
|
5046 |
+
div = null;
|
5047 |
+
})();
|
5048 |
+
|
5049 |
+
if ( document.querySelectorAll ) {
|
5050 |
+
(function(){
|
5051 |
+
var oldSizzle = Sizzle,
|
5052 |
+
div = document.createElement("div"),
|
5053 |
+
id = "__sizzle__";
|
5054 |
+
|
5055 |
+
div.innerHTML = "<p class='TEST'></p>";
|
5056 |
+
|
5057 |
+
// Safari can't handle uppercase or unicode characters when
|
5058 |
+
// in quirks mode.
|
5059 |
+
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
|
5060 |
+
return;
|
5061 |
+
}
|
5062 |
+
|
5063 |
+
Sizzle = function( query, context, extra, seed ) {
|
5064 |
+
context = context || document;
|
5065 |
+
|
5066 |
+
// Only use querySelectorAll on non-XML documents
|
5067 |
+
// (ID selectors don't work in non-HTML documents)
|
5068 |
+
if ( !seed && !Sizzle.isXML(context) ) {
|
5069 |
+
// See if we find a selector to speed up
|
5070 |
+
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
|
5071 |
+
|
5072 |
+
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
|
5073 |
+
// Speed-up: Sizzle("TAG")
|
5074 |
+
if ( match[1] ) {
|
5075 |
+
return makeArray( context.getElementsByTagName( query ), extra );
|
5076 |
+
|
5077 |
+
// Speed-up: Sizzle(".CLASS")
|
5078 |
+
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
|
5079 |
+
return makeArray( context.getElementsByClassName( match[2] ), extra );
|
5080 |
+
}
|
5081 |
+
}
|
5082 |
+
|
5083 |
+
if ( context.nodeType === 9 ) {
|
5084 |
+
// Speed-up: Sizzle("body")
|
5085 |
+
// The body element only exists once, optimize finding it
|
5086 |
+
if ( query === "body" && context.body ) {
|
5087 |
+
return makeArray( [ context.body ], extra );
|
5088 |
+
|
5089 |
+
// Speed-up: Sizzle("#ID")
|
5090 |
+
} else if ( match && match[3] ) {
|
5091 |
+
var elem = context.getElementById( match[3] );
|
5092 |
+
|
5093 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
5094 |
+
// nodes that are no longer in the document #6963
|
5095 |
+
if ( elem && elem.parentNode ) {
|
5096 |
+
// Handle the case where IE and Opera return items
|
5097 |
+
// by name instead of ID
|
5098 |
+
if ( elem.id === match[3] ) {
|
5099 |
+
return makeArray( [ elem ], extra );
|
5100 |
+
}
|
5101 |
+
|
5102 |
+
} else {
|
5103 |
+
return makeArray( [], extra );
|
5104 |
+
}
|
5105 |
+
}
|
5106 |
+
|
5107 |
+
try {
|
5108 |
+
return makeArray( context.querySelectorAll(query), extra );
|
5109 |
+
} catch(qsaError) {}
|
5110 |
+
|
5111 |
+
// qSA works strangely on Element-rooted queries
|
5112 |
+
// We can work around this by specifying an extra ID on the root
|
5113 |
+
// and working up from there (Thanks to Andrew Dupont for the technique)
|
5114 |
+
// IE 8 doesn't work on object elements
|
5115 |
+
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
5116 |
+
var oldContext = context,
|
5117 |
+
old = context.getAttribute( "id" ),
|
5118 |
+
nid = old || id,
|
5119 |
+
hasParent = context.parentNode,
|
5120 |
+
relativeHierarchySelector = /^\s*[+~]/.test( query );
|
5121 |
+
|
5122 |
+
if ( !old ) {
|
5123 |
+
context.setAttribute( "id", nid );
|
5124 |
+
} else {
|
5125 |
+
nid = nid.replace( /'/g, "\\$&" );
|
5126 |
+
}
|
5127 |
+
if ( relativeHierarchySelector && hasParent ) {
|
5128 |
+
context = context.parentNode;
|
5129 |
+
}
|
5130 |
+
|
5131 |
+
try {
|
5132 |
+
if ( !relativeHierarchySelector || hasParent ) {
|
5133 |
+
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
|
5134 |
+
}
|
5135 |
+
|
5136 |
+
} catch(pseudoError) {
|
5137 |
+
} finally {
|
5138 |
+
if ( !old ) {
|
5139 |
+
oldContext.removeAttribute( "id" );
|
5140 |
+
}
|
5141 |
+
}
|
5142 |
+
}
|
5143 |
+
}
|
5144 |
+
|
5145 |
+
return oldSizzle(query, context, extra, seed);
|
5146 |
+
};
|
5147 |
+
|
5148 |
+
for ( var prop in oldSizzle ) {
|
5149 |
+
Sizzle[ prop ] = oldSizzle[ prop ];
|
5150 |
+
}
|
5151 |
+
|
5152 |
+
// release memory in IE
|
5153 |
+
div = null;
|
5154 |
+
})();
|
5155 |
+
}
|
5156 |
+
|
5157 |
+
(function(){
|
5158 |
+
var html = document.documentElement,
|
5159 |
+
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
|
5160 |
+
|
5161 |
+
if ( matches ) {
|
5162 |
+
// Check to see if it's possible to do matchesSelector
|
5163 |
+
// on a disconnected node (IE 9 fails this)
|
5164 |
+
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
|
5165 |
+
pseudoWorks = false;
|
5166 |
+
|
5167 |
+
try {
|
5168 |
+
// This should fail with an exception
|
5169 |
+
// Gecko does not error, returns false instead
|
5170 |
+
matches.call( document.documentElement, "[test!='']:sizzle" );
|
5171 |
+
|
5172 |
+
} catch( pseudoError ) {
|
5173 |
+
pseudoWorks = true;
|
5174 |
+
}
|
5175 |
+
|
5176 |
+
Sizzle.matchesSelector = function( node, expr ) {
|
5177 |
+
// Make sure that attribute selectors are quoted
|
5178 |
+
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
|
5179 |
+
|
5180 |
+
if ( !Sizzle.isXML( node ) ) {
|
5181 |
+
try {
|
5182 |
+
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
|
5183 |
+
var ret = matches.call( node, expr );
|
5184 |
+
|
5185 |
+
// IE 9's matchesSelector returns false on disconnected nodes
|
5186 |
+
if ( ret || !disconnectedMatch ||
|
5187 |
+
// As well, disconnected nodes are said to be in a document
|
5188 |
+
// fragment in IE 9, so check for that
|
5189 |
+
node.document && node.document.nodeType !== 11 ) {
|
5190 |
+
return ret;
|
5191 |
+
}
|
5192 |
+
}
|
5193 |
+
} catch(e) {}
|
5194 |
+
}
|
5195 |
+
|
5196 |
+
return Sizzle(expr, null, null, [node]).length > 0;
|
5197 |
+
};
|
5198 |
+
}
|
5199 |
+
})();
|
5200 |
+
|
5201 |
+
(function(){
|
5202 |
+
var div = document.createElement("div");
|
5203 |
+
|
5204 |
+
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
|
5205 |
+
|
5206 |
+
// Opera can't find a second classname (in 9.6)
|
5207 |
+
// Also, make sure that getElementsByClassName actually exists
|
5208 |
+
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
|
5209 |
+
return;
|
5210 |
+
}
|
5211 |
+
|
5212 |
+
// Safari caches class attributes, doesn't catch changes (in 3.2)
|
5213 |
+
div.lastChild.className = "e";
|
5214 |
+
|
5215 |
+
if ( div.getElementsByClassName("e").length === 1 ) {
|
5216 |
+
return;
|
5217 |
+
}
|
5218 |
+
|
5219 |
+
Expr.order.splice(1, 0, "CLASS");
|
5220 |
+
Expr.find.CLASS = function( match, context, isXML ) {
|
5221 |
+
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
5222 |
+
return context.getElementsByClassName(match[1]);
|
5223 |
+
}
|
5224 |
+
};
|
5225 |
+
|
5226 |
+
// release memory in IE
|
5227 |
+
div = null;
|
5228 |
+
})();
|
5229 |
+
|
5230 |
+
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
5231 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
5232 |
+
var elem = checkSet[i];
|
5233 |
+
|
5234 |
+
if ( elem ) {
|
5235 |
+
var match = false;
|
5236 |
+
|
5237 |
+
elem = elem[dir];
|
5238 |
+
|
5239 |
+
while ( elem ) {
|
5240 |
+
if ( elem[ expando ] === doneName ) {
|
5241 |
+
match = checkSet[elem.sizset];
|
5242 |
+
break;
|
5243 |
+
}
|
5244 |
+
|
5245 |
+
if ( elem.nodeType === 1 && !isXML ){
|
5246 |
+
elem[ expando ] = doneName;
|
5247 |
+
elem.sizset = i;
|
5248 |
+
}
|
5249 |
+
|
5250 |
+
if ( elem.nodeName.toLowerCase() === cur ) {
|
5251 |
+
match = elem;
|
5252 |
+
break;
|
5253 |
+
}
|
5254 |
+
|
5255 |
+
elem = elem[dir];
|
5256 |
+
}
|
5257 |
+
|
5258 |
+
checkSet[i] = match;
|
5259 |
+
}
|
5260 |
+
}
|
5261 |
+
}
|
5262 |
+
|
5263 |
+
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
5264 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
5265 |
+
var elem = checkSet[i];
|
5266 |
+
|
5267 |
+
if ( elem ) {
|
5268 |
+
var match = false;
|
5269 |
+
|
5270 |
+
elem = elem[dir];
|
5271 |
+
|
5272 |
+
while ( elem ) {
|
5273 |
+
if ( elem[ expando ] === doneName ) {
|
5274 |
+
match = checkSet[elem.sizset];
|
5275 |
+
break;
|
5276 |
+
}
|
5277 |
+
|
5278 |
+
if ( elem.nodeType === 1 ) {
|
5279 |
+
if ( !isXML ) {
|
5280 |
+
elem[ expando ] = doneName;
|
5281 |
+
elem.sizset = i;
|
5282 |
+
}
|
5283 |
+
|
5284 |
+
if ( typeof cur !== "string" ) {
|
5285 |
+
if ( elem === cur ) {
|
5286 |
+
match = true;
|
5287 |
+
break;
|
5288 |
+
}
|
5289 |
+
|
5290 |
+
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
|
5291 |
+
match = elem;
|
5292 |
+
break;
|
5293 |
+
}
|
5294 |
+
}
|
5295 |
+
|
5296 |
+
elem = elem[dir];
|
5297 |
+
}
|
5298 |
+
|
5299 |
+
checkSet[i] = match;
|
5300 |
+
}
|
5301 |
+
}
|
5302 |
+
}
|
5303 |
+
|
5304 |
+
if ( document.documentElement.contains ) {
|
5305 |
+
Sizzle.contains = function( a, b ) {
|
5306 |
+
return a !== b && (a.contains ? a.contains(b) : true);
|
5307 |
+
};
|
5308 |
+
|
5309 |
+
} else if ( document.documentElement.compareDocumentPosition ) {
|
5310 |
+
Sizzle.contains = function( a, b ) {
|
5311 |
+
return !!(a.compareDocumentPosition(b) & 16);
|
5312 |
+
};
|
5313 |
+
|
5314 |
+
} else {
|
5315 |
+
Sizzle.contains = function() {
|
5316 |
+
return false;
|
5317 |
+
};
|
5318 |
+
}
|
5319 |
+
|
5320 |
+
Sizzle.isXML = function( elem ) {
|
5321 |
+
// documentElement is verified for cases where it doesn't yet exist
|
5322 |
+
// (such as loading iframes in IE - #4833)
|
5323 |
+
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
|
5324 |
+
|
5325 |
+
return documentElement ? documentElement.nodeName !== "HTML" : false;
|
5326 |
+
};
|
5327 |
+
|
5328 |
+
var posProcess = function( selector, context, seed ) {
|
5329 |
+
var match,
|
5330 |
+
tmpSet = [],
|
5331 |
+
later = "",
|
5332 |
+
root = context.nodeType ? [context] : context;
|
5333 |
+
|
5334 |
+
// Position selectors must be done after the filter
|
5335 |
+
// And so must :not(positional) so we move all PSEUDOs to the end
|
5336 |
+
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
|
5337 |
+
later += match[0];
|
5338 |
+
selector = selector.replace( Expr.match.PSEUDO, "" );
|
5339 |
+
}
|
5340 |
+
|
5341 |
+
selector = Expr.relative[selector] ? selector + "*" : selector;
|
5342 |
+
|
5343 |
+
for ( var i = 0, l = root.length; i < l; i++ ) {
|
5344 |
+
Sizzle( selector, root[i], tmpSet, seed );
|
5345 |
+
}
|
5346 |
+
|
5347 |
+
return Sizzle.filter( later, tmpSet );
|
5348 |
+
};
|
5349 |
+
|
5350 |
+
// EXPOSE
|
5351 |
+
// Override sizzle attribute retrieval
|
5352 |
+
Sizzle.attr = jQuery.attr;
|
5353 |
+
Sizzle.selectors.attrMap = {};
|
5354 |
+
jQuery.find = Sizzle;
|
5355 |
+
jQuery.expr = Sizzle.selectors;
|
5356 |
+
jQuery.expr[":"] = jQuery.expr.filters;
|
5357 |
+
jQuery.unique = Sizzle.uniqueSort;
|
5358 |
+
jQuery.text = Sizzle.getText;
|
5359 |
+
jQuery.isXMLDoc = Sizzle.isXML;
|
5360 |
+
jQuery.contains = Sizzle.contains;
|
5361 |
+
|
5362 |
+
|
5363 |
+
})();
|
5364 |
+
|
5365 |
+
|
5366 |
+
var runtil = /Until$/,
|
5367 |
+
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
|
5368 |
+
// Note: This RegExp should be improved, or likely pulled from Sizzle
|
5369 |
+
rmultiselector = /,/,
|
5370 |
+
isSimple = /^.[^:#\[\.,]*$/,
|
5371 |
+
slice = Array.prototype.slice,
|
5372 |
+
POS = jQuery.expr.match.POS,
|
5373 |
+
// methods guaranteed to produce a unique set when starting from a unique set
|
5374 |
+
guaranteedUnique = {
|
5375 |
+
children: true,
|
5376 |
+
contents: true,
|
5377 |
+
next: true,
|
5378 |
+
prev: true
|
5379 |
+
};
|
5380 |
+
|
5381 |
+
jQuery.fn.extend({
|
5382 |
+
find: function( selector ) {
|
5383 |
+
var self = this,
|
5384 |
+
i, l;
|
5385 |
+
|
5386 |
+
if ( typeof selector !== "string" ) {
|
5387 |
+
return jQuery( selector ).filter(function() {
|
5388 |
+
for ( i = 0, l = self.length; i < l; i++ ) {
|
5389 |
+
if ( jQuery.contains( self[ i ], this ) ) {
|
5390 |
+
return true;
|
5391 |
+
}
|
5392 |
+
}
|
5393 |
+
});
|
5394 |
+
}
|
5395 |
+
|
5396 |
+
var ret = this.pushStack( "", "find", selector ),
|
5397 |
+
length, n, r;
|
5398 |
+
|
5399 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
5400 |
+
length = ret.length;
|
5401 |
+
jQuery.find( selector, this[i], ret );
|
5402 |
+
|
5403 |
+
if ( i > 0 ) {
|
5404 |
+
// Make sure that the results are unique
|
5405 |
+
for ( n = length; n < ret.length; n++ ) {
|
5406 |
+
for ( r = 0; r < length; r++ ) {
|
5407 |
+
if ( ret[r] === ret[n] ) {
|
5408 |
+
ret.splice(n--, 1);
|
5409 |
+
break;
|
5410 |
+
}
|
5411 |
+
}
|
5412 |
+
}
|
5413 |
+
}
|
5414 |
+
}
|
5415 |
+
|
5416 |
+
return ret;
|
5417 |
+
},
|
5418 |
+
|
5419 |
+
has: function( target ) {
|
5420 |
+
var targets = jQuery( target );
|
5421 |
+
return this.filter(function() {
|
5422 |
+
for ( var i = 0, l = targets.length; i < l; i++ ) {
|
5423 |
+
if ( jQuery.contains( this, targets[i] ) ) {
|
5424 |
+
return true;
|
5425 |
+
}
|
5426 |
+
}
|
5427 |
+
});
|
5428 |
+
},
|
5429 |
+
|
5430 |
+
not: function( selector ) {
|
5431 |
+
return this.pushStack( winnow(this, selector, false), "not", selector);
|
5432 |
+
},
|
5433 |
+
|
5434 |
+
filter: function( selector ) {
|
5435 |
+
return this.pushStack( winnow(this, selector, true), "filter", selector );
|
5436 |
+
},
|
5437 |
+
|
5438 |
+
is: function( selector ) {
|
5439 |
+
return !!selector && (
|
5440 |
+
typeof selector === "string" ?
|
5441 |
+
// If this is a positional selector, check membership in the returned set
|
5442 |
+
// so $("p:first").is("p:last") won't return true for a doc with two "p".
|
5443 |
+
POS.test( selector ) ?
|
5444 |
+
jQuery( selector, this.context ).index( this[0] ) >= 0 :
|
5445 |
+
jQuery.filter( selector, this ).length > 0 :
|
5446 |
+
this.filter( selector ).length > 0 );
|
5447 |
+
},
|
5448 |
+
|
5449 |
+
closest: function( selectors, context ) {
|
5450 |
+
var ret = [], i, l, cur = this[0];
|
5451 |
+
|
5452 |
+
// Array (deprecated as of jQuery 1.7)
|
5453 |
+
if ( jQuery.isArray( selectors ) ) {
|
5454 |
+
var level = 1;
|
5455 |
+
|
5456 |
+
while ( cur && cur.ownerDocument && cur !== context ) {
|
5457 |
+
for ( i = 0; i < selectors.length; i++ ) {
|
5458 |
+
|
5459 |
+
if ( jQuery( cur ).is( selectors[ i ] ) ) {
|
5460 |
+
ret.push({ selector: selectors[ i ], elem: cur, level: level });
|
5461 |
+
}
|
5462 |
+
}
|
5463 |
+
|
5464 |
+
cur = cur.parentNode;
|
5465 |
+
level++;
|
5466 |
+
}
|
5467 |
+
|
5468 |
+
return ret;
|
5469 |
+
}
|
5470 |
+
|
5471 |
+
// String
|
5472 |
+
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
|
5473 |
+
jQuery( selectors, context || this.context ) :
|
5474 |
+
0;
|
5475 |
+
|
5476 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
5477 |
+
cur = this[i];
|
5478 |
+
|
5479 |
+
while ( cur ) {
|
5480 |
+
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
|
5481 |
+
ret.push( cur );
|
5482 |
+
break;
|
5483 |
+
|
5484 |
+
} else {
|
5485 |
+
cur = cur.parentNode;
|
5486 |
+
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
|
5487 |
+
break;
|
5488 |
+
}
|
5489 |
+
}
|
5490 |
+
}
|
5491 |
+
}
|
5492 |
+
|
5493 |
+
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
|
5494 |
+
|
5495 |
+
return this.pushStack( ret, "closest", selectors );
|
5496 |
+
},
|
5497 |
+
|
5498 |
+
// Determine the position of an element within
|
5499 |
+
// the matched set of elements
|
5500 |
+
index: function( elem ) {
|
5501 |
+
|
5502 |
+
// No argument, return index in parent
|
5503 |
+
if ( !elem ) {
|
5504 |
+
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
|
5505 |
+
}
|
5506 |
+
|
5507 |
+
// index in selector
|
5508 |
+
if ( typeof elem === "string" ) {
|
5509 |
+
return jQuery.inArray( this[0], jQuery( elem ) );
|
5510 |
+
}
|
5511 |
+
|
5512 |
+
// Locate the position of the desired element
|
5513 |
+
return jQuery.inArray(
|
5514 |
+
// If it receives a jQuery object, the first element is used
|
5515 |
+
elem.jquery ? elem[0] : elem, this );
|
5516 |
+
},
|
5517 |
+
|
5518 |
+
add: function( selector, context ) {
|
5519 |
+
var set = typeof selector === "string" ?
|
5520 |
+
jQuery( selector, context ) :
|
5521 |
+
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
|
5522 |
+
all = jQuery.merge( this.get(), set );
|
5523 |
+
|
5524 |
+
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
|
5525 |
+
all :
|
5526 |
+
jQuery.unique( all ) );
|
5527 |
+
},
|
5528 |
+
|
5529 |
+
andSelf: function() {
|
5530 |
+
return this.add( this.prevObject );
|
5531 |
+
}
|
5532 |
+
});
|
5533 |
+
|
5534 |
+
// A painfully simple check to see if an element is disconnected
|
5535 |
+
// from a document (should be improved, where feasible).
|
5536 |
+
function isDisconnected( node ) {
|
5537 |
+
return !node || !node.parentNode || node.parentNode.nodeType === 11;
|
5538 |
+
}
|
5539 |
+
|
5540 |
+
jQuery.each({
|
5541 |
+
parent: function( elem ) {
|
5542 |
+
var parent = elem.parentNode;
|
5543 |
+
return parent && parent.nodeType !== 11 ? parent : null;
|
5544 |
+
},
|
5545 |
+
parents: function( elem ) {
|
5546 |
+
return jQuery.dir( elem, "parentNode" );
|
5547 |
+
},
|
5548 |
+
parentsUntil: function( elem, i, until ) {
|
5549 |
+
return jQuery.dir( elem, "parentNode", until );
|
5550 |
+
},
|
5551 |
+
next: function( elem ) {
|
5552 |
+
return jQuery.nth( elem, 2, "nextSibling" );
|
5553 |
+
},
|
5554 |
+
prev: function( elem ) {
|
5555 |
+
return jQuery.nth( elem, 2, "previousSibling" );
|
5556 |
+
},
|
5557 |
+
nextAll: function( elem ) {
|
5558 |
+
return jQuery.dir( elem, "nextSibling" );
|
5559 |
+
},
|
5560 |
+
prevAll: function( elem ) {
|
5561 |
+
return jQuery.dir( elem, "previousSibling" );
|
5562 |
+
},
|
5563 |
+
nextUntil: function( elem, i, until ) {
|
5564 |
+
return jQuery.dir( elem, "nextSibling", until );
|
5565 |
+
},
|
5566 |
+
prevUntil: function( elem, i, until ) {
|
5567 |
+
return jQuery.dir( elem, "previousSibling", until );
|
5568 |
+
},
|
5569 |
+
siblings: function( elem ) {
|
5570 |
+
return jQuery.sibling( elem.parentNode.firstChild, elem );
|
5571 |
+
},
|
5572 |
+
children: function( elem ) {
|
5573 |
+
return jQuery.sibling( elem.firstChild );
|
5574 |
+
},
|
5575 |
+
contents: function( elem ) {
|
5576 |
+
return jQuery.nodeName( elem, "iframe" ) ?
|
5577 |
+
elem.contentDocument || elem.contentWindow.document :
|
5578 |
+
jQuery.makeArray( elem.childNodes );
|
5579 |
+
}
|
5580 |
+
}, function( name, fn ) {
|
5581 |
+
jQuery.fn[ name ] = function( until, selector ) {
|
5582 |
+
var ret = jQuery.map( this, fn, until ),
|
5583 |
+
// The variable 'args' was introduced in
|
5584 |
+
// https://github.com/jquery/jquery/commit/52a0238
|
5585 |
+
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
|
5586 |
+
// http://code.google.com/p/v8/issues/detail?id=1050
|
5587 |
+
args = slice.call(arguments);
|
5588 |
+
|
5589 |
+
if ( !runtil.test( name ) ) {
|
5590 |
+
selector = until;
|
5591 |
+
}
|
5592 |
+
|
5593 |
+
if ( selector && typeof selector === "string" ) {
|
5594 |
+
ret = jQuery.filter( selector, ret );
|
5595 |
+
}
|
5596 |
+
|
5597 |
+
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
|
5598 |
+
|
5599 |
+
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
|
5600 |
+
ret = ret.reverse();
|
5601 |
+
}
|
5602 |
+
|
5603 |
+
return this.pushStack( ret, name, args.join(",") );
|
5604 |
+
};
|
5605 |
+
});
|
5606 |
+
|
5607 |
+
jQuery.extend({
|
5608 |
+
filter: function( expr, elems, not ) {
|
5609 |
+
if ( not ) {
|
5610 |
+
expr = ":not(" + expr + ")";
|
5611 |
+
}
|
5612 |
+
|
5613 |
+
return elems.length === 1 ?
|
5614 |
+
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
|
5615 |
+
jQuery.find.matches(expr, elems);
|
5616 |
+
},
|
5617 |
+
|
5618 |
+
dir: function( elem, dir, until ) {
|
5619 |
+
var matched = [],
|
5620 |
+
cur = elem[ dir ];
|
5621 |
+
|
5622 |
+
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
|
5623 |
+
if ( cur.nodeType === 1 ) {
|
5624 |
+
matched.push( cur );
|
5625 |
+
}
|
5626 |
+
cur = cur[dir];
|
5627 |
+
}
|
5628 |
+
return matched;
|
5629 |
+
},
|
5630 |
+
|
5631 |
+
nth: function( cur, result, dir, elem ) {
|
5632 |
+
result = result || 1;
|
5633 |
+
var num = 0;
|
5634 |
+
|
5635 |
+
for ( ; cur; cur = cur[dir] ) {
|
5636 |
+
if ( cur.nodeType === 1 && ++num === result ) {
|
5637 |
+
break;
|
5638 |
+
}
|
5639 |
+
}
|
5640 |
+
|
5641 |
+
return cur;
|
5642 |
+
},
|
5643 |
+
|
5644 |
+
sibling: function( n, elem ) {
|
5645 |
+
var r = [];
|
5646 |
+
|
5647 |
+
for ( ; n; n = n.nextSibling ) {
|
5648 |
+
if ( n.nodeType === 1 && n !== elem ) {
|
5649 |
+
r.push( n );
|
5650 |
+
}
|
5651 |
+
}
|
5652 |
+
|
5653 |
+
return r;
|
5654 |
+
}
|
5655 |
+
});
|
5656 |
+
|
5657 |
+
// Implement the identical functionality for filter and not
|
5658 |
+
function winnow( elements, qualifier, keep ) {
|
5659 |
+
|
5660 |
+
// Can't pass null or undefined to indexOf in Firefox 4
|
5661 |
+
// Set to 0 to skip string check
|
5662 |
+
qualifier = qualifier || 0;
|
5663 |
+
|
5664 |
+
if ( jQuery.isFunction( qualifier ) ) {
|
5665 |
+
return jQuery.grep(elements, function( elem, i ) {
|
5666 |
+
var retVal = !!qualifier.call( elem, i, elem );
|
5667 |
+
return retVal === keep;
|
5668 |
+
});
|
5669 |
+
|
5670 |
+
} else if ( qualifier.nodeType ) {
|
5671 |
+
return jQuery.grep(elements, function( elem, i ) {
|
5672 |
+
return ( elem === qualifier ) === keep;
|
5673 |
+
});
|
5674 |
+
|
5675 |
+
} else if ( typeof qualifier === "string" ) {
|
5676 |
+
var filtered = jQuery.grep(elements, function( elem ) {
|
5677 |
+
return elem.nodeType === 1;
|
5678 |
+
});
|
5679 |
+
|
5680 |
+
if ( isSimple.test( qualifier ) ) {
|
5681 |
+
return jQuery.filter(qualifier, filtered, !keep);
|
5682 |
+
} else {
|
5683 |
+
qualifier = jQuery.filter( qualifier, filtered );
|
5684 |
+
}
|
5685 |
+
}
|
5686 |
+
|
5687 |
+
return jQuery.grep(elements, function( elem, i ) {
|
5688 |
+
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
|
5689 |
+
});
|
5690 |
+
}
|
5691 |
+
|
5692 |
+
|
5693 |
+
|
5694 |
+
|
5695 |
+
function createSafeFragment( document ) {
|
5696 |
+
var list = nodeNames.split( " " ),
|
5697 |
+
safeFrag = document.createDocumentFragment();
|
5698 |
+
|
5699 |
+
if ( safeFrag.createElement ) {
|
5700 |
+
while ( list.length ) {
|
5701 |
+
safeFrag.createElement(
|
5702 |
+
list.pop()
|
5703 |
+
);
|
5704 |
+
}
|
5705 |
+
}
|
5706 |
+
return safeFrag;
|
5707 |
+
}
|
5708 |
+
|
5709 |
+
var nodeNames = "abbr article aside audio canvas datalist details figcaption figure footer " +
|
5710 |
+
"header hgroup mark meter nav output progress section summary time video",
|
5711 |
+
rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
5712 |
+
rleadingWhitespace = /^\s+/,
|
5713 |
+
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
|
5714 |
+
rtagName = /<([\w:]+)/,
|
5715 |
+
rtbody = /<tbody/i,
|
5716 |
+
rhtml = /<|&#?\w+;/,
|
5717 |
+
rnoInnerhtml = /<(?:script|style)/i,
|
5718 |
+
rnocache = /<(?:script|object|embed|option|style)/i,
|
5719 |
+
rnoshimcache = new RegExp("<(?:" + nodeNames.replace(" ", "|") + ")", "i"),
|
5720 |
+
// checked="checked" or checked
|
5721 |
+
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
5722 |
+
rscriptType = /\/(java|ecma)script/i,
|
5723 |
+
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
|
5724 |
+
wrapMap = {
|
5725 |
+
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
5726 |
+
legend: [ 1, "<fieldset>", "</fieldset>" ],
|
5727 |
+
thead: [ 1, "<table>", "</table>" ],
|
5728 |
+
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
|
5729 |
+
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
5730 |
+
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
5731 |
+
area: [ 1, "<map>", "</map>" ],
|
5732 |
+
_default: [ 0, "", "" ]
|
5733 |
+
},
|
5734 |
+
safeFragment = createSafeFragment( document );
|
5735 |
+
|
5736 |
+
wrapMap.optgroup = wrapMap.option;
|
5737 |
+
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
5738 |
+
wrapMap.th = wrapMap.td;
|
5739 |
+
|
5740 |
+
// IE can't serialize <link> and <script> tags normally
|
5741 |
+
if ( !jQuery.support.htmlSerialize ) {
|
5742 |
+
wrapMap._default = [ 1, "div<div>", "</div>" ];
|
5743 |
+
}
|
5744 |
+
|
5745 |
+
jQuery.fn.extend({
|
5746 |
+
text: function( text ) {
|
5747 |
+
if ( jQuery.isFunction(text) ) {
|
5748 |
+
return this.each(function(i) {
|
5749 |
+
var self = jQuery( this );
|
5750 |
+
|
5751 |
+
self.text( text.call(this, i, self.text()) );
|
5752 |
+
});
|
5753 |
+
}
|
5754 |
+
|
5755 |
+
if ( typeof text !== "object" && text !== undefined ) {
|
5756 |
+
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
|
5757 |
+
}
|
5758 |
+
|
5759 |
+
return jQuery.text( this );
|
5760 |
+
},
|
5761 |
+
|
5762 |
+
wrapAll: function( html ) {
|
5763 |
+
if ( jQuery.isFunction( html ) ) {
|
5764 |
+
return this.each(function(i) {
|
5765 |
+
jQuery(this).wrapAll( html.call(this, i) );
|
5766 |
+
});
|
5767 |
+
}
|
5768 |
+
|
5769 |
+
if ( this[0] ) {
|
5770 |
+
// The elements to wrap the target around
|
5771 |
+
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
|
5772 |
+
|
5773 |
+
if ( this[0].parentNode ) {
|
5774 |
+
wrap.insertBefore( this[0] );
|
5775 |
+
}
|
5776 |
+
|
5777 |
+
wrap.map(function() {
|
5778 |
+
var elem = this;
|
5779 |
+
|
5780 |
+
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
|
5781 |
+
elem = elem.firstChild;
|
5782 |
+
}
|
5783 |
+
|
5784 |
+
return elem;
|
5785 |
+
}).append( this );
|
5786 |
+
}
|
5787 |
+
|
5788 |
+
return this;
|
5789 |
+
},
|
5790 |
+
|
5791 |
+
wrapInner: function( html ) {
|
5792 |
+
if ( jQuery.isFunction( html ) ) {
|
5793 |
+
return this.each(function(i) {
|
5794 |
+
jQuery(this).wrapInner( html.call(this, i) );
|
5795 |
+
});
|
5796 |
+
}
|
5797 |
+
|
5798 |
+
return this.each(function() {
|
5799 |
+
var self = jQuery( this ),
|
5800 |
+
contents = self.contents();
|
5801 |
+
|
5802 |
+
if ( contents.length ) {
|
5803 |
+
contents.wrapAll( html );
|
5804 |
+
|
5805 |
+
} else {
|
5806 |
+
self.append( html );
|
5807 |
+
}
|
5808 |
+
});
|
5809 |
+
},
|
5810 |
+
|
5811 |
+
wrap: function( html ) {
|
5812 |
+
return this.each(function() {
|
5813 |
+
jQuery( this ).wrapAll( html );
|
5814 |
+
});
|
5815 |
+
},
|
5816 |
+
|
5817 |
+
unwrap: function() {
|
5818 |
+
return this.parent().each(function() {
|
5819 |
+
if ( !jQuery.nodeName( this, "body" ) ) {
|
5820 |
+
jQuery( this ).replaceWith( this.childNodes );
|
5821 |
+
}
|
5822 |
+
}).end();
|
5823 |
+
},
|
5824 |
+
|
5825 |
+
append: function() {
|
5826 |
+
return this.domManip(arguments, true, function( elem ) {
|
5827 |
+
if ( this.nodeType === 1 ) {
|
5828 |
+
this.appendChild( elem );
|
5829 |
+
}
|
5830 |
+
});
|
5831 |
+
},
|
5832 |
+
|
5833 |
+
prepend: function() {
|
5834 |
+
return this.domManip(arguments, true, function( elem ) {
|
5835 |
+
if ( this.nodeType === 1 ) {
|
5836 |
+
this.insertBefore( elem, this.firstChild );
|
5837 |
+
}
|
5838 |
+
});
|
5839 |
+
},
|
5840 |
+
|
5841 |
+
before: function() {
|
5842 |
+
if ( this[0] && this[0].parentNode ) {
|
5843 |
+
return this.domManip(arguments, false, function( elem ) {
|
5844 |
+
this.parentNode.insertBefore( elem, this );
|
5845 |
+
});
|
5846 |
+
} else if ( arguments.length ) {
|
5847 |
+
var set = jQuery(arguments[0]);
|
5848 |
+
set.push.apply( set, this.toArray() );
|
5849 |
+
return this.pushStack( set, "before", arguments );
|
5850 |
+
}
|
5851 |
+
},
|
5852 |
+
|
5853 |
+
after: function() {
|
5854 |
+
if ( this[0] && this[0].parentNode ) {
|
5855 |
+
return this.domManip(arguments, false, function( elem ) {
|
5856 |
+
this.parentNode.insertBefore( elem, this.nextSibling );
|
5857 |
+
});
|
5858 |
+
} else if ( arguments.length ) {
|
5859 |
+
var set = this.pushStack( this, "after", arguments );
|
5860 |
+
set.push.apply( set, jQuery(arguments[0]).toArray() );
|
5861 |
+
return set;
|
5862 |
+
}
|
5863 |
+
},
|
5864 |
+
|
5865 |
+
// keepData is for internal use only--do not document
|
5866 |
+
remove: function( selector, keepData ) {
|
5867 |
+
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
5868 |
+
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
|
5869 |
+
if ( !keepData && elem.nodeType === 1 ) {
|
5870 |
+
jQuery.cleanData( elem.getElementsByTagName("*") );
|
5871 |
+
jQuery.cleanData( [ elem ] );
|
5872 |
+
}
|
5873 |
+
|
5874 |
+
if ( elem.parentNode ) {
|
5875 |
+
elem.parentNode.removeChild( elem );
|
5876 |
+
}
|
5877 |
+
}
|
5878 |
+
}
|
5879 |
+
|
5880 |
+
return this;
|
5881 |
+
},
|
5882 |
+
|
5883 |
+
empty: function() {
|
5884 |
+
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
5885 |
+
// Remove element nodes and prevent memory leaks
|
5886 |
+
if ( elem.nodeType === 1 ) {
|
5887 |
+
jQuery.cleanData( elem.getElementsByTagName("*") );
|
5888 |
+
}
|
5889 |
+
|
5890 |
+
// Remove any remaining nodes
|
5891 |
+
while ( elem.firstChild ) {
|
5892 |
+
elem.removeChild( elem.firstChild );
|
5893 |
+
}
|
5894 |
+
}
|
5895 |
+
|
5896 |
+
return this;
|
5897 |
+
},
|
5898 |
+
|
5899 |
+
clone: function( dataAndEvents, deepDataAndEvents ) {
|
5900 |
+
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
5901 |
+
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
5902 |
+
|
5903 |
+
return this.map( function () {
|
5904 |
+
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
|
5905 |
+
});
|
5906 |
+
},
|
5907 |
+
|
5908 |
+
html: function( value ) {
|
5909 |
+
if ( value === undefined ) {
|
5910 |
+
return this[0] && this[0].nodeType === 1 ?
|
5911 |
+
this[0].innerHTML.replace(rinlinejQuery, "") :
|
5912 |
+
null;
|
5913 |
+
|
5914 |
+
// See if we can take a shortcut and just use innerHTML
|
5915 |
+
} else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
5916 |
+
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
|
5917 |
+
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
|
5918 |
+
|
5919 |
+
value = value.replace(rxhtmlTag, "<$1></$2>");
|
5920 |
+
|
5921 |
+
try {
|
5922 |
+
for ( var i = 0, l = this.length; i < l; i++ ) {
|
5923 |
+
// Remove element nodes and prevent memory leaks
|
5924 |
+
if ( this[i].nodeType === 1 ) {
|
5925 |
+
jQuery.cleanData( this[i].getElementsByTagName("*") );
|
5926 |
+
this[i].innerHTML = value;
|
5927 |
+
}
|
5928 |
+
}
|
5929 |
+
|
5930 |
+
// If using innerHTML throws an exception, use the fallback method
|
5931 |
+
} catch(e) {
|
5932 |
+
this.empty().append( value );
|
5933 |
+
}
|
5934 |
+
|
5935 |
+
} else if ( jQuery.isFunction( value ) ) {
|
5936 |
+
this.each(function(i){
|
5937 |
+
var self = jQuery( this );
|
5938 |
+
|
5939 |
+
self.html( value.call(this, i, self.html()) );
|
5940 |
+
});
|
5941 |
+
|
5942 |
+
} else {
|
5943 |
+
this.empty().append( value );
|
5944 |
+
}
|
5945 |
+
|
5946 |
+
return this;
|
5947 |
+
},
|
5948 |
+
|
5949 |
+
replaceWith: function( value ) {
|
5950 |
+
if ( this[0] && this[0].parentNode ) {
|
5951 |
+
// Make sure that the elements are removed from the DOM before they are inserted
|
5952 |
+
// this can help fix replacing a parent with child elements
|
5953 |
+
if ( jQuery.isFunction( value ) ) {
|
5954 |
+
return this.each(function(i) {
|
5955 |
+
var self = jQuery(this), old = self.html();
|
5956 |
+
self.replaceWith( value.call( this, i, old ) );
|
5957 |
+
});
|
5958 |
+
}
|
5959 |
+
|
5960 |
+
if ( typeof value !== "string" ) {
|
5961 |
+
value = jQuery( value ).detach();
|
5962 |
+
}
|
5963 |
+
|
5964 |
+
return this.each(function() {
|
5965 |
+
var next = this.nextSibling,
|
5966 |
+
parent = this.parentNode;
|
5967 |
+
|
5968 |
+
jQuery( this ).remove();
|
5969 |
+
|
5970 |
+
if ( next ) {
|
5971 |
+
jQuery(next).before( value );
|
5972 |
+
} else {
|
5973 |
+
jQuery(parent).append( value );
|
5974 |
+
}
|
5975 |
+
});
|
5976 |
+
} else {
|
5977 |
+
return this.length ?
|
5978 |
+
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
|
5979 |
+
this;
|
5980 |
+
}
|
5981 |
+
},
|
5982 |
+
|
5983 |
+
detach: function( selector ) {
|
5984 |
+
return this.remove( selector, true );
|
5985 |
+
},
|
5986 |
+
|
5987 |
+
domManip: function( args, table, callback ) {
|
5988 |
+
var results, first, fragment, parent,
|
5989 |
+
value = args[0],
|
5990 |
+
scripts = [];
|
5991 |
+
|
5992 |
+
// We can't cloneNode fragments that contain checked, in WebKit
|
5993 |
+
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
|
5994 |
+
return this.each(function() {
|
5995 |
+
jQuery(this).domManip( args, table, callback, true );
|
5996 |
+
});
|
5997 |
+
}
|
5998 |
+
|
5999 |
+
if ( jQuery.isFunction(value) ) {
|
6000 |
+
return this.each(function(i) {
|
6001 |
+
var self = jQuery(this);
|
6002 |
+
args[0] = value.call(this, i, table ? self.html() : undefined);
|
6003 |
+
self.domManip( args, table, callback );
|
6004 |
+
});
|
6005 |
+
}
|
6006 |
+
|
6007 |
+
if ( this[0] ) {
|
6008 |
+
parent = value && value.parentNode;
|
6009 |
+
|
6010 |
+
// If we're in a fragment, just use that instead of building a new one
|
6011 |
+
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
|
6012 |
+
results = { fragment: parent };
|
6013 |
+
|
6014 |
+
} else {
|
6015 |
+
results = jQuery.buildFragment( args, this, scripts );
|
6016 |
+
}
|
6017 |
+
|
6018 |
+
fragment = results.fragment;
|
6019 |
+
|
6020 |
+
if ( fragment.childNodes.length === 1 ) {
|
6021 |
+
first = fragment = fragment.firstChild;
|
6022 |
+
} else {
|
6023 |
+
first = fragment.firstChild;
|
6024 |
+
}
|
6025 |
+
|
6026 |
+
if ( first ) {
|
6027 |
+
table = table && jQuery.nodeName( first, "tr" );
|
6028 |
+
|
6029 |
+
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
|
6030 |
+
callback.call(
|
6031 |
+
table ?
|
6032 |
+
root(this[i], first) :
|
6033 |
+
this[i],
|
6034 |
+
// Make sure that we do not leak memory by inadvertently discarding
|
6035 |
+
// the original fragment (which might have attached data) instead of
|
6036 |
+
// using it; in addition, use the original fragment object for the last
|
6037 |
+
// item instead of first because it can end up being emptied incorrectly
|
6038 |
+
// in certain situations (Bug #8070).
|
6039 |
+
// Fragments from the fragment cache must always be cloned and never used
|
6040 |
+
// in place.
|
6041 |
+
results.cacheable || ( l > 1 && i < lastIndex ) ?
|
6042 |
+
jQuery.clone( fragment, true, true ) :
|
6043 |
+
fragment
|
6044 |
+
);
|
6045 |
+
}
|
6046 |
+
}
|
6047 |
+
|
6048 |
+
if ( scripts.length ) {
|
6049 |
+
jQuery.each( scripts, evalScript );
|
6050 |
+
}
|
6051 |
+
}
|
6052 |
+
|
6053 |
+
return this;
|
6054 |
+
}
|
6055 |
+
});
|
6056 |
+
|
6057 |
+
function root( elem, cur ) {
|
6058 |
+
return jQuery.nodeName(elem, "table") ?
|
6059 |
+
(elem.getElementsByTagName("tbody")[0] ||
|
6060 |
+
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
|
6061 |
+
elem;
|
6062 |
+
}
|
6063 |
+
|
6064 |
+
function cloneCopyEvent( src, dest ) {
|
6065 |
+
|
6066 |
+
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
|
6067 |
+
return;
|
6068 |
+
}
|
6069 |
+
|
6070 |
+
var type, i, l,
|
6071 |
+
oldData = jQuery._data( src ),
|
6072 |
+
curData = jQuery._data( dest, oldData ),
|
6073 |
+
events = oldData.events;
|
6074 |
+
|
6075 |
+
if ( events ) {
|
6076 |
+
delete curData.handle;
|
6077 |
+
curData.events = {};
|
6078 |
+
|
6079 |
+
for ( type in events ) {
|
6080 |
+
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
6081 |
+
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
|
6082 |
+
}
|
6083 |
+
}
|
6084 |
+
}
|
6085 |
+
|
6086 |
+
// make the cloned public data object a copy from the original
|
6087 |
+
if ( curData.data ) {
|
6088 |
+
curData.data = jQuery.extend( {}, curData.data );
|
6089 |
+
}
|
6090 |
+
}
|
6091 |
+
|
6092 |
+
function cloneFixAttributes( src, dest ) {
|
6093 |
+
var nodeName;
|
6094 |
+
|
6095 |
+
// We do not need to do anything for non-Elements
|
6096 |
+
if ( dest.nodeType !== 1 ) {
|
6097 |
+
return;
|
6098 |
+
}
|
6099 |
+
|
6100 |
+
// clearAttributes removes the attributes, which we don't want,
|
6101 |
+
// but also removes the attachEvent events, which we *do* want
|
6102 |
+
if ( dest.clearAttributes ) {
|
6103 |
+
dest.clearAttributes();
|
6104 |
+
}
|
6105 |
+
|
6106 |
+
// mergeAttributes, in contrast, only merges back on the
|
6107 |
+
// original attributes, not the events
|
6108 |
+
if ( dest.mergeAttributes ) {
|
6109 |
+
dest.mergeAttributes( src );
|
6110 |
+
}
|
6111 |
+
|
6112 |
+
nodeName = dest.nodeName.toLowerCase();
|
6113 |
+
|
6114 |
+
// IE6-8 fail to clone children inside object elements that use
|
6115 |
+
// the proprietary classid attribute value (rather than the type
|
6116 |
+
// attribute) to identify the type of content to display
|
6117 |
+
if ( nodeName === "object" ) {
|
6118 |
+
dest.outerHTML = src.outerHTML;
|
6119 |
+
|
6120 |
+
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
|
6121 |
+
// IE6-8 fails to persist the checked state of a cloned checkbox
|
6122 |
+
// or radio button. Worse, IE6-7 fail to give the cloned element
|
6123 |
+
// a checked appearance if the defaultChecked value isn't also set
|
6124 |
+
if ( src.checked ) {
|
6125 |
+
dest.defaultChecked = dest.checked = src.checked;
|
6126 |
+
}
|
6127 |
+
|
6128 |
+
// IE6-7 get confused and end up setting the value of a cloned
|
6129 |
+
// checkbox/radio button to an empty string instead of "on"
|
6130 |
+
if ( dest.value !== src.value ) {
|
6131 |
+
dest.value = src.value;
|
6132 |
+
}
|
6133 |
+
|
6134 |
+
// IE6-8 fails to return the selected option to the default selected
|
6135 |
+
// state when cloning options
|
6136 |
+
} else if ( nodeName === "option" ) {
|
6137 |
+
dest.selected = src.defaultSelected;
|
6138 |
+
|
6139 |
+
// IE6-8 fails to set the defaultValue to the correct value when
|
6140 |
+
// cloning other types of input fields
|
6141 |
+
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
6142 |
+
dest.defaultValue = src.defaultValue;
|
6143 |
+
}
|
6144 |
+
|
6145 |
+
// Event data gets referenced instead of copied if the expando
|
6146 |
+
// gets copied too
|
6147 |
+
dest.removeAttribute( jQuery.expando );
|
6148 |
+
}
|
6149 |
+
|
6150 |
+
jQuery.buildFragment = function( args, nodes, scripts ) {
|
6151 |
+
var fragment, cacheable, cacheresults, doc,
|
6152 |
+
first = args[ 0 ];
|
6153 |
+
|
6154 |
+
// nodes may contain either an explicit document object,
|
6155 |
+
// a jQuery collection or context object.
|
6156 |
+
// If nodes[0] contains a valid object to assign to doc
|
6157 |
+
if ( nodes && nodes[0] ) {
|
6158 |
+
doc = nodes[0].ownerDocument || nodes[0];
|
6159 |
+
}
|
6160 |
+
|
6161 |
+
// Ensure that an attr object doesn't incorrectly stand in as a document object
|
6162 |
+
// Chrome and Firefox seem to allow this to occur and will throw exception
|
6163 |
+
// Fixes #8950
|
6164 |
+
if ( !doc.createDocumentFragment ) {
|
6165 |
+
doc = document;
|
6166 |
+
}
|
6167 |
+
|
6168 |
+
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
|
6169 |
+
// Cloning options loses the selected state, so don't cache them
|
6170 |
+
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
|
6171 |
+
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
|
6172 |
+
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
|
6173 |
+
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
|
6174 |
+
first.charAt(0) === "<" && !rnocache.test( first ) &&
|
6175 |
+
(jQuery.support.checkClone || !rchecked.test( first )) &&
|
6176 |
+
(!jQuery.support.unknownElems && rnoshimcache.test( first )) ) {
|
6177 |
+
|
6178 |
+
cacheable = true;
|
6179 |
+
|
6180 |
+
cacheresults = jQuery.fragments[ first ];
|
6181 |
+
if ( cacheresults && cacheresults !== 1 ) {
|
6182 |
+
fragment = cacheresults;
|
6183 |
+
}
|
6184 |
+
}
|
6185 |
+
|
6186 |
+
if ( !fragment ) {
|
6187 |
+
fragment = doc.createDocumentFragment();
|
6188 |
+
jQuery.clean( args, doc, fragment, scripts );
|
6189 |
+
}
|
6190 |
+
|
6191 |
+
if ( cacheable ) {
|
6192 |
+
jQuery.fragments[ first ] = cacheresults ? fragment : 1;
|
6193 |
+
}
|
6194 |
+
|
6195 |
+
return { fragment: fragment, cacheable: cacheable };
|
6196 |
+
};
|
6197 |
+
|
6198 |
+
jQuery.fragments = {};
|
6199 |
+
|
6200 |
+
jQuery.each({
|
6201 |
+
appendTo: "append",
|
6202 |
+
prependTo: "prepend",
|
6203 |
+
insertBefore: "before",
|
6204 |
+
insertAfter: "after",
|
6205 |
+
replaceAll: "replaceWith"
|
6206 |
+
}, function( name, original ) {
|
6207 |
+
jQuery.fn[ name ] = function( selector ) {
|
6208 |
+
var ret = [],
|
6209 |
+
insert = jQuery( selector ),
|
6210 |
+
parent = this.length === 1 && this[0].parentNode;
|
6211 |
+
|
6212 |
+
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
|
6213 |
+
insert[ original ]( this[0] );
|
6214 |
+
return this;
|
6215 |
+
|
6216 |
+
} else {
|
6217 |
+
for ( var i = 0, l = insert.length; i < l; i++ ) {
|
6218 |
+
var elems = ( i > 0 ? this.clone(true) : this ).get();
|
6219 |
+
jQuery( insert[i] )[ original ]( elems );
|
6220 |
+
ret = ret.concat( elems );
|
6221 |
+
}
|
6222 |
+
|
6223 |
+
return this.pushStack( ret, name, insert.selector );
|
6224 |
+
}
|
6225 |
+
};
|
6226 |
+
});
|
6227 |
+
|
6228 |
+
function getAll( elem ) {
|
6229 |
+
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
6230 |
+
return elem.getElementsByTagName( "*" );
|
6231 |
+
|
6232 |
+
} else if ( typeof elem.querySelectorAll !== "undefined" ) {
|
6233 |
+
return elem.querySelectorAll( "*" );
|
6234 |
+
|
6235 |
+
} else {
|
6236 |
+
return [];
|
6237 |
+
}
|
6238 |
+
}
|
6239 |
+
|
6240 |
+
// Used in clean, fixes the defaultChecked property
|
6241 |
+
function fixDefaultChecked( elem ) {
|
6242 |
+
if ( elem.type === "checkbox" || elem.type === "radio" ) {
|
6243 |
+
elem.defaultChecked = elem.checked;
|
6244 |
+
}
|
6245 |
+
}
|
6246 |
+
// Finds all inputs and passes them to fixDefaultChecked
|
6247 |
+
function findInputs( elem ) {
|
6248 |
+
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
6249 |
+
if ( nodeName === "input" ) {
|
6250 |
+
fixDefaultChecked( elem );
|
6251 |
+
// Skip scripts, get other children
|
6252 |
+
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
|
6253 |
+
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
|
6254 |
+
}
|
6255 |
+
}
|
6256 |
+
|
6257 |
+
jQuery.extend({
|
6258 |
+
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
6259 |
+
var clone = elem.cloneNode(true),
|
6260 |
+
srcElements,
|
6261 |
+
destElements,
|
6262 |
+
i;
|
6263 |
+
|
6264 |
+
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
|
6265 |
+
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
6266 |
+
// IE copies events bound via attachEvent when using cloneNode.
|
6267 |
+
// Calling detachEvent on the clone will also remove the events
|
6268 |
+
// from the original. In order to get around this, we use some
|
6269 |
+
// proprietary methods to clear the events. Thanks to MooTools
|
6270 |
+
// guys for this hotness.
|
6271 |
+
|
6272 |
+
cloneFixAttributes( elem, clone );
|
6273 |
+
|
6274 |
+
// Using Sizzle here is crazy slow, so we use getElementsByTagName
|
6275 |
+
// instead
|
6276 |
+
srcElements = getAll( elem );
|
6277 |
+
destElements = getAll( clone );
|
6278 |
+
|
6279 |
+
// Weird iteration because IE will replace the length property
|
6280 |
+
// with an element if you are cloning the body and one of the
|
6281 |
+
// elements on the page has a name or id of "length"
|
6282 |
+
for ( i = 0; srcElements[i]; ++i ) {
|
6283 |
+
// Ensure that the destination node is not null; Fixes #9587
|
6284 |
+
if ( destElements[i] ) {
|
6285 |
+
cloneFixAttributes( srcElements[i], destElements[i] );
|
6286 |
+
}
|
6287 |
+
}
|
6288 |
+
}
|
6289 |
+
|
6290 |
+
// Copy the events from the original to the clone
|
6291 |
+
if ( dataAndEvents ) {
|
6292 |
+
cloneCopyEvent( elem, clone );
|
6293 |
+
|
6294 |
+
if ( deepDataAndEvents ) {
|
6295 |
+
srcElements = getAll( elem );
|
6296 |
+
destElements = getAll( clone );
|
6297 |
+
|
6298 |
+
for ( i = 0; srcElements[i]; ++i ) {
|
6299 |
+
cloneCopyEvent( srcElements[i], destElements[i] );
|
6300 |
+
}
|
6301 |
+
}
|
6302 |
+
}
|
6303 |
+
|
6304 |
+
srcElements = destElements = null;
|
6305 |
+
|
6306 |
+
// Return the cloned set
|
6307 |
+
return clone;
|
6308 |
+
},
|
6309 |
+
|
6310 |
+
clean: function( elems, context, fragment, scripts ) {
|
6311 |
+
var checkScriptType;
|
6312 |
+
|
6313 |
+
context = context || document;
|
6314 |
+
|
6315 |
+
// !context.createElement fails in IE with an error but returns typeof 'object'
|
6316 |
+
if ( typeof context.createElement === "undefined" ) {
|
6317 |
+
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
|
6318 |
+
}
|
6319 |
+
|
6320 |
+
var ret = [], j;
|
6321 |
+
|
6322 |
+
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
6323 |
+
if ( typeof elem === "number" ) {
|
6324 |
+
elem += "";
|
6325 |
+
}
|
6326 |
+
|
6327 |
+
if ( !elem ) {
|
6328 |
+
continue;
|
6329 |
+
}
|
6330 |
+
|
6331 |
+
// Convert html string into DOM nodes
|
6332 |
+
if ( typeof elem === "string" ) {
|
6333 |
+
if ( !rhtml.test( elem ) ) {
|
6334 |
+
elem = context.createTextNode( elem );
|
6335 |
+
} else {
|
6336 |
+
// Fix "XHTML"-style tags in all browsers
|
6337 |
+
elem = elem.replace(rxhtmlTag, "<$1></$2>");
|
6338 |
+
|
6339 |
+
// Trim whitespace, otherwise indexOf won't work as expected
|
6340 |
+
var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
|
6341 |
+
wrap = wrapMap[ tag ] || wrapMap._default,
|
6342 |
+
depth = wrap[0],
|
6343 |
+
div = context.createElement("div");
|
6344 |
+
|
6345 |
+
// Append wrapper element to unknown element safe doc fragment
|
6346 |
+
if ( context === document ) {
|
6347 |
+
// Use the fragment we've already created for this document
|
6348 |
+
safeFragment.appendChild( div );
|
6349 |
+
} else {
|
6350 |
+
// Use a fragment created with the owner document
|
6351 |
+
createSafeFragment( context ).appendChild( div );
|
6352 |
+
}
|
6353 |
+
|
6354 |
+
// Go to html and back, then peel off extra wrappers
|
6355 |
+
div.innerHTML = wrap[1] + elem + wrap[2];
|
6356 |
+
|
6357 |
+
// Move to the right depth
|
6358 |
+
while ( depth-- ) {
|
6359 |
+
div = div.lastChild;
|
6360 |
+
}
|
6361 |
+
|
6362 |
+
// Remove IE's autoinserted <tbody> from table fragments
|
6363 |
+
if ( !jQuery.support.tbody ) {
|
6364 |
+
|
6365 |
+
// String was a <table>, *may* have spurious <tbody>
|
6366 |
+
var hasBody = rtbody.test(elem),
|
6367 |
+
tbody = tag === "table" && !hasBody ?
|
6368 |
+
div.firstChild && div.firstChild.childNodes :
|
6369 |
+
|
6370 |
+
// String was a bare <thead> or <tfoot>
|
6371 |
+
wrap[1] === "<table>" && !hasBody ?
|
6372 |
+
div.childNodes :
|
6373 |
+
[];
|
6374 |
+
|
6375 |
+
for ( j = tbody.length - 1; j >= 0 ; --j ) {
|
6376 |
+
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
|
6377 |
+
tbody[ j ].parentNode.removeChild( tbody[ j ] );
|
6378 |
+
}
|
6379 |
+
}
|
6380 |
+
}
|
6381 |
+
|
6382 |
+
// IE completely kills leading whitespace when innerHTML is used
|
6383 |
+
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
|
6384 |
+
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
|
6385 |
+
}
|
6386 |
+
|
6387 |
+
elem = div.childNodes;
|
6388 |
+
}
|
6389 |
+
}
|
6390 |
+
|
6391 |
+
// Resets defaultChecked for any radios and checkboxes
|
6392 |
+
// about to be appended to the DOM in IE 6/7 (#8060)
|
6393 |
+
var len;
|
6394 |
+
if ( !jQuery.support.appendChecked ) {
|
6395 |
+
if ( elem[0] && typeof (len = elem.length) === "number" ) {
|
6396 |
+
for ( j = 0; j < len; j++ ) {
|
6397 |
+
findInputs( elem[j] );
|
6398 |
+
}
|
6399 |
+
} else {
|
6400 |
+
findInputs( elem );
|
6401 |
+
}
|
6402 |
+
}
|
6403 |
+
|
6404 |
+
if ( elem.nodeType ) {
|
6405 |
+
ret.push( elem );
|
6406 |
+
} else {
|
6407 |
+
ret = jQuery.merge( ret, elem );
|
6408 |
+
}
|
6409 |
+
}
|
6410 |
+
|
6411 |
+
if ( fragment ) {
|
6412 |
+
checkScriptType = function( elem ) {
|
6413 |
+
return !elem.type || rscriptType.test( elem.type );
|
6414 |
+
};
|
6415 |
+
for ( i = 0; ret[i]; i++ ) {
|
6416 |
+
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
|
6417 |
+
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
|
6418 |
+
|
6419 |
+
} else {
|
6420 |
+
if ( ret[i].nodeType === 1 ) {
|
6421 |
+
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
|
6422 |
+
|
6423 |
+
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
6424 |
+
}
|
6425 |
+
fragment.appendChild( ret[i] );
|
6426 |
+
}
|
6427 |
+
}
|
6428 |
+
}
|
6429 |
+
|
6430 |
+
return ret;
|
6431 |
+
},
|
6432 |
+
|
6433 |
+
cleanData: function( elems ) {
|
6434 |
+
var data, id,
|
6435 |
+
cache = jQuery.cache,
|
6436 |
+
special = jQuery.event.special,
|
6437 |
+
deleteExpando = jQuery.support.deleteExpando;
|
6438 |
+
|
6439 |
+
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
6440 |
+
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
|
6441 |
+
continue;
|
6442 |
+
}
|
6443 |
+
|
6444 |
+
id = elem[ jQuery.expando ];
|
6445 |
+
|
6446 |
+
if ( id ) {
|
6447 |
+
data = cache[ id ];
|
6448 |
+
|
6449 |
+
if ( data && data.events ) {
|
6450 |
+
for ( var type in data.events ) {
|
6451 |
+
if ( special[ type ] ) {
|
6452 |
+
jQuery.event.remove( elem, type );
|
6453 |
+
|
6454 |
+
// This is a shortcut to avoid jQuery.event.remove's overhead
|
6455 |
+
} else {
|
6456 |
+
jQuery.removeEvent( elem, type, data.handle );
|
6457 |
+
}
|
6458 |
+
}
|
6459 |
+
|
6460 |
+
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
|
6461 |
+
if ( data.handle ) {
|
6462 |
+
data.handle.elem = null;
|
6463 |
+
}
|
6464 |
+
}
|
6465 |
+
|
6466 |
+
if ( deleteExpando ) {
|
6467 |
+
delete elem[ jQuery.expando ];
|
6468 |
+
|
6469 |
+
} else if ( elem.removeAttribute ) {
|
6470 |
+
elem.removeAttribute( jQuery.expando );
|
6471 |
+
}
|
6472 |
+
|
6473 |
+
delete cache[ id ];
|
6474 |
+
}
|
6475 |
+
}
|
6476 |
+
}
|
6477 |
+
});
|
6478 |
+
|
6479 |
+
function evalScript( i, elem ) {
|
6480 |
+
if ( elem.src ) {
|
6481 |
+
jQuery.ajax({
|
6482 |
+
url: elem.src,
|
6483 |
+
async: false,
|
6484 |
+
dataType: "script"
|
6485 |
+
});
|
6486 |
+
} else {
|
6487 |
+
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
|
6488 |
+
}
|
6489 |
+
|
6490 |
+
if ( elem.parentNode ) {
|
6491 |
+
elem.parentNode.removeChild( elem );
|
6492 |
+
}
|
6493 |
+
}
|
6494 |
+
|
6495 |
+
|
6496 |
+
|
6497 |
+
|
6498 |
+
var ralpha = /alpha\([^)]*\)/i,
|
6499 |
+
ropacity = /opacity=([^)]*)/,
|
6500 |
+
// fixed for IE9, see #8346
|
6501 |
+
rupper = /([A-Z]|^ms)/g,
|
6502 |
+
rnumpx = /^-?\d+(?:px)?$/i,
|
6503 |
+
rnum = /^-?\d/,
|
6504 |
+
rrelNum = /^([\-+])=([\-+.\de]+)/,
|
6505 |
+
|
6506 |
+
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6507 |
+
cssWidth = [ "Left", "Right" ],
|
6508 |
+
cssHeight = [ "Top", "Bottom" ],
|
6509 |
+
curCSS,
|
6510 |
+
|
6511 |
+
getComputedStyle,
|
6512 |
+
currentStyle;
|
6513 |
+
|
6514 |
+
jQuery.fn.css = function( name, value ) {
|
6515 |
+
// Setting 'undefined' is a no-op
|
6516 |
+
if ( arguments.length === 2 && value === undefined ) {
|
6517 |
+
return this;
|
6518 |
+
}
|
6519 |
+
|
6520 |
+
return jQuery.access( this, name, value, true, function( elem, name, value ) {
|
6521 |
+
return value !== undefined ?
|
6522 |
+
jQuery.style( elem, name, value ) :
|
6523 |
+
jQuery.css( elem, name );
|
6524 |
+
});
|
6525 |
+
};
|
6526 |
+
|
6527 |
+
jQuery.extend({
|
6528 |
+
// Add in style property hooks for overriding the default
|
6529 |
+
// behavior of getting and setting a style property
|
6530 |
+
cssHooks: {
|
6531 |
+
opacity: {
|
6532 |
+
get: function( elem, computed ) {
|
6533 |
+
if ( computed ) {
|
6534 |
+
// We should always get a number back from opacity
|
6535 |
+
var ret = curCSS( elem, "opacity", "opacity" );
|
6536 |
+
return ret === "" ? "1" : ret;
|
6537 |
+
|
6538 |
+
} else {
|
6539 |
+
return elem.style.opacity;
|
6540 |
+
}
|
6541 |
+
}
|
6542 |
+
}
|
6543 |
+
},
|
6544 |
+
|
6545 |
+
// Exclude the following css properties to add px
|
6546 |
+
cssNumber: {
|
6547 |
+
"fillOpacity": true,
|
6548 |
+
"fontWeight": true,
|
6549 |
+
"lineHeight": true,
|
6550 |
+
"opacity": true,
|
6551 |
+
"orphans": true,
|
6552 |
+
"widows": true,
|
6553 |
+
"zIndex": true,
|
6554 |
+
"zoom": true
|
6555 |
+
},
|
6556 |
+
|
6557 |
+
// Add in properties whose names you wish to fix before
|
6558 |
+
// setting or getting the value
|
6559 |
+
cssProps: {
|
6560 |
+
// normalize float css property
|
6561 |
+
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
|
6562 |
+
},
|
6563 |
+
|
6564 |
+
// Get and set the style property on a DOM Node
|
6565 |
+
style: function( elem, name, value, extra ) {
|
6566 |
+
// Don't set styles on text and comment nodes
|
6567 |
+
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
6568 |
+
return;
|
6569 |
+
}
|
6570 |
+
|
6571 |
+
// Make sure that we're working with the right name
|
6572 |
+
var ret, type, origName = jQuery.camelCase( name ),
|
6573 |
+
style = elem.style, hooks = jQuery.cssHooks[ origName ];
|
6574 |
+
|
6575 |
+
name = jQuery.cssProps[ origName ] || origName;
|
6576 |
+
|
6577 |
+
// Check if we're setting a value
|
6578 |
+
if ( value !== undefined ) {
|
6579 |
+
type = typeof value;
|
6580 |
+
|
6581 |
+
// convert relative number strings (+= or -=) to relative numbers. #7345
|
6582 |
+
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
|
6583 |
+
value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
|
6584 |
+
// Fixes bug #9237
|
6585 |
+
type = "number";
|
6586 |
+
}
|
6587 |
+
|
6588 |
+
// Make sure that NaN and null values aren't set. See: #7116
|
6589 |
+
if ( value == null || type === "number" && isNaN( value ) ) {
|
6590 |
+
return;
|
6591 |
+
}
|
6592 |
+
|
6593 |
+
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
6594 |
+
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
6595 |
+
value += "px";
|
6596 |
+
}
|
6597 |
+
|
6598 |
+
// If a hook was provided, use that value, otherwise just set the specified value
|
6599 |
+
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
|
6600 |
+
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
|
6601 |
+
// Fixes bug #5509
|
6602 |
+
try {
|
6603 |
+
style[ name ] = value;
|
6604 |
+
} catch(e) {}
|
6605 |
+
}
|
6606 |
+
|
6607 |
+
} else {
|
6608 |
+
// If a hook was provided get the non-computed value from there
|
6609 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
6610 |
+
return ret;
|
6611 |
+
}
|
6612 |
+
|
6613 |
+
// Otherwise just get the value from the style object
|
6614 |
+
return style[ name ];
|
6615 |
+
}
|
6616 |
+
},
|
6617 |
+
|
6618 |
+
css: function( elem, name, extra ) {
|
6619 |
+
var ret, hooks;
|
6620 |
+
|
6621 |
+
// Make sure that we're working with the right name
|
6622 |
+
name = jQuery.camelCase( name );
|
6623 |
+
hooks = jQuery.cssHooks[ name ];
|
6624 |
+
name = jQuery.cssProps[ name ] || name;
|
6625 |
+
|
6626 |
+
// cssFloat needs a special treatment
|
6627 |
+
if ( name === "cssFloat" ) {
|
6628 |
+
name = "float";
|
6629 |
+
}
|
6630 |
+
|
6631 |
+
// If a hook was provided get the computed value from there
|
6632 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
|
6633 |
+
return ret;
|
6634 |
+
|
6635 |
+
// Otherwise, if a way to get the computed value exists, use that
|
6636 |
+
} else if ( curCSS ) {
|
6637 |
+
return curCSS( elem, name );
|
6638 |
+
}
|
6639 |
+
},
|
6640 |
+
|
6641 |
+
// A method for quickly swapping in/out CSS properties to get correct calculations
|
6642 |
+
swap: function( elem, options, callback ) {
|
6643 |
+
var old = {};
|
6644 |
+
|
6645 |
+
// Remember the old values, and insert the new ones
|
6646 |
+
for ( var name in options ) {
|
6647 |
+
old[ name ] = elem.style[ name ];
|
6648 |
+
elem.style[ name ] = options[ name ];
|
6649 |
+
}
|
6650 |
+
|
6651 |
+
callback.call( elem );
|
6652 |
+
|
6653 |
+
// Revert the old values
|
6654 |
+
for ( name in options ) {
|
6655 |
+
elem.style[ name ] = old[ name ];
|
6656 |
+
}
|
6657 |
+
}
|
6658 |
+
});
|
6659 |
+
|
6660 |
+
// DEPRECATED, Use jQuery.css() instead
|
6661 |
+
jQuery.curCSS = jQuery.css;
|
6662 |
+
|
6663 |
+
jQuery.each(["height", "width"], function( i, name ) {
|
6664 |
+
jQuery.cssHooks[ name ] = {
|
6665 |
+
get: function( elem, computed, extra ) {
|
6666 |
+
var val;
|
6667 |
+
|
6668 |
+
if ( computed ) {
|
6669 |
+
if ( elem.offsetWidth !== 0 ) {
|
6670 |
+
return getWH( elem, name, extra );
|
6671 |
+
} else {
|
6672 |
+
jQuery.swap( elem, cssShow, function() {
|
6673 |
+
val = getWH( elem, name, extra );
|
6674 |
+
});
|
6675 |
+
}
|
6676 |
+
|
6677 |
+
return val;
|
6678 |
+
}
|
6679 |
+
},
|
6680 |
+
|
6681 |
+
set: function( elem, value ) {
|
6682 |
+
if ( rnumpx.test( value ) ) {
|
6683 |
+
// ignore negative width and height values #1599
|
6684 |
+
value = parseFloat( value );
|
6685 |
+
|
6686 |
+
if ( value >= 0 ) {
|
6687 |
+
return value + "px";
|
6688 |
+
}
|
6689 |
+
|
6690 |
+
} else {
|
6691 |
+
return value;
|
6692 |
+
}
|
6693 |
+
}
|
6694 |
+
};
|
6695 |
+
});
|
6696 |
+
|
6697 |
+
if ( !jQuery.support.opacity ) {
|
6698 |
+
jQuery.cssHooks.opacity = {
|
6699 |
+
get: function( elem, computed ) {
|
6700 |
+
// IE uses filters for opacity
|
6701 |
+
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
|
6702 |
+
( parseFloat( RegExp.$1 ) / 100 ) + "" :
|
6703 |
+
computed ? "1" : "";
|
6704 |
+
},
|
6705 |
+
|
6706 |
+
set: function( elem, value ) {
|
6707 |
+
var style = elem.style,
|
6708 |
+
currentStyle = elem.currentStyle,
|
6709 |
+
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
|
6710 |
+
filter = currentStyle && currentStyle.filter || style.filter || "";
|
6711 |
+
|
6712 |
+
// IE has trouble with opacity if it does not have layout
|
6713 |
+
// Force it by setting the zoom level
|
6714 |
+
style.zoom = 1;
|
6715 |
+
|
6716 |
+
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
|
6717 |
+
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
|
6718 |
+
|
6719 |
+
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
6720 |
+
// if "filter:" is present at all, clearType is disabled, we want to avoid this
|
6721 |
+
// style.removeAttribute is IE Only, but so apparently is this code path...
|
6722 |
+
style.removeAttribute( "filter" );
|
6723 |
+
|
6724 |
+
// if there there is no filter style applied in a css rule, we are done
|
6725 |
+
if ( currentStyle && !currentStyle.filter ) {
|
6726 |
+
return;
|
6727 |
+
}
|
6728 |
+
}
|
6729 |
+
|
6730 |
+
// otherwise, set new filter values
|
6731 |
+
style.filter = ralpha.test( filter ) ?
|
6732 |
+
filter.replace( ralpha, opacity ) :
|
6733 |
+
filter + " " + opacity;
|
6734 |
+
}
|
6735 |
+
};
|
6736 |
+
}
|
6737 |
+
|
6738 |
+
jQuery(function() {
|
6739 |
+
// This hook cannot be added until DOM ready because the support test
|
6740 |
+
// for it is not run until after DOM ready
|
6741 |
+
if ( !jQuery.support.reliableMarginRight ) {
|
6742 |
+
jQuery.cssHooks.marginRight = {
|
6743 |
+
get: function( elem, computed ) {
|
6744 |
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
6745 |
+
// Work around by temporarily setting element display to inline-block
|
6746 |
+
var ret;
|
6747 |
+
jQuery.swap( elem, { "display": "inline-block" }, function() {
|
6748 |
+
if ( computed ) {
|
6749 |
+
ret = curCSS( elem, "margin-right", "marginRight" );
|
6750 |
+
} else {
|
6751 |
+
ret = elem.style.marginRight;
|
6752 |
+
}
|
6753 |
+
});
|
6754 |
+
return ret;
|
6755 |
+
}
|
6756 |
+
};
|
6757 |
+
}
|
6758 |
+
});
|
6759 |
+
|
6760 |
+
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
6761 |
+
getComputedStyle = function( elem, name ) {
|
6762 |
+
var ret, defaultView, computedStyle;
|
6763 |
+
|
6764 |
+
name = name.replace( rupper, "-$1" ).toLowerCase();
|
6765 |
+
|
6766 |
+
if ( !(defaultView = elem.ownerDocument.defaultView) ) {
|
6767 |
+
return undefined;
|
6768 |
+
}
|
6769 |
+
|
6770 |
+
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
|
6771 |
+
ret = computedStyle.getPropertyValue( name );
|
6772 |
+
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
|
6773 |
+
ret = jQuery.style( elem, name );
|
6774 |
+
}
|
6775 |
+
}
|
6776 |
+
|
6777 |
+
return ret;
|
6778 |
+
};
|
6779 |
+
}
|
6780 |
+
|
6781 |
+
if ( document.documentElement.currentStyle ) {
|
6782 |
+
currentStyle = function( elem, name ) {
|
6783 |
+
var left, rsLeft, uncomputed,
|
6784 |
+
ret = elem.currentStyle && elem.currentStyle[ name ],
|
6785 |
+
style = elem.style;
|
6786 |
+
|
6787 |
+
// Avoid setting ret to empty string here
|
6788 |
+
// so we don't default to auto
|
6789 |
+
if ( ret === null && style && (uncomputed = style[ name ]) ) {
|
6790 |
+
ret = uncomputed;
|
6791 |
+
}
|
6792 |
+
|
6793 |
+
// From the awesome hack by Dean Edwards
|
6794 |
+
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
6795 |
+
|
6796 |
+
// If we're not dealing with a regular pixel number
|
6797 |
+
// but a number that has a weird ending, we need to convert it to pixels
|
6798 |
+
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
|
6799 |
+
|
6800 |
+
// Remember the original values
|
6801 |
+
left = style.left;
|
6802 |
+
rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
|
6803 |
+
|
6804 |
+
// Put in the new values to get a computed value out
|
6805 |
+
if ( rsLeft ) {
|
6806 |
+
elem.runtimeStyle.left = elem.currentStyle.left;
|
6807 |
+
}
|
6808 |
+
style.left = name === "fontSize" ? "1em" : ( ret || 0 );
|
6809 |
+
ret = style.pixelLeft + "px";
|
6810 |
+
|
6811 |
+
// Revert the changed values
|
6812 |
+
style.left = left;
|
6813 |
+
if ( rsLeft ) {
|
6814 |
+
elem.runtimeStyle.left = rsLeft;
|
6815 |
+
}
|
6816 |
+
}
|
6817 |
+
|
6818 |
+
return ret === "" ? "auto" : ret;
|
6819 |
+
};
|
6820 |
+
}
|
6821 |
+
|
6822 |
+
curCSS = getComputedStyle || currentStyle;
|
6823 |
+
|
6824 |
+
function getWH( elem, name, extra ) {
|
6825 |
+
|
6826 |
+
// Start with offset property
|
6827 |
+
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
6828 |
+
which = name === "width" ? cssWidth : cssHeight;
|
6829 |
+
|
6830 |
+
if ( val > 0 ) {
|
6831 |
+
if ( extra !== "border" ) {
|
6832 |
+
jQuery.each( which, function() {
|
6833 |
+
if ( !extra ) {
|
6834 |
+
val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
|
6835 |
+
}
|
6836 |
+
if ( extra === "margin" ) {
|
6837 |
+
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
|
6838 |
+
} else {
|
6839 |
+
val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
|
6840 |
+
}
|
6841 |
+
});
|
6842 |
+
}
|
6843 |
+
|
6844 |
+
return val + "px";
|
6845 |
+
}
|
6846 |
+
|
6847 |
+
// Fall back to computed then uncomputed css if necessary
|
6848 |
+
val = curCSS( elem, name, name );
|
6849 |
+
if ( val < 0 || val == null ) {
|
6850 |
+
val = elem.style[ name ] || 0;
|
6851 |
+
}
|
6852 |
+
// Normalize "", auto, and prepare for extra
|
6853 |
+
val = parseFloat( val ) || 0;
|
6854 |
+
|
6855 |
+
// Add padding, border, margin
|
6856 |
+
if ( extra ) {
|
6857 |
+
jQuery.each( which, function() {
|
6858 |
+
val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
|
6859 |
+
if ( extra !== "padding" ) {
|
6860 |
+
val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
|
6861 |
+
}
|
6862 |
+
if ( extra === "margin" ) {
|
6863 |
+
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
|
6864 |
+
}
|
6865 |
+
});
|
6866 |
+
}
|
6867 |
+
|
6868 |
+
return val + "px";
|
6869 |
+
}
|
6870 |
+
|
6871 |
+
if ( jQuery.expr && jQuery.expr.filters ) {
|
6872 |
+
jQuery.expr.filters.hidden = function( elem ) {
|
6873 |
+
var width = elem.offsetWidth,
|
6874 |
+
height = elem.offsetHeight;
|
6875 |
+
|
6876 |
+
return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
6877 |
+
};
|
6878 |
+
|
6879 |
+
jQuery.expr.filters.visible = function( elem ) {
|
6880 |
+
return !jQuery.expr.filters.hidden( elem );
|
6881 |
+
};
|
6882 |
+
}
|
6883 |
+
|
6884 |
+
|
6885 |
+
|
6886 |
+
|
6887 |
+
var r20 = /%20/g,
|
6888 |
+
rbracket = /\[\]$/,
|
6889 |
+
rCRLF = /\r?\n/g,
|
6890 |
+
rhash = /#.*$/,
|
6891 |
+
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
6892 |
+
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
6893 |
+
// #7653, #8125, #8152: local protocol detection
|
6894 |
+
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
|
6895 |
+
rnoContent = /^(?:GET|HEAD)$/,
|
6896 |
+
rprotocol = /^\/\//,
|
6897 |
+
rquery = /\?/,
|
6898 |
+
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
6899 |
+
rselectTextarea = /^(?:select|textarea)/i,
|
6900 |
+
rspacesAjax = /\s+/,
|
6901 |
+
rts = /([?&])_=[^&]*/,
|
6902 |
+
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
|
6903 |
+
|
6904 |
+
// Keep a copy of the old load method
|
6905 |
+
_load = jQuery.fn.load,
|
6906 |
+
|
6907 |
+
/* Prefilters
|
6908 |
+
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
|
6909 |
+
* 2) These are called:
|
6910 |
+
* - BEFORE asking for a transport
|
6911 |
+
* - AFTER param serialization (s.data is a string if s.processData is true)
|
6912 |
+
* 3) key is the dataType
|
6913 |
+
* 4) the catchall symbol "*" can be used
|
6914 |
+
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
|
6915 |
+
*/
|
6916 |
+
prefilters = {},
|
6917 |
+
|
6918 |
+
/* Transports bindings
|
6919 |
+
* 1) key is the dataType
|
6920 |
+
* 2) the catchall symbol "*" can be used
|
6921 |
+
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
6922 |
+
*/
|
6923 |
+
transports = {},
|
6924 |
+
|
6925 |
+
// Document location
|
6926 |
+
ajaxLocation,
|
6927 |
+
|
6928 |
+
// Document location segments
|
6929 |
+
ajaxLocParts,
|
6930 |
+
|
6931 |
+
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
6932 |
+
allTypes = ["*/"] + ["*"];
|
6933 |
+
|
6934 |
+
// #8138, IE may throw an exception when accessing
|
6935 |
+
// a field from window.location if document.domain has been set
|
6936 |
+
try {
|
6937 |
+
ajaxLocation = location.href;
|
6938 |
+
} catch( e ) {
|
6939 |
+
// Use the href attribute of an A element
|
6940 |
+
// since IE will modify it given document.location
|
6941 |
+
ajaxLocation = document.createElement( "a" );
|
6942 |
+
ajaxLocation.href = "";
|
6943 |
+
ajaxLocation = ajaxLocation.href;
|
6944 |
+
}
|
6945 |
+
|
6946 |
+
// Segment location into parts
|
6947 |
+
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
6948 |
+
|
6949 |
+
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
6950 |
+
function addToPrefiltersOrTransports( structure ) {
|
6951 |
+
|
6952 |
+
// dataTypeExpression is optional and defaults to "*"
|
6953 |
+
return function( dataTypeExpression, func ) {
|
6954 |
+
|
6955 |
+
if ( typeof dataTypeExpression !== "string" ) {
|
6956 |
+
func = dataTypeExpression;
|
6957 |
+
dataTypeExpression = "*";
|
6958 |
+
}
|
6959 |
+
|
6960 |
+
if ( jQuery.isFunction( func ) ) {
|
6961 |
+
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
|
6962 |
+
i = 0,
|
6963 |
+
length = dataTypes.length,
|
6964 |
+
dataType,
|
6965 |
+
list,
|
6966 |
+
placeBefore;
|
6967 |
+
|
6968 |
+
// For each dataType in the dataTypeExpression
|
6969 |
+
for ( ; i < length; i++ ) {
|
6970 |
+
dataType = dataTypes[ i ];
|
6971 |
+
// We control if we're asked to add before
|
6972 |
+
// any existing element
|
6973 |
+
placeBefore = /^\+/.test( dataType );
|
6974 |
+
if ( placeBefore ) {
|
6975 |
+
dataType = dataType.substr( 1 ) || "*";
|
6976 |
+
}
|
6977 |
+
list = structure[ dataType ] = structure[ dataType ] || [];
|
6978 |
+
// then we add to the structure accordingly
|
6979 |
+
list[ placeBefore ? "unshift" : "push" ]( func );
|
6980 |
+
}
|
6981 |
+
}
|
6982 |
+
};
|
6983 |
+
}
|
6984 |
+
|
6985 |
+
// Base inspection function for prefilters and transports
|
6986 |
+
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
|
6987 |
+
dataType /* internal */, inspected /* internal */ ) {
|
6988 |
+
|
6989 |
+
dataType = dataType || options.dataTypes[ 0 ];
|
6990 |
+
inspected = inspected || {};
|
6991 |
+
|
6992 |
+
inspected[ dataType ] = true;
|
6993 |
+
|
6994 |
+
var list = structure[ dataType ],
|
6995 |
+
i = 0,
|
6996 |
+
length = list ? list.length : 0,
|
6997 |
+
executeOnly = ( structure === prefilters ),
|
6998 |
+
selection;
|
6999 |
+
|
7000 |
+
for ( ; i < length && ( executeOnly || !selection ); i++ ) {
|
7001 |
+
selection = list[ i ]( options, originalOptions, jqXHR );
|
7002 |
+
// If we got redirected to another dataType
|
7003 |
+
// we try there if executing only and not done already
|
7004 |
+
if ( typeof selection === "string" ) {
|
7005 |
+
if ( !executeOnly || inspected[ selection ] ) {
|
7006 |
+
selection = undefined;
|
7007 |
+
} else {
|
7008 |
+
options.dataTypes.unshift( selection );
|
7009 |
+
selection = inspectPrefiltersOrTransports(
|
7010 |
+
structure, options, originalOptions, jqXHR, selection, inspected );
|
7011 |
+
}
|
7012 |
+
}
|
7013 |
+
}
|
7014 |
+
// If we're only executing or nothing was selected
|
7015 |
+
// we try the catchall dataType if not done already
|
7016 |
+
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
|
7017 |
+
selection = inspectPrefiltersOrTransports(
|
7018 |
+
structure, options, originalOptions, jqXHR, "*", inspected );
|
7019 |
+
}
|
7020 |
+
// unnecessary when only executing (prefilters)
|
7021 |
+
// but it'll be ignored by the caller in that case
|
7022 |
+
return selection;
|
7023 |
+
}
|
7024 |
+
|
7025 |
+
// A special extend for ajax options
|
7026 |
+
// that takes "flat" options (not to be deep extended)
|
7027 |
+
// Fixes #9887
|
7028 |
+
function ajaxExtend( target, src ) {
|
7029 |
+
var key, deep,
|
7030 |
+
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
7031 |
+
for ( key in src ) {
|
7032 |
+
if ( src[ key ] !== undefined ) {
|
7033 |
+
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
|
7034 |
+
}
|
7035 |
+
}
|
7036 |
+
if ( deep ) {
|
7037 |
+
jQuery.extend( true, target, deep );
|
7038 |
+
}
|
7039 |
+
}
|
7040 |
+
|
7041 |
+
jQuery.fn.extend({
|
7042 |
+
load: function( url, params, callback ) {
|
7043 |
+
if ( typeof url !== "string" && _load ) {
|
7044 |
+
return _load.apply( this, arguments );
|
7045 |
+
|
7046 |
+
// Don't do a request if no elements are being requested
|
7047 |
+
} else if ( !this.length ) {
|
7048 |
+
return this;
|
7049 |
+
}
|
7050 |
+
|
7051 |
+
var off = url.indexOf( " " );
|
7052 |
+
if ( off >= 0 ) {
|
7053 |
+
var selector = url.slice( off, url.length );
|
7054 |
+
url = url.slice( 0, off );
|
7055 |
+
}
|
7056 |
+
|
7057 |
+
// Default to a GET request
|
7058 |
+
var type = "GET";
|
7059 |
+
|
7060 |
+
// If the second parameter was provided
|
7061 |
+
if ( params ) {
|
7062 |
+
// If it's a function
|
7063 |
+
if ( jQuery.isFunction( params ) ) {
|
7064 |
+
// We assume that it's the callback
|
7065 |
+
callback = params;
|
7066 |
+
params = undefined;
|
7067 |
+
|
7068 |
+
// Otherwise, build a param string
|
7069 |
+
} else if ( typeof params === "object" ) {
|
7070 |
+
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
|
7071 |
+
type = "POST";
|
7072 |
+
}
|
7073 |
+
}
|
7074 |
+
|
7075 |
+
var self = this;
|
7076 |
+
|
7077 |
+
// Request the remote document
|
7078 |
+
jQuery.ajax({
|
7079 |
+
url: url,
|
7080 |
+
type: type,
|
7081 |
+
dataType: "html",
|
7082 |
+
data: params,
|
7083 |
+
// Complete callback (responseText is used internally)
|
7084 |
+
complete: function( jqXHR, status, responseText ) {
|
7085 |
+
// Store the response as specified by the jqXHR object
|
7086 |
+
responseText = jqXHR.responseText;
|
7087 |
+
// If successful, inject the HTML into all the matched elements
|
7088 |
+
if ( jqXHR.isResolved() ) {
|
7089 |
+
// #4825: Get the actual response in case
|
7090 |
+
// a dataFilter is present in ajaxSettings
|
7091 |
+
jqXHR.done(function( r ) {
|
7092 |
+
responseText = r;
|
7093 |
+
});
|
7094 |
+
// See if a selector was specified
|
7095 |
+
self.html( selector ?
|
7096 |
+
// Create a dummy div to hold the results
|
7097 |
+
jQuery("<div>")
|
7098 |
+
// inject the contents of the document in, removing the scripts
|
7099 |
+
// to avoid any 'Permission Denied' errors in IE
|
7100 |
+
.append(responseText.replace(rscript, ""))
|
7101 |
+
|
7102 |
+
// Locate the specified elements
|
7103 |
+
.find(selector) :
|
7104 |
+
|
7105 |
+
// If not, just inject the full result
|
7106 |
+
responseText );
|
7107 |
+
}
|
7108 |
+
|
7109 |
+
if ( callback ) {
|
7110 |
+
self.each( callback, [ responseText, status, jqXHR ] );
|
7111 |
+
}
|
7112 |
+
}
|
7113 |
+
});
|
7114 |
+
|
7115 |
+
return this;
|
7116 |
+
},
|
7117 |
+
|
7118 |
+
serialize: function() {
|
7119 |
+
return jQuery.param( this.serializeArray() );
|
7120 |
+
},
|
7121 |
+
|
7122 |
+
serializeArray: function() {
|
7123 |
+
return this.map(function(){
|
7124 |
+
return this.elements ? jQuery.makeArray( this.elements ) : this;
|
7125 |
+
})
|
7126 |
+
.filter(function(){
|
7127 |
+
return this.name && !this.disabled &&
|
7128 |
+
( this.checked || rselectTextarea.test( this.nodeName ) ||
|
7129 |
+
rinput.test( this.type ) );
|
7130 |
+
})
|
7131 |
+
.map(function( i, elem ){
|
7132 |
+
var val = jQuery( this ).val();
|
7133 |
+
|
7134 |
+
return val == null ?
|
7135 |
+
null :
|
7136 |
+
jQuery.isArray( val ) ?
|
7137 |
+
jQuery.map( val, function( val, i ){
|
7138 |
+
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
7139 |
+
}) :
|
7140 |
+
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
7141 |
+
}).get();
|
7142 |
+
}
|
7143 |
+
});
|
7144 |
+
|
7145 |
+
// Attach a bunch of functions for handling common AJAX events
|
7146 |
+
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
|
7147 |
+
jQuery.fn[ o ] = function( f ){
|
7148 |
+
return this.bind( o, f );
|
7149 |
+
};
|
7150 |
+
});
|
7151 |
+
|
7152 |
+
jQuery.each( [ "get", "post" ], function( i, method ) {
|
7153 |
+
jQuery[ method ] = function( url, data, callback, type ) {
|
7154 |
+
// shift arguments if data argument was omitted
|
7155 |
+
if ( jQuery.isFunction( data ) ) {
|
7156 |
+
type = type || callback;
|
7157 |
+
callback = data;
|
7158 |
+
data = undefined;
|
7159 |
+
}
|
7160 |
+
|
7161 |
+
return jQuery.ajax({
|
7162 |
+
type: method,
|
7163 |
+
url: url,
|
7164 |
+
data: data,
|
7165 |
+
success: callback,
|
7166 |
+
dataType: type
|
7167 |
+
});
|
7168 |
+
};
|
7169 |
+
});
|
7170 |
+
|
7171 |
+
jQuery.extend({
|
7172 |
+
|
7173 |
+
getScript: function( url, callback ) {
|
7174 |
+
return jQuery.get( url, undefined, callback, "script" );
|
7175 |
+
},
|
7176 |
+
|
7177 |
+
getJSON: function( url, data, callback ) {
|
7178 |
+
return jQuery.get( url, data, callback, "json" );
|
7179 |
+
},
|
7180 |
+
|
7181 |
+
// Creates a full fledged settings object into target
|
7182 |
+
// with both ajaxSettings and settings fields.
|
7183 |
+
// If target is omitted, writes into ajaxSettings.
|
7184 |
+
ajaxSetup: function( target, settings ) {
|
7185 |
+
if ( settings ) {
|
7186 |
+
// Building a settings object
|
7187 |
+
ajaxExtend( target, jQuery.ajaxSettings );
|
7188 |
+
} else {
|
7189 |
+
// Extending ajaxSettings
|
7190 |
+
settings = target;
|
7191 |
+
target = jQuery.ajaxSettings;
|
7192 |
+
}
|
7193 |
+
ajaxExtend( target, settings );
|
7194 |
+
return target;
|
7195 |
+
},
|
7196 |
+
|
7197 |
+
ajaxSettings: {
|
7198 |
+
url: ajaxLocation,
|
7199 |
+
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
7200 |
+
global: true,
|
7201 |
+
type: "GET",
|
7202 |
+
contentType: "application/x-www-form-urlencoded",
|
7203 |
+
processData: true,
|
7204 |
+
async: true,
|
7205 |
+
/*
|
7206 |
+
timeout: 0,
|
7207 |
+
data: null,
|
7208 |
+
dataType: null,
|
7209 |
+
username: null,
|
7210 |
+
password: null,
|
7211 |
+
cache: null,
|
7212 |
+
traditional: false,
|
7213 |
+
headers: {},
|
7214 |
+
*/
|
7215 |
+
|
7216 |
+
accepts: {
|
7217 |
+
xml: "application/xml, text/xml",
|
7218 |
+
html: "text/html",
|
7219 |
+
text: "text/plain",
|
7220 |
+
json: "application/json, text/javascript",
|
7221 |
+
"*": allTypes
|
7222 |
+
},
|
7223 |
+
|
7224 |
+
contents: {
|
7225 |
+
xml: /xml/,
|
7226 |
+
html: /html/,
|
7227 |
+
json: /json/
|
7228 |
+
},
|
7229 |
+
|
7230 |
+
responseFields: {
|
7231 |
+
xml: "responseXML",
|
7232 |
+
text: "responseText"
|
7233 |
+
},
|
7234 |
+
|
7235 |
+
// List of data converters
|
7236 |
+
// 1) key format is "source_type destination_type" (a single space in-between)
|
7237 |
+
// 2) the catchall symbol "*" can be used for source_type
|
7238 |
+
converters: {
|
7239 |
+
|
7240 |
+
// Convert anything to text
|
7241 |
+
"* text": window.String,
|
7242 |
+
|
7243 |
+
// Text to html (true = no transformation)
|
7244 |
+
"text html": true,
|
7245 |
+
|
7246 |
+
// Evaluate text as a json expression
|
7247 |
+
"text json": jQuery.parseJSON,
|
7248 |
+
|
7249 |
+
// Parse text as xml
|
7250 |
+
"text xml": jQuery.parseXML
|
7251 |
+
},
|
7252 |
+
|
7253 |
+
// For options that shouldn't be deep extended:
|
7254 |
+
// you can add your own custom options here if
|
7255 |
+
// and when you create one that shouldn't be
|
7256 |
+
// deep extended (see ajaxExtend)
|
7257 |
+
flatOptions: {
|
7258 |
+
context: true,
|
7259 |
+
url: true
|
7260 |
+
}
|
7261 |
+
},
|
7262 |
+
|
7263 |
+
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
7264 |
+
ajaxTransport: addToPrefiltersOrTransports( transports ),
|
7265 |
+
|
7266 |
+
// Main method
|
7267 |
+
ajax: function( url, options ) {
|
7268 |
+
|
7269 |
+
// If url is an object, simulate pre-1.5 signature
|
7270 |
+
if ( typeof url === "object" ) {
|
7271 |
+
options = url;
|
7272 |
+
url = undefined;
|
7273 |
+
}
|
7274 |
+
|
7275 |
+
// Force options to be an object
|
7276 |
+
options = options || {};
|
7277 |
+
|
7278 |
+
var // Create the final options object
|
7279 |
+
s = jQuery.ajaxSetup( {}, options ),
|
7280 |
+
// Callbacks context
|
7281 |
+
callbackContext = s.context || s,
|
7282 |
+
// Context for global events
|
7283 |
+
// It's the callbackContext if one was provided in the options
|
7284 |
+
// and if it's a DOM node or a jQuery collection
|
7285 |
+
globalEventContext = callbackContext !== s &&
|
7286 |
+
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
|
7287 |
+
jQuery( callbackContext ) : jQuery.event,
|
7288 |
+
// Deferreds
|
7289 |
+
deferred = jQuery.Deferred(),
|
7290 |
+
completeDeferred = jQuery.Callbacks( "once memory" ),
|
7291 |
+
// Status-dependent callbacks
|
7292 |
+
statusCode = s.statusCode || {},
|
7293 |
+
// ifModified key
|
7294 |
+
ifModifiedKey,
|
7295 |
+
// Headers (they are sent all at once)
|
7296 |
+
requestHeaders = {},
|
7297 |
+
requestHeadersNames = {},
|
7298 |
+
// Response headers
|
7299 |
+
responseHeadersString,
|
7300 |
+
responseHeaders,
|
7301 |
+
// transport
|
7302 |
+
transport,
|
7303 |
+
// timeout handle
|
7304 |
+
timeoutTimer,
|
7305 |
+
// Cross-domain detection vars
|
7306 |
+
parts,
|
7307 |
+
// The jqXHR state
|
7308 |
+
state = 0,
|
7309 |
+
// To know if global events are to be dispatched
|
7310 |
+
fireGlobals,
|
7311 |
+
// Loop variable
|
7312 |
+
i,
|
7313 |
+
// Fake xhr
|
7314 |
+
jqXHR = {
|
7315 |
+
|
7316 |
+
readyState: 0,
|
7317 |
+
|
7318 |
+
// Caches the header
|
7319 |
+
setRequestHeader: function( name, value ) {
|
7320 |
+
if ( !state ) {
|
7321 |
+
var lname = name.toLowerCase();
|
7322 |
+
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
7323 |
+
requestHeaders[ name ] = value;
|
7324 |
+
}
|
7325 |
+
return this;
|
7326 |
+
},
|
7327 |
+
|
7328 |
+
// Raw string
|
7329 |
+
getAllResponseHeaders: function() {
|
7330 |
+
return state === 2 ? responseHeadersString : null;
|
7331 |
+
},
|
7332 |
+
|
7333 |
+
// Builds headers hashtable if needed
|
7334 |
+
getResponseHeader: function( key ) {
|
7335 |
+
var match;
|
7336 |
+
if ( state === 2 ) {
|
7337 |
+
if ( !responseHeaders ) {
|
7338 |
+
responseHeaders = {};
|
7339 |
+
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
7340 |
+
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
|
7341 |
+
}
|
7342 |
+
}
|
7343 |
+
match = responseHeaders[ key.toLowerCase() ];
|
7344 |
+
}
|
7345 |
+
return match === undefined ? null : match;
|
7346 |
+
},
|
7347 |
+
|
7348 |
+
// Overrides response content-type header
|
7349 |
+
overrideMimeType: function( type ) {
|
7350 |
+
if ( !state ) {
|
7351 |
+
s.mimeType = type;
|
7352 |
+
}
|
7353 |
+
return this;
|
7354 |
+
},
|
7355 |
+
|
7356 |
+
// Cancel the request
|
7357 |
+
abort: function( statusText ) {
|
7358 |
+
statusText = statusText || "abort";
|
7359 |
+
if ( transport ) {
|
7360 |
+
transport.abort( statusText );
|
7361 |
+
}
|
7362 |
+
done( 0, statusText );
|
7363 |
+
return this;
|
7364 |
+
}
|
7365 |
+
};
|
7366 |
+
|
7367 |
+
// Callback for when everything is done
|
7368 |
+
// It is defined here because jslint complains if it is declared
|
7369 |
+
// at the end of the function (which would be more logical and readable)
|
7370 |
+
function done( status, nativeStatusText, responses, headers ) {
|
7371 |
+
|
7372 |
+
// Called once
|
7373 |
+
if ( state === 2 ) {
|
7374 |
+
return;
|
7375 |
+
}
|
7376 |
+
|
7377 |
+
// State is "done" now
|
7378 |
+
state = 2;
|
7379 |
+
|
7380 |
+
// Clear timeout if it exists
|
7381 |
+
if ( timeoutTimer ) {
|
7382 |
+
clearTimeout( timeoutTimer );
|
7383 |
+
}
|
7384 |
+
|
7385 |
+
// Dereference transport for early garbage collection
|
7386 |
+
// (no matter how long the jqXHR object will be used)
|
7387 |
+
transport = undefined;
|
7388 |
+
|
7389 |
+
// Cache response headers
|
7390 |
+
responseHeadersString = headers || "";
|
7391 |
+
|
7392 |
+
// Set readyState
|
7393 |
+
jqXHR.readyState = status > 0 ? 4 : 0;
|
7394 |
+
|
7395 |
+
var isSuccess,
|
7396 |
+
success,
|
7397 |
+
error,
|
7398 |
+
statusText = nativeStatusText,
|
7399 |
+
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
|
7400 |
+
lastModified,
|
7401 |
+
etag;
|
7402 |
+
|
7403 |
+
// If successful, handle type chaining
|
7404 |
+
if ( status >= 200 && status < 300 || status === 304 ) {
|
7405 |
+
|
7406 |
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
7407 |
+
if ( s.ifModified ) {
|
7408 |
+
|
7409 |
+
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
|
7410 |
+
jQuery.lastModified[ ifModifiedKey ] = lastModified;
|
7411 |
+
}
|
7412 |
+
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
|
7413 |
+
jQuery.etag[ ifModifiedKey ] = etag;
|
7414 |
+
}
|
7415 |
+
}
|
7416 |
+
|
7417 |
+
// If not modified
|
7418 |
+
if ( status === 304 ) {
|
7419 |
+
|
7420 |
+
statusText = "notmodified";
|
7421 |
+
isSuccess = true;
|
7422 |
+
|
7423 |
+
// If we have data
|
7424 |
+
} else {
|
7425 |
+
|
7426 |
+
try {
|
7427 |
+
success = ajaxConvert( s, response );
|
7428 |
+
statusText = "success";
|
7429 |
+
isSuccess = true;
|
7430 |
+
} catch(e) {
|
7431 |
+
// We have a parsererror
|
7432 |
+
statusText = "parsererror";
|
7433 |
+
error = e;
|
7434 |
+
}
|
7435 |
+
}
|
7436 |
+
} else {
|
7437 |
+
// We extract error from statusText
|
7438 |
+
// then normalize statusText and status for non-aborts
|
7439 |
+
error = statusText;
|
7440 |
+
if ( !statusText || status ) {
|
7441 |
+
statusText = "error";
|
7442 |
+
if ( status < 0 ) {
|
7443 |
+
status = 0;
|
7444 |
+
}
|
7445 |
+
}
|
7446 |
+
}
|
7447 |
+
|
7448 |
+
// Set data for the fake xhr object
|
7449 |
+
jqXHR.status = status;
|
7450 |
+
jqXHR.statusText = "" + ( nativeStatusText || statusText );
|
7451 |
+
|
7452 |
+
// Success/Error
|
7453 |
+
if ( isSuccess ) {
|
7454 |
+
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
7455 |
+
} else {
|
7456 |
+
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
7457 |
+
}
|
7458 |
+
|
7459 |
+
// Status-dependent callbacks
|
7460 |
+
jqXHR.statusCode( statusCode );
|
7461 |
+
statusCode = undefined;
|
7462 |
+
|
7463 |
+
if ( fireGlobals ) {
|
7464 |
+
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
|
7465 |
+
[ jqXHR, s, isSuccess ? success : error ] );
|
7466 |
+
}
|
7467 |
+
|
7468 |
+
// Complete
|
7469 |
+
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
7470 |
+
|
7471 |
+
if ( fireGlobals ) {
|
7472 |
+
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
7473 |
+
// Handle the global AJAX counter
|
7474 |
+
if ( !( --jQuery.active ) ) {
|
7475 |
+
jQuery.event.trigger( "ajaxStop" );
|
7476 |
+
}
|
7477 |
+
}
|
7478 |
+
}
|
7479 |
+
|
7480 |
+
// Attach deferreds
|
7481 |
+
deferred.promise( jqXHR );
|
7482 |
+
jqXHR.success = jqXHR.done;
|
7483 |
+
jqXHR.error = jqXHR.fail;
|
7484 |
+
jqXHR.complete = completeDeferred.add;
|
7485 |
+
|
7486 |
+
// Status-dependent callbacks
|
7487 |
+
jqXHR.statusCode = function( map ) {
|
7488 |
+
if ( map ) {
|
7489 |
+
var tmp;
|
7490 |
+
if ( state < 2 ) {
|
7491 |
+
for ( tmp in map ) {
|
7492 |
+
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
|
7493 |
+
}
|
7494 |
+
} else {
|
7495 |
+
tmp = map[ jqXHR.status ];
|
7496 |
+
jqXHR.then( tmp, tmp );
|
7497 |
+
}
|
7498 |
+
}
|
7499 |
+
return this;
|
7500 |
+
};
|
7501 |
+
|
7502 |
+
// Remove hash character (#7531: and string promotion)
|
7503 |
+
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
7504 |
+
// We also use the url parameter if available
|
7505 |
+
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
7506 |
+
|
7507 |
+
// Extract dataTypes list
|
7508 |
+
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
|
7509 |
+
|
7510 |
+
// Determine if a cross-domain request is in order
|
7511 |
+
if ( s.crossDomain == null ) {
|
7512 |
+
parts = rurl.exec( s.url.toLowerCase() );
|
7513 |
+
s.crossDomain = !!( parts &&
|
7514 |
+
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
|
7515 |
+
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
|
7516 |
+
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
|
7517 |
+
);
|
7518 |
+
}
|
7519 |
+
|
7520 |
+
// Convert data if not already a string
|
7521 |
+
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
7522 |
+
s.data = jQuery.param( s.data, s.traditional );
|
7523 |
+
}
|
7524 |
+
|
7525 |
+
// Apply prefilters
|
7526 |
+
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
7527 |
+
|
7528 |
+
// If request was aborted inside a prefiler, stop there
|
7529 |
+
if ( state === 2 ) {
|
7530 |
+
return false;
|
7531 |
+
}
|
7532 |
+
|
7533 |
+
// We can fire global events as of now if asked to
|
7534 |
+
fireGlobals = s.global;
|
7535 |
+
|
7536 |
+
// Uppercase the type
|
7537 |
+
s.type = s.type.toUpperCase();
|
7538 |
+
|
7539 |
+
// Determine if request has content
|
7540 |
+
s.hasContent = !rnoContent.test( s.type );
|
7541 |
+
|
7542 |
+
// Watch for a new set of requests
|
7543 |
+
if ( fireGlobals && jQuery.active++ === 0 ) {
|
7544 |
+
jQuery.event.trigger( "ajaxStart" );
|
7545 |
+
}
|
7546 |
+
|
7547 |
+
// More options handling for requests with no content
|
7548 |
+
if ( !s.hasContent ) {
|
7549 |
+
|
7550 |
+
// If data is available, append data to url
|
7551 |
+
if ( s.data ) {
|
7552 |
+
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
|
7553 |
+
// #9682: remove data so that it's not used in an eventual retry
|
7554 |
+
delete s.data;
|
7555 |
+
}
|
7556 |
+
|
7557 |
+
// Get ifModifiedKey before adding the anti-cache parameter
|
7558 |
+
ifModifiedKey = s.url;
|
7559 |
+
|
7560 |
+
// Add anti-cache in url if needed
|
7561 |
+
if ( s.cache === false ) {
|
7562 |
+
|
7563 |
+
var ts = jQuery.now(),
|
7564 |
+
// try replacing _= if it is there
|
7565 |
+
ret = s.url.replace( rts, "$1_=" + ts );
|
7566 |
+
|
7567 |
+
// if nothing was replaced, add timestamp to the end
|
7568 |
+
s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
|
7569 |
+
}
|
7570 |
+
}
|
7571 |
+
|
7572 |
+
// Set the correct header, if data is being sent
|
7573 |
+
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
7574 |
+
jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
7575 |
+
}
|
7576 |
+
|
7577 |
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
7578 |
+
if ( s.ifModified ) {
|
7579 |
+
ifModifiedKey = ifModifiedKey || s.url;
|
7580 |
+
if ( jQuery.lastModified[ ifModifiedKey ] ) {
|
7581 |
+
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
|
7582 |
+
}
|
7583 |
+
if ( jQuery.etag[ ifModifiedKey ] ) {
|
7584 |
+
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
|
7585 |
+
}
|
7586 |
+
}
|
7587 |
+
|
7588 |
+
// Set the Accepts header for the server, depending on the dataType
|
7589 |
+
jqXHR.setRequestHeader(
|
7590 |
+
"Accept",
|
7591 |
+
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
7592 |
+
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
7593 |
+
s.accepts[ "*" ]
|
7594 |
+
);
|
7595 |
+
|
7596 |
+
// Check for headers option
|
7597 |
+
for ( i in s.headers ) {
|
7598 |
+
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
7599 |
+
}
|
7600 |
+
|
7601 |
+
// Allow custom headers/mimetypes and early abort
|
7602 |
+
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
7603 |
+
// Abort if not done already
|
7604 |
+
jqXHR.abort();
|
7605 |
+
return false;
|
7606 |
+
|
7607 |
+
}
|
7608 |
+
|
7609 |
+
// Install callbacks on deferreds
|
7610 |
+
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
7611 |
+
jqXHR[ i ]( s[ i ] );
|
7612 |
+
}
|
7613 |
+
|
7614 |
+
// Get transport
|
7615 |
+
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
7616 |
+
|
7617 |
+
// If no transport, we auto-abort
|
7618 |
+
if ( !transport ) {
|
7619 |
+
done( -1, "No Transport" );
|
7620 |
+
} else {
|
7621 |
+
jqXHR.readyState = 1;
|
7622 |
+
// Send global event
|
7623 |
+
if ( fireGlobals ) {
|
7624 |
+
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
7625 |
+
}
|
7626 |
+
// Timeout
|
7627 |
+
if ( s.async && s.timeout > 0 ) {
|
7628 |
+
timeoutTimer = setTimeout( function(){
|
7629 |
+
jqXHR.abort( "timeout" );
|
7630 |
+
}, s.timeout );
|
7631 |
+
}
|
7632 |
+
|
7633 |
+
try {
|
7634 |
+
state = 1;
|
7635 |
+
transport.send( requestHeaders, done );
|
7636 |
+
} catch (e) {
|
7637 |
+
// Propagate exception as error if not done
|
7638 |
+
if ( state < 2 ) {
|
7639 |
+
done( -1, e );
|
7640 |
+
// Simply rethrow otherwise
|
7641 |
+
} else {
|
7642 |
+
jQuery.error( e );
|
7643 |
+
}
|
7644 |
+
}
|
7645 |
+
}
|
7646 |
+
|
7647 |
+
return jqXHR;
|
7648 |
+
},
|
7649 |
+
|
7650 |
+
// Serialize an array of form elements or a set of
|
7651 |
+
// key/values into a query string
|
7652 |
+
param: function( a, traditional ) {
|
7653 |
+
var s = [],
|
7654 |
+
add = function( key, value ) {
|
7655 |
+
// If value is a function, invoke it and return its value
|
7656 |
+
value = jQuery.isFunction( value ) ? value() : value;
|
7657 |
+
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
7658 |
+
};
|
7659 |
+
|
7660 |
+
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
7661 |
+
if ( traditional === undefined ) {
|
7662 |
+
traditional = jQuery.ajaxSettings.traditional;
|
7663 |
+
}
|
7664 |
+
|
7665 |
+
// If an array was passed in, assume that it is an array of form elements.
|
7666 |
+
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
7667 |
+
// Serialize the form elements
|
7668 |
+
jQuery.each( a, function() {
|
7669 |
+
add( this.name, this.value );
|
7670 |
+
});
|
7671 |
+
|
7672 |
+
} else {
|
7673 |
+
// If traditional, encode the "old" way (the way 1.3.2 or older
|
7674 |
+
// did it), otherwise encode params recursively.
|
7675 |
+
for ( var prefix in a ) {
|
7676 |
+
buildParams( prefix, a[ prefix ], traditional, add );
|
7677 |
+
}
|
7678 |
+
}
|
7679 |
+
|
7680 |
+
// Return the resulting serialization
|
7681 |
+
return s.join( "&" ).replace( r20, "+" );
|
7682 |
+
}
|
7683 |
+
});
|
7684 |
+
|
7685 |
+
function buildParams( prefix, obj, traditional, add ) {
|
7686 |
+
if ( jQuery.isArray( obj ) ) {
|
7687 |
+
// Serialize array item.
|
7688 |
+
jQuery.each( obj, function( i, v ) {
|
7689 |
+
if ( traditional || rbracket.test( prefix ) ) {
|
7690 |
+
// Treat each array item as a scalar.
|
7691 |
+
add( prefix, v );
|
7692 |
+
|
7693 |
+
} else {
|
7694 |
+
// If array item is non-scalar (array or object), encode its
|
7695 |
+
// numeric index to resolve deserialization ambiguity issues.
|
7696 |
+
// Note that rack (as of 1.0.0) can't currently deserialize
|
7697 |
+
// nested arrays properly, and attempting to do so may cause
|
7698 |
+
// a server error. Possible fixes are to modify rack's
|
7699 |
+
// deserialization algorithm or to provide an option or flag
|
7700 |
+
// to force array serialization to be shallow.
|
7701 |
+
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
|
7702 |
+
}
|
7703 |
+
});
|
7704 |
+
|
7705 |
+
} else if ( !traditional && obj != null && typeof obj === "object" ) {
|
7706 |
+
// Serialize object item.
|
7707 |
+
for ( var name in obj ) {
|
7708 |
+
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
7709 |
+
}
|
7710 |
+
|
7711 |
+
} else {
|
7712 |
+
// Serialize scalar item.
|
7713 |
+
add( prefix, obj );
|
7714 |
+
}
|
7715 |
+
}
|
7716 |
+
|
7717 |
+
// This is still on the jQuery object... for now
|
7718 |
+
// Want to move this to jQuery.ajax some day
|
7719 |
+
jQuery.extend({
|
7720 |
+
|
7721 |
+
// Counter for holding the number of active queries
|
7722 |
+
active: 0,
|
7723 |
+
|
7724 |
+
// Last-Modified header cache for next request
|
7725 |
+
lastModified: {},
|
7726 |
+
etag: {}
|
7727 |
+
|
7728 |
+
});
|
7729 |
+
|
7730 |
+
/* Handles responses to an ajax request:
|
7731 |
+
* - sets all responseXXX fields accordingly
|
7732 |
+
* - finds the right dataType (mediates between content-type and expected dataType)
|
7733 |
+
* - returns the corresponding response
|
7734 |
+
*/
|
7735 |
+
function ajaxHandleResponses( s, jqXHR, responses ) {
|
7736 |
+
|
7737 |
+
var contents = s.contents,
|
7738 |
+
dataTypes = s.dataTypes,
|
7739 |
+
responseFields = s.responseFields,
|
7740 |
+
ct,
|
7741 |
+
type,
|
7742 |
+
finalDataType,
|
7743 |
+
firstDataType;
|
7744 |
+
|
7745 |
+
// Fill responseXXX fields
|
7746 |
+
for ( type in responseFields ) {
|
7747 |
+
if ( type in responses ) {
|
7748 |
+
jqXHR[ responseFields[type] ] = responses[ type ];
|
7749 |
+
}
|
7750 |
+
}
|
7751 |
+
|
7752 |
+
// Remove auto dataType and get content-type in the process
|
7753 |
+
while( dataTypes[ 0 ] === "*" ) {
|
7754 |
+
dataTypes.shift();
|
7755 |
+
if ( ct === undefined ) {
|
7756 |
+
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
|
7757 |
+
}
|
7758 |
+
}
|
7759 |
+
|
7760 |
+
// Check if we're dealing with a known content-type
|
7761 |
+
if ( ct ) {
|
7762 |
+
for ( type in contents ) {
|
7763 |
+
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
7764 |
+
dataTypes.unshift( type );
|
7765 |
+
break;
|
7766 |
+
}
|
7767 |
+
}
|
7768 |
+
}
|
7769 |
+
|
7770 |
+
// Check to see if we have a response for the expected dataType
|
7771 |
+
if ( dataTypes[ 0 ] in responses ) {
|
7772 |
+
finalDataType = dataTypes[ 0 ];
|
7773 |
+
} else {
|
7774 |
+
// Try convertible dataTypes
|
7775 |
+
for ( type in responses ) {
|
7776 |
+
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
7777 |
+
finalDataType = type;
|
7778 |
+
break;
|
7779 |
+
}
|
7780 |
+
if ( !firstDataType ) {
|
7781 |
+
firstDataType = type;
|
7782 |
+
}
|
7783 |
+
}
|
7784 |
+
// Or just use first one
|
7785 |
+
finalDataType = finalDataType || firstDataType;
|
7786 |
+
}
|
7787 |
+
|
7788 |
+
// If we found a dataType
|
7789 |
+
// We add the dataType to the list if needed
|
7790 |
+
// and return the corresponding response
|
7791 |
+
if ( finalDataType ) {
|
7792 |
+
if ( finalDataType !== dataTypes[ 0 ] ) {
|
7793 |
+
dataTypes.unshift( finalDataType );
|
7794 |
+
}
|
7795 |
+
return responses[ finalDataType ];
|
7796 |
+
}
|
7797 |
+
}
|
7798 |
+
|
7799 |
+
// Chain conversions given the request and the original response
|
7800 |
+
function ajaxConvert( s, response ) {
|
7801 |
+
|
7802 |
+
// Apply the dataFilter if provided
|
7803 |
+
if ( s.dataFilter ) {
|
7804 |
+
response = s.dataFilter( response, s.dataType );
|
7805 |
+
}
|
7806 |
+
|
7807 |
+
var dataTypes = s.dataTypes,
|
7808 |
+
converters = {},
|
7809 |
+
i,
|
7810 |
+
key,
|
7811 |
+
length = dataTypes.length,
|
7812 |
+
tmp,
|
7813 |
+
// Current and previous dataTypes
|
7814 |
+
current = dataTypes[ 0 ],
|
7815 |
+
prev,
|
7816 |
+
// Conversion expression
|
7817 |
+
conversion,
|
7818 |
+
// Conversion function
|
7819 |
+
conv,
|
7820 |
+
// Conversion functions (transitive conversion)
|
7821 |
+
conv1,
|
7822 |
+
conv2;
|
7823 |
+
|
7824 |
+
// For each dataType in the chain
|
7825 |
+
for ( i = 1; i < length; i++ ) {
|
7826 |
+
|
7827 |
+
// Create converters map
|
7828 |
+
// with lowercased keys
|
7829 |
+
if ( i === 1 ) {
|
7830 |
+
for ( key in s.converters ) {
|
7831 |
+
if ( typeof key === "string" ) {
|
7832 |
+
converters[ key.toLowerCase() ] = s.converters[ key ];
|
7833 |
+
}
|
7834 |
+
}
|
7835 |
+
}
|
7836 |
+
|
7837 |
+
// Get the dataTypes
|
7838 |
+
prev = current;
|
7839 |
+
current = dataTypes[ i ];
|
7840 |
+
|
7841 |
+
// If current is auto dataType, update it to prev
|
7842 |
+
if ( current === "*" ) {
|
7843 |
+
current = prev;
|
7844 |
+
// If no auto and dataTypes are actually different
|
7845 |
+
} else if ( prev !== "*" && prev !== current ) {
|
7846 |
+
|
7847 |
+
// Get the converter
|
7848 |
+
conversion = prev + " " + current;
|
7849 |
+
conv = converters[ conversion ] || converters[ "* " + current ];
|
7850 |
+
|
7851 |
+
// If there is no direct converter, search transitively
|
7852 |
+
if ( !conv ) {
|
7853 |
+
conv2 = undefined;
|
7854 |
+
for ( conv1 in converters ) {
|
7855 |
+
tmp = conv1.split( " " );
|
7856 |
+
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
|
7857 |
+
conv2 = converters[ tmp[1] + " " + current ];
|
7858 |
+
if ( conv2 ) {
|
7859 |
+
conv1 = converters[ conv1 ];
|
7860 |
+
if ( conv1 === true ) {
|
7861 |
+
conv = conv2;
|
7862 |
+
} else if ( conv2 === true ) {
|
7863 |
+
conv = conv1;
|
7864 |
+
}
|
7865 |
+
break;
|
7866 |
+
}
|
7867 |
+
}
|
7868 |
+
}
|
7869 |
+
}
|
7870 |
+
// If we found no converter, dispatch an error
|
7871 |
+
if ( !( conv || conv2 ) ) {
|
7872 |
+
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
|
7873 |
+
}
|
7874 |
+
// If found converter is not an equivalence
|
7875 |
+
if ( conv !== true ) {
|
7876 |
+
// Convert with 1 or 2 converters accordingly
|
7877 |
+
response = conv ? conv( response ) : conv2( conv1(response) );
|
7878 |
+
}
|
7879 |
+
}
|
7880 |
+
}
|
7881 |
+
return response;
|
7882 |
+
}
|
7883 |
+
|
7884 |
+
|
7885 |
+
|
7886 |
+
|
7887 |
+
var jsc = jQuery.now(),
|
7888 |
+
jsre = /(\=)\?(&|$)|\?\?/i;
|
7889 |
+
|
7890 |
+
// Default jsonp settings
|
7891 |
+
jQuery.ajaxSetup({
|
7892 |
+
jsonp: "callback",
|
7893 |
+
jsonpCallback: function() {
|
7894 |
+
return jQuery.expando + "_" + ( jsc++ );
|
7895 |
+
}
|
7896 |
+
});
|
7897 |
+
|
7898 |
+
// Detect, normalize options and install callbacks for jsonp requests
|
7899 |
+
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
7900 |
+
|
7901 |
+
var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
|
7902 |
+
( typeof s.data === "string" );
|
7903 |
+
|
7904 |
+
if ( s.dataTypes[ 0 ] === "jsonp" ||
|
7905 |
+
s.jsonp !== false && ( jsre.test( s.url ) ||
|
7906 |
+
inspectData && jsre.test( s.data ) ) ) {
|
7907 |
+
|
7908 |
+
var responseContainer,
|
7909 |
+
jsonpCallback = s.jsonpCallback =
|
7910 |
+
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
|
7911 |
+
previous = window[ jsonpCallback ],
|
7912 |
+
url = s.url,
|
7913 |
+
data = s.data,
|
7914 |
+
replace = "$1" + jsonpCallback + "$2";
|
7915 |
+
|
7916 |
+
if ( s.jsonp !== false ) {
|
7917 |
+
url = url.replace( jsre, replace );
|
7918 |
+
if ( s.url === url ) {
|
7919 |
+
if ( inspectData ) {
|
7920 |
+
data = data.replace( jsre, replace );
|
7921 |
+
}
|
7922 |
+
if ( s.data === data ) {
|
7923 |
+
// Add callback manually
|
7924 |
+
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
|
7925 |
+
}
|
7926 |
+
}
|
7927 |
+
}
|
7928 |
+
|
7929 |
+
s.url = url;
|
7930 |
+
s.data = data;
|
7931 |
+
|
7932 |
+
// Install callback
|
7933 |
+
window[ jsonpCallback ] = function( response ) {
|
7934 |
+
responseContainer = [ response ];
|
7935 |
+
};
|
7936 |
+
|
7937 |
+
// Clean-up function
|
7938 |
+
jqXHR.always(function() {
|
7939 |
+
// Set callback back to previous value
|
7940 |
+
window[ jsonpCallback ] = previous;
|
7941 |
+
// Call if it was a function and we have a response
|
7942 |
+
if ( responseContainer && jQuery.isFunction( previous ) ) {
|
7943 |
+
window[ jsonpCallback ]( responseContainer[ 0 ] );
|
7944 |
+
}
|
7945 |
+
});
|
7946 |
+
|
7947 |
+
// Use data converter to retrieve json after script execution
|
7948 |
+
s.converters["script json"] = function() {
|
7949 |
+
if ( !responseContainer ) {
|
7950 |
+
jQuery.error( jsonpCallback + " was not called" );
|
7951 |
+
}
|
7952 |
+
return responseContainer[ 0 ];
|
7953 |
+
};
|
7954 |
+
|
7955 |
+
// force json dataType
|
7956 |
+
s.dataTypes[ 0 ] = "json";
|
7957 |
+
|
7958 |
+
// Delegate to script
|
7959 |
+
return "script";
|
7960 |
+
}
|
7961 |
+
});
|
7962 |
+
|
7963 |
+
|
7964 |
+
|
7965 |
+
|
7966 |
+
// Install script dataType
|
7967 |
+
jQuery.ajaxSetup({
|
7968 |
+
accepts: {
|
7969 |
+
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
7970 |
+
},
|
7971 |
+
contents: {
|
7972 |
+
script: /javascript|ecmascript/
|
7973 |
+
},
|
7974 |
+
converters: {
|
7975 |
+
"text script": function( text ) {
|
7976 |
+
jQuery.globalEval( text );
|
7977 |
+
return text;
|
7978 |
+
}
|
7979 |
+
}
|
7980 |
+
});
|
7981 |
+
|
7982 |
+
// Handle cache's special case and global
|
7983 |
+
jQuery.ajaxPrefilter( "script", function( s ) {
|
7984 |
+
if ( s.cache === undefined ) {
|
7985 |
+
s.cache = false;
|
7986 |
+
}
|
7987 |
+
if ( s.crossDomain ) {
|
7988 |
+
s.type = "GET";
|
7989 |
+
s.global = false;
|
7990 |
+
}
|
7991 |
+
});
|
7992 |
+
|
7993 |
+
// Bind script tag hack transport
|
7994 |
+
jQuery.ajaxTransport( "script", function(s) {
|
7995 |
+
|
7996 |
+
// This transport only deals with cross domain requests
|
7997 |
+
if ( s.crossDomain ) {
|
7998 |
+
|
7999 |
+
var script,
|
8000 |
+
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
8001 |
+
|
8002 |
+
return {
|
8003 |
+
|
8004 |
+
send: function( _, callback ) {
|
8005 |
+
|
8006 |
+
script = document.createElement( "script" );
|
8007 |
+
|
8008 |
+
script.async = "async";
|
8009 |
+
|
8010 |
+
if ( s.scriptCharset ) {
|
8011 |
+
script.charset = s.scriptCharset;
|
8012 |
+
}
|
8013 |
+
|
8014 |
+
script.src = s.url;
|
8015 |
+
|
8016 |
+
// Attach handlers for all browsers
|
8017 |
+
script.onload = script.onreadystatechange = function( _, isAbort ) {
|
8018 |
+
|
8019 |
+
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
8020 |
+
|
8021 |
+
// Handle memory leak in IE
|
8022 |
+
script.onload = script.onreadystatechange = null;
|
8023 |
+
|
8024 |
+
// Remove the script
|
8025 |
+
if ( head && script.parentNode ) {
|
8026 |
+
head.removeChild( script );
|
8027 |
+
}
|
8028 |
+
|
8029 |
+
// Dereference the script
|
8030 |
+
script = undefined;
|
8031 |
+
|
8032 |
+
// Callback if not abort
|
8033 |
+
if ( !isAbort ) {
|
8034 |
+
callback( 200, "success" );
|
8035 |
+
}
|
8036 |
+
}
|
8037 |
+
};
|
8038 |
+
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
|
8039 |
+
// This arises when a base node is used (#2709 and #4378).
|
8040 |
+
head.insertBefore( script, head.firstChild );
|
8041 |
+
},
|
8042 |
+
|
8043 |
+
abort: function() {
|
8044 |
+
if ( script ) {
|
8045 |
+
script.onload( 0, 1 );
|
8046 |
+
}
|
8047 |
+
}
|
8048 |
+
};
|
8049 |
+
}
|
8050 |
+
});
|
8051 |
+
|
8052 |
+
|
8053 |
+
|
8054 |
+
|
8055 |
+
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
|
8056 |
+
xhrOnUnloadAbort = window.ActiveXObject ? function() {
|
8057 |
+
// Abort all pending requests
|
8058 |
+
for ( var key in xhrCallbacks ) {
|
8059 |
+
xhrCallbacks[ key ]( 0, 1 );
|
8060 |
+
}
|
8061 |
+
} : false,
|
8062 |
+
xhrId = 0,
|
8063 |
+
xhrCallbacks;
|
8064 |
+
|
8065 |
+
// Functions to create xhrs
|
8066 |
+
function createStandardXHR() {
|
8067 |
+
try {
|
8068 |
+
return new window.XMLHttpRequest();
|
8069 |
+
} catch( e ) {}
|
8070 |
+
}
|
8071 |
+
|
8072 |
+
function createActiveXHR() {
|
8073 |
+
try {
|
8074 |
+
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
|
8075 |
+
} catch( e ) {}
|
8076 |
+
}
|
8077 |
+
|
8078 |
+
// Create the request object
|
8079 |
+
// (This is still attached to ajaxSettings for backward compatibility)
|
8080 |
+
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
8081 |
+
/* Microsoft failed to properly
|
8082 |
+
* implement the XMLHttpRequest in IE7 (can't request local files),
|
8083 |
+
* so we use the ActiveXObject when it is available
|
8084 |
+
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
|
8085 |
+
* we need a fallback.
|
8086 |
+
*/
|
8087 |
+
function() {
|
8088 |
+
return !this.isLocal && createStandardXHR() || createActiveXHR();
|
8089 |
+
} :
|
8090 |
+
// For all other browsers, use the standard XMLHttpRequest object
|
8091 |
+
createStandardXHR;
|
8092 |
+
|
8093 |
+
// Determine support properties
|
8094 |
+
(function( xhr ) {
|
8095 |
+
jQuery.extend( jQuery.support, {
|
8096 |
+
ajax: !!xhr,
|
8097 |
+
cors: !!xhr && ( "withCredentials" in xhr )
|
8098 |
+
});
|
8099 |
+
})( jQuery.ajaxSettings.xhr() );
|
8100 |
+
|
8101 |
+
// Create transport if the browser can provide an xhr
|
8102 |
+
if ( jQuery.support.ajax ) {
|
8103 |
+
|
8104 |
+
jQuery.ajaxTransport(function( s ) {
|
8105 |
+
// Cross domain only allowed if supported through XMLHttpRequest
|
8106 |
+
if ( !s.crossDomain || jQuery.support.cors ) {
|
8107 |
+
|
8108 |
+
var callback;
|
8109 |
+
|
8110 |
+
return {
|
8111 |
+
send: function( headers, complete ) {
|
8112 |
+
|
8113 |
+
// Get a new xhr
|
8114 |
+
var xhr = s.xhr(),
|
8115 |
+
handle,
|
8116 |
+
i;
|
8117 |
+
|
8118 |
+
// Open the socket
|
8119 |
+
// Passing null username, generates a login popup on Opera (#2865)
|
8120 |
+
if ( s.username ) {
|
8121 |
+
xhr.open( s.type, s.url, s.async, s.username, s.password );
|
8122 |
+
} else {
|
8123 |
+
xhr.open( s.type, s.url, s.async );
|
8124 |
+
}
|
8125 |
+
|
8126 |
+
// Apply custom fields if provided
|
8127 |
+
if ( s.xhrFields ) {
|
8128 |
+
for ( i in s.xhrFields ) {
|
8129 |
+
xhr[ i ] = s.xhrFields[ i ];
|
8130 |
+
}
|
8131 |
+
}
|
8132 |
+
|
8133 |
+
// Override mime type if needed
|
8134 |
+
if ( s.mimeType && xhr.overrideMimeType ) {
|
8135 |
+
xhr.overrideMimeType( s.mimeType );
|
8136 |
+
}
|
8137 |
+
|
8138 |
+
// X-Requested-With header
|
8139 |
+
// For cross-domain requests, seeing as conditions for a preflight are
|
8140 |
+
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
8141 |
+
// (it can always be set on a per-request basis or even using ajaxSetup)
|
8142 |
+
// For same-domain requests, won't change header if already provided.
|
8143 |
+
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
|
8144 |
+
headers[ "X-Requested-With" ] = "XMLHttpRequest";
|
8145 |
+
}
|
8146 |
+
|
8147 |
+
// Need an extra try/catch for cross domain requests in Firefox 3
|
8148 |
+
try {
|
8149 |
+
for ( i in headers ) {
|
8150 |
+
xhr.setRequestHeader( i, headers[ i ] );
|
8151 |
+
}
|
8152 |
+
} catch( _ ) {}
|
8153 |
+
|
8154 |
+
// Do send the request
|
8155 |
+
// This may raise an exception which is actually
|
8156 |
+
// handled in jQuery.ajax (so no try/catch here)
|
8157 |
+
xhr.send( ( s.hasContent && s.data ) || null );
|
8158 |
+
|
8159 |
+
// Listener
|
8160 |
+
callback = function( _, isAbort ) {
|
8161 |
+
|
8162 |
+
var status,
|
8163 |
+
statusText,
|
8164 |
+
responseHeaders,
|
8165 |
+
responses,
|
8166 |
+
xml;
|
8167 |
+
|
8168 |
+
// Firefox throws exceptions when accessing properties
|
8169 |
+
// of an xhr when a network error occured
|
8170 |
+
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
|
8171 |
+
try {
|
8172 |
+
|
8173 |
+
// Was never called and is aborted or complete
|
8174 |
+
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
8175 |
+
|
8176 |
+
// Only called once
|
8177 |
+
callback = undefined;
|
8178 |
+
|
8179 |
+
// Do not keep as active anymore
|
8180 |
+
if ( handle ) {
|
8181 |
+
xhr.onreadystatechange = jQuery.noop;
|
8182 |
+
if ( xhrOnUnloadAbort ) {
|
8183 |
+
delete xhrCallbacks[ handle ];
|
8184 |
+
}
|
8185 |
+
}
|
8186 |
+
|
8187 |
+
// If it's an abort
|
8188 |
+
if ( isAbort ) {
|
8189 |
+
// Abort it manually if needed
|
8190 |
+
if ( xhr.readyState !== 4 ) {
|
8191 |
+
xhr.abort();
|
8192 |
+
}
|
8193 |
+
} else {
|
8194 |
+
status = xhr.status;
|
8195 |
+
responseHeaders = xhr.getAllResponseHeaders();
|
8196 |
+
responses = {};
|
8197 |
+
xml = xhr.responseXML;
|
8198 |
+
|
8199 |
+
// Construct response list
|
8200 |
+
if ( xml && xml.documentElement /* #4958 */ ) {
|
8201 |
+
responses.xml = xml;
|
8202 |
+
}
|
8203 |
+
responses.text = xhr.responseText;
|
8204 |
+
|
8205 |
+
// Firefox throws an exception when accessing
|
8206 |
+
// statusText for faulty cross-domain requests
|
8207 |
+
try {
|
8208 |
+
statusText = xhr.statusText;
|
8209 |
+
} catch( e ) {
|
8210 |
+
// We normalize with Webkit giving an empty statusText
|
8211 |
+
statusText = "";
|
8212 |
+
}
|
8213 |
+
|
8214 |
+
// Filter status for non standard behaviors
|
8215 |
+
|
8216 |
+
// If the request is local and we have data: assume a success
|
8217 |
+
// (success with no data won't get notified, that's the best we
|
8218 |
+
// can do given current implementations)
|
8219 |
+
if ( !status && s.isLocal && !s.crossDomain ) {
|
8220 |
+
status = responses.text ? 200 : 404;
|
8221 |
+
// IE - #1450: sometimes returns 1223 when it should be 204
|
8222 |
+
} else if ( status === 1223 ) {
|
8223 |
+
status = 204;
|
8224 |
+
}
|
8225 |
+
}
|
8226 |
+
}
|
8227 |
+
} catch( firefoxAccessException ) {
|
8228 |
+
if ( !isAbort ) {
|
8229 |
+
complete( -1, firefoxAccessException );
|
8230 |
+
}
|
8231 |
+
}
|
8232 |
+
|
8233 |
+
// Call complete if needed
|
8234 |
+
if ( responses ) {
|
8235 |
+
complete( status, statusText, responses, responseHeaders );
|
8236 |
+
}
|
8237 |
+
};
|
8238 |
+
|
8239 |
+
// if we're in sync mode or it's in cache
|
8240 |
+
// and has been retrieved directly (IE6 & IE7)
|
8241 |
+
// we need to manually fire the callback
|
8242 |
+
if ( !s.async || xhr.readyState === 4 ) {
|
8243 |
+
callback();
|
8244 |
+
} else {
|
8245 |
+
handle = ++xhrId;
|
8246 |
+
if ( xhrOnUnloadAbort ) {
|
8247 |
+
// Create the active xhrs callbacks list if needed
|
8248 |
+
// and attach the unload handler
|
8249 |
+
if ( !xhrCallbacks ) {
|
8250 |
+
xhrCallbacks = {};
|
8251 |
+
jQuery( window ).unload( xhrOnUnloadAbort );
|
8252 |
+
}
|
8253 |
+
// Add to list of active xhrs callbacks
|
8254 |
+
xhrCallbacks[ handle ] = callback;
|
8255 |
+
}
|
8256 |
+
xhr.onreadystatechange = callback;
|
8257 |
+
}
|
8258 |
+
},
|
8259 |
+
|
8260 |
+
abort: function() {
|
8261 |
+
if ( callback ) {
|
8262 |
+
callback(0,1);
|
8263 |
+
}
|
8264 |
+
}
|
8265 |
+
};
|
8266 |
+
}
|
8267 |
+
});
|
8268 |
+
}
|
8269 |
+
|
8270 |
+
|
8271 |
+
|
8272 |
+
|
8273 |
+
var elemdisplay = {},
|
8274 |
+
iframe, iframeDoc,
|
8275 |
+
rfxtypes = /^(?:toggle|show|hide)$/,
|
8276 |
+
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
|
8277 |
+
timerId,
|
8278 |
+
fxAttrs = [
|
8279 |
+
// height animations
|
8280 |
+
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
|
8281 |
+
// width animations
|
8282 |
+
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
|
8283 |
+
// opacity animations
|
8284 |
+
[ "opacity" ]
|
8285 |
+
],
|
8286 |
+
fxNow;
|
8287 |
+
|
8288 |
+
jQuery.fn.extend({
|
8289 |
+
show: function( speed, easing, callback ) {
|
8290 |
+
var elem, display;
|
8291 |
+
|
8292 |
+
if ( speed || speed === 0 ) {
|
8293 |
+
return this.animate( genFx("show", 3), speed, easing, callback );
|
8294 |
+
|
8295 |
+
} else {
|
8296 |
+
for ( var i = 0, j = this.length; i < j; i++ ) {
|
8297 |
+
elem = this[ i ];
|
8298 |
+
|
8299 |
+
if ( elem.style ) {
|
8300 |
+
display = elem.style.display;
|
8301 |
+
|
8302 |
+
// Reset the inline display of this element to learn if it is
|
8303 |
+
// being hidden by cascaded rules or not
|
8304 |
+
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
|
8305 |
+
display = elem.style.display = "";
|
8306 |
+
}
|
8307 |
+
|
8308 |
+
// Set elements which have been overridden with display: none
|
8309 |
+
// in a stylesheet to whatever the default browser style is
|
8310 |
+
// for such an element
|
8311 |
+
if ( display === "" && jQuery.css(elem, "display") === "none" ) {
|
8312 |
+
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
|
8313 |
+
}
|
8314 |
+
}
|
8315 |
+
}
|
8316 |
+
|
8317 |
+
// Set the display of most of the elements in a second loop
|
8318 |
+
// to avoid the constant reflow
|
8319 |
+
for ( i = 0; i < j; i++ ) {
|
8320 |
+
elem = this[ i ];
|
8321 |
+
|
8322 |
+
if ( elem.style ) {
|
8323 |
+
display = elem.style.display;
|
8324 |
+
|
8325 |
+
if ( display === "" || display === "none" ) {
|
8326 |
+
elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
|
8327 |
+
}
|
8328 |
+
}
|
8329 |
+
}
|
8330 |
+
|
8331 |
+
return this;
|
8332 |
+
}
|
8333 |
+
},
|
8334 |
+
|
8335 |
+
hide: function( speed, easing, callback ) {
|
8336 |
+
if ( speed || speed === 0 ) {
|
8337 |
+
return this.animate( genFx("hide", 3), speed, easing, callback);
|
8338 |
+
|
8339 |
+
} else {
|
8340 |
+
var elem, display,
|
8341 |
+
i = 0,
|
8342 |
+
j = this.length;
|
8343 |
+
|
8344 |
+
for ( ; i < j; i++ ) {
|
8345 |
+
elem = this[i];
|
8346 |
+
if ( elem.style ) {
|
8347 |
+
display = jQuery.css( elem, "display" );
|
8348 |
+
|
8349 |
+
if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
|
8350 |
+
jQuery._data( elem, "olddisplay", display );
|
8351 |
+
}
|
8352 |
+
}
|
8353 |
+
}
|
8354 |
+
|
8355 |
+
// Set the display of the elements in a second loop
|
8356 |
+
// to avoid the constant reflow
|
8357 |
+
for ( i = 0; i < j; i++ ) {
|
8358 |
+
if ( this[i].style ) {
|
8359 |
+
this[i].style.display = "none";
|
8360 |
+
}
|
8361 |
+
}
|
8362 |
+
|
8363 |
+
return this;
|
8364 |
+
}
|
8365 |
+
},
|
8366 |
+
|
8367 |
+
// Save the old toggle function
|
8368 |
+
_toggle: jQuery.fn.toggle,
|
8369 |
+
|
8370 |
+
toggle: function( fn, fn2, callback ) {
|
8371 |
+
var bool = typeof fn === "boolean";
|
8372 |
+
|
8373 |
+
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
|
8374 |
+
this._toggle.apply( this, arguments );
|
8375 |
+
|
8376 |
+
} else if ( fn == null || bool ) {
|
8377 |
+
this.each(function() {
|
8378 |
+
var state = bool ? fn : jQuery(this).is(":hidden");
|
8379 |
+
jQuery(this)[ state ? "show" : "hide" ]();
|
8380 |
+
});
|
8381 |
+
|
8382 |
+
} else {
|
8383 |
+
this.animate(genFx("toggle", 3), fn, fn2, callback);
|
8384 |
+
}
|
8385 |
+
|
8386 |
+
return this;
|
8387 |
+
},
|
8388 |
+
|
8389 |
+
fadeTo: function( speed, to, easing, callback ) {
|
8390 |
+
return this.filter(":hidden").css("opacity", 0).show().end()
|
8391 |
+
.animate({opacity: to}, speed, easing, callback);
|
8392 |
+
},
|
8393 |
+
|
8394 |
+
animate: function( prop, speed, easing, callback ) {
|
8395 |
+
var optall = jQuery.speed( speed, easing, callback );
|
8396 |
+
|
8397 |
+
if ( jQuery.isEmptyObject( prop ) ) {
|
8398 |
+
return this.each( optall.complete, [ false ] );
|
8399 |
+
}
|
8400 |
+
|
8401 |
+
// Do not change referenced properties as per-property easing will be lost
|
8402 |
+
prop = jQuery.extend( {}, prop );
|
8403 |
+
|
8404 |
+
function doAnimation() {
|
8405 |
+
// XXX 'this' does not always have a nodeName when running the
|
8406 |
+
// test suite
|
8407 |
+
|
8408 |
+
if ( optall.queue === false ) {
|
8409 |
+
jQuery._mark( this );
|
8410 |
+
}
|
8411 |
+
|
8412 |
+
var opt = jQuery.extend( {}, optall ),
|
8413 |
+
isElement = this.nodeType === 1,
|
8414 |
+
hidden = isElement && jQuery(this).is(":hidden"),
|
8415 |
+
name, val, p, e,
|
8416 |
+
parts, start, end, unit,
|
8417 |
+
method;
|
8418 |
+
|
8419 |
+
// will store per property easing and be used to determine when an animation is complete
|
8420 |
+
opt.animatedProperties = {};
|
8421 |
+
|
8422 |
+
for ( p in prop ) {
|
8423 |
+
|
8424 |
+
// property name normalization
|
8425 |
+
name = jQuery.camelCase( p );
|
8426 |
+
if ( p !== name ) {
|
8427 |
+
prop[ name ] = prop[ p ];
|
8428 |
+
delete prop[ p ];
|
8429 |
+
}
|
8430 |
+
|
8431 |
+
val = prop[ name ];
|
8432 |
+
|
8433 |
+
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
|
8434 |
+
if ( jQuery.isArray( val ) ) {
|
8435 |
+
opt.animatedProperties[ name ] = val[ 1 ];
|
8436 |
+
val = prop[ name ] = val[ 0 ];
|
8437 |
+
} else {
|
8438 |
+
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
|
8439 |
+
}
|
8440 |
+
|
8441 |
+
if ( val === "hide" && hidden || val === "show" && !hidden ) {
|
8442 |
+
return opt.complete.call( this );
|
8443 |
+
}
|
8444 |
+
|
8445 |
+
if ( isElement && ( name === "height" || name === "width" ) ) {
|
8446 |
+
// Make sure that nothing sneaks out
|
8447 |
+
// Record all 3 overflow attributes because IE does not
|
8448 |
+
// change the overflow attribute when overflowX and
|
8449 |
+
// overflowY are set to the same value
|
8450 |
+
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
|
8451 |
+
|
8452 |
+
// Set display property to inline-block for height/width
|
8453 |
+
// animations on inline elements that are having width/height animated
|
8454 |
+
if ( jQuery.css( this, "display" ) === "inline" &&
|
8455 |
+
jQuery.css( this, "float" ) === "none" ) {
|
8456 |
+
|
8457 |
+
// inline-level elements accept inline-block;
|
8458 |
+
// block-level elements need to be inline with layout
|
8459 |
+
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
|
8460 |
+
this.style.display = "inline-block";
|
8461 |
+
|
8462 |
+
} else {
|
8463 |
+
this.style.zoom = 1;
|
8464 |
+
}
|
8465 |
+
}
|
8466 |
+
}
|
8467 |
+
}
|
8468 |
+
|
8469 |
+
if ( opt.overflow != null ) {
|
8470 |
+
this.style.overflow = "hidden";
|
8471 |
+
}
|
8472 |
+
|
8473 |
+
for ( p in prop ) {
|
8474 |
+
e = new jQuery.fx( this, opt, p );
|
8475 |
+
val = prop[ p ];
|
8476 |
+
|
8477 |
+
if ( rfxtypes.test( val ) ) {
|
8478 |
+
|
8479 |
+
// Tracks whether to show or hide based on private
|
8480 |
+
// data attached to the element
|
8481 |
+
method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
|
8482 |
+
if ( method ) {
|
8483 |
+
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
|
8484 |
+
e[ method ]();
|
8485 |
+
} else {
|
8486 |
+
e[ val ]();
|
8487 |
+
}
|
8488 |
+
|
8489 |
+
} else {
|
8490 |
+
parts = rfxnum.exec( val );
|
8491 |
+
start = e.cur();
|
8492 |
+
|
8493 |
+
if ( parts ) {
|
8494 |
+
end = parseFloat( parts[2] );
|
8495 |
+
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
|
8496 |
+
|
8497 |
+
// We need to compute starting value
|
8498 |
+
if ( unit !== "px" ) {
|
8499 |
+
jQuery.style( this, p, (end || 1) + unit);
|
8500 |
+
start = ( (end || 1) / e.cur() ) * start;
|
8501 |
+
jQuery.style( this, p, start + unit);
|
8502 |
+
}
|
8503 |
+
|
8504 |
+
// If a +=/-= token was provided, we're doing a relative animation
|
8505 |
+
if ( parts[1] ) {
|
8506 |
+
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
|
8507 |
+
}
|
8508 |
+
|
8509 |
+
e.custom( start, end, unit );
|
8510 |
+
|
8511 |
+
} else {
|
8512 |
+
e.custom( start, val, "" );
|
8513 |
+
}
|
8514 |
+
}
|
8515 |
+
}
|
8516 |
+
|
8517 |
+
// For JS strict compliance
|
8518 |
+
return true;
|
8519 |
+
}
|
8520 |
+
|
8521 |
+
return optall.queue === false ?
|
8522 |
+
this.each( doAnimation ) :
|
8523 |
+
this.queue( optall.queue, doAnimation );
|
8524 |
+
},
|
8525 |
+
|
8526 |
+
stop: function( type, clearQueue, gotoEnd ) {
|
8527 |
+
if ( typeof type !== "string" ) {
|
8528 |
+
gotoEnd = clearQueue;
|
8529 |
+
clearQueue = type;
|
8530 |
+
type = undefined;
|
8531 |
+
}
|
8532 |
+
if ( clearQueue && type !== false ) {
|
8533 |
+
this.queue( type || "fx", [] );
|
8534 |
+
}
|
8535 |
+
|
8536 |
+
return this.each(function() {
|
8537 |
+
var i,
|
8538 |
+
hadTimers = false,
|
8539 |
+
timers = jQuery.timers,
|
8540 |
+
data = jQuery._data( this );
|
8541 |
+
|
8542 |
+
// clear marker counters if we know they won't be
|
8543 |
+
if ( !gotoEnd ) {
|
8544 |
+
jQuery._unmark( true, this );
|
8545 |
+
}
|
8546 |
+
|
8547 |
+
function stopQueue( elem, data, i ) {
|
8548 |
+
var hooks = data[ i ];
|
8549 |
+
jQuery.removeData( elem, i, true );
|
8550 |
+
hooks.stop( gotoEnd );
|
8551 |
+
}
|
8552 |
+
|
8553 |
+
if ( type == null ) {
|
8554 |
+
for ( i in data ) {
|
8555 |
+
if ( data[ i ].stop && i.indexOf(".run") === i.length - 4 ) {
|
8556 |
+
stopQueue( this, data, i );
|
8557 |
+
}
|
8558 |
+
}
|
8559 |
+
} else if ( data[ i = type + ".run" ] && data[ i ].stop ){
|
8560 |
+
stopQueue( this, data, i );
|
8561 |
+
}
|
8562 |
+
|
8563 |
+
for ( i = timers.length; i--; ) {
|
8564 |
+
if ( timers[ i ].elem === this && (type == null || timers[ i ].queue === type) ) {
|
8565 |
+
if ( gotoEnd ) {
|
8566 |
+
|
8567 |
+
// force the next step to be the last
|
8568 |
+
timers[ i ]( true );
|
8569 |
+
} else {
|
8570 |
+
timers[ i ].saveState();
|
8571 |
+
}
|
8572 |
+
hadTimers = true;
|
8573 |
+
timers.splice( i, 1 );
|
8574 |
+
}
|
8575 |
+
}
|
8576 |
+
|
8577 |
+
// start the next in the queue if the last step wasn't forced
|
8578 |
+
// timers currently will call their complete callbacks, which will dequeue
|
8579 |
+
// but only if they were gotoEnd
|
8580 |
+
if ( !( gotoEnd && hadTimers ) ) {
|
8581 |
+
jQuery.dequeue( this, type );
|
8582 |
+
}
|
8583 |
+
});
|
8584 |
+
}
|
8585 |
+
|
8586 |
+
});
|
8587 |
+
|
8588 |
+
// Animations created synchronously will run synchronously
|
8589 |
+
function createFxNow() {
|
8590 |
+
setTimeout( clearFxNow, 0 );
|
8591 |
+
return ( fxNow = jQuery.now() );
|
8592 |
+
}
|
8593 |
+
|
8594 |
+
function clearFxNow() {
|
8595 |
+
fxNow = undefined;
|
8596 |
+
}
|
8597 |
+
|
8598 |
+
// Generate parameters to create a standard animation
|
8599 |
+
function genFx( type, num ) {
|
8600 |
+
var obj = {};
|
8601 |
+
|
8602 |
+
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
|
8603 |
+
obj[ this ] = type;
|
8604 |
+
});
|
8605 |
+
|
8606 |
+
return obj;
|
8607 |
+
}
|
8608 |
+
|
8609 |
+
// Generate shortcuts for custom animations
|
8610 |
+
jQuery.each({
|
8611 |
+
slideDown: genFx( "show", 1 ),
|
8612 |
+
slideUp: genFx( "hide", 1 ),
|
8613 |
+
slideToggle: genFx( "toggle", 1 ),
|
8614 |
+
fadeIn: { opacity: "show" },
|
8615 |
+
fadeOut: { opacity: "hide" },
|
8616 |
+
fadeToggle: { opacity: "toggle" }
|
8617 |
+
}, function( name, props ) {
|
8618 |
+
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
8619 |
+
return this.animate( props, speed, easing, callback );
|
8620 |
+
};
|
8621 |
+
});
|
8622 |
+
|
8623 |
+
jQuery.extend({
|
8624 |
+
speed: function( speed, easing, fn ) {
|
8625 |
+
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
8626 |
+
complete: fn || !fn && easing ||
|
8627 |
+
jQuery.isFunction( speed ) && speed,
|
8628 |
+
duration: speed,
|
8629 |
+
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
|
8630 |
+
};
|
8631 |
+
|
8632 |
+
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
|
8633 |
+
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
8634 |
+
|
8635 |
+
// normalize opt.queue - true/undefined/null -> "fx"
|
8636 |
+
if ( opt.queue == null || opt.queue === true ) {
|
8637 |
+
opt.queue = "fx";
|
8638 |
+
}
|
8639 |
+
|
8640 |
+
// Queueing
|
8641 |
+
opt.old = opt.complete;
|
8642 |
+
|
8643 |
+
opt.complete = function( noUnmark ) {
|
8644 |
+
if ( jQuery.isFunction( opt.old ) ) {
|
8645 |
+
opt.old.call( this );
|
8646 |
+
}
|
8647 |
+
|
8648 |
+
if ( opt.queue ) {
|
8649 |
+
jQuery.dequeue( this, opt.queue );
|
8650 |
+
} else if ( noUnmark !== false ) {
|
8651 |
+
jQuery._unmark( this );
|
8652 |
+
}
|
8653 |
+
};
|
8654 |
+
|
8655 |
+
return opt;
|
8656 |
+
},
|
8657 |
+
|
8658 |
+
easing: {
|
8659 |
+
linear: function( p, n, firstNum, diff ) {
|
8660 |
+
return firstNum + diff * p;
|
8661 |
+
},
|
8662 |
+
swing: function( p, n, firstNum, diff ) {
|
8663 |
+
return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
|
8664 |
+
}
|
8665 |
+
},
|
8666 |
+
|
8667 |
+
timers: [],
|
8668 |
+
|
8669 |
+
fx: function( elem, options, prop ) {
|
8670 |
+
this.options = options;
|
8671 |
+
this.elem = elem;
|
8672 |
+
this.prop = prop;
|
8673 |
+
|
8674 |
+
options.orig = options.orig || {};
|
8675 |
+
}
|
8676 |
+
|
8677 |
+
});
|
8678 |
+
|
8679 |
+
jQuery.fx.prototype = {
|
8680 |
+
// Simple function for setting a style value
|
8681 |
+
update: function() {
|
8682 |
+
if ( this.options.step ) {
|
8683 |
+
this.options.step.call( this.elem, this.now, this );
|
8684 |
+
}
|
8685 |
+
|
8686 |
+
( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
|
8687 |
+
},
|
8688 |
+
|
8689 |
+
// Get the current size
|
8690 |
+
cur: function() {
|
8691 |
+
if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
|
8692 |
+
return this.elem[ this.prop ];
|
8693 |
+
}
|
8694 |
+
|
8695 |
+
var parsed,
|
8696 |
+
r = jQuery.css( this.elem, this.prop );
|
8697 |
+
// Empty strings, null, undefined and "auto" are converted to 0,
|
8698 |
+
// complex values such as "rotate(1rad)" are returned as is,
|
8699 |
+
// simple values such as "10px" are parsed to Float.
|
8700 |
+
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
|
8701 |
+
},
|
8702 |
+
|
8703 |
+
// Start an animation from one number to another
|
8704 |
+
custom: function( from, to, unit ) {
|
8705 |
+
var self = this,
|
8706 |
+
fx = jQuery.fx;
|
8707 |
+
|
8708 |
+
this.startTime = fxNow || createFxNow();
|
8709 |
+
this.end = to;
|
8710 |
+
this.now = this.start = from;
|
8711 |
+
this.pos = this.state = 0;
|
8712 |
+
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
|
8713 |
+
|
8714 |
+
function t( gotoEnd ) {
|
8715 |
+
return self.step( gotoEnd );
|
8716 |
+
}
|
8717 |
+
|
8718 |
+
t.queue = this.options.queue;
|
8719 |
+
t.elem = this.elem;
|
8720 |
+
t.saveState = function() {
|
8721 |
+
if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
|
8722 |
+
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
|
8723 |
+
}
|
8724 |
+
};
|
8725 |
+
|
8726 |
+
if ( t() && jQuery.timers.push(t) && !timerId ) {
|
8727 |
+
timerId = setInterval( fx.tick, fx.interval );
|
8728 |
+
}
|
8729 |
+
},
|
8730 |
+
|
8731 |
+
// Simple 'show' function
|
8732 |
+
show: function() {
|
8733 |
+
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
|
8734 |
+
|
8735 |
+
// Remember where we started, so that we can go back to it later
|
8736 |
+
this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
|
8737 |
+
this.options.show = true;
|
8738 |
+
|
8739 |
+
// Begin the animation
|
8740 |
+
// Make sure that we start at a small width/height to avoid any flash of content
|
8741 |
+
if ( dataShow !== undefined ) {
|
8742 |
+
// This show is picking up where a previous hide or show left off
|
8743 |
+
this.custom( this.cur(), dataShow );
|
8744 |
+
} else {
|
8745 |
+
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
|
8746 |
+
}
|
8747 |
+
|
8748 |
+
// Start by showing the element
|
8749 |
+
jQuery( this.elem ).show();
|
8750 |
+
},
|
8751 |
+
|
8752 |
+
// Simple 'hide' function
|
8753 |
+
hide: function() {
|
8754 |
+
// Remember where we started, so that we can go back to it later
|
8755 |
+
this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
|
8756 |
+
this.options.hide = true;
|
8757 |
+
|
8758 |
+
// Begin the animation
|
8759 |
+
this.custom( this.cur(), 0 );
|
8760 |
+
},
|
8761 |
+
|
8762 |
+
// Each step of an animation
|
8763 |
+
step: function( gotoEnd ) {
|
8764 |
+
var p, n, complete,
|
8765 |
+
t = fxNow || createFxNow(),
|
8766 |
+
done = true,
|
8767 |
+
elem = this.elem,
|
8768 |
+
options = this.options;
|
8769 |
+
|
8770 |
+
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
8771 |
+
this.now = this.end;
|
8772 |
+
this.pos = this.state = 1;
|
8773 |
+
this.update();
|
8774 |
+
|
8775 |
+
options.animatedProperties[ this.prop ] = true;
|
8776 |
+
|
8777 |
+
for ( p in options.animatedProperties ) {
|
8778 |
+
if ( options.animatedProperties[ p ] !== true ) {
|
8779 |
+
done = false;
|
8780 |
+
}
|
8781 |
+
}
|
8782 |
+
|
8783 |
+
if ( done ) {
|
8784 |
+
// Reset the overflow
|
8785 |
+
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
|
8786 |
+
|
8787 |
+
jQuery.each( [ "", "X", "Y" ], function( index, value ) {
|
8788 |
+
elem.style[ "overflow" + value ] = options.overflow[ index ];
|
8789 |
+
});
|
8790 |
+
}
|
8791 |
+
|
8792 |
+
// Hide the element if the "hide" operation was done
|
8793 |
+
if ( options.hide ) {
|
8794 |
+
jQuery( elem ).hide();
|
8795 |
+
}
|
8796 |
+
|
8797 |
+
// Reset the properties, if the item has been hidden or shown
|
8798 |
+
if ( options.hide || options.show ) {
|
8799 |
+
for ( p in options.animatedProperties ) {
|
8800 |
+
jQuery.style( elem, p, options.orig[ p ] );
|
8801 |
+
jQuery.removeData( elem, "fxshow" + p, true );
|
8802 |
+
// Toggle data is no longer needed
|
8803 |
+
jQuery.removeData( elem, "toggle" + p, true );
|
8804 |
+
}
|
8805 |
+
}
|
8806 |
+
|
8807 |
+
// Execute the complete function
|
8808 |
+
// in the event that the complete function throws an exception
|
8809 |
+
// we must ensure it won't be called twice. #5684
|
8810 |
+
|
8811 |
+
complete = options.complete;
|
8812 |
+
if ( complete ) {
|
8813 |
+
|
8814 |
+
options.complete = false;
|
8815 |
+
complete.call( elem );
|
8816 |
+
}
|
8817 |
+
}
|
8818 |
+
|
8819 |
+
return false;
|
8820 |
+
|
8821 |
+
} else {
|
8822 |
+
// classical easing cannot be used with an Infinity duration
|
8823 |
+
if ( options.duration == Infinity ) {
|
8824 |
+
this.now = t;
|
8825 |
+
} else {
|
8826 |
+
n = t - this.startTime;
|
8827 |
+
this.state = n / options.duration;
|
8828 |
+
|
8829 |
+
// Perform the easing function, defaults to swing
|
8830 |
+
this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
|
8831 |
+
this.now = this.start + ( (this.end - this.start) * this.pos );
|
8832 |
+
}
|
8833 |
+
// Perform the next step of the animation
|
8834 |
+
this.update();
|
8835 |
+
}
|
8836 |
+
|
8837 |
+
return true;
|
8838 |
+
}
|
8839 |
+
};
|
8840 |
+
|
8841 |
+
jQuery.extend( jQuery.fx, {
|
8842 |
+
tick: function() {
|
8843 |
+
var timer,
|
8844 |
+
timers = jQuery.timers,
|
8845 |
+
i = 0;
|
8846 |
+
|
8847 |
+
for ( ; i < timers.length; i++ ) {
|
8848 |
+
timer = timers[ i ];
|
8849 |
+
// Checks the timer has not already been removed
|
8850 |
+
if ( !timer() && timers[ i ] === timer ) {
|
8851 |
+
timers.splice( i--, 1 );
|
8852 |
+
}
|
8853 |
+
}
|
8854 |
+
|
8855 |
+
if ( !timers.length ) {
|
8856 |
+
jQuery.fx.stop();
|
8857 |
+
}
|
8858 |
+
},
|
8859 |
+
|
8860 |
+
interval: 13,
|
8861 |
+
|
8862 |
+
stop: function() {
|
8863 |
+
clearInterval( timerId );
|
8864 |
+
timerId = null;
|
8865 |
+
},
|
8866 |
+
|
8867 |
+
speeds: {
|
8868 |
+
slow: 600,
|
8869 |
+
fast: 200,
|
8870 |
+
// Default speed
|
8871 |
+
_default: 400
|
8872 |
+
},
|
8873 |
+
|
8874 |
+
step: {
|
8875 |
+
opacity: function( fx ) {
|
8876 |
+
jQuery.style( fx.elem, "opacity", fx.now );
|
8877 |
+
},
|
8878 |
+
|
8879 |
+
_default: function( fx ) {
|
8880 |
+
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
|
8881 |
+
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
|
8882 |
+
} else {
|
8883 |
+
fx.elem[ fx.prop ] = fx.now;
|
8884 |
+
}
|
8885 |
+
}
|
8886 |
+
}
|
8887 |
+
});
|
8888 |
+
|
8889 |
+
// Adds width/height step functions
|
8890 |
+
// Do not set anything below 0
|
8891 |
+
jQuery.each([ "width", "height" ], function( i, prop ) {
|
8892 |
+
jQuery.fx.step[ prop ] = function( fx ) {
|
8893 |
+
jQuery.style( fx.elem, prop, Math.max(0, fx.now) );
|
8894 |
+
};
|
8895 |
+
});
|
8896 |
+
|
8897 |
+
if ( jQuery.expr && jQuery.expr.filters ) {
|
8898 |
+
jQuery.expr.filters.animated = function( elem ) {
|
8899 |
+
return jQuery.grep(jQuery.timers, function( fn ) {
|
8900 |
+
return elem === fn.elem;
|
8901 |
+
}).length;
|
8902 |
+
};
|
8903 |
+
}
|
8904 |
+
|
8905 |
+
// Try to restore the default display value of an element
|
8906 |
+
function defaultDisplay( nodeName ) {
|
8907 |
+
|
8908 |
+
if ( !elemdisplay[ nodeName ] ) {
|
8909 |
+
|
8910 |
+
var body = document.body,
|
8911 |
+
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
|
8912 |
+
display = elem.css( "display" );
|
8913 |
+
elem.remove();
|
8914 |
+
|
8915 |
+
// If the simple way fails,
|
8916 |
+
// get element's real default display by attaching it to a temp iframe
|
8917 |
+
if ( display === "none" || display === "" ) {
|
8918 |
+
// No iframe to use yet, so create it
|
8919 |
+
if ( !iframe ) {
|
8920 |
+
iframe = document.createElement( "iframe" );
|
8921 |
+
iframe.frameBorder = iframe.width = iframe.height = 0;
|
8922 |
+
}
|
8923 |
+
|
8924 |
+
body.appendChild( iframe );
|
8925 |
+
|
8926 |
+
// Create a cacheable copy of the iframe document on first call.
|
8927 |
+
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
|
8928 |
+
// document to it; WebKit & Firefox won't allow reusing the iframe document.
|
8929 |
+
if ( !iframeDoc || !iframe.createElement ) {
|
8930 |
+
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
|
8931 |
+
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
|
8932 |
+
iframeDoc.close();
|
8933 |
+
}
|
8934 |
+
|
8935 |
+
elem = iframeDoc.createElement( nodeName );
|
8936 |
+
|
8937 |
+
iframeDoc.body.appendChild( elem );
|
8938 |
+
|
8939 |
+
display = jQuery.css( elem, "display" );
|
8940 |
+
body.removeChild( iframe );
|
8941 |
+
}
|
8942 |
+
|
8943 |
+
// Store the correct default display
|
8944 |
+
elemdisplay[ nodeName ] = display;
|
8945 |
+
}
|
8946 |
+
|
8947 |
+
return elemdisplay[ nodeName ];
|
8948 |
+
}
|
8949 |
+
|
8950 |
+
|
8951 |
+
|
8952 |
+
|
8953 |
+
var rtable = /^t(?:able|d|h)$/i,
|
8954 |
+
rroot = /^(?:body|html)$/i;
|
8955 |
+
|
8956 |
+
if ( "getBoundingClientRect" in document.documentElement ) {
|
8957 |
+
jQuery.fn.offset = function( options ) {
|
8958 |
+
var elem = this[0], box;
|
8959 |
+
|
8960 |
+
if ( options ) {
|
8961 |
+
return this.each(function( i ) {
|
8962 |
+
jQuery.offset.setOffset( this, options, i );
|
8963 |
+
});
|
8964 |
+
}
|
8965 |
+
|
8966 |
+
if ( !elem || !elem.ownerDocument ) {
|
8967 |
+
return null;
|
8968 |
+
}
|
8969 |
+
|
8970 |
+
if ( elem === elem.ownerDocument.body ) {
|
8971 |
+
return jQuery.offset.bodyOffset( elem );
|
8972 |
+
}
|
8973 |
+
|
8974 |
+
try {
|
8975 |
+
box = elem.getBoundingClientRect();
|
8976 |
+
} catch(e) {}
|
8977 |
+
|
8978 |
+
var doc = elem.ownerDocument,
|
8979 |
+
docElem = doc.documentElement;
|
8980 |
+
|
8981 |
+
// Make sure we're not dealing with a disconnected DOM node
|
8982 |
+
if ( !box || !jQuery.contains( docElem, elem ) ) {
|
8983 |
+
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
|
8984 |
+
}
|
8985 |
+
|
8986 |
+
var body = doc.body,
|
8987 |
+
win = getWindow(doc),
|
8988 |
+
clientTop = docElem.clientTop || body.clientTop || 0,
|
8989 |
+
clientLeft = docElem.clientLeft || body.clientLeft || 0,
|
8990 |
+
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
|
8991 |
+
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
|
8992 |
+
top = box.top + scrollTop - clientTop,
|
8993 |
+
left = box.left + scrollLeft - clientLeft;
|
8994 |
+
|
8995 |
+
return { top: top, left: left };
|
8996 |
+
};
|
8997 |
+
|
8998 |
+
} else {
|
8999 |
+
jQuery.fn.offset = function( options ) {
|
9000 |
+
var elem = this[0];
|
9001 |
+
|
9002 |
+
if ( options ) {
|
9003 |
+
return this.each(function( i ) {
|
9004 |
+
jQuery.offset.setOffset( this, options, i );
|
9005 |
+
});
|
9006 |
+
}
|
9007 |
+
|
9008 |
+
if ( !elem || !elem.ownerDocument ) {
|
9009 |
+
return null;
|
9010 |
+
}
|
9011 |
+
|
9012 |
+
if ( elem === elem.ownerDocument.body ) {
|
9013 |
+
return jQuery.offset.bodyOffset( elem );
|
9014 |
+
}
|
9015 |
+
|
9016 |
+
var computedStyle,
|
9017 |
+
offsetParent = elem.offsetParent,
|
9018 |
+
prevOffsetParent = elem,
|
9019 |
+
doc = elem.ownerDocument,
|
9020 |
+
docElem = doc.documentElement,
|
9021 |
+
body = doc.body,
|
9022 |
+
defaultView = doc.defaultView,
|
9023 |
+
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
|
9024 |
+
top = elem.offsetTop,
|
9025 |
+
left = elem.offsetLeft;
|
9026 |
+
|
9027 |
+
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
|
9028 |
+
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
|
9029 |
+
break;
|
9030 |
+
}
|
9031 |
+
|
9032 |
+
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
|
9033 |
+
top -= elem.scrollTop;
|
9034 |
+
left -= elem.scrollLeft;
|
9035 |
+
|
9036 |
+
if ( elem === offsetParent ) {
|
9037 |
+
top += elem.offsetTop;
|
9038 |
+
left += elem.offsetLeft;
|
9039 |
+
|
9040 |
+
if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
|
9041 |
+
top += parseFloat( computedStyle.borderTopWidth ) || 0;
|
9042 |
+
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
|
9043 |
+
}
|
9044 |
+
|
9045 |
+
prevOffsetParent = offsetParent;
|
9046 |
+
offsetParent = elem.offsetParent;
|
9047 |
+
}
|
9048 |
+
|
9049 |
+
if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
|
9050 |
+
top += parseFloat( computedStyle.borderTopWidth ) || 0;
|
9051 |
+
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
|
9052 |
+
}
|
9053 |
+
|
9054 |
+
prevComputedStyle = computedStyle;
|
9055 |
+
}
|
9056 |
+
|
9057 |
+
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
|
9058 |
+
top += body.offsetTop;
|
9059 |
+
left += body.offsetLeft;
|
9060 |
+
}
|
9061 |
+
|
9062 |
+
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
|
9063 |
+
top += Math.max( docElem.scrollTop, body.scrollTop );
|
9064 |
+
left += Math.max( docElem.scrollLeft, body.scrollLeft );
|
9065 |
+
}
|
9066 |
+
|
9067 |
+
return { top: top, left: left };
|
9068 |
+
};
|
9069 |
+
}
|
9070 |
+
|
9071 |
+
jQuery.offset = {
|
9072 |
+
|
9073 |
+
bodyOffset: function( body ) {
|
9074 |
+
var top = body.offsetTop,
|
9075 |
+
left = body.offsetLeft;
|
9076 |
+
|
9077 |
+
if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
|
9078 |
+
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
|
9079 |
+
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
|
9080 |
+
}
|
9081 |
+
|
9082 |
+
return { top: top, left: left };
|
9083 |
+
},
|
9084 |
+
|
9085 |
+
setOffset: function( elem, options, i ) {
|
9086 |
+
var position = jQuery.css( elem, "position" );
|
9087 |
+
|
9088 |
+
// set position first, in-case top/left are set even on static elem
|
9089 |
+
if ( position === "static" ) {
|
9090 |
+
elem.style.position = "relative";
|
9091 |
+
}
|
9092 |
+
|
9093 |
+
var curElem = jQuery( elem ),
|
9094 |
+
curOffset = curElem.offset(),
|
9095 |
+
curCSSTop = jQuery.css( elem, "top" ),
|
9096 |
+
curCSSLeft = jQuery.css( elem, "left" ),
|
9097 |
+
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
9098 |
+
props = {}, curPosition = {}, curTop, curLeft;
|
9099 |
+
|
9100 |
+
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
9101 |
+
if ( calculatePosition ) {
|
9102 |
+
curPosition = curElem.position();
|
9103 |
+
curTop = curPosition.top;
|
9104 |
+
curLeft = curPosition.left;
|
9105 |
+
} else {
|
9106 |
+
curTop = parseFloat( curCSSTop ) || 0;
|
9107 |
+
curLeft = parseFloat( curCSSLeft ) || 0;
|
9108 |
+
}
|
9109 |
+
|
9110 |
+
if ( jQuery.isFunction( options ) ) {
|
9111 |
+
options = options.call( elem, i, curOffset );
|
9112 |
+
}
|
9113 |
+
|
9114 |
+
if ( options.top != null ) {
|
9115 |
+
props.top = ( options.top - curOffset.top ) + curTop;
|
9116 |
+
}
|
9117 |
+
if ( options.left != null ) {
|
9118 |
+
props.left = ( options.left - curOffset.left ) + curLeft;
|
9119 |
+
}
|
9120 |
+
|
9121 |
+
if ( "using" in options ) {
|
9122 |
+
options.using.call( elem, props );
|
9123 |
+
} else {
|
9124 |
+
curElem.css( props );
|
9125 |
+
}
|
9126 |
+
}
|
9127 |
+
};
|
9128 |
+
|
9129 |
+
|
9130 |
+
jQuery.fn.extend({
|
9131 |
+
|
9132 |
+
position: function() {
|
9133 |
+
if ( !this[0] ) {
|
9134 |
+
return null;
|
9135 |
+
}
|
9136 |
+
|
9137 |
+
var elem = this[0],
|
9138 |
+
|
9139 |
+
// Get *real* offsetParent
|
9140 |
+
offsetParent = this.offsetParent(),
|
9141 |
+
|
9142 |
+
// Get correct offsets
|
9143 |
+
offset = this.offset(),
|
9144 |
+
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
|
9145 |
+
|
9146 |
+
// Subtract element margins
|
9147 |
+
// note: when an element has margin: auto the offsetLeft and marginLeft
|
9148 |
+
// are the same in Safari causing offset.left to incorrectly be 0
|
9149 |
+
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
|
9150 |
+
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
|
9151 |
+
|
9152 |
+
// Add offsetParent borders
|
9153 |
+
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
|
9154 |
+
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
|
9155 |
+
|
9156 |
+
// Subtract the two offsets
|
9157 |
+
return {
|
9158 |
+
top: offset.top - parentOffset.top,
|
9159 |
+
left: offset.left - parentOffset.left
|
9160 |
+
};
|
9161 |
+
},
|
9162 |
+
|
9163 |
+
offsetParent: function() {
|
9164 |
+
return this.map(function() {
|
9165 |
+
var offsetParent = this.offsetParent || document.body;
|
9166 |
+
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
|
9167 |
+
offsetParent = offsetParent.offsetParent;
|
9168 |
+
}
|
9169 |
+
return offsetParent;
|
9170 |
+
});
|
9171 |
+
}
|
9172 |
+
});
|
9173 |
+
|
9174 |
+
|
9175 |
+
// Create scrollLeft and scrollTop methods
|
9176 |
+
jQuery.each( ["Left", "Top"], function( i, name ) {
|
9177 |
+
var method = "scroll" + name;
|
9178 |
+
|
9179 |
+
jQuery.fn[ method ] = function( val ) {
|
9180 |
+
var elem, win;
|
9181 |
+
|
9182 |
+
if ( val === undefined ) {
|
9183 |
+
elem = this[ 0 ];
|
9184 |
+
|
9185 |
+
if ( !elem ) {
|
9186 |
+
return null;
|
9187 |
+
}
|
9188 |
+
|
9189 |
+
win = getWindow( elem );
|
9190 |
+
|
9191 |
+
// Return the scroll offset
|
9192 |
+
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
|
9193 |
+
jQuery.support.boxModel && win.document.documentElement[ method ] ||
|
9194 |
+
win.document.body[ method ] :
|
9195 |
+
elem[ method ];
|
9196 |
+
}
|
9197 |
+
|
9198 |
+
// Set the scroll offset
|
9199 |
+
return this.each(function() {
|
9200 |
+
win = getWindow( this );
|
9201 |
+
|
9202 |
+
if ( win ) {
|
9203 |
+
win.scrollTo(
|
9204 |
+
!i ? val : jQuery( win ).scrollLeft(),
|
9205 |
+
i ? val : jQuery( win ).scrollTop()
|
9206 |
+
);
|
9207 |
+
|
9208 |
+
} else {
|
9209 |
+
this[ method ] = val;
|
9210 |
+
}
|
9211 |
+
});
|
9212 |
+
};
|
9213 |
+
});
|
9214 |
+
|
9215 |
+
function getWindow( elem ) {
|
9216 |
+
return jQuery.isWindow( elem ) ?
|
9217 |
+
elem :
|
9218 |
+
elem.nodeType === 9 ?
|
9219 |
+
elem.defaultView || elem.parentWindow :
|
9220 |
+
false;
|
9221 |
+
}
|
9222 |
+
|
9223 |
+
|
9224 |
+
|
9225 |
+
|
9226 |
+
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
|
9227 |
+
jQuery.each([ "Height", "Width" ], function( i, name ) {
|
9228 |
+
|
9229 |
+
var type = name.toLowerCase();
|
9230 |
+
|
9231 |
+
// innerHeight and innerWidth
|
9232 |
+
jQuery.fn[ "inner" + name ] = function() {
|
9233 |
+
var elem = this[0];
|
9234 |
+
return elem ?
|
9235 |
+
elem.style ?
|
9236 |
+
parseFloat( jQuery.css( elem, type, "padding" ) ) :
|
9237 |
+
this[ type ]() :
|
9238 |
+
null;
|
9239 |
+
};
|
9240 |
+
|
9241 |
+
// outerHeight and outerWidth
|
9242 |
+
jQuery.fn[ "outer" + name ] = function( margin ) {
|
9243 |
+
var elem = this[0];
|
9244 |
+
return elem ?
|
9245 |
+
elem.style ?
|
9246 |
+
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
|
9247 |
+
this[ type ]() :
|
9248 |
+
null;
|
9249 |
+
};
|
9250 |
+
|
9251 |
+
jQuery.fn[ type ] = function( size ) {
|
9252 |
+
// Get window width or height
|
9253 |
+
var elem = this[0];
|
9254 |
+
if ( !elem ) {
|
9255 |
+
return size == null ? null : this;
|
9256 |
+
}
|
9257 |
+
|
9258 |
+
if ( jQuery.isFunction( size ) ) {
|
9259 |
+
return this.each(function( i ) {
|
9260 |
+
var self = jQuery( this );
|
9261 |
+
self[ type ]( size.call( this, i, self[ type ]() ) );
|
9262 |
+
});
|
9263 |
+
}
|
9264 |
+
|
9265 |
+
if ( jQuery.isWindow( elem ) ) {
|
9266 |
+
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
|
9267 |
+
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
|
9268 |
+
var docElemProp = elem.document.documentElement[ "client" + name ],
|
9269 |
+
body = elem.document.body;
|
9270 |
+
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
|
9271 |
+
body && body[ "client" + name ] || docElemProp;
|
9272 |
+
|
9273 |
+
// Get document width or height
|
9274 |
+
} else if ( elem.nodeType === 9 ) {
|
9275 |
+
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
|
9276 |
+
return Math.max(
|
9277 |
+
elem.documentElement["client" + name],
|
9278 |
+
elem.body["scroll" + name], elem.documentElement["scroll" + name],
|
9279 |
+
elem.body["offset" + name], elem.documentElement["offset" + name]
|
9280 |
+
);
|
9281 |
+
|
9282 |
+
// Get or set width or height on the element
|
9283 |
+
} else if ( size === undefined ) {
|
9284 |
+
var orig = jQuery.css( elem, type ),
|
9285 |
+
ret = parseFloat( orig );
|
9286 |
+
|
9287 |
+
return jQuery.isNumeric( ret ) ? ret : orig;
|
9288 |
+
|
9289 |
+
// Set the width or height on the element (default to pixels if value is unitless)
|
9290 |
+
} else {
|
9291 |
+
return this.css( type, typeof size === "string" ? size : size + "px" );
|
9292 |
+
}
|
9293 |
+
};
|
9294 |
+
|
9295 |
+
});
|
9296 |
+
|
9297 |
+
|
9298 |
+
// Expose jQuery to the global object
|
9299 |
+
window.jQuery = window.$ = jQuery;
|
9300 |
+
})( window );
|
js/lib/legacy.js
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/*jshint
|
3 |
+
asi: true,
|
4 |
+
unused: true,
|
5 |
+
boss: true,
|
6 |
+
loopfunc: true,
|
7 |
+
eqnull: true
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
/*!
|
12 |
+
* Legacy browser support
|
13 |
+
*/
|
14 |
+
|
15 |
+
|
16 |
+
// Map array support
|
17 |
+
if ( ![].map ) {
|
18 |
+
Array.prototype.map = function ( callback, self ) {
|
19 |
+
var array = this, len = array.length, newArray = new Array( len )
|
20 |
+
for ( var i = 0; i < len; i++ ) {
|
21 |
+
if ( i in array ) {
|
22 |
+
newArray[ i ] = callback.call( self, array[ i ], i, array )
|
23 |
+
}
|
24 |
+
}
|
25 |
+
return newArray
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
// Filter array support
|
31 |
+
if ( ![].filter ) {
|
32 |
+
Array.prototype.filter = function( callback ) {
|
33 |
+
if ( this == null ) throw new TypeError()
|
34 |
+
var t = Object( this ), len = t.length >>> 0
|
35 |
+
if ( typeof callback != 'function' ) throw new TypeError()
|
36 |
+
var newArray = [], thisp = arguments[ 1 ]
|
37 |
+
for ( var i = 0; i < len; i++ ) {
|
38 |
+
if ( i in t ) {
|
39 |
+
var val = t[ i ]
|
40 |
+
if ( callback.call( thisp, val, i, t ) ) newArray.push( val )
|
41 |
+
}
|
42 |
+
}
|
43 |
+
return newArray
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
// Index of array support
|
49 |
+
if ( ![].indexOf ) {
|
50 |
+
Array.prototype.indexOf = function( searchElement ) {
|
51 |
+
if ( this == null ) throw new TypeError()
|
52 |
+
var t = Object( this ), len = t.length >>> 0
|
53 |
+
if ( len === 0 ) return -1
|
54 |
+
var n = 0
|
55 |
+
if ( arguments.length > 1 ) {
|
56 |
+
n = Number( arguments[ 1 ] )
|
57 |
+
if ( n != n ) {
|
58 |
+
n = 0
|
59 |
+
}
|
60 |
+
else if ( n !== 0 && n != Infinity && n != -Infinity ) {
|
61 |
+
n = ( n > 0 || -1 ) * Math.floor( Math.abs( n ) )
|
62 |
+
}
|
63 |
+
}
|
64 |
+
if ( n >= len ) return -1
|
65 |
+
var k = n >= 0 ? n : Math.max( len - Math.abs( n ), 0 )
|
66 |
+
for ( ; k < len; k++ ) {
|
67 |
+
if ( k in t && t[ k ] === searchElement ) return k
|
68 |
+
}
|
69 |
+
return -1
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
/*!
|
75 |
+
* Cross-Browser Split 1.1.1
|
76 |
+
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
|
77 |
+
* Available under the MIT License
|
78 |
+
* http://blog.stevenlevithan.com/archives/cross-browser-split
|
79 |
+
*/
|
80 |
+
var nativeSplit = String.prototype.split, compliantExecNpcg = /()??/.exec('')[1] === undefined
|
81 |
+
String.prototype.split = function(separator, limit) {
|
82 |
+
var str = this
|
83 |
+
if (Object.prototype.toString.call(separator) !== '[object RegExp]') {
|
84 |
+
return nativeSplit.call(str, separator, limit)
|
85 |
+
}
|
86 |
+
var output = [],
|
87 |
+
flags = (separator.ignoreCase ? 'i' : '') +
|
88 |
+
(separator.multiline ? 'm' : '') +
|
89 |
+
(separator.extended ? 'x' : '') +
|
90 |
+
(separator.sticky ? 'y' : ''),
|
91 |
+
lastLastIndex = 0,
|
92 |
+
separator2, match, lastIndex, lastLength
|
93 |
+
separator = new RegExp(separator.source, flags + 'g')
|
94 |
+
str += ''
|
95 |
+
if (!compliantExecNpcg) {
|
96 |
+
separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags)
|
97 |
+
}
|
98 |
+
limit = limit === undefined ? -1 >>> 0 : limit >>> 0
|
99 |
+
while (match = separator.exec(str)) {
|
100 |
+
lastIndex = match.index + match[0].length
|
101 |
+
if (lastIndex > lastLastIndex) {
|
102 |
+
output.push(str.slice(lastLastIndex, match.index))
|
103 |
+
if (!compliantExecNpcg && match.length > 1) {
|
104 |
+
match[0].replace(separator2, function () {
|
105 |
+
for (var i = 1; i < arguments.length - 2; i++) {
|
106 |
+
if (arguments[i] === undefined) {
|
107 |
+
match[i] = undefined
|
108 |
+
}
|
109 |
+
}
|
110 |
+
})
|
111 |
+
}
|
112 |
+
if (match.length > 1 && match.index < str.length) {
|
113 |
+
Array.prototype.push.apply(output, match.slice(1))
|
114 |
+
}
|
115 |
+
lastLength = match[0].length
|
116 |
+
lastLastIndex = lastIndex
|
117 |
+
if (output.length >= limit) {
|
118 |
+
break
|
119 |
+
}
|
120 |
+
}
|
121 |
+
if (separator.lastIndex === match.index) {
|
122 |
+
separator.lastIndex++
|
123 |
+
}
|
124 |
+
}
|
125 |
+
if (lastLastIndex === str.length) {
|
126 |
+
if (lastLength || !separator.test('')) {
|
127 |
+
output.push('')
|
128 |
+
}
|
129 |
+
} else {
|
130 |
+
output.push(str.slice(lastLastIndex))
|
131 |
+
}
|
132 |
+
return output.length > limit ? output.slice(0, limit) : output
|
133 |
+
};
|
js/lib/picker.date.js
ADDED
@@ -0,0 +1,1354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Date picker for pickadate.js v3.5.6
|
3 |
+
* http://amsul.github.io/pickadate.js/date.htm
|
4 |
+
*/
|
5 |
+
|
6 |
+
(function ( factory ) {
|
7 |
+
|
8 |
+
// AMD.
|
9 |
+
if ( typeof define == 'function' && define.amd )
|
10 |
+
define( ['picker', 'jquery'], factory )
|
11 |
+
|
12 |
+
// Node.js/browserify.
|
13 |
+
else if ( typeof exports == 'object' )
|
14 |
+
module.exports = factory( require('./picker.js'), require('jquery') )
|
15 |
+
|
16 |
+
// Browser globals.
|
17 |
+
else factory( Picker, jQuery )
|
18 |
+
|
19 |
+
}(function( Picker, $ ) {
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Globals and constants
|
24 |
+
*/
|
25 |
+
var DAYS_IN_WEEK = 7,
|
26 |
+
WEEKS_IN_CALENDAR = 6,
|
27 |
+
_ = Picker._
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The date picker constructor
|
33 |
+
*/
|
34 |
+
function DatePicker( picker, settings ) {
|
35 |
+
|
36 |
+
var calendar = this,
|
37 |
+
element = picker.$node[ 0 ],
|
38 |
+
elementValue = element.value,
|
39 |
+
elementDataValue = picker.$node.data( 'value' ),
|
40 |
+
valueString = elementDataValue || elementValue,
|
41 |
+
formatString = elementDataValue ? settings.formatSubmit : settings.format,
|
42 |
+
isRTL = function() {
|
43 |
+
|
44 |
+
return element.currentStyle ?
|
45 |
+
|
46 |
+
// For IE.
|
47 |
+
element.currentStyle.direction == 'rtl' :
|
48 |
+
|
49 |
+
// For normal browsers.
|
50 |
+
getComputedStyle( picker.$root[0] ).direction == 'rtl'
|
51 |
+
}
|
52 |
+
|
53 |
+
calendar.settings = settings
|
54 |
+
calendar.$node = picker.$node
|
55 |
+
|
56 |
+
// The queue of methods that will be used to build item objects.
|
57 |
+
calendar.queue = {
|
58 |
+
min: 'measure create',
|
59 |
+
max: 'measure create',
|
60 |
+
now: 'now create',
|
61 |
+
select: 'parse create validate',
|
62 |
+
highlight: 'parse navigate create validate',
|
63 |
+
view: 'parse create validate viewset',
|
64 |
+
disable: 'deactivate',
|
65 |
+
enable: 'activate'
|
66 |
+
}
|
67 |
+
|
68 |
+
// The component's item object.
|
69 |
+
calendar.item = {}
|
70 |
+
|
71 |
+
calendar.item.clear = null
|
72 |
+
calendar.item.disable = ( settings.disable || [] ).slice( 0 )
|
73 |
+
calendar.item.enable = -(function( collectionDisabled ) {
|
74 |
+
return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1
|
75 |
+
})( calendar.item.disable )
|
76 |
+
|
77 |
+
calendar.
|
78 |
+
set( 'min', settings.min ).
|
79 |
+
set( 'max', settings.max ).
|
80 |
+
set( 'now' )
|
81 |
+
|
82 |
+
// When there’s a value, set the `select`, which in turn
|
83 |
+
// also sets the `highlight` and `view`.
|
84 |
+
if ( valueString ) {
|
85 |
+
calendar.set( 'select', valueString, {
|
86 |
+
format: formatString,
|
87 |
+
defaultValue: true
|
88 |
+
})
|
89 |
+
}
|
90 |
+
|
91 |
+
// If there’s no value, default to highlighting “today”.
|
92 |
+
else {
|
93 |
+
calendar.
|
94 |
+
set( 'select', null ).
|
95 |
+
set( 'highlight', calendar.item.now )
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
// The keycode to movement mapping.
|
100 |
+
calendar.key = {
|
101 |
+
40: 7, // Down
|
102 |
+
38: -7, // Up
|
103 |
+
39: function() { return isRTL() ? -1 : 1 }, // Right
|
104 |
+
37: function() { return isRTL() ? 1 : -1 }, // Left
|
105 |
+
go: function( timeChange ) {
|
106 |
+
var highlightedObject = calendar.item.highlight,
|
107 |
+
targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )
|
108 |
+
calendar.set(
|
109 |
+
'highlight',
|
110 |
+
targetDate,
|
111 |
+
{ interval: timeChange }
|
112 |
+
)
|
113 |
+
this.render()
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
+
// Bind some picker events.
|
119 |
+
picker.
|
120 |
+
on( 'render', function() {
|
121 |
+
picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {
|
122 |
+
var value = this.value
|
123 |
+
if ( value ) {
|
124 |
+
picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )
|
125 |
+
picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )
|
126 |
+
}
|
127 |
+
})
|
128 |
+
picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {
|
129 |
+
var value = this.value
|
130 |
+
if ( value ) {
|
131 |
+
picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )
|
132 |
+
picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )
|
133 |
+
}
|
134 |
+
})
|
135 |
+
}, 1 ).
|
136 |
+
on( 'open', function() {
|
137 |
+
var includeToday = ''
|
138 |
+
if ( calendar.disabled( calendar.get('now') ) ) {
|
139 |
+
includeToday = ':not(.' + settings.klass.buttonToday + ')'
|
140 |
+
}
|
141 |
+
picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )
|
142 |
+
}, 1 ).
|
143 |
+
on( 'close', function() {
|
144 |
+
picker.$root.find( 'button, select' ).attr( 'disabled', true )
|
145 |
+
}, 1 )
|
146 |
+
|
147 |
+
} //DatePicker
|
148 |
+
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Set a datepicker item object.
|
152 |
+
*/
|
153 |
+
DatePicker.prototype.set = function( type, value, options ) {
|
154 |
+
|
155 |
+
var calendar = this,
|
156 |
+
calendarItem = calendar.item
|
157 |
+
|
158 |
+
// If the value is `null` just set it immediately.
|
159 |
+
if ( value === null ) {
|
160 |
+
if ( type == 'clear' ) type = 'select'
|
161 |
+
calendarItem[ type ] = value
|
162 |
+
return calendar
|
163 |
+
}
|
164 |
+
|
165 |
+
// Otherwise go through the queue of methods, and invoke the functions.
|
166 |
+
// Update this as the time unit, and set the final value as this item.
|
167 |
+
// * In the case of `enable`, keep the queue but set `disable` instead.
|
168 |
+
// And in the case of `flip`, keep the queue but set `enable` instead.
|
169 |
+
calendarItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = calendar.queue[ type ].split( ' ' ).map( function( method ) {
|
170 |
+
value = calendar[ method ]( type, value, options )
|
171 |
+
return value
|
172 |
+
}).pop()
|
173 |
+
|
174 |
+
// Check if we need to cascade through more updates.
|
175 |
+
if ( type == 'select' ) {
|
176 |
+
calendar.set( 'highlight', calendarItem.select, options )
|
177 |
+
}
|
178 |
+
else if ( type == 'highlight' ) {
|
179 |
+
calendar.set( 'view', calendarItem.highlight, options )
|
180 |
+
}
|
181 |
+
else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) {
|
182 |
+
if ( calendarItem.select && calendar.disabled( calendarItem.select ) ) {
|
183 |
+
calendar.set( 'select', calendarItem.select, options )
|
184 |
+
}
|
185 |
+
if ( calendarItem.highlight && calendar.disabled( calendarItem.highlight ) ) {
|
186 |
+
calendar.set( 'highlight', calendarItem.highlight, options )
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
return calendar
|
191 |
+
} //DatePicker.prototype.set
|
192 |
+
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Get a datepicker item object.
|
196 |
+
*/
|
197 |
+
DatePicker.prototype.get = function( type ) {
|
198 |
+
return this.item[ type ]
|
199 |
+
} //DatePicker.prototype.get
|
200 |
+
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Create a picker date object.
|
204 |
+
*/
|
205 |
+
DatePicker.prototype.create = function( type, value, options ) {
|
206 |
+
|
207 |
+
var isInfiniteValue,
|
208 |
+
calendar = this
|
209 |
+
|
210 |
+
// If there’s no value, use the type as the value.
|
211 |
+
value = value === undefined ? type : value
|
212 |
+
|
213 |
+
|
214 |
+
// If it’s infinity, update the value.
|
215 |
+
if ( value == -Infinity || value == Infinity ) {
|
216 |
+
isInfiniteValue = value
|
217 |
+
}
|
218 |
+
|
219 |
+
// If it’s an object, use the native date object.
|
220 |
+
else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
|
221 |
+
value = value.obj
|
222 |
+
}
|
223 |
+
|
224 |
+
// If it’s an array, convert it into a date and make sure
|
225 |
+
// that it’s a valid date – otherwise default to today.
|
226 |
+
else if ( $.isArray( value ) ) {
|
227 |
+
value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )
|
228 |
+
value = _.isDate( value ) ? value : calendar.create().obj
|
229 |
+
}
|
230 |
+
|
231 |
+
// If it’s a number or date object, make a normalized date.
|
232 |
+
else if ( _.isInteger( value ) || _.isDate( value ) ) {
|
233 |
+
value = calendar.normalize( new Date( value ), options )
|
234 |
+
}
|
235 |
+
|
236 |
+
// If it’s a literal true or any other case, set it to now.
|
237 |
+
else /*if ( value === true )*/ {
|
238 |
+
value = calendar.now( type, value, options )
|
239 |
+
}
|
240 |
+
|
241 |
+
// Return the compiled object.
|
242 |
+
return {
|
243 |
+
year: isInfiniteValue || value.getFullYear(),
|
244 |
+
month: isInfiniteValue || value.getMonth(),
|
245 |
+
date: isInfiniteValue || value.getDate(),
|
246 |
+
day: isInfiniteValue || value.getDay(),
|
247 |
+
obj: isInfiniteValue || value,
|
248 |
+
pick: isInfiniteValue || value.getTime()
|
249 |
+
}
|
250 |
+
} //DatePicker.prototype.create
|
251 |
+
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Create a range limit object using an array, date object,
|
255 |
+
* literal “true”, or integer relative to another time.
|
256 |
+
*/
|
257 |
+
DatePicker.prototype.createRange = function( from, to ) {
|
258 |
+
|
259 |
+
var calendar = this,
|
260 |
+
createDate = function( date ) {
|
261 |
+
if ( date === true || $.isArray( date ) || _.isDate( date ) ) {
|
262 |
+
return calendar.create( date )
|
263 |
+
}
|
264 |
+
return date
|
265 |
+
}
|
266 |
+
|
267 |
+
// Create objects if possible.
|
268 |
+
if ( !_.isInteger( from ) ) {
|
269 |
+
from = createDate( from )
|
270 |
+
}
|
271 |
+
if ( !_.isInteger( to ) ) {
|
272 |
+
to = createDate( to )
|
273 |
+
}
|
274 |
+
|
275 |
+
// Create relative dates.
|
276 |
+
if ( _.isInteger( from ) && $.isPlainObject( to ) ) {
|
277 |
+
from = [ to.year, to.month, to.date + from ];
|
278 |
+
}
|
279 |
+
else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {
|
280 |
+
to = [ from.year, from.month, from.date + to ];
|
281 |
+
}
|
282 |
+
|
283 |
+
return {
|
284 |
+
from: createDate( from ),
|
285 |
+
to: createDate( to )
|
286 |
+
}
|
287 |
+
} //DatePicker.prototype.createRange
|
288 |
+
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Check if a date unit falls within a date range object.
|
292 |
+
*/
|
293 |
+
DatePicker.prototype.withinRange = function( range, dateUnit ) {
|
294 |
+
range = this.createRange(range.from, range.to)
|
295 |
+
return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick
|
296 |
+
}
|
297 |
+
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Check if two date range objects overlap.
|
301 |
+
*/
|
302 |
+
DatePicker.prototype.overlapRanges = function( one, two ) {
|
303 |
+
|
304 |
+
var calendar = this
|
305 |
+
|
306 |
+
// Convert the ranges into comparable dates.
|
307 |
+
one = calendar.createRange( one.from, one.to )
|
308 |
+
two = calendar.createRange( two.from, two.to )
|
309 |
+
|
310 |
+
return calendar.withinRange( one, two.from ) || calendar.withinRange( one, two.to ) ||
|
311 |
+
calendar.withinRange( two, one.from ) || calendar.withinRange( two, one.to )
|
312 |
+
}
|
313 |
+
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Get the date today.
|
317 |
+
*/
|
318 |
+
DatePicker.prototype.now = function( type, value, options ) {
|
319 |
+
value = new Date()
|
320 |
+
if ( options && options.rel ) {
|
321 |
+
value.setDate( value.getDate() + options.rel )
|
322 |
+
}
|
323 |
+
return this.normalize( value, options )
|
324 |
+
}
|
325 |
+
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Navigate to next/prev month.
|
329 |
+
*/
|
330 |
+
DatePicker.prototype.navigate = function( type, value, options ) {
|
331 |
+
|
332 |
+
var targetDateObject,
|
333 |
+
targetYear,
|
334 |
+
targetMonth,
|
335 |
+
targetDate,
|
336 |
+
isTargetArray = $.isArray( value ),
|
337 |
+
isTargetObject = $.isPlainObject( value ),
|
338 |
+
viewsetObject = this.item.view/*,
|
339 |
+
safety = 100*/
|
340 |
+
|
341 |
+
|
342 |
+
if ( isTargetArray || isTargetObject ) {
|
343 |
+
|
344 |
+
if ( isTargetObject ) {
|
345 |
+
targetYear = value.year
|
346 |
+
targetMonth = value.month
|
347 |
+
targetDate = value.date
|
348 |
+
}
|
349 |
+
else {
|
350 |
+
targetYear = +value[0]
|
351 |
+
targetMonth = +value[1]
|
352 |
+
targetDate = +value[2]
|
353 |
+
}
|
354 |
+
|
355 |
+
// If we’re navigating months but the view is in a different
|
356 |
+
// month, navigate to the view’s year and month.
|
357 |
+
if ( options && options.nav && viewsetObject && viewsetObject.month !== targetMonth ) {
|
358 |
+
targetYear = viewsetObject.year
|
359 |
+
targetMonth = viewsetObject.month
|
360 |
+
}
|
361 |
+
|
362 |
+
// Figure out the expected target year and month.
|
363 |
+
targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 )
|
364 |
+
targetYear = targetDateObject.getFullYear()
|
365 |
+
targetMonth = targetDateObject.getMonth()
|
366 |
+
|
367 |
+
// If the month we’re going to doesn’t have enough days,
|
368 |
+
// keep decreasing the date until we reach the month’s last date.
|
369 |
+
while ( /*safety &&*/ new Date( targetYear, targetMonth, targetDate ).getMonth() !== targetMonth ) {
|
370 |
+
targetDate -= 1
|
371 |
+
/*safety -= 1
|
372 |
+
if ( !safety ) {
|
373 |
+
throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'
|
374 |
+
}*/
|
375 |
+
}
|
376 |
+
|
377 |
+
value = [ targetYear, targetMonth, targetDate ]
|
378 |
+
}
|
379 |
+
|
380 |
+
return value
|
381 |
+
} //DatePicker.prototype.navigate
|
382 |
+
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Normalize a date by setting the hours to midnight.
|
386 |
+
*/
|
387 |
+
DatePicker.prototype.normalize = function( value/*, options*/ ) {
|
388 |
+
value.setHours( 0, 0, 0, 0 )
|
389 |
+
return value
|
390 |
+
}
|
391 |
+
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Measure the range of dates.
|
395 |
+
*/
|
396 |
+
DatePicker.prototype.measure = function( type, value/*, options*/ ) {
|
397 |
+
|
398 |
+
var calendar = this
|
399 |
+
|
400 |
+
// If it’s anything false-y, remove the limits.
|
401 |
+
if ( !value ) {
|
402 |
+
value = type == 'min' ? -Infinity : Infinity
|
403 |
+
}
|
404 |
+
|
405 |
+
// If it’s a string, parse it.
|
406 |
+
else if ( typeof value == 'string' ) {
|
407 |
+
value = calendar.parse( type, value )
|
408 |
+
}
|
409 |
+
|
410 |
+
// If it's an integer, get a date relative to today.
|
411 |
+
else if ( _.isInteger( value ) ) {
|
412 |
+
value = calendar.now( type, value, { rel: value } )
|
413 |
+
}
|
414 |
+
|
415 |
+
return value
|
416 |
+
} ///DatePicker.prototype.measure
|
417 |
+
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Create a viewset object based on navigation.
|
421 |
+
*/
|
422 |
+
DatePicker.prototype.viewset = function( type, dateObject/*, options*/ ) {
|
423 |
+
return this.create([ dateObject.year, dateObject.month, 1 ])
|
424 |
+
}
|
425 |
+
|
426 |
+
|
427 |
+
/**
|
428 |
+
* Validate a date as enabled and shift if needed.
|
429 |
+
*/
|
430 |
+
DatePicker.prototype.validate = function( type, dateObject, options ) {
|
431 |
+
|
432 |
+
var calendar = this,
|
433 |
+
|
434 |
+
// Keep a reference to the original date.
|
435 |
+
originalDateObject = dateObject,
|
436 |
+
|
437 |
+
// Make sure we have an interval.
|
438 |
+
interval = options && options.interval ? options.interval : 1,
|
439 |
+
|
440 |
+
// Check if the calendar enabled dates are inverted.
|
441 |
+
isFlippedBase = calendar.item.enable === -1,
|
442 |
+
|
443 |
+
// Check if we have any enabled dates after/before now.
|
444 |
+
hasEnabledBeforeTarget, hasEnabledAfterTarget,
|
445 |
+
|
446 |
+
// The min & max limits.
|
447 |
+
minLimitObject = calendar.item.min,
|
448 |
+
maxLimitObject = calendar.item.max,
|
449 |
+
|
450 |
+
// Check if we’ve reached the limit during shifting.
|
451 |
+
reachedMin, reachedMax,
|
452 |
+
|
453 |
+
// Check if the calendar is inverted and at least one weekday is enabled.
|
454 |
+
hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter( function( value ) {
|
455 |
+
|
456 |
+
// If there’s a date, check where it is relative to the target.
|
457 |
+
if ( $.isArray( value ) ) {
|
458 |
+
var dateTime = calendar.create( value ).pick
|
459 |
+
if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true
|
460 |
+
else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true
|
461 |
+
}
|
462 |
+
|
463 |
+
// Return only integers for enabled weekdays.
|
464 |
+
return _.isInteger( value )
|
465 |
+
}).length/*,
|
466 |
+
|
467 |
+
safety = 100*/
|
468 |
+
|
469 |
+
|
470 |
+
|
471 |
+
// Cases to validate for:
|
472 |
+
// [1] Not inverted and date disabled.
|
473 |
+
// [2] Inverted and some dates enabled.
|
474 |
+
// [3] Not inverted and out of range.
|
475 |
+
//
|
476 |
+
// Cases to **not** validate for:
|
477 |
+
// • Navigating months.
|
478 |
+
// • Not inverted and date enabled.
|
479 |
+
// • Inverted and all dates disabled.
|
480 |
+
// • ..and anything else.
|
481 |
+
if ( !options || (!options.nav && !options.defaultValue) ) if (
|
482 |
+
/* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) ||
|
483 |
+
/* 2 */ ( isFlippedBase && calendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) ||
|
484 |
+
/* 3 */ ( !isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick) )
|
485 |
+
) {
|
486 |
+
|
487 |
+
|
488 |
+
// When inverted, flip the direction if there aren’t any enabled weekdays
|
489 |
+
// and there are no enabled dates in the direction of the interval.
|
490 |
+
if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabledAfterTarget && interval > 0 ) || ( !hasEnabledBeforeTarget && interval < 0 ) ) ) {
|
491 |
+
interval *= -1
|
492 |
+
}
|
493 |
+
|
494 |
+
|
495 |
+
// Keep looping until we reach an enabled date.
|
496 |
+
while ( /*safety &&*/ calendar.disabled( dateObject ) ) {
|
497 |
+
|
498 |
+
/*safety -= 1
|
499 |
+
if ( !safety ) {
|
500 |
+
throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.'
|
501 |
+
}*/
|
502 |
+
|
503 |
+
|
504 |
+
// If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.
|
505 |
+
if ( Math.abs( interval ) > 1 && ( dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month ) ) {
|
506 |
+
dateObject = originalDateObject
|
507 |
+
interval = interval > 0 ? 1 : -1
|
508 |
+
}
|
509 |
+
|
510 |
+
|
511 |
+
// If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.
|
512 |
+
if ( dateObject.pick <= minLimitObject.pick ) {
|
513 |
+
reachedMin = true
|
514 |
+
interval = 1
|
515 |
+
dateObject = calendar.create([
|
516 |
+
minLimitObject.year,
|
517 |
+
minLimitObject.month,
|
518 |
+
minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1)
|
519 |
+
])
|
520 |
+
}
|
521 |
+
else if ( dateObject.pick >= maxLimitObject.pick ) {
|
522 |
+
reachedMax = true
|
523 |
+
interval = -1
|
524 |
+
dateObject = calendar.create([
|
525 |
+
maxLimitObject.year,
|
526 |
+
maxLimitObject.month,
|
527 |
+
maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1)
|
528 |
+
])
|
529 |
+
}
|
530 |
+
|
531 |
+
|
532 |
+
// If we’ve reached both limits, just break out of the loop.
|
533 |
+
if ( reachedMin && reachedMax ) {
|
534 |
+
break
|
535 |
+
}
|
536 |
+
|
537 |
+
|
538 |
+
// Finally, create the shifted date using the interval and keep looping.
|
539 |
+
dateObject = calendar.create([ dateObject.year, dateObject.month, dateObject.date + interval ])
|
540 |
+
}
|
541 |
+
|
542 |
+
} //endif
|
543 |
+
|
544 |
+
|
545 |
+
// Return the date object settled on.
|
546 |
+
return dateObject
|
547 |
+
} //DatePicker.prototype.validate
|
548 |
+
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Check if a date is disabled.
|
552 |
+
*/
|
553 |
+
DatePicker.prototype.disabled = function( dateToVerify ) {
|
554 |
+
|
555 |
+
var
|
556 |
+
calendar = this,
|
557 |
+
|
558 |
+
// Filter through the disabled dates to check if this is one.
|
559 |
+
isDisabledMatch = calendar.item.disable.filter( function( dateToDisable ) {
|
560 |
+
|
561 |
+
// If the date is a number, match the weekday with 0index and `firstDay` check.
|
562 |
+
if ( _.isInteger( dateToDisable ) ) {
|
563 |
+
return dateToVerify.day === ( calendar.settings.firstDay ? dateToDisable : dateToDisable - 1 ) % 7
|
564 |
+
}
|
565 |
+
|
566 |
+
// If it’s an array or a native JS date, create and match the exact date.
|
567 |
+
if ( $.isArray( dateToDisable ) || _.isDate( dateToDisable ) ) {
|
568 |
+
return dateToVerify.pick === calendar.create( dateToDisable ).pick
|
569 |
+
}
|
570 |
+
|
571 |
+
// If it’s an object, match a date within the “from” and “to” range.
|
572 |
+
if ( $.isPlainObject( dateToDisable ) ) {
|
573 |
+
return calendar.withinRange( dateToDisable, dateToVerify )
|
574 |
+
}
|
575 |
+
})
|
576 |
+
|
577 |
+
// If this date matches a disabled date, confirm it’s not inverted.
|
578 |
+
isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( dateToDisable ) {
|
579 |
+
return $.isArray( dateToDisable ) && dateToDisable[3] == 'inverted' ||
|
580 |
+
$.isPlainObject( dateToDisable ) && dateToDisable.inverted
|
581 |
+
}).length
|
582 |
+
|
583 |
+
// Check the calendar “enabled” flag and respectively flip the
|
584 |
+
// disabled state. Then also check if it’s beyond the min/max limits.
|
585 |
+
return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch ||
|
586 |
+
dateToVerify.pick < calendar.item.min.pick ||
|
587 |
+
dateToVerify.pick > calendar.item.max.pick
|
588 |
+
|
589 |
+
} //DatePicker.prototype.disabled
|
590 |
+
|
591 |
+
|
592 |
+
/**
|
593 |
+
* Parse a string into a usable type.
|
594 |
+
*/
|
595 |
+
DatePicker.prototype.parse = function( type, value, options ) {
|
596 |
+
|
597 |
+
var calendar = this,
|
598 |
+
parsingObject = {}
|
599 |
+
|
600 |
+
// If it’s already parsed, we’re good.
|
601 |
+
if ( !value || typeof value != 'string' ) {
|
602 |
+
return value
|
603 |
+
}
|
604 |
+
|
605 |
+
// We need a `.format` to parse the value with.
|
606 |
+
if ( !( options && options.format ) ) {
|
607 |
+
options = options || {}
|
608 |
+
options.format = calendar.settings.format
|
609 |
+
}
|
610 |
+
|
611 |
+
// Convert the format into an array and then map through it.
|
612 |
+
calendar.formats.toArray( options.format ).map( function( label ) {
|
613 |
+
|
614 |
+
var
|
615 |
+
// Grab the formatting label.
|
616 |
+
formattingLabel = calendar.formats[ label ],
|
617 |
+
|
618 |
+
// The format length is from the formatting label function or the
|
619 |
+
// label length without the escaping exclamation (!) mark.
|
620 |
+
formatLength = formattingLabel ? _.trigger( formattingLabel, calendar, [ value, parsingObject ] ) : label.replace( /^!/, '' ).length
|
621 |
+
|
622 |
+
// If there's a format label, split the value up to the format length.
|
623 |
+
// Then add it to the parsing object with appropriate label.
|
624 |
+
if ( formattingLabel ) {
|
625 |
+
parsingObject[ label ] = value.substr( 0, formatLength )
|
626 |
+
}
|
627 |
+
|
628 |
+
// Update the value as the substring from format length to end.
|
629 |
+
value = value.substr( formatLength )
|
630 |
+
})
|
631 |
+
|
632 |
+
// Compensate for month 0index.
|
633 |
+
return [
|
634 |
+
parsingObject.yyyy || parsingObject.yy,
|
635 |
+
+( parsingObject.mm || parsingObject.m ) - 1,
|
636 |
+
parsingObject.dd || parsingObject.d
|
637 |
+
]
|
638 |
+
} //DatePicker.prototype.parse
|
639 |
+
|
640 |
+
|
641 |
+
/**
|
642 |
+
* Various formats to display the object in.
|
643 |
+
*/
|
644 |
+
DatePicker.prototype.formats = (function() {
|
645 |
+
|
646 |
+
// Return the length of the first word in a collection.
|
647 |
+
function getWordLengthFromCollection( string, collection, dateObject ) {
|
648 |
+
|
649 |
+
// Grab the first word from the string.
|
650 |
+
// Regex pattern from http://stackoverflow.com/q/150033
|
651 |
+
var word = string.match( /[^\x00-\x7F]+|\w+/ )[ 0 ]
|
652 |
+
|
653 |
+
// If there's no month index, add it to the date object
|
654 |
+
if ( !dateObject.mm && !dateObject.m ) {
|
655 |
+
dateObject.m = collection.indexOf( word ) + 1
|
656 |
+
}
|
657 |
+
|
658 |
+
// Return the length of the word.
|
659 |
+
return word.length
|
660 |
+
}
|
661 |
+
|
662 |
+
// Get the length of the first word in a string.
|
663 |
+
function getFirstWordLength( string ) {
|
664 |
+
return string.match( /\w+/ )[ 0 ].length
|
665 |
+
}
|
666 |
+
|
667 |
+
return {
|
668 |
+
|
669 |
+
d: function( string, dateObject ) {
|
670 |
+
|
671 |
+
// If there's string, then get the digits length.
|
672 |
+
// Otherwise return the selected date.
|
673 |
+
return string ? _.digits( string ) : dateObject.date
|
674 |
+
},
|
675 |
+
dd: function( string, dateObject ) {
|
676 |
+
|
677 |
+
// If there's a string, then the length is always 2.
|
678 |
+
// Otherwise return the selected date with a leading zero.
|
679 |
+
return string ? 2 : _.lead( dateObject.date )
|
680 |
+
},
|
681 |
+
ddd: function( string, dateObject ) {
|
682 |
+
|
683 |
+
// If there's a string, then get the length of the first word.
|
684 |
+
// Otherwise return the short selected weekday.
|
685 |
+
return string ? getFirstWordLength( string ) : this.settings.weekdaysShort[ dateObject.day ]
|
686 |
+
},
|
687 |
+
dddd: function( string, dateObject ) {
|
688 |
+
|
689 |
+
// If there's a string, then get the length of the first word.
|
690 |
+
// Otherwise return the full selected weekday.
|
691 |
+
return string ? getFirstWordLength( string ) : this.settings.weekdaysFull[ dateObject.day ]
|
692 |
+
},
|
693 |
+
m: function( string, dateObject ) {
|
694 |
+
|
695 |
+
// If there's a string, then get the length of the digits
|
696 |
+
// Otherwise return the selected month with 0index compensation.
|
697 |
+
return string ? _.digits( string ) : dateObject.month + 1
|
698 |
+
},
|
699 |
+
mm: function( string, dateObject ) {
|
700 |
+
|
701 |
+
// If there's a string, then the length is always 2.
|
702 |
+
// Otherwise return the selected month with 0index and leading zero.
|
703 |
+
return string ? 2 : _.lead( dateObject.month + 1 )
|
704 |
+
},
|
705 |
+
mmm: function( string, dateObject ) {
|
706 |
+
|
707 |
+
var collection = this.settings.monthsShort
|
708 |
+
|
709 |
+
// If there's a string, get length of the relevant month from the short
|
710 |
+
// months collection. Otherwise return the selected month from that collection.
|
711 |
+
return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]
|
712 |
+
},
|
713 |
+
mmmm: function( string, dateObject ) {
|
714 |
+
|
715 |
+
var collection = this.settings.monthsFull
|
716 |
+
|
717 |
+
// If there's a string, get length of the relevant month from the full
|
718 |
+
// months collection. Otherwise return the selected month from that collection.
|
719 |
+
return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]
|
720 |
+
},
|
721 |
+
yy: function( string, dateObject ) {
|
722 |
+
|
723 |
+
// If there's a string, then the length is always 2.
|
724 |
+
// Otherwise return the selected year by slicing out the first 2 digits.
|
725 |
+
return string ? 2 : ( '' + dateObject.year ).slice( 2 )
|
726 |
+
},
|
727 |
+
yyyy: function( string, dateObject ) {
|
728 |
+
|
729 |
+
// If there's a string, then the length is always 4.
|
730 |
+
// Otherwise return the selected year.
|
731 |
+
return string ? 4 : dateObject.year
|
732 |
+
},
|
733 |
+
|
734 |
+
// Create an array by splitting the formatting string passed.
|
735 |
+
toArray: function( formatString ) { return formatString.split( /(d{1,4}|m{1,4}|y{4}|yy|!.)/g ) },
|
736 |
+
|
737 |
+
// Format an object into a string using the formatting options.
|
738 |
+
toString: function ( formatString, itemObject ) {
|
739 |
+
var calendar = this
|
740 |
+
return calendar.formats.toArray( formatString ).map( function( label ) {
|
741 |
+
return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' )
|
742 |
+
}).join( '' )
|
743 |
+
}
|
744 |
+
}
|
745 |
+
})() //DatePicker.prototype.formats
|
746 |
+
|
747 |
+
|
748 |
+
|
749 |
+
|
750 |
+
/**
|
751 |
+
* Check if two date units are the exact.
|
752 |
+
*/
|
753 |
+
DatePicker.prototype.isDateExact = function( one, two ) {
|
754 |
+
|
755 |
+
var calendar = this
|
756 |
+
|
757 |
+
// When we’re working with weekdays, do a direct comparison.
|
758 |
+
if (
|
759 |
+
( _.isInteger( one ) && _.isInteger( two ) ) ||
|
760 |
+
( typeof one == 'boolean' && typeof two == 'boolean' )
|
761 |
+
) {
|
762 |
+
return one === two
|
763 |
+
}
|
764 |
+
|
765 |
+
// When we’re working with date representations, compare the “pick” value.
|
766 |
+
if (
|
767 |
+
( _.isDate( one ) || $.isArray( one ) ) &&
|
768 |
+
( _.isDate( two ) || $.isArray( two ) )
|
769 |
+
) {
|
770 |
+
return calendar.create( one ).pick === calendar.create( two ).pick
|
771 |
+
}
|
772 |
+
|
773 |
+
// When we’re working with range objects, compare the “from” and “to”.
|
774 |
+
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
|
775 |
+
return calendar.isDateExact( one.from, two.from ) && calendar.isDateExact( one.to, two.to )
|
776 |
+
}
|
777 |
+
|
778 |
+
return false
|
779 |
+
}
|
780 |
+
|
781 |
+
|
782 |
+
/**
|
783 |
+
* Check if two date units overlap.
|
784 |
+
*/
|
785 |
+
DatePicker.prototype.isDateOverlap = function( one, two ) {
|
786 |
+
|
787 |
+
var calendar = this,
|
788 |
+
firstDay = calendar.settings.firstDay ? 1 : 0
|
789 |
+
|
790 |
+
// When we’re working with a weekday index, compare the days.
|
791 |
+
if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {
|
792 |
+
one = one % 7 + firstDay
|
793 |
+
return one === calendar.create( two ).day + 1
|
794 |
+
}
|
795 |
+
if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {
|
796 |
+
two = two % 7 + firstDay
|
797 |
+
return two === calendar.create( one ).day + 1
|
798 |
+
}
|
799 |
+
|
800 |
+
// When we’re working with range objects, check if the ranges overlap.
|
801 |
+
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
|
802 |
+
return calendar.overlapRanges( one, two )
|
803 |
+
}
|
804 |
+
|
805 |
+
return false
|
806 |
+
}
|
807 |
+
|
808 |
+
|
809 |
+
/**
|
810 |
+
* Flip the “enabled” state.
|
811 |
+
*/
|
812 |
+
DatePicker.prototype.flipEnable = function(val) {
|
813 |
+
var itemObject = this.item
|
814 |
+
itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1)
|
815 |
+
}
|
816 |
+
|
817 |
+
|
818 |
+
/**
|
819 |
+
* Mark a collection of dates as “disabled”.
|
820 |
+
*/
|
821 |
+
DatePicker.prototype.deactivate = function( type, datesToDisable ) {
|
822 |
+
|
823 |
+
var calendar = this,
|
824 |
+
disabledItems = calendar.item.disable.slice(0)
|
825 |
+
|
826 |
+
|
827 |
+
// If we’re flipping, that’s all we need to do.
|
828 |
+
if ( datesToDisable == 'flip' ) {
|
829 |
+
calendar.flipEnable()
|
830 |
+
}
|
831 |
+
|
832 |
+
else if ( datesToDisable === false ) {
|
833 |
+
calendar.flipEnable(1)
|
834 |
+
disabledItems = []
|
835 |
+
}
|
836 |
+
|
837 |
+
else if ( datesToDisable === true ) {
|
838 |
+
calendar.flipEnable(-1)
|
839 |
+
disabledItems = []
|
840 |
+
}
|
841 |
+
|
842 |
+
// Otherwise go through the dates to disable.
|
843 |
+
else {
|
844 |
+
|
845 |
+
datesToDisable.map(function( unitToDisable ) {
|
846 |
+
|
847 |
+
var matchFound
|
848 |
+
|
849 |
+
// When we have disabled items, check for matches.
|
850 |
+
// If something is matched, immediately break out.
|
851 |
+
for ( var index = 0; index < disabledItems.length; index += 1 ) {
|
852 |
+
if ( calendar.isDateExact( unitToDisable, disabledItems[index] ) ) {
|
853 |
+
matchFound = true
|
854 |
+
break
|
855 |
+
}
|
856 |
+
}
|
857 |
+
|
858 |
+
// If nothing was found, add the validated unit to the collection.
|
859 |
+
if ( !matchFound ) {
|
860 |
+
if (
|
861 |
+
_.isInteger( unitToDisable ) ||
|
862 |
+
_.isDate( unitToDisable ) ||
|
863 |
+
$.isArray( unitToDisable ) ||
|
864 |
+
( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )
|
865 |
+
) {
|
866 |
+
disabledItems.push( unitToDisable )
|
867 |
+
}
|
868 |
+
}
|
869 |
+
})
|
870 |
+
}
|
871 |
+
|
872 |
+
// Return the updated collection.
|
873 |
+
return disabledItems
|
874 |
+
} //DatePicker.prototype.deactivate
|
875 |
+
|
876 |
+
|
877 |
+
/**
|
878 |
+
* Mark a collection of dates as “enabled”.
|
879 |
+
*/
|
880 |
+
DatePicker.prototype.activate = function( type, datesToEnable ) {
|
881 |
+
|
882 |
+
var calendar = this,
|
883 |
+
disabledItems = calendar.item.disable,
|
884 |
+
disabledItemsCount = disabledItems.length
|
885 |
+
|
886 |
+
// If we’re flipping, that’s all we need to do.
|
887 |
+
if ( datesToEnable == 'flip' ) {
|
888 |
+
calendar.flipEnable()
|
889 |
+
}
|
890 |
+
|
891 |
+
else if ( datesToEnable === true ) {
|
892 |
+
calendar.flipEnable(1)
|
893 |
+
disabledItems = []
|
894 |
+
}
|
895 |
+
|
896 |
+
else if ( datesToEnable === false ) {
|
897 |
+
calendar.flipEnable(-1)
|
898 |
+
disabledItems = []
|
899 |
+
}
|
900 |
+
|
901 |
+
// Otherwise go through the disabled dates.
|
902 |
+
else {
|
903 |
+
|
904 |
+
datesToEnable.map(function( unitToEnable ) {
|
905 |
+
|
906 |
+
var matchFound,
|
907 |
+
disabledUnit,
|
908 |
+
index,
|
909 |
+
isExactRange
|
910 |
+
|
911 |
+
// Go through the disabled items and try to find a match.
|
912 |
+
for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
913 |
+
|
914 |
+
disabledUnit = disabledItems[index]
|
915 |
+
|
916 |
+
// When an exact match is found, remove it from the collection.
|
917 |
+
if ( calendar.isDateExact( disabledUnit, unitToEnable ) ) {
|
918 |
+
matchFound = disabledItems[index] = null
|
919 |
+
isExactRange = true
|
920 |
+
break
|
921 |
+
}
|
922 |
+
|
923 |
+
// When an overlapped match is found, add the “inverted” state to it.
|
924 |
+
else if ( calendar.isDateOverlap( disabledUnit, unitToEnable ) ) {
|
925 |
+
if ( $.isPlainObject( unitToEnable ) ) {
|
926 |
+
unitToEnable.inverted = true
|
927 |
+
matchFound = unitToEnable
|
928 |
+
}
|
929 |
+
else if ( $.isArray( unitToEnable ) ) {
|
930 |
+
matchFound = unitToEnable
|
931 |
+
if ( !matchFound[3] ) matchFound.push( 'inverted' )
|
932 |
+
}
|
933 |
+
else if ( _.isDate( unitToEnable ) ) {
|
934 |
+
matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
|
935 |
+
}
|
936 |
+
break
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
+
// If a match was found, remove a previous duplicate entry.
|
941 |
+
if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
942 |
+
if ( calendar.isDateExact( disabledItems[index], unitToEnable ) ) {
|
943 |
+
disabledItems[index] = null
|
944 |
+
break
|
945 |
+
}
|
946 |
+
}
|
947 |
+
|
948 |
+
// In the event that we’re dealing with an exact range of dates,
|
949 |
+
// make sure there are no “inverted” dates because of it.
|
950 |
+
if ( isExactRange ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
951 |
+
if ( calendar.isDateOverlap( disabledItems[index], unitToEnable ) ) {
|
952 |
+
disabledItems[index] = null
|
953 |
+
break
|
954 |
+
}
|
955 |
+
}
|
956 |
+
|
957 |
+
// If something is still matched, add it into the collection.
|
958 |
+
if ( matchFound ) {
|
959 |
+
disabledItems.push( matchFound )
|
960 |
+
}
|
961 |
+
})
|
962 |
+
}
|
963 |
+
|
964 |
+
// Return the updated collection.
|
965 |
+
return disabledItems.filter(function( val ) { return val != null })
|
966 |
+
} //DatePicker.prototype.activate
|
967 |
+
|
968 |
+
|
969 |
+
/**
|
970 |
+
* Create a string for the nodes in the picker.
|
971 |
+
*/
|
972 |
+
DatePicker.prototype.nodes = function( isOpen ) {
|
973 |
+
|
974 |
+
var
|
975 |
+
calendar = this,
|
976 |
+
settings = calendar.settings,
|
977 |
+
calendarItem = calendar.item,
|
978 |
+
nowObject = calendarItem.now,
|
979 |
+
selectedObject = calendarItem.select,
|
980 |
+
highlightedObject = calendarItem.highlight,
|
981 |
+
viewsetObject = calendarItem.view,
|
982 |
+
disabledCollection = calendarItem.disable,
|
983 |
+
minLimitObject = calendarItem.min,
|
984 |
+
maxLimitObject = calendarItem.max,
|
985 |
+
|
986 |
+
|
987 |
+
// Create the calendar table head using a copy of weekday labels collection.
|
988 |
+
// * We do a copy so we don't mutate the original array.
|
989 |
+
tableHead = (function( collection, fullCollection ) {
|
990 |
+
|
991 |
+
// If the first day should be Monday, move Sunday to the end.
|
992 |
+
if ( settings.firstDay ) {
|
993 |
+
collection.push( collection.shift() )
|
994 |
+
fullCollection.push( fullCollection.shift() )
|
995 |
+
}
|
996 |
+
|
997 |
+
// Create and return the table head group.
|
998 |
+
return _.node(
|
999 |
+
'thead',
|
1000 |
+
_.node(
|
1001 |
+
'tr',
|
1002 |
+
_.group({
|
1003 |
+
min: 0,
|
1004 |
+
max: DAYS_IN_WEEK - 1,
|
1005 |
+
i: 1,
|
1006 |
+
node: 'th',
|
1007 |
+
item: function( counter ) {
|
1008 |
+
return [
|
1009 |
+
collection[ counter ],
|
1010 |
+
settings.klass.weekdays,
|
1011 |
+
'scope=col title="' + fullCollection[ counter ] + '"'
|
1012 |
+
]
|
1013 |
+
}
|
1014 |
+
})
|
1015 |
+
)
|
1016 |
+
) //endreturn
|
1017 |
+
})( ( settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysShort ).slice( 0 ), settings.weekdaysFull.slice( 0 ) ), //tableHead
|
1018 |
+
|
1019 |
+
|
1020 |
+
// Create the nav for next/prev month.
|
1021 |
+
createMonthNav = function( next ) {
|
1022 |
+
|
1023 |
+
// Otherwise, return the created month tag.
|
1024 |
+
return _.node(
|
1025 |
+
'div',
|
1026 |
+
' ',
|
1027 |
+
settings.klass[ 'nav' + ( next ? 'Next' : 'Prev' ) ] + (
|
1028 |
+
|
1029 |
+
// If the focused month is outside the range, disabled the button.
|
1030 |
+
( next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month ) ||
|
1031 |
+
( !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ) ?
|
1032 |
+
' ' + settings.klass.navDisabled : ''
|
1033 |
+
),
|
1034 |
+
'data-nav=' + ( next || -1 ) + ' ' +
|
1035 |
+
_.ariaAttr({
|
1036 |
+
role: 'button',
|
1037 |
+
controls: calendar.$node[0].id + '_table'
|
1038 |
+
}) + ' ' +
|
1039 |
+
'title="' + (next ? settings.labelMonthNext : settings.labelMonthPrev ) + '"'
|
1040 |
+
) //endreturn
|
1041 |
+
}, //createMonthNav
|
1042 |
+
|
1043 |
+
|
1044 |
+
// Create the month label.
|
1045 |
+
createMonthLabel = function() {
|
1046 |
+
|
1047 |
+
var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull
|
1048 |
+
|
1049 |
+
// If there are months to select, add a dropdown menu.
|
1050 |
+
if ( settings.selectMonths ) {
|
1051 |
+
|
1052 |
+
return _.node( 'select',
|
1053 |
+
_.group({
|
1054 |
+
min: 0,
|
1055 |
+
max: 11,
|
1056 |
+
i: 1,
|
1057 |
+
node: 'option',
|
1058 |
+
item: function( loopedMonth ) {
|
1059 |
+
|
1060 |
+
return [
|
1061 |
+
|
1062 |
+
// The looped month and no classes.
|
1063 |
+
monthsCollection[ loopedMonth ], 0,
|
1064 |
+
|
1065 |
+
// Set the value and selected index.
|
1066 |
+
'value=' + loopedMonth +
|
1067 |
+
( viewsetObject.month == loopedMonth ? ' selected' : '' ) +
|
1068 |
+
(
|
1069 |
+
(
|
1070 |
+
( viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month ) ||
|
1071 |
+
( viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month )
|
1072 |
+
) ?
|
1073 |
+
' disabled' : ''
|
1074 |
+
)
|
1075 |
+
]
|
1076 |
+
}
|
1077 |
+
}),
|
1078 |
+
settings.klass.selectMonth,
|
1079 |
+
( isOpen ? '' : 'disabled' ) + ' ' +
|
1080 |
+
_.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
|
1081 |
+
'title="' + settings.labelMonthSelect + '"'
|
1082 |
+
)
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
// If there's a need for a month selector
|
1086 |
+
return _.node( 'div', monthsCollection[ viewsetObject.month ], settings.klass.month )
|
1087 |
+
}, //createMonthLabel
|
1088 |
+
|
1089 |
+
|
1090 |
+
// Create the year label.
|
1091 |
+
createYearLabel = function() {
|
1092 |
+
|
1093 |
+
var focusedYear = viewsetObject.year,
|
1094 |
+
|
1095 |
+
// If years selector is set to a literal "true", set it to 5. Otherwise
|
1096 |
+
// divide in half to get half before and half after focused year.
|
1097 |
+
numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 )
|
1098 |
+
|
1099 |
+
// If there are years to select, add a dropdown menu.
|
1100 |
+
if ( numberYears ) {
|
1101 |
+
|
1102 |
+
var
|
1103 |
+
minYear = minLimitObject.year,
|
1104 |
+
maxYear = maxLimitObject.year,
|
1105 |
+
lowestYear = focusedYear - numberYears,
|
1106 |
+
highestYear = focusedYear + numberYears
|
1107 |
+
|
1108 |
+
// If the min year is greater than the lowest year, increase the highest year
|
1109 |
+
// by the difference and set the lowest year to the min year.
|
1110 |
+
if ( minYear > lowestYear ) {
|
1111 |
+
highestYear += minYear - lowestYear
|
1112 |
+
lowestYear = minYear
|
1113 |
+
}
|
1114 |
+
|
1115 |
+
// If the max year is less than the highest year, decrease the lowest year
|
1116 |
+
// by the lower of the two: available and needed years. Then set the
|
1117 |
+
// highest year to the max year.
|
1118 |
+
if ( maxYear < highestYear ) {
|
1119 |
+
|
1120 |
+
var availableYears = lowestYear - minYear,
|
1121 |
+
neededYears = highestYear - maxYear
|
1122 |
+
|
1123 |
+
lowestYear -= availableYears > neededYears ? neededYears : availableYears
|
1124 |
+
highestYear = maxYear
|
1125 |
+
}
|
1126 |
+
|
1127 |
+
return _.node( 'select',
|
1128 |
+
_.group({
|
1129 |
+
min: lowestYear,
|
1130 |
+
max: highestYear,
|
1131 |
+
i: 1,
|
1132 |
+
node: 'option',
|
1133 |
+
item: function( loopedYear ) {
|
1134 |
+
return [
|
1135 |
+
|
1136 |
+
// The looped year and no classes.
|
1137 |
+
loopedYear, 0,
|
1138 |
+
|
1139 |
+
// Set the value and selected index.
|
1140 |
+
'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' )
|
1141 |
+
]
|
1142 |
+
}
|
1143 |
+
}),
|
1144 |
+
settings.klass.selectYear,
|
1145 |
+
( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
|
1146 |
+
'title="' + settings.labelYearSelect + '"'
|
1147 |
+
)
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
// Otherwise just return the year focused
|
1151 |
+
return _.node( 'div', focusedYear, settings.klass.year )
|
1152 |
+
} //createYearLabel
|
1153 |
+
|
1154 |
+
|
1155 |
+
// Create and return the entire calendar.
|
1156 |
+
return _.node(
|
1157 |
+
'div',
|
1158 |
+
( settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel() ) +
|
1159 |
+
createMonthNav() + createMonthNav( 1 ),
|
1160 |
+
settings.klass.header
|
1161 |
+
) + _.node(
|
1162 |
+
'table',
|
1163 |
+
tableHead +
|
1164 |
+
_.node(
|
1165 |
+
'tbody',
|
1166 |
+
_.group({
|
1167 |
+
min: 0,
|
1168 |
+
max: WEEKS_IN_CALENDAR - 1,
|
1169 |
+
i: 1,
|
1170 |
+
node: 'tr',
|
1171 |
+
item: function( rowCounter ) {
|
1172 |
+
|
1173 |
+
// If Monday is the first day and the month starts on Sunday, shift the date back a week.
|
1174 |
+
var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0
|
1175 |
+
|
1176 |
+
return [
|
1177 |
+
_.group({
|
1178 |
+
min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index
|
1179 |
+
max: function() {
|
1180 |
+
return this.min + DAYS_IN_WEEK - 1
|
1181 |
+
},
|
1182 |
+
i: 1,
|
1183 |
+
node: 'td',
|
1184 |
+
item: function( targetDate ) {
|
1185 |
+
|
1186 |
+
// Convert the time date from a relative date to a target date.
|
1187 |
+
targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])
|
1188 |
+
|
1189 |
+
var isSelected = selectedObject && selectedObject.pick == targetDate.pick,
|
1190 |
+
isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick,
|
1191 |
+
isDisabled = disabledCollection && calendar.disabled( targetDate ) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick,
|
1192 |
+
formattedDate = _.trigger( calendar.formats.toString, calendar, [ settings.format, targetDate ] )
|
1193 |
+
|
1194 |
+
return [
|
1195 |
+
_.node(
|
1196 |
+
'div',
|
1197 |
+
targetDate.date,
|
1198 |
+
(function( klasses ) {
|
1199 |
+
|
1200 |
+
// Add the `infocus` or `outfocus` classes based on month in view.
|
1201 |
+
klasses.push( viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus )
|
1202 |
+
|
1203 |
+
// Add the `today` class if needed.
|
1204 |
+
if ( nowObject.pick == targetDate.pick ) {
|
1205 |
+
klasses.push( settings.klass.now )
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
// Add the `selected` class if something's selected and the time matches.
|
1209 |
+
if ( isSelected ) {
|
1210 |
+
klasses.push( settings.klass.selected )
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
// Add the `highlighted` class if something's highlighted and the time matches.
|
1214 |
+
if ( isHighlighted ) {
|
1215 |
+
klasses.push( settings.klass.highlighted )
|
1216 |
+
}
|
1217 |
+
|
1218 |
+
// Add the `disabled` class if something's disabled and the object matches.
|
1219 |
+
if ( isDisabled ) {
|
1220 |
+
klasses.push( settings.klass.disabled )
|
1221 |
+
}
|
1222 |
+
|
1223 |
+
return klasses.join( ' ' )
|
1224 |
+
})([ settings.klass.day ]),
|
1225 |
+
'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({
|
1226 |
+
role: 'gridcell',
|
1227 |
+
label: formattedDate,
|
1228 |
+
selected: isSelected && calendar.$node.val() === formattedDate ? true : null,
|
1229 |
+
activedescendant: isHighlighted ? true : null,
|
1230 |
+
disabled: isDisabled ? true : null
|
1231 |
+
})
|
1232 |
+
),
|
1233 |
+
'',
|
1234 |
+
_.ariaAttr({ role: 'presentation' })
|
1235 |
+
] //endreturn
|
1236 |
+
}
|
1237 |
+
})
|
1238 |
+
] //endreturn
|
1239 |
+
}
|
1240 |
+
})
|
1241 |
+
),
|
1242 |
+
settings.klass.table,
|
1243 |
+
'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({
|
1244 |
+
role: 'grid',
|
1245 |
+
controls: calendar.$node[0].id,
|
1246 |
+
readonly: true
|
1247 |
+
})
|
1248 |
+
) +
|
1249 |
+
|
1250 |
+
// * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.
|
1251 |
+
_.node(
|
1252 |
+
'div',
|
1253 |
+
_.node( 'button', settings.today, settings.klass.buttonToday,
|
1254 |
+
'type=button data-pick=' + nowObject.pick +
|
1255 |
+
( isOpen && !calendar.disabled(nowObject) ? '' : ' disabled' ) + ' ' +
|
1256 |
+
_.ariaAttr({ controls: calendar.$node[0].id }) ) +
|
1257 |
+
_.node( 'button', settings.clear, settings.klass.buttonClear,
|
1258 |
+
'type=button data-clear=1' +
|
1259 |
+
( isOpen ? '' : ' disabled' ) + ' ' +
|
1260 |
+
_.ariaAttr({ controls: calendar.$node[0].id }) ) +
|
1261 |
+
_.node('button', settings.close, settings.klass.buttonClose,
|
1262 |
+
'type=button data-close=true ' +
|
1263 |
+
( isOpen ? '' : ' disabled' ) + ' ' +
|
1264 |
+
_.ariaAttr({ controls: calendar.$node[0].id }) ),
|
1265 |
+
settings.klass.footer
|
1266 |
+
) //endreturn
|
1267 |
+
} //DatePicker.prototype.nodes
|
1268 |
+
|
1269 |
+
|
1270 |
+
|
1271 |
+
|
1272 |
+
/**
|
1273 |
+
* The date picker defaults.
|
1274 |
+
*/
|
1275 |
+
DatePicker.defaults = (function( prefix ) {
|
1276 |
+
|
1277 |
+
return {
|
1278 |
+
|
1279 |
+
// The title label to use for the month nav buttons
|
1280 |
+
labelMonthNext: 'Next month',
|
1281 |
+
labelMonthPrev: 'Previous month',
|
1282 |
+
|
1283 |
+
// The title label to use for the dropdown selectors
|
1284 |
+
labelMonthSelect: 'Select a month',
|
1285 |
+
labelYearSelect: 'Select a year',
|
1286 |
+
|
1287 |
+
// Months and weekdays
|
1288 |
+
monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
|
1289 |
+
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],
|
1290 |
+
weekdaysFull: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
|
1291 |
+
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
1292 |
+
|
1293 |
+
// Today and clear
|
1294 |
+
today: 'Today',
|
1295 |
+
clear: 'Clear',
|
1296 |
+
close: 'Close',
|
1297 |
+
|
1298 |
+
// Picker close behavior
|
1299 |
+
closeOnSelect: true,
|
1300 |
+
closeOnClear: true,
|
1301 |
+
|
1302 |
+
// The format to show on the `input` element
|
1303 |
+
format: 'd mmmm, yyyy',
|
1304 |
+
|
1305 |
+
// Classes
|
1306 |
+
klass: {
|
1307 |
+
|
1308 |
+
table: prefix + 'table',
|
1309 |
+
|
1310 |
+
header: prefix + 'header',
|
1311 |
+
|
1312 |
+
navPrev: prefix + 'nav--prev',
|
1313 |
+
navNext: prefix + 'nav--next',
|
1314 |
+
navDisabled: prefix + 'nav--disabled',
|
1315 |
+
|
1316 |
+
month: prefix + 'month',
|
1317 |
+
year: prefix + 'year',
|
1318 |
+
|
1319 |
+
selectMonth: prefix + 'select--month',
|
1320 |
+
selectYear: prefix + 'select--year',
|
1321 |
+
|
1322 |
+
weekdays: prefix + 'weekday',
|
1323 |
+
|
1324 |
+
day: prefix + 'day',
|
1325 |
+
disabled: prefix + 'day--disabled',
|
1326 |
+
selected: prefix + 'day--selected',
|
1327 |
+
highlighted: prefix + 'day--highlighted',
|
1328 |
+
now: prefix + 'day--today',
|
1329 |
+
infocus: prefix + 'day--infocus',
|
1330 |
+
outfocus: prefix + 'day--outfocus',
|
1331 |
+
|
1332 |
+
footer: prefix + 'footer',
|
1333 |
+
|
1334 |
+
buttonClear: prefix + 'button--clear',
|
1335 |
+
buttonToday: prefix + 'button--today',
|
1336 |
+
buttonClose: prefix + 'button--close'
|
1337 |
+
}
|
1338 |
+
}
|
1339 |
+
})( Picker.klasses().picker + '__' )
|
1340 |
+
|
1341 |
+
|
1342 |
+
|
1343 |
+
|
1344 |
+
|
1345 |
+
/**
|
1346 |
+
* Extend the picker to add the date picker.
|
1347 |
+
*/
|
1348 |
+
Picker.extend( 'pickadate', DatePicker )
|
1349 |
+
|
1350 |
+
|
1351 |
+
}));
|
1352 |
+
|
1353 |
+
|
1354 |
+
|
js/lib/picker.js
ADDED
@@ -0,0 +1,1163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* pickadate.js v3.5.6, 2015/04/20
|
3 |
+
* By Amsul, http://amsul.ca
|
4 |
+
* Hosted on http://amsul.github.io/pickadate.js
|
5 |
+
* Licensed under MIT
|
6 |
+
*/
|
7 |
+
|
8 |
+
(function ( factory ) {
|
9 |
+
|
10 |
+
// AMD.
|
11 |
+
if ( typeof define == 'function' && define.amd )
|
12 |
+
define( 'picker', ['jquery'], factory )
|
13 |
+
|
14 |
+
// Node.js/browserify.
|
15 |
+
else if ( typeof exports == 'object' )
|
16 |
+
module.exports = factory( require('jquery') )
|
17 |
+
|
18 |
+
// Browser globals.
|
19 |
+
else this.Picker = factory( jQuery )
|
20 |
+
|
21 |
+
}(function( $ ) {
|
22 |
+
|
23 |
+
var $window = $( window )
|
24 |
+
var $document = $( document )
|
25 |
+
var $html = $( document.documentElement )
|
26 |
+
var supportsTransitions = document.documentElement.style.transition != null
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* The picker constructor that creates a blank picker.
|
31 |
+
*/
|
32 |
+
function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
|
33 |
+
|
34 |
+
// If there’s no element, return the picker constructor.
|
35 |
+
if ( !ELEMENT ) return PickerConstructor
|
36 |
+
|
37 |
+
|
38 |
+
var
|
39 |
+
IS_DEFAULT_THEME = false,
|
40 |
+
|
41 |
+
|
42 |
+
// The state of the picker.
|
43 |
+
STATE = {
|
44 |
+
id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )
|
45 |
+
},
|
46 |
+
|
47 |
+
|
48 |
+
// Merge the defaults and options passed.
|
49 |
+
SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},
|
50 |
+
|
51 |
+
|
52 |
+
// Merge the default classes with the settings classes.
|
53 |
+
CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),
|
54 |
+
|
55 |
+
|
56 |
+
// The element node wrapper into a jQuery object.
|
57 |
+
$ELEMENT = $( ELEMENT ),
|
58 |
+
|
59 |
+
|
60 |
+
// Pseudo picker constructor.
|
61 |
+
PickerInstance = function() {
|
62 |
+
return this.start()
|
63 |
+
},
|
64 |
+
|
65 |
+
|
66 |
+
// The picker prototype.
|
67 |
+
P = PickerInstance.prototype = {
|
68 |
+
|
69 |
+
constructor: PickerInstance,
|
70 |
+
|
71 |
+
$node: $ELEMENT,
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Initialize everything
|
76 |
+
*/
|
77 |
+
start: function() {
|
78 |
+
|
79 |
+
// If it’s already started, do nothing.
|
80 |
+
if ( STATE && STATE.start ) return P
|
81 |
+
|
82 |
+
|
83 |
+
// Update the picker states.
|
84 |
+
STATE.methods = {}
|
85 |
+
STATE.start = true
|
86 |
+
STATE.open = false
|
87 |
+
STATE.type = ELEMENT.type
|
88 |
+
|
89 |
+
|
90 |
+
// Confirm focus state, convert into text input to remove UA stylings,
|
91 |
+
// and set as readonly to prevent keyboard popup.
|
92 |
+
ELEMENT.autofocus = ELEMENT == getActiveElement()
|
93 |
+
ELEMENT.readOnly = !SETTINGS.editable
|
94 |
+
ELEMENT.id = ELEMENT.id || STATE.id
|
95 |
+
if ( ELEMENT.type != 'text' ) {
|
96 |
+
ELEMENT.type = 'text'
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
// Create a new picker component with the settings.
|
101 |
+
P.component = new COMPONENT(P, SETTINGS)
|
102 |
+
|
103 |
+
|
104 |
+
// Create the picker root and then prepare it.
|
105 |
+
P.$root = $( '<div class="' + CLASSES.picker + '" id="' + ELEMENT.id + '_root" />' )
|
106 |
+
prepareElementRoot()
|
107 |
+
|
108 |
+
|
109 |
+
// Create the picker holder and then prepare it.
|
110 |
+
P.$holder = $( createWrappedComponent() ).appendTo( P.$root )
|
111 |
+
prepareElementHolder()
|
112 |
+
|
113 |
+
|
114 |
+
// If there’s a format for the hidden input element, create the element.
|
115 |
+
if ( SETTINGS.formatSubmit ) {
|
116 |
+
prepareElementHidden()
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
// Prepare the input element.
|
121 |
+
prepareElement()
|
122 |
+
|
123 |
+
|
124 |
+
// Insert the hidden input as specified in the settings.
|
125 |
+
if ( SETTINGS.containerHidden ) $( SETTINGS.containerHidden ).append( P._hidden )
|
126 |
+
else $ELEMENT.after( P._hidden )
|
127 |
+
|
128 |
+
|
129 |
+
// Insert the root as specified in the settings.
|
130 |
+
if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )
|
131 |
+
else $ELEMENT.after( P.$root )
|
132 |
+
|
133 |
+
|
134 |
+
// Bind the default component and settings events.
|
135 |
+
P.on({
|
136 |
+
start: P.component.onStart,
|
137 |
+
render: P.component.onRender,
|
138 |
+
stop: P.component.onStop,
|
139 |
+
open: P.component.onOpen,
|
140 |
+
close: P.component.onClose,
|
141 |
+
set: P.component.onSet
|
142 |
+
}).on({
|
143 |
+
start: SETTINGS.onStart,
|
144 |
+
render: SETTINGS.onRender,
|
145 |
+
stop: SETTINGS.onStop,
|
146 |
+
open: SETTINGS.onOpen,
|
147 |
+
close: SETTINGS.onClose,
|
148 |
+
set: SETTINGS.onSet
|
149 |
+
})
|
150 |
+
|
151 |
+
|
152 |
+
// Once we’re all set, check the theme in use.
|
153 |
+
IS_DEFAULT_THEME = isUsingDefaultTheme( P.$holder[0] )
|
154 |
+
|
155 |
+
|
156 |
+
// If the element has autofocus, open the picker.
|
157 |
+
if ( ELEMENT.autofocus ) {
|
158 |
+
P.open()
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
// Trigger queued the “start” and “render” events.
|
163 |
+
return P.trigger( 'start' ).trigger( 'render' )
|
164 |
+
}, //start
|
165 |
+
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Render a new picker
|
169 |
+
*/
|
170 |
+
render: function( entireComponent ) {
|
171 |
+
|
172 |
+
// Insert a new component holder in the root or box.
|
173 |
+
if ( entireComponent ) {
|
174 |
+
P.$holder = $( createWrappedComponent() )
|
175 |
+
prepareElementHolder()
|
176 |
+
P.$root.html( P.$holder )
|
177 |
+
}
|
178 |
+
else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )
|
179 |
+
|
180 |
+
// Trigger the queued “render” events.
|
181 |
+
return P.trigger( 'render' )
|
182 |
+
}, //render
|
183 |
+
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Destroy everything
|
187 |
+
*/
|
188 |
+
stop: function() {
|
189 |
+
|
190 |
+
// If it’s already stopped, do nothing.
|
191 |
+
if ( !STATE.start ) return P
|
192 |
+
|
193 |
+
// Then close the picker.
|
194 |
+
P.close()
|
195 |
+
|
196 |
+
// Remove the hidden field.
|
197 |
+
if ( P._hidden ) {
|
198 |
+
P._hidden.parentNode.removeChild( P._hidden )
|
199 |
+
}
|
200 |
+
|
201 |
+
// Remove the root.
|
202 |
+
P.$root.remove()
|
203 |
+
|
204 |
+
// Remove the input class, remove the stored data, and unbind
|
205 |
+
// the events (after a tick for IE - see `P.close`).
|
206 |
+
$ELEMENT.removeClass( CLASSES.input ).removeData( NAME )
|
207 |
+
setTimeout( function() {
|
208 |
+
$ELEMENT.off( '.' + STATE.id )
|
209 |
+
}, 0)
|
210 |
+
|
211 |
+
// Restore the element state
|
212 |
+
ELEMENT.type = STATE.type
|
213 |
+
ELEMENT.readOnly = false
|
214 |
+
|
215 |
+
// Trigger the queued “stop” events.
|
216 |
+
P.trigger( 'stop' )
|
217 |
+
|
218 |
+
// Reset the picker states.
|
219 |
+
STATE.methods = {}
|
220 |
+
STATE.start = false
|
221 |
+
|
222 |
+
return P
|
223 |
+
}, //stop
|
224 |
+
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Open up the picker
|
228 |
+
*/
|
229 |
+
open: function( dontGiveFocus ) {
|
230 |
+
|
231 |
+
// If it’s already open, do nothing.
|
232 |
+
if ( STATE.open ) return P
|
233 |
+
|
234 |
+
// Add the “active” class.
|
235 |
+
$ELEMENT.addClass( CLASSES.active )
|
236 |
+
aria( ELEMENT, 'expanded', true )
|
237 |
+
|
238 |
+
// * A Firefox bug, when `html` has `overflow:hidden`, results in
|
239 |
+
// killing transitions :(. So add the “opened” state on the next tick.
|
240 |
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
|
241 |
+
setTimeout( function() {
|
242 |
+
|
243 |
+
// Add the “opened” class to the picker root.
|
244 |
+
P.$root.addClass( CLASSES.opened )
|
245 |
+
aria( P.$root[0], 'hidden', false )
|
246 |
+
|
247 |
+
}, 0 )
|
248 |
+
|
249 |
+
// If we have to give focus, bind the element and doc events.
|
250 |
+
if ( dontGiveFocus !== false ) {
|
251 |
+
|
252 |
+
// Set it as open.
|
253 |
+
STATE.open = true
|
254 |
+
|
255 |
+
// Prevent the page from scrolling.
|
256 |
+
if ( IS_DEFAULT_THEME ) {
|
257 |
+
$html.
|
258 |
+
css( 'overflow', 'hidden' ).
|
259 |
+
css( 'padding-right', '+=' + getScrollbarWidth() )
|
260 |
+
}
|
261 |
+
|
262 |
+
// Pass focus to the root element’s jQuery object.
|
263 |
+
focusPickerOnceOpened()
|
264 |
+
|
265 |
+
// Bind the document events.
|
266 |
+
$document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {
|
267 |
+
|
268 |
+
var target = event.target
|
269 |
+
|
270 |
+
// If the target of the event is not the element, close the picker picker.
|
271 |
+
// * Don’t worry about clicks or focusins on the root because those don’t bubble up.
|
272 |
+
// Also, for Firefox, a click on an `option` element bubbles up directly
|
273 |
+
// to the doc. So make sure the target wasn't the doc.
|
274 |
+
// * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,
|
275 |
+
// which causes the picker to unexpectedly close when right-clicking it. So make
|
276 |
+
// sure the event wasn’t a right-click.
|
277 |
+
if ( target != ELEMENT && target != document && event.which != 3 ) {
|
278 |
+
|
279 |
+
// If the target was the holder that covers the screen,
|
280 |
+
// keep the element focused to maintain tabindex.
|
281 |
+
P.close( target === P.$holder[0] )
|
282 |
+
}
|
283 |
+
|
284 |
+
}).on( 'keydown.' + STATE.id, function( event ) {
|
285 |
+
|
286 |
+
var
|
287 |
+
// Get the keycode.
|
288 |
+
keycode = event.keyCode,
|
289 |
+
|
290 |
+
// Translate that to a selection change.
|
291 |
+
keycodeToMove = P.component.key[ keycode ],
|
292 |
+
|
293 |
+
// Grab the target.
|
294 |
+
target = event.target
|
295 |
+
|
296 |
+
|
297 |
+
// On escape, close the picker and give focus.
|
298 |
+
if ( keycode == 27 ) {
|
299 |
+
P.close( true )
|
300 |
+
}
|
301 |
+
|
302 |
+
|
303 |
+
// Check if there is a key movement or “enter” keypress on the element.
|
304 |
+
else if ( target == P.$holder[0] && ( keycodeToMove || keycode == 13 ) ) {
|
305 |
+
|
306 |
+
// Prevent the default action to stop page movement.
|
307 |
+
event.preventDefault()
|
308 |
+
|
309 |
+
// Trigger the key movement action.
|
310 |
+
if ( keycodeToMove ) {
|
311 |
+
PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )
|
312 |
+
}
|
313 |
+
|
314 |
+
// On “enter”, if the highlighted item isn’t disabled, set the value and close.
|
315 |
+
else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {
|
316 |
+
P.set( 'select', P.component.item.highlight )
|
317 |
+
if ( SETTINGS.closeOnSelect ) {
|
318 |
+
P.close( true )
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
|
324 |
+
// If the target is within the root and “enter” is pressed,
|
325 |
+
// prevent the default action and trigger a click on the target instead.
|
326 |
+
else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {
|
327 |
+
event.preventDefault()
|
328 |
+
target.click()
|
329 |
+
}
|
330 |
+
})
|
331 |
+
}
|
332 |
+
|
333 |
+
// Trigger the queued “open” events.
|
334 |
+
return P.trigger( 'open' )
|
335 |
+
}, //open
|
336 |
+
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Close the picker
|
340 |
+
*/
|
341 |
+
close: function( giveFocus ) {
|
342 |
+
|
343 |
+
// If we need to give focus, do it before changing states.
|
344 |
+
if ( giveFocus ) {
|
345 |
+
if ( SETTINGS.editable ) {
|
346 |
+
ELEMENT.focus()
|
347 |
+
}
|
348 |
+
else {
|
349 |
+
// ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|
|
350 |
+
// The focus is triggered *after* the close has completed - causing it
|
351 |
+
// to open again. So unbind and rebind the event at the next tick.
|
352 |
+
P.$holder.off( 'focus.toOpen' ).focus()
|
353 |
+
setTimeout( function() {
|
354 |
+
P.$holder.on( 'focus.toOpen', handleFocusToOpenEvent )
|
355 |
+
}, 0 )
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
// Remove the “active” class.
|
360 |
+
$ELEMENT.removeClass( CLASSES.active )
|
361 |
+
aria( ELEMENT, 'expanded', false )
|
362 |
+
|
363 |
+
// * A Firefox bug, when `html` has `overflow:hidden`, results in
|
364 |
+
// killing transitions :(. So remove the “opened” state on the next tick.
|
365 |
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
|
366 |
+
setTimeout( function() {
|
367 |
+
|
368 |
+
// Remove the “opened” and “focused” class from the picker root.
|
369 |
+
P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )
|
370 |
+
aria( P.$root[0], 'hidden', true )
|
371 |
+
|
372 |
+
}, 0 )
|
373 |
+
|
374 |
+
// If it’s already closed, do nothing more.
|
375 |
+
if ( !STATE.open ) return P
|
376 |
+
|
377 |
+
// Set it as closed.
|
378 |
+
STATE.open = false
|
379 |
+
|
380 |
+
// Allow the page to scroll.
|
381 |
+
if ( IS_DEFAULT_THEME ) {
|
382 |
+
$html.
|
383 |
+
css( 'overflow', '' ).
|
384 |
+
css( 'padding-right', '-=' + getScrollbarWidth() )
|
385 |
+
}
|
386 |
+
|
387 |
+
// Unbind the document events.
|
388 |
+
$document.off( '.' + STATE.id )
|
389 |
+
|
390 |
+
// Trigger the queued “close” events.
|
391 |
+
return P.trigger( 'close' )
|
392 |
+
}, //close
|
393 |
+
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Clear the values
|
397 |
+
*/
|
398 |
+
clear: function( options ) {
|
399 |
+
return P.set( 'clear', null, options )
|
400 |
+
}, //clear
|
401 |
+
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Set something
|
405 |
+
*/
|
406 |
+
set: function( thing, value, options ) {
|
407 |
+
|
408 |
+
var thingItem, thingValue,
|
409 |
+
thingIsObject = $.isPlainObject( thing ),
|
410 |
+
thingObject = thingIsObject ? thing : {}
|
411 |
+
|
412 |
+
// Make sure we have usable options.
|
413 |
+
options = thingIsObject && $.isPlainObject( value ) ? value : options || {}
|
414 |
+
|
415 |
+
if ( thing ) {
|
416 |
+
|
417 |
+
// If the thing isn’t an object, make it one.
|
418 |
+
if ( !thingIsObject ) {
|
419 |
+
thingObject[ thing ] = value
|
420 |
+
}
|
421 |
+
|
422 |
+
// Go through the things of items to set.
|
423 |
+
for ( thingItem in thingObject ) {
|
424 |
+
|
425 |
+
// Grab the value of the thing.
|
426 |
+
thingValue = thingObject[ thingItem ]
|
427 |
+
|
428 |
+
// First, if the item exists and there’s a value, set it.
|
429 |
+
if ( thingItem in P.component.item ) {
|
430 |
+
if ( thingValue === undefined ) thingValue = null
|
431 |
+
P.component.set( thingItem, thingValue, options )
|
432 |
+
}
|
433 |
+
|
434 |
+
// Then, check to update the element value and broadcast a change.
|
435 |
+
if ( thingItem == 'select' || thingItem == 'clear' ) {
|
436 |
+
$ELEMENT.
|
437 |
+
val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).
|
438 |
+
trigger( 'change' )
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
// Render a new picker.
|
443 |
+
P.render()
|
444 |
+
}
|
445 |
+
|
446 |
+
// When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.
|
447 |
+
return options.muted ? P : P.trigger( 'set', thingObject )
|
448 |
+
}, //set
|
449 |
+
|
450 |
+
|
451 |
+
/**
|
452 |
+
* Get something
|
453 |
+
*/
|
454 |
+
get: function( thing, format ) {
|
455 |
+
|
456 |
+
// Make sure there’s something to get.
|
457 |
+
thing = thing || 'value'
|
458 |
+
|
459 |
+
// If a picker state exists, return that.
|
460 |
+
if ( STATE[ thing ] != null ) {
|
461 |
+
return STATE[ thing ]
|
462 |
+
}
|
463 |
+
|
464 |
+
// Return the submission value, if that.
|
465 |
+
if ( thing == 'valueSubmit' ) {
|
466 |
+
if ( P._hidden ) {
|
467 |
+
return P._hidden.value
|
468 |
+
}
|
469 |
+
thing = 'value'
|
470 |
+
}
|
471 |
+
|
472 |
+
// Return the value, if that.
|
473 |
+
if ( thing == 'value' ) {
|
474 |
+
return ELEMENT.value
|
475 |
+
}
|
476 |
+
|
477 |
+
// Check if a component item exists, return that.
|
478 |
+
if ( thing in P.component.item ) {
|
479 |
+
if ( typeof format == 'string' ) {
|
480 |
+
var thingValue = P.component.get( thing )
|
481 |
+
return thingValue ?
|
482 |
+
PickerConstructor._.trigger(
|
483 |
+
P.component.formats.toString,
|
484 |
+
P.component,
|
485 |
+
[ format, thingValue ]
|
486 |
+
) : ''
|
487 |
+
}
|
488 |
+
return P.component.get( thing )
|
489 |
+
}
|
490 |
+
}, //get
|
491 |
+
|
492 |
+
|
493 |
+
|
494 |
+
/**
|
495 |
+
* Bind events on the things.
|
496 |
+
*/
|
497 |
+
on: function( thing, method, internal ) {
|
498 |
+
|
499 |
+
var thingName, thingMethod,
|
500 |
+
thingIsObject = $.isPlainObject( thing ),
|
501 |
+
thingObject = thingIsObject ? thing : {}
|
502 |
+
|
503 |
+
if ( thing ) {
|
504 |
+
|
505 |
+
// If the thing isn’t an object, make it one.
|
506 |
+
if ( !thingIsObject ) {
|
507 |
+
thingObject[ thing ] = method
|
508 |
+
}
|
509 |
+
|
510 |
+
// Go through the things to bind to.
|
511 |
+
for ( thingName in thingObject ) {
|
512 |
+
|
513 |
+
// Grab the method of the thing.
|
514 |
+
thingMethod = thingObject[ thingName ]
|
515 |
+
|
516 |
+
// If it was an internal binding, prefix it.
|
517 |
+
if ( internal ) {
|
518 |
+
thingName = '_' + thingName
|
519 |
+
}
|
520 |
+
|
521 |
+
// Make sure the thing methods collection exists.
|
522 |
+
STATE.methods[ thingName ] = STATE.methods[ thingName ] || []
|
523 |
+
|
524 |
+
// Add the method to the relative method collection.
|
525 |
+
STATE.methods[ thingName ].push( thingMethod )
|
526 |
+
}
|
527 |
+
}
|
528 |
+
|
529 |
+
return P
|
530 |
+
}, //on
|
531 |
+
|
532 |
+
|
533 |
+
|
534 |
+
/**
|
535 |
+
* Unbind events on the things.
|
536 |
+
*/
|
537 |
+
off: function() {
|
538 |
+
var i, thingName,
|
539 |
+
names = arguments;
|
540 |
+
for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {
|
541 |
+
thingName = names[i]
|
542 |
+
if ( thingName in STATE.methods ) {
|
543 |
+
delete STATE.methods[thingName]
|
544 |
+
}
|
545 |
+
}
|
546 |
+
return P
|
547 |
+
},
|
548 |
+
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Fire off method events.
|
552 |
+
*/
|
553 |
+
trigger: function( name, data ) {
|
554 |
+
var _trigger = function( name ) {
|
555 |
+
var methodList = STATE.methods[ name ]
|
556 |
+
if ( methodList ) {
|
557 |
+
methodList.map( function( method ) {
|
558 |
+
PickerConstructor._.trigger( method, P, [ data ] )
|
559 |
+
})
|
560 |
+
}
|
561 |
+
}
|
562 |
+
_trigger( '_' + name )
|
563 |
+
_trigger( name )
|
564 |
+
return P
|
565 |
+
} //trigger
|
566 |
+
} //PickerInstance.prototype
|
567 |
+
|
568 |
+
|
569 |
+
/**
|
570 |
+
* Wrap the picker holder components together.
|
571 |
+
*/
|
572 |
+
function createWrappedComponent() {
|
573 |
+
|
574 |
+
// Create a picker wrapper holder
|
575 |
+
return PickerConstructor._.node( 'div',
|
576 |
+
|
577 |
+
// Create a picker wrapper node
|
578 |
+
PickerConstructor._.node( 'div',
|
579 |
+
|
580 |
+
// Create a picker frame
|
581 |
+
PickerConstructor._.node( 'div',
|
582 |
+
|
583 |
+
// Create a picker box node
|
584 |
+
PickerConstructor._.node( 'div',
|
585 |
+
|
586 |
+
// Create the components nodes.
|
587 |
+
P.component.nodes( STATE.open ),
|
588 |
+
|
589 |
+
// The picker box class
|
590 |
+
CLASSES.box
|
591 |
+
),
|
592 |
+
|
593 |
+
// Picker wrap class
|
594 |
+
CLASSES.wrap
|
595 |
+
),
|
596 |
+
|
597 |
+
// Picker frame class
|
598 |
+
CLASSES.frame
|
599 |
+
),
|
600 |
+
|
601 |
+
// Picker holder class
|
602 |
+
CLASSES.holder,
|
603 |
+
|
604 |
+
'tabindex="-1"'
|
605 |
+
) //endreturn
|
606 |
+
} //createWrappedComponent
|
607 |
+
|
608 |
+
|
609 |
+
|
610 |
+
/**
|
611 |
+
* Prepare the input element with all bindings.
|
612 |
+
*/
|
613 |
+
function prepareElement() {
|
614 |
+
|
615 |
+
$ELEMENT.
|
616 |
+
|
617 |
+
// Store the picker data by component name.
|
618 |
+
data(NAME, P).
|
619 |
+
|
620 |
+
// Add the “input” class name.
|
621 |
+
addClass(CLASSES.input).
|
622 |
+
|
623 |
+
// If there’s a `data-value`, update the value of the element.
|
624 |
+
val( $ELEMENT.data('value') ?
|
625 |
+
P.get('select', SETTINGS.format) :
|
626 |
+
ELEMENT.value
|
627 |
+
)
|
628 |
+
|
629 |
+
|
630 |
+
// Only bind keydown events if the element isn’t editable.
|
631 |
+
if ( !SETTINGS.editable ) {
|
632 |
+
|
633 |
+
$ELEMENT.
|
634 |
+
|
635 |
+
// On focus/click, open the picker.
|
636 |
+
on( 'focus.' + STATE.id + ' click.' + STATE.id, function(event) {
|
637 |
+
event.preventDefault()
|
638 |
+
P.open()
|
639 |
+
}).
|
640 |
+
|
641 |
+
// Handle keyboard event based on the picker being opened or not.
|
642 |
+
on( 'keydown.' + STATE.id, handleKeydownEvent )
|
643 |
+
}
|
644 |
+
|
645 |
+
|
646 |
+
// Update the aria attributes.
|
647 |
+
aria(ELEMENT, {
|
648 |
+
haspopup: true,
|
649 |
+
expanded: false,
|
650 |
+
readonly: false,
|
651 |
+
owns: ELEMENT.id + '_root'
|
652 |
+
})
|
653 |
+
}
|
654 |
+
|
655 |
+
|
656 |
+
/**
|
657 |
+
* Prepare the root picker element with all bindings.
|
658 |
+
*/
|
659 |
+
function prepareElementRoot() {
|
660 |
+
aria( P.$root[0], 'hidden', true )
|
661 |
+
}
|
662 |
+
|
663 |
+
|
664 |
+
/**
|
665 |
+
* Prepare the holder picker element with all bindings.
|
666 |
+
*/
|
667 |
+
function prepareElementHolder() {
|
668 |
+
|
669 |
+
P.$holder.
|
670 |
+
|
671 |
+
on({
|
672 |
+
|
673 |
+
// For iOS8.
|
674 |
+
keydown: handleKeydownEvent,
|
675 |
+
|
676 |
+
'focus.toOpen': handleFocusToOpenEvent,
|
677 |
+
|
678 |
+
blur: function() {
|
679 |
+
// Remove the “target” class.
|
680 |
+
$ELEMENT.removeClass( CLASSES.target )
|
681 |
+
},
|
682 |
+
|
683 |
+
// When something within the holder is focused, stop from bubbling
|
684 |
+
// to the doc and remove the “focused” state from the root.
|
685 |
+
focusin: function( event ) {
|
686 |
+
P.$root.removeClass( CLASSES.focused )
|
687 |
+
event.stopPropagation()
|
688 |
+
},
|
689 |
+
|
690 |
+
// When something within the holder is clicked, stop it
|
691 |
+
// from bubbling to the doc.
|
692 |
+
'mousedown click': function( event ) {
|
693 |
+
|
694 |
+
var target = event.target
|
695 |
+
|
696 |
+
// Make sure the target isn’t the root holder so it can bubble up.
|
697 |
+
if ( target != P.$holder[0] ) {
|
698 |
+
|
699 |
+
event.stopPropagation()
|
700 |
+
|
701 |
+
// * For mousedown events, cancel the default action in order to
|
702 |
+
// prevent cases where focus is shifted onto external elements
|
703 |
+
// when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).
|
704 |
+
// Also, for Firefox, don’t prevent action on the `option` element.
|
705 |
+
if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {
|
706 |
+
|
707 |
+
event.preventDefault()
|
708 |
+
|
709 |
+
// Re-focus onto the holder so that users can click away
|
710 |
+
// from elements focused within the picker.
|
711 |
+
P.$holder[0].focus()
|
712 |
+
}
|
713 |
+
}
|
714 |
+
}
|
715 |
+
|
716 |
+
}).
|
717 |
+
|
718 |
+
// If there’s a click on an actionable element, carry out the actions.
|
719 |
+
on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {
|
720 |
+
|
721 |
+
var $target = $( this ),
|
722 |
+
targetData = $target.data(),
|
723 |
+
targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),
|
724 |
+
|
725 |
+
// * For IE, non-focusable elements can be active elements as well
|
726 |
+
// (http://stackoverflow.com/a/2684561).
|
727 |
+
activeElement = getActiveElement()
|
728 |
+
activeElement = activeElement && ( activeElement.type || activeElement.href )
|
729 |
+
|
730 |
+
// If it’s disabled or nothing inside is actively focused, re-focus the element.
|
731 |
+
if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {
|
732 |
+
P.$holder[0].focus()
|
733 |
+
}
|
734 |
+
|
735 |
+
// If something is superficially changed, update the `highlight` based on the `nav`.
|
736 |
+
if ( !targetDisabled && targetData.nav ) {
|
737 |
+
P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )
|
738 |
+
}
|
739 |
+
|
740 |
+
// If something is picked, set `select` then close with focus.
|
741 |
+
else if ( !targetDisabled && 'pick' in targetData ) {
|
742 |
+
P.set( 'select', targetData.pick )
|
743 |
+
if ( SETTINGS.closeOnSelect ) {
|
744 |
+
P.close( true )
|
745 |
+
}
|
746 |
+
}
|
747 |
+
|
748 |
+
// If a “clear” button is pressed, empty the values and close with focus.
|
749 |
+
else if ( targetData.clear ) {
|
750 |
+
P.clear()
|
751 |
+
if ( SETTINGS.closeOnClear ) {
|
752 |
+
P.close( true )
|
753 |
+
}
|
754 |
+
}
|
755 |
+
|
756 |
+
else if ( targetData.close ) {
|
757 |
+
P.close( true )
|
758 |
+
}
|
759 |
+
|
760 |
+
}) //P.$holder
|
761 |
+
|
762 |
+
}
|
763 |
+
|
764 |
+
|
765 |
+
/**
|
766 |
+
* Prepare the hidden input element along with all bindings.
|
767 |
+
*/
|
768 |
+
function prepareElementHidden() {
|
769 |
+
|
770 |
+
var name
|
771 |
+
|
772 |
+
if ( SETTINGS.hiddenName === true ) {
|
773 |
+
name = ELEMENT.name
|
774 |
+
ELEMENT.name = ''
|
775 |
+
}
|
776 |
+
else {
|
777 |
+
name = [
|
778 |
+
typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',
|
779 |
+
typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'
|
780 |
+
]
|
781 |
+
name = name[0] + ELEMENT.name + name[1]
|
782 |
+
}
|
783 |
+
|
784 |
+
P._hidden = $(
|
785 |
+
'<input ' +
|
786 |
+
'type=hidden ' +
|
787 |
+
|
788 |
+
// Create the name using the original input’s with a prefix and suffix.
|
789 |
+
'name="' + name + '"' +
|
790 |
+
|
791 |
+
// If the element has a value, set the hidden value as well.
|
792 |
+
(
|
793 |
+
$ELEMENT.data('value') || ELEMENT.value ?
|
794 |
+
' value="' + P.get('select', SETTINGS.formatSubmit) + '"' :
|
795 |
+
''
|
796 |
+
) +
|
797 |
+
'>'
|
798 |
+
)[0]
|
799 |
+
|
800 |
+
$ELEMENT.
|
801 |
+
|
802 |
+
// If the value changes, update the hidden input with the correct format.
|
803 |
+
on('change.' + STATE.id, function() {
|
804 |
+
P._hidden.value = ELEMENT.value ?
|
805 |
+
P.get('select', SETTINGS.formatSubmit) :
|
806 |
+
''
|
807 |
+
})
|
808 |
+
}
|
809 |
+
|
810 |
+
|
811 |
+
// Wait for transitions to end before focusing the holder. Otherwise, while
|
812 |
+
// using the `container` option, the view jumps to the container.
|
813 |
+
function focusPickerOnceOpened() {
|
814 |
+
|
815 |
+
if (IS_DEFAULT_THEME && supportsTransitions) {
|
816 |
+
P.$holder.find('.' + CLASSES.frame).one('transitionend', function() {
|
817 |
+
P.$holder[0].focus()
|
818 |
+
})
|
819 |
+
}
|
820 |
+
else {
|
821 |
+
P.$holder[0].focus()
|
822 |
+
}
|
823 |
+
}
|
824 |
+
|
825 |
+
|
826 |
+
function handleFocusToOpenEvent(event) {
|
827 |
+
|
828 |
+
// Stop the event from propagating to the doc.
|
829 |
+
event.stopPropagation()
|
830 |
+
|
831 |
+
// Add the “target” class.
|
832 |
+
$ELEMENT.addClass( CLASSES.target )
|
833 |
+
|
834 |
+
// Add the “focused” class to the root.
|
835 |
+
P.$root.addClass( CLASSES.focused )
|
836 |
+
|
837 |
+
// And then finally open the picker.
|
838 |
+
P.open()
|
839 |
+
}
|
840 |
+
|
841 |
+
|
842 |
+
// For iOS8.
|
843 |
+
function handleKeydownEvent( event ) {
|
844 |
+
|
845 |
+
var keycode = event.keyCode,
|
846 |
+
|
847 |
+
// Check if one of the delete keys was pressed.
|
848 |
+
isKeycodeDelete = /^(8|46)$/.test(keycode)
|
849 |
+
|
850 |
+
// For some reason IE clears the input value on “escape”.
|
851 |
+
if ( keycode == 27 ) {
|
852 |
+
P.close( true )
|
853 |
+
return false
|
854 |
+
}
|
855 |
+
|
856 |
+
// Check if `space` or `delete` was pressed or the picker is closed with a key movement.
|
857 |
+
if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {
|
858 |
+
|
859 |
+
// Prevent it from moving the page and bubbling to doc.
|
860 |
+
event.preventDefault()
|
861 |
+
event.stopPropagation()
|
862 |
+
|
863 |
+
// If `delete` was pressed, clear the values and close the picker.
|
864 |
+
// Otherwise open the picker.
|
865 |
+
if ( isKeycodeDelete ) { P.clear().close() }
|
866 |
+
else { P.open() }
|
867 |
+
}
|
868 |
+
}
|
869 |
+
|
870 |
+
|
871 |
+
// Return a new picker instance.
|
872 |
+
return new PickerInstance()
|
873 |
+
} //PickerConstructor
|
874 |
+
|
875 |
+
|
876 |
+
|
877 |
+
/**
|
878 |
+
* The default classes and prefix to use for the HTML classes.
|
879 |
+
*/
|
880 |
+
PickerConstructor.klasses = function( prefix ) {
|
881 |
+
prefix = prefix || 'picker'
|
882 |
+
return {
|
883 |
+
|
884 |
+
picker: prefix,
|
885 |
+
opened: prefix + '--opened',
|
886 |
+
focused: prefix + '--focused',
|
887 |
+
|
888 |
+
input: prefix + '__input',
|
889 |
+
active: prefix + '__input--active',
|
890 |
+
target: prefix + '__input--target',
|
891 |
+
|
892 |
+
holder: prefix + '__holder',
|
893 |
+
|
894 |
+
frame: prefix + '__frame',
|
895 |
+
wrap: prefix + '__wrap',
|
896 |
+
|
897 |
+
box: prefix + '__box'
|
898 |
+
}
|
899 |
+
} //PickerConstructor.klasses
|
900 |
+
|
901 |
+
|
902 |
+
|
903 |
+
/**
|
904 |
+
* Check if the default theme is being used.
|
905 |
+
*/
|
906 |
+
function isUsingDefaultTheme( element ) {
|
907 |
+
|
908 |
+
var theme,
|
909 |
+
prop = 'position'
|
910 |
+
|
911 |
+
// For IE.
|
912 |
+
if ( element.currentStyle ) {
|
913 |
+
theme = element.currentStyle[prop]
|
914 |
+
}
|
915 |
+
|
916 |
+
// For normal browsers.
|
917 |
+
else if ( window.getComputedStyle ) {
|
918 |
+
theme = getComputedStyle( element )[prop]
|
919 |
+
}
|
920 |
+
|
921 |
+
return theme == 'fixed'
|
922 |
+
}
|
923 |
+
|
924 |
+
|
925 |
+
|
926 |
+
/**
|
927 |
+
* Get the width of the browser’s scrollbar.
|
928 |
+
* Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js
|
929 |
+
*/
|
930 |
+
function getScrollbarWidth() {
|
931 |
+
|
932 |
+
if ( $html.height() <= $window.height() ) {
|
933 |
+
return 0
|
934 |
+
}
|
935 |
+
|
936 |
+
var $outer = $( '<div style="visibility:hidden;width:100px" />' ).
|
937 |
+
appendTo( 'body' )
|
938 |
+
|
939 |
+
// Get the width without scrollbars.
|
940 |
+
var widthWithoutScroll = $outer[0].offsetWidth
|
941 |
+
|
942 |
+
// Force adding scrollbars.
|
943 |
+
$outer.css( 'overflow', 'scroll' )
|
944 |
+
|
945 |
+
// Add the inner div.
|
946 |
+
var $inner = $( '<div style="width:100%" />' ).appendTo( $outer )
|
947 |
+
|
948 |
+
// Get the width with scrollbars.
|
949 |
+
var widthWithScroll = $inner[0].offsetWidth
|
950 |
+
|
951 |
+
// Remove the divs.
|
952 |
+
$outer.remove()
|
953 |
+
|
954 |
+
// Return the difference between the widths.
|
955 |
+
return widthWithoutScroll - widthWithScroll
|
956 |
+
}
|
957 |
+
|
958 |
+
|
959 |
+
|
960 |
+
/**
|
961 |
+
* PickerConstructor helper methods.
|
962 |
+
*/
|
963 |
+
PickerConstructor._ = {
|
964 |
+
|
965 |
+
/**
|
966 |
+
* Create a group of nodes. Expects:
|
967 |
+
* `
|
968 |
+
{
|
969 |
+
min: {Integer},
|
970 |
+
max: {Integer},
|
971 |
+
i: {Integer},
|
972 |
+
node: {String},
|
973 |
+
item: {Function}
|
974 |
+
}
|
975 |
+
* `
|
976 |
+
*/
|
977 |
+
group: function( groupObject ) {
|
978 |
+
|
979 |
+
var
|
980 |
+
// Scope for the looped object
|
981 |
+
loopObjectScope,
|
982 |
+
|
983 |
+
// Create the nodes list
|
984 |
+
nodesList = '',
|
985 |
+
|
986 |
+
// The counter starts from the `min`
|
987 |
+
counter = PickerConstructor._.trigger( groupObject.min, groupObject )
|
988 |
+
|
989 |
+
|
990 |
+
// Loop from the `min` to `max`, incrementing by `i`
|
991 |
+
for ( ; counter <= PickerConstructor._.trigger( groupObject.max, groupObject, [ counter ] ); counter += groupObject.i ) {
|
992 |
+
|
993 |
+
// Trigger the `item` function within scope of the object
|
994 |
+
loopObjectScope = PickerConstructor._.trigger( groupObject.item, groupObject, [ counter ] )
|
995 |
+
|
996 |
+
// Splice the subgroup and create nodes out of the sub nodes
|
997 |
+
nodesList += PickerConstructor._.node(
|
998 |
+
groupObject.node,
|
999 |
+
loopObjectScope[ 0 ], // the node
|
1000 |
+
loopObjectScope[ 1 ], // the classes
|
1001 |
+
loopObjectScope[ 2 ] // the attributes
|
1002 |
+
)
|
1003 |
+
}
|
1004 |
+
|
1005 |
+
// Return the list of nodes
|
1006 |
+
return nodesList
|
1007 |
+
}, //group
|
1008 |
+
|
1009 |
+
|
1010 |
+
/**
|
1011 |
+
* Create a dom node string
|
1012 |
+
*/
|
1013 |
+
node: function( wrapper, item, klass, attribute ) {
|
1014 |
+
|
1015 |
+
// If the item is false-y, just return an empty string
|
1016 |
+
if ( !item ) return ''
|
1017 |
+
|
1018 |
+
// If the item is an array, do a join
|
1019 |
+
item = $.isArray( item ) ? item.join( '' ) : item
|
1020 |
+
|
1021 |
+
// Check for the class
|
1022 |
+
klass = klass ? ' class="' + klass + '"' : ''
|
1023 |
+
|
1024 |
+
// Check for any attributes
|
1025 |
+
attribute = attribute ? ' ' + attribute : ''
|
1026 |
+
|
1027 |
+
// Return the wrapped item
|
1028 |
+
return '<' + wrapper + klass + attribute + '>' + item + '</' + wrapper + '>'
|
1029 |
+
}, //node
|
1030 |
+
|
1031 |
+
|
1032 |
+
/**
|
1033 |
+
* Lead numbers below 10 with a zero.
|
1034 |
+
*/
|
1035 |
+
lead: function( number ) {
|
1036 |
+
return ( number < 10 ? '0': '' ) + number
|
1037 |
+
},
|
1038 |
+
|
1039 |
+
|
1040 |
+
/**
|
1041 |
+
* Trigger a function otherwise return the value.
|
1042 |
+
*/
|
1043 |
+
trigger: function( callback, scope, args ) {
|
1044 |
+
return typeof callback == 'function' ? callback.apply( scope, args || [] ) : callback
|
1045 |
+
},
|
1046 |
+
|
1047 |
+
|
1048 |
+
/**
|
1049 |
+
* If the second character is a digit, length is 2 otherwise 1.
|
1050 |
+
*/
|
1051 |
+
digits: function( string ) {
|
1052 |
+
return ( /\d/ ).test( string[ 1 ] ) ? 2 : 1
|
1053 |
+
},
|
1054 |
+
|
1055 |
+
|
1056 |
+
/**
|
1057 |
+
* Tell if something is a date object.
|
1058 |
+
*/
|
1059 |
+
isDate: function( value ) {
|
1060 |
+
return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() )
|
1061 |
+
},
|
1062 |
+
|
1063 |
+
|
1064 |
+
/**
|
1065 |
+
* Tell if something is an integer.
|
1066 |
+
*/
|
1067 |
+
isInteger: function( value ) {
|
1068 |
+
return {}.toString.call( value ).indexOf( 'Number' ) > -1 && value % 1 === 0
|
1069 |
+
},
|
1070 |
+
|
1071 |
+
|
1072 |
+
/**
|
1073 |
+
* Create ARIA attribute strings.
|
1074 |
+
*/
|
1075 |
+
ariaAttr: ariaAttr
|
1076 |
+
} //PickerConstructor._
|
1077 |
+
|
1078 |
+
|
1079 |
+
|
1080 |
+
/**
|
1081 |
+
* Extend the picker with a component and defaults.
|
1082 |
+
*/
|
1083 |
+
PickerConstructor.extend = function( name, Component ) {
|
1084 |
+
|
1085 |
+
// Extend jQuery.
|
1086 |
+
$.fn[ name ] = function( options, action ) {
|
1087 |
+
|
1088 |
+
// Grab the component data.
|
1089 |
+
var componentData = this.data( name )
|
1090 |
+
|
1091 |
+
// If the picker is requested, return the data object.
|
1092 |
+
if ( options == 'picker' ) {
|
1093 |
+
return componentData
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
// If the component data exists and `options` is a string, carry out the action.
|
1097 |
+
if ( componentData && typeof options == 'string' ) {
|
1098 |
+
return PickerConstructor._.trigger( componentData[ options ], componentData, [ action ] )
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
// Otherwise go through each matched element and if the component
|
1102 |
+
// doesn’t exist, create a new picker using `this` element
|
1103 |
+
// and merging the defaults and options with a deep copy.
|
1104 |
+
return this.each( function() {
|
1105 |
+
var $this = $( this )
|
1106 |
+
if ( !$this.data( name ) ) {
|
1107 |
+
new PickerConstructor( this, name, Component, options )
|
1108 |
+
}
|
1109 |
+
})
|
1110 |
+
}
|
1111 |
+
|
1112 |
+
// Set the defaults.
|
1113 |
+
$.fn[ name ].defaults = Component.defaults
|
1114 |
+
} //PickerConstructor.extend
|
1115 |
+
|
1116 |
+
|
1117 |
+
|
1118 |
+
function aria(element, attribute, value) {
|
1119 |
+
if ( $.isPlainObject(attribute) ) {
|
1120 |
+
for ( var key in attribute ) {
|
1121 |
+
ariaSet(element, key, attribute[key])
|
1122 |
+
}
|
1123 |
+
}
|
1124 |
+
else {
|
1125 |
+
ariaSet(element, attribute, value)
|
1126 |
+
}
|
1127 |
+
}
|
1128 |
+
function ariaSet(element, attribute, value) {
|
1129 |
+
element.setAttribute(
|
1130 |
+
(attribute == 'role' ? '' : 'aria-') + attribute,
|
1131 |
+
value
|
1132 |
+
)
|
1133 |
+
}
|
1134 |
+
function ariaAttr(attribute, data) {
|
1135 |
+
if ( !$.isPlainObject(attribute) ) {
|
1136 |
+
attribute = { attribute: data }
|
1137 |
+
}
|
1138 |
+
data = ''
|
1139 |
+
for ( var key in attribute ) {
|
1140 |
+
var attr = (key == 'role' ? '' : 'aria-') + key,
|
1141 |
+
attrVal = attribute[key]
|
1142 |
+
data += attrVal == null ? '' : attr + '="' + attribute[key] + '"'
|
1143 |
+
}
|
1144 |
+
return data
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
// IE8 bug throws an error for activeElements within iframes.
|
1148 |
+
function getActiveElement() {
|
1149 |
+
try {
|
1150 |
+
return document.activeElement
|
1151 |
+
} catch ( err ) { }
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
|
1155 |
+
|
1156 |
+
// Expose the picker constructor.
|
1157 |
+
return PickerConstructor
|
1158 |
+
|
1159 |
+
|
1160 |
+
}));
|
1161 |
+
|
1162 |
+
|
1163 |
+
|
js/lib/picker.time.js
ADDED
@@ -0,0 +1,1013 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Time picker for pickadate.js v3.5.6
|
3 |
+
* http://amsul.github.io/pickadate.js/time.htm
|
4 |
+
*/
|
5 |
+
|
6 |
+
(function ( factory ) {
|
7 |
+
|
8 |
+
// AMD.
|
9 |
+
if ( typeof define == 'function' && define.amd )
|
10 |
+
define( ['picker', 'jquery'], factory )
|
11 |
+
|
12 |
+
// Node.js/browserify.
|
13 |
+
else if ( typeof exports == 'object' )
|
14 |
+
module.exports = factory( require('./picker.js'), require('jquery') )
|
15 |
+
|
16 |
+
// Browser globals.
|
17 |
+
else factory( Picker, jQuery )
|
18 |
+
|
19 |
+
}(function( Picker, $ ) {
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Globals and constants
|
24 |
+
*/
|
25 |
+
var HOURS_IN_DAY = 24,
|
26 |
+
MINUTES_IN_HOUR = 60,
|
27 |
+
HOURS_TO_NOON = 12,
|
28 |
+
MINUTES_IN_DAY = HOURS_IN_DAY * MINUTES_IN_HOUR,
|
29 |
+
_ = Picker._
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The time picker constructor
|
35 |
+
*/
|
36 |
+
function TimePicker( picker, settings ) {
|
37 |
+
|
38 |
+
var clock = this,
|
39 |
+
elementValue = picker.$node[ 0 ].value,
|
40 |
+
elementDataValue = picker.$node.data( 'value' ),
|
41 |
+
valueString = elementDataValue || elementValue,
|
42 |
+
formatString = elementDataValue ? settings.formatSubmit : settings.format
|
43 |
+
|
44 |
+
clock.settings = settings
|
45 |
+
clock.$node = picker.$node
|
46 |
+
|
47 |
+
// The queue of methods that will be used to build item objects.
|
48 |
+
clock.queue = {
|
49 |
+
interval: 'i',
|
50 |
+
min: 'measure create',
|
51 |
+
max: 'measure create',
|
52 |
+
now: 'now create',
|
53 |
+
select: 'parse create validate',
|
54 |
+
highlight: 'parse create validate',
|
55 |
+
view: 'parse create validate',
|
56 |
+
disable: 'deactivate',
|
57 |
+
enable: 'activate'
|
58 |
+
}
|
59 |
+
|
60 |
+
// The component's item object.
|
61 |
+
clock.item = {}
|
62 |
+
|
63 |
+
clock.item.clear = null
|
64 |
+
clock.item.interval = settings.interval || 30
|
65 |
+
clock.item.disable = ( settings.disable || [] ).slice( 0 )
|
66 |
+
clock.item.enable = -(function( collectionDisabled ) {
|
67 |
+
return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1
|
68 |
+
})( clock.item.disable )
|
69 |
+
|
70 |
+
clock.
|
71 |
+
set( 'min', settings.min ).
|
72 |
+
set( 'max', settings.max ).
|
73 |
+
set( 'now' )
|
74 |
+
|
75 |
+
// When there’s a value, set the `select`, which in turn
|
76 |
+
// also sets the `highlight` and `view`.
|
77 |
+
if ( valueString ) {
|
78 |
+
clock.set( 'select', valueString, {
|
79 |
+
format: formatString
|
80 |
+
})
|
81 |
+
}
|
82 |
+
|
83 |
+
// If there’s no value, default to highlighting “today”.
|
84 |
+
else {
|
85 |
+
clock.
|
86 |
+
set( 'select', null ).
|
87 |
+
set( 'highlight', clock.item.now )
|
88 |
+
}
|
89 |
+
|
90 |
+
// The keycode to movement mapping.
|
91 |
+
clock.key = {
|
92 |
+
40: 1, // Down
|
93 |
+
38: -1, // Up
|
94 |
+
39: 1, // Right
|
95 |
+
37: -1, // Left
|
96 |
+
go: function( timeChange ) {
|
97 |
+
clock.set(
|
98 |
+
'highlight',
|
99 |
+
clock.item.highlight.pick + timeChange * clock.item.interval,
|
100 |
+
{ interval: timeChange * clock.item.interval }
|
101 |
+
)
|
102 |
+
this.render()
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
|
107 |
+
// Bind some picker events.
|
108 |
+
picker.
|
109 |
+
on( 'render', function() {
|
110 |
+
var $pickerHolder = picker.$root.children(),
|
111 |
+
$viewset = $pickerHolder.find( '.' + settings.klass.viewset ),
|
112 |
+
vendors = function( prop ) {
|
113 |
+
return ['webkit', 'moz', 'ms', 'o', ''].map(function( vendor ) {
|
114 |
+
return ( vendor ? '-' + vendor + '-' : '' ) + prop
|
115 |
+
})
|
116 |
+
},
|
117 |
+
animations = function( $el, state ) {
|
118 |
+
vendors( 'transform' ).map(function( prop ) {
|
119 |
+
$el.css( prop, state )
|
120 |
+
})
|
121 |
+
vendors( 'transition' ).map(function( prop ) {
|
122 |
+
$el.css( prop, state )
|
123 |
+
})
|
124 |
+
}
|
125 |
+
if ( $viewset.length ) {
|
126 |
+
animations( $pickerHolder, 'none' )
|
127 |
+
$pickerHolder[ 0 ].scrollTop = ~~$viewset.position().top - ( $viewset[ 0 ].clientHeight * 2 )
|
128 |
+
animations( $pickerHolder, '' )
|
129 |
+
}
|
130 |
+
}, 1 ).
|
131 |
+
on( 'open', function() {
|
132 |
+
picker.$root.find( 'button' ).attr( 'disabled', false )
|
133 |
+
}, 1 ).
|
134 |
+
on( 'close', function() {
|
135 |
+
picker.$root.find( 'button' ).attr( 'disabled', true )
|
136 |
+
}, 1 )
|
137 |
+
|
138 |
+
} //TimePicker
|
139 |
+
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Set a timepicker item object.
|
143 |
+
*/
|
144 |
+
TimePicker.prototype.set = function( type, value, options ) {
|
145 |
+
|
146 |
+
var clock = this,
|
147 |
+
clockItem = clock.item
|
148 |
+
|
149 |
+
// If the value is `null` just set it immediately.
|
150 |
+
if ( value === null ) {
|
151 |
+
if ( type == 'clear' ) type = 'select'
|
152 |
+
clockItem[ type ] = value
|
153 |
+
return clock
|
154 |
+
}
|
155 |
+
|
156 |
+
// Otherwise go through the queue of methods, and invoke the functions.
|
157 |
+
// Update this as the time unit, and set the final value as this item.
|
158 |
+
// * In the case of `enable`, keep the queue but set `disable` instead.
|
159 |
+
// And in the case of `flip`, keep the queue but set `enable` instead.
|
160 |
+
clockItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = clock.queue[ type ].split( ' ' ).map( function( method ) {
|
161 |
+
value = clock[ method ]( type, value, options )
|
162 |
+
return value
|
163 |
+
}).pop()
|
164 |
+
|
165 |
+
// Check if we need to cascade through more updates.
|
166 |
+
if ( type == 'select' ) {
|
167 |
+
clock.set( 'highlight', clockItem.select, options )
|
168 |
+
}
|
169 |
+
else if ( type == 'highlight' ) {
|
170 |
+
clock.set( 'view', clockItem.highlight, options )
|
171 |
+
}
|
172 |
+
else if ( type == 'interval' ) {
|
173 |
+
clock.
|
174 |
+
set( 'min', clockItem.min, options ).
|
175 |
+
set( 'max', clockItem.max, options )
|
176 |
+
}
|
177 |
+
else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) {
|
178 |
+
if ( clockItem.select && clock.disabled( clockItem.select ) ) {
|
179 |
+
clock.set( 'select', value, options )
|
180 |
+
}
|
181 |
+
if ( clockItem.highlight && clock.disabled( clockItem.highlight ) ) {
|
182 |
+
clock.set( 'highlight', value, options )
|
183 |
+
}
|
184 |
+
if ( type == 'min' ) {
|
185 |
+
clock.set( 'max', clockItem.max, options )
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
return clock
|
190 |
+
} //TimePicker.prototype.set
|
191 |
+
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Get a timepicker item object.
|
195 |
+
*/
|
196 |
+
TimePicker.prototype.get = function( type ) {
|
197 |
+
return this.item[ type ]
|
198 |
+
} //TimePicker.prototype.get
|
199 |
+
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Create a picker time object.
|
203 |
+
*/
|
204 |
+
TimePicker.prototype.create = function( type, value, options ) {
|
205 |
+
|
206 |
+
var clock = this
|
207 |
+
|
208 |
+
// If there’s no value, use the type as the value.
|
209 |
+
value = value === undefined ? type : value
|
210 |
+
|
211 |
+
// If it’s a date object, convert it into an array.
|
212 |
+
if ( _.isDate( value ) ) {
|
213 |
+
value = [ value.getHours(), value.getMinutes() ]
|
214 |
+
}
|
215 |
+
|
216 |
+
// If it’s an object, use the “pick” value.
|
217 |
+
if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
|
218 |
+
value = value.pick
|
219 |
+
}
|
220 |
+
|
221 |
+
// If it’s an array, convert it into minutes.
|
222 |
+
else if ( $.isArray( value ) ) {
|
223 |
+
value = +value[ 0 ] * MINUTES_IN_HOUR + (+value[ 1 ])
|
224 |
+
}
|
225 |
+
|
226 |
+
// If no valid value is passed, set it to “now”.
|
227 |
+
else if ( !_.isInteger( value ) ) {
|
228 |
+
value = clock.now( type, value, options )
|
229 |
+
}
|
230 |
+
|
231 |
+
// If we’re setting the max, make sure it’s greater than the min.
|
232 |
+
if ( type == 'max' && value < clock.item.min.pick ) {
|
233 |
+
value += MINUTES_IN_DAY
|
234 |
+
}
|
235 |
+
|
236 |
+
// If the value doesn’t fall directly on the interval,
|
237 |
+
// add one interval to indicate it as “passed”.
|
238 |
+
if ( type != 'min' && type != 'max' && (value - clock.item.min.pick) % clock.item.interval !== 0 ) {
|
239 |
+
value += clock.item.interval
|
240 |
+
}
|
241 |
+
|
242 |
+
// Normalize it into a “reachable” interval.
|
243 |
+
value = clock.normalize( type, value, options )
|
244 |
+
|
245 |
+
// Return the compiled object.
|
246 |
+
return {
|
247 |
+
|
248 |
+
// Divide to get hours from minutes.
|
249 |
+
hour: ~~( HOURS_IN_DAY + value / MINUTES_IN_HOUR ) % HOURS_IN_DAY,
|
250 |
+
|
251 |
+
// The remainder is the minutes.
|
252 |
+
mins: ( MINUTES_IN_HOUR + value % MINUTES_IN_HOUR ) % MINUTES_IN_HOUR,
|
253 |
+
|
254 |
+
// The time in total minutes.
|
255 |
+
time: ( MINUTES_IN_DAY + value ) % MINUTES_IN_DAY,
|
256 |
+
|
257 |
+
// Reference to the “relative” value to pick.
|
258 |
+
pick: value % MINUTES_IN_DAY
|
259 |
+
}
|
260 |
+
} //TimePicker.prototype.create
|
261 |
+
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Create a range limit object using an array, date object,
|
265 |
+
* literal “true”, or integer relative to another time.
|
266 |
+
*/
|
267 |
+
TimePicker.prototype.createRange = function( from, to ) {
|
268 |
+
|
269 |
+
var clock = this,
|
270 |
+
createTime = function( time ) {
|
271 |
+
if ( time === true || $.isArray( time ) || _.isDate( time ) ) {
|
272 |
+
return clock.create( time )
|
273 |
+
}
|
274 |
+
return time
|
275 |
+
}
|
276 |
+
|
277 |
+
// Create objects if possible.
|
278 |
+
if ( !_.isInteger( from ) ) {
|
279 |
+
from = createTime( from )
|
280 |
+
}
|
281 |
+
if ( !_.isInteger( to ) ) {
|
282 |
+
to = createTime( to )
|
283 |
+
}
|
284 |
+
|
285 |
+
// Create relative times.
|
286 |
+
if ( _.isInteger( from ) && $.isPlainObject( to ) ) {
|
287 |
+
from = [ to.hour, to.mins + ( from * clock.settings.interval ) ];
|
288 |
+
}
|
289 |
+
else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {
|
290 |
+
to = [ from.hour, from.mins + ( to * clock.settings.interval ) ];
|
291 |
+
}
|
292 |
+
|
293 |
+
return {
|
294 |
+
from: createTime( from ),
|
295 |
+
to: createTime( to )
|
296 |
+
}
|
297 |
+
} //TimePicker.prototype.createRange
|
298 |
+
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Check if a time unit falls within a time range object.
|
302 |
+
*/
|
303 |
+
TimePicker.prototype.withinRange = function( range, timeUnit ) {
|
304 |
+
range = this.createRange(range.from, range.to)
|
305 |
+
return timeUnit.pick >= range.from.pick && timeUnit.pick <= range.to.pick
|
306 |
+
}
|
307 |
+
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Check if two time range objects overlap.
|
311 |
+
*/
|
312 |
+
TimePicker.prototype.overlapRanges = function( one, two ) {
|
313 |
+
|
314 |
+
var clock = this
|
315 |
+
|
316 |
+
// Convert the ranges into comparable times.
|
317 |
+
one = clock.createRange( one.from, one.to )
|
318 |
+
two = clock.createRange( two.from, two.to )
|
319 |
+
|
320 |
+
return clock.withinRange( one, two.from ) || clock.withinRange( one, two.to ) ||
|
321 |
+
clock.withinRange( two, one.from ) || clock.withinRange( two, one.to )
|
322 |
+
}
|
323 |
+
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Get the time relative to now.
|
327 |
+
*/
|
328 |
+
TimePicker.prototype.now = function( type, value/*, options*/ ) {
|
329 |
+
|
330 |
+
var interval = this.item.interval,
|
331 |
+
date = new Date(),
|
332 |
+
nowMinutes = date.getHours() * MINUTES_IN_HOUR + date.getMinutes(),
|
333 |
+
isValueInteger = _.isInteger( value ),
|
334 |
+
isBelowInterval
|
335 |
+
|
336 |
+
// Make sure “now” falls within the interval range.
|
337 |
+
nowMinutes -= nowMinutes % interval
|
338 |
+
|
339 |
+
// Check if the difference is less than the interval itself.
|
340 |
+
isBelowInterval = value < 0 && interval * value + nowMinutes <= -interval
|
341 |
+
|
342 |
+
// Add an interval because the time has “passed”.
|
343 |
+
nowMinutes += type == 'min' && isBelowInterval ? 0 : interval
|
344 |
+
|
345 |
+
// If the value is a number, adjust by that many intervals.
|
346 |
+
if ( isValueInteger ) {
|
347 |
+
nowMinutes += interval * (
|
348 |
+
isBelowInterval && type != 'max' ?
|
349 |
+
value + 1 :
|
350 |
+
value
|
351 |
+
)
|
352 |
+
}
|
353 |
+
|
354 |
+
// Return the final calculation.
|
355 |
+
return nowMinutes
|
356 |
+
} //TimePicker.prototype.now
|
357 |
+
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Normalize minutes to be “reachable” based on the min and interval.
|
361 |
+
*/
|
362 |
+
TimePicker.prototype.normalize = function( type, value/*, options*/ ) {
|
363 |
+
|
364 |
+
var interval = this.item.interval,
|
365 |
+
minTime = this.item.min && this.item.min.pick || 0
|
366 |
+
|
367 |
+
// If setting min time, don’t shift anything.
|
368 |
+
// Otherwise get the value and min difference and then
|
369 |
+
// normalize the difference with the interval.
|
370 |
+
value -= type == 'min' ? 0 : ( value - minTime ) % interval
|
371 |
+
|
372 |
+
// Return the adjusted value.
|
373 |
+
return value
|
374 |
+
} //TimePicker.prototype.normalize
|
375 |
+
|
376 |
+
|
377 |
+
/**
|
378 |
+
* Measure the range of minutes.
|
379 |
+
*/
|
380 |
+
TimePicker.prototype.measure = function( type, value, options ) {
|
381 |
+
|
382 |
+
var clock = this
|
383 |
+
|
384 |
+
// If it’s anything false-y, set it to the default.
|
385 |
+
if ( !value ) {
|
386 |
+
value = type == 'min' ? [ 0, 0 ] : [ HOURS_IN_DAY - 1, MINUTES_IN_HOUR - 1 ]
|
387 |
+
}
|
388 |
+
|
389 |
+
// If it’s a string, parse it.
|
390 |
+
if ( typeof value == 'string' ) {
|
391 |
+
value = clock.parse( type, value )
|
392 |
+
}
|
393 |
+
|
394 |
+
// If it’s a literal true, or an integer, make it relative to now.
|
395 |
+
else if ( value === true || _.isInteger( value ) ) {
|
396 |
+
value = clock.now( type, value, options )
|
397 |
+
}
|
398 |
+
|
399 |
+
// If it’s an object already, just normalize it.
|
400 |
+
else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
|
401 |
+
value = clock.normalize( type, value.pick, options )
|
402 |
+
}
|
403 |
+
|
404 |
+
return value
|
405 |
+
} ///TimePicker.prototype.measure
|
406 |
+
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Validate an object as enabled.
|
410 |
+
*/
|
411 |
+
TimePicker.prototype.validate = function( type, timeObject, options ) {
|
412 |
+
|
413 |
+
var clock = this,
|
414 |
+
interval = options && options.interval ? options.interval : clock.item.interval
|
415 |
+
|
416 |
+
// Check if the object is disabled.
|
417 |
+
if ( clock.disabled( timeObject ) ) {
|
418 |
+
|
419 |
+
// Shift with the interval until we reach an enabled time.
|
420 |
+
timeObject = clock.shift( timeObject, interval )
|
421 |
+
}
|
422 |
+
|
423 |
+
// Scope the object into range.
|
424 |
+
timeObject = clock.scope( timeObject )
|
425 |
+
|
426 |
+
// Do a second check to see if we landed on a disabled min/max.
|
427 |
+
// In that case, shift using the opposite interval as before.
|
428 |
+
if ( clock.disabled( timeObject ) ) {
|
429 |
+
timeObject = clock.shift( timeObject, interval * -1 )
|
430 |
+
}
|
431 |
+
|
432 |
+
// Return the final object.
|
433 |
+
return timeObject
|
434 |
+
} //TimePicker.prototype.validate
|
435 |
+
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Check if an object is disabled.
|
439 |
+
*/
|
440 |
+
TimePicker.prototype.disabled = function( timeToVerify ) {
|
441 |
+
|
442 |
+
var clock = this,
|
443 |
+
|
444 |
+
// Filter through the disabled times to check if this is one.
|
445 |
+
isDisabledMatch = clock.item.disable.filter( function( timeToDisable ) {
|
446 |
+
|
447 |
+
// If the time is a number, match the hours.
|
448 |
+
if ( _.isInteger( timeToDisable ) ) {
|
449 |
+
return timeToVerify.hour == timeToDisable
|
450 |
+
}
|
451 |
+
|
452 |
+
// If it’s an array, create the object and match the times.
|
453 |
+
if ( $.isArray( timeToDisable ) || _.isDate( timeToDisable ) ) {
|
454 |
+
return timeToVerify.pick == clock.create( timeToDisable ).pick
|
455 |
+
}
|
456 |
+
|
457 |
+
// If it’s an object, match a time within the “from” and “to” range.
|
458 |
+
if ( $.isPlainObject( timeToDisable ) ) {
|
459 |
+
return clock.withinRange( timeToDisable, timeToVerify )
|
460 |
+
}
|
461 |
+
})
|
462 |
+
|
463 |
+
// If this time matches a disabled time, confirm it’s not inverted.
|
464 |
+
isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( timeToDisable ) {
|
465 |
+
return $.isArray( timeToDisable ) && timeToDisable[2] == 'inverted' ||
|
466 |
+
$.isPlainObject( timeToDisable ) && timeToDisable.inverted
|
467 |
+
}).length
|
468 |
+
|
469 |
+
// If the clock is "enabled" flag is flipped, flip the condition.
|
470 |
+
return clock.item.enable === -1 ? !isDisabledMatch : isDisabledMatch ||
|
471 |
+
timeToVerify.pick < clock.item.min.pick ||
|
472 |
+
timeToVerify.pick > clock.item.max.pick
|
473 |
+
} //TimePicker.prototype.disabled
|
474 |
+
|
475 |
+
|
476 |
+
/**
|
477 |
+
* Shift an object by an interval until we reach an enabled object.
|
478 |
+
*/
|
479 |
+
TimePicker.prototype.shift = function( timeObject, interval ) {
|
480 |
+
|
481 |
+
var clock = this,
|
482 |
+
minLimit = clock.item.min.pick,
|
483 |
+
maxLimit = clock.item.max.pick/*,
|
484 |
+
safety = 1000*/
|
485 |
+
|
486 |
+
interval = interval || clock.item.interval
|
487 |
+
|
488 |
+
// Keep looping as long as the time is disabled.
|
489 |
+
while ( /*safety &&*/ clock.disabled( timeObject ) ) {
|
490 |
+
|
491 |
+
/*safety -= 1
|
492 |
+
if ( !safety ) {
|
493 |
+
throw 'Fell into an infinite loop while shifting to ' + timeObject.hour + ':' + timeObject.mins + '.'
|
494 |
+
}*/
|
495 |
+
|
496 |
+
// Increase/decrease the time by the interval and keep looping.
|
497 |
+
timeObject = clock.create( timeObject.pick += interval )
|
498 |
+
|
499 |
+
// If we've looped beyond the limits, break out of the loop.
|
500 |
+
if ( timeObject.pick <= minLimit || timeObject.pick >= maxLimit ) {
|
501 |
+
break
|
502 |
+
}
|
503 |
+
}
|
504 |
+
|
505 |
+
// Return the final object.
|
506 |
+
return timeObject
|
507 |
+
} //TimePicker.prototype.shift
|
508 |
+
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Scope an object to be within range of min and max.
|
512 |
+
*/
|
513 |
+
TimePicker.prototype.scope = function( timeObject ) {
|
514 |
+
var minLimit = this.item.min.pick,
|
515 |
+
maxLimit = this.item.max.pick
|
516 |
+
return this.create( timeObject.pick > maxLimit ? maxLimit : timeObject.pick < minLimit ? minLimit : timeObject )
|
517 |
+
} //TimePicker.prototype.scope
|
518 |
+
|
519 |
+
|
520 |
+
/**
|
521 |
+
* Parse a string into a usable type.
|
522 |
+
*/
|
523 |
+
TimePicker.prototype.parse = function( type, value, options ) {
|
524 |
+
|
525 |
+
var hour, minutes, isPM, item, parseValue,
|
526 |
+
clock = this,
|
527 |
+
parsingObject = {}
|
528 |
+
|
529 |
+
// If it’s already parsed, we’re good.
|
530 |
+
if ( !value || typeof value != 'string' ) {
|
531 |
+
return value
|
532 |
+
}
|
533 |
+
|
534 |
+
// We need a `.format` to parse the value with.
|
535 |
+
if ( !( options && options.format ) ) {
|
536 |
+
options = options || {}
|
537 |
+
options.format = clock.settings.format
|
538 |
+
}
|
539 |
+
|
540 |
+
// Convert the format into an array and then map through it.
|
541 |
+
clock.formats.toArray( options.format ).map( function( label ) {
|
542 |
+
|
543 |
+
var
|
544 |
+
substring,
|
545 |
+
|
546 |
+
// Grab the formatting label.
|
547 |
+
formattingLabel = clock.formats[ label ],
|
548 |
+
|
549 |
+
// The format length is from the formatting label function or the
|
550 |
+
// label length without the escaping exclamation (!) mark.
|
551 |
+
formatLength = formattingLabel ?
|
552 |
+
_.trigger( formattingLabel, clock, [ value, parsingObject ] ) :
|
553 |
+
label.replace( /^!/, '' ).length
|
554 |
+
|
555 |
+
// If there's a format label, split the value up to the format length.
|
556 |
+
// Then add it to the parsing object with appropriate label.
|
557 |
+
if ( formattingLabel ) {
|
558 |
+
substring = value.substr( 0, formatLength )
|
559 |
+
parsingObject[ label ] = substring.match(/^\d+$/) ? +substring : substring
|
560 |
+
}
|
561 |
+
|
562 |
+
// Update the time value as the substring from format length to end.
|
563 |
+
value = value.substr( formatLength )
|
564 |
+
})
|
565 |
+
|
566 |
+
// Grab the hour and minutes from the parsing object.
|
567 |
+
for ( item in parsingObject ) {
|
568 |
+
parseValue = parsingObject[item]
|
569 |
+
if ( _.isInteger(parseValue) ) {
|
570 |
+
if ( item.match(/^(h|hh)$/i) ) {
|
571 |
+
hour = parseValue
|
572 |
+
if ( item == 'h' || item == 'hh' ) {
|
573 |
+
hour %= 12
|
574 |
+
}
|
575 |
+
}
|
576 |
+
else if ( item == 'i' ) {
|
577 |
+
minutes = parseValue
|
578 |
+
}
|
579 |
+
}
|
580 |
+
else if ( item.match(/^a$/i) && parseValue.match(/^p/i) && ('h' in parsingObject || 'hh' in parsingObject) ) {
|
581 |
+
isPM = true
|
582 |
+
}
|
583 |
+
}
|
584 |
+
|
585 |
+
// Calculate it in minutes and return.
|
586 |
+
return (isPM ? hour + 12 : hour) * MINUTES_IN_HOUR + minutes
|
587 |
+
} //TimePicker.prototype.parse
|
588 |
+
|
589 |
+
|
590 |
+
/**
|
591 |
+
* Various formats to display the object in.
|
592 |
+
*/
|
593 |
+
TimePicker.prototype.formats = {
|
594 |
+
|
595 |
+
h: function( string, timeObject ) {
|
596 |
+
|
597 |
+
// If there's string, then get the digits length.
|
598 |
+
// Otherwise return the selected hour in "standard" format.
|
599 |
+
return string ? _.digits( string ) : timeObject.hour % HOURS_TO_NOON || HOURS_TO_NOON
|
600 |
+
},
|
601 |
+
hh: function( string, timeObject ) {
|
602 |
+
|
603 |
+
// If there's a string, then the length is always 2.
|
604 |
+
// Otherwise return the selected hour in "standard" format with a leading zero.
|
605 |
+
return string ? 2 : _.lead( timeObject.hour % HOURS_TO_NOON || HOURS_TO_NOON )
|
606 |
+
},
|
607 |
+
H: function( string, timeObject ) {
|
608 |
+
|
609 |
+
// If there's string, then get the digits length.
|
610 |
+
// Otherwise return the selected hour in "military" format as a string.
|
611 |
+
return string ? _.digits( string ) : '' + ( timeObject.hour % 24 )
|
612 |
+
},
|
613 |
+
HH: function( string, timeObject ) {
|
614 |
+
|
615 |
+
// If there's string, then get the digits length.
|
616 |
+
// Otherwise return the selected hour in "military" format with a leading zero.
|
617 |
+
return string ? _.digits( string ) : _.lead( timeObject.hour % 24 )
|
618 |
+
},
|
619 |
+
i: function( string, timeObject ) {
|
620 |
+
|
621 |
+
// If there's a string, then the length is always 2.
|
622 |
+
// Otherwise return the selected minutes.
|
623 |
+
return string ? 2 : _.lead( timeObject.mins )
|
624 |
+
},
|
625 |
+
a: function( string, timeObject ) {
|
626 |
+
|
627 |
+
// If there's a string, then the length is always 4.
|
628 |
+
// Otherwise check if it's more than "noon" and return either am/pm.
|
629 |
+
return string ? 4 : MINUTES_IN_DAY / 2 > timeObject.time % MINUTES_IN_DAY ? 'a.m.' : 'p.m.'
|
630 |
+
},
|
631 |
+
A: function( string, timeObject ) {
|
632 |
+
|
633 |
+
// If there's a string, then the length is always 2.
|
634 |
+
// Otherwise check if it's more than "noon" and return either am/pm.
|
635 |
+
return string ? 2 : MINUTES_IN_DAY / 2 > timeObject.time % MINUTES_IN_DAY ? 'AM' : 'PM'
|
636 |
+
},
|
637 |
+
|
638 |
+
// Create an array by splitting the formatting string passed.
|
639 |
+
toArray: function( formatString ) { return formatString.split( /(h{1,2}|H{1,2}|i|a|A|!.)/g ) },
|
640 |
+
|
641 |
+
// Format an object into a string using the formatting options.
|
642 |
+
toString: function ( formatString, itemObject ) {
|
643 |
+
var clock = this
|
644 |
+
return clock.formats.toArray( formatString ).map( function( label ) {
|
645 |
+
return _.trigger( clock.formats[ label ], clock, [ 0, itemObject ] ) || label.replace( /^!/, '' )
|
646 |
+
}).join( '' )
|
647 |
+
}
|
648 |
+
} //TimePicker.prototype.formats
|
649 |
+
|
650 |
+
|
651 |
+
|
652 |
+
|
653 |
+
/**
|
654 |
+
* Check if two time units are the exact.
|
655 |
+
*/
|
656 |
+
TimePicker.prototype.isTimeExact = function( one, two ) {
|
657 |
+
|
658 |
+
var clock = this
|
659 |
+
|
660 |
+
// When we’re working with minutes, do a direct comparison.
|
661 |
+
if (
|
662 |
+
( _.isInteger( one ) && _.isInteger( two ) ) ||
|
663 |
+
( typeof one == 'boolean' && typeof two == 'boolean' )
|
664 |
+
) {
|
665 |
+
return one === two
|
666 |
+
}
|
667 |
+
|
668 |
+
// When we’re working with time representations, compare the “pick” value.
|
669 |
+
if (
|
670 |
+
( _.isDate( one ) || $.isArray( one ) ) &&
|
671 |
+
( _.isDate( two ) || $.isArray( two ) )
|
672 |
+
) {
|
673 |
+
return clock.create( one ).pick === clock.create( two ).pick
|
674 |
+
}
|
675 |
+
|
676 |
+
// When we’re working with range objects, compare the “from” and “to”.
|
677 |
+
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
|
678 |
+
return clock.isTimeExact( one.from, two.from ) && clock.isTimeExact( one.to, two.to )
|
679 |
+
}
|
680 |
+
|
681 |
+
return false
|
682 |
+
}
|
683 |
+
|
684 |
+
|
685 |
+
/**
|
686 |
+
* Check if two time units overlap.
|
687 |
+
*/
|
688 |
+
TimePicker.prototype.isTimeOverlap = function( one, two ) {
|
689 |
+
|
690 |
+
var clock = this
|
691 |
+
|
692 |
+
// When we’re working with an integer, compare the hours.
|
693 |
+
if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {
|
694 |
+
return one === clock.create( two ).hour
|
695 |
+
}
|
696 |
+
if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {
|
697 |
+
return two === clock.create( one ).hour
|
698 |
+
}
|
699 |
+
|
700 |
+
// When we’re working with range objects, check if the ranges overlap.
|
701 |
+
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
|
702 |
+
return clock.overlapRanges( one, two )
|
703 |
+
}
|
704 |
+
|
705 |
+
return false
|
706 |
+
}
|
707 |
+
|
708 |
+
|
709 |
+
/**
|
710 |
+
* Flip the “enabled” state.
|
711 |
+
*/
|
712 |
+
TimePicker.prototype.flipEnable = function(val) {
|
713 |
+
var itemObject = this.item
|
714 |
+
itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1)
|
715 |
+
}
|
716 |
+
|
717 |
+
|
718 |
+
/**
|
719 |
+
* Mark a collection of times as “disabled”.
|
720 |
+
*/
|
721 |
+
TimePicker.prototype.deactivate = function( type, timesToDisable ) {
|
722 |
+
|
723 |
+
var clock = this,
|
724 |
+
disabledItems = clock.item.disable.slice(0)
|
725 |
+
|
726 |
+
|
727 |
+
// If we’re flipping, that’s all we need to do.
|
728 |
+
if ( timesToDisable == 'flip' ) {
|
729 |
+
clock.flipEnable()
|
730 |
+
}
|
731 |
+
|
732 |
+
else if ( timesToDisable === false ) {
|
733 |
+
clock.flipEnable(1)
|
734 |
+
disabledItems = []
|
735 |
+
}
|
736 |
+
|
737 |
+
else if ( timesToDisable === true ) {
|
738 |
+
clock.flipEnable(-1)
|
739 |
+
disabledItems = []
|
740 |
+
}
|
741 |
+
|
742 |
+
// Otherwise go through the times to disable.
|
743 |
+
else {
|
744 |
+
|
745 |
+
timesToDisable.map(function( unitToDisable ) {
|
746 |
+
|
747 |
+
var matchFound
|
748 |
+
|
749 |
+
// When we have disabled items, check for matches.
|
750 |
+
// If something is matched, immediately break out.
|
751 |
+
for ( var index = 0; index < disabledItems.length; index += 1 ) {
|
752 |
+
if ( clock.isTimeExact( unitToDisable, disabledItems[index] ) ) {
|
753 |
+
matchFound = true
|
754 |
+
break
|
755 |
+
}
|
756 |
+
}
|
757 |
+
|
758 |
+
// If nothing was found, add the validated unit to the collection.
|
759 |
+
if ( !matchFound ) {
|
760 |
+
if (
|
761 |
+
_.isInteger( unitToDisable ) ||
|
762 |
+
_.isDate( unitToDisable ) ||
|
763 |
+
$.isArray( unitToDisable ) ||
|
764 |
+
( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )
|
765 |
+
) {
|
766 |
+
disabledItems.push( unitToDisable )
|
767 |
+
}
|
768 |
+
}
|
769 |
+
})
|
770 |
+
}
|
771 |
+
|
772 |
+
// Return the updated collection.
|
773 |
+
return disabledItems
|
774 |
+
} //TimePicker.prototype.deactivate
|
775 |
+
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Mark a collection of times as “enabled”.
|
779 |
+
*/
|
780 |
+
TimePicker.prototype.activate = function( type, timesToEnable ) {
|
781 |
+
|
782 |
+
var clock = this,
|
783 |
+
disabledItems = clock.item.disable,
|
784 |
+
disabledItemsCount = disabledItems.length
|
785 |
+
|
786 |
+
// If we’re flipping, that’s all we need to do.
|
787 |
+
if ( timesToEnable == 'flip' ) {
|
788 |
+
clock.flipEnable()
|
789 |
+
}
|
790 |
+
|
791 |
+
else if ( timesToEnable === true ) {
|
792 |
+
clock.flipEnable(1)
|
793 |
+
disabledItems = []
|
794 |
+
}
|
795 |
+
|
796 |
+
else if ( timesToEnable === false ) {
|
797 |
+
clock.flipEnable(-1)
|
798 |
+
disabledItems = []
|
799 |
+
}
|
800 |
+
|
801 |
+
// Otherwise go through the disabled times.
|
802 |
+
else {
|
803 |
+
|
804 |
+
timesToEnable.map(function( unitToEnable ) {
|
805 |
+
|
806 |
+
var matchFound,
|
807 |
+
disabledUnit,
|
808 |
+
index,
|
809 |
+
isRangeMatched
|
810 |
+
|
811 |
+
// Go through the disabled items and try to find a match.
|
812 |
+
for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
813 |
+
|
814 |
+
disabledUnit = disabledItems[index]
|
815 |
+
|
816 |
+
// When an exact match is found, remove it from the collection.
|
817 |
+
if ( clock.isTimeExact( disabledUnit, unitToEnable ) ) {
|
818 |
+
matchFound = disabledItems[index] = null
|
819 |
+
isRangeMatched = true
|
820 |
+
break
|
821 |
+
}
|
822 |
+
|
823 |
+
// When an overlapped match is found, add the “inverted” state to it.
|
824 |
+
else if ( clock.isTimeOverlap( disabledUnit, unitToEnable ) ) {
|
825 |
+
if ( $.isPlainObject( unitToEnable ) ) {
|
826 |
+
unitToEnable.inverted = true
|
827 |
+
matchFound = unitToEnable
|
828 |
+
}
|
829 |
+
else if ( $.isArray( unitToEnable ) ) {
|
830 |
+
matchFound = unitToEnable
|
831 |
+
if ( !matchFound[2] ) matchFound.push( 'inverted' )
|
832 |
+
}
|
833 |
+
else if ( _.isDate( unitToEnable ) ) {
|
834 |
+
matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
|
835 |
+
}
|
836 |
+
break
|
837 |
+
}
|
838 |
+
}
|
839 |
+
|
840 |
+
// If a match was found, remove a previous duplicate entry.
|
841 |
+
if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
842 |
+
if ( clock.isTimeExact( disabledItems[index], unitToEnable ) ) {
|
843 |
+
disabledItems[index] = null
|
844 |
+
break
|
845 |
+
}
|
846 |
+
}
|
847 |
+
|
848 |
+
// In the event that we’re dealing with an overlap of range times,
|
849 |
+
// make sure there are no “inverted” times because of it.
|
850 |
+
if ( isRangeMatched ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
851 |
+
if ( clock.isTimeOverlap( disabledItems[index], unitToEnable ) ) {
|
852 |
+
disabledItems[index] = null
|
853 |
+
break
|
854 |
+
}
|
855 |
+
}
|
856 |
+
|
857 |
+
// If something is still matched, add it into the collection.
|
858 |
+
if ( matchFound ) {
|
859 |
+
disabledItems.push( matchFound )
|
860 |
+
}
|
861 |
+
})
|
862 |
+
}
|
863 |
+
|
864 |
+
// Return the updated collection.
|
865 |
+
return disabledItems.filter(function( val ) { return val != null })
|
866 |
+
} //TimePicker.prototype.activate
|
867 |
+
|
868 |
+
|
869 |
+
/**
|
870 |
+
* The division to use for the range intervals.
|
871 |
+
*/
|
872 |
+
TimePicker.prototype.i = function( type, value/*, options*/ ) {
|
873 |
+
return _.isInteger( value ) && value > 0 ? value : this.item.interval
|
874 |
+
}
|
875 |
+
|
876 |
+
|
877 |
+
/**
|
878 |
+
* Create a string for the nodes in the picker.
|
879 |
+
*/
|
880 |
+
TimePicker.prototype.nodes = function( isOpen ) {
|
881 |
+
|
882 |
+
var
|
883 |
+
clock = this,
|
884 |
+
settings = clock.settings,
|
885 |
+
selectedObject = clock.item.select,
|
886 |
+
highlightedObject = clock.item.highlight,
|
887 |
+
viewsetObject = clock.item.view,
|
888 |
+
disabledCollection = clock.item.disable
|
889 |
+
|
890 |
+
return _.node(
|
891 |
+
'ul',
|
892 |
+
_.group({
|
893 |
+
min: clock.item.min.pick,
|
894 |
+
max: clock.item.max.pick,
|
895 |
+
i: clock.item.interval,
|
896 |
+
node: 'li',
|
897 |
+
item: function( loopedTime ) {
|
898 |
+
loopedTime = clock.create( loopedTime )
|
899 |
+
var timeMinutes = loopedTime.pick,
|
900 |
+
isSelected = selectedObject && selectedObject.pick == timeMinutes,
|
901 |
+
isHighlighted = highlightedObject && highlightedObject.pick == timeMinutes,
|
902 |
+
isDisabled = disabledCollection && clock.disabled( loopedTime ),
|
903 |
+
formattedTime = _.trigger( clock.formats.toString, clock, [ settings.format, loopedTime ] )
|
904 |
+
return [
|
905 |
+
_.trigger( clock.formats.toString, clock, [ _.trigger( settings.formatLabel, clock, [ loopedTime ] ) || settings.format, loopedTime ] ),
|
906 |
+
(function( klasses ) {
|
907 |
+
|
908 |
+
if ( isSelected ) {
|
909 |
+
klasses.push( settings.klass.selected )
|
910 |
+
}
|
911 |
+
|
912 |
+
if ( isHighlighted ) {
|
913 |
+
klasses.push( settings.klass.highlighted )
|
914 |
+
}
|
915 |
+
|
916 |
+
if ( viewsetObject && viewsetObject.pick == timeMinutes ) {
|
917 |
+
klasses.push( settings.klass.viewset )
|
918 |
+
}
|
919 |
+
|
920 |
+
if ( isDisabled ) {
|
921 |
+
klasses.push( settings.klass.disabled )
|
922 |
+
}
|
923 |
+
|
924 |
+
return klasses.join( ' ' )
|
925 |
+
})( [ settings.klass.listItem ] ),
|
926 |
+
'data-pick=' + loopedTime.pick + ' ' + _.ariaAttr({
|
927 |
+
role: 'option',
|
928 |
+
label: formattedTime,
|
929 |
+
selected: isSelected && clock.$node.val() === formattedTime ? true : null,
|
930 |
+
activedescendant: isHighlighted ? true : null,
|
931 |
+
disabled: isDisabled ? true : null
|
932 |
+
})
|
933 |
+
]
|
934 |
+
}
|
935 |
+
}) +
|
936 |
+
|
937 |
+
// * For Firefox forms to submit, make sure to set the button’s `type` attribute as “button”.
|
938 |
+
_.node(
|
939 |
+
'li',
|
940 |
+
_.node(
|
941 |
+
'button',
|
942 |
+
settings.clear,
|
943 |
+
settings.klass.buttonClear,
|
944 |
+
'type=button data-clear=1' + ( isOpen ? '' : ' disabled' ) + ' ' +
|
945 |
+
_.ariaAttr({ controls: clock.$node[0].id })
|
946 |
+
),
|
947 |
+
'', _.ariaAttr({ role: 'presentation' })
|
948 |
+
),
|
949 |
+
settings.klass.list,
|
950 |
+
_.ariaAttr({ role: 'listbox', controls: clock.$node[0].id })
|
951 |
+
)
|
952 |
+
} //TimePicker.prototype.nodes
|
953 |
+
|
954 |
+
|
955 |
+
|
956 |
+
|
957 |
+
|
958 |
+
|
959 |
+
|
960 |
+
/**
|
961 |
+
* Extend the picker to add the component with the defaults.
|
962 |
+
*/
|
963 |
+
TimePicker.defaults = (function( prefix ) {
|
964 |
+
|
965 |
+
return {
|
966 |
+
|
967 |
+
// Clear
|
968 |
+
clear: 'Clear',
|
969 |
+
|
970 |
+
// The format to show on the `input` element
|
971 |
+
format: 'h:i A',
|
972 |
+
|
973 |
+
// The interval between each time
|
974 |
+
interval: 30,
|
975 |
+
|
976 |
+
// Picker close behavior
|
977 |
+
closeOnSelect: true,
|
978 |
+
closeOnClear: true,
|
979 |
+
|
980 |
+
// Classes
|
981 |
+
klass: {
|
982 |
+
|
983 |
+
picker: prefix + ' ' + prefix + '--time',
|
984 |
+
holder: prefix + '__holder',
|
985 |
+
|
986 |
+
list: prefix + '__list',
|
987 |
+
listItem: prefix + '__list-item',
|
988 |
+
|
989 |
+
disabled: prefix + '__list-item--disabled',
|
990 |
+
selected: prefix + '__list-item--selected',
|
991 |
+
highlighted: prefix + '__list-item--highlighted',
|
992 |
+
viewset: prefix + '__list-item--viewset',
|
993 |
+
now: prefix + '__list-item--now',
|
994 |
+
|
995 |
+
buttonClear: prefix + '__button--clear'
|
996 |
+
}
|
997 |
+
}
|
998 |
+
})( Picker.klasses().picker )
|
999 |
+
|
1000 |
+
|
1001 |
+
|
1002 |
+
|
1003 |
+
|
1004 |
+
/**
|
1005 |
+
* Extend the picker to add the time picker.
|
1006 |
+
*/
|
1007 |
+
Picker.extend( 'pickatime', TimePicker )
|
1008 |
+
|
1009 |
+
|
1010 |
+
}));
|
1011 |
+
|
1012 |
+
|
1013 |
+
|
js/lib/themes-source/_variables.less
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
// ==========================================================================
|
3 |
+
// $VARIABLES
|
4 |
+
// ==========================================================================
|
5 |
+
|
6 |
+
|
7 |
+
//
|
8 |
+
// Base colors
|
9 |
+
//
|
10 |
+
@blue: #0089ec;
|
11 |
+
@blue-hover: #b1dcfb;
|
12 |
+
@black: #000;
|
13 |
+
@white: #fff;
|
14 |
+
|
15 |
+
|
16 |
+
//
|
17 |
+
// Backgrounds
|
18 |
+
//
|
19 |
+
@bg-white: @white;
|
20 |
+
@bg-grey-light: #f2f2f2;
|
21 |
+
|
22 |
+
|
23 |
+
//
|
24 |
+
// Borders
|
25 |
+
//
|
26 |
+
@border-grey: #777;
|
27 |
+
@border-grey-light: #ddd;
|
28 |
+
@border-select: darken( @border-grey-light, 15% );
|
29 |
+
|
30 |
+
|
31 |
+
//
|
32 |
+
// Buttons
|
33 |
+
//
|
34 |
+
@clear-red: #e20;
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
//
|
41 |
+
// Picker base
|
42 |
+
//
|
43 |
+
|
44 |
+
// Make sure nothing is above the picker.
|
45 |
+
@picker-z-index: 10000;
|
46 |
+
|
47 |
+
// Animation speeds.
|
48 |
+
@speed-animate-in: .15s;
|
49 |
+
|
50 |
+
// Focused input border color.
|
51 |
+
@input-active-border: @blue;
|
52 |
+
|
53 |
+
// Typography.
|
54 |
+
@base-font-size: 16px;
|
55 |
+
@base-line-height: 1.2;
|
56 |
+
|
57 |
+
// Corners.
|
58 |
+
@picker-border-radius: 5px;
|
59 |
+
|
60 |
+
// Drop shadows.
|
61 |
+
@picker-box-shadow: 0 12px 36px 16px rgba(0,0,0,.24);
|
62 |
+
@picker-box-shadow-light: 0 6px 18px 1px rgba(0,0,0,.12);
|
63 |
+
|
64 |
+
// Height breakpoints.
|
65 |
+
@breakpoint-tiny: 26.5em; // 424px @ 16px
|
66 |
+
@breakpoint-small: 33.875em; // 542px @ 16px
|
67 |
+
@breakpoint-medium: 40.125em; // 642px @ 16px
|
68 |
+
@breakpoint-large: 46.75em; // 748px @ 16px
|
69 |
+
|
70 |
+
// Width breakpoints.
|
71 |
+
@breakpoint-width-tiny: 24.5em; // 392px @ 16px
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
//
|
77 |
+
// Date picker options
|
78 |
+
//
|
79 |
+
|
80 |
+
// The year and weekday labels.
|
81 |
+
@year-weekday-label: #999;
|
82 |
+
|
83 |
+
// “Today” tag indicators.
|
84 |
+
@blue-tag: #0059bc;
|
85 |
+
@disabled-tag: #aaa;
|
86 |
+
|
87 |
+
// Disabled things.. such as days, month nav, etc.
|
88 |
+
@disabled-things-bg: #f5f5f5;
|
89 |
+
@disabled-things-text: #ddd;
|
90 |
+
@disabled-highlighted-things-bg: #bbb;
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
//
|
97 |
+
// Theme configurations
|
98 |
+
//
|
99 |
+
|
100 |
+
// The “default” min & max widths.
|
101 |
+
@picker-min-width: 256px;
|
102 |
+
@picker-max-width: 666px;
|
103 |
+
|
104 |
+
// The time picker min & max widths.
|
105 |
+
@time-min-width: @picker-min-width;
|
106 |
+
@time-max-width: 320px;
|
107 |
+
|
108 |
+
// The “classic” theme settings.
|
109 |
+
@classic-max-width: @picker-max-width - 200px;
|
110 |
+
@classic-min-width: @picker-min-width - 80px;
|
111 |
+
@classic-max-height: 25em;
|
112 |
+
@classic-box-shadow: 0 6px 18px 1px rgba(0,0,0,.12);
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
|
121 |
+
// ==========================================================================
|
122 |
+
// $MIXINS
|
123 |
+
// ==========================================================================
|
124 |
+
|
125 |
+
|
126 |
+
//
|
127 |
+
// Common picker item states
|
128 |
+
//
|
129 |
+
|
130 |
+
// Highlighted.
|
131 |
+
.picker-item-highlighted () {
|
132 |
+
border-color: @blue;
|
133 |
+
}
|
134 |
+
|
135 |
+
// Hovered.
|
136 |
+
.picker-item-hovered () {
|
137 |
+
cursor: pointer;
|
138 |
+
color: @black;
|
139 |
+
background: @blue-hover;
|
140 |
+
}
|
141 |
+
|
142 |
+
// Selected.
|
143 |
+
.picker-item-selected () {
|
144 |
+
background: @blue;
|
145 |
+
color: @white;
|
146 |
+
}
|
147 |
+
|
148 |
+
// Disabled.
|
149 |
+
.picker-item-disabled () {
|
150 |
+
background: @disabled-things-bg;
|
151 |
+
border-color: @disabled-things-bg;
|
152 |
+
color: @disabled-things-text;
|
153 |
+
cursor: default;
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
|
158 |
+
|
159 |
+
//
|
160 |
+
// Opacity
|
161 |
+
//
|
162 |
+
.opacity( @decimal ) {
|
163 |
+
@percent: @decimal * 100;
|
164 |
+
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=@{percent})";
|
165 |
+
filter: ~"alpha(opacity=@{percent})";
|
166 |
+
-moz-opacity: @decimal;
|
167 |
+
opacity: @decimal;
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
|
js/lib/themes-source/base.date.less
ADDED
@@ -0,0 +1,333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$BASE-DATE-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The picker box.
|
11 |
+
*/
|
12 |
+
.picker__box {
|
13 |
+
padding: 0 1em;
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The header containing the month and year stuff.
|
19 |
+
*/
|
20 |
+
.picker__header {
|
21 |
+
text-align: center;
|
22 |
+
position: relative;
|
23 |
+
margin-top: .75em;
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
/**
|
28 |
+
* The month and year labels.
|
29 |
+
*/
|
30 |
+
.picker__month,
|
31 |
+
.picker__year {
|
32 |
+
font-weight: 500;
|
33 |
+
display: inline-block;
|
34 |
+
margin-left: .25em;
|
35 |
+
margin-right: .25em;
|
36 |
+
}
|
37 |
+
.picker__year {
|
38 |
+
color: @year-weekday-label;
|
39 |
+
font-size: .8em;
|
40 |
+
font-style: italic;
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* The month and year selectors.
|
46 |
+
*/
|
47 |
+
.picker__select--month,
|
48 |
+
.picker__select--year {
|
49 |
+
border: 1px solid @border-select;
|
50 |
+
height: 2em;
|
51 |
+
padding: .5em; // For firefox
|
52 |
+
margin-left: .25em;
|
53 |
+
margin-right: .25em;
|
54 |
+
|
55 |
+
// For `tiny` width screens, move it up a bit.
|
56 |
+
@media ( min-width: @breakpoint-width-tiny ) {
|
57 |
+
margin-top: -.5em;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
.picker__select--month {
|
61 |
+
width: 35%;
|
62 |
+
}
|
63 |
+
.picker__select--year {
|
64 |
+
width: 22.5%;
|
65 |
+
}
|
66 |
+
.picker__select--month:focus,
|
67 |
+
.picker__select--year:focus {
|
68 |
+
border-color: @blue;
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
* The month navigation buttons.
|
74 |
+
*/
|
75 |
+
.picker__nav--prev,
|
76 |
+
.picker__nav--next {
|
77 |
+
position: absolute;
|
78 |
+
padding: .5em 1.25em;
|
79 |
+
width: 1em;
|
80 |
+
height: 1em;
|
81 |
+
box-sizing: content-box;
|
82 |
+
top: -.25em;
|
83 |
+
|
84 |
+
// For `tiny` width screens, move it up a bit.
|
85 |
+
@media ( min-width: @breakpoint-width-tiny ) {
|
86 |
+
top: -.33em;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
.picker__nav--prev {
|
90 |
+
left: -1em;
|
91 |
+
padding-right: 1.25em;
|
92 |
+
|
93 |
+
// For `tiny` width screens, increase the padding a bit.
|
94 |
+
@media ( min-width: @breakpoint-width-tiny ) {
|
95 |
+
padding-right: 1.5em;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
.picker__nav--next {
|
99 |
+
right: -1em;
|
100 |
+
padding-left: 1.25em;
|
101 |
+
|
102 |
+
// For `tiny` width screens, increase the padding a bit.
|
103 |
+
@media ( min-width: @breakpoint-width-tiny ) {
|
104 |
+
padding-left: 1.5em;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
.picker__nav--prev:before,
|
108 |
+
.picker__nav--next:before {
|
109 |
+
content: " ";
|
110 |
+
border-top: .5em solid transparent;
|
111 |
+
border-bottom: .5em solid transparent;
|
112 |
+
border-right: .75em solid @black;
|
113 |
+
width: 0;
|
114 |
+
height: 0;
|
115 |
+
display: block;
|
116 |
+
margin: 0 auto;
|
117 |
+
}
|
118 |
+
.picker__nav--next:before {
|
119 |
+
border-right: 0;
|
120 |
+
border-left: .75em solid @black;
|
121 |
+
}
|
122 |
+
|
123 |
+
// Hovered date picker items.
|
124 |
+
.picker__nav--prev:hover,
|
125 |
+
.picker__nav--next:hover {
|
126 |
+
.picker-item-hovered;
|
127 |
+
}
|
128 |
+
|
129 |
+
// Disabled month nav.
|
130 |
+
.picker__nav--disabled,
|
131 |
+
.picker__nav--disabled:hover,
|
132 |
+
.picker__nav--disabled:before,
|
133 |
+
.picker__nav--disabled:before:hover {
|
134 |
+
cursor: default;
|
135 |
+
background: none;
|
136 |
+
border-right-color: @disabled-things-bg;
|
137 |
+
border-left-color: @disabled-things-bg;
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
/**
|
144 |
+
* The calendar table of dates
|
145 |
+
*/
|
146 |
+
.picker__table {
|
147 |
+
text-align: center;
|
148 |
+
border-collapse: collapse;
|
149 |
+
border-spacing: 0;
|
150 |
+
table-layout: fixed;
|
151 |
+
font-size: inherit;
|
152 |
+
width: 100%;
|
153 |
+
margin-top: .75em;
|
154 |
+
margin-bottom: .5em;
|
155 |
+
|
156 |
+
// For `small` screens, increase the spacing a tad.
|
157 |
+
@media ( min-height: @breakpoint-small ) {
|
158 |
+
margin-bottom: .75em;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
// Remove browser stylings on a table cell.
|
163 |
+
.picker__table td {
|
164 |
+
margin: 0;
|
165 |
+
padding: 0;
|
166 |
+
}
|
167 |
+
|
168 |
+
|
169 |
+
/**
|
170 |
+
* The weekday labels
|
171 |
+
*/
|
172 |
+
.picker__weekday {
|
173 |
+
width: 14.285714286%; // 100/7
|
174 |
+
font-size: .75em;
|
175 |
+
padding-bottom: .25em;
|
176 |
+
color: @year-weekday-label;
|
177 |
+
font-weight: 500;
|
178 |
+
|
179 |
+
/* Increase the spacing a tad */
|
180 |
+
@media ( min-height: @breakpoint-small ) {
|
181 |
+
padding-bottom: .5em;
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
/**
|
187 |
+
* The days on the calendar
|
188 |
+
*/
|
189 |
+
.picker__day {
|
190 |
+
padding: .3125em 0;
|
191 |
+
font-weight: 200;
|
192 |
+
border: 1px solid transparent;
|
193 |
+
}
|
194 |
+
|
195 |
+
// Today.
|
196 |
+
.picker__day--today {
|
197 |
+
position: relative;
|
198 |
+
}
|
199 |
+
.picker__day--today:before {
|
200 |
+
content: " ";
|
201 |
+
position: absolute;
|
202 |
+
top: 2px;
|
203 |
+
right: 2px;
|
204 |
+
width: 0;
|
205 |
+
height: 0;
|
206 |
+
border-top: .5em solid @blue-tag;
|
207 |
+
border-left: .5em solid transparent;
|
208 |
+
}
|
209 |
+
|
210 |
+
// Disabled day.
|
211 |
+
.picker__day--disabled:before {
|
212 |
+
border-top-color: @disabled-tag;
|
213 |
+
}
|
214 |
+
|
215 |
+
// Out of focus days.
|
216 |
+
.picker__day--outfocus {
|
217 |
+
color: @disabled-things-text;
|
218 |
+
}
|
219 |
+
|
220 |
+
// Hovered date picker items.
|
221 |
+
.picker__day--infocus:hover,
|
222 |
+
.picker__day--outfocus:hover {
|
223 |
+
.picker-item-hovered;
|
224 |
+
}
|
225 |
+
|
226 |
+
// Highlighted and hovered/focused dates.
|
227 |
+
.picker__day--highlighted {
|
228 |
+
.picker-item-highlighted;
|
229 |
+
}
|
230 |
+
.picker__day--highlighted:hover,
|
231 |
+
.picker--focused .picker__day--highlighted {
|
232 |
+
.picker-item-hovered;
|
233 |
+
}
|
234 |
+
|
235 |
+
// Selected and hovered/focused dates.
|
236 |
+
.picker__day--selected,
|
237 |
+
.picker__day--selected:hover,
|
238 |
+
.picker--focused .picker__day--selected {
|
239 |
+
.picker-item-selected;
|
240 |
+
}
|
241 |
+
|
242 |
+
// Disabled dates.
|
243 |
+
.picker__day--disabled,
|
244 |
+
.picker__day--disabled:hover,
|
245 |
+
.picker--focused .picker__day--disabled {
|
246 |
+
.picker-item-disabled;
|
247 |
+
}
|
248 |
+
|
249 |
+
// Disabled and highlighted dates.
|
250 |
+
.picker__day--highlighted.picker__day--disabled,
|
251 |
+
.picker__day--highlighted.picker__day--disabled:hover {
|
252 |
+
background: @disabled-highlighted-things-bg;
|
253 |
+
}
|
254 |
+
|
255 |
+
|
256 |
+
/**
|
257 |
+
* The footer containing the "today", "clear", and "close" buttons.
|
258 |
+
*/
|
259 |
+
.picker__footer {
|
260 |
+
text-align: center;
|
261 |
+
}
|
262 |
+
|
263 |
+
// Today, clear, and close buttons.
|
264 |
+
.picker__button--today,
|
265 |
+
.picker__button--clear,
|
266 |
+
.picker__button--close {
|
267 |
+
border: 1px solid @white;
|
268 |
+
background: @white;
|
269 |
+
font-size: .8em;
|
270 |
+
padding: .66em 0;
|
271 |
+
font-weight: bold;
|
272 |
+
width: 33%;
|
273 |
+
display: inline-block;
|
274 |
+
vertical-align: bottom;
|
275 |
+
}
|
276 |
+
.picker__button--today:hover,
|
277 |
+
.picker__button--clear:hover,
|
278 |
+
.picker__button--close:hover {
|
279 |
+
.picker-item-hovered;
|
280 |
+
border-bottom-color: @blue-hover;
|
281 |
+
}
|
282 |
+
.picker__button--today:focus,
|
283 |
+
.picker__button--clear:focus,
|
284 |
+
.picker__button--close:focus {
|
285 |
+
background: @blue-hover;
|
286 |
+
border-color: @blue;
|
287 |
+
outline: none;
|
288 |
+
}
|
289 |
+
|
290 |
+
// Today, clear, and close “indicators”.
|
291 |
+
.picker__button--today:before,
|
292 |
+
.picker__button--clear:before,
|
293 |
+
.picker__button--close:before {
|
294 |
+
position: relative;
|
295 |
+
display: inline-block;
|
296 |
+
height: 0;
|
297 |
+
}
|
298 |
+
.picker__button--today:before,
|
299 |
+
.picker__button--clear:before {
|
300 |
+
content: " ";
|
301 |
+
margin-right: .45em;
|
302 |
+
}
|
303 |
+
.picker__button--today:before {
|
304 |
+
top: -.05em;
|
305 |
+
width: 0;
|
306 |
+
border-top: .66em solid @blue-tag;
|
307 |
+
border-left: .66em solid transparent;
|
308 |
+
}
|
309 |
+
.picker__button--clear:before {
|
310 |
+
top: -.25em;
|
311 |
+
width: .66em;
|
312 |
+
border-top: 3px solid @clear-red;
|
313 |
+
}
|
314 |
+
.picker__button--close:before {
|
315 |
+
content: "\D7"; // ×
|
316 |
+
top: -.1em;
|
317 |
+
vertical-align: top;
|
318 |
+
font-size: 1.1em;
|
319 |
+
margin-right: .35em;
|
320 |
+
color: @border-grey;
|
321 |
+
}
|
322 |
+
|
323 |
+
// Today when “disabled”.
|
324 |
+
.picker__button--today[disabled],
|
325 |
+
.picker__button--today[disabled]:hover {
|
326 |
+
.picker-item-disabled;
|
327 |
+
}
|
328 |
+
.picker__button--today[disabled]:before {
|
329 |
+
border-top-color: @disabled-tag;
|
330 |
+
}
|
331 |
+
|
332 |
+
|
333 |
+
|
js/lib/themes-source/base.less
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$BASE-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
11 |
+
*/
|
12 |
+
.picker {
|
13 |
+
|
14 |
+
// The base font stylings.
|
15 |
+
font-size: @base-font-size;
|
16 |
+
text-align: left;
|
17 |
+
line-height: @base-line-height;
|
18 |
+
color: @black;
|
19 |
+
|
20 |
+
// The picker shouldn’t affect or be affected by elements around it.
|
21 |
+
position: absolute;
|
22 |
+
z-index: @picker-z-index;
|
23 |
+
|
24 |
+
// The picker shouldn’t be selectable.
|
25 |
+
user-select: none;
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* The picker input element.
|
31 |
+
*/
|
32 |
+
.picker__input {
|
33 |
+
cursor: default;
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* When the picker is opened, the input element is “activated”.
|
39 |
+
*/
|
40 |
+
.picker__input.picker__input--active {
|
41 |
+
border-color: @input-active-border;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
* The holder is the only “scrollable” top-level container element.
|
47 |
+
*/
|
48 |
+
.picker__holder {
|
49 |
+
width: 100%;
|
50 |
+
overflow-y: auto;
|
51 |
+
-webkit-overflow-scrolling: touch;
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
|
js/lib/themes-source/base.time.less
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$BASE-TIME-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The list of times.
|
11 |
+
*/
|
12 |
+
.picker__list {
|
13 |
+
list-style: none;
|
14 |
+
padding: 0.75em 0 4.2em;
|
15 |
+
margin: 0;
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The times on the clock.
|
21 |
+
*/
|
22 |
+
.picker__list-item {
|
23 |
+
border-bottom: 1px solid @border-grey-light;
|
24 |
+
border-top: 1px solid @border-grey-light;
|
25 |
+
margin-bottom: -1px; // Prevent border from doubling up.
|
26 |
+
position: relative;
|
27 |
+
background: @bg-white;
|
28 |
+
padding: .75em 1.25em;
|
29 |
+
|
30 |
+
// For `large` screens, reduce the padding to show more in view.
|
31 |
+
@media ( min-height: @breakpoint-large ) {
|
32 |
+
padding: .5em 1em;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
/* Hovered time */
|
37 |
+
.picker__list-item:hover {
|
38 |
+
.picker-item-hovered;
|
39 |
+
border-color: @blue;
|
40 |
+
z-index: 10;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* Highlighted and hovered/focused time */
|
44 |
+
.picker__list-item--highlighted {
|
45 |
+
.picker-item-highlighted;
|
46 |
+
z-index: 10;
|
47 |
+
}
|
48 |
+
.picker__list-item--highlighted:hover,
|
49 |
+
.picker--focused .picker__list-item--highlighted {
|
50 |
+
.picker-item-hovered;
|
51 |
+
}
|
52 |
+
|
53 |
+
/* Selected and hovered/focused time */
|
54 |
+
.picker__list-item--selected,
|
55 |
+
.picker__list-item--selected:hover,
|
56 |
+
.picker--focused .picker__list-item--selected {
|
57 |
+
.picker-item-selected;
|
58 |
+
z-index: 10;
|
59 |
+
}
|
60 |
+
|
61 |
+
/* Disabled time */
|
62 |
+
.picker__list-item--disabled,
|
63 |
+
.picker__list-item--disabled:hover,
|
64 |
+
.picker--focused .picker__list-item--disabled {
|
65 |
+
.picker-item-disabled;
|
66 |
+
border-color: @border-grey-light;
|
67 |
+
z-index: auto;
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
/**
|
74 |
+
* The clear button
|
75 |
+
*/
|
76 |
+
.picker--time {
|
77 |
+
|
78 |
+
.picker__button--clear {
|
79 |
+
display: block;
|
80 |
+
width: 80%;
|
81 |
+
margin: 1em auto 0;
|
82 |
+
padding: 1em 1.25em;
|
83 |
+
|
84 |
+
background: none;
|
85 |
+
border: 0;
|
86 |
+
|
87 |
+
font-weight: 500;
|
88 |
+
font-size: .67em;
|
89 |
+
text-align: center;
|
90 |
+
text-transform: uppercase;
|
91 |
+
color: #666;
|
92 |
+
}
|
93 |
+
|
94 |
+
.picker__button--clear:hover,
|
95 |
+
.picker__button--clear:focus {
|
96 |
+
.picker-item-hovered;
|
97 |
+
background: @clear-red;
|
98 |
+
border-color: @clear-red;
|
99 |
+
cursor: pointer;
|
100 |
+
color: @white;
|
101 |
+
outline: none;
|
102 |
+
}
|
103 |
+
|
104 |
+
.picker__button--clear:before {
|
105 |
+
top: -.25em;
|
106 |
+
color: #666;
|
107 |
+
font-size: 1.25em;
|
108 |
+
font-weight: bold;
|
109 |
+
}
|
110 |
+
|
111 |
+
.picker__button--clear:hover:before,
|
112 |
+
.picker__button--clear:focus:before {
|
113 |
+
color: @white;
|
114 |
+
border-color: @white;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
|
js/lib/themes-source/classic.date.less
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$CLASSIC-DATE-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
|
js/lib/themes-source/classic.less
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Classic picker styling for pickadate.js
|
3 |
+
* Demo: http://amsul.github.io/pickadate.js
|
4 |
+
*/
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
11 |
+
*/
|
12 |
+
.picker {
|
13 |
+
|
14 |
+
// Make it full-width so that it doesn’t collapse.
|
15 |
+
width: 100%;
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The holder is the base of the picker.
|
22 |
+
*/
|
23 |
+
.picker__holder {
|
24 |
+
|
25 |
+
// The base stylings.
|
26 |
+
position: absolute;
|
27 |
+
background: @bg-white;
|
28 |
+
|
29 |
+
// Add a light border - except top & bottom to let it collapse.
|
30 |
+
border: 1px solid lighten( @border-grey, 20% );
|
31 |
+
border-top-width: 0;
|
32 |
+
border-bottom-width: 0;
|
33 |
+
|
34 |
+
// Round the bottom corners.
|
35 |
+
border-radius: 0 0 @picker-border-radius @picker-border-radius;
|
36 |
+
|
37 |
+
// Let’s not go 100% + 2px.
|
38 |
+
box-sizing: border-box;
|
39 |
+
|
40 |
+
// Specify the min & max widths.
|
41 |
+
min-width: @classic-min-width;
|
42 |
+
max-width: @classic-max-width;
|
43 |
+
|
44 |
+
// Hide everything to begin with.
|
45 |
+
max-height: 0;
|
46 |
+
.opacity( 0 );
|
47 |
+
|
48 |
+
// Tilt the picker.
|
49 |
+
transform: translateY( -1em ) perspective( 600px ) rotateX( 10deg );
|
50 |
+
|
51 |
+
// Everything should be smoothly animated – the height & border should wait till the rest is done.
|
52 |
+
transition: transform @speed-animate-in ease-out,
|
53 |
+
opacity @speed-animate-in ease-out,
|
54 |
+
max-height 0s @speed-animate-in,
|
55 |
+
border-width 0s @speed-animate-in;
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
/**
|
61 |
+
* The frame and wrap work together to ensure that
|
62 |
+
* clicks within the picker don’t reach the holder.
|
63 |
+
*/
|
64 |
+
.picker__frame {
|
65 |
+
padding: 1px;
|
66 |
+
}
|
67 |
+
.picker__wrap {
|
68 |
+
margin: -1px;
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
/**
|
74 |
+
* When the picker opens...
|
75 |
+
*/
|
76 |
+
.picker--opened {
|
77 |
+
|
78 |
+
.picker__holder {
|
79 |
+
|
80 |
+
// Reveal the content.
|
81 |
+
max-height: @classic-max-height;
|
82 |
+
.opacity( 1 );
|
83 |
+
|
84 |
+
// Expand the top & bottom borders.
|
85 |
+
border-top-width: 1px;
|
86 |
+
border-bottom-width: 1px;
|
87 |
+
|
88 |
+
// Straighten the picker.
|
89 |
+
transform: translateY( 0 ) perspective( 600px ) rotateX( 0 );
|
90 |
+
|
91 |
+
// Everything should be smoothly animated – except the height & border.
|
92 |
+
transition: transform @speed-animate-in ease-out,
|
93 |
+
opacity @speed-animate-in ease-out,
|
94 |
+
max-height 0s,
|
95 |
+
border-width 0s;
|
96 |
+
|
97 |
+
// Add a light shadow.
|
98 |
+
box-shadow: @classic-box-shadow;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
|
js/lib/themes-source/classic.time.less
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$CLASSIC-TIME-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Note: the root picker element should __NOT__ be styled
|
11 |
+
* more than what’s here. Style the `.picker__holder` instead.
|
12 |
+
*/
|
13 |
+
.picker--time {
|
14 |
+
|
15 |
+
// Adjust the min & max widths.
|
16 |
+
min-width: @time-min-width;
|
17 |
+
max-width: @time-max-width;
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The holder is the base of the picker.
|
23 |
+
*/
|
24 |
+
.picker--time .picker__holder {
|
25 |
+
|
26 |
+
// Add a slight background color.
|
27 |
+
background: @bg-grey-light;
|
28 |
+
|
29 |
+
// For `medium` screens, reduce the font-size a bit to get more in view.
|
30 |
+
@media ( min-height: @breakpoint-medium ) {
|
31 |
+
font-size: .875em;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
/**
|
37 |
+
* The box contains the list of times.
|
38 |
+
*/
|
39 |
+
.picker--time .picker__box {
|
40 |
+
|
41 |
+
// Remove any stylings overflowing from the date picker.
|
42 |
+
padding: 0;
|
43 |
+
|
44 |
+
// Make the “viewset” time position relative to the box.
|
45 |
+
position: relative;
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
|
js/lib/themes-source/default.date.less
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$DEFAULT-DATE-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
|
js/lib/themes-source/default.less
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Default mobile-first, responsive styling for pickadate.js
|
3 |
+
* Demo: http://amsul.github.io/pickadate.js
|
4 |
+
*/
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
11 |
+
*/
|
12 |
+
.picker {}
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Make the holder and frame fullscreen.
|
17 |
+
*/
|
18 |
+
.picker__holder,
|
19 |
+
.picker__frame {
|
20 |
+
top: 0;
|
21 |
+
bottom: 0;
|
22 |
+
left: 0;
|
23 |
+
right: 0;
|
24 |
+
|
25 |
+
// Nudge everything off-screen to begin with.
|
26 |
+
transform: translateY(100%);
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
/**
|
31 |
+
* The holder should overlay the entire screen.
|
32 |
+
*/
|
33 |
+
.picker__holder {
|
34 |
+
|
35 |
+
// Fill the screen and fix the position.
|
36 |
+
position: fixed;
|
37 |
+
|
38 |
+
// Fade out the background, then immediately shift the holder out of view.
|
39 |
+
transition: background @speed-animate-in ease-out, transform 0s @speed-animate-in;
|
40 |
+
|
41 |
+
// Avoid flickering of the page on webkit browsers
|
42 |
+
-webkit-backface-visibility: hidden;
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* The frame that bounds the box contents of the picker.
|
49 |
+
*/
|
50 |
+
.picker__frame {
|
51 |
+
|
52 |
+
position: absolute;
|
53 |
+
|
54 |
+
// Specify the min & max widths and center align it.
|
55 |
+
margin: 0 auto;
|
56 |
+
min-width: @picker-min-width;
|
57 |
+
max-width: @picker-max-width;
|
58 |
+
width: 100%; // For IE9 & 10 to keep it centered.
|
59 |
+
|
60 |
+
// Hide it to begin with.
|
61 |
+
.opacity( 0 );
|
62 |
+
|
63 |
+
// Animate the frame in and out of view.
|
64 |
+
transition: all @speed-animate-in ease-out;
|
65 |
+
|
66 |
+
// For `small` screens...
|
67 |
+
@media ( min-height: @breakpoint-small ) {
|
68 |
+
|
69 |
+
// Reveal what’s beyond to allow drop shadows, et al.
|
70 |
+
overflow: visible;
|
71 |
+
|
72 |
+
// Align to the bottom edge instead of top.
|
73 |
+
top: auto;
|
74 |
+
bottom: -100%;
|
75 |
+
|
76 |
+
// Prevent it from overflowing over the top edge.
|
77 |
+
max-height: 80%;
|
78 |
+
}
|
79 |
+
|
80 |
+
// For `medium` screens...
|
81 |
+
@media ( min-height: @breakpoint-medium ) {
|
82 |
+
|
83 |
+
// Move away from the bottom edge.
|
84 |
+
margin-bottom: 7.5%;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* The wrapper sets the stage to vertically align the box contents.
|
90 |
+
*/
|
91 |
+
.picker__wrap {
|
92 |
+
display: table;
|
93 |
+
width: 100%;
|
94 |
+
height: 100%;
|
95 |
+
|
96 |
+
// For `small` screens, remove the “middle-aligned” styling
|
97 |
+
@media ( min-height: @breakpoint-small ) {
|
98 |
+
display: block;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
/**
|
105 |
+
* The box contains all the picker contents.
|
106 |
+
*/
|
107 |
+
.picker__box {
|
108 |
+
background: @bg-white;
|
109 |
+
|
110 |
+
// To start with, vertically align to center
|
111 |
+
display: table-cell;
|
112 |
+
vertical-align: middle;
|
113 |
+
|
114 |
+
// For `tiny` screens, increase the font size a bit
|
115 |
+
@media ( min-height: @breakpoint-tiny ) {
|
116 |
+
font-size: 1.25em;
|
117 |
+
}
|
118 |
+
|
119 |
+
// For `small` screens...
|
120 |
+
@media ( min-height: @breakpoint-small ) {
|
121 |
+
|
122 |
+
// Remove the “middle-aligned” styling
|
123 |
+
display: block;
|
124 |
+
|
125 |
+
// Increase the font size a bit more
|
126 |
+
font-size: 1.33em;
|
127 |
+
|
128 |
+
// Add the borders except the bottom one
|
129 |
+
border: 1px solid @border-grey;
|
130 |
+
border-top-color: lighten( @border-grey, 7% );
|
131 |
+
border-bottom-width: 0;
|
132 |
+
|
133 |
+
// Make ‘em rounded at the top corners
|
134 |
+
border-radius: @picker-border-radius @picker-border-radius 0 0;
|
135 |
+
|
136 |
+
// And finally, add a nice shadow
|
137 |
+
box-shadow: @picker-box-shadow;
|
138 |
+
}
|
139 |
+
|
140 |
+
// For `medium` screens...
|
141 |
+
@media ( min-height: @breakpoint-medium ) {
|
142 |
+
|
143 |
+
// Increase the font size.
|
144 |
+
font-size: 1.5em;
|
145 |
+
|
146 |
+
// Reveal all borders and round all corners.
|
147 |
+
border-bottom-width: 1px;
|
148 |
+
border-radius: @picker-border-radius;
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
+
/**
|
154 |
+
* When the picker opens...
|
155 |
+
*/
|
156 |
+
.picker--opened {
|
157 |
+
|
158 |
+
// Immediately move the holder to the top edge then fade in an overlay
|
159 |
+
.picker__holder {
|
160 |
+
|
161 |
+
// Move it to the top edge
|
162 |
+
transform: translateY(0);
|
163 |
+
|
164 |
+
// Show a translucent black background (order is important for IE)
|
165 |
+
background: transparent;
|
166 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#1E000000,endColorstr=#1E000000)"; // IE8
|
167 |
+
zoom: 1;
|
168 |
+
background: rgba(0,0,0,.32); // Normal browsers
|
169 |
+
|
170 |
+
// Animate in the background
|
171 |
+
transition: background @speed-animate-in ease-out;
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
+
// Smoothly move the content to the top edge while fading it in
|
176 |
+
.picker__frame {
|
177 |
+
|
178 |
+
// Move to the top edge
|
179 |
+
transform: translateY(0);
|
180 |
+
|
181 |
+
// Ånd then reveal the content
|
182 |
+
.opacity( 1 );
|
183 |
+
|
184 |
+
// For `small` screens, move to the bottom edge instead
|
185 |
+
@media ( min-height: @breakpoint-small ) {
|
186 |
+
top: auto;
|
187 |
+
bottom: 0;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
|
js/lib/themes-source/default.time.less
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* ==========================================================================
|
3 |
+
$DEFAULT-TIME-PICKER
|
4 |
+
========================================================================== */
|
5 |
+
|
6 |
+
@import "_variables.less";
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The frame the bounds the time picker.
|
11 |
+
*/
|
12 |
+
.picker--time .picker__frame {
|
13 |
+
|
14 |
+
// Adjust the min & max widths.
|
15 |
+
min-width: @time-min-width;
|
16 |
+
max-width: @time-max-width;
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The picker box.
|
22 |
+
*/
|
23 |
+
.picker--time .picker__box {
|
24 |
+
|
25 |
+
// Keep the font-size small to show more in view.
|
26 |
+
font-size: 1em;
|
27 |
+
|
28 |
+
// Add a slight background color.
|
29 |
+
background: @bg-grey-light;
|
30 |
+
|
31 |
+
// Remove the side paddings.
|
32 |
+
padding: 0;
|
33 |
+
|
34 |
+
// For `medium` screens, move it away from the bottom edge of the screen.
|
35 |
+
@media ( min-height: @breakpoint-medium ) {
|
36 |
+
margin-bottom: 5em;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
|
js/lib/themes-source/rtl.less
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Styling for RTL (right-to-left) languages using pickadate.js
|
3 |
+
*/
|
4 |
+
|
5 |
+
@import "_variables.less";
|
6 |
+
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Switch the direction - only really necessary if
|
10 |
+
* it hasn’t already been applied higher up in the DOM.
|
11 |
+
*/
|
12 |
+
.picker {
|
13 |
+
direction: rtl;
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Flip around the “next” and “previous” buttons.
|
19 |
+
*/
|
20 |
+
.picker__nav--next {
|
21 |
+
right: auto;
|
22 |
+
left: -1em;
|
23 |
+
}
|
24 |
+
.picker__nav--prev {
|
25 |
+
left: auto;
|
26 |
+
right: -1em;
|
27 |
+
}
|
28 |
+
.picker__nav--next:before {
|
29 |
+
border-left: 0;
|
30 |
+
border-right: .75em solid @black;
|
31 |
+
}
|
32 |
+
.picker__nav--prev:before {
|
33 |
+
border-right: 0;
|
34 |
+
border-left: .75em solid @black;
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
|
js/lib/themes/classic.css
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ==========================================================================
|
2 |
+
$BASE-PICKER
|
3 |
+
========================================================================== */
|
4 |
+
/**
|
5 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
6 |
+
*/
|
7 |
+
.picker {
|
8 |
+
font-size: 16px;
|
9 |
+
text-align: left;
|
10 |
+
line-height: 1.2;
|
11 |
+
color: #000000;
|
12 |
+
position: absolute;
|
13 |
+
z-index: 10000;
|
14 |
+
-webkit-user-select: none;
|
15 |
+
-moz-user-select: none;
|
16 |
+
-ms-user-select: none;
|
17 |
+
user-select: none;
|
18 |
+
}
|
19 |
+
/**
|
20 |
+
* The picker input element.
|
21 |
+
*/
|
22 |
+
.picker__input {
|
23 |
+
cursor: default;
|
24 |
+
}
|
25 |
+
/**
|
26 |
+
* When the picker is opened, the input element is “activated”.
|
27 |
+
*/
|
28 |
+
.picker__input.picker__input--active {
|
29 |
+
border-color: #0089ec;
|
30 |
+
}
|
31 |
+
/**
|
32 |
+
* The holder is the only “scrollable” top-level container element.
|
33 |
+
*/
|
34 |
+
.picker__holder {
|
35 |
+
width: 100%;
|
36 |
+
overflow-y: auto;
|
37 |
+
-webkit-overflow-scrolling: touch;
|
38 |
+
}
|
39 |
+
|
40 |
+
/*!
|
41 |
+
* Classic picker styling for pickadate.js
|
42 |
+
* Demo: http://amsul.github.io/pickadate.js
|
43 |
+
*/
|
44 |
+
/**
|
45 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
46 |
+
*/
|
47 |
+
.picker {
|
48 |
+
width: 100%;
|
49 |
+
}
|
50 |
+
/**
|
51 |
+
* The holder is the base of the picker.
|
52 |
+
*/
|
53 |
+
.picker__holder {
|
54 |
+
position: absolute;
|
55 |
+
background: #ffffff;
|
56 |
+
border: 1px solid #aaaaaa;
|
57 |
+
border-top-width: 0;
|
58 |
+
border-bottom-width: 0;
|
59 |
+
border-radius: 0 0 5px 5px;
|
60 |
+
box-sizing: border-box;
|
61 |
+
min-width: 176px;
|
62 |
+
max-width: 466px;
|
63 |
+
max-height: 0;
|
64 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
65 |
+
filter: alpha(opacity=0);
|
66 |
+
-moz-opacity: 0;
|
67 |
+
opacity: 0;
|
68 |
+
-webkit-transform: translateY(-1em) perspective(600px) rotateX(10deg);
|
69 |
+
transform: translateY(-1em) perspective(600px) rotateX(10deg);
|
70 |
+
transition: -webkit-transform 0.15s ease-out, opacity 0.15s ease-out, max-height 0s 0.15s, border-width 0s 0.15s;
|
71 |
+
transition: transform 0.15s ease-out, opacity 0.15s ease-out, max-height 0s 0.15s, border-width 0s 0.15s;
|
72 |
+
}
|
73 |
+
/**
|
74 |
+
* The frame and wrap work together to ensure that
|
75 |
+
* clicks within the picker don’t reach the holder.
|
76 |
+
*/
|
77 |
+
.picker__frame {
|
78 |
+
padding: 1px;
|
79 |
+
}
|
80 |
+
.picker__wrap {
|
81 |
+
margin: -1px;
|
82 |
+
}
|
83 |
+
/**
|
84 |
+
* When the picker opens...
|
85 |
+
*/
|
86 |
+
.picker--opened .picker__holder {
|
87 |
+
max-height: 25em;
|
88 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
89 |
+
filter: alpha(opacity=100);
|
90 |
+
-moz-opacity: 1;
|
91 |
+
opacity: 1;
|
92 |
+
border-top-width: 1px;
|
93 |
+
border-bottom-width: 1px;
|
94 |
+
-webkit-transform: translateY(0) perspective(600px) rotateX(0);
|
95 |
+
transform: translateY(0) perspective(600px) rotateX(0);
|
96 |
+
transition: -webkit-transform 0.15s ease-out, opacity 0.15s ease-out, max-height 0s, border-width 0s;
|
97 |
+
transition: transform 0.15s ease-out, opacity 0.15s ease-out, max-height 0s, border-width 0s;
|
98 |
+
box-shadow: 0 6px 18px 1px rgba(0, 0, 0, 0.12);
|
99 |
+
}
|
js/lib/themes/classic.date.css
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ==========================================================================
|
2 |
+
$BASE-DATE-PICKER
|
3 |
+
========================================================================== */
|
4 |
+
/**
|
5 |
+
* The picker box.
|
6 |
+
*/
|
7 |
+
.picker__box {
|
8 |
+
padding: 0 1em;
|
9 |
+
}
|
10 |
+
/**
|
11 |
+
* The header containing the month and year stuff.
|
12 |
+
*/
|
13 |
+
.picker__header {
|
14 |
+
text-align: center;
|
15 |
+
position: relative;
|
16 |
+
margin-top: .75em;
|
17 |
+
}
|
18 |
+
/**
|
19 |
+
* The month and year labels.
|
20 |
+
*/
|
21 |
+
.picker__month,
|
22 |
+
.picker__year {
|
23 |
+
font-weight: 500;
|
24 |
+
display: inline-block;
|
25 |
+
margin-left: .25em;
|
26 |
+
margin-right: .25em;
|
27 |
+
}
|
28 |
+
.picker__year {
|
29 |
+
color: #999999;
|
30 |
+
font-size: .8em;
|
31 |
+
font-style: italic;
|
32 |
+
}
|
33 |
+
/**
|
34 |
+
* The month and year selectors.
|
35 |
+
*/
|
36 |
+
.picker__select--month,
|
37 |
+
.picker__select--year {
|
38 |
+
border: 1px solid #b7b7b7;
|
39 |
+
height: 2em;
|
40 |
+
padding: .5em;
|
41 |
+
margin-left: .25em;
|
42 |
+
margin-right: .25em;
|
43 |
+
}
|
44 |
+
@media (min-width: 24.5em) {
|
45 |
+
.picker__select--month,
|
46 |
+
.picker__select--year {
|
47 |
+
margin-top: -0.5em;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
.picker__select--month {
|
51 |
+
width: 35%;
|
52 |
+
}
|
53 |
+
.picker__select--year {
|
54 |
+
width: 22.5%;
|
55 |
+
}
|
56 |
+
.picker__select--month:focus,
|
57 |
+
.picker__select--year:focus {
|
58 |
+
border-color: #0089ec;
|
59 |
+
}
|
60 |
+
/**
|
61 |
+
* The month navigation buttons.
|
62 |
+
*/
|
63 |
+
.picker__nav--prev,
|
64 |
+
.picker__nav--next {
|
65 |
+
position: absolute;
|
66 |
+
padding: .5em 1.25em;
|
67 |
+
width: 1em;
|
68 |
+
height: 1em;
|
69 |
+
box-sizing: content-box;
|
70 |
+
top: -0.25em;
|
71 |
+
}
|
72 |
+
@media (min-width: 24.5em) {
|
73 |
+
.picker__nav--prev,
|
74 |
+
.picker__nav--next {
|
75 |
+
top: -0.33em;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
.picker__nav--prev {
|
79 |
+
left: -1em;
|
80 |
+
padding-right: 1.25em;
|
81 |
+
}
|
82 |
+
@media (min-width: 24.5em) {
|
83 |
+
.picker__nav--prev {
|
84 |
+
padding-right: 1.5em;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
.picker__nav--next {
|
88 |
+
right: -1em;
|
89 |
+
padding-left: 1.25em;
|
90 |
+
}
|
91 |
+
@media (min-width: 24.5em) {
|
92 |
+
.picker__nav--next {
|
93 |
+
padding-left: 1.5em;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
.picker__nav--prev:before,
|
97 |
+
.picker__nav--next:before {
|
98 |
+
content: " ";
|
99 |
+
border-top: .5em solid transparent;
|
100 |
+
border-bottom: .5em solid transparent;
|
101 |
+
border-right: 0.75em solid #000000;
|
102 |
+
width: 0;
|
103 |
+
height: 0;
|
104 |
+
display: block;
|
105 |
+
margin: 0 auto;
|
106 |
+
}
|
107 |
+
.picker__nav--next:before {
|
108 |
+
border-right: 0;
|
109 |
+
border-left: 0.75em solid #000000;
|
110 |
+
}
|
111 |
+
.picker__nav--prev:hover,
|
112 |
+
.picker__nav--next:hover {
|
113 |
+
cursor: pointer;
|
114 |
+
color: #000000;
|
115 |
+
background: #b1dcfb;
|
116 |
+
}
|
117 |
+
.picker__nav--disabled,
|
118 |
+
.picker__nav--disabled:hover,
|
119 |
+
.picker__nav--disabled:before,
|
120 |
+
.picker__nav--disabled:before:hover {
|
121 |
+
cursor: default;
|
122 |
+
background: none;
|
123 |
+
border-right-color: #f5f5f5;
|
124 |
+
border-left-color: #f5f5f5;
|
125 |
+
}
|
126 |
+
/**
|
127 |
+
* The calendar table of dates
|
128 |
+
*/
|
129 |
+
.picker__table {
|
130 |
+
text-align: center;
|
131 |
+
border-collapse: collapse;
|
132 |
+
border-spacing: 0;
|
133 |
+
table-layout: fixed;
|
134 |
+
font-size: inherit;
|
135 |
+
width: 100%;
|
136 |
+
margin-top: .75em;
|
137 |
+
margin-bottom: .5em;
|
138 |
+
}
|
139 |
+
@media (min-height: 33.875em) {
|
140 |
+
.picker__table {
|
141 |
+
margin-bottom: .75em;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
.picker__table td {
|
145 |
+
margin: 0;
|
146 |
+
padding: 0;
|
147 |
+
}
|
148 |
+
/**
|
149 |
+
* The weekday labels
|
150 |
+
*/
|
151 |
+
.picker__weekday {
|
152 |
+
width: 14.285714286%;
|
153 |
+
font-size: .75em;
|
154 |
+
padding-bottom: .25em;
|
155 |
+
color: #999999;
|
156 |
+
font-weight: 500;
|
157 |
+
/* Increase the spacing a tad */
|
158 |
+
}
|
159 |
+
@media (min-height: 33.875em) {
|
160 |
+
.picker__weekday {
|
161 |
+
padding-bottom: .5em;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
/**
|
165 |
+
* The days on the calendar
|
166 |
+
*/
|
167 |
+
.picker__day {
|
168 |
+
padding: .3125em 0;
|
169 |
+
font-weight: 200;
|
170 |
+
border: 1px solid transparent;
|
171 |
+
}
|
172 |
+
.picker__day--today {
|
173 |
+
position: relative;
|
174 |
+
}
|
175 |
+
.picker__day--today:before {
|
176 |
+
content: " ";
|
177 |
+
position: absolute;
|
178 |
+
top: 2px;
|
179 |
+
right: 2px;
|
180 |
+
width: 0;
|
181 |
+
height: 0;
|
182 |
+
border-top: 0.5em solid #0059bc;
|
183 |
+
border-left: .5em solid transparent;
|
184 |
+
}
|
185 |
+
.picker__day--disabled:before {
|
186 |
+
border-top-color: #aaaaaa;
|
187 |
+
}
|
188 |
+
.picker__day--outfocus {
|
189 |
+
color: #dddddd;
|
190 |
+
}
|
191 |
+
.picker__day--infocus:hover,
|
192 |
+
.picker__day--outfocus:hover {
|
193 |
+
cursor: pointer;
|
194 |
+
color: #000000;
|
195 |
+
background: #b1dcfb;
|
196 |
+
}
|
197 |
+
.picker__day--highlighted {
|
198 |
+
border-color: #0089ec;
|
199 |
+
}
|
200 |
+
.picker__day--highlighted:hover,
|
201 |
+
.picker--focused .picker__day--highlighted {
|
202 |
+
cursor: pointer;
|
203 |
+
color: #000000;
|
204 |
+
background: #b1dcfb;
|
205 |
+
}
|
206 |
+
.picker__day--selected,
|
207 |
+
.picker__day--selected:hover,
|
208 |
+
.picker--focused .picker__day--selected {
|
209 |
+
background: #0089ec;
|
210 |
+
color: #ffffff;
|
211 |
+
}
|
212 |
+
.picker__day--disabled,
|
213 |
+
.picker__day--disabled:hover,
|
214 |
+
.picker--focused .picker__day--disabled {
|
215 |
+
background: #f5f5f5;
|
216 |
+
border-color: #f5f5f5;
|
217 |
+
color: #dddddd;
|
218 |
+
cursor: default;
|
219 |
+
}
|
220 |
+
.picker__day--highlighted.picker__day--disabled,
|
221 |
+
.picker__day--highlighted.picker__day--disabled:hover {
|
222 |
+
background: #bbbbbb;
|
223 |
+
}
|
224 |
+
/**
|
225 |
+
* The footer containing the "today", "clear", and "close" buttons.
|
226 |
+
*/
|
227 |
+
.picker__footer {
|
228 |
+
text-align: center;
|
229 |
+
}
|
230 |
+
.picker__button--today,
|
231 |
+
.picker__button--clear,
|
232 |
+
.picker__button--close {
|
233 |
+
border: 1px solid #ffffff;
|
234 |
+
background: #ffffff;
|
235 |
+
font-size: .8em;
|
236 |
+
padding: .66em 0;
|
237 |
+
font-weight: bold;
|
238 |
+
width: 33%;
|
239 |
+
display: inline-block;
|
240 |
+
vertical-align: bottom;
|
241 |
+
}
|
242 |
+
.picker__button--today:hover,
|
243 |
+
.picker__button--clear:hover,
|
244 |
+
.picker__button--close:hover {
|
245 |
+
cursor: pointer;
|
246 |
+
color: #000000;
|
247 |
+
background: #b1dcfb;
|
248 |
+
border-bottom-color: #b1dcfb;
|
249 |
+
}
|
250 |
+
.picker__button--today:focus,
|
251 |
+
.picker__button--clear:focus,
|
252 |
+
.picker__button--close:focus {
|
253 |
+
background: #b1dcfb;
|
254 |
+
border-color: #0089ec;
|
255 |
+
outline: none;
|
256 |
+
}
|
257 |
+
.picker__button--today:before,
|
258 |
+
.picker__button--clear:before,
|
259 |
+
.picker__button--close:before {
|
260 |
+
position: relative;
|
261 |
+
display: inline-block;
|
262 |
+
height: 0;
|
263 |
+
}
|
264 |
+
.picker__button--today:before,
|
265 |
+
.picker__button--clear:before {
|
266 |
+
content: " ";
|
267 |
+
margin-right: .45em;
|
268 |
+
}
|
269 |
+
.picker__button--today:before {
|
270 |
+
top: -0.05em;
|
271 |
+
width: 0;
|
272 |
+
border-top: 0.66em solid #0059bc;
|
273 |
+
border-left: .66em solid transparent;
|
274 |
+
}
|
275 |
+
.picker__button--clear:before {
|
276 |
+
top: -0.25em;
|
277 |
+
width: .66em;
|
278 |
+
border-top: 3px solid #ee2200;
|
279 |
+
}
|
280 |
+
.picker__button--close:before {
|
281 |
+
content: "\D7";
|
282 |
+
top: -0.1em;
|
283 |
+
vertical-align: top;
|
284 |
+
font-size: 1.1em;
|
285 |
+
margin-right: .35em;
|
286 |
+
color: #777777;
|
287 |
+
}
|
288 |
+
.picker__button--today[disabled],
|
289 |
+
.picker__button--today[disabled]:hover {
|
290 |
+
background: #f5f5f5;
|
291 |
+
border-color: #f5f5f5;
|
292 |
+
color: #dddddd;
|
293 |
+
cursor: default;
|
294 |
+
}
|
295 |
+
.picker__button--today[disabled]:before {
|
296 |
+
border-top-color: #aaaaaa;
|
297 |
+
}
|
298 |
+
|
299 |
+
/* ==========================================================================
|
300 |
+
$CLASSIC-DATE-PICKER
|
301 |
+
========================================================================== */
|
js/lib/themes/classic.time.css
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ==========================================================================
|
2 |
+
$BASE-TIME-PICKER
|
3 |
+
========================================================================== */
|
4 |
+
/**
|
5 |
+
* The list of times.
|
6 |
+
*/
|
7 |
+
.picker__list {
|
8 |
+
list-style: none;
|
9 |
+
padding: 0.75em 0 4.2em;
|
10 |
+
margin: 0;
|
11 |
+
}
|
12 |
+
/**
|
13 |
+
* The times on the clock.
|
14 |
+
*/
|
15 |
+
.picker__list-item {
|
16 |
+
border-bottom: 1px solid #dddddd;
|
17 |
+
border-top: 1px solid #dddddd;
|
18 |
+
margin-bottom: -1px;
|
19 |
+
position: relative;
|
20 |
+
background: #ffffff;
|
21 |
+
padding: .75em 1.25em;
|
22 |
+
}
|
23 |
+
@media (min-height: 46.75em) {
|
24 |
+
.picker__list-item {
|
25 |
+
padding: .5em 1em;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
/* Hovered time */
|
29 |
+
.picker__list-item:hover {
|
30 |
+
cursor: pointer;
|
31 |
+
color: #000000;
|
32 |
+
background: #b1dcfb;
|
33 |
+
border-color: #0089ec;
|
34 |
+
z-index: 10;
|
35 |
+
}
|
36 |
+
/* Highlighted and hovered/focused time */
|
37 |
+
.picker__list-item--highlighted {
|
38 |
+
border-color: #0089ec;
|
39 |
+
z-index: 10;
|
40 |
+
}
|
41 |
+
.picker__list-item--highlighted:hover,
|
42 |
+
.picker--focused .picker__list-item--highlighted {
|
43 |
+
cursor: pointer;
|
44 |
+
color: #000000;
|
45 |
+
background: #b1dcfb;
|
46 |
+
}
|
47 |
+
/* Selected and hovered/focused time */
|
48 |
+
.picker__list-item--selected,
|
49 |
+
.picker__list-item--selected:hover,
|
50 |
+
.picker--focused .picker__list-item--selected {
|
51 |
+
background: #0089ec;
|
52 |
+
color: #ffffff;
|
53 |
+
z-index: 10;
|
54 |
+
}
|
55 |
+
/* Disabled time */
|
56 |
+
.picker__list-item--disabled,
|
57 |
+
.picker__list-item--disabled:hover,
|
58 |
+
.picker--focused .picker__list-item--disabled {
|
59 |
+
background: #f5f5f5;
|
60 |
+
border-color: #f5f5f5;
|
61 |
+
color: #dddddd;
|
62 |
+
cursor: default;
|
63 |
+
border-color: #dddddd;
|
64 |
+
z-index: auto;
|
65 |
+
}
|
66 |
+
/**
|
67 |
+
* The clear button
|
68 |
+
*/
|
69 |
+
.picker--time .picker__button--clear {
|
70 |
+
display: block;
|
71 |
+
width: 80%;
|
72 |
+
margin: 1em auto 0;
|
73 |
+
padding: 1em 1.25em;
|
74 |
+
background: none;
|
75 |
+
border: 0;
|
76 |
+
font-weight: 500;
|
77 |
+
font-size: .67em;
|
78 |
+
text-align: center;
|
79 |
+
text-transform: uppercase;
|
80 |
+
color: #666;
|
81 |
+
}
|
82 |
+
.picker--time .picker__button--clear:hover,
|
83 |
+
.picker--time .picker__button--clear:focus {
|
84 |
+
color: #000000;
|
85 |
+
background: #b1dcfb;
|
86 |
+
background: #ee2200;
|
87 |
+
border-color: #ee2200;
|
88 |
+
cursor: pointer;
|
89 |
+
color: #ffffff;
|
90 |
+
outline: none;
|
91 |
+
}
|
92 |
+
.picker--time .picker__button--clear:before {
|
93 |
+
top: -0.25em;
|
94 |
+
color: #666;
|
95 |
+
font-size: 1.25em;
|
96 |
+
font-weight: bold;
|
97 |
+
}
|
98 |
+
.picker--time .picker__button--clear:hover:before,
|
99 |
+
.picker--time .picker__button--clear:focus:before {
|
100 |
+
color: #ffffff;
|
101 |
+
border-color: #ffffff;
|
102 |
+
}
|
103 |
+
|
104 |
+
/* ==========================================================================
|
105 |
+
$CLASSIC-TIME-PICKER
|
106 |
+
========================================================================== */
|
107 |
+
/**
|
108 |
+
* Note: the root picker element should __NOT__ be styled
|
109 |
+
* more than what’s here. Style the `.picker__holder` instead.
|
110 |
+
*/
|
111 |
+
.picker--time {
|
112 |
+
min-width: 256px;
|
113 |
+
max-width: 320px;
|
114 |
+
}
|
115 |
+
/**
|
116 |
+
* The holder is the base of the picker.
|
117 |
+
*/
|
118 |
+
.picker--time .picker__holder {
|
119 |
+
background: #f2f2f2;
|
120 |
+
}
|
121 |
+
@media (min-height: 40.125em) {
|
122 |
+
.picker--time .picker__holder {
|
123 |
+
font-size: .875em;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
/**
|
127 |
+
* The box contains the list of times.
|
128 |
+
*/
|
129 |
+
.picker--time .picker__box {
|
130 |
+
padding: 0;
|
131 |
+
position: relative;
|
132 |
+
}
|
js/lib/themes/default.css
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ==========================================================================
|
2 |
+
$BASE-PICKER
|
3 |
+
========================================================================== */
|
4 |
+
/**
|
5 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
6 |
+
*/
|
7 |
+
.picker {
|
8 |
+
font-size: 16px;
|
9 |
+
text-align: left;
|
10 |
+
line-height: 1.2;
|
11 |
+
color: #000000;
|
12 |
+
position: absolute;
|
13 |
+
z-index: 10000;
|
14 |
+
-webkit-user-select: none;
|
15 |
+
-moz-user-select: none;
|
16 |
+
-ms-user-select: none;
|
17 |
+
user-select: none;
|
18 |
+
}
|
19 |
+
/**
|
20 |
+
* The picker input element.
|
21 |
+
*/
|
22 |
+
.picker__input {
|
23 |
+
cursor: default;
|
24 |
+
}
|
25 |
+
/**
|
26 |
+
* When the picker is opened, the input element is “activated”.
|
27 |
+
*/
|
28 |
+
.picker__input.picker__input--active {
|
29 |
+
border-color: #0089ec;
|
30 |
+
}
|
31 |
+
/**
|
32 |
+
* The holder is the only “scrollable” top-level container element.
|
33 |
+
*/
|
34 |
+
.picker__holder {
|
35 |
+
width: 100%;
|
36 |
+
overflow-y: auto;
|
37 |
+
-webkit-overflow-scrolling: touch;
|
38 |
+
}
|
39 |
+
|
40 |
+
/*!
|
41 |
+
* Default mobile-first, responsive styling for pickadate.js
|
42 |
+
* Demo: http://amsul.github.io/pickadate.js
|
43 |
+
*/
|
44 |
+
/**
|
45 |
+
* Note: the root picker element should *NOT* be styled more than what’s here.
|
46 |
+
*/
|
47 |
+
/**
|
48 |
+
* Make the holder and frame fullscreen.
|
49 |
+
*/
|
50 |
+
.picker__holder,
|
51 |
+
.picker__frame {
|
52 |
+
top: 0;
|
53 |
+
bottom: 0;
|
54 |
+
left: 0;
|
55 |
+
right: 0;
|
56 |
+
-webkit-transform: translateY(100%);
|
57 |
+
-ms-transform: translateY(100%);
|
58 |
+
transform: translateY(100%);
|
59 |
+
}
|
60 |
+
/**
|
61 |
+
* The holder should overlay the entire screen.
|
62 |
+
*/
|
63 |
+
.picker__holder {
|
64 |
+
position: fixed;
|
65 |
+
transition: background 0.15s ease-out, -webkit-transform 0s 0.15s;
|
66 |
+
transition: background 0.15s ease-out, transform 0s 0.15s;
|
67 |
+
-webkit-backface-visibility: hidden;
|
68 |
+
}
|
69 |
+
/**
|
70 |
+
* The frame that bounds the box contents of the picker.
|
71 |
+
*/
|
72 |
+
.picker__frame {
|
73 |
+
position: absolute;
|
74 |
+
margin: 0 auto;
|
75 |
+
min-width: 256px;
|
76 |
+
max-width: 666px;
|
77 |
+
width: 100%;
|
78 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
79 |
+
filter: alpha(opacity=0);
|
80 |
+
-moz-opacity: 0;
|
81 |
+
opacity: 0;
|
82 |
+
transition: all 0.15s ease-out;
|
83 |
+
}
|
84 |
+
@media (min-height: 33.875em) {
|
85 |
+
.picker__frame {
|
86 |
+
overflow: visible;
|
87 |
+
top: auto;
|
88 |
+
bottom: -100%;
|
89 |
+
max-height: 80%;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
@media (min-height: 40.125em) {
|
93 |
+
.picker__frame {
|
94 |
+
margin-bottom: 7.5%;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
/**
|
98 |
+
* The wrapper sets the stage to vertically align the box contents.
|
99 |
+
*/
|
100 |
+
.picker__wrap {
|
101 |
+
display: table;
|
102 |
+
width: 100%;
|
103 |
+
height: 100%;
|
104 |
+
}
|
105 |
+
@media (min-height: 33.875em) {
|
106 |
+
.picker__wrap {
|
107 |
+
display: block;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
/**
|
111 |
+
* The box contains all the picker contents.
|
112 |
+
*/
|
113 |
+
.picker__box {
|
114 |
+
background: #ffffff;
|
115 |
+
display: table-cell;
|
116 |
+
vertical-align: middle;
|
117 |
+
}
|
118 |
+
@media (min-height: 26.5em) {
|
119 |
+
.picker__box {
|
120 |
+
font-size: 1.25em;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
@media (min-height: 33.875em) {
|
124 |
+
.picker__box {
|
125 |
+
display: block;
|
126 |
+
font-size: 1.33em;
|
127 |
+
border: 1px solid #777777;
|
128 |
+
border-top-color: #898989;
|
129 |
+
border-bottom-width: 0;
|
130 |
+
border-radius: 5px 5px 0 0;
|
131 |
+
box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24);
|
132 |
+
}
|
133 |
+
}
|
134 |
+
@media (min-height: 40.125em) {
|
135 |
+
.picker__box {
|
136 |
+
font-size: 1.5em;
|
137 |
+
border-bottom-width: 1px;
|
138 |
+
border-radius: 5px;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
/**
|
142 |
+
* When the picker opens...
|
143 |
+
*/
|
144 |
+
.picker--opened .picker__holder {
|
145 |
+
-webkit-transform: translateY(0);
|
146 |
+
-ms-transform: translateY(0);
|
147 |
+
transform: translateY(0);
|
148 |
+
background: transparent;
|
149 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#1E000000,endColorstr=#1E000000)";
|
150 |
+
zoom: 1;
|
151 |
+
background: rgba(0, 0, 0, 0.32);
|
152 |
+
transition: background 0.15s ease-out;
|
153 |
+
}
|
154 |
+
.picker--opened .picker__frame {
|
155 |
+
-webkit-transform: translateY(0);
|
156 |
+
-ms-transform: translateY(0);
|
157 |
+
transform: translateY(0);
|
158 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
159 |
+
filter: alpha(opacity=100);
|
160 |
+
-moz-opacity: 1;
|
161 |
+
opacity: 1;
|
162 |
+
}
|
163 |
+
@media (min-height: 33.875em) {
|
164 |
+
.picker--opened .picker__frame {
|
165 |
+
top: auto;
|
166 |
+
bottom: 0;
|
167 |
+
}
|
168 |
+
}
|
js/lib/themes/default.date.css
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ==========================================================================
|
2 |
+
$BASE-DATE-PICKER
|
3 |
+
========================================================================== */
|
4 |
+
/**
|
5 |
+
* The picker box.
|
6 |
+
*/
|
7 |
+
.picker__box {
|
8 |
+
padding: 0 1em;
|
9 |
+
}
|
10 |
+
/**
|
11 |
+
* The header containing the month and year stuff.
|
12 |
+
*/
|
13 |
+
.picker__header {
|
14 |
+
text-align: center;
|
15 |
+
position: relative;
|
16 |
+
margin-top: .75em;
|
17 |
+
}
|
18 |
+
/**
|
19 |
+
* The month and year labels.
|
20 |
+
*/
|
21 |
+
.picker__month,
|
22 |
+
.picker__year {
|
23 |
+
font-weight: 500;
|
24 |
+
display: inline-block;
|
25 |
+
margin-left: .25em;
|
26 |
+
margin-right: .25em;
|
27 |
+
}
|
28 |
+
.picker__year {
|
29 |
+
color: #999999;
|
30 |
+
font-size: .8em;
|
31 |
+
font-style: italic;
|
32 |
+
}
|
33 |
+
/**
|
34 |
+
* The month and year selectors.
|
35 |
+
*/
|
36 |
+
.picker__select--month,
|
37 |
+
.picker__select--year {
|
38 |
+
border: 1px solid #b7b7b7;
|
39 |
+
height: 2em;
|
40 |
+
padding: .5em;
|
41 |
+
margin-left: .25em;
|
42 |
+
margin-right: .25em;
|
43 |
+
}
|
44 |
+
@media (min-width: 24.5em) {
|
45 |
+
.picker__select--month,
|
46 |
+
.picker__select--year {
|
47 |
+
margin-top: -0.5em;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
.picker__select--month {
|
51 |
+
width: 35%;
|
52 |
+
}
|
53 |
+
.picker__select--year {
|
54 |
+
width: 22.5%;
|
55 |
+
}
|
56 |
+
.picker__select--month:focus,
|
57 |
+
.picker__select--year:focus {
|
58 |
+
border-color: #0089ec;
|
59 |
+
}
|
60 |
+
/**
|
61 |
+
* The month navigation buttons.
|
62 |
+
*/
|
63 |
+
.picker__nav--prev,
|
64 |
+
.picker__nav--next {
|
65 |
+
position: absolute;
|
66 |
+
padding: .5em 1.25em;
|
67 |
+
width: 1em;
|
68 |
+
height: 1em;
|
69 |
+
box-sizing: content-box;
|
70 |
+
top: -0.25em;
|
71 |
+
}
|
72 |
+
@media (min-width: 24.5em) {
|
73 |
+
.picker__nav--prev,
|
74 |
+
.picker__nav--next {
|
75 |
+
top: -0.33em;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
.picker__nav--prev {
|
79 |
+
left: -1em;
|
80 |
+
padding-right: 1.25em;
|
81 |
+
}
|
82 |
+
@media (min-width: 24.5em) {
|
83 |
+
.picker__nav--prev {
|
84 |
+
padding-right: 1.5em;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
.picker__nav--next {
|
88 |
+
right: -1em;
|
89 |
+
padding-left: 1.25em;
|
90 |
+
}
|
91 |
+
@media (min-width: 24.5em) {
|
92 |
+
.picker__nav--next {
|
93 |
+
padding-left: 1.5em;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
.picker__nav--prev:before,
|
97 |
+
.picker__nav--next:before {
|
98 |
+
content: " ";
|
99 |
+
border-top: .5em solid transparent;
|
100 |
+
border-bottom: .5em solid transparent;
|
101 |
+
border-right: 0.75em solid #000000;
|
102 |
+
width: 0;
|
103 |
+
height: 0;
|
104 |
+
display: block;
|
105 |
+
margin: 0 auto;
|
106 |
+
}
|
107 |
+
.picker__nav--next:before {
|
108 |
+
border-right: 0;
|
109 |
+
border-left: 0.75em solid #000000;
|
110 |
+
}
|
111 |
+
.picker__nav--prev:hover,
|
112 |
+
.picker__nav--next:hover {
|
113 |
+
cursor: pointer;
|
114 |
+
color: #000000;
|
115 |
+
background: #b1dcfb;
|
116 |
+
}
|
117 |
+
.picker__nav--disabled,
|
118 |
+
.picker__nav--disabled:hover,
|
119 |
+
.picker__nav--disabled:before,
|
120 |
+
.picker__nav--disabled:before:hover {
|
121 |
+
cursor: default;
|
122 |
+
background: none;
|
123 |
+
border-right-color: #f5f5f5;
|
124 |
+
border-left-color: #f5f5f5;
|
125 |
+
}
|
126 |
+
/**
|
127 |
+
* The calendar table of dates
|
128 |
+
*/
|
129 |
+
.picker__table {
|
130 |
+
text-align: center;
|
131 |
+
border-collapse: collapse;
|
132 |
+
border-spacing: 0;
|
133 |
+
table-layout: fixed;
|
134 |
+
font-size: inherit;
|
135 |
+
width: 100%;
|
136 |
+
margin-top: .75em;
|
137 |
+
margin-bottom: .5em;
|
138 |
+
}
|
139 |
+
@media (min-height: 33.875em) {
|
140 |
+
.picker__table {
|
141 |
+
margin-bottom: .75em;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
.picker__table td {
|
145 |
+
margin: 0;
|
146 |
+
padding: 0;
|
147 |
+
}
|
148 |
+
/**
|
149 |
+
* The weekday labels
|
150 |
+
*/
|
151 |
+
.picker__weekday {
|
152 |
+
width: 14.285714286%;
|
153 |
+
font-size: .75em;
|
154 |
+
padding-bottom: .25em;
|
155 |
+
color: #999999;
|
156 |
+
font-weight: 500;
|
157 |
+
/* Increase the spacing a tad */
|
158 |
+
}
|
159 |
+
@media (min-height: 33.875em) {
|
160 |
+
.picker__weekday {
|
161 |
+
padding-bottom: .5em;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
/**
|
165 |
+
* The days on the calendar
|
166 |
+
*/
|
167 |
+
.picker__day {
|
168 |
+
padding: .3125em 0;
|
169 |
+
font-weight: 200;
|
170 |
+
border: 1px solid transparent;
|
171 |
+
}
|
172 |
+
.picker__day--today {
|
173 |
+
position: relative;
|
174 |
+
}
|
175 |
+
.picker__day--today:before {
|
176 |
+
content: " ";
|
177 |
+
position: absolute;
|
178 |
+
top: 2px;
|
179 |
+
right: 2px;
|
180 |
+
width: 0;
|
181 |
+
height: 0;
|
182 |
+
border-top: 0.5em solid #0059bc;
|
183 |
+
border-left: .5em solid transparent;
|
184 |
+
}
|
185 |
+
.picker__day--disabled:before {
|
186 |
+
border-top-color: #aaaaaa;
|
187 |
+
}
|
188 |
+
.picker__day--outfocus {
|
189 |
+
color: #dddddd;
|
190 |
+
}
|
191 |
+
.picker__day--infocus:hover,
|
192 |
+
.picker__day--outfocus:hover {
|
193 |
+
cursor: pointer;
|
194 |
+
color: #000000;
|
195 |
+
background: #b1dcfb;
|
196 |
+
}
|
197 |
+
.picker__day--highlighted {
|
198 |
+
border-color: #0089ec;
|
199 |
+
}
|
200 |
+
.picker__day--highlighted:hover,
|
201 |
+
.picker--focused .picker__day--highlighted {
|
202 |
+
cursor: pointer;
|
203 |
+
color: #000000;
|
204 |
+
background: #b1dcfb;
|
205 |
+
}
|
206 |
+
.picker__day--selected,
|
207 |
+
.picker__day--selected:hover,
|
208 |
+
.picker--focused .picker__day--selected {
|
209 |
+
background: #0089ec;
|
210 |
+
color: #ffffff;
|
211 |
+
}
|
212 |
+
.picker__day--disabled,
|
213 |
+
.picker__day--disabled:hover,
|
214 |
+
.picker--focused .picker__day--disabled {
|
215 |
+
background: #f5f5f5;
|
216 |
+
border-color: #f5f5f5;
|
217 |
+
color: #dddddd;
|
218 |
+
cursor: default;
|
219 |
+
}
|
220 |
+
.picker__day--highlighted.picker__day--disabled,
|
221 |
+
.picker__day--highlighted.picker__day--disabled:hover {
|
222 |
+
background: #bbbbbb;
|
223 |
+
}
|
224 |
+
/**
|
225 |
+
* The footer containing the "today", "clear", and "close" buttons.
|
226 |
+
*/
|
227 |
+
.picker__footer {
|
228 |
+
text-align: center;
|
229 |
+
}
|
230 |
+
.picker__button--today,
|
231 |
+
.picker__button--clear,
|
232 |
+
.picker__button--close {
|
233 |
+
border: 1px solid #ffffff;
|
234 |
+
background: #ffffff;
|
235 |
+
font-size: .8em;
|
236 |
+
padding: .66em 0;
|
237 |
+
font-weight: bold;
|
238 |
+
width: 33%;
|
239 |
+
display: inline-block;
|
240 |
+
vertical-align: bottom;
|
241 |
+
}
|
242 |
+
.picker__button--today:hover,
|
243 |
+
.picker__button--clear:hover,
|
244 |
+
.picker__button--close:hover {
|
245 |
+
cursor: pointer;
|
246 |
+
color: #000000;
|
247 |
+
background: #b1dcfb;
|
248 |
+
border-bottom-color: #b1dcfb;
|
249 |
+
}
|
250 |
+
.picker__button--today:focus,
|
251 |
+
.picker__button--clear:focus,
|
252 |
+
.picker__button--close:focus {
|
253 |
+
background: #b1dcfb;
|
254 |
+
border-color: #0089ec;
|
255 |
+
outline: none;
|
256 |
+
}
|
257 |
+
.picker__button--today:before,
|
258 |
+
.picker__button--clear:before,
|
259 |
+
.picker__button--close:before {
|
260 |
+
position: relative;
|
261 |
+
display: inline-block;
|
262 |
+
height: 0;
|
263 |
+
}
|
264 |
+
.picker__button--today:before,
|
265 |
+
.picker__button--clear:before {
|
266 |
+
content: " ";
|
267 |
+
margin-right: .45em;
|
268 |
+
}
|
269 |
+
.picker__button--today:before {
|
270 |
+
top: -0.05em;
|
271 |
+
width: 0;
|
272 |
+
border-top: 0.66em solid #0059bc;
|
273 |
+
border-left: .66em solid transparent;
|
274 |
+
}
|
275 |
+
.picker__button--clear:before {
|
276 |
+
top: -0.25em;
|
277 |
+
width: .66em;
|
278 |
+
border-top: 3px solid #ee2200;
|
279 |
+
}
|
280 |
+
.picker__button--close:before {
|
281 |
+
content: "\D7";
|
282 |
+
top: -0.1em;
|
283 |
+
vertical-align: top;
|
284 |
+
font-size: 1.1em;
|
285 |
+
margin-right: .35em;
|
286 |
+
color: #777777;
|
287 |
+
}
|
288 |
+
.picker__button--today[disabled],
|
289 |
+
.picker__button--today[disabled]:hover {
|
290 |
+
background: #f5f5f5;
|
291 |
+
border-color: #f5f5f5;
|
292 |
+
color: #dddddd;
|
293 |
+
cursor: default;
|
294 |
+
}
|
295 |
+
.picker__button--today[disabled]:before {
|
296 |
+
border-top-color: #aaaaaa;
|
297 |
+
}
|
298 |
+
|
299 |
+
/* ==========================================================================
|
300 |
+
$DEFAULT-DATE-PICKER
|
301 |
+
========================================================================== */
|
js/lib/themes/default.time.css
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ==========================================================================
|
2 |
+
$BASE-TIME-PICKER
|
3 |
+
========================================================================== */
|
4 |
+
/**
|
5 |
+
* The list of times.
|
6 |
+
*/
|
7 |
+
.picker__list {
|
8 |
+
list-style: none;
|
9 |
+
padding: 0.75em 0 4.2em;
|
10 |
+
margin: 0;
|
11 |
+
}
|
12 |
+
/**
|
13 |
+
* The times on the clock.
|
14 |
+
*/
|
15 |
+
.picker__list-item {
|
16 |
+
border-bottom: 1px solid #dddddd;
|
17 |
+
border-top: 1px solid #dddddd;
|
18 |
+
margin-bottom: -1px;
|
19 |
+
position: relative;
|
20 |
+
background: #ffffff;
|
21 |
+
padding: .75em 1.25em;
|
22 |
+
}
|
23 |
+
@media (min-height: 46.75em) {
|
24 |
+
.picker__list-item {
|
25 |
+
padding: .5em 1em;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
/* Hovered time */
|
29 |
+
.picker__list-item:hover {
|
30 |
+
cursor: pointer;
|
31 |
+
color: #000000;
|
32 |
+
background: #b1dcfb;
|
33 |
+
border-color: #0089ec;
|
34 |
+
z-index: 10;
|
35 |
+
}
|
36 |
+
/* Highlighted and hovered/focused time */
|
37 |
+
.picker__list-item--highlighted {
|
38 |
+
border-color: #0089ec;
|
39 |
+
z-index: 10;
|
40 |
+
}
|
41 |
+
.picker__list-item--highlighted:hover,
|
42 |
+
.picker--focused .picker__list-item--highlighted {
|
43 |
+
cursor: pointer;
|
44 |
+
color: #000000;
|
45 |
+
background: #b1dcfb;
|
46 |
+
}
|
47 |
+
/* Selected and hovered/focused time */
|
48 |
+
.picker__list-item--selected,
|
49 |
+
.picker__list-item--selected:hover,
|
50 |
+
.picker--focused .picker__list-item--selected {
|
51 |
+
background: #0089ec;
|
52 |
+
color: #ffffff;
|
53 |
+
z-index: 10;
|
54 |
+
}
|
55 |
+
/* Disabled time */
|
56 |
+
.picker__list-item--disabled,
|
57 |
+
.picker__list-item--disabled:hover,
|
58 |
+
.picker--focused .picker__list-item--disabled {
|
59 |
+
background: #f5f5f5;
|
60 |
+
border-color: #f5f5f5;
|
61 |
+
color: #dddddd;
|
62 |
+
cursor: default;
|
63 |
+
border-color: #dddddd;
|
64 |
+
z-index: auto;
|
65 |
+
}
|
66 |
+
/**
|
67 |
+
* The clear button
|
68 |
+
*/
|
69 |
+
.picker--time .picker__button--clear {
|
70 |
+
display: block;
|
71 |
+
width: 80%;
|
72 |
+
margin: 1em auto 0;
|
73 |
+
padding: 1em 1.25em;
|
74 |
+
background: none;
|
75 |
+
border: 0;
|
76 |
+
font-weight: 500;
|
77 |
+
font-size: .67em;
|
78 |
+
text-align: center;
|
79 |
+
text-transform: uppercase;
|
80 |
+
color: #666;
|
81 |
+
}
|
82 |
+
.picker--time .picker__button--clear:hover,
|
83 |
+
.picker--time .picker__button--clear:focus {
|
84 |
+
color: #000000;
|
85 |
+
background: #b1dcfb;
|
86 |
+
background: #ee2200;
|
87 |
+
border-color: #ee2200;
|
88 |
+
cursor: pointer;
|
89 |
+
color: #ffffff;
|
90 |
+
outline: none;
|
91 |
+
}
|
92 |
+
.picker--time .picker__button--clear:before {
|
93 |
+
top: -0.25em;
|
94 |
+
color: #666;
|
95 |
+
font-size: 1.25em;
|
96 |
+
font-weight: bold;
|
97 |
+
}
|
98 |
+
.picker--time .picker__button--clear:hover:before,
|
99 |
+
.picker--time .picker__button--clear:focus:before {
|
100 |
+
color: #ffffff;
|
101 |
+
border-color: #ffffff;
|
102 |
+
}
|
103 |
+
|
104 |
+
/* ==========================================================================
|
105 |
+
$DEFAULT-TIME-PICKER
|
106 |
+
========================================================================== */
|
107 |
+
/**
|
108 |
+
* The frame the bounds the time picker.
|
109 |
+
*/
|
110 |
+
.picker--time .picker__frame {
|
111 |
+
min-width: 256px;
|
112 |
+
max-width: 320px;
|
113 |
+
}
|
114 |
+
/**
|
115 |
+
* The picker box.
|
116 |
+
*/
|
117 |
+
.picker--time .picker__box {
|
118 |
+
font-size: 1em;
|
119 |
+
background: #f2f2f2;
|
120 |
+
padding: 0;
|
121 |
+
}
|
122 |
+
@media (min-height: 40.125em) {
|
123 |
+
.picker--time .picker__box {
|
124 |
+
margin-bottom: 5em;
|
125 |
+
}
|
126 |
+
}
|
js/lib/themes/rtl.css
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Styling for RTL (right-to-left) languages using pickadate.js
|
3 |
+
*/
|
4 |
+
/**
|
5 |
+
* Switch the direction - only really necessary if
|
6 |
+
* it hasn’t already been applied higher up in the DOM.
|
7 |
+
*/
|
8 |
+
.picker {
|
9 |
+
direction: rtl;
|
10 |
+
}
|
11 |
+
/**
|
12 |
+
* Flip around the “next” and “previous” buttons.
|
13 |
+
*/
|
14 |
+
.picker__nav--next {
|
15 |
+
right: auto;
|
16 |
+
left: -1em;
|
17 |
+
}
|
18 |
+
.picker__nav--prev {
|
19 |
+
left: auto;
|
20 |
+
right: -1em;
|
21 |
+
}
|
22 |
+
.picker__nav--next:before {
|
23 |
+
border-left: 0;
|
24 |
+
border-right: 0.75em solid #000000;
|
25 |
+
}
|
26 |
+
.picker__nav--prev:before {
|
27 |
+
border-right: 0;
|
28 |
+
border-left: 0.75em solid #000000;
|
29 |
+
}
|
js/lib/translations/FORMATTING.md
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### The following convention is used for choosing a format for the translation files:
|
2 |
+
|
3 |
+
1. Google for “Microsoft Style Guide LANGUAGE COUNTRY”.
|
4 |
+
2. Check the standard suggestions for Long Date Formats.
|
5 |
+
3. Set this as the `format` option using [pickadate’s formatting rules](http://amsul.ca/pickadate.js/date.htm#formatting-rules).
|
6 |
+
|
7 |
+
Make sure `formatSubmit` is always `yyyy/mm/dd` to ensure our servers always get the value formatted the same.
|
js/lib/translations/NAMING.md
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### The following convention is used for naming the translation files:
|
2 |
+
|
3 |
+
```
|
4 |
+
LANGUAGE_COUNTRY.js
|
5 |
+
```
|
6 |
+
|
7 |
+
#### Where:
|
8 |
+
|
9 |
+
```
|
10 |
+
LANGUAGE = The lowercase ISO 639-1 language code.
|
11 |
+
```
|
12 |
+
|
13 |
+
> See http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
14 |
+
|
15 |
+
```
|
16 |
+
COUNTRY = The uppercase ISO 3166-1 country code.
|
17 |
+
```
|
18 |
+
|
19 |
+
> See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
20 |
+
|
21 |
+
When there is no `COUNTRY` in the filename, it is assumed the generic language is used in multiple countries.
|
js/lib/translations/ar.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Arabic
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر' ],
|
5 |
+
monthsShort: [ 'يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر' ],
|
6 |
+
weekdaysFull: [ 'الاحد', 'الاثنين', 'الثلاثاء', 'الاربعاء', 'الخميس', 'الجمعة', 'السبت' ],
|
7 |
+
weekdaysShort: [ 'الاحد', 'الاثنين', 'الثلاثاء', 'الاربعاء', 'الخميس', 'الجمعة', 'السبت' ],
|
8 |
+
today: 'اليوم',
|
9 |
+
clear: 'مسح',
|
10 |
+
format: 'yyyy mmmm dd',
|
11 |
+
formatSubmit: 'yyyy/mm/dd'
|
12 |
+
});
|
13 |
+
|
14 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
15 |
+
clear: 'مسح'
|
16 |
+
});
|
js/lib/translations/bg_BG.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Bulgarian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'януари','февруари','март','април','май','юни','юли','август','септември','октомври','ноември','декември' ],
|
5 |
+
monthsShort: [ 'янр','фев','мар','апр','май','юни','юли','авг','сеп','окт','ное','дек' ],
|
6 |
+
weekdaysFull: [ 'неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота' ],
|
7 |
+
weekdaysShort: [ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб' ],
|
8 |
+
today: 'днес',
|
9 |
+
clear: 'изтривам',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd mmmm yyyy г.',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'изтривам'
|
17 |
+
});
|
js/lib/translations/bs_BA.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Bosnian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'cetvrtak', 'petak', 'subota' ],
|
7 |
+
weekdaysShort: [ 'ne', 'po', 'ut', 'sr', 'če', 'pe', 'su' ],
|
8 |
+
today: 'danas',
|
9 |
+
clear: 'izbrisati',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'dd. mmmm yyyy.',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'izbrisati'
|
17 |
+
});
|
js/lib/translations/ca_ES.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Catalan
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Gener', 'Febrer', 'Març', 'Abril', 'Maig', 'juny', 'Juliol', 'Agost', 'Setembre', 'Octubre', 'Novembre', 'Desembre' ],
|
5 |
+
monthsShort: [ 'Gen', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Oct', 'Nov', 'Des' ],
|
6 |
+
weekdaysFull: [ 'diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte' ],
|
7 |
+
weekdaysShort: [ 'diu', 'dil', 'dim', 'dmc', 'dij', 'div', 'dis' ],
|
8 |
+
today: 'avui',
|
9 |
+
clear: 'esborrar',
|
10 |
+
close: 'tancar',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dddd d !de mmmm !de yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'esborrar'
|
18 |
+
});
|
js/lib/translations/cs_CZ.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Czech
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec' ],
|
5 |
+
monthsShort: [ 'led', 'úno', 'bře', 'dub', 'kvě', 'čer', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro' ],
|
6 |
+
weekdaysFull: [ 'neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota' ],
|
7 |
+
weekdaysShort: [ 'ne', 'po', 'út', 'st', 'čt', 'pá', 'so' ],
|
8 |
+
today: 'dnes',
|
9 |
+
clear: 'vymazat',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd. mmmm yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'vymazat'
|
17 |
+
});
|
js/lib/translations/da_DK.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Danish
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag' ],
|
7 |
+
weekdaysShort: [ 'søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør' ],
|
8 |
+
today: 'i dag',
|
9 |
+
clear: 'slet',
|
10 |
+
close: 'luk',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'd. mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'slet'
|
18 |
+
});
|
js/lib/translations/de_DE.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// German
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' ],
|
5 |
+
monthsShort: [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ],
|
6 |
+
weekdaysFull: [ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag' ],
|
7 |
+
weekdaysShort: [ 'So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa' ],
|
8 |
+
today: 'Heute',
|
9 |
+
clear: 'Löschen',
|
10 |
+
close: 'Schließen',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dddd, dd. mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'Löschen'
|
18 |
+
});
|
js/lib/translations/el_GR.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Greek
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ],
|
5 |
+
monthsShort: [ 'Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαι', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ' ],
|
6 |
+
weekdaysFull: [ 'Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο' ],
|
7 |
+
weekdaysShort: [ 'Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ' ],
|
8 |
+
today: 'σήμερα',
|
9 |
+
clear: 'Διαγραφή',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd mmmm yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'Διαγραφή'
|
17 |
+
});
|
js/lib/translations/es_ES.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Spanish
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre' ],
|
5 |
+
monthsShort: [ 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic' ],
|
6 |
+
weekdaysFull: [ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado' ],
|
7 |
+
weekdaysShort: [ 'dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb' ],
|
8 |
+
today: 'hoy',
|
9 |
+
clear: 'borrar',
|
10 |
+
close: 'cerrar',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dddd d !de mmmm !de yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'borrar'
|
18 |
+
});
|
js/lib/translations/et_EE.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Estonian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'jaanuar', 'veebruar', 'märts', 'aprill', 'mai', 'juuni', 'juuli', 'august', 'september', 'oktoober', 'november', 'detsember' ],
|
5 |
+
monthsShort: [ 'jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets' ],
|
6 |
+
weekdaysFull: [ 'pühapäev', 'esmaspäev', 'teisipäev', 'kolmapäev', 'neljapäev', 'reede', 'laupäev' ],
|
7 |
+
weekdaysShort: [ 'püh', 'esm', 'tei', 'kol', 'nel', 'ree', 'lau' ],
|
8 |
+
today: 'täna',
|
9 |
+
clear: 'kustutama',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd. mmmm yyyy. a',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'kustutama'
|
17 |
+
});
|
js/lib/translations/eu_ES.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Basque
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'urtarrila', 'otsaila', 'martxoa', 'apirila', 'maiatza', 'ekaina', 'uztaila', 'abuztua', 'iraila', 'urria', 'azaroa', 'abendua' ],
|
5 |
+
monthsShort: [ 'urt', 'ots', 'mar', 'api', 'mai', 'eka', 'uzt', 'abu', 'ira', 'urr', 'aza', 'abe' ],
|
6 |
+
weekdaysFull: [ 'igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata' ],
|
7 |
+
weekdaysShort: [ 'ig.', 'al.', 'ar.', 'az.', 'og.', 'or.', 'lr.' ],
|
8 |
+
today: 'gaur',
|
9 |
+
clear: 'garbitu',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'dddd, yyyy(e)ko mmmmren da',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'garbitu'
|
17 |
+
});
|
js/lib/translations/fa_ir.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Farsi
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
|
5 |
+
monthsShort: [ 'ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر' ],
|
6 |
+
weekdaysFull: [ 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' ],
|
7 |
+
weekdaysShort: [ 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' ],
|
8 |
+
today: 'امروز',
|
9 |
+
clear: 'پاک کردن',
|
10 |
+
close: 'بستن',
|
11 |
+
format: 'yyyy mmmm dd',
|
12 |
+
formatSubmit: 'yyyy/mm/dd',
|
13 |
+
labelMonthNext: 'ماه بعدی',
|
14 |
+
labelMonthPrev: 'ماه قبلی'
|
15 |
+
});
|
16 |
+
|
17 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
18 |
+
clear: 'پاک کردن'
|
19 |
+
});
|
js/lib/translations/fi_FI.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Finnish
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu' ],
|
5 |
+
monthsShort: [ 'tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu' ],
|
6 |
+
weekdaysFull: [ 'sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai' ],
|
7 |
+
weekdaysShort: [ 'su', 'ma', 'ti', 'ke', 'to', 'pe', 'la' ],
|
8 |
+
today: 'tänään',
|
9 |
+
clear: 'tyhjennä',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd.m.yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'tyhjennä'
|
17 |
+
});
|
js/lib/translations/fr_FR.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// French
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ],
|
5 |
+
monthsShort: [ 'Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec' ],
|
6 |
+
weekdaysFull: [ 'Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi' ],
|
7 |
+
weekdaysShort: [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ],
|
8 |
+
today: 'Aujourd\'hui',
|
9 |
+
clear: 'Effacer',
|
10 |
+
close: 'Fermer',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dd mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd',
|
14 |
+
labelMonthNext:"Mois suivant",
|
15 |
+
labelMonthPrev:"Mois précédent",
|
16 |
+
labelMonthSelect:"Sélectionner un mois",
|
17 |
+
labelYearSelect:"Sélectionner une année"
|
18 |
+
});
|
19 |
+
|
20 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
21 |
+
clear: 'Effacer'
|
22 |
+
});
|
js/lib/translations/gl_ES.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Galician
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Xaneiro', 'Febreiro', 'Marzo', 'Abril', 'Maio', 'Xuño', 'Xullo', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Decembro' ],
|
5 |
+
monthsShort: [ 'xan', 'feb', 'mar', 'abr', 'mai', 'xun', 'xul', 'ago', 'sep', 'out', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado' ],
|
7 |
+
weekdaysShort: [ 'dom', 'lun', 'mar', 'mér', 'xov', 'ven', 'sab' ],
|
8 |
+
today: 'hoxe',
|
9 |
+
clear: 'borrar',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'dddd d !de mmmm !de yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'borrar'
|
17 |
+
});
|
js/lib/translations/he_IL.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Hebrew
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר' ],
|
5 |
+
monthsShort: [ 'ינו', 'פבר', 'מרץ', 'אפר', 'מאי', 'יונ', 'יול', 'אוג', 'ספט', 'אוק', 'נוב', 'דצמ' ],
|
6 |
+
weekdaysFull: [ 'יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום ששי', 'יום שבת' ],
|
7 |
+
weekdaysShort: [ 'א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש' ],
|
8 |
+
today: 'היום',
|
9 |
+
clear: 'למחוק',
|
10 |
+
format: 'yyyy mmmmב d dddd',
|
11 |
+
formatSubmit: 'yyyy/mm/dd'
|
12 |
+
});
|
13 |
+
|
14 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
15 |
+
clear: 'למחוק'
|
16 |
+
});
|
js/lib/translations/hi_IN.js
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
2 |
+
monthsFull: [ 'जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर' ],
|
3 |
+
monthsShort: [ 'जन', 'फर', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जु', 'अग', 'सित', 'अक्टू', 'नव', 'दिस' ],
|
4 |
+
weekdaysFull: [ 'रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार' ],
|
5 |
+
weekdaysShort: [ 'रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र','शनि' ],
|
6 |
+
today: 'आज की तारीख चयन करें',
|
7 |
+
clear: 'चुनी हुई तारीख को मिटाएँ',
|
8 |
+
close: 'विंडो बंद करे',
|
9 |
+
firstDay: 1,
|
10 |
+
format: 'dd/mm/yyyy',
|
11 |
+
formatSubmit: 'yyyy/mm/dd',
|
12 |
+
labelMonthNext: 'अगले माह का चयन करें',
|
13 |
+
labelMonthPrev: 'पिछले माह का चयन करें',
|
14 |
+
labelMonthSelect: 'किसि एक महीने का चयन करें',
|
15 |
+
labelYearSelect: 'किसि एक वर्ष का चयन करें'
|
16 |
+
});
|
17 |
+
|
18 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
19 |
+
clear: 'चुनी हुई तारीख को मिटाएँ'
|
20 |
+
});
|
js/lib/translations/hr_HR.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Croatian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'sijećanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac' ],
|
5 |
+
monthsShort: [ 'sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro' ],
|
6 |
+
weekdaysFull: [ 'nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota' ],
|
7 |
+
weekdaysShort: [ 'ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub' ],
|
8 |
+
today: 'danas',
|
9 |
+
clear: 'izbrisati',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd. mmmm yyyy.',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'izbrisati'
|
17 |
+
});
|
js/lib/translations/hu_HU.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Hungarian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december' ],
|
5 |
+
monthsShort: [ 'jan', 'febr', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat' ],
|
7 |
+
weekdaysShort: [ 'V', 'H', 'K', 'SZe', 'CS', 'P', 'SZo' ],
|
8 |
+
today: 'Ma',
|
9 |
+
clear: 'Törlés',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'yyyy. mmmm dd.',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'Törlés'
|
17 |
+
});
|
js/lib/translations/id_ID.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Indonesian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember' ],
|
5 |
+
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des' ],
|
6 |
+
weekdaysFull: [ 'Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu' ],
|
7 |
+
weekdaysShort: [ 'Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab' ],
|
8 |
+
today: 'hari ini',
|
9 |
+
clear: 'menghapus',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'd mmmm yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'menghapus'
|
17 |
+
});
|
js/lib/translations/is_IS.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Icelandic
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'maí', 'jún', 'júl', 'ágú', 'sep', 'okt', 'nóv', 'des' ],
|
6 |
+
weekdaysFull: [ 'sunnudagur', 'mánudagur', 'þriðjudagur', 'miðvikudagur', 'fimmtudagur', 'föstudagur', 'laugardagur' ],
|
7 |
+
weekdaysShort: [ 'sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau' ],
|
8 |
+
today: 'Í dag',
|
9 |
+
clear: 'Hreinsa',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'dd. mmmm yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'Hreinsa'
|
17 |
+
});
|
js/lib/translations/it_IT.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Italian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre' ],
|
5 |
+
monthsShort: [ 'gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic' ],
|
6 |
+
weekdaysFull: [ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato' ],
|
7 |
+
weekdaysShort: [ 'dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab' ],
|
8 |
+
today: 'Oggi',
|
9 |
+
clear: 'Cancella',
|
10 |
+
close: 'Chiudi',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dddd d mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd',
|
14 |
+
labelMonthNext: 'Mese successivo',
|
15 |
+
labelMonthPrev: 'Mese precedente',
|
16 |
+
labelMonthSelect: 'Seleziona un mese',
|
17 |
+
labelYearSelect: 'Seleziona un anno'
|
18 |
+
});
|
19 |
+
|
20 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
21 |
+
clear: 'Cancella',
|
22 |
+
format: 'HH:i',
|
23 |
+
formatSubmit: 'HH:i'
|
24 |
+
});
|
js/lib/translations/ja_JP.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Japanese
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月' ],
|
5 |
+
monthsShort: [ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月' ],
|
6 |
+
weekdaysFull: [ '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日' ],
|
7 |
+
weekdaysShort: [ '日', '月', '火', '水', '木', '金', '土' ],
|
8 |
+
today: '今日',
|
9 |
+
clear: '消去',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'yyyy mm dd',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: '消去'
|
17 |
+
});
|
js/lib/translations/ko_KR.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Korean
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월' ],
|
5 |
+
monthsShort: [ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월' ],
|
6 |
+
weekdaysFull: [ '일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일' ],
|
7 |
+
weekdaysShort: [ '일', '월', '화', '수', '목', '금', '토' ],
|
8 |
+
today: '오늘',
|
9 |
+
clear: '취소',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'yyyy 년 mm 월 dd 일',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: '취소'
|
17 |
+
});
|
js/lib/translations/lt_LT.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Lietuviškai
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
labelMonthNext: 'Sekantis mėnuo',
|
5 |
+
labelMonthPrev: 'Ankstesnis mėnuo',
|
6 |
+
labelMonthSelect: 'Pasirinkite mėnesį',
|
7 |
+
labelYearSelect: 'Pasirinkite metus',
|
8 |
+
monthsFull: ['Sausis', 'Vasaris', 'Kovas', 'Balandis', 'Gegužė', 'Birželis', 'Liepa', 'Rugpjūtis', 'Rugsėjis', 'Spalis', 'Lapkritis', 'Gruodis'],
|
9 |
+
monthsShort: ['Sau', 'Vas', 'Kov', 'Bal', 'Geg', 'Bir', 'Lie', 'Rgp', 'Rgs', 'Spa', 'Lap', 'Grd'],
|
10 |
+
weekdaysFull: ['Sekmadienis', 'Pirmadienis', 'Antradienis', 'Trečiadienis', 'Ketvirtadienis', 'Penktadienis', 'Šeštadienis'],
|
11 |
+
weekdaysShort: ['Sk', 'Pr', 'An', 'Tr', 'Kt', 'Pn', 'Št'],
|
12 |
+
today: 'Šiandien',
|
13 |
+
clear: 'Išvalyti',
|
14 |
+
close: 'Uždaryti',
|
15 |
+
firstDay: 1,
|
16 |
+
//format: 'yyyy !m. mmmm d !d.', // need to have diffrent case of full months name
|
17 |
+
format: 'yyyy-mm-dd',
|
18 |
+
formatSubmit: 'yyyy/mm/dd'
|
19 |
+
});
|
20 |
+
|
21 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
22 |
+
clear: 'Išvalyti',
|
23 |
+
format: 'HH:i'
|
24 |
+
});
|
js/lib/translations/lv_LV.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Latvian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Janvāris', 'Februāris', 'Marts', 'Aprīlis', 'Maijs', 'Jūnijs', 'Jūlijs', 'Augusts', 'Septembris', 'Oktobris', 'Novembris', 'Decembris' ],
|
5 |
+
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jūn', 'Jūl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec' ],
|
6 |
+
weekdaysFull: [ 'Svētdiena', 'Pirmdiena', 'Otrdiena', 'Trešdiena', 'Ceturtdiena', 'Piektdiena', 'Sestdiena' ],
|
7 |
+
weekdaysShort: [ 'Sv', 'P', 'O', 'T', 'C', 'Pk', 'S' ],
|
8 |
+
today: 'Šodiena',
|
9 |
+
clear: 'Atcelt',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'yyyy.mm.dd. dddd',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
js/lib/translations/nb_NO.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Norwegian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des' ],
|
6 |
+
weekdaysFull: [ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag' ],
|
7 |
+
weekdaysShort: [ 'søn','man','tir', 'ons', 'tor', 'fre', 'lør' ],
|
8 |
+
today: 'i dag',
|
9 |
+
clear: 'nullstill',
|
10 |
+
close: 'lukk',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dd. mmm. yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'nullstill'
|
18 |
+
});
|
js/lib/translations/ne_NP.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Nepali
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्त', 'सेप्टेम्बर', 'अक्टोबर', 'नोवेम्बर', 'डिसेम्बर' ],
|
5 |
+
monthsShort: [ 'जन', 'फेब्रु', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुल', 'अग', 'सेप्टे', 'अक्टो', 'नोभे', 'डिसे' ],
|
6 |
+
weekdaysFull: [ 'सोमबार', 'मङ्लबार', 'बुधबार', 'बिहीबार', 'शुक्रबार', 'शनिबार', 'आईतबार' ],
|
7 |
+
weekdaysShort: [ 'सोम', 'मंगल्', 'बुध', 'बिही', 'शुक्र', 'शनि', 'आईत' ],
|
8 |
+
numbers: [ '०', '१', '२', '३', '४', '५', '६', '७', '८', '९' ],
|
9 |
+
today: 'आज',
|
10 |
+
clear: 'मेटाउनुहोस्',
|
11 |
+
format: 'dddd, dd mmmm, yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'मेटाउनुहोस्'
|
17 |
+
});
|
js/lib/translations/nl_NL.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Dutch
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'maa', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag' ],
|
7 |
+
weekdaysShort: [ 'zo', 'ma', 'di', 'wo', 'do', 'vr', 'za' ],
|
8 |
+
today: 'vandaag',
|
9 |
+
clear: 'verwijderen',
|
10 |
+
close: 'sluiten',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dddd d mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'verwijderen'
|
18 |
+
});
|
js/lib/translations/pl_PL.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Polish
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień' ],
|
5 |
+
monthsShort: [ 'sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru' ],
|
6 |
+
weekdaysFull: [ 'niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota' ],
|
7 |
+
weekdaysShort: [ 'niedz.', 'pn.', 'wt.', 'śr.', 'cz.', 'pt.', 'sob.' ],
|
8 |
+
today: 'Dzisiaj',
|
9 |
+
clear: 'Usuń',
|
10 |
+
close: 'Zamknij',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'd mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'usunąć'
|
18 |
+
});
|
js/lib/translations/pt_BR.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Brazilian Portuguese
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro' ],
|
5 |
+
monthsShort: [ 'jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez' ],
|
6 |
+
weekdaysFull: [ 'domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado' ],
|
7 |
+
weekdaysShort: [ 'dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sab' ],
|
8 |
+
today: 'hoje',
|
9 |
+
clear: 'limpar',
|
10 |
+
close: 'fechar',
|
11 |
+
format: 'dddd, d !de mmmm !de yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'limpar'
|
17 |
+
});
|
js/lib/translations/pt_PT.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Portuguese
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ],
|
5 |
+
monthsShort: [ 'jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez' ],
|
6 |
+
weekdaysFull: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado' ],
|
7 |
+
weekdaysShort: [ 'dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sab' ],
|
8 |
+
today: 'Hoje',
|
9 |
+
clear: 'Limpar',
|
10 |
+
close: 'Fechar',
|
11 |
+
format: 'd !de mmmm !de yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'Limpar'
|
17 |
+
});
|
js/lib/translations/ro_RO.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Romanian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie' ],
|
5 |
+
monthsShort: [ 'ian', 'feb', 'mar', 'apr', 'mai', 'iun', 'iul', 'aug', 'sep', 'oct', 'noi', 'dec' ],
|
6 |
+
weekdaysFull: [ 'duminică', 'luni', 'marţi', 'miercuri', 'joi', 'vineri', 'sâmbătă' ],
|
7 |
+
weekdaysShort: [ 'D', 'L', 'Ma', 'Mi', 'J', 'V', 'S' ],
|
8 |
+
today: 'azi',
|
9 |
+
clear: 'șterge',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'dd mmmm yyyy',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'șterge'
|
17 |
+
});
|
js/lib/translations/ru_RU.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Russian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря' ],
|
5 |
+
monthsShort: [ 'янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек' ],
|
6 |
+
weekdaysFull: [ 'воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота' ],
|
7 |
+
weekdaysShort: [ 'вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб' ],
|
8 |
+
today: 'сегодня',
|
9 |
+
clear: 'удалить',
|
10 |
+
close: 'закрыть',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'd mmmm yyyy г.',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'удалить'
|
18 |
+
});
|
js/lib/translations/sk_SK.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Slovak
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota' ],
|
7 |
+
weekdaysShort: [ 'Ne', 'Po', 'Ut', 'St', 'Št', 'Pi', 'So' ],
|
8 |
+
today: 'dnes',
|
9 |
+
clear: 'vymazať',
|
10 |
+
close: 'zavrieť',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'd. mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'vymazať'
|
18 |
+
});
|
js/lib/translations/sl_SI.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Slovenian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota' ],
|
7 |
+
weekdaysShort: [ 'ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob' ],
|
8 |
+
today: 'danes',
|
9 |
+
clear: 'izbriši',
|
10 |
+
close: 'zapri',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'd. mmmm yyyy',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'izbriši'
|
18 |
+
});
|
js/lib/translations/sv_SE.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Swedish
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december' ],
|
5 |
+
monthsShort: [ 'jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec' ],
|
6 |
+
weekdaysFull: [ 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag' ],
|
7 |
+
weekdaysShort: [ 'sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör' ],
|
8 |
+
today: 'Idag',
|
9 |
+
clear: 'Rensa',
|
10 |
+
close: 'Stäng',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'yyyy-mm-dd',
|
13 |
+
formatSubmit: 'yyyy/mm/dd',
|
14 |
+
labelMonthNext: 'Nästa månad',
|
15 |
+
labelMonthPrev: 'Föregående månad',
|
16 |
+
labelMonthSelect: 'Välj månad',
|
17 |
+
labelYearSelect: 'Välj år'
|
18 |
+
});
|
19 |
+
|
20 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
21 |
+
clear: 'Rensa'
|
22 |
+
});
|
js/lib/translations/th_TH.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Thai
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม' ],
|
5 |
+
monthsShort: [ 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.' ],
|
6 |
+
weekdaysFull: [ 'อาทติย', 'จันทร', 'องัคาร', 'พุธ', 'พฤหสั บดี', 'ศกุร', 'เสาร' ],
|
7 |
+
weekdaysShort: [ 'อ.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.' ],
|
8 |
+
today: 'วันนี้',
|
9 |
+
clear: 'ลบ',
|
10 |
+
format: 'd mmmm yyyy',
|
11 |
+
formatSubmit: 'yyyy/mm/dd'
|
12 |
+
});
|
13 |
+
|
14 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
15 |
+
clear: 'ลบ'
|
16 |
+
});
|
js/lib/translations/tr_TR.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Turkish
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık' ],
|
5 |
+
monthsShort: [ 'Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara' ],
|
6 |
+
weekdaysFull: [ 'Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi' ],
|
7 |
+
weekdaysShort: [ 'Pzr', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cmt' ],
|
8 |
+
today: 'Bugün',
|
9 |
+
clear: 'Sil',
|
10 |
+
close: 'Kapat',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'dd mmmm yyyy dddd',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: 'sil'
|
18 |
+
});
|
js/lib/translations/uk_UA.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Ukrainian
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень' ],
|
5 |
+
monthsShort: [ 'січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру' ],
|
6 |
+
weekdaysFull: [ 'неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п‘ятниця', 'субота' ],
|
7 |
+
weekdaysShort: [ 'нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб' ],
|
8 |
+
today: 'сьогодні',
|
9 |
+
clear: 'викреслити',
|
10 |
+
firstDay: 1,
|
11 |
+
format: 'dd mmmm yyyy p.',
|
12 |
+
formatSubmit: 'yyyy/mm/dd'
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
16 |
+
clear: 'викреслити'
|
17 |
+
});
|
js/lib/translations/vi_VN.js
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Vietnamese
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ 'Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai' ],
|
5 |
+
monthsShort: [ 'Một', 'Hai', 'Ba', 'Tư', 'Năm', 'Sáu', 'Bảy', 'Tám', 'Chín', 'Mưới', 'Mười Một', 'Mười Hai' ],
|
6 |
+
weekdaysFull: [ 'Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy' ],
|
7 |
+
weekdaysShort: [ 'C.Nhật', 'T.Hai', 'T.Ba', 'T.Tư', 'T.Năm', 'T.Sáu', 'T.Bảy' ],
|
8 |
+
today: 'Hôm Nay',
|
9 |
+
clear: 'Xoá',
|
10 |
+
firstDay: 1
|
11 |
+
});
|
12 |
+
|
13 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
14 |
+
clear: 'Xoá'
|
15 |
+
});
|
js/lib/translations/zh_CN.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Simplified Chinese
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月' ],
|
5 |
+
monthsShort: [ '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二' ],
|
6 |
+
weekdaysFull: [ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六' ],
|
7 |
+
weekdaysShort: [ '日', '一', '二', '三', '四', '五', '六' ],
|
8 |
+
today: '今日',
|
9 |
+
clear: '清除',
|
10 |
+
close: '关闭',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'yyyy 年 mm 月 dd 日',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: '清除'
|
18 |
+
});
|
js/lib/translations/zh_TW.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Traditional Chinese
|
2 |
+
|
3 |
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4 |
+
monthsFull: [ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月' ],
|
5 |
+
monthsShort: [ '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二' ],
|
6 |
+
weekdaysFull: [ '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六' ],
|
7 |
+
weekdaysShort: [ '日', '一', '二', '三', '四', '五', '六' ],
|
8 |
+
today: '今天',
|
9 |
+
clear: '清除',
|
10 |
+
close: '关闭',
|
11 |
+
firstDay: 1,
|
12 |
+
format: 'yyyy 年 mm 月 dd 日',
|
13 |
+
formatSubmit: 'yyyy/mm/dd'
|
14 |
+
});
|
15 |
+
|
16 |
+
jQuery.extend( jQuery.fn.pickatime.defaults, {
|
17 |
+
clear: '清除'
|
18 |
+
});
|
wpm-admin-settings.js → js/wpm-admin-settings.js
RENAMED
File without changes
|
wpm-color-options.js → js/wpm-color-options.js
RENAMED
File without changes
|
wpm-cpt-script.js → js/wpm-cpt-script.js
RENAMED
File without changes
|
js/wpm-footer-scripts.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
|
3 |
+
var $input = jQuery( '.datepicker' ).pickadate({
|
4 |
+
formatSubmit: 'dd/mm/yyyy',
|
5 |
+
// min: [2015, 7, 14],
|
6 |
+
container: '#container',
|
7 |
+
// editable: true,
|
8 |
+
closeOnSelect: false,
|
9 |
+
closeOnClear: false,
|
10 |
+
first_day: 1,
|
11 |
+
date_min: [ 2015, 12, 12 ],
|
12 |
+
})
|
13 |
+
|
14 |
+
var picker = $input.pickadate('picker')
|
15 |
+
|
16 |
+
// picker.set('select', '14 October, 2014')
|
17 |
+
// picker.open()
|
18 |
+
|
19 |
+
// $('button').on('click', function() {
|
20 |
+
// picker.set('disable', true);
|
21 |
+
// });
|
22 |
+
/*var $input = jQuery( '.datepicker' ).pickatime({
|
23 |
+
})
|
24 |
+
var picker = $input.pickatime('picker')
|
25 |
+
picker.open()*/
|
26 |
+
|
27 |
+
});
|
wpm-script.js → js/wpm-script.js
RENAMED
File without changes
|
languages/wp-maintenance-fr_FR.mo
CHANGED
Binary file
|
languages/wp-maintenance-fr_FR.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WP Maintenance\n"
|
4 |
-
"POT-Creation-Date:
|
5 |
-
"PO-Revision-Date:
|
6 |
"Last-Translator: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
7 |
"Language-Team: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
8 |
"Language: fr\n"
|
@@ -21,7 +21,7 @@ msgstr ""
|
|
21 |
msgid "Options saved."
|
22 |
msgstr "Options sauvegardées."
|
23 |
|
24 |
-
#: wp-maintenance-admin.php:
|
25 |
msgid "The Style Sheet has been reset!"
|
26 |
msgstr "Feuille de style réinitialisée !"
|
27 |
|
@@ -49,7 +49,7 @@ msgstr "Compte à rebours"
|
|
49 |
msgid "CSS Style"
|
50 |
msgstr "Style CSS"
|
51 |
|
52 |
-
#: wp-maintenance-admin.php:78 wp-maintenance.php:
|
53 |
msgid "Settings"
|
54 |
msgstr "Réglages"
|
55 |
|
@@ -63,11 +63,11 @@ msgstr "Activer le mode maintenance :"
|
|
63 |
|
64 |
#: wp-maintenance-admin.php:93 wp-maintenance-admin.php:111
|
65 |
#: wp-maintenance-admin.php:121 wp-maintenance-admin.php:181
|
66 |
-
#: wp-maintenance-admin.php:
|
67 |
msgid "Yes"
|
68 |
msgstr "Oui"
|
69 |
|
70 |
-
#: wp-maintenance-admin.php:94 wp-maintenance-admin.php:
|
71 |
msgid "No"
|
72 |
msgstr "Non"
|
73 |
|
@@ -186,8 +186,8 @@ msgid "Enter your newletter shortcode here:"
|
|
186 |
msgstr "Entrez le Shortcode de la newletter ici :"
|
187 |
|
188 |
#: wp-maintenance-admin.php:190 wp-maintenance-admin.php:349
|
189 |
-
#: wp-maintenance-admin.php:420 wp-maintenance-admin.php:
|
190 |
-
#: wp-maintenance-admin.php:
|
191 |
msgid "Save this settings"
|
192 |
msgstr "Sauvegarder ces paramètres"
|
193 |
|
@@ -333,35 +333,63 @@ msgstr "Options de l'image de fond"
|
|
333 |
msgid "Fixed"
|
334 |
msgstr "Fixe"
|
335 |
|
336 |
-
#: wp-maintenance-admin.php:
|
337 |
msgid "Enable a countdown ?"
|
338 |
msgstr "Activer le compte à rebours ?"
|
339 |
|
340 |
-
#: wp-maintenance-admin.php:
|
341 |
-
msgid "
|
342 |
-
msgstr "
|
343 |
|
344 |
-
#: wp-maintenance-admin.php:
|
345 |
msgid "Enable seconds ?"
|
346 |
msgstr "Afficher les secondes ?"
|
347 |
|
348 |
-
#: wp-maintenance-admin.php:
|
349 |
msgid "Disable maintenance mode at the end of the countdown?"
|
350 |
msgstr "Désactiver le mode maintenance à la fin du compte à rebours ?"
|
351 |
|
352 |
-
#: wp-maintenance-admin.php:
|
353 |
msgid "End message:"
|
354 |
msgstr "Message de fin :"
|
355 |
|
356 |
-
#: wp-maintenance-admin.php:
|
357 |
msgid "Font size:"
|
358 |
msgstr "Taille de la police :"
|
359 |
|
360 |
-
#: wp-maintenance-admin.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
msgid "CSS style sheet code:"
|
362 |
msgstr "Code style CSS :"
|
363 |
|
364 |
-
#: wp-maintenance-admin.php:
|
365 |
msgid ""
|
366 |
"Edit the CSS sheet of your maintenance page here. Click \"Reset\" and \"Save"
|
367 |
"\" to retrieve the default style sheet."
|
@@ -369,70 +397,70 @@ msgstr ""
|
|
369 |
"Editer le code CSS de votre page de maintenance ici. Cliquez sur "
|
370 |
"\"Réinitialiser\" et \"Sauvegarder\" pour remettre le style par défaut."
|
371 |
|
372 |
-
#: wp-maintenance-admin.php:
|
373 |
msgid "Markers for colors"
|
374 |
msgstr "Marqueurs pour les couleurs"
|
375 |
|
376 |
-
#: wp-maintenance-admin.php:
|
377 |
msgid "Use this code for text color"
|
378 |
msgstr "Utiliser ce code pour la couleur du texte"
|
379 |
|
380 |
-
#: wp-maintenance-admin.php:
|
381 |
msgid "Use this code for background text color"
|
382 |
msgstr "Utiliser ce code pour la couleur de fond du texte"
|
383 |
|
384 |
-
#: wp-maintenance-admin.php:
|
385 |
msgid "Use this code for background color countdown"
|
386 |
msgstr "Utiliser ce code pour la couleur du fond du compte à rebours"
|
387 |
|
388 |
-
#: wp-maintenance-admin.php:
|
389 |
msgid "Use this code for size countdown"
|
390 |
msgstr "Utiliser ce code pour la taille du compte à rebours"
|
391 |
|
392 |
-
#: wp-maintenance-admin.php:
|
393 |
msgid "Use this code for countdown color"
|
394 |
msgstr "Utiliser ce code pour la couleur du texte du compte à rebours"
|
395 |
|
396 |
-
#: wp-maintenance-admin.php:
|
397 |
msgid "Reset default CSS stylesheet ?"
|
398 |
msgstr "Réinitialiser la feuille de style ?"
|
399 |
|
400 |
-
#: wp-maintenance-admin.php:
|
401 |
msgid "Theme maintenance page:"
|
402 |
msgstr "Page maintenance du thème :"
|
403 |
|
404 |
-
#: wp-maintenance-admin.php:
|
405 |
msgid ""
|
406 |
"If you would use your maintenance.php page in your theme folder, click Yes."
|
407 |
msgstr ""
|
408 |
"Si vous souhaitez utiliser votre page maintenance.php dans le dossier de "
|
409 |
"votre thème, cliquez sur Oui."
|
410 |
|
411 |
-
#: wp-maintenance-admin.php:
|
412 |
msgid "You can use this shortcode to include Google Analytics code:"
|
413 |
msgstr ""
|
414 |
"Vous pouvez utiliser ce Shortcode pour include le code Google Analytics sur "
|
415 |
"votre page :"
|
416 |
|
417 |
-
#: wp-maintenance-admin.php:
|
418 |
msgid "You can use this shortcode to include Social Networks icons:"
|
419 |
msgstr ""
|
420 |
"Vous pouvez utiliser ce Shortcode pour include les icons des réseaux sociaux "
|
421 |
"sur votre page :"
|
422 |
|
423 |
-
#: wp-maintenance-admin.php:
|
424 |
msgid "Roles and Capabilities:"
|
425 |
msgstr "Rôles et capacités :"
|
426 |
|
427 |
-
#: wp-maintenance-admin.php:
|
428 |
msgid "Allow the site to display these roles:"
|
429 |
msgstr "Autoriser l'affichage du site à ces rôles :"
|
430 |
|
431 |
-
#: wp-maintenance-admin.php:
|
432 |
msgid "IP autorized:"
|
433 |
msgstr "IP autorisées :"
|
434 |
|
435 |
-
#: wp-maintenance-admin.php:
|
436 |
msgid ""
|
437 |
"Allow the site to display these IP addresses. Please, enter one IP address "
|
438 |
"by line:"
|
@@ -440,11 +468,11 @@ msgstr ""
|
|
440 |
"Autoriser l'affichage du site à ces adresses IP. Merci d'entrer 1 adresse IP "
|
441 |
"par ligne : "
|
442 |
|
443 |
-
#: wp-maintenance-admin.php:
|
444 |
msgid "Header Code:"
|
445 |
msgstr "Code pour le header"
|
446 |
|
447 |
-
#: wp-maintenance-admin.php:
|
448 |
msgid ""
|
449 |
"The following code will add to the <head> tag. Useful if you need to add "
|
450 |
"additional scripts such as CSS or JS."
|
@@ -452,7 +480,7 @@ msgstr ""
|
|
452 |
"Le code suivant va être ajouter à la balise <head>. Très utile si vous avez "
|
453 |
"besoin d'ajouter des scripts supplémentaires tels que CSS ou JS."
|
454 |
|
455 |
-
#: wp-maintenance-admin.php:
|
456 |
msgid ""
|
457 |
"This plugin has been developed for you for free by <a href=\"http://www."
|
458 |
"restezconnectes.fr\" target=\"_blank\">Florent Maillefaud</ a>. It is "
|
@@ -467,77 +495,80 @@ msgstr ""
|
|
467 |
"retours sur vos éventuelles modifications afin d'améliorer ce plugin pour "
|
468 |
"tous."
|
469 |
|
470 |
-
#: wp-maintenance-admin.php:
|
471 |
msgid "Visit"
|
472 |
msgstr "Visitez le site web de"
|
473 |
|
474 |
-
#: wp-maintenance-admin.php:
|
475 |
msgid ""
|
476 |
"try the demo of the plugin, talk about this plugin to your surroundings!"
|
477 |
msgstr "essayez la démo du plugin et parlez de ce plugin à votre entourage !"
|
478 |
|
479 |
-
#: wp-maintenance-admin.php:
|
480 |
msgid ""
|
481 |
"If you want Donate (French Paypal) for my current and future developments:"
|
482 |
msgstr ""
|
483 |
"Si vous souhaitez me soutenir pour mes développements actuels et futurs :"
|
484 |
|
485 |
-
#: wp-maintenance-admin.php:
|
486 |
msgid "WP Maintenance is brought to you by"
|
487 |
msgstr "WP Maintenance est un plugin proposé par"
|
488 |
|
489 |
-
#: wp-maintenance-admin.php:
|
490 |
msgid "If you found this plugin useful"
|
491 |
msgstr "Si vous avez trouvé ce plugin utile,"
|
492 |
|
493 |
-
#: wp-maintenance-admin.php:
|
494 |
msgid "give it 5 ★ on WordPress.org"
|
495 |
msgstr "donnez-lui 5 ★ sur WordPress.org"
|
496 |
|
497 |
-
#: wp-maintenance.php:
|
498 |
msgid "Maintenance mode activated!"
|
499 |
msgstr "Maintenance activée !"
|
500 |
|
501 |
-
#: wp-maintenance.php:
|
502 |
msgid "This site is down for maintenance"
|
503 |
msgstr "Ce site est en maintenance"
|
504 |
|
505 |
-
#: wp-maintenance.php:
|
506 |
msgid "Come back quickly !"
|
507 |
msgstr "Revenez vite nous voir !"
|
508 |
|
509 |
-
#: wp-maintenance.php:
|
510 |
msgid "Options for the maintenance page"
|
511 |
msgstr "Options pour la page maintenance"
|
512 |
|
513 |
-
#: wp-maintenance.php:
|
514 |
msgid "Choose This Image"
|
515 |
msgstr "Choisir cette image"
|
516 |
|
517 |
-
#: wp-maintenance.php:
|
518 |
msgid "Choose Image"
|
519 |
msgstr "Choisissez une image"
|
520 |
|
521 |
-
#: wp-maintenance.php:
|
522 |
msgid "Dashboard"
|
523 |
msgstr "Tableau de bord"
|
524 |
|
525 |
-
#: wp-maintenance.php:
|
526 |
msgid "Days"
|
527 |
msgstr "Jours"
|
528 |
|
529 |
-
#: wp-maintenance.php:
|
530 |
msgid "Hours"
|
531 |
msgstr "Heures"
|
532 |
|
533 |
-
#: wp-maintenance.php:
|
534 |
msgid "Minutes"
|
535 |
msgstr "Minutes"
|
536 |
|
537 |
-
#: wp-maintenance.php:
|
538 |
msgid "Seconds"
|
539 |
msgstr "Secondes"
|
540 |
|
|
|
|
|
|
|
541 |
#~ msgid "Please, enter one IP address by line:"
|
542 |
#~ msgstr "Merci d'entrer 1 adresse IP par ligne : "
|
543 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WP Maintenance\n"
|
4 |
+
"POT-Creation-Date: 2016-01-25 10:49+0100\n"
|
5 |
+
"PO-Revision-Date: 2016-01-25 10:50+0100\n"
|
6 |
"Last-Translator: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
7 |
"Language-Team: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
8 |
"Language: fr\n"
|
21 |
msgid "Options saved."
|
22 |
msgstr "Options sauvegardées."
|
23 |
|
24 |
+
#: wp-maintenance-admin.php:50
|
25 |
msgid "The Style Sheet has been reset!"
|
26 |
msgstr "Feuille de style réinitialisée !"
|
27 |
|
49 |
msgid "CSS Style"
|
50 |
msgstr "Style CSS"
|
51 |
|
52 |
+
#: wp-maintenance-admin.php:78 wp-maintenance.php:69
|
53 |
msgid "Settings"
|
54 |
msgstr "Réglages"
|
55 |
|
63 |
|
64 |
#: wp-maintenance-admin.php:93 wp-maintenance-admin.php:111
|
65 |
#: wp-maintenance-admin.php:121 wp-maintenance-admin.php:181
|
66 |
+
#: wp-maintenance-admin.php:445 wp-maintenance-admin.php:596
|
67 |
msgid "Yes"
|
68 |
msgstr "Oui"
|
69 |
|
70 |
+
#: wp-maintenance-admin.php:94 wp-maintenance-admin.php:597
|
71 |
msgid "No"
|
72 |
msgstr "Non"
|
73 |
|
186 |
msgstr "Entrez le Shortcode de la newletter ici :"
|
187 |
|
188 |
#: wp-maintenance-admin.php:190 wp-maintenance-admin.php:349
|
189 |
+
#: wp-maintenance-admin.php:420 wp-maintenance-admin.php:526
|
190 |
+
#: wp-maintenance-admin.php:582 wp-maintenance-admin.php:646
|
191 |
msgid "Save this settings"
|
192 |
msgstr "Sauvegarder ces paramètres"
|
193 |
|
333 |
msgid "Fixed"
|
334 |
msgstr "Fixe"
|
335 |
|
336 |
+
#: wp-maintenance-admin.php:444
|
337 |
msgid "Enable a countdown ?"
|
338 |
msgstr "Activer le compte à rebours ?"
|
339 |
|
340 |
+
#: wp-maintenance-admin.php:446
|
341 |
+
msgid "Select the launch date/time"
|
342 |
+
msgstr "Sélectionner une date et heure de lancement"
|
343 |
|
344 |
+
#: wp-maintenance-admin.php:449
|
345 |
msgid "Enable seconds ?"
|
346 |
msgstr "Afficher les secondes ?"
|
347 |
|
348 |
+
#: wp-maintenance-admin.php:450
|
349 |
msgid "Disable maintenance mode at the end of the countdown?"
|
350 |
msgstr "Désactiver le mode maintenance à la fin du compte à rebours ?"
|
351 |
|
352 |
+
#: wp-maintenance-admin.php:451
|
353 |
msgid "End message:"
|
354 |
msgstr "Message de fin :"
|
355 |
|
356 |
+
#: wp-maintenance-admin.php:451
|
357 |
msgid "Font size:"
|
358 |
msgstr "Taille de la police :"
|
359 |
|
360 |
+
#: wp-maintenance-admin.php:479
|
361 |
+
msgid "Today"
|
362 |
+
msgstr "Aujourd'hui"
|
363 |
+
|
364 |
+
#: wp-maintenance-admin.php:480
|
365 |
+
msgid "Delete"
|
366 |
+
msgstr "Supprimer"
|
367 |
+
|
368 |
+
#: wp-maintenance-admin.php:481 wp-maintenance-admin.php:505
|
369 |
+
msgid "Close"
|
370 |
+
msgstr "Fermer"
|
371 |
+
|
372 |
+
#: wp-maintenance-admin.php:484
|
373 |
+
msgid "Next month"
|
374 |
+
msgstr "Mois suivant"
|
375 |
+
|
376 |
+
#: wp-maintenance-admin.php:485
|
377 |
+
msgid "Previous month"
|
378 |
+
msgstr "Mois précédent"
|
379 |
+
|
380 |
+
#: wp-maintenance-admin.php:486
|
381 |
+
msgid "Select a month"
|
382 |
+
msgstr "Sélectionner un mois"
|
383 |
+
|
384 |
+
#: wp-maintenance-admin.php:487
|
385 |
+
msgid "Select a year"
|
386 |
+
msgstr "Sélectionner une année"
|
387 |
+
|
388 |
+
#: wp-maintenance-admin.php:538
|
389 |
msgid "CSS style sheet code:"
|
390 |
msgstr "Code style CSS :"
|
391 |
|
392 |
+
#: wp-maintenance-admin.php:539
|
393 |
msgid ""
|
394 |
"Edit the CSS sheet of your maintenance page here. Click \"Reset\" and \"Save"
|
395 |
"\" to retrieve the default style sheet."
|
397 |
"Editer le code CSS de votre page de maintenance ici. Cliquez sur "
|
398 |
"\"Réinitialiser\" et \"Sauvegarder\" pour remettre le style par défaut."
|
399 |
|
400 |
+
#: wp-maintenance-admin.php:547
|
401 |
msgid "Markers for colors"
|
402 |
msgstr "Marqueurs pour les couleurs"
|
403 |
|
404 |
+
#: wp-maintenance-admin.php:552
|
405 |
msgid "Use this code for text color"
|
406 |
msgstr "Utiliser ce code pour la couleur du texte"
|
407 |
|
408 |
+
#: wp-maintenance-admin.php:556
|
409 |
msgid "Use this code for background text color"
|
410 |
msgstr "Utiliser ce code pour la couleur de fond du texte"
|
411 |
|
412 |
+
#: wp-maintenance-admin.php:560
|
413 |
msgid "Use this code for background color countdown"
|
414 |
msgstr "Utiliser ce code pour la couleur du fond du compte à rebours"
|
415 |
|
416 |
+
#: wp-maintenance-admin.php:564
|
417 |
msgid "Use this code for size countdown"
|
418 |
msgstr "Utiliser ce code pour la taille du compte à rebours"
|
419 |
|
420 |
+
#: wp-maintenance-admin.php:568
|
421 |
msgid "Use this code for countdown color"
|
422 |
msgstr "Utiliser ce code pour la couleur du texte du compte à rebours"
|
423 |
|
424 |
+
#: wp-maintenance-admin.php:577
|
425 |
msgid "Reset default CSS stylesheet ?"
|
426 |
msgstr "Réinitialiser la feuille de style ?"
|
427 |
|
428 |
+
#: wp-maintenance-admin.php:594
|
429 |
msgid "Theme maintenance page:"
|
430 |
msgstr "Page maintenance du thème :"
|
431 |
|
432 |
+
#: wp-maintenance-admin.php:595
|
433 |
msgid ""
|
434 |
"If you would use your maintenance.php page in your theme folder, click Yes."
|
435 |
msgstr ""
|
436 |
"Si vous souhaitez utiliser votre page maintenance.php dans le dossier de "
|
437 |
"votre thème, cliquez sur Oui."
|
438 |
|
439 |
+
#: wp-maintenance-admin.php:598
|
440 |
msgid "You can use this shortcode to include Google Analytics code:"
|
441 |
msgstr ""
|
442 |
"Vous pouvez utiliser ce Shortcode pour include le code Google Analytics sur "
|
443 |
"votre page :"
|
444 |
|
445 |
+
#: wp-maintenance-admin.php:598
|
446 |
msgid "You can use this shortcode to include Social Networks icons:"
|
447 |
msgstr ""
|
448 |
"Vous pouvez utiliser ce Shortcode pour include les icons des réseaux sociaux "
|
449 |
"sur votre page :"
|
450 |
|
451 |
+
#: wp-maintenance-admin.php:607
|
452 |
msgid "Roles and Capabilities:"
|
453 |
msgstr "Rôles et capacités :"
|
454 |
|
455 |
+
#: wp-maintenance-admin.php:608
|
456 |
msgid "Allow the site to display these roles:"
|
457 |
msgstr "Autoriser l'affichage du site à ces rôles :"
|
458 |
|
459 |
+
#: wp-maintenance-admin.php:625
|
460 |
msgid "IP autorized:"
|
461 |
msgstr "IP autorisées :"
|
462 |
|
463 |
+
#: wp-maintenance-admin.php:626
|
464 |
msgid ""
|
465 |
"Allow the site to display these IP addresses. Please, enter one IP address "
|
466 |
"by line:"
|
468 |
"Autoriser l'affichage du site à ces adresses IP. Merci d'entrer 1 adresse IP "
|
469 |
"par ligne : "
|
470 |
|
471 |
+
#: wp-maintenance-admin.php:631
|
472 |
msgid "Header Code:"
|
473 |
msgstr "Code pour le header"
|
474 |
|
475 |
+
#: wp-maintenance-admin.php:632
|
476 |
msgid ""
|
477 |
"The following code will add to the <head> tag. Useful if you need to add "
|
478 |
"additional scripts such as CSS or JS."
|
480 |
"Le code suivant va être ajouter à la balise <head>. Très utile si vous avez "
|
481 |
"besoin d'ajouter des scripts supplémentaires tels que CSS ou JS."
|
482 |
|
483 |
+
#: wp-maintenance-admin.php:662
|
484 |
msgid ""
|
485 |
"This plugin has been developed for you for free by <a href=\"http://www."
|
486 |
"restezconnectes.fr\" target=\"_blank\">Florent Maillefaud</ a>. It is "
|
495 |
"retours sur vos éventuelles modifications afin d'améliorer ce plugin pour "
|
496 |
"tous."
|
497 |
|
498 |
+
#: wp-maintenance-admin.php:666
|
499 |
msgid "Visit"
|
500 |
msgstr "Visitez le site web de"
|
501 |
|
502 |
+
#: wp-maintenance-admin.php:666
|
503 |
msgid ""
|
504 |
"try the demo of the plugin, talk about this plugin to your surroundings!"
|
505 |
msgstr "essayez la démo du plugin et parlez de ce plugin à votre entourage !"
|
506 |
|
507 |
+
#: wp-maintenance-admin.php:671
|
508 |
msgid ""
|
509 |
"If you want Donate (French Paypal) for my current and future developments:"
|
510 |
msgstr ""
|
511 |
"Si vous souhaitez me soutenir pour mes développements actuels et futurs :"
|
512 |
|
513 |
+
#: wp-maintenance-admin.php:691
|
514 |
msgid "WP Maintenance is brought to you by"
|
515 |
msgstr "WP Maintenance est un plugin proposé par"
|
516 |
|
517 |
+
#: wp-maintenance-admin.php:691
|
518 |
msgid "If you found this plugin useful"
|
519 |
msgstr "Si vous avez trouvé ce plugin utile,"
|
520 |
|
521 |
+
#: wp-maintenance-admin.php:691
|
522 |
msgid "give it 5 ★ on WordPress.org"
|
523 |
msgstr "donnez-lui 5 ★ sur WordPress.org"
|
524 |
|
525 |
+
#: wp-maintenance.php:118
|
526 |
msgid "Maintenance mode activated!"
|
527 |
msgstr "Maintenance activée !"
|
528 |
|
529 |
+
#: wp-maintenance.php:155
|
530 |
msgid "This site is down for maintenance"
|
531 |
msgstr "Ce site est en maintenance"
|
532 |
|
533 |
+
#: wp-maintenance.php:156
|
534 |
msgid "Come back quickly !"
|
535 |
msgstr "Revenez vite nous voir !"
|
536 |
|
537 |
+
#: wp-maintenance.php:206 wp-maintenance.php:208
|
538 |
msgid "Options for the maintenance page"
|
539 |
msgstr "Options pour la page maintenance"
|
540 |
|
541 |
+
#: wp-maintenance.php:234
|
542 |
msgid "Choose This Image"
|
543 |
msgstr "Choisir cette image"
|
544 |
|
545 |
+
#: wp-maintenance.php:235
|
546 |
msgid "Choose Image"
|
547 |
msgstr "Choisissez une image"
|
548 |
|
549 |
+
#: wp-maintenance.php:526
|
550 |
msgid "Dashboard"
|
551 |
msgstr "Tableau de bord"
|
552 |
|
553 |
+
#: wp-maintenance.php:602
|
554 |
msgid "Days"
|
555 |
msgstr "Jours"
|
556 |
|
557 |
+
#: wp-maintenance.php:602
|
558 |
msgid "Hours"
|
559 |
msgstr "Heures"
|
560 |
|
561 |
+
#: wp-maintenance.php:602
|
562 |
msgid "Minutes"
|
563 |
msgstr "Minutes"
|
564 |
|
565 |
+
#: wp-maintenance.php:604
|
566 |
msgid "Seconds"
|
567 |
msgstr "Secondes"
|
568 |
|
569 |
+
#~ msgid "Enter the launch date"
|
570 |
+
#~ msgstr "Entrez la date de lancement"
|
571 |
+
|
572 |
#~ msgid "Please, enter one IP address by line:"
|
573 |
#~ msgstr "Merci d'entrer 1 adresse IP par ligne : "
|
574 |
|
languages/wp-maintenance.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: WP Maintenance\n"
|
5 |
-
"POT-Creation-Date:
|
6 |
"PO-Revision-Date: 2015-03-19 11:19+0100\n"
|
7 |
"Last-Translator: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
8 |
"Language-Team: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
@@ -21,7 +21,7 @@ msgstr ""
|
|
21 |
msgid "Options saved."
|
22 |
msgstr ""
|
23 |
|
24 |
-
#: wp-maintenance-admin.php:
|
25 |
msgid "The Style Sheet has been reset!"
|
26 |
msgstr ""
|
27 |
|
@@ -49,7 +49,7 @@ msgstr ""
|
|
49 |
msgid "CSS Style"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: wp-maintenance-admin.php:78 wp-maintenance.php:
|
53 |
msgid "Settings"
|
54 |
msgstr ""
|
55 |
|
@@ -63,11 +63,11 @@ msgstr ""
|
|
63 |
|
64 |
#: wp-maintenance-admin.php:93 wp-maintenance-admin.php:111
|
65 |
#: wp-maintenance-admin.php:121 wp-maintenance-admin.php:181
|
66 |
-
#: wp-maintenance-admin.php:
|
67 |
msgid "Yes"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: wp-maintenance-admin.php:94 wp-maintenance-admin.php:
|
71 |
msgid "No"
|
72 |
msgstr ""
|
73 |
|
@@ -182,8 +182,8 @@ msgid "Enter your newletter shortcode here:"
|
|
182 |
msgstr ""
|
183 |
|
184 |
#: wp-maintenance-admin.php:190 wp-maintenance-admin.php:349
|
185 |
-
#: wp-maintenance-admin.php:420 wp-maintenance-admin.php:
|
186 |
-
#: wp-maintenance-admin.php:
|
187 |
msgid "Save this settings"
|
188 |
msgstr ""
|
189 |
|
@@ -329,114 +329,142 @@ msgstr ""
|
|
329 |
msgid "Fixed"
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: wp-maintenance-admin.php:
|
333 |
msgid "Enable a countdown ?"
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: wp-maintenance-admin.php:
|
337 |
-
msgid "
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: wp-maintenance-admin.php:
|
341 |
msgid "Enable seconds ?"
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: wp-maintenance-admin.php:
|
345 |
msgid "Disable maintenance mode at the end of the countdown?"
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: wp-maintenance-admin.php:
|
349 |
msgid "End message:"
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: wp-maintenance-admin.php:
|
353 |
msgid "Font size:"
|
354 |
msgstr ""
|
355 |
|
356 |
-
#: wp-maintenance-admin.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
msgid "CSS style sheet code:"
|
358 |
msgstr ""
|
359 |
|
360 |
-
#: wp-maintenance-admin.php:
|
361 |
msgid ""
|
362 |
"Edit the CSS sheet of your maintenance page here. Click \"Reset\" and \"Save"
|
363 |
"\" to retrieve the default style sheet."
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: wp-maintenance-admin.php:
|
367 |
msgid "Markers for colors"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: wp-maintenance-admin.php:
|
371 |
msgid "Use this code for text color"
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: wp-maintenance-admin.php:
|
375 |
msgid "Use this code for background text color"
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: wp-maintenance-admin.php:
|
379 |
msgid "Use this code for background color countdown"
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: wp-maintenance-admin.php:
|
383 |
msgid "Use this code for size countdown"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: wp-maintenance-admin.php:
|
387 |
msgid "Use this code for countdown color"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: wp-maintenance-admin.php:
|
391 |
msgid "Reset default CSS stylesheet ?"
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: wp-maintenance-admin.php:
|
395 |
msgid "Theme maintenance page:"
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: wp-maintenance-admin.php:
|
399 |
msgid ""
|
400 |
"If you would use your maintenance.php page in your theme folder, click Yes."
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: wp-maintenance-admin.php:
|
404 |
msgid "You can use this shortcode to include Google Analytics code:"
|
405 |
msgstr ""
|
406 |
|
407 |
-
#: wp-maintenance-admin.php:
|
408 |
msgid "You can use this shortcode to include Social Networks icons:"
|
409 |
msgstr ""
|
410 |
|
411 |
-
#: wp-maintenance-admin.php:
|
412 |
msgid "Roles and Capabilities:"
|
413 |
msgstr ""
|
414 |
|
415 |
-
#: wp-maintenance-admin.php:
|
416 |
msgid "Allow the site to display these roles:"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: wp-maintenance-admin.php:
|
420 |
msgid "IP autorized:"
|
421 |
msgstr ""
|
422 |
|
423 |
-
#: wp-maintenance-admin.php:
|
424 |
msgid ""
|
425 |
"Allow the site to display these IP addresses. Please, enter one IP address "
|
426 |
"by line:"
|
427 |
msgstr ""
|
428 |
|
429 |
-
#: wp-maintenance-admin.php:
|
430 |
msgid "Header Code:"
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: wp-maintenance-admin.php:
|
434 |
msgid ""
|
435 |
"The following code will add to the <head> tag. Useful if you need to add "
|
436 |
"additional scripts such as CSS or JS."
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: wp-maintenance-admin.php:
|
440 |
msgid ""
|
441 |
"This plugin has been developed for you for free by <a href=\"http://www."
|
442 |
"restezconnectes.fr\" target=\"_blank\">Florent Maillefaud</ a>. It is "
|
@@ -445,72 +473,72 @@ msgid ""
|
|
445 |
"changes to improve this plugin for all."
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: wp-maintenance-admin.php:
|
449 |
msgid "Visit"
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: wp-maintenance-admin.php:
|
453 |
msgid ""
|
454 |
"try the demo of the plugin, talk about this plugin to your surroundings!"
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: wp-maintenance-admin.php:
|
458 |
msgid ""
|
459 |
"If you want Donate (French Paypal) for my current and future developments:"
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: wp-maintenance-admin.php:
|
463 |
msgid "WP Maintenance is brought to you by"
|
464 |
msgstr ""
|
465 |
|
466 |
-
#: wp-maintenance-admin.php:
|
467 |
msgid "If you found this plugin useful"
|
468 |
msgstr ""
|
469 |
|
470 |
-
#: wp-maintenance-admin.php:
|
471 |
msgid "give it 5 ★ on WordPress.org"
|
472 |
msgstr ""
|
473 |
|
474 |
-
#: wp-maintenance.php:
|
475 |
msgid "Maintenance mode activated!"
|
476 |
msgstr ""
|
477 |
|
478 |
-
#: wp-maintenance.php:
|
479 |
msgid "This site is down for maintenance"
|
480 |
msgstr ""
|
481 |
|
482 |
-
#: wp-maintenance.php:
|
483 |
msgid "Come back quickly !"
|
484 |
msgstr ""
|
485 |
|
486 |
-
#: wp-maintenance.php:
|
487 |
msgid "Options for the maintenance page"
|
488 |
msgstr ""
|
489 |
|
490 |
-
#: wp-maintenance.php:
|
491 |
msgid "Choose This Image"
|
492 |
msgstr ""
|
493 |
|
494 |
-
#: wp-maintenance.php:
|
495 |
msgid "Choose Image"
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: wp-maintenance.php:
|
499 |
msgid "Dashboard"
|
500 |
msgstr ""
|
501 |
|
502 |
-
#: wp-maintenance.php:
|
503 |
msgid "Days"
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: wp-maintenance.php:
|
507 |
msgid "Hours"
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: wp-maintenance.php:
|
511 |
msgid "Minutes"
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: wp-maintenance.php:
|
515 |
msgid "Seconds"
|
516 |
msgstr ""
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: WP Maintenance\n"
|
5 |
+
"POT-Creation-Date: 2016-01-25 10:48+0100\n"
|
6 |
"PO-Revision-Date: 2015-03-19 11:19+0100\n"
|
7 |
"Last-Translator: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
8 |
"Language-Team: Florent Maillefaud <contact@restezconnectes.fr>\n"
|
21 |
msgid "Options saved."
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: wp-maintenance-admin.php:50
|
25 |
msgid "The Style Sheet has been reset!"
|
26 |
msgstr ""
|
27 |
|
49 |
msgid "CSS Style"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: wp-maintenance-admin.php:78 wp-maintenance.php:69
|
53 |
msgid "Settings"
|
54 |
msgstr ""
|
55 |
|
63 |
|
64 |
#: wp-maintenance-admin.php:93 wp-maintenance-admin.php:111
|
65 |
#: wp-maintenance-admin.php:121 wp-maintenance-admin.php:181
|
66 |
+
#: wp-maintenance-admin.php:445 wp-maintenance-admin.php:596
|
67 |
msgid "Yes"
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: wp-maintenance-admin.php:94 wp-maintenance-admin.php:597
|
71 |
msgid "No"
|
72 |
msgstr ""
|
73 |
|
182 |
msgstr ""
|
183 |
|
184 |
#: wp-maintenance-admin.php:190 wp-maintenance-admin.php:349
|
185 |
+
#: wp-maintenance-admin.php:420 wp-maintenance-admin.php:526
|
186 |
+
#: wp-maintenance-admin.php:582 wp-maintenance-admin.php:646
|
187 |
msgid "Save this settings"
|
188 |
msgstr ""
|
189 |
|
329 |
msgid "Fixed"
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: wp-maintenance-admin.php:444
|
333 |
msgid "Enable a countdown ?"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: wp-maintenance-admin.php:446
|
337 |
+
msgid "Select the launch date/time"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: wp-maintenance-admin.php:449
|
341 |
msgid "Enable seconds ?"
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: wp-maintenance-admin.php:450
|
345 |
msgid "Disable maintenance mode at the end of the countdown?"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: wp-maintenance-admin.php:451
|
349 |
msgid "End message:"
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: wp-maintenance-admin.php:451
|
353 |
msgid "Font size:"
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: wp-maintenance-admin.php:479
|
357 |
+
msgid "Today"
|
358 |
+
msgstr ""
|
359 |
+
|
360 |
+
#: wp-maintenance-admin.php:480
|
361 |
+
msgid "Delete"
|
362 |
+
msgstr ""
|
363 |
+
|
364 |
+
#: wp-maintenance-admin.php:481 wp-maintenance-admin.php:505
|
365 |
+
msgid "Close"
|
366 |
+
msgstr ""
|
367 |
+
|
368 |
+
#: wp-maintenance-admin.php:484
|
369 |
+
msgid "Next month"
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: wp-maintenance-admin.php:485
|
373 |
+
msgid "Previous month"
|
374 |
+
msgstr ""
|
375 |
+
|
376 |
+
#: wp-maintenance-admin.php:486
|
377 |
+
msgid "Select a month"
|
378 |
+
msgstr ""
|
379 |
+
|
380 |
+
#: wp-maintenance-admin.php:487
|
381 |
+
msgid "Select a year"
|
382 |
+
msgstr ""
|
383 |
+
|
384 |
+
#: wp-maintenance-admin.php:538
|
385 |
msgid "CSS style sheet code:"
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: wp-maintenance-admin.php:539
|
389 |
msgid ""
|
390 |
"Edit the CSS sheet of your maintenance page here. Click \"Reset\" and \"Save"
|
391 |
"\" to retrieve the default style sheet."
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: wp-maintenance-admin.php:547
|
395 |
msgid "Markers for colors"
|
396 |
msgstr ""
|
397 |
|
398 |
+
#: wp-maintenance-admin.php:552
|
399 |
msgid "Use this code for text color"
|
400 |
msgstr ""
|
401 |
|
402 |
+
#: wp-maintenance-admin.php:556
|
403 |
msgid "Use this code for background text color"
|
404 |
msgstr ""
|
405 |
|
406 |
+
#: wp-maintenance-admin.php:560
|
407 |
msgid "Use this code for background color countdown"
|
408 |
msgstr ""
|
409 |
|
410 |
+
#: wp-maintenance-admin.php:564
|
411 |
msgid "Use this code for size countdown"
|
412 |
msgstr ""
|
413 |
|
414 |
+
#: wp-maintenance-admin.php:568
|
415 |
msgid "Use this code for countdown color"
|
416 |
msgstr ""
|
417 |
|
418 |
+
#: wp-maintenance-admin.php:577
|
419 |
msgid "Reset default CSS stylesheet ?"
|
420 |
msgstr ""
|
421 |
|
422 |
+
#: wp-maintenance-admin.php:594
|
423 |
msgid "Theme maintenance page:"
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: wp-maintenance-admin.php:595
|
427 |
msgid ""
|
428 |
"If you would use your maintenance.php page in your theme folder, click Yes."
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: wp-maintenance-admin.php:598
|
432 |
msgid "You can use this shortcode to include Google Analytics code:"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: wp-maintenance-admin.php:598
|
436 |
msgid "You can use this shortcode to include Social Networks icons:"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: wp-maintenance-admin.php:607
|
440 |
msgid "Roles and Capabilities:"
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: wp-maintenance-admin.php:608
|
444 |
msgid "Allow the site to display these roles:"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: wp-maintenance-admin.php:625
|
448 |
msgid "IP autorized:"
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: wp-maintenance-admin.php:626
|
452 |
msgid ""
|
453 |
"Allow the site to display these IP addresses. Please, enter one IP address "
|
454 |
"by line:"
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: wp-maintenance-admin.php:631
|
458 |
msgid "Header Code:"
|
459 |
msgstr ""
|
460 |
|
461 |
+
#: wp-maintenance-admin.php:632
|
462 |
msgid ""
|
463 |
"The following code will add to the <head> tag. Useful if you need to add "
|
464 |
"additional scripts such as CSS or JS."
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: wp-maintenance-admin.php:662
|
468 |
msgid ""
|
469 |
"This plugin has been developed for you for free by <a href=\"http://www."
|
470 |
"restezconnectes.fr\" target=\"_blank\">Florent Maillefaud</ a>. It is "
|
473 |
"changes to improve this plugin for all."
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: wp-maintenance-admin.php:666
|
477 |
msgid "Visit"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: wp-maintenance-admin.php:666
|
481 |
msgid ""
|
482 |
"try the demo of the plugin, talk about this plugin to your surroundings!"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: wp-maintenance-admin.php:671
|
486 |
msgid ""
|
487 |
"If you want Donate (French Paypal) for my current and future developments:"
|
488 |
msgstr ""
|
489 |
|
490 |
+
#: wp-maintenance-admin.php:691
|
491 |
msgid "WP Maintenance is brought to you by"
|
492 |
msgstr ""
|
493 |
|
494 |
+
#: wp-maintenance-admin.php:691
|
495 |
msgid "If you found this plugin useful"
|
496 |
msgstr ""
|
497 |
|
498 |
+
#: wp-maintenance-admin.php:691
|
499 |
msgid "give it 5 ★ on WordPress.org"
|
500 |
msgstr ""
|
501 |
|
502 |
+
#: wp-maintenance.php:118
|
503 |
msgid "Maintenance mode activated!"
|
504 |
msgstr ""
|
505 |
|
506 |
+
#: wp-maintenance.php:155
|
507 |
msgid "This site is down for maintenance"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: wp-maintenance.php:156
|
511 |
msgid "Come back quickly !"
|
512 |
msgstr ""
|
513 |
|
514 |
+
#: wp-maintenance.php:206 wp-maintenance.php:208
|
515 |
msgid "Options for the maintenance page"
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: wp-maintenance.php:234
|
519 |
msgid "Choose This Image"
|
520 |
msgstr ""
|
521 |
|
522 |
+
#: wp-maintenance.php:235
|
523 |
msgid "Choose Image"
|
524 |
msgstr ""
|
525 |
|
526 |
+
#: wp-maintenance.php:526
|
527 |
msgid "Dashboard"
|
528 |
msgstr ""
|
529 |
|
530 |
+
#: wp-maintenance.php:602
|
531 |
msgid "Days"
|
532 |
msgstr ""
|
533 |
|
534 |
+
#: wp-maintenance.php:602
|
535 |
msgid "Hours"
|
536 |
msgstr ""
|
537 |
|
538 |
+
#: wp-maintenance.php:602
|
539 |
msgid "Minutes"
|
540 |
msgstr ""
|
541 |
|
542 |
+
#: wp-maintenance.php:604
|
543 |
msgid "Seconds"
|
544 |
msgstr ""
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
|
2 |
Contributors: Florent73
|
3 |
Donate link: https://wpmaintenance.shost.ca/a-propos/
|
4 |
Tags: WordPress.com, maintenance, atttente, pause, travaux, construction, launch, coming soon
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 4.4
|
7 |
-
Stable tag: 2.7.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -67,11 +67,14 @@ Oui mais merci de me soumettre les modifications souhaitées afin de mettre à j
|
|
67 |
|
68 |
== Upgrade Notice ==
|
69 |
|
70 |
-
= 2.7.
|
71 |
Cette version est stable / This version is stable
|
72 |
|
73 |
== Changelog ==
|
74 |
|
|
|
|
|
|
|
75 |
= 2.7.0 =
|
76 |
* Correction de bugs. Compatible version 4.4 / Fixed bugs. Version 4.4 compatible
|
77 |
|
1 |
+
=== Plugin Name ===
|
2 |
Contributors: Florent73
|
3 |
Donate link: https://wpmaintenance.shost.ca/a-propos/
|
4 |
Tags: WordPress.com, maintenance, atttente, pause, travaux, construction, launch, coming soon
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 4.4.1
|
7 |
+
Stable tag: 2.7.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
67 |
|
68 |
== Upgrade Notice ==
|
69 |
|
70 |
+
= 2.7.1 =
|
71 |
Cette version est stable / This version is stable
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 2.7.1 =
|
76 |
+
* Correction de bugs. Ajout d'un calendrier. Compatible version 4.4.1 / Fixed bugs. Add calendar. Version 4.4.1 compatible
|
77 |
+
|
78 |
= 2.7.0 =
|
79 |
* Correction de bugs. Compatible version 4.4 / Fixed bugs. Version 4.4 compatible
|
80 |
|
wp-maintenance-admin.php
CHANGED
@@ -61,6 +61,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
|
|
61 |
#pattern li.current { background: #66CC00; color: #fff; }
|
62 |
</style>
|
63 |
<style type="text/css">.postbox h3 { cursor:pointer; }</style>
|
|
|
64 |
<div class="wrap">
|
65 |
|
66 |
<h2 style="font-size: 23px;font-weight: 400;padding: 9px 15px 4px 0px;line-height: 29px;">
|
@@ -95,11 +96,11 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
|
|
95 |
<!-- TEXTE PERSONNEL POUR LA PAGE -->
|
96 |
<li>
|
97 |
<h3><?php _e('Title and text for the maintenance page:', 'wp-maintenance'); ?></h3>
|
98 |
-
<?php _e('Title:', 'wp-maintenance'); ?><br /><input type="text" name="wp_maintenance_settings[titre_maintenance]" value="<?php echo stripslashes($paramMMode['titre_maintenance']); ?>" size="70" /><br />
|
99 |
<?php _e('Text:', 'wp-maintenance'); ?><br /><TEXTAREA NAME="wp_maintenance_settings[text_maintenance]" COLS=70 ROWS=4><?php echo stripslashes($paramMMode['text_maintenance']); ?></TEXTAREA>
|
100 |
<h3><?php _e('Text in the bottom of maintenance page:', 'wp-maintenance'); ?></h3>
|
101 |
-
<?php _e('Text:', 'wp-maintenance'); ?><br /><TEXTAREA NAME="wp_maintenance_settings[text_bt_maintenance]" COLS=70 ROWS=4><?php echo stripslashes($paramMMode['text_bt_maintenance']); ?></TEXTAREA><br /><br />
|
102 |
-
<input type= "checkbox" name="wp_maintenance_settings[add_wplogin]" value="1" <?php if($paramMMode['add_wplogin']==1) { echo ' checked'; } ?>> <?php _e('Enable login access in the bottom ?', 'wp-maintenance'); ?><br /><br />
|
103 |
<?php _e('Enter a text to go to the dashboard:', 'wp-maintenance'); ?><br />
|
104 |
<input type="text" name="wp_maintenance_settings[add_wplogin_title]" size="60" value="<?php echo stripslashes(trim($paramMMode['add_wplogin_title'])); ?>" /><br />
|
105 |
<small><?php _e('Eg: connect to %DASHBOARD% here!', 'wp-maintenance'); ?> <?php _e('(%DASHBOARD% will be replaced with the link to the dashboard and the word "Dashboard")', 'wp-maintenance'); ?></small>
|
@@ -138,7 +139,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
|
|
138 |
}
|
139 |
?>
|
140 |
</ul>
|
141 |
-
<script src="<?php echo WPM_PLUGIN_URL; ?>jquery.sortable.js"></script>
|
142 |
<script>
|
143 |
jQuery('.sortable').sortable();
|
144 |
</script>
|
@@ -429,40 +430,21 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
|
|
429 |
<div id="wpm-opt-compte" >
|
430 |
<ul>
|
431 |
<!-- ACTIVER COMPTEUR -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
<li><h3><?php _e('Enable a countdown ?', 'wp-maintenance'); ?></h3>
|
433 |
<input type= "checkbox" name="wp_maintenance_settings[active_cpt]" value="1" <?php if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1 ) { echo ' checked'; } ?>> <?php _e('Yes', 'wp-maintenance'); ?><br /><br />
|
434 |
-
<small><?php _e('
|
435 |
-
<
|
436 |
-
<?php
|
437 |
-
$ctpDate = array(
|
438 |
-
'01'=> 'jan',
|
439 |
-
'02' => 'fév',
|
440 |
-
'03' => 'mar',
|
441 |
-
'04' => 'avr',
|
442 |
-
'05' => 'mai',
|
443 |
-
'06' => 'juin',
|
444 |
-
'07' => 'juil',
|
445 |
-
'08' => 'août',
|
446 |
-
'09' => 'sept',
|
447 |
-
'10' => 'oct',
|
448 |
-
'11' => 'nov',
|
449 |
-
'12' => 'déc'
|
450 |
-
);
|
451 |
-
foreach($ctpDate as $a => $b) {
|
452 |
-
if( isset($paramMMode['date_cpt_mm']) && $paramMMode['date_cpt_mm']=='' && $a==date('m')) {
|
453 |
-
$addSelected = 'selected';
|
454 |
-
} elseif( isset($paramMMode['date_cpt_mm']) && $paramMMode['date_cpt_mm']!='' && $paramMMode['date_cpt_mm']==$a) {
|
455 |
-
$addSelected = 'selected';
|
456 |
-
} else {
|
457 |
-
$addSelected = '';
|
458 |
-
}
|
459 |
-
echo '<option value="'.$a.'" '.$addSelected.'>'.$a.' - '.$b.'</option>';
|
460 |
-
}
|
461 |
-
?>
|
462 |
-
</select>
|
463 |
-
<input type="text" name="wp_maintenance_settings[date_cpt_aa]" value="<?php if( isset($paramMMode['date_cpt_aa']) && $paramMMode['date_cpt_aa']!='') { echo $paramMMode['date_cpt_aa']; } else { echo date('Y'); } ?>" size="4" maxlength="4" autocomplete="off" /> à
|
464 |
-
<input type="text" name="wp_maintenance_settings[date_cpt_hh]" value="<?php if( isset($paramMMode['date_cpt_hh']) && $paramMMode['date_cpt_hh']!='') { echo $paramMMode['date_cpt_hh']; } else { echo date('H'); } ?>" size="2" maxlength="2" autocomplete="off" /> h <input type="text" name="wp_maintenance_settings[date_cpt_mn]" value="<?php if($paramMMode['date_cpt_mn']!='') { echo $paramMMode['date_cpt_mn']; } else { echo date('i'); } ?>" size="2" maxlength="2" autocomplete="off" /> min
|
465 |
-
<input type="hidden" name="wp_maintenance_settings[date_cpt_ss]" value="00" />
|
466 |
<br /><br />
|
467 |
<input type= "checkbox" name="wp_maintenance_settings[active_cpt_s]" value="1" <?php if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1) { echo ' checked'; } ?>> <?php _e('Enable seconds ?', 'wp-maintenance'); ?><br /><br />
|
468 |
<input type= "checkbox" name="wp_maintenance_settings[disable]" value="1" <?php if( isset($paramMMode['disable']) && $paramMMode['disable']==1) { echo ' checked'; } ?>> <?php _e('Disable maintenance mode at the end of the countdown?', 'wp-maintenance'); ?><br /><br />
|
@@ -479,6 +461,66 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
|
|
479 |
}
|
480 |
?>
|
481 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
</li>
|
483 |
<li> </li>
|
484 |
<li>
|
61 |
#pattern li.current { background: #66CC00; color: #fff; }
|
62 |
</style>
|
63 |
<style type="text/css">.postbox h3 { cursor:pointer; }</style>
|
64 |
+
<!--<script src="<?php echo WP_PLUGIN_URL; ?>/wp-maintenance/js/jquery-ui-timepicker-addon.js"></script>-->
|
65 |
<div class="wrap">
|
66 |
|
67 |
<h2 style="font-size: 23px;font-weight: 400;padding: 9px 15px 4px 0px;line-height: 29px;">
|
96 |
<!-- TEXTE PERSONNEL POUR LA PAGE -->
|
97 |
<li>
|
98 |
<h3><?php _e('Title and text for the maintenance page:', 'wp-maintenance'); ?></h3>
|
99 |
+
<?php _e('Title:', 'wp-maintenance'); ?><br /><input type="text" name="wp_maintenance_settings[titre_maintenance]" value="<?php if( isset($paramMMode['titre_maintenance']) ) { echo stripslashes($paramMMode['titre_maintenance']); } ?>" size="70" /><br />
|
100 |
<?php _e('Text:', 'wp-maintenance'); ?><br /><TEXTAREA NAME="wp_maintenance_settings[text_maintenance]" COLS=70 ROWS=4><?php echo stripslashes($paramMMode['text_maintenance']); ?></TEXTAREA>
|
101 |
<h3><?php _e('Text in the bottom of maintenance page:', 'wp-maintenance'); ?></h3>
|
102 |
+
<?php _e('Text:', 'wp-maintenance'); ?><br /><TEXTAREA NAME="wp_maintenance_settings[text_bt_maintenance]" COLS=70 ROWS=4><?php if( isset($paramMMode['text_bt_maintenance']) ) { echo stripslashes($paramMMode['text_bt_maintenance']); } ?></TEXTAREA><br /><br />
|
103 |
+
<input type= "checkbox" name="wp_maintenance_settings[add_wplogin]" value="1" <?php if( isset($paramMMode['add_wplogin']) && $paramMMode['add_wplogin']==1 ) { echo ' checked'; } ?>> <?php _e('Enable login access in the bottom ?', 'wp-maintenance'); ?><br /><br />
|
104 |
<?php _e('Enter a text to go to the dashboard:', 'wp-maintenance'); ?><br />
|
105 |
<input type="text" name="wp_maintenance_settings[add_wplogin_title]" size="60" value="<?php echo stripslashes(trim($paramMMode['add_wplogin_title'])); ?>" /><br />
|
106 |
<small><?php _e('Eg: connect to %DASHBOARD% here!', 'wp-maintenance'); ?> <?php _e('(%DASHBOARD% will be replaced with the link to the dashboard and the word "Dashboard")', 'wp-maintenance'); ?></small>
|
139 |
}
|
140 |
?>
|
141 |
</ul>
|
142 |
+
<script src="<?php echo WPM_PLUGIN_URL; ?>js/jquery.sortable.js"></script>
|
143 |
<script>
|
144 |
jQuery('.sortable').sortable();
|
145 |
</script>
|
430 |
<div id="wpm-opt-compte" >
|
431 |
<ul>
|
432 |
<!-- ACTIVER COMPTEUR -->
|
433 |
+
<?php
|
434 |
+
|
435 |
+
// Old version compte à rebours
|
436 |
+
if( isset($paramMMode['date_cpt_jj']) && empty($paramMMode['cptdate']) ) {
|
437 |
+
$paramMMode['cptdate'] = $paramMMode['date_cpt_aa'].'/'.$paramMMode['date_cpt_mm'].'/'.$paramMMode['date_cpt_jj'];
|
438 |
+
}
|
439 |
+
if( isset($paramMMode['date_cpt_hh']) && empty($paramMMode['cpttime']) ) {
|
440 |
+
$paramMMode['cpttime'] = $paramMMode['date_cpt_hh'].':'.$paramMMode['date_cpt_mn'];
|
441 |
+
}
|
442 |
+
|
443 |
+
?>
|
444 |
<li><h3><?php _e('Enable a countdown ?', 'wp-maintenance'); ?></h3>
|
445 |
<input type= "checkbox" name="wp_maintenance_settings[active_cpt]" value="1" <?php if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1 ) { echo ' checked'; } ?>> <?php _e('Yes', 'wp-maintenance'); ?><br /><br />
|
446 |
+
<small><?php _e('Select the launch date/time', 'wp-maintenance'); ?></small><br /><img src="<?php echo WP_PLUGIN_URL.'/wp-maintenance/images/schedule_clock.png'; ?>" class="datepicker" width="48" height="48" style="vertical-align: middle;margin-right:5px;"> <input id="cptdate" class="datepicker" name="wp_maintenance_settings[cptdate]" type="text" autofocuss data-value="<?php if( isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate']) ) { echo $paramMMode['cptdate']; } else { echo date('d').'/'.date('m').'/'.date('Y'); } ?>"> à <input id="cpttime" class="timepicker" type="time" name="wp_maintenance_settings[cpttime]" value="<?php if( isset($paramMMode['cpttime']) && !empty($paramMMode['cpttime']) ) { echo $paramMMode['cpttime']; } else { echo date('H:m'); }?>" size="4" autofocuss>
|
447 |
+
<div id="wpmdatecontainer"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
<br /><br />
|
449 |
<input type= "checkbox" name="wp_maintenance_settings[active_cpt_s]" value="1" <?php if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1) { echo ' checked'; } ?>> <?php _e('Enable seconds ?', 'wp-maintenance'); ?><br /><br />
|
450 |
<input type= "checkbox" name="wp_maintenance_settings[disable]" value="1" <?php if( isset($paramMMode['disable']) && $paramMMode['disable']==1) { echo ' checked'; } ?>> <?php _e('Disable maintenance mode at the end of the countdown?', 'wp-maintenance'); ?><br /><br />
|
461 |
}
|
462 |
?>
|
463 |
</select>
|
464 |
+
|
465 |
+
<script type="text/javascript">
|
466 |
+
|
467 |
+
jQuery(document).ready(function() {
|
468 |
+
|
469 |
+
var $input = jQuery( '.datepicker' ).pickadate({
|
470 |
+
formatSubmit: 'yyyy/mm/dd',
|
471 |
+
container: '#wpmdatecontainer',
|
472 |
+
closeOnSelect: true,
|
473 |
+
closeOnClear: false,
|
474 |
+
firstDay: 1,
|
475 |
+
min: new Date(<?php echo date('Y').','.(date('m')-1).','.date('d'); ?>),
|
476 |
+
monthsFull: [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ],
|
477 |
+
monthsShort: [ 'Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec' ],
|
478 |
+
weekdaysShort: [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ],
|
479 |
+
today: "<?php _e('Today', 'wp-maintenance'); ?>",
|
480 |
+
clear: '<?php _e('Delete', 'wp-maintenance'); ?>',
|
481 |
+
close: '<?php _e('Close', 'wp-maintenance'); ?>',
|
482 |
+
|
483 |
+
// Accessibility labels
|
484 |
+
labelMonthNext: '<?php _e('Next month', 'wp-maintenance'); ?>',
|
485 |
+
labelMonthPrev: '<?php _e('Previous month', 'wp-maintenance'); ?>',
|
486 |
+
labelMonthSelect: '<?php _e('Select a month', 'wp-maintenance'); ?>',
|
487 |
+
labelYearSelect: '<?php _e('Select a year', 'wp-maintenance'); ?>',
|
488 |
+
|
489 |
+
selectMonths: true,
|
490 |
+
selectYears: true,
|
491 |
+
|
492 |
+
|
493 |
+
})
|
494 |
+
|
495 |
+
var picker = $input.pickadate('picker')
|
496 |
+
|
497 |
+
// picker.set('select', '14 October, 2014')
|
498 |
+
// picker.open()
|
499 |
+
|
500 |
+
// $('button').on('click', function() {
|
501 |
+
// picker.set('disable', true);
|
502 |
+
// });
|
503 |
+
var $input = jQuery( '.timepicker' ).pickatime({
|
504 |
+
//container: '#wpmtimecontainer',
|
505 |
+
clear: '<?php _e('Close', 'wp-maintenance'); ?>',
|
506 |
+
interval: 30,
|
507 |
+
format: 'HH:i', // retour ce format dans le input
|
508 |
+
formatSubmit: 'HH:i', // return ce format en post
|
509 |
+
formatLabel: '<b>HH</b>:i', // Affichage
|
510 |
+
//min: -0.5, // heure minimum
|
511 |
+
/*formatLabel: function(time) {
|
512 |
+
var hours = ( time.pick - this.get('now').pick ) / 60,
|
513 |
+
label = hours < 0 ? ' !hours to now' : hours > 0 ? ' !heures' : ''
|
514 |
+
return 'HH:i <sm!all>(->' + ( hours ? Math.abs(hours) : '' ) + label +')</sm!all>'
|
515 |
+
}*/
|
516 |
+
})
|
517 |
+
var picker = $input.pickatime('picker')
|
518 |
+
// picker.open()
|
519 |
+
|
520 |
+
|
521 |
+
});
|
522 |
+
|
523 |
+
</script>
|
524 |
</li>
|
525 |
<li> </li>
|
526 |
<li>
|
wp-maintenance.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* Description: Le plugin WP Maintenance vous permet de mettre votre site en attente le temps pour vous de faire une maintenance ou du lancement de votre site. Personnalisez cette page de maintenance avec une image, un compte à rebours, etc... / The WP Maintenance plugin allows you to put your website on the waiting time for you to do maintenance or launch your website. Personalize this page with picture, countdown...
|
7 |
* Author: Florent Maillefaud
|
8 |
* Author URI: https://wpmaintenance.shost.ca
|
9 |
-
* Version: 2.7.
|
10 |
* Text Domain: wp-maintenance
|
11 |
* Domain Path: /languages/
|
12 |
*/
|
@@ -14,6 +14,7 @@
|
|
14 |
|
15 |
/*
|
16 |
Change Log
|
|
|
17 |
06/12/2015 - Autorise certaines IP
|
18 |
04/12/2015 - Correction notice php (undefined index)
|
19 |
17/09/2015 - Ajout accès au tableau de bord
|
@@ -70,6 +71,18 @@ function wpm_plugin_actions ( $links ) {
|
|
70 |
return $links;
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
// multilingue
|
74 |
add_action( 'init', 'wpm_make_multilang' );
|
75 |
function wpm_make_multilang() {
|
@@ -77,7 +90,7 @@ function wpm_make_multilang() {
|
|
77 |
}
|
78 |
|
79 |
/* Ajoute la version dans les options */
|
80 |
-
define('WPM_VERSION', '2.7.
|
81 |
$option['wp_maintenance_version'] = WPM_VERSION;
|
82 |
if( !get_option('wp_maintenance_version') ) {
|
83 |
add_option('wp_maintenance_version', $option);
|
@@ -202,11 +215,17 @@ function wpm_protocole() {
|
|
202 |
}
|
203 |
|
204 |
function wpm_admin_scripts() {
|
|
|
205 |
wp_enqueue_script('media-upload');
|
206 |
wp_enqueue_script('thickbox');
|
207 |
-
|
|
|
208 |
wp_enqueue_script('wpm-my-upload');
|
209 |
|
|
|
|
|
|
|
|
|
210 |
// If you're not including an image upload then you can leave this function call out
|
211 |
wp_enqueue_media();
|
212 |
|
@@ -218,26 +237,45 @@ function wpm_admin_scripts() {
|
|
218 |
|
219 |
|
220 |
//if( wpm_protocole()=='' ) {
|
221 |
-
wp_register_script('wpm-admin-settings', WP_PLUGIN_URL.'/wp-maintenance/wpm-admin-settings.js');
|
222 |
wp_enqueue_script('wpm-admin-settings');
|
223 |
//}
|
224 |
}
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
add_action( 'admin_enqueue_scripts', 'wpm_enqueue_color_picker' );
|
227 |
function wpm_enqueue_color_picker( $hook_suffix ) {
|
228 |
// first check that $hook_suffix is appropriate for your admin page
|
229 |
wp_enqueue_style( 'wp-color-picker' );
|
230 |
-
wp_enqueue_script( 'my-script-handle', plugins_url('wpm-color-options.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
|
231 |
}
|
232 |
|
233 |
function wpm_admin_styles() {
|
234 |
wp_enqueue_style('thickbox');
|
|
|
235 |
}
|
236 |
|
237 |
if (isset($_GET['page']) && $_GET['page'] == 'wp-maintenance/wp-maintenance.php') {
|
238 |
add_action('admin_print_scripts', 'wpm_admin_scripts');
|
239 |
add_action('admin_print_styles', 'wpm_admin_styles');
|
240 |
add_action('admin_print_scripts', 'wpm_admin_scripts');
|
|
|
241 |
}
|
242 |
|
243 |
function wpm_change_active($value = 0) {
|
@@ -298,7 +336,7 @@ function wpm_social_shortcode( $atts ) {
|
|
298 |
$content = '';
|
299 |
// Si on est en mobile on réduit les icones
|
300 |
if ( wp_is_mobile() ) {
|
301 |
-
|
302 |
}
|
303 |
|
304 |
// Attributes
|
@@ -425,8 +463,11 @@ function wpm_maintenance_mode() {
|
|
425 |
if( !isset($paramMMode['color_txt']) || $paramMMode['color_txt']=="") { $paramMMode['color_txt'] = "#888888"; }
|
426 |
|
427 |
/* Date compte à rebours / Convertie en format US */
|
428 |
-
|
429 |
-
|
|
|
|
|
|
|
430 |
|
431 |
/* Traitement de la feuille de style */
|
432 |
$styleRemplacements = array (
|
@@ -540,10 +581,11 @@ body {
|
|
540 |
background-repeat: '.$paramMMode['b_repeat_image'].';
|
541 |
'.$optionBackground.'
|
542 |
}'; }
|
543 |
-
|
544 |
/*********** AJOUT COMPTEUR SUIVANT LES PARAMETRES *********/
|
545 |
if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1) {
|
546 |
-
|
|
|
547 |
$Counter = '
|
548 |
<div id="countdown">
|
549 |
<script language="JavaScript">
|
@@ -566,9 +608,9 @@ body {
|
|
566 |
FinishMessage = "'.stripslashes($paramMMode['message_cpt_fin']).'";
|
567 |
</script>';
|
568 |
$Counter .= '
|
569 |
-
<script language="JavaScript" src="'.WP_PLUGIN_URL.'/wp-maintenance/wpm-cpt-script.js"></script>
|
570 |
</div>';
|
571 |
-
}
|
572 |
}
|
573 |
|
574 |
/*********** AJOUT DU STYLE SUIVANT LES PARAMETRES *********/
|
@@ -579,6 +621,11 @@ body {
|
|
579 |
}
|
580 |
$wpmFonts .= ');';
|
581 |
|
|
|
|
|
|
|
|
|
|
|
582 |
$wpmStyle .= ''.$addBImage.'
|
583 |
.wpm_social_icon {
|
584 |
float:left;
|
@@ -719,7 +766,8 @@ $wpmStyle .= '
|
|
719 |
}
|
720 |
|
721 |
}
|
722 |
-
add_action('
|
|
|
723 |
|
724 |
if(function_exists('register_deactivation_hook')) {
|
725 |
register_deactivation_hook(__FILE__, 'wpm_uninstall');
|
6 |
* Description: Le plugin WP Maintenance vous permet de mettre votre site en attente le temps pour vous de faire une maintenance ou du lancement de votre site. Personnalisez cette page de maintenance avec une image, un compte à rebours, etc... / The WP Maintenance plugin allows you to put your website on the waiting time for you to do maintenance or launch your website. Personalize this page with picture, countdown...
|
7 |
* Author: Florent Maillefaud
|
8 |
* Author URI: https://wpmaintenance.shost.ca
|
9 |
+
* Version: 2.7.1
|
10 |
* Text Domain: wp-maintenance
|
11 |
* Domain Path: /languages/
|
12 |
*/
|
14 |
|
15 |
/*
|
16 |
Change Log
|
17 |
+
11/12/2015 - Corrige le bug couleur de fond. Ajout DatePicker pour compteur
|
18 |
06/12/2015 - Autorise certaines IP
|
19 |
04/12/2015 - Correction notice php (undefined index)
|
20 |
17/09/2015 - Ajout accès au tableau de bord
|
71 |
return $links;
|
72 |
}
|
73 |
|
74 |
+
/* DATEPICKER */
|
75 |
+
add_action( 'init', 'wpm_date_picker' );
|
76 |
+
function wpm_date_picker() {
|
77 |
+
wp_enqueue_script( 'jquery' );
|
78 |
+
//wp_enqueue_script( 'jquery-ui-core' );
|
79 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
80 |
+
//wp_enqueue_script( 'jquery-datepicker', WP_PLUGIN_URL.'/'.WPSPO_NAME_DIR.'/wpspo-js/jquery.ui.datepicker.min.js', array('jquery', 'jquery-ui-core' ) );
|
81 |
+
//wp_enqueue_script('jquery-ui-fr-datepicker', WP_PLUGIN_URL.'/'.WPSPO_NAME_DIR.'/wpspo-js/jquery.ui.datepicker-fr.js', array('jquery-ui-datepicker'));
|
82 |
+
wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
// multilingue
|
87 |
add_action( 'init', 'wpm_make_multilang' );
|
88 |
function wpm_make_multilang() {
|
90 |
}
|
91 |
|
92 |
/* Ajoute la version dans les options */
|
93 |
+
define('WPM_VERSION', '2.7.1');
|
94 |
$option['wp_maintenance_version'] = WPM_VERSION;
|
95 |
if( !get_option('wp_maintenance_version') ) {
|
96 |
add_option('wp_maintenance_version', $option);
|
215 |
}
|
216 |
|
217 |
function wpm_admin_scripts() {
|
218 |
+
|
219 |
wp_enqueue_script('media-upload');
|
220 |
wp_enqueue_script('thickbox');
|
221 |
+
|
222 |
+
wp_register_script('wpm-my-upload', WP_PLUGIN_URL.'/wp-maintenance/js/wpm-script.js', array('jquery','media-upload','thickbox'));
|
223 |
wp_enqueue_script('wpm-my-upload');
|
224 |
|
225 |
+
wp_enqueue_style('jquery-defaut-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.css');
|
226 |
+
wp_enqueue_style('jquery-date-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.date.css');
|
227 |
+
wp_enqueue_style('jquery-time-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.time.css');
|
228 |
+
|
229 |
// If you're not including an image upload then you can leave this function call out
|
230 |
wp_enqueue_media();
|
231 |
|
237 |
|
238 |
|
239 |
//if( wpm_protocole()=='' ) {
|
240 |
+
wp_register_script('wpm-admin-settings', WP_PLUGIN_URL.'/wp-maintenance/js/wpm-admin-settings.js');
|
241 |
wp_enqueue_script('wpm-admin-settings');
|
242 |
//}
|
243 |
}
|
244 |
|
245 |
+
//}
|
246 |
+
add_action('admin_footer', 'wpm_print_footer_scripts');
|
247 |
+
function wpm_print_footer_scripts() {
|
248 |
+
wp_register_script('wpm-picker', WP_PLUGIN_URL.'/wp-maintenance/js/lib/picker.js');
|
249 |
+
wp_enqueue_script('wpm-picker');
|
250 |
+
wp_register_script('wpm-datepicker', WP_PLUGIN_URL.'/wp-maintenance/js/lib/picker.date.js');
|
251 |
+
wp_enqueue_script('wpm-datepicker');
|
252 |
+
wp_register_script('wpm-timepicker', WP_PLUGIN_URL.'/wp-maintenance/js/lib/picker.time.js');
|
253 |
+
wp_enqueue_script('wpm-timepicker');
|
254 |
+
wp_register_script('wpm-legacy', WP_PLUGIN_URL.'/wp-maintenance/js/lib/legacy.js');
|
255 |
+
wp_enqueue_script('wpm-legacy');
|
256 |
+
//wp_register_script('wpm-footerscripts', WP_PLUGIN_URL.'/wp-maintenance/js/wpm-footer-scripts.js');
|
257 |
+
//wp_enqueue_script('wpm-footerscripts');
|
258 |
+
//$url = WP_PLUGIN_URL.'/wp-maintenance/js/wpm-footer-scripts.js';
|
259 |
+
//echo '"<script type="text/javascript" src="'. $url . '"></script>"';
|
260 |
+
}
|
261 |
+
|
262 |
add_action( 'admin_enqueue_scripts', 'wpm_enqueue_color_picker' );
|
263 |
function wpm_enqueue_color_picker( $hook_suffix ) {
|
264 |
// first check that $hook_suffix is appropriate for your admin page
|
265 |
wp_enqueue_style( 'wp-color-picker' );
|
266 |
+
wp_enqueue_script( 'my-script-handle', plugins_url('js/wpm-color-options.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
|
267 |
}
|
268 |
|
269 |
function wpm_admin_styles() {
|
270 |
wp_enqueue_style('thickbox');
|
271 |
+
wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
272 |
}
|
273 |
|
274 |
if (isset($_GET['page']) && $_GET['page'] == 'wp-maintenance/wp-maintenance.php') {
|
275 |
add_action('admin_print_scripts', 'wpm_admin_scripts');
|
276 |
add_action('admin_print_styles', 'wpm_admin_styles');
|
277 |
add_action('admin_print_scripts', 'wpm_admin_scripts');
|
278 |
+
//add_action('admin_footer', 'wpm_print_scripts');
|
279 |
}
|
280 |
|
281 |
function wpm_change_active($value = 0) {
|
336 |
$content = '';
|
337 |
// Si on est en mobile on réduit les icones
|
338 |
if ( wp_is_mobile() ) {
|
339 |
+
$paramSocialOption['size'] = 24;
|
340 |
}
|
341 |
|
342 |
// Attributes
|
463 |
if( !isset($paramMMode['color_txt']) || $paramMMode['color_txt']=="") { $paramMMode['color_txt'] = "#888888"; }
|
464 |
|
465 |
/* Date compte à rebours / Convertie en format US */
|
466 |
+
if( isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate']) && isset($paramMMode['cpttime']) ) {
|
467 |
+
$timestamp = strtotime($paramMMode['cptdate'].' '.$paramMMode['cpttime']);
|
468 |
+
$dateCpt = date('m/d/Y h:i A', $timestamp);
|
469 |
+
}
|
470 |
+
|
471 |
|
472 |
/* Traitement de la feuille de style */
|
473 |
$styleRemplacements = array (
|
581 |
background-repeat: '.$paramMMode['b_repeat_image'].';
|
582 |
'.$optionBackground.'
|
583 |
}'; }
|
584 |
+
|
585 |
/*********** AJOUT COMPTEUR SUIVANT LES PARAMETRES *********/
|
586 |
if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1) {
|
587 |
+
|
588 |
+
if( isset($paramMMode['message_cpt_fin']) && $paramMMode['message_cpt_fin']!='' && (isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate'])) ) {
|
589 |
$Counter = '
|
590 |
<div id="countdown">
|
591 |
<script language="JavaScript">
|
608 |
FinishMessage = "'.stripslashes($paramMMode['message_cpt_fin']).'";
|
609 |
</script>';
|
610 |
$Counter .= '
|
611 |
+
<script language="JavaScript" src="'.WP_PLUGIN_URL.'/wp-maintenance/js/wpm-cpt-script.js"></script>
|
612 |
</div>';
|
613 |
+
}
|
614 |
}
|
615 |
|
616 |
/*********** AJOUT DU STYLE SUIVANT LES PARAMETRES *********/
|
621 |
}
|
622 |
$wpmFonts .= ');';
|
623 |
|
624 |
+
/* Si on a une couleur de fond */
|
625 |
+
if( isset($paramMMode['color_bg']) && $paramMMode['color_bg']!='' ) {
|
626 |
+
$wpmStyle .= 'body { background-color: '.$paramMMode['color_bg'].'; }';
|
627 |
+
}
|
628 |
+
|
629 |
$wpmStyle .= ''.$addBImage.'
|
630 |
.wpm_social_icon {
|
631 |
float:left;
|
766 |
}
|
767 |
|
768 |
}
|
769 |
+
add_action('template_redirect', 'wpm_maintenance_mode');
|
770 |
+
//add_action('get_header', 'wpm_maintenance_mode');
|
771 |
|
772 |
if(function_exists('register_deactivation_hook')) {
|
773 |
register_deactivation_hook(__FILE__, 'wpm_uninstall');
|