mirror of https://github.com/kurisufriend/frontend
parent
d481ac7935
commit
4c9a56f4cc
@ -1,45 +1,50 @@ |
|||||||
<html> |
<html> |
||||||
|
|
||||||
<head> |
<head> |
||||||
<title>Mangaloid</title> |
<title>Mangaloid</title> |
||||||
|
|
||||||
<meta charset="UTF-8"/> |
<meta charset="UTF-8" /> |
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/stylesheet.css"/> |
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" /> |
||||||
</head> |
</head> |
||||||
|
|
||||||
<body> |
<body> |
||||||
<div id="header"> |
<div id="header"> |
||||||
<a href="./catalog.html"><img id="home" src="img/home.png"/></a> |
<a href="./catalog.html"><img id="home" src="img/home.png" /></a> |
||||||
<form action="/search.html"> |
<form action="/search.html"> |
||||||
<input id="search_bar" type="search" name="title" placeholder="Search"> |
<input id="search_bar" type="search" name="title" placeholder="Search"> |
||||||
<button id="search_button" type="submit">Search</button> |
<button id="search_button" type="submit">Search</button> |
||||||
</form> |
</form> |
||||||
<img id="logo" src="img/logo.png"/> |
<img id="logo" src="img/logo.png" /> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div id="content"> |
<div id="content"> |
||||||
<div style="position:relative;top:20px;"> |
<div style="position:relative;top:20px;"> |
||||||
<p>Instance address:</p> |
<p>Instance address:</p> |
||||||
<input style="width:500px" id="address" placeholder="test.cynic.moe"></input> |
<input style="width:500px" id="address" placeholder="test.cynic.moe"></input> |
||||||
<button onclick="update_address()">Update</button> |
<button onclick="update_address()">Update</button> |
||||||
<button onclick="clear_instance()">Default</button> |
<button onclick="clear_instance()">Default</button> |
||||||
<p>Current: </p><p id="instance_addr"></p> |
<p>Current: </p> |
||||||
</div> |
<p id="instance_addr"></p> |
||||||
|
</div> |
||||||
<div id="footer"> |
<div id="footer"> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<script type="text/javascript" src="js/cookie.js"></script> |
<script type="text/javascript" src="js/instance.js"></script> |
||||||
<script> |
<script> |
||||||
document.onreadystatechange = function () { |
document.onreadystatechange = function () { |
||||||
var addr = get_instance(); |
var addr = get_instance(); |
||||||
document.getElementById("instance_addr").innerHTML = addr; |
document.getElementById("address").setAttribute("placeholder", DEFAULT_INSTANCE); |
||||||
} |
document.getElementById("instance_addr").innerHTML = addr; |
||||||
function update_address() { |
} |
||||||
var addr = document.getElementById("address").value; |
function update_address() { |
||||||
set_instance(addr); |
var addr = document.getElementById("address").value; |
||||||
console.log(addr); |
set_instance(addr); |
||||||
} |
console.log(addr); |
||||||
|
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
</body> |
</body> |
||||||
</html> |
|
||||||
|
</html> |
@ -1,17 +0,0 @@ |
|||||||
function get_instance() { |
|
||||||
var addr = "test.cynic.moe"; |
|
||||||
var cookie = document.cookie; |
|
||||||
if(cookie != "") { |
|
||||||
addr = decodeURIComponent(cookie).split(";")[0].split("=")[1]; |
|
||||||
} |
|
||||||
return addr; |
|
||||||
} |
|
||||||
|
|
||||||
function set_instance(addr) { |
|
||||||
var str = "Instance="+addr+"; SameSite=Lax;"; |
|
||||||
document.cookie = str; |
|
||||||
} |
|
||||||
|
|
||||||
function clear_instance() { |
|
||||||
document.cookie = "Instance=test.cynic.moe; SameSite=Lax;"; |
|
||||||
} |
|
@ -0,0 +1,13 @@ |
|||||||
|
const DEFAULT_INSTANCE = "test.cynic.moe"; |
||||||
|
|
||||||
|
function get_instance() { |
||||||
|
return localStorage.getItem("instance") || DEFAULT_INSTANCE; |
||||||
|
} |
||||||
|
|
||||||
|
function set_instance(addr) { |
||||||
|
localStorage.setItem("instance", addr); |
||||||
|
} |
||||||
|
|
||||||
|
function clear_instance() { |
||||||
|
localStorage.setItem("instance", DEFAULT_INSTANCE); |
||||||
|
} |
@ -1,54 +1,58 @@ |
|||||||
<html> |
<html> |
||||||
<head> |
|
||||||
<title>Mangaloid</title> |
|
||||||
|
|
||||||
<meta charset="UTF-8"/> |
<head> |
||||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/> |
<title>Mangaloid</title> |
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/stylesheet.css"/> |
<meta charset="UTF-8" /> |
||||||
<link rel="stylesheet" type="text/css" href="css/reader.css"/> |
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" /> |
||||||
</head> |
|
||||||
<body> |
|
||||||
|
|
||||||
<div id="titlebar_container"> |
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" /> |
||||||
|
<link rel="stylesheet" type="text/css" href="css/reader.css" /> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
|
||||||
|
<div id="titlebar_container"> |
||||||
<div id="titlebar"> |
<div id="titlebar"> |
||||||
<button class="back" onclick="history.back()"> |
<button class="back" onclick="history.back()"> |
||||||
<img class="back" src="img/back.png"/> |
<img class="back" src="img/back.png" /> |
||||||
</button> |
</button> |
||||||
|
|
||||||
<span class="text"></span> |
<span class="text"></span> |
||||||
|
|
||||||
<button class="download"> |
<button class="download"> |
||||||
<img class="download" src="img/download.png"/> |
<img class="download" src="img/download.png" /> |
||||||
</button> |
</button> |
||||||
<button class="layout"> |
<button class="layout"> |
||||||
<img class="layout" src="img/single.png"/> |
<img class="layout" src="img/single.png" /> |
||||||
</button> |
</button> |
||||||
<button class="fit"> |
<button class="fit"> |
||||||
<img class="fit" src="img/height.png"/> |
<img class="fit" src="img/height.png" /> |
||||||
</button> |
</button> |
||||||
<button class="invert"> |
<button class="invert"> |
||||||
<img class="invert" src="img/invert.png"/> |
<img class="invert" src="img/invert.png" /> |
||||||
</button> |
</button> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div id="page_left"></div> |
<div id="page_left"></div> |
||||||
<div id="page_right"></div> |
<div id="page_right"></div> |
||||||
<div id="page_view"></div> |
<div id="page_view"></div> |
||||||
|
|
||||||
<div id="footer"> |
<div id="footer"> |
||||||
<span id="counter">0/?</span> |
<span id="counter">0/?</span> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<script type="text/javascript" src="js/reader.js"></script> |
<script type="text/javascript" src="js/reader.js"></script> |
||||||
<script> |
<script type="text/javascript" src="js/instance.js"></script> |
||||||
document.onreadystatechange = function () { |
<script> |
||||||
if(document.readyState == "interactive"){ |
document.onreadystatechange = function () { |
||||||
var addr = decodeURIComponent(document.cookie).split(";")[0].split("=")[1]; |
if (document.readyState == "interactive") { |
||||||
load_pages("https://"+addr); |
var addr = get_instance(); |
||||||
} |
load_pages("https://" + addr); |
||||||
} |
} |
||||||
</script> |
} |
||||||
</body> |
</script> |
||||||
</html> |
</body> |
||||||
|
|
||||||
|
</html> |
Loading…
Reference in new issue