GMM MMPage show marketline

顯示MMPage的marketline id

As of 15.05.2019. See апошняя версія.

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         GMM MMPage show marketline
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  顯示MMPage的marketline id
// @author       You
// @include       *://localhost:8899/MarketManagement/*
// @include       *://gmmweb.avabet.com/MarketManagement/*
// @include       *://adcontrol.sb.com/MarketManagement/*
// @grant        none
// @run-at        document-end
// ==/UserScript==

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

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

        var enable = $(".showMlId").length == 0;
        
        //將marketline id加到html中
        if(enable === "True"){
            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>");
            });
        }else{
            $(".showMlId").remove();
        }

    });
})();