GMM MMPage show marketline

顯示MMPage的marketline id

当前为 2019-08-27 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GMM MMPage show marketline
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  顯示MMPage的marketline id
// @author       You
// @include       *://localhost:8899/MarketManagement/*
// @include       *://gmmweb.avabet.com/MarketManagement/*
// @include       *://adcontrol.sb.com/MarketManagement/*
// @include       *://gmm.188access.com/MarketManagement/Default.aspx
// @include       *://gmm*.gmm88.com/*
// @grant        none
// @run-at        document-end
// ==/UserScript==

(function() {
    $('.search-panel >ul,#top-panel > div > ul').prepend('<li><input type="button" id="ShowAllMarketLine" value="ML ID" class="btn_release" ></li>');

    //幫prod的background加上紅色
    var url = document.location.toString();
    if(window.location.href.indexOf("gmm88")>-1){
        $("#ContainerDiv").css("background-color","red");
    }

     //Selection button點擊事件
    var ClickSelectionBtn = function (){
        $("#slidDisplay").remove();
        $(this).parent().append("<div id='slidDisplay'>"+$(this).attr("SlId")+"</div>");
    }

    $( "#ShowAllMarketLine" ).click(function() {

        var enable = $(".showMlId").length == 0;
        
        
        if(enable){
            //將marketline id加到html中
            var pauseDiv = $(".pause").filter(function() {
                return $(this).attr("actionsrc") === "MarketLineStatusControl.js" ;
            });
            pauseDiv.each(function(i, obj) {
                $(this).parent().prepend("<span class='showMlId' style = 'background:#c9e1f6'>"+$(obj).attr("id").match(/\d+/)[0]+"</span>");
            });

            //將selection id加到html中
            var oddsdiv = $("tr:not([isalgorow])").find(".odds,.oddsnonlink").each(function(i, obj) {
                $(this).prepend("<span class='showSlId' style = 'background:#fe98b0' SlId='"+$(obj).attr("id").match(/\d+/)[0]+"'>S</span>");
            });

            var items = document.getElementsByClassName ("showSlId")
            for (var i = 0; i < items.length; i++) {
                items[i].addEventListener ("click", ClickSelectionBtn, false);
            }
        }else{
            $(".showMlId,.showSlId,#slidDisplay").remove();
        }

    });





})();