diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 29c5a49131..7ba650eb18 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1674,7 +1674,7 @@ c: fileData.etag }; var previewUrl = this.generatePreviewUrl(urlSpec); - previewUrl = previewUrl.replace('(', '%28').replace(')', '%29'); + previewUrl = previewUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'); iconDiv.css('background-image', 'url("' + previewUrl + '")'); } } @@ -2058,8 +2058,7 @@ } previewURL = self.generatePreviewUrl(urlSpec); - previewURL = previewURL.replace('(', '%28'); - previewURL = previewURL.replace(')', '%29'); + previewURL = previewURL.replace(/\(/g, '%28').replace(/\)/g, '%29'); // preload image to prevent delay // this will make the browser cache the image diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 3583019ef0..c9aeaa0b33 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -280,7 +280,7 @@ var OCdialogs = { self.$form.submit(); }); var newName = $input.val(); - lastPos = newName.lastIndexOf('.'); + var lastPos = newName.lastIndexOf('.'); if (lastPos === -1) { lastPos = newName.length; } diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 91101e47b2..a3d2568463 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -245,7 +245,7 @@ var $newShare = self.$el.find('li[data-share-id="'+newShareId+'"]'); // only open the menu by default if this is the first share if ($newShare && shares.length === 1) { - $menu = $newShare.find('.popovermenu'); + var $menu = $newShare.find('.popovermenu'); OC.showMenu(null, $menu); } } @@ -257,7 +257,7 @@ // password failure? Show error self.password = '' if (isPasswordEnforced && response && response.responseJSON && response.responseJSON.ocs.meta && response.responseJSON.ocs.meta.message) { - $input = self.$el.find('.pending #enforcedPassText') + var $input = self.$el.find('.pending #enforcedPassText') $input.tooltip('destroy'); $input.attr('title', response.responseJSON.ocs.meta.message); $input.tooltip({placement: 'bottom', trigger: 'manual'}); diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index eabcf2f3b2..ffb75f9d15 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -338,7 +338,7 @@ * build the result array that only contains all contact entries from * merged contacts, if the search term matches its contact name */ - for (i = 0; i < groupedLength; i++) { + for (var i = 0; i < groupedLength; i++) { if (typeof grouped[i].uuid !== 'undefined' && grouped[i].uuid === previousUuid) { grouped[i].merged = true; }