Fixed sort:score Button

Fixed version of the sort:score button

06.10.2022 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        Fixed sort:score Button
// @namespace   Violentmonkey Scripts
// @version     1
// @author      usnkw, hetisnietgay
// @description Fixed version of the sort:score button
// @license MIT
// @match       *://rule34.xxx/*
// ==/UserScript==
// Don't need so many comments, it's clear what we're doing

// Removed on ready/load call since grease/violent/tampermonkey
// scripts are executed on DOMContentLoaded

(() => {
    'use strict';

     // Create our button
    var newButton = document.createElement("Button");
    newButton.innerHTML = "sort:score";
    newButton.style.cursor = "pointer";

    // Better not to use inline events
    newButton.addEventListener('click', (e) => {

        var searchField = document.getElementsByName("tags")[0];

        if (searchField.value.toLowerCase().indexOf("sort:score") == -1) {
            searchField.value += " sort:score"
        }

        e.preventDefault();
    });

    // Search box has class awesomplete, add our button after it
    document.getElementsByClassName("awesomplete")[0].appendChild(newButton);

})();