Created
December 20, 2009 17:55
-
-
Save banyan/260575 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 Tumblr Dashboard Expand Embed | |
// @namespace http://d.hatena.ne.jp/bannyan/ | |
// @description From the beginning to show Embed | |
// @include http://www.tumblr.com/dashboard/* | |
// ==/UserScript== | |
(function(unsafeWindow){ | |
var expandEmbed = function(node) { | |
var divs = document.evaluate( | |
'.//div[@class="dashboard_watch_link"]', | |
node, | |
null, | |
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, | |
null | |
); | |
for (var i = 0; i < divs.snapshotLength; i++) { | |
var id = divs.snapshotItem(i).id.split('_').pop(); | |
Element.hide('watch_link_' + id); | |
Element.show('watch_video_' + id); | |
} | |
} | |
expandEmbed(document); | |
document.body.addEventListener('AutoPagerize_DOMNodeInserted',function(evt){ | |
var node = evt.target; | |
expandEmbed(node); | |
}, false); | |
})(this.unsafeWindow || window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment