Use the Fetch API instead of PrototypeJS
This commit is contained in:
parent
c622ada0df
commit
0876fc3c2e
@ -4,9 +4,6 @@
|
|||||||
<title>YouP0m Administration</title>
|
<title>YouP0m Administration</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<link rel="stylesheet" media="all" href="/css/style.css">
|
<link rel="stylesheet" media="all" href="/css/style.css">
|
||||||
<script type="text/javascript" src="/js/prototype.js"></script>
|
|
||||||
<script type="text/javascript" src="/js/youp0m.js"></script>
|
|
||||||
<script type="text/javascript" src="/js/youp0m-admin.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Welcome on YouP0m!</h1>
|
<h1>Welcome on YouP0m!</h1>
|
||||||
@ -19,5 +16,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.write("<h2>We are loading the newest cute pictures for you, please wait…</h2>");
|
document.write("<h2>We are loading the newest cute pictures for you, please wait…</h2>");
|
||||||
</script>
|
</script>
|
||||||
|
<script type="text/javascript" src="/js/youp0m.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/youp0m-admin.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -50,6 +50,11 @@ function show_picture(id) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (picts.length == 0) {
|
||||||
|
document.body.innerHTML = '<h1>Welcome on YouP0m!</h1><h2>There is no image currently, come back soon!</h2>';
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (id == null || id == "")
|
if (id == null || id == "")
|
||||||
id = picts[Math.floor(Math.random() * picts.length)].name;
|
id = picts[Math.floor(Math.random() * picts.length)].name;
|
||||||
|
|
||||||
@ -112,7 +117,7 @@ function display_picture(pict, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function display_error(msg) {
|
function display_error(msg) {
|
||||||
$$("body")[0].innerHTML = '<h1>An error occurs</h1><h2>' + msg + '</h2>';
|
document.body.innerHTML = '<h1>An error occurs</h1><h2>' + msg + '</h2>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sync() {
|
function sync() {
|
||||||
|
Loading…
Reference in New Issue
Block a user