diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-19 15:22:10 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-11-19 15:22:10 +0100 |
commit | 802e4a79d1d86a3f4ffdd253859c798b16d9ab1c (patch) | |
tree | 8fcf3cda5a1939aeceb23715b73012bbb7a5a67c | |
parent | 85a491a6fb497246e19316bd4d383e89c9fc42a5 (diff) | |
download | nextcloud-server-802e4a79d1d86a3f4ffdd253859c798b16d9ab1c.tar.gz nextcloud-server-802e4a79d1d86a3f4ffdd253859c798b16d9ab1c.zip |
JSUnit tests are not compatible with let/const yet
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r-- | apps/files/js/filelist.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 18e2b9beed6..3646b42dc6a 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2284,27 +2284,27 @@ // not overwrite it targetPath = targetPath + '/'; } - let targetPathAndName = targetPath + fileName; + var targetPathAndName = targetPath + fileName; if ((dir + fileName) === targetPathAndName) { - let dotIndex = targetPathAndName.indexOf("."); + var dotIndex = targetPathAndName.indexOf("."); if ( dotIndex > 1) { - let leftPartOfName = targetPathAndName.substr(0, dotIndex); - let fileNumber = leftPartOfName.match(/\d+/); + var leftPartOfName = targetPathAndName.substr(0, dotIndex); + var fileNumber = leftPartOfName.match(/\d+/); // TRANSLATORS name that is appended to copied files with the same name, will be put in parenthesis and appened with a number if it is the second+ copy - let copyNameLocalized = t('files', 'copy'); + var copyNameLocalized = t('files', 'copy'); if (isNaN(fileNumber) ) { fileNumber++; targetPathAndName = targetPathAndName.replace(/(?=\.[^.]+$)/g, " (" + copyNameLocalized + " " + fileNumber + ")"); } else { // Check if we have other files with 'copy X' and the same name - let maxNum = 1; + var maxNum = 1; if (self.files !== null) { leftPartOfName = leftPartOfName.replace("/", ""); leftPartOfName = leftPartOfName.replace(new RegExp("\\(" + copyNameLocalized + "( \\d+)?\\)"),""); // find the last file with the number extension and add one to the new name - for (let j = 0; j < self.files.length; j++) { - const cName = self.files[j].name; + for (var j = 0; j < self.files.length; j++) { + var cName = self.files[j].name; if (cName.indexOf(leftPartOfName) > -1) { if (cName.indexOf("(" + copyNameLocalized + ")") > 0) { targetPathAndName = targetPathAndName.replace(new RegExp(" \\(" + copyNameLocalized + "\\)"),""); @@ -2313,7 +2313,7 @@ } } else { - let cFileNumber = cName.match(new RegExp("\\(" + copyNameLocalized + " (\\d+)\\)")); + var cFileNumber = cName.match(new RegExp("\\(" + copyNameLocalized + " (\\d+)\\)")); if (cFileNumber && parseInt(cFileNumber[1]) >= maxNum) { maxNum = parseInt(cFileNumber[1]) + 1; } @@ -2324,7 +2324,7 @@ } // Create the new file name with _x at the end // Start from 2 per a special request of the 'standard' - let extensionName = " (" + copyNameLocalized + " " + maxNum +")"; + var extensionName = " (" + copyNameLocalized + " " + maxNum +")"; if (maxNum == 1) { extensionName = " (" + copyNameLocalized + ")"; } |