mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
Fixing automatic reloading of new features and community feedback on web.
This commit is contained in:
parent
8c26fb1117
commit
562aa6a10c
5 changed files with 18 additions and 11 deletions
|
@ -2020,7 +2020,8 @@ def add_feature(request):
|
|||
def load_features(request):
|
||||
user = get_user(request)
|
||||
page = max(int(request.REQUEST.get('page', 0)), 0)
|
||||
logging.user(request, "~FBBrowse features: ~SBPage #%s" % (page+1))
|
||||
if page > 1:
|
||||
logging.user(request, "~FBBrowse features: ~SBPage #%s" % (page+1))
|
||||
features = Feature.objects.all()[page*3:(page+1)*3+1].values()
|
||||
features = [{
|
||||
'description': f['description'],
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>53</string>
|
||||
<string>54</string>
|
||||
<key>Fabric</key>
|
||||
<dict>
|
||||
<key>APIKey</key>
|
||||
|
|
|
@ -2656,7 +2656,7 @@
|
|||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.newsblur.NewsBlur;
|
||||
PRODUCT_NAME = NewsBlur;
|
||||
PROVISIONING_PROFILE = "a33bf1f3-82b0-4761-a144-cb612ef478e9";
|
||||
PROVISIONING_PROFILE = "15ce9584-643e-4af2-9bb6-cb2bd0c5e965";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
"WARNING_CFLAGS[arch=*]" = "-Wall";
|
||||
|
@ -2696,7 +2696,7 @@
|
|||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.newsblur.NewsBlur;
|
||||
PRODUCT_NAME = NewsBlur;
|
||||
PROVISIONING_PROFILE = "a33bf1f3-82b0-4761-a144-cb612ef478e9";
|
||||
PROVISIONING_PROFILE = "15ce9584-643e-4af2-9bb6-cb2bd0c5e965";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
|
|
|
@ -1270,9 +1270,9 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
|
|||
this.make_request('/reader/mark_all_as_read', {'days': days}, callback);
|
||||
},
|
||||
|
||||
get_features_page: function(page, callback) {
|
||||
this.make_request('/reader/features', {'page': page}, callback, callback, {
|
||||
'ajax_group': 'statistics',
|
||||
get_features_page: function(page, callback, error_callback) {
|
||||
this.make_request('/reader/features', {'page': page}, callback, error_callback, {
|
||||
'ajax_group': 'queue',
|
||||
request_type: 'GET'
|
||||
});
|
||||
},
|
||||
|
@ -1283,7 +1283,7 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
|
|||
'refresh' : refresh,
|
||||
'unmoderated' : unmoderated
|
||||
}, callback, error_callback, {
|
||||
'ajax_group': 'statistics',
|
||||
'ajax_group': 'queue',
|
||||
request_type: 'GET'
|
||||
});
|
||||
},
|
||||
|
@ -1340,7 +1340,7 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
|
|||
|
||||
load_feedback_table: function(callback, error_callback) {
|
||||
this.make_request('/statistics/feedback_table', {}, callback, error_callback, {
|
||||
'ajax_group': 'statistics',
|
||||
'ajax_group': 'queue',
|
||||
request_type: 'GET'
|
||||
});
|
||||
},
|
||||
|
|
|
@ -4976,6 +4976,9 @@
|
|||
|
||||
this.model.get_features_page(this.counts['feature_page']+direction, function(features) {
|
||||
$module.removeClass('NB-loading');
|
||||
|
||||
if (!features) return;
|
||||
|
||||
self.counts['feature_page'] += direction;
|
||||
|
||||
var $table = $.make('table', { className: 'NB-features', cellSpacing: 0, cellPadding: 0 });
|
||||
|
@ -5005,6 +5008,8 @@
|
|||
$previous.addClass('NB-disabled');
|
||||
}
|
||||
|
||||
}, function() {
|
||||
$module.removeClass('NB-loading');
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -5416,10 +5421,11 @@
|
|||
if (NEWSBLUR.Globals.debug) return;
|
||||
|
||||
// Reload feedback module every 10 minutes.
|
||||
var reload_interval = NEWSBLUR.Globals.is_staff ? 60*1000 : 10*60*1000;
|
||||
var reload_interval = NEWSBLUR.Globals.is_staff ? 30*1000 : 5*60*1000;
|
||||
clearInterval(this.locks.load_feedback_table);
|
||||
this.locks.load_feedback_table = setInterval(_.bind(function() {
|
||||
this.load_feedback_table();
|
||||
this.load_feature_page(0);
|
||||
}, this), reload_interval * (Math.random() * (1.25 - 0.75) + 0.75));
|
||||
},
|
||||
|
||||
|
@ -5429,8 +5435,8 @@
|
|||
$module.addClass('NB-loading');
|
||||
|
||||
this.model.load_feedback_table(function(resp) {
|
||||
if (!resp) return;
|
||||
$module.removeClass('NB-loading');
|
||||
if (!resp) return;
|
||||
$module.replaceWith(resp);
|
||||
self.load_javascript_elements_on_page();
|
||||
}, function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue