This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function loadController(controllerName){ | |
| require(['Controllers/' + controllerName], function(controller){ | |
| controller.start(); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(function(){ | |
| var routes = [{hash:'#list', controller:'ListController'}, | |
| {hash:'#add', controller:'AddController'}]; | |
| var defaultRoute = '#list'; | |
| var currentHash = ''; | |
| function startRouting(){ | |
| window.location.hash = window.location.hash || defaultRoute; | |
| setInterval(hashCheck, 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require(['Models/User', 'Router'], function(User, Router){ | |
| var users = [new User('Barney'), | |
| new User('Cartman'), | |
| new User('Sheldon')]; | |
| localStorage.users = JSON.stringify(users); | |
| Router.startRouting(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require(['Controllers/ListController'], function(ListController){ | |
| ListController.start(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.location.hash = '#list'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <head> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <div class="shape" id="shape1"></div> | |
| <div class="shape" id="shape2"></div> | |
| <div class="shape" id="shape3"></div> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .shape{ | |
| display:inline-block; | |
| width:200px; | |
| height:200px; | |
| background:#ddf; | |
| margin:20px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @lightBlue:#ddf; | |
| .shape{ | |
| display:inline-block; | |
| width:200px; | |
| height:200px; | |
| background:@lightBlue; | |
| margin:20px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @lightRed: #fdd; | |
| @lightGreen: #dfd; | |
| @lightBlue: #ddf; | |
| @defaultThemeColor:@lightGreen; | |
| .shape{ | |
| display:inline-block; | |
| width:200px; | |
| height:200px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #shape1{ | |
| border-radius:9999px; | |
| } |