autoretrieve title and description after entering new url
This commit is contained in:
parent
672515c23f
commit
847347b58a
|
@ -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