1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-22 18:52:10 +01:00

Adding tags in bookmarklet, fix #127

This commit is contained in:
Shikiryu 2015-03-08 00:53:42 +01:00 committed by Arthur Schiwon
parent e5acadc10e
commit 52ec490ad4
2 changed files with 16 additions and 5 deletions

View File

@ -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() {

View File

@ -35,9 +35,9 @@ $bookmarkExists = $_['bookmarkExists'];
<li>
<ul class="tags" >
<?php foreach ($_['bookmark']['tags'] as $tag): ?>
<li><?php p($tag); ?></li>
<?php endforeach; ?>
<ul class="tags" >
<li></li>
</ul>
</ul>
</li>