Created
July 12, 2012 19:55
-
-
Save brianjmiller/3100526 to your computer and use it in GitHub Desktop.
YUI3: A Start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add( | |
"myapp-general", | |
function (Y) { | |
var Clazz = Y.namespace("MyApp").General = Y.Base.create( | |
"myapp-general", | |
Y.Widget, | |
[], | |
{ | |
initializer: function (config) { | |
Y.log("initializer", "debug", Clazz.NAME); | |
}, | |
destructor: function () { | |
Y.log("destructor", "debug", Clazz.NAME); | |
} | |
}, | |
{ | |
ATTRS: {} | |
} | |
); | |
}, | |
"0.0.1", | |
{ | |
requires: [ | |
"widget" | |
] | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI().use("base", "myapp-shopper", function (Y) { | |
var shopper = new Y.MyApp.Shopper ({ render: true }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add( | |
"myapp-history", | |
function (Y) { | |
var Clazz = Y.namespace("MyApp").History = Y.Base.create( | |
"myapp-history", | |
Y.Widget, | |
[], | |
{ | |
initializer: function (config) { | |
Y.log("initializer", "debug", Clazz.NAME); | |
}, | |
destructor: function () { | |
Y.log("destructor", "debug", Clazz.NAME); | |
} | |
}, | |
{ | |
ATTRS: {} | |
} | |
); | |
}, | |
"0.0.1", | |
{ | |
requires: [ | |
"widget" | |
] | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add( | |
"myapp-preferences", | |
function (Y) { | |
var Clazz = Y.namespace("MyApp").Preferences = Y.Base.create( | |
"myapp-preferences", | |
Y.Widget, | |
[], | |
{ | |
initializer: function (config) { | |
Y.log("initializer", "debug", Clazz.NAME); | |
}, | |
destructor: function () { | |
Y.log("destructor", "debug", Clazz.NAME); | |
} | |
}, | |
{ | |
ATTRS: {} | |
} | |
); | |
}, | |
"0.0.1", | |
{ | |
requires: [ | |
"widget" | |
] | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add( | |
"myapp-shopper", | |
function (Y) { | |
var Clazz = Y.namespace("MyApp").Shopper = Y.Base.create( | |
"myapp-shopper", | |
Y.Widget, | |
[], | |
{ | |
_preferences: null, | |
_history: null, | |
_general: null, | |
initializer: function (config) { | |
Y.log("initializer", "debug", Clazz.NAME); | |
this._preferences = new Y.MyApp.General (); | |
this._history = new Y.MyApp.History (); | |
this._general = new Y.MyApp.Preferences (); | |
}, | |
destructor: function () { | |
Y.log("destructor", "debug", Clazz.NAME); | |
}, | |
renderUI: function () { | |
Y.log("renderUI", "debug", Clazz.NAME); | |
var cb = this.get("contentBox"); | |
this._preferences.render(cb); | |
this._history.render(cb); | |
this._general.render(cb); | |
} | |
}, | |
{ | |
ATTRS: {} | |
} | |
); | |
}, | |
"0.0.1", | |
{ | |
requires: [ | |
'widget', | |
'myapp-general', | |
'myapp-preferences', | |
'myapp-history' | |
] | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment