Created
December 27, 2008 15:58
-
-
Save arikui/40268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 4gamerViewer | |
// @namespace http://d.hatena.ne.jp/arikui/ | |
// @description http://userscripts.org/scripts/show/39290 | |
// @include http://www.4gamer.net/ | |
// @require http://gist.github.com/raw/3242/9dc0cdee5e975d275c7ab71f581d272eb316674f | |
// ==/UserScript== | |
(function(){ | |
var thumbnail = document.createElement("div"); | |
var newsDay1 = document.getElementById("NEWS_SELECT_DAY_1"); | |
Array.slice.call([], document.getElementsByClassName("img_right_top")).forEach(function(image){ | |
thumbnail.appendChild(image.parentNode.cloneNode(true)); | |
}); | |
thumbnail.style.display = "none"; | |
newsDay1.parentNode.insertBefore(thumbnail, newsDay1); | |
$X("//div[@class='finding_common']/ul")[0].appendChild((function(){ | |
var li = document.createElement("li"); | |
var label = document.createElement("label"); | |
var input = document.createElement("input"); | |
input.type = "checkbox"; | |
li.appendChild(label); | |
label.appendChild(input); | |
label.appendChild(document.createTextNode("Thumbnail")); | |
input.addEventListener("click", function(){ | |
thumbnail.style.display = this.checked ? "block" : "none"; | |
}, false); | |
return li; | |
})()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment