+HTML редактор

This commit is contained in:
2021-10-14 19:35:32 +06:00
parent 5ebcf5041d
commit 66cc2fbd03
301 changed files with 57 additions and 45975 deletions

View File

@ -196,8 +196,8 @@ class EdtRec
}
nodeProp=nodeProperties.firstChild;
var newRowM=null;
var rpos=0;
let newRowM=null;
let rpos=0;
while (nodeProp!=null)
{
if (nodeProp.nodeName=="type") //Grouping fields.
@ -253,13 +253,13 @@ class EdtRec
}else
if (nodeProp.nodeName=="prop")
{
var bgColor='';
var tr = null;
var td1 = null;
var td2 = null;
let bgColor='';
let tr = null;
let td1 = null;
let td2 = null;
let vt=nodeProp.getAttribute("vt");
var row=nodeProp.getAttribute("row"); //Several fields in the 1st row.
let row=nodeProp.getAttribute("row"); //Several fields in the 1st row.
if(row==null)
{
rpos++;
@ -267,16 +267,13 @@ class EdtRec
if (rpos%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2;
tr.setAttribute("bgColor",bgColor);
if(nodeProp.getAttribute("visible")=='0') tr.style.display='none';
var td1 = document.createElement('td');
var td2 = document.createElement('td');
td1 = document.createElement('td');
td2 = document.createElement('td');
tr.appendChild(td1);
tr.appendChild(td2);
var table=document.createElement('table');
table.border=0;
table.setAttribute("width","100%");
table.cellspacing=0;
table.cellpadding=0;
let table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
td2.appendChild(table);
newRowM=table.insertRow(0);
td2 = newRowM.insertCell(-1);
@ -306,17 +303,16 @@ class EdtRec
if(vt=="string" || vt=="str")
{
var table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;";
table.border=0;
let table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0); //add a row to the created table
var newCell1 = newRow.insertCell(0); //in the created line we add a column
let newCell1 = newRow.insertCell(0); //in the created line we add a column
newCell1.style.cssText="padding:0px; padding-right:1px; width: 100%;";
var newCell2 = newRow.insertCell(1); //in the created line we add a column
let newCell2 = newRow.insertCell(1); //in the created line we add a column
newCell2.style.cssText="padding:0px;";
//If there is a list node with CheckBox elements, then we create them
var nList=findNode(nodeProp, "options");
let nList=findNode(nodeProp, "options");
if(nList!=null)
{
nodeProp.field = new TCheckboxListField(nodeProp.getAttribute("n"));
@ -344,7 +340,7 @@ class EdtRec
//td2.appendChild( input );
//Button for translation
var tObj=findNode(nodeProp, "type");
let tObj=findNode(nodeProp, "type");
if(tObj!=null)
{
let button = document.createElement('input');
@ -365,7 +361,7 @@ class EdtRec
}else
if(vt=="password")
{
input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","password");
@ -380,10 +376,10 @@ class EdtRec
select.classList.add('DBMS');
select.style.cssText="width: 100%;";
select.setAttribute("name",nodeProp.getAttribute("n"));
var opt=findFirstNode(nodeProp,"options");
let opt=findFirstNode(nodeProp,"options");
if(opt==null)
{
var option = document.createElement('option');
let option = document.createElement('option');
option.setAttribute("value","");
option.appendChild(document.createTextNode(""));
option.selected = true;
@ -418,13 +414,13 @@ class EdtRec
{
//If there is a node "list" with the elements "CheckBox" then create them.
let opt=findNode(nodeProp, "options");
if(opt!=null) //If combobox
if(opt!=null){ //If combobox
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"));
opt=opt.firstChild
opt=opt.firstChild;
while(opt!=null)
{
if(opt.nodeName=="option")
@ -437,22 +433,19 @@ class EdtRec
opt=opt.nextSibling;
}
td2.appendChild( select );
}else
{
var table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;";
//table.setAttribute("bgColor","#0000FF");
table.border=0;
let table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0); //add a row to the created table
var newCell1 = newRow.insertCell(0); //in the created line we add a column
let newCell1 = newRow.insertCell(0); //in the created line we add a column
newCell1.style.cssText="padding:0px; padding-right:1px; width: 100%;";
var newCell2 = newRow.insertCell(1); //in the created line we add a column
let newCell2 = newRow.insertCell(1); //in the created line we add a column
newCell2.style.cssText="padding:0px; padding-right:1px;height:100%;";
var newCell3 = newRow.insertCell(2); //in the created line we add a column
let newCell3 = newRow.insertCell(2); //in the created line we add a column
newCell3.style.cssText="padding:0px;height:100%;";
input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%; height:22px;";
input.setAttribute("type","text");
@ -496,18 +489,16 @@ class EdtRec
}else
if(vt=="object")
{
var input=null;
//objpres = findFirstNode(nodeProp, 'object-presentation')
let input=null;
if(nodeProp.getAttribute("selector")=="combo")
{
var table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;";
let table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
//table.setAttribute("bgColor","#0000FF");
table.border=0;
let newRow=table.insertRow(0); //add a row to the created table
var newCell1 = newRow.insertCell(0); //in the created line we add a column
let newCell1 = newRow.insertCell(0); //in the created line we add a column
newCell1.style.cssText="padding:0px;padding-right:1px;width:100%;";
var newCell2 = newRow.insertCell(1); //in the created line we add a column
let newCell2 = newRow.insertCell(1); //in the created line we add a column
newCell2.style.cssText="padding:0px;height:100%;";
let select = document.createElement('select');
@ -519,7 +510,8 @@ class EdtRec
select.onchange = function(thiz,node){ return function()
{
thiz.onComboObjectChangeHandler(node);
};}(this,nodeProp);
};
}(this,nodeProp);
//td2.appendChild( select )
newCell1.appendChild(select);
@ -570,14 +562,12 @@ class EdtRec
}*/
}else
{
var table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;";
//table.setAttribute("bgColor","#0000FF");
table.border=0;
let table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0); //add a row to the created table
var newCell1 = newRow.insertCell(0); //in the created line we add a column
let newCell1 = newRow.insertCell(0); //in the created line we add a column
newCell1.style.cssText="padding:0px;width: 100%;";
var newCell2 = newRow.insertCell(1); //in the created line we add a column
let newCell2 = newRow.insertCell(1); //in the created line we add a column
newCell2.style.cssText="padding:0px;";
//two elements are placed in the table
@ -649,22 +639,20 @@ class EdtRec
let ifr=createIFrame("prop_"+this.uid+"_"+nodeProp.getAttribute("n")+'_frm', ScriptUName+"?fn=9", td2, false); //IFrame to send the file to the server.
document.body.appendChild(ifr);
var tbl_b=document.createElement('table');
tbl_b.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;";
//table.setAttribute("bgColor","#0000FF");
tbl_b.border=0;
let tbl_b=document.createElement('table');
tbl_b.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=tbl_b.insertRow(0);
var newCell1 = newRow.insertCell(0);
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px;width: 100%;";
var newCell2 = newRow.insertCell(1);
let newCell2 = newRow.insertCell(1);
newCell2.style.cssText="padding:0px;";
var newCell3 = newRow.insertCell(2);
let newCell3 = newRow.insertCell(2);
newCell3.style.cssText="padding:0px;";
var newCell4 = newRow.insertCell(3);
let newCell4 = newRow.insertCell(3);
newCell4.style.cssText="padding:0px;";
//Two elements are placed in the table
input = document.createElement('input');
let 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"))
@ -722,14 +710,12 @@ class EdtRec
}else
if(vt=="date" || vt=="dateTime")
{
var table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;";
//table.setAttribute("bgColor","#0000FF");
table.border=0;
let table=document.createElement('table');
table.style.cssText="width:100%;border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0);
var newCell1 = newRow.insertCell(0);
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px;width: 100%;";
var newCell2 = newRow.insertCell(1);
let newCell2 = newRow.insertCell(1);
newCell2.style.cssText="padding:0px;";
let input = document.createElement('input');
@ -783,15 +769,13 @@ class EdtRec
input.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n"));
td2.appendChild( input );
}
}
nodeProp=nodeProp.nextSibling;
}
//Button apply
tr = document.createElement('tr');
var td = document.createElement('td');
td = document.createElement('td');
td.style.cssText="padding: 5px; vertical-align: bottom;";
td.setAttribute("colspan", "2");
if (this.record_id==-1) td.innerHTML='<label style="float: left; white-space: nowrap;"><input id="readd_'+this.uid+'" type="checkbox"> '+trt('Repeat_the_addition_of_the_entry')+'</label>';

View File

@ -548,7 +548,7 @@ class SRec
td1.colSpan='2';
let table=document.createElement('table');
table.border=0;
table.style.cssText="border:0px;";
table.setAttribute("width","100%");
table.cellspacing=0;
table.cellpadding=0;
@ -579,8 +579,7 @@ class SRec
if (columnNode.getAttribute("vt")==="dateTime")
{
let table=document.createElement('table');
table.border=0;
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;";
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0);
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px;width:100%;";
@ -626,9 +625,8 @@ class SRec
if (columnNode.getAttribute("vt")==="date")
{
let table=document.createElement('table');
table.border=0;
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;";
newRow=table.insertRow(0);
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0);
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px;width:100%;";
let newCell2 = newRow.insertCell(1);
@ -752,8 +750,7 @@ class SRec
}else {
let table=document.createElement('table');
table.border=0;
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;";
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0); //We add a row in the created table.
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px;padding-right:1px;width:100%;";
@ -814,9 +811,7 @@ class SRec
let fc=columnNode.getAttribute("FieldCaption");
let table=document.createElement('table');
//table.setAttribute("bgColor","#0000FF")
table.border=0;
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;";
table.style.cssText="width:100%;/*table-layout:fixed;*/border-spacing:0;border-collapse:collapse;border:0px;";
let newRow=table.insertRow(0); //We add a row in the created table.
let newCell1 = newRow.insertCell(0);
newCell1.style.cssText="padding:0px; border: 0px solid #999999; /*width:100%;*/";