404, obj layer, cache, ask,
This commit is contained in:
@ -49,15 +49,16 @@
|
||||
}
|
||||
function del_color(){
|
||||
let color_id = document.getElementById(cur_color).getAttribute("color_id")
|
||||
let wait_msg = msg("удаление цвета",{type:"wait"})
|
||||
$.post( "/admin/colors/delete", {id:color_id})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
msg_del(wait_msg.id);
|
||||
msg("цвет удалён");
|
||||
obj_colors_load();
|
||||
console.log(res["body"]);
|
||||
}
|
||||
});
|
||||
msg("Удалить этот цвет?",{type:"ask",res:(out)=>{if(out){
|
||||
$.post( "/admin/colors/delete", {id:color_id})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
msg("цвет удалён");
|
||||
obj_colors_load();
|
||||
console.log(res["body"]);
|
||||
}
|
||||
});
|
||||
}}})
|
||||
|
||||
}
|
||||
</script>
|
@ -29,7 +29,7 @@
|
||||
|
||||
<h1>Изменение объектов</h1>
|
||||
<div>
|
||||
<div id="objs_in_group" style="max-height: 20vh;height: 20vh;"></div>
|
||||
<div id="objs_in_group"></div>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between;float: right;">
|
||||
<div id="find_obj_btns">
|
||||
@ -86,7 +86,7 @@
|
||||
function obj_del(id){
|
||||
// let select = document.getElementById("group_select");
|
||||
let menu = document.getElementById(`object_${id}`);
|
||||
if (confirm(`вы точно хотите удалить ${menu.getAttribute("name").split("~")[0]}?`)){
|
||||
msg(`вы точно хотите удалить ${menu.getAttribute("name").split("~")[0]}?`,{type:"ask",res:(out)=>{if(res){
|
||||
let wait_msg = msg("удаление товара",{type:"wait"});
|
||||
$.post( "/admin/objects/delete", { id:id,})
|
||||
.done(function( res ) {
|
||||
@ -96,7 +96,7 @@
|
||||
edit_get_objs();
|
||||
}
|
||||
});
|
||||
}
|
||||
}}})
|
||||
}
|
||||
|
||||
function save_edited_obj(id){
|
||||
@ -194,16 +194,16 @@
|
||||
});
|
||||
}
|
||||
else{
|
||||
let name = ask("название");
|
||||
if(name != "")[
|
||||
$.post( "/admin/objects/find", { name:name.replaceAll(" ","$")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
callback(res["body"])
|
||||
}
|
||||
})
|
||||
]
|
||||
ask("название",{func:(name)=>{
|
||||
$.post( "/admin/objects/find", { name:name.replaceAll(" ","$")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
callback(res["body"])
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,57 +86,59 @@
|
||||
let name = document.getElementById("group_drop-"+pid).innerText;
|
||||
msg(`вы уверены вы хотите удалить раздел ${name}`,{type:"ask",res:(out)=>{
|
||||
if(out == true){
|
||||
$.post( "/admin/parts/delete", {pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
edit_get_objs();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
msg(`раздел ${name} удалён`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
$.post( "/admin/parts/delete", {pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
edit_get_objs();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
msg(`раздел ${name} удалён`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
}})
|
||||
}
|
||||
function create_new_group(pid) {
|
||||
let group_name = ask("название группы");
|
||||
if(group_name != null && group_name != ""){
|
||||
$.post( "/admin/groups/new", { name:group_name.replaceAll(" ","$"),pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
edit_get_objs();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
msg(`группа ${group_name.replaceAll(" ","$")} создана`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
ask("название группы",{func:(group_name)=>{
|
||||
if(group_name != null && group_name != ""){
|
||||
$.post( "/admin/groups/new", { name:group_name.replaceAll(" ","$"),pid:pid})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
edit_get_objs();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
msg(`группа ${group_name.replaceAll(" ","$")} создана`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
||||
function create_new_part() {
|
||||
let part_name = ask("название раздела");
|
||||
if(part_name != null && part_name != ""){
|
||||
$.post( "/admin/parts/new", { name:part_name.replaceAll(" ","$")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
msg(`раздел ${part_name.replaceAll(" ","$")} создан`)
|
||||
},500)
|
||||
ask("название раздела",{func:(part_name)=>{
|
||||
if(part_name != null && part_name != ""){
|
||||
$.post( "/admin/parts/new", { name:part_name.replaceAll(" ","$")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
// load_groups();
|
||||
hide_menus();
|
||||
setTimeout(()=>{
|
||||
parts_load();
|
||||
msg(`раздел ${part_name.replaceAll(" ","$")} создан`)
|
||||
},500)
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}})
|
||||
}
|
||||
|
||||
function parts_load(){
|
||||
|
@ -115,22 +115,23 @@
|
||||
});
|
||||
}
|
||||
else{
|
||||
let login = ask("имя");
|
||||
if (login != ""){
|
||||
form = 0;
|
||||
$.post( "/admin/users/find",{login:login,from:from,load_interval:load_interval})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
res["body"].forEach(user => {
|
||||
make_user(user,res);
|
||||
});
|
||||
}
|
||||
else if(res["out"] == "bad"){
|
||||
msg("нет пользователя с таким иминем")
|
||||
load_users_data(users_from);
|
||||
}
|
||||
});
|
||||
}
|
||||
ask("имя",{func:(out)=>{
|
||||
if(out != null && out != "" && out != " "){
|
||||
from = 0;
|
||||
$.post( "/admin/users/find",{login:out,from:from,load_interval:load_interval})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
res["body"].forEach(user => {
|
||||
make_user(user,res);
|
||||
});
|
||||
}
|
||||
else if(res["out"] == "bad"){
|
||||
msg("нет пользователя с таким иминем")
|
||||
load_users_data(users_from);
|
||||
}
|
||||
});
|
||||
}
|
||||
}})
|
||||
}
|
||||
|
||||
function make_user(user,res){
|
||||
@ -205,16 +206,21 @@
|
||||
let pass= document.getElementById(`pass_${id}`).innerText;
|
||||
let value = null;
|
||||
if (key == 'login' || key == "pass") {
|
||||
value = ask(`изменение ${key} пользователя ${login}`,document.getElementById(`${key}_${id}`).innerText);
|
||||
ask(`изменение ${key} пользователя ${login}`,{def:document.getElementById(`${key}_${id}`).innerText,func:(out)=>{
|
||||
if(out != null && out != "" && out != " "){
|
||||
make(out);
|
||||
}
|
||||
}});
|
||||
}
|
||||
else if (key == "admin"){
|
||||
value = admin;
|
||||
make(value)
|
||||
}
|
||||
else if (key == "rights"){
|
||||
value = args[0]["rights"];
|
||||
make(value)
|
||||
}
|
||||
|
||||
if(value != null){
|
||||
function make(value){
|
||||
$.post( "/admin/users/edit",{key:key,value:value,id:id,login:login})
|
||||
.done(function( res ) {
|
||||
// console.log("serv reg");
|
||||
@ -261,14 +267,15 @@
|
||||
}
|
||||
function user_del(id){
|
||||
let login = document.getElementById(`login_${id}`).innerText;
|
||||
if(confirm(`вы точно хотите удалить пользователя ${login}?`) == true){
|
||||
$.post( "/admin/users/delete",{login:login,id:id})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
load_users_data(users_from);
|
||||
}
|
||||
});
|
||||
}
|
||||
msg(`вы точно хотите удалить пользователя ${login}?`,{type:"ask",res:(out)=>{if(out){
|
||||
$.post( "/admin/users/delete",{login:login,id:id})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
load_users_data(users_from);
|
||||
}
|
||||
});
|
||||
}
|
||||
}})
|
||||
}
|
||||
|
||||
let user_edit_menu = document.createElement("div");user_edit_menu.id = "user_edit_menu"; user_edit_menu.classList.add("cmenu");
|
||||
|
@ -127,7 +127,7 @@
|
||||
<div id="top_panel_left" class="tpanel"></div>
|
||||
<div id="top_panel_center" class="tpanel">
|
||||
<button id="page_btn_main" onclick="goto('/main')">Мои проекты</button>
|
||||
<button id="page_btn_tamp" onclick="goto('/tamp')">Шаблоны</button>
|
||||
<button id="page_btn_tamp" onclick="goto('/temp')">Шаблоны</button>
|
||||
<button id="page_btn_gallery" onclick="goto('/gallery')">Галерея</button>
|
||||
<button id="page_btn_faq" onclick="goto('/faq')">FAQ</button>
|
||||
<button id="page_btn_help" onclick="goto('/help')">Связаться с поддержкой</button>
|
||||
@ -162,6 +162,7 @@
|
||||
|
||||
let menu = document.getElementById("top_panel_center");
|
||||
if (res["admin"] == true){
|
||||
if (typeof admin != "undefined"){Object.values(admin).forEach(afunc => {afunc()});}
|
||||
menu.innerHTML += `<button id="page_btn_admin" onclick='goto("/admin")'>Админ. панель</button><br>`;
|
||||
switch (document.URL.split("/").at(-1)) {
|
||||
case ("admin"):document.getElementById("page_btn_admin").style.border = "1px solid black";break;
|
||||
|
16
views/help.ejs
Normal file
16
views/help.ejs
Normal file
@ -0,0 +1,16 @@
|
||||
<%- include('./static/start.ejs',{name:'help',async: true}) %>
|
||||
<%- include('./header.ejs') %>
|
||||
|
||||
|
||||
<section class="main">
|
||||
<div>
|
||||
<h1>Морской Сергей Юрьевич - руководитель проекта:</h1>
|
||||
<div style="display: flex;"><h1 style="margin-right: 1vw;">Kонтакты:</h1><img style="margin: auto 0px;cursor: pointer;" onclick="goto('https://tlgg.ru/@teleanonym')" src="/img/telegram.svg"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<%- include('./static/end.ejs',{soc:true}) %>
|
||||
<script>
|
||||
setTimeout(()=>{loaded()},500);
|
||||
</script>
|
@ -30,7 +30,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
#load_help{
|
||||
width: 12vw;
|
||||
/* width: 12vw; */
|
||||
justify-content: space-between;
|
||||
position:absolute;
|
||||
top:50%;
|
||||
@ -47,7 +47,14 @@
|
||||
|
||||
<div id="load_div">
|
||||
<img id="load_logo" src="/img/Умничка лого с обводкой-02 1.png" onclick="goto('/')" alt="">
|
||||
<div id="load_help"><a href="">reload</a><br><a href="/main">go to main page</a></div>
|
||||
<div id="load_help">
|
||||
<div>Страница Долго загружается?</div>
|
||||
<div>Вы можете</div>
|
||||
<br>
|
||||
<div><a href="">Перезагрузить</a><br><a href="/main">На главную страницу</a></div>
|
||||
<br>
|
||||
<div>Но лучьше подождать</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@ -100,5 +107,5 @@
|
||||
if(page_state != "loaded"){
|
||||
document.getElementById("load_help").style.display = "block";
|
||||
}
|
||||
},7000)
|
||||
},5000)
|
||||
</script>
|
@ -141,9 +141,10 @@
|
||||
// logo.style.transform = 'translate(-40vw,-20vh)';
|
||||
// logo.style.position = "absolute"
|
||||
function log(){
|
||||
const login = CryptoJS.AES.encrypt(document.getElementById('login').value,$.cookie("sid")).toString();
|
||||
const pass = CryptoJS.AES.encrypt(document.getElementById('pass').value,$.cookie("sid")).toString();
|
||||
const sid = $.cookie("sid");
|
||||
console.log(sid);
|
||||
const login = CryptoJS.AES.encrypt(document.getElementById('login').value,sid).toString();
|
||||
const pass = CryptoJS.AES.encrypt(document.getElementById('pass').value,sid).toString();
|
||||
if(login!=""&&pass!=""){
|
||||
$.post( "/back_login", { login:login,pass:pass,sid:sid })
|
||||
.done(function( res ) {
|
||||
|
@ -61,24 +61,25 @@
|
||||
});
|
||||
}
|
||||
function new_proj(objs = null){
|
||||
let name = ask("please enter project name");
|
||||
objs = (objs == null)? { height:"2",width:"4"}:objs;
|
||||
if(name != null && name!= "" && name!=" " && typeof name != "undefined" && name!="undefined"){
|
||||
$.post( "/save_proj", {proj:JSON.stringify(objs),name:name,img:"/img/proj_placeholder.webp"})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(scr)
|
||||
// console.log("good");
|
||||
// if(callback) callback(res);
|
||||
goto(`/proj/load/${name}`);
|
||||
}
|
||||
})
|
||||
}
|
||||
let name = ask("Введите название проекта ",{func:(name)=>{
|
||||
objs = (objs == null)? { height:"2",width:"4"}:objs;
|
||||
if(name != null && name!= "" && name!=" " && typeof name != "undefined" && name!="undefined"){
|
||||
$.post( "/save_proj", {proj:JSON.stringify(objs),name:name,img:"/img/proj_placeholder.webp"})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
goto(`/proj/load/${name}`);
|
||||
}
|
||||
else if(res["out"] == "bad" && res["err"] == "proj"){
|
||||
msg("Проект уже существует")
|
||||
}
|
||||
})
|
||||
}
|
||||
}});
|
||||
}
|
||||
load_projs((projs)=>{
|
||||
console.log(projs);
|
||||
if(projs.length == 0){
|
||||
setTimeout(loaded(),1000)
|
||||
setTimeout(()=>{loaded()},500);
|
||||
}
|
||||
else{
|
||||
projs.forEach(proj => {
|
||||
@ -99,7 +100,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</button>`;
|
||||
setTimeout(loaded(),1000)
|
||||
setTimeout(()=>{loaded()},500);
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -112,37 +113,52 @@
|
||||
}
|
||||
|
||||
function del_proj(proj_name){
|
||||
let del = confirm(`удалить проект ${proj_name}?`);
|
||||
if(del == true){
|
||||
$.post( "/proj/delete",{name:proj_name})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
goto("/main")
|
||||
}
|
||||
})
|
||||
}
|
||||
msg(`удалить проект ${proj_name}?`,{type:"ask",res:(out)=>{
|
||||
if(out){
|
||||
$.post( "/proj/delete",{name:proj_name})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
goto("/main")
|
||||
}
|
||||
})
|
||||
}
|
||||
}})
|
||||
}
|
||||
|
||||
function copy_proj(proj){
|
||||
$.post( "/load_proj",{name:proj})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
new_proj(JSON.parse(res["body"]))
|
||||
let name = ask("Введите название копии проекта ",{func:(name)=>{
|
||||
if(name != null && name!= "" && name!=" " && typeof name != "undefined" && name!="undefined"){
|
||||
$.post( "/save_proj", {proj:res["body"],name:name,img:"/img/proj_placeholder.webp"})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
goto(`/proj/load/${name}`);
|
||||
}
|
||||
else if(res["out"] == "bad" && res["err"] == "proj"){
|
||||
msg("Проект уже существует")
|
||||
}
|
||||
})
|
||||
}
|
||||
}});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function rename_proj(name){
|
||||
let cur_proj = document.getElementById(`proj_${name}`);
|
||||
let new_name = ask(`новое имя для проекта ${name}`);
|
||||
if(new_name != null){
|
||||
$.post( "/proj/rename",{name:new_name,id:cur_proj.getAttribute("proj_id")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
goto("/main");
|
||||
}
|
||||
})
|
||||
}
|
||||
ask(`новое имя для проекта ${name}`,{func:(new_name)=>{
|
||||
if(new_name != null){
|
||||
$.post( "/proj/rename",{name:new_name,id:cur_proj.getAttribute("proj_id")})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
goto("/main");
|
||||
}
|
||||
})
|
||||
}
|
||||
}});
|
||||
}
|
||||
</script>
|
||||
<%- include('./static/end.ejs',{soc:true}) %>
|
@ -17,6 +17,7 @@
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-width: 100px;
|
||||
position:relative;
|
||||
max-width: 200px;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
border: 0.2vw rgba(0, 0, 0, 0.2) solid;
|
||||
@ -42,7 +43,7 @@
|
||||
|
||||
<script>
|
||||
let msg_int = 0;
|
||||
function msg(text,params = {type:null,time:null,res:null}){
|
||||
function msg(text,params = {type:null,time:null,res:null,def:null}){
|
||||
params.time = (params.time == null)? 8:params.time;
|
||||
params.type = (params.type == null)? "msg":params.type;
|
||||
msg_int++;
|
||||
@ -64,6 +65,9 @@
|
||||
case "ask":
|
||||
msg_div.style.borderColor = "rgba(0, 255, 0, 0.5)";
|
||||
break;
|
||||
case "enter":
|
||||
msg_div.style.borderColor = "rgba(0, 255, 0, 0.5)";
|
||||
break;
|
||||
case "warning":
|
||||
msg_div.style.borderColor = "rgba(255, 0, 0, 0.5)";
|
||||
break;
|
||||
@ -81,8 +85,8 @@
|
||||
let no = document.createElement("button");
|
||||
let q_div = document.createElement("div");
|
||||
q_div.style = "display:flex;justify-content: space-between;z-index:20000";
|
||||
yes.innerText = "да";
|
||||
no.innerText = "нет";
|
||||
yes.innerText = "Да";
|
||||
no.innerText = "Нет";
|
||||
yes.classList.add("yes-ans")
|
||||
no.classList.add("no-ans")
|
||||
yes.id = `${msg_div.id}-yes`;
|
||||
@ -113,6 +117,60 @@
|
||||
observer.observe(msg_div, {attributes: true });
|
||||
|
||||
|
||||
function fin(){
|
||||
observer.disconnect();
|
||||
document.getElementById("message_div").style.pointerEvents = "none";
|
||||
if (document.getElementById(msg_div.id) != null){
|
||||
msg_div.style.transform = "translateX(120%)";
|
||||
setTimeout(() => {
|
||||
msg_root.removeChild(msg_div);
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(params.type == "enter"){
|
||||
let yes = document.createElement("button");
|
||||
let no = document.createElement("button");
|
||||
let text = document.createElement("input");
|
||||
let q_div = document.createElement("div");
|
||||
text.value = (typeof params.def != "undefined")? params.def:"";
|
||||
text.style.width = "90%";
|
||||
text.style.marginBlock = "0.5vw";
|
||||
text.style.border = "1px gray solid";
|
||||
text.style.borderRadius = "0.5vw";
|
||||
q_div.style = "display:flex;justify-content: space-between;z-index:20000";
|
||||
yes.innerText = "Ок";
|
||||
no.innerText = "Отменить";
|
||||
yes.classList.add("yes-ans")
|
||||
no.classList.add("no-ans")
|
||||
yes.id = `${msg_div.id}-yes`;
|
||||
no.id = `${msg_div.id}-no`;
|
||||
q_div.append(yes)
|
||||
q_div.append(no)
|
||||
msg_div.append(text)
|
||||
msg_div.append(q_div)
|
||||
msg_div.setAttribute("ans","null")
|
||||
yes.setAttribute("onclick",`document.getElementById('${msg_div.id}').setAttribute("ans","true")`)
|
||||
no.setAttribute("onclick",`document.getElementById('${msg_div.id}').setAttribute("ans","false")`)
|
||||
document.getElementById("message_div").style.pointerEvents = "all";
|
||||
// document.getElementById("message_div").setAttribute("onclick",`document.getElementById('${msg_div.id}').setAttribute("ans","false")`)
|
||||
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type = "attributes" && mutation.target.getAttribute("ans") != "null") {
|
||||
console.log(mutation);
|
||||
if(mutation.target.getAttribute("ans") == "true"){
|
||||
params.res(text.value);fin();
|
||||
}
|
||||
else if (mutation.target.getAttribute("ans") == "false"){
|
||||
params.res(false);fin();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
observer.observe(msg_div, {attributes: true });
|
||||
|
||||
|
||||
function fin(){
|
||||
observer.disconnect();
|
||||
document.getElementById("message_div").style.pointerEvents = "none";
|
||||
|
@ -41,7 +41,7 @@
|
||||
background-position: bottom 0px left 0px;
|
||||
border: 2px solid black;
|
||||
/* overflow: visible; */
|
||||
z-index: 2;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.createzone {
|
||||
@ -209,11 +209,33 @@
|
||||
width: 2vw;
|
||||
}
|
||||
</style>
|
||||
<div style="display: flex;justify-content: space-between; width: 20vw;">
|
||||
<div style="display: flex;justify-content: space-between; width: 35vw;">
|
||||
<div class="btn_icon"><img src="/img/icon/copy.png" alt="copy"></div>
|
||||
<div class="btn_icon" onclick="go_back()"><img src="/img/icon/back.png" alt="back"></div>
|
||||
<div class="btn_icon" onclick="go_forw()"><img src="/img/icon/forw.png" alt="forw"></div>
|
||||
<div class="btn_icon" onclick="obj_del()"><img src="/img/icon/del.png" alt="del"></div>
|
||||
<div class="layer_changer">
|
||||
<div class="btn_icon layer_btn" onclick="obj_change_layer('up')"><img src="/img/icon/up.png" alt="up"></div>
|
||||
<input id="layer_inp" type="number" oninput="obj_change_layer('inp')">
|
||||
<div class="btn_icon layer_btn" onclick="obj_change_layer('down')"><img src="/img/icon/down.png" alt="down"></div>
|
||||
</div>
|
||||
<style>
|
||||
#layer_inp{
|
||||
width: 2vw;
|
||||
appearance: textfield;
|
||||
text-align: center;
|
||||
border: 0px;
|
||||
}
|
||||
.layer_btn{
|
||||
border: 0px;
|
||||
}
|
||||
.layer_changer{
|
||||
display: flex;
|
||||
background-color: white;
|
||||
border: 1px gray solid;
|
||||
border-radius: 0.5vw;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between; width: 15vw;">
|
||||
<div><input type="checkbox" id="grid_checkbox" checked="true" onchange='grid_view(JSON.parse(event.target.checked));'><label for="grid_checkbox">Показывать сетку</label></div>
|
||||
@ -267,10 +289,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="czones"></div>
|
||||
<button onclick="capture()">cap</button>
|
||||
<script src="/lib/inter.js"></script>
|
||||
<script>
|
||||
let proj_name = "<%= proj_name %>";
|
||||
document.getElementById("layer_inp").value = 0;
|
||||
img_cache(()=>{
|
||||
loaded();
|
||||
})
|
||||
|
||||
|
||||
if ( $.cookie("grid") != null){
|
||||
document.getElementById("grid_checkbox").checked = JSON.parse($.cookie("grid"));
|
||||
@ -310,6 +336,10 @@
|
||||
let width = (parseInt(document.getElementById("wall").style.width))
|
||||
document.getElementById("drags").append(document.getElementById("wall"));
|
||||
document.getElementById("drags").style.height = document.getElementById("wall").style.height;
|
||||
document.getElementById("cost_list").style.left = "";
|
||||
Object.values(document.getElementsByClassName("spawn")).forEach((spawn)=>{
|
||||
spawn.src = "";
|
||||
})
|
||||
if(cost == true){
|
||||
width += 252;
|
||||
document.getElementById("drags").append(document.getElementById("cost_div"));
|
||||
@ -333,6 +363,7 @@
|
||||
src = canvas.toDataURL();
|
||||
// console.log(src);
|
||||
callback(src)
|
||||
drag_start();
|
||||
});
|
||||
}
|
||||
|
||||
@ -406,8 +437,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
function obj_change_layer(type) {
|
||||
let obj = document.getElementById(cur_obj);
|
||||
if(obj != null){
|
||||
let cur_layer = obj.style.zIndex;
|
||||
if (type == "up" && cur_layer < 99999){
|
||||
objs[obj.classList[0]][obj.getAttribute("id")].layer = parseInt(cur_layer) + 1;
|
||||
obj.style.zIndex = parseInt(cur_layer) + 1;
|
||||
document.getElementById("layer_inp").value = parseInt(cur_layer) + 1;
|
||||
} else if (type == "down" && cur_layer > 0){
|
||||
objs[obj.classList[0]][obj.getAttribute("id")].layer = parseInt(cur_layer) - 1;
|
||||
obj.style.zIndex = parseInt(cur_layer) - 1;
|
||||
document.getElementById("layer_inp").value = parseInt(cur_layer) - 1;
|
||||
}
|
||||
else if ((type == "inp")){
|
||||
let inp_val = parseInt(document.getElementById("layer_inp").value);
|
||||
if(inp_val >= 0 && inp_val < 99999){
|
||||
objs[obj.classList[0]][obj.getAttribute("id")].layer = inp_val;
|
||||
obj.style.zIndex = inp_val;
|
||||
}
|
||||
else{
|
||||
document.getElementById("layer_inp").value = cur_layer;
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(objs[obj.classList[0]][obj.getAttribute("id")]);
|
||||
}
|
||||
|
||||
function obj_del(){
|
||||
if (proj_state == "loaded"){objs_back.push(JSON.parse(JSON.stringify(objs)));}
|
||||
document.getElementById("layer_inp").value = 0;
|
||||
|
||||
try{
|
||||
let drag = document.getElementById(cur_obj);
|
||||
@ -578,17 +637,6 @@
|
||||
drag_start()
|
||||
}
|
||||
|
||||
// function del_proj(){
|
||||
// let del = confirm(`удалить проект ${proj_name}?`);
|
||||
// if(del == true){
|
||||
// $.post( "/proj/delete",{name:proj_name})
|
||||
// .done(function( res ) {
|
||||
// if(res["out"] == "good"){
|
||||
// goto("/main")
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
// console.log(proj_name);
|
||||
// let menu = document.getElementById("project_menu");
|
||||
|
25
views/static/404.ejs
Normal file
25
views/static/404.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<%- include('../static/start.ejs',{name:'404',async: true}) %>
|
||||
<%- include('../header.ejs') %>
|
||||
|
||||
<style>
|
||||
a{
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section class="main" >
|
||||
<div style="margin: auto;width: 40vw;text-align: center;">
|
||||
<h1>Ой!!!</h1>
|
||||
<h2>На сайте не нашлась такая страница</h2>
|
||||
<h1>Можете <a onclick="goto('/main')">Вернутся на главную страницу</a> или <a onclick="goto('/help')">сообщить в поддержку</a></h1>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<%- include('../static/end.ejs',{soc:true}) %>
|
||||
<script>
|
||||
setTimeout(()=>{loaded()},500);
|
||||
</script>
|
@ -11,6 +11,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title> <%= name %> </title>
|
||||
<script>
|
||||
admin = {};
|
||||
admin["global"] = () =>{
|
||||
globalThis._admin_ = true;
|
||||
}
|
||||
oncontextmenu = (e) => {
|
||||
e.preventDefault()
|
||||
}
|
||||
@ -21,6 +25,7 @@
|
||||
check_sid(true);
|
||||
// console.log("check");
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
:root{
|
||||
|
65
views/templates.ejs
Normal file
65
views/templates.ejs
Normal file
@ -0,0 +1,65 @@
|
||||
<%- include('./static/start.ejs',{name:'templates',async: true}) %>
|
||||
<%- include('./header.ejs') %>
|
||||
|
||||
<style>
|
||||
.t_img{
|
||||
/* pointer-events: none; */
|
||||
height: 200px;
|
||||
border-radius: 10px;
|
||||
width: 290px;
|
||||
box-shadow: 0px 4px 4px 0px #00000040;
|
||||
cursor: pointer;
|
||||
}
|
||||
.temp, .new_temp{
|
||||
border: 0px;
|
||||
background-color: transparent;
|
||||
}
|
||||
.p_left{
|
||||
display: block;
|
||||
}
|
||||
.p_left div{
|
||||
font-size: calc(var(--main-font-size)/2);
|
||||
}
|
||||
.p_right{
|
||||
display: flex;
|
||||
margin-top:15px;
|
||||
justify-content: space-between;
|
||||
width: 130px;
|
||||
}
|
||||
.p_props{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.p_props img{
|
||||
cursor: pointer;
|
||||
}
|
||||
.main h1{
|
||||
/* font-size: --main-font-size; */
|
||||
font-weight: 100;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
<!-- <script src="/lib/interact.min.js"></script> -->
|
||||
|
||||
<section class="main">
|
||||
<div id="temp_div">
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- <script src="/lib/inter.js"></script> -->
|
||||
|
||||
|
||||
|
||||
<%- include('./static/end.ejs',{soc:true}) %>
|
||||
<script>
|
||||
setTimeout(()=>{loaded()},500);
|
||||
admin["temp"] = ()=>{
|
||||
|
||||
document.getElementById("temp_div").innerHTML += `
|
||||
<button onclick="new_temp()" class="new_temp"><img class="t_img" src="/img/new_proj.png" alt=""><h1>Новый проект</h1></button>
|
||||
`
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user