mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Exposing even more processes over ajax. Quite a bit of inspection going on here.
This commit is contained in:
parent
f0de9155d3
commit
07e335b5a5
4 changed files with 22 additions and 16 deletions
|
@ -71,13 +71,14 @@ def refresh_feeds(feeds, force=False):
|
||||||
def load_feeds(request):
|
def load_feeds(request):
|
||||||
user = get_user(request)
|
user = get_user(request)
|
||||||
|
|
||||||
us = UserSubscriptionFolders.objects.filter(
|
us = UserSubscriptionFolders.objects.select_related('feed', 'usersubscription').filter(
|
||||||
user=user
|
user=user
|
||||||
)
|
)
|
||||||
|
logging.info('UserSubs: %s' % us)
|
||||||
feeds = []
|
feeds = []
|
||||||
folders = []
|
folders = []
|
||||||
for sub in us:
|
for sub in us:
|
||||||
|
logging.info("UserSub: %s" % sub)
|
||||||
try:
|
try:
|
||||||
sub.feed.unread_count = sub.user_sub.count_unread()
|
sub.feed.unread_count = sub.user_sub.count_unread()
|
||||||
except:
|
except:
|
||||||
|
@ -101,7 +102,7 @@ def load_feeds(request):
|
||||||
context = feeds
|
context = feeds
|
||||||
|
|
||||||
data = json_encode(context)
|
data = json_encode(context)
|
||||||
return HttpResponse(data, mimetype='application/json')
|
return HttpResponse(data, mimetype='text/html')
|
||||||
|
|
||||||
def load_single_feed(request):
|
def load_single_feed(request):
|
||||||
user = get_user(request)
|
user = get_user(request)
|
||||||
|
|
|
@ -171,6 +171,13 @@ a img {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 4px 0px;
|
padding: 4px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#story_titles .story .story_title .NB-storytitles-author {
|
||||||
|
padding-left: 12px;
|
||||||
|
color: #808080;
|
||||||
|
font-size: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
#story_titles .story .story_id {
|
#story_titles .story .story_id {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -282,12 +289,6 @@ a img {
|
||||||
border-top: 4px solid #404040;
|
border-top: 4px solid #404040;
|
||||||
}
|
}
|
||||||
|
|
||||||
#story_pane .story_title .NB-storytitles-author {
|
|
||||||
padding-left: 4px;
|
|
||||||
color: #808080;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#story_pane .story_title a {
|
#story_pane .story_title a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #101050;
|
color: #101050;
|
||||||
|
|
|
@ -41,16 +41,20 @@ NEWSBLUR.AssetModel.Reader.prototype = {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function(o) {
|
success: function(o) {
|
||||||
var log_regex = /\s+<div id="django_log"([\s|\S])*$/m;
|
var log_regex = /\s+<div id="django_log"([\s|\S])*$/m;
|
||||||
var log = o.match(log_regex);
|
var log_index = o.indexOf('<div id="django_log"');
|
||||||
var data = eval('(' + o.replace(log_regex, '') + ')');
|
var log = o.substring(log_index);
|
||||||
|
var raw_data = o.substring(0, log_index);
|
||||||
|
var data = eval('(' + raw_data + ')');
|
||||||
if(callback && typeof callback == 'function'){
|
if(callback && typeof callback == 'function'){
|
||||||
callback(data);
|
callback(data);
|
||||||
}
|
}
|
||||||
if (log && log.length) {
|
if (log) {
|
||||||
var log_js = log[0].match(/<script.*?>([\s|\S]*?)<\/script>/m);
|
var log_js_index_begin = log.indexOf('<script type="text/javascript">');
|
||||||
var log_html = log[0].replace(/<script.*?>[\s|\S]*?<\/script>/m, '');
|
var log_js_index_end = log.indexOf('</script>');
|
||||||
|
var log_html = log.substring(0, log_js_index_begin);
|
||||||
|
var log_js = log.substring(log_js_index_begin+31, log_js_index_end);
|
||||||
$('#django_log').replaceWith(log_html);
|
$('#django_log').replaceWith(log_html);
|
||||||
var js = eval(log_js[1]);
|
var js = eval(log_js);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -73,7 +73,7 @@ else:
|
||||||
'/Users/conesus/Projects/newsblur/templates'
|
'/Users/conesus/Projects/newsblur/templates'
|
||||||
)
|
)
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
CACHE_BACKEND = 'locmem:///'
|
CACHE_BACKEND = 'dummy:///'
|
||||||
logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
format='%(asctime)s %(levelname)s %(message)s',
|
format='%(asctime)s %(levelname)s %(message)s',
|
||||||
filename='/Users/conesus/Projects/newsblur/logs/newsblur.log',
|
filename='/Users/conesus/Projects/newsblur/logs/newsblur.log',
|
||||||
|
|
Loading…
Add table
Reference in a new issue