From d634152e42ef1c75d899f021132ce0c2632257ac Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Tue, 7 Jul 2015 12:39:55 +0100 Subject: improved various minor frontend issues in styling plugin * improved spacing of popup * made primary buttons clearer * xhtml and validity fixes * improved some lang strings * moved 'open as popup' after intro * fixed page reload after clicking 'open as popup' button --- lib/plugins/styling/admin.php | 16 ++++++++-------- lib/plugins/styling/lang/en/lang.php | 10 +++++----- lib/plugins/styling/popup.php | 14 ++++++++------ lib/plugins/styling/script.js | 14 ++++++++------ lib/plugins/styling/style.less | 7 ++----- 5 files changed, 31 insertions(+), 30 deletions(-) (limited to 'lib/plugins') diff --git a/lib/plugins/styling/admin.php b/lib/plugins/styling/admin.php index 627efbd15..f241e3fed 100644 --- a/lib/plugins/styling/admin.php +++ b/lib/plugins/styling/admin.php @@ -43,7 +43,7 @@ class admin_plugin_styling extends DokuWiki_Admin_Plugin { */ public function html() { $class = 'nopopup'; - if($this->ispopup) $class = 'ispopup'; + if($this->ispopup) $class = 'ispopup page'; echo '
'; ptln('

'.$this->getLang('menu').'

'); @@ -75,7 +75,7 @@ class admin_plugin_styling extends DokuWiki_Admin_Plugin { echo '
'; - echo ''; + echo '
'; foreach($replacements as $key => $value) { $name = tpl_getLang($key); if(empty($name)) $name = $this->getLang($key); @@ -83,22 +83,22 @@ class admin_plugin_styling extends DokuWiki_Admin_Plugin { echo ''; echo ''; - echo ''; echo ''; } - echo '
'.$name.'colorClass($key).' />'; + echo 'colorClass($key).' />
'; + echo ''; echo '

'; - echo ''; - echo ''; #FIXME only if preview.ini exists + echo ' '; + echo ''; #FIXME only if preview.ini exists echo '

'; echo '

'; - echo ''; + echo ''; echo '

'; echo '

'; - echo ''; #FIXME only if local.ini exists + echo ''; #FIXME only if local.ini exists echo '

'; echo '
'; diff --git a/lib/plugins/styling/lang/en/lang.php b/lib/plugins/styling/lang/en/lang.php index a076065cb..010743956 100644 --- a/lib/plugins/styling/lang/en/lang.php +++ b/lib/plugins/styling/lang/en/lang.php @@ -8,15 +8,15 @@ // menu entry for admin plugins $lang['menu'] = 'Template Style Settings'; -$lang['js']['loader'] = 'Preview is loading...
if this does not goes away, your values may be faulty'; -$lang['js']['popup'] = 'Open as Popup'; +$lang['js']['loader'] = 'Preview is loading...
if this does not goes away, your values may be faulty'; +$lang['js']['popup'] = 'Open as a popup'; // custom language strings for the plugin $lang['error'] = 'Sorry, this template does not support this functionality.'; -$lang['btn_preview'] = 'Preview your changes'; -$lang['btn_save'] = 'Save your changes'; -$lang['btn_reset'] = 'Reset your current changes'; +$lang['btn_preview'] = 'Preview changes'; +$lang['btn_save'] = 'Save changes'; +$lang['btn_reset'] = 'Reset current changes'; $lang['btn_revert'] = 'Revert all styles back to the template\'s default'; // default guaranteed placeholders diff --git a/lib/plugins/styling/popup.php b/lib/plugins/styling/popup.php index eea4f3bfd..964b19e29 100644 --- a/lib/plugins/styling/popup.php +++ b/lib/plugins/styling/popup.php @@ -4,6 +4,7 @@ require_once(DOKU_INC . 'inc/init.php'); //close session session_write_close(); header('Content-Type: text/html; charset=utf-8'); +header('X-UA-Compatible: IE=edge,chrome=1'); /** @var admin_plugin_styling $plugin */ $plugin = plugin_load('admin', 'styling'); @@ -14,15 +15,16 @@ $plugin->ispopup = true; $plugin->handle(); // output plugin in a very minimal template: -?> - +?> + + <?php echo $plugin->getLang('menu') ?> + + - -
- html() ?> -
+ + html() ?> diff --git a/lib/plugins/styling/script.js b/lib/plugins/styling/script.js index 6fc2b9043..84b251eab 100644 --- a/lib/plugins/styling/script.js +++ b/lib/plugins/styling/script.js @@ -12,14 +12,15 @@ jQuery(function () { // add button on main page if (!$styling_plugin.hasClass('ispopup')) { - var $hl = $styling_plugin.find('h1').first(); - var $btn = jQuery(''); - $hl.append($btn); + var $form = $styling_plugin.find('form.styling').first(); + var $btn = jQuery(''); + $form.prepend($btn); $btn.click(function (e) { var windowFeatures = "menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500"; window.open(DOKU_BASE + 'lib/plugins/styling/popup.php', 'styling', windowFeatures) - }); + e.preventDefault(); + }).wrap('

'); return; } @@ -54,9 +55,10 @@ jQuery(function () { 'background-color': '#fff', 'opacity': '0.7', 'color': '#000', - 'font-size': '40px', + 'font-size': '2.5em', 'text-align': 'center', - 'line-height': '90px' + 'line-height': 1.5, + 'padding-top': '2em' }); window.opener.jQuery('body').append($loader); } diff --git a/lib/plugins/styling/style.less b/lib/plugins/styling/style.less index 3cb563fdb..120768289 100644 --- a/lib/plugins/styling/style.less +++ b/lib/plugins/styling/style.less @@ -1,9 +1,6 @@ #plugin__styling { - - h1 button { - font-size: 12px; - line-height: 16px; - margin-left: 1em; + input.primary { + font-weight: bold; } } -- cgit v1.2.3