From b1a864fe66dcf7f538e4d304cc01ea9ec736b786 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 17 May 2015 19:45:15 +0200 Subject: fix keeping the current page --- lib/plugins/styler/action.php | 3 +++ lib/plugins/styler/admin.php | 1 - lib/plugins/styler/script.js | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/plugins/styler/action.php b/lib/plugins/styler/action.php index b63cf3ec1..35e2f8f3c 100644 --- a/lib/plugins/styler/action.php +++ b/lib/plugins/styler/action.php @@ -90,6 +90,9 @@ class action_plugin_styler extends DokuWiki_Action_Plugin { $event->preventDefault(); $event->stopPropagation(); + global $ID; + $ID = getID(); + /** @var admin_plugin_styler $hlp */ $hlp = plugin_load('admin', 'styler'); $hlp->form(true); diff --git a/lib/plugins/styler/admin.php b/lib/plugins/styler/admin.php index 4269a0ee7..432b22279 100644 --- a/lib/plugins/styler/admin.php +++ b/lib/plugins/styler/admin.php @@ -61,7 +61,6 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { public function form($isajax) { global $conf; global $ID; - $tpl = $conf['template']; define('SIMPLE_TEST', 1); // hack, ideally certain functions should be moved out of css.php require_once(DOKU_INC.'lib/exe/css.php'); $styleini = css_styleini($conf['template'], true); diff --git a/lib/plugins/styler/script.js b/lib/plugins/styler/script.js index b71e46802..1c53987a4 100644 --- a/lib/plugins/styler/script.js +++ b/lib/plugins/styler/script.js @@ -4,7 +4,7 @@ jQuery(function () { // user openend the admin page, set cookie and redirect if (jQuery('#plugin__styler').length) { DokuCookie.setValue('styler_plugin', 1); - document.location.href = DOKU_BASE; + document.location.href = document.location.href.replace(/do=admin/, ''); } // The Styler Dialog is currently enabled, display it here and apply the preview styles @@ -15,7 +15,8 @@ jQuery(function () { $dialog.load( DOKU_BASE + '/lib/exe/ajax.php', { - 'call': 'plugin_styler' + 'call': 'plugin_styler', + 'id': JSINFO.id }, function () { // load the preview template -- cgit v1.2.3