test
Server : Apache System : Linux festive-vaughan.27-254-111-205.plesk.page 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 User : acaindustrial ( 10114) PHP Version : 8.2.25 Disable Function : opcache_get_status Directory : /var/www/vhosts/acaindustrial.co.th/httpdocs/wp-content/plugins/xo-liteslider/build/ |
Upload File : |
(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var l in i)e.o(i,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:i[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,i=window.wp.i18n,l=window.wp.element,r=window.wp.blockEditor,s=window.wp.components,n=window.wp.apiFetch;var o=e.n(n);const a=window.wp.url,d=window.wp.data,c=(0,l.createElement)(s.SVG,{viewBox:"0 0 52 30"},(0,l.createElement)(s.Path,{d:"m 46.992829,2.7202846 v 2.3804293 h 2.640173 V 24.898508 h -2.640173 v 2.380434 H 52 V 2.7202846 Z"}),(0,l.createElement)(s.Path,{d:"m 352.03751,462.06516 c 41.09671,0 82.19342,0 123.29013,0 0,32.85821 0,65.71643 0,98.57464 -41.09671,0 -82.19342,0 -123.29013,0 0,-32.85821 0,-65.71643 0,-98.57464 z"}),(0,l.createElement)(s.Path,{d:"M 7.8786587,-9.3254442e-8 C 7.8786587,9.9999999 7.8786587,20 7.8786587,30 20.085694,30 32.29273,30 44.499766,30 c 0,-10 0,-20.0000001 0,-30.000000093254442 -12.207036,0 -24.414072,0 -36.6211073,0 z M 10.626155,2.7630876 c 10.375372,0 20.750743,0 31.126115,0 0,8.1579424 0,16.3158854 0,24.4738274 -10.375372,0 -20.750743,0 -31.126115,0 0,-8.157942 0,-16.315885 0,-24.4738274 z"}),(0,l.createElement)(s.Path,{d:"M 34.357468,8.8914098 C 34.45669,11.025656 31.820941,12.524165 30.053707,11.33868 28.183986,10.323996 28.265696,7.2801821 30.187019,6.3683315 32.002044,5.334196 34.414978,6.790888 34.357468,8.8914098 Z"}),(0,l.createElement)(s.Path,{d:"m 20.126544,9.26688 c -0.845534,0.011837 -1.691069,0.023673 -2.536603,0.03551 -0.891894,2.085102 -2.231527,3.973057 -4.13658,5.232686 -1.226101,0.387453 -0.954606,1.523375 -0.96155,2.52481 0,2.778138 0,5.556277 0,8.334416 9.131639,0 18.263278,0 27.394917,0 0,-1.141436 0,-2.28287 0,-3.424305 C 35.48349,20.760481 31.177456,19.07284 27.426133,16.413624 24.49957,14.585225 22.065666,12.121993 20.126544,9.26688 Z"}),(0,l.createElement)(s.Path,{d:"m 5.385594,2.7202846 v 2.38043 H 2.745421 V 24.898508 h 2.640173 v 2.380434 H 0.37842305 V 2.7202846 Z"}));class p extends l.Component{constructor(){super(...arguments),this.state={editing:!this.props.attributes.sliderID,preview:null},this.onSubmitSlider=this.onSubmitSlider.bind(this)}componentDidMount(){this.isStillMounted=!0,this.fetchRequest=o()({path:(0,a.addQueryArgs)(`/xo-slider/v1/preview/${this.props.attributes.sliderID}`)}).then((e=>{this.isStillMounted&&this.setState({preview:e})})).catch((()=>{this.isStillMounted&&this.setState({preview:0})}))}componentWillUnmount(){this.isStillMounted=!1}onSubmitSlider(e){e.preventDefault();const{sliderID:t}=this.props.attributes;t&&this.setState({editing:!1}),this.fetchRequest=o()({path:(0,a.addQueryArgs)(`/xo-slider/v1/preview/${t}`)}).then((e=>{this.isStillMounted&&this.setState({preview:e})})).catch((()=>{this.isStillMounted&&this.setState({preview:0})}))}render(){const{attributes:e,setAttributes:t,posts:n,className:o}=this.props,{sliderID:a}=e,{preview:d}=this.state,p=[{icon:"edit",title:(0,i.__)("Select a slider","xo-liteslider"),onClick:()=>this.setState({editing:!0})}];return Array.isArray(n)&&n.length?this.state.editing?(0,l.createElement)(s.Placeholder,{icon:c,label:(0,i.__)("Slider","xo-liteslider")},(0,l.createElement)("form",{onSubmit:this.onSubmitSlider,className:o+"__placeholder-form"},(0,l.createElement)(s.SelectControl,{value:a,options:[{label:(0,i.__)("- Select -","xo-liteslider"),value:0}].concat(n.map((e=>({label:e.title.raw,value:e.id})))),onChange:e=>t({sliderID:Number(e)}),className:o+"__select"}),(0,l.createElement)(s.Button,{type:"submit",className:o+"__button",variant:"primary"},(0,i.__)("Use Slider","xo-liteslider")))):(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.BlockControls,null,(0,l.createElement)(s.Toolbar,{controls:p})),(0,l.createElement)(s.Disabled,null,(0,l.createElement)("div",{className:o},(0,l.createElement)("div",{className:o+"__wrapper"},(0,l.createElement)("iframe",{srcDoc:d,onLoad:()=>{xoSliderIframeLoaded(this.props.clientId)}}))))):(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.Placeholder,{icon:c,label:(0,i.__)("Slider","xo-liteslider")},Array.isArray(n)?(0,i.__)("No sliders found.","xo-liteslider"):(0,l.createElement)(s.Spinner,null)))}}const u=(0,d.withSelect)(((e,t)=>{const{getEntityRecords:i}=e("core");return{posts:i("postType","xo_liteslider",{per_page:-1})}}))(p);(0,t.registerBlockType)("xo-liteslider/xo-slider",{title:(0,i.__)("XO Slider","xo-liteslider"),description:(0,i.__)("Display the slider.","xo-liteslider"),category:"widgets",icon:{foreground:"#782121",src:c},supports:{align:["wide","full"],alignWide:!0,html:!1},attributes:{sliderID:{type:"number",default:0}},edit:u,save:function(){return null}})})();