We also want you to test the hell out of these!
- Async Loader
- Async Get (full re-write)
| YUI().use('app', 'handlebars', 'jsonp', function (Y) { | |
| var GithubSync, | |
| Contributor, ContributorList, Repo, RepoList, User, | |
| ContributorListView, RepoView, RepoListView, UserView, | |
| HomePageView, UserPageView, RepoPageView, | |
| ContributorsApp; | |
| // -- GithubSync --------------------------------------------------------------- |
| // Imagine that `Y.User`, `Y.UsersView`, and `Y.UserView` have been defined. | |
| var app = new Y.App({ | |
| views: { | |
| users: { | |
| type : Y.UsersView, | |
| preserve: true | |
| }, | |
| user: { | |
| type : Y.UserView, |
| YUI().use('charts', 'app-base', function (Y) { | |
| var ChartView, StatsView, app; | |
| ChartView = Y.Base.create('chartView', Y.View, [], { | |
| render: function () { | |
| this.chart = new Y.Chart({ | |
| dataProvider: [], | |
| render : this.get('container') | |
| }); |
Preferential ordering of server and browser capabilities to determine if client- side routing should happen and enhance an application's user experience.
Format: (app has capable server) && (browser has pushState) => (should route)
server && html5 //=> routesserver && !html5 //=> !routes!server && html //=> routes!server && !html5 //=> routes| var comboServer = require('combohandler/lib/server'), | |
| port = process.env.PORT || 3001, | |
| app = comboServer({ | |
| roots: { | |
| '/': __dirname + '/build' | |
| } | |
| }); | |
| app.listen(port, function () { |
| // For Y.Foo | |
| // Class extensions that will be used in the base class | |
| function ExtA() {} | |
| ... | |
| Y.FooExtA = ExtA; | |
| // Base Class definition | |
| function FooBase() {} | |
| ... |
| YUI().use('model', 'model-list', function (Y) { | |
| Y.Tag = Y.Base.create('tag', Y.Model, [], {}, { | |
| ATTRS: { | |
| name: {} | |
| } | |
| }); | |
| Y.Tags = Y.Base.create('tags', Y.ModelList, [], { model: Y.Tag }); |