From fe7f5402a8b2a76cac4ea050e925a36fc32fbb6a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 22 Jul 2015 11:30:04 -0400 Subject: [PATCH 01/27] changed base templates path to Persona, from Vanilla. This breaks all themes relying on templates from Vanilla!! See: https://community.nodebb.org/topic/6098/on-changing-the-default-theme-to-persona --- app.js | 2 +- src/meta/css.js | 2 +- src/meta/themes.js | 2 +- src/webserver.js | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 0f5de4bfe9..210927491b 100644 --- a/app.js +++ b/app.js @@ -95,7 +95,7 @@ function loadConfig() { // Ensure themes_path is a full filepath nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); nconf.set('core_templates_path', path.join(__dirname, 'src/views')); - nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); + nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-persona/templates')); if (!process.send) { // If run using `node app`, log GNU copyright info along with server info diff --git a/src/meta/css.js b/src/meta/css.js index 50369f89fb..982388dafb 100644 --- a/src/meta/css.js +++ b/src/meta/css.js @@ -34,7 +34,7 @@ module.exports = function(Meta) { return callback(err); } - var themeId = (themeData['theme:id'] || 'nodebb-theme-vanilla'), + var themeId = (themeData['theme:id'] || 'nodebb-theme-persona'), baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')), paths = [ baseThemePath, diff --git a/src/meta/themes.js b/src/meta/themes.js index 77f1e41523..e10194c9af 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -119,7 +119,7 @@ module.exports = function(Meta) { return callback(err); } - var themeId = data.currentThemeId || 'nodebb-theme-vanilla'; + var themeId = data.currentThemeId || 'nodebb-theme-persona'; var themeObj = data.themesData.filter(function(themeObj) { return themeObj.id === themeId; diff --git a/src/webserver.js b/src/webserver.js index abeb367a90..bef33d2dae 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -89,6 +89,12 @@ function initializeNodeBB(callback) { function(next) { plugins.init(app, middleware, next); }, + function(next) { + plugins.fireHook('static:app.preload', { + app: app, + middleware: middleware + }, next); + }, function(next) { async.parallel([ async.apply(meta.templates.compile), @@ -98,12 +104,6 @@ function initializeNodeBB(callback) { ], next); }, function(results, next) { - plugins.fireHook('static:app.preload', { - app: app, - middleware: middleware - }, next); - }, - function(next) { routes(app, middleware); next(); } From 766e233b876c77e97b059e0d87b343afa4ce861b Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 22 Jul 2015 14:51:20 -0400 Subject: [PATCH 02/27] closes #3353 --- src/user/create.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/user/create.js b/src/user/create.js index db09c11b97..1a6e2a40e8 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -53,26 +53,14 @@ module.exports = function(User) { renamedUsername: function(next) { renameUsername(userData, next); }, - customFields: function(next) { - plugins.fireHook('filter:user.custom_fields', [], next); - }, userData: function(next) { - plugins.fireHook('filter:user.create', userData, next); + plugins.fireHook('filter:user.create', {user: userData, data: data}, next); } }, function(err, results) { if (err) { return callback(err); } - var customData = {}; - results.customFields.forEach(function(customField) { - if (data[customField]) { - customData[customField] = data[customField]; - } - }); - - userData = utils.merge(results.userData, customData); - var userNameChanged = !!results.renamedUsername; if (userNameChanged) { From 791e0893ab5ffc215cee20647342cc29b0d16a07 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 22 Jul 2015 15:06:30 -0400 Subject: [PATCH 03/27] added new hook "filter:digest.subscribers" to allow plugins to override digest subscriptions --- src/user/digest.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/user/digest.js b/src/user/digest.js index 056eebd508..c1656d45c8 100644 --- a/src/user/digest.js +++ b/src/user/digest.js @@ -64,7 +64,14 @@ var async = require('async'), }; Digest.getSubscribers = function(interval, callback) { - db.getSortedSetRange('digest:' + interval + ':uids', 0, -1, callback); + db.getSortedSetRange('digest:' + interval + ':uids', 0, -1, function(err, subscribers) { + plugins.fireHook('filter:digest.subscribers', { + interval: interval, + subscribers: subscribers + }, function(err, returnData) { + callback(err, returnData.subscribers); + }); + }); }; Digest.send = function(data, callback) { From 26a953068662ef77df75b731770cd9a90b595cf5 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 24 Jul 2015 13:58:40 -0400 Subject: [PATCH 04/27] fix sorting on users/map --- src/controllers/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/users.js b/src/controllers/users.js index d416207e29..6e2cfd566f 100644 --- a/src/controllers/users.js +++ b/src/controllers/users.js @@ -175,7 +175,7 @@ usersController.getMap = function(req, res, next) { }); }, function(err, data) { data.sort(function(a, b) { - return b.total - a.total; + return b.users.length - a.users.length; }); data.forEach(function(room) { From ac46356cadf8edbf23c71e523a22d8d2dd000f3d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Aug 2015 14:54:39 -0400 Subject: [PATCH 05/27] Revert "changed base templates path to Persona, from Vanilla." This reverts commit fe7f5402a8b2a76cac4ea050e925a36fc32fbb6a. --- app.js | 2 +- src/meta/css.js | 2 +- src/meta/themes.js | 2 +- src/webserver.js | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 210927491b..0f5de4bfe9 100644 --- a/app.js +++ b/app.js @@ -95,7 +95,7 @@ function loadConfig() { // Ensure themes_path is a full filepath nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); nconf.set('core_templates_path', path.join(__dirname, 'src/views')); - nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-persona/templates')); + nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); if (!process.send) { // If run using `node app`, log GNU copyright info along with server info diff --git a/src/meta/css.js b/src/meta/css.js index 982388dafb..50369f89fb 100644 --- a/src/meta/css.js +++ b/src/meta/css.js @@ -34,7 +34,7 @@ module.exports = function(Meta) { return callback(err); } - var themeId = (themeData['theme:id'] || 'nodebb-theme-persona'), + var themeId = (themeData['theme:id'] || 'nodebb-theme-vanilla'), baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')), paths = [ baseThemePath, diff --git a/src/meta/themes.js b/src/meta/themes.js index e10194c9af..77f1e41523 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -119,7 +119,7 @@ module.exports = function(Meta) { return callback(err); } - var themeId = data.currentThemeId || 'nodebb-theme-persona'; + var themeId = data.currentThemeId || 'nodebb-theme-vanilla'; var themeObj = data.themesData.filter(function(themeObj) { return themeObj.id === themeId; diff --git a/src/webserver.js b/src/webserver.js index bef33d2dae..abeb367a90 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -89,12 +89,6 @@ function initializeNodeBB(callback) { function(next) { plugins.init(app, middleware, next); }, - function(next) { - plugins.fireHook('static:app.preload', { - app: app, - middleware: middleware - }, next); - }, function(next) { async.parallel([ async.apply(meta.templates.compile), @@ -104,6 +98,12 @@ function initializeNodeBB(callback) { ], next); }, function(results, next) { + plugins.fireHook('static:app.preload', { + app: app, + middleware: middleware + }, next); + }, + function(next) { routes(app, middleware); next(); } From 6f23e4bab12e9c61b8bce89f761d51b31df61e59 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Aug 2015 14:57:49 -0400 Subject: [PATCH 06/27] changing the default base theme to persona, from vanilla --- app.js | 2 +- src/meta/css.js | 2 +- src/meta/themes.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 0f5de4bfe9..210927491b 100644 --- a/app.js +++ b/app.js @@ -95,7 +95,7 @@ function loadConfig() { // Ensure themes_path is a full filepath nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); nconf.set('core_templates_path', path.join(__dirname, 'src/views')); - nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); + nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-persona/templates')); if (!process.send) { // If run using `node app`, log GNU copyright info along with server info diff --git a/src/meta/css.js b/src/meta/css.js index 50369f89fb..982388dafb 100644 --- a/src/meta/css.js +++ b/src/meta/css.js @@ -34,7 +34,7 @@ module.exports = function(Meta) { return callback(err); } - var themeId = (themeData['theme:id'] || 'nodebb-theme-vanilla'), + var themeId = (themeData['theme:id'] || 'nodebb-theme-persona'), baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')), paths = [ baseThemePath, diff --git a/src/meta/themes.js b/src/meta/themes.js index 77f1e41523..e10194c9af 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -119,7 +119,7 @@ module.exports = function(Meta) { return callback(err); } - var themeId = data.currentThemeId || 'nodebb-theme-vanilla'; + var themeId = data.currentThemeId || 'nodebb-theme-persona'; var themeObj = data.themesData.filter(function(themeObj) { return themeObj.id === themeId; From 306964b4ea9bb25583b041b7841e7ad7e3fe0a93 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 15:58:53 -0400 Subject: [PATCH 07/27] chat/dropdown and chat/list component --- public/src/modules/chat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 41d178a413..f77ecf6281 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -7,8 +7,8 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra var newMessage = false; module.prepareDOM = function() { - var chatsToggleEl = $('#chat_dropdown'), - chatsListEl = $('#chat-list'), + var chatsToggleEl = components.get('chat/dropdown'), + chatsListEl = components.get('chat/list'), dropdownEl; // Sync open chats between all user socket sessions From 63be875daaed5857c8b58b935028c624f60a6e5e Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 16:18:53 -0400 Subject: [PATCH 08/27] header/userpicture, header/profilelink, header/username components --- public/src/client/account/edit.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/public/src/client/account/edit.js b/public/src/client/account/edit.js index f7896baa90..eb651ca677 100644 --- a/public/src/client/account/edit.js +++ b/public/src/client/account/edit.js @@ -87,18 +87,20 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'], } function updateHeader(picture, username, userslug) { - if (parseInt(ajaxify.data.theirid, 10) !== parseInt(ajaxify.data.yourid, 10)) { - return; - } + require(['components'], function(components) { + if (parseInt(ajaxify.data.theirid, 10) !== parseInt(ajaxify.data.yourid, 10)) { + return; + } - if (picture) { - $('#user-header-picture').attr('src', picture); - } + if (picture) { + components.get('header/userpicture').attr('src', picture); + } - if (username && userslug) { - $('#user-profile-link').attr('href', config.relative_path + '/user/' + userslug); - $('#user-header-name').text(username); - } + if (username && userslug) { + components.get('header/profilelink').attr('href', config.relative_path + '/user/' + userslug); + components.get('header/username').text(username); + } + }); } function handleImageChange() { From a663f95669d9bfa286a75b9626fd273cdfee91b9 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 16:32:32 -0400 Subject: [PATCH 09/27] chats.loadChats() --- public/src/modules/chat.js | 91 ++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index f77ecf6281..4c934b19b8 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -8,8 +8,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra module.prepareDOM = function() { var chatsToggleEl = components.get('chat/dropdown'), - chatsListEl = components.get('chat/list'), - dropdownEl; + chatsListEl = components.get('chat/list'); // Sync open chats between all user socket sessions module.sync(); @@ -19,46 +18,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra return; } - socket.emit('modules.chats.getRecentChats', {after: 0}, function(err, chats) { - if (err) { - return app.alertError(err.message); - } - chats = chats.users; - var userObj; - - chatsListEl.empty(); - - if (!chats.length) { - translator.translate('[[modules:chat.no_active]]', function(str) { - $('
  • ') - .addClass('no_active') - .html('' + str + '') - .appendTo(chatsListEl); - }); - return; - } - - for(var x = 0; x') - .attr('data-uid', userObj.uid) - .html(''+ - '' + - ' ' + - userObj.username + '') - .appendTo(chatsListEl); - - (function(userObj) { - dropdownEl.click(function() { - if (!ajaxify.currentPage.match(/^chats\//)) { - app.openChat(userObj.username, userObj.uid); - } else { - ajaxify.go('chats/' + utils.slugify(userObj.username)); - } - }); - })(userObj); - } - }); + module.loadChats(chatsListEl); }); socket.on('event:chats.receive', function(data) { @@ -139,7 +99,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra username: chatObj.options.title, uid: chatObj.options.touid, new: chatObj.element.hasClass('new') - } + }; }); callback(null, chats); @@ -170,6 +130,51 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra }); }; + module.loadChats = function(chatsListEl) { + var dropdownEl; + + socket.emit('modules.chats.getRecentChats', {after: 0}, function(err, chats) { + if (err) { + return app.alertError(err.message); + } + chats = chats.users; + var userObj; + + chatsListEl.empty(); + + if (!chats.length) { + translator.translate('[[modules:chat.no_active]]', function(str) { + $('
  • ') + .addClass('no_active') + .html('' + str + '') + .appendTo(chatsListEl); + }); + return; + } + + for(var x = 0; x') + .attr('data-uid', userObj.uid) + .html(''+ + '' + + ' ' + + userObj.username + '') + .appendTo(chatsListEl); + + (function(userObj) { + dropdownEl.click(function() { + if (!ajaxify.currentPage.match(/^chats\//)) { + app.openChat(userObj.username, userObj.uid); + } else { + ajaxify.go('chats/' + utils.slugify(userObj.username)); + } + }); + })(userObj); + } + }); + }; + module.bringModalToTop = function(chatModal) { var topZ = 0; From 2301362f59bde60a84049b49128eb592b15a2ffd Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 17:12:34 -0400 Subject: [PATCH 10/27] component="header/usercontrol"; also fixes user status bug --- public/src/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 8aeb81ea17..8ecc3659ae 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -487,13 +487,13 @@ app.cacheBuster = null; }; function handleStatusChange() { - $('#user-control-list .user-status').off('click').on('click', function(e) { + $('[component="header/usercontrol"] [data-status]').off('click').on('click', function(e) { var status = $(this).attr('data-status'); socket.emit('user.setStatus', status, function(err, data) { if(err) { return app.alertError(err.message); } - $('#logged-in-menu #user_label #user-profile-link>i').attr('class', 'fa fa-circle status ' + status); + $('[component="user/status"]').attr('class', 'fa fa-circle status ' + status); app.user.status = status; }); e.preventDefault(); From a44f467ebcd1089731ea115b36a8547db1f88d09 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 17:52:36 -0400 Subject: [PATCH 11/27] Notifications.loadNotifications() --- public/src/modules/notifications.js | 42 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index bf4313b066..5ffbb1de93 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -17,25 +17,7 @@ define('notifications', ['sounds', 'translator'], function(sound, translator) { return; } - socket.emit('notifications.get', null, function(err, data) { - if (err) { - return app.alertError(err.message); - } - - var notifs = data.unread.concat(data.read).sort(function(a, b) { - return parseInt(a.datetime, 10) > parseInt(b.datetime, 10) ? -1 : 1; - }); - - translator.toggleTimeagoShorthand(); - for(var i=0; i parseInt(b.datetime, 10) ? -1 : 1; + }); + + translator.toggleTimeagoShorthand(); + for(var i=0; i Date: Wed, 26 Aug 2015 17:53:23 -0400 Subject: [PATCH 12/27] nbb 0.7.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 41ece32b77..5a9e5d650e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "0.7.3", + "version": "0.7.4", "homepage": "http://www.nodebb.org", "repository": { "type": "git", From 1947a4aea6de6c63661b15cfc25a3d5f8e7ae1ca Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 26 Aug 2015 17:58:35 -0400 Subject: [PATCH 13/27] vanilla 3.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5a9e5d650e..333b5e4475 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "nodebb-rewards-essentials": "0.0.3", "nodebb-theme-lavender": "1.0.52", "nodebb-theme-persona": "2.0.28", - "nodebb-theme-vanilla": "3.0.17", + "nodebb-theme-vanilla": "3.1.0", "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", "passport": "^0.3.0", From e9a42cdecb0c6c96331cce1275dd0a99b1502375 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 11:48:08 -0400 Subject: [PATCH 14/27] fixed notifications on deskto --- public/src/modules/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 5ffbb1de93..d7d6cf79b1 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -17,7 +17,7 @@ define('notifications', ['sounds', 'translator'], function(sound, translator) { return; } - Notifications.loadNotifications(); + Notifications.loadNotifications(notifList); }); notifList.on('click', '[data-nid]', function() { From b19120f82298f485bf3999c6a6a451da4497bed3 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 12:20:45 -0400 Subject: [PATCH 15/27] user/logout componen --- public/src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/app.js b/public/src/app.js index 8ecc3659ae..6fe793ed15 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -553,7 +553,7 @@ app.cacheBuster = null; handleNewTopic(); - $('#logout-link').on('click', app.logout); + components.get('user/logout').on('click', app.logout); Visibility.change(function(e, state){ if (state === 'visible') { From 54d996ca6abce6f3802b47202c5de538145211b8 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 12:24:58 -0400 Subject: [PATCH 16/27] fixed user/logout component + vanilla 3.1.2 --- package.json | 2 +- public/src/app.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 333b5e4475..50b7d2cf83 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "nodebb-rewards-essentials": "0.0.3", "nodebb-theme-lavender": "1.0.52", "nodebb-theme-persona": "2.0.28", - "nodebb-theme-vanilla": "3.1.0", + "nodebb-theme-vanilla": "3.1.2", "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", "passport": "^0.3.0", diff --git a/public/src/app.js b/public/src/app.js index 6fe793ed15..11b82a51e0 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -553,7 +553,9 @@ app.cacheBuster = null; handleNewTopic(); - components.get('user/logout').on('click', app.logout); + require(['components'], function(components) { + components.get('user/logout').on('click', app.logout); + }); Visibility.change(function(e, state){ if (state === 'visible') { From b5c7a34aa5f6d4a8249512997cb862a727fddef2 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 12:34:44 -0400 Subject: [PATCH 17/27] persona 2.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50b7d2cf83..1cd5fc2a6e 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "nodebb-plugin-spam-be-gone": "0.4.1", "nodebb-rewards-essentials": "0.0.3", "nodebb-theme-lavender": "1.0.52", - "nodebb-theme-persona": "2.0.28", + "nodebb-theme-persona": "2.1.1", "nodebb-theme-vanilla": "3.1.2", "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", From d923fa39970aa3dbf52eeaeb70e449ee40680f89 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 12:46:06 -0400 Subject: [PATCH 18/27] up'd persona --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1cd5fc2a6e..94e7a329a7 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "nodebb-plugin-spam-be-gone": "0.4.1", "nodebb-rewards-essentials": "0.0.3", "nodebb-theme-lavender": "1.0.52", - "nodebb-theme-persona": "2.1.1", + "nodebb-theme-persona": "2.1.2", "nodebb-theme-vanilla": "3.1.2", "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", From 12015c17288c001231f794a95c0c6284b55c4b8a Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 13:19:04 -0400 Subject: [PATCH 19/27] persona 2.1.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 94e7a329a7..5eb9f294b1 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "nodebb-plugin-spam-be-gone": "0.4.1", "nodebb-rewards-essentials": "0.0.3", "nodebb-theme-lavender": "1.0.52", - "nodebb-theme-persona": "2.1.2", + "nodebb-theme-persona": "2.1.4", "nodebb-theme-vanilla": "3.1.2", "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", From b7c8d4e5afc20432d4286ab822e9d004aab55cca Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 14:00:15 -0400 Subject: [PATCH 20/27] 0.8.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5eb9f294b1..5251434cfa 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "0.7.4", + "version": "0.8.0", "homepage": "http://www.nodebb.org", "repository": { "type": "git", From b66a58dd529ecdaa6bd5e43b466630ad59f3226d Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 14:07:24 -0400 Subject: [PATCH 21/27] user/status: don't touch the other classes fixes that 2px thing @julianlam --- public/src/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/app.js b/public/src/app.js index 11b82a51e0..6fb289b041 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -493,7 +493,10 @@ app.cacheBuster = null; if(err) { return app.alertError(err.message); } - $('[component="user/status"]').attr('class', 'fa fa-circle status ' + status); + $('[component="user/status"]') + .removeClass('away online dnd offline') + .addClass(status); + app.user.status = status; }); e.preventDefault(); From b10a7d44105f840e37616edaa5510d63cf0c9541 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 14:52:39 -0400 Subject: [PATCH 22/27] notifications/icon component --- public/src/modules/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index d7d6cf79b1..4f4f7ab876 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -9,7 +9,7 @@ define('notifications', ['sounds', 'translator'], function(sound, translator) { var notifContainer = $('.notifications'), notifTrigger = notifContainer.children('a'), notifList = $('#notif-list'), - notifIcon = $('.notification-icon'); + notifIcon = components.get('notifications/icon'); notifTrigger.on('click', function(e) { e.preventDefault(); @@ -119,7 +119,7 @@ define('notifications', ['sounds', 'translator'], function(sound, translator) { }; Notifications.updateNotifCount = function(count) { - var notifIcon = $('.notification-icon'); + var notifIcon = components.get('notifications/icon'); if (count > 0) { notifIcon.removeClass('fa-bell-o').addClass('fa-bell'); From 82d39753b77cfa1552ae47d8d7cc28e8376b9aad Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 14:53:53 -0400 Subject: [PATCH 23/27] hint --- public/src/modules/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 4f4f7ab876..a94c4f635c 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -2,7 +2,7 @@ /* globals define, socket, utils, config, app, ajaxify, templates, Tinycon*/ -define('notifications', ['sounds', 'translator'], function(sound, translator) { +define('notifications', ['sounds', 'translator', 'components'], function(sound, translator, components) { var Notifications = {}; Notifications.prepareDOM = function() { From 53c8d54d573cfb351131b569860f79dd33a8c346 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 14:59:22 -0400 Subject: [PATCH 24/27] upping themes --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5251434cfa..f6e68a2f34 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "nodebb-plugin-spam-be-gone": "0.4.1", "nodebb-rewards-essentials": "0.0.3", "nodebb-theme-lavender": "1.0.52", - "nodebb-theme-persona": "2.1.4", - "nodebb-theme-vanilla": "3.1.2", + "nodebb-theme-persona": "2.1.6", + "nodebb-theme-vanilla": "3.1.3", "nodebb-widget-essentials": "1.0.5", "npm": "^2.1.4", "passport": "^0.3.0", From 61cc0ee597b79b586b2cdbedb7ddcbd8fef2cf44 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 15:07:26 -0400 Subject: [PATCH 25/27] /categories: og:title and should be the same --- src/controllers/categories.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/categories.js b/src/controllers/categories.js index 82c1cbc1e1..5509b0530a 100644 --- a/src/controllers/categories.js +++ b/src/controllers/categories.js @@ -27,7 +27,7 @@ categoriesController.list = function(req, res, next) { content: validator.escape(meta.config.description || '') }, { property: 'og:title', - content: 'Index | ' + validator.escape(meta.config.title || 'NodeBB') + content: '[[pages:categories]]' }, { property: 'og:type', content: 'website' From 5dae60faffedfcdb0f5133e8f1fe7fa22574916a Mon Sep 17 00:00:00 2001 From: psychobunny <rodrigues.andrew@gmail.com> Date: Thu, 27 Aug 2015 15:26:53 -0400 Subject: [PATCH 26/27] closes #3502 --- src/middleware/middleware.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 1f28c827dd..8f9eba0a8f 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -300,6 +300,10 @@ middleware.renderHeader = function(req, res, data, callback) { templateValues.template = {name: res.locals.template}; templateValues.template[res.locals.template] = true; + if (req.route.path === '/') { + modifyTitle(templateValues); + } + plugins.fireHook('filter:middleware.renderHeader', {templateValues: templateValues, req: req, res: res}, function(err, data) { if (err) { return callback(err); @@ -342,6 +346,10 @@ middleware.processRender = function(req, res, next) { } if (res.locals.isAPI) { + if (req.route.path === '/api/') { + options.title = 'Index'; + } + return res.json(options); } @@ -519,6 +527,21 @@ function redirectToLogin(req, res) { return controllers.helpers.redirect(res, '/login'); } +function modifyTitle(obj) { + var title = 'Index | ' + validator.escape(meta.config.title || 'NodeBB'); + obj.browserTitle = title; + + if (obj.metaTags) { + obj.metaTags.forEach(function(tag, i) { + if (tag.property === 'og:title') { + obj.metaTags[i].content = title; + } + }); + } + + return title; +} + module.exports = function(webserver) { app = webserver; middleware.admin = require('./admin')(webserver); From 4b5f67eb4ddc0d1be3d8ace95066358478c84a3c Mon Sep 17 00:00:00 2001 From: psychobunny <rodrigues.andrew@gmail.com> Date: Thu, 27 Aug 2015 15:28:46 -0400 Subject: [PATCH 27/27] use [[pages:home]] instead --- src/middleware/middleware.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 8f9eba0a8f..769882c49d 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -347,7 +347,7 @@ middleware.processRender = function(req, res, next) { if (res.locals.isAPI) { if (req.route.path === '/api/') { - options.title = 'Index'; + options.title = '[[pages:home]]'; } return res.json(options); @@ -528,7 +528,7 @@ function redirectToLogin(req, res) { } function modifyTitle(obj) { - var title = 'Index | ' + validator.escape(meta.config.title || 'NodeBB'); + var title = '[[pages:home]] | ' + validator.escape(meta.config.title || 'NodeBB'); obj.browserTitle = title; if (obj.metaTags) {