This file contains hidden or 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('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 }); |
This file contains hidden or 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
| // For Y.Foo | |
| // Class extensions that will be used in the base class | |
| function ExtA() {} | |
| ... | |
| Y.FooExtA = ExtA; | |
| // Base Class definition | |
| function FooBase() {} | |
| ... |
This file contains hidden or 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
| var comboServer = require('combohandler/lib/server'), | |
| port = process.env.PORT || 3001, | |
| app = comboServer({ | |
| roots: { | |
| '/': __dirname + '/build' | |
| } | |
| }); | |
| app.listen(port, function () { |
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
This file contains hidden or 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('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') | |
| }); |
This file contains hidden or 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
| // 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, |
This file contains hidden or 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('app', 'handlebars', 'jsonp', function (Y) { | |
| var GithubSync, | |
| Contributor, ContributorList, Repo, RepoList, User, | |
| ContributorListView, RepoView, RepoListView, UserView, | |
| HomePageView, UserPageView, RepoPageView, | |
| ContributorsApp; | |
| // -- GithubSync --------------------------------------------------------------- |