replaced all important links with javascript links, thus effectively enabling the

app to be a true offline app.
This commit is contained in:
Manuel Friedli 2014-09-02 18:53:20 +02:00
parent 28670a66bb
commit a5599242f6
2 changed files with 14 additions and 21 deletions

View File

@ -43,29 +43,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<script type="text/javascript" src="js/uhr-fr.js"></script>
<script type="text/javascript" src="js/uhr-it.js"></script>
<script type="text/javascript">
(function(doc, nav, standalone) {
if ((standalone in nav) && nav[standalone]) {
var curnode;
var loc = doc.location;
var stop = /^(a|html)$/i;
doc.addEventListener('click', function(e) {
curnode = e.target;
while (!(stop).test(curnode.nodeName)) {
curnode = curnode.parentNode;
}
if ('href' in curnode && (curnode.href.indexOf('http') || ~curnode.href.indexOf(location.host))) {
e.preventDefault();
location.href=curnode.href;
}
}, false);
}
}(document, window.navigator, 'standalone'));
function go(url) {
window.location = url;
return true;
}
</script>
</head>
<body style="padding:0;margin:0;">
<div id="uhr"></div>
<p id="disclaimer">Created by <a href="http://www.fritteli.ch/">fritteli</a>, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>. <a
href="info/">Read more!</a> - <a href="showcase">View full showcase!</a></p>
onclick="go('info/')" href="#">Read more!</a> - <a href="showcase">View full showcase!</a></p>
<script type="text/javascript">
(function($) {
var width = $(window).width();

View File

@ -27,6 +27,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<script type="text/javascript" src="../lib/jquery-cookie-1.4.0.js"></script>
<script type="text/javascript" src="../js/uhr.js"></script>
<script type="text/javascript" src="../js/uhr-de_CH.js"></script>
<script type="text/javascript">
function go(url) {
window.location = url;
return true;
}
</script>
</head>
<body>
<h1 id="main-title">Die Zeit im Wort</h1>
@ -59,10 +65,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Website einbauen kannst. Denn das darfst du gerne tun, solange du
dich dabei an die Regeln der <a href="#license">Lizenz</a> hältst.</p>
<p><a href="..">Das interessiert mich nicht, ich will zurück zur grossen Uhr!</a></p>
<p><a onclick="go('../')" href="#">Das interessiert mich nicht, ich will zurück zur grossen Uhr!</a></p>
<h2 id="the-clock">Die Uhr<a href="#toc" class="toclink">Zum Inhalt</a></h2>
<a href="../">
<a onclick="go('../')" href="#">
<div id="uhr1"></div>
</a>
@ -191,7 +197,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
oder ein gravierender Nachteil erwachsen, so soll sich diese Person bei mir melden und wir werden bestimmt eine Lösung finden, die für alle
beteiligten angemessen ist. Allen anderen Personen wünsche ich viel Freude mit der Zeit im Wort.</p>
<p>Der Quellcode ist frei zugänglich unter <a href="https://git.friedli.info/manuel/uhr">https://git.friedli.info/manuel/uhr</a>.</p>
<p>Der Quellcode ist frei zugänglich unter <a href="https://gittr.ch/manuel/uhr">https://gittr.ch/manuel/uhr</a>.</p>
<h2 id="license">Lizenzbestimmungen<a href="#toc" class="toclink">Zum Inhalt</a></h2>