diff --git a/config/env/torrents.js b/config/env/torrents.js
index 227bce13..e3a64b6d 100644
--- a/config/env/torrents.js
+++ b/config/env/torrents.js
@@ -124,6 +124,8 @@ module.exports = {
* @debugAnnounceUser: setting of debug announce user, NOTE: enable this need @app.writeServerDebugLog must be true too
* @debugAll: if true, debug all announce user, else debug user in ids list below
* @ids: debug announce user id list
+ * @debugClientSideUser: setting of debug client side user
+ * @ids: debug user id list
*/
announce: {
url: 'http://localhost:3000/announce',
@@ -162,6 +164,11 @@ module.exports = {
'59227f9095602327ea1d96ba',
'592280c464be9e281a1ec56e'
]
+ },
+ debugClientSideUser: {
+ ids: [
+ '59227f9095602327ea1d96ba'
+ ]
}
},
diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js
index 92f3cfe1..a3891b06 100644
--- a/modules/core/client/app/trans-string-en.js
+++ b/modules/core/client/app/trans-string-en.js
@@ -1124,6 +1124,7 @@
MESSAGES_IS_LOADING: 'Loading messages, please wait ...',
MESSAGES_IS_EMPTY: 'Messages Box is empty!',
OFFICIAL_MESSAGES_TOOLTIP: '
Tip:
In order to maintain a clean list of official messages, please delete messages that have expired over time as they cannot be unilaterally cleared in the users message center.',
+ MARK_AS_ALREADY_READ: 'Mark as already read, do not show next time.',
MESSAGES_FIELD: {
TO: 'Send to:',
TYPE: 'Message type:',
@@ -1143,7 +1144,9 @@
INFO_SEND_AT: 'at',
LAST_REPLY_AT: 'Latest reply at',
NEW_MSG: 'New messages',
- SERVER_SEND: 'Server send'
+ SERVER_SEND: 'Server send',
+ MUST_READ: 'Must read message',
+ MUST_READ_KEY: 'MustRead'
},
BUTTON_MESSAGE_DELETE: 'Delete',
BUTTON_MESSAGE_CLOSE: 'Close(esc)',
diff --git a/modules/core/client/app/trans-string-zh-tw.js b/modules/core/client/app/trans-string-zh-tw.js
index 5cfd6a39..f3847857 100644
--- a/modules/core/client/app/trans-string-zh-tw.js
+++ b/modules/core/client/app/trans-string-zh-tw.js
@@ -1124,6 +1124,7 @@
MESSAGES_IS_LOADING: '正在讀取, 請稍候 ...',
MESSAGES_IS_EMPTY: '訊息列表為空!',
OFFICIAL_MESSAGES_TOOLTIP: '提示:
為了維護一個乾淨的官方訊息列表,請及時將長時間過期的訊息刪除,因為這些訊息在用戶的訊息中心裡不能被單方面清理。',
+ MARK_AS_ALREADY_READ: '標記為已讀,下次不再提示。',
MESSAGES_FIELD: {
TO: '傳送至:',
TYPE: '訊息類別:',
@@ -1143,7 +1144,9 @@
INFO_SEND_AT: '於',
LAST_REPLY_AT: '最新回覆於',
NEW_MSG: '條未讀訊息',
- SERVER_SEND: '伺服器傳送'
+ SERVER_SEND: '伺服器傳送',
+ MUST_READ: '必讀消息',
+ MUST_READ_KEY: '必讀'
},
BUTTON_MESSAGE_DELETE: '刪除',
BUTTON_MESSAGE_CLOSE: '關閉(esc)',
diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js
index 086a1fee..817f9fb3 100644
--- a/modules/core/client/app/trans-string-zh.js
+++ b/modules/core/client/app/trans-string-zh.js
@@ -1124,6 +1124,7 @@
MESSAGES_IS_LOADING: '正在装载, 请稍候 ...',
MESSAGES_IS_EMPTY: '消息列表为空!',
OFFICIAL_MESSAGES_TOOLTIP: '提示:
为了维护一个干净的官方消息列表,请及时将长时间过期的消息删除,因为这些消息在用户的消息中心里不能被单方面清理。',
+ MARK_AS_ALREADY_READ: '标记为已读,下次不再提示。',
MESSAGES_FIELD: {
TO: '发送至:',
TYPE: '消息类型:',
@@ -1143,7 +1144,9 @@
INFO_SEND_AT: '于',
LAST_REPLY_AT: '最新回复于',
NEW_MSG: '条未读消息',
- SERVER_SEND: '服务器发送'
+ SERVER_SEND: '服务器发送',
+ MUST_READ: '必读消息',
+ MUST_READ_KEY: '必读'
},
BUTTON_MESSAGE_DELETE: '删除',
BUTTON_MESSAGE_CLOSE: '关闭(esc)',
diff --git a/modules/core/client/config/core.client.route-filter.js b/modules/core/client/config/core.client.route-filter.js
index a3cc0cf1..1f264bbf 100644
--- a/modules/core/client/config/core.client.route-filter.js
+++ b/modules/core/client/config/core.client.route-filter.js
@@ -14,7 +14,6 @@
function stateChangeStart(event, toState, toParams, fromState, fromParams) {
$('.side-background').remove();
$('.textcomplete-dropdown').remove();
- $('.popup_wrapper').remove();
// Check authentication before changing state
if (toState.data && toState.data.roles && toState.data.roles.length > 0) {
var allowed = false;
diff --git a/modules/core/client/controllers/footer.client.controller.js b/modules/core/client/controllers/footer.client.controller.js
new file mode 100644
index 00000000..39b2835b
--- /dev/null
+++ b/modules/core/client/controllers/footer.client.controller.js
@@ -0,0 +1,78 @@
+(function () {
+ 'use strict';
+
+ angular
+ .module('core')
+ .controller('FooterController', FooterController);
+
+ FooterController.$inject = ['$scope', '$state', '$timeout', '$translate', 'Authentication', 'MeanTorrentConfig', 'localStorageService',
+ 'getStorageLangService', 'TorrentsService'];
+
+ function FooterController($scope, $state, $timeout, $translate, Authentication, MeanTorrentConfig, localStorageService,
+ getStorageLangService, TorrentsService) {
+ var vm = this;
+ vm.user = Authentication.user;
+ vm.langService = getStorageLangService;
+ vm.language = MeanTorrentConfig.meanTorrentConfig.language;
+ vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
+ vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign;
+
+ /**
+ * document.ready()
+ */
+ $(document).ready(function () {
+ $('#warning_popup').popup({
+ outline: false,
+ focusdelay: 400,
+ vertical: 'top',
+ autoopen: false,
+ opacity: 0.6,
+ closetransitionend: function () {
+ $('#warning_popup_wrapper').remove();
+ $('#warning_popup_background').remove();
+ }
+ });
+ });
+
+ /**
+ * getWarningInfo
+ */
+ vm.getWarningInfo = function () {
+ var sw = localStorageService.get('showed_warning');
+ if (!vm.user && vm.appConfig.showDemoWarningPopup && !sw) {
+ $timeout(function () {
+ $('#warning_popup').popup('show');
+ }, 10);
+
+ localStorageService.set('showed_warning', true);
+ }
+ if (sw) {
+ $('#warning_popup_wrapper').remove();
+ $('#warning_popup_background').remove();
+ }
+ };
+
+ /**
+ * changeLanguage
+ * @param langKey
+ */
+ vm.changeLanguage = function (langKey) {
+ var lang = localStorageService.get('storage_user_lang');
+ if (lang !== langKey) {
+ localStorageService.set('storage_user_lang', langKey);
+ $translate.use(langKey);
+
+ $state.reload();
+ }
+ };
+
+ /**
+ * getSiteInfo
+ */
+ vm.getSiteInfo = function () {
+ TorrentsService.siteInfo(function (data) {
+ vm.siteInfo = data;
+ });
+ };
+ }
+}());
diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js
index f41ce0b9..485422fe 100644
--- a/modules/core/client/controllers/header.client.controller.js
+++ b/modules/core/client/controllers/header.client.controller.js
@@ -5,11 +5,13 @@
.module('core')
.controller('HeaderController', HeaderController);
- HeaderController.$inject = ['$scope', '$state', '$timeout', '$translate', 'Authentication', 'menuService', 'MeanTorrentConfig', 'localStorageService',
- 'ScoreLevelService', 'InvitationsService', '$interval', 'MessagesService', 'TorrentsService', 'UsersService', 'DebugConsoleService', 'getStorageLangService'];
+ HeaderController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'menuService', 'MeanTorrentConfig', 'localStorageService',
+ 'ScoreLevelService', 'InvitationsService', '$interval', 'MessagesService', 'marked', 'UsersService', 'DebugConsoleService', 'getStorageLangService',
+ 'AdminMessagesService'];
- function HeaderController($scope, $state, $timeout, $translate, Authentication, menuService, MeanTorrentConfig, localStorageService, ScoreLevelService,
- InvitationsService, $interval, MessagesService, TorrentsService, UsersService, mtDebug, getStorageLangService) {
+ function HeaderController($scope, $rootScope, $state, $timeout, $translate, Authentication, menuService, MeanTorrentConfig, localStorageService, ScoreLevelService,
+ InvitationsService, $interval, MessagesService, marked, UsersService, mtDebug, getStorageLangService,
+ AdminMessagesService) {
$scope.$state = $state;
var vm = this;
vm.user = Authentication.user;
@@ -37,15 +39,26 @@
/**
* document.ready()
*/
- $(document).ready(function () {
- $('#warning_popup').popup({
+ angular.element(document).ready(function () {
+ $('#must_read_popup').popup({
outline: false,
focusdelay: 400,
vertical: 'top',
autoopen: false,
opacity: 0.6,
+ blur: false,
+ escape: false,
closetransitionend: function () {
- $('.popup_wrapper').remove();
+ if ($scope.mustReadMessage.markReadMessage) {
+ var mrMsg = new AdminMessagesService({
+ _adminMessageId: $scope.mustReadMessage._id
+ });
+ mrMsg.$update(function (res) {
+ $timeout(function () {
+ vm.getCountUnread();
+ }, 10);
+ });
+ }
}
});
});
@@ -190,23 +203,6 @@
}
};
- /**
- * getWarningInfo
- */
- vm.getWarningInfo = function () {
- var sw = localStorageService.get('showed_warning');
- if (vm.appConfig.showDemoWarningPopup && !sw) {
- $timeout(function () {
- $('#warning_popup').popup('show');
- }, 10);
-
- localStorageService.set('showed_warning', true);
- }
- if (sw) {
- $('.popup_wrapper').remove();
- }
- };
-
/**
* checkMessageUnread
*/
@@ -219,10 +215,30 @@
if (Authentication.user) {
MessagesService.countUnread(function (data) {
vm.unreadCount = data.countAll;
+
+ if (data.mustRead.length > 0) {
+ $rootScope.mustReadMessage = data.mustRead[0];
+ $rootScope.mustReadMessage.markReadMessage = false;
+
+ $timeout(function () {
+ $('#must_read_popup').popup('show');
+ }, 10);
+ }
});
}
};
+ /**
+ * getMustReadMessageContentMarked
+ * @param m
+ * @returns {*}
+ */
+ $rootScope.getMustReadMessageContentMarked = function (m) {
+ if (m) {
+ return marked(m.content, {sanitize: true});
+ }
+ };
+
/**
* checkHnRWarning
*/
@@ -261,20 +277,7 @@
$translate.use(langKey);
$state.reload();
- //$state.transitionTo($state.current, $stateParams, {
- // reload: true, inherit: false, notify: false
- //});
}
};
-
- /**
- * getSiteInfo
- */
- vm.getSiteInfo = function () {
- TorrentsService.siteInfo(function (data) {
- vm.siteInfo = data;
- mtDebug.info(data);
- });
- };
}
}());
diff --git a/modules/core/client/less/home.less b/modules/core/client/less/home.less
index 17703317..ce79755a 100644
--- a/modules/core/client/less/home.less
+++ b/modules/core/client/less/home.less
@@ -539,3 +539,56 @@
padding-top: 30px;
border-top: solid 1px #1a1a1a;
}
+
+//popup overlay----------------------------------------------
+/* csslint ignore:start */
+.must_read_popup {
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
+ display: none;
+}
+
+#must_read_popup_background {
+ transition: all 0.3s 0.05s;
+}
+
+#must_read_popup,
+#must_read_popup_wrapper {
+ transition: all 0.3s ease-out;
+}
+
+#must_read_popup {
+ transform: translateX(0) translateY(-40%);
+}
+
+.popup_visible #must_read_popup {
+ transform: translateX(0) translateY(0);
+}
+
+#must_read_popup,
+#must_read_popup_wrapper {
+ .popup_content {
+ background-color: #fff;
+ opacity: 0.8 !important;
+ width: 80%;
+ top: 20%;
+ border-radius: 4px;
+ h4,
+ .h4 {
+ line-height: 1.6 !important;
+ }
+ .msg-content {
+ font-size: 16px;
+ }
+ .checkbox {
+ font-size: 16px;
+ font-weight: bold;
+ color: @brand-danger;
+ }
+ }
+ .downloading-filename {
+ word-break: break-all;
+ }
+}
+
+/* csslint ignore:end */
+//popup overlay end -------------------------------------------
diff --git a/modules/core/client/services/debug.client.service.js b/modules/core/client/services/debug.client.service.js
index 97fb6816..aaccdc02 100644
--- a/modules/core/client/services/debug.client.service.js
+++ b/modules/core/client/services/debug.client.service.js
@@ -6,10 +6,12 @@
.module('core')
.factory('DebugConsoleService', DebugConsoleService);
- DebugConsoleService.$inject = ['MeanTorrentConfig'];
+ DebugConsoleService.$inject = ['MeanTorrentConfig', 'Authentication'];
- function DebugConsoleService(MeanTorrentConfig) {
+ function DebugConsoleService(MeanTorrentConfig, Authentication) {
var appConfig = MeanTorrentConfig.meanTorrentConfig.app;
+ var announceConfig = MeanTorrentConfig.meanTorrentConfig.announce;
+ var user = Authentication.user;
var service = {
info: debugInfo
@@ -18,7 +20,7 @@
return service;
function debugInfo(obj) {
- if (appConfig.showClientDebugLog) {
+ if (appConfig.showClientDebugLog && announceConfig.debugClientSideUser.ids.includes(user._id)) {
console.log(obj);
}
}
diff --git a/modules/core/client/views/footer.client.view.html b/modules/core/client/views/footer.client.view.html
index e835ab8d..72719495 100644
--- a/modules/core/client/views/footer.client.view.html
+++ b/modules/core/client/views/footer.client.view.html
@@ -1,8 +1,8 @@
-