aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes
diff options
context:
space:
mode:
Diffstat (limited to 'themes')
-rwxr-xr-xthemes/_global/js/autoCompleteTags.js14
-rwxr-xr-xthemes/baggy/edit-tags.twig4
2 files changed, 17 insertions, 1 deletions
diff --git a/themes/_global/js/autoCompleteTags.js b/themes/_global/js/autoCompleteTags.js
index 90bc982c..986e71d1 100755
--- a/themes/_global/js/autoCompleteTags.js
+++ b/themes/_global/js/autoCompleteTags.js
@@ -43,5 +43,19 @@ jQuery(function($) {
43 } 43 }
44 }); 44 });
45 45
46 $('.suggestedtag').click(function(){
47 var input = $("#value");
48 var value = input.val();
49 var tag = $(this).text();
50 var terms = value.split(','); // tags into the <input>
51 if (jQuery.inArray(tag, terms) == -1 ) { // if the tag hasn't already been added
52 value += tag + ",";
53 input.val(value);
54 }
55 input.focus();
56 input[0].selectionStart = input[0].selectionEnd = input.val().length;
57
58 });
59
46 60
47}); 61});
diff --git a/themes/baggy/edit-tags.twig b/themes/baggy/edit-tags.twig
index 15f15560..ae6684f2 100755
--- a/themes/baggy/edit-tags.twig
+++ b/themes/baggy/edit-tags.twig
@@ -16,7 +16,7 @@
16<div class="notags">{% trans "no tags" %}</div> 16<div class="notags">{% trans "no tags" %}</div>
17{% endif %} 17{% endif %}
18<ul> 18<ul>
19{% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %} 19{% for tag in tags %}<li><span class="alreadytagged">{{ tag.value }}</span> <a href="./?action=remove_tag&amp;tag_id={{ tag.id }}&amp;id={{ entry_id }}">✘</a></li>{% endfor %}
20</ul> 20</ul>
21<form method="post" action="./?action=add_tag"> 21<form method="post" action="./?action=add_tag">
22 <input type="hidden" name="entry_id" value="{{ entry_id }}" /> 22 <input type="hidden" name="entry_id" value="{{ entry_id }}" />
@@ -25,5 +25,7 @@
25 <p>{% trans "Start typing for auto complete." %}<br> 25 <p>{% trans "Start typing for auto complete." %}<br>
26 {% trans "You can enter multiple tags, separated by commas." %}</p> 26 {% trans "You can enter multiple tags, separated by commas." %}</p>
27</form> 27</form>
28All existing tags :
29<ul>{% for eachtag in alltags %}<li class="suggestedtag" style="display: inline-block; margin:10px;">{{ eachtag.value }}</li>{% endfor %}</ul>
28<a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> 30<a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a>
29{% endblock %} 31{% endblock %}