File Editor
Directories:
.. (Back)
Files:
editor.asset.php
editor.css
editor.js
editor.rtl.css
Create New File
Create
Edit File: editor.js
(()=>{var e={113:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(468);const o=(0,s.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,s.cloneElement)(e,{width:t,height:t,...n,ref:o})}))},512:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(573),o=n(790);const r=(0,o.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(s.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})})},941:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let s=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(s++,"%c"===e&&(o=s))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(212)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},212:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,r,i=null;function a(...e){if(!a.enabled)return;const s=a,o=Number(new Date),r=o-(n||o);s.diff=r,s.prev=n,s.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";i++;const r=t.formatters[o];if("function"==typeof r){const t=e[i];n=r.call(s,t),e.splice(i,1),i--}return n})),t.formatArgs.call(s,e);(s.log||t.log).apply(s,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,r=t.enabled(e)),r),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function s(e,n){const s=t(this.namespace+(void 0===n?":":n)+e);return s.log=this.log,s}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").split(/[\s,]+/),o=s.length;for(n=0;n<o;n++)s[n]&&("-"===(e=s[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,s;for(n=0,s=t.skips.length;n<s;n++)if(t.skips[n].test(e))return!1;for(n=0,s=t.names.length;n<s;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(997),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},997:e=>{var t=1e3,n=60*t,s=60*n,o=24*s,r=7*o,i=365.25*o;function a(e,t,n,s){var o=t>=1.5*n;return Math.round(e/n)+" "+s+(o?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*s;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var r=Math.abs(e);if(r>=o)return a(e,r,o,"day");if(r>=s)return a(e,r,s,"hour");if(r>=n)return a(e,r,n,"minute");if(r>=t)return a(e,r,t,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=o)return Math.round(e/o)+"d";if(r>=s)return Math.round(e/s)+"h";if(r>=n)return Math.round(e/n)+"m";if(r>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},372:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(941);const o=n.n(s)()("dops:analytics");let r,i;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const a={initialize:function(e,t,n){a.setUser(e,t),a.setSuperProps(n),a.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){i={ID:e,username:t}},setSuperProps:function(e){r=e},assignSuperProps:function(e){r=Object.assign(r||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);o("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),o('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);a.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);o("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),o('Built stat "%s" in group "%s"',t,e);return n}(e,t);a.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){a.tracks.recordPageView(e),a.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,s,o,r,i){a.ga.recordPurchase(e,t,n,s,o,r,i)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(r&&(o("- Super Props: %o",r),t=Object.assign(t,r)),o('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):o('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};a.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){a.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){o("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};a.ga.initialized||(i&&(e={userId:"u-"+i.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),a.ga.initialized=!0)},recordPageView:function(e,t){a.ga.initialize(),o("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,s){a.ga.initialize();let r="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(r+=" [Option Label: "+n+"]"),void 0!==s&&(r+=" [Option Value: "+s+"]"),o(r),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,s)},recordPurchase:function(e,t,n,s,o,r,i){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:s,currency:i}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:o,quantity:r}),window.ga("ecommerce:send")}},identifyUser:function(){i&&window._tkq.push(["identifyUser",i.ID,i.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},c=a},985:(e,t,n)=>{"use strict";n.d(t,{st:()=>s.A});n(34),n(595),n(265);var s=n(489);n(923),n(877),n(335),n(290)},877:(e,t,n)=>{"use strict";n(609)},335:(e,t,n)=>{"use strict";n(468)},489:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(372),o=n(384),r=n(468);const{tracks:i}=s.A,{recordEvent:a}=i,c=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:c={}}={})=>{const[u,l]=(0,r.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:g={}}=(0,o.useConnection)(),{wpcomUser:{login:w,ID:f}={},blogId:C}=g.currentUser||{},m=(0,r.useCallback)((async(e,t={})=>{d&&f&&w&&a(e,t)}),[d,f,w]);return(0,r.useEffect)((()=>{d&&f&&w&&C&&s.A.initialize(f,w,{blog_id:C})}),[C,f,w,d]),(0,r.useEffect)((()=>{const s=e?`${t}_${e}_${n}`:null;p&&s&&(u||(m(s,c),l(!0)))}),[u,t,e,n,p,c,m]),{recordEvent:m,tracks:i}}},923:(e,t,n)=>{"use strict";n(143),n(468),n(290)},105:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>d,E9:()=>l});var s=n(143),o=n(634),r=n(478),i=n(290);const a="SET_JETPACK_MODULES";function c(e){return l({isLoading:e})}function u(e,t){return{type:"SET_MODULE_UPDATING",name:e,isUpdating:t}}function l(e){return{type:a,options:e}}const d={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,r.sB)(e);const t=yield(0,r.wz)();return yield l({data:t}),!0}catch(e){const t=(0,s.select)(i.F).getJetpackModules();return yield l(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:l,fetchModules:function*(){if((0,o.Sy)())return!0;try{yield c(!0);const e=yield(0,r.wz)();return yield l({data:e}),!0}catch(e){const t=(0,s.select)(i.F).getJetpackModules();return yield l(t),!1}finally{yield c(!1)}}}},478:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>u,sB:()=>c,wz:()=>a});var s=n(455),o=n.n(s);const r="FETCH_JETPACK_MODULES",i="UPDATE_JETPACK_MODULE_STATUS",a=()=>({type:r}),c=e=>({type:i,settings:e}),u={[r]:function(){return o()({path:"/jetpack/v4/module/all",method:"GET"})},[i]:function({settings:e}){return o()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},290:(e,t,n)=>{"use strict";n.d(t,{F:()=>u});var s=n(143),o=n(105),r=n(478),i=n(862),a=n(701),c=n(640);const u="jetpack-modules",l=(0,s.createReduxStore)(u,{reducer:i.A,actions:o.Ay,controls:r.Ay,resolvers:a.A,selectors:c.A});(0,s.register)(l);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,s.dispatch)(u).setJetpackModules({data:{...d}})},862:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const s={isLoading:!1,isUpdating:{},data:{}},o=(e=s,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},701:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(105),o=n(478);const r={getJetpackModules:function*(){try{const e=yield(0,o.wz)();if(e)return(0,s.E9)({data:e})}catch(e){console.error(e)}}}},640:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(634);const o={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,s.Sy)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},265:(e,t,n)=>{"use strict";var s=n(723);n(832),n(87);const __=s.__;__("Upgrade your plan to use video covers","jetpack-blaze"),__("Upgrade your plan to upload audio","jetpack-blaze")},34:(e,t,n)=>{"use strict";n(279)},634:(e,t,n)=>{"use strict";function s(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function o(){return"simple"===s()}n.d(t,{Sy:()=>o})},595:(e,t,n)=>{"use strict";n(72),n(491)},368:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(427);function o(){return React.createElement(s.SVG,{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement(s.G,{clipPath:"url(#clip0_4728_49296)"},React.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"#D9D9D9"}),React.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"black"}),React.createElement(s.Path,{d:"M14.8665 6.68544C14.7139 6.50468 14.4652 6.43826 14.2436 6.52015C14.0224 6.60204 13.875 6.81412 13.875 7.05149V8.71684C13.875 9.02893 13.6226 9.2829 13.3125 9.2829C13.0024 9.2829 12.75 9.02893 12.75 8.71684V4.72989C12.75 4.56762 12.681 4.41365 12.5602 4.3061C12.4354 4.19515 12.3622 4.13288 12.3622 4.13288C12.1537 3.95627 11.8485 3.95552 11.6389 4.13175C11.4086 4.32572 6 8.9327 6 13.434C6 16.7632 8.69175 19.472 12 19.472C15.3082 19.472 18 16.7632 18 13.434C18 10.9267 16.296 8.38022 14.8665 6.68544ZM12.0728 18.5274C11.508 18.544 10.9699 18.3259 10.5259 17.9742C8.3535 16.2537 10.3856 13.4982 11.4469 12.3106C11.7435 11.9789 12.2584 11.9807 12.555 12.3125C13.2742 13.1178 14.4375 14.6416 14.4375 16.0756C14.4375 17.4059 13.3853 18.4885 12.0728 18.5274Z",fill:"white"})))}},384:e=>{"use strict";e.exports=window.JetpackConnection},609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},87:e=>{"use strict";e.exports=window.lodash},455:e=>{"use strict";e.exports=window.wp.apiFetch},427:e=>{"use strict";e.exports=window.wp.components},491:e=>{"use strict";e.exports=window.wp.compose},143:e=>{"use strict";e.exports=window.wp.data},309:e=>{"use strict";e.exports=window.wp.editPost},656:e=>{"use strict";e.exports=window.wp.editor},468:e=>{"use strict";e.exports=window.wp.element},723:e=>{"use strict";e.exports=window.wp.i18n},279:e=>{"use strict";e.exports=window.wp.plugins},573:e=>{"use strict";e.exports=window.wp.primitives},832:e=>{"use strict";e.exports=window.wp.url},72:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(s){var o=t[s];if(void 0!==o)return o.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(985),t=n(427),s=n(491),o=n(143),r=n(309),i=n(656),a=n(468),c=n(723),u=n(113),l=n(512),d=n(279),p=n(368);const __=c.__,g=()=>{const{blazeUrlTemplate:n}=window?.blazeInitialState||{},{tracks:c}=(0,e.st)(),d=(0,a.useCallback)((()=>c.recordEvent("jetpack_editor_blaze_publish_click")),[c]),{isPostPublished:g,isPublishingPost:w,postId:f,postType:C,postVisibility:m}=(0,o.useSelect)((e=>({isPostPublished:e(i.store).isCurrentPostPublished(),isPublishingPost:e(i.store).isPublishingPost(),postId:e(i.store).getCurrentPostId(),postType:e(i.store).getCurrentPostType(),postVisibility:e(i.store).getEditedPostVisibility()}))),h=(0,s.usePrevious)(w),y={name:"blaze-panel",title:__("Promote with Blaze","jetpack-blaze"),className:"blaze-panel",icon:React.createElement(p.A,null),initialOpen:!0},v=n.link.replace("__POST_ID__",f),b=(0,a.useCallback)((()=>!!["page","post","product"].includes(C)&&!(!g||"password"===m||"private"===m)),[C,g,m]);if((0,a.useEffect)((()=>{h&&!w&&b()&&g&&c.recordEvent("jetpack_editor_blaze_post_publish_panel_view")}),[c,w,g,h,b]),!b())return null;const F={page:__("Blaze this page","jetpack-blaze"),post:__("Blaze this post","jetpack-blaze"),product:__("Blaze this product","jetpack-blaze")}[C]??__("Blaze this post","jetpack-blaze");return React.createElement(r.PluginPostPublishPanel,y,React.createElement(t.PanelRow,null,React.createElement("p",null,__("Reach a larger audience boosting the content to the WordPress.com community of blogs and sites.","jetpack-blaze"))),React.createElement("div",{role:"link",className:"post-publish-panel__postpublish-buttons",tabIndex:0,onClick:d,onKeyDown:d},React.createElement(t.Button,{variant:"secondary",href:v,target:"_top"},F,n.external&&React.createElement(u.A,{icon:l.A,className:"blaze-panel-outbound-link__external_icon"}))))};(0,d.getPlugin)("jetpack-blaze")||(0,d.registerPlugin)("jetpack-blaze",{render:g})})()})();
Save Changes
Rename File
Rename