FSD Button

Adds auto select button for FSD work order.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         FSD Button
// @namespace    https://almedawaterwell.com/
// @version      1.3
// @description  Adds auto select button for FSD work order.
// @author       Luke Pyburn
// @match        https://reveal.us.fleetmatics.com/fsd/*
// @match        https://reveal.fleetmatics.com/fsd/*
// @grant        GM_addStyle
// @grant        GM_setClipboard
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

/*--- Create the FSD auto select button in a container div.  It will be styled and
    positioned with CSS.
*/
var multipleTransfersGlobal;
var zNode = document.createElement ('div');
zNode.innerHTML = '<button id="myButton" type="button">'
                + 'Select Job Details</button>'
                ;
zNode.setAttribute ('id', 'myContainer');
document.body.appendChild (zNode);

//--- Activate the newly added button.
document.getElementById ("myButton").addEventListener (
    "click", ButtonClickAction, false
);

function ButtonClickAction (zEvent) {
    window.getSelection().selectAllChildren(
    document.getElementById("side-panel")
);
    multipleTransfersGlobal = document.getElementById("description").value;
    console.log(multipleTransfersGlobal);
    GM_setClipboard(multipleTransfersGlobal);
};


//--- Style our newly added elements using CSS.
GM_addStyle ( `
    #myContainer {
        position:               absolute;
        top:                    15px;
        right:                  200px;
        font-size:              20px;
        background:             #E30000;
        border:                 2px outset black;
        margin:                 0px;
        opacity:                0.85;
        z-index:                1100;
        padding:                5px 20px;
        border-radius:          10px;
    }
    #myButton {
        cursor:                 pointer;
        border-radius:          4px;
        align-content:             center;
    }
    #myContainer p {
        color:                  red;
        background:             white;
        align-content:             center;
    }
` );