Adding @anaconda's safari extension for unreads. Also fixing up real-time stats on Statistics to look better.

This commit is contained in:
Samuel Clay 2013-03-30 20:33:00 -07:00
parent 61dde968b8
commit f44678c056
4 changed files with 75 additions and 37 deletions

View file

@ -142,17 +142,12 @@ def load_feed_statistics(request, feed_id):
# Dates of last and next update
stats['active'] = feed.active
stats['last_update'] = relative_timesince(feed.last_update)
if feed.is_push:
stats['next_update'] = "real-time..."
else:
stats['next_update'] = relative_timeuntil(feed.next_scheduled_update)
stats['next_update'] = relative_timeuntil(feed.next_scheduled_update)
stats['push'] = feed.is_push
# Minutes between updates
update_interval_minutes, _ = feed.get_next_scheduled_update(force=True, verbose=False)
if feed.is_push:
stats['update_interval_minutes'] = 0
else:
stats['update_interval_minutes'] = update_interval_minutes
stats['update_interval_minutes'] = update_interval_minutes
original_active_premium_subscribers = feed.active_premium_subscribers
original_premium_subscribers = feed.premium_subscribers
feed.active_premium_subscribers = max(feed.active_premium_subscribers+1, 1)
@ -160,10 +155,7 @@ def load_feed_statistics(request, feed_id):
premium_update_interval_minutes, _ = feed.get_next_scheduled_update(force=True, verbose=False)
feed.active_premium_subscribers = original_active_premium_subscribers
feed.premium_subscribers = original_premium_subscribers
if feed.is_push:
stats['premium_update_interval_minutes'] = 0
else:
stats['premium_update_interval_minutes'] = premium_update_interval_minutes
stats['premium_update_interval_minutes'] = premium_update_interval_minutes
# Stories per month - average and month-by-month breakout
average_stories_per_month, story_count_history = feed.average_stories_per_month, feed.data.story_count_history

View file

@ -6071,10 +6071,23 @@ form.opml_import_form input {
color: #A0A0A0;
text-shadow: 0 1px 0 #FFF;
font-size: 11px;
margin-top: 8px;
}
.NB-modal-statistics .NB-statisics-realtime-spinner {
width: 16px;
height: 16px;
margin-right: 6px;
vertical-align: middle;
display: inline-block;
}
.NB-modal-statistics .NB-statistics-stat .NB-statistics-count {
font-size: 17px;
padding: 6px 0 0;
margin-bottom: 8px;
}
.NB-modal-statistics .NB-statistics-realtime .NB-statistics-count {
font-size: 13px;
color: #808080;
}
.NB-modal-statistics .NB-statistics-history-stat .NB-statistics-count {
font-size: 42px;
@ -7625,7 +7638,7 @@ form.opml_import_form input {
background: transparent url('/media/embed/reader/firefox.png') no-repeat 0 0;
}
.NB-modal-goodies .NB-goodies-safari-link {
.NB-modal-goodies .NB-modal-submit-button {
float: right;
}
.NB-modal-goodies .NB-goodies-safari {

View file

@ -74,31 +74,62 @@ NEWSBLUR.ReaderGoodies.prototype = {
href: '#'
}, 'Add to Firefox'),
$.make('div', { className: 'NB-goodies-firefox' }),
$.make('div', { className: 'NB-goodies-title' }, 'Firefox: Register Newsblur as an RSS reader')
$.make('div', { className: 'NB-goodies-title' }, 'Firefox: Register NewsBlur as an RSS reader')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-chrome-link NB-modal-submit-button NB-modal-submit-green',
href: '#'
}, 'Add to Chrome'),
}, 'Download'),
$.make('div', { className: 'NB-goodies-chrome' }),
$.make('div', { className: 'NB-goodies-title' }, 'Google Chrome: NewsBlur Chrome Web App')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-safari-link NB-modal-submit-button NB-modal-submit-green',
href: '#'
className: 'NB-modal-submit-button NB-modal-submit-green',
href: 'https://chrome.google.com/webstore/detail/rss-subscription-extensio/nlbjncdgjeocebhnmkbbbdekmmmcbfjd/details?hl=en'
}, 'Add to Chrome'),
$.make('div', { className: 'NB-goodies-chrome' }),
$.make('div', { className: 'NB-goodies-title' }, 'Google Chrome: Register NewsBlur as an RSS reader'),
$.make('div', { className: 'NB-goodies-subtitle' }, [
'To use this extension, use the custom add site URL below.'
])
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-modal-submit-button NB-modal-submit-green',
href: NEWSBLUR.Globals.MEDIA_URL + 'extensions/NewsBlur Safari Helper.app.zip'
}, 'Add to Safari'),
$.make('div', { className: 'NB-goodies-safari' }),
$.make('div', { className: 'NB-goodies-title' }, 'Safari: Register Newsblur as an RSS reader'),
$.make('div', { className: 'NB-goodies-title' }, 'Safari: Register NewsBlur as an RSS reader'),
$.make('div', { className: 'NB-goodies-subtitle' }, [
'To use this extension, extract and move the NewsBlur Safari Helper.app ',
'to your Applications folder. Then in ',
$.make('b', 'Safari > Settings > RSS'),
' choose the new NewsBlur Safari Helper.app. Then clicking on the RSS button in ',
'Safari will open the feed in NewsBlur. Simple!'
' choose the new NewsBlur Safari Helper.app. If you don\'t have an RSS chooser, ',
'you will have to use ',
$.make('a', { href: 'http://www.rubicode.com/Software/RCDefaultApp/', className: 'NB-splash-link' }, 'RCDefaultApp'),
' to select the NewsBlur Safari Helper as your RSS reader. Then loading an RSS ',
'feed in Safari will open the feed in NewsBlur. Simple!'
])
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-safari-notifier NB-modal-submit-button NB-modal-submit-green',
href: 'https://menakite.eu/~anaconda/safari/NewsBlur-Counter/NewsBlur-Counter.safariextz'
}, 'Download'),
$.make('div', { className: 'NB-goodies-safari' }),
$.make('div', { className: 'NB-goodies-title' }, 'Safari: NewsBlur unread count notifier')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-chrome-link NB-modal-submit-button NB-modal-submit-green',
href: 'https://chrome.google.com/webstore/detail/nnbhbdncokmmjheldobdfbmfpamelojh'
}, 'Download'),
$.make('div', { className: 'NB-goodies-chrome' }),
$.make('div', { className: 'NB-goodies-title' }, 'Chrome: NewsBlur unread count notifier')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('input', {
className: 'NB-goodies-custom-input',
@ -106,14 +137,6 @@ NEWSBLUR.ReaderGoodies.prototype = {
}),
$.make('div', { className: 'NB-goodies-custom' }),
$.make('div', { className: 'NB-goodies-title' }, 'Custom Add Site URL')
]),
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
$.make('a', {
className: 'NB-goodies-chrome-link NB-modal-submit-button NB-modal-submit-green',
href: 'https://chrome.google.com/webstore/detail/nnbhbdncokmmjheldobdfbmfpamelojh'
}, 'Chrome Notifier'),
$.make('div', { className: 'NB-goodies-chrome' }),
$.make('div', { className: 'NB-goodies-title' }, 'Chrome address bar button that shows unread counts')
])
]);
},
@ -181,12 +204,6 @@ NEWSBLUR.ReaderGoodies.prototype = {
"NewsBlur");
});
$.targetIs(e, { tagSelector: '.NB-goodies-safari-link' }, function($t, $p) {
e.preventDefault();
window.location.href = NEWSBLUR.Globals.MEDIA_URL + 'extensions/NewsBlur Safari Helper.app.zip';
});
$.targetIs(e, { tagSelector: '.NB-goodies-chrome-link' }, function($t, $p) {
e.preventDefault();

View file

@ -95,8 +95,17 @@ _.extend(NEWSBLUR.ReaderStatistics.prototype, {
$.make('div', { className: 'NB-statistics-count' }, ' ' + (data['last_update'] && (data['last_update'] + ' ago')))
]),
$.make('div', { className: 'NB-statistics-update'}, [
$.make('div', { className: 'NB-statistics-label' }, 'Every'),
$.make('div', { className: 'NB-statistics-count' }, update_interval)
(data['push'] && $.make('div', { className: 'NB-statistics-realtime' }, [
$.make('div', { className: 'NB-statistics-label' }, [
$.make('img', { src: NEWSBLUR.Globals.MEDIA_URL + '/img/reader/realtime_spinner.gif', className: 'NB-statisics-realtime-spinner' }),
'Real-time'
]),
$.make('div', { className: 'NB-statistics-count' }, 'Supplemented by checks every ' + update_interval)
])),
(!data['push'] && $.make('div', [
$.make('div', { className: 'NB-statistics-label' }, 'Every'),
$.make('div', { className: 'NB-statistics-count' }, update_interval)
]))
]),
$.make('div', { className: 'NB-statistics-update'}, [
$.make('div', { className: 'NB-statistics-label' }, 'Next Update'),
@ -117,7 +126,14 @@ _.extend(NEWSBLUR.ReaderStatistics.prototype, {
$.make('br'),
'this site would update every'
]),
$.make('div', { className: 'NB-statistics-count' }, premium_update_interval)
$.make('div', { className: 'NB-statistics-count' }, premium_update_interval),
(data['push'] && $.make('div', { className: 'NB-statistics-realtime' }, [
$.make('div', { className: 'NB-statistics-label' }, [
'but it wouldn\'t matter because',
$.make('br'),
'this site is already in real-time'
])
]))
])
]))
])),