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

Side by Side Diff: safari/background.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Patch Set: Created Dec. 11, 2013, 1:08 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « popup.js ('k') | skin/popup.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }, 70 },
71 close: function() 71 close: function()
72 { 72 {
73 this._tab.close(); 73 this._tab.close();
74 }, 74 },
75 activate: function() 75 activate: function()
76 { 76 {
77 this._tab.activate(); 77 this._tab.activate();
78 }, 78 },
79 sendMessage: sendMessage, 79 sendMessage: sendMessage,
80 pageAction: { 80 browserAction: {
81 // there are no page actions in safari, so we use toolbar items instead
82 setIcon: function(path) 81 setIcon: function(path)
83 { 82 {
84 safari.extension.toolbarItems[0].image = safari.extension.baseURI + path ; 83 safari.extension.toolbarItems[0].image = safari.extension.baseURI + path ;
85 }, 84 },
86 setTitle: function(title) 85 setTitle: function(title)
87 { 86 {
88 safari.extension.toolbarItems[0].toolTip = title; 87 safari.extension.toolbarItems[0].toolTip = title;
89 }, 88 },
89 setBadgeNumber: function(number)
90 {
91 safari.extension.toolbarItems[0].badge = (number === null) ? 0 : number;
92 },
90 93
91 // toolbar items in safari can"t get hidden 94 // The following features aren't supported by Safari
92 hide: function() {}, 95 hide: function() {},
93 show: function() {} 96 show: function() {},
97 setBadgeBackgroundColor: function(color) {}
94 } 98 }
95 }; 99 };
96 100
97 TabMap = function() 101 TabMap = function()
98 { 102 {
99 this._tabs = []; 103 this._tabs = [];
100 this._values = []; 104 this._values = [];
101 105
102 this._onClosed = this._onClosed.bind(this); 106 this._onClosed = this._onClosed.bind(this);
103 }; 107 };
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 // clicked. While Chrome loads it everytime you click the icon. So in order to 530 // clicked. While Chrome loads it everytime you click the icon. So in order to
527 // force the same behavior in Safari, we are going to reload the page of the 531 // force the same behavior in Safari, we are going to reload the page of the
528 // bubble everytime it is shown. 532 // bubble everytime it is shown.
529 if (safari.extension.globalPage.contentWindow != window) 533 if (safari.extension.globalPage.contentWindow != window)
530 safari.application.addEventListener("popover", function() 534 safari.application.addEventListener("popover", function()
531 { 535 {
532 document.documentElement.style.display = "none"; 536 document.documentElement.style.display = "none";
533 document.location.reload(); 537 document.location.reload();
534 }, true); 538 }, true);
535 })(); 539 })();
OLDNEW
« no previous file with comments | « popup.js ('k') | skin/popup.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld