aboutsummaryrefslogtreecommitdiffstats
path: root/resources/lib/jquery/jquery.cookie.js
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2018-08-19 22:23:51 +0100
committerKrinkle <krinklemail@gmail.com>2018-08-20 21:11:51 +0000
commit9f86db20286c2c39ae5f134a31ad2927441340d0 (patch)
treee2f2a40e1d3cf7a9414b92f69ad0c5f6e56d73ff /resources/lib/jquery/jquery.cookie.js
parent0087dcf2ac0ebefae98128b2259a732d92d253a8 (diff)
downloadmediawikicore-9f86db20286c2c39ae5f134a31ad2927441340d0.tar.gz
mediawikicore-9f86db20286c2c39ae5f134a31ad2927441340d0.zip
resources: Move non-jquery files from /resources/lib/jquery to /resources/lib
Per discussion on T193826, these are not part of jquery (the library, or the module), and should not be in the same subdirectory. To follow the new convention that all entries directly in /resources/lib should correspond to single library only (either as file, or as directory), move them one directory up. Bug: T193826 Change-Id: I24c05ec5fc5f0a2d54d501a4a022d829675bf850
Diffstat (limited to 'resources/lib/jquery/jquery.cookie.js')
-rw-r--r--resources/lib/jquery/jquery.cookie.js90
1 files changed, 0 insertions, 90 deletions
diff --git a/resources/lib/jquery/jquery.cookie.js b/resources/lib/jquery/jquery.cookie.js
deleted file mode 100644
index 3fb201c6a013..000000000000
--- a/resources/lib/jquery/jquery.cookie.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*!
- * jQuery Cookie Plugin v1.3.1
- * https://github.com/carhartl/jquery-cookie
- *
- * Copyright 2013 Klaus Hartl
- * Released under the MIT license
- */
-(function ($, document, undefined) {
-
- var pluses = /\+/g;
-
- function raw(s) {
- return s;
- }
-
- function decoded(s) {
- return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
- }
-
- function unRfc2068(value) {
- if (value.indexOf('"') === 0) {
- // This is a quoted cookie as according to RFC2068, unescape
- value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
- }
- return value;
- }
-
- function fromJSON(value) {
- return config.json ? JSON.parse(value) : value;
- }
-
- var config = $.cookie = function (key, value, options) {
-
- // write
- if (value !== undefined) {
- options = $.extend({}, config.defaults, options);
-
- if (value === null) {
- options.expires = -1;
- }
-
- if (typeof options.expires === 'number') {
- var days = options.expires, t = options.expires = new Date();
- t.setDate(t.getDate() + days);
- }
-
- value = config.json ? JSON.stringify(value) : String(value);
-
- return (document.cookie = [
- encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
- options.path ? '; path=' + options.path : '',
- options.domain ? '; domain=' + options.domain : '',
- options.secure ? '; secure' : ''
- ].join(''));
- }
-
- // read
- var decode = config.raw ? raw : decoded;
- var cookies = document.cookie.split('; ');
- var result = key ? null : {};
- for (var i = 0, l = cookies.length; i < l; i++) {
- var parts = cookies[i].split('=');
- var name = decode(parts.shift());
- var cookie = decode(parts.join('='));
-
- if (key && key === name) {
- result = fromJSON(cookie);
- break;
- }
-
- if (!key) {
- result[name] = fromJSON(cookie);
- }
- }
-
- return result;
- };
-
- config.defaults = {};
-
- $.removeCookie = function (key, options) {
- if ($.cookie(key) !== null) {
- $.cookie(key, null, options);
- return true;
- }
- return false;
- };
-
-})(jQuery, document);