Skip to content

Commit

Permalink
[js:core,cmd:info] fix #1652 add the item type Volume Root
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Sep 16, 2016
1 parent 68e6f22 commit 4f4049d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
7 changes: 5 additions & 2 deletions js/commands/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
kind : fm.i18n('kind'),
files : fm.i18n('files'),
folders : fm.i18n('folders'),
roots : fm.i18n('volumeRoots'),
items : fm.i18n('items'),
yes : fm.i18n('yes'),
no : fm.i18n('no'),
Expand Down Expand Up @@ -197,7 +198,7 @@
fm.autoSync();
});
},
size, tmb, file, title, dcnt;
size, tmb, file, title, dcnt, rdcnt;

if (!cnt) {
return $.Deferred().reject();
Expand Down Expand Up @@ -314,7 +315,9 @@
content.push(row.replace(l, msg.kind).replace(v, msg.files));
content.push(row.replace(l, msg.size).replace(v, fm.formatSize(size)));
} else {
content.push(row.replace(l, msg.kind).replace(v, dcnt == cnt ? msg.folders : msg.folders+' '+dcnt+', '+msg.files+' '+(cnt-dcnt)));
rdcnt = $.map(files, function(f) { return f.mime === 'directory' && (! f.phash || f.isroot)? 1 : null ; }).length;
dcnt -= rdcnt;
content.push(row.replace(l, msg.kind).replace(v, (rdcnt === cnt || dcnt === cnt)? msg[rdcnt? 'roots' : 'folders'] : $.map({roots: rdcnt, folders: dcnt, files: cnt - rdcnt - dcnt}, function(c, t) { return c? msg[t]+' '+c : null}).join(', ')));
content.push(row.replace(l, msg.size).replace(v, tpl.spinner.replace('{text}', msg.calc).replace('{name}', 'size')));
count = $.map(files, function(f) { return f.hash; });

Expand Down
21 changes: 15 additions & 6 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5588,13 +5588,22 @@ elFinder.prototype = {
* @return String
*/
mime2kind : function(f) {
var mime = typeof(f) == 'object' ? f.mime : f, kind;
var isObj = typeof(f) == 'object' ? true : false,
mime = isObj ? f.mime : f,
kind;

if (f.alias && f.mime != 'symlink-broken') {
kind = 'Alias';
} else if (this.kinds[mime]) {
kind = this.kinds[mime];
} else {
if (isObj) {
if (f.alias && mime != 'symlink-broken') {
kind = 'Alias';
} else if (this.kinds[mime]) {
if (mime === 'directory' && (! f.phash || f.isroot)) {
kind = 'Root';
} else {
kind = this.kinds[mime];
}
}
}
if (! kind) {
if (mime.indexOf('text') === 0) {
kind = 'Text';
} else if (mime.indexOf('image') === 0) {
Expand Down
2 changes: 2 additions & 0 deletions js/i18n/elfinder.LANG.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,11 @@ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object'
'complete' : '$1 complete', // from v2.1.15 added 21.8.2016
'contextmenu' : 'Context menu', // from v2.1.15 added 9.9.2016
'pageTurning' : 'Page turning', // from v2.1.15 added 9.10.2016
'volumeRoots' : 'Volume roots', // from v2.1.16 added 16.10.2016

/********************************** mimetypes **********************************/
'kindUnknown' : 'Unknown',
'kindRoot' : 'Volume Root', // from v2.1.16 added 16.10.2016
'kindFolder' : 'Folder',
'kindAlias' : 'Alias',
'kindAliasBroken' : 'Broken alias',
Expand Down
4 changes: 3 additions & 1 deletion js/i18n/elfinder.en.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* English translation
* @author Troex Nevelin <troex@fury.scancode.ru>
* @version 2016-09-10
* @version 2016-09-16
*/
if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
elFinder.prototype.i18.en = {
Expand Down Expand Up @@ -361,9 +361,11 @@ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object'
'complete' : '$1 complete', // from v2.1.15 added 21.8.2016
'contextmenu' : 'Context menu', // from v2.1.15 added 9.9.2016
'pageTurning' : 'Page turning', // from v2.1.15 added 9.10.2016
'volumeRoots' : 'Volume roots', // from v2.1.16 added 16.10.2016

/********************************** mimetypes **********************************/
'kindUnknown' : 'Unknown',
'kindRoot' : 'Volume Root', // from v2.1.16 added 16.10.2016
'kindFolder' : 'Folder',
'kindAlias' : 'Alias',
'kindAliasBroken' : 'Broken alias',
Expand Down
4 changes: 3 additions & 1 deletion js/i18n/elfinder.jp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Japanese translation
* @author Tomoaki Yoshida <info@yoshida-studio.jp>
* @author Naoki Sawada <hypweb@gmail.com>
* @version 2016-09-10
* @version 2016-09-16
*/
if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') {
elFinder.prototype.i18.jp = {
Expand Down Expand Up @@ -362,9 +362,11 @@ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object'
'complete' : '$1 完了', // from v2.1.15 added 21.8.2016
'contextmenu' : 'コンテキストメニュー', // from v2.1.15 added 9.9.2016
'pageTurning' : 'ページめくり', // from v2.1.15 added 9.10.2016
'volumeRoots' : 'ボリュームルート', // from v2.1.16 added 16.10.2016

/********************************** mimetypes **********************************/
'kindUnknown' : '不明',
'kindRoot' : 'ボリュームルート', // from v2.1.16 added 16.10.2016
'kindFolder' : 'フォルダー',
'kindAlias' : '別名',
'kindAliasBroken' : '宛先不明の別名',
Expand Down

0 comments on commit 4f4049d

Please sign in to comment.