增加快捷键

This commit is contained in:
luchenqun 2017-05-08 22:11:59 +08:00
parent 5178bb28a1
commit 453d4dad22
8 changed files with 65 additions and 14 deletions

View File

@ -1,4 +1,4 @@
app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$window', '$timeout', 'ngDialog', 'bookmarkService', 'pubSubService', 'dataService', function($scope, $state, $stateParams, $filter, $window, $timeout, ngDialog, bookmarkService, pubSubService, dataService) {
app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$window', '$timeout', '$document', 'ngDialog', 'bookmarkService', 'pubSubService', 'dataService', function($scope, $state, $stateParams, $filter, $window, $timeout, $document, ngDialog, bookmarkService, pubSubService, dataService) {
console.log("Hello hotCtr...");
$scope.bookmarks = []; // 书签数据
$scope.bookmarkNormalHover = false;
@ -117,6 +117,20 @@ app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$windo
}
}
// 快捷键r随机推荐
$document.bind("keydown", function(event) {
$scope.$apply(function() {
// console.log(event.keyCode);
var menusScope = $('div[ng-controller="menuCtr"]').scope();
var login = (menusScope && menusScope.login) || false;
var blur = (menusScope && menusScope.blur) || false;
// r按键显示
if (event.keyCode == 82 && login && (!blur)) {
$scope.randomHotBookmarks();
}
})
});
$scope.randomHotBookmarks = function() {
var menusScope = $('div[ng-controller="menuCtr"]').scope();
var login = (menusScope && menusScope.login) || false;

View File

@ -7,6 +7,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
$scope.showStyle = null;
$scope.searchHistory = [];
$scope.historyTypes = dataService.historyTypes;
$scope.blur = false;
// 防止在登陆的情况下在浏览器里面直接输入url这时候要更新菜单选项
pubSubService.subscribe('Common.menuActive', $scope, function(event, params) {
@ -19,6 +20,10 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
$scope.loginMenus = dataService.loginMenus; // 登陆之后显示的菜单数据。uiSerf内部跳转链接。
$scope.notLoginMenus = dataService.notLoginMenus; // 未登陆显示的菜单数据
$scope.inputBlur = function(blur) {
$scope.blur = blur;
}
/**
* @func
* @desc 点击搜索按钮搜索书签

View File

@ -1,4 +1,4 @@
app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$window', '$timeout', 'ngDialog', 'bookmarkService', 'pubSubService', 'dataService', function($scope, $state, $stateParams, $filter, $window, $timeout, ngDialog, bookmarkService, pubSubService, dataService) {
app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$window', '$timeout', '$document', 'ngDialog', 'bookmarkService', 'pubSubService', 'dataService', function($scope, $state, $stateParams, $filter, $window, $timeout, $document, ngDialog, bookmarkService, pubSubService, dataService) {
console.log("Hello noteCtr...", $stateParams);
const perPageItems = 35;
@ -44,6 +44,24 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
}
}
// 快捷键a增加书签
$document.bind("keydown", function(event) {
$scope.$apply(function() {
var menusScope = $('div[ng-controller="menuCtr"]').scope();
var login = (menusScope && menusScope.login) || false;
var blur = (menusScope && menusScope.blur) || false;
// a按键显示
if (event.keyCode == 65 && login && (!blur) && (!$scope.add)) {
$scope.showAddNote();
}
// Esc按键退出
if (event.keyCode == 27 && login && (!blur) && ($scope.add)) {
$scope.showAddNote();
}
})
});
$scope.showAddNote = function() {
$scope.add = (!$scope.add);
$scope.edit = false;

View File

@ -20,8 +20,8 @@
<p>7、书签可以作为公有或者私有公有可供所有人搜索。(完成)</p>
<p>8、可以将搜索到其他用户的书签转存为自己的书签。(已完成)</p>
<p>9、可以将书签导出来然后导入到浏览器。(未完成)</p>
<p>10、在热门标签里面有在网上找的热门书签。可以转存收藏到自己书签里面。(完成)</p>
<p>11、新增备忘录功能有时候随手要做点纪录就方便了。双击备忘录可查看详情(完成)</p>
<p>10、在热门标签里面有在网上找的热门书签。可以转存收藏到自己书签里面。快捷键R随机查看热门书签。(完成)</p>
<p>11、新增备忘录功能有时候随手要做点纪录就方便了。快捷键A增加备忘录。双击备忘录可查看详情!(完成)</p>
<h3 class="ui dividing header">联系方式</h3>
<p>微信跟QQ530485521记得备注加书签。</p>
<h3 class="ui dividing header">开发备忘(非开发人员请无视)</h3>

View File

@ -24,7 +24,7 @@
</div>
</div>
</div>
<div style="width:22px;height:22px;" class="js-hot-random" ng-click="randomHotBookmarks()" data-tooltip="随机查看热门收藏,如需回到最新热门收藏,请点击菜单栏热门收藏" ng-show="!loadBusy">
<div style="width:22px;height:22px;" class="js-hot-random" ng-click="randomHotBookmarks()" data-tooltip="随机查看热门收藏,如需回到最新热门收藏,请点击菜单栏热门收藏" ng-show="!loadBusy && false">
<img class="ui ui middle aligned tiny image" ng-src="./images/random.png">
</div>
</div>

View File

@ -46,7 +46,17 @@
</div>
</div>
</label>
<input class="prompt search-item" type="text" ng-model="searchWord" placeholder="" ng-keypress="($event.which === 13)?search(searchWord):0" data-position="bottom left" data-variation="large" id="lcq">
<input
class="prompt search-item"
type="text"
ng-model="searchWord"
placeholder=""
ng-keypress="($event.which === 13)?search(searchWord):0"
data-position="bottom left"
data-variation="large"
id="lcq"
ng-focus="inputBlur(true)"
ng-blur="inputBlur(false)">
<div class="ui fluid popup top left transition hidden" style="padding-left: 0px; padding-right: 0px;">
<div class="ui selection list">
<div class="item" ng-repeat="item in searchHistory" ng-click="searchByHistory(item.t, item.d)" style="height:30px;">
@ -63,7 +73,7 @@
</div>
</div>
<div class="item" title="添加书签" ng-click="showAddBookmarkMoadl()">
<span data-tooltip="添加书签">
<span data-tooltip="添加书签可用Insert快捷键">
<i class="add square icon"></i>
</span>
</div>

View File

@ -40,7 +40,7 @@
</div>
</div>
<div style="width:22px;height:22px;" class="js-note-add" ng-click="showAddNote()" data-tooltip="添加备忘" ng-show="!add">
<img class="ui ui middle aligned tiny image" src="./images/add-note.png" ng-show="!loadBusy">
<img class="ui ui middle aligned tiny image" src="./images/add-note.png" ng-show="!loadBusy && false">
</div>
<div class="ui divider"></div>
<div class="ui grid">

View File

@ -62,26 +62,30 @@
</form>
<div class="ui four statistics" style="margin-top:30px;" ng-show="form[1]">
<div class="statistic">
<div class="text value">{{user.created_at.substring(0, 4)}}<br> {{user.created_at.substring(5, 10)}}
<div class="text value">{{user.created_at.substring(0, 4)}}<br>
{{user.created_at.substring(5, 10)}}
</div>
<div class="label">注册时间
</div>
</div>
<div class="statistic">
<div class="text value">{{user.last_login.substring(0, 4)}}<br> {{user.last_login.substring(5, 10)}}
<div class="text value">{{user.last_login.substring(0, 4)}}<br>
{{user.last_login.substring(5, 10)}}
</div>
<div class="label">最近登陆
</div>
</div>
<div class="statistic">
<div class="value">
<i class="tags icon"></i> {{ tagCnt }}
<i class="tags icon"></i>
{{ tagCnt }}
</div>
<div class="label">分类数目</div>
</div>
<div class="statistic">
<div class="value">
<i class="bookmark icon"></i> {{ bookmarkCnt }}
<i class="bookmark icon"></i>
{{ bookmarkCnt }}
</div>
<div class="label">书签数目</div>
</div>
@ -143,8 +147,8 @@
<p>7、书签可以作为公有或者私有公有可供所有人搜索。(完成)</p>
<p>8、可以将搜索到其他用户的书签转存为自己的书签。(已完成)</p>
<p>9、可以将书签导出来然后导入到浏览器。(未完成)</p>
<p>10、在热门标签里面有在网上找的热门书签。可以转存收藏到自己书签里面。(完成)</p>
<p>11、新增备忘录功能有时候随手要做点纪录就方便了。双击备忘录可查看详情(完成)</p>
<p>10、在热门标签里面有在网上找的热门书签。可以转存收藏到自己书签里面。快捷键R随机查看热门书签。(完成)</p>
<p>11、新增备忘录功能有时候随手要做点纪录就方便了。快捷键A增加备忘录。双击备忘录可查看详情!(完成)</p>
<h3 class="ui dividing header">联系方式</h3>
<p>微信跟QQ530485521记得备注加书签。</p>
<h3 class="ui dividing header">开发备忘(非开发人员请无视)</h3>