baseBuild.html revision 13c4505d6df2d3db68248902959be8c92998d0fc
<html>
<head>
<script type="text/javascript">
(function() {
YUI({base:"/build/", filter:"raw"}).use("base", "plugin", function(Y) {
// ----- Main Class -----
function MainPlugin() {}
MainPlugin.NS = "mainplugin";
MainPlugin.NAME = "mainplugin";
function Main(config) {
Main.superclass.constructor.apply(this, arguments);
}
Main.NAME = "main";
Main.ATTRS = {
mainA : {
value: "mainA"
},
mainB : {
value: "mainB"
}
};
Main.CLASSNAMES = {
main: "yui-main"
};
Main.PLUGINS = [
MainPlugin
];
methodA : function() {
},
methodB : function() {
},
initializer : function() {
Y.log("Main initializer");
}
});
// ----- ExtOne --
function ExtOnePlugin() {}
ExtOnePlugin.NS = "extoneplugin";
ExtOnePlugin.NAME = "extoneplugin";
function ExtOne() {
Y.log("ExtOne initializer");
}
ExtOne.NAME = "extone";
ExtOne.ATTRS = {
extOne : {
value: "extOne"
}
};
extOne : "yui-extone"
};
ExtOne.PLUGINS = [
ExtOnePlugin
];
ExtOne.prototype = {
methodB : function() {
},
methodC : function() {
},
methodD : function() {
}
};
// ----- ExtTwo --
function ExtTwoPlugin() {}
ExtTwoPlugin.NS = "exttwoplugin";
ExtTwoPlugin.NAME = "exttwoplugin";
function ExtTwo() {
Y.log("ExtTwo initializer");
}
ExtTwo.NAME = "exttwo";
ExtTwo.ATTRS = {
extTwo : {
value: "extTwo"
}
};
extTwo : "yui-exttwo"
};
ExtTwo.PLUGINS = [
ExtTwoPlugin
];
ExtTwo.prototype = {
methodB : function() {
},
methodE : function() {
},
methodF : function() {
}
};
var CustMain = Y.Base.build(Main, [ExtOne, ExtTwo], {aggregates:["PLUGINS", "CLASSNAMES"]});
var c = new CustMain({mainA:"custMainA", extOne:"custExtOne"});
c.methodA();
c.methodB();
c.methodC();
c.methodD();
c.methodE();
c.methodF();
Y.log("CustMain === Main:" + (CustMain === Main));
Y.log("c instanceof Main:" + (c instanceof Main));
Y.log("c instanceof CustMain:" + (c instanceof CustMain));
var d = Y.Base.create(Main, [ExtOne, ExtTwo], {mainB: "custMainB", extTwo: "custExtTwo"});
d.methodA();
d.methodB();
d.methodC();
d.methodD();
d.methodE();
d.methodF();
Y.log("d instanceof Main:" + (d instanceof Main));
Y.log("d instanceof CustMain:" + (d instanceof CustMain));
});
})();
</script>
</head>
<body>
</body>
</html>