jekyll-theme-anatole 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +19 -0
- data/README.md +57 -0
- data/_config.yml +104 -0
- data/_includes/footer.html +4 -0
- data/_includes/head.html +12 -0
- data/_includes/navbar.html +21 -0
- data/_includes/sidebar.html +23 -0
- data/_includes/taxonomy/categories.html +5 -0
- data/_includes/taxonomy/tags.html +5 -0
- data/_layouts/categories.html +38 -0
- data/_layouts/category.html +24 -0
- data/_layouts/default.html +16 -0
- data/_layouts/list.html +24 -0
- data/_layouts/page.html +28 -0
- data/_layouts/post.html +5 -0
- data/_layouts/tag.html +24 -0
- data/_layouts/tags.html +38 -0
- data/_sass/_style.scss +973 -0
- data/assets/css/main.scss +4 -0
- data/assets/images/profile_picture.svg +16 -0
- data/assets/js/anatole-header.js +72 -0
- data/assets/js/jquery-appear.js +127 -0
- data/assets/js/jquery-migrate.js +882 -0
- data/assets/js/jquery.js +10840 -0
- data/assets/js/medium-zoom.js +566 -0
- metadata +84 -0
@@ -0,0 +1,882 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Migrate - v3.3.0 - 2020-05-05T01:57Z
|
3
|
+
* Copyright OpenJS Foundation and other contributors
|
4
|
+
*/
|
5
|
+
(function (factory) {
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
if (typeof define === "function" && define.amd) {
|
9
|
+
// AMD. Register as an anonymous module.
|
10
|
+
define(["jquery"], function (jQuery) {
|
11
|
+
return factory(jQuery, window);
|
12
|
+
});
|
13
|
+
} else if (typeof module === "object" && module.exports) {
|
14
|
+
// Node/CommonJS
|
15
|
+
// eslint-disable-next-line no-undef
|
16
|
+
module.exports = factory(require("jquery"), window);
|
17
|
+
} else {
|
18
|
+
// Browser globals
|
19
|
+
factory(jQuery, window);
|
20
|
+
}
|
21
|
+
})(function (jQuery, window) {
|
22
|
+
"use strict";
|
23
|
+
|
24
|
+
jQuery.migrateVersion = "3.3.0";
|
25
|
+
|
26
|
+
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
|
27
|
+
function compareVersions(v1, v2) {
|
28
|
+
var i,
|
29
|
+
rVersionParts = /^(\d+)\.(\d+)\.(\d+)/,
|
30
|
+
v1p = rVersionParts.exec(v1) || [],
|
31
|
+
v2p = rVersionParts.exec(v2) || [];
|
32
|
+
|
33
|
+
for (i = 1; i <= 3; i++) {
|
34
|
+
if (+v1p[i] > +v2p[i]) {
|
35
|
+
return 1;
|
36
|
+
}
|
37
|
+
if (+v1p[i] < +v2p[i]) {
|
38
|
+
return -1;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
return 0;
|
42
|
+
}
|
43
|
+
|
44
|
+
function jQueryVersionSince(version) {
|
45
|
+
return compareVersions(jQuery.fn.jquery, version) >= 0;
|
46
|
+
}
|
47
|
+
|
48
|
+
(function () {
|
49
|
+
// Support: IE9 only
|
50
|
+
// IE9 only creates console object when dev tools are first opened
|
51
|
+
// IE9 console is a host object, callable but doesn't have .apply()
|
52
|
+
if (!window.console || !window.console.log) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
|
56
|
+
// Need jQuery 3.0.0+ and no older Migrate loaded
|
57
|
+
if (!jQuery || !jQueryVersionSince("3.0.0")) {
|
58
|
+
window.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED");
|
59
|
+
}
|
60
|
+
if (jQuery.migrateWarnings) {
|
61
|
+
window.console.log("JQMIGRATE: Migrate plugin loaded multiple times");
|
62
|
+
}
|
63
|
+
|
64
|
+
// Show a message on the console so devs know we're active
|
65
|
+
window.console.log(
|
66
|
+
"JQMIGRATE: Migrate is installed" +
|
67
|
+
(jQuery.migrateMute ? "" : " with logging active") +
|
68
|
+
", version " +
|
69
|
+
jQuery.migrateVersion
|
70
|
+
);
|
71
|
+
})();
|
72
|
+
|
73
|
+
var warnedAbout = {};
|
74
|
+
|
75
|
+
// By default each warning is only reported once.
|
76
|
+
jQuery.migrateDeduplicateWarnings = true;
|
77
|
+
|
78
|
+
// List of warnings already given; public read only
|
79
|
+
jQuery.migrateWarnings = [];
|
80
|
+
|
81
|
+
// Set to false to disable traces that appear with warnings
|
82
|
+
if (jQuery.migrateTrace === undefined) {
|
83
|
+
jQuery.migrateTrace = true;
|
84
|
+
}
|
85
|
+
|
86
|
+
// Forget any warnings we've already given; public
|
87
|
+
jQuery.migrateReset = function () {
|
88
|
+
warnedAbout = {};
|
89
|
+
jQuery.migrateWarnings.length = 0;
|
90
|
+
};
|
91
|
+
|
92
|
+
function migrateWarn(msg) {
|
93
|
+
var console = window.console;
|
94
|
+
if (!jQuery.migrateDeduplicateWarnings || !warnedAbout[msg]) {
|
95
|
+
warnedAbout[msg] = true;
|
96
|
+
jQuery.migrateWarnings.push(msg);
|
97
|
+
if (console && console.warn && !jQuery.migrateMute) {
|
98
|
+
console.warn("JQMIGRATE: " + msg);
|
99
|
+
if (jQuery.migrateTrace && console.trace) {
|
100
|
+
console.trace();
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
function migrateWarnProp(obj, prop, value, msg) {
|
107
|
+
Object.defineProperty(obj, prop, {
|
108
|
+
configurable: true,
|
109
|
+
enumerable: true,
|
110
|
+
get: function () {
|
111
|
+
migrateWarn(msg);
|
112
|
+
return value;
|
113
|
+
},
|
114
|
+
set: function (newValue) {
|
115
|
+
migrateWarn(msg);
|
116
|
+
value = newValue;
|
117
|
+
},
|
118
|
+
});
|
119
|
+
}
|
120
|
+
|
121
|
+
function migrateWarnFunc(obj, prop, newFunc, msg) {
|
122
|
+
obj[prop] = function () {
|
123
|
+
migrateWarn(msg);
|
124
|
+
return newFunc.apply(this, arguments);
|
125
|
+
};
|
126
|
+
}
|
127
|
+
|
128
|
+
if (window.document.compatMode === "BackCompat") {
|
129
|
+
// JQuery has never supported or tested Quirks Mode
|
130
|
+
migrateWarn("jQuery is not compatible with Quirks Mode");
|
131
|
+
}
|
132
|
+
|
133
|
+
var findProp,
|
134
|
+
class2type = {},
|
135
|
+
oldInit = jQuery.fn.init,
|
136
|
+
oldFind = jQuery.find,
|
137
|
+
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
|
138
|
+
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
|
139
|
+
// Support: Android <=4.0 only
|
140
|
+
// Make sure we trim BOM and NBSP
|
141
|
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
142
|
+
|
143
|
+
jQuery.fn.init = function (arg1) {
|
144
|
+
var args = Array.prototype.slice.call(arguments);
|
145
|
+
|
146
|
+
if (typeof arg1 === "string" && arg1 === "#") {
|
147
|
+
// JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
|
148
|
+
migrateWarn("jQuery( '#' ) is not a valid selector");
|
149
|
+
args[0] = [];
|
150
|
+
}
|
151
|
+
|
152
|
+
return oldInit.apply(this, args);
|
153
|
+
};
|
154
|
+
jQuery.fn.init.prototype = jQuery.fn;
|
155
|
+
|
156
|
+
jQuery.find = function (selector) {
|
157
|
+
var args = Array.prototype.slice.call(arguments);
|
158
|
+
|
159
|
+
// Support: PhantomJS 1.x
|
160
|
+
// String#match fails to match when used with a //g RegExp, only on some strings
|
161
|
+
if (typeof selector === "string" && rattrHashTest.test(selector)) {
|
162
|
+
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
163
|
+
// First see if qS thinks it's a valid selector, if so avoid a false positive
|
164
|
+
try {
|
165
|
+
window.document.querySelector(selector);
|
166
|
+
} catch (err1) {
|
167
|
+
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
|
168
|
+
selector = selector.replace(rattrHashGlob, function (_, attr, op, value) {
|
169
|
+
return "[" + attr + op + '"' + value + '"]';
|
170
|
+
});
|
171
|
+
|
172
|
+
// If the regexp *may* have created an invalid selector, don't update it
|
173
|
+
// Note that there may be false alarms if selector uses jQuery extensions
|
174
|
+
try {
|
175
|
+
window.document.querySelector(selector);
|
176
|
+
migrateWarn("Attribute selector with '#' must be quoted: " + args[0]);
|
177
|
+
args[0] = selector;
|
178
|
+
} catch (err2) {
|
179
|
+
migrateWarn("Attribute selector with '#' was not fixed: " + args[0]);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
return oldFind.apply(this, args);
|
185
|
+
};
|
186
|
+
|
187
|
+
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
|
188
|
+
for (findProp in oldFind) {
|
189
|
+
if (Object.prototype.hasOwnProperty.call(oldFind, findProp)) {
|
190
|
+
jQuery.find[findProp] = oldFind[findProp];
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
// The number of elements contained in the matched element set
|
195
|
+
migrateWarnFunc(
|
196
|
+
jQuery.fn,
|
197
|
+
"size",
|
198
|
+
function () {
|
199
|
+
return this.length;
|
200
|
+
},
|
201
|
+
"jQuery.fn.size() is deprecated and removed; use the .length property"
|
202
|
+
);
|
203
|
+
|
204
|
+
migrateWarnFunc(
|
205
|
+
jQuery,
|
206
|
+
"parseJSON",
|
207
|
+
function () {
|
208
|
+
return JSON.parse.apply(null, arguments);
|
209
|
+
},
|
210
|
+
"jQuery.parseJSON is deprecated; use JSON.parse"
|
211
|
+
);
|
212
|
+
|
213
|
+
migrateWarnFunc(jQuery, "holdReady", jQuery.holdReady, "jQuery.holdReady is deprecated");
|
214
|
+
|
215
|
+
migrateWarnFunc(
|
216
|
+
jQuery,
|
217
|
+
"unique",
|
218
|
+
jQuery.uniqueSort,
|
219
|
+
"jQuery.unique is deprecated; use jQuery.uniqueSort"
|
220
|
+
);
|
221
|
+
|
222
|
+
// Now jQuery.expr.pseudos is the standard incantation
|
223
|
+
migrateWarnProp(
|
224
|
+
jQuery.expr,
|
225
|
+
"filters",
|
226
|
+
jQuery.expr.pseudos,
|
227
|
+
"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"
|
228
|
+
);
|
229
|
+
migrateWarnProp(
|
230
|
+
jQuery.expr,
|
231
|
+
":",
|
232
|
+
jQuery.expr.pseudos,
|
233
|
+
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"
|
234
|
+
);
|
235
|
+
|
236
|
+
// Prior to jQuery 3.1.1 there were internal refs so we don't warn there
|
237
|
+
if (jQueryVersionSince("3.1.1")) {
|
238
|
+
migrateWarnFunc(
|
239
|
+
jQuery,
|
240
|
+
"trim",
|
241
|
+
function (text) {
|
242
|
+
return text == null ? "" : (text + "").replace(rtrim, "");
|
243
|
+
},
|
244
|
+
"jQuery.trim is deprecated; use String.prototype.trim"
|
245
|
+
);
|
246
|
+
}
|
247
|
+
|
248
|
+
// Prior to jQuery 3.2 there were internal refs so we don't warn there
|
249
|
+
if (jQueryVersionSince("3.2.0")) {
|
250
|
+
migrateWarnFunc(
|
251
|
+
jQuery,
|
252
|
+
"nodeName",
|
253
|
+
function (elem, name) {
|
254
|
+
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
255
|
+
},
|
256
|
+
"jQuery.nodeName is deprecated"
|
257
|
+
);
|
258
|
+
}
|
259
|
+
|
260
|
+
if (jQueryVersionSince("3.3.0")) {
|
261
|
+
migrateWarnFunc(
|
262
|
+
jQuery,
|
263
|
+
"isNumeric",
|
264
|
+
function (obj) {
|
265
|
+
// As of jQuery 3.0, isNumeric is limited to
|
266
|
+
// strings and numbers (primitives or objects)
|
267
|
+
// that can be coerced to finite numbers (gh-2662)
|
268
|
+
var type = typeof obj;
|
269
|
+
return (
|
270
|
+
(type === "number" || type === "string") &&
|
271
|
+
// parseFloat NaNs numeric-cast false positives ("")
|
272
|
+
// ...but misinterprets leading-number strings, e.g. hex literals ("0x...")
|
273
|
+
// subtraction forces infinities to NaN
|
274
|
+
!isNaN(obj - parseFloat(obj))
|
275
|
+
);
|
276
|
+
},
|
277
|
+
"jQuery.isNumeric() is deprecated"
|
278
|
+
);
|
279
|
+
|
280
|
+
// Populate the class2type map
|
281
|
+
jQuery.each(
|
282
|
+
"Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
|
283
|
+
function (_, name) {
|
284
|
+
class2type["[object " + name + "]"] = name.toLowerCase();
|
285
|
+
}
|
286
|
+
);
|
287
|
+
|
288
|
+
migrateWarnFunc(
|
289
|
+
jQuery,
|
290
|
+
"type",
|
291
|
+
function (obj) {
|
292
|
+
if (obj == null) {
|
293
|
+
return obj + "";
|
294
|
+
}
|
295
|
+
|
296
|
+
// Support: Android <=2.3 only (functionish RegExp)
|
297
|
+
return typeof obj === "object" || typeof obj === "function"
|
298
|
+
? class2type[Object.prototype.toString.call(obj)] || "object"
|
299
|
+
: typeof obj;
|
300
|
+
},
|
301
|
+
"jQuery.type is deprecated"
|
302
|
+
);
|
303
|
+
|
304
|
+
migrateWarnFunc(
|
305
|
+
jQuery,
|
306
|
+
"isFunction",
|
307
|
+
function (obj) {
|
308
|
+
return typeof obj === "function";
|
309
|
+
},
|
310
|
+
"jQuery.isFunction() is deprecated"
|
311
|
+
);
|
312
|
+
|
313
|
+
migrateWarnFunc(
|
314
|
+
jQuery,
|
315
|
+
"isWindow",
|
316
|
+
function (obj) {
|
317
|
+
return obj != null && obj === obj.window;
|
318
|
+
},
|
319
|
+
"jQuery.isWindow() is deprecated"
|
320
|
+
);
|
321
|
+
|
322
|
+
migrateWarnFunc(
|
323
|
+
jQuery,
|
324
|
+
"isArray",
|
325
|
+
Array.isArray,
|
326
|
+
"jQuery.isArray is deprecated; use Array.isArray"
|
327
|
+
);
|
328
|
+
}
|
329
|
+
|
330
|
+
// Support jQuery slim which excludes the ajax module
|
331
|
+
if (jQuery.ajax) {
|
332
|
+
var oldAjax = jQuery.ajax;
|
333
|
+
|
334
|
+
jQuery.ajax = function () {
|
335
|
+
var jQXHR = oldAjax.apply(this, arguments);
|
336
|
+
|
337
|
+
// Be sure we got a jQXHR (e.g., not sync)
|
338
|
+
if (jQXHR.promise) {
|
339
|
+
migrateWarnFunc(
|
340
|
+
jQXHR,
|
341
|
+
"success",
|
342
|
+
jQXHR.done,
|
343
|
+
"jQXHR.success is deprecated and removed"
|
344
|
+
);
|
345
|
+
migrateWarnFunc(
|
346
|
+
jQXHR,
|
347
|
+
"error",
|
348
|
+
jQXHR.fail,
|
349
|
+
"jQXHR.error is deprecated and removed"
|
350
|
+
);
|
351
|
+
migrateWarnFunc(
|
352
|
+
jQXHR,
|
353
|
+
"complete",
|
354
|
+
jQXHR.always,
|
355
|
+
"jQXHR.complete is deprecated and removed"
|
356
|
+
);
|
357
|
+
}
|
358
|
+
|
359
|
+
return jQXHR;
|
360
|
+
};
|
361
|
+
}
|
362
|
+
|
363
|
+
var oldRemoveAttr = jQuery.fn.removeAttr,
|
364
|
+
oldToggleClass = jQuery.fn.toggleClass,
|
365
|
+
rmatchNonSpace = /\S+/g;
|
366
|
+
|
367
|
+
jQuery.fn.removeAttr = function (name) {
|
368
|
+
var self = this;
|
369
|
+
|
370
|
+
jQuery.each(name.match(rmatchNonSpace), function (_i, attr) {
|
371
|
+
if (jQuery.expr.match.bool.test(attr)) {
|
372
|
+
migrateWarn("jQuery.fn.removeAttr no longer sets boolean properties: " + attr);
|
373
|
+
self.prop(attr, false);
|
374
|
+
}
|
375
|
+
});
|
376
|
+
|
377
|
+
return oldRemoveAttr.apply(this, arguments);
|
378
|
+
};
|
379
|
+
|
380
|
+
jQuery.fn.toggleClass = function (state) {
|
381
|
+
// Only deprecating no-args or single boolean arg
|
382
|
+
if (state !== undefined && typeof state !== "boolean") {
|
383
|
+
return oldToggleClass.apply(this, arguments);
|
384
|
+
}
|
385
|
+
|
386
|
+
migrateWarn("jQuery.fn.toggleClass( boolean ) is deprecated");
|
387
|
+
|
388
|
+
// Toggle entire class name of each element
|
389
|
+
return this.each(function () {
|
390
|
+
var className = (this.getAttribute && this.getAttribute("class")) || "";
|
391
|
+
|
392
|
+
if (className) {
|
393
|
+
jQuery.data(this, "__className__", className);
|
394
|
+
}
|
395
|
+
|
396
|
+
// If the element has a class name or if we're passed `false`,
|
397
|
+
// then remove the whole classname (if there was one, the above saved it).
|
398
|
+
// Otherwise bring back whatever was previously saved (if anything),
|
399
|
+
// falling back to the empty string if nothing was stored.
|
400
|
+
if (this.setAttribute) {
|
401
|
+
this.setAttribute(
|
402
|
+
"class",
|
403
|
+
className || state === false ? "" : jQuery.data(this, "__className__") || ""
|
404
|
+
);
|
405
|
+
}
|
406
|
+
});
|
407
|
+
};
|
408
|
+
|
409
|
+
function camelCase(string) {
|
410
|
+
return string.replace(/-([a-z])/g, function (_, letter) {
|
411
|
+
return letter.toUpperCase();
|
412
|
+
});
|
413
|
+
}
|
414
|
+
|
415
|
+
var oldFnCss,
|
416
|
+
internalSwapCall = false,
|
417
|
+
ralphaStart = /^[a-z]/,
|
418
|
+
// The regex visualized:
|
419
|
+
//
|
420
|
+
// /----------\
|
421
|
+
// | | /-------\
|
422
|
+
// | / Top \ | | |
|
423
|
+
// /--- Border ---+-| Right |-+---+- Width -+---\
|
424
|
+
// | | Bottom | |
|
425
|
+
// | \ Left / |
|
426
|
+
// | |
|
427
|
+
// | /----------\ |
|
428
|
+
// | /-------------\ | | |- END
|
429
|
+
// | | | | / Top \ | |
|
430
|
+
// | | / Margin \ | | | Right | | |
|
431
|
+
// |---------+-| |-+---+-| Bottom |-+----|
|
432
|
+
// | \ Padding / \ Left / |
|
433
|
+
// BEGIN -| |
|
434
|
+
// | /---------\ |
|
435
|
+
// | | | |
|
436
|
+
// | | / Min \ | / Width \ |
|
437
|
+
// \--------------+-| |-+---| |---/
|
438
|
+
// \ Max / \ Height /
|
439
|
+
rautoPx =
|
440
|
+
/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;
|
441
|
+
|
442
|
+
// If this version of jQuery has .swap(), don't false-alarm on internal uses
|
443
|
+
if (jQuery.swap) {
|
444
|
+
jQuery.each(["height", "width", "reliableMarginRight"], function (_, name) {
|
445
|
+
var oldHook = jQuery.cssHooks[name] && jQuery.cssHooks[name].get;
|
446
|
+
|
447
|
+
if (oldHook) {
|
448
|
+
jQuery.cssHooks[name].get = function () {
|
449
|
+
var ret;
|
450
|
+
|
451
|
+
internalSwapCall = true;
|
452
|
+
ret = oldHook.apply(this, arguments);
|
453
|
+
internalSwapCall = false;
|
454
|
+
return ret;
|
455
|
+
};
|
456
|
+
}
|
457
|
+
});
|
458
|
+
}
|
459
|
+
|
460
|
+
jQuery.swap = function (elem, options, callback, args) {
|
461
|
+
var ret,
|
462
|
+
name,
|
463
|
+
old = {};
|
464
|
+
|
465
|
+
if (!internalSwapCall) {
|
466
|
+
migrateWarn("jQuery.swap() is undocumented and deprecated");
|
467
|
+
}
|
468
|
+
|
469
|
+
// Remember the old values, and insert the new ones
|
470
|
+
for (name in options) {
|
471
|
+
old[name] = elem.style[name];
|
472
|
+
elem.style[name] = options[name];
|
473
|
+
}
|
474
|
+
|
475
|
+
ret = callback.apply(elem, args || []);
|
476
|
+
|
477
|
+
// Revert the old values
|
478
|
+
for (name in options) {
|
479
|
+
elem.style[name] = old[name];
|
480
|
+
}
|
481
|
+
|
482
|
+
return ret;
|
483
|
+
};
|
484
|
+
|
485
|
+
if (jQueryVersionSince("3.4.0") && typeof Proxy !== "undefined") {
|
486
|
+
jQuery.cssProps = new Proxy(jQuery.cssProps || {}, {
|
487
|
+
set: function () {
|
488
|
+
migrateWarn("JQMIGRATE: jQuery.cssProps is deprecated");
|
489
|
+
return Reflect.set.apply(this, arguments);
|
490
|
+
},
|
491
|
+
});
|
492
|
+
}
|
493
|
+
|
494
|
+
// Create a dummy jQuery.cssNumber if missing. It won't be used by jQuery but
|
495
|
+
// it will prevent code adding new keys to it unconditionally from crashing.
|
496
|
+
if (!jQuery.cssNumber) {
|
497
|
+
jQuery.cssNumber = {};
|
498
|
+
}
|
499
|
+
|
500
|
+
function isAutoPx(prop) {
|
501
|
+
// The first test is used to ensure that:
|
502
|
+
// 1. The prop starts with a lowercase letter (as we uppercase it for the second regex).
|
503
|
+
// 2. The prop is not empty.
|
504
|
+
return ralphaStart.test(prop) && rautoPx.test(prop[0].toUpperCase() + prop.slice(1));
|
505
|
+
}
|
506
|
+
|
507
|
+
oldFnCss = jQuery.fn.css;
|
508
|
+
|
509
|
+
jQuery.fn.css = function (name, value) {
|
510
|
+
var origThis = this;
|
511
|
+
if (typeof name !== "string") {
|
512
|
+
jQuery.each(name, function (n, v) {
|
513
|
+
jQuery.fn.css.call(origThis, n, v);
|
514
|
+
});
|
515
|
+
}
|
516
|
+
if (typeof value === "number" && !isAutoPx(camelCase(name))) {
|
517
|
+
migrateWarn("Use of number-typed values is deprecated in jQuery.fn.css");
|
518
|
+
}
|
519
|
+
|
520
|
+
return oldFnCss.apply(this, arguments);
|
521
|
+
};
|
522
|
+
|
523
|
+
var oldData = jQuery.data;
|
524
|
+
|
525
|
+
jQuery.data = function (elem, name, value) {
|
526
|
+
var curData, sameKeys, key;
|
527
|
+
|
528
|
+
// Name can be an object, and each entry in the object is meant to be set as data
|
529
|
+
if (name && typeof name === "object" && arguments.length === 2) {
|
530
|
+
curData = jQuery.hasData(elem) && oldData.call(this, elem);
|
531
|
+
sameKeys = {};
|
532
|
+
for (key in name) {
|
533
|
+
if (key !== camelCase(key)) {
|
534
|
+
migrateWarn("jQuery.data() always sets/gets camelCased names: " + key);
|
535
|
+
curData[key] = name[key];
|
536
|
+
} else {
|
537
|
+
sameKeys[key] = name[key];
|
538
|
+
}
|
539
|
+
}
|
540
|
+
|
541
|
+
oldData.call(this, elem, sameKeys);
|
542
|
+
|
543
|
+
return name;
|
544
|
+
}
|
545
|
+
|
546
|
+
// If the name is transformed, look for the un-transformed name in the data object
|
547
|
+
if (name && typeof name === "string" && name !== camelCase(name)) {
|
548
|
+
curData = jQuery.hasData(elem) && oldData.call(this, elem);
|
549
|
+
if (curData && name in curData) {
|
550
|
+
migrateWarn("jQuery.data() always sets/gets camelCased names: " + name);
|
551
|
+
if (arguments.length > 2) {
|
552
|
+
curData[name] = value;
|
553
|
+
}
|
554
|
+
return curData[name];
|
555
|
+
}
|
556
|
+
}
|
557
|
+
|
558
|
+
return oldData.apply(this, arguments);
|
559
|
+
};
|
560
|
+
|
561
|
+
// Support jQuery slim which excludes the effects module
|
562
|
+
if (jQuery.fx) {
|
563
|
+
var intervalValue,
|
564
|
+
intervalMsg,
|
565
|
+
oldTweenRun = jQuery.Tween.prototype.run,
|
566
|
+
linearEasing = function (pct) {
|
567
|
+
return pct;
|
568
|
+
};
|
569
|
+
|
570
|
+
jQuery.Tween.prototype.run = function () {
|
571
|
+
if (jQuery.easing[this.easing].length > 1) {
|
572
|
+
migrateWarn(
|
573
|
+
"'jQuery.easing." + this.easing.toString() + "' should use only one argument"
|
574
|
+
);
|
575
|
+
|
576
|
+
jQuery.easing[this.easing] = linearEasing;
|
577
|
+
}
|
578
|
+
|
579
|
+
oldTweenRun.apply(this, arguments);
|
580
|
+
};
|
581
|
+
|
582
|
+
intervalValue = jQuery.fx.interval || 13;
|
583
|
+
intervalMsg = "jQuery.fx.interval is deprecated";
|
584
|
+
|
585
|
+
// Support: IE9, Android <=4.4
|
586
|
+
// Avoid false positives on browsers that lack rAF
|
587
|
+
// Don't warn if document is hidden, jQuery uses setTimeout (#292)
|
588
|
+
if (window.requestAnimationFrame) {
|
589
|
+
Object.defineProperty(jQuery.fx, "interval", {
|
590
|
+
configurable: true,
|
591
|
+
enumerable: true,
|
592
|
+
get: function () {
|
593
|
+
if (!window.document.hidden) {
|
594
|
+
migrateWarn(intervalMsg);
|
595
|
+
}
|
596
|
+
return intervalValue;
|
597
|
+
},
|
598
|
+
set: function (newValue) {
|
599
|
+
migrateWarn(intervalMsg);
|
600
|
+
intervalValue = newValue;
|
601
|
+
},
|
602
|
+
});
|
603
|
+
}
|
604
|
+
}
|
605
|
+
|
606
|
+
var oldLoad = jQuery.fn.load,
|
607
|
+
oldEventAdd = jQuery.event.add,
|
608
|
+
originalFix = jQuery.event.fix;
|
609
|
+
|
610
|
+
jQuery.event.props = [];
|
611
|
+
jQuery.event.fixHooks = {};
|
612
|
+
|
613
|
+
migrateWarnProp(
|
614
|
+
jQuery.event.props,
|
615
|
+
"concat",
|
616
|
+
jQuery.event.props.concat,
|
617
|
+
"jQuery.event.props.concat() is deprecated and removed"
|
618
|
+
);
|
619
|
+
|
620
|
+
jQuery.event.fix = function (originalEvent) {
|
621
|
+
var event,
|
622
|
+
type = originalEvent.type,
|
623
|
+
fixHook = this.fixHooks[type],
|
624
|
+
props = jQuery.event.props;
|
625
|
+
|
626
|
+
if (props.length) {
|
627
|
+
migrateWarn("jQuery.event.props are deprecated and removed: " + props.join());
|
628
|
+
while (props.length) {
|
629
|
+
jQuery.event.addProp(props.pop());
|
630
|
+
}
|
631
|
+
}
|
632
|
+
|
633
|
+
if (fixHook && !fixHook._migrated_) {
|
634
|
+
fixHook._migrated_ = true;
|
635
|
+
migrateWarn("jQuery.event.fixHooks are deprecated and removed: " + type);
|
636
|
+
if ((props = fixHook.props) && props.length) {
|
637
|
+
while (props.length) {
|
638
|
+
jQuery.event.addProp(props.pop());
|
639
|
+
}
|
640
|
+
}
|
641
|
+
}
|
642
|
+
|
643
|
+
event = originalFix.call(this, originalEvent);
|
644
|
+
|
645
|
+
return fixHook && fixHook.filter ? fixHook.filter(event, originalEvent) : event;
|
646
|
+
};
|
647
|
+
|
648
|
+
jQuery.event.add = function (elem, types) {
|
649
|
+
// This misses the multiple-types case but that seems awfully rare
|
650
|
+
if (elem === window && types === "load" && window.document.readyState === "complete") {
|
651
|
+
migrateWarn("jQuery(window).on('load'...) called after load event occurred");
|
652
|
+
}
|
653
|
+
return oldEventAdd.apply(this, arguments);
|
654
|
+
};
|
655
|
+
|
656
|
+
jQuery.each(["load", "unload", "error"], function (_, name) {
|
657
|
+
jQuery.fn[name] = function () {
|
658
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
659
|
+
|
660
|
+
// If this is an ajax load() the first arg should be the string URL;
|
661
|
+
// technically this could also be the "Anything" arg of the event .load()
|
662
|
+
// which just goes to show why this dumb signature has been deprecated!
|
663
|
+
// jQuery custom builds that exclude the Ajax module justifiably die here.
|
664
|
+
if (name === "load" && typeof args[0] === "string") {
|
665
|
+
return oldLoad.apply(this, args);
|
666
|
+
}
|
667
|
+
|
668
|
+
migrateWarn("jQuery.fn." + name + "() is deprecated");
|
669
|
+
|
670
|
+
args.splice(0, 0, name);
|
671
|
+
if (arguments.length) {
|
672
|
+
return this.on.apply(this, args);
|
673
|
+
}
|
674
|
+
|
675
|
+
// Use .triggerHandler here because:
|
676
|
+
// - load and unload events don't need to bubble, only applied to window or image
|
677
|
+
// - error event should not bubble to window, although it does pre-1.7
|
678
|
+
// See http://bugs.jquery.com/ticket/11820
|
679
|
+
this.triggerHandler.apply(this, args);
|
680
|
+
return this;
|
681
|
+
};
|
682
|
+
});
|
683
|
+
|
684
|
+
jQuery.each(
|
685
|
+
(
|
686
|
+
"blur focus focusin focusout resize scroll click dblclick " +
|
687
|
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
688
|
+
"change select submit keydown keypress keyup contextmenu"
|
689
|
+
).split(" "),
|
690
|
+
function (_i, name) {
|
691
|
+
// Handle event binding
|
692
|
+
jQuery.fn[name] = function (data, fn) {
|
693
|
+
migrateWarn("jQuery.fn." + name + "() event shorthand is deprecated");
|
694
|
+
return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
|
695
|
+
};
|
696
|
+
}
|
697
|
+
);
|
698
|
+
|
699
|
+
// Trigger "ready" event only once, on document ready
|
700
|
+
jQuery(function () {
|
701
|
+
jQuery(window.document).triggerHandler("ready");
|
702
|
+
});
|
703
|
+
|
704
|
+
jQuery.event.special.ready = {
|
705
|
+
setup: function () {
|
706
|
+
if (this === window.document) {
|
707
|
+
migrateWarn("'ready' event is deprecated");
|
708
|
+
}
|
709
|
+
},
|
710
|
+
};
|
711
|
+
|
712
|
+
jQuery.fn.extend({
|
713
|
+
bind: function (types, data, fn) {
|
714
|
+
migrateWarn("jQuery.fn.bind() is deprecated");
|
715
|
+
return this.on(types, null, data, fn);
|
716
|
+
},
|
717
|
+
unbind: function (types, fn) {
|
718
|
+
migrateWarn("jQuery.fn.unbind() is deprecated");
|
719
|
+
return this.off(types, null, fn);
|
720
|
+
},
|
721
|
+
delegate: function (selector, types, data, fn) {
|
722
|
+
migrateWarn("jQuery.fn.delegate() is deprecated");
|
723
|
+
return this.on(types, selector, data, fn);
|
724
|
+
},
|
725
|
+
undelegate: function (selector, types, fn) {
|
726
|
+
migrateWarn("jQuery.fn.undelegate() is deprecated");
|
727
|
+
return arguments.length === 1
|
728
|
+
? this.off(selector, "**")
|
729
|
+
: this.off(types, selector || "**", fn);
|
730
|
+
},
|
731
|
+
hover: function (fnOver, fnOut) {
|
732
|
+
migrateWarn("jQuery.fn.hover() is deprecated");
|
733
|
+
return this.on("mouseenter", fnOver).on("mouseleave", fnOut || fnOver);
|
734
|
+
},
|
735
|
+
});
|
736
|
+
|
737
|
+
var rxhtmlTag =
|
738
|
+
/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
|
739
|
+
origHtmlPrefilter = jQuery.htmlPrefilter,
|
740
|
+
makeMarkup = function (html) {
|
741
|
+
var doc = window.document.implementation.createHTMLDocument("");
|
742
|
+
doc.body.innerHTML = html;
|
743
|
+
return doc.body && doc.body.innerHTML;
|
744
|
+
},
|
745
|
+
warnIfChanged = function (html) {
|
746
|
+
var changed = html.replace(rxhtmlTag, "<$1></$2>");
|
747
|
+
if (changed !== html && makeMarkup(html) !== makeMarkup(changed)) {
|
748
|
+
migrateWarn("HTML tags must be properly nested and closed: " + html);
|
749
|
+
}
|
750
|
+
};
|
751
|
+
|
752
|
+
jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function () {
|
753
|
+
jQuery.htmlPrefilter = function (html) {
|
754
|
+
warnIfChanged(html);
|
755
|
+
return html.replace(rxhtmlTag, "<$1></$2>");
|
756
|
+
};
|
757
|
+
};
|
758
|
+
|
759
|
+
jQuery.htmlPrefilter = function (html) {
|
760
|
+
warnIfChanged(html);
|
761
|
+
return origHtmlPrefilter(html);
|
762
|
+
};
|
763
|
+
|
764
|
+
var oldOffset = jQuery.fn.offset;
|
765
|
+
|
766
|
+
jQuery.fn.offset = function () {
|
767
|
+
var docElem,
|
768
|
+
elem = this[0],
|
769
|
+
bogus = { top: 0, left: 0 };
|
770
|
+
|
771
|
+
if (!elem || !elem.nodeType) {
|
772
|
+
migrateWarn("jQuery.fn.offset() requires a valid DOM element");
|
773
|
+
return undefined;
|
774
|
+
}
|
775
|
+
|
776
|
+
docElem = (elem.ownerDocument || window.document).documentElement;
|
777
|
+
if (!jQuery.contains(docElem, elem)) {
|
778
|
+
migrateWarn("jQuery.fn.offset() requires an element connected to a document");
|
779
|
+
return bogus;
|
780
|
+
}
|
781
|
+
|
782
|
+
return oldOffset.apply(this, arguments);
|
783
|
+
};
|
784
|
+
|
785
|
+
// Support jQuery slim which excludes the ajax module
|
786
|
+
// The jQuery.param patch is about respecting `jQuery.ajaxSettings.traditional`
|
787
|
+
// so it doesn't make sense for the slim build.
|
788
|
+
if (jQuery.ajax) {
|
789
|
+
var oldParam = jQuery.param;
|
790
|
+
|
791
|
+
jQuery.param = function (data, traditional) {
|
792
|
+
var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
|
793
|
+
|
794
|
+
if (traditional === undefined && ajaxTraditional) {
|
795
|
+
migrateWarn("jQuery.param() no longer uses jQuery.ajaxSettings.traditional");
|
796
|
+
traditional = ajaxTraditional;
|
797
|
+
}
|
798
|
+
|
799
|
+
return oldParam.call(this, data, traditional);
|
800
|
+
};
|
801
|
+
}
|
802
|
+
|
803
|
+
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
804
|
+
|
805
|
+
jQuery.fn.andSelf = function () {
|
806
|
+
migrateWarn("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()");
|
807
|
+
return oldSelf.apply(this, arguments);
|
808
|
+
};
|
809
|
+
|
810
|
+
// Support jQuery slim which excludes the deferred module in jQuery 4.0+
|
811
|
+
if (jQuery.Deferred) {
|
812
|
+
var oldDeferred = jQuery.Deferred,
|
813
|
+
tuples = [
|
814
|
+
// Action, add listener, callbacks, .then handlers, final state
|
815
|
+
[
|
816
|
+
"resolve",
|
817
|
+
"done",
|
818
|
+
jQuery.Callbacks("once memory"),
|
819
|
+
jQuery.Callbacks("once memory"),
|
820
|
+
"resolved",
|
821
|
+
],
|
822
|
+
[
|
823
|
+
"reject",
|
824
|
+
"fail",
|
825
|
+
jQuery.Callbacks("once memory"),
|
826
|
+
jQuery.Callbacks("once memory"),
|
827
|
+
"rejected",
|
828
|
+
],
|
829
|
+
["notify", "progress", jQuery.Callbacks("memory"), jQuery.Callbacks("memory")],
|
830
|
+
];
|
831
|
+
|
832
|
+
jQuery.Deferred = function (func) {
|
833
|
+
var deferred = oldDeferred(),
|
834
|
+
promise = deferred.promise();
|
835
|
+
|
836
|
+
deferred.pipe = promise.pipe = function (/* fnDone, fnFail, fnProgress */) {
|
837
|
+
var fns = arguments;
|
838
|
+
|
839
|
+
migrateWarn("deferred.pipe() is deprecated");
|
840
|
+
|
841
|
+
return jQuery
|
842
|
+
.Deferred(function (newDefer) {
|
843
|
+
jQuery.each(tuples, function (i, tuple) {
|
844
|
+
var fn = typeof fns[i] === "function" && fns[i];
|
845
|
+
|
846
|
+
// Deferred.done(function() { bind to newDefer or newDefer.resolve })
|
847
|
+
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
848
|
+
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
849
|
+
deferred[tuple[1]](function () {
|
850
|
+
var returned = fn && fn.apply(this, arguments);
|
851
|
+
if (returned && typeof returned.promise === "function") {
|
852
|
+
returned
|
853
|
+
.promise()
|
854
|
+
.done(newDefer.resolve)
|
855
|
+
.fail(newDefer.reject)
|
856
|
+
.progress(newDefer.notify);
|
857
|
+
} else {
|
858
|
+
newDefer[tuple[0] + "With"](
|
859
|
+
this === promise ? newDefer.promise() : this,
|
860
|
+
fn ? [returned] : arguments
|
861
|
+
);
|
862
|
+
}
|
863
|
+
});
|
864
|
+
});
|
865
|
+
fns = null;
|
866
|
+
})
|
867
|
+
.promise();
|
868
|
+
};
|
869
|
+
|
870
|
+
if (func) {
|
871
|
+
func.call(deferred, deferred);
|
872
|
+
}
|
873
|
+
|
874
|
+
return deferred;
|
875
|
+
};
|
876
|
+
|
877
|
+
// Preserve handler of uncaught exceptions in promise chains
|
878
|
+
jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
|
879
|
+
}
|
880
|
+
|
881
|
+
return jQuery;
|
882
|
+
});
|