add.html revision 1629abfab16a010ce64a057b1d3b3dfeaec3cc1f
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass<html debug="true">
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <head>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <title>YUI 3.0</title>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <!--
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass -->
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <script type="text/javascript" src="/build/yui/yui-debug.js"></script>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass </head>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <body>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <script type="text/javascript">
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass (function () {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass YUI.add('mywidget', function(Y) {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass function MyWidget(config) {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass MyWidget.superclass.constructor.apply(this, arguments);
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass MyWidget.NAME = "mywidget";
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass MyWidget.ATTRS = {};
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.extend(MyWidget, Y.Widget);
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.MyWidget = MyWidget;
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }, '3.0.0b1', {requires:['widget']});
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass })();
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass var config1 = {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass a: 1,
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass modules: {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass 'yui2-yde': {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass fullpath: "http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass },
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass config2 = {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass a: 2,
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass b: 1,
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass modules: {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass 'yui2-calendar': {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass fullpath: "http://yui.yahooapis.com/2.5.2/build/calendar/calendar-min.js",
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass requires: ['yui2-yde', 'yui2-calendarcss']
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass },
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass config3 = {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass a: 3,
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass b: 2,
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass c: 1,
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass modules: {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass 'yui2-calendarcss': {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass fullpath: "http://yui.yahooapis.com/2.5.2/build/calendar/assets/skins/sam/calendar.css",
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass type: 'css'
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass }
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass };
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass </script>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <div id="my"/>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass <script type="text/javascript">
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass // Works
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass // YUI().use('widget', function(Y) {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass // new Y.Widget().render();
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass // Y.log("use 'widget' - No Exceptions");
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass // })
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass // Broken
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass YUI( { filter: 'debug' }, config1, config2, config3).use('dump', 'mywidget', function(Y) {
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass new Y.MyWidget().render();
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.log("use 'mywidget', custom module - No Exceptions");
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.log("config: " + Y.dump(Y.config));
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.log("modules: " + Y.dump(Y.config.modules, 0));
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.log("DOM element: " + Y.dump(document.getElementById('my')));
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass Y.log("DOM element: " + Y.dump(document.location));
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass })
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass </script>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass </body>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass</html>
dcf867898f7641811b300c3da22c2c6f84b78bdfDav Glass