initial
This commit is contained in:
commit
9883323161
17470 files changed
+4470592
No files matched your search
+2643
File diff suppressed because it is too large.
Load diff
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
!function(e,t){if("function"==typeof define&&define.amd)define(["elfinder"],e);else if(t){var i=t.prototype._options.commandsOptions.edit.editors;t.prototype._options.commandsOptions.edit.editors=i.concat(e(t))}}(function(e){"use strict";var t,i=window.location.search.match(/getfile=([a-z]+)/),n=e.prototype.hasRequire,o={bmp:"image/x-ms-bmp",dng:"image/x-adobe-dng",gif:"image/gif",jpeg:"image/jpeg",jpg:"image/jpeg",pdf:"application/pdf",png:"image/png",ppm:"image/x-portable-pixmap",psd:"image/vnd.adobe.photoshop",pxd:"image/x-pixlr-data",svg:"image/svg+xml",tiff:"image/tiff",webp:"image/webp",xcf:"image/x-xcf",sketch:"application/x-sketch",ico:"image/x-icon",dds:"image/vnd-ms.dds",emf:"application/x-msmetafile"},a=function(e,i,n){t||(t=i.arrayFlip(o));var a=t[e]||i.mimeTypes[e];return n?"jpg"===a&&(a="jpeg"):"jpeg"===a&&(a="jpg"),a},r=function(e,t){var i=$.Deferred();try{var n=document.createElement("canvas"),o=n.getContext("2d"),a=new Image,r=function(){var e,o,a=n.toDataURL(t);e=(o=a.match(/^data:([a-z0-9]+\/[a-z0-9.+-]+)/i))?o[1]:"",e.toLowerCase()===t.toLowerCase()?i.resolve(n.toDataURL(t),n):i.reject()};return a.src=e,$(a).on("load",function(){try{n.width=a.width,n.height=a.height,o.drawImage(a,0,0),r()}catch(e){i.reject()}}).on("error",function(){i.reject()}),i}catch(s){return i.reject()}},s=function(e,t,i,n){var o,r=$(this).children("img:first").data("ext",a(t.mime,n)),s=$('<div class="elfinder-edit-spinner elfinder-edit-image"></div>').html('<span class="elfinder-spinner-text">'+n.i18n("ntfloadimg")+'</span><span class="elfinder-spinner"></span>').hide().appendTo(this),d=function(){r.attr("id",e+"-img").attr("src",o||i).css({height:"","max-width":"100%","max-height":"100%",cursor:"pointer"}).data("loading",function(e){var t=r.closest(".elfinder-dialog").find("button,.elfinder-titlebar-button");return t.prop("disabled",!e)[e?"removeClass":"addClass"]("ui-state-disabled"),r.css("opacity",e?"":"0.3"),s[e?"hide":"show"](),r})};i.match(/^data:/)?d():n.openUrl(t.hash,!1,function(e){o=e,r.attr("_src",i),d()})},d=function(e,t){var i,n,o,a=e.attr("style");try{e.attr("style",""),i=e.get(0),n=document.createElement("canvas"),n.width=i.width,n.height=i.height,e.attr("style",a),n.getContext("2d").drawImage(i,0,0),o=n.toDataURL(t)}catch(r){o=e.attr("src")}return o},c=function(e){var t,i=$(e),n=$.Deferred().always(function(){i.off("load",r)}),o="about:blank",a=function(){t=setTimeout(function(){var e;try{e=base.contentWindow.location.href}catch(t){e=null}e===o?n.resolve():--s>0?a():n.reject()},500)},r=function(){t&&clearTimeout(t),n.resolve()},s=20;return i.one("load",r),e.src=o,a(),n};return i&&(i=i[1],"ckeditor"===i&&(e.prototype._options.getFileCallback=function(e,t){window.opener.CKEDITOR.tools.callFunction(function(){var e=new RegExp("(?:[?&]|&)CKEditorFuncNum=([^&]+)","i"),t=window.location.search.match(e);return t&&t.length>1?t[1]:""}(),t.convAbsUrl(e.url)),t.destroy(),window.close()})),[{info:{id:"tuiimgedit",name:"TUI Image Editor",iconImg:"img/editor-icons.png 0 -48",dataScheme:!0,schemeContent:!0,openMaximized:!0,canMakeEmpty:!1,integrate:{title:"TOAST UI Image Editor",link:"http://ui.toast.com/tui-image-editor/"}},mimes:["image/jpeg","image/png","image/gif","image/svg+xml","image/x-ms-bmp"],html:'<div class="elfinder-edit-imageeditor"><canvas></canvas></div>',setup:function(e,t){t.UA.ltIE8||t.UA.Mobile?this.disabled=!0:(this.opts=Object.assign({version:"v3.15.3"},e.extraOptions.tuiImgEditOpts||{},{iconsPath:t.baseUrl+"img/tui-",theme:{}}),t.isSameOrigin(this.opts.iconsPath)||(this.disabled=!0,t.debug("warning","Setting `commandOptions.edit.extraOptions.tuiImgEditOpts.iconsPath` MUST follow the same origin policy.")))},init:function(e,t,i,n){this.data("url",i)},load:function(e){var t,i=this,n=this.fm,o=$.Deferred(),a=n.options.cdns,r=i.confObj.opts.version,s=function(t){var a,r,s,d,c,l=$(e),p=l.parent(),m=i.confObj.opts,f=(m.iconsPath,$('<div class="tui-image-editor-container">').appendTo(p)),u=[$('<div class="tui-image-editor-submenu"></div>').appendTo(f),$('<div class="tui-image-editor-controls"></div>').appendTo(f)],g=new t(e,{includeUI:{loadImage:{path:l.data("url"),name:i.file.name},theme:m.theme,initMenu:"filter",menuBarPosition:"bottom"},cssMaxWidth:Math.max(300,p.width()),cssMaxHeight:Math.max(200,p.height()-(u[0].height()+u[1].height()+3)),usageStatistics:!1}),h=l.find("canvas:first").get(0),v=function(e){if("undefined"!=typeof e){var t,i,n,o=$(h),r=parseInt(o.attr("width")),s=parseInt(o.attr("height")),d=r/s;0===e?(i=r,n=s):(i=parseInt(o.css("max-width"))+Number(e),n=i/d,i>r&&n>s&&(i=r,n=s)),t=Math.round(i/r*100),t<100?(g.resetZoom(),g.stopDrawingMode(),a.hide()):a.show(),y.text(t+"%"),g.resizeCanvasDimension({width:i,height:n}),c&&setTimeout(function(){c&&v(e)},50)}},b=$('<span class="ui-icon ui-icon-plusthick"></span>').data("val",10),x=$('<span class="ui-icon ui-icon-minusthick"></span>').data("val",-10),y=$("<button></button>").css("width","4em").text("%").attr("title","100%").data("vLine truncated
|
||||
},s=function(){d.off("resize close",s),m()},c=!0;a.name&&(c=void 0),i.bind("dialogopened",r).exec("upload",Object.assign({files:[a],clipdata:c},t.confObj.uploadOpts),void 0,i.cwd().hash).done(function(e){e.added&&e.added.length?i.url(e.added[0].hash,{async:!0}).done(function(e){m(),n(i.convAbsUrl(e))}).fail(function(){o(i.i18n("errFileNotFound"))}):o(i.i18n(e.error?e.error:"errUpload"))}).fail(function(e){var t=i.parseError(e);t&&("errUnknownCmd"===t?t="errPerm":"userabort"===t&&(t="errAbort")),o(i.i18n(t?t:"errUploadNoFiles"))})}},f>=5&&(o.height="100%"),t.trigger("Prepare",{node:e,editorObj:tinymce,instance:void 0,opts:o}),tinymce.init(Object.assign(o,t.confObj.mceOpts))};return t.confObj.loader||(t.confObj.loader=$.Deferred(),t.fm.loadScript([i.options.cdns.tinymce+(i.options.cdns.tinymce.match(/\.js/)?"":"/tinymce.min.js")],function(){t.confObj.loader.resolve()},{loadType:"tag"})),t.confObj.loader.done(o),n},close:function(e,t){t&&tinymce.execCommand("mceRemoveEditor",!1,e.id)},save:function(e,t){t&&t.save()},focus:function(e,t){t&&t.focus()},resize:function(e,t,i,n){t&&e._setHeight()}},{info:{id:"zohoeditor",name:"Zoho Editor",iconImg:"img/editor-icons.png 0 -32",cmdCheck:"ZohoOffice",preventGet:!0,hideButtons:!0,syncInterval:15e3,canMakeEmpty:!0,integrate:{title:"Zoho Office API",link:"https://www.zoho.com/officeapi/"}},mimes:["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.oasis.opendocument.text","application/rtf","text/html","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","application/vnd.sun.xml.calc","text/csv","text/tab-separated-values","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.oasis.opendocument.presentation","application/vnd.sun.xml.impress"],html:'<iframe style="width:100%;max-height:100%;border:none;"></iframe>',setup:function(e,t){(t.UA.Mobile||t.UA.ltIE8)&&(this.disabled=!0)},prepare:function(e,t,i){var n=e.editor.fm.getUI();$(e).height(n.height()),t.width=Math.max(t.width||0,.8*n.width())},init:function(e,t,i,n){var o=this,a=$(this).hide(),r=n.getUI("toast"),s=$('<div class="elfinder-edit-spinner elfinder-edit-zohoeditor"></div>').html('<span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span>').appendTo(a.parent()),d=function(){var e="";return $.each(n.customData,function(t,i){e+="&"+encodeURIComponent(t)+"="+encodeURIComponent(i)}),e};$(o).data("xhr",n.request({data:{cmd:"editor",name:o.editor.confObj.info.cmdCheck,method:"init","args[target]":t.hash,"args[lang]":n.lang,"args[cdata]":d()},preventDefault:!0}).done(function(e){var t;e.zohourl?(t={css:{height:"100%"}},o.editor.trigger("Prepare",{node:o,editorObj:void 0,instance:a,opts:t}),a.attr("src",e.zohourl).show().css(t.css),e.warning&&(r.appendTo(o.closest(".ui-dialog")),n.toast({msg:n.i18n(e.warning),mode:"warning",timeOut:0,onHidden:function(){1===r.children().length&&r.appendTo(n.getUI())},button:{text:"btnYes"}}))):(e.error&&n.error(e.error),o.elfinderdialog("destroy"))}).fail(function(e){e&&n.error(e),o.elfinderdialog("destroy")}).always(function(){s.remove()}))},load:function(){},getContent:function(){},save:function(){},beforeclose:c,close:function(e){var t=(this.fm,$(e).data("xhr"));"pending"===t.state()&&t.reject()}},{info:{id:"ziparchive",name:"btnMount",iconImg:"img/toolbar.png 0 -416",cmdCheck:"ZipArchive",edit:function(e,t){var i=this,n=$.Deferred();return i.request({data:{cmd:"netmount",protocol:"ziparchive",host:e.hash,path:e.phash},preventFail:!0,notify:{type:"netmount",cnt:1,hideCnt:!0}}).done(function(e){var t;e.added&&e.added.length&&(e.added[0].phash&&(t=i.file(e.added[0].phash))&&(t.dirs||(t.dirs=1,i.change({changed:[t]}))),i.one("netmountdone",function(){i.exec("open",e.added[0].hash),i.one("opendone",function(){e.toast&&i.toast(e.toast)})})),n.resolve()}).fail(function(e){n.reject(e)}),n}},mimes:["application/zip"],load:function(){},save:function(){}},{info:{id:"textarea",name:"TextArea",useTextAreaEvent:!0},load:function(e){this.trigger("Prepare",{node:e,editorObj:void 0,instance:void 0,opts:{}}),e.setSelectionRange&&e.setSelectionRange(0,0),$(e).trigger("focus").show()},save:function(){}},{info:{id:"onlineconvert",name:"Online Convert",iconImg:"img/editor-icons.png 0 -144",cmdCheck:"OnlineConvert",preventGet:!0,hideButtons:!0,single:!0,converter:!0,canMakeEmpty:!1,integrate:{title:"ONLINE-CONVERT.COM",link:"https://online-convert.com"}},mimes:["*"],html:'<div style="width:100%;max-height:100%;"></div>',setup:function(e,t){var i=e.extraOptions.onlineConvert||{maxSize:100,showLink:!0};i.maxSize&&(this.info.maxSize=1048576*i.maxSize),this.set=Object.assign({url:"https://%s.online-convert.com%s?external_url=",conv:{Archive:{"7Z":{},BZ2:{ext:"bz"},GZ:{},ZLine truncated
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['elfinder'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
module.exports = factory(require('elfinder'));
|
||||
} else {
|
||||
factory(root.elFinder);
|
||||
}
|
||||
}(this, function(elFinder) {
|
||||
"use strict";
|
||||
try {
|
||||
if (! elFinder.prototype.commands.quicklook.plugins) {
|
||||
elFinder.prototype.commands.quicklook.plugins = [];
|
||||
}
|
||||
elFinder.prototype.commands.quicklook.plugins.push(function(ql) {
|
||||
var fm = ql.fm,
|
||||
preview = ql.preview;
|
||||
|
||||
preview.on('update', function(e) {
|
||||
var win = ql.window,
|
||||
file = e.file, node, loading;
|
||||
|
||||
if (file.mime.indexOf('application/vnd.google-apps.') === 0) {
|
||||
if (file.url == '1') {
|
||||
preview.hide();
|
||||
$('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+fm.i18n('getLink')+'</button></div>').appendTo(ql.info.find('.elfinder-quicklook-info'))
|
||||
.on('click', function() {
|
||||
$(this).html('<span class="elfinder-spinner">');
|
||||
fm.request({
|
||||
data : {cmd : 'url', target : file.hash},
|
||||
preventDefault : true
|
||||
})
|
||||
.always(function() {
|
||||
preview.show();
|
||||
$(this).html('');
|
||||
})
|
||||
.done(function(data) {
|
||||
var rfile = fm.file(file.hash);
|
||||
ql.value.url = rfile.url = data.url || '';
|
||||
if (ql.value.url) {
|
||||
preview.trigger($.Event('update', {file : ql.value}));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (file.url !== '' && file.url != '1') {
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
loading = $('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+fm.i18n('nowLoading')+'</span><span class="elfinder-spinner"></span></div>').appendTo(ql.info.find('.elfinder-quicklook-info'));
|
||||
|
||||
node = $('<iframe class="elfinder-quicklook-preview-iframe"></iframe>')
|
||||
.css('background-color', 'transparent')
|
||||
.on('load', function() {
|
||||
ql.hideinfo();
|
||||
loading.remove();
|
||||
node.css('background-color', '#fff');
|
||||
})
|
||||
.on('error', function() {
|
||||
loading.remove();
|
||||
node.remove();
|
||||
})
|
||||
.appendTo(preview)
|
||||
.attr('src', fm.url(file.hash));
|
||||
|
||||
preview.one('change', function() {
|
||||
loading.remove();
|
||||
node.off('load').remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
} catch(e) {}
|
||||
}));
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
!function(e,n){"function"==typeof define&&define.amd?define(["elfinder"],n):"undefined"!=typeof exports?module.exports=n(require("elfinder")):n(e.elFinder)}(this,function(e){"use strict";try{e.prototype.commands.quicklook.plugins||(e.prototype.commands.quicklook.plugins=[]),e.prototype.commands.quicklook.plugins.push(function(e){var n=e.fm,o=e.preview;o.on("update",function(i){var r,a,t=(e.window,i.file);0===t.mime.indexOf("application/vnd.google-apps.")&&("1"==t.url&&(o.hide(),$('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+n.i18n("getLink")+"</button></div>").appendTo(e.info.find(".elfinder-quicklook-info")).on("click",function(){$(this).html('<span class="elfinder-spinner">'),n.request({data:{cmd:"url",target:t.hash},preventDefault:!0}).always(function(){o.show(),$(this).html("")}).done(function(i){var r=n.file(t.hash);e.value.url=r.url=i.url||"",e.value.url&&o.trigger($.Event("update",{file:e.value}))})})),""!==t.url&&"1"!=t.url&&(i.stopImmediatePropagation(),a=$('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(e.info.find(".elfinder-quicklook-info")),r=$('<iframe class="elfinder-quicklook-preview-iframe"></iframe>').css("background-color","transparent").on("load",function(){e.hideinfo(),a.remove(),r.css("background-color","#fff")}).on("error",function(){a.remove(),r.remove()}).appendTo(o).attr("src",n.url(t.hash)),o.one("change",function(){a.remove(),r.off("load").remove()})))})})}catch(n){}});
|
||||
Reference in new issue
Block a user