From 663aff4b246e43ecd58401e9c0a19443f46e0f55 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 20 Jan 2014 13:41:46 -0500 Subject: [PATCH 1/6] fixed #723 - bootswatch now using BootstrapCDN, scheme-independant URL --- public/src/forum/admin/themes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 5163f0df1d..7c0baaa568 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -114,7 +114,7 @@ define(function() { for (var x = 0; x < numThemes; x++) { var theme = bootswatch.themes[x]; - themeEl.setAttribute('data-css', theme.cssMin); + themeEl.setAttribute('data-css', theme.cssCdn); themeEl.setAttribute('data-theme', theme.name); themeEl.innerHTML = '' + '
' + From 9c9fadb5a1a1c8120cc26dbbb4f9918435bdc03a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 20 Jan 2014 14:53:09 -0500 Subject: [PATCH 2/6] upping mentions minver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ba0ddfbd4..1cb47da746 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "prompt": "~0.2.11", "uglify-js": "~2.4.0", "validator": "~1.5.1", - "nodebb-plugin-mentions": "~0.2", + "nodebb-plugin-mentions": "~0.3", "nodebb-plugin-markdown": "~0.3", "nodebb-theme-vanilla": "~0.0.13", "nodebb-theme-cerulean": "~0.0.12", From f14ad11dd0218f4c82c48db74204add3d5d0f12d Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 20 Jan 2014 20:28:46 +0000 Subject: [PATCH 3/6] add remove user from group confirmation Added confirmation request when removing user from a group. --- public/src/forum/admin/groups.js | 20 ++++++++++++-------- public/templates/admin/groups.tpl | 1 + src/routes/admin.js | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js index 2a7d256364..94817826b0 100644 --- a/public/src/forum/admin/groups.js +++ b/public/src/forum/admin/groups.js @@ -2,7 +2,8 @@ define(function() { var Groups = {}; Groups.init = function() { - var createEl = document.getElementById('create'), + var yourid = templates.get('yourid'), + createEl = document.getElementById('create'), createModal = $('#create-modal'), createSubmitBtn = document.getElementById('create-modal-go'), createNameEl = $('#create-group-name'), @@ -171,13 +172,16 @@ define(function() { groupMembersEl.on('click', 'li[data-uid]', function() { var uid = this.getAttribute('data-uid'), gid = detailsModal.attr('data-gid'); - - socket.emit('admin.groups.leave', { - gid: gid, - uid: uid - }, function(err, data) { - if (!err) { - groupMembersEl.find('li[data-uid="' + uid + '"]').remove(); + bootbox.confirm('Are you sure you want to remove this user?', function(confirm) { + if (confirm){ + socket.emit('admin.groups.leave', { + gid: gid, + uid: uid + }, function(err, data) { + if (!err) { + groupMembersEl.find('li[data-uid="' + uid + '"]').remove(); + } + }); } }); }); diff --git a/public/templates/admin/groups.tpl b/public/templates/admin/groups.tpl index fa23608102..6984e97254 100644 --- a/public/templates/admin/groups.tpl +++ b/public/templates/admin/groups.tpl @@ -96,3 +96,4 @@
+ \ No newline at end of file diff --git a/src/routes/admin.js b/src/routes/admin.js index 0b23680cd0..d7c1c7863f 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -429,7 +429,8 @@ var nconf = require('nconf'), expand: true }, function (err, groups) { res.json(200, { - groups: groups + groups: groups, + yourid: req.user.uid }); }); }); From ed1c276739ddbf96c1e67027e6ddc20d69009fb5 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Mon, 20 Jan 2014 15:35:10 -0500 Subject: [PATCH 4/6] only drag chat modal from header --- public/src/modules/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 6aecfe0271..f79271a94e 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -131,7 +131,8 @@ define(['taskbar', 'string'], function(taskbar, S) { chatModal.draggable({ start:function() { module.bringModalToTop(chatModal); - } + }, + handle: '.modal-header' }); chatModal.find('#chat-with-name').html(username); From a86ff15f7b2d53ad38f1613327cd456511e7e3ca Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 20 Jan 2014 20:54:19 +0000 Subject: [PATCH 5/6] Removed code for yourid removed code that will give the current user id in a var called yourid --- public/src/forum/admin/groups.js | 4 ++-- public/templates/admin/groups.tpl | 3 +-- src/routes/admin.js | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js index 94817826b0..136d9ce363 100644 --- a/public/src/forum/admin/groups.js +++ b/public/src/forum/admin/groups.js @@ -2,8 +2,7 @@ define(function() { var Groups = {}; Groups.init = function() { - var yourid = templates.get('yourid'), - createEl = document.getElementById('create'), + var createEl = document.getElementById('create'), createModal = $('#create-modal'), createSubmitBtn = document.getElementById('create-modal-go'), createNameEl = $('#create-group-name'), @@ -172,6 +171,7 @@ define(function() { groupMembersEl.on('click', 'li[data-uid]', function() { var uid = this.getAttribute('data-uid'), gid = detailsModal.attr('data-gid'); + groups.getGidFromName('Administrators', function(err, gid) {}); bootbox.confirm('Are you sure you want to remove this user?', function(confirm) { if (confirm){ socket.emit('admin.groups.leave', { diff --git a/public/templates/admin/groups.tpl b/public/templates/admin/groups.tpl index 6984e97254..40ceae9669 100644 --- a/public/templates/admin/groups.tpl +++ b/public/templates/admin/groups.tpl @@ -95,5 +95,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/routes/admin.js b/src/routes/admin.js index d7c1c7863f..0b23680cd0 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -429,8 +429,7 @@ var nconf = require('nconf'), expand: true }, function (err, groups) { res.json(200, { - groups: groups, - yourid: req.user.uid + groups: groups }); }); }); From f7a290d0b3e631ce2b250de6920b1c25caf46a09 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 20 Jan 2014 20:55:53 +0000 Subject: [PATCH 6/6] removed function removed function that did not work --- public/src/forum/admin/groups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js index 136d9ce363..16283d9150 100644 --- a/public/src/forum/admin/groups.js +++ b/public/src/forum/admin/groups.js @@ -171,7 +171,7 @@ define(function() { groupMembersEl.on('click', 'li[data-uid]', function() { var uid = this.getAttribute('data-uid'), gid = detailsModal.attr('data-gid'); - groups.getGidFromName('Administrators', function(err, gid) {}); + bootbox.confirm('Are you sure you want to remove this user?', function(confirm) { if (confirm){ socket.emit('admin.groups.leave', {