Files
psalmenweb/Psalmenweb/target/psalmenweb-1.0.0-BUILD-SNAPSHOT/WEB-INF/views/hcindex.jsp
2025-04-13 20:31:08 +02:00

146 lines
3.7 KiB
Plaintext

<%@ page session="false"%>
<!DOCTYPE html>
<html>
<head>
<title>Index Catechismus</title>
<meta name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=0" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<link rel="stylesheet" href="resources/css/themes/Psalmenweb.min.css" />
<link rel="stylesheet" href="resources/css/psalmenweb.css" />
<style type="text/css">
a {
width: 20%;
}
.ui-btn {
height: 100px;
font-size: 60px;
line-height: 40px;
}
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script
src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.js"></script></head>
<body>
<div data-role="page" id="myPage" data-theme="a">
<div data-role="content" data-theme="a">
<a id="hc" style="width: 100%;" href="#" data-role="button" data-transition="fade" class="indexlabel" data-theme="a">Zondag <span id="choice"></span></a>
<div data-role="controlgroup" data-type="horizontal" class="localnav indexknoppengroep">
<a id="k7" href="#" data-role="button" data-theme="a">7</a>
&nbsp;
<a id="k8" href="#" data-role="button" data-theme="a">8</a>
&nbsp;
<a id="k9" href="#" data-role="button" data-theme="a">9</a>
</div>
<div data-role="controlgroup" data-type="horizontal" class="localnav indexknoppengroep">
<a id="k4" href="#" data-role="button" data-theme="a">4</a>
&nbsp;
<a id="k5" href="#" data-role="button" data-theme="a">5</a>
&nbsp;
<a id="k6" href="#" data-role="button" data-theme="a">6</a>
</div>
<div data-role="controlgroup" data-type="horizontal" class="localnav indexknoppengroep">
<a id="k1" href="#" data-role="button" data-theme="a">1</a>
&nbsp;
<a id="k2" href="#" data-role="button" data-theme="a">2</a>
&nbsp;
<a id="k3" href="#" data-role="button" data-theme="a">3</a>
</div>
<div data-role="controlgroup" data-type="horizontal" class="localnav indexknoppengroep">
<a id="kd" href="#" data-role="button" data-theme="a">&#8630;</a>
&nbsp;
<a id="k0" href="#" data-role="button" data-theme="a">0</a>
&nbsp;
<a id="ke" href="#" data-role="button" data-theme="a">&#x2714;</a>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$(".indexknoppengroep a").click(function() {
if ($("div.ui-loader.ui-overlay-shadow").length == 1) {
return;
}
var knop = this.id.substring(1);
switch(knop) {
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
addNumber(knop);
break;
case "d":
if ($("#choice").html().length == 0) {
window.history.back();
} else {
removeChar();
}
break;
case "e":
if (! $("#hc").hasClass("invalid")) {
var choice = $("#choice").html();
window.location.href = "hc?z=" + choice;
}
}
if ($("#choice").html().length == 0) {
$("a#kd span span").html("&#8630;");
} else {
$("a#kd span span").html("&#x25C0;");
}
});
});
function addNumber(knop) {
var choice = $("#choice").html();
var lengte = choice.length;
if (lengte == 2) {
choice = "";
}
if (lengte == 0 && knop == "0") {
return;
}
choice += knop;
$("#choice").html(choice);
checkCorrectChoice();
}
function removeChar() {
var choice = $("#choice").html();
var lengte = choice.length;
if (lengte > 0) {
choice = choice.substring(0, choice.length - 1);
$("#choice").html(choice);
}
checkCorrectChoice();
}
function checkCorrectChoice() {
var hc = parseInt($("#choice").html());
if (hc > 52) {
$("#hc").addClass("invalid");
} else {
$("#hc").removeClass("invalid");
}
}
</script>
</body>
</html>