Delete types

This commit is contained in:
2021-09-13 20:31:56 +06:00
parent f0fa97a2ff
commit e1a4f954fd
80 changed files with 692 additions and 641 deletions

View File

@ -50,7 +50,7 @@ class EdtRec
{
this.pBarDiv=document.createElement('div');
this.pBarDiv.style.cssText='position: absolute; left: 0px; top: 0px; z-index: 1; background-color: rgba(0,0,0,0.5); width:100%; height: 100%;';
this.pBarDiv.innerHTML='<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" style="vertical-align: middle;"><img src="../resources/metadata/dbms/images/loading.gif" alt=""></td></tr></table>';
this.pBarDiv.innerHTML='<table width="100%" height="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="vertical-align: middle;"><img src="../resources/metadata/dbms/images/loading.gif" alt=""></td></tr></table>';
let eDiv=document.getElementById('eDiv'+this.uid);
eDiv.appendChild(this.pBarDiv);
@ -202,9 +202,9 @@ class EdtRec
{
if (nodeProp.nodeName=="type") //Grouping fields.
{
var tr = document.createElement('tr');
tr.setAttribute("bgColor",'#E0E0E0');
var td = document.createElement('td');
let tr = document.createElement('tr');
tr.style.cssText="background-color: var(--back-color);";
let td = document.createElement('td');
td.style.cssText="font-weight: bold;";
td.colSpan = "2";
@ -242,11 +242,12 @@ class EdtRec
if (nodeProp.nodeName=="divide") //Grouping fields.
{
var tr = document.createElement('tr');
tr.setAttribute("bgColor",'#E0E0E0');
tr.style.cssText="background-color: var(--back-color-title);";
var td = document.createElement('td');
td.style.cssText="font-weight: bold;";
td.colSpan = "2";
td.appendChild(document.createTextNode(nodeProp.getAttribute("d")));
td.innerHTML=nodeProp.getAttribute("d");
tr.appendChild(td);
eTable.tBodies[0].appendChild(tr);
}else
@ -256,6 +257,7 @@ class EdtRec
var tr = null;
var td1 = null;
var td2 = null;
let vt=nodeProp.getAttribute("vt");
var row=nodeProp.getAttribute("row"); //Several fields in the 1st row.
if(row==null)
@ -289,13 +291,19 @@ class EdtRec
td2.setAttribute("width","50%");
//td2.style.width=row+"px";
}
td1.appendChild(document.createTextNode(nodeProp.getAttribute("d")));
if(vt=="html"){
td1.innerHTML=nodeProp.getAttribute("d")+'<br><button class="button-secondary" onclick="showHTMLEditor(\''+nodeProp.getAttribute("d")+'\',\'prop_'+this.uid+'_'+nodeProp.getAttribute("n")+'\');">HTML ...</button>';
}else{
td1.innerHTML=nodeProp.getAttribute("d");
}
if(nodeProp.getAttribute("t")!=null) td1.title=nodeProp.getAttribute("t");
if (nodeProp.getAttribute("maybenull")=='0') td1.style.cssText="font-weight: bold;";
var value=getCdata(nodeProp).nodeValue;
var vt=nodeProp.getAttribute("vt");
if(vt=="string" || vt=="str")
{
var table=document.createElement('table');
@ -322,8 +330,9 @@ class EdtRec
newCell1.appendChild(nodeProp.field.getDiv());
}else
{
input = document.createElement('input');
let input = document.createElement('input');
input.setAttribute("type","text");
input.classList.add('DBMS');
input.style.cssText="width: 100%;overflow:hidden;";
input.setAttribute("name",nodeProp.getAttribute("n"));
if(nodeProp.getAttribute("size")!=null)
@ -339,7 +348,7 @@ class EdtRec
if(tObj!=null)
{
let button = document.createElement('input');
button.className='button-secondary';
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
@ -357,6 +366,7 @@ class EdtRec
if(vt=="password")
{
input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","password");
input.setAttribute("name",nodeProp.getAttribute("n"));
@ -366,7 +376,8 @@ class EdtRec
}else
if(vt=="b")
{
var select = document.createElement('select');
let select = document.createElement('select');
select.classList.add('DBMS');
select.style.cssText="width: 100%;";
select.setAttribute("name",nodeProp.getAttribute("n"));
var opt=findFirstNode(nodeProp,"options");
@ -409,10 +420,11 @@ class EdtRec
//alert2(trt('Alert'),"prop name = "+nodeProp.getAttribute("n"));
//If there is a node "list" with the elements "CheckBox" then create them.
var opt=findNode(nodeProp, "options");
let opt=findNode(nodeProp, "options");
if(opt!=null) //If combobox
{
var select = document.createElement('select');
let select = document.createElement('select');
select.classList.add('DBMS');
select.style.cssText="width: 100%;";
select.setAttribute("name",nodeProp.getAttribute("n"));
select.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n"));
@ -445,6 +457,7 @@ class EdtRec
newCell3.style.cssText="padding:0px;height:100%;";
input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%; height:22px;";
input.setAttribute("type","text");
input.setAttribute("name",nodeProp.getAttribute("n"));
@ -452,8 +465,8 @@ class EdtRec
input.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n"));
newCell1.appendChild( input );
button = document.createElement('input');
button.className='button-secondary';
let button = document.createElement('input');
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","+");
button.setAttribute("title",trt("Increase_by_1"));
@ -463,7 +476,7 @@ class EdtRec
newCell2.appendChild( button );
button = document.createElement('input');
button.className='button-secondary';
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","-");
button.setAttribute("title",trt("Decrease_by_1"));
@ -476,7 +489,8 @@ class EdtRec
}else
if(vt=="f4")
{
input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
input.setAttribute("name",nodeProp.getAttribute("n"));
@ -500,7 +514,8 @@ class EdtRec
var newCell2 = newRow.insertCell(1); //in the created line we add a column
newCell2.style.cssText="padding:0px;height:100%;";
select = document.createElement('select');
let select = document.createElement('select');
select.classList.add('DBMS');
select.style.cssText="width: 100%; height:22px; line-height: 22px;";
select.setAttribute("name",nodeProp.getAttribute("n"));
//select.setAttribute("value",value) does not work because when creating no values in the list
@ -515,8 +530,8 @@ class EdtRec
//cmbInp.addEventListener(IndexChangeEvent.CHANGE,onComboObjectChangeHandler);
var button = document.createElement('input');
button.className='button-secondary';
let button = document.createElement('input');
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;height:100%;";
@ -571,6 +586,7 @@ class EdtRec
//two elements are placed in the table
input = document.createElement('input');
input.classList.add('DBMS');
//After pressing "Enter" we pass the entered line to the server.
input.onkeydown=this.onCallFV(nodeProp.getAttribute("ot"),nodeProp.getAttribute("FieldCaption"),input,nodeProp.getAttribute("n"),nodeProp.getAttribute("fn"));
input.style.cssText="width: 100%; height:22px; line-height: 22px;";
@ -584,8 +600,8 @@ class EdtRec
hidden.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n"));
hidden.value=value;
newCell1.appendChild(hidden);
var button = document.createElement('input');
button.className='button-secondary';
let button = document.createElement('input');
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
@ -608,6 +624,7 @@ class EdtRec
}else
if(vt=="text") {
let ta = document.createElement('textarea')
ta.classList.add('DBMS');
ta.setAttribute("id", "prop_" + this.uid + "_" + nodeProp.getAttribute("n"));
ta.style.cssText = "width: 100%;";
ta.setAttribute("rows", 4);
@ -618,6 +635,7 @@ class EdtRec
}else
if(vt=="html"){
let ta = document.createElement('textarea')
ta.classList.add('DBMS');
ta.setAttribute("id", "prop_" + this.uid + "_" + nodeProp.getAttribute("n"));
ta.style.cssText = "width: 100%;";
ta.setAttribute("rows", 4);
@ -651,6 +669,7 @@ class EdtRec
//Two elements are placed in the table
input = document.createElement('input');
input.classList.add('dbms');
//After pressing Enter we pass the entered line to the server
//input.onkeydown=this.onCallFV(nodeProp.getAttribute("ot"),nodeProp.getAttribute("FieldCaption"),input,nodeProp.getAttribute("n"),nodeProp.getAttribute("fn"))
input.style.cssText="width: 100%; color: #777777;";
@ -662,7 +681,7 @@ class EdtRec
//Button to send the file to the server
let btnSel = document.createElement('input');
btnSel.className='button-secondary';
btnSel.classList.add('button-secondary');
btnSel.setAttribute("type","button");
btnSel.setAttribute("value","...");
btnSel.setAttribute("title",trt('Upload'));
@ -671,6 +690,7 @@ class EdtRec
newCell2.appendChild(btnSel);
let button2 = document.createElement('input');
button2.classList.add('button-secondary');
button2.className='button-secondary';
button2.setAttribute("type","button");
button2.setAttribute("value","X");
@ -716,7 +736,8 @@ class EdtRec
var newCell2 = newRow.insertCell(1);
newCell2.style.cssText="padding:0px;";
input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
input.setAttribute("name",nodeProp.getAttribute("n"));
@ -757,7 +778,8 @@ class EdtRec
});
}else
{
input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
input.setAttribute("name",nodeProp.getAttribute("n"));
@ -780,8 +802,8 @@ class EdtRec
tr.appendChild(td);
//var td = document.createElement('td');
td.setAttribute("align","right");
button = document.createElement('input');
button.className='button-secondary';
let button = document.createElement('input');
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.style.cssText="margin:0px;margin-right:1px;";
button.setAttribute("value",trt('Apply'));
@ -789,8 +811,8 @@ class EdtRec
td.appendChild( button );
button = document.createElement('input'); //Button cancel
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.className='button-secondary';
button.style.cssText="margin:0px;";
button.setAttribute("value",trt('Cancel'));
//button.onclick=function f_exit(this) { alert2(trt('Alert'),this.win.div); }
@ -1516,14 +1538,15 @@ class TCheckboxListField
}
addCheckbox(value, name) {
var input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
this.array.push(input);
input.setAttribute("type", "checkbox");
input.setAttribute("value", value);
var label = document.createElement("Label");
let label = document.createElement("Label");
// label.setAttribute("for",id_from_input);
label.appendChild(input);
label.appendChild(document.createTextNode(" " + name + " "));