Enables yalb Premium buttons
当前为
// ==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() {
//}
})();