Derpibooru - Sort by Score & No Scope

Adds a button to automatically sort by score after a search. Also, remove pointless scope stuff from URLs.

Verze ze dne 28. 05. 2015. Zobrazit nejnovější verzi.

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        Derpibooru - Sort by Score & No Scope
// @namespace   Selbi
// @include     http*://*derpiboo.ru/*
// @include     http*://*derpibooru.org/*
// @version     1.3
// @description Adds a button to automatically sort by score after a search. Also, remove pointless scope stuff from URLs.
// ==/UserScript==


// Make sure the script gets excecuted only once
	if (window.top != window.self) return;


// Display Sort-by-Score button next to search prompt
	$(".searchbox > form > a:eq(1)").after('<a title="Search and sort by score" id="sortbyscore">' + '<i class="fa fa-sort-amount-desc"></i>' + '</a>');

	$("#sortbyscore").click(function(){
		var tags = document.getElementById("sbq").value;
		var newurl = "/search?utf8=%E2%9C%93&sbq=" + tags + "&sf=score&sd=desc";
		window.location.href = newurl;
	});


// Remove "Scope" crap from URLs
	var allA = document.getElementsByTagName("a");
	for (var i=0; i<allA.length; i++) {
		if (allA[i].href != "") {
			allA[i].href = allA[i].href.replace(/(&|\?)?scope=scpe\w+/g, "");
		}
	}