Skip to content

Commit

Permalink
Working prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Kalafarski authored and Christopher Kalafarski committed Jan 29, 2015
1 parent 6d06ad8 commit f8feba8
Show file tree
Hide file tree
Showing 26 changed files with 592 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Syndication Feeds

This extension for Chrome will try to find any feeds syndicating the current web site, and present them in a pop up. It functions similary to Google's RSS extension, but it does not integrate with any feed readers, or offer a way to subscribe to the feeds it finds. It simply presents the feeds and will open them in a new tab if selected. Other extensions are expected to handle things like: displaying the XML, subscriptions, and parsing feed items.
Binary file added crx-icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/feed/orange/128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/feed/orange/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/feed/orange/19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/feed/orange/32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/feed/orange/38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/feed/orange/64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/podcast/springboard/128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/podcast/springboard/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/podcast/springboard/19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/podcast/springboard/32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/podcast/springboard/38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icons/podcast/springboard/512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"background": {
"persistent": false,
"scripts": [ "scripts/background.js" ]
},
"content_scripts": [ {
"js": [ "scripts/content.js" ],
"matches": [ "http://*/*", "https://*/*" ]
} ],
"description": "Quickly view any podcasdt feeds that are related to the current page.",
"icons": {
"128": "images/icons/podcast/springboard/128.png"
},
"manifest_version": 2,
"name": "Podcast Feeds",
"page_action": {
"default_icon": {
"19": "images/icons/podcast/springboard/19.png",
"38": "images/icons/podcast/springboard/38.png"
},
"default_popup": "page_action/popup.html",
"default_title": "Podcast Feeds"
},
"permissions": [ "tabs", "http://*/*", "https://*/*", "storage" ],
"version": "0.0.1"
}
126 changes: 126 additions & 0 deletions page_action/popup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
Copyright (c) 2013 Christopher Kalafarski.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

body {
width: 270px;
font-family: 'Lucida Grande', 'Segoe UI', Tahoma, 'DejaVu Sans', Arial, sans-serif;
text-decoration: none;
color: black;
padding: 0 0;
}

header {

}

header h1 {
font-weight: normal;
font-size: 18px;
margin: 0 3px;
border-bottom: 1px solid #eee;
padding: 4px 0 15px 0;
}

section {

}

section ol {
margin: 8px 0 15px;
border-bottom: 1px solid #eee;
padding: 0 0 20px;
padding: 0;
list-style: none;
}

section ol li {
}

section ol li > a {
display: block;
text-decoration: inherit;
color: inherit;
outline: none;
margin: 0 0 8px 0;
padding: 3px;
font-size: 11px;
word-break: break-all;
word-wrap: break-word;
}

section ol li > a:hover {
background: #eee;
}

section ol li a h1 {
font-weight: normal;
font-size: 14px;
margin: 0;
padding: 0;
text-transform: capitalize;
background: url(/images/icons/podcast/springboard/16.png) no-repeat;
text-indent: 19px;
}

section ol li a h2 {
font-size: 10px;
font-weight: normal;
color: #bbb;
margin: 0;
padding: 0;
}

section ol li a span {
display: block;
margin: 3px 0;
}

section ol li a p {
margin: 0;
border: 0;
padding: 0;
}

section ol li a p a {
display: inline-block;
padding: 0 8px;
color: black;
text-decoration: none;
}

section ol li a p a:hover {
text-decoration: underline;
}

section ol li a p a:first-child {
border-right: 1px solid #aaa;
padding-left: 0;
}

@media only screen and (-Webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
section ol li a h1 {
background: url(/images/icons/podcast/springboard/32.png) no-repeat;
background-size: 16px 16px;
background-repeat: no-repeat;
}
}
20 changes: 20 additions & 0 deletions page_action/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Podcasts</title>
<link href="/page_action/popup.css" rel="stylesheet" />
</head>
<body>
<header>
<h1>Podcasts</h1>
</header>
<section>
<ol id="feeds"></ol>
</section>
<footer>
</footer>

<script src="/page_action/popup.js"></script>
</body>
</html>
80 changes: 80 additions & 0 deletions page_action/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright (c) 2015 Christopher Kalafarski.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

function main() {
chrome.tabs.getSelected(function(tab) {
chrome.storage.local.get(tab.id.toString(), function(result) {
var _list = document.getElementById('feeds');
var feeds = result[tab.id];

for (var i = 0; i < feeds.length; ++i) {

var feedURL = feeds[i].href;
var feedTitle = feeds[i].title;
var encodedFeedURL = encodeURIComponent(feedURL);
var galleryPath = "/podcast/gallery.html?feed=" + encodedFeedURL;

var _item = document.createElement('li');
_list.appendChild(_item);

var _block = document.createElement('a');
_block.href = galleryPath;
_item.appendChild(_block);

var _h1 = document.createElement('h1');
_h1.appendChild(document.createTextNode(feedTitle));
_block.appendChild(_h1);

var _url = document.createElement('span');
_url.innerHTML = feedURL;
_block.appendChild(_url);

var _p = document.createElement('p');
_block.appendChild(_p);

var _rssLink = document.createElement('a');
_rssLink.href = feedURL;
_rssLink.innerHTML = 'RSS'
_p.appendChild(_rssLink);

var _podcastLink = document.createElement('a');
_podcastLink.href = galleryPath;
_podcastLink.innerHTML = 'Podcast'
_p.appendChild(_podcastLink);

_block.addEventListener("click", function(e) {
chrome.tabs.create({ url: this.getAttribute('href') });
});

_podcastLink.addEventListener("click", function(e) {
chrome.tabs.create({ url: this.getAttribute('href') });
e.stopPropagation();
});

_rssLink.addEventListener("click", function(e) {
chrome.tabs.create({ url: this.getAttribute('href') });
e.stopPropagation();
});
}
});
});
}

document.addEventListener('DOMContentLoaded', main);
45 changes: 45 additions & 0 deletions podcast/gallery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
html {

}

body {
margin: 0;
border: 0;
padding: 0;
min-width: 100vw;
min-height: 100vh;
}

.overlay {
position: absolute;
/* top: 0; */
/* left: 0; */
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

#spinner {
width: 300px;
height: 300px;
}

header h3:before {
content: 'by ';
}

h4 {
margin: 0;
border: 0;
padding: 0;
}

audio {
margin: 0;
}

li {
margin-top: 10px;
}
34 changes: 34 additions & 0 deletions podcast/gallery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Podcasts</title>
<link href="/podcast/gallery.css" rel="stylesheet" />
<script src="/scripts/jquery-2.1.3.min.js"></script>
<script src="/scripts/spin.min.js"></script>
</head>
<body>
<div class="overlay">
<div id="spinner"></div>
</div>

<header>
<nav>
Speed:
<button data-rate="1">1x</button>
<button data-rate="2">2x</button>
</nav>

<h1></h1>
<h2></h2>
<h3></h3>
</header>
<section>
<ol></ol>
</section>
<footer>
</footer>

<script src="/podcast/gallery.js"></script>
</body>
</html>
Loading

0 comments on commit f8feba8

Please sign in to comment.