aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/scripts/cookie.js
diff options
context:
space:
mode:
authorPhy <git@phy25.com>2019-03-13 12:51:32 -0400
committerPhy <git@phy25.com>2019-03-13 12:51:32 -0400
commitbded2f50427c1a29306e13bec420fd7804b75718 (patch)
tree0c2dbc8d1dcf9dc37ff53cd2cf7f810e3dfed95b /lib/scripts/cookie.js
parent40be5e7a38c9cf92c115534a77437c3fda53379e (diff)
downloaddokuwiki-bded2f50427c1a29306e13bec420fd7804b75718.tar.gz
dokuwiki-bded2f50427c1a29306e13bec420fd7804b75718.zip
cookie.js add def parameter to getValue()
Diffstat (limited to 'lib/scripts/cookie.js')
-rw-r--r--lib/scripts/cookie.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/scripts/cookie.js b/lib/scripts/cookie.js
index a8e90fea5..4fb9c25f7 100644
--- a/lib/scripts/cookie.js
+++ b/lib/scripts/cookie.js
@@ -38,10 +38,11 @@ var DokuCookie = {
* Get a Value from the Cookie
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @param def default value if key does not exist; if not set, returns undefined by default
*/
- getValue: function(key){
+ getValue: function(key, def){
this.init();
- return this.data[key];
+ return key in this.data ? this.data[key] : def;
},
/**