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

Side by Side Diff: button.js

Issue 8483154: Adding ABP core modules to ABP/Opera (Closed)
Patch Set: Created Oct. 11, 2012, 9:35 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 const button = { 1 const button = {
2 update: function(url) { 2 update: function(url) {
3 var url = opera.extension.tabs.getSelected().url; 3 var url = opera.extension.tabs.getSelected().url;
4 if(url) { 4 if(url) {
5 if(whitelist.check(url)) 5 if(whitelist.check(url))
6 buttonElement.icon = '/images/icon18.png'; 6 buttonElement.icon = '/images/icon18.png';
7 else 7 else
8 buttonElement.icon = '/images/icon_green18.png'; 8 buttonElement.icon = '/images/icon_green18.png';
9 } 9 }
10 else 10 else
(...skipping 30 matching lines...) Expand all
41 }; 41 };
42 var properties = { 42 var properties = {
43 disabled: true, 43 disabled: true,
44 icon: '/images/icon18.png', 44 icon: '/images/icon18.png',
45 title: translate.get('ext_name') 45 title: translate.get('ext_name')
46 }; 46 };
47 var buttonElement = opera.contexts.toolbar.createItem(properties); 47 var buttonElement = opera.contexts.toolbar.createItem(properties);
48 buttonElement.addEventListener('click', button.click(), false); 48 buttonElement.addEventListener('click', button.click(), false);
49 49
50 button.display(); 50 button.display();
OLDNEW

Powered by Google App Engine
This is Rietveld