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

Delta Between Two Patch Sets: safari/background.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Left Patch Set: Created Dec. 10, 2013, 10:05 a.m.
Right Patch Set: Merged setBadgeNumber and setBadgeBackgroundColor Created Dec. 13, 2013, 10:36 a.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
LEFTRIGHT
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
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
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 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld