diff --git a/Gemfile.lock b/Gemfile.lock index ff2bf2ea037..8b2e816e4ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -165,7 +165,7 @@ GEM em-redis (0.3.0) eventmachine erubis (2.7.0) - eventmachine (1.0.1) + eventmachine (1.0.3) excon (0.16.10) execjs (1.4.0) multi_json (~> 1.0) @@ -452,7 +452,7 @@ GEM therubyracer (0.11.4) libv8 (~> 3.11.8.12) ref - thin (1.5.0) + thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) diff --git a/app/assets/javascripts/admin/templates/admin.js.handlebars b/app/assets/javascripts/admin/templates/admin.js.handlebars index e14a1389fe1..4d66db86c9f 100644 --- a/app/assets/javascripts/admin/templates/admin.js.handlebars +++ b/app/assets/javascripts/admin/templates/admin.js.handlebars @@ -7,7 +7,7 @@
  • {{#linkTo 'admin.site_settings'}}{{i18n admin.site_settings.title}}{{/linkTo}}
  • {{#linkTo 'adminSiteContents'}}{{i18n admin.site_content.title}}{{/linkTo}}
  • {{#linkTo 'adminUsersList.active'}}{{i18n admin.users.title}}{{/linkTo}}
  • -
  • {{#linkTo 'admin.groups'}}{{i18n admin.groups.title}}{{/linkTo}}
  • +
  • {{#linkTo 'admin.email_logs'}}{{i18n admin.email_logs.title}}{{/linkTo}}
  • {{#linkTo 'adminFlags.active'}}{{i18n admin.flags.title}}{{/linkTo}}
  • {{#linkTo 'admin.customize'}}{{i18n admin.customize.title}}{{/linkTo}}
  • diff --git a/app/assets/javascripts/admin/templates/groups.js.handlebars b/app/assets/javascripts/admin/templates/groups.js.handlebars index eb05ffab957..f5a53ea524f 100644 --- a/app/assets/javascripts/admin/templates/groups.js.handlebars +++ b/app/assets/javascripts/admin/templates/groups.js.handlebars @@ -1,3 +1,4 @@ +

    {{i18n admin.groups.edit}}

    @@ -13,8 +14,10 @@
    {{#if content.active}} {{#with content.active}} - {{name}} +

    {{name}}

    {{view Discourse.UserSelector id="private-message-users" class="span8" placeholderKey="admin.groups.selector_placeholder" tabindex="1" usernamesBinding="usernames"}} + + {{/with}} {{else}} nothing here yet diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index 9600f112e34..5fa3a5834f5 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -205,6 +205,7 @@ Discourse = Ember.Application.createWithMixins({ start: function() { Discourse.bindDOMEvents(); Discourse.SiteSettings = PreloadStore.get('siteSettings'); + Discourse.MessageBus.alwaysLongPoll = Discourse.Environment === "development"; Discourse.MessageBus.start(); Discourse.KeyValueStore.init("discourse_", Discourse.MessageBus); // Make sure we delete preloaded data diff --git a/app/assets/javascripts/discourse/components/message_bus.js b/app/assets/javascripts/discourse/components/message_bus.js index 0c725d5a77e..1c19de3686e 100644 --- a/app/assets/javascripts/discourse/components/message_bus.js +++ b/app/assets/javascripts/discourse/components/message_bus.js @@ -9,7 +9,8 @@ **/ Discourse.MessageBus = (function() { // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript - var callbacks, clientId, failCount, interval, isHidden, queue, responseCallbacks, uniqueId; + var callbacks, clientId, failCount, interval, shouldLongPoll, queue, responseCallbacks, uniqueId; + var me; uniqueId = function() { return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { @@ -27,7 +28,7 @@ Discourse.MessageBus = (function() { interval = null; failCount = 0; - isHidden = function() { + var isHidden = function() { if (document.hidden !== void 0) { return document.hidden; } else if (document.webkitHidden !== void 0) { @@ -42,13 +43,17 @@ Discourse.MessageBus = (function() { } }; - return { + shouldLongPoll = function() { + return me.alwaysLongPoll || !isHidden(); + }; + + me = { enableLongPolling: true, callbackInterval: 60000, maxPollInterval: 3 * 60 * 1000, callbacks: callbacks, clientId: clientId, - + alwaysLongPoll: false, stop: false, // Start polling @@ -68,7 +73,7 @@ Discourse.MessageBus = (function() { data[c.channel] = c.last_id === void 0 ? -1 : c.last_id; }); gotData = false; - _this.longPoll = Discourse.ajax(Discourse.getURL("/message-bus/") + clientId + "/poll?" + (isHidden() || !_this.enableLongPolling ? "dlp=t" : ""), { + _this.longPoll = Discourse.ajax(Discourse.getURL("/message-bus/") + clientId + "/poll?" + (!shouldLongPoll() || !_this.enableLongPolling ? "dlp=t" : ""), { data: data, cache: false, dataType: 'json', @@ -101,7 +106,7 @@ Discourse.MessageBus = (function() { interval = _this.callbackInterval; if (failCount > 2) { interval = interval * failCount; - } else if (isHidden()) { + } else if (!shouldLongPoll()) { // slowning down stuff a lot when hidden // we will need to add a lot of fine tuning here interval = interval * 4; @@ -150,4 +155,6 @@ Discourse.MessageBus = (function() { } } }; + + return me; })(); diff --git a/app/assets/stylesheets/admin.css b/app/assets/stylesheets/admin.css index 4dd250ef271..d39d23a863c 100644 --- a/app/assets/stylesheets/admin.css +++ b/app/assets/stylesheets/admin.css @@ -1,6 +1,3 @@ // Manifest // //= require_tree ./admin - - -