| OLD | NEW |
| 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 Loading... |
| 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(); |
| OLD | NEW |