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: Rebased Created Nov. 19, 2013, 1:43 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
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 },
90 89
91 // toolbar items in safari can"t get hidden 90 // Safari does not provide these functionalities
92 hide: function() {}, 91 hide: function() {},
93 show: function() {} 92 show: function() {},
93 setBadgeBackgroundColor: function(color) {},
94 setBadgeText: function(text) {}
Sebastian Noack 2013/11/19 15:27:54 It turned out that Safari actually can show a badg
Thomas Greiner 2013/11/26 17:50:51 Done.
94 } 95 }
95 }; 96 };
96 97
97 TabMap = function() 98 TabMap = function()
98 { 99 {
99 this._tabs = []; 100 this._tabs = [];
100 this._values = []; 101 this._values = [];
101 102
102 this._onClosed = this._onClosed.bind(this); 103 this._onClosed = this._onClosed.bind(this);
103 }; 104 };
(...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 527 // 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 528 // force the same behavior in Safari, we are going to reload the page of the
528 // bubble everytime it is shown. 529 // bubble everytime it is shown.
529 if (safari.extension.globalPage.contentWindow != window) 530 if (safari.extension.globalPage.contentWindow != window)
530 safari.application.addEventListener("popover", function() 531 safari.application.addEventListener("popover", function()
531 { 532 {
532 document.documentElement.style.display = "none"; 533 document.documentElement.style.display = "none";
533 document.location.reload(); 534 document.location.reload();
534 }, true); 535 }, true);
535 })(); 536 })();
OLDNEW
« popup.js ('K') | « popup.js ('k') | skin/background-main-hover.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld