diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-03-06 21:29:56 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-03-12 20:27:16 +0100 |
commit | bdd1715b249561ed919e4f03a06aec1f4c327335 (patch) | |
tree | eb21225e95b1fd849a8404c7bfe9bff6f970a8cb /tpl/changetag.html | |
parent | 3a10fa0e3f0d0978dc359d1407b93fe425f44b25 (diff) | |
download | Shaarli-bdd1715b249561ed919e4f03a06aec1f4c327335.tar.gz Shaarli-bdd1715b249561ed919e4f03a06aec1f4c327335.tar.zst Shaarli-bdd1715b249561ed919e4f03a06aec1f4c327335.zip |
Use awesomplete as autocomplete lib and remove jQuery - shaarli/Shaarli#148
* Add awesomplete dependancy (source + min + CSS)
* Remove jQuery and jQuery-UI dependancy
* Few CSS ajustements
* Use tags complete list as RainTPL var (and display it as HTML)
* Remove "disable jQuery" feature
* Remove tag list web service
Diffstat (limited to 'tpl/changetag.html')
-rw-r--r-- | tpl/changetag.html | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/tpl/changetag.html b/tpl/changetag.html index fdfb0b37..13cc5cf1 100644 --- a/tpl/changetag.html +++ b/tpl/changetag.html | |||
@@ -1,27 +1,34 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html> | 2 | <html> |
3 | <head>{include="includes"} | 3 | <head>{include="includes"} |
4 | {if="empty($GLOBALS['disablejquery'])"}<script src="inc/jquery.min.js#"></script><script src="inc/jquery-ui.min.js#"></script>{/if} | 4 | <link type="text/css" rel="stylesheet" href="../inc/awesomplete.css" /> |
5 | <script src="inc/awesomplete.min.js#"></script> | ||
5 | </head> | 6 | </head> |
6 | <body onload="document.changetag.fromtag.focus();"> | 7 | <body onload="document.changetag.fromtag.focus();"> |
7 | <div id="pageheader"> | 8 | <div id="pageheader"> |
8 | {include="page.header"} | 9 | {include="page.header"} |
9 | <form method="POST" action="" name="changetag" id="changetag"> | 10 | <form method="POST" action="" name="changetag" id="changetag"> |
10 | <input type="hidden" name="token" value="{$token}"> | 11 | <input type="hidden" name="token" value="{$token}"> |
11 | Tag: <input type="text" name="fromtag" id="fromtag"> | 12 | <div> |
12 | <input type="text" name="totag" id="totag"> | 13 | <label for="fromtag">Tag:</label> |
13 | <input type="submit" name="renametag" value="Rename tag" class="bigbutton"> | 14 | </div> |
14 | or <input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();"><br>(Case sensitive)</form> | 15 | <div> |
16 | <input type="text" name="fromtag" id="fromtag" list="tagsList" autocomplete="off" class="awesomplete" data-minChars="1" /> | ||
17 | <datalist id="tagsList"> | ||
18 | {loop="$tags"}<option>{$key}</option>{/loop} | ||
19 | </datalist> | ||
20 | </div> | ||
21 | |||
22 | <div> | ||
23 | <input type="text" name="totag" id="totag"> | ||
24 | <input type="submit" name="renametag" value="Rename tag" class="bigbutton"> | ||
25 | or <input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();"> | ||
26 | </div> | ||
27 | </form> | ||
28 | <div class="clear white">(Case sensitive)</div> | ||
29 | </div> | ||
15 | <script>function confirmDeleteTag() { var agree=confirm("Are you sure you want to delete this tag from all links ?"); if (agree) return true ; else return false ; }</script> | 30 | <script>function confirmDeleteTag() { var agree=confirm("Are you sure you want to delete this tag from all links ?"); if (agree) return true ; else return false ; }</script> |
16 | </div> | 31 | </div> |
17 | {include="page.footer"} | 32 | {include="page.footer"} |
18 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} | ||
19 | <script> | ||
20 | $(document).ready(function() | ||
21 | { | ||
22 | $('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1}); | ||
23 | }); | ||
24 | </script> | ||
25 | {/if} | ||
26 | </body> | 33 | </body> |
27 | </html> | 34 | </html> |