This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
issues.php
153 lines (143 loc) · 5.82 KB
/
issues.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
?>
<!DOCTYPE html>
<html>
<head>
<!-- screen formatting -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no" />
<link rel="apple-touch-icon" href="images/apple-touch-icon.png" />
<link rel="stylesheet" href="css/jquery.mobile-1.1.0.min.css" />
<link rel="stylesheet" href="css/owncss.css"/>
<!--Javascript libraries-->
<script type="text/javascript" src="js/Libraries/jquery-1.7.1.min.js"></script>
<script src="js/Libraries/jquery.mobile-1.1.0.min.js"></script>
<!--Home made -->
<!-- <script src="js/Parsers/generateissues.js"></script>-->
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "data/issues.xml",
dataType: "xml",
success: function(xml){
count = $(xml).find("issue").each(function()
{
return $(this).children().length === 0;
}).length;
var j = 0;
while(j < count){
if(j==i){
$('#pager').append('<img src="images/pager_active.png"/>').trigger('create');
}
else{
$('#pager').append('<img src="images/pager_inactive.png"/>').trigger('create');
}
j++;
}
}
})
function genPager(i){
$('#pager').empty();
var j = 0;
while(j < count){
if(j==i){
$('#pager').append('<img src="images/pager_active.png"/>').trigger('create');
}
else{
$('#pager').append('<img src="images/pager_inactive.png"/>').trigger('create');
}
j++;
}
}
var i = 0;
getNode(i);
$('body').live('swipeleft swiperight',function(event){
if (event.type == "swipeleft") {
if(i == 0)
{
i = count-1;
genPager(i);
}
else{
i--;
genPager(i);
}
getNode(i);
}
if (event.type == "swiperight") {
if(i==count-1)
{
i=0;
genPager(i);
}
else{
i++;
genPager(i);
}
getNode(i);
}
});
});
window.onorientationchange = detectIPadOrientation;
function detectIPadOrientation () {
if ( orientation == 90 || orientation == -90) {
$('#wrap').hide();
$('#landscape').show();
}
else
{
$('#wrap').show();
$('#landscape').hide();
}
}
</script>
<script type="text/javascript">
function getNode(id) {
$.ajax({
type: "GET",
url: "data/issues.xml",
dataType: "xml",
success: function(xml){
oIssue = $(xml).find('issue:eq('+id+')');
$('#issues').empty();
$('#issues').append('<div id="block"><div id="titleissue"><strong>'+oIssue.find('title').text()+'</strong></div>'
+'<div id="issue_date">'+oIssue.find('date').text()+'</div>'
+'<div id=""><img src="'+oIssue.find('image').text()+'"alt="coverimage" id="coverimage"/></div>'
+'<div id="content"><a href="" id="downloadbtn" onclick="window.location.href='+"'"+'download.php?f='+oIssue.find('file').text()+"'"+'">Download</a></div></div><br />').trigger('create');
$('#uitleg').empty();
$('#uitleg').append(oIssue.find('text').text()).trigger('create');
}
})
}
</script>
<title>issues</title>
</head>
<body>
<div id="landscape"></div>
<div data-role="page" id="wrap">
<div data-role="header" data-position="fixed"><h1>Magazine</h1></div>
<div class="banner"><img src="images/20-1.jpg"/></div>
<div data-role="content">
<div id="issues"></div>
</div>
<div id="uitleg"></div>
<div id="pager"></div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li onclick="window.location.href='index.html'"><a href="">Update!</a></li>
<li onclick="window.location.href='xml-parser.html'"><a href="">Kalender</a></li>
<li onclick="window.location.href='freestuff.html'"><a href="">Free Stuff</a></li>
<li onclick="window.location.href='issues.php'"><a href="">Magazine</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>