Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 16067002: Added Safari Support (Closed)
Patch Set: Created Nov. 9, 2013, 6:45 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « options.html ('k') | popup.html » ('j') | safari/background.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -15,9 +15,6 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-var backgroundPage = chrome.extension.getBackgroundPage();
-var require = backgroundPage.require;
-
with(require("filterClasses"))
{
this.Filter = Filter;
@@ -74,6 +71,8 @@
initCheckbox("shouldShowBlockElementMenu");
initCheckbox("hidePlaceholders");
+ ext.onMessage.addListener(onMessage);
+
// Load recommended subscriptions
loadRecommendations();
@@ -82,6 +81,18 @@
}
$(loadOptions);
+function onMessage(msg)
+{
+ switch (msg.type)
+ {
+ case "add-subscription":
+ startSubscriptionSelection(msg.title, msg.url);
+ break;
+ default:
+ console.log("got unexpected message: " + msg.type);
+ }
+};
+
// Reloads the displayed subscriptions and filters
function reloadFilters()
{
@@ -229,7 +240,7 @@
return;
}
- $('#tabs').tabs('select', 0);
+ $("#tabs").tabs("select", 0);
$("#addSubscriptionContainer").show();
$("#addSubscriptionButton").hide();
$("#subscriptionSelector").focus();
« no previous file with comments | « options.html ('k') | popup.html » ('j') | safari/background.js » ('J')

Powered by Google App Engine
This is Rietveld