Last active
March 30, 2016 09:49
-
-
Save mamemomonga/11439dd4e20ed852ab78 to your computer and use it in GitHub Desktop.
[Firefox+Greasemonkey, Chrome] Tumblr Activityページの「最新メモ」サムネイル画像が大きくなります
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 TumblrActivityThumbnailEnlarger | |
// @description Tumblr Activityページの「最新メモ」サムネイル画像が大きくなります | |
// @namespace https://gist.github.com/mamemomonga/11439dd4e20ed852ab78 | |
// @include http://www.tumblr.com/blog/*/activity | |
// @include https://www.tumblr.com/blog/*/activity | |
// @version 1.01 | |
// @grant none | |
// ==/UserScript== | |
// ■ ダウンロード方法 | |
// 右上の[Raw]をクリックしてダウンロード | |
// ■ インストール方法 | |
// Firefox | |
// 1.Greasemonkey(https://addons.mozilla.org/ja/firefox/addon/greasemonkey/) を入れる | |
// 2.Firefoxを再起動して、TumblrActivityThumbnailEnlarger.user.jsをドロップ | |
// (確認ダイアログがブラウザの裏側に開かれることがあるので注意) | |
// | |
// Chrome | |
// 「ツール」→「機能拡張」を選択し、そこにTumblrActivityThumbnailEnlarger.user.jsをドロップ | |
// ■ 更新履歴 | |
// 1.00 Chrome専用 | |
// 1.01 Greasemonkey対応、サムネイル以外は拡大しない、jqueryからquerySelectorに変更 | |
(function(){ | |
var TumblrActivityThumbnailEnlarger=function(){}; | |
TumblrActivityThumbnailEnlarger.prototype={ | |
start: function() { | |
var t=this; | |
window.addEventListener("DOMSubtreeModified", function(e) { | |
if(e.target.className == 'ui_notes clearfix') { t.cbwait();} | |
}); | |
this.magnify(); | |
}, | |
cbwait: function() { | |
var t=this; | |
if(t.cbwaitid) { return; } | |
t.cbwaitid=setTimeout(function() { | |
t.cbwaitid=undefined; | |
t.magnify(); | |
},1000); | |
}, | |
magnify: function() { | |
var t=this; | |
var nl=document.querySelectorAll('.ui_note'); | |
for( var i=0; i < nl.length; i++) { | |
var icon=nl[i].querySelector('.part_icon > a'); | |
if(icon.style.backgroundImage != '') { | |
icon.style.height='75px'; | |
icon.style.width='75px'; | |
nl[i].style.height='75px'; | |
nl[i].style.width='550px'; | |
nl[i].querySelector('.part_glass').style.width='400px'; | |
nl[i].querySelector('.part_icon').style.top='0px'; | |
} | |
} | |
}, | |
}; | |
new TumblrActivityThumbnailEnlarger().start(); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment