about summary refs log tree commit diff stats
path: root/wiki/lib/scripts/cookie.js
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2019-01-02 04:57:35 +0000
committerahriman <ahriman@falte.red>2019-01-02 04:57:35 +0000
commit2bd7f83a6495011ada78ca8a9f2af417caf01760 (patch)
treef9acdb7f09e011c65330ab993d4db3620787dbfb /wiki/lib/scripts/cookie.js
parentbcb215c3a7e914d05f166846a33860e48bba64fb (diff)
downloadsite-2bd7f83a6495011ada78ca8a9f2af417caf01760.tar.gz
removed dokuwiki
Diffstat (limited to 'wiki/lib/scripts/cookie.js')
-rw-r--r--wiki/lib/scripts/cookie.js64
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]);
-            }
-        }
-    }
-};