diff --git a/metadata/dbms/TCGallery.js b/metadata/dbms/TCGallery.js index 916ac10..d431a72 100644 --- a/metadata/dbms/TCGallery.js +++ b/metadata/dbms/TCGallery.js @@ -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(maxz0) - 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); } } diff --git a/metadata/dbms/editrecord.js b/metadata/dbms/editrecord.js index 7fa830e..bea0eb9 100644 --- a/metadata/dbms/editrecord.js +++ b/metadata/dbms/editrecord.js @@ -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")+"
"+trt("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this)); - - + confirm2(trt('Warning'),trt("Successfully_added_data")+"
"+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. diff --git a/metadata/dbms/images/config.png b/metadata/dbms/images/config.png index 9b58a6c..c991601 100644 Binary files a/metadata/dbms/images/config.png and b/metadata/dbms/images/config.png differ diff --git a/metadata/dbms/login.js b/metadata/dbms/login.js index 5ff5a44..5583732 100644 --- a/metadata/dbms/login.js +++ b/metadata/dbms/login.js @@ -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='\ \ \n\ - \ - \ + \ + \ '; - 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) diff --git a/metadata/dbms/session.js b/metadata/dbms/session.js index b083c49..2e2041d 100644 --- a/metadata/dbms/session.js +++ b/metadata/dbms/session.js @@ -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 diff --git a/metadata/dbms/showrecord.js b/metadata/dbms/showrecord.js index 96fc04b..8808339 100644 --- a/metadata/dbms/showrecord.js +++ b/metadata/dbms/showrecord.js @@ -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{ for(let i=0;i" - ,function(thiz){ - return function(){ - - for(let i=0;i{ + for(let i=0;i',true)) + if(this.request.callServer(ScriptName,'',true)) { - thiz.showProgressBar(); + this.showProgressBar(); } } } - }; - }(this) - ,null); - - /*if (confirm(trt("Are_you_sure_you_want_to_delete_the_entries")+'?')) - { - for(let i=0;i',true)) - { - this.showProgressBar(); } - } - } - }*/ + ,null); return false; } diff --git a/metadata/dbms/tabs.js b/metadata/dbms/tabs.js index bfcba51..da7f65b 100644 --- a/metadata/dbms/tabs.js +++ b/metadata/dbms/tabs.js @@ -67,6 +67,7 @@ class tcTabs return this.tbs[i]; } } + return null; } } diff --git a/metadata/dbms/tools.js b/metadata/dbms/tools.js index dee565d..db2a244 100644 --- a/metadata/dbms/tools.js +++ b/metadata/dbms/tools.js @@ -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){