migration start

This commit is contained in:
2023-09-18 16:36:07 +05:00
parent 898391ef3b
commit ba9bfda202
31 changed files with 451 additions and 15740 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 164 KiB

View File

@ -99,6 +99,21 @@ function get_sid(){
});
}
function load_colors(callback){
$.post( "/object/colors/get", {})
.done(function( res ) {
if(res["out"] == "good"){
if(callback)callback(res["body"])
}
});
}
function clear_palette(){
Object.values(document.getElementsByClassName("color_palette")).forEach(element => {
element.style.border = "0px blue solid";
});
}
function load_groups(callback,groups,admin = false){
let select = document.getElementById("group");
// let name = select.options[select.selectedIndex].text;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -50,12 +50,14 @@ function create(clas,x,y,color = null,id,size){
}
}
function make(img){
// console.log(db_data);
obj.src = img;
obj.title = `${db_data["name"].replaceAll("$"," ").split("/g")[0]}\nцена:${db_data["cost"]}\nширина:${db_data["width"]}см высота:${db_data["height"]}см`;
obj.title = `${db_data["name"].replaceAll("$"," ").split("~g")[0]}\nцена:${db_data["cost"]}\nширина:${db_data["width"]}см высота:${db_data["height"]}см`;
obj.setAttribute("cost",db_data["cost"])
obj.setAttribute("colors",Boolean(db_data["colors"]))
obj.setAttribute("img",img)
obj.setAttribute("gid",db_data["gid"])
obj.setAttribute("pid",db_data["pid"])
obj.setAttribute("color",color)
// drag.transform = `translate(${drag.getAttribute("data-y")}px, ${drag.getAttribute("data-y")}px) scale(${db_data["width"] * cm_mod} ${db_data["height"] * cm_mod})`;
if(size){
@ -78,7 +80,13 @@ function obj_click(id){
let obj = document.getElementById(id);
cur_obj = id;
if (obj.getAttribute("colors") == "true"){
document.getElementById("obj_color_div").style.display = "flex";
clear_palette();
obj_colors_load(()=>{
document.getElementById("obj_color_div").style.display = "flex";
if( document.getElementById(`color_${obj.getAttribute("color")}`) != null){
document.getElementById(`color_${obj.getAttribute("color")}`).style.border = "1px blue solid"
}
});
}
else{
document.getElementById("obj_color_div").style.display = "none";
@ -148,7 +156,7 @@ function calc_total(start = false){
if(key != "height"&&key!="width"&key!="total"){
// console.log(Object.keys(value).length);
// console.log(objs_store[key]);
if(objs_store[key] != null && objs_store[key]["cost"] > 0){
if(objs_store[key] != null && objs_store[key]["cost"] > 0 && JSON.parse(document.getElementById(`group_drop-${objs_store[key]["pid"]}`).getAttribute("no-cost")) == false){
// console.log(key,value);
total += parseInt(parseInt(objs_store[key]["cost"]) * Object.keys(value).length);
let obj_cost_div = document.createElement("li");
@ -196,9 +204,6 @@ function load(objss){
if (keys == "color"){
document.getElementById("wall").style.backgroundColor = values;
}
if (keys == "grided"){
document.getElementById("wall").style.backgroundColor = values;
}
if (keys == Object.keys(objs).at(-1)){
loaded();
proj_state = "loaded";
@ -285,7 +290,7 @@ function load_objs(callback,group){
if(res["out"] == "good"){
// console.log(res["body"]);
res["body"].forEach(element => {
objs_store[`${element["name"]}`] = {height:element["height"],width:element["width"],id:element["id"],name:element["name"],cost:element["cost"],colors:element["colors"]}
objs_store[`${element["name"]}`] = {height:element["height"],width:element["width"],id:element["id"],name:element["name"],cost:element["cost"],colors:element["colors"],gid:element["gid"],pid:element["pid"]}
});
callback(res["body"]);
}