From cf2c8e759bf06596f9492d090f4dd8dbb76a178c Mon Sep 17 00:00:00 2001
From: Anika Henke <anika@selfthinker.org>
Date: Sat, 25 Jul 2015 22:58:51 +0100
Subject: [PATCH] changed input submits to buttons, fixed small RTL issue

---
 lib/plugins/styling/admin.php        | 10 +++++-----
 lib/plugins/styling/lang/en/lang.php |  2 +-
 lib/plugins/styling/script.js        |  2 +-
 lib/plugins/styling/style.less       |  6 +++++-
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lib/plugins/styling/admin.php b/lib/plugins/styling/admin.php
index c6c04bb52..c747c3130 100644
--- a/lib/plugins/styling/admin.php
+++ b/lib/plugins/styling/admin.php
@@ -83,22 +83,22 @@ class admin_plugin_styling extends DokuWiki_Admin_Plugin {
 
                 echo '<tr>';
                 echo '<td><label for="tpl__'.hsc($key).'">'.$name.'</label></td>';
-                echo '<td><input type="text" name="tpl['.hsc($key).']" id="tpl__'.hsc($key).'" value="'.hsc($value).'" '.$this->colorClass($key).' /></td>';
+                echo '<td><input type="text" name="tpl['.hsc($key).']" id="tpl__'.hsc($key).'" value="'.hsc($value).'" '.$this->colorClass($key).' dir="ltr" /></td>';
                 echo '</tr>';
             }
             echo '</tbody></table>';
 
             echo '<p>';
-            echo '<input type="submit" name="run[preview]" class="btn_preview primary" value="'.$this->getLang('btn_preview').'" /> ';
-            echo '<input type="submit" name="run[reset]" value="'.$this->getLang('btn_reset').'" />'; #FIXME only if preview.ini exists
+            echo '<button type="submit" name="run[preview]" class="btn_preview primary">'.$this->getLang('btn_preview').'</button> ';
+            echo '<button type="submit" name="run[reset]">'.$this->getLang('btn_reset').'</button>'; #FIXME only if preview.ini exists
             echo '</p>';
 
             echo '<p>';
-            echo '<input type="submit" name="run[save]" class="primary" value="'.$this->getLang('btn_save').'" />';
+            echo '<button type="submit" name="run[save]" class="primary">'.$this->getLang('btn_save').'</button>';
             echo '</p>';
 
             echo '<p>';
-            echo '<input type="submit" name="run[revert]" value="'.$this->getLang('btn_revert').'" />'; #FIXME only if local.ini exists
+            echo '<button type="submit" name="run[revert]">'.$this->getLang('btn_revert').'</button>'; #FIXME only if local.ini exists
             echo '</p>';
 
             echo '</form>';
diff --git a/lib/plugins/styling/lang/en/lang.php b/lib/plugins/styling/lang/en/lang.php
index 010743956..e0011eb83 100644
--- a/lib/plugins/styling/lang/en/lang.php
+++ b/lib/plugins/styling/lang/en/lang.php
@@ -17,7 +17,7 @@ $lang['error'] = 'Sorry, this template does not support this functionality.';
 $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';
+$lang['btn_revert']  = 'Revert styles back to template\'s default';
 
 // default guaranteed placeholders
 $lang['__text__']           = 'Main text color';
diff --git a/lib/plugins/styling/script.js b/lib/plugins/styling/script.js
index 2f4285269..aa343fd71 100644
--- a/lib/plugins/styling/script.js
+++ b/lib/plugins/styling/script.js
@@ -85,7 +85,7 @@ jQuery(function () {
     };
 
     // don't reload on our own buttons
-    jQuery('input[type=submit]').click(function(e){
+    jQuery(':button').click(function(e){
         doreload = false;
     });
 
diff --git a/lib/plugins/styling/style.less b/lib/plugins/styling/style.less
index 120768289..be0e16a5b 100644
--- a/lib/plugins/styling/style.less
+++ b/lib/plugins/styling/style.less
@@ -1,7 +1,11 @@
 #plugin__styling {
-    input.primary {
+    button.primary {
         font-weight: bold;
     }
+
+    [dir=rtl] & table input {
+        text-align: right;
+    }
 }
 
 #plugin__styling_loader {
-- 
GitLab