From eb3adee9fc1ff254d4ec2a0808162029c3cb07df Mon Sep 17 00:00:00 2001 From: mattpass Date: Fri, 19 Jun 2020 10:06:42 +0100 Subject: [PATCH] Find & replace on filenames now working and case insensitive --- lib/multiple-results.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/multiple-results.php b/lib/multiple-results.php index 702555e..02e9e84 100644 --- a/lib/multiple-results.php +++ b/lib/multiple-results.php @@ -243,7 +243,8 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena const renameSingle = function(arrayRef) { fileRef = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, ""); - newName = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "").replace(find, ""); + const rExp = new RegExp(findText, "gi"); + newName = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "").replace(rExp, ""); parent.ICEcoder.renameFile(fileRef,newName); }; @@ -270,7 +271,7 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena parent.document.getElementById('results').style.display = 'inline-block'; // Action the find and then focus on find input box setTimeout(function() { - parent.ICEcoder.findReplace(parent.document.getElementById('find').value, true, false, false); + parent.ICEcoder.findReplace(findText, true, false, false); parent.document.getElementById("find").focus(); }, 0); };