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

Delta Between Two Patch Sets: options.js

Issue 8560083: adblockplusopera: Port UI code from Chrome (Closed)
Left Patch Set: Created Oct. 12, 2012, 1:11 p.m.
Right Patch Set: Created Oct. 19, 2012, 4:04 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « options.html ('k') | options/about.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 var backgroundPage = opera.extension.bgProcess; 1 var backgroundPage = opera.extension.bgProcess;
2 var imports = ["FilterStorage", "FilterNotifier", "Subscription", "SpecialSubscr iption", 2 var imports = ["FilterStorage", "FilterNotifier", "Subscription", "SpecialSubscr iption",
3 "DownloadableSubscription", "Filter", "WhitelistFilter", 3 "DownloadableSubscription", "Filter", "WhitelistFilter",
4 "Synchronizer", "Prefs", "Utils", "require"]; 4 "Synchronizer", "Prefs", "Utils", "require"];
5 for (var i = 0; i < imports.length; i++) 5 for (var i = 0; i < imports.length; i++)
6 window[imports[i]] = backgroundPage[imports[i]]; 6 window[imports[i]] = backgroundPage[imports[i]];
7 7
8 // Loads options from localStorage and sets UI elements accordingly 8 // Loads options from localStorage and sets UI elements accordingly
9 function loadOptions() 9 function loadOptions()
10 { 10 {
(...skipping 21 matching lines...) Expand all
32 32
33 // Display jQuery UI elements 33 // Display jQuery UI elements
34 $("#tabs").tabs(); 34 $("#tabs").tabs();
35 $("button").button(); 35 $("button").button();
36 $(".refreshButton").button("option", "icons", {primary: "ui-icon-refresh"}); 36 $(".refreshButton").button("option", "icons", {primary: "ui-icon-refresh"});
37 $(".addButton").button("option", "icons", {primary: "ui-icon-plus"}); 37 $(".addButton").button("option", "icons", {primary: "ui-icon-plus"});
38 $(".removeButton").button("option", "icons", {primary: "ui-icon-minus"}); 38 $(".removeButton").button("option", "icons", {primary: "ui-icon-minus"});
39 39
40 // Popuplate option checkboxes 40 // Popuplate option checkboxes
41 initCheckbox("shouldShowIcon"); 41 initCheckbox("shouldShowIcon");
42 initCheckbox("shouldShowBlockElementMenu"); 42 $("#shouldShowIcon").click(backgroundPage.refreshToolbarButton);
43 initCheckbox("disableInlineTextAds");
44 initCheckbox("hidePlaceholders");
45 43
46 // Load recommended subscriptions 44 // Load recommended subscriptions
47 loadRecommendations(); 45 loadRecommendations();
48 46
49 // Show user's filters 47 // Show user's filters
50 reloadFilters(); 48 reloadFilters();
51 } 49 }
52 $(loadOptions); 50 $(loadOptions);
53 51
54 // Reloads the displayed subscriptions and filters 52 // Reloads the displayed subscriptions and filters
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if (subscription.disabled == !enabled.checked) 575 if (subscription.disabled == !enabled.checked)
578 return; 576 return;
579 577
580 subscription.disabled = !enabled.checked; 578 subscription.disabled = !enabled.checked;
581 }, false); 579 }, false);
582 580
583 updateSubscriptionInfo(element); 581 updateSubscriptionInfo(element);
584 582
585 document.getElementById("filterLists").appendChild(element); 583 document.getElementById("filterLists").appendChild(element);
586 } 584 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld