Rule34 Quick Buttons

Just a few buttons that a useful

目前為 2025-01-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Rule34 Quick Buttons
// @namespace   miep
// @include     *://rule34.xxx/*
// @grant       none
// @version     Final
// @author      jAstn
// @description Just a few buttons that a useful
// @require     https://code.jquery.com/jquery-3.5.1.min.js
// @icon        https://i.imgur.com/m2kIFiy.png
// @license MIT
// ==/UserScript==

// this function get exicuted when the document is ready so all the elements on the page are loaded and we can access everything we need for the scipt
// first and only thing i just form the jquery libary but it has so many more things that are just nice to have (that we install with the  @require     https://code.jquery.com/jquery-3.5.1.min.js line)
// libary = is basical a colection of code that you can use if you import the libary into the program
$("document").ready(function() {
  var searchField = document.getElementsByName("tags")[0];
  var searchButton = document.getElementsByName("tag-search")[0];

function createButton(text, innerHTML) {
  var button = document.createElement("button");
  button.innerHTML = innerHTML;
  button.style.cursor = "pointer";
  button.style.margin = "2px";
  button.onclick = function() {
    // Appending the text to the searchField value
    searchField.value += " " + text;

    // Triggering click event on the searchButton
    searchButton.click();
  };
  return button;
}

// If you want to create a button just remove the // from the last line and copy the new buttons name down in tagSearchContainer
var sortScoreButton = createButton("sort:score", "Sort by Score");
var animatedButton = createButton("-animated -video", "No Animation");
var sortIDButton = createButton("sort:id:desc", "Sort by ID");
var sortScoreanimatedButton = createButton("sort:score -animated -video height:>1000", "Combined");
var HeightButton = createButton("height:>1000", "Height");
// var NAMEButton = createButton ("TAG THAT YOU WANT TO SEARCH", "TEXT ON THE BUTTON");

// Appending the buttons to the container div
var tagSearchContainer = document.getElementsByClassName("tag-search")[0];
tagSearchContainer.appendChild(sortScoreanimatedButton);
tagSearchContainer.appendChild(sortScoreButton);
tagSearchContainer.appendChild(animatedButton);
tagSearchContainer.appendChild(sortIDButton);
tagSearchContainer.appendChild(HeightButton);
// tagSearchContainer.appendChild(NAMEButton);
});