From a49aee9d3dbada3f0a8f32b5945678b7e456f18e Mon Sep 17 00:00:00 2001 From: chronize Date: Thu, 31 Jul 2014 15:20:41 -0400 Subject: [PATCH] Merge master --- package.json | 45 +++++++++++++++++++++++--------- public/src/forum/admin/groups.js | 27 ++++++++++++++++--- src/groups.js | 8 +++++- 3 files changed, 62 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 1f29c41593..ecc7ae2750 100644 --- a/package.json +++ b/package.json @@ -16,24 +16,33 @@ }, "dependencies": { "async": "~0.9.0", + "base64-url": "^1.0.0", "bcryptjs": "~2.0.1", + "body-parser": "^1.0.1", + "colors": "^0.6.2", + "compression": "^1.0.1", "connect-flash": "^0.1.1", + "connect-multiparty": "^1.0.1", + "cookie": "^0.1.2", + "cookie-parser": "^1.0.1", + "cookie-signature": "^1.0.4", "cron": "~1.0.4", + "csurf": "^1.1.0", + "cycle": "^1.0.3", "daemon": "~1.1.0", + "debug": "^1.0.4", + "depd": "^0.4.4", "express": "4.6.1", - "cookie-parser": "^1.0.1", - "body-parser": "^1.0.1", - "serve-favicon": "^2.0.1", "express-session": "^1.0.2", - "csurf": "^1.1.0", - "compression": "^1.0.1", - "connect-multiparty": "^1.0.1", - "morgan": "^1.0.0", + "finalhandler": "^0.1.0", "gm": "1.16.0", "gravatar": "1.0.6", "less": "~1.7.3", "mkdirp": "~0.5.0", - "nconf": "~0.6.7", + "mocha": "^1.21.3", + "morgan": "^1.0.0", + "ms": "^0.6.2", + "nconf": "^0.6.9", "nodebb-plugin-dbsearch": "0.0.13", "nodebb-plugin-markdown": "~0.5.0", "nodebb-plugin-mentions": "~0.5.0", @@ -41,24 +50,34 @@ "nodebb-theme-lavender": "~0.0.74", "nodebb-theme-vanilla": "~0.0.111", "nodebb-widget-essentials": "~0.1.0", - "npm": "^1.4.6", + "npm": "^1.4.21", "passport": "~0.2.0", "passport-local": "1.0.0", + "path-to-regexp": "^0.2.3", + "pkginfo": "^0.3.0", "prompt": "~0.2.11", + "read": "^1.0.5", + "reds": "^0.2.4", "request": "~2.38.0", + "revalidator": "^0.2.0", "rimraf": "~2.2.6", "rss": "~0.3.2", "semver": "~2.3.1", + "serve-favicon": "^2.0.1", "sitemap": "~0.7.3", "socket.io": "~0.9.16", + "socket.io-client": "^1.0.6", "socket.io-wildcard": "~0.1.1", + "stack-trace": "0.0.9", "string": "~1.9.0", - "uglify-js": "git+https://github.com/julianlam/UglifyJS2.git", + "templates.js": "0.0.8", + "uglify-js": "^2.4.15", "underscore": "~1.6.0", + "utile": "^0.2.1", + "utils-merge": "^1.0.0", "validator": "~3.16.1", - "winston": "~0.7.2", - "xregexp": "~2.0.0", - "templates.js": "0.0.8" + "winston": "^0.7.3", + "xregexp": "~2.0.0" }, "devDependencies": { "mocha": "~1.13.0" diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js index 5e4f0c34d1..34a1b59ed0 100644 --- a/public/src/forum/admin/groups.js +++ b/public/src/forum/admin/groups.js @@ -78,14 +78,33 @@ define('forum/admin/groups', ['forum/admin/iconSelect'], function(iconSelect) { break; case 'members': socket.emit('admin.groups.get', groupName, function(err, groupObj) { - var formEl = detailsModal.find('form'); + var formEl = detailsModal.find('form').keypress(function(e) { + switch(e.keyCode) { + case 13: + detailsModalSave.click(); + break; + default: + break; + } + }), + groupLabelPreview = formEl.find('#group-label-preview'), + changeGroupUserTitle = formEl.find('#change-group-user-title'), + changeGroupLabelColor = formEl.find('#change-group-label-color'); formEl.find('#change-group-name').val(groupObj.name).prop('readonly', groupObj.system); formEl.find('#change-group-desc').val(groupObj.description); - formEl.find('#change-group-user-title').val(groupObj.userTitle); + changeGroupUserTitle.val(groupObj.userTitle).keydown(function() { + setTimeout(function() { + groupLabelPreview.text(changeGroupUserTitle.val()); + }, 0); + }); formEl.find('#group-icon').attr('class', 'fa fa-2x ' + groupObj.icon).attr('value', groupObj.icon); - formEl.find('#change-group-label-color').val(groupObj.labelColor); - formEl.find('#group-label-preview').css('background', groupObj.labelColor || '#000000').text(groupObj.userTitle); + changeGroupLabelColor.val(groupObj.labelColor).keydown(function() { + setTimeout(function() { + groupLabelPreview.css('background', changeGroupLabelColor.val() || '#000000'); + }, 0); + }); + groupLabelPreview.css('background', groupObj.labelColor || '#000000').text(groupObj.userTitle); groupMembersEl.empty(); if (groupObj.members.length > 0) { diff --git a/src/groups.js b/src/groups.js index 8164ae457c..5af818c5ec 100644 --- a/src/groups.js +++ b/src/groups.js @@ -295,7 +295,13 @@ db.rename('group:' + oldName, 'group:' + newName, next); }, function(next) { - db.rename('group:' + oldName + ':members', 'group:' + newName + ':members', next); + Groups.exists('group:' + oldName + ':members', function(err, exists) { + if (exists) { + db.rename('group:' + oldName + ':members', 'group:' + newName + ':members', next); + } else { + next(); + } + }); }, function(next) { renameGroupMember('groups', oldName, newName, next);