Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

I think I prefer the name "thumb" to "icon".

(Yeah, I know I called it newtabicons…)

Also, change the capitalization, and fix the missing image.
  • Loading branch information...
commit afd78b2d82304d102bef03f05bd3b50eed1096de 1 parent 5d3b6d1
@bwinton authored
Showing with 7 additions and 6 deletions.
  1. +1 −1  data/newtabicons-content.js
  2. +6 −5 lib/newtabicons.js
View
2  data/newtabicons-content.js
@@ -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 {
View
11 lib/newtabicons.js
@@ -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'
@@ -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 () {
Please sign in to comment.
Something went wrong with that request. Please try again.