Greasy Fork

Greasy Fork is available in English.

GOTA_Extender_Constants

Constants definition.

当前为 2014-10-02 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/5427/19766/GOTA_Extender_Constants.js

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

var templates = {

    menuBtn:
        '<a id="extender-menu" class="navlink" data-menu="manager">' +
            '<span class="navlinkbox">' +
                '<span class="navlinkicon"></span>' +
                '<span class="vertcenter">' +
                    '<span>Extender</span>' +
                '</span>' +
            '</span>' +
        '</a>',

    queueBtn:
        '<span class="btnwrap btnmed equipbtn queue" data-quantity="1">' +
            '<span class="btnedge">' +
                '<a class="btngold">Queue</a>' +
            '</span>' +
        '</span>',

    queue5Btn:
        '<span class="btnwrap btnmed equipbtn queue" data-quantity="5">' +
            '<span class="btnedge">' +
                '<a class="btngold">Queue x5</a>' +
            '</span>' +
        '</span>',

    queueUpgradeBtn:
        '<h5>Actions:</h5>' +
        '<div class="upgradeinfo">' +
            '<span id="upgradeQueue" class="btnwrap btnmed btnprice upgradeQueue">' +
                '<span class="btnedge">' +
                    '<a class="btngold">Enqueue upgrade</a>' +
                '</span>' +
            '</span>' +
        '</div>',

    saveOptionsBtn:
        '<span id="saveOptions" class="btnwrap btnlg">' +
            '<span class="btnedge">' +
                '<a class="btngold">Save</a>' +
            '</span>' +
        '</span>',

    resetOptionsBtn:
        '<span id="resetOptions" class="btnwrap btnlg">' +
            '<span class="btnedge">' +
                '<a class="btngold">Reset</a>' +
            '</span>' +
        '</span>',

    tableRow: function(i, el) {
        return '<tr class="tableRow" style="cursor: pointer">' +
            '<td><span class="ranklist colsort">' + i + '</span></td>' +
            '<td><span class="ranklist colsort">' + el.type + '</span></td>' +
            '<td><span class="name colsort">' + el.activeBuildingPanel + '</span></td>' +
            '<td><span class="name colsort">' + el.name + '</span></td>' +
            '<td><span class="avatarimg"><img src="' + el.img + '"></span></td>' +
            '</tr>';
    },

    options: function(o) {
        return '<h1 style="font-family:GoudyTrajan-Bold,Trajan,\'Trajan Pro\',Trajanbold;">Extender options</h1><hr />' +
            '<a style="color:white;padding-right:4px;padding-left:32px!important;" href="#" id="toggleUserAlerts" class="extender-option checkbox ' + (o.userAlert ? 'checked' : '') + '">Show user alerts</a>' +
            '<a style="color:white;padding-right:4px;padding-left:32px!important;" href="#" id="toggledebugModes" class="extender-option checkbox ' + (o.debugMode ? 'checked' : '') + '">Debug mode</a>' +
            '<a style="color:white;padding-right:4px;padding-left:32px!important;" href="#" id="toggleAutoCollect" class="extender-option checkbox ' + (o.autoCollect ? 'checked' : '') + '">Enable auto-collecting</a>' +
            '<a style="color:white;padding-right:4px;padding-left:32px!important;" href="#" id="toggleSuperiorMaterials" class="extender-option checkbox ' + (o.superiorMaterials ? 'checked' : '') + '">Use superior materials</a>' +
            '<br />' +
            '<label for="autoCollectInteval">Collect in (minutes): </label>' +
            '<input type="number" maxlength="3" style="width:38px" id="autoCollectInterval" value="' + o.autoCollectInterval + '">' +
            '<button type="button" onclick="finishAll()">Finish All Buildings</button>' +
            '<br />' +
            '<label for="queueDelay"> Queue: Delay= </label>' +
            '<input type="number" maxlength="2" style="width:38px" id="queueDelay" value="' + o.queueDelay + '">' +
            '<label for="queueTimerInterval"> Interval = </label>' +
            '<input type="number" maxlength="3" style="width:38px" id="queueTimerInterval" value="' + o.queueTimerInterval + '"> (0 = disabled)' +
            '<div style="overflow-y: scroll; height: 426px;">' +
            '<table id="queueTable" class="powertable">' +
            '<tbody>' +
            '<tr id="headerRow">' +
            '<th id="col4"><span class="colsort">QueueID</span></th>' +
            '<th id="col1"><span class="colsort">Type</span></th>' +
            '<th id="col1"><span class="colsort">Building</span></th>' +
            '<th id="col2"><span class="colsort">Name</span></th>' +
            '<th id="col3"><span class="colsort">Icon</span></th>' +
            '</tr>' +
            '</tbody>' +
            '</table>' +
            '</div>';
    },
}

var styles = {
    resetOptions:
        '#resetOptions { ' +
            'bottom: 15px; ' +
            'left: 66%; ' +
            'margin-left: -40px; ' +
            'padding: 0; ' +
            'position: absolute; ' +
            'width: 80px; ' +
        '}',

    saveOptions:
        '#saveOptions {' +
            'bottom: 15px;' +
            'left: 34%;' +
            'margin-left: -40px; ' +
            'padding: 0; ' +
            'position: absolute; ' +
            'width: 80px; ' +
        '}',

    extenderMenu:
        '#extender-menu .navlinkicon {' +
            'background-image: url("http://disruptorbeamcdn-01.insnw.net/images/icons/newnav-menu.png?t=386c1688da2a"); ' +
        '}',

    addGlobalStyle: function(css) {
        try {

            var elmHead, elmStyle;
            elmHead = document.getElementsByTagName('head')[0];
            elmStyle = document.createElement('style');
            elmStyle.type = 'text/css';
            elmHead.appendChild(elmStyle);
            elmStyle.innerHTML = css;

        } catch (e) {
            if (!document.styleSheets.length)
                document.createStyleSheet();
            
            document.styleSheets[0].cssText += css;
        }
    },

    addAllStyles: function() {
        for (var style in this) {
            if (this.hasOwnProperty(style) && typeof this[style] == "string") {
                this.addGlobalStyle(this[style]);
            }
        }
    }
}