iopenjs / Empornium Thumb button

// ==UserScript==
// @name        Empornium Thumb button
// @include     /https?://www\.empornium\.(me|sx)*/
// @version     1.0
// @require     http://code.jquery.com/jquery-2.1.1.js
// ==/UserScript==
//By ilovevr for EMP
// Based on https://openuserjs.org/scripts/node/whatcd_gazelle_torrent_button

// Changelog:
// New Release


this.jQuery = jQuery.noConflict(true);

(function() {

    var code = jQuery('a.bb_button[alt="Code"]');
    var target = code.attr('onclick').match(/'([^']*)'\)$/)[1];
    var torrent = code.clone();
    torrent.attr({
        'onclick': "tag('thumb', '" + target + "')",
        'title': "Thumbnail: [thumb]direct image link[/thumb]",
        'alt': "Thumbnail"
    });
    torrent.text("Thumb");
    code.after(" ", torrent);

})();