diff options
Diffstat (limited to 'src/data/templates')
-rw-r--r-- | src/data/templates/quotes.hbs | 15 | ||||
-rw-r--r-- | src/data/templates/vote.hbs | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/data/templates/quotes.hbs b/src/data/templates/quotes.hbs index 0e38d22..45fa711 100644 --- a/src/data/templates/quotes.hbs +++ b/src/data/templates/quotes.hbs @@ -31,6 +31,18 @@ -moz-user-select: text; } </style> + <script type="text/javascript"> + 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> </head> <body> @@ -59,8 +71,7 @@ Dato: {{date}}, Score: <a href="javascript:vote({{id}},2)">2</a> <a href="javascript:vote({{id}},3)">3</a> <a href="javascript:vote({{id}},4)">4</a> - <a href="javascript:vote({{id}},5)">5</a> - </font></span>, + <a href="javascript:vote({{id}},5)">5</a></font></span>, <form method="post" style="display: inline;"action="http://www.vidarholen.net/contents/rage/index.php"><input type="hidden" name="irc" value="{{content}}"/><input type="submit" class="ragebutton" value="Rage it"/></form><br> <br> <br> diff --git a/src/data/templates/vote.hbs b/src/data/templates/vote.hbs new file mode 100644 index 0000000..135fa2f --- /dev/null +++ b/src/data/templates/vote.hbs @@ -0,0 +1,3 @@ +{{#with quote}} +{{score}} (fra {{votes}}) +{{/with}} |