Pastebin Improved

Some improvements to Pastebin.com, colored buttons etc.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Pastebin Improved
// @namespace    https://greatest.deepsurf.us/users/166103
// @version      0.41
// @description  Some improvements to Pastebin.com, colored buttons etc.
// @author       https://github.com/Amarok24
// @match        https://pastebin.com/*
// @grant        none
// ==/UserScript==

(function() {

"use strict";


var pbButtons = document.querySelectorAll(".buttonsm");
var nightModeAdvert = document.getElementById("pro_promo_text");

if (pbButtons) {

    var setButtonStyle = function(innerText, styleNameAndProperty) {
        var indexOfButton = null;

        for (let i = 0; i < pbButtons.length; i++) {
            if (pbButtons[i].innerText == innerText) {
                indexOfButton = i;
                break;
            }
        }

        if (indexOfButton !== null) {
            console.log("button found, index = " + indexOfButton);

            for (let z=0; z<styleNameAndProperty.length; z++) {
                for (let j in styleNameAndProperty[z]) {
                    //console.log(j);
                    //console.log(styleNameAndProperty[z][j]);
                    pbButtons[indexOfButton].style[j] = styleNameAndProperty[z][j];
                }
            }

        }
    };

    setButtonStyle("edit", [ {"backgroundColor" : "coral"}, {"fontWeight" : "700"}, {"color" : "white"} ] );
    setButtonStyle("raw", [ {"backgroundColor" : "darkgreen"}, {"color" : "white"} ] );
}

if (nightModeAdvert && nightModeAdvert.innerText.indexOf("Night")) {
    document.getElementById("float-box-frame").style.display = "none";
}

})();