From 9c60182da47e93d03099771c10b0f5f314cd2370 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 9 Jan 2014 15:58:31 -0500 Subject: [PATCH 1/4] closes #749 --- public/src/forum/topic.js | 6 +++--- public/src/modules/chat.js | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index bfd423fedc..799451d60a 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -996,13 +996,13 @@ define(['composer'], function(composer) { return; } - var container = $(document.body), + var container = $(window), scrollTo = $('#post_anchor_' + pid), tid = $('#post-container').attr('data-tid'); function animateScroll() { - $('body,html').animate({ - scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() - $('#header-menu').height() + $('window,html').animate({ + scrollTop: scrollTo.offset().top + container.scrollTop() - $('#header-menu').height() }, 400); } diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 990b86b8fc..a8807615c8 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -58,6 +58,7 @@ define(['taskbar', 'string'], function(taskbar, S) { chatModal.attr('id', 'chat-modal-' + touid); chatModal.attr('UUID', uuid); + chatModal.css("position", "fixed"); chatModal.appendTo($('body')); chatModal.draggable({ start:function() { @@ -96,9 +97,10 @@ define(['taskbar', 'string'], function(taskbar, S) { } module.center = function(chatModal) { - chatModal.css("position", "fixed"); chatModal.css("left", Math.max(0, (($(window).width() - $(chatModal).outerWidth()) / 2) + $(window).scrollLeft()) + "px"); chatModal.css("top", "0px"); + chatModal.css("zIndex", 2000); + chatModal.find('#chat-message-input').focus(); return chatModal; } @@ -109,7 +111,6 @@ define(['taskbar', 'string'], function(taskbar, S) { checkOnlineStatus(chatModal); taskbar.updateActive(uuid); scrollToBottom(chatModal.find('#chat-content')); - chatModal.find('#chat-message-input').focus(); } module.minimize = function(uuid) { @@ -163,9 +164,11 @@ define(['taskbar', 'string'], function(taskbar, S) { }; function scrollToBottom(chatContent) { - chatContent.scrollTop( - chatContent[0].scrollHeight - chatContent.height() - ); + if(chatContent[0]) { + chatContent.scrollTop( + chatContent[0].scrollHeight - chatContent.height() + ); + } } module.toggleNew = function(uuid, state) { From 30624d4ad85473bd88b3d353e23daa2673e96f4c Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 9 Jan 2014 17:51:26 -0500 Subject: [PATCH 2/4] tabbified the admin settings page --- public/src/forum/admin/settings.js | 6 + public/templates/admin/settings.tpl | 269 +++++++++++++++------------- 2 files changed, 146 insertions(+), 129 deletions(-) diff --git a/public/src/forum/admin/settings.js b/public/src/forum/admin/settings.js index acb74827f4..95cc3c1b9b 100644 --- a/public/src/forum/admin/settings.js +++ b/public/src/forum/admin/settings.js @@ -89,6 +89,12 @@ define(['uploader'], function(uploader) { uploader.hideAlerts(); }); + + $('#settings-tab a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + return false; + }); }; Settings.remove = function(key) { diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl index b5fef202c8..8ddd896da9 100644 --- a/public/templates/admin/settings.tpl +++ b/public/templates/admin/settings.tpl @@ -1,137 +1,148 @@

Settings


-

General Settings

-
-
- -
- -
- -
- -
-
- -
- -
-
-
-
-
+ + +
+
+
+
+ +
+ +
+ +
+ +
+

+ +
+
+
+
+
+
+
+ +
+
+
+

Use privilege thresholds to manage how much reputation a user must gain to receive moderator access.


+ Manage Thread

+ Manage Content

+
+ +
+
+
+
+
+
+
+
+

+ Please ensure that you have installed a third-party emailer (e.g. PostageApp, Mailgun, Mandrill, SendGrid, etc), otherwise emails will not be sent by NodeBB +

+

+ Email Address
+ The following email address refers to the email that the recipient will see in the "From" and "Reply To" fields. +

+
+
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+ +
+ Minimum Username Length
+
+ Maximum Username Length
+
+ Minimum Password Length
+
+ Maximum Signature Length
+
+
+
+
+ +
+
+
+ Post Delay

+ Minimum Title Length

+ Maximum Title Length

+ Minimum Post Length

+ Chat Messages To Display

+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ Maximum File Size

+
+
+
+ +
+
+
+ Custom Robots.txt Leave blank for default
+ +
+
+
-
-

Privilege Thresholds

-
-

Use privilege thresholds to manage how much reputation a user must gain to receive moderator access.


- Manage Thread

- Manage Content

-
- -
-
-
- -
-

Email Settings

-
-
-

- Please ensure that you have installed a third-party emailer (e.g. PostageApp, Mailgun, Mandrill, SendGrid, etc), otherwise emails will not be sent by NodeBB -

-

- Email Address
- The following email address refers to the email that the recipient will see in the "From" and "Reply To" fields. -

-
-
-
-
- -
-

Profile Settings

-
-
- -
-
-
- -
-

User Settings

-
-
- -
-
- -
- Minimum Username Length
-
- Maximum Username Length
-
- Minimum Password Length
-
- Maximum Signature Length
-
-
-
- -
-

Post Settings

-
- Post Delay

- Minimum Title Length

- Maximum Title Length

- Minimum Post Length

- Chat Messages To Display

-
- -
-
- -
-
- -
-
- -
-
- -
- Maximum File Size

-
-
- -
-

Web Crawler Settings

-
- Custom Robots.txt Leave blank for default
- -
-
From c19d3e80632f0f7bea2ed2ee40e009deca3395a3 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 9 Jan 2014 19:34:51 -0500 Subject: [PATCH 3/4] closes #738 --- public/src/forum/footer.js | 13 ++----------- public/templates/header.tpl | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index c10d951088..5c1d57b51e 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -250,18 +250,9 @@ }); function updateUnreadCount(count) { - var badge = $('#numUnreadBadge'); - badge.html(count > 20 ? '20+' : count); - if (count > 0) { - badge - .removeClass('badge-inverse') - .addClass('badge-important'); - } else { - badge - .removeClass('badge-important') - .addClass('badge-inverse'); - } + $('#unread-count').toggleClass('unread-count', count > 0); + $('#unread-count').attr('data-content', count > 20 ? '20+' : count); } socket.on('event:unread.updateCount', updateUnreadCount); diff --git a/public/templates/header.tpl b/public/templates/header.tpl index cf8bc888a7..e5c5bad73a 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -58,7 +58,7 @@
  • - 0 +
  • From 92ca739002bfbe892ee2bc5ca41786b6e5a0b255 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 9 Jan 2014 20:04:50 -0500 Subject: [PATCH 4/4] center on load --- public/src/modules/chat.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index a8807615c8..32d5e6ee8c 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -111,6 +111,7 @@ define(['taskbar', 'string'], function(taskbar, S) { checkOnlineStatus(chatModal); taskbar.updateActive(uuid); scrollToBottom(chatModal.find('#chat-content')); + module.center(chatModal); } module.minimize = function(uuid) {