First attempt to remove JSP and move to Thymeleaf and update to Spring Boot. The Thymeleaf templates can be loaded as snippets which makes it more easy to move away from ECS and create normal HTML pages for a lesson.
This commit is contained in:
40
webgoat-container/src/main/resources/static/js/toggle.js
Normal file
40
webgoat-container/src/main/resources/static/js/toggle.js
Normal file
@ -0,0 +1,40 @@
|
||||
var iframe;
|
||||
|
||||
function initIframe() {
|
||||
var body;
|
||||
var element;
|
||||
|
||||
body = document.getElementsByTagName('body')[0];
|
||||
element = document.getElementById('lessonPlans');
|
||||
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.style.position = "absolute";
|
||||
iframe.style.visibility = "hidden";
|
||||
body.appendChild(iframe);
|
||||
|
||||
// Configure the iFrame to border the lessonPlan
|
||||
document.getElementsByTagName('body')[0].appendChild(element);
|
||||
iframe.style.height = element.offsetHeight;
|
||||
iframe.style.left = '275px';
|
||||
iframe.style.top = '145px';
|
||||
iframe.style.width = '474px';
|
||||
}
|
||||
|
||||
|
||||
function toggle(id) {
|
||||
element = document.getElementById(id);
|
||||
|
||||
if (!element) return;
|
||||
|
||||
if (element.style.visibility=='visible' || element.style.visibility=='') {
|
||||
iframe.style.visibility = 'hidden';
|
||||
element.style.visibility = 'hidden';
|
||||
element.style.overflow = 'hidden';
|
||||
element.style.height='1';
|
||||
} else {
|
||||
iframe.style.visibility= 'visible';
|
||||
element.style.visibility = 'visible';
|
||||
element.style.overflow = 'visible';
|
||||
element.style.height='';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user