v1.18.x
Barış Soner Uşaklı 6 years ago
commit 8566205214

@ -66,7 +66,7 @@
"ipaddr.js": "^1.5.4", "ipaddr.js": "^1.5.4",
"jquery": "^3.2.1", "jquery": "^3.2.1",
"jsesc": "2.5.2", "jsesc": "2.5.2",
"json-2-csv": "^2.1.2", "json-2-csv": "^3.0.0",
"less": "^2.7.3", "less": "^2.7.3",
"lodash": "^4.17.10", "lodash": "^4.17.10",
"logrotate-stream": "^0.2.5", "logrotate-stream": "^0.2.5",
@ -79,7 +79,7 @@
"mousetrap": "^1.6.1", "mousetrap": "^1.6.1",
"mubsub-nbb": "^1.5.0", "mubsub-nbb": "^1.5.0",
"nconf": "^0.10.0", "nconf": "^0.10.0",
"nodebb-plugin-composer-default": "6.1.19", "nodebb-plugin-composer-default": "6.1.20",
"nodebb-plugin-dbsearch": "3.0.4", "nodebb-plugin-dbsearch": "3.0.4",
"nodebb-plugin-emoji": "^2.2.5", "nodebb-plugin-emoji": "^2.2.5",
"nodebb-plugin-emoji-android": "2.0.0", "nodebb-plugin-emoji-android": "2.0.0",
@ -93,7 +93,7 @@
"nodebb-theme-slick": "1.2.19", "nodebb-theme-slick": "1.2.19",
"nodebb-theme-vanilla": "10.1.13", "nodebb-theme-vanilla": "10.1.13",
"nodebb-widget-essentials": "4.0.12", "nodebb-widget-essentials": "4.0.12",
"nodemailer": "^4.6.5", "nodemailer": "^5.0.0",
"passport": "^0.4.0", "passport": "^0.4.0",
"passport-local": "1.0.0", "passport-local": "1.0.0",
"pg": "^7.4.0", "pg": "^7.4.0",
@ -119,7 +119,7 @@
"socket.io-redis": "5.2.0", "socket.io-redis": "5.2.0",
"socketio-wildcard": "2.0.0", "socketio-wildcard": "2.0.0",
"spdx-license-list": "^5.0.0", "spdx-license-list": "^5.0.0",
"spider-detector": "1.0.18", "spider-detector": "1.0.19",
"toobusy-js": "^0.5.1", "toobusy-js": "^0.5.1",
"uglify-es": "^3.3.9", "uglify-es": "^3.3.9",
"validator": "10.10.0", "validator": "10.10.0",
@ -137,7 +137,7 @@
"eslint-plugin-import": "2.14.0", "eslint-plugin-import": "2.14.0",
"grunt": "1.0.3", "grunt": "1.0.3",
"grunt-contrib-watch": "1.1.0", "grunt-contrib-watch": "1.1.0",
"husky": "1.3.0", "husky": "1.3.1",
"jsdom": "13.1.0", "jsdom": "13.1.0",
"lint-staged": "8.1.0", "lint-staged": "8.1.0",
"mocha": "5.2.0", "mocha": "5.2.0",

@ -46,6 +46,6 @@
"redis.raw-info": "Redis Raw Info", "redis.raw-info": "Redis Raw Info",
"postgres": "Postgres", "postgres": "Postgres",
"postgres.version": "PostgreSQL Version", "postgres.version": "PostgreSQL 버전",
"postgres.raw-info": "Postgres Raw Info" "postgres.raw-info": "Postgres Raw Info"
} }

@ -1,5 +1,5 @@
{ {
"global": "Global", "global": "글로벌",
"global.no-users": "No user-specific global privileges.", "global.no-users": "No user-specific global privileges.",
"chat": "Chat", "chat": "Chat",

@ -258,6 +258,12 @@ define('chat', [
} }
}; };
// TODO: see taskbar.js:44
module.closeByUUID = function (uuid) {
var chatModal = $('.chat-modal[data-uuid="' + uuid + '"]');
module.close(chatModal);
};
module.center = function (chatModal) { module.center = function (chatModal) {
var hideAfter = false; var hideAfter = false;
if (chatModal.hasClass('hide')) { if (chatModal.hasClass('hide')) {

@ -34,6 +34,42 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
return false; return false;
}); });
}); });
$(window).on('action:app.loggedOut', function () {
taskbar.closeAll();
});
};
taskbar.close = function (module, uuid) {
// Sends signal to the appropriate module's .close() fn (if present)
var btnEl = taskbar.tasklist.find('[data-module="' + module + '"][data-uuid="' + uuid + '"]');
var fnName = 'close';
// TODO: Refactor chat module to not take uuid in close instead of by jQuery element
if (module === 'chat') {
fnName = 'closeByUUID';
}
if (btnEl.length) {
require([module], function (module) {
if (typeof module[fnName] === 'function') {
module[fnName](uuid);
}
});
}
};
taskbar.closeAll = function (module) {
// module is optional
var selector = '[data-uuid]';
if (module) {
selector = '[data-module="' + module + '"]' + selector;
}
taskbar.tasklist.find(selector).each(function (idx, el) {
taskbar.close(module || el.getAttribute('data-module'), el.getAttribute('data-uuid'));
});
}; };
taskbar.discard = function (module, uuid) { taskbar.discard = function (module, uuid) {

@ -472,7 +472,8 @@ authenticationController.logout = function (req, res, next) {
function (next) { function (next) {
req.logout(); req.logout();
req.session.regenerate(function (err) { req.session.regenerate(function (err) {
delete req.uid; req.uid = 0;
req.headers['x-csrf-token'] = req.csrfToken();
next(err); next(err);
}); });
}, },

Loading…
Cancel
Save