modified: index.js
modified: object.js modified: project.js new file: public/img/background/photo_2023-06-06_08-53-47 1.png new file: public/img/icon/copy.svg new file: public/img/icon/download.svg new file: public/img/icon/edit.svg new file: public/img/icon/save.svg new file: public/img/icon/trash.svg new file: public/img/new_proj.png new file: public/img/ok.svg new file: public/img/telegram.svg new file: public/img/vk.svg new file: public/img/youtube.svg new file: "public/img/\320\243\320\274\320\275\320\270\321\207\320\272\320\260 \320\273\320\276\320\263\320\276 \321\201 \320\276\320\261\320\262\320\276\320\264\320\272\320\276\320\271-02 1.png" modified: public/lib/fn.js modified: public/lib/inter.js modified: user.js modified: views/admin.ejs modified: views/header.ejs new file: views/load.ejs modified: views/login.ejs modified: views/main.ejs new file: views/old/project.ejs modified: views/project.ejs modified: views/static/end.ejs modified: views/static/start.ejs
This commit is contained in:
@ -10,6 +10,12 @@ function get_from_uuid(callback){
|
||||
});
|
||||
}
|
||||
|
||||
function set_pos(obj,x,y){
|
||||
obj.style.transform = 'translate(' + x + 'px, ' + y + 'px)';
|
||||
obj.setAttribute('data-x', x)
|
||||
obj.setAttribute('data-y', y)
|
||||
}
|
||||
|
||||
function log_by_sid() {
|
||||
// const uuid = $.cookie("uuid");
|
||||
// const sid = $.cookie("sid");
|
||||
@ -18,17 +24,17 @@ function log_by_sid() {
|
||||
// get_sid(location.hostname);
|
||||
get_sid();
|
||||
}
|
||||
// else if ($.cookie('sid') != null && $.cookie('uuid') != null){
|
||||
// $.post( "/sid_log")
|
||||
// .done(function( res ) {
|
||||
// console.log("ping");
|
||||
// if(res["out"] == "good"){
|
||||
// goto(res["url"]);
|
||||
// }
|
||||
// else if (res["out"] == "bad"){
|
||||
// clear_ck(false);
|
||||
// }
|
||||
// })}
|
||||
else if ($.cookie('sid') != null && $.cookie('uuid') != null){
|
||||
$.post( "/sid_log")
|
||||
.done(function( res ) {
|
||||
// console.log("ping");
|
||||
if(res["out"] == "good"){
|
||||
goto(res["url"]);
|
||||
}
|
||||
else if (res["out"] == "bad"){
|
||||
clear_ck(false);
|
||||
}
|
||||
})}
|
||||
}
|
||||
|
||||
function clear_ck(redirect = true){
|
||||
@ -115,7 +121,10 @@ function load_groups(callback){
|
||||
|
||||
// redirect
|
||||
function goto(url) {
|
||||
location.href = url;
|
||||
loading();
|
||||
setTimeout(()=>{
|
||||
location.href = url;
|
||||
},1000)
|
||||
}
|
||||
|
||||
function postForm(path, params, method) {
|
||||
|
@ -65,25 +65,25 @@ function resize_drags(){
|
||||
drag_start();
|
||||
}
|
||||
|
||||
function wall_size_change(type,value){
|
||||
function wall_size_change(type,value = null){
|
||||
let wall = document.getElementsByClassName("wall")[0];
|
||||
let scroll;
|
||||
if(type != null && type == "width") {
|
||||
if (value == null) scroll = document.getElementById("wall_width").value;
|
||||
else scroll = value;
|
||||
if (value == null) scroll = parseFloat(document.getElementById("wall_width").value);
|
||||
else if (value != null) scroll = value;
|
||||
// document.getElementById("wall_width_value").innerHTML = (Math.ceil((parseFloat(scroll)+0.1)*10)/ 10);
|
||||
document.getElementById("wall_width_value").innerHTML = `${scroll}м`;
|
||||
// document.getElementById("wall_width_value").innerHTML = `${scroll}м`;
|
||||
|
||||
// console.log(scroll);
|
||||
wall.style.width = `${scroll * 200}px`;
|
||||
objs["width"] = scroll;
|
||||
}
|
||||
if(type != null && type == "height") {
|
||||
if (value == null) scroll = document.getElementById("wall_height").value;
|
||||
else scroll = value;
|
||||
if (value == null) scroll = parseFloat(document.getElementById("wall_height").value);
|
||||
else if (value != null) scroll = value;
|
||||
// document.getElementById("wall_height_value").innerHTML = (Math.ceil((parseFloat(scroll)+0.1)*10)/ 10);
|
||||
document.getElementById("wall_height_value").innerHTML = `${scroll}м`;
|
||||
|
||||
// document.getElementById("wall_height_value").innerHTML = `${scroll}м`;
|
||||
|
||||
// console.log(scroll);
|
||||
wall.style.height = `${scroll * 200}px`;
|
||||
objs["height"] = scroll;
|
||||
@ -129,6 +129,10 @@ function load(objss){
|
||||
wall_size_change(keys,values);
|
||||
// document.getElementById("drags").style.left = $(".dropzone")[0].getBoundingClientRect().x;
|
||||
}
|
||||
|
||||
if (keys == Object.keys(objs).at(-1)){
|
||||
loaded();
|
||||
}
|
||||
});
|
||||
resize_drags();
|
||||
calc_total()
|
||||
@ -137,7 +141,7 @@ function load(objss){
|
||||
function load_proj_cloud(){
|
||||
proj_from = "cloud";
|
||||
document.getElementById("drags").innerHTML = "";
|
||||
document.getElementById("top_panel_center").innerText = `загрузка ${proj_name} из облака`;
|
||||
// document.getElementById("top_panel_center").innerText = `загрузка ${proj_name} из облака`;
|
||||
$.post( "/load_proj",{name:proj_name})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
@ -146,7 +150,7 @@ function load_proj_cloud(){
|
||||
// console.log(JSON.parse(res["body"]));
|
||||
// $.cookie("objs",res["body"]);
|
||||
load(JSON.parse(res["body"]));
|
||||
document.getElementById("top_panel_center").innerText = `${proj_name} (облако)`;
|
||||
// document.getElementById("top_panel_center").innerText = `${proj_name} (облако)`;
|
||||
}
|
||||
else if(res["out"] == "bad proj"){
|
||||
console.log("bad");
|
||||
@ -163,7 +167,7 @@ function load_proj_local(){
|
||||
if(localStorage.getItem(proj_name) == null){
|
||||
save_local()
|
||||
}
|
||||
document.getElementById("top_panel_center").innerText = `${proj_name} (локальное хранилище)`;
|
||||
// document.getElementById("top_panel_center").innerText = `${proj_name} (локальное хранилище)`;
|
||||
document.getElementById("drags").innerHTML = "";
|
||||
load(JSON.parse(localStorage.getItem(proj_name)));
|
||||
}
|
||||
@ -204,9 +208,10 @@ function save(callback,with_pic = true){
|
||||
}
|
||||
}
|
||||
|
||||
function load_objs(callback){
|
||||
let select = document.getElementById("group_select");
|
||||
$.post( "/get_objs",{gid:select.options[select.selectedIndex].getAttribute("gid")})
|
||||
function load_objs(callback,group){
|
||||
// let select = document.getElementById("group_select");
|
||||
console.log(group);
|
||||
$.post( "/get_objs",{gid:group})
|
||||
.done(function( res ) {
|
||||
if(res["out"] == "good"){
|
||||
// console.log(res["body"]);
|
||||
@ -239,12 +244,6 @@ function load_obj(name,key,callback){
|
||||
});
|
||||
}
|
||||
|
||||
function set_pos(obj,x,y){
|
||||
obj.style.transform = 'translate(' + x + 'px, ' + y + 'px)';
|
||||
obj.setAttribute('data-x', x)
|
||||
obj.setAttribute('data-y', y)
|
||||
}
|
||||
|
||||
function dragMoveListener (event) {
|
||||
var drag = event.target
|
||||
var x = (parseFloat(drag.getAttribute('data-x')) || 0) + event.dx
|
||||
|
Reference in New Issue
Block a user