diff --git a/index.js b/index.js
index 477a70e..7a798ac 100644
--- a/index.js
+++ b/index.js
@@ -241,6 +241,9 @@ app.post("/load_proj", (req,res) => {
console.log(`${udata["uuid"]} loaded project ${projt["name"]} from ${cook["sid"]}`);
res.send({out:"good",body:projt["body"]});
}
+ else{
+ res.send({out:"bad proj"});
+ }
})
})
}
diff --git a/public/img/bg1red.png b/public/img/bg1red.png
new file mode 100644
index 0000000..9215f72
Binary files /dev/null and b/public/img/bg1red.png differ
diff --git a/public/lib/fn.js b/public/lib/fn.js
index 9bf3940..7d4ec78 100644
--- a/public/lib/fn.js
+++ b/public/lib/fn.js
@@ -115,6 +115,26 @@ function logout(redirect = true) {
}
}
+function ask() {
+ let name = prompt("please enter project name");
+ if(name != "" && name != " "){
+ return name;
+ }
+}
+
+function wall_size_change(type){
+ let wall = document.getElementsByClassName("wall")[0];
+ let scroll;
+ if(type != null && type == "x") {
+ scroll = document.getElementById("wall_x");
+ wall.style.width = `${scroll.value * 200}px`;
+ }
+ if(type != null && type == "y") {
+ scroll = document.getElementById("wall_y");
+ wall.style.height = `${scroll.value * 200}px`;
+ }
+}
+
function goto_proj(name){
$.post( "/proj/"+name, { name:hostname })
.done(function( res ) {
diff --git a/public/lib/inter.js b/public/lib/inter.js
index 581c65f..07eff26 100644
--- a/public/lib/inter.js
+++ b/public/lib/inter.js
@@ -56,15 +56,22 @@ function load_proj(){
load_local(JSON.parse(res["body"]));
drag_start();
}
+ else if(res["out"] == "bad proj"){
+ console.log("bad");
+ save(()=>{
+ goto("/proj/"+proj_name);
+ });
+ }
})
}
-function save(){
+function save(callback){
// console.log(objs);
$.post( "/save_proj", {proj:JSON.stringify(objs),name:proj_name})
.done(function( res ) {
if(res["out"] == "good"){
console.log("good");
+ if(callback) callback(res);
}
})
}
diff --git a/views/admin.ejs b/views/admin.ejs
index d8130f3..a9cf125 100644
--- a/views/admin.ejs
+++ b/views/admin.ejs
@@ -1,10 +1,66 @@
+
+
<%- include('./static/start.ejs',{name:"admin",async: true}) %>
<%- include('./header.ejs') %>
hello admin
-
+
+
+
+
![Image preview...]()
+
+
+
+
+
+
+
+
<%- include('./reg.ejs') %>
diff --git a/views/header.ejs b/views/header.ejs
index 36d7241..189ba2f 100644
--- a/views/header.ejs
+++ b/views/header.ejs
@@ -9,11 +9,18 @@
}
#top_panel_right{
/* float: right; */
+ justify-content: space-between;
display: flex;
+ width: 20vw;
}
#top_panel_left{
/* float: left; */
+ justify-content: space-between;
display: flex;
+ width: 20vw;
+ }
+ #top_panel{
+ height: 20px;
}
/* button{
/* margin-inline: 5px; */
diff --git a/views/main.ejs b/views/main.ejs
index a10f674..e00009c 100644
--- a/views/main.ejs
+++ b/views/main.ejs
@@ -46,10 +46,14 @@
-
+