aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-06-23 09:25:01 +0200
committerGitHub <noreply@github.com>2016-06-23 09:25:01 +0200
commit49e2854d5c15bbce3f24f91da34450e8f209295b (patch)
treef5aa95445549cc151e86f144b40464eecee28cf7 /src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js
parent4eaaa27bb5b9a5725b26471a39548d764fc9cd0a (diff)
parent496cfdc0172fd55cb555f74b64704c8f50c71b77 (diff)
downloadwallabag-49e2854d5c15bbce3f24f91da34450e8f209295b.tar.gz
wallabag-49e2854d5c15bbce3f24f91da34450e8f209295b.tar.zst
wallabag-49e2854d5c15bbce3f24f91da34450e8f209295b.zip
Merge pull request #2142 from wallabag/v2-use-npm
Manage assets through npm
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js')
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js
deleted file mode 100755
index 90bc982c..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js
+++ /dev/null
@@ -1,47 +0,0 @@
1jQuery(function($) {
2
3 function split( val ) {
4 return val.split( /,\s*/ );
5 }
6 function extractLast( term ) {
7 return split( term ).pop();
8 }
9
10
11 $("#value").bind("keydown", function(event) {
12 if (event.keyCode === $.ui.keyCode.TAB && $(this).data("ui-autocomplete").menu.active) {
13 event.preventDefault();
14 }
15 }).autocomplete({
16 source : function(request, response) {
17 $.getJSON("./?view=tags", {
18 term : extractLast(request.term),
19 //id: $(':hidden#entry_id').val()
20 }, response);
21 },
22 search : function() {
23 // custom minLength
24 var term = extractLast(this.value);
25 if (term.length < 1) {
26 return false;
27 }
28 },
29 focus : function() {
30 // prevent value inserted on focus
31 return false;
32 },
33 select : function(event, ui) {
34 var terms = split(this.value);
35 // remove the current input
36 terms.pop();
37 // add the selected item
38 terms.push(ui.item.value);
39 // add placeholder to get the comma-and-space at the end
40 terms.push("");
41 this.value = terms.join(", ");
42 return false;
43 }
44 });
45
46
47});