jodit-pro
Version:
PRO Version of Jodit Editor
9 lines • 2.73 kB
JavaScript
/*!
* jodit-pro - PRO Version of Jodit Editor
* Author: Chupurnov Valerii <chupurnov@gmail.com>
* Version: v4.9.27
* Url: https://xdsoft.net/jodit/pro/
* License(s): SEE LICENSE IN LICENSE.md
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[210],{53121:function(e){e.exports='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M19,21H5a2,2,0,0,1-2-2V17a1,1,0,0,1,2,0v2H19V17a1,1,0,0,1,2,0v2A2,2,0,0,1,19,21Z"/> <path d="M18,5H6A1,1,0,0,1,6,3H18a1,1,0,0,1,0,2Z"/> <path d="M15.71,10.29l-3-3a1,1,0,0,0-.33-.21,1,1,0,0,0-.76,0,1,1,0,0,0-.33.21l-3,3a1,1,0,0,0-.21,1.09A1,1,0,0,0,9,12h2v3a1,1,0,0,0,2,0V12h2a1,1,0,0,0,.92-.62A1,1,0,0,0,15.71,10.29Z"/> </svg>'},90832:function(e,t,o){"use strict";var r=o(53121),s=o.n(r),a=o(6441),n=o(2748);a.Config.prototype.exportDocs={css:"",pdf:{externalFonts:[],allow:!0,options:{defaultFont:"courier",format:"A4",page_orientation:"portrait"}}},a.Config.prototype.controls.exportDocs={tooltip:"Export",isDisabled:e=>n.Dom.isEmptyContent(e.editor),icon:s(),list:{exportToPdf:"Export to PDF"},command:"exportToPDF"}},90882:function(e,t,o){"use strict";o.r(t),o.d(t,{ExportDocs:function(){return f}});var r=o(82749);o(90832);var s=o(22732),a=o(68934),n=o(11628),p=o(50911),i=o(54079),c=o(14625),l=o(2692);class f extends p.Plugin{afterInit(e){e.registerCommand("exportToPDF",async()=>{let t=new i.Ajax({...e.o.exportDocs.ajax??e.o.filebrowser.ajax,method:"POST",responseType:"blob",onProgress(t){e.progressbar.show().progress(t)},data:{action:"generatePdf",html:f.getValue(e),options:(0,a.ConfigDeepFlatten)(e.o.exportDocs.pdf).options}});e.e.on("beforeDestruct",t.destruct);try{let e=await t.send(),o=await e.blob(),r=this.j.create.a();r.href=URL.createObjectURL(o),r.download="document.pdf",r.click(),s.Dom.safeRemove(r),URL.revokeObjectURL(r.href)}catch(t){t.message&&e.alert(t.message)}finally{e.progressbar.progress(100),await e.async.delay(200),e.progressbar.hide()}})}static getValue(e){let[t]=(0,n.previewBox)(e),o=[];return e.o.exportDocs.pdf.externalFonts.forEach(e=>{/^</.test(e)?o.push(e):o.push(`<link rel="stylesheet" href="${e}">`)}),o.push(`<style>${(0,c.generateCriticalCSS)(e)}</style>`),o.push(`<style>${e.o.exportDocs.css}</style>`),o.push(t.innerHTML),o.join(`
`)}beforeDestruct(){}constructor(...e){super(...e),(0,r._)(this,"buttons",[{name:"exportDocs",group:"media"}])}}(0,r._)(f,"requires",["license"]),l.JoditPro.plugins.add("exportDocs",f)}},function(e){return e(e.s=90882)}])});