/src/filmstrip.app.js
JavaScript | 73 lines | 52 code | 14 blank | 7 comment | 0 complexity | 135addeff0e4e2a37321c66204819edd MD5 | raw file
- define([
- '$',
- 'underscore',
- 'backbone',
-
- // 'lib/browsing',
- 'views/widgetview',
- 'views/filmstripview',
- 'models/sitecollection',
- 'models/sitemodel',
-
- 'lib/decorateboot',
- 'xmessage'
- ], function (
- $,
- util,
- Backbone,
-
- // browsing,
-
- WidgetView,
- FilmstripView,
- SiteCollection,
- SiteModel,
-
- decorateBoot,
- xmessage
- ) {
- var global = window;
- var FilmStripAppRouter = Backbone.Router.extend({
- initialize: function () {
- // Create a new map view for app.
- this.appView = new WidgetView({
- el: $('#stacknav')
- });
-
- this.appView.render();
- }
- });
- var app = new FilmStripAppRouter();
-
- app.route('timeline*GET', 'new', decorateBoot(
- function () {
- var collection = new SiteCollection();
-
- var view = new FilmstripView({
- collection: collection
- });
-
- return {
- appView: this.appView,
- view: view
- };
- },
- function (booted) {
- booted.appView.widget('.controls', booted.view);
- // Populate data...
- booted.view.collection.fetch();
- }
- ));
-
- // Now that all of our routes are configured, start router listener.
- Backbone.history.start({pushState: true});
-
- xmessage.sendMessage("top", "ready", [{ source: window.name, type: "ready", data: { toSay: "nothing much" } }], function (result) {
- // Ignore the response
- });
-
- // Return app object for reference
- return app;
- });