Server IP : 85.214.239.14 / Your IP : 3.138.134.163 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/self/root/srv/modoboa/instance/sitestatic/ckeditor/ckeditor/plugins/uploadimage/ |
Upload File : |
"use strict";(function(){CKEDITOR.plugins.add("uploadimage",{requires:"uploadwidget",onLoad:function(){CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}")},init:function(b){if(!CKEDITOR.plugins.clipboard.isFileApiSupported){return}var d=CKEDITOR.fileTools,c=d.getUploadUrl(b.config,"image");if(!c){CKEDITOR.error("uploadimage-config");return}d.addUploadWidget(b,"uploadimage",{supportedTypes:/image\/(jpeg|png|gif|bmp)/,uploadUrl:c,fileToElement:function(){var e=new CKEDITOR.dom.element("img");e.setAttribute("src",a);return e},parts:{img:"img"},onUploading:function(e){this.parts.img.setAttribute("src",e.data)},onUploaded:function(e){console.log(e);this.replaceWith('<img src="'+e.url+'" width="'+this.parts.img.$.naturalWidth+'" height="'+this.parts.img.$.naturalHeight+'">')}});b.on("paste",function(m){if(!m.data.dataValue.match(/<img[\s\S]+data:/i)){return}var h=m.data,l=document.implementation.createHTMLDocument(""),o=new CKEDITOR.dom.element(l.body),j,f,g;o.data("cke-editable",1);o.appendHtml(h.dataValue);j=o.find("img");for(g=0;g<j.count();g++){f=j.getItem(g);var k=f.getAttribute("src")&&f.getAttribute("src").substring(0,5)=="data:",e=f.data("cke-realelement")===null;if(k&&e&&!f.data("cke-upload-id")&&!f.isReadOnly(1)){var n=b.uploadRepository.create(f.getAttribute("src"));n.upload(c);d.markElement(f,"uploadimage",n.id);d.bindNotifications(b,n)}}h.dataValue=o.getHtml()})}});var a="data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs="})();