diff options
author | Golnaz Nilieh <g382nilieh@gmail.com> | 2011-09-13 16:10:52 +0430 |
---|---|---|
committer | Golnaz Nilieh <g382nilieh@gmail.com> | 2011-09-13 16:10:52 +0430 |
commit | 0ff9bc4806bc9296046057b2eadbf29738346b05 (patch) | |
tree | 90e9e119a52d0b0d8cb7ae899c3ae93d9dabb406 /apps/bookmarks/js | |
parent | 67addb488244621e3d118f2ee1d0165ba95b95ba (diff) | |
download | nextcloud-server-0ff9bc4806bc9296046057b2eadbf29738346b05.tar.gz nextcloud-server-0ff9bc4806bc9296046057b2eadbf29738346b05.zip |
Add link and other edit information to newly added bookmarks.
Diffstat (limited to 'apps/bookmarks/js')
-rw-r--r-- | apps/bookmarks/js/bookmarks.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js index e26a9a80fb1..8c0b74b6c67 100644 --- a/apps/bookmarks/js/bookmarks.js +++ b/apps/bookmarks/js/bookmarks.js @@ -96,16 +96,17 @@ function addOrEditBookmark(event) { $.ajax({ url: 'ajax/addBookmark.php', data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags), - success: function(data){ + success: function(response){ + var bookmark_id = response.data; $('.bookmarks_add').slideToggle(); $('.bookmarks_add').children('p').children('.bookmarks_input').val(''); $('.bookmarks_list').prepend( - '<div class="bookmark_single">' + + '<div class="bookmark_single" data-id="' + bookmark_id + '" >' + '<p class="bookmark_title"><a href="' + url + '" target="_new" class="bookmark_link">' + title + '</a></p>' + '<p class="bookmark_url">' + url + '</p>' + '<p class="bookmark_description">' + description + '</p>' + '<p class="bookmark_tags">' + tagshtml + '</p>' + - '<p class="bookmark_actions"><span class="bookmark_delete">Delete</span></p>' + + '<p class="bookmark_actions"><span class="bookmark_delete">Delete</span> <span class="bookmark_edit">Edit</span></p>' + '</div>' ); } @@ -119,6 +120,8 @@ function addOrEditBookmark(event) { success: function(){ $('.bookmarks_add').slideToggle(); $('.bookmarks_add').children('p').children('.bookmarks_input').val(''); + $('#bookmark_add_id').val('0'); + var record = $('.bookmark_single[data-id = "' + id + '"]'); record.children('.bookmark_url:first').text(url); record.children('.bookmark_description:first').text(description); |