bookish_admin-1.0.x-dev/modules/bookish_image/js/ckeditor5-bookish-image/build/bookish-image.js

modules/bookish_image/js/ckeditor5-bookish-image/build/bookish-image.js
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.bookishImage=function(t){var e={};function o(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(i,n,function(e){return t[e]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=4)}([function(t,e){t.exports=CKEditor5.dll},function(t,e,o){t.exports=o(0)("./src/core.js")},function(t,e,o){t.exports=o(0)("./src/ui.js")},function(t,e,o){t.exports=o(0)("./src/utils.js")},function(t,e,o){"use strict";o.r(e),o.d(e,"BookishImage",(function(){return s})),o.d(e,"icons",(function(){return u}));var i='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"/></svg>',n=o(1),r=o(2),a=o(3);class s extends n.Plugin{static get pluginName(){return"BookishImage"}init(){const t=this.editor,e=t.t,o=t.model,{schema:n}=t.model;n.isRegistered("imageInline")&&n.extend("imageInline",{allowAttributes:["dataBookishImageStyle"]}),n.isRegistered("imageBlock")&&n.extend("imageBlock",{allowAttributes:["dataBookishImageStyle"]}),t.conversion.for("upcast").add(t=>{t.on("element:img",(t,e,o)=>{const{viewItem:i}=e,{writer:n}=o,r=i.getAttribute("data-bookish-image-style"),a=i.getAttribute("data-entity-uuid");if(!r||!a)return;const s=e.modelRange,u=s&&s.start.nodeAfter;u&&("imageInline"!==u.name&&"imageBlock"!==u.name||u.getAttribute("dataEntityUuid")!==a||(n.setAttribute("dataBookishImageStyle",r,u),o.consumable.consume(i,{attributes:"data-bookish-image-style"})))})}),t.conversion.for("downcast").add(t=>{t.on("attribute:dataBookishImageStyle",(t,e,o)=>{const{item:i}=e,{consumable:n,writer:r}=o;if(!n.consume(i,t.name))return;const a=o.mapper.toViewElement(i),s=Array.from(a.getChildren()).find(t=>"img"===t.name);null!==e.attributeNewValue?r.setAttribute("data-bookish-image-style",e.attributeNewValue,s||a):r.removeAttribute("data-bookish-image-style",s||a)})}),t.ui.componentFactory.add("bookishImageButton",t=>{const n=new r.ButtonView(t);return n.set({label:e("Edit image"),icon:i,tooltip:!0,isToggleable:!0}),this.listenTo(n,"execute",()=>{const t=o.document.selection,e=t.getSelectedElement()||Object(a.first)(t.getSelectedBlocks()),i=e.getAttribute("dataEntityUuid"),n=e.getAttribute("dataEntityType"),r=e.getAttribute("dataBookishImageStyle");if(!n||"file"!=n||!i)return;const s={url:window.drupalSettings.path.baseUrl+window.drupalSettings.path.pathPrefix+"admin/bookish-image-effect-form/"+i,event:"click",dialogType:"modal",dialog:{width:1280,height:850},progress:{type:"none"}};r&&(s.url+="?imageStyle="+encodeURIComponent(r)),window.Drupal.ajax(s).execute(),window.bookishImageAjaxCallback=function(t,i){o.change(o=>{const n=new URL(t);n.searchParams.set("t",(new Date).getTime()),o.setAttribute("src",n.toString(),e),o.setAttribute("dataBookishImageStyle",i,e)})}}),n})}}const u={ckeditor:i}}]);

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc