Skip to content

Commit

Permalink
Ticket tastejs#510 - Put all the codez in a global namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarGodson committed May 1, 2013
1 parent f7e1b55 commit 6de9e4b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions vanilla-examples/vanillajs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ <h1>todos</h1>
</footer>
<script src="components/todomvc-common/base.js"></script>
<script src="components/director/build/director.js"></script>
<script>
// Bootstrap app data
window.app = {};
</script>
<script src="js/helpers.js"></script>
<script src="js/store.js"></script>
<script src="js/model.js"></script>
Expand Down
8 changes: 4 additions & 4 deletions vanilla-examples/vanillajs/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* @param {string} name The name of your new to do list.
*/
function Todo(name) {
this.storage = new Store(name);
this.model = new Model(this.storage);
this.view = new View();
this.controller = new Controller(this.model, this.view);
this.storage = new app.Store(name);
this.model = new app.Model(this.storage);
this.view = new app.View();
this.controller = new app.Controller(this.model, this.view);
}

var todo = new Todo('todos-vanillajs');
Expand Down
2 changes: 1 addition & 1 deletion vanilla-examples/vanillajs/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,5 @@
};

// Export to window
window.Controller = Controller;
window.app.Controller = Controller;
})(window);
2 changes: 1 addition & 1 deletion vanilla-examples/vanillajs/js/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@
};

// Export to window
window.Model = Model;
window.app.Model = Model;
})(window);
2 changes: 1 addition & 1 deletion vanilla-examples/vanillajs/js/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@
};

// Export to window
window.Store = Store;
window.app.Store = Store;
})(window);
2 changes: 1 addition & 1 deletion vanilla-examples/vanillajs/js/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@
};

// Export to window
window.View = View;
window.app.View = View;
})(window);

0 comments on commit 6de9e4b

Please sign in to comment.