diff --git a/public/css/style.css b/public/css/style.css index c9bab93..a28fceb 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,179 +1,183 @@ -body { - background-image: url('../images/bg.png'); - background-repeat: repeat; - background-position: top left; - background-attachment: scroll; - padding: 50px; - font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; -} - -code { - background-color: rgba(0, 0, 0, 0.08); - border-radius: 3px; - display: inline-block; - font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace; - font-size: 0.875em; - font-weight: bold; - padding: 1px 6px; - vertical-align: baseline; -} - -.bookmark { - white-space: nowrap; - text-overflow: ellipsis; - -o-text-overflow: ellipsis; - overflow: hidden; - color: #212121; - border: 1px solid transparent; -} - -.bookmarkTitle { - color: #333; - font-size: 16px; - line-height: 24px; - display: -webkit-box; - text-overflow: ellipsis; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; -} - -.bookmarkNormalHover { - white-space: nowrap; - text-overflow: ellipsis; - -o-text-overflow: ellipsis; - overflow: hidden; - color: #212121; - background: #F5F5F5; - cursor: pointer; - border: 1px solid transparent; -} - -.bookmarkOperaterHover { - cursor: pointer; -} - -.tags { - cursor: default; -} - -.bookmarkEditHover { - white-space: nowrap; - text-overflow: ellipsis; - -o-text-overflow: ellipsis; - overflow: hidden; - color: #212121; - cursor: default; - border: 1px dashed #3388FF; -} - -.bookmarkInfo { - cursor: url('../images/detail.ico'), auto; -} - -.img-fixed-size { - width: 16px; - height: 16px; -} - -td { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; -} - -table { - table-layout: fixed; -} - -.wrap { - white-space: nowrap; - text-overflow: ellipsis; - -o-text-overflow: ellipsis; - overflow: hidden; -} - -.js-navigate-bookmark a { - color: #212121; -} - -.ui.menu .selected.item { - background: rgba(1, 1, 1, 0.05); -} - -img.operator { - width: 16px; - height: 16px -} - -.js-bookmark-info .content img { - max-width: 100%; - max-height: 100%; - padding-right: 20px; -} - -.hot-image { - max-width: 100%; - max-height: 160px; - min-height: 160px; - background-color: yellow; - overflow: hidden; -} - -.sourceName { - display: inline-block; - position: relative; - top: 4px; - max-width: 55px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - font-size: 12px; - color: #333; -} - -.favCount { - position: relative; - top: 1px; - font-size: 12px; - color: #BFC0C6; -} - -.urlSpan { - word-wrap: break-word; - word-break: break-all; - cursor: default; -} - -.ui.sortable.table thead th.forbid_sorted:hover { - cursor: default; - background: #F9FAFB -} - -.ui.selection.list .list>.item, .ui.selection.list>.item { - border-radius: 0; -} - -.js-p-info p { - margin-bottom: 5px; - font-size: 16px; -} - -.note-content { - font: 15px "Lucida Grande", Helvetica, Arial, sans-serif; - white-space: pre-wrap; - white-space: -moz-pre-wrap; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - word-wrap: break-word; -} - -.fontgreen { - color: RGB(33, 186, 69); -} - -.fontred { - color: #F00; -} +body { + background-image: url('../images/bg.png'); + background-repeat: repeat; + background-position: top left; + background-attachment: scroll; + padding: 50px; + font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; +} + +code { + background-color: rgba(0, 0, 0, 0.08); + border-radius: 3px; + display: inline-block; + font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace; + font-size: 0.875em; + font-weight: bold; + padding: 1px 6px; + vertical-align: baseline; +} + +.bookmark { + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; + color: #212121; + border: 1px solid transparent; +} + +.bookmarkTitle { + color: #333; + font-size: 16px; + line-height: 24px; + display: -webkit-box; + text-overflow: ellipsis; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.bookmarkNormalHover { + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; + color: #212121; + background: #F5F5F5; + cursor: pointer; + border: 1px solid transparent; +} + +.bookmarkOperaterHover { + cursor: pointer; +} + +.tags { + cursor: default; +} + +.bookmarkEditHover { + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; + color: #212121; + cursor: default; + border: 1px dashed #3388FF; +} + +.bookmarkInfo { + cursor: url('../images/detail.ico'), auto; +} + +.img-fixed-size { + width: 16px; + height: 16px; +} + +td { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +table { + table-layout: fixed; +} + +.wrap { + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; +} + +.js-navigate-bookmark a { + color: #212121; +} + +.ui.menu .selected.item { + background: rgba(1, 1, 1, 0.05); +} + +img.operator { + width: 16px; + height: 16px +} + +.js-bookmark-info .content img { + max-width: 100%; + max-height: 100%; + padding-right: 20px; +} + +.hot-image { + max-width: 100%; + max-height: 160px; + min-height: 160px; + background-color: yellow; + overflow: hidden; +} + +.sourceName { + display: inline-block; + position: relative; + top: 4px; + max-width: 55px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 12px; + color: #333; +} + +.favCount { + position: relative; + top: 1px; + font-size: 12px; + color: #BFC0C6; +} + +.urlSpan { + word-wrap: break-word; + word-break: break-all; + cursor: default; +} + +.ui.sortable.table thead th.forbid_sorted:hover { + cursor: default; + background: #F9FAFB +} + +.ui.selection.list .list>.item, .ui.selection.list>.item { + border-radius: 0; +} + +.js-p-info p { + margin-bottom: 5px; + font-size: 16px; +} + +.note-content { + font: 15px "Lucida Grande", Helvetica, Arial, sans-serif; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} + +.fontgreen { + color: RGB(33, 186, 69); +} + +.fontred { + color: #F00; +} + +.js-history-word:hover { + background: #f0f0f0; +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index db6b078..d8e82f5 100644 --- a/public/index.html +++ b/public/index.html @@ -1,103 +1,103 @@ - - - - - - - - - - 在线书签管理工具-我的书签 - - - - - - - - - - - - -
- - -
-
-
-
-
-
-
- 我爱佳佳与这个世界  |  Copyleft ©All Rights Reserved LCQ  |  移动设备访问  |  联系我(QQ:530485521)  |  网站源码  |  V1.5.0  |  加载失败,请按F5!(●'◡'●)
-
- -
- Copy -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + 在线书签管理工具-我的书签 + + + + + + + + + + + + +
+ + +
+
+
+
+
+
+
+ 我爱佳佳与这个世界  |  Copyleft ©All Rights Reserved LCQ  |  移动设备访问  |  联系我(QQ:530485521)  |  网站源码  |  V1.5.0  |  加载失败,请按F5!(●'◡'●)
+
+ +
+ Copy +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/scripts/controllers/menus-controller.js b/public/scripts/controllers/menus-controller.js index 39320f6..9c36c98 100644 --- a/public/scripts/controllers/menus-controller.js +++ b/public/scripts/controllers/menus-controller.js @@ -10,7 +10,6 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time $scope.quickUrl = {}; $scope.longPress = false; $scope.user = {}; - $scope.searching = true; // 防止在登陆的情况下,在浏览器里面直接输入url,这时候要更新菜单选项 pubSubService.subscribe('Common.menuActive', $scope, function (event, params) { @@ -32,19 +31,38 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time $scope.user = data; if(data.username === 'lcq') { $scope.loginMenus[dataService.LoginIndexHot].show = false; - console.info($scope.loginMenus) } }) .catch((err) => { }); - + + $scope.searchIcon = function(item) { + if(item.t === 0) { + item.icon = "book link icon"; + } else if(item.t === 1) { + item.icon = "google link icon"; + } else if(item.t === 2) { + item.icon = "github link icon"; + } else if(item.t === 3) { + item.icon = "stack overflow link icon"; + } else if(item.t === 4) { + item.icon = "bimobject link icon"; + } else if(item.t === 5) { + item.icon = "file alternate link icon"; + } + } + /** * @func * @desc 点击搜索按钮搜索书签 */ $scope.search = function (searchWord, searchOption) { console.log('search......', searchWord); + if (!searchWord) { + toastr.error('请输入搜索关键字', "错误"); + return; + } $scope.login = true; // var searchOption = $('.js-search-option').dropdown('get value') || 0; @@ -81,6 +99,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time t: searchOption, d: searchWord, } + $scope.searchIcon(newItem) var delIndex = -1; $scope.searchHistory.unshift(newItem); $scope.searchHistory.forEach((item, index) => { @@ -98,17 +117,9 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time } } - $scope.readySearch = function () { - $scope.searching = true; - } - - $scope.exitSearch = function () { - $scope.searching = false; - $scope.searchWord = ""; - $(".search-item").val(""); - } - - $scope.searchByHistory = function (type, data) { + $scope.searchByHistory = function (type, data, $event) { + console.log("searchByHistory", type, data); + $event && $event.stopPropagation(); $scope.searchWord = data; $('.search-item').val($scope.searchWord); @@ -119,10 +130,12 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time $('.js-search-option .menu .item').removeClass('active'); $('.js-search-option .menu .item:eq(' + type + ')').addClass('active'); $('.js-history-popup').removeClass('visible').addClass('hidden'); - $scope.search(data); + $scope.search(data, type); } - $scope.delHistory = function (type, data) { + $scope.delHistory = function (type, data, $event) { + console.log("delHistory", type, data); + $event && $event.stopPropagation(); var delIndex = -1; $scope.searchHistory.forEach((item, index) => { if (index >= 1 && item.t == type && item.d == data) { @@ -132,9 +145,13 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time if (delIndex >= 0) { $scope.searchHistory.splice(delIndex, 1); } + if(!type && !data) { + $scope.searchHistory = []; + } saveHistory(); + toastr.info("历史搜索已全部清空", "提示"); $timeout(function () { - $('.js-history-popup').removeClass('hidden').addClass('visible'); + type && data && $('.js-history-popup').removeClass('hidden').addClass('visible'); }, 500) } @@ -221,11 +238,15 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time }); } + + bookmarkService.userInfo({}) .then((user) => { $scope.searchHistory = JSON.parse(user.search_history || '[]'); $scope.quickUrl = JSON.parse(user.quick_url || '{}'); - + $scope.searchHistory.forEach((item, index) => { + $scope.searchIcon(item) + }) $timeout(function () { var showStyle = (user && user.show_style) || 'navigate'; if (showStyle) { @@ -275,7 +296,6 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time } if (key == 'S') { - $scope.searching = true; $(".search-item").focus(); var count = 1; var sId = setInterval(function() { diff --git a/public/views/menus.html b/public/views/menus.html index 411cb26..f0df5c3 100644 --- a/public/views/menus.html +++ b/public/views/menus.html @@ -1,6 +1,7 @@
- -