|
60 | 60 | </head>
|
61 | 61 |
|
62 | 62 | <body class="animated fadeIn" ng-app="goatApp">
|
63 |
| - <section id="container"> |
| 63 | + <section id="container" ng-controller="goatLesson"> |
64 | 64 | <header id="header">
|
65 | 65 | <!--logo start-->
|
66 | 66 | <div class="brand">
|
|
72 | 72 | <i class="fa fa-bars"></i>
|
73 | 73 | </button>
|
74 | 74 | </div><!--toggle navigation end-->
|
75 |
| - <div class="lessonTitle"> |
76 |
| - <h1>Lesson Title in here</h1> |
| 75 | + <div class="lessonTitle" > |
| 76 | + <h1 id="lessonTitle">Lesson Title in here</h1> |
77 | 77 | </div><!--lesson title end-->
|
78 | 78 | <div class="user-nav pull-right">
|
79 | 79 | <button type="button" class="btn btn-default">
|
|
90 | 90 |
|
91 | 91 | <!--sidebar left start-->
|
92 | 92 | <aside class="sidebar">
|
93 |
| - <div id="leftside-navigation" class="nano" ng-controller="goatLessonMenu"> |
| 93 | + <div id="leftside-navigation" class="nano"> |
94 | 94 | <ul class="nano-content">
|
95 | 95 | <li class="sub-menu" ng-repeat="item in menuTopics">
|
96 | 96 | <a ng-click="expanded = !expanded" href=""><i class="fa {{item.class}}"></i><span>{{item.name}}</span></a>
|
|
112 | 112 | <!--main content start-->
|
113 | 113 | <section class="main-content-wrapper">
|
114 | 114 |
|
115 |
| - <section id="main-content" ng-controller="lessonHelpController"> |
| 115 | + <section id="main-content" > <!-- ng-controller="lessonController" --> |
116 | 116 | <div class="row">
|
117 | 117 | <div class="col-md-8">
|
118 | 118 | <div class="col-md-12" align="left">
|
119 | 119 | <div class="panel">
|
120 | 120 | <div class="panel-body">
|
121 |
| - <button type="button" id="showSourceBtn" class="btn btn-primary btn-xs">Java [Source]</button> |
122 |
| - <button type="button" id="showSolutionBtn" class="btn btn-primary btn-xs">Solution</button> |
123 |
| - <button type="button" id="showPlanBtn" class="btn btn-primary btn-xs">Lesson Plan</button> |
| 121 | + <button type="button" id="showSourceBtn" class="btn btn-primary btn-xs" ng-click="showLessonSource()">Java [Source]</button> |
| 122 | + <button type="button" id="showSolutionBtn" class="btn btn-primary btn-xs" ng-click="showLessonSolution()">Solution</button> |
| 123 | + <button type="button" id="showPlanBtn" class="btn btn-primary btn-xs" ng-click="showLessonPlan()">Lesson Plan</button> |
| 124 | + <button type="button" id="showHintsBtn" class="btn btn-primary btn-xs" ng-click="viewHints()">Hints</button> |
124 | 125 | </div>
|
125 | 126 | </div>
|
| 127 | + |
126 | 128 | </div>
|
127 | 129 | <div class="col-md-12">
|
128 |
| - <!--<div class="panel" id="buttonPanel">--> |
129 |
| - <!--<button type="button" id="showParamsCookiesBtn" class="btn btn-primary btn-xs">Params/Cookies</button>--> |
130 |
| - <!--<button type="button" id="showHintsBtn" class="btn btn-primary btn-xs lessonHelpBtn">Hints</button>--> |
131 |
| - <!--<button type="button" id="showPlanBtn" class="btn btn-primary btn-xs lessonHelpBtn">Lesson Plan</button>--> |
132 |
| - <!--<button type="button" id="showSourceBtn" class="btn btn-primary btn-xs lessonHelpBtn">Java [Source]</button> <!-- ng-click="showSource('lg') --> |
133 |
| - <!--<button type="button" id="showSolutionBtn" class="btn btn-primary btn-xs lessonHelpBtn">Solution</button>--> |
134 |
| - <!-- ng-click="showSolution('lg') --> |
135 |
| - <!--</div> --> |
136 | 130 | <div class="panel" >
|
137 | 131 | <div class="panel-body" id="lesson_content">
|
138 | 132 | <b>This should default to the "How to Work with Webgoat" lesson</b>
|
|
146 | 140 | <div class="panel">
|
147 | 141 | <div class="panel-body">
|
148 | 142 | <div align="left">
|
149 |
| - <button id="tshowParamsCookiesBtn" type="button" class="btn btn-xs" ng-click="viewCookiesAndParams()">Params / Cookies</button> |
150 |
| - <button id="showHintsBtn" type="button" class="btn btn-xs">Hints</button> |
151 |
| - |
| 143 | + <h3>Cookies / Parameters</h3> |
152 | 144 | </div>
|
153 | 145 | <hr />
|
154 |
| - <div id="hintsView"> |
155 |
| - <h3>Hints</h3> |
156 |
| - <p>{{scope.hints}}</p> |
157 |
| - </div> |
158 | 146 | <div id="cookiesAndParamsView">
|
159 | 147 | <div class="cookiesView">
|
160 | 148 | <h4>Cookies</h4>
|
|
179 | 167 | <tr><th>Param</th><th>Value</th></tr>
|
180 | 168 | </thead>
|
181 | 169 | <tbody>
|
182 |
| - <tr ng-repeat="param in params"> |
| 170 | + <tr ng-repeat="param in parameters"> |
183 | 171 | <td>{{param.name}}</td>
|
184 | 172 | <td>{{param.value}}</td>
|
185 | 173 | </tr>
|
|
194 | 182 | </div><!--col-md-4 end-->
|
195 | 183 | </div>
|
196 | 184 | <div id="lessonHelpsWrapper">
|
| 185 | + <div class="row lessonHelp" id="lesson_hint_row"> |
| 186 | + <div class="col-md-12"> |
| 187 | + <h4>Hints</h4> |
| 188 | + <div class="panel" > |
| 189 | + <div class="panel-body" id="lesson_hint"> |
| 190 | + <span class="glyphicon-class glyphicon glyphicon-circle-arrow-left" id="showPrevHintBtn" ng-click="viewPrevHint()"></span> |
| 191 | + <span class="glyphicon-class glyphicon glyphicon-circle-arrow-right" id="showNextHintBtn" ng-click="viewNextHint()"></span> |
| 192 | + <br/> |
| 193 | + {{curHint}} |
| 194 | + </div> |
| 195 | + </div> |
| 196 | + </div> |
| 197 | + </div> |
197 | 198 | <div class="row lessonHelp" id="lesson_cookies_row">
|
198 | 199 | <div class="col-md-12">
|
199 | 200 | <h4>Lesson Parameters and Cookies</h4>
|
|
218 | 219 | <div class="col-md-12">
|
219 | 220 | <h4>Lesson Plan</h4>
|
220 | 221 | <div class="panel" >
|
221 |
| - <div class="panel-body" id="lesson_plan"> |
222 |
| - |
| 222 | + <div class="panel-body" id="lesson_plan"> |
| 223 | + <!-- allowing jQuery to handle this one --> |
223 | 224 | </div>
|
224 | 225 | </div>
|
225 | 226 | </div>
|
226 | 227 | </div>
|
227 | 228 | <div class="row lessonHelp" id="lesson_solution_row">
|
228 | 229 | <div class="col-md-12">
|
229 | 230 | <h4>Lesson Solution</h4>
|
230 |
| - <div class="panel" > |
231 |
| - <div class="panel-body" id="lesson_solution"> |
| 231 | + <div class="panel"> |
| 232 | + <div class="panel-body" id="lesson_solution"> |
232 | 233 | </div>
|
233 | 234 | </div>
|
234 | 235 | </div>
|
235 | 236 | </div>
|
236 | 237 | <div class="row lessonHelp" id="lesson_source_row">
|
237 | 238 | <div class="col-md-12">
|
238 | 239 | <h4>Lesson Source Code</h4>
|
239 |
| - <div class="panel" > |
240 |
| - <div class="panel-body" id="lesson_source"> |
| 240 | + <div class="panel"> |
| 241 | + <div class="panel-body" id="lesson_source"> |
| 242 | + <pre>{{source}}</pre> |
241 | 243 | </div>
|
242 | 244 | </div>
|
243 | 245 | </div>
|
|
260 | 262 | var DEBUG_FORM_SUBMISSION = false;
|
261 | 263 |
|
262 | 264 | $(document).ready(function() {
|
263 |
| - // bind to click events on menu links |
264 |
| - /*$('.menu-link').bind('click', function(event) { |
265 |
| - event.preventDefault(); |
266 |
| - $.get(this.href, {}, function(reply) { |
267 |
| - $("#lesson_content").html(reply); |
268 |
| - goat.utils.showLessonSource(); |
269 |
| - }, "html"); |
270 |
| - });*/ |
271 |
| -
|
272 | 265 | app.init();
|
273 |
| -
|
| 266 | + //can be augmented later to 'resume' for a given user ... currently kluged to start at fixed lesson |
| 267 | + var url = 'attack?Screen=32&menu=5'; |
| 268 | + angular.element($('#leftside-navigation')).scope().renderLesson(url); |
274 | 269 | });
|
275 | 270 | // make all forms ajax forms
|
276 | 271 | var options = {
|
|
0 commit comments