Simplify QuickStatements Import Buttons

Simplify the import buttons of QuickStatements into one button

As of 2021-10-27. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Simplify QuickStatements Import Buttons
// @namespace    https://greasyfork.org/users/21515
// @version      0.1.0
// @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://www.google.com/s2/favicons?sz=64&domain=quickstatements.toolforge.org
// @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]");
    button_v1.innerText = button_v1.innerText.replace("V1 ","");
    var button_csv = document.querySelector(".btn[tt=dialog_import_csv]");
    if (button_v1 && button_csv && button_v1.onmousedown==null){
        button_v1.onmousedown = function(){
            if (buttonClicks == 0){
                button_csv.click();
            }
        };
        button_csv.style.display="none";
        unsafeWindow.alert = function (str) {
            if (str == "No valid commands found"){
                buttonClicks++;
                if (buttonClicks == 2){
                    alert("No valid commands found");
                }
            }
        };
    }else{
        buttonClicks = 0;
    }
},50);