Greasy Fork

koc chatv2

tester

当前为 2025-04-26 提交的版本,查看 最新版本

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

Tabs.TabDemo = {
    tabOrder : 8001,
    tabLabel : 'triplej',
    tabColor : 'blue',
    myDiv : null,
    Options : {
        Counter : 0,
    },

    init : function (div){
        var t = Tabs.TabDemo;
        t.myDiv = div;

        if (!Options.TabDemo) {
            Options.TabDemo = t.Options;
        }
        else {
            for (var y in t.Options) {
                if (!Options.TabDemo.hasOwnProperty(y)) {
                    Options.TabDemo[y] = t.Options[y];
                }
            }
        }
    },

    hide : function (){
        var t = Tabs.TabDemo;
    },

    show : function (){
        var t = Tabs.TabDemo;

        var m = 'https://www.abc.net.au/triplej/live/triplej';
        t.myDiv.innerHTML = '<iframe src="' + m + '" style="width:100%; height:500px; border:none;"></iframe>';

        if (ById('pbpdemoreset')) {
            ById('pbpdemoreset').addEventListener('click', t.ResetTimer);
        }
    },

    EverySecond : function () {
        var t = Tabs.TabDemo;

        if (tabManager.currentTab.name == 'triplej' && Options.btWinIsOpen){
            Options.TabDemo.Counter++;
            saveOptions();
            if (ById('pbpdemotime')) {
                ById('pbpdemotime').innerHTML = Options.TabDemo.Counter;
            }
        }
    },

    ResetTimer : function () {
        var t = Tabs.TabDemo;
        Options.TabDemo.Counter = 0;
        saveOptions();
    },
}