diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2011-08-23 16:30:29 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2011-08-23 16:30:29 +0200 |
commit | 847347b58a29d48340d40da5ca4f51caf802ccf9 (patch) | |
tree | 1e8c71265ac5da45789b4727904b5d7db602b069 /apps/bookmarks | |
parent | 672515c23fb7a585cd8ddf31656b1a6ed912833a (diff) | |
download | nextcloud-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.js | 14 |
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()) |