* event machine fix is critical (long polling has been broken)
* thin upgrade * work in progress - groups * fix live-refresh in dev
This commit is contained in:
parent
d0a8cfa6c0
commit
de9ca54aed
|
@ -165,7 +165,7 @@ GEM
|
||||||
em-redis (0.3.0)
|
em-redis (0.3.0)
|
||||||
eventmachine
|
eventmachine
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.0.1)
|
eventmachine (1.0.3)
|
||||||
excon (0.16.10)
|
excon (0.16.10)
|
||||||
execjs (1.4.0)
|
execjs (1.4.0)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
|
@ -452,7 +452,7 @@ GEM
|
||||||
therubyracer (0.11.4)
|
therubyracer (0.11.4)
|
||||||
libv8 (~> 3.11.8.12)
|
libv8 (~> 3.11.8.12)
|
||||||
ref
|
ref
|
||||||
thin (1.5.0)
|
thin (1.5.1)
|
||||||
daemons (>= 1.0.9)
|
daemons (>= 1.0.9)
|
||||||
eventmachine (>= 0.12.6)
|
eventmachine (>= 0.12.6)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<li>{{#linkTo 'admin.site_settings'}}{{i18n admin.site_settings.title}}{{/linkTo}}</li>
|
<li>{{#linkTo 'admin.site_settings'}}{{i18n admin.site_settings.title}}{{/linkTo}}</li>
|
||||||
<li>{{#linkTo 'adminSiteContents'}}{{i18n admin.site_content.title}}{{/linkTo}}</li>
|
<li>{{#linkTo 'adminSiteContents'}}{{i18n admin.site_content.title}}{{/linkTo}}</li>
|
||||||
<li>{{#linkTo 'adminUsersList.active'}}{{i18n admin.users.title}}{{/linkTo}}</li>
|
<li>{{#linkTo 'adminUsersList.active'}}{{i18n admin.users.title}}{{/linkTo}}</li>
|
||||||
<li>{{#linkTo 'admin.groups'}}{{i18n admin.groups.title}}{{/linkTo}}</li>
|
<!--<li>{{#linkTo 'admin.groups'}}{{i18n admin.groups.title}}{{/linkTo}}</li>-->
|
||||||
<li>{{#linkTo 'admin.email_logs'}}{{i18n admin.email_logs.title}}{{/linkTo}}</li>
|
<li>{{#linkTo 'admin.email_logs'}}{{i18n admin.email_logs.title}}{{/linkTo}}</li>
|
||||||
<li>{{#linkTo 'adminFlags.active'}}{{i18n admin.flags.title}}{{/linkTo}}</li>
|
<li>{{#linkTo 'adminFlags.active'}}{{i18n admin.flags.title}}{{/linkTo}}</li>
|
||||||
<li>{{#linkTo 'admin.customize'}}{{i18n admin.customize.title}}{{/linkTo}}</li>
|
<li>{{#linkTo 'admin.customize'}}{{i18n admin.customize.title}}{{/linkTo}}</li>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<!-- work in progress, please ignore -->
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='content-list span6'>
|
<div class='content-list span6'>
|
||||||
<h3>{{i18n admin.groups.edit}}</h3>
|
<h3>{{i18n admin.groups.edit}}</h3>
|
||||||
|
@ -13,8 +14,10 @@
|
||||||
<div class='content-editor'>
|
<div class='content-editor'>
|
||||||
{{#if content.active}}
|
{{#if content.active}}
|
||||||
{{#with content.active}}
|
{{#with content.active}}
|
||||||
{{name}}
|
<h3>{{name}}</h3>
|
||||||
{{view Discourse.UserSelector id="private-message-users" class="span8" placeholderKey="admin.groups.selector_placeholder" tabindex="1" usernamesBinding="usernames"}}
|
{{view Discourse.UserSelector id="private-message-users" class="span8" placeholderKey="admin.groups.selector_placeholder" tabindex="1" usernamesBinding="usernames"}}
|
||||||
|
<button>Save</button>
|
||||||
|
|
||||||
{{/with}}
|
{{/with}}
|
||||||
{{else}}
|
{{else}}
|
||||||
nothing here yet
|
nothing here yet
|
||||||
|
|
|
@ -205,6 +205,7 @@ Discourse = Ember.Application.createWithMixins({
|
||||||
start: function() {
|
start: function() {
|
||||||
Discourse.bindDOMEvents();
|
Discourse.bindDOMEvents();
|
||||||
Discourse.SiteSettings = PreloadStore.get('siteSettings');
|
Discourse.SiteSettings = PreloadStore.get('siteSettings');
|
||||||
|
Discourse.MessageBus.alwaysLongPoll = Discourse.Environment === "development";
|
||||||
Discourse.MessageBus.start();
|
Discourse.MessageBus.start();
|
||||||
Discourse.KeyValueStore.init("discourse_", Discourse.MessageBus);
|
Discourse.KeyValueStore.init("discourse_", Discourse.MessageBus);
|
||||||
// Make sure we delete preloaded data
|
// Make sure we delete preloaded data
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
**/
|
**/
|
||||||
Discourse.MessageBus = (function() {
|
Discourse.MessageBus = (function() {
|
||||||
// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
|
// 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() {
|
uniqueId = function() {
|
||||||
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||||
|
@ -27,7 +28,7 @@ Discourse.MessageBus = (function() {
|
||||||
interval = null;
|
interval = null;
|
||||||
failCount = 0;
|
failCount = 0;
|
||||||
|
|
||||||
isHidden = function() {
|
var isHidden = function() {
|
||||||
if (document.hidden !== void 0) {
|
if (document.hidden !== void 0) {
|
||||||
return document.hidden;
|
return document.hidden;
|
||||||
} else if (document.webkitHidden !== void 0) {
|
} else if (document.webkitHidden !== void 0) {
|
||||||
|
@ -42,13 +43,17 @@ Discourse.MessageBus = (function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
shouldLongPoll = function() {
|
||||||
|
return me.alwaysLongPoll || !isHidden();
|
||||||
|
};
|
||||||
|
|
||||||
|
me = {
|
||||||
enableLongPolling: true,
|
enableLongPolling: true,
|
||||||
callbackInterval: 60000,
|
callbackInterval: 60000,
|
||||||
maxPollInterval: 3 * 60 * 1000,
|
maxPollInterval: 3 * 60 * 1000,
|
||||||
callbacks: callbacks,
|
callbacks: callbacks,
|
||||||
clientId: clientId,
|
clientId: clientId,
|
||||||
|
alwaysLongPoll: false,
|
||||||
stop: false,
|
stop: false,
|
||||||
|
|
||||||
// Start polling
|
// Start polling
|
||||||
|
@ -68,7 +73,7 @@ Discourse.MessageBus = (function() {
|
||||||
data[c.channel] = c.last_id === void 0 ? -1 : c.last_id;
|
data[c.channel] = c.last_id === void 0 ? -1 : c.last_id;
|
||||||
});
|
});
|
||||||
gotData = false;
|
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,
|
data: data,
|
||||||
cache: false,
|
cache: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
@ -101,7 +106,7 @@ Discourse.MessageBus = (function() {
|
||||||
interval = _this.callbackInterval;
|
interval = _this.callbackInterval;
|
||||||
if (failCount > 2) {
|
if (failCount > 2) {
|
||||||
interval = interval * failCount;
|
interval = interval * failCount;
|
||||||
} else if (isHidden()) {
|
} else if (!shouldLongPoll()) {
|
||||||
// slowning down stuff a lot when hidden
|
// slowning down stuff a lot when hidden
|
||||||
// we will need to add a lot of fine tuning here
|
// we will need to add a lot of fine tuning here
|
||||||
interval = interval * 4;
|
interval = interval * 4;
|
||||||
|
@ -150,4 +155,6 @@ Discourse.MessageBus = (function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return me;
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
// Manifest
|
// Manifest
|
||||||
//
|
//
|
||||||
//= require_tree ./admin
|
//= require_tree ./admin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue