Intermediate result for calling multiple lesson endpoints

This commit is contained in:
Nanne Baars
2016-08-18 21:15:12 +02:00
parent c0ab7b7d1c
commit 61d5116d44
8 changed files with 93 additions and 63 deletions

View File

@ -6,6 +6,7 @@ server.port=8080
logging.level.org.springframework=WARN
spring.thymeleaf.cache=false
spring.thymeleaf.content-type=text/html
security.enable-csrf=false

View File

@ -40,28 +40,10 @@ define(['jquery',
// The current LessonAdapter#getLink() generates a hash-mark link. It will not match the mask below.
// Besides, the new MVC code registers an event handler that will reload the lesson according to the route.
$('form').submit(function(event){
var url = this.baseURI;
url = url.replace('start.mvc#lesson', '');
url = url + '.attack';
$.get(url)
$.get(this.action, "json")
.done(self.reLoadView.bind(self))
.fail(function() { alert("failed to GET " + url); });
});
//
//
// $.each($('a[href^="*.attack"]'),function(i,el) { //FIXME: need to figure out what to do here ...
// var url = $(el).attr('href');
// $(el).unbind('click').attr('href','#').attr('link',url);
// //TODO pull currentMenuId
// $(el).click(function(event) {
// event.preventDefault();
// var _url = $(el).attr('link');
// console.log("About to GET " + _url);
// $.get(_url)
// .done(self.reLoadView.bind(self))
// .fail(function() { alert("failed to GET " + _url); });
// });
// });
},
onAttackExecution: function(feedback) {