Permalink
Browse files

add checkered background for calculation results

  • Loading branch information...
1 parent bcc9fe9 commit 539f50cbeb10493af9ae77e2d967a7766fd8d4bc @the42 committed Apr 8, 2012
Showing with 15 additions and 13 deletions.
  1. +10 −10 webzapfen/templates/en.division.tpl
  2. +4 −2 webzapfen/templates/en.zapfen.tpl
  3. +1 −1 webzapfen/webzapfen.go
@@ -2,18 +2,16 @@
<html>
<head>
<style type="text/css">
- .divisionColumn[data-division=true][data-boxed=true] {
- border: 1px solid black;
- display: inline-block;
- float: left;
+ .divisionOutputArea {
+ background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmAQMAAACS83vtAAAAAXNSR0IArs4c6QAAAAZQTFRF////mcz/7U0nzgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wECAceA9EbgDsAAAAYSURBVAjXY2BgUGBgYaAP+R8I/jDQ3UYApJwPAeJX0y0AAAAASUVORK5CYII=);
+ overflow: hidden;
}
- .divisionColumn[data-division=true] {
- display: inline-block;
- float: left;
+ .divisionColumn[data-division=true], .divisionColumn[data-result=true] {
+ display: inline-block;
+ float: left;
}
- .divisionColumn[data-result=true] {
- display: inline-block;
- float: left;
+ .divisionColumn[data-division=true][data-boxed=true] {
+ border: 1px solid black;
}
</style>
<title>Division</title>
@@ -39,6 +37,7 @@
</form>{{if .SDivide}}
<div class="divisionOutputArea">
{{tplfuncdivdisplay .SDivide .Boxed}}
+Hallo Welt!
</div>{{end}}
<script type="text/javascript">
function changeBox() {
@@ -49,6 +48,7 @@
}
}
}
+
document.getElementById('boxedresult').addEventListener('click', changeBox);
document.getElementById('submitprec').addEventListener('click', function() { document.forms[0].submit();} );
</script>
@@ -2,6 +2,9 @@
<html>
<head>
<style type="text/css">
+ .zapfenOutputArea {
+ background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmAQMAAACS83vtAAAAAXNSR0IArs4c6QAAAAZQTFRF////mcz/7U0nzgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wECAceA9EbgDsAAAAYSURBVAjXY2BgUGBgYaAP+R8I/jDQ3UYApJwPAeJX0y0AAAAASUVORK5CYII=);
+ }
.zapfenmultiplier, .zapfendividend {
text-align: right;
}
@@ -22,7 +25,6 @@
text-decoration: none;
}
a.emptylink:hover {
- color:blue;
font-weight:bold;
}
</style>
@@ -39,7 +41,7 @@
Number: <input type="text" name="number" value="{{.Number}}" autofocus="true"/>
<input type="submit" value="Submit" />
</form>{{if .Zapfen}}
- <a href='#' id='toggleallintermedsteps' class='emptylink'>Toggle</a> display of intermediate division steps
+ <button id='toggleallintermedsteps' >Toggle</button> display of intermediate division steps
<div class="zapfenOutputArea">
<table>
{{tplfunczapfendisplay .Zapfen .IntermedZapfen}}
View
@@ -234,7 +234,7 @@ func tplfunczapfendisplay(zapfen *schoolcalc.Zapfen, steps [8]*schoolcalc.SDivid
}
for i := 0; i < 8; i++ {
- retstring += fmt.Sprintf("\n<tr>\n <td class='zapfendividend'><a href='#' class='zapfendividenditem emptylink' id='zapfendividenditem%d'>%s</a></td><td>:</td><td>%d</td><td>=</td><td>%s</td>\n</tr>\n", i, input, i+2, zapfen.Divzapfen[i])
+ retstring += fmt.Sprintf("\n<tr>\n <td class='zapfendividend'><a href='javascript:void(0);' class='zapfendividenditem emptylink' id='zapfendividenditem%d'>%s</a></td><td>:</td><td>%d</td><td>=</td><td>%s</td>\n</tr>\n", i, input, i+2, zapfen.Divzapfen[i])
var divisorintermed string = ""

0 comments on commit 539f50c

Please sign in to comment.