First attempt to remove JSP and move to Thymeleaf and update to Spring Boot. The Thymeleaf templates can be loaded as snippets which makes it more easy to move away from ECS and create normal HTML pages for a lesson.
This commit is contained in:
@ -0,0 +1,67 @@
|
||||
define(['jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'goatApp/controller/LessonController',
|
||||
'goatApp/controller/MenuController',
|
||||
'goatApp/view/LessonContentView',
|
||||
'goatApp/view/MenuView',
|
||||
'goatApp/view/DeveloperControlsView'
|
||||
], function ($,
|
||||
_,
|
||||
Backbone,
|
||||
LessonController,
|
||||
MenuController,
|
||||
LessonContentView,
|
||||
MenuView,
|
||||
DeveloperControlsView) {
|
||||
|
||||
var lessonView = new LessonContentView();
|
||||
var menuView = new MenuView();
|
||||
var developerControlsView = new DeveloperControlsView();
|
||||
|
||||
var GoatAppRouter = Backbone.Router.extend({
|
||||
routes: {
|
||||
'welcome':'welcomeRoute',
|
||||
'attack/:scr/:menu':'attackRoute',
|
||||
'attack/:scr/:menu/:stage':'attackRoute',
|
||||
'attack/:scr/:menu/*stage/:num':'attackRoute',
|
||||
},
|
||||
|
||||
lessonController: new LessonController({
|
||||
lessonView: lessonView
|
||||
}),
|
||||
|
||||
menuController: new MenuController({
|
||||
menuView: menuView
|
||||
}),
|
||||
|
||||
init:function() {
|
||||
goatRouter = new GoatAppRouter();
|
||||
this.lessonController.start();
|
||||
// this.menuController.initMenu();
|
||||
|
||||
goatRouter.on('route:attackRoute', function(scr,menu,stage,num) {
|
||||
this.lessonController.loadLesson(scr,menu,stage,num);
|
||||
this.menuController.updateMenu(scr,menu);
|
||||
});
|
||||
goatRouter.on('route:welcomeRoute', function() {
|
||||
this.lessonController.loadWelcome();
|
||||
});
|
||||
goatRouter.on("route", function(route, params) {
|
||||
|
||||
});
|
||||
|
||||
Backbone.history.start();
|
||||
this.listenTo(this.lessonController, 'menu:reload',this.reloadMenu)
|
||||
},
|
||||
|
||||
reloadMenu: function (curLesson) {
|
||||
this.menuController.updateMenu();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return GoatAppRouter;
|
||||
|
||||
});
|
Reference in New Issue
Block a user