Merge pull request #127 from misfir3/master
items ommited from menu spinner and some more clean up
This commit is contained in:
commit
8bffb76e5b
@ -34,7 +34,8 @@ public class LessonInfoModel {
|
|||||||
if (lesson.getCategory().equals(Category.CHALLENGE)) {
|
if (lesson.getCategory().equals(Category.CHALLENGE)) {
|
||||||
this.numberHints = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS)) ? lesson.getHintCount(webSession) : 0;
|
this.numberHints = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS)) ? lesson.getHintCount(webSession) : 0;
|
||||||
this.hasSource = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS));
|
this.hasSource = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS));
|
||||||
this.hasSolution = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS)); //assuming we want this as well
|
this.hasSolution = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS)); //assuming we want this to fall in line with source and solution
|
||||||
|
this.hasPlan = (lesson.isAuthorized(webSession, AbstractLesson.CHALLENGE_ROLE, WebSession.SHOWHINTS)); //assuming we want this to fall in line with source and solutionn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,19 +88,18 @@ define(['jquery',
|
|||||||
|
|
||||||
this.onContentLoaded = function(loadHelps) {
|
this.onContentLoaded = function(loadHelps) {
|
||||||
this.lessonInfoModel = new LessonInfoModel();
|
this.lessonInfoModel = new LessonInfoModel();
|
||||||
this.listenTo(this.lessonInfoModel,'info:loaded',this.onInfoLoaded); //TODO onInfoLoaded function to handle title view and helpview
|
this.listenTo(this.lessonInfoModel,'info:loaded',this.onInfoLoaded);
|
||||||
|
|
||||||
if (loadHelps) {
|
if (loadHelps) {
|
||||||
this.helpControlsView = null;
|
this.helpControlsView = null;
|
||||||
this.lessonView.model = this.lessonContent;
|
this.lessonView.model = this.lessonContent;
|
||||||
this.lessonView.render();
|
this.lessonView.render();
|
||||||
//load title view (initially hidden) << //TODO: currently handled via menu click but need to be able to handle via routed request
|
|
||||||
this.planView = new PlanView();
|
this.planView = new PlanView();
|
||||||
this.solutionView = new SolutionView();
|
this.solutionView = new SolutionView();
|
||||||
this.sourceView = new SourceView();
|
this.sourceView = new SourceView();
|
||||||
this.lessonHintView = new HintView();
|
this.lessonHintView = new HintView();
|
||||||
this.cookieView = new CookieView();
|
this.cookieView = new CookieView();
|
||||||
// parameter model & view
|
|
||||||
//TODO: instantiate model with values (not sure why was not working before)
|
//TODO: instantiate model with values (not sure why was not working before)
|
||||||
var paramModel = new ParamModel({});
|
var paramModel = new ParamModel({});
|
||||||
paramModel.set('screenParam',this.lessonContent.get('screenParam'));
|
paramModel.set('screenParam',this.lessonContent.get('screenParam'));
|
||||||
@ -109,7 +108,7 @@ define(['jquery',
|
|||||||
this.paramView = new ParamView({model:paramModel});
|
this.paramView = new ParamView({model:paramModel});
|
||||||
|
|
||||||
$('.lesson-help').hide();
|
$('.lesson-help').hide();
|
||||||
}
|
}
|
||||||
this.trigger('menu:reload');
|
this.trigger('menu:reload');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,15 +11,22 @@ define(['jquery',
|
|||||||
_.extend(Controller.prototype,Backbone.Events);
|
_.extend(Controller.prototype,Backbone.Events);
|
||||||
options = options || {};
|
options = options || {};
|
||||||
this.menuView = options.menuView;
|
this.menuView = options.menuView;
|
||||||
|
this.titleView = options.titleView;
|
||||||
|
|
||||||
this.initMenu = function() {
|
// this.initMenu = function() {
|
||||||
//this.listenTo(this.menuView,'lesson:click',this.renderTitle);
|
// this.listenTo(this.menuView,'lesson:click',this.renderTitle);
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.updateMenu = function(){
|
this.updateMenu = function(){
|
||||||
this.menuView.updateMenu();
|
this.menuView.updateMenu();
|
||||||
|
},
|
||||||
|
|
||||||
|
//TODO: move title rendering into lessonContent/View pipeline once data can support it
|
||||||
|
this.renderTitle = function(title) {
|
||||||
|
this.titleView.render(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return Controller;
|
return Controller;
|
||||||
|
@ -13,9 +13,8 @@ define(['jquery',
|
|||||||
},
|
},
|
||||||
|
|
||||||
infoLoaded: function(data) {
|
infoLoaded: function(data) {
|
||||||
console.log (data);
|
|
||||||
this.trigger('info:loaded',this,data);
|
this.trigger('info:loaded',this,data);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});6
|
@ -33,7 +33,7 @@ define(['jquery',
|
|||||||
init:function() {
|
init:function() {
|
||||||
goatRouter = new GoatAppRouter();
|
goatRouter = new GoatAppRouter();
|
||||||
this.lessonController.start();
|
this.lessonController.start();
|
||||||
this.menuController.initMenu();
|
// this.menuController.initMenu();
|
||||||
|
|
||||||
goatRouter.on('route:attackRoute', function(scr,menu,stage) {
|
goatRouter.on('route:attackRoute', function(scr,menu,stage) {
|
||||||
this.lessonController.loadLesson(scr,menu,stage);
|
this.lessonController.loadLesson(scr,menu,stage);
|
||||||
|
@ -10,15 +10,18 @@ define(['jquery',
|
|||||||
JQueryForm) {
|
JQueryForm) {
|
||||||
return Backbone.View.extend({
|
return Backbone.View.extend({
|
||||||
el:'#lesson-content-wrapper', //TODO << get this fixed up in DOM
|
el:'#lesson-content-wrapper', //TODO << get this fixed up in DOM
|
||||||
|
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
this.$el.html(this.model.get('content'));
|
this.$el.html(this.model.get('content'));
|
||||||
this.makeFormsAjax();
|
this.makeFormsAjax();
|
||||||
this.ajaxifyAttackHref();
|
this.ajaxifyAttackHref();
|
||||||
$(window).scrollTop(0); //work-around til we get the scroll down sorted out
|
$(window).scrollTop(0); //work-around til we get the scroll down sorted out
|
||||||
},
|
},
|
||||||
|
|
||||||
//TODO: reimplement this in custom fashion maybe?
|
//TODO: reimplement this in custom fashion maybe?
|
||||||
makeFormsAjax: function () {
|
makeFormsAjax: function () {
|
||||||
var options = {
|
var options = {
|
||||||
|
@ -4,6 +4,7 @@ define(['jquery',
|
|||||||
function($,_,Backbone) {
|
function($,_,Backbone) {
|
||||||
return Backbone.View.extend({
|
return Backbone.View.extend({
|
||||||
el:'#header #lesson-title-wrapper',
|
el:'#header #lesson-title-wrapper',
|
||||||
|
|
||||||
render:function(title) {
|
render:function(title) {
|
||||||
var lessonTitleEl = $('<h1>',{id:'lesson-title',text:title});
|
var lessonTitleEl = $('<h1>',{id:'lesson-title',text:title});
|
||||||
this.$el.html(lessonTitleEl);
|
this.$el.html(lessonTitleEl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user