yalb Unlocker

Enables yalb Premium buttons

目前为 2020-04-15 提交的版本,查看 最新版本

// ==UserScript==
// @name         yalb Unlocker
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Enables yalb Premium buttons
// @author       Djamana
// @match        https://*.yalp.io/chords/*
// @grant        none
// ==/UserScript==
'use strict';

function RestoreButtonIDs() {
    var buttons_locked = $("[title].notify-premium")
    console.log ( buttons_locked.length + " premium buttons found." )

    //newID = buttons_locked.getAttribute("data-alert")
    //newID = newID.match ("(?:unlimited-)(.*)(?:-alert)") [1]
    buttons_locked.removeAttr("data-alert" )
    buttons_locked.removeAttr("data-toggle")
    buttons_locked.removeAttr("data-target")
    buttons_locked.removeClass("notify-premium")

    var newID_Translator = {
        "Transpose up"   : "transpose-plus" ,
        "Transpose down" : "transpose-minus" ,
        "Print pdf"       : ".print-grid" ,
        "Loop song"       : "loop" ,
        "Start tuner"     : "download-midi"
    }

    var newID = buttons_locked.attr("aria-label")

    buttons_locked.each( function() {
        try {
            var button_label = $( this )[0]["aria-label"];
            newID = newID_Translator[ button_label ]
            this.id = newID

            console.log ( " " + newID + " " + button_label )

        } catch (exception) {
            console.warn('initialize.exception', exception);
        }
    });
}

(function() {
    debugger
    $("#beats_chords_container").height(1280)

    RestoreButtonIDs()

    //$(document).ready()
    //buttons_locked.attr( "id" , newID_Translator[ newID ] )
    // Your code here...
//$("#expand").click(function() {
//}


})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址