mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-11-29 04:24:11 +01:00
autoretrieve title and description after entering new url
This commit is contained in:
parent
001533bf81
commit
6d7dd830e9
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user