diff --git a/package.json b/package.json index 41ece32b77..5eb9f294b1 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", @@ -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.0.28", - "nodebb-theme-vanilla": "3.0.17", + "nodebb-theme-persona": "2.1.4", + "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 8aeb81ea17..11b82a51e0 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(); @@ -553,7 +553,9 @@ app.cacheBuster = null; handleNewTopic(); - $('#logout-link').on('click', app.logout); + require(['components'], function(components) { + components.get('user/logout').on('click', app.logout); + }); Visibility.change(function(e, state){ if (state === 'visible') { 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() { diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 41d178a413..4c934b19b8 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -7,9 +7,8 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra var newMessage = false; module.prepareDOM = function() { - var chatsToggleEl = $('#chat_dropdown'), - chatsListEl = $('#chat-list'), - dropdownEl; + var chatsToggleEl = components.get('chat/dropdown'), + 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