diff options
author | nodiscc <nodiscc@gmail.com> | 2015-03-15 14:21:59 +0100 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2015-03-15 14:21:59 +0100 |
commit | 9a631bab7fb7ca0c60c9fd1c688b3c58ecec40f8 (patch) | |
tree | a821338f733f60e13ad0319761dac74bf6f8be07 /tpl/editlink.html | |
parent | bc66d513a9aa6da9361dbfc2f0b4bf384e9597a6 (diff) | |
parent | bdd1715b249561ed919e4f03a06aec1f4c327335 (diff) | |
download | Shaarli-9a631bab7fb7ca0c60c9fd1c688b3c58ecec40f8.tar.gz Shaarli-9a631bab7fb7ca0c60c9fd1c688b3c58ecec40f8.tar.zst Shaarli-9a631bab7fb7ca0c60c9fd1c688b3c58ecec40f8.zip |
Merge remote-tracking branch 'ArthurHoaro/autocomplete' into next
Diffstat (limited to 'tpl/editlink.html')
-rw-r--r-- | tpl/editlink.html | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tpl/editlink.html b/tpl/editlink.html index ecab443d..b737b990 100644 --- a/tpl/editlink.html +++ b/tpl/editlink.html | |||
@@ -1,7 +1,8 @@ | |||
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-1.11.2.min.js#"></script><script src="inc/jquery-ui-1.11.2.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 | 7 | <body |
7 | {if="$link.title==''"}onload="document.linkform.lf_title.focus();" | 8 | {if="$link.title==''"}onload="document.linkform.lf_title.focus();" |
@@ -12,10 +13,12 @@ | |||
12 | <div id="editlinkform"> | 13 | <div id="editlinkform"> |
13 | <form method="post" name="linkform"> | 14 | <form method="post" name="linkform"> |
14 | <input type="hidden" name="lf_linkdate" value="{$link.linkdate}"> | 15 | <input type="hidden" name="lf_linkdate" value="{$link.linkdate}"> |
15 | <i>URL</i><br><input type="text" name="lf_url" value="{$link.url|htmlspecialchars}" class="lf_input"><br> | 16 | <label for="lf_url"><i>URL</i></label><br><input type="text" name="lf_url" id="lf_url" value="{$link.url|htmlspecialchars}" class="lf_input"><br> |
16 | <i>Title</i><br><input type="text" name="lf_title" value="{$link.title|htmlspecialchars}" class="lf_input"><br> | 17 | <label for="lf_title"><i>Title</i></label><br><input type="text" name="lf_title" id="lf_title" value="{$link.title|htmlspecialchars}" class="lf_input"><br> |
17 | <i>Description</i><br><textarea name="lf_description" rows="4" cols="25">{$link.description|htmlspecialchars}</textarea><br> | 18 | <label for="lf_description"><i>Description</i></label><br><textarea name="lf_description" id="lf_description" rows="4" cols="25">{$link.description|htmlspecialchars}</textarea><br> |
18 | <i>Tags</i><br><input type="text" id="lf_tags" name="lf_tags" value="{$link.tags|htmlspecialchars}" class="lf_input"><br> | 19 | <label for="lf_tags"><i>Tags</i></label><br> |
20 | <input type="text" id="lf_tags" name="lf_tags" id="lf_tags" value="{$link.tags|htmlspecialchars}" class="lf_input" | ||
21 | data-list="{loop="$tags"}{$key}, {/loop}" data-multiple autocomplete="off" ><br> | ||
19 | {if="($link_is_new && $GLOBALS['privateLinkByDefault']==true) || $link.private == true"} | 22 | {if="($link_is_new && $GLOBALS['privateLinkByDefault']==true) || $link.private == true"} |
20 | <input type="checkbox" checked="checked" name="lf_private" id="lf_private"> | 23 | <input type="checkbox" checked="checked" name="lf_private" id="lf_private"> |
21 | <label for="lf_private"><i>Private</i></label><br> | 24 | <label for="lf_private"><i>Private</i></label><br> |
@@ -32,12 +35,19 @@ | |||
32 | </div> | 35 | </div> |
33 | </div> | 36 | </div> |
34 | {include="page.footer"} | 37 | {include="page.footer"} |
35 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} | 38 | {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn())"} |
36 | <script> | 39 | <script> |
37 | $(document).ready(function() | 40 | $ = Awesomplete.$; |
38 | { | 41 | new Awesomplete($('input[data-multiple]'), { |
39 | $('#lf_tags').autocomplete({source:'{$source}?ws=tags',minLength:1}); | 42 | filter: function(text, input) { |
40 | }); | 43 | return Awesomplete.FILTER_CONTAINS(text, input.match(/[^ ]*$/)[0]); |
44 | }, | ||
45 | replace: function(text) { | ||
46 | var before = this.input.value.match(/^.+ \s*|/)[0]; | ||
47 | this.input.value = before + text + " "; | ||
48 | }, | ||
49 | minChars: 1 | ||
50 | }); | ||
41 | </script> | 51 | </script> |
42 | {/if} | 52 | {/if} |
43 | </body> | 53 | </body> |