Now displaying Replaced text when successfully replaced

This commit is contained in:
mattpass
2021-07-01 21:13:30 +01:00
parent 7b97ff92ae
commit d92c3b00c3
2 changed files with 10 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ var ICEcoder = {
resultsLines: [], // Array of lines containing results (simpler version of results)
findResult: 0, // Array position of current find in results
findRegex: false, // If find attempts are done using regex
findUpdateMultiInfoID: [], // ID of multiple results modal elem to update & text, when rename/replace is successful
scrollbarVisible: false, // Indicates if the main pane has a scrollbar
mouseDown: false, // If the mouse is down
mouseDownInCM: false, // If the mouse is down within CodeMirror instance (can be false, 'editor' or 'gutter')
@@ -3596,8 +3597,15 @@ var ICEcoder = {
console.log(statusObj);
ICEcoder.serverMessage();
ICEcoder.serverQueue('del');
// Successful, process the requested action to take now
} else {
eval(statusObj.action.doNext);
// If we need to update the multiple results pane with new info now a task is done successfully
if (ICEcoder.findUpdateMultiInfoID[0]) {
get('multipleResultsIFrame').contentWindow.document.getElementById(ICEcoder.findUpdateMultiInfoID[0])
.innerHTML = ICEcoder.findUpdateMultiInfoID[1];
ICEcoder.findUpdateMultiInfoID = [];
}
}
// Some other response? Display a message about that
} else {

View File

@@ -266,9 +266,10 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
const renameSingle = function(arrayRef) {
fileRef = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "");
const rExp = new RegExp(true === parent.ICEcoder.findRegex ? findText : parent.ICEcoder.escapeRegex(findText), "gi");
// TODO: get this working
// TODO: get this working with regex
newName = spansArray[arrayRef].id.replace(/\|/g, "/").replace(/_perms/g, "").replace(rExp, "<?php if (isset($_GET['replace'])) {echo xssClean($_GET['replace'], 'script');}; ?>");
parent.ICEcoder.renameFile(fileRef,newName);
parent.ICEcoder.findUpdateMultiInfoID = ['foundCount' + arrayRef, 'Renamed'];
};
const renameAll = function() {