diff options
author | ahriman <ahriman@falte.red> | 2019-01-02 04:57:35 +0000 |
---|---|---|
committer | ahriman <ahriman@falte.red> | 2019-01-02 04:57:35 +0000 |
commit | 2bd7f83a6495011ada78ca8a9f2af417caf01760 (patch) | |
tree | f9acdb7f09e011c65330ab993d4db3620787dbfb /wiki/lib/scripts/cookie.js | |
parent | bcb215c3a7e914d05f166846a33860e48bba64fb (diff) | |
download | site-2bd7f83a6495011ada78ca8a9f2af417caf01760.tar.gz |
removed dokuwiki
Diffstat (limited to 'wiki/lib/scripts/cookie.js')
-rw-r--r-- | wiki/lib/scripts/cookie.js | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/wiki/lib/scripts/cookie.js b/wiki/lib/scripts/cookie.js deleted file mode 100644 index 8417d20..0000000 --- a/wiki/lib/scripts/cookie.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* Handles the cookie used by several JavaScript functions -* -* Only a single cookie is written and read. You may only save -* simple name-value pairs - no complex types! -* -* You should only use the getValue and setValue methods -* -* @author Andreas Gohr <andi@splitbrain.org> -* @author Michal Rezler <m.rezler@centrum.cz> -*/ -var DokuCookie = { - data: {}, - name: 'DOKU_PREFS', - - /** - * Save a value to the cookie - * - * @author Andreas Gohr <andi@splitbrain.org> - */ - setValue: function(key,val){ - var text = [], - _this = this; - this.init(); - this.data[key] = val; - - //save the whole data array - jQuery.each(_this.data, function (key, val) { - if (_this.data.hasOwnProperty(key)) { - text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val)); - } - }); - jQuery.cookie(this.name, text.join('#'), {expires: 365, path: DOKU_COOKIE_PARAM.path, secure: DOKU_COOKIE_PARAM.secure}); - }, - - /** - * Get a Value from the Cookie - * - * @author Andreas Gohr <andi@splitbrain.org> - */ - getValue: function(key){ - this.init(); - return this.data[key]; - }, - - /** - * Loads the current set cookie - * - * @author Andreas Gohr <andi@splitbrain.org> - */ - init: function(){ - var text, parts, i; - if(!jQuery.isEmptyObject(this.data)) { - return; - } - text = jQuery.cookie(this.name); - if(text){ - parts = text.split('#'); - for(i = 0; i < parts.length; i += 2){ - this.data[decodeURIComponent(parts[i])] = decodeURIComponent(parts[i+1]); - } - } - } -}; |