diff --git a/README.md b/README.md
index adc2b2f..26611ed 100644
--- a/README.md
+++ b/README.md
@@ -142,6 +142,7 @@ my-bookmark/
```
"body-parser": bodyParser用于解析客户端请求的body中的内容,内部使用JSON编码处理
"connect-mongo": 用于将session存入MongoDB
+"cheerio": 用于后端的jQuery
"cookie-parser": 处理每一个请求的cookie
"crypto": 加密模块,主要用来加密用户的密码
"debug": 这个好像没用到,看名字好像调试的。
diff --git a/package.json b/package.json
index 25a9a19..a580345 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
},
"dependencies": {
"body-parser": "~1.15.1",
+ "cheerio": "^1.0.0-rc.1",
"connect-mongo": "^1.3.2",
"cookie-parser": "~1.4.3",
"crypto": "0.0.3",
diff --git a/public/css/style.css b/public/css/style.css
index 01c7552..c9bab93 100644
--- a/public/css/style.css
+++ b/public/css/style.css
@@ -144,7 +144,7 @@ img.operator {
.urlSpan {
word-wrap: break-word;
word-break: break-all;
- cursor:default;
+ cursor: default;
}
.ui.sortable.table thead th.forbid_sorted:hover {
@@ -156,16 +156,24 @@ img.operator {
border-radius: 0;
}
-.js-p-info p{
- margin-bottom:5px;
+.js-p-info p {
+ margin-bottom: 5px;
font-size: 16px;
}
-.note-content{
+.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;
+ 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;
}
diff --git a/public/scripts/controllers/menus-controller.js b/public/scripts/controllers/menus-controller.js
index f6cc807..c364844 100644
--- a/public/scripts/controllers/menus-controller.js
+++ b/public/scripts/controllers/menus-controller.js
@@ -207,7 +207,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
title: '操作提示',
position: 'bottom center',
variation: "very wide",
- html: '特别提示:如果功能不正常,请先尝试清除浏览器缓存!点击查看更新日志!
1、在任意页面,按A键添加备忘录。
2、在热门收藏页面,按R键随机查看热门收藏。
3、在任意页面,按数字键切换菜单栏。
4、在书签页面鼠标放在书签上,按C复制书签链接
5、在书签页面鼠标放在书签上,按E编辑书签
6、在书签页面鼠标放在书签上,按D删除书签
7、在书签页面鼠标放在书签上,按I查看书签详情
8、在任意页面,按INSERT做添加书签
9、在任意页面,按ESC退出弹窗
'
+ html: "特别提示:对照更新日志,如果功能不正常,请先尝试清除浏览器缓存!
点击该按钮即可查看更新日志!
1、在任意页面,按A键添加备忘录。
2、在热门收藏页面,按R键随机查看热门收藏。
3、在任意页面,按数字键切换菜单栏。
4、在书签页面鼠标放在书签上,按C复制书签链接
5、在书签页面鼠标放在书签上,按E编辑书签
6、在书签页面鼠标放在书签上,按D删除书签
7、在书签页面鼠标放在书签上,按I查看书签详情
8、在任意页面,按INSERT做添加书签
9、在任意页面,按ESC退出弹窗
"
});
}, 1000)
diff --git a/public/scripts/controllers/settings-controller.js b/public/scripts/controllers/settings-controller.js
index 21ac041..8c9c6eb 100644
--- a/public/scripts/controllers/settings-controller.js
+++ b/public/scripts/controllers/settings-controller.js
@@ -14,11 +14,30 @@ app.controller('settingsCtr', ['$scope', '$stateParams', '$filter', '$state', '$
$scope.key = '';
$scope.url = '';
$scope.quickUrl = {};
+ $scope.updateLogs = [];
+ $scope.logsUrl = 'https://github.com/luchenqun/my-bookmark/commits/master';
+ $scope.getUpdateLog = function(url) {
+ console.log(url);
+ $scope.updateLogs = [];
+ bookmarkService.getUpdateLog({
+ url: url
+ })
+ .then((data) => {
+ $scope.updateLogs = data.updateLogs;
+ $scope.logsUrl = data.oldUrl;
+ console.log(data);
+ })
+ .catch((err) => {
+ toastr.error('获取更新日志失败。错误信息:' + JSON.stringify(err), "错误");
+ });
+ }
+
$scope.changeForm = function(index) {
console.log("changeForm = ", index);
$scope.form = $scope.form.map(() => false);
$scope.form[index] = true;
+ $scope.updateLogs = [];
if (index == 0 || index == 1 || index == 4) {
$scope.loadShowStyle = true;
@@ -53,6 +72,10 @@ app.controller('settingsCtr', ['$scope', '$stateParams', '$filter', '$state', '$
console.log('getTags err', err);
});
}
+
+ if (index == 5) {
+ $scope.getUpdateLog($scope.logsUrl);
+ }
}
$scope.changeForm($scope.form.indexOf(true)); // 马上调用一次
@@ -170,6 +193,10 @@ app.controller('settingsCtr', ['$scope', '$stateParams', '$filter', '$state', '$
saveQuickUrl();
}
+ $scope.jumpCommit = function(url) {
+ $window.open(url, '_blank');
+ }
+
function updateShowStyle(showStyle) {
setTimeout(function() {
if (showStyle) {
diff --git a/public/scripts/services/bookmark-service.js b/public/scripts/services/bookmark-service.js
index e3ffafe..a9776c1 100644
--- a/public/scripts/services/bookmark-service.js
+++ b/public/scripts/services/bookmark-service.js
@@ -14,6 +14,19 @@ app.factory('bookmarkService', ['$http', '$q', function($http, $q) {
});
return def.promise;
},
+ getUpdateLog: function(params) {
+ var def = $q.defer();
+ $http.post('/api/getUpdateLog/', {
+ params: params
+ })
+ .success(function(data) {
+ def.resolve(data);
+ })
+ .error(function(data) {
+ def.reject('getUpdateLog error');
+ });
+ return def.promise;
+ },
login: function(params) {
var def = $q.defer();
$http.post('/api/login/', {
diff --git a/public/views/settings.html b/public/views/settings.html
index e2ba54a..dff1494 100644
--- a/public/views/settings.html
+++ b/public/views/settings.html
@@ -165,6 +165,22 @@
{{key}}:{{value}}