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