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 97214eddd..2e41ec73e 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 @@ -18,6 +18,7 @@ define(['jquery', render: function() { this.$el.html(this.model.get('content')); this.makeFormsAjax(); + this.initPagination(); this.ajaxifyAttackHref(); $(window).scrollTop(0); //work-around til we get the scroll down sorted out }, @@ -35,6 +36,16 @@ define(['jquery', $("form.attack-form").ajaxForm(options); }, + initPagination: function() { + //console.log(this.$el.find('.lesson-page-wrapper').length + ' pages of content'); + this.currentPage = 0; + this.$contentPages = this.$el.find('.lesson-page-wrapper'); + if (this.$contentPages.length > 1) { + this.$contentPages.hide(); + this.$el.find(this.$contentPages[0]).show(); + } + }, + ajaxifyAttackHref: function() { // rewrite any links with hrefs point to relative attack URLs var self = this; // The current LessonAdapter#getLink() generates a hash-mark link. It will not match the mask below. @@ -53,6 +64,16 @@ define(['jquery', renderFeedback: function(feedback) { this.$el.find('feedback').html(feedback); + }, + + addPaginationControls: function() { +//
+// +// +//
+// +//
+ } });