Skip to content

Commit

Permalink
Add the dimsycorn when you're in private browsing mode, and release a…
Browse files Browse the repository at this point in the history
…n update.
  • Loading branch information
bwinton committed Feb 12, 2014
1 parent 4428085 commit 99e6e33
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
Binary file added data/dimsycorn-18.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/dimsycorn-32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/dimsycorn-36.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/dimsycorn-48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/dimsycorn-64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 32 additions & 7 deletions lib/button.js
Expand Up @@ -8,24 +8,49 @@

"use strict";

var privateBrowsing = require('sdk/private-browsing');
var tabs = require('sdk/tabs');
var ui = require('sdk/ui');

var whimsIcon = {
'18': './whimsycorn-18.png',
'32': './whimsycorn-32.png',
'36': './whimsycorn-36.png',
'48': './whimsycorn-48.png',
'64': './whimsycorn-64.png'
};

var dimsIcon = {
'18': './dimsycorn-18.png',
'32': './dimsycorn-32.png',
'36': './dimsycorn-36.png',
'48': './dimsycorn-48.png',
'64': './dimsycorn-64.png'
};



exports.load = function () {
let button = ui.ActionButton({
id: 'whimsy-button',
label: 'Whimsy!',
icon: {
'18': './whimsycorn-18.png',
'32': './whimsycorn-32.png',
'36': './whimsycorn-36.png',
'48': './whimsycorn-48.png',
'64': './whimsycorn-64.png'
},
icon: whimsIcon,
onClick: function (button) {
console.log(button.id, button.label);
}
});

// Listen for tab openings.
tabs.on('activate', function (tab) {
if (privateBrowsing.isPrivate(tab)) {
button.icon = dimsIcon;
} else {
button.icon = whimsIcon;
}
});

};


exports.unload = function () {
};
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -79,7 +79,7 @@
"bugs": {},
"amd": {},
"repository": {},
"version": "0.19.0",
"version": "0.21.0",
"contributors": [],
"fullName": "Whimsy Pro",
"id": "jid1-6mUPixNFCjAgkg",
Expand Down

0 comments on commit 99e6e33

Please sign in to comment.