Forked from nobodyplace/tumblr_queue_latest_link.user.js
Created
March 31, 2011 07:27
-
-
Save retlet/895959 to your computer and use it in GitHub Desktop.
@include 追加
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 Queue Latest Link Maker | |
// @version 0.0.2 | |
// @namespace http://nplll.com | |
// @description Tumblr Queueの最新ページへのリンクを生成するGreasemonkey | |
// @include http://www.tumblr.com/queue* | |
// @include http://www.tumblr.com/queue?page=* | |
// @include http://www.tumblr.com/dashboard* | |
// @include http://www.tumblr.com/tumblelog/* | |
// ==/UserScript== | |
// 0.0.1 - 2010/10/07 リリース | |
// 0.0.2 - 2010/11/07 リリース | |
(function(){ | |
//二重表示防止 | |
if(document.getElementById('tumblrQueueLatest')) | |
return; | |
//Queueへのリンクを含むli | |
var li = document.getElementsByClassName('dashboard_subpages')[0].getElementsByTagName('li')[4]; | |
//Queue Number | |
var q = li.getElementsByTagName('a')[0].innerHTML.match(/Queue\s+\((\d+)\)/)[1]; | |
if (q) { | |
//最新へのリンク | |
var a = document.createElement('a'); | |
a.setAttribute('href', 'http://www.tumblr.com/queue?page=' + Math.ceil(q / 10)); | |
a.innerHTML = 'Latest'; | |
//liに追加 | |
var u = document.createElement('ul'); | |
u.id = 'tumblrQueueLatest'; | |
var l = document.createElement('li'); | |
l.appendChild(a); | |
u.appendChild(l); | |
li.appendChild(u); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment