diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index b987fa4e42b040547eabe4099ed18ce5817c9266..5aed0f60149dfb039f1f51608e65ebe1a7bbfb0e 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -18,7 +18,7 @@ * - TODO music upload button */ -/* global jQuery, humanFileSize, md5 */ +/* global jQuery, md5 */ /** * File upload object @@ -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()) }); } @@ -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); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 38b8dc549232610460fc10fe6944b151065a9d6c..2ca4185ec863ba91a3638758a5c19c10e97176c5 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -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)); diff --git a/core/js/dist/login.js b/core/js/dist/login.js index b1298c8ae4c9550815eb9a16d916db8a6edb54d7..59e88710a57420b88f03420cbb213fb4bf09ba6d 100644 Binary files a/core/js/dist/login.js and b/core/js/dist/login.js differ diff --git a/core/js/dist/login.js.map b/core/js/dist/login.js.map index a2e8731de7e547b86737a1fb2f23923300462dd9..5862426523224358470df2076fe006ac2c3244ff 100644 Binary files a/core/js/dist/login.js.map and b/core/js/dist/login.js.map differ diff --git a/core/js/dist/main.js b/core/js/dist/main.js index b2ffa2ec16e8b122a344f51d89c295870af6f315..a8f26109181a6e0b5c9db33b129cc885860689a4 100644 Binary files a/core/js/dist/main.js and b/core/js/dist/main.js differ diff --git a/core/js/dist/main.js.map b/core/js/dist/main.js.map index f90569c50348da63534159045b3ea7746af3c473..3c286ce6b54a5337c87ae6dd5decefca2df00f63 100644 Binary files a/core/js/dist/main.js.map and b/core/js/dist/main.js.map differ diff --git a/core/js/dist/maintenance.js b/core/js/dist/maintenance.js index 519a12c4589876a3d3f35da1ae1ae6952959c785..fcfd3021ccc7d81ef99bf5c72abc13252df87d66 100644 Binary files a/core/js/dist/maintenance.js and b/core/js/dist/maintenance.js differ diff --git a/core/js/dist/maintenance.js.map b/core/js/dist/maintenance.js.map index e016a104e70a6bcf5e8e9be390fe509084912b84..bb61fd66147e64d6f29dd0e97f9f5a1dc7134397 100644 Binary files a/core/js/dist/maintenance.js.map and b/core/js/dist/maintenance.js.map differ diff --git a/core/js/dist/recommendedapps.js b/core/js/dist/recommendedapps.js index 2907158723f89d5c8b92f6ae31997e3e7ea7d31b..1afe05eb249164d7ee4ca1088401bcef7b2ee674 100644 Binary files a/core/js/dist/recommendedapps.js and b/core/js/dist/recommendedapps.js differ diff --git a/core/js/dist/recommendedapps.js.map b/core/js/dist/recommendedapps.js.map index c116335953986650e0c8e7f5ccc2dcc0ca808fdd..f95c2de9e57c381e94126356f45939585d24cd24 100644 Binary files a/core/js/dist/recommendedapps.js.map and b/core/js/dist/recommendedapps.js.map differ diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index cea857f6f2ef27c1f5670895ac5295d92d12c96e..87b7728bdd9bc55eec7d4415fe6dd8795ae24692 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -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 @@ -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') diff --git a/core/src/OC/util.js b/core/src/OC/util.js index 1bb4ae9ead0ecdc5535e05462be185dd309b996e..f8f7c05e6e8cb25ca6722881cc8fc17257b7bf09 100644 --- a/core/src/OC/util.js +++ b/core/src/OC/util.js @@ -58,7 +58,6 @@ export default { History, - // TODO: remove original functions from global namespace humanFileSize, /** diff --git a/core/src/Util/format-date.js b/core/src/Util/format-date.js deleted file mode 100644 index 9551804d4abfe5df5702d6917229ee04465d3a2b..0000000000000000000000000000000000000000 --- a/core/src/Util/format-date.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// TODO: import Util directly: https://github.com/nextcloud/server/pull/13957 -import OC from '../OC/index' - -/** - * Format an UNIX timestamp to a human understandable format - * @param {number} timestamp UNIX timestamp - * @returns {string} Human readable format - * @deprecated 16.0.0 use OC.Util.formatDate instead - */ -export default function formatDate(timestamp) { - console.warn('formatDate is deprecated, use OC.Util.formatDate instead') - return OC.Util.formatDate(timestamp) -} diff --git a/core/src/Util/relative-modified-date.js b/core/src/Util/relative-modified-date.js deleted file mode 100644 index 4e41f939250776af74a4ddfb26778a05a8c9adb5..0000000000000000000000000000000000000000 --- a/core/src/Util/relative-modified-date.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// TODO: import Util directly: https://github.com/nextcloud/server/pull/13957 -import OC from '../OC/index' - -/** - * Takes an absolute timestamp and return a string with a human-friendly relative date - * - * @param {number} timestamp A Unix timestamp - * @deprecated use OC.Util.relativeModifiedDate instead but beware the argument value - * @returns {string} - */ -export default function relativeModifiedDate(timestamp) { - console.warn('relativeModifiedDate is deprecated, use OC.Util.relativeModifiedDate instead') - /* - Were multiplying by 1000 to bring the timestamp back to its original value - per https://github.com/owncloud/core/pull/10647#discussion_r16790315 - */ - return OC.Util.relativeModifiedDate(timestamp * 1000) -} diff --git a/core/src/globals.js b/core/src/globals.js index d4926e0184505001a7009a760120bb473e223959..1ceb4aacd85a96669bea472c1ba8bfec9fe05ed5 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -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' @@ -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) { @@ -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') @@ -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) /**