File app/index.html changed (mode: 100755 -> 100644) (index d231005..9cdf3d5) |
1 |
1 |
<!doctype html> |
<!doctype html> |
2 |
2 |
<html> |
<html> |
3 |
3 |
<head> |
<head> |
4 |
|
<link rel="stylesheet" href="css/app.css" type="text/css"> |
|
5 |
|
<link rel="stylesheet" href="css/page.css" type="text/css"> |
|
6 |
|
<link rel="stylesheet" href="css/list-bare.css" type="text/css"> |
|
7 |
|
<link rel="stylesheet" href="css/animate.css" type="text/css"> |
|
8 |
|
<link rel="stylesheet" href="css/utils.css" type="text/css"> |
|
|
4 |
|
<link rel="stylesheet" href="app.css" type="text/css"> |
|
5 |
|
<link rel="stylesheet" href="page.css" type="text/css"> |
|
6 |
|
<link rel="stylesheet" href="list-bare.css" type="text/css"> |
|
7 |
|
<link rel="stylesheet" href="animate.css" type="text/css"> |
|
8 |
|
<link rel="stylesheet" href="utils.css" type="text/css"> |
9 |
9 |
</head> |
</head> |
10 |
10 |
<body> |
<body> |
11 |
11 |
|
|
12 |
12 |
<ul class="oPage_list"> |
<ul class="oPage_list"> |
13 |
13 |
<li id="Page0" class="oPage isActive uCenter"> |
<li id="Page0" class="oPage isActive uCenter"> |
14 |
|
<img class="oPage_logo" src="images/logo.png" /> |
|
|
14 |
|
<img class="oPage_logo" src="logo.png" /> |
15 |
15 |
|
|
16 |
16 |
<small>V 5.0.0</small> |
<small>V 5.0.0</small> |
17 |
17 |
|
|
|
20 |
20 |
<small>de la</small> |
<small>de la</small> |
21 |
21 |
|
|
22 |
22 |
<div class="oPage_link">www.teologie.net</div> |
<div class="oPage_link">www.teologie.net</div> |
|
23 |
|
|
|
24 |
|
<div id="debug"></div> |
23 |
25 |
</li> |
</li> |
24 |
26 |
|
|
25 |
27 |
<li id="Page1" class="oPage"> |
<li id="Page1" class="oPage"> |
26 |
28 |
<div class="oPage_hero"> |
<div class="oPage_hero"> |
27 |
|
<img src="images/christ_icon.jpg" /> |
|
|
29 |
|
<img src="christ_icon.jpg" /> |
28 |
30 |
</div> |
</div> |
29 |
31 |
|
|
30 |
32 |
<h2 id="AppTitle" class="oPage_header fillMain">Texte Liturgice Ortodoxe</h2> |
<h2 id="AppTitle" class="oPage_header fillMain">Texte Liturgice Ortodoxe</h2> |
|
43 |
45 |
<!-- -------------------------------------- --> |
<!-- -------------------------------------- --> |
44 |
46 |
|
|
45 |
47 |
<script type="text/javascript"> |
<script type="text/javascript"> |
46 |
|
|
|
|
48 |
|
console.log('Start JS'); |
47 |
49 |
var DONE = 4; // readyState 4 means the request is done. |
var DONE = 4; // readyState 4 means the request is done. |
48 |
50 |
var OK = 200; // status 200 is a successful return. |
var OK = 200; // status 200 is a successful return. |
49 |
51 |
|
|
|
52 |
|
var elDebug = document.getElementById('debug'); |
50 |
53 |
var elPageIndex = document.getElementById('Page0'); |
var elPageIndex = document.getElementById('Page0'); |
51 |
54 |
var elPageHome = document.getElementById('Page1'); |
var elPageHome = document.getElementById('Page1'); |
52 |
55 |
var elPageChapter = document.getElementById('Page2'); |
var elPageChapter = document.getElementById('Page2'); |
|
223 |
226 |
|
|
224 |
227 |
setTimeout( function () { |
setTimeout( function () { |
225 |
228 |
changePage(elPageHome, elPageChapter, function () { listChaper(chapterBooks, bookId); }); |
changePage(elPageHome, elPageChapter, function () { listChaper(chapterBooks, bookId); }); |
226 |
|
}, 200); |
|
|
229 |
|
}, 2000); |
227 |
230 |
} |
} |
228 |
231 |
}; |
}; |
229 |
232 |
} |
} |
230 |
233 |
|
|
231 |
234 |
document.addEventListener('DOMContentLoaded', function() { |
document.addEventListener('DOMContentLoaded', function() { |
232 |
|
var xhr = new XMLHttpRequest(); |
|
233 |
|
xhr.open('GET', 'books.json'); |
|
234 |
|
xhr.send(null); |
|
235 |
|
|
|
236 |
|
xhr.onreadystatechange = function () { |
|
237 |
|
if (xhr.readyState === DONE) { |
|
238 |
|
if (xhr.status === OK) { |
|
239 |
|
mainBooks = JSON.parse(xhr.responseText); |
|
240 |
|
} else { |
|
241 |
|
console.log('Error: ' + xhr.status); // An error occurred during the request. |
|
242 |
|
} |
|
243 |
|
|
|
244 |
|
setTimeout( function () { |
|
245 |
|
changePage(elPageIndex, elPageHome, listBooks); |
|
246 |
|
}, 200); |
|
247 |
|
} |
|
248 |
|
}; |
|
|
235 |
|
var oReq = new XMLHttpRequest(); |
|
236 |
|
oReq.onload = function (e) { |
|
237 |
|
var responseText = e.target.response.toString(); |
|
238 |
|
elDebug.innerHTML += responseText; |
|
239 |
|
mainBooks = JSON.parse(responseText); |
|
240 |
|
changePage(elPageIndex, elPageHome, listBooks); |
|
241 |
|
}; |
|
242 |
|
|
|
243 |
|
oReq.onreadystatechange = function () { |
|
244 |
|
document.getElementById('debug').innerHTML+=' | Was clicked' + |
|
245 |
|
toReadyStateDescription(oReq.readyState); |
|
246 |
|
}; |
|
247 |
|
oReq.open('GET', "books.json", true); |
|
248 |
|
oReq.send(); |
|
249 |
|
|
|
250 |
|
// var xhr = new XMLHttpRequest(); |
|
251 |
|
// xhr.open('GET', 'books.json'); |
|
252 |
|
// xhr.send(null); |
|
253 |
|
// console.log('Request books.json'); |
|
254 |
|
|
|
255 |
|
// xhr.onreadystatechange = function () { |
|
256 |
|
// if (xhr.readyState === DONE) { |
|
257 |
|
// elDebug.textContent += 'Received data'; |
|
258 |
|
// if (xhr.status === OK) { |
|
259 |
|
|
|
260 |
|
// elDebug.textContent += xhr.responseText; |
|
261 |
|
// mainBooks = JSON.parse(xhr.responseText); |
|
262 |
|
// console.log(mainBooks); |
|
263 |
|
// } else { |
|
264 |
|
// elDebug.textContent += 'Error: ' + xhr.status; |
|
265 |
|
// } |
|
266 |
|
|
|
267 |
|
// // setTimeout( function () { |
|
268 |
|
// //changePage(elPageIndex, elPageHome, listBooks); |
|
269 |
|
// // }, 2000); |
|
270 |
|
// } |
|
271 |
|
// }; |
249 |
272 |
}); |
}); |
250 |
273 |
|
|
251 |
274 |
</script> |
</script> |