summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn H. Anthony <johnhant@gmail.com>2010-09-04 23:39:01 +0200
committerJohn H. Anthony <johnhant@gmail.com>2010-09-04 23:39:01 +0200
commit1920c3b92b4852c467d35f44fc5913aeea39cf9d (patch)
tree08f4beb1815a1a12ba58ee1dc209f543589440d1
parent059a7efa13ff4147385013b8c6b62e5345e33b3c (diff)
enable voting for ViewQuotestability-improvements
-rw-r--r--html/quotes.jsp15
-rw-r--r--html/vote.js10
-rw-r--r--src/lq/ViewQuote.java1
3 files changed, 12 insertions, 14 deletions
diff --git a/html/quotes.jsp b/html/quotes.jsp
index 0602276..bd2f1f7 100644
--- a/html/quotes.jsp
+++ b/html/quotes.jsp
@@ -31,20 +31,7 @@ hr {
</pre>
<hr>
-<script>
-
-function vote(id, value) {
- var http = new XMLHttpRequest();
- http.open("GET","/vote?id="+id+"&vote="+value);
- http.onreadystatechange=function() {
- if(http.readyState==4) {
- document.getElementById("v"+id).innerHTML = http.responseText;
- }
- }
- http.send(null);
-}
-</script>
-
+<script src="/vote.js"></script>
<%
diff --git a/html/vote.js b/html/vote.js
new file mode 100644
index 0000000..90811e0
--- /dev/null
+++ b/html/vote.js
@@ -0,0 +1,10 @@
+function vote(id, value) {
+ var http = new XMLHttpRequest();
+ http.open("GET","/vote?id="+id+"&vote="+value);
+ http.onreadystatechange=function() {
+ if(http.readyState==4) {
+ document.getElementById("v"+id).innerHTML = http.responseText;
+ }
+ }
+ http.send(null);
+}
diff --git a/src/lq/ViewQuote.java b/src/lq/ViewQuote.java
index 411251b..adc6f51 100644
--- a/src/lq/ViewQuote.java
+++ b/src/lq/ViewQuote.java
@@ -45,6 +45,7 @@ public class ViewQuote extends HttpServlet {
"}" +
"</style> " +
"</head> " +
+ "<script src=\"/vote.js\"></script>" +
"<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\"> ";
}