diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-02-07 17:08:50 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-09 13:31:50 +0100 |
commit | bb1d8b318964b5b778e4c381db2f9ff281164384 (patch) | |
tree | 363ad7483868749111c6ba96b09dcf3f99ae751a /core/src | |
parent | ac03f54079535fd9e047fbe3fbbe2a5768eb6e83 (diff) | |
download | nextcloud-server-bb1d8b318964b5b778e4c381db2f9ff281164384.tar.gz nextcloud-server-bb1d8b318964b5b778e4c381db2f9ff281164384.zip |
Remove deprecated global variables
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/OC/dialogs.js | 6 | ||||
-rw-r--r-- | core/src/OC/util.js | 1 | ||||
-rw-r--r-- | core/src/Util/format-date.js | 34 | ||||
-rw-r--r-- | core/src/Util/relative-modified-date.js | 39 | ||||
-rw-r--r-- | core/src/globals.js | 10 |
5 files changed, 3 insertions, 87 deletions
diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index cea857f6f2e..87b7728bdd9 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 1bb4ae9ead0..f8f7c05e6e8 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 9551804d4ab..00000000000 --- 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 4e41f939250..00000000000 --- 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 d4926e01845..1ceb4aacd85 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) /** |