Remove deprecated global variables
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
ac03f54079
commit
bb1d8b3189
|
@ -18,7 +18,7 @@
|
||||||
* - TODO music upload button
|
* - TODO music upload button
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global jQuery, humanFileSize, md5 */
|
/* global jQuery, md5 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File upload object
|
* File upload object
|
||||||
|
@ -971,8 +971,8 @@ OC.Uploader.prototype = _.extend({
|
||||||
data.textStatus = 'notenoughspace';
|
data.textStatus = 'notenoughspace';
|
||||||
data.errorThrown = t('files',
|
data.errorThrown = t('files',
|
||||||
'Not enough free space, you are uploading {size1} but only {size2} is left', {
|
'Not enough free space, you are uploading {size1} but only {size2} is left', {
|
||||||
'size1': humanFileSize(selection.totalBytes),
|
'size1': OC.Util.humanFileSize(selection.totalBytes),
|
||||||
'size2': humanFileSize($('#free_space').val())
|
'size2': OC.Util.humanFileSize($('#free_space').val())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1171,9 +1171,9 @@ OC.Uploader.prototype = _.extend({
|
||||||
h = t('files', 'Uploading …');
|
h = t('files', 'Uploading …');
|
||||||
}
|
}
|
||||||
self._setProgressBarText(h, h, t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
|
self._setProgressBarText(h, h, t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
|
||||||
loadedSize: humanFileSize(data.loaded),
|
loadedSize: OC.Util.humanFileSize(data.loaded),
|
||||||
totalSize: humanFileSize(total),
|
totalSize: OC.Util.humanFileSize(total),
|
||||||
bitrate: humanFileSize(data.bitrate / 8) + '/s'
|
bitrate: OC.Util.humanFileSize(data.bitrate / 8) + '/s'
|
||||||
}));
|
}));
|
||||||
self._setProgressBarValue(progress);
|
self._setProgressBarValue(progress);
|
||||||
self.trigger('progressall', e, data);
|
self.trigger('progressall', e, data);
|
||||||
|
|
|
@ -1606,7 +1606,7 @@
|
||||||
|
|
||||||
// size column
|
// size column
|
||||||
if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) {
|
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
|
// rgb(118, 118, 118) / #767676
|
||||||
// min. color contrast for normal text on white background according to WCAG AA
|
// min. color contrast for normal text on white background according to WCAG AA
|
||||||
sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)), 2));
|
sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)), 2));
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -787,11 +787,11 @@ const Dialogs = {
|
||||||
$conflict.data('data', data)
|
$conflict.data('data', data)
|
||||||
|
|
||||||
$conflict.find('.filename').text(original.name)
|
$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))
|
$originalDiv.find('.mtime').text(formatDate(original.mtime))
|
||||||
// ie sucks
|
// ie sucks
|
||||||
if (replacement.size && replacement.lastModifiedDate) {
|
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))
|
$replacementDiv.find('.mtime').text(formatDate(replacement.lastModifiedDate))
|
||||||
}
|
}
|
||||||
var path = original.directory + '/' + original.name
|
var path = original.directory + '/' + original.name
|
||||||
|
@ -1164,7 +1164,7 @@ const Dialogs = {
|
||||||
entry.icon = OC.MimeType.getIconUrl(entry.mimetype)
|
entry.icon = OC.MimeType.getIconUrl(entry.mimetype)
|
||||||
var simpleSize, sizeColor
|
var simpleSize, sizeColor
|
||||||
if (typeof (entry.size) !== 'undefined' && entry.size >= 0) {
|
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))
|
sizeColor = Math.round(160 - Math.pow((entry.size / (1024 * 1024)), 2))
|
||||||
} else {
|
} else {
|
||||||
simpleSize = t('files', 'Pending')
|
simpleSize = t('files', 'Pending')
|
||||||
|
|
|
@ -58,7 +58,6 @@ export default {
|
||||||
|
|
||||||
History,
|
History,
|
||||||
|
|
||||||
// TODO: remove original functions from global namespace
|
|
||||||
humanFileSize,
|
humanFileSize,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
|
@ -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)
|
|
||||||
}
|
|
|
@ -42,7 +42,6 @@ import Handlebars from 'handlebars'
|
||||||
import 'jcrop/js/jquery.Jcrop'
|
import 'jcrop/js/jquery.Jcrop'
|
||||||
import 'jcrop/css/jquery.Jcrop.css'
|
import 'jcrop/css/jquery.Jcrop.css'
|
||||||
import jstimezonedetect from 'jstimezonedetect'
|
import jstimezonedetect from 'jstimezonedetect'
|
||||||
import marked from 'marked'
|
|
||||||
import md5 from 'blueimp-md5'
|
import md5 from 'blueimp-md5'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import 'select2'
|
import 'select2'
|
||||||
|
@ -55,11 +54,7 @@ import OC from './OC/index'
|
||||||
import OCP from './OCP/index'
|
import OCP from './OCP/index'
|
||||||
import OCA from './OCA/index'
|
import OCA from './OCA/index'
|
||||||
import escapeHTML from 'escape-html'
|
import escapeHTML from 'escape-html'
|
||||||
import formatDate from './Util/format-date'
|
|
||||||
import { getToken as getRequestToken } from './OC/requesttoken'
|
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() {
|
const warnIfNotTesting = function() {
|
||||||
if (window.TESTING === undefined) {
|
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('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('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')
|
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('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')
|
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['OCP'] = OCP
|
||||||
window['OCA'] = OCA
|
window['OCA'] = OCA
|
||||||
window['escapeHTML'] = deprecate(escapeHTML, 'escapeHTML', 19)
|
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)
|
$.fn.select2 = deprecate($.fn.select2, 'select2', 19)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue