JSFiddle - React, Tailwind, and code Playground

by brianjmiller

HTML

<div id="someDiv">Some Text</div>

JavaScript

YUI.add("dev-tools-plugin", function(Y) {
    var originalPlug = Y.Plugin.Host.prototype.plug;
    Y.log(originalPlug);
    
    Y.Plugin.Host.prototype.plug = function(Plugin, config) {
        Y.log("Plugin: " + Plugin);
        if (typeof Plugin === "undefined") {
            alert("Tried to plug an invalid plugin: " + this);
        }
        else {
            originalPlug.apply(this, arguments);
        }
    };
}, "@VERSION@", {
    requires: [ "pluginhost-base" ]
});

YUI().use("dev-tools-plugin", "node-pluginhost", "button-plugin", function(Y) {
    Y.log("running DoesNotExist");
    Y.one("#someDiv").plug(Y.DoesNotExist);
    
    Y.log("running Button");
    Y.one("#someDiv").plug(Y.Plugin.Button);
    
});