Skip to content

Commit

Permalink
loading more files
Browse files Browse the repository at this point in the history
  • Loading branch information
julien51 committed Jun 7, 2013
1 parent 18fdf1c commit 445bd15
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
<script src="/js/angular.min.js"></script>
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/compatibility.js"></script>
<script src="/js/subtome.js"></script>
<script src="/js/services.js"></script>
<script src="/js/store.js"></script>


<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
Expand Down
77 changes: 77 additions & 0 deletions js/compatibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/* some IE8 love */

/* Array.reduce */
if ('function' !== typeof Array.prototype.reduce) {
Array.prototype.reduce = function(callback, opt_initialValue){
'use strict';
if (null === this || 'undefined' === typeof this) {
// At the moment all modern browsers, that support strict mode, have
// native implementation of Array.prototype.reduce. For instance, IE8
// does not support strict mode, so this check is actually useless.
throw new TypeError(
'Array.prototype.reduce called on null or undefined');
}
if ('function' !== typeof callback) {
throw new TypeError(callback + ' is not a function');
}
var index = 0, length = this.length >>> 0, value, isValueSet = false;
if (1 < arguments.length) {
value = opt_initialValue;
isValueSet = true;
}
for ( ; length > index; ++index) {
if (!this.hasOwnProperty(index)) continue;
if (isValueSet) {
value = callback(value, this[index], index, this);
} else {
value = this[index];
isValueSet = true;
}
}
if (!isValueSet) {
throw new TypeError('Reduce of empty array with no initial value');
}
return value;
};
}

/* Date.now */
if (!Date.now) {
Date.now = function() {
return new Date().valueOf();
}
}

/* Array.indexOf */
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
return -1;
}
var n = 0;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n != n) {
n = 0;
} else if (n != 0 && n != Infinity && n != -Infinity) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
if (n >= len) {
return -1;
}
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
for (; k < len; k++) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
}
}
66 changes: 66 additions & 0 deletions js/services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
var Services = function Services() {
this.services = {};
this.error = null;
this.load();
}

Services.prototype.load = function loadServices() {
try {
var servicesString = localStorage.getItem('services');
}
catch(error) {
console.error('There was an error, so we could not load the services from the localStorage. ', error);
if(error.name === 'SecurityError' && error.code === 18) {
this.error = 'A browser setting is preventing SubToMe from saving your favorite subscription tools. Open up Settings > Privacy. Then, make sure Accept cookies from sites is checked. Also, make sure Accept third-party is checked as well.';
}
else {
this.error = 'We could not load your favorite subscriptions tools. ';
}
}
if(servicesString) {
try {
this.services = JSON.parse(servicesString);
}
catch(error) {
console.error('Could not parse ' + servicesString);
this.error = 'Warning: We could not load your favorite subscriptions tools. ';
}
}
}

Services.prototype.count = function countServices() {
var count = 0;
for(var name in this.services) {
count += 1;
}
return count;
}

Services.prototype.forEach = function forEachServices(iterator) {
for(var name in this.services) {
iterator(name, this.services[name]);
}
}

Services.prototype.uses = function usesService(name) {
return this.services[name] || false;
}

Services.prototype.save = function saveServices() {
localStorage.setItem('services', JSON.stringify(this.services));
}

Services.prototype.removeService = function removeService(name) {
delete this.services[name];
this.save();
}

Services.prototype.register = function registerService(name, handler) {
if(!this.services[name]) {
this.services[name] = {
url: handler,
addedOn: Date.now()
}
this.save();
}
}
134 changes: 134 additions & 0 deletions js/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
var apps = [
{
name: 'The Old Reader',
tags: ['web', 'popular', 'advanced'],
description: 'The Old Reader was built to be a Google Reader replacement, and it does it well!',
url: 'http://theoldreader.com/',
icon: 'http://theoldreader.com/favicon.ico',
registration: {
name: 'The Old Reader',
url: 'http://theoldreader.com/feeds/subscribe?url={feed}'
}
},
{
name: 'NewsBlur',
tags: ['web', 'mobile', 'advanced', 'open source'],
description: 'NewsBlur is a personal news reader bringing people together to talk about the world.',
url: 'http://www.newsblur.com/',
icon: 'http://newsblur.com/favicon.ico',
registration: {
name: 'NewsBlur',
url: 'http://www.newsblur.com/?url={url}'
}
},
{
name: 'Rivered',
tags: ['web'],
description: 'An uncluttered River of News; no unread item count, no complexity. Just the content you subscribe to.',
url: 'http://www.rivered.io/',
icon: 'http://www.rivered.io/favicon.ico',
registration: {
name: 'Rivered',
url: 'http://www.rivered.io/add?url={url}'
}
},
{
name: 'Bloglovin',
tags: ['web', 'iOS', 'blog'],
description: 'Bloglovin was created to make reading blogs awesome.',
url: 'http://www.bloglovin.com/',
icon: 'http://www.bloglovin.com/images/favicon.ico',
registration: {
name: 'Bloglovin',
url: 'http://www.bloglovin.com/search/{url}'
}
},
{
name: 'Blogtrottr',
tags: ['email', 'digests'],
description: 'Blogtrottr delivers updates from all of your favourite news, feeds, and blogs directly to your email inbox.',
url: 'http://blogtrottr.com/',
icon: 'http://blogtrottr.com/favicon.ico',
registration: {
name: 'Blogtrottr',
url: 'http://blogtrottr.com/?subscribe={feed}'
}
},
{
name: 'BazQux Reader',
tags: ['web', 'comments'],
description: 'RSS feed reader that shows comments to posts and supports reading of Facebook and Google+ pages.',
url: 'https://bazqux.com/',
icon: 'https://bazqux.com/favicon.ico',
registration: {
name: 'BazQux',
url: 'https://bazqux.com/add?url={url}'
}
},
{
name: 'Feedleap',
tags: ['web', 'kippt', 'bookmark', 'open source'],
description: 'FeedLeap lets you subscribe to your favorite RSS feeds and store new entries as Clips in any Kippt List you want.',
url: 'https://feedleap.herokuapp.com',
icon: 'https://feedleap.herokuapp.com/static/favicon.ico',
registration: {
name: 'Feedleap',
url: 'https://feedleap.herokuapp.com/feeds/new/?feed={feed}&source=subtome'
}
},
{
name: 'FeedHQ',
tags: ['web', 'mobile', 'open source'],
description: 'FeedHQ is a feed reader built with readability and mobility in mind',
url: 'https://feedhq.org/',
icon: 'https://feedhq.org/static/core/img/icon-rss.png',
registration: {
name: 'FeedHQ',
url: 'https://feedhq.org/subscribe/?feeds={feeds}&url={url}'
}
},
{
name: 'Feedbin',
tags: ['web'],
description: 'A fast, simple RSS feed reader that delivers a great reading experience.',
url: 'https://feedbin.me/',
icon: 'https://feedbin.me/favicon.ico',
registration: {
name: 'Feedbin',
url: 'https://feedbin.me/?subscribe={feed}'
}
},
{
name: 'Feedly',
tags: ['chrome', 'firefox', 'mobile'],
description: 'Feedly is a news aggregator application for various Web browsers and mobile devices running iOS and Android.',
url: 'http://feedly.com/',
icon: 'http://feedly.com/favicon.ico',
registration: {
name: 'Feedly',
url: 'http://www.feedly.com/home#subscription/feed/{feed}'
}
},
{
name: 'Msgboy',
tags: ['chrome', 'open source'],
description: 'Msgboy delivers a custom feed of stories in realtime, all based on websites you\'ve bookmarked and visited most often',
url: 'http://www.msgboy.com/',
icon: 'https://raw.github.com/superfeedr/msgboy/master/views/img/icon16.png',
registration: {
name: 'Msgboy',
url: 'chrome-extension://ligglcbjgpiljeoenbhnnfdipkealakb/data/html/subscribe.html?url={url}'
}
},
{
name: 'Google Reader',
tags: ['web', 'deprecated', 'advanced'],
description: 'Google Reader will be shut down on July 1st 2013. We suggest you look at some other option.',
url: 'http://www.google.com/reader',
icon: 'https://www.google.com/reader/ui/favicon.ico',
registration: {
name: 'Google Reader',
url: 'http://www.google.com/reader/view/feed/{feed}'
}
}
];

0 comments on commit 445bd15

Please sign in to comment.