From 935ecb0ef751ac1d658932316e06410e70c483e0 Mon Sep 17 00:00:00 2001 From: haobug Date: Fri, 28 Jun 2013 05:18:19 +0800 Subject: Improve Linkwizard, make it can be used more than once. As reported in https://forum.dokuwiki.org/thread/9988 the previous implementation can not handle the situation of use the linkwiz more than once. Now you can use in you toolbar plugin 'type' => 'linkwiz' to make use of the handy Linkwizard for choosing the wiki pages. --- lib/scripts/linkwiz.js | 24 ++++++++++++++++++------ lib/scripts/toolbar.js | 5 +++-- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js index c55650d68..875d4a995 100644 --- a/lib/scripts/linkwiz.js +++ b/lib/scripts/linkwiz.js @@ -22,6 +22,8 @@ var dw_linkwiz = { var pos = $editor.position(); // create HTML Structure + if(dw_linkwiz.$wiz) + return; dw_linkwiz.$wiz = jQuery(document.createElement('div')) .dialog({ autoOpen: false, @@ -235,15 +237,25 @@ var dw_linkwiz = { link = ':' + link; } - var so = link.length+3; - link = '[['+link+'|'; - if(stxt) { - link += stxt; + var so = link.length; + var eo = 0; + if(dw_linkwiz.val){ + if(dw_linkwiz.val.open) { + so += dw_linkwiz.val.open.length; + link = dw_linkwiz.val.open+link; + } + if(stxt) { + link += '|'+stxt; + so += 1; + } + if(dw_linkwiz.val.close) { + link += dw_linkwiz.val.close; + eo = dw_linkwiz.val.close.length; + } } - link += ']]'; - pasteText(sel,link,{startofs: so, endofs: 2}); + pasteText(sel,link,{startofs: so, endofs: eo}); dw_linkwiz.hide(); // reset the entry to the parent namespace diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index 6d75215e0..e33fa8677 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -211,9 +211,10 @@ function addBtnActionPicker($btn, props, edid) { * @return boolean If button should be appended * @author Andreas Gohr */ -function addBtnActionLinkwiz(btn, props, edid) { +function addBtnActionLinkwiz($btn, props, edid) { dw_linkwiz.init(jQuery('#'+edid)); - jQuery(btn).click(function(){ + jQuery($btn).click(function(){ + dw_linkwiz.val = props; dw_linkwiz.toggle(); return false; }); -- cgit v1.2.3 From fbd8067eeeb9f424981aad8b283e17f734c738c3 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 12 Jul 2013 17:29:28 +0200 Subject: updated jquery.cookie.js to 1.3.1 FS#2804 --- lib/scripts/jquery/jquery.cookie.js | 59 ++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 18 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/jquery/jquery.cookie.js b/lib/scripts/jquery/jquery.cookie.js index 2d4c05a84..c4f99af00 100644 --- a/lib/scripts/jquery/jquery.cookie.js +++ b/lib/scripts/jquery/jquery.cookie.js @@ -1,13 +1,19 @@ /*! - * jQuery Cookie Plugin v1.3 + * jQuery Cookie Plugin v1.3.1 * https://github.com/carhartl/jquery-cookie * - * Copyright 2011, Klaus Hartl - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/GPL-2.0 + * Copyright 2013 Klaus Hartl + * Released under the MIT license */ -(function ($, document, undefined) { +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as anonymous module. + define(['jquery'], factory); + } else { + // Browser globals. + factory(jQuery); + } +}(function ($) { var pluses = /\+/g; @@ -19,16 +25,22 @@ return decodeURIComponent(s.replace(pluses, ' ')); } + function converted(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + try { + return config.json ? JSON.parse(s) : s; + } catch(er) {} + } + var config = $.cookie = function (key, value, options) { // write if (value !== undefined) { options = $.extend({}, config.defaults, options); - if (value === null) { - options.expires = -1; - } - if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); @@ -37,7 +49,9 @@ value = config.json ? JSON.stringify(value) : String(value); return (document.cookie = [ - encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), + config.raw ? key : encodeURIComponent(key), + '=', + config.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', @@ -48,25 +62,34 @@ // read var decode = config.raw ? raw : decoded; var cookies = document.cookie.split('; '); + var result = key ? undefined : {}; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); - if (decode(parts.shift()) === key) { - var cookie = decode(parts.join('=')); - return config.json ? JSON.parse(cookie) : cookie; + var name = decode(parts.shift()); + var cookie = decode(parts.join('=')); + + if (key && key === name) { + result = converted(cookie); + break; + } + + if (!key) { + result[name] = converted(cookie); } } - return null; + return result; }; config.defaults = {}; $.removeCookie = function (key, options) { - if ($.cookie(key) !== null) { - $.cookie(key, null, options); + if ($.cookie(key) !== undefined) { + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); return true; } return false; }; -})(jQuery, document); +})); -- cgit v1.2.3 From 6b0ec830e5ac0044252908630e52d4494f1df570 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 21 Jul 2013 22:59:27 +0200 Subject: In debug mode: catch and log JS errors with file information When debugging is enabled (allowdebug enabled) JS errors are now catched for each non-core JS file and logged with the additional information from which file they came. This should make it easier to find out which plugin is the cause for broken JS code. The feature isn't enabled by default as defining functions inside try-clauses isn't allowed in strict mode and causes a warning at least in Firefox. --- lib/scripts/helpers.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/scripts') diff --git a/lib/scripts/helpers.js b/lib/scripts/helpers.js index d6f36967d..fdac13b71 100644 --- a/lib/scripts/helpers.js +++ b/lib/scripts/helpers.js @@ -68,3 +68,18 @@ function bind(fnc/*, ... */) { static_args.concat(Aps.call(arguments, 0))); }; } + +/** + * Report an error from a JS file to the console + * + * @param e The error object + * @param file The file in which the error occurred + */ +function logError(e, file) { + if (window.console && console.error) { + console.error('The error "%s: %s" occurred in file "%s". ' + + 'If this is in a plugin try updating or disabling the plugin, ' + + 'if this is in a template try updating the template or switching to the "default" or "dokuwiki" template.', + e.name, e.message, file); + } +} \ No newline at end of file -- cgit v1.2.3 From c6f665dd924dfa715fc19140c26d25eddcef9841 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Tue, 30 Jul 2013 17:50:17 +0200 Subject: Don't recommend the deprecated default template for JS debugging --- lib/scripts/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/helpers.js b/lib/scripts/helpers.js index fdac13b71..677abbad7 100644 --- a/lib/scripts/helpers.js +++ b/lib/scripts/helpers.js @@ -79,7 +79,7 @@ function logError(e, file) { if (window.console && console.error) { console.error('The error "%s: %s" occurred in file "%s". ' + 'If this is in a plugin try updating or disabling the plugin, ' + - 'if this is in a template try updating the template or switching to the "default" or "dokuwiki" template.', + 'if this is in a template try updating the template or switching to the "dokuwiki" template.', e.name, e.message, file); } -} \ No newline at end of file +} -- cgit v1.2.3 From 0e1777cbe86faf809f67198704842a01034a1a98 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Wed, 31 Jul 2013 17:05:07 +0100 Subject: added aria attributes to tree and show/hide functions --- lib/scripts/behaviour.js | 2 ++ lib/scripts/tree.js | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js index f1c46bf4c..85ddf503e 100644 --- a/lib/scripts/behaviour.js +++ b/lib/scripts/behaviour.js @@ -5,6 +5,7 @@ * @author Adrian Lang */ jQuery.fn.dw_hide = function(fn) { + this.attr('aria-expanded', 'false'); return this.slideUp('fast', fn); }; @@ -15,6 +16,7 @@ jQuery.fn.dw_hide = function(fn) { * @author Adrian Lang */ jQuery.fn.dw_show = function(fn) { + this.attr('aria-expanded', 'true'); return this.slideDown('fast', fn); }; diff --git a/lib/scripts/tree.js b/lib/scripts/tree.js index 96763053d..c4e1da3f7 100644 --- a/lib/scripts/tree.js +++ b/lib/scripts/tree.js @@ -14,6 +14,12 @@ jQuery.fn.dw_tree = function(overrides) { init: function () { this.$obj.delegate(this.toggle_selector, 'click', this, this.toggle); + jQuery('ul:first', this.$obj).attr('role', 'tree'); + jQuery('ul', this.$obj).not(':first').attr('role', 'group'); + jQuery('li', this.$obj).attr('role', 'treeitem'); + jQuery('li.open > ul', this.$obj).attr('aria-expanded', 'true'); + jQuery('li.closed > ul', this.$obj).attr('aria-expanded', 'false'); + jQuery('li.closed', this.$obj).attr('aria-live', 'assertive'); }, /** @@ -35,8 +41,14 @@ jQuery.fn.dw_tree = function(overrides) { $listitem = $clicky.closest('li'); $sublist = $listitem.find('ul').first(); opening = $listitem.hasClass('closed'); - $listitem.toggleClass('open closed'); dw_tree.toggle_display($clicky, opening); + if ($sublist.is(':visible')) { + $listitem.removeClass('open').addClass('closed'); + $sublist.attr('aria-expanded', 'false'); + } else { + $listitem.removeClass('closed').addClass('open'); + $sublist.attr('aria-expanded', 'true'); + } // if already open, close by hiding the sublist if (!opening) { @@ -48,6 +60,8 @@ jQuery.fn.dw_tree = function(overrides) { $sublist.hide(); if (typeof data !== 'undefined') { $sublist.html(data); + $sublist.parent().attr('aria-busy', 'false').removeAttr('aria-live'); + jQuery('li.closed', $sublist).attr('aria-live', 'assertive'); } if ($listitem.hasClass('open')) { // Only show if user didn’t close the list since starting @@ -63,11 +77,11 @@ jQuery.fn.dw_tree = function(overrides) { } //prepare the new ul - $sublist = jQuery('
    '); + $sublist = jQuery('
      '); $listitem.append($sublist); timeout = window.setTimeout( - bind(show_sublist, '
    • loading...
    • '), dw_tree.throbber_delay); + bind(show_sublist, '
    • loading...
    • '), dw_tree.throbber_delay); dw_tree.load_data(function (data) { window.clearTimeout(timeout); -- cgit v1.2.3 From 5a99d25b24f7e14f137084100f40325b7a2a71b4 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 1 Aug 2013 16:38:02 +0100 Subject: added aria attributes to edit mode --- lib/scripts/edit.js | 9 ++++++--- lib/scripts/editor.js | 1 + lib/scripts/toolbar.js | 29 ++++++++++++++++++++--------- 3 files changed, 27 insertions(+), 12 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 5a5e829bd..b1dbff683 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -23,7 +23,7 @@ function createToolButton(icon,label,key,id,classname){ $btn.addClass(classname); } - $btn.attr('title', label); + $btn.attr('title', label).attr('aria-controls', 'wiki__text'); if(key){ $btn.attr('title', label + ' ['+key.toUpperCase()+']') .attr('accessKey', key); @@ -40,6 +40,7 @@ function createToolButton(icon,label,key,id,classname){ icon = DOKU_BASE + 'lib/images/toolbar/' + icon; } $ico.attr('src', icon); + $ico.attr('alt', ''); $ico.attr('width', 16); $ico.attr('height', 16); $btn.append($ico); @@ -76,6 +77,7 @@ function createPicker(id,props,edid){ function $makebutton(title) { var $btn = jQuery(document.createElement('button')) .addClass('pickerbutton').attr('title', title) + .attr('aria-controls', edid) .bind('click', bind(pickerInsert, title, edid)) .appendTo($picker); return $btn; @@ -93,6 +95,7 @@ function createPicker(id,props,edid){ } jQuery(document.createElement('img')) .attr('src', item) + .attr('alt', '') .appendTo($makebutton(key)); }else if (typeof item == 'string'){ // a list of text -> treat as text picker @@ -132,9 +135,9 @@ function pickerInsert(text,edid){ function addBtnActionSignature($btn, props, edid) { if(typeof SIG != 'undefined' && SIG != ''){ $btn.bind('click', bind(insertAtCarret,edid,SIG)); - return true; + return edid; } - return false; + return ''; } /** diff --git a/lib/scripts/editor.js b/lib/scripts/editor.js index 042e34608..2c0924eb7 100644 --- a/lib/scripts/editor.js +++ b/lib/scripts/editor.js @@ -65,6 +65,7 @@ var dw_editor = { ], function (_, img) { jQuery(document.createElement('IMG')) .attr('src', DOKU_BASE+'lib/images/' + img[0] + '.gif') + .attr('alt', '') .click(img[1]) .appendTo($ctl); }); diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index 6d75215e0..5fc4d835e 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -52,8 +52,13 @@ function initToolbar(tbid,edid,tb, allowblock){ // type is a init function -> execute it actionFunc = 'addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1); if( jQuery.isFunction(window[actionFunc]) ){ - if(window[actionFunc]($btn, val, edid)){ + var pickerid = window[actionFunc]($btn, val, edid); + if(pickerid !== ''){ $toolbar.append($btn); + $btn.attr('aria-controls', pickerid); + if (actionFunc === 'addBtnActionPicker') { + $btn.attr('aria-haspopup', 'true'); + } } return; } @@ -190,16 +195,17 @@ function tb_autohead(btn, props, edid){ */ function addBtnActionPicker($btn, props, edid) { var pickerid = 'picker'+(pickercounter++); - createPicker(pickerid, props, edid); + var picker = createPicker(pickerid, props, edid); + jQuery(picker).attr('aria-hidden', 'true'); $btn.click( function() { pickerToggle(pickerid,$btn); - return false; + return ''; } ); - return true; + return pickerid; } /** @@ -215,22 +221,26 @@ function addBtnActionLinkwiz(btn, props, edid) { dw_linkwiz.init(jQuery('#'+edid)); jQuery(btn).click(function(){ dw_linkwiz.toggle(); - return false; + return ''; }); - return true; + return 'link__wiz'; } /** - * Show/Hide a previosly created picker window + * Show/Hide a previously created picker window * * @author Andreas Gohr */ function pickerToggle(pickerid,$btn){ var $picker = jQuery('#' + pickerid), pos = $btn.offset(); - $picker.toggleClass('a11y') - .offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3}); + if ($picker.hasClass('a11y')) { + $picker.removeClass('a11y').attr('aria-hidden', 'false'); + } else { + $picker.addClass('a11y').attr('aria-hidden', 'true'); + } + $picker.offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3}); } /** @@ -252,4 +262,5 @@ function fixtxt(str){ jQuery(function () { initToolbar('tool__bar','wiki__text',toolbar); + jQuery('#tool__bar').attr('role', 'toolbar'); }); -- cgit v1.2.3 From 193e22801d763e715f03f241b135a2e249c6132e Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 1 Aug 2013 16:42:31 +0100 Subject: removed unused and old hasFlash() JS function --- lib/scripts/helpers.js | 19 ------------------- lib/scripts/media.js | 19 ------------------- 2 files changed, 38 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/helpers.js b/lib/scripts/helpers.js index d6f36967d..632c4bff2 100644 --- a/lib/scripts/helpers.js +++ b/lib/scripts/helpers.js @@ -2,25 +2,6 @@ * Various helper functions */ -/** - * Very simplistic Flash plugin check, probably works for Flash 8 and higher only - * - * @author Andreas Gohr - */ -function hasFlash(version){ - var ver = 0; - try{ - if(navigator.plugins != null && navigator.plugins.length > 0){ - ver = navigator.plugins["Shockwave Flash"].description.split(' ')[2].split('.')[0]; - }else{ - ver = (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) - .GetVariable("$version").split(' ')[1].split(',')[0]; - } - }catch(e){ } - - return ver >= version; -} - /** * A PHP-style substr_replace * diff --git a/lib/scripts/media.js b/lib/scripts/media.js index 182d5fefe..8ca21ecab 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -921,23 +921,4 @@ var dw_mediamanager = { } }; -// moved from helpers.js temporarily here -/** - * Very simplistic Flash plugin check, probably works for Flash 8 and higher only - * - */ -function hasFlash(version){ - var ver = 0, axo; - try{ - if(navigator.plugins !== null && navigator.plugins.length > 0){ - ver = navigator.plugins["Shockwave Flash"].description.split(' ')[2].split('.')[0]; - }else{ - axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); - ver = axo.GetVariable("$version").split(' ')[1].split(',')[0]; - } - }catch(e){ } - - return ver >= version; -} - jQuery(dw_mediamanager.init); -- cgit v1.2.3 From 763ffe58812aba9b1e6fe2bca4bb74187ab16ea3 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 1 Aug 2013 17:11:29 +0100 Subject: added aria attributes for footnote tooltips --- lib/scripts/page.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/page.js b/lib/scripts/page.js index 4ab0bf9b5..7b4958d82 100644 --- a/lib/scripts/page.js +++ b/lib/scripts/page.js @@ -62,7 +62,9 @@ dw_page = { $fndiv = jQuery(document.createElement('div')) .attr('id', popup_id) .addClass('insitu-footnote JSpopup') - .mouseleave(function () {jQuery(this).hide();}); + .attr('aria-hidden', 'true') + .mouseleave(function () {jQuery(this).hide().attr('aria-hidden', 'true');}) + .attr('role', 'tooltip'); jQuery('.dokuwiki:first').append($fndiv); } @@ -97,7 +99,7 @@ dw_page = { content = content.replace(/\bid=(['"])([^"']+)\1/gi,'id="insitu__$2'); // now put the content into the wrapper - dw_page.insituPopup(this, 'insitu__fn').html(content).show(); + dw_page.insituPopup(this, 'insitu__fn').html(content).show().attr('aria-hidden', 'false'); }, /** -- cgit v1.2.3 From 9805efa058358e0fcbd3976fa553901cabe0b2e0 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 1 Aug 2013 17:20:25 +0100 Subject: added aria roles to search and acl manager --- lib/scripts/tw-sack.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/scripts') diff --git a/lib/scripts/tw-sack.js b/lib/scripts/tw-sack.js index cc988f5be..b0e570151 100644 --- a/lib/scripts/tw-sack.js +++ b/lib/scripts/tw-sack.js @@ -2,6 +2,7 @@ /* ©2005 Gregory Wild-Smith */ /* www.twilightuniverse.com */ /* Software licenced under a modified X11 licence, see documentation or authors website for more details */ +/* @deprecated */ function sack(file){ this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n"; -- cgit v1.2.3 From c84391dcf5eb8a23bcae9e558285975c6b47e7f1 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 3 Aug 2013 17:19:28 +0200 Subject: show media files in date order (most recent first) after an upload is completed --- lib/scripts/fileuploaderextended.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/scripts') diff --git a/lib/scripts/fileuploaderextended.js b/lib/scripts/fileuploaderextended.js index 0ba7a0525..f5786c387 100644 --- a/lib/scripts/fileuploaderextended.js +++ b/lib/scripts/fileuploaderextended.js @@ -188,6 +188,7 @@ qq.extend(qq.FileUploaderExtended.prototype, { if (i) action = action.substr(0, i); var button = '
      '; button += ''; + button += ''; button += '
      '; jQuery('#mediamanager__uploader').append(button); } -- cgit v1.2.3 From 2f7a0e94cadfbc1ece3bd1d3ff23483b845cd420 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Tue, 10 Sep 2013 22:17:43 -0700 Subject: Fix CodeSniffer whitespace violoations Removed extraneous whitespace to eliminate errors reported by the Squiz.WhiteSpace.SuperfluousWhitespace sniff. --- lib/scripts/linkwiz.js | 1 - lib/scripts/textselection.js | 2 -- 2 files changed, 3 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js index 875d4a995..f6ac9b032 100644 --- a/lib/scripts/linkwiz.js +++ b/lib/scripts/linkwiz.js @@ -237,7 +237,6 @@ var dw_linkwiz = { link = ':' + link; } - var so = link.length; var eo = 0; if(dw_linkwiz.val){ diff --git a/lib/scripts/textselection.js b/lib/scripts/textselection.js index bd80e9341..26b4196f2 100644 --- a/lib/scripts/textselection.js +++ b/lib/scripts/textselection.js @@ -104,7 +104,6 @@ function getSelection(textArea) { } } while ((!before_finished || !selection_finished)); - // count number of newlines in str to work around stupid IE selection bug var countNL = function(str) { var m = str.split("\r\n"); @@ -230,4 +229,3 @@ function insertAtCarret(textAreaID, text){ var selection = getSelection(txtarea); pasteText(selection,text,{nosel: true}); } - -- cgit v1.2.3 From 75e4dd8a2ec6c181e99877919b5a2b529407752a Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 8 Oct 2013 00:06:46 +0200 Subject: Use in cookie a correct path, added DOKU_COOKIEPATH to js constants Fixes FS#2837 --- lib/scripts/cookie.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scripts') diff --git a/lib/scripts/cookie.js b/lib/scripts/cookie.js index 3ad67bfa4..4cb527f26 100644 --- a/lib/scripts/cookie.js +++ b/lib/scripts/cookie.js @@ -30,7 +30,7 @@ var DokuCookie = { text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val)); } }); - jQuery.cookie(this.name, text.join('#'), {expires: 365, path: DOKU_BASE}); + jQuery.cookie(this.name, text.join('#'), {expires: 365, path: DOKU_COOKIEPATH}); }, /** -- cgit v1.2.3 From df5d307ea8bac1f5030d42af363ae9f7469a63f2 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 10 Oct 2013 15:53:03 +0200 Subject: add cookie secure parameter to cookies set by javascript --- lib/scripts/cookie.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scripts') diff --git a/lib/scripts/cookie.js b/lib/scripts/cookie.js index 4cb527f26..8417d2064 100644 --- a/lib/scripts/cookie.js +++ b/lib/scripts/cookie.js @@ -30,7 +30,7 @@ var DokuCookie = { text.push(encodeURIComponent(key)+'#'+encodeURIComponent(val)); } }); - jQuery.cookie(this.name, text.join('#'), {expires: 365, path: DOKU_COOKIEPATH}); + jQuery.cookie(this.name, text.join('#'), {expires: 365, path: DOKU_COOKIE_PARAM.path, secure: DOKU_COOKIE_PARAM.secure}); }, /** -- cgit v1.2.3