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

@ -1,8 +1,21 @@
//Галерея изображений на первой странице сайта
function TCGallery(parent)
class TCGallery
{
this.work = function()
constructor(parent)
{
this.test=0;
//Конструктор
this.timeout_id =0;
this.parent=parent;
this.mas = this.getChildsMas(); //Массив элементов которые будут "Галереится"
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;});
this.firstmas = [].concat(this.mas); //Первоначальный порядок элементов
this.btns = new Array();
}
work()
{
if(this.mas[0].style.opacity > 0.05)
{
@ -15,8 +28,8 @@ function TCGallery(parent)
//Перестовляем Z индексы первый на последнее место (больший наверху)
if(this.mas.length>0)
{
var z=this.mas[this.mas.length-1].style.zIndex;
for(var i=this.mas.length-1;i>0;i--)
let z=this.mas[this.mas.length-1].style.zIndex;
for(let i=this.mas.length-1;i>0;i--)
{
this.mas[i].style.zIndex=this.mas[i-1].style.zIndex
}
@ -24,7 +37,7 @@ function TCGallery(parent)
}
//Поменяли местами востанавливаем прозрачность
for(var i=0;i<this.mas.length;i++)
for(let i=0;i<this.mas.length;i++)
{ this.mas[i].style.opacity = 1;
}
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;}); //Сортируем с макс Z индексом наверху в 0ле
@ -32,12 +45,12 @@ function TCGallery(parent)
this.selected();
this.test++;
}
};
}
//Стартуем галерею
this.Start = function()
Init()
{
var maxz=0;
for(var i=0;i<this.mas.length;i++)
let maxz=0;
for(let i=0;i<this.mas.length;i++)
{ this.mas[i].style.opacity = 1;
if(maxz<this.mas[i].style.zIndex) maxz=this.mas[i].style.zIndex;
}
@ -46,11 +59,11 @@ function TCGallery(parent)
maxz++;
//Кнопочки для переключения картинок
var cdv=document.createElement('div');
let cdv=document.createElement('div');
cdv.style.cssText='opacity: 0.7; display: block; position: absolute; bottom: 5px; right: 5px; z-index: '+maxz+'; border: solid 0px red;';
for(var i=0;i<this.mas.length;i++)
for(let i=0;i<this.mas.length;i++)
{
var btn=document.createElement('div');
let btn=document.createElement('div');
btn.style.cssText='cursor: pointer; background-color: #eeeeee; text-align: center; display: inline-block; margin: 2px; border: solid 1px black; width: 17px;';
btn.appendChild(document.createTextNode(i+1));
btn.onclick = function(thiz,i){return function(){ thiz.moveTo(i); }; }(this,i);
@ -59,18 +72,18 @@ function TCGallery(parent)
}
this.parent.appendChild(cdv);
if(this.btns.length>0) this.btns[0].style.backgroundColor='#f3af5a';
};
}
//Переместить на заданный слой (позиция с 0)
this.moveTo = function(pos)
moveTo(pos)
{
if(pos<0 || pos>this.firstmas.length - 1) return;
var elm=this.firstmas[pos];
for(var j=0;j<this.mas.length;j++)
let elm=this.firstmas[pos];
for(let j=0;j<this.mas.length;j++)
{
if(this.mas[0]==elm) break;
var z=this.mas[this.mas.length-1].style.zIndex;
for(var i=this.mas.length-1;i>0;i--)
let z=this.mas[this.mas.length-1].style.zIndex;
for(let i=this.mas.length-1;i>0;i--)
{
this.mas[i].style.zIndex=this.mas[i-1].style.zIndex
}
@ -78,67 +91,57 @@ function TCGallery(parent)
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;});
}
//Поменяли местами востанавливаем прозрачность
for(var i=0;i<this.mas.length;i++)
for(let i=0;i<this.mas.length;i++)
{ this.mas[i].style.opacity = 1.0;
}
clearTimeout(this.timeout_id)
this.timeout_id=setTimeout(()=>this.work(),10000);
this.selected();
};
}
//Поменялся элемент
this.selected = function()
selected()
{
var pos=0;
for(var i=0;i<this.firstmas.length;i++)
let pos=0;
for(let i=0;i<this.firstmas.length;i++)
{ if(this.mas[0]==this.firstmas[i])
{ pos=i;
break;
}
}
//Обнуляем стили
for(var i=0;i<this.btns.length;i++)
for(let i=0;i<this.btns.length;i++)
this.btns[i].style.backgroundColor='#eeeeee';
//Выставляем стиль для выбранного элемента
this.btns[pos].style.backgroundColor='#f3af5a';
};
}
//Private
//Получить детей в виде массива
this.getChildsMas = function()
getChildsMas()
{
var mas = new Array();
let mas = new Array();
if(this.parent!==null)
{
var child = this.parent.firstChild;
while(child)
{ if(typeof child.style !== "undefined") //Только те где есть стиль
{ mas.push(child);
}
child = child.nextSibling;
let child = this.parent.firstChild;
while(child){
if(typeof child.style !== "undefined"){ //Только те где есть стиль
mas.push(child);
}
child = child.nextSibling;
}
}
return mas;
};
}
//Private
//Получить позицию по объекту (-1 если ненайден)
this.getPos = function(obj)
getPos(obj)
{
for(var i=0;i<this.firstmas.length;i++)
for(let i=0;i<this.firstmas.length;i++)
{ if(this.firstmas[i]==obj) return i;
}
return -1;
};
this.test=0;
//Конструктор
this.timeout_id =0;
this.parent=parent;
this.mas = this.getChildsMas(); //Массив элементов которые будут "Галереится"
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;});
this.firstmas = [].concat(this.mas); //Первоначальный порядок элементов
this.btns = new Array();
}
}
//Галерея изображений на странице товара (Двигается в право в лево)

View File

@ -60,7 +60,7 @@ select
text-align: center;
}
input[type="text"], input[type="password"], textarea, select {
input[type="text"].DBMS, input[type="password"].DBMS, textarea.DBMS, select.DBMS {
background-color : var(--back-color3);
color : var(--main-font-color);
border-color: rgb(195, 195, 195);
@ -68,7 +68,7 @@ input[type="text"], input[type="password"], textarea, select {
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
input[type="text"]:focus.DBMS, input[type="password"]:focus.DBMS, textarea:focus.DBMS, select:focus.DBMS {
outline: none !important;
border-color: rgb(195, 195, 195);
border-width: 1px;
@ -76,10 +76,11 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:f
}
/*Стили для таблицы которая исполняет роль окна*/
.shadow {
table.DBMSShadow {
box-shadow: 0 0 10px var(--box-shadow-color);
background-color: var(--back-color);
color: var(--main-font-color);
border-collapse: collapse;
}
/* Для полей состояжих из нескольких элементов (поле с кнопочкой допустим) */

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 + " "));

View File

@ -98,10 +98,10 @@ class DBMSUser
this.win.setSize("350px","200px");
var str='<div style="width: 100%; height: 100%; padding: 3px; text-align: left;">\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<tbody>\n\
<tr><td>\n\
<table border="0" style="width: 100%; height: 100%;">\n\
<table style="width: 100%; height: 100%;">\n\
<tr>\n\
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+trt('Login')+' (E-mail):</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\
@ -228,7 +228,7 @@ class DBMSUser
win.setCaption(trt("Password_recovery"));
str='<div style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\
<tr>\n\
<td style="padding: 2px; white-space: nowrap"><b>'+trt('Login')+' (E-mail)</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="40" style="width: 100%; display: inline;" id="'+win.uid+'_email" name="login">\n\

View File

@ -69,7 +69,7 @@
if($v=='1') $v='true'; else
if($v=='0') $v='false';
}else
if($t=='string' || $t=='text' || $t=='dateTime' || $t=='time' || $t=='date' || $t=='file') {
if($t=='string' || $t=='html' || $t=='text' || $t=='dateTime' || $t=='time' || $t=='date' || $t=='file') {
if ($v == '') {
$v = 'NULL';
} else {

View File

@ -127,7 +127,14 @@ class SRec
//Apply the parameters to the current XML filter if there are filter settings in the parent window!
if(xml===null || typeof(xml) == "undefined" || xml=="") return;
if(typeof(xml) == "string"){
applyNodeToNode(findFirstNodeOnAttribute(CreateXMLDOC(xml), "type", "n", this.f_TypeName), findFirstNodeOnAttribute(this.nodeMetadata, "type", "n", this.f_TypeName), "n");
let doc=CreateXMLDOC(xml);
if(doc==null)
alert2(trt('Alert'),xml);
else {
let node=findFirstNodeOnAttribute(doc, "type", "n", this.f_TypeName);
if(node!=null)
applyNodeToNode(node, findFirstNodeOnAttribute(this.nodeMetadata, "type", "n", this.f_TypeName), "n");
}
}else
if(typeof(xml) == "object"){
if(xml.getAttribute("n")==this.f_TypeName)
@ -146,12 +153,12 @@ class SRec
<caption></caption><thead></thead><tbody></tbody>\
</table>\
</td></tr><tr><td>\
<table style="width:100%;"><tr><td><img src="../resources/metadata/dbms/images/rplus.png" alt="add" id="SRec_Add_'+this.uid+'" title="'+trt('Add_record')+'" border="0" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/rdel.png" alt="del" id="SRec_Del_'+this.uid+'" title="'+trt('Delete_record')+'" border="0" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/excel.png" alt="excel" id="SRec_Exc_'+this.uid+'" title="'+trt('Export_to_Excel')+'" border="0" style="cursor: pointer;"/></td>\
<table style="width:100%;"><tr><td><img src="../resources/metadata/dbms/images/rplus.png" alt="add" id="SRec_Add_'+this.uid+'" title="'+trt('Add_record')+'" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/rdel.png" alt="del" id="SRec_Del_'+this.uid+'" title="'+trt('Delete_record')+'" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/excel.png" alt="excel" id="SRec_Exc_'+this.uid+'" title="'+trt('Export_to_Excel')+'" style="cursor: pointer;"/></td>\
<td style="width: 99%;">&nbsp;</td>\
<td><img src="../resources/metadata/dbms/images/config.png" alt="'+trt('Settings')+'" id="SRec_Cnf_'+this.uid+'" title="'+trt('Settings')+'" border="0" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/refresh.png" alt="'+trt('Refresh')+'" id="SRec_Rfr_'+this.uid+'" title="'+trt('Update')+'" border="0" style="cursor: pointer;"/></td></tr>\
<td><img src="../resources/metadata/dbms/images/config.png" alt="'+trt('Settings')+'" id="SRec_Cnf_'+this.uid+'" title="'+trt('Settings')+'" style="cursor: pointer;"/></td>\
<td><img src="../resources/metadata/dbms/images/refresh.png" alt="'+trt('Refresh')+'" id="SRec_Rfr_'+this.uid+'" title="'+trt('Update')+'" style="cursor: pointer;"/></td></tr>\
</table>\
</td></tr><tr><td id="tblContainer_'+this.uid+'" style="vertical-align:top; overflow:hidden; width:100%; height:100%; text-align:center;">\
<div id="tblSContainer_'+this.uid+'" style="position: absolute; overflow:scroll; width: 400px; height: 400px;">\
@ -209,7 +216,7 @@ class SRec
{
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);
@ -581,6 +588,7 @@ class SRec
newCell2.style.cssText="padding:0px;width:25px;";
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
/*input.onkeydown=function(event){
@ -626,7 +634,8 @@ class SRec
let newCell2 = newRow.insertCell(1);
newCell2.style.cssText="padding:0px;width:25px;";
input = document.createElement('input');
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
/*input.onkeydown=function(event){
@ -662,6 +671,7 @@ class SRec
if (columnNode.getAttribute("vt")==="b")
{
let select = document.createElement('select');
select.classList.add('DBMS');
select.onkeydown=function(){
if(event.keyCode==13) event.keyCode=9;
};
@ -706,6 +716,7 @@ class SRec
if (columnNode.getAttribute("vt")==="string")
{
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
input.onkeydown=function(event){if(event.which==13) event.which=9;};
@ -730,6 +741,7 @@ class SRec
newCell3.style.cssText="padding:0px;width:25px;height:100%;";
let input = document.createElement('input');
input.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
input.onkeydown=function(){ if(event.keyCode==13) event.keyCode=9; };
@ -741,7 +753,7 @@ class SRec
newCell1.appendChild( input );
let button = document.createElement('input');
button.className='button-secondary';
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","+");
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
@ -749,7 +761,7 @@ class SRec
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
button = document.createElement('input');
button.className='button-secondary';
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","-");
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
@ -761,8 +773,9 @@ class SRec
if (columnNode.getAttribute("vt")==="f8")
{
let input = document.createElement('input');
input.style.cssText="width: 100%;";
input.setAttribute("type","text");
button.classList.add('DBMS');
input.style.cssText="width: 100%;";
input.onkeydown=function(){ if(event.keyCode==13) event.keyCode=9; };
input.setAttribute("name",columnNode.getAttribute("n"));
if(columnNode.getAttribute("size")!=null)
@ -790,6 +803,7 @@ class SRec
if(selector=="combo")
{
let select = document.createElement('select');
select.classList.add('DBMS');
select.style.cssText="width: 100%;";
select.onkeydown=function(){ if(event.keyCode==13) event.keyCode=9; };
//select.setAttribute("name",columnNode.getAttribute("n"))
@ -800,7 +814,7 @@ class SRec
newCell1.appendChild(select);
let button = document.createElement('input');
button.className='button-secondary';
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="display:block; box-sizing: border-box; margin: 0px; padding: 0px;width:100%; height:100%; font-size: 9pt;";
@ -844,6 +858,7 @@ class SRec
{
//Two elements are placed in the table
let input = document.createElement('input');
input.classList.add('DBMS');
//After pressing Enter we pass the entered line to the server
input.onkeydown=function(obj,val1,val2,val3,val4){
return function(e){
@ -869,7 +884,7 @@ class SRec
newCell1.appendChild(hidden);
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; height:100%;margin: 0px; padding: 0px;";
@ -904,7 +919,7 @@ class SRec
td.setAttribute("align","right");
let button = document.createElement('input');
button.className='button-secondary';
button.classList.add('button-secondary');
button.setAttribute("type","button");
button.setAttribute("value",trt("Filtering"));
button.setAttribute("id","btnfilter_"+this.uid);
@ -1187,6 +1202,7 @@ class SRec
if(!(this.f_pD!="1" || nodeRecord.getAttribute("a").indexOf("d")==-1))
{
let checkbox = document.createElement('input');
checkbox.classList.add('DBMS');
this.masChBox.push(checkbox);
//checkbox.disabled=true;
checkbox.setAttribute("type","checkbox");

View File

@ -125,7 +125,7 @@ function showProgressBar(obj,img_id)
let pBarDiv=document.createElement('div');
pBarDiv.id=obj.id+'_pBar';
pBarDiv.style.cssText='position: absolute; left: 0px; top: 0px; z-index: 1; background-color: rgba(0,0,0,0.5); width:100%; height: 100%;';
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'+img_id+'.gif" alt=""></td></tr></table>';
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'+img_id+'.gif" alt=""></td></tr></table>';
obj.appendChild(pBarDiv);
};
@ -192,7 +192,7 @@ function alert2(title,text,okFunc=null)
win.BuildGUI(10,10);
win.setCaption(document.createTextNode(title));
let html='\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<tr>\n\
<td colspan="2" style="text-align: center; vertical-align: middle;">'+text+'</td>\n\
</tr>\n\
@ -219,7 +219,7 @@ function confirm2(title,text,okFunc,cancelFunc)
win.BuildGUI(10,10);
win.setCaption(document.createTextNode(title));
let html='\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<tr style="width: 100%;">\n\
<td colspan="3" style="text-align: center; vertical-align: middle; width: 100%;">'+text+'</td>\n\
</tr>\n\
@ -326,12 +326,15 @@ function validateNumber(myEvent,decimal) {
//Добавить предшествующие нули к цифре
function pad(number, length)
{
var str = '' + number;
let str = '' + number;
while (str.length < length)
{ str = '0' + str;
}
return str;
}
//Добавить дней к дате
function addDays(date, n)
{
@ -469,7 +472,7 @@ function eraseCookies()
function move_me(e,win)
{
var elem=win.div;
let elem=win.div;
if(!e) e = window.event;
win.dx=parseInt(elem.style.left)-(e.pageX || e.x);
win.dy=parseInt(elem.style.top)-(e.pageY || e.y);
@ -478,8 +481,8 @@ function move_me(e,win)
};
document.onmousemove = function(e) {
if(!e) e = window.event;
var x2 = e.pageX || e.x;
var y2 = e.pageY || e.y;
let x2 = e.pageX || e.x;
let y2 = e.pageY || e.y;
elem.style.top = win.dy + y2+'px';
if(parseInt(elem.style.top)<0) elem.style.top='0px';
elem.style.left = win.dx + x2+'px';
@ -494,7 +497,7 @@ function move_me(e,win)
function createImg(src,w,h)
{
var img=new Image();
let img=new Image();
if ((/MSIE (5\.5|6).+Win/.test(navigator.userAgent))&&(/\.png$/.test(src)))
{
img.style.cssText="height:"+h+"; width:"+w+"; background:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"' ,sizingMethod='scale');";
@ -514,7 +517,7 @@ function fixPNG(element)
{
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent))
{
var src;
let src;
if (element.tagName=='IMG')
{
if (/\.png$/.test(element.src))
@ -632,10 +635,10 @@ function getParam(sParamName,win)
//утилитарная функция из-за различий IE и FF
function getXMLNodeSerialisation(xmlNode)
{
var text = null;
let text = null;
try
{
var serializer = new XMLSerializer(); // Gecko-based browsers, Safari, Opera.
let serializer = new XMLSerializer(); // Gecko-based browsers, Safari, Opera.
text = serializer.serializeToString(xmlNode);
}
catch (e)
@ -671,7 +674,7 @@ function createRequestObject()
//создать DOMParser
function CreateXMLDOC(xmlString)
{
var xml=null;
let xml=null;
if (window.ActiveXObject)
{
xml = new ActiveXObject("MSXML2.DOMDocument");
@ -679,7 +682,7 @@ function CreateXMLDOC(xmlString)
}
else if(document.implementation)
{
var parser = new DOMParser();
let parser = new DOMParser();
xml = parser.parseFromString(xmlString,"text/xml");
}
return xml
@ -689,7 +692,7 @@ function findNode(node, nodename, n)
{
if (typeof n == "undefined") n = 0;
if(node==null) return null;
var nextNode = node.firstChild;
let nextNode = node.firstChild;
while (nextNode != null)
{
if(nextNode.nodeName.toLowerCase()==nodename.toLowerCase()) return nextNode;
@ -702,8 +705,8 @@ function findNodeOnNum(node,nodename,n)
{
if (typeof n == "undefined") n = 0;
if(node==null) return null;
var nextNode = node.firstChild;
var i=0
let nextNode = node.firstChild;
let i=0
while (nextNode != null)
{
if(nextNode.nodeName.toLowerCase()==nodename.toLowerCase())
@ -719,7 +722,7 @@ function findNodeOnNum(node,nodename,n)
function findNodeOnAttribute(node, nodename,Attribute,val)
{
if(node==null) return null;
var n = node.firstChild;
let n = node.firstChild;
while (n != null)
{
if((n.nodeName.toLowerCase()==nodename.toLowerCase())&&(n.getAttribute(Attribute)==val)) {
@ -732,8 +735,8 @@ function findNodeOnAttribute(node, nodename,Attribute,val)
//Вернуть номер узла по атрибуту среди себеподобных (нумерация с 0)
function findNumNodeOnAttribute(node, nodename,Attribute,val)
{ if(node==null) return -1;
var i=0;
var n = node.firstChild;
let i=0;
let n = node.firstChild;
while (n != null)
{if(n.nodeName.toLowerCase()==nodename.toLowerCase())
{if(n.getAttribute(Attribute)==val) return i;
@ -748,8 +751,8 @@ function findNumNodeOnAttribute(node, nodename,Attribute,val)
function findFirstNode(node, nodename)
{
if(node==null) return null;
var mas=new Array();
var pos=0;
let mas=new Array();
let pos=0;
mas[pos] = node.firstChild;
while (mas[pos] != null)
{
@ -787,8 +790,8 @@ function findFirstNode(node, nodename)
function findFirstNodeOnAttribute(node, nodename,Attribute,val)
{
if(node==null) return null;
var mas=new Array();
var pos=0;
let mas=new Array();
let pos=0;
mas[pos] = node.firstChild;
while (mas[pos] != null)
{
@ -826,8 +829,8 @@ function findFirstNodeOnAttribute(node, nodename,Attribute,val)
function findNodeOnPath(node, path)
{
if(node==null) return null;
var Params = path.split("/");
for (var i=0;i<Params.length;i++)
let Params = path.split("/");
for (let i=0;i<Params.length;i++)
{
if(node==null) return null;
node=findNode(node,Params[i]);
@ -838,7 +841,7 @@ function findNodeOnPath(node, path)
function getCdata(node,n)
{
if(node==null) return null;
var r=findNodeOnNum(node,'#cdata-section',n);
let r=findNodeOnNum(node,'#cdata-section',n);
if(r==null)
{
r=node.ownerDocument.createCDATASection("");
@ -850,7 +853,7 @@ function getCdata(node,n)
function getCdataValue(node,n)
{
if(node==null) return '';
var r=findNodeOnNum(node,'#cdata-section',n);
let r=findNodeOnNum(node,'#cdata-section',n);
if(r==null) return '';
return r.nodeValue;
}
@ -870,7 +873,7 @@ function deleteHTML(obj)
obj=document.getElementById(obj);
if(obj!=null)
{
var parent=obj.parentNode;
let parent=obj.parentNode;
if(parent!=null) parent.removeChild(obj);
return true;
}
@ -907,10 +910,10 @@ function applyNodeToNode(first, second, name)
return;
}
//Если есть совпадающие узлы то передаём в рекурсию если нет то просто копируем
var fn=first.firstChild;
let fn=first.firstChild;
while (fn !== null)
{
var sn=null;
let sn=null;
if(fn.nodeName!=="#text" && fn.nodeName!=="#cdata-section" && fn.nodeName!=="#comment"){ //потому что для этих getAttribute вызывает ошибку
sn=findNodeOnAttribute(second,fn.nodeName,name,fn.getAttribute(name));
}
@ -918,7 +921,7 @@ function applyNodeToNode(first, second, name)
if(sn!==null) //Если по имени атрибуту совпали узлы
{
//Переписываем значения атрибутов из первого второму, если их нет то создаются автоматом
for(i=0;i<fn.attributes.length;i++)
for(let i=0;i<fn.attributes.length;i++)
{ sn.setAttribute(fn.attributes[i].nodeName,fn.attributes[i].value);
}
applyNodeToNode(fn,sn,name); //В рекурсию
@ -954,7 +957,7 @@ function replaseTextInCDATA(node,oldStr,newStr)
{
if(node===null || oldStr===null || newStr===null) return;
var fn=node.firstChild;
let fn=node.firstChild;
while (fn !== null)
{
if(fn.nodeName=="#cdata-section")
@ -984,7 +987,7 @@ class TRequest
callServer(url,xmlString)
{
var call=new myXMLHttpRequest(this);
let call=new myXMLHttpRequest(this);
return call.callServer(url,xmlString);
}
@ -998,18 +1001,18 @@ class TRequest
xmlHttpRequest.responseXML=CreateXMLDOC(xmlHttpRequest.responseText);
//загрузился xml документ начинаем его разбирать (по id функции в документе)
var xmldoc = xmlHttpRequest.responseXML;
let xmldoc = xmlHttpRequest.responseXML;
if(xmldoc==null){
alert2(trt('Alert'),trt('Wrong_XML_document')+"!\nXML=("+xmlHttpRequest.responseText+')\nURL=('+url+')\nxmlString=('+xmlString+')');
return;
}
var node = xmldoc.documentElement;
let node = xmldoc.documentElement;
if((node==null)||(node.getAttribute("fn")==null)) alert(trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText);
else
{
//alert("XML=\n"+getXMLNodeSerialisation(node));
var fn = node.getAttribute("fn");
let fn = node.getAttribute("fn");
if(this.winObj!=null)
{
//this.winObj.alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node));
@ -1182,20 +1185,21 @@ class TWin
if(this.disableClosing)
return;
//Переместил перед удалением компонент так как бывает нужно поработать с ними перед удалением
if(this.onClose!=null)
{
this.onClose();
}
this.hide(true);
this.setParent(null);
for(var i=0;i<this.childs.length;i++) if(this.childs[i]!=null) this.childs[i].parent=null
for(let i=0;i<this.childs.length;i++) if(this.childs[i]!=null) this.childs[i].parent=null
//??? зачем коментил (пояснение не понятное)? раскоментил потому что после пересоздания формы HTML id сохранялись (Вот непонятный комент: Закоментил потому что в магазине могут закрыть окно а оно больше не появится...)
if(this.div.parentNode!=null) this.div.parentNode.removeChild(this.div);
if(this.divsh.parentNode!=null) this.divsh.parentNode.removeChild(this.divsh);
this.closed=true;
if(this.onClose!=null)
{
this.onClose();
}
};
//Типа конструктор создать окно с заданой позицией
@ -1203,7 +1207,7 @@ class TWin
{
this.tWinId=Wins.add(this);
/*
var hd='';
let hd='';
hd+='<table style="width: 100%;">';
hd+=' <tr>';
hd+=' <td style="vertical-align:bottom;cursor:move;" id="TWin_H1_'+this.tWinId+'"><img src="../metadata/dbms/form/t1.gif" style="width: 20px; height: 20px; display: block;" alt="" border="0px" draggable="false"/></td>';
@ -1217,7 +1221,7 @@ class TWin
hd+=' </tr>';
hd+='</table>';
var str='';
let str='';
str+='<table id="TWin_TBL_'+this.tWinId+'" border="0px" style="width: 100%; height: 100%;">';
str+=' <tr id="TWin_H0_'+this.tWinId+'"><td colspan=3>'+hd+'</td></tr>';
str+=' <tr>';
@ -1238,7 +1242,7 @@ class TWin
str+='</table>';
*/
/*
var str='';
let str='';
str+='<table id="TWin_TBL_'+this.tWinId+'" class="TWin">';
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="border-bottom: 1px solid #b3b3b3;"><td></td><td><table style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;"><img src="../resources/metadata/dbms/form/x.gif" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;"></td></tr></table></td><td></td></tr>';
str+=' <tr>';
@ -1267,7 +1271,7 @@ class TWin
}
let str='';
str+='<table id="TWin_TBL_'+this.tWinId+'" class="shadow" style="width: 100%; height: 100%; border: 1px solid #000000;">';
str+='<table id="TWin_TBL_'+this.tWinId+'" class="DBMSShadow" style="width: 100%; height: 100%; border: 1px solid #000000;">';
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: url(../resources/metadata/dbms/form/'+imgB+') repeat-x;"><td></td><td><table style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;">'+(this.disableClosing ? '' : '<img src="../resources/metadata/dbms/form/'+imgX+'" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;padding-right: 5px;">')+'</td></tr></table></td><td></td></tr>';
str+=' <tr>';
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
@ -1392,8 +1396,8 @@ class TWin
//В центр видимой части экрана
setCenter()
{
var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
let scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
this.div.style.left=(scrollLeft+((document.documentElement.clientWidth || document.body.clientWidth)-parseInt(this.div.style.width))/2)+"px"
this.div.style.top=(scrollTop+((document.documentElement.clientHeight || document.body.clientHeight)-parseInt(this.div.style.height))/2)+"px"
@ -1533,7 +1537,7 @@ class TWin
this.pBarDiv=document.createElement('div');
this.pBarDiv.style.cssText='position: absolute; left: 0px; top: 0px; z-index: 1; width:100%; height: 100%; margin-top:30px; padding-bottom:30px;';
this.pBarDiv.innerHTML='<table style="background-color: rgba(0,0,0,0.5);" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" style="vertical-align: middle;"><img src="../resources/metadata/dbms/images/'+img+'" alt=""></td></tr></table>';
this.pBarDiv.innerHTML='<table style="background-color: rgba(0,0,0,0.5);" width="100%" height="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="vertical-align: middle;"><img src="../resources/metadata/dbms/images/'+img+'" alt=""></td></tr></table>';
//var eDiv=document.getElementById('eDiv'+this.uid);
this.div.appendChild(this.pBarDiv);
@ -1653,30 +1657,34 @@ function getIntVal(str)
else return parseInt(rez)
}
//Аналог PHP функции форматирования чисел
function number_format (number, decimals, dec_point, thousands_sep)
//Аналог PHP функции форматирования чисел (для разделения на десятки и сотни)
function number_format (number, decimals, dec_point, thousands_sep)
{
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
s = '',
toFixedFix = function (n, prec) {
var k = Math.pow(10, prec);
return '' + Math.round(n * k) / k;
};
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
if (s[0].length > 3) {
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
}
if ((s[1] || '').length < prec) {
s[1] = s[1] || '';
s[1] += new Array(prec - s[1].length + 1).join('0');
}
return s.join(dec);
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
let n = !isFinite(+number) ? 0 : +number;
let prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
let sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep;
let dec = (typeof dec_point === 'undefined') ? '.' : dec_point;
let s = '';
let toFixedFix = function (n, prec) {
let k = Math.pow(10, prec);
return '' + Math.round(n * k) / k;
};
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
if (s[0].length > 3) {
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
}
if ((s[1] || '').length < prec) {
s[1] = s[1] || '';
s[1] += new Array(prec - s[1].length + 1).join('0');
}
return s.join(dec);
}
/*
function number_format( number, decimals, dec_point, thousands_sep )
{ // Format a number with grouped thousands