diff --git a/public/language/en_GB/groups.json b/public/language/en_GB/groups.json index a72cf20110..09b1509171 100644 --- a/public/language/en_GB/groups.json +++ b/public/language/en_GB/groups.json @@ -29,6 +29,7 @@ "details.change_icon": "Change Icon", "details.change_colour": "Change Colour", "details.badge_text": "Badge Text", + "details.userTitleEnabled": "Show Badge", "details.private_help": "If enabled, joining of groups requires approval from a group owner", "details.hidden": "Hidden", "details.hidden_help": "If enabled, this group will not be found in the groups listing, and users will have to be invited manually", diff --git a/public/language/en_GB/recent.json b/public/language/en_GB/recent.json index f01670e47c..835dfce296 100644 --- a/public/language/en_GB/recent.json +++ b/public/language/en_GB/recent.json @@ -6,6 +6,7 @@ "year": "Year", "alltime": "All Time", "no_recent_topics": "There are no recent topics.", + "no_popular_topics": "There are no popular topics.", "there-is-a-new-topic": "There is a new topic.", "there-is-a-new-topic-and-a-new-post": "There is a new topic and a new post.", diff --git a/public/src/client/groups/details.js b/public/src/client/groups/details.js index f4f56a686e..bc1534f051 100644 --- a/public/src/client/groups/details.js +++ b/public/src/client/groups/details.js @@ -88,7 +88,9 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker', iconBtn = settingsFormEl.find('[data-action="icon-select"]'), previewEl = settingsFormEl.find('.label'), previewIcon = previewEl.find('i'), - previewValueEl = settingsFormEl.find('[name="icon"]'); + userTitleEl = settingsFormEl.find('[name="userTitle"]'), + userTitleEnabledEl = settingsFormEl.find('[name="userTitleEnabled"]'), + iconValueEl = settingsFormEl.find('[name="icon"]'); // Add color picker to settings form colorBtn.ColorPicker({ @@ -105,9 +107,29 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker', // Add icon selection interface iconBtn.on('click', function() { iconSelect.init(previewIcon, function() { - previewValueEl.val(previewIcon.val()); + iconValueEl.val(previewIcon.val()); }); }); + + // If the user title changes, update that too + userTitleEl.on('keyup', function() { + var icon = previewIcon.detach(); + previewEl.text(' ' + (this.value || settingsFormEl.find('#name').val())); + previewEl.prepend(icon); + }); + + // Disable user title customisation options if the the user title itself is disabled + userTitleEnabledEl.on('change', function() { + var customOpts = $('.user-title-option input, .user-title-option button'); + + if (this.checked) { + customOpts.removeAttr('disabled'); + previewEl.removeClass('hide'); + } else { + customOpts.attr('disabled', 'disabled'); + previewEl.addClass('hide'); + } + }); }; Details.update = function() { diff --git a/public/src/client/popular.js b/public/src/client/popular.js index 6edc5a071c..0d05186faf 100644 --- a/public/src/client/popular.js +++ b/public/src/client/popular.js @@ -2,16 +2,12 @@ /* globals define, app, socket*/ -define('forum/popular', ['forum/recent', 'forum/infinitescroll'], function(recent, infinitescroll) { +define('forum/popular', ['forum/recent'], function(recent) { var Popular = {}; Popular.init = function() { app.enterRoom('recent_posts'); - $('#new-topics-alert').on('click', function() { - $(this).addClass('hide'); - }); - selectActivePill(); }; @@ -26,10 +22,10 @@ define('forum/popular', ['forum/recent', 'forum/infinitescroll'], function(recen return false; } }); - }; + } function getActiveSection() { - parts = window.location.href.split('/'); + var parts = window.location.href.split('/'); return parts[parts.length - 1]; } diff --git a/public/src/modules/composer/resize.js b/public/src/modules/composer/resize.js index 20048eb7e6..9d5d303df9 100644 --- a/public/src/modules/composer/resize.js +++ b/public/src/modules/composer/resize.js @@ -25,7 +25,7 @@ define('composer/resize', function() { } } - if (env === 'sm' || env === 'xs') { + if (env === 'sm' || env === 'xs' || window.innerHeight < 480) { app.toggleNavbar(false); postContainer.css('height', $(window).height()); } diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 6e36cf7296..d0f92d0230 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -22,7 +22,9 @@ define('notifications', ['sounds'], function(sound) { return app.alertError(err.message); } - var notifs = data.unread.concat(data.read); + 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