This commit is contained in:
Kovid Goyal 2012-01-06 14:35:29 +05:30
parent a3cbcfb6a4
commit 3eb93282f6
2 changed files with 11 additions and 11 deletions

View File

@ -47,7 +47,6 @@ mark_and_reload = (evt) ->
ypos = window_ypos()
newloc = window.location.href.replace(/#.*$/, '') + "#" + ypos + epubcfi
window.location.replace(newloc)
document.getElementById('current-cfi').innerHTML = window.current_cfi
window.location.reload()
setTimeout(fn, 1)
@ -64,10 +63,11 @@ window.onload = ->
if r
window.current_cfi = r[2]
ypos = if r[1] then 0+r[1] else 0
document.getElementById('current-cfi').innerHTML = window.current_cfi
base = document.getElementById('first-h1').innerHTML
document.title = base + ": " + window.current_cfi
fn = () ->
show_cfi()
window_ypos(ypos)
setTimeout(show_cfi, 1)
setTimeout(fn, 100)
null

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Testing CFI functionality</title>
<title>Testing EPUB CFI</title>
<script type="text/javascript" src="cfi.coffee"></script>
<script type="text/javascript" src="cfi-test.coffee"></script>
<style type="text/css">
@ -22,29 +22,29 @@
position:relative;
}
#current-cfi {
font-family: monospace;
border: solid 1px blue;
padding: 1em;
}
#overflow {
max-height: 100px;
overflow: scroll;
border: solid 1px black;
padding: 2em;
}
#whitespace {
border: 20px solid gray;
margin: 20px;
padding: 20px;
}
#reset {
color: blue;
text-decoration: none
}
</style>
</head>
<body>
<div id="container">
<h1 id="first-h1">Testing EPUB CFI</h1>
<div id="current-cfi">Current CFI:&nbsp;None</div>
<p><a href="/">Reset</a></p>
<p><a id="reset" href="/">Reset CFI to None</a></p>
<h2>A div with scrollbars</h2>
<p>Scroll down and click on some elements. Make sure to hit both bold and not bold text</p>
<div id="overflow">But I must explain to you how all this mistaken