From 50406be88994d493be470d76cdcebfbca8d4f7d9 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sat, 28 Jan 2017 23:34:32 +0000 Subject: [PATCH] Update jquery.cookiejar 1.0.1 to 1.0.2. --- CHANGES.md | 1 + gui/slick/interfaces/default/inc_top.tmpl | 2 +- gui/slick/js/lib/jquery.cookiejar.js | 200 ---------------------- gui/slick/js/lib/jquery.cookiejar.min.js | 4 + 4 files changed, 6 insertions(+), 201 deletions(-) delete mode 100644 gui/slick/js/lib/jquery.cookiejar.js create mode 100644 gui/slick/js/lib/jquery.cookiejar.min.js diff --git a/CHANGES.md b/CHANGES.md index 931c931a..1df055b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,7 @@ * Update Bootstrap 3.2.0 to 3.3.7 * Update Bootstrap Hover Dropdown 2.0.11 to 2.2.1 * Update jquery.cookie 1.0 (21349d9) to JS-Cookie 2.1.3 (c1aa987) +* Update jquery.cookiejar 1.0.1 to 1.0.2 [develop changelog] diff --git a/gui/slick/interfaces/default/inc_top.tmpl b/gui/slick/interfaces/default/inc_top.tmpl index 76f1a40a..8308fd11 100644 --- a/gui/slick/interfaces/default/inc_top.tmpl +++ b/gui/slick/interfaces/default/inc_top.tmpl @@ -53,7 +53,7 @@ - + diff --git a/gui/slick/js/lib/jquery.cookiejar.js b/gui/slick/js/lib/jquery.cookiejar.js deleted file mode 100644 index 92f6c19b..00000000 --- a/gui/slick/js/lib/jquery.cookiejar.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * .cookieJar - Cookie Jar Plugin - * - * Version: 1.0.1 - * Updated: 2007-08-14 - * - * Used to store objects, arrays or multiple values in one cookie, under one name - * - * Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/cookieJar/) - * - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - **/ - -/** - * Requirements: - * - jQuery (John Resig, http://www.jquery.com/) - * - cookie (Klaus Hartl, http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/) - * - toJSON (Mark Gibson, http://jollytoad.googlepages.com/json.js) - **/ -(function($) { - $.cookieJar = function(name, options) { - if (!$.parseJSON) return false; - if (!$.toJSON) return false; - if (!$.cookie) return false; - return new function() { - /** - * @access private - **/ - function log(s) { - if (typeof console != 'undefined' && typeof console.log != 'undefined') { - console.log('cookiejar:' + self.cookieName + ' ' + s); - } else { - alert(s); - } - }; - - /** - * @access private - **/ - function save() { - if (self.options.debug) log('save ' + $.toJSON(self.cookieObject)); - return $.cookie(self.cookieName, $.toJSON(self.cookieObject), self.options.cookie); - }; - - /** - * @access private - **/ - function load() { - var cookieJSON = $.cookie(self.cookieName); - if (typeof cookieJSON == 'string') { - if (self.options.debug) log('load ' + cookieJSON); - self.cookieObject = $.parseJSON(cookieJSON, true); - } else { - if (self.options.debug) log('load new'); - self.cookieObject = {}; - save(); - } - } - - /** - * cookieJar.set(name, value) - * - * Sets a value in the cookie jar using a name to identify it - * - * @access public - * @param string name value identifier - * @param mixed value any value, array or object - * @return bool - **/ - this.set = function(name, value) { - if (self.options.debug) log('set ' + name + ' = ' + value); - self.cookieObject[name] = value; - return save(); - }; - - /** - * cookieJar.get(name) - * - * Gets a value from the cookie jar using a name to identify it - * - * @access public - * @param string name value identifier - * @return mixed stored value - **/ - this.get = function(name) { - if (!self.options.cacheCookie) { - load(); - } - if (self.options.debug) log('get ' + name + ' = ' + self.cookieObject[name]); - return self.cookieObject[name]; - }; - - /** - * cookieJar.remove([name]) - * - * Removes a value from the cookie jar using a name to identify it - * No name will clear the cookie jar of all values - * - * @access public - * @param string name value identifier - * @return bool - **/ - this.remove = function(name) { - if (self.options.debug) log('remove ' + name); - if (typeof name != 'undefined') { - delete(self.cookieObject[name]); - } else { - self.setFromObject({}); - } - return save(); - }; - - /** - * cookieJar.setFromObject(object) - * - * Uses the object as the set of values to store in the cookie jar - * - * @access public - * @param object object new values for the cookie jar - * @return bool - **/ - this.setFromObject = function(object) { - if (typeof object == 'object') { - if (self.options.debug) log('setFromObject'); - self.cookieObject = object; - return save(); - } - }; - - /** - * cookieJar.toObject() - * - * Returns the contents of the cookie jar as an object - * - * @access public - * @return object contents of the cookie jar - **/ - this.toObject = function() { - if (self.options.debug) log('toObject'); - return self.cookieObject; - }; - - /** - * cookieJar.toString() - * - * Returns the contents of the cookie jar as a JSON encoded string - * - * @access public - * @return string contents of the cookie jar as JSON - **/ - this.toString = function() { - if (self.options.debug) log('toString = ' + $.toJSON(self.cookieObject)); - return $.toJSON(self.cookieObject); - }; - - /** - * cookieJar.destroy() - * - * Removes the cookie containing the cookie jar from the server - * - * @access public - * @return bool - **/ - this.destroy = function() { - if (self.options.debug) log('destroy'); - self.cookieObject = {}; - return $.cookie(self.cookieName, null, self.options.cookie); - }; - - /** - * cookieJar(name, [options]) - * - * loads a cookie jar for the name provided, creates new if none found - * - * @param string name - * @param object options - * @return object cookieJar - **/ - this.construct = function(name, options) { - self.options = $.extend({ - cookie: { - expires: 365, - path: '/' - }, - cacheCookie: true, - cookiePrefix: 'jqCookieJar_', - debug: false - }, options); - - self.cookieName = self.options.cookiePrefix + name; - load(); - return self; - }; - - var self = this; - self.construct(name, options); - }; - }; -})(jQuery); diff --git a/gui/slick/js/lib/jquery.cookiejar.min.js b/gui/slick/js/lib/jquery.cookiejar.min.js new file mode 100644 index 00000000..9a0d8e41 --- /dev/null +++ b/gui/slick/js/lib/jquery.cookiejar.min.js @@ -0,0 +1,4 @@ +(function(c){c.cookieJar=function(g,h){return c.parseJSON&&c.toJSON&&c.cookie?new function(){function d(b){"undefined"!=typeof console&&"undefined"!=typeof console.log?console.log("cookiejar:"+a.cookieName+" "+b):alert(b)}function e(){a.options.debug&&d("save "+c.toJSON(a.cookieObject));return Cookies.set(a.cookieName,c.toJSON(a.cookieObject),a.options.cookie)}function f(){var b=Cookies.get(a.cookieName);"string"==typeof b?(a.options.debug&&d("load "+b),a.cookieObject=c.parseJSON(b,!0)):(a.options.debug&& +d("load new"),a.cookieObject={},e())}this.set=function(b,c){a.options.debug&&d("set "+b+" = "+c);a.cookieObject[b]=c;return e()};this.get=function(b){a.options.cacheCookie||f();a.options.debug&&d("get "+b+" = "+a.cookieObject[b]);return a.cookieObject[b]};this.remove=function(b){a.options.debug&&d("remove "+b);"undefined"!=typeof b?delete a.cookieObject[b]:a.setFromObject({});return e()};this.setFromObject=function(b){if("object"==typeof b)return a.options.debug&&d("setFromObject"),a.cookieObject= +b,e()};this.toObject=function(){a.options.debug&&d("toObject");return a.cookieObject};this.toString=function(){a.options.debug&&d("toString = "+c.toJSON(a.cookieObject));return c.toJSON(a.cookieObject)};this.destroy=function(){a.options.debug&&d("destroy");a.cookieObject={};return Cookies.set(a.cookieName,null,a.options.cookie)};this.construct=function(b,d){a.options=c.extend({cookie:{expires:365,path:"/"},cacheCookie:!0,cookiePrefix:"jqCookieJar_",debug:!1},d);a.cookieName=a.options.cookiePrefix+ +b;f();return a};var a=this;a.construct(g,h)}:!1}})(jQuery);