aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-10-04 08:44:57 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-10-04 08:44:57 +0200
commitd59151025366d11e3baa7fd16c2d987ba5a227a6 (patch)
tree0bda16530ed93da59642619ddcf2268d649d165e /apps
parentd79e26b25a4a5f3e692439d9ab913f0e078a7785 (diff)
downloadnextcloud-server-d59151025366d11e3baa7fd16c2d987ba5a227a6.tar.gz
nextcloud-server-d59151025366d11e3baa7fd16c2d987ba5a227a6.zip
fix(files): legacy humanFileSize tests
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/file-upload.js10
-rw-r--r--apps/files/js/filelist.js8
-rw-r--r--apps/files/js/files.js6
-rw-r--r--apps/files/js/filesummary.js4
-rw-r--r--apps/files/js/mainfileinfodetailview.js2
5 files changed, 15 insertions, 15 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 61bd53eb35f..0301c1fe6ac 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -1063,8 +1063,8 @@ OC.Uploader.prototype = _.extend({
data.textStatus = 'notenoughspace';
data.errorThrown = t('files',
'Not enough free space, you are uploading {size1} but only {size2} is left', {
- 'size1': OC.Util.humanFileSize(selection.totalBytes),
- 'size2': OC.Util.humanFileSize(freeSpace)
+ 'size1': OC.Util.humanFileSize(selection.totalBytes, false, false),
+ 'size2': OC.Util.humanFileSize(freeSpace, false, false)
});
}
@@ -1302,9 +1302,9 @@ OC.Uploader.prototype = _.extend({
}
self._setProgressBarText(h, h, t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
- loadedSize: OC.Util.humanFileSize(data.loaded),
- totalSize: OC.Util.humanFileSize(total),
- bitrate: OC.Util.humanFileSize(smoothBitrate / 8) + '/s'
+ loadedSize: OC.Util.humanFileSize(data.loaded, false, false),
+ totalSize: OC.Util.humanFileSize(total, false, false),
+ bitrate: OC.Util.humanFileSize(smoothBitrate / 8, false, false) + '/s'
}));
self._setProgressBarValue(progress);
self.trigger('progressall', e, data);
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index cfc21e909c0..7f5eade84ff 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1798,7 +1798,7 @@
// size column
if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) {
- simpleSize = OC.Util.humanFileSize(parseInt(fileData.size, 10), true);
+ simpleSize = OC.Util.humanFileSize(parseInt(fileData.size, 10), true, false);
// rgb(118, 118, 118) / #767676
// min. color contrast for normal text on white background according to WCAG AA
sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)), 2));
@@ -2609,7 +2609,7 @@
var oldSize = oldFile.data('size');
var newSize = oldSize + newFile.data('size');
oldFile.data('size', newSize);
- oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize));
+ oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize, false, false));
self.remove(fileName);
}
@@ -2752,7 +2752,7 @@
var oldSize = oldFile.data('size');
var newSize = oldSize + newFile.data('size');
oldFile.data('size', newSize);
- oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize));
+ oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize, false, false));
}
self.reload();
})
@@ -3463,7 +3463,7 @@
}
else {
this.$el.find('.selectedActions').removeClass('hidden');
- this.$el.find('.column-size a>span:first').text(OC.Util.humanFileSize(summary.totalSize));
+ this.$el.find('.column-size a>span:first').text(OC.Util.humanFileSize(summary.totalSize, false, false));
var directoryInfo = n('files', '%n folder', '%n folders', summary.totalDirs);
var fileInfo = n('files', '%n file', '%n files', summary.totalFiles);
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 486e437a8aa..88a762ca9c7 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -101,8 +101,8 @@
&& response.data.total !== undefined
&& response.data.used !== undefined
&& response.data.usedSpacePercent !== undefined) {
- var humanUsed = OC.Util.humanFileSize(response.data.used, true);
- var humanTotal = OC.Util.humanFileSize(response.data.total, true);
+ var humanUsed = OC.Util.humanFileSize(response.data.used, true, false);
+ var humanTotal = OC.Util.humanFileSize(response.data.total, true, false);
if (response.data.quota > 0) {
$('#quota').attr('title', t('files', '{used}%', {used: Math.round(response.data.usedSpacePercent)}));
$('#quota progress').val(response.data.usedSpacePercent);
@@ -425,7 +425,7 @@ var createDragShadow = function(event) {
.attr('data-file', elem.name)
.attr('data-origin', elem.origin);
newtr.append($('<td class="filename"></td>').text(elem.name).css('background-size', 32));
- newtr.append($('<td class="size"></td>').text(OC.Util.humanFileSize(elem.size)));
+ newtr.append($('<td class="size"></td>').text(OC.Util.humanFileSize(elem.size, false, false)));
tbody.append(newtr);
if (elem.type === 'dir') {
newtr.find('td.filename')
diff --git a/apps/files/js/filesummary.js b/apps/files/js/filesummary.js
index 00f13249ff3..0e9b191510a 100644
--- a/apps/files/js/filesummary.js
+++ b/apps/files/js/filesummary.js
@@ -226,7 +226,7 @@
$dirInfo.html(n('files', '%n folder', '%n folders', this.summary.totalDirs));
$fileInfo.html(n('files', '%n file', '%n files', this.summary.totalFiles));
$hiddenInfo.html(' (' + n('files', 'including %n hidden', 'including %n hidden', this.summary.totalHidden) + ')');
- var fileSize = this.summary.sumIsPending ? t('files', 'Pending') : OC.Util.humanFileSize(this.summary.totalSize);
+ var fileSize = this.summary.sumIsPending ? t('files', 'Pending') : OC.Util.humanFileSize(this.summary.totalSize, false, false);
this.$el.find('.filesize').html(fileSize);
// Show only what's necessary (may be hidden)
@@ -263,7 +263,7 @@
// don't show the filesize column, if filesize is NaN (e.g. in trashbin)
var fileSize = '';
if (!isNaN(summary.totalSize)) {
- fileSize = summary.sumIsPending ? t('files', 'Pending') : OC.Util.humanFileSize(summary.totalSize);
+ fileSize = summary.sumIsPending ? t('files', 'Pending') : OC.Util.humanFileSize(summary.totalSize, false, false);
fileSize = '<td class="filesize">' + fileSize + '</td>';
}
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js
index b5093e5c251..45988a60a02 100644
--- a/apps/files/js/mainfileinfodetailview.js
+++ b/apps/files/js/mainfileinfodetailview.js
@@ -156,7 +156,7 @@
path: this.model.get('path'),
hasSize: this.model.has('size'),
sizeLabel: t('files', 'Size'),
- size: OC.Util.humanFileSize(this.model.get('size'), true),
+ size: OC.Util.humanFileSize(this.model.get('size'), true, false),
altSize: n('files', '%n byte', '%n bytes', this.model.get('size')),
dateLabel: t('files', 'Modified'),
altDate: OC.Util.formatDate(this.model.get('mtime')),