2013-01-11 18:48:15 +04:00
|
|
|
<html>
|
|
|
|
|
<head>
|
2013-01-21 05:55:56 +04:00
|
|
|
<title>Magazine</title>
|
|
|
|
|
<link rel="stylesheet" href="magazine.css">
|
2013-01-11 18:48:15 +04:00
|
|
|
<script src="jquery.js"></script>
|
|
|
|
|
<script src="jquery.touchSwipe.js"></script>
|
2013-01-22 18:04:33 +04:00
|
|
|
<script src="jstorage.js"></script>
|
|
|
|
|
|
2013-01-23 01:37:39 +04:00
|
|
|
<script src="magazine.js"></script>
|
2013-01-21 05:55:56 +04:00
|
|
|
|
2013-01-22 18:39:44 +04:00
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2013-01-23 00:42:27 +04:00
|
|
|
|
|
|
|
|
if(DEBUG){
|
|
|
|
|
$('.splash').click(function(){
|
|
|
|
|
$('.splash').fadeOut()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-01-22 19:03:26 +04:00
|
|
|
$(window)
|
|
|
|
|
.resize(function() {
|
|
|
|
|
fitNPages(PAGES_VISIBLE)
|
|
|
|
|
})
|
2013-01-23 16:31:30 +04:00
|
|
|
.bind('hashchange', function(e){
|
|
|
|
|
e.preventDefault()
|
2013-01-23 00:46:30 +04:00
|
|
|
setCurrentPage(loadURLState())
|
|
|
|
|
})
|
2013-01-22 18:39:44 +04:00
|
|
|
|
|
|
|
|
$('.viewer')
|
|
|
|
|
.swipe({
|
|
|
|
|
swipeStatus: swipeUpdate,
|
|
|
|
|
// XXX change this to pinch...
|
|
|
|
|
swipeUp: function(){
|
2013-01-23 05:53:42 +04:00
|
|
|
//togglePageView('off')
|
|
|
|
|
togglePageView()
|
2013-01-22 18:39:44 +04:00
|
|
|
},
|
|
|
|
|
// XXX change this to pinch...
|
|
|
|
|
swipeDown: function(){
|
2013-01-23 05:53:42 +04:00
|
|
|
//togglePageView('on')
|
|
|
|
|
togglePageView()
|
2013-01-22 18:39:44 +04:00
|
|
|
},
|
2013-01-23 16:35:30 +04:00
|
|
|
|
|
|
|
|
pinchIn: function(event, direction, distance, duration, fingerCount, pinchZoom) {
|
2013-01-23 17:45:42 +04:00
|
|
|
if(pinchZoom < distance){
|
|
|
|
|
return
|
|
|
|
|
}
|
2013-01-23 16:40:26 +04:00
|
|
|
if(fingerCount == 2){
|
|
|
|
|
togglePageView('on')
|
|
|
|
|
}
|
2013-01-23 16:35:30 +04:00
|
|
|
},
|
|
|
|
|
pinchOut: function(event, direction, distance, duration, fingerCount, pinchZoom) {
|
2013-01-23 17:45:42 +04:00
|
|
|
if(pinchZoom < distance){
|
|
|
|
|
return
|
|
|
|
|
}
|
2013-01-23 16:40:26 +04:00
|
|
|
if(fingerCount == 2){
|
|
|
|
|
togglePageView('off')
|
|
|
|
|
}
|
2013-01-23 16:35:30 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2013-01-22 18:39:44 +04:00
|
|
|
// XXX for some reason this deos not bubble up the nested elements...
|
|
|
|
|
click: function(evt, elem){
|
|
|
|
|
if($(elem).hasClass('page')){
|
|
|
|
|
setCurrentPage(elem)
|
2013-01-23 04:10:05 +04:00
|
|
|
//togglePageView('on')
|
2013-01-22 18:39:44 +04:00
|
|
|
} else if($(elem).hasClass('content')){
|
|
|
|
|
setCurrentPage($(elem).parents('.page').first())
|
2013-01-23 04:10:05 +04:00
|
|
|
//togglePageView('on')
|
2013-01-22 18:39:44 +04:00
|
|
|
}
|
|
|
|
|
return true
|
2013-01-23 16:40:26 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fingers: $.fn.swipe.fingers.ALL
|
2013-01-22 18:39:44 +04:00
|
|
|
})
|
|
|
|
|
$('.button.cover').swipe({click: goToMagazineCover})
|
|
|
|
|
$('.button.next-article').swipe({click: nextArticle})
|
|
|
|
|
$('.button.prev-article').swipe({click: prevArticle})
|
|
|
|
|
|
2013-01-22 19:19:43 +04:00
|
|
|
loadState()
|
2013-01-22 18:39:44 +04:00
|
|
|
|
|
|
|
|
togglePageView('on')
|
|
|
|
|
|
|
|
|
|
// hide the splash screen...
|
|
|
|
|
$(window).one('webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend',
|
|
|
|
|
function(){
|
|
|
|
|
$('.splash').fadeOut()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
2013-01-11 18:48:15 +04:00
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
2013-01-21 05:55:56 +04:00
|
|
|
|
|
|
|
|
<div class="viewer">
|
2013-01-22 00:36:32 +04:00
|
|
|
|
2013-01-22 18:39:44 +04:00
|
|
|
<!-- Splash screen -->
|
|
|
|
|
<div class="splash noSwipe">
|
|
|
|
|
<!-- XXX replace this with a background-image logo... -->
|
|
|
|
|
<table width="100%" height="100%"><tr><td align="center" valign="middle">
|
|
|
|
|
<h2><i>loading...</i></h2>
|
|
|
|
|
</td></tr></table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
2013-01-22 18:04:33 +04:00
|
|
|
<!-- XXX Magazine title... -->
|
|
|
|
|
|
2013-01-22 01:26:37 +04:00
|
|
|
<div class="top-toolbar">
|
|
|
|
|
<div class="button cover">Issue Cover</div>
|
|
|
|
|
<div class="button prev-article">Prev Article</div>
|
|
|
|
|
<div class="button next-article">Next Article</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bottom-toolbar">
|
2013-01-23 05:53:42 +04:00
|
|
|
<!-- this is just an example-->
|
|
|
|
|
<a href="#home">Cover</a> |
|
|
|
|
|
<a href="#prevArticle">Previous article</a> |
|
|
|
|
|
<a href="#prev">Previous page</a> |
|
|
|
|
|
<a href="#next">Next page</a> |
|
|
|
|
|
<a href="#nextArticle">Next article</a> |
|
|
|
|
|
<a href="#end">End</a>
|
2013-01-22 01:26:37 +04:00
|
|
|
</div>
|
2013-01-22 00:36:32 +04:00
|
|
|
|
2013-01-21 05:55:56 +04:00
|
|
|
<div class="scaler">
|
|
|
|
|
<div class="aligner">
|
|
|
|
|
<div class="magazine">
|
|
|
|
|
<div class="cover page current">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
2013-01-23 04:10:05 +04:00
|
|
|
<h1>Magazine Cover</h1>
|
2013-01-23 05:53:42 +04:00
|
|
|
<h2>Navigation via #URLs</h2>
|
|
|
|
|
<h3>The basics</h3>
|
|
|
|
|
<a href="#1">Page #1</a><br>
|
|
|
|
|
<a href="#ArticleAnchorExample">Named page</a><br>
|
2013-01-23 16:31:30 +04:00
|
|
|
<p>
|
|
|
|
|
<a href="#page-3-anchor">Anchor on page #3</a><br>
|
|
|
|
|
<i>BUG: currently navigation via existing anchors
|
|
|
|
|
will break the layout, so use the name attribute
|
|
|
|
|
on any other tags (see example).
|
|
|
|
|
</i>
|
|
|
|
|
</p>
|
2013-01-23 04:10:05 +04:00
|
|
|
|
|
|
|
|
<h3>Special anchors</h3>
|
2013-01-23 05:53:42 +04:00
|
|
|
<p>These show up in the page URL</p>
|
2013-01-23 04:10:05 +04:00
|
|
|
<a href="#home">Magazine cover</a><br>
|
2013-01-23 05:53:42 +04:00
|
|
|
<a href="#end">Last page</a><br>
|
2013-01-23 04:10:05 +04:00
|
|
|
<a href="#thumbnails">Thumbnail view</a><br>
|
2013-01-23 05:53:42 +04:00
|
|
|
<a href="#example-layer">Toggle a hidden layer</a><br>
|
|
|
|
|
<span name="example-layer" class="hidden">
|
|
|
|
|
<a href="#hideLayers">Hide all layers</a><br>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<h3>Relative special anchors</h3>
|
|
|
|
|
<p>These will get replaced by corresponding page numbers in the URL</p>
|
|
|
|
|
<a href="#next">Next page</a><br>
|
|
|
|
|
<a href="#prev">Previous page</a><br>
|
|
|
|
|
<a href="#nextArticle">Next article</a><br>
|
|
|
|
|
<a href="#prevArticle">Previous article</a><br>
|
|
|
|
|
|
2013-01-23 16:31:30 +04:00
|
|
|
<div name="example-layer" class="hidden" onclick="window.location.hash='example-layer'" style="position:absolute; left:400px; top:250px; width: 250px; height:50px; text-align: center; padding: 15px; border: solid gray 5px; background: silver; color: white">
|
2013-01-23 06:04:18 +04:00
|
|
|
This is an example layer<br><br>
|
|
|
|
|
<i>click or tap to hide</i>
|
2013-01-23 05:53:42 +04:00
|
|
|
</div>
|
2013-01-21 20:05:05 +04:00
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- XXX do we need a Magazine Credits page??? -->
|
|
|
|
|
|
|
|
|
|
<div class="article">
|
|
|
|
|
<div class="cover page">
|
2013-01-21 18:04:10 +04:00
|
|
|
<div class="content">
|
2013-01-23 04:10:05 +04:00
|
|
|
<h1>Article Cover</h1>
|
|
|
|
|
<a href="#home">home</a><br>
|
2013-01-21 18:04:10 +04:00
|
|
|
some more text...
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- XXX do we need an Article Credits page??? -->
|
|
|
|
|
|
|
|
|
|
<div class="page">
|
2013-01-22 00:36:32 +04:00
|
|
|
<div class="content" style="border:solid red 1px">
|
2013-01-21 20:05:05 +04:00
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
2013-01-23 16:31:30 +04:00
|
|
|
<a name="page-3-anchor"></a>
|
2013-01-21 20:05:05 +04:00
|
|
|
Page
|
2013-01-21 21:09:15 +04:00
|
|
|
<img src="img.jpg" height="100%"/>
|
2013-01-21 20:05:05 +04:00
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
2013-01-22 00:57:01 +04:00
|
|
|
<img src="img.jpg" width="200%" style="margin-left: -50%; margin-top: -20%"/>
|
2013-01-21 20:05:05 +04:00
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="article">
|
|
|
|
|
<div class="cover page">
|
2013-01-23 04:10:05 +04:00
|
|
|
<div class="content" name="ArticleAnchorExample">
|
|
|
|
|
<!--a name="ArticleAnchorExample"></a-->
|
|
|
|
|
<h1>Article Cover</h1>
|
|
|
|
|
<a href="#home">home</a><br>
|
2013-01-21 20:05:05 +04:00
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="article">
|
|
|
|
|
<div class="cover page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
2013-01-23 04:10:05 +04:00
|
|
|
<h1>Article Cover</h1>
|
|
|
|
|
<a href="#home">home</a><br>
|
2013-01-21 20:05:05 +04:00
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
|
|
|
|
Page
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
<div class="page">
|
2013-01-21 20:05:05 +04:00
|
|
|
<div class="content">
|
2013-01-23 04:10:05 +04:00
|
|
|
Page<br>
|
|
|
|
|
<a href="#home">home</a><br>
|
2013-01-21 20:05:05 +04:00
|
|
|
</div>
|
2013-01-11 18:48:15 +04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2013-01-21 05:55:56 +04:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
2013-01-11 18:48:15 +04:00
|
|
|
</body>
|
|
|
|
|
</html>
|