fixed object load

This commit is contained in:
2023-07-01 23:16:45 +05:00
parent 997dc5466d
commit af8e44d1ce
6 changed files with 230 additions and 11 deletions

View File

@ -13,7 +13,7 @@
<h1>hello admin</h1>
<div class="nobj">
<div class="img_preview">
<label for="img_file">max size 1mb</label><br>
<label for="img_file">max size 2mb</label><br>
<input type="file" id="img_file" onchange="previewFile()" accept="image/*" value="" maxlength="1"><br>
<img src="" height="100" alt="Image preview...">
</div>
@ -61,8 +61,8 @@
var img = document.querySelector('img').src;
name = name.replace(" ","_");
if (img != "http://n0rsrv2:3002/admin"){
document.getElementById("obj_resp").innerHTML = "creating object";
new_obj(name,img,0,0,description,(res)=>{
document.getElementById("obj_resp").innerHTML = "creating object";
if(res["out"] == "bad" && res["err"] == "name"){
document.getElementById("obj_resp").innerHTML = "object already exist";
}

View File

@ -109,7 +109,7 @@
</div>
<section class="main">
<div id="proj_top">
<button id="proj_save_btn" onclick="save((res)=>{document.getElementById('proj_save_btn').innerHTML='saved';setTimeout((res)=>{document.getElementById('proj_save_btn').innerHTML='save'},3000)})">save</button>
<button id="proj_save_btn" onclick="document.getElementById('proj_save_btn').innerHTML='saving';save((res)=>{document.getElementById('proj_save_btn').innerHTML='saved';setTimeout((res)=>{document.getElementById('proj_save_btn').innerHTML='save'},3000)})">save</button>
<input id="proj_name"></input>
</div>
</section>
@ -182,6 +182,7 @@
czone.classList.add("createzone");
czones.append(czone)
});
load_proj();
})
</script>
<script>
@ -189,6 +190,5 @@
// console.log(proj_name);
document.getElementById("proj_name").value = proj_name;
// drag_start();
load_proj();
</script>
<%- include('./static/end.ejs') %>

View File

@ -15,10 +15,15 @@
<form action="" method="get" onsubmit="return false;" id="reg_form">
<h1>user registration</h1>
<section class="main_sec">
<input type="text" id="login" name="login">
<input type="password" id="pass" name="pass">
<input type="checkbox" name="admin" value='false' id="admin_check">
<button onclick='reg();'>reg</button>
<div>
<input type="text" id="login" name="login" placeholder="login">
<input type="password" id="pass" name="pass" placeholder="password">
<button onclick='reg();'>reg</button>
</div>
<div>
<label for="admin_check">admin</label>
<input type="checkbox" name="admin" value='false' id="admin_check">
</div>
<div id="reg_response"></div>
</section>
<script>