Skip to content

Commit

Permalink
Bit the bullet. RequireJS 2.0 compatible application.
Browse files Browse the repository at this point in the history
Remover included RequireJS (load from assets).
  • Loading branch information
mikaelkaron committed Jun 1, 2012
1 parent 44ed919 commit 37a4b5e
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 2,081 deletions.
2 changes: 1 addition & 1 deletion labs/architecture-examples/troopjs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ <h1>todos</h1>
</footer>
<!-- Scripts here. Don't remove this ↓ -->
<script src="../../../assets/base.js"></script>
<script type="text/javascript" data-main="js/app.js" src="js/lib/require.js"></script>
<script type="text/javascript" data-main="js/app.js" src="../../../assets/require.min.js"></script>
</body>
</html>
21 changes: 15 additions & 6 deletions labs/architecture-examples/troopjs/js/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
require({
"baseUrl" : "js",
"paths" : {
"jquery" : "../../../../assets/jquery.min",
"troopjs-bundle" : "lib/troopjs-bundle"
"troopjs-bundle" : "lib/troopjs-bundle.min"
},
"priority": [ "jquery", "config", "troopjs-bundle" ]
}, [ "jquery", "widget/application" ], function App(jQuery, Application) {
jQuery(document).ready(function ready($) {
Application($(this.body), "app/todos").start();
}, [ "require", "jquery", "troopjs-bundle" ], function Deps(parentRequire, jQuery) {

// Application and plug-ins
parentRequire([
"widget/application",
"troopjs-jquery/weave",
"troopjs-jquery/destroy",
"troopjs-jquery/hashchange",
"troopjs-jquery/action" ], function App(Application) {

// Hook ready
jQuery(document).ready(function ready($) {
Application($(this.body), "app/todos").start();
});
});
});
Loading

0 comments on commit 37a4b5e

Please sign in to comment.