diff --git a/webgoat-container/src/main/resources/static/js/goatApp/model/LessonContentModel.js b/webgoat-container/src/main/resources/static/js/goatApp/model/LessonContentModel.js index 60ca65a36..f036f22e6 100644 --- a/webgoat-container/src/main/resources/static/js/goatApp/model/LessonContentModel.js +++ b/webgoat-container/src/main/resources/static/js/goatApp/model/LessonContentModel.js @@ -13,26 +13,14 @@ define(['jquery', items:null, selectedItem:null }, + initialize: function (options) { - //this.scrParam = null; - //this.menuParam = null; - //this.stageParam = null; - //this.numParam = null; - //this.baseUrlRoot = ''; + }, + loadData: function(options) { this.urlRoot = _.escape(encodeURIComponent(options.name)) + '.lesson' -// if (options.stage != null) { -// this.urlRoot += '&stage=' + options.stage; -// } -// if (options.num != null) { -// this.urlRoot += '&Num=' + options.num; -// } - //TODO - is below needed anymore? -// this.set('menuParam', options.menu); -// this.set('scrParam', options.scr); -// this.set('stageParam', options.stage); -// this.set('numParam', options.num); + var self = this; this.fetch().done(function(data) { self.setContent(data); @@ -44,6 +32,7 @@ define(['jquery', loadHelps = true; } this.set('content',content); + this.set('lessonUrl',document.URL); this.trigger('content:loaded',this,loadHelps); }, diff --git a/webgoat-container/src/main/resources/static/js/goatApp/view/GoatRouter.js b/webgoat-container/src/main/resources/static/js/goatApp/view/GoatRouter.js index b8eb7bb1e..2039cf1e2 100644 --- a/webgoat-container/src/main/resources/static/js/goatApp/view/GoatRouter.js +++ b/webgoat-container/src/main/resources/static/js/goatApp/view/GoatRouter.js @@ -27,7 +27,6 @@ define(['jquery', 'test/:param':'testRoute' }, - lessonController: new LessonController({ lessonContentView: lessonContentView }), @@ -84,10 +83,6 @@ define(['jquery', this.lessonController.loadWelcome(); }); - goatRouter.on('route:welcomeRoute', function() { - this.lessonController.loadWelcome(); - }); - goatRouter.on('route:testRoute', function(param) { this.lessonController.testHandler(param); }); diff --git a/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js b/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js index c122d1e90..b9c220124 100644 --- a/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js +++ b/webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js @@ -168,7 +168,8 @@ define(['jquery', incrementPageView: function() { if (this.currentPage < this.numPages -1) { this.currentPage++; - this.showCurContentPage(true); + window.location.href = this.model.get('lessonUrl') + '/' + this.currentPage; + //this.showCurContentPage(true); } if (this.currentPage > 0) { @@ -184,7 +185,8 @@ define(['jquery', decrementPageView: function() { if (this.currentPage > 0) { this.currentPage--; - this.showCurContentPage(false); + window.location.href = this.model.get('lessonUrl') + '/' + this.currentPage; + //this.showCurContentPage(false); } if (this.currentPage < this.numPages -1) {