LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 sendMessage: sendMessage, | 79 sendMessage: sendMessage, |
80 browserAction: { | 80 browserAction: { |
81 setIcon: function(path) | 81 setIcon: function(path) |
82 { | 82 { |
83 safari.extension.toolbarItems[0].image = safari.extension.baseURI + path
; | 83 safari.extension.toolbarItems[0].image = safari.extension.baseURI + path
; |
84 }, | 84 }, |
85 setTitle: function(title) | 85 setTitle: function(title) |
86 { | 86 { |
87 safari.extension.toolbarItems[0].toolTip = title; | 87 safari.extension.toolbarItems[0].toolTip = title; |
88 }, | 88 }, |
89 setBadgeNumber: function(number) | 89 setBadge: function(badge) |
90 { | 90 { |
91 safari.extension.toolbarItems[0].badge = (number === null) ? 0 : number; | 91 if (!badge) |
| 92 safari.extension.toolbarItems[0].badge = 0; |
| 93 else if ("number" in badge) |
| 94 safari.extension.toolbarItems[0].badge = badge.number; |
92 }, | 95 }, |
93 | 96 |
94 // The following features aren't supported by Safari | 97 // The following features aren't supported by Safari |
95 hide: function() {}, | 98 hide: function() {}, |
96 show: function() {}, | 99 show: function() {} |
97 setBadgeBackgroundColor: function(color) {} | |
98 } | 100 } |
99 }; | 101 }; |
100 | 102 |
101 TabMap = function() | 103 TabMap = function() |
102 { | 104 { |
103 this._tabs = []; | 105 this._tabs = []; |
104 this._values = []; | 106 this._values = []; |
105 | 107 |
106 this._onClosed = this._onClosed.bind(this); | 108 this._onClosed = this._onClosed.bind(this); |
107 }; | 109 }; |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 // clicked. While Chrome loads it everytime you click the icon. So in order to | 532 // clicked. While Chrome loads it everytime you click the icon. So in order to |
531 // force the same behavior in Safari, we are going to reload the page of the | 533 // force the same behavior in Safari, we are going to reload the page of the |
532 // bubble everytime it is shown. | 534 // bubble everytime it is shown. |
533 if (safari.extension.globalPage.contentWindow != window) | 535 if (safari.extension.globalPage.contentWindow != window) |
534 safari.application.addEventListener("popover", function() | 536 safari.application.addEventListener("popover", function() |
535 { | 537 { |
536 document.documentElement.style.display = "none"; | 538 document.documentElement.style.display = "none"; |
537 document.location.reload(); | 539 document.location.reload(); |
538 }, true); | 540 }, true); |
539 })(); | 541 })(); |
LEFT | RIGHT |