From b8a4cc913e8deafbe0fba4baff03f7f6e99f2c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 20 Apr 2017 15:50:53 +0200 Subject: [PATCH 1/6] Fix not correctly forgetting section-open state The sidebar is intended to close all sections when the content is wide and set their default back to closed. SPR-883 --- js/sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/sidebar.js b/js/sidebar.js index 56bd928..b87ffc6 100644 --- a/js/sidebar.js +++ b/js/sidebar.js @@ -21,7 +21,7 @@ jQuery(function () { for (var index=0; index <= sessionStorage.length; index += 1) { var item = sessionStorage.getItem('sidebar-section-' + index + '-open'); if (!item) { - break; + continue; } sessionStorage.removeItem('sidebar-section-' + index + '-open'); } From fdf5eaea74d8409203a1aeda1c2cf8a509b75835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 20 Apr 2017 16:23:26 +0200 Subject: [PATCH 2/6] Remember sidebar toggle-state While browsing a wiki, it would be nice if it would remember whether the content is wide or not. SPR-883 --- js/sidebar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/sidebar.js b/js/sidebar.js index b87ffc6..f7b6f98 100644 --- a/js/sidebar.js +++ b/js/sidebar.js @@ -12,6 +12,7 @@ jQuery(function () { $nav.find('div.nav-panel').hide(); // close all panels jQuery('body').addClass('wide-content'); removeToggleStorage(); + sessionStorage.setItem('wide-content', true); }, /** @@ -32,7 +33,7 @@ jQuery(function () { */ setDefaultContent = function () { jQuery('body').removeClass('wide-content'); - + sessionStorage.setItem('wide-content', false); }, /** @@ -166,6 +167,10 @@ jQuery(function () { setWideContent(); } }); + + if (sessionStorage.getItem('wide-content') === 'true') { + setWideContent(); + } }, /** From 6df4603459ec037ca8392be642b54ecd235c1503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 20 Apr 2017 16:30:50 +0200 Subject: [PATCH 3/6] Explicitly refer to the global sessionStorage Using this as a local variable might break in some browsers. --- js/sidebar.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/sidebar.js b/js/sidebar.js index f7b6f98..d0811b7 100644 --- a/js/sidebar.js +++ b/js/sidebar.js @@ -12,19 +12,19 @@ jQuery(function () { $nav.find('div.nav-panel').hide(); // close all panels jQuery('body').addClass('wide-content'); removeToggleStorage(); - sessionStorage.setItem('wide-content', true); + window.sessionStorage.setItem('wide-content', true); }, /** * removes information about the toggle-state */ removeToggleStorage = function () { - for (var index=0; index <= sessionStorage.length; index += 1) { - var item = sessionStorage.getItem('sidebar-section-' + index + '-open'); + for (var index=0; index <= window.sessionStorage.length; index += 1) { + var item = window.sessionStorage.getItem('sidebar-section-' + index + '-open'); if (!item) { continue; } - sessionStorage.removeItem('sidebar-section-' + index + '-open'); + window.sessionStorage.removeItem('sidebar-section-' + index + '-open'); } }, @@ -33,7 +33,7 @@ jQuery(function () { */ setDefaultContent = function () { jQuery('body').removeClass('wide-content'); - sessionStorage.setItem('wide-content', false); + window.sessionStorage.setItem('wide-content', false); }, /** @@ -61,7 +61,7 @@ jQuery(function () { focusFirstSubLink($panel); } }); - sessionStorage.setItem('sidebar-section-' + $toggler.data('index') + '-open', !isOpen); + window.sessionStorage.setItem('sidebar-section-' + $toggler.data('index') + '-open', !isOpen); }, /** @@ -124,7 +124,7 @@ jQuery(function () { $toggler.parent('li').addClass('toggler'); } - if (sessionStorage.getItem('sidebar-section-' + index + '-open') === 'true') { + if (window.sessionStorage.getItem('sidebar-section-' + index + '-open') === 'true') { $wrap.css('display', 'block'); } @@ -168,7 +168,7 @@ jQuery(function () { } }); - if (sessionStorage.getItem('wide-content') === 'true') { + if (window.sessionStorage.getItem('wide-content') === 'true') { setWideContent(); } }, From 67d7dea5e821b568784466b5f8dd51586f0ef9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Fri, 21 Apr 2017 16:36:05 +0200 Subject: [PATCH 4/6] Show number of tags in metabox label SPR-939 --- Template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Template.php b/Template.php index df7ef52..b2924d9 100644 --- a/Template.php +++ b/Template.php @@ -88,7 +88,7 @@ class Template { * @return array */ public function getMetaBoxTabs() { - global $lang; + global $lang, $INFO; $tabs = array(); $toc = tpl_toc(true); @@ -106,7 +106,7 @@ class Template { 'id' => 'spr__tab-tags', 'label' => tpl_getLang('tab_tags'), 'tab' => $this->plugins['tagging']->tpl_tags(false), - 'count' => null, // FIXME + 'count' => count($this->plugins['tagging']->findItems(array('pid' => $INFO['id']), 'tag')), ); } From d29aa0daacafaf92fc58d48e041527caf1b885da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Fri, 21 Apr 2017 17:49:52 +0200 Subject: [PATCH 5/6] Editbutton should be closely below section The `margin-top: 0` overwrites DokuWiki's default `margin-top: -1.4em` and causes the edit button to be far below the section it is supposed to edit. This causes a visual disconnect between button and section, especially for small or empty sections. This is even more apparent when contrasted with the button-placement for tables etc. --- css/area_main-content-secedit.less | 1 - 1 file changed, 1 deletion(-) diff --git a/css/area_main-content-secedit.less b/css/area_main-content-secedit.less index cd5582d..976d752 100644 --- a/css/area_main-content-secedit.less +++ b/css/area_main-content-secedit.less @@ -21,7 +21,6 @@ z-index: 2; top: 0; float: right; - margin-top: 0; form div.no { button { From 81a9f400e799758c364128e4206d06969172defd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Mon, 24 Apr 2017 11:15:27 +0200 Subject: [PATCH 6/6] Prevent interaction between do-js and our page-tasks-icon The javascript of the do-plugin tries to update the container with the plugin__do_pagetasks class. However, since our container has a different structure than the icon produced by the do-plugin, this attempt fails and leaves the icon in a broken state. This commit changes the class of the container and thus ceases to be affected by the do-plugin's javascript. SPR-946 --- css/plugins/do_tasks.less | 23 +++++++++++------------ tpl/nav-page-attributes.php | 14 +------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/css/plugins/do_tasks.less b/css/plugins/do_tasks.less index 6b66253..b3aea69 100755 --- a/css/plugins/do_tasks.less +++ b/css/plugins/do_tasks.less @@ -2,22 +2,21 @@ * This file provides styles for do-task plugin */ - /* + + + + + global + + + + + */ ul.page-attributes { - .plugin__do_pagetasks { + .plugin_do_pagetasks { + position: relative; + border-radius: @ini_default_border_radius; // @ini_default_border_radius vs. @fix_border-radius + + strong { + overflow: hidden; + background-color: @ini_background; + border-color: @noopentasks-border; + color: @ini_text_webframe; + } + &.do_none { - position: relative; - border-radius: @ini_default_border_radius; // @ini_default_border_radius vs. @fix_border-radius - - strong { - overflow: hidden; - background-color: @ini_background; - border-color: @noopentasks-border; - color: @ini_text_webframe; - } - .num { background-color: @noopentasks-border; // fix color: @noopentasks-color; // fix diff --git a/tpl/nav-page-attributes.php b/tpl/nav-page-attributes.php index 1bacb7c..498cb36 100755 --- a/tpl/nav-page-attributes.php +++ b/tpl/nav-page-attributes.php @@ -35,7 +35,7 @@ if($doPlugin !== null) { $class = 'do_late'; $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']); } - $markup = "
  • " . tpl_getLang('prefix_tasks_page') . " {$count['undone']}
  • "; + $markup = "
  • {$count['undone']}" . tpl_getLang('prefix_tasks_page') . "
  • "; echo $markup; } @@ -43,15 +43,3 @@ if($doPlugin !== null) { if($doPlugin !== null || $qcPlugin !== null) { echo ""; } - - - -/* - - -$out = '
    '; -$out .= $count['undone']; -$out .= '
    '; - -if($return) return $out; -echo $out;*/