diff --git a/ajax/getInfos.php b/ajax/getInfos.php new file mode 100644 index 00000000..e164401e --- /dev/null +++ b/ajax/getInfos.php @@ -0,0 +1,39 @@ +. +* +*/ + +// Check if we are a user +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); + +require_once(OC_App::getAppPath('bookmarks').'/bookmarksHelper.php'); + +$req_type=isset($_GET['type']) ? $_GET['type'] : ''; + +if($req_type == 'url_info' && $_GET['url']) { + $datas = getURLMetadata($_GET['url']); + $title = isset($datas['title']) ? $datas['title'] : ''; + OCP\JSON::success(array('title' => $title)); + exit(); +} + +OC_JSON::error(); +exit(); diff --git a/js/addBm.js b/js/addBm.js index 4a9c1cfe..bfab8117 100644 --- a/js/addBm.js +++ b/js/addBm.js @@ -28,6 +28,9 @@ }); return false; } + base.setTitle = function (str) { + base.$el.find('.title').val(str); + } base.init = function(){ base.options = $.extend({},$.bookmark_dialog.defaultOptions, options); @@ -45,8 +48,10 @@ base.$el.find('.url_input').val(record.url); base.$el.find('.desc').val(record.description); tagit_elem = base.$el.find('.tags'); - for(var i=0;i
- + +