Simplify QuickStatements Import Buttons

Simplify the import buttons of QuickStatements into one button

目前為 2022-03-17 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Simplify QuickStatements Import Buttons
// @namespace    https://gf.qytechs.cn/users/21515
// @version      0.1.3
// @description  Simplify the import buttons of QuickStatements into one button
// @author       CennoxX
// @contact      [email protected]
// @homepage     https://github.com/CennoxX/userscripts
// @supportURL   https://github.com/CennoxX/userscripts/issues/new?title=[Simplify%20QuickStatements%20Import%20Buttons]%20
// @match        https://quickstatements.toolforge.org/*
// @icon         https://quickstatements.toolforge.org/favicon.ico
// @grant        unsafeWindow
// @run-at       document-start
// @license      MIT
// ==/UserScript==
/* jshint esversion: 8 */
/* eslint curly: "off" */
var buttonClicks = 0;
setInterval(()=>{
    var button_v1 = document.querySelector(".btn[tt=dialog_import_v1]");
    var button_csv = document.querySelector(".btn[tt=dialog_import_csv]");
    var button_all = document.querySelector("button:nth-child(3)");
    if (button_v1 && button_csv && !button_all){
        button_all = button_v1.cloneNode();
        button_all.attributes.removeNamedItem("tt");
        button_all.innerHTML = "Anweisungen importieren";
        button_all.onmousedown = function(){
            button_csv.click();
            button_v1.click();
        };
        button_v1.parentNode.append(button_all);
        button_v1.style.display = "none";
        button_csv.style.display = "none";
        unsafeWindow.alert = function (str) {
            if (str == "No valid commands found"){
                buttonClicks++;
                if (buttonClicks % 2 == 0){
                    alert("No valid commands found");
                }
            }
        };
    }
},100);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址