misfir3 82ef171a50 XSS Lesson Modifications (#367)
* initial cut on XSS, need to add some tests still

* initial unit tests for assignment endpoints

* updating header comment license thingy

* comment, clean up

* Stubs for security unit test

* Additional Unit Testing

* isEncoded and isNotEncoded Unit Tests added

* http-proxies updates

* update for XXE solutions

* Work-around to handle special chars in action ... currently to be able to match {userId} in hint creation/assignment for IDOR

* IDOR hints updated

* mitigation content update

* mitigation content update ... 2

* Lesson Overview updates

* including restart lesson fix for lesson overview
2017-07-10 08:33:10 -04:00

56 lines
1.4 KiB
JavaScript

define(['jquery',
'underscore',
'backbone'],
function($,_,Backbone) {
return Backbone.View.extend({
el:'#help-controls', //Check this
initialize: function (options) {
if (!options) {
return;
}
this.hasPlan = options.hasPlan;
this.hasSolution = options.hasSolution;
this.hasSource = options.hasSource;
},
showHintsButton: function(nav) {
this.$el.find('#show-hints-button').unbind().on('click',this.showHints.bind(this)).show();
},
hideHintsButton: function(){
$('#show-hints-button').hide();
},
render:function(title) {
$('#show-source-button').hide();
$('#show-solution-button').hide();
$('#show-plan-button').hide();
if (this.hasSource) {
this.$el.find('#show-source-button').unbind().on('click',_.bind(this.showSource,this)).show();
}
if (this.hasSolution) {
this.$el.find('#show-solution-button').unbind().on('click',_.bind(this.showSolution,this)).show();
}
this.$el.find('#restart-lesson-button').unbind().on('click',_.bind(this.restartLesson,this)).show();
},
showHints: function() {
this.trigger('hints:show','hint');
},
showSource: function() {
this.trigger('source:show','source');
},
showSolution: function() {
this.trigger('solution:show','solution');
},
restartLesson: function() {
this.trigger('lesson:restart');
}
});
});