]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Change password and manage tags template
authorArthurHoaro <arthur@hoa.ro>
Fri, 14 Oct 2016 13:13:38 +0000 (15:13 +0200)
committerArthurHoaro <arthur@hoa.ro>
Fri, 14 Oct 2016 13:13:38 +0000 (15:13 +0200)
tpl/default/addlink.html
tpl/default/changepassword.html [new file with mode: 0644]
tpl/default/changetag.html [new file with mode: 0644]
tpl/default/css/shaarli.css
tpl/default/js/shaarli.js

index bc328daacb6fb8e870580904ef34e18af1d13371..05207551db7aab567acc628122cc8ef443b36b36 100644 (file)
@@ -9,7 +9,7 @@
   <div class="pure-u-lg-1-3 pure-u-1-8"></div>
   <div id="addlink-form" class="page-form pure-u-lg-1-3 pure-u-3-4">
     <h2>{"Shaare a new link"|t}</h2>
-    <form method="GET" action="" name="addform" class="addform page-form page-form-light">
+    <form method="GET" action="" name="addform" class="addform page-form page-form-light autofocus">
       <div>
         <input type="text" name="post" placeholder="{'URL or leave empty to post a note'|t}">
       </div>
@@ -20,8 +20,5 @@
   </div>
 </div>
 {include="page.footer"}
-<script>
-  document.getElementsByName('post')[0].focus();
-</script>
 </body>
 </html>
diff --git a/tpl/default/changepassword.html b/tpl/default/changepassword.html
new file mode 100644 (file)
index 0000000..69191fa
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+  {include="includes"}
+</head>
+<body>
+{include="page.header"}
+<div class="pure-g">
+  <div class="pure-u-lg-1-3 pure-u-1-8"></div>
+  <div id="addlink-form" class="page-form pure-u-lg-1-3 pure-u-3-4">
+    <h2>{"Change password"|t}</h2>
+    <form method="POST" action="" name="changepasswordform" id="changepasswordform"
+          class="addform page-form page-form-light">
+      <div>
+        <input type="password" name="oldpassword" placeholder="{'Current password'|t}" class="autofocus">
+      </div>
+      <div>
+        <input type="password" name="setpassword" placeholder="{'New password'|t}">
+      </div>
+      <input type="hidden" name="token" value="{$token}">
+      <div>
+        <input type="submit" value="{'Change'|t}">
+      </div>
+    </form>
+  </div>
+</div>
+{include="page.footer"}
+</body>
+</html>
diff --git a/tpl/default/changetag.html b/tpl/default/changetag.html
new file mode 100644 (file)
index 0000000..ca2d2db
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+  {include="includes"}
+</head>
+<body>
+{include="page.header"}
+<div class="pure-g">
+  <div class="pure-u-lg-1-3 pure-u-1-8"></div>
+  <div id="addlink-form" class="page-form pure-u-lg-1-3 pure-u-3-4">
+    <h2>{"Manage tags"|t}</h2>
+    <form method="POST" action="" name="changetag" id="changetag"
+          class="addform page-form page-form-light">
+      <div>
+        <input type="text" name="fromtag" placeholder="{'Tag'|t}"
+               list="tagsList" autocomplete="off" class="awesomplete autofocus" data-minChars="1">
+        <datalist id="tagsList">
+          {loop="$tags"}<option>{$key}</option>{/loop}
+        </datalist>
+      </div>
+      <div>
+        <input type="text" name="totag" placeholder="{'New name'|t}"
+               list="toTagsList" autocomplete="off" class="awesomplete" data-minChars="1">
+        <datalist id="toTagsList">
+          {loop="$tags"}<option>{$key}</option>{/loop}
+        </datalist>
+      </div>
+      <div>{'Case sensitive'|t}</div>
+      <input type="hidden" name="token" value="{$token}">
+      <div>
+        <input type="submit" value="{'Rename'|t}" name="renametag">
+        <span class="pure-u-0 pure-u-lg-visible">or</span>
+        <input type="submit" value="{'Delete'|t}" name="deletetag">
+      </div>
+    </form>
+  </div>
+</div>
+{include="page.footer"}
+</body>
+</html>
index 4c9f76afc4abd72e04ce07e6ad0bb0d686d83856..22c173b1f99a550aa87eda7e8cb58fd4c867b6da 100644 (file)
@@ -969,4 +969,4 @@ pre {
     #pluginform .mobile-row, #pluginform .mobile-row td {
         border-top-style: none;
     }
-}
\ No newline at end of file
+}
index f24aff736a445061562e52c729f50366f48ebf63..e542548607899191d9c09421a59eb4fc3216d4d2 100644 (file)
@@ -146,16 +146,29 @@ if (newVersionDismiss != null) {
 var loginButton = document.getElementById('login-button');
 var loginBlock = document.getElementById('header-login-form');
 
-loginButton.addEventListener('click', function(event) {
-    event.preventDefault();
-    loginBlock.classList.toggle('open');
-    document.getElementById('content').style.boxShadow = 'none';
-});
+if (loginButton != null) {
+    loginButton.addEventListener('click', function(event) {
+        event.preventDefault();
+        loginBlock.classList.toggle('open');
+        document.getElementById('content').style.boxShadow = 'none';
+    });
+}
 
 // Focus on login field.
-loginBlock.addEventListener('transitionend', function() {
-    loginBlock.firstElementChild.focus();
-});
+if (loginBlock != null) {
+    loginBlock.addEventListener('transitionend', function () {
+        loginBlock.firstElementChild.focus();
+    });
+}
 
 var hiddenReturnurl = document.getElementsByName('returnurl');
-hiddenReturnurl.value = window.location.href;
\ No newline at end of file
+if (hiddenReturnurl != null) {
+    hiddenReturnurl.value = window.location.href;
+}
+
+
+var autofocusElements = document.querySelector('.autofocus');
+console.log(autofocusElements);
+if (autofocusElements != null) {
+    autofocusElements.focus();
+}
\ No newline at end of file