get submenus showing up and animation working
This commit is contained in:
parent
83b4c50b89
commit
cfb4ebb2b6
56
java/org/owasp/webgoat/service/HintService_1.java
Normal file
56
java/org/owasp/webgoat/service/HintService_1.java
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.owasp.webgoat.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import org.owasp.webgoat.lessons.AbstractLesson;
|
||||
import org.owasp.webgoat.lessons.model.Hint;
|
||||
import org.owasp.webgoat.session.WebSession;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author rlawson
|
||||
*/
|
||||
@Controller
|
||||
public class HintService extends BaseService {
|
||||
|
||||
/**
|
||||
* Returns hints for current lesson
|
||||
*
|
||||
* @param session
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/hint.mvc", produces = "application/json")
|
||||
public @ResponseBody
|
||||
List<Hint> showHint(HttpSession session) {
|
||||
List<Hint> listHints = new ArrayList<Hint>();
|
||||
WebSession ws = getWebSesion(session);
|
||||
AbstractLesson l = ws.getCurrentLesson();
|
||||
if (l == null) {
|
||||
return listHints;
|
||||
}
|
||||
List<String> hints;
|
||||
hints = l.getHintsPublic(ws);
|
||||
if (hints == null) {
|
||||
return listHints;
|
||||
}
|
||||
int idx = 0;
|
||||
for (String h : hints) {
|
||||
Hint hint = new Hint();
|
||||
hint.setHint(h);
|
||||
hint.setLesson(l.getName());
|
||||
hint.setNumber(idx);
|
||||
listHints.add(hint);
|
||||
idx++;
|
||||
}
|
||||
return listHints;
|
||||
}
|
||||
}
|
@ -35,7 +35,7 @@
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script type="text/javascript">
|
||||
var goat=angular.module("goatApp",['ngAnimate']);
|
||||
var goat=angular.module("goatApp", ['ngAnimate']);
|
||||
</script>
|
||||
<script type="text/javascript" src="js/goat.js"></script>
|
||||
<script type="text/javascript" src="js/goatConstants.js"></script>
|
||||
@ -66,8 +66,8 @@
|
||||
<ul class="nano-content">
|
||||
<li class="sub-menu" ng-repeat="item in menuTopics">
|
||||
<!-- TODO: implement conditional rendering -->
|
||||
<a ng-click="expanded = !expanded" href="#"><i class="fa {{item.class}}"></i><span>{{item.name}}</span></a>
|
||||
<ul ng-class="{slideDown: expanded}">
|
||||
<a ng-click="expanded = !expanded" href=""><i class="fa {{item.class}}"></i><span>{{item.name}}</span></a>
|
||||
<ul class="slideDown" ng-show="expanded" style="display:block;">
|
||||
<li ng-repeat="child in item.children">
|
||||
<a ng-click="renderLesson(child.link)" title="link to {{child.name}}">{{child.name}}</a>
|
||||
</li>
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user