From 91029ed3a6114640f6de31b3cf003fd323951a33 Mon Sep 17 00:00:00 2001 From: Jason White Date: Thu, 4 Sep 2014 20:02:23 -0400 Subject: [PATCH] reworked cookies/params and modified button layout some --- src/main/webapp/WEB-INF/pages/main_new.jsp | 82 ++++++++++++++-------- src/main/webapp/css/main.css | 20 ++++-- src/main/webapp/js/goatControllers.js | 11 +-- 3 files changed, 71 insertions(+), 42 deletions(-) diff --git a/src/main/webapp/WEB-INF/pages/main_new.jsp b/src/main/webapp/WEB-INF/pages/main_new.jsp index 88b771305..d9529030b 100644 --- a/src/main/webapp/WEB-INF/pages/main_new.jsp +++ b/src/main/webapp/WEB-INF/pages/main_new.jsp @@ -118,36 +118,21 @@
- - + + +
-
- - - - - -
- -
-
- cookies: -
    -
  • {{key}} :: {{ value}} -
-
-
- params:
-
    -
  • - {{param.name}} = {{param.value}} -
  • -
-
-
+ + + + + + + +
This should default to the "How to Work with Webgoat" lesson @@ -161,13 +146,48 @@
- - - + + +

-

Hints

-

Nam placerat magna in massa euismod fringilla. Pellentesque in cursus risus, eu hendrerit ligula. Quisque ultrices eget tortor ut eleifend. Praesent auctor libero nec quam fringilla faucibus. Curabitur cursus risus eu faucibus rutrum. Morbi dapibus nulla risus, et euismod eros posuere volutpat. Quisque ut diam diam. Quisque sed enim tortor. Suspendisse commodo magna nec felis ultricies laoreet. Donec sit amet vehicula eros. Phasellus at dapibus enim. Sed massa quam, aliquet eu mattis at, porttitor a nisi.

+
+

Hints

+

{{scope.hints}}

+
+
+
+

Cookies

+ + + + + + + + + + + + +
FieldValue
{{key}}{{value}}
+
+
+

Params

+ + + + + + + + + + +
ParamValue
{{param.name}}{{param.value}}
+ +
+
diff --git a/src/main/webapp/css/main.css b/src/main/webapp/css/main.css index 8f92c46c6..986950ba5 100644 --- a/src/main/webapp/css/main.css +++ b/src/main/webapp/css/main.css @@ -781,11 +781,17 @@ fieldset[disabled] .btn-warning.active { .lessonHelp, .lessonHelpBtn { display: none; } -/* -.paramsView { - float:right; - width 50%; - margin-right:10px; - border-left:2px solid #333; + +#hintsView, #cookiesAndParamsView { + display:none; } -*/ \ No newline at end of file + +.table-nonfluid { + width:auto; +} + +.cookieTable tr td, .paramsTable tr td { + padding: 3px; + max-width: 200px; + font-size: x-small; +} \ No newline at end of file diff --git a/src/main/webapp/js/goatControllers.js b/src/main/webapp/js/goatControllers.js index ab84128ee..a68ebd0b0 100644 --- a/src/main/webapp/js/goatControllers.js +++ b/src/main/webapp/js/goatControllers.js @@ -59,10 +59,13 @@ goat.controller('lessonHelpController', function($scope) { $scope.cookies=[]; $scope.params=[]; $scope.viewCookiesAndParams = function() { - $scope.cookies=goat.lesson.lessonInfo.cookies; - console.log($scope.cookies); - $scope.params=goat.lesson.lessonInfo.params; - + $('#hintsView').hide(); + if (goat.lesson.lessonInfo.cookies && goat.lesson.lessonInfo.cookies.length > 0) { + $scope.cookies=goat.lesson.lessonInfo.cookies; + console.log($scope.cookies); + $scope.params=goat.lesson.lessonInfo.params; + } + $('#cookiesAndParamsView').show(); //@TODO: issue callback to track view }; //$scope.watch()