对获取的书签标题进行处理
This commit is contained in:
parent
7f9c2749d4
commit
57e79531b8
|
|
@ -20,9 +20,13 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
|
||||||
bookmarkService.getArticle(params)
|
bookmarkService.getArticle(params)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
$scope.loadTitle = false;
|
$scope.loadTitle = false;
|
||||||
|
$scope.originTitle = data.title;
|
||||||
$scope.title = data.title;
|
$scope.title = data.title;
|
||||||
|
|
||||||
if (!$scope.title) {
|
if (!$scope.title) {
|
||||||
toastr.error('获取书签标题失败,请手动填入', "提示");
|
toastr.error('获取书签标题失败,请手动填入', "提示");
|
||||||
|
} else {
|
||||||
|
$scope.title = data.title.split('-')[0].trim();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -46,6 +50,10 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', '$document', 'ngDialo
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.restoreTitle = function() {
|
||||||
|
$scope.title = $scope.originTitle;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$('.ui.modal.js-add-bookmark').modal('hide');
|
$('.ui.modal.js-add-bookmark').modal('hide');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<input type="text" placeholder="输粘贴网页地址,如:http://mybookmark.cn/" ng-model="url">
|
<input type="text" placeholder="输粘贴网页地址,如:http://mybookmark.cn/" ng-model="url">
|
||||||
</div>
|
</div>
|
||||||
<div class="required eight wide field" ng-class="{error:titleError}">
|
<div class="required eight wide field" ng-class="{error:titleError}">
|
||||||
<label>书签标题</label>
|
<label ng-click="restoreTitle()">书签标题</label>
|
||||||
<div class="ui icon input" ng-class="{loading:loadTitle}">
|
<div class="ui icon input" ng-class="{loading:loadTitle}">
|
||||||
<input type="text" ng-attr-placeholder="{{loadTitle ? '正在获取书签标题。。。' : '在书签链接处粘贴正确的网站会自动获取'}}" ng-model="title">
|
<input type="text" ng-attr-placeholder="{{loadTitle ? '正在获取书签标题。。。' : '在书签链接处粘贴正确的网站会自动获取'}}" ng-model="title">
|
||||||
<i class="search icon" ng-show="loadTitle && title.length==0"></i>
|
<i class="search icon" ng-show="loadTitle && title.length==0"></i>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue