From d414d1a5e464ec5c2eeabfc822c0c37a08037dbb Mon Sep 17 00:00:00 2001 From: Jason White Date: Sat, 30 Aug 2014 21:33:20 -0400 Subject: [PATCH] basic updates to UI, some js clean-up (moving some literals into goatConstants) --- src/main/webapp/WEB-INF/pages/main_new.jsp | 7 ++++++- src/main/webapp/css/main.css | 6 ++++++ src/main/webapp/js/goatConstants.js | 7 ++++++- src/main/webapp/js/goatUtil.js | 10 +++++----- src/main/webapp/lessonJS/sameOrigin.js | 4 ++-- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/WEB-INF/pages/main_new.jsp b/src/main/webapp/WEB-INF/pages/main_new.jsp index bfde6742f..d079279ff 100644 --- a/src/main/webapp/WEB-INF/pages/main_new.jsp +++ b/src/main/webapp/WEB-INF/pages/main_new.jsp @@ -64,7 +64,7 @@ diff --git a/src/main/webapp/css/main.css b/src/main/webapp/css/main.css index e71d2b014..278a3843c 100644 --- a/src/main/webapp/css/main.css +++ b/src/main/webapp/css/main.css @@ -747,4 +747,10 @@ fieldset[disabled] .btn-warning.active { #buttonPanel { padding:3px; width:auto; +} + +#topLinks { + float:right; + margin-right:5px; + margin-top:3px; } \ No newline at end of file diff --git a/src/main/webapp/js/goatConstants.js b/src/main/webapp/js/goatConstants.js index 6880e5fc8..00eb8196b 100644 --- a/src/main/webapp/js/goatConstants.js +++ b/src/main/webapp/js/goatConstants.js @@ -11,6 +11,11 @@ var goatConstants = { children:null, class:'fa-bars static' }], - lessonService: 'service/lessonmenu.mvc' + lessonService: 'service/lessonmenu.mvc', + cookieService: 'service/cookies_widget.mvc', + hintService:'service/hint_widget.mvc', + sourceService:'service/source.mvc', + solutionService:'service/solution.mvc', + lessonPlanService:'service/lessonplan.mvc' }; diff --git a/src/main/webapp/js/goatUtil.js b/src/main/webapp/js/goatUtil.js index fcf6443f7..e2179d84d 100644 --- a/src/main/webapp/js/goatUtil.js +++ b/src/main/webapp/js/goatUtil.js @@ -24,27 +24,27 @@ goat.utils = { return title; }, showLessonCookiesAndParams: function() { - $.get("service/cookies_widget.mvc", {}, function(reply) { + $.get(goatConstants.cookieService, {}, function(reply) { $("#lesson_cookies").html(reply); }, "html"); }, showLessonHint: function() { - $.get("service/hint_widget.mvc", {}, function(reply) { + $.get(goatConstants.hintService, {}, function(reply) { $("#lesson_hint").html(reply); }, "html"); }, showLessonSource: function() { - $.get("service/source.mvc", {}, function(reply) { + $.get(goatConstants.sourceService, {}, function(reply) { $("#lesson_source").html("
"+reply+"
"); }, "html"); }, showLessonSolution: function() { - $.get("service/solution.mvc", {}, function(reply) { + $.get(goatConstants.solutionService, {}, function(reply) { $("#lesson_solution").html(reply); }, "html"); }, showLessonPlan: function() { - $.get("service/lessonplan.mvc", {}, function(reply) { + $.get(goatConstants.lessonPlanService, {}, function(reply) { $("#lesson_plan").html(reply); }, "html"); } diff --git a/src/main/webapp/lessonJS/sameOrigin.js b/src/main/webapp/lessonJS/sameOrigin.js index 811f95b03..2acca8d2a 100644 --- a/src/main/webapp/lessonJS/sameOrigin.js +++ b/src/main/webapp/lessonJS/sameOrigin.js @@ -7,8 +7,8 @@ function submitXHR(){ document.getElementById("responseArea").innerHTML=""; - alert("creating XHR request for: " + document.getElementById("requestedURL").value); - + //alert("creating XHR request for: " + document.getElementById("requestedURL").value); + console.log("creating XHR request for: " + document.getElementById("requestedURL").value); try{