TopicPageLinks

Converts the "last" link in the forums into a link to individual pages in the topic (ie. "1 | 2 | 3 | 4" instead of "last")

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==   
// @name            TopicPageLinks
// @namespace       skyboy@kongregate
// @author          skyboy
// @version         1.0.0
// @description     Converts the "last" link in the forums into a link to individual pages in the topic (ie. "1 | 2 | 3 | 4" instead of "last")
// @include         http://www.kongregate.com/forums/*
// @homepage        http://userscripts.org/scripts/show/98515
// ==/UserScript==   
if (/^\/?forums\/\d+[^\/?]*[^\/][\s\S]*/.test(window.location.pathname)) {
setTimeout(function() {
var body = document.body;
body.innerHTML = String(body.innerHTML).gsub(/<small><a href="([^?"]+\?page=)(\d+)">last<\/a><\/small>/i, function(a){
var url = a[1], last = parseInt(a[2], 10), rtn = "<small>";
if (last > 7) {
	rtn += '<a href="'+url+'1">1</a> | <a href="'+url+'2">2</a> | <a href="'+url+'3">3</a> | \u2026 | ';
	last -= 2;
	rtn += '<a href="'+url+last+'">'+last+++'</a> | <a href="'+url+last+'">'+last+++'</a> | <a href="'+url+last+'">'+last+++'</a>';
} else if(last == 7) {
	rtn += '<a href="'+url+'1">1</a> | <a href="'+url+'2">2</a> | <a href="'+url+'3">3</a> | <a href="'+url+'4">4</a> | <a href="'+url+'5">5</a> | <a href="'+url+'6">6</a> | <a href="'+url+'7">7</a>'
} else if(last>1) {
	var i=1;
	while(i!=last) {
		rtn += '<a href="'+url+i+'">'+i+++'</a> | ';
	}
	rtn += '<a href="'+url+i+'">'+i+++'</a>';
}
return rtn + "</small>";
});
}, 1250);
}