uawdijnntqw1x1x1
IP : 18.222.188.218
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
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,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
axolotl.ru
/
www
/
bitrix
/
js
/
bizproc
/
bp_selector.min.js
/
/
(function(){var e=window.BX;e.namespace("BX.Bizproc");if(e.Bizproc.Selector)return;e.Bizproc.Selector={delimiter:"=",listenKeyCode:187,listenKey:"=",currentData:{},inputElement:null,popup:null,selectedTab:null,activitiesItemsCache:null};e.Bizproc.Selector.initSelectors=function(t){if(!t)t=document;var s,i,a,r=t.querySelectorAll('[data-role="bp-selector-button"]');if(r){for(a=0;a<r.length;++a){i=JSON.parse(r[a].getAttribute("data-bp-selector-props"));if(typeof i!=="object")continue;s=document.getElementById(i.controlId);if(!s)continue;e.bind(s,"keydown",(function(t){e.Bizproc.Selector.onSearch(this,t)}));s.setAttribute("autocomplete","off")}}};e.Bizproc.Selector.getTabItems=function(e){var t;for(t=0;t<this.currentData.length;++t){if(this.currentData[t]["tabId"]===e)return this.currentData[t]["items"]}return[]};e.Bizproc.Selector.getActivitiesItems=function(e){if(this.activitiesItemsCache===null||e){this.activitiesItemsCache=this.getTemplateActivitiesItems([rootActivity.Serialize()],arAllActivities)}return this.activitiesItemsCache};e.Bizproc.Selector.getTemplateActivitiesItems=function(t,s){var i=[],a,r,o,l,n;for(a=0,r=t.length;a<r;++a){o=t[a].Type.toLowerCase();if(s[o])l=s[o];if(l&&l["RETURN"]){for(n in l["RETURN"]){if(!l["RETURN"].hasOwnProperty(n))continue;i.push({text:l["RETURN"][n].NAME,description:t[a].Properties.Title||l.NAME,value:"{="+t[a].Name+":"+n+"}",propertyObject:t[a].Name,propertyField:n,property:{Name:l["RETURN"][n].NAME,Type:l["RETURN"][n].TYPE}})}}else if(l&&e.type.isArray(l["ADDITIONAL_RESULT"])){var u=t[a]["Properties"];l["ADDITIONAL_RESULT"].forEach((function(e){if(u[e]){for(var s in u[e]){if(u[e].hasOwnProperty(s)){var r=u[e][s];i.push({text:r["Name"],description:t[a].Properties.Title||l.NAME,value:"{="+t[a].Name+":"+s+"}",propertyObject:t[a].Name,propertyField:s,property:r})}}}}),this)}if(t[a].Children&&t[a].Children.length>0){var c=this.getTemplateActivitiesItems(t[a].Children,s);for(var _=0;_<c.length;++_){i.push(c[_])}}}return i};e.Bizproc.Selector.getTabsCounters=function(){var e,t={};for(e=0;e<this.currentData.length;++e){t[this.currentData[e]["tabId"]]=this.currentData[e]["items"].length}return t};e.Bizproc.Selector.getListElement=function(){return e.findChild(this.popup.contentContainer,{className:"bp-selector-list"},true)};e.Bizproc.Selector.getSelectedItem=function(){return e.findChild(this.popup.contentContainer,{className:"bp-selector-item-selected"},true)};e.Bizproc.Selector.getTabsElements=function(){return e.findChildren(this.popup.contentContainer,{className:"bp-selector-tab"},true)};e.Bizproc.Selector.closePopup=function(){if(this.popup)this.popup.close()};e.Bizproc.Selector.insertItemValue=function(e,t){var s=this.inputElement.value.substr(0,this.inputElement.selectionEnd),i=this.inputElement.value.substr(0,s.lastIndexOf(this.delimiter)),a=e.getAttribute("data-value")+(t?this.delimiter:""),r=this.inputElement.value.substr(this.inputElement.selectionEnd),o=parseInt(e.getAttribute("data-cursor-position"));if(isNaN(o))o=a.length;if(i.substr(-1)==="{")i=i.substr(0,i.length-1);this.inputElement.value=i+a+r;this.inputElement.selectionEnd=i.length+Math.max(0,o)+1};e.Bizproc.Selector.onSearch=function(t,s){var i=this,a=true;if(t.mentionListen){if(s.keyCode==27){t.mentionListen=false;this.closePopup();return e.PreventDefault(s)}else if(s.keyCode==13&&this.popup){var r=this.getSelectedItem();if(r){this.insertItemValue(r,s.shiftKey===true);if(s.shiftKey!==true)this.closePopup()}return e.PreventDefault(s)}else if((s.keyCode==37||s.keyCode==39||s.keyCode==9)&&this.popup){this.SelectNextTab(s.keyCode==37?-1:1);return e.PreventDefault(s)}else if((s.keyCode==38||s.keyCode==40)&&this.popup){this.SelectNextItem(s.keyCode==38?-1:1);return e.PreventDefault(s)}else if(s.altKey===true||s.ctrlKey===true||s.shiftKey===true&&s.keyCode==16){}else{setTimeout(e.delegate((function(){var e=this.value.substr(0,this.selectionEnd);if(e.lastIndexOf(i.delimiter)<0){i.closePopup();return false}e=e.substr(e.lastIndexOf(i.delimiter),this.selectionEnd-e.lastIndexOf(i.delimiter));if(e.length<=0){i.closePopup();return false}e=e.substr(1);if(e.substr(0,1)==" "){i.closePopup();return false}if(i.popup)i.updatePopupContent(e)}),t),10)}}else if(s.shiftKey===false&&(s.keyCode==i.listenKeyCode||s.key===i.listenKey)){if(!t.mentionListen){setTimeout(e.delegate((function(){var t=this.value.substr(this.selectionEnd-1,1);if(t!=i.delimiter)return false;this.mentionListen=true;i.closePopup();i.popup=new e.PopupWindow("bx-bizproc-selector",this,{lightShadow:true,offsetTop:0,closeIcon:true,offsetLeft:0,autoHide:true,bindOptions:{position:"bottom"},closeByEsc:true,zIndex:200,events:{onPopupShow:function(){e.WindowManager.currently_loaded=this;this.CloseDialog=this.Close=function(){e.WindowManager.currently_loaded=null;if(i.popup!==null){var t=e.WindowManager.Get();if(t&&!t.unclosable)t.Close()}}},onPopupClose:function(){this.destroy();setTimeout((function(){e.WindowManager.currently_loaded=null}),50)},onPopupDestroy:e.delegate((function(){i.popup=null;i.activitiesItemsCache=null;this.mentionListen=false}),this)},content:e.create("DIV",{children:[i.generatePopupContent()]})});i.popup.show();i.inputElement=this}),t),100)}}if(!a)return e.PreventDefault(s)};e.Bizproc.Selector.extractMenuItem=function(t,s,i){var a=[];var r,o,l;for(r in s){if(!s.hasOwnProperty(r))continue;o="{="+i+":"+r+"}";if(i==="Document"){o="{{"+s[r].Name+"}}"}else if(i==="GlobalVar"&&window.wfGVarVisibilityNames&&e.util.object_keys(window.wfGVarVisibilityNames).length>0){l=s[r].Visibility;o="{{"+window.wfGVarVisibilityNames[l]+": "+s[r].Name+"}}"}else if(i==="GlobalConst"&&window.wfGConstVisibilityNames&&e.util.object_keys(window.wfGConstVisibilityNames).length>0){l=s[r].Visibility;o="{{"+window.wfGConstVisibilityNames[l]+": "+s[r].Name+"}}"}a.push({text:s[r].Name,value:o})}return this.filterItems(a,t)};e.Bizproc.Selector.filterItems=function(t,s){var i=[],a;s=s?s.toLowerCase():"";var r=s&&e.correctText?e.correctText(s,{replace_way:"AUTO",mixed:true}).toLowerCase():"";for(a=0;a<t.length;++a){if(!s||t[a].text.toLowerCase().indexOf(s)>=0||t[a].value.toLowerCase().indexOf(s)>=0||t[a].text.toLowerCase().indexOf(r)>=0||t[a].value.toLowerCase().indexOf(r)>=0){i.push(t[a])}}return i};e.Bizproc.Selector.updateCurrentData=function(t){var s=[];if(e.util.object_keys(arWorkflowParameters).length>0)s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_PARAMETERS"),tabId:"parameters",items:this.extractMenuItem(t,arWorkflowParameters,"Template")});if(e.util.object_keys(arWorkflowVariables).length>0)s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_VARIABLES"),tabId:"variables",items:this.extractMenuItem(t,arWorkflowVariables,"Variable")});if(e.util.object_keys(arWorkflowConstants).length>0)s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_CONSTANTS"),tabId:"constants",items:this.extractMenuItem(t,arWorkflowConstants,"Constant")});if(typeof arDocumentFields!=="undefined"){s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_DOCUMENT"),tabId:"document",items:this.extractMenuItem(t,arDocumentFields,"Document")})}var i=this.getActivitiesItems();if(i.length>0)s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_ACTIVITIES"),tabId:"activities",items:this.filterItems(i,t)});if(window.arWorkflowGlobalConstants&&e.util.object_keys(window.arWorkflowGlobalConstants).length>0){s.push({tabName:"@"+e.message("BIZPROC_JS_BP_SELECTOR_CONSTANTS"),tabId:"gconstants",items:this.extractMenuItem(t,window.arWorkflowGlobalConstants,"GlobalConst")})}if(window.arWorkflowGlobalVariables&&e.util.object_keys(window.arWorkflowGlobalVariables).length>0){s.push({tabName:"@"+e.message("BIZPROC_JS_BP_SELECTOR_VARIABLES"),tabId:"gvariables",items:this.extractMenuItem(t,window.arWorkflowGlobalVariables,"GlobalVar")})}s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_SYSTEM"),tabId:"system",items:this.filterItems([{text:e.message("BIZPROC_JS_BP_SELECTOR_WORKFLOW_ID"),value:"{=Workflow:ID}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_TARGET_USER"),value:"{=Template:TargetUser}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_USER_ID"),value:"{=User:ID}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_NOW"),value:"{=System:Now}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_NOW_LOCAL"),value:"{=System:NowLocal}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_DATE"),value:"{=System:Date}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_EOL"),value:"{=System:Eol}"},{text:e.message("BIZPROC_JS_BP_SELECTOR_HOST_URL"),value:"{=System:HostUrl}"}],t)});s.push({tabName:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTIONS"),tabId:"functions",items:this.filterItems([{text:"abs",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_ABS_DESCRIPTION"),value:"{{=abs()}}"},{text:"dateadd",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_DATEADD_DESCRIPTION"),value:"{{=dateadd(,)}}"},{text:"datediff",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_DATEDIFF_DESCRIPTION"),value:"{{=datediff(,,)}}"},{text:"date",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_DATE_DESCRIPTION"),value:"{{=date(,)}}"},{text:"workdateadd",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_WORKDATEADD_DESCRIPTION"),value:"{{=workdateadd(,)}}"},{text:"addworkdays",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_ADDWORKDAYS_DESCRIPTION"),value:"{{=addworkdays(,)}}"},{text:"isworkday",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_ISWORKDAY_DESCRIPTION"),value:"{{=isworkday()}}"},{text:"isworktime",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_ISWORKTIME_DESCRIPTION"),value:"{{=isworktime()}}"},{text:"touserdate",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_TOUSERDATE_DESCRIPTION"),value:"{{=touserdate()}}"},{text:"getuserdateoffset",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_GETUSERDATEOFFSET_DESCRIPTION"),value:"{{=getuserdateoffset()}}"},{text:"if",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_IF_DESCRIPTION"),value:"{{=if(,,)}}"},{text:"intval",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_INTVAL_DESCRIPTION"),value:"{{=intval()}}"},{text:"floatval",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_FLOATVAL_DESCRIPTION"),value:"{{=floatval()}}"},{text:"numberformat",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_NUMBER_FORMAT_DESCRIPTION"),value:"{{=numberformat(,)}}"},{text:"min",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_MIN_DESCRIPTION"),value:"{{=min(,)}}"},{text:"max",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_MAX_DESCRIPTION"),value:"{{=max(,)}}"},{text:"rand",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_RAND_DESCRIPTION"),value:"{{=rand(0,)}}"},{text:"round",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_ROUND_DESCRIPTION"),value:"{{=round(,)}}"},{text:"ceil",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_CEIL_DESCRIPTION"),value:"{{=ceil()}}"},{text:"floor",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_FLOOR_DESCRIPTION"),value:"{{=floor()}}"},{text:"substr",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_SUBSTR_DESCRIPTION"),value:"{{=substr(,,)}}"},{text:"strpos",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_STRPOS_DESCRIPTION"),value:"{{=strpos(,)}}"},{text:"strlen",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_STRLEN_DESCRIPTION"),value:"{{=strlen()}}"},{text:"implode",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_IMPLODE_DESCRIPTION"),value:"{{=implode(,)}}"},{text:"explode",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_EXPLODE_DESCRIPTION"),value:"{{=explode(,)}}"},{text:"randstring",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_RANDSTRING_DESCRIPTION"),value:"{{=randstring(10)}}"},{text:"merge",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_MERGE_DESCRIPTION"),value:"{{=merge(,)}}"},{text:"urlencode",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_URLENCODE_DESCRIPTION"),value:"{{=urlencode()}}"},{text:"strtolower",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_STRTOLOWER_DESCRIPTION"),value:"{{=strtolower()}}"},{text:"strtoupper",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_STRTOUPPER_DESCRIPTION"),value:"{{=strtoupper()}}"},{text:"ucwords",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_UCWORDS_DESCRIPTION"),value:"{{=ucwords()}}"},{text:"ucfirst",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_UCFIRST_DESCRIPTION"),value:"{{=ucfirst()}}"},{text:"strtotime",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_STRTOTIME_DESCRIPTION"),value:"{{=strtotime()}}"},{text:"locdate",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_LOCDATE_DESCRIPTION"),value:"{{=locdate(,)}}"},{text:"shuffle",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_SHUFFLE_DESCRIPTION"),value:"{{=shuffle()}}"},{text:"firstvalue",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_FIRSTVALUE_DESCRIPTION"),value:"{{=firstvalue()}}"},{text:"swirl",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_SWIRL_DESCRIPTION"),value:"{{=swirl()}}"},{text:"getdocumenturl",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_GETDOCUMENTURL_DESCRIPTION"),value:"{{=getdocumenturl()}}"},{text:"trim",description:e.message("BIZPROC_JS_BP_SELECTOR_FUNCTION_TRIM_DESCRIPTION"),value:"{{=trim()}}"}],t)});this.currentData=s;return s};e.Bizproc.Selector.generatePopupContent=function(t){var s=e.create("DIV",{attrs:{className:"bp-selector-popup"}});var i=e.create("UL",{attrs:{className:"bp-selector-tabs"}});var a=e.create("UL",{attrs:{className:"bp-selector-list"}});s.appendChild(i);s.appendChild(a);var r=this.updateCurrentData(t);var o,l,n=this;for(o=0;o<r.length;++o){l=e.create("LI",{attrs:{className:"bp-selector-tab"},html:r[o].tabName+' (<span class="counter-value">'+r[o].items.length+"</span>)"});l.setAttribute("data-tab-id",r[o].tabId);l.setAttribute("hidefocus","true");if(!this.selectedTab&&o===0||this.selectedTab==r[o].tabId){e.addClass(l,"selected");this.updateList(a,r[o].items)}e.bind(l,"click",(function(t){n.selectTab(this);e.focus(n.inputElement);return e.PreventDefault(t)}));i.appendChild(l)}return s};e.Bizproc.Selector.updatePopupContent=function(t){var s=this.getListElement();var i,a,r,o=this.updateCurrentData(t);var l=this.getTabsCounters();var n=this.getTabsElements();for(i=0;i<n.length;++i){a=n[i].getAttribute("data-tab-id");r=e.findChild(n[i],{className:"counter-value"});r.innerHTML=l[a]||0;if(e.hasClass(n[i],"selected")){this.updateList(s,this.getTabItems(a))}}};e.Bizproc.Selector.SelectNextTab=function(t){var s,i,a,r,o,l=this.getTabsElements();for(a=0,r=l.length;a<r;++a){s=e.hasClass(l[a],"selected");if(s&&t<0){o=a-1>=0?a-1:r-1;e.removeClass(l[a],"selected");e.addClass(l[o],"selected");i=l[o].getAttribute("data-tab-id");break}if(s&&t>0){o=a+1<=r-1?a+1:0;e.removeClass(l[a],"selected");e.addClass(l[o],"selected");i=l[o].getAttribute("data-tab-id");break}}var n=this.getListElement();this.updateList(n,this.getTabItems(i));this.selectedTab=i};e.Bizproc.Selector.selectTab=function(t){var s=this.getListElement();var i=this.getTabsElements();for(var a=0;a<i.length;++a){if(i[a]==t){e.addClass(t,"selected");this.updateList(s,this.getTabItems(t.getAttribute("data-tab-id")))}else{e.removeClass(i[a],"selected")}}this.selectedTab=t.getAttribute("data-tab-id")};e.Bizproc.Selector.SelectNextItem=function(t){var s=this.getListElement();var i,a,r,o=0,l=e.findChildren(s,{className:"bp-selector-item"},true);for(a=0,r=l.length;a<r;++a){i=e.hasClass(l[a],"bp-selector-item-selected");if(i&&t<0){o=a-1>=0?a-1:r-1;e.removeClass(l[a],"bp-selector-item-selected");e.addClass(l[o],"bp-selector-item-selected");break}if(i&&t>0){o=a+1<=r-1?a+1:0;e.removeClass(l[a],"bp-selector-item-selected");e.addClass(l[o],"bp-selector-item-selected");break}}this.fixListScroll(s,l[o])};e.Bizproc.Selector.updateList=function(t,s){e.cleanNode(t);var i,a,r,o=this;if(s.length===0){r=e.create("LI",{html:e.message("BIZPROC_JS_BP_SELECTOR_EMPTY_LIST")});e.addClass(r,"bp-selector-item-empty");t.appendChild(r)}for(i=0;i<s.length;++i){a=s[i];r=e.create("LI",{html:e.util.htmlspecialchars(a.text)+(a.description?'<span class="bp-selector-item-description"> '+e.util.htmlspecialchars(a.description)+"</span>":"")});r.setAttribute("data-value",a.value);r.setAttribute("data-cursor-position",a.value.indexOf("("));r.setAttribute("hidefocus","true");e.addClass(r,"bp-selector-item");if(i===0)e.addClass(r,"bp-selector-item-selected");e.bind(r,"click",(function(t){o.insertItemValue(this,t.shiftKey===true);if(t.shiftKey!==true)o.closePopup();e.focus(o.inputElement);return e.PreventDefault(t)}));t.appendChild(r)}t.scrollTop=0};e.Bizproc.Selector.fixListScroll=function(t,s){var i=e.pos(t);var a=e.pos(s);if(a.bottom>i.bottom||a.top<i.top){t.scrollTop+=a.bottom>i.bottom?a.bottom-i.bottom:a.top-i.top}}})(); //# sourceMappingURL=bp_selector.map.js
/var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/bizproc/bp_selector.min.js