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.add('router', function(Y) { | |
| /** | |
| Provides URL-based routing using HTML5 `pushState()` or the location hash. | |
| @module app | |
| @submodule router | |
| @since 3.4.0 | |
| **/ |
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({ | |
| modules: { | |
| 'router': { | |
| fullpath: 'router-fixes.js', | |
| requires: ['array-extras', 'base-build', 'history'], | |
| optional: ['querystring-parse'] | |
| } | |
| } | |
| }).use('app-base', 'app-transitions', function (Y) { |
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
| Y.SquareList = Y.Base.create('squareList', Y.ModelList, [], { /* ... */ }); | |
| Y.Game = Y.Base.create('game', Y.Model, [], { | |
| initializer: function () { | |
| this._squareList = new Y.SquareList(); | |
| }, | |
| _getSquareList: function () { | |
| return this._squareList; | |
| }, |
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 foo = 'foo', | |
| bar = 'bar', | |
| baz, zee; | |
| baz = { | |
| bla : true, | |
| blaBla: false | |
| }; | |
| zee = { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Y.App + Y.TabView</title> | |
| </head> | |
| <body class="yui3-skin-sam"> | |
| <script src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js"></script> | |
| <script> | |
| YUI({ |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Example App</title> | |
| </head> | |
| <body> | |
| <h1></h1> |
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
| // Creates a new App and View instance. | |
| var app = new Y.App(), | |
| view = new Y.View(); | |
| // Overrides the view's `render()` method to render text into its `container`. | |
| view.render = function () { | |
| this.get('container').set('text', 'Hello World!'); | |
| return this; | |
| }; |
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
| UserPageView = Y.Base.create('userPageView', Y.View, [], { | |
| initializer: function () { | |
| var user = this.get('model'), | |
| repos = this.get('modelList'); | |
| // This view serves as a "page"-level view containing two sub-views to | |
| // which it delegates rendering and stitches together the resulting UI. | |
| // Sub-views are created to render the `User` and `RepoList`. | |
| this.userView = new UserView({model: user}); | |
| this.repoListView = new RepoListView({modelList: repos}); |
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
| // Creates a Person model which has a `name` attribute. | |
| Y.Person = Y.Base.create('person', Y.Model, [], {}, { | |
| ATTRS: { | |
| name: {} | |
| } | |
| }); | |
| // Creates a HelloView which can say hello to a Person, or to the World if a | |
| // Person model is not specified. | |
| Y.HelloView = Y.Base.create('helloView', Y.View, [], { |
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 app = new Y.App(), | |
| view = new Y.View(); | |
| view.render = function () { | |
| this.get('container').set('text', 'Hello World!'); | |
| return this; | |
| }; | |
| app.render().showView(view.render()); |