소스 정리

main
이범준 3 months ago
parent 9eda173b86
commit 5336c3f03d

@ -61,7 +61,9 @@ class NameLabel extends HTMLLabelElement {
}
if(doctx != null){
this.setAttribute("data-ref-doctx", doctx);
this.htmlFor = this.getAttribute("for")+"--"+doctx;
if(this.getAttribute("for") != null && this.getAttribute("for").indexOf("--") == -1){
this.htmlFor = this.getAttribute("for")+"--"+doctx;
}
}
}
}
@ -177,17 +179,19 @@ class CurlyBrackets extends HTMLTemplateElement {
constructor() {
super();
let curlyBracketsOpen = String.fromCharCode(123); //중괄호시작
let thisCon = this.content;
let trs = thisCon.querySelectorAll("tr");
trs.forEach(function(node) {
let key = node.getAttribute("data-key");
if(key != null && key != "" && key.indexOf("{") == -1){
if(key != null && key != "" && key.indexOf(curlyBracketsOpen) == -1){
node.setAttribute("data-key","{"+key+"}");
}
let index = node.getAttribute("data-index");
if(index != null && index != "" && index.indexOf("{") == -1){
if(index != null && index != "" && index.indexOf(curlyBracketsOpen) == -1){
node.setAttribute("data-index","{"+index+"}");
}
});
@ -202,7 +206,7 @@ class CurlyBrackets extends HTMLTemplateElement {
node.setAttribute("ondblclick","{ondblclick}");
}
if(node.textContent.trim() != "" && node.textContent.indexOf("{") == -1){
if(node.textContent.trim() != "" && node.textContent.indexOf(curlyBracketsOpen) == -1){
node.textContent = "{"+node.textContent.trim()+"}";
}
});

@ -80,7 +80,8 @@ function ObjectInspector(doctx, data){
} else if(data instanceof HTMLScriptElement){
objectInspector = JSON.parse(data.text);
} else if(typeof data == "string"){
if(!data.trim().startsWith(String.fromCharCode(123))){
let curlyBracketsOpen = String.fromCharCode(123); //중괄호시작
if(!data.trim().startsWith(curlyBracketsOpen)){
objectInspector = JSON.parse(document.querySelector("script[id='"+data+"'").text);
} else {
objectInspector = JSON.parse(data);

Loading…
Cancel
Save