diff --git a/js/bookmarklet.js b/js/bookmarklet.js index 39adbc20..3b19fa9e 100644 --- a/js/bookmarklet.js +++ b/js/bookmarklet.js @@ -25,8 +25,12 @@ function updateLoadingAnimation() { $(function () { $(".submit").click(function () { increaseAjaxCallCount(); - var dataString = 'url=' + $("input#url").val() + '&description=' + - $("textarea#description").val() + '&title=' + $("input#title").val(); + var tags = ''; + $('.tagit-choice .tagit-label').each(function() { + tags += '&item[tags][]='+$(this).text(); + }); + var dataString = 'url=' + $("input#url").val() + '&description=' + + $("textarea#description").val() + '&title=' + $("input#title").val() + tags; $.ajax({ type: "POST", url: "bookmark", @@ -48,6 +52,13 @@ $(function () { }); return false; }); + $.get('tag', function(data) { + $('.tags').tagit({ + allowSpaces: true, + availableTags : data, + placeholderText: t('bookmark', 'Tags') + }); + }); }); function closeWindow() { diff --git a/templates/addBookmarklet.php b/templates/addBookmarklet.php index ce7c8992..0de385f1 100644 --- a/templates/addBookmarklet.php +++ b/templates/addBookmarklet.php @@ -35,9 +35,9 @@ $bookmarkExists = $_['bookmarkExists'];