2011-01-20 09:57:23 -05:00
|
|
|
NEWSBLUR.ReaderGoodies = function(options) {
|
|
|
|
var defaults = {};
|
|
|
|
|
|
|
|
this.options = $.extend({}, defaults, options);
|
2012-05-17 18:40:46 -07:00
|
|
|
this.model = NEWSBLUR.assets;
|
2011-01-20 09:57:23 -05:00
|
|
|
this.runner();
|
|
|
|
};
|
|
|
|
|
2013-04-11 16:50:18 -07:00
|
|
|
NEWSBLUR.ReaderGoodies.prototype = new NEWSBLUR.Modal;
|
|
|
|
NEWSBLUR.ReaderGoodies.prototype.constructor = NEWSBLUR.ReaderGoodies;
|
|
|
|
|
|
|
|
_.extend(NEWSBLUR.ReaderGoodies.prototype, {
|
2011-01-20 09:57:23 -05:00
|
|
|
|
|
|
|
runner: function() {
|
|
|
|
this.make_modal();
|
|
|
|
this.open_modal();
|
|
|
|
|
|
|
|
this.$modal.bind('click', $.rescope(this.handle_click, this));
|
|
|
|
},
|
|
|
|
|
|
|
|
make_modal: function() {
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
this.$modal = $.make('div', { className: 'NB-modal-goodies NB-modal' }, [
|
2013-04-05 11:26:25 -07:00
|
|
|
$.make('h2', { className: 'NB-modal-title' }, [
|
|
|
|
$.make('div', { className: 'NB-icon' }),
|
|
|
|
'Goodies & Extras'
|
|
|
|
]),
|
2013-04-11 13:41:10 -07:00
|
|
|
|
|
|
|
$.make('fieldset', [
|
|
|
|
$.make('legend', 'Bookmarklet')
|
|
|
|
]),
|
2011-01-20 09:57:23 -05:00
|
|
|
$.make('div', { className: 'NB-goodies-group' }, [
|
2011-01-22 21:42:58 -05:00
|
|
|
NEWSBLUR.generate_bookmarklet(),
|
2012-08-25 19:56:07 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Add Site & Share Story Bookmarklet')
|
2011-02-01 03:35:11 +01:00
|
|
|
]),
|
2012-10-23 12:44:10 -07:00
|
|
|
|
2013-04-11 13:41:10 -07:00
|
|
|
$.make('fieldset', [
|
|
|
|
$.make('legend', 'Mobile Apps for NewsBlur')
|
|
|
|
]),
|
2012-10-23 12:44:10 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
|
|
|
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
|
|
|
|
href: '/ios/'
|
|
|
|
}, 'See the iOS App'),
|
|
|
|
$.make('div', { className: 'NB-goodies-iphone' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Official NewsBlur iPhone/iPad App')
|
|
|
|
]),
|
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
|
|
|
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
|
|
|
|
href: '/android/'
|
|
|
|
}, 'See the Android App'),
|
|
|
|
$.make('div', { className: 'NB-goodies-android' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Official NewsBlur Android App')
|
|
|
|
]),
|
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
|
|
|
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
|
|
|
|
href: 'https://market.android.com/details?id=bitwrit.Blar'
|
|
|
|
}, 'View in Android Market'),
|
|
|
|
$.make('div', { className: 'NB-goodies-android' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Blar: User-Created Android App')
|
|
|
|
]),
|
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
|
|
|
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
|
2013-03-13 16:17:19 -07:00
|
|
|
href: 'http://windowsphone.com/s?appid=900e67fd-9934-e011-854c-00237de2db9e'
|
|
|
|
}, 'View in Windows Phone Store'),
|
|
|
|
$.make('div', { className: 'NB-goodies-windows' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Feed Me: User-Created Windows Phone App')
|
|
|
|
]),
|
2013-04-24 11:56:39 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
|
|
|
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
|
|
|
|
href: 'http://windowsphone.com/s?appid=2585d348-0894-41b6-8c26-77aeb257f9d8'
|
|
|
|
}, 'View in Windows Phone Store'),
|
|
|
|
$.make('div', { className: 'NB-goodies-windows' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Metroblur: User-Created Windows Phone App')
|
|
|
|
]),
|
2013-03-13 16:17:19 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
|
|
|
className: 'NB-goodies-mobile-link NB-modal-submit-button NB-modal-submit-green',
|
2012-10-23 12:44:10 -07:00
|
|
|
href: 'http://projects.developer.nokia.com/feed_reader'
|
|
|
|
}, 'View in Nokia Store'),
|
|
|
|
$.make('div', { className: 'NB-goodies-nokia' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Web Feeds: User-Created MeeGo App')
|
|
|
|
]),
|
2013-04-11 13:41:10 -07:00
|
|
|
$.make('fieldset', [
|
|
|
|
$.make('legend', 'Browser Extensions for NewsBlur')
|
|
|
|
]),
|
2011-02-25 13:07:08 -05:00
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
2011-02-01 03:35:11 +01:00
|
|
|
$.make('a', {
|
2011-02-25 13:07:08 -05:00
|
|
|
className: 'NB-goodies-firefox-link NB-modal-submit-button NB-modal-submit-green',
|
2011-02-01 03:35:11 +01:00
|
|
|
href: '#'
|
2011-02-25 15:20:38 -05:00
|
|
|
}, 'Add to Firefox'),
|
2011-02-25 13:07:08 -05:00
|
|
|
$.make('div', { className: 'NB-goodies-firefox' }),
|
2013-03-30 20:33:00 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Firefox: Register NewsBlur as an RSS reader')
|
2011-02-25 14:04:03 -05:00
|
|
|
]),
|
2011-03-18 00:09:33 -04:00
|
|
|
$.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: '#'
|
2013-03-30 20:33:00 -07:00
|
|
|
}, 'Download'),
|
2011-03-18 00:09:33 -04:00
|
|
|
$.make('div', { className: 'NB-goodies-chrome' }),
|
2012-07-29 22:06:43 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Google Chrome: NewsBlur Chrome Web App')
|
2011-03-18 00:09:33 -04:00
|
|
|
]),
|
2011-02-25 14:04:03 -05:00
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('a', {
|
2013-03-30 20:33:00 -07:00
|
|
|
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'
|
2011-02-25 15:20:38 -05:00
|
|
|
}, 'Add to Safari'),
|
2011-02-25 14:04:03 -05:00
|
|
|
$.make('div', { className: 'NB-goodies-safari' }),
|
2013-03-30 20:33:00 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Safari: Register NewsBlur as an RSS reader'),
|
2011-03-18 00:00:17 -04:00
|
|
|
$.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'),
|
2013-03-30 20:33:00 -07:00
|
|
|
' 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!'
|
2011-03-18 00:00:17 -04:00
|
|
|
])
|
2011-02-25 15:20:38 -05:00
|
|
|
]),
|
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
2013-03-30 20:33:00 -07:00
|
|
|
$.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')
|
2011-08-07 21:38:09 -07:00
|
|
|
]),
|
2012-01-13 10:55:15 -08:00
|
|
|
$.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'
|
2013-03-30 20:33:00 -07:00
|
|
|
}, 'Download'),
|
2012-01-13 10:55:15 -08:00
|
|
|
$.make('div', { className: 'NB-goodies-chrome' }),
|
2013-03-30 20:33:00 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Chrome: NewsBlur unread count notifier')
|
|
|
|
]),
|
|
|
|
|
2013-04-11 13:41:10 -07:00
|
|
|
$.make('fieldset', [
|
|
|
|
$.make('legend', 'Custom URLs')
|
|
|
|
]),
|
2013-03-30 20:33:00 -07:00
|
|
|
$.make('div', { className: 'NB-goodies-group NB-modal-submit' }, [
|
|
|
|
$.make('input', {
|
|
|
|
className: 'NB-goodies-custom-input',
|
|
|
|
value: 'http://www.newsblur.com/?url=BLOG_URL_GOES_HERE'
|
|
|
|
}),
|
|
|
|
$.make('div', { className: 'NB-goodies-custom' }),
|
|
|
|
$.make('div', { className: 'NB-goodies-title' }, 'Custom Add Site URL')
|
2011-01-20 09:57:23 -05:00
|
|
|
])
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
|
|
|
|
// ===========
|
|
|
|
// = Actions =
|
|
|
|
// ===========
|
|
|
|
|
|
|
|
handle_click: function(elem, e) {
|
|
|
|
var self = this;
|
|
|
|
|
2011-01-24 09:58:16 -05:00
|
|
|
$.targetIs(e, { tagSelector: '.NB-goodies-bookmarklet-button' }, function($t, $p) {
|
2011-01-20 09:57:23 -05:00
|
|
|
e.preventDefault();
|
|
|
|
|
2011-01-24 09:58:16 -05:00
|
|
|
alert('Drag this button to your bookmark toolbar.');
|
2011-01-20 09:57:23 -05:00
|
|
|
});
|
2011-02-01 03:35:11 +01:00
|
|
|
|
2011-02-25 13:07:08 -05:00
|
|
|
$.targetIs(e, { tagSelector: '.NB-goodies-firefox-link' }, function($t, $p) {
|
2011-02-01 03:35:11 +01:00
|
|
|
e.preventDefault();
|
2012-11-16 15:54:31 -08:00
|
|
|
var host = [
|
|
|
|
document.location.protocol,
|
|
|
|
'//',
|
|
|
|
document.location.host,
|
|
|
|
'/'
|
|
|
|
].join('');
|
2011-02-01 03:35:11 +01:00
|
|
|
navigator.registerContentHandler("application/vnd.mozilla.maybe.feed",
|
2012-11-16 15:54:31 -08:00
|
|
|
host + "?url=%s",
|
2011-02-01 03:35:11 +01:00
|
|
|
"NewsBlur");
|
2012-10-19 14:57:36 -07:00
|
|
|
navigator.registerContentHandler("application/atom+xml",
|
2012-11-16 15:54:31 -08:00
|
|
|
host + "?url=%s",
|
2012-10-19 14:57:36 -07:00
|
|
|
"NewsBlur");
|
|
|
|
navigator.registerContentHandler("application/rss+xml",
|
2012-11-16 15:54:31 -08:00
|
|
|
host + "?url=%s",
|
2012-10-19 14:57:36 -07:00
|
|
|
"NewsBlur");
|
2011-02-01 03:35:11 +01:00
|
|
|
});
|
2011-02-25 14:04:03 -05:00
|
|
|
|
2011-03-18 00:09:33 -04:00
|
|
|
$.targetIs(e, { tagSelector: '.NB-goodies-chrome-link' }, function($t, $p) {
|
|
|
|
e.preventDefault();
|
|
|
|
|
2013-04-08 12:07:54 -07:00
|
|
|
window.location.href = 'https://chrome.google.com/webstore/detail/rss-subscription-extensio/bmjffnfcokiodbeiamclanljnaheeoke';
|
2011-03-18 00:09:33 -04:00
|
|
|
});
|
|
|
|
|
2011-02-25 15:20:38 -05:00
|
|
|
$.targetIs(e, { tagSelector: '.NB-goodies-custom-input' }, function($t, $p) {
|
|
|
|
e.preventDefault();
|
|
|
|
$t.select();
|
|
|
|
});
|
2011-01-20 09:57:23 -05:00
|
|
|
}
|
|
|
|
|
2013-04-11 16:50:18 -07:00
|
|
|
});
|