added new views
added loading information added no account information
This commit is contained in:
parent
b41d97985d
commit
d5187c7332
@ -80,7 +80,11 @@ async function main(){
|
||||
if(!user){
|
||||
user = await (await fetch("/api/getuser")).json()
|
||||
username = user.username
|
||||
if(!username)username = user.error
|
||||
if(!username){
|
||||
document.getElementById("noaccount").style=""
|
||||
} else {
|
||||
document.getElementById("loading").style="display:none;"
|
||||
}
|
||||
document.getElementById("username-self").innerText = username
|
||||
}
|
||||
|
||||
@ -166,3 +170,6 @@ if(window.location.href.includes("mention=")) {
|
||||
if(window.location.href.includes("message=")) {
|
||||
document.getElementById("post-text").innerText = `${decodeURIComponent(window.location.href.split("message=")[1])} `
|
||||
}
|
||||
|
||||
|
||||
document.getElementById("scriptonly").style = ""
|
||||
|
@ -11,13 +11,26 @@
|
||||
<script type="text/javascript" src="/js/markdown.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="self">
|
||||
Username: <span class="Username" id="username-self"></span> <br>
|
||||
<textarea name="name" id="post-text" rows="8" cols="80"></textarea>
|
||||
<br>
|
||||
<button type="button" name="button" id="post-btn" onclick="postMessage()">Post</button>
|
||||
<div id="loading">
|
||||
<h1>Loading...</h1>
|
||||
Please allow us up to 5 seconds to load in your requested content. <br>
|
||||
If this takes longer than usual, please refresh the page or contact support. <br>
|
||||
</div>
|
||||
<div id="noaccount" style="display:none;">
|
||||
<h1>Error</h1>
|
||||
<h2>You have to be logged in to view this content</h2>
|
||||
To log in, please visit <a href="/login">The login page</a> <br>
|
||||
If you are new to here, please visit <a href="/register">The register page</a> <br>
|
||||
</div>
|
||||
<div id="scriptonly" style="display:none;">
|
||||
<div class="self">
|
||||
Username: <span class="Username" id="username-self"></span> <br>
|
||||
<textarea name="name" id="post-text" rows="8" cols="80"></textarea>
|
||||
<br>
|
||||
<button type="button" name="button" id="post-btn" onclick="postMessage()">Post</button>
|
||||
</div>
|
||||
<div class="posts" id="posts"></div>
|
||||
</div>
|
||||
<div class="posts" id="posts"></div>
|
||||
<script type="text/javascript" src="/js/posts.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user