Server IP : 85.214.239.14 / Your IP : 3.138.137.114 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 : /srv/modoboa/instance/sitestatic/ckeditor/ckeditor/plugins/uploadwidget/ |
Upload File : |
/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ (function(){CKEDITOR.plugins.add("uploadwidget",{lang:"cs,da,de,en,eo,fr,gl,hu,it,ko,ku,nb,nl,pl,pt-br,ru,sv,tr,zh,zh-cn",requires:"widget,clipboard,filetools,notificationaggregator",init:function(b){b.filter.allow("*[!data-widget,!data-cke-upload-id]")}});CKEDITOR.fileTools||(CKEDITOR.fileTools={});CKEDITOR.tools.extend(CKEDITOR.fileTools,{addUploadWidget:function(b,c,a){var f=CKEDITOR.fileTools,k=b.uploadRepository,m=a.supportedTypes?10:20;if(a.fileToElement)b.on("paste",function(i){var i=i.data, l=i.dataTransfer,e=l.getFilesCount(),j=a.loadMethod||"loadAndUpload",d,g;if(!i.dataValue&&e)for(g=0;g<e;g++){d=l.getFile(g);if(!a.supportedTypes||f.isTypeSupported(d,a.supportedTypes)){var h=a.fileToElement(d);d=k.create(d);if(h){d[j](a.uploadUrl);CKEDITOR.fileTools.markElement(h,c,d.id);(j=="loadAndUpload"||j=="upload")&&CKEDITOR.fileTools.bindNotifications(b,d);i.dataValue=i.dataValue+h.getOuterHtml()}}}},null,null,m);CKEDITOR.tools.extend(a,{downcast:function(){return new CKEDITOR.htmlParser.text("")}, init:function(){var a=this,c=this.wrapper.findOne("[data-cke-upload-id]").data("cke-upload-id"),e=k.loaders[c],f=CKEDITOR.tools.capitalize,d,g;e.on("update",function(h){if(!a.wrapper||!a.wrapper.getParent()){b.editable().find('[data-cke-upload-id="'+c+'"]').count()||e.abort();h.removeListener()}else{b.fire("lockSnapshot");h="on"+f(e.status);if(!(typeof a[h]==="function"&&a[h](e)===false)){g="cke_upload_"+e.status;if(a.wrapper&&g!=d){d&&a.wrapper.removeClass(d);a.wrapper.addClass(g);d=g}(e.status== "error"||e.status=="abort")&&b.widgets.del(a)}b.fire("unlockSnapshot")}});e.update()},replaceWith:function(a,c){if(a.trim()==="")b.widgets.del(this);else{var e=this==b.widgets.focused,f=b.editable(),d=b.createRange(),g,h;e||(h=b.getSelection().createBookmarks());d.setStartBefore(this.wrapper);d.setEndAfter(this.wrapper);e&&(g=d.createBookmark());f.insertHtmlIntoRange(a,d,c);b.widgets.checkWidgets({initOnlyNew:true});b.widgets.destroy(this,true);if(e){d.moveToBookmark(g);d.select()}else b.getSelection().selectBookmarks(h)}}}); b.widgets.add(c,a)},markElement:function(b,c,a){b.setAttributes({"data-cke-upload-id":a,"data-widget":c})},bindNotifications:function(b,c){var a=b._.uploadWidgetNotificaionAggregator;if(!a||a.isFinished()){a=b._.uploadWidgetNotificaionAggregator=new CKEDITOR.plugins.notificationAggregator(b,b.lang.uploadwidget.uploadMany,b.lang.uploadwidget.uploadOne);a.once("finished",function(){var c=a.getTaskCount();c===0?a.notification.hide():a.notification.update({message:c==1?b.lang.uploadwidget.doneOne:b.lang.uploadwidget.doneMany.replace("%1", c),type:"success",important:1})})}var f=a.createTask({weight:c.total});c.on("update",function(){f&&c.status=="uploading"&&f.update(c.uploaded)});c.on("uploaded",function(){f&&f.done()});c.on("error",function(){f&&f.cancel();b.showNotification(c.message,"warning")});c.on("abort",function(){f&&f.cancel();b.showNotification(b.lang.uploadwidget.abort,"info")})}})})();