Skip to content

Commit

Permalink
elFinder up to newly ( Studio-42/elFinder@84c1eb4 )
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Aug 21, 2017
1 parent aec1f3c commit 64145be
Show file tree
Hide file tree
Showing 16 changed files with 339 additions and 48 deletions.
86 changes: 78 additions & 8 deletions html/common/elfinder/css/cwd.css
Expand Up @@ -265,6 +265,71 @@
background-position:1px -1px;
}

/* type badge in "icons" view */
.elfinder-cwd-icon:before {
content: none;
position: absolute;
left: 0px;
top: 5px;
min-width: 20px;
max-width: 84px;
text-align: center;
padding: 1px 4px;
border-radius: 4px;
font-family: Verdana;
font-size: 10px;
-webkit-transform: scale(0.9);
-moz-transform: scale(0.9);
-ms-transform: scale(0.9);
-o-transform: scale(0.9);
transform: scale(0.9);
}
.elfinder-cwd-icon.elfinder-cwd-bgurl:before {
left: -10px;
}

/* icon image has type */
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-empty:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-plain:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-rtf:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-rtfd:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-pdf:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-html:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-css:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-javascript:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-javascript:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-perl:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-python:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-ruby:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-sh:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-shellscript:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-csrc:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-chdr:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c--:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c--src:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c--hdr:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-java:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-java-source:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-php:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-xml:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-zip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-zip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-xz:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-7z-compressed:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-gzip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-tar:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-bzip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-bzip2:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-rar:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-rar-compressed:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-shockwave-flash:before { content: none }

/* addtional type badge name */
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-mp2t:before { content: 'ts' }
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-dash-xml:before { content: 'dash' }
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-mpegurl:before { content: 'hls' }

/* thumbnail image */
.elfinder-cwd-icon.elfinder-cwd-bgurl {
background-position: center center;
Expand All @@ -282,8 +347,10 @@
-moz-background-size: cover;
background-size: cover;
}
.elfinder-cwd-bgurl:after {
.elfinder-cwd-icon.elfinder-cwd-bgurl:after {
content: ' ';
}
.elfinder-cwd-bgurl:after {
position: relative;
display: inline-block;
top: 36px;
Expand All @@ -306,11 +373,11 @@
transform: scale(.6);
}
/* thumbnail image overlay none */
.elfinder-cwd-icon-image:after {
.elfinder-cwd-view-icons .elfinder-cwd-icon-image:after {
content: none;
}
/* thumbnail image video overlay */
.elfinder-cwd-icon-video:after {
.elfinder-cwd-view-icons .elfinder-cwd-icon-video:after {
top: 32px;
left: -26px;
height: 25px;
Expand All @@ -336,10 +403,13 @@
.elfinder-cwd-icon-application:after,
.elfinder-cwd-icon-application { background-position:0 -150px; }

.elfinder-cwd-icon-x-empty:after,
.elfinder-cwd-icon-text:after,
.elfinder-cwd-icon-x-empty,
.elfinder-cwd-icon-text { background-position:0 -200px; }
.elfinder-cwd-icon-text { background-position:0 -1350px; }

.elfinder-cwd-icon-plain:after,
.elfinder-cwd-icon-plain,
.elfinder-cwd-icon-x-empty:after,
.elfinder-cwd-icon-x-empty { background-position:0 -200px; }

.elfinder-cwd-icon-image:after,
.elfinder-cwd-icon-vnd-adobe-photoshop:after,
Expand All @@ -354,8 +424,8 @@
.elfinder-cwd-icon-video,
.elfinder-cwd-icon-flash-video,
.elfinder-cwd-icon-dash-xml,
.elfinder-cwd-icon-vnd-apple-mpegURL,
.elfinder-cwd-icon-x-mpegURL { background-position:0 -350px; }
.elfinder-cwd-icon-vnd-apple-mpegurl,
.elfinder-cwd-icon-x-mpegurl { background-position:0 -350px; }

.elfinder-cwd-icon-rtf:after,
.elfinder-cwd-icon-rtfd:after,
Expand Down
88 changes: 79 additions & 9 deletions html/common/elfinder/css/elfinder.full.css
@@ -1,6 +1,6 @@
/*!
* elFinder - file manager for web
* Version 2.1.28 (2.1 Nightly: 448804d) (2017-08-19)
* Version 2.1.28 (2.1 Nightly: 84c1eb4) (2017-08-21)
* http://elfinder.org
*
* Copyright 2009-2017, Studio 42
Expand Down Expand Up @@ -1093,6 +1093,71 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
background-position:1px -1px;
}

/* type badge in "icons" view */
.elfinder-cwd-icon:before {
content: none;
position: absolute;
left: 0px;
top: 5px;
min-width: 20px;
max-width: 84px;
text-align: center;
padding: 1px 4px;
border-radius: 4px;
font-family: Verdana;
font-size: 10px;
-webkit-transform: scale(0.9);
-moz-transform: scale(0.9);
-ms-transform: scale(0.9);
-o-transform: scale(0.9);
transform: scale(0.9);
}
.elfinder-cwd-icon.elfinder-cwd-bgurl:before {
left: -10px;
}

/* icon image has type */
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-empty:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-plain:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-rtf:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-rtfd:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-pdf:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-html:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-css:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-javascript:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-javascript:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-perl:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-python:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-ruby:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-sh:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-shellscript:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-csrc:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-chdr:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c--:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c--src:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-c--hdr:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-java:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-java-source:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-php:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-xml:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-zip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-zip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-xz:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-7z-compressed:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-gzip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-tar:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-bzip:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-bzip2:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-rar:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-rar-compressed:before,
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-shockwave-flash:before { content: none }

/* addtional type badge name */
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-mp2t:before { content: 'ts' }
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-dash-xml:before { content: 'dash' }
.elfinder-cwd-view-icons .elfinder-cwd-icon.elfinder-cwd-icon-x-mpegurl:before { content: 'hls' }

/* thumbnail image */
.elfinder-cwd-icon.elfinder-cwd-bgurl {
background-position: center center;
Expand All @@ -1110,8 +1175,10 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
-moz-background-size: cover;
background-size: cover;
}
.elfinder-cwd-bgurl:after {
.elfinder-cwd-icon.elfinder-cwd-bgurl:after {
content: ' ';
}
.elfinder-cwd-bgurl:after {
position: relative;
display: inline-block;
top: 36px;
Expand All @@ -1134,11 +1201,11 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
transform: scale(.6);
}
/* thumbnail image overlay none */
.elfinder-cwd-icon-image:after {
.elfinder-cwd-view-icons .elfinder-cwd-icon-image:after {
content: none;
}
/* thumbnail image video overlay */
.elfinder-cwd-icon-video:after {
.elfinder-cwd-view-icons .elfinder-cwd-icon-video:after {
top: 32px;
left: -26px;
height: 25px;
Expand All @@ -1164,10 +1231,13 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
.elfinder-cwd-icon-application:after,
.elfinder-cwd-icon-application { background-position:0 -150px; }

.elfinder-cwd-icon-x-empty:after,
.elfinder-cwd-icon-text:after,
.elfinder-cwd-icon-x-empty,
.elfinder-cwd-icon-text { background-position:0 -200px; }
.elfinder-cwd-icon-text { background-position:0 -1350px; }

.elfinder-cwd-icon-plain:after,
.elfinder-cwd-icon-plain,
.elfinder-cwd-icon-x-empty:after,
.elfinder-cwd-icon-x-empty { background-position:0 -200px; }

.elfinder-cwd-icon-image:after,
.elfinder-cwd-icon-vnd-adobe-photoshop:after,
Expand All @@ -1182,8 +1252,8 @@ div.elfinder-cwd-wrapper-list tr.ui-state-default td span.ui-icon {
.elfinder-cwd-icon-video,
.elfinder-cwd-icon-flash-video,
.elfinder-cwd-icon-dash-xml,
.elfinder-cwd-icon-vnd-apple-mpegURL,
.elfinder-cwd-icon-x-mpegURL { background-position:0 -350px; }
.elfinder-cwd-icon-vnd-apple-mpegurl,
.elfinder-cwd-icon-x-mpegurl { background-position:0 -350px; }

.elfinder-cwd-icon-rtf:after,
.elfinder-cwd-icon-rtfd:after,
Expand Down
4 changes: 2 additions & 2 deletions html/common/elfinder/css/elfinder.min.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions html/common/elfinder/css/theme.css
Expand Up @@ -31,9 +31,20 @@
.elfinder-cwd-wrapper.elfinder-cwd-wrapper-trash {
background-color: #f0efef;
}

/* selected file in "icons" view */
.elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-hover { background:#ccc; }

/* type badge in "icons" view */
.elfinder-cwd-view-icons .elfinder-cwd-icon:before {
color: white;
background-color: #798da7;
}
.elfinder-cwd-view-icons .elfinder-cwd-icon-text:before { background-color: #6f99e6 }
.elfinder-cwd-view-icons .elfinder-cwd-icon-image:before { background-color: #2ea26c }
.elfinder-cwd-view-icons .elfinder-cwd-icon-audio:before { background-color: #7bad2a }
.elfinder-cwd-view-icons .elfinder-cwd-icon-video:before { background-color: #322aad }

/* list view*/
.elfinder-cwd table thead td.ui-state-hover { background:#ddd; }
.elfinder-cwd table tr:nth-child(odd) { background-color:#edf3fe; }
Expand Down
Binary file modified html/common/elfinder/img/icons-big.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion html/common/elfinder/js/commands/edit.js
Expand Up @@ -408,7 +408,7 @@ elFinder.prototype.commands.edit = function() {
}

req.done(function(data) {
var selEncoding;
var selEncoding, reg, m;
if (data.doconv) {
fm.confirm({
title : self.title,
Expand Down Expand Up @@ -439,6 +439,12 @@ elFinder.prototype.commands.edit = function() {
}
});
} else {
if (file.mime.indexOf('text/') === 0 || $.inArray(file.mime, texts) !== -1) {
reg = new RegExp('^(data:'+file.mime.replace(/([.+])/g, '\\$1')+';base64,)', 'i');
if (window.atob && (m = data.content.match(reg))) {
data.content = atob(data.content.substr(m[1].length));
}
}
dialog(id, file, data.content, data.encoding, editor)
.done(function(data) {
dfrd.resolve(data);
Expand Down
10 changes: 9 additions & 1 deletion html/common/elfinder/js/elFinder.js
Expand Up @@ -4683,6 +4683,14 @@ elFinder.prototype = {
'video/ogg' : 'VideoOGG'
},

/**
* File mimetype to file extention mapping
*
* @type Object
* @see elFinder.mimetypes.js
*/
mimeTypes : {},

/**
* Ajax request data validation rules
*
Expand Down Expand Up @@ -7079,7 +7087,7 @@ elFinder.prototype = {

mime = mime.split('/');

return prefix + mime[0] + (mime[1] ? ' ' + prefix+mime[1].replace(/(\.|\+)/g, '-') : '');
return prefix + mime[0].toLowerCase() + (mime[1] ? ' ' + prefix+mime[1].toLowerCase().replace(/(\.|\+)/g, '-') : '');
},

/**
Expand Down
1 change: 1 addition & 0 deletions html/common/elfinder/js/elFinder.mimetypes.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions html/common/elfinder/js/elFinder.resources.js
Expand Up @@ -44,6 +44,7 @@ elFinder.prototype.resources = {
text : [
'application/x-empty',
'application/javascript',
'application/json',
'application/xhtml+xml',
'audio/x-mp3-playlist',
'application/x-web-config',
Expand Down
2 changes: 1 addition & 1 deletion html/common/elfinder/js/elFinder.version.js
Expand Up @@ -3,5 +3,5 @@
*
* @type String
**/
elFinder.prototype.version = '2.1.28 (2.1 Nightly: 448804d)';
elFinder.prototype.version = '2.1.28 (2.1 Nightly: 84c1eb4)';

77 changes: 73 additions & 4 deletions html/common/elfinder/js/elfinder.full.js

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions html/common/elfinder/js/elfinder.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion html/common/elfinder/js/extras/editors.default.js
Expand Up @@ -24,7 +24,7 @@
try {
hasFlash = !!(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
} catch (e) {
hasFlash = !!(navigator && navigator.mimeTypes["application/x-shockwave-flash"]);
hasFlash = !!(! window.orientation || (navigator && navigator.mimeTypes["application/x-shockwave-flash"]));
}
return hasFlash;
})(),
Expand Down

0 comments on commit 64145be

Please sign in to comment.