AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 13.58.210.96
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/js/sale/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/js/sale//core_ui_chainedselectors.min.js
BX.ui.chainedSelectors=function(e,t){this.parentConstruct(BX.ui.chainedSelectors,e);BX.merge(this,{opts:{source:"/somewhere.php",paginatedRequest:false,autoSelectWhenSingle:true,knownBundles:{},selectedItem:false,initialBundlesIncomplete:false,bundlesIncomplete:{},rootNodeValue:0,ignoreUnSelectable:false,adapterName:"combobox",messages:{nothingFound:"Sorry, nothing found",notSelected:"-- Not selected",error:"Error occured"},bindEvents:{init:function(){this.setInitialValue();this.vars.allowHideErrors=true}}},vars:{stack:[],cache:{links:{},nodes:{},incomplete:{}},value:false,eventLock:false,allowHideErrors:false},sys:{code:"chainedselectors"}});this.handleInitStack(t,BX.ui.chainedSelectors,e)};BX.extend(BX.ui.chainedSelectors,BX.ui.networkIOWidget);BX.merge(BX.ui.chainedSelectors.prototype,{init:function(){var e=this.opts,t=this.ctrls,n=this.vars;t.targetInput=this.getControl("target");t.errorMessage=this.getControl("error",true);t.pool=this.getControl("pool");if(typeof t.pool=="undefined")t.pool=t.scope;if(typeof e.knownBundles=="object"){this.fillCache(e.knownBundles);if(e.initialBundlesIncomplete){for(var s in e.knownBundles)if(e.knownBundles.hasOwnProperty(s))n.cache.incomplete[s]=true}else if(typeof e.bundlesIncomplete!="undefined"){for(var s in e.knownBundles){if(e.knownBundles.hasOwnProperty(s))if(typeof e.bundlesIncomplete[s]!="undefined")n.cache.incomplete[s]=true}}}this.pushFuncStack("buildUpDOM",BX.ui.chainedSelectors);this.pushFuncStack("bindEvents",BX.ui.chainedSelectors)},buildUpDOM:function(){},bindEvents:function(){var e=this,t=this.opts,n=this.vars,s=this.ctrls;this.bindEvent("control-change",this.controlChangeActions);BX.bind(s.targetInput,"change",function(){if(n.eventLock)return;e.setValue(this.value)})},addItems2Cache:function(){},clearCache:function(){},focus:function(){},checkDisabled:function(){},disable:function(){},enable:function(){},setValue:function(e){var t=this.vars;if(t.value!=false&&typeof e!="undefined"&&e==t.value)return;if(e==null||e==false||typeof e=="undefined"||e.toString().length==0){this.displayRoute([]);this.setValueVariable("");this.setTargetValue("");this.fireEvent("after-clear-selection");return}this.fireEvent("before-set-value",[e]);var n=new BX.deferred;var s=this;n.done(BX.proxy(function(n){this.displayRoute(n);t.value=e;this.setTargetValue(this.checkCanSelectItem(e)?e:this.getLastValidValue())},this));n.fail(function(e){if(e=="notfound"){s.displayRoute([]);s.setValueVariable("");s.setTargetValue("");s.showError({errors:[s.opts.messages.nothingFound],type:"server-logic",options:{}})}});this.hideError();this.getRouteToNode(e,n)},getValue:function(){return this.vars.value===false?"":this.vars.value},clearSelected:function(){this.setValue("")},getNodeByValue:function(e){return this.vars.cache.nodes[e]},setTabIndex:function(e){},setTargetInputName:function(e){this.ctrls.targetInput.setAttribute("name",e)},cancelRequest:function(){},getStackSize:function(){return this.vars.stack.length},getAdapterAtPosition:function(e){if(e<0||e>=this.vars.stack.length)return null;return this.vars.stack[e].control},setTargetInputValue:function(e){this.vars.eventLock=true;this.ctrls.targetInput.value=e;BX.fireEvent(this.ctrls.targetInput,"change");this.vars.eventLock=false},setFakeInputValue:function(e){},setValueVariable:function(e){this.vars.value=e},checkCanSelectItem:function(e){if(this.opts.ignoreUnSelectable)return true;var t=this.vars.cache.nodes;if(typeof t[e]=="undefined")return false;if(typeof t[e].IS_UNCHOOSABLE=="undefined")return true;return!t[e].IS_UNCHOOSABLE},controlChangeActions:function(e,t){var n=this,s=this.opts,i=this.vars,o=this.ctrls;this.hideError();if(t.length==0){n.truncateStack(e);i.value=n.getLastValidValue();n.setTargetValue(i.value)}else{var r=i.cache.nodes[t];if(typeof r=="undefined")throw new Error("Selected node not found in the cache");n.truncateStack(e);if(typeof i.cache.links[t]!="undefined"||r.IS_PARENT)n.appendControl(t);if(n.checkCanSelectItem(t)){i.value=t;n.setTargetValue(t)}}},setTargetValue:function(e){this.setTargetInputValue(e);this.fireEvent("after-select-item",[e])},getRouteToNodeFromCache:function(e){var t=[],n=this.vars;if(typeof n.cache.nodes[e]=="undefined")return t;var s=n.cache.nodes[e];t.unshift(s.VALUE);var i=0;var o=false;var r=BX.util.getObjectLength(n.cache.nodes);while(i<r){var a=s.PARENT_VALUE;if(a==this.opts.rootNodeValue)o=true;t.unshift(a);if(typeof a=="undefined"||a==this.opts.rootNodeValue||a=="0"){break}else{if(typeof n.cache.nodes[a]=="undefined")throw new Error("Tree integrity compromised");s=n.cache.nodes[a]}i++}return t},setInitialValue:function(){var e=false;if(this.opts.selectedItem!==false)e=this.opts.selectedItem;else if(this.ctrls.targetInput.value.length>0)e=this.ctrls.targetInput.value;this.setValue(e)},getRouteToNode:function(e,t){var n=this.vars,s=this;if(typeof e!="undefined"&&e!==false&&e.toString().length>0){var i=this.getRouteToNodeFromCache(e);if(i.length==0){s.downloadBundle({request:{VALUE:e},callbacks:{onLoad:function(i){for(var o in i){if(i.hasOwnProperty(o))if(typeof n.cache.links[o]=="undefined")n.cache.incomplete[o]=true}s.fillCache(i,true);var r=s.getRouteToNodeFromCache(e);if(r.length==0)t.reject("notfound");else t.resolve(r)},onError:function(){t.reject("internal")}},options:{}})}else t.resolve(i)}else t.resolve([])},getBundleForNode:function(e,t){var n=this.vars,s=this;if(typeof e!="undefined"&&e!==false&&e.toString().length>0){if(typeof this.vars.cache.links[e]=="undefined"||this.vars.cache.incomplete[e]===true){s.downloadBundle({request:{PARENT_VALUE:e},callbacks:{onLoad:function(i){s.fillCache(i);if(typeof this.vars.cache.links[e]=="undefined"){t.reject()}else{delete n.cache.incomplete[e];t.resolve(this.vars.cache.links[e])}},onError:function(){t.reject()}},options:{}})}else t.resolve(this.vars.cache.links[e])}else t.resolve([])},displayRoute:function(e){var t=this.vars;this.truncateStack(-1);if(e.length==0)this.appendControl(this.opts.rootNodeValue);else{e=BX.clone(e);for(var n=0;n<e.length;n++){var s=e[n];if(typeof t.cache.links[s]!="undefined"||t.cache.nodes[s].IS_PARENT){this.appendControl(s,e[n+1])}}}},appendControl:function(e,t){var n={parent:this,messages:this.opts.messages};if(typeof t!="undefined")n.selectedItem=t;n.parentNode=e;if(typeof this.vars.cache.links[e]!="undefined"){n.knownItems=[];for(var s in this.vars.cache.links[e])if(this.vars.cache.links[e].hasOwnProperty(s))n.knownItems.push(this.vars.cache.nodes[this.vars.cache.links[e][s]])}var i=new BX.ui.chainedSelectors.adapters[this.opts.adapterName](n);i.setIndex(this.vars.stack.length);this.vars.stack.push({control:i})},setNextValidValue:function(e,t){var n=this.vars,s=this.opts,i=this.ctrls;var o=typeof n.cache.links[t]!="undefined";var r=n.cache.links[t].length;if(s.autoSelectWhenSingle&&e.IS_PARENT&&o&&r==1){var a=this.getLastControl().control;a.value=n.cache.links[t][0];BX.fireEvent(a,"change")}else{this.setTargetValue(e.IS_UNCHOOSABLE?this.getLastValidValue():t)}},getLastValidValue:function(){var e=undefined,t=this.ctrls,n=this.vars;for(var s=n.stack.length-1;s>=0;s--){e=n.stack[s].control.getValue();if(typeof e!="undefined"&&typeof n.cache.nodes[e]!="undefined"&&typeof n.cache.nodes[e].IS_UNCHOOSABLE=="undefined")return e}return""},getLastControl:function(){return this.vars.stack[this.vars.stack.length-1]},truncateStack:function(e){if(e<-1)return;var t=this.vars.stack.length;for(var n=e+1;n<t;n++){this.vars.stack[n].control.remove()}this.vars.stack.splice(e+1,t-(e+1))},getSelectorValue:function(e){return e},fillCache:function(e,t){var n=this.vars,s=this.opts;for(var i in e){if(!e.hasOwnProperty(i))continue;if(typeof n.cache.links[i]=="undefined"||n.cache.incomplete[i]===true){if(typeof n.cache.links[i]=="undefined"||!t)n.cache.links[i]=[];for(var o in e[i]){if(!e[i].hasOwnProperty(o))continue;n.cache.links[i].push(e[i][o].VALUE);e[i][o].PARENT_VALUE=i;this.addItem2Cache(e[i][o])}}}},addItem2Cache:function(e){this.vars.cache.nodes[e.VALUE]=e},getCurrentItem:function(){return this.vars.cache.nodes[this.vars.value]},setTargetInputName:function(e){this.ctrls.targetInput.setAttribute("name",e)},showError:function(e){this.setCSSState("error",this.ctrls.scope);if(BX.type.isElementNode(this.ctrls.errorMessage)){this.ctrls.errorMessage.innerHTML=BX.util.htmlspecialchars(e.errors.join(", "));BX.show(this.ctrls.errorMessage)}BX.debug(e)},hideError:function(){if(this.vars.allowHideErrors){this.dropCSSState("error",this.ctrls.scope);if(BX.type.isElementNode(this.ctrls.errorMessage))BX.hide(this.ctrls.errorMessage)}}});BX.ui.chainedSelectors.adapters={};BX.ui.chainedSelectors.adapters.combobox=function(e){this.opts=e;this.control=null;this.scope=null;this.index=null;this.place=function(){var t=this;var n=this.opts.parent.createNodesByTemplate("selector-scope",{},true);if(n==null)return;this.scope=n[0];BX.append(this.scope,this.opts.parent.ctrls.pool);e.scope=this.scope;e.arrowScrollAdditional=5;e.focusOnMouseSelect=false;this.opts.parent.fireEvent("before-control-placed",[this]);this.control=new BX.ui.combobox(e);this.control.vars.outSideClickScope=this.scope;this.control.bindEvent("item-list-discover",BX.proxy(function(e){e.stopRace();var t=new BX.deferred;t.done(BX.proxy(function(t){var n=[];for(var s in t)if(t.hasOwnProperty(s))n.push(this.opts.parent.vars.cache.nodes[t[s]]);this.opts.parent.fireEvent("before-control-item-discover-done",[n,this]);e.resolve({items:n})},this));this.opts.parent.getBundleForNode(this.opts.parentNode,t)},this));this.control.bindEvent("before-display-page",function(){t.opts.parent.fireEvent("control-before-display-page",[t])});this.control.bindEvent("after-select-item",BX.proxy(function(e){this.opts.parent.fireEvent("control-change",[this.index,e])},this));this.control.bindEvent("after-deselect-item",BX.proxy(function(){this.opts.parent.fireEvent("control-change",[this.index,""])},this));if(this.opts.parent.vars.cache.incomplete[this.opts.parentNode])this.control.clearCache();this.opts.parent.fireEvent("after-control-placed",[this])};this.remove=function(){if(this.control!=null){this.control.remove()}this.control=null;this.opts=null;BX.remove(this.scope);this.scope=null};this.setIndex=function(e){this.index=e};this.getIndex=function(){return this.index};this.getValue=function(){return this.control.getValue()};this.getParentValue=function(){return this.opts.parentNode};this.getControl=function(){return this.control};this.setValuePair=function(e,t){this.control.setTargetInputValue(e);this.control.setFakeInputValue(t);this.control.setValueVariable(e)};this.place();return this};
//# sourceMappingURL=core_ui_chainedselectors.map.js

Anon7 - 2022
AnonSec Team