added grid
This commit is contained in:
BIN
public/img/bg1red.png
Normal file
BIN
public/img/bg1red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
@ -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 ) {
|
||||
|
@ -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);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user