Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/scale/ |
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/scale/actionprocessdialog.min.js |
(function(e){if(BX.Scale.ActionProcessDialog)return;BX.Scale.ActionProcessDialog={dialogWindow:null,contentTable:null,processingAction:false,pageRefresh:false,getContentObj:function(){if(this.contentTable===null){var e=BX.create("table",{props:{className:"bx-adm-scale-action-result-table"}}),t=BX.create("tr");t.appendChild(BX.create("th",{html:BX.message("SCALE_PANEL_JS_ARD_NAME")}));t.appendChild(BX.create("th",{html:BX.message("SCALE_PANEL_JS_ARD_RESULT")}));t.appendChild(BX.create("th",{html:BX.message("SCALE_PANEL_JS_ARD_MESSAGE")}));e.appendChild(t);this.contentTable=e}return this.contentTable},addActionProcess:function(e){if(this.processingAction)return false;this.processingAction=true;var t=this.getContentObj(),n=BX.create("tr");n.appendChild(BX.create("td",{html:e}));var i=BX.create("td"),a=document.body.appendChild(document.createElement("DIV"));a.className="bx-adm-scale-wait";a.style.marginLeft="24px";i.appendChild(a);n.appendChild(i);n.appendChild(BX.create("td"));t.appendChild(n);if(this.dialogWindow)this.dialogWindow.adjustSizeEx();return true},setActionResult:function(e,t){if(!this.processingAction)return false;if(t)this.addActionMessage(t,true);this.processingAction=false;var n=this.contentTable.lastChild;if(e)n.children[1].innerHTML="<td style='text-align: center;'><span style='color: green;'>OK</span></td>";else n.children[1].innerHTML="<td style='text-align: center;'><span style='color: red;'>"+BX.message("SCALE_PANEL_JS_ERROR")+"</span></td>";BX("close").disabled=false;return true},addActionMessage:function(e,t){if(!this.processingAction)return false;var n=this.contentTable.lastChild;if(t){n.children[2].innerHTML=e}else{if(n.children[2].innerHTML.length>0)n.children[2].innerHTML+="<br>";n.children[2].innerHTML+=e}return true},show:function(){var t=this.getContentObj();BX.Scale.currentActionProcessDialogContext=this;var n=BX.CAdminDialog.btnClose;if(this.pageRefresh){n.action=function(){this.parentWindow.Close();BX.Scale.AdminFrame.waitForPageRefreshing();e.location.reload(true)}}this.dialogWindow=new BX.CDialog({title:BX.message("SCALE_PANEL_JS_APD_TITLE"),content:t,resizable:false,height:500,width:500,buttons:[n]});BX("close").disabled=true;this.dialogWindow.unclosable=true;this.dialogWindow.adjustSizeEx();this.dialogWindow.Show()}}})(window);