├── content ├── scripts │ ├── util │ │ ├── underscore.js │ │ ├── loadcss.js │ │ ├── module-activator.js │ │ ├── content-builder.js │ │ ├── cookie.js │ │ └── json.js │ ├── main.js │ ├── backbone │ │ └── todo │ │ │ ├── main.js │ │ │ ├── templates │ │ │ ├── todo.js │ │ │ └── stats.js │ │ │ ├── models │ │ │ └── todo.js │ │ │ ├── collections │ │ │ └── todoList.js │ │ │ ├── views │ │ │ ├── todoView.js │ │ │ └── appView.js │ │ │ └── localStorage.js │ └── lib │ │ ├── jquery.alphanumeric.js │ │ ├── selectivizr.js │ │ ├── jquery.tmpl.js │ │ ├── modernizr-1.6.min.js │ │ ├── backbone-min.js │ │ ├── nwmatcher-1.2.3-min.js │ │ ├── knockout.js │ │ ├── underscore.js │ │ └── backbone.js ├── images │ └── destroy.png └── styles │ └── todos.css ├── readme.md └── index.html /content/scripts/util/underscore.js: -------------------------------------------------------------------------------- 1 | define(["../lib/underscore.js"], function () { 2 | return _; 3 | }); -------------------------------------------------------------------------------- /content/images/destroy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rauhryan/Backbone_RequireJS/HEAD/content/images/destroy.png -------------------------------------------------------------------------------- /content/scripts/main.js: -------------------------------------------------------------------------------- 1 | require({ 2 | paths: { 3 | underscore: "util/underscore-wrapper" 4 | } 5 | }, 6 | ['util/content-builder', 'util/module-activator'], function (builder, activator) { 7 | activator.execute(); 8 | builder.execute(); 9 | }); -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Backbone.js + RequireJS 2 | ----------------------- 3 | 4 | This is just the todo example application used in the Backbone.js documentation refactored 5 | to use requireJS. 6 | 7 | The easiest way to get it running is probably use 8 | 9 | > gem install simpleserve 10 | 11 | 12 | > simpleserve 13 | 14 | -------------------------------------------------------------------------------- /content/scripts/backbone/todo/main.js: -------------------------------------------------------------------------------- 1 | define(["./views/appView", 2 | "util/loadCss", 3 | "/content/scripts/lib/backbone.js", 4 | "/content/scripts/lib/underscore.js", 5 | "/content/scripts/lib/jquery.tmpl.js"], 6 | function (AppView, loadCss) { 7 | //loadCss("todos"); 8 | var app = new AppView(); 9 | return {}; 10 | }); 11 | -------------------------------------------------------------------------------- /content/scripts/backbone/todo/templates/todo.js: -------------------------------------------------------------------------------- 1 |