aboutsummaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2011-08-23 16:30:29 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2011-08-23 16:30:29 +0200
commit847347b58a29d48340d40da5ca4f51caf802ccf9 (patch)
tree1e8c71265ac5da45789b4727904b5d7db602b069 /apps/bookmarks
parent672515c23fb7a585cd8ddf31656b1a6ed912833a (diff)
downloadnextcloud-server-847347b58a29d48340d40da5ca4f51caf802ccf9.tar.gz
nextcloud-server-847347b58a29d48340d40da5ca4f51caf802ccf9.zip
autoretrieve title and description after entering new url
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/js/bookmarks.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js
index 04db8b42a79..ad3aefde204 100644
--- a/apps/bookmarks/js/bookmarks.js
+++ b/apps/bookmarks/js/bookmarks.js
@@ -9,6 +9,8 @@ $(document).ready(function() {
$('#bookmark_add_submit').click(addBookmark);
$(window).scroll(updateOnBottom);
+ $('#bookmark_add_url').focusout(getMetadata);
+
$('.bookmarks_list').empty();
getBookmarks();
});
@@ -36,6 +38,18 @@ function getBookmarks() {
});
}
+function getMetadata() {
+ var url = encodeEntities($('#bookmark_add_url').val())
+ $.ajax({
+ url: 'ajax/getMeta.php',
+ data: 'url=' + encodeURI(url),
+ success: function(pageinfo){
+ $('#bookmark_add_description').val(pageinfo.data.description);
+ $('#bookmark_add_title').val(pageinfo.data.title);
+ }
+ });
+}
+
function addBookmark(event) {
var url = encodeEntities($('#bookmark_add_url').val())
var title = encodeEntities($('#bookmark_add_title').val())