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

Unified Diff: button.js

Issue 8560083: adblockplusopera: Port UI code from Chrome (Closed)
Patch Set: Created Oct. 19, 2012, 4:04 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 | « background.js ('k') | config.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: button.js
===================================================================
deleted file mode 100644
--- a/button.js
+++ /dev/null
@@ -1,50 +0,0 @@
-const button = {
- update: function(url) {
- var url = opera.extension.tabs.getSelected().url;
- if(url) {
- if(whitelist.check(url))
- buttonElement.icon = '/images/icon18.png';
- else
- buttonElement.icon = '/images/icon_green18.png';
- }
- else
- buttonElement.icon = '/images/icon_yellow18.png';
- },
- click: function() {
- this.update();
- },
- enable: function() {
- preferences.bool('button', true);
- this.display();
- },
- disable: function() {
- preferences.bool('button', false);
- opera.contexts.toolbar.removeItem(buttonElement);
-
- opera.extension.windows.removeEventListener('focus', button.update, false);
- opera.extension.tabs.removeEventListener('focus', button.update, false);
- window.clearInterval(button.update, 1000);
- },
- status: function() {
- return preferences.bool('button');
- },
- display: function() {
- if(this.status()) {
- this.update();
- opera.contexts.toolbar.addItem(buttonElement);
-
- opera.extension.windows.addEventListener('focus', button.update, false);
- opera.extension.tabs.addEventListener('focus', button.update, false);
- window.setInterval(button.update, 1000);
- }
- }
-};
-var properties = {
- disabled: true,
- icon: '/images/icon18.png',
- title: translate.get('ext_name')
-};
-var buttonElement = opera.contexts.toolbar.createItem(properties);
-buttonElement.addEventListener('click', button.click(), false);
-
-button.display();
« no previous file with comments | « background.js ('k') | config.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld