Skip to content

Commit

Permalink
I think I prefer the name "thumb" to "icon".
Browse files Browse the repository at this point in the history
(Yeah, I know I called it newtabicons…)

Also, change the capitalization, and fix the missing image.
  • Loading branch information
bwinton committed Mar 2, 2013
1 parent 5d3b6d1 commit afd78b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/newtabicons-content.js
Expand Up @@ -14,7 +14,7 @@ for (let i = 0; i < thumbnails.length; ++i) {
let newPreview = 'url("' + self.options.thumbs[i] + '")';
let oldPreview = thumb.style.backgroundImage;

thumb.setAttribute('data-iconurl', self.options.thumbs[i]);
thumb.setAttribute('data-thumburl', self.options.thumbs[i]);
if (self.options.showAlways) {
thumb.style.backgroundImage = newPreview;
} else {
Expand Down
11 changes: 6 additions & 5 deletions lib/newtabicons.js
Expand Up @@ -22,7 +22,7 @@ var tabs = require('tabs');
var winutils = require('window/utils');

var running = false;
var menuitem; // Context menu item to copy icon URL.
var menuitem; // Context menu item to copy thumbnail URL.

etherpad.setDefaults([
'http://25.media.tumblr.com/tumblr_ma7rqzY6zQ1qis5xyo1_400.gif'
Expand Down Expand Up @@ -56,18 +56,19 @@ var run = function () {
tabOpen();

menuitem = cm.Item({
label: 'Copy icon URL',
label: 'Copy Thumbnail URL',
context: [
cm.URLContext('about:newtab'),
cm.SelectorContext('.newtab-thumbnail')
],
contentScript: 'self.on("click", function(node, data) {' +
' self.postMessage(node.getAttribute("data-iconurl"));' +
' self.postMessage(node.getAttribute("data-thumburl"));' +
'});',
onMessage: function(iconUrl) {
clipboard.set(iconUrl);
onMessage: function (thumbUrl) {
clipboard.set(thumbUrl);
}
});
menuitem.image = null;
};

var stop = function () {
Expand Down

0 comments on commit afd78b2

Please sign in to comment.