403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/ui/field/link/dist/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/ui/field/link/dist/link.bundle.min.js
this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(t,e,i){"use strict";let n=t=>t,s;class a extends e.BaseField{constructor(t){super(t);BX.Landing.UI.Field.BaseField.apply(this,arguments);this.options=t.options||{};i.Dom.remove(this.input);this.onValueChangeHandler=t.onValueChange?t.onValueChange:function(){};this.content=i.Type.isPlainObject(this.content)?this.content:{};this.content=BX.Landing.Utils.clone(this.content);this.content.text=BX.Landing.Utils.trim(this.content.text);this.content.href=BX.Landing.Utils.trim(BX.Landing.Utils.escapeText(this.content.href));this.content.target=BX.Landing.Utils.trim(BX.Landing.Utils.escapeText(this.content.target));this.skipContent=t.skipContent;this.detailPageMode=t.detailPageMode===true;if(!this.containsImage()&&!this.containsHtml()){if(i.Type.isStringFilled(this.content.text)){this.content.text=this.content.text.replace(" "," ")}this.content.text=BX.Landing.Utils.escapeText(this.content.text)}this.input=new BX.Landing.UI.Field.Text({placeholder:BX.Landing.Loc.getMessage("FIELD_LINK_TEXT_LABEL"),selector:this.selector,content:i.Text.decode(this.content.text),textOnly:true,onValueChange:function(){this.onValueChangeHandler(this);if(this.hrefInput.getValue()===this.hrefInput.typeHrefs.page+"#landing0"){const t=this.input.getValue();const e=this.hrefInput.input.firstElementChild;if(e){const n=e.querySelector(".landing-ui-field-url-placeholder-text");n.innerText=i.Text.decode(t.replace(/ /g," "))}}const t=new i.Event.BaseEvent({data:{value:this.getValue()},compatData:[this.getValue()]});this.emit("change",t)}.bind(this)});if(this.skipContent){this.input.layout.hidden=true;this.header.hidden=true}this.hrefInput=new BX.Landing.UI.Field.LinkUrl({title:BX.Landing.Loc.getMessage("FIELD_LINK_HREF_LABEL_2"),placeholder:"",selector:this.selector,content:this.content.href,contentRoot:this.contentRoot,onInput:this.onHrefInput.bind(this),textOnly:true,options:this.options,disallowType:t.disallowType,disableBlocks:t.disableBlocks,allowedTypes:t.allowedTypes,detailPageMode:t.detailPageMode===true,sourceField:t.sourceField,onValueChange:function(){this.onValueChangeHandler(this);const t=new BX.Event.BaseEvent({data:{value:this.getValue()},compatData:[this.getValue()]});this.emit("change",t)}.bind(this),onNewPage:function(){const t=this.input.getValue();const e=this.hrefInput.input.firstElementChild;if(e){const i=e.querySelector(".landing-ui-field-url-placeholder-text");i.innerHTML=t.replace(/ /g," ")}}.bind(this)});this.targetInput=new BX.Landing.UI.Field.DropdownInline({title:BX.Landing.Loc.getMessage("FIELD_LINK_TARGET_LABEL"),selector:this.selector,className:"landing-ui-field-dropdown-inline",content:this.content.target,contentRoot:this.contentRoot,items:{_self:BX.Landing.Loc.getMessage("FIELD_LINK_TARGET_SELF"),_blank:BX.Landing.Loc.getMessage("FIELD_LINK_TARGET_BLANK"),_popup:BX.Landing.Loc.getMessage("FIELD_LINK_TARGET_POPUP")},onValueChange:function(){this.onValueChangeHandler(this);const t=new BX.Event.BaseEvent({data:{value:this.getValue()},compatData:[this.getValue()]});this.emit("change",t)}.bind(this)});this.stateNode=i.Tag.render(s||(s=n`
			<div class="landing-ui-field-url-state-box"></div>
		`));this.mediaLayout=i.Dom.create("div",{props:{className:"landing-ui-field-link-media-layout"}});if(this.containsImage()||this.containsHtml()){this.input.layout.hidden=true;this.header.hidden=true;this.hrefInput.header.innerHTML=this.header.innerHTML}this.wrapper=BX.Landing.UI.Field.Link.createWrapper();this.left=BX.Landing.UI.Field.Link.createLeft();this.center=BX.Landing.UI.Field.Link.createCenter();this.right=BX.Landing.UI.Field.Link.createRight();i.Dom.append(this.input.layout,this.left);i.Dom.append(this.hrefInput.layout,this.center);this.targetInput=this.createTargetInput(this.hrefInput.getRightData());this.right.innerHTML="";if(this.targetInput.hasOwnProperty("layout")){i.Dom.append(this.targetInput.layout,this.right)}else{i.Dom.append(this.targetInput,this.right)}this.showElement(this.right);const e=this.hrefInput.getSelectedHrefType();if(e===this.hrefInput.typeHrefs.start){this.hideElement(this.right)}const a=this.hrefInput.getTypeData(e);this.checkVisibleMediaPanel(e,this.targetInput.getValue());this.targetInput.subscribe("onChange",(()=>{this.checkVisibleMediaPanel(e,this.targetInput.getValue())}));if(a.hasOwnProperty("hideInput")){const t=this.hrefInput.gridCenterCell.querySelector(".landing-ui-field-input");t.hidden=!!a.hideInput}const r=this.center.querySelector(".landing-ui-field-link-url-grid-center");i.Dom.append(this.stateNode,r);i.Dom.addClass(r,"--only-manual-entry");if(a.hasOwnProperty("button")){if(!r.querySelector(".landing-ui-button-grid-center-cell")){const t=this.hrefInput.createCenterCellButton(a.button);i.Dom.append(t.layout,r);i.Dom.removeClass(r,"--only-manual-entry")}}this.hrefInput.subscribe("deleteAction",(()=>{if(this.hrefInput.getSelectedHrefType()===this.hrefInput.typeHrefs.start){this.hideElement(this.right)}}));this.hrefInput.subscribe("selectAction",(t=>{const e=this.hrefInput.getSelectedHrefType();const n=this.hrefInput.getTypeData(e);this.prepareGridCenter(e);const s=this.hrefInput.gridCenterCell.querySelector(".landing-ui-field-input");s.hidden=!!n.hideInput;this.targetInput=this.createTargetInput(t.data.right);if(!i.Type.isUndefined(this.selectedTargetValueByUser)){this.targetInput.setValue(this.selectedTargetValueByUser)}this.targetInput.subscribe("onItemClick",(()=>{this.selectedTargetValueByUser=this.targetInput.getValue()}));this.right.innerHTML="";if(this.targetInput.hasOwnProperty("layout")){i.Dom.append(this.targetInput.layout,this.right)}else{i.Dom.append(this.targetInput,this.right)}this.showElement(this.right);this.checkVisibleMediaPanel(e,this.targetInput.getValue());this.targetInput.subscribe("onChange",(()=>{this.checkVisibleMediaPanel(e,this.targetInput.getValue())}));this.disableMedia();this.adjustTarget()}));this.hrefInput.subscribe("buildCenter",(t=>{const e=this.hrefInput.gridCenterCell.querySelector(".landing-ui-button-grid-center-cell");const n=this.center.querySelector(".landing-ui-field-link-url-grid-center");if(e){e.remove()}i.Dom.append(this.stateNode,n);if(t.data.button){i.Dom.append(t.data.button.layout,n);i.Dom.removeClass(n,"--only-manual-entry")}else{i.Dom.addClass(n,"--only-manual-entry")}}));i.Dom.append(this.left,this.wrapper);i.Dom.append(this.center,this.wrapper);i.Dom.append(this.right,this.wrapper);i.Dom.append(this.wrapper,this.layout);i.Dom.append(this.mediaLayout,this.layout);i.Dom.addClass(this.layout,"landing-ui-field-link");if(this.hrefInput.getSelectedHrefType()===""){if(this.content.target==="_popup"){this.adjustVideo()}}this.adjustEditLink();this.adjustTarget();this.targetInput.subscribe("onItemClick",(()=>{this.selectedTargetValueByUser=this.targetInput.getValue()}));this.hrefInput.subscribe("readyToSave",(t=>{if(t.data.readyToSave){this.readyToSave=true;this.emit("onChangeReadyToSave")}else{this.readyToSave=false;this.emit("onChangeReadyToSave")}}))}static createWrapper(){return i.Dom.create("div",{props:{className:"landing-ui-field-link-wrapper"}})}static createCenter(){return i.Dom.create("div",{props:{className:"landing-ui-field-link-center"}})}static createLeft(){return i.Dom.create("div",{props:{className:"landing-ui-field-link-left"}})}static createRight(){return i.Dom.create("div",{props:{className:"landing-ui-field-link-right"}})}hideElement(t){t.hidden=true}showElement(t){t.hidden=false}createTargetInput(t){const e=t.title||"";const i=t.items||{};return new BX.Landing.UI.Field.DropdownInline({title:e,selector:this.selector,className:"landing-ui-field-dropdown-inline",content:this.content.target,contentRoot:this.contentRoot,items:i,onValueChange:function(){this.onValueChangeHandler(this);const t=new BX.Event.BaseEvent({data:{value:this.getValue()},compatData:[this.getValue()]});this.emit("change",t)}.bind(this)})}adjustEditLink(){const t=this.hrefInput.getPlaceholderType();const e=BX.Landing.Env.getInstance().getType();if(t==="PAGE"&&e!=="KNOWLEDGE"&&e!=="GROUP"){const t=this.hrefInput.getValue();if(i.Type.isString(t)&&t.length>0){this.hrefInput.getPageData(t).then(function(t){const e=BX.Landing.Main.getInstance().options.params.sef_url.landing_view;const n=e.replace("#site_show#",t.siteId).replace("#landing_edit#",t.id);[].slice.call(this.layout.querySelectorAll(".landing-ui-field-edit-link")).forEach(BX.remove);this.editLink=this.createEditLink(BX.Landing.Loc.getMessage("LANDING_LINK_FILED__EDIT_PAGE_LINK_LABEL"),n);i.Dom.append(this.editLink,this.layout)}.bind(this))}}}createEditLink(t,e){return i.Dom.create("div",{props:{className:"landing-ui-field-edit-link"},children:[i.Dom.create("a",{attrs:{href:e,target:a.TARGET_BLANK,title:BX.Landing.Loc.getMessage("LANDING_LINK_FILED__EDIT_LINK_TITLE")},text:t})]})}isChanged(){const t=JSON.stringify(this.content)!==JSON.stringify(this.getValue());if(t){this.prepareHrefInput();this.prepareTargetInput()}return t}containsImage(){return!!i.Dom.create("div",{html:this.content.text}).querySelector("img")}containsHtml(){const t=BX.Landing.Utils.htmlToElement(this.content.text);return!!t&&!t.matches("br")}getValue(){const t={text:BX.Landing.Utils.decodeDataValue(BX.Landing.Utils.trim(this.input.getValue().replace(/&nbsp;/g," "))),href:BX.Landing.Utils.trim(this.hrefInput.getValue()),target:this.prepareTarget(BX.Landing.Utils.trim(this.targetInput.getValue()))};if(this.isAvailableMedia()&&this.mediaService){t.attrs={"data-url":BX.Landing.Utils.trim(this.mediaService.getEmbedURL())}}if(this.hrefInput.getDynamic()){if(!i.Type.isPlainObject(t.attrs)){t.attrs={}}if(this.hrefInput.input.firstElementChild){t.attrs["data-url"]=this.hrefInput.input.firstElementChild.getAttribute("data-url")}t.attrs["data-dynamic"]=this.hrefInput.getDynamic()}if(this.skipContent){delete t["text"]}if(t.href.startsWith("selectActions:")){t.href="#"}return t}setValue(t){if(i.Type.isPlainObject(t)){this.input.setValue(BX.Landing.Utils.escapeText(t.text));this.hrefInput.setValue(t.href);this.targetInput.setValue(BX.Landing.Utils.escapeText(t.target))}this.adjustEditLink();this.adjustTarget()}adjustTarget(){if(!this.isAvailableMedia()){const t=BX.Landing.Env.getInstance().getType();const e=this.getValue();this.targetInput.enable();if(t==="KNOWLEDGE"||t==="GROUP"){this.targetInput.disable();const t=this.hrefInput.getSelectedHrefType();if(t==="page:"||t==="block:"||t==="form:"||t==="user:"||/^#(\w+)([0-9])$/.test(e.href)){this.targetInput.setValue(a.TARGET_SELF)}else{this.targetInput.setValue(a.TARGET_BLANK)}}else if(t==="MAINPAGE"){this.targetInput.disable();this.targetInput.setValue(a.TARGET_BLANK)}else{if(e.href.startsWith("#crmFormPopup")){this.targetInput.disable()}if(e.href.startsWith("#crmPhone")){this.targetInput.disable()}}}}enableMedia(){this.readyToSave=true;if(!this.mediaService.isDataLoaded){this.readyToSave=false;BX.addCustomEvent(this.mediaService,"onDataLoaded",(()=>{this.readyToSave=true;this.emit("onChangeReadyToSave")}))}this.emit("onChangeReadyToSave");this.showMediaPreview()}disableMedia(){if(!this.readyToSave){this.readyToSave=true;this.emit("onChangeReadyToSave")}this.hideMediaPreview();this.hideMediaSettings()}showMediaSettings(){if(this.isAvailableMedia()){this.hideMediaSettings();this.mediaSettings=this.mediaService.getSettingsForm();if(this.mediaSettings){i.Dom.append(this.mediaSettings.layout,this.mediaLayout)}}}hideMediaSettings(){if(this.mediaSettings){i.Dom.remove(this.mediaSettings.layout)}}isAvailableMedia(){const t=new BX.Landing.MediaService.Factory;return!!t.getRelevantClass(this.hrefInput.getValue())}showMediaPreview(){const t=new BX.Loader({target:this.mediaLayout,mode:"inline",offset:{top:"calc(50% - 55px)",left:"calc(50% - 55px)"}});this.video=t.layout;t.show();return this.mediaService.getURLPreviewElement().then(function(e){i.Dom.remove(this.video);t.hide();this.video=e;i.Dom.append(this.video,this.mediaLayout);this.targetValueBeforeAutochange=this.targetInput.getValue();if(i.Type.isUndefined(this.selectedTargetValueByUser)){this.targetInput.setValue("_popup")}this.showMediaSettings()}.bind(this),function(){this.hideMediaSettings();i.Dom.remove(this.video)}.bind(this))}hideMediaPreview(){if(i.Type.isUndefined(this.selectedTargetValueByUser)){this.targetInput.setValue(this.targetValueBeforeAutochange)}if(this.video){i.Dom.remove(this.video)}}adjustVideo(){const t=BX.Landing.Env.getInstance().getType();if(t!=="KNOWLEDGE"&&t!=="GROUP"){const t="attrs"in this.content&&"data-url"in this.content.attrs?this.content.attrs["data-url"]:"";const e=new BX.Landing.MediaService.Factory;this.mediaService=e.create(this.hrefInput.getValue(),BX.Landing.Utils.getQueryParams(t));if(this.mediaService){this.disableMedia();if(this.isAvailableMedia()){this.enableMedia()}}else{this.disableMedia()}}}onHrefInput(){const t=this.hrefInput.getSelectedHrefType();const e=this.hrefInput.getTypeData(t);if(e.hasOwnProperty("validate"));if(t===""){this.adjustVideo()}this.adjustEditLink();this.adjustTarget()}checkVisibleMediaPanel(t,e){if(t===""&&e==="_popup"){this.showMediaPanel()}else{this.hideMediaPanel()}}showMediaPanel(){this.mediaLayout.hidden=false}hideMediaPanel(){this.mediaLayout.hidden=true}prepareHrefInput(){if(this.hrefInput.getValue()===""||this.hrefInput.getValue()==="#"){this.hrefInput.setHrefTypeSwitcherValue(this.hrefInput.typeHrefs.start)}}prepareTargetInput(){if(this.hrefInput.getSelectedHrefType()===this.hrefInput.typeHrefs.user){this.targetInput.setValue(a.TARGET_BLANK)}if(this.hrefInput.getSelectedHrefType()===this.hrefInput.typeHrefs.start){this.targetInput.setValue(a.TARGET_SELF)}}prepareGridCenter(t){const e=[this.hrefInput.typeHrefs.block,this.hrefInput.typeHrefs.page,this.hrefInput.typeHrefs.form,this.hrefInput.typeHrefs.product,this.hrefInput.typeHrefs.file,this.hrefInput.typeHrefs.user];i.Dom.removeClass(this.hrefInput.gridCenterCell,"--not-empty");if(e.includes(t)){i.Dom.addClass(this.hrefInput.gridCenterCell,"--not-manual-input")}else{i.Dom.removeClass(this.hrefInput.gridCenterCell,"--not-manual-input")}}prepareTarget(t){if(this.hrefInput.getSelectedHrefType()===this.hrefInput.typeHrefs.user){t=a.TARGET_BLANK}return t}}a.TARGET_SELF="_self";a.TARGET_BLANK="_blank";t.Link=a})(this.BX.Landing.UI.Field=this.BX.Landing.UI.Field||{},BX.Landing.UI.Field,BX);
//# sourceMappingURL=link.bundle.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit