This commit is contained in:
2020-11-12 19:04:31 +06:00
8 changed files with 32 additions and 63 deletions

View File

@ -7,10 +7,9 @@ function TCGallery(parent)
if(this.mas[0].style.opacity > 0.05)
{
this.mas[0].style.opacity = this.mas[0].style.opacity - 0.05;
this.timeout_id=setTimeout(function(thiz){return function(){thiz.work();}}(this),50);
this.timeout_id=setTimeout(()=>this.work(),50);
this.test++;
//console.info(this.test+' 50 '+this.mas[0].style.opacity);
}else
{
//Перестовляем Z индексы первый на последнее место (больший наверху)
@ -29,12 +28,9 @@ function TCGallery(parent)
{ this.mas[i].style.opacity = 1;
}
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;}); //Сортируем с макс Z индексом наверху в 0ле
this.timeout_id=setTimeout(function(thiz){return function(){thiz.work();}}(this),5000); //Перезапускаем таймер через 10 секунд с максимальным Z индексом
this.timeout_id=setTimeout(()=>this.work(),5000); //Перезапускаем таймер через 10 секунд с максимальным Z индексом
this.selected();
this.test++;
//console.info(this.test+' 5000 '+this.mas[0].style.opacity);
}
};
//Стартуем галерею
@ -46,7 +42,7 @@ function TCGallery(parent)
if(maxz<this.mas[i].style.zIndex) maxz=this.mas[i].style.zIndex;
}
if(this.mas.length>0)
setTimeout(function(thiz){return function(){thiz.work();}}(this),5000);
setTimeout(()=>this.work(),5000);
maxz++;
//Кнопочки для переключения картинок
@ -87,7 +83,7 @@ function TCGallery(parent)
}
clearTimeout(this.timeout_id)
this.timeout_id=setTimeout(function(thiz){return function(){thiz.work();}}(this),10000);
this.timeout_id=setTimeout(()=>this.work(),10000);
this.selected();
};
//Поменялся элемент
@ -225,7 +221,7 @@ class TCGallery2
if(dx>0) dx=Math.ceil(dx); else dx=Math.floor(dx);
this.parent.scrollLeft+=dx;
if(this.parent.scrollLeft!=this.pos)
setTimeout(function(thiz){ return function(){ thiz.moveTo(); } }(this),10);
setTimeout(()=>this.moveTo(),10);
}
}

View File

@ -785,11 +785,7 @@ class EdtRec
button.setAttribute("type","button");
button.style.cssText="margin:0px;margin-right:1px;";
button.setAttribute("value",trt('Apply'));
button.onclick=function(thiz){
return function(){
thiz.sendData();
};
}(this);
button.onclick=()=>this.sendData();
td.appendChild( button );
button = document.createElement('input'); //Button cancel
@ -798,7 +794,7 @@ class EdtRec
button.style.cssText="margin:0px;";
button.setAttribute("value",trt('Cancel'));
//button.onclick=function f_exit(this) { alert2(trt('Alert'),this.win.div); }
button.onclick=function(thiz){ return function(){thiz.win.Close();};}(this);
button.onclick=()=>this.win.Close();
td.appendChild( button );
tr.appendChild(td);
eTable.tBodies[0].appendChild(tr);
@ -1485,11 +1481,7 @@ class EdtRec
let readd=document.getElementById("readd_"+this.uid);
if(readd!==null && readd.checked){
//if(!confirm(trt("Successfully_added_data")+".\n"+trt("Add_more")+"?")) this.win.Close();
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this));
confirm2(trt('Warning'),trt("Successfully_added_data")+"<br>"+trt("Add_more")+"?",null,()=>this.win.Close());
}else
{
this.win.Close();
@ -1499,9 +1491,9 @@ class EdtRec
//The data has been updated successfully now telling the parent to update the record.
updateRows(node)
{
var typeNode=findFirstNode(node,"type");
var typeName=typeNode.getAttribute("n");
var id=typeNode.getAttribute("id");
let typeNode=findFirstNode(node,"type");
let typeName=typeNode.getAttribute("n");
let id=typeNode.getAttribute("id");
if (this.opener!=null)
{
if(this.opener.f_TypeName==typeName) //It would be better to make an array of open windows then check for everyone.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -134,24 +134,21 @@ class DBMSUser
obj=document.getElementById('TLogin_E'+this.uid);
if(obj!==null)
{
obj.onclick=function(thiz)
{
return function()
obj.onclick=()=>
{
var xs='<?xml version="1.0" encoding="utf-8"?>\
<metadata fn="7">\
<cmd><![CDATA[3]]></cmd>\n\
<login><![CDATA['+document.getElementById('tcLogin'+thiz.uid).value+']]></login>\
<password><![CDATA['+document.getElementById('tcPassword'+thiz.uid).value+']]></password>\
<login><![CDATA['+document.getElementById('tcLogin'+this.uid).value+']]></login>\
<password><![CDATA['+document.getElementById('tcPassword'+this.uid).value+']]></password>\
</metadata>';
var request=new TRequest(thiz);
var request=new TRequest(this);
if(request.callServer(ScriptName,xs))
{
thiz.win.showProgressBar();
this.win.showProgressBar();
}
};
}(this);
}
}
};
@ -169,8 +166,8 @@ class DBMSUser
//Checking the session without its extension, if it is completed, we display the authorization window.
checkSession()
{
$.getJSON('../session',{},function(thiz){return function(data){ if(data.result=='ERROR'){thiz.showLoginForm();} };}(this));
setTimeout(function(thiz){return function(){thiz.checkSession();};}(this), 10000);
$.getJSON('../session',{},(data)=>{if(data.result=='ERROR'){this.showLoginForm();}});
setTimeout(()=>this.checkSession(), 10000);
};
showShadow(visible)

View File

@ -45,7 +45,7 @@ function CheckSession(path)
this.run=function()
{
this.sendReq('?fn=2&'+this.ses_name+'='+this.ses_id);
this.timer=setTimeout(function(thiz){ return function(){ thiz.run(); }}(this), 60000);
this.timer=setTimeout(()=>this.run(), 60000);
};
this.path=path; //URL файла session.php

View File

@ -183,10 +183,10 @@ class SRec
htmlElement.innerHTML=str;
}
document.getElementById('SRec_Add_'+this.uid).onclick=function(thiz){return function(){thiz.insertRecord();};}(this);
document.getElementById('SRec_Del_'+this.uid).onclick=function(thiz){return function(){thiz.deleteRecord();};}(this);
document.getElementById('SRec_Exc_'+this.uid).onclick=function(thiz){return function(){thiz.showreport('xls');};}(this);
document.getElementById('SRec_Rfr_'+this.uid).onclick=function(thiz){return function(){thiz.appendFilter(); thiz.sendFilter(-1,0);};}(this);
document.getElementById('SRec_Add_'+this.uid).onclick = ()=>this.insertRecord();
document.getElementById('SRec_Del_'+this.uid).onclick = ()=>this.deleteRecord();
document.getElementById('SRec_Exc_'+this.uid).onclick = ()=>this.showreport('xls');
document.getElementById('SRec_Rfr_'+this.uid).onclick = ()=>{this.appendFilter(); this.sendFilter(-1,0);};
}
//Update dimensions of the elements (the main table in absolute coordinates).
@ -1040,7 +1040,7 @@ class SRec
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; };
th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; };
th.onclick=function(thiz){return function(){ for(let i=0;i<thiz.masChBox.length;i++){ if(!thiz.masChBox[i].disabled) thiz.masChBox[i].checked = ! thiz.masChBox[i].checked; }};}(this);
th.onclick= ()=>{ for(let i=0;i<this.masChBox.length;i++){ if(!this.masChBox[i].disabled) this.masChBox[i].checked = ! this.masChBox[i].checked; }};
tr.appendChild(th);
let pos=0;
@ -1520,36 +1520,19 @@ class SRec
deleteRecord(recordid)
{
confirm2(trt('Warning'),trt("Are_you_sure_you_want_to_delete_the_entries")+"<br>"
,function(thiz){
return function(){
for(let i=0;i<thiz.masChBox.length;i++)
,()=>{
for(let i=0;i<this.masChBox.length;i++)
{
if(thiz.masChBox[i].checked)
if(this.masChBox[i].checked)
{
if(thiz.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="3"><type n="'+thiz.f_TypeName+'" id="'+thiz.masChBox[i].value+'"></type></metadata>',true))
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="3"><type n="'+this.f_TypeName+'" id="'+this.masChBox[i].value+'"></type></metadata>',true))
{
thiz.showProgressBar();
this.showProgressBar();
}
}
}
};
}(this)
,null);
/*if (confirm(trt("Are_you_sure_you_want_to_delete_the_entries")+'?'))
{
for(let i=0;i<this.masChBox.length;i++)
{
if(this.masChBox[i].checked)
{
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="3"><type n="'+this.f_TypeName+'" id="'+this.masChBox[i].value+'"></type></metadata>',true))
{
this.showProgressBar();
}
}
}
}*/
,null);
return false;
}

View File

@ -67,6 +67,7 @@ class tcTabs
return this.tbs[i];
}
}
return null;
}
}

View File

@ -1304,7 +1304,7 @@ class TWin
this.ca=document.getElementById('TWin_Ca_'+this.tWinId);
this.setSel();
this.div.onmousedown=function(thiz){ return function(e){ thiz.setSel(); } }(this);
this.div.onmousedown=(e)=>this.setSel();
//Кнопка закрыть окно
let obj=document.getElementById('TWin_CL_'+this.tWinId);
if(obj!=null){