OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function feedLink(url) { | 5 function feedLink(url) { |
6 var feed_link = document.createElement('a'); | 6 var feed_link = document.createElement('a'); |
7 feed_link.href = url; | 7 feed_link.href = url; |
8 feed_link.addEventListener("click", onClick); | 8 feed_link.addEventListener("click", onClick); |
9 return feed_link; | 9 return feed_link; |
10 } | 10 } |
11 | 11 |
12 function main() { | 12 function main() { |
13 chrome.tabs.getSelected(null, function(tab) { | 13 chrome.tabs.getSelected(null, function(tab) { |
14 var feeds = chrome.extension.getBackgroundPage().feedData[tab.id]; | 14 var feeds = JSON.parse(localStorage.getItem(tab.id)); |
not at google - send to devlin
2013/03/28 00:35:05
I don't fully understand what this is for, but we'
| |
15 if (feeds.length == 1) { | 15 if (feeds.length == 1) { |
16 // Only one feed, no need for a bubble; go straight to the subscribe page. | 16 // Only one feed, no need for a bubble; go straight to the subscribe page. |
17 preview(feeds[0].href); | 17 preview(feeds[0].href); |
18 } else { | 18 } else { |
19 var content = document.getElementById('content'); | 19 var content = document.getElementById('content'); |
20 var heading = document.getElementById('heading'); | 20 var heading = document.getElementById('heading'); |
21 heading.innerText = | 21 heading.innerText = |
22 chrome.i18n.getMessage("rss_subscription_action_title"); | 22 chrome.i18n.getMessage("rss_subscription_action_title"); |
23 content.appendChild(document.createElement('br')); | 23 content.appendChild(document.createElement('br')); |
24 | 24 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 } else { | 67 } else { |
68 // Show the preview page. | 68 // Show the preview page. |
69 url = "subscribe.html?" + encodeURIComponent(feed_url); | 69 url = "subscribe.html?" + encodeURIComponent(feed_url); |
70 } | 70 } |
71 chrome.tabs.create({ url: url }); | 71 chrome.tabs.create({ url: url }); |
72 window.close(); | 72 window.close(); |
73 } | 73 } |
74 | 74 |
75 // Init on DOM ready. | 75 // Init on DOM ready. |
76 document.addEventListener('DOMContentLoaded', main); | 76 document.addEventListener('DOMContentLoaded', main); |
OLD | NEW |