recent merge from upstream

This commit is contained in:
Jason White
2015-05-07 18:19:10 -04:00
parent 33dc855da7
commit f85132284f
12 changed files with 7 additions and 724 deletions

View File

@ -6,7 +6,8 @@ define(['jquery','underscore','backbone','goatApp/view/goatRouter','goatApp/cont
return {
initApp: function() {
//TODO: add query/ability to load from where they left off
Router.init();
console.log('initApp')
//Router.init();
}
}
});

View File

@ -1,20 +0,0 @@
define(['jquery', 'underscore','backbone'], function($,_,Backbone){
return Backbone.Model.extend({
urlRoot:null,
defaults: {
items:null,
selectedItem:null
},
initialize: function (options) {
var self = this;
this.urlRoot = 'attack.jsp?Screen='+options.screen + '&menu=' + options.menu;
this.fetch().then(function(content){
self.lessonContent = content
});
},
getHint: function (i) {
}
});
});

View File

@ -1,32 +0,0 @@
//var goatApp = goatApp || {};
define(['jquery','underscore','backbone'], function($,_,Backbone) {
var menuData = Backbone.Model.extend({
urlRoot:'/webgoat/service/lessonmenu.mvc',
defaults: {
items:null,
selectedItem:null
},
initialize: function () {
var self = this;
this.fetch().then(function(menuItems){
menuItems = goatUtils.enhanceMenuData(menuItems,this.selectedItem);
this.setDataItems(menuItems);
});
},
update: function() {
var self = this;
this.fetch().then(function(menuItems) {
menuItems = goatUtils.enhanceMenuData(menuItems,this.selectedItem);
self.setDataItems(menuItems);
});
},
setDataItems: function (data) {
this.items = data;
}
});
});

View File

@ -1,22 +0,0 @@
var menuData = Backbone.Model.extend({
urlRoot:'/webgoat/service/lessonmenu.mvc',
defaults: {
items:null,
selectedItem:null
},
initialize: function () {
var self = this;
this.fetch().then(function(menuItems){
menuItems = goatUtils.enhanceMenuData(menuItems,this.selectedItem);
self.items = menuItems;
});
},
update: function() {
var self = this;
this.fetch().then(function(data) {
self.items = data;
self.render(0);
});
}
});

View File

@ -20,4 +20,6 @@ function($,_,Backbone,LessonData) {
this.$el.html(this.content);
}
});
return contentView;
});

View File

@ -5,7 +5,7 @@ define(['jquery',
'goatApp/controller/MenuController',
'goatApp/view/LessonContentView',
'goatApp/view/MenuView'
], function ($,_,Backbone,LessonController,MenuController,LessonView,MenuView) {
], function ($,_,Backbone,LessonController,MenuController,LessonContentView,MenuView) {
var lessonView = new LessonContentView();
var menuView = new MenuView();
@ -20,7 +20,7 @@ define(['jquery',
}),
menuView: new MenuController({
menuView:menuView
});
})
});
var init = function() {