.> builtins.mergeio
.> load unison-src/transcripts-using-base/base.u
| var DocumentRouteTarget = { | |
| show: function () { | |
| // this function is called for /documents/:id urls like /documents/123 | |
| } | |
| }; |
| YUI.add('models:my_model', function (Y, NAME, __imports__, __exports__) { | |
| "use strict"; | |
| var MyOtherModel = __imports__['models/my_other_model']['default']; | |
| var MyModel = Y.Base.create('models:myModel', | |
| MyOtherModel | |
| [], | |
| { | |
| // .. some implementation | |
| }, |
| /** @jsx React.DOM */ | |
| var AppRouteTarget = { | |
| setupLayout: function () { | |
| React.renderComponent({ | |
| <App className='page-content'>, | |
| document.querySelector('body') | |
| }); | |
| } | |
| }; |
| (function () { | |
| // initiate the application loader | |
| var appLoader = new Swipely.AppLoader({ | |
| slowText: 'Hold tight, almost done...', | |
| errorText: "Oh dear, we had a problem loading. We're sorry, please try again." | |
| }); | |
| // boot the application | |
| YUI().use('partners:app', function (Y) { |
| YUI.add('location-search-view', function (Y) { | |
| /** | |
| @class LocationSearchView | |
| @extends View | |
| @constructor | |
| **/ | |
| Y.LocationSearchView = Y.Base.create('view', | |
| Y.View, | |
| [], |
| host[model.isNew() ? "destroy" : "render"](); | |
| // vs | |
| if (model.isNew()) host.destroy(); | |
| else host.render(); |
| // THIS IS A SUPER PRESENTER?! | |
| YUI.add("presenters:your_rewards", function (Y) { | |
| Y.YourRewardsPresenter = Y.Base.create("YourRewardsPresenter", Y.Presenter, [], { | |
| initializer: function (options) { | |
| this.yourPlacesPresenter = new Y.YourPlacesPresenter({}); | |
| this.yourCashPresenter = new Y.YourCashPresenter({}); |
| @contact = Contact.find(params[:id]) | |
| raise url_for(contacts_url(@contact)) | |
| # http://localhost:3000/contacts.986060960 | |
| class Release < ActiveRecord::Base | |
| has_many :release_sites | |
| has_many :sites, :through => :release_sites | |
| end | |
| class Site < ActiveRecord::Base | |
| has_many :release_sites | |
| has_many :releases, :through => :release_sites | |
| end |