Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* - TODO music upload button
*/

/* global jQuery, humanFileSize, md5 */
/* global jQuery, md5 */

/**
* File upload object
Expand Down Expand Up @@ -971,8 +971,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': humanFileSize(selection.totalBytes),
'size2': humanFileSize($('#free_space').val())
'size1': OC.Util.humanFileSize(selection.totalBytes),
'size2': OC.Util.humanFileSize($('#free_space').val())
});
}

Expand Down Expand Up @@ -1171,9 +1171,9 @@ OC.Uploader.prototype = _.extend({
h = t('files', 'Uploading …');
}
self._setProgressBarText(h, h, t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
loadedSize: humanFileSize(data.loaded),
totalSize: humanFileSize(total),
bitrate: humanFileSize(data.bitrate / 8) + '/s'
loadedSize: OC.Util.humanFileSize(data.loaded),
totalSize: OC.Util.humanFileSize(total),
bitrate: OC.Util.humanFileSize(data.bitrate / 8) + '/s'
}));
self._setProgressBarValue(progress);
self.trigger('progressall', e, data);
Expand Down
2 changes: 1 addition & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@

// size column
if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) {
simpleSize = humanFileSize(parseInt(fileData.size, 10), true);
simpleSize = OC.Util.humanFileSize(parseInt(fileData.size, 10), true);
// 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));
Expand Down
64 changes: 32 additions & 32 deletions core/js/dist/login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/login.js.map

Large diffs are not rendered by default.

180 changes: 49 additions & 131 deletions core/js/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/main.js.map

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions core/js/dist/maintenance.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/maintenance.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/js/dist/recommendedapps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/recommendedapps.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions core/src/OC/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,11 @@ const Dialogs = {
$conflict.data('data', data)

$conflict.find('.filename').text(original.name)
$originalDiv.find('.size').text(humanFileSize(original.size))
$originalDiv.find('.size').text(OC.Util.humanFileSize(original.size))
$originalDiv.find('.mtime').text(formatDate(original.mtime))
// ie sucks
if (replacement.size && replacement.lastModifiedDate) {
$replacementDiv.find('.size').text(humanFileSize(replacement.size))
$replacementDiv.find('.size').text(OC.Util.humanFileSize(replacement.size))
$replacementDiv.find('.mtime').text(formatDate(replacement.lastModifiedDate))
}
var path = original.directory + '/' + original.name
Expand Down Expand Up @@ -1164,7 +1164,7 @@ const Dialogs = {
entry.icon = OC.MimeType.getIconUrl(entry.mimetype)
var simpleSize, sizeColor
if (typeof (entry.size) !== 'undefined' && entry.size >= 0) {
simpleSize = humanFileSize(parseInt(entry.size, 10), true)
simpleSize = OC.Util.humanFileSize(parseInt(entry.size, 10), true)
sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2))
} else {
simpleSize = t('files', 'Pending')
Expand Down
1 change: 0 additions & 1 deletion core/src/OC/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default {

History,

// TODO: remove original functions from global namespace
humanFileSize,

/**
Expand Down
34 changes: 0 additions & 34 deletions core/src/Util/format-date.js

This file was deleted.

39 changes: 0 additions & 39 deletions core/src/Util/relative-modified-date.js

This file was deleted.

10 changes: 0 additions & 10 deletions core/src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import Handlebars from 'handlebars'
import 'jcrop/js/jquery.Jcrop'
import 'jcrop/css/jquery.Jcrop.css'
import jstimezonedetect from 'jstimezonedetect'
import marked from 'marked'
import md5 from 'blueimp-md5'
import moment from 'moment'
import 'select2'
Expand All @@ -55,11 +54,7 @@ import OC from './OC/index'
import OCP from './OCP/index'
import OCA from './OCA/index'
import escapeHTML from 'escape-html'
import formatDate from './Util/format-date'
import { getToken as getRequestToken } from './OC/requesttoken'
import getURLParameter from './Util/get-url-parameter'
import humanFileSize from './Util/human-file-size'
import relativeModifiedDate from './Util/relative-modified-date'

const warnIfNotTesting = function() {
if (window.TESTING === undefined) {
Expand Down Expand Up @@ -114,7 +109,6 @@ window['dav'] = dav
setDeprecatedProp('DOMPurify', () => DOMPurify, 'The global DOMPurify is deprecated, this will be removed in Nextcloud 21')
setDeprecatedProp('Handlebars', () => Handlebars, 'please ship your own, this will be removed in Nextcloud 20')
setDeprecatedProp(['jstz', 'jstimezonedetect'], () => jstimezonedetect, 'please ship your own, this will be removed in Nextcloud 20')
window['marked'] = deprecate(marked, 'marked', 19)
setDeprecatedProp('md5', () => md5, 'please ship your own, this will be removed in Nextcloud 20')
setDeprecatedProp('moment', () => moment, 'please ship your own, this will be removed in Nextcloud 20')

Expand All @@ -133,10 +127,6 @@ setDeprecatedProp('OCDialogs', () => OC.dialogs, 'use OC.dialogs instead, this w
window['OCP'] = OCP
window['OCA'] = OCA
window['escapeHTML'] = deprecate(escapeHTML, 'escapeHTML', 19)
window['formatDate'] = deprecate(formatDate, 'formatDate', 19)
window['getURLParameter'] = deprecate(getURLParameter, 'getURLParameter', 19)
window['humanFileSize'] = deprecate(humanFileSize, 'humanFileSize', 19)
window['relative_modified_date'] = deprecate(relativeModifiedDate, 'relative_modified_date', 19)
$.fn.select2 = deprecate($.fn.select2, 'select2', 19)

/**
Expand Down