增加链接输入提示

This commit is contained in:
luchenqun 2017-02-08 17:25:04 +08:00
parent b62bfa0844
commit 266b25a2ea
2 changed files with 6 additions and 1 deletions

View File

@ -87,6 +87,11 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p
tags: selectedTags,
description: $scope.description
}
if (!/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test($scope.url)) {
toastr.error('检撤到您的书签链接非法是否忘记加http或者https了建议直接从打开浏览器地址栏复制出来直接粘贴到输入框。', "错误");
return;
}
if ($scope.add) {
bookmarkService.addBookmark(params)
.then((data) => {

View File

@ -7,7 +7,7 @@
<div class="ui form">
<div class="required field" ng-class="{error:urlError}">
<label>书签链接</label>
<input type="text" placeholder="" ng-model="url">
<input type="text" placeholder="输入网址http://mybookmark.cn/" ng-model="url">
</div>
<div class="required field" ng-class="{error:titleError}">
<label>书签标题</label>