+ Подробные коменты в не [[]]

This commit is contained in:
2022-08-19 17:12:00 +06:00
parent b0ddda219f
commit d46b696e6d
10 changed files with 279 additions and 96 deletions

View File

@ -11,6 +11,7 @@ class DBMSUser
this.role='';
this.m_ls=new Array(); //Listeners called OnLogin function.
this.divsh = null;
//Запрашиваю данные о текущем пользователе с сервера
//this.LoadData();
}
@ -162,11 +163,47 @@ class DBMSUser
}
};
showLock(visible) {
if(this.divsh==null) {
this.divsh = document.createElement('div'); //Shadow
this.divsh.style.cssText = "display: none; position: fixed; z-index: 1000; top:0; left:0; height: 100%; width: 100%; background: rgba(0,0,0,0.3);";
document.body.append(this.divsh);
}
if(!visible)
this.divsh.style.display='none';
else
this.divsh.style.display='block';
}
//Checking the session without its extension, if it is completed, we display the authorization window.
checkSession()
{
$.getJSON('../session',{},(data)=>{if(data.result=='ERROR'){this.showLoginForm();}});
setTimeout(()=>this.checkSession(), 10000);
$.ajax({
url: '../session',
data: "{}",
type: "POST",
dataType: "json",
success: (data,status) => {
if(status=='success')
{
if(data.result=='ERROR'){
this.showLoginForm();
}else
if(data.result=='OK'){
this.id=data.user_id;
}
this.showLock(false);
}else
{
this.showLock(true);
}
},
error: (jqXHR, exception)=>
{
this.showLock(true);
}
});
setTimeout(()=>this.checkSession(), 10000);
};
showShadow(visible)
@ -280,27 +317,22 @@ class DBMSUser
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') + "!\n" + xmlHttpRequest.responseText);
return;
}
var 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");
if (fn==-1)
{
alert(findFirstNode(node,'#cdata-section').nodeValue);
this.win.hideProgressBar();
}else
if(fn==7)
{
alert(findFirstNode(node,'#cdata-section').nodeValue);
this.win.Close();
}else {
var 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");
if (fn == -1) {
alert(findFirstNode(node, '#cdata-section').nodeValue);
this.win.hideProgressBar();
} else if (fn == 7) {
alert(findFirstNode(node, '#cdata-section').nodeValue);
this.win.Close();
}
}
}
}else