mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 14:17:19 +00:00
updated js.cookie.js
This commit is contained in:
@@ -111,7 +111,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
$('table tr td:first-child input').each(function(chkbx) {
|
$('table tr td:first-child input').each(function(chkbx) {
|
||||||
row = $(this);
|
row = $(this);
|
||||||
if (row.prop('checked') != cb.prop('checked')){
|
if (row.prop('checked') !== cb.prop('checked')){
|
||||||
row.click();
|
row.click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,145 +1,142 @@
|
|||||||
/*!
|
/*! js-cookie v3.0.0-rc.1 | MIT */
|
||||||
* JavaScript Cookie v2.1.0
|
;
|
||||||
* https://github.com/js-cookie/js-cookie
|
(function (global, factory) {
|
||||||
*
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||||
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
typeof define === 'function' && define.amd ? define(factory) :
|
||||||
* Released under the MIT license
|
(global = global || self, (function () {
|
||||||
*/
|
var current = global.Cookies;
|
||||||
(function (factory) {
|
var exports = global.Cookies = factory();
|
||||||
if (typeof define === 'function' && define.amd) {
|
exports.noConflict = function () { global.Cookies = current; return exports; };
|
||||||
define(factory);
|
}()));
|
||||||
} else if (typeof exports === 'object') {
|
}(this, (function () { 'use strict';
|
||||||
module.exports = factory();
|
|
||||||
} else {
|
|
||||||
var _OldCookies = window.Cookies;
|
|
||||||
var api = window.Cookies = factory();
|
|
||||||
api.noConflict = function () {
|
|
||||||
window.Cookies = _OldCookies;
|
|
||||||
return api;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}(function () {
|
|
||||||
function extend () {
|
|
||||||
var i = 0;
|
|
||||||
var result = {};
|
|
||||||
for (; i < arguments.length; i++) {
|
|
||||||
var attributes = arguments[ i ];
|
|
||||||
for (var key in attributes) {
|
|
||||||
result[key] = attributes[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init (converter) {
|
function assign (target) {
|
||||||
function api (key, value, attributes) {
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
var result;
|
var source = arguments[i];
|
||||||
|
for (var key in source) {
|
||||||
|
target[key] = source[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return target
|
||||||
|
}
|
||||||
|
|
||||||
// Write
|
var defaultConverter = {
|
||||||
|
read: function (value) {
|
||||||
|
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
|
||||||
|
},
|
||||||
|
write: function (value) {
|
||||||
|
return encodeURIComponent(value).replace(
|
||||||
|
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
||||||
|
decodeURIComponent
|
||||||
|
)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (arguments.length > 1) {
|
function init (converter, defaultAttributes) {
|
||||||
attributes = extend({
|
function set (key, value, attributes) {
|
||||||
path: '/'
|
if (typeof document === 'undefined') {
|
||||||
}, api.defaults, attributes);
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof attributes.expires === 'number') {
|
attributes = assign({}, defaultAttributes, attributes);
|
||||||
var expires = new Date();
|
|
||||||
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
|
|
||||||
attributes.expires = expires;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
if (typeof attributes.expires === 'number') {
|
||||||
result = JSON.stringify(value);
|
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
||||||
if (/^[\{\[]/.test(result)) {
|
}
|
||||||
value = result;
|
if (attributes.expires) {
|
||||||
}
|
attributes.expires = attributes.expires.toUTCString();
|
||||||
} catch (e) {}
|
}
|
||||||
|
|
||||||
if (!converter.write) {
|
key = encodeURIComponent(key)
|
||||||
value = encodeURIComponent(String(value))
|
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
|
||||||
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
.replace(/[()]/g, escape);
|
||||||
} else {
|
|
||||||
value = converter.write(value, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
key = encodeURIComponent(String(key));
|
value = converter.write(value, key);
|
||||||
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
|
|
||||||
key = key.replace(/[\(\)]/g, escape);
|
|
||||||
|
|
||||||
return (document.cookie = [
|
var stringifiedAttributes = '';
|
||||||
key, '=', value,
|
for (var attributeName in attributes) {
|
||||||
attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
|
if (!attributes[attributeName]) {
|
||||||
attributes.path && '; path=' + attributes.path,
|
continue
|
||||||
attributes.domain && '; domain=' + attributes.domain,
|
}
|
||||||
attributes.secure ? '; secure' : ''
|
|
||||||
].join(''));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read
|
stringifiedAttributes += '; ' + attributeName;
|
||||||
|
|
||||||
if (!key) {
|
if (attributes[attributeName] === true) {
|
||||||
result = {};
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// To prevent the for loop in the first place assign an empty array
|
// Considers RFC 6265 section 5.2:
|
||||||
// in case there are no cookies at all. Also prevents odd result when
|
// ...
|
||||||
// calling "get()"
|
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
||||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
// character:
|
||||||
var rdecode = /(%[0-9A-Z]{2})+/g;
|
// Consume the characters of the unparsed-attributes up to,
|
||||||
var i = 0;
|
// not including, the first %x3B (";") character.
|
||||||
|
// ...
|
||||||
|
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
||||||
|
}
|
||||||
|
|
||||||
for (; i < cookies.length; i++) {
|
return (document.cookie = key + '=' + value + stringifiedAttributes)
|
||||||
var parts = cookies[i].split('=');
|
}
|
||||||
var name = parts[0].replace(rdecode, decodeURIComponent);
|
|
||||||
var cookie = parts.slice(1).join('=');
|
|
||||||
|
|
||||||
if (cookie.charAt(0) === '"') {
|
function get (key) {
|
||||||
cookie = cookie.slice(1, -1);
|
if (typeof document === 'undefined' || (arguments.length && !key)) {
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
// To prevent the for loop in the first place assign an empty array
|
||||||
cookie = converter.read ?
|
// in case there are no cookies at all.
|
||||||
converter.read(cookie, name) : converter(cookie, name) ||
|
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||||
cookie.replace(rdecode, decodeURIComponent);
|
var jar = {};
|
||||||
|
for (var i = 0; i < cookies.length; i++) {
|
||||||
|
var parts = cookies[i].split('=');
|
||||||
|
var value = parts.slice(1).join('=');
|
||||||
|
|
||||||
if (this.json) {
|
if (value[0] === '"') {
|
||||||
try {
|
value = value.slice(1, -1);
|
||||||
cookie = JSON.parse(cookie);
|
}
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key === name) {
|
try {
|
||||||
result = cookie;
|
var foundKey = defaultConverter.read(parts[0]);
|
||||||
break;
|
jar[foundKey] = converter.read(value, foundKey);
|
||||||
}
|
|
||||||
|
|
||||||
if (!key) {
|
if (key === foundKey) {
|
||||||
result[name] = cookie;
|
break
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return key ? jar[key] : jar
|
||||||
}
|
}
|
||||||
|
|
||||||
api.get = api.set = api;
|
return Object.create(
|
||||||
api.getJSON = function () {
|
{
|
||||||
return api.apply({
|
set: set,
|
||||||
json: true
|
get: get,
|
||||||
}, [].slice.call(arguments));
|
remove: function (key, attributes) {
|
||||||
};
|
set(
|
||||||
api.defaults = {};
|
key,
|
||||||
|
'',
|
||||||
|
assign({}, attributes, {
|
||||||
|
expires: -1
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
withAttributes: function (attributes) {
|
||||||
|
return init(this.converter, assign({}, this.attributes, attributes))
|
||||||
|
},
|
||||||
|
withConverter: function (converter) {
|
||||||
|
return init(assign({}, this.converter, converter), this.attributes)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
attributes: { value: Object.freeze(defaultAttributes) },
|
||||||
|
converter: { value: Object.freeze(converter) }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
api.remove = function (key, attributes) {
|
var api = init(defaultConverter, { path: '/' });
|
||||||
api(key, '', extend(attributes, {
|
|
||||||
expires: -1
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
api.withConverter = init;
|
return api;
|
||||||
|
|
||||||
return api;
|
})));
|
||||||
}
|
|
||||||
|
|
||||||
return init(function () {});
|
|
||||||
}));
|
|
||||||
|
|||||||
2
static/js/js.cookie.min.js
vendored
Normal file
2
static/js/js.cookie.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/*! js-cookie v3.0.0-rc.1 | MIT */
|
||||||
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,r=e.Cookies=t();r.noConflict=function(){return e.Cookies=n,r}}())}(this,function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var t={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};return function n(r,o){function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),n=r.write(n,t);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+c}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var c=n[i].split("="),u=c.slice(1).join("=");'"'===u[0]&&(u=u.slice(1,-1));try{var f=t.read(c[0]);if(o[f]=r.read(u,f),e===f)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(t){return n(this.converter,e({},this.attributes,t))},withConverter:function(t){return n(e({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(r)}})}(t,{path:"/"})});
|
||||||
Reference in New Issue
Block a user