ninjs-rjs
Version:
requirejs build wrapper
1 lines • 1.55 kB
JavaScript
define("views/home/index",["jquery","underscore","backbone"],function(e,n,o){return o.View.extend({el:"body",initialize:function(e){return console.log("HOME"),console.log(e),this},render:function(){return this}})}),define("views/info/index",["jquery","underscore","backbone"],function(e,n,o){return o.View.extend({el:"body",initialize:function(e){return console.log("INFO"),console.log(e),this},render:function(){return this}})}),define("router",["jquery","underscore","backbone","views/home/index","views/info/index"],function(e,n,o,i,r){var t,c=o.Router.extend({routes:{"info(/)":"info","(/)":"home","*actions":"def"},info:function(){console.log("Info\n%j",arguments);var e=new r;e.render()},home:function(){console.log("Home\n%j",arguments);var e=new i;e.render()},def:function(e){console.log("No route\n%j",arguments)}});return{initialize:function(){return t=new c,o.history.start({pushState:!0}),t}}}),define("app",["jquery","underscore","backbone","router"],function(e,n,o,i){return{initialize:function(){i.initialize()}}}),require.config({paths:{jquery:"//cdn.snapptop.com/js/jquery/jquery.slim.min",underscore:"//cdn.snapptop.com/js/lodash/lodash.slim.min",moment:"//cdn.snapptop.com/js/moment/moment.min",backbone:"//cdn.snapptop.com/js/backbone/backbone.min",ba:"//cdn.snapptop.com/js/backbone/ba.min"},shim:{jquery:{exports:"$"},underscore:{exports:"_"},backbone:{exports:"Backbone",deps:["underscore","jquery"]},ba:{deps:["underscore","backbone"]}},config:{}}),require(["app"],function(e){e.initialize()}),define("main",function(){});