added elfinder module
This commit is contained in:
2631
sites/all/libraries/elfinder/js/extras/editors.default.js
Normal file
2631
sites/all/libraries/elfinder/js/extras/editors.default.js
Normal file
File diff suppressed because it is too large
Load Diff
2
sites/all/libraries/elfinder/js/extras/editors.default.min.js
vendored
Normal file
2
sites/all/libraries/elfinder/js/extras/editors.default.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -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"/></div>').appendTo(ql.info.find('.elfinder-quicklook-info'));
|
||||
|
||||
node = $('<iframe class="elfinder-quicklook-preview-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) {}
|
||||
}));
|
1
sites/all/libraries/elfinder/js/extras/quicklook.googledocs.min.js
vendored
Normal file
1
sites/all/libraries/elfinder/js/extras/quicklook.googledocs.min.js
vendored
Normal file
@@ -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,t,a=(e.window,i.file);0===a.mime.indexOf("application/vnd.google-apps.")&&("1"==a.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:a.hash},preventDefault:!0}).always(function(){o.show(),$(this).html("")}).done(function(i){var r=n.file(a.hash);e.value.url=r.url=i.url||"",e.value.url&&o.trigger($.Event("update",{file:e.value}))})})),""!==a.url&&"1"!=a.url&&(i.stopImmediatePropagation(),t=$('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"/></div>').appendTo(e.info.find(".elfinder-quicklook-info")),r=$('<iframe class="elfinder-quicklook-preview-iframe"/>').css("background-color","transparent").on("load",function(){e.hideinfo(),t.remove(),r.css("background-color","#fff")}).on("error",function(){t.remove(),r.remove()}).appendTo(o).attr("src",n.url(a.hash)),o.one("change",function(){t.remove(),r.off("load").remove()})))})})}catch(n){}});
|
Reference in New Issue
Block a user