From 2e601a4ccc32c200143a0bbc0006f5f1bf2c0b42 Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Mon, 16 Feb 2015 13:15:16 +0300 Subject: [PATCH 01/20] do not add openCloseDir onclick handler (which loads folder contents) for files. Files are not folders and this handler only causes problems overlapping with doubleClick handler sometimes. --- lib/get-branch.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/get-branch.php b/lib/get-branch.php index dd6cdae..d451991 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -152,7 +152,15 @@ for ($i=0;$i        ".xssClean(basename($fileFolderName),"html")." "; + echo "
  •         ".xssClean(basename($fileFolderName),"html")." "; $thisPermVal = $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : ''; $permColors = $thisPermVal == 777 ? 'background: #800; color: #eee' : 'color: #888'; echo ''; From ae37460e92ca4ab6cc641cf28032fe8c5d1c3281 Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Mon, 16 Feb 2015 13:18:32 +0300 Subject: [PATCH 02/20] Preserve line endings when editing existing file. --- lib/file-control-xhr.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/file-control-xhr.php b/lib/file-control-xhr.php index e4c517a..56cff8e 100644 --- a/lib/file-control-xhr.php +++ b/lib/file-control-xhr.php @@ -153,12 +153,25 @@ if (!$error && $_GET['action']=="save") { if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) { // Newly created files have the perms set too $setPerms = (!file_exists($file)) ? true : false; + // get old file contents, if file exists, and count stats on usage \n and \r there + // in this case we can keep line endings, which file had before, without + // making code version control systems going crazy about line endings change in whole file. + $oldContents = file_exists($file)?file_get_contents($file):''; + $unixNewLines = preg_match_all('/[^\r][\n]/u', $oldContents); + $windowsNewLines = preg_match_all('/[\r][\n]/u', $oldContents); $fh = fopen($file, 'w') or die($t['Sorry, cannot save']); // replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding $contents = $_POST['contents']; $contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents); $contents = str_replace("\r", $ICEcoder["lineEnding"], $contents); $contents = str_replace("\n", $ICEcoder["lineEnding"], $contents); + if (($unixNewLines > 0) || ($windowsNewLines > 0)){ + if ($unixNewLines > $windowsNewLines){ + $contents = str_replace($ICEcoder["lineEnding"], "\n", $contents); + } elseif ($windowsNewLines > $unixNewLines){ + $contents = str_replace($ICEcoder["lineEnding"], "\r\n", $contents); + } + } // Now write that content, close the file and clear the statcache fwrite($fh, $contents); fclose($fh); From db3130f911afea6f4d854db0f7dc667a9004a2fc Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Mon, 16 Feb 2015 14:01:11 +0300 Subject: [PATCH 03/20] when Ctrl-F - select text in find text input in order to make user able to enter new text right away, without need to remove old text first --- lib/ice-coder.js | 4 +++- lib/ice-coder.min.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index f186327..7fad030 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -3105,7 +3105,9 @@ var ICEcoder = { // CTRL/Cmd+F (Find) } else if(key==70 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { - top.get('find').focus(); + var find = top.get('find'); + find.select(); + find.focus(); return false; // CTRL/Cmd+G (Go to line) diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 17fe071..d645ebd 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -142,9 +142,9 @@ c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b= 0;e Date: Tue, 17 Feb 2015 09:15:15 +0300 Subject: [PATCH 04/20] 2 things about "Ctrl-F" find: 1. if there is some selection - in the code window - put it into the search box straight away 2. tweak for Chrome - somewhy it had problem with using Ctrl-F more then once --- lib/ice-coder.js | 13 +++++++++++++ lib/ice-coder.min.js | 22 +++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 7fad030..5c73b84 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -3106,7 +3106,20 @@ var ICEcoder = { // CTRL/Cmd+F (Find) } else if(key==70 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { var find = top.get('find'); + cM = ICEcoder.getcMInstance(); + cMdiff = ICEcoder.getcMdiffInstance(); + thisCM = top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? cMdiff : cM; + var selections = thisCM.getSelections(); + if (selections.length > 0){ + if (selections[0].length > 0){ + find.value = selections[0]; + } + } find.select(); + // this is trick for Chrome - after you have used Ctrl-F once, when + // you try using Ctrl-F another time, somewhy Chrome still thinks, + // that find has focus and refuses to give it focus second time. + top.get('goToLineNo').focus(); find.focus(); return false; diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index d645ebd..a4a297f 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -140,14 +140,14 @@ c).style.left=a>=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.savedPoints,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var f=0;f Date: Fri, 20 Feb 2015 23:40:47 +0300 Subject: [PATCH 05/20] indentAuto - make configurable --- editor.php | 29 ++++++++++++++++++++++++++++- index.php | 1 + lang/chinese-simplified.php | 3 ++- lang/chinese-traditional.php | 3 ++- lang/dutch.php | 1 + lang/english.php | 1 + lang/french.php | 3 ++- lang/german.php | 3 ++- lang/italian.php | 1 + lang/norwegian.php | 1 + lang/persian.php | 3 ++- lang/portuguese_brazilian.php | 1 + lib/config___users-template.php | 1 + lib/ice-coder.js | 30 +++++++++++++++++++----------- lib/ice-coder.min.js | 28 ++++++++++++++-------------- lib/settings-screen.php | 16 +++++++++++++--- lib/settings-update.php | 5 +++-- 17 files changed, 94 insertions(+), 36 deletions(-) diff --git a/editor.php b/editor.php index 1448d8b..7d1e578 100644 --- a/editor.php +++ b/editor.php @@ -166,7 +166,18 @@ h2 {color: rgba(0,198,255,0.7)} "; + echo ""; } ?> \ No newline at end of file From 9f408abb349f275ce7ed02c2fd1db77c6c089581 Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Fri, 20 Feb 2015 23:49:02 +0300 Subject: [PATCH 06/20] allow Ctrl-O + enter filename with line number (captured from log or exception trace) - to go straight to the line --- lang/english.php | 2 +- lib/file-control.php | 5 ++- lib/ice-coder.js | 26 +++++++++++- lib/ice-coder.min.js | 97 ++++++++++++++++++++++---------------------- 4 files changed, 77 insertions(+), 53 deletions(-) diff --git a/lang/english.php b/lang/english.php index 55c6be9..0dd058c 100644 --- a/lang/english.php +++ b/lang/english.php @@ -252,7 +252,7 @@ $text = array( "Creating Folder" => "Creating Folder", "Sorry you can..." => "Sorry, you can only have 100 files open at a time!", "Opening File" => "Opening File", - "Enter relative file..." => "Enter relative file path (prefixed with /) or remote URL", + "Enter relative file..." => "Enter relative file path (prefixed with /) or remote URL\\nYou can enter \\n'/path/file:123' or \\n'/path/file(123)' or \\n'/path/file.ext line 123' \\nto go directly to particular line", "Getting" => "Getting", "Please enter the..." => "Please enter the new name for", "Renaming to" => "Renaming to", diff --git a/lib/file-control.php b/lib/file-control.php index 06912a2..d7be68a 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -1,4 +1,4 @@ --1?"brace":"xml",null,"+","-",true)(cM, i); } top.ICEcoder.loadingFile = false; + top.ICEcoder.goToLine(); diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 12ac7e0..e392bc1 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1151,6 +1151,22 @@ var ICEcoder = { // Open a file openFile: function(fileLink) { var shortURL, canOpenFile; + var line = 1; + if ("undefined" != typeof fileLink) { + var re = /^(.*)\s+line\s+(\d+)/; + var reMatch = re.exec(fileLink); + if (null !== reMatch) + { + line = reMatch[2]; + fileLink = reMatch[1]; + } else if (fileLink.indexOf(':') > 0){ + line = fileLink.split(':')[1]; + fileLink = fileLink.split(':')[0]; + } else if ((fileLink.indexOf('(') > 0) && (fileLink.indexOf(')') > 0)){ + line = fileLink.split('(')[1].split(')')[0]; + fileLink = fileLink.split('(')[0]; + } + } if (fileLink) { top.ICEcoder.thisFileFolderLink=fileLink; @@ -1176,7 +1192,7 @@ var ICEcoder = { if (shortURL!="/[NEW]") { top.ICEcoder.thisFileFolderLink = top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"); - top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf); + top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+line); top.ICEcoder.serverMessage(''+top.t['Opening File']+'
    '+top.ICEcoder.shortURL); } else { top.ICEcoder.createNewTab('new'); @@ -3133,7 +3149,13 @@ var ICEcoder = { // CTRL/Cmd+G (Go to line) } else if(key==71 && (evt.ctrlKey||top.ICEcoder.cmdKey)) { - top.get('goToLineNo').focus(); + var goToLineInput = top.get('goToLineNo'); + goToLineInput.select(); + // this is trick for Chrome - after you have used Ctrl-F once, when + // you try using Ctrl-F another time, somewhy Chrome still thinks, + // that find has focus and refuses to give it focus second time. + top.get('find').focus(); + goToLineInput.focus(); return false; // CTRL/Cmd+I (Get info) diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 8e36adf..942bffe 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -47,46 +47,47 @@ top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selec b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},boxSelect:function(a,b){var c,d;c=top.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast="");top.ICEcoder.mouseDown&&"drag"==b&&(top.ICEcoder.fmDraggedBox=!0, d=0"+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b;a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file"); -"/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message(top.t["Sorry you can..."]),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g, -"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf),top.ICEcoder.serverMessage(""+top.t["Opening File"]+"
    "+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0"+top.t.Saving+"
    "+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length- -1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1
    ', -c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1"+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^(.*)\s+line\s+(\d+)/.exec(a),null!==b?(c= +b[2],a=b[1]):0"+top.t["Opening File"]+"
    "+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView", +1)))},openFilesFromList:function(a){for(var b=0;b"+ +top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0"+top.t.Saving+"
    "+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title= -b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0"+top.t["Deleting File"]+"
    "+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
    "+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a); -"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;ac&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity= -"1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,f,e,g){var k,h,l,p,n,m,t;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//", -"/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='        '+c+' '+d+"";if(3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m, -l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(h=0;hc||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=k;m.draggable=!1;m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragend=function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length- -1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,l.childNodes[h+1]));break}"file"!=g||e||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(e=f.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g, -"|")+"|"+c+"_perms");"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",f.substr(0,f.lastIndexOf("/")),c));"chmod"==a&&(e=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.style.background=777==d?"#800":"none",h.style.color=777==d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"), -b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity= -"1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"== -ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value== -top.t.and?"inline-block":"none"},findReplace:function(a,b,c){var d,f,e,g;a=a.toLowerCase();d=top.get("replace").value;f=top.get("results");e=ICEcoder.getcMInstance();g=ICEcoder.getcMdiffInstance();if((e=-1ICEcoder.results.length-1&&(ICEcoder.findResult=0);f.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";b=e.getSearchCursor(a,e.getCursor(),!0);b.findNext();b.from()||(b=e.getSearchCursor(a, -{line:0,ch:0},!0),b.findNext());e.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/e.lineCount():e.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?0:e.heightAtLine(0);f="";for(d=1;d<=e.lineCount();d++)c=-1';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=f;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}f.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=a&&c?(f=b=e="",document.findAndReplace.connector.value== -top.t.and&&(e="&replace="+d),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(f="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(f.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none")},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|"));top.ICEcoder.serverMessage(""+ -top.t["Replacing text in"]+"
    "+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1=a||10<=a)&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-parseInt(top.ICEcoder.files.style.width,10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX").replace(/\<\/b\>/g,"").replace(/\<br\>/g,"
    "),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1: -0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1d.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"), -b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='



    '; +b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1', +c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g, +"\n");0"+top.t["Deleting File"]+"
    "+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
    "+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){var b; +top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a, +b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;ac&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,f,e,g){var k,h,l,p,n,m,t;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot, +"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='        '+c+' '+d+"";if(3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")? +top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(h=0;hc||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className= +k;m.draggable=!1;m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragend=function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,l.childNodes[h+1]));break}"file"!=g||e||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab- +1]=b+c)}"rename"==a&&(e=f.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",f.substr(0,f.lastIndexOf("/")),c));"chmod"==a&& +(e=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.style.background=777==d?"#800":"none",h.style.color=777==d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode, +top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b|| +93==b)top.ICEcoder.cmdKey=!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey? +(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,b,c){var d,f,e,g;a=a.toLowerCase();d=top.get("replace").value;f=top.get("results");e=ICEcoder.getcMInstance(); +g=ICEcoder.getcMdiffInstance();if((e=-1ICEcoder.results.length-1&&(ICEcoder.findResult=0);f.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";b=e.getSearchCursor(a,e.getCursor(),!0);b.findNext();b.from()||(b=e.getSearchCursor(a,{line:0,ch:0},!0),b.findNext());e.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/e.lineCount(): +e.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?0:e.heightAtLine(0);f="";for(d=1;d<=e.lineCount();d++)c=-1';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=f;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display= +"inline-block";return!0}f.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=a&&c?(f=b=e="",document.findAndReplace.connector.value==top.t.and&&(e="&replace="+d),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&& +(f="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(f.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display= +"none")},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|"));top.ICEcoder.serverMessage(""+top.t["Replacing text in"]+"
    "+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1=a||10<=a)&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-parseInt(top.ICEcoder.files.style.width,10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown|| +(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX").replace(/\<\/b\>/g,"").replace(/\<br\>/g,"
    "),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1d.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&& +(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='



    '; farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,f,e,g,k,h,l,p,n;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;f=a.pageY-this.offsetTop;e=b.getImageData(d,f,1,1).data;g=e[0];k=e[1];h=e[2];l=g+","+k+","+h;p=top.ICEcoder.rgbToHex(g, k,h);top.get("rgbMouseXY").value=l;top.get("hexMouseXY").value="#"+p;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+p;n=128>g||128>k||128>h&&200>g&&200>k&&50 Date: Fri, 20 Feb 2015 23:49:54 +0300 Subject: [PATCH 07/20] minor tweaks: treat XML as editable file use htmlentities to escape textarea content --- lib/file-control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/file-control.php b/lib/file-control.php index d7be68a..0e07ba9 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -82,11 +82,11 @@ if ($_GET['action']=="load") { if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";}; if (array_search($fileExt,array("doc","docx","ppt","rtf","pdf","zip","tar","gz","swf","asx","asf","midi","mp3","wav","aiff","mov","qt","wmv","mp4","odt","odg","odp"))!==false) {$finfo = "other";}; } - if (strpos($finfo,"text")===0 || strpos($finfo,"empty")!==false) { + if (strpos($finfo,"text")===0 || strpos($finfo, "application/xml")===0 || strpos($finfo,"empty")!==false) { echo 'fileType="text";'; echo 'top.ICEcoder.shortURL = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";'; $loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true); - echo '","",str_replace("&","&",$loadedFile)).' + diff --git a/index.php b/index.php index 1eeb6b9..7206d19 100644 --- a/index.php +++ b/index.php @@ -40,6 +40,9 @@ $isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false; ICEcoder v <?php echo $ICEcoder["versionNo"];?> + From a488c19d61137250c54c1ed52d71f505e674ac43 Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Mon, 23 Feb 2015 01:29:28 +0300 Subject: [PATCH 14/20] Prompt when F5 (Ctrl-R) is pressed. It is common thing to refresh page after you have made some tweaks, and it is common thing to refresh wrong page and even although everything is saved and tabs will reopen - you will loose opened folders in fileManager and cursor positions in open files. So it's better to prompt anyway. --- index.php | 1 + lang/chinese-simplified.php | 1 + lang/chinese-traditional.php | 1 + lang/dutch.php | 1 + lang/english.php | 17 +++++++++++++++-- lang/french.php | 1 + lang/german.php | 1 + lang/italian.php | 1 + lang/norwegian.php | 1 + lang/persian.php | 1 + lang/portuguese_brazilian.php | 1 + lang/spanish.php | 1 + 12 files changed, 26 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 7206d19..f7fc4f6 100644 --- a/index.php +++ b/index.php @@ -57,6 +57,7 @@ window.onbeforeunload = function() { return "."; } } + return ""; } t = { diff --git a/lang/chinese-simplified.php b/lang/chinese-simplified.php index 2797a5a..22b46e6 100644 --- a/lang/chinese-simplified.php +++ b/lang/chinese-simplified.php @@ -49,6 +49,7 @@ $text = array( "Your version is" => "你的版本是", "Update now" => "现在更新", "You have some..." => "你有一些未保存的更改", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "载入中", "Color picker" => "颜色选择器", "New File" => "新建文件", diff --git a/lang/chinese-traditional.php b/lang/chinese-traditional.php index 231ea46..da39aa7 100644 --- a/lang/chinese-traditional.php +++ b/lang/chinese-traditional.php @@ -49,6 +49,7 @@ $text = array( "Your version is" => "你的版本是", "Update now" => "現在更新", "You have some..." => "你有一些未保存的更改", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "裝載中", "Color picker" => "顔色選擇器", "New File" => "新建文件", diff --git a/lang/dutch.php b/lang/dutch.php index 0b140bb..dfa441e 100644 --- a/lang/dutch.php +++ b/lang/dutch.php @@ -51,6 +51,7 @@ in lib/config__settings.php", "Your version is" => "Uw versie is", "Update now" => "Nu updaten", "You have some..." => "Er zijn wijzigingen die niet opgeslagen zijn", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "bezig", "Color picker" => "Kleuren kiezer", "New File" => "Nieuw bestand", diff --git a/lang/english.php b/lang/english.php index 0dd058c..5c30e52 100644 --- a/lang/english.php +++ b/lang/english.php @@ -48,6 +48,7 @@ $text = array( "Your version is" => "Your version is", "Update now" => "Update now", "You have some..." => "You have some unsaved changes", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "working", "Color picker" => "Color picker", "New File" => "New File", @@ -431,7 +432,19 @@ $text = array( "updater" => array( "Update appears to..." => "Update appears to be successful" - ) - + ), + + "find-in-files" => + array( + "Enter path to search in" => "Enter path to search in", + "Enter semicolon-separated masks of files to look at (e.g. *.php;*.html;*.js)" => "Enter semicolon-separated masks of files to look at (e.g. *.php;*.html;*.js)", + "Type of text" => "Type of text", + "Fixed text" => "Fixed text", + "Regular expression" => "Regular expression", + "Case sensitive" => "Case sensitive", + "Yes" => "Yes", + "No" => "No", + "Search" => "Search", + ), ); ?> \ No newline at end of file diff --git a/lang/french.php b/lang/french.php index 44b75b1..63a576c 100644 --- a/lang/french.php +++ b/lang/french.php @@ -48,6 +48,7 @@ dans lib/config__settings.php", "Your version is" => "Votre version est la", "Update now" => "Mettre à jour maintenant", "You have some..." => "Vous avez quelques changements non sauvegardés", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "en progression", "Color picker" => "Sélecteur de couleur", "New File" => "Nouveau fichier", diff --git a/lang/german.php b/lang/german.php index 7e67223..940b450 100644 --- a/lang/german.php +++ b/lang/german.php @@ -49,6 +49,7 @@ $text = array( "Your version is" => "Deine Version ist", "Update now" => "Jetzt aktualisieren", "You have some..." => "Du hast einige nicht gespeicherete Dateien", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "arbeite", "Color picker" => "Farbauswahl", "New File" => "Neue Datei", diff --git a/lang/italian.php b/lang/italian.php index 05215d1..8dd7681 100644 --- a/lang/italian.php +++ b/lang/italian.php @@ -48,6 +48,7 @@ $text = array( "Your version is" => "La tua versione Egrave;", "Update now" => "Aggiorna ora", "You have some..." => "Ci sono modifiche non salvate", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "working", "Color picker" => "Selettore di colore", "New File" => "Nuovo file", diff --git a/lang/norwegian.php b/lang/norwegian.php index 66069c5..8da2293 100644 --- a/lang/norwegian.php +++ b/lang/norwegian.php @@ -49,6 +49,7 @@ $text = array( "Your version is" => "Din versjon er", "Update now" => "Oppdater n", "You have some..." => "Du har noe ulagrede endringer", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "arbeider", "Color picker" => "Fargevelger", "New File" => "Ny Fil", diff --git a/lang/persian.php b/lang/persian.php index 6712d73..e369f08 100644 --- a/lang/persian.php +++ b/lang/persian.php @@ -49,6 +49,7 @@ $text = array( "Your version is" => "نسخه مورد استفاده شما", "Update now" => "به روز کنید", "You have some..." => "شما چند تغییر ذخیره نشده دارید", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "در حال کار", "Color picker" => "اشاره گر رنگ", "New File" => "فایل جدید", diff --git a/lang/portuguese_brazilian.php b/lang/portuguese_brazilian.php index 69a5697..5b5889f 100644 --- a/lang/portuguese_brazilian.php +++ b/lang/portuguese_brazilian.php @@ -48,6 +48,7 @@ $text = array( "Your version is" => "Sua verso ", "Update now" => "Atualizar j", "You have some..." => "Voce possui alteraes no salvas", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "trabalhando", "Color picker" => "Color picker", "New File" => "Novo Arquivo", diff --git a/lang/spanish.php b/lang/spanish.php index 4c8ac80..467dc6e 100644 --- a/lang/spanish.php +++ b/lang/spanish.php @@ -47,6 +47,7 @@ $text = array( "Your version is" => "Su versión es", "Update now" => "Actualizar ahora", "You have some..." => "Usted tiene cambios sin guardar", + "Are you sure you want to close?" => "Are you sure you want to close?", "working" => "trabajando", "Color picker" => "Selector de color", "New File" => "Nuevo archivo", From ba634bbeeddeaeda54774a0957ad868ae2341503 Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Mon, 23 Feb 2015 01:51:20 +0300 Subject: [PATCH 15/20] fix to isPathFolder function --- lib/ice-coder.js | 14 ++++++++++++-- lib/ice-coder.min.js | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index c5e6c96..1135783 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1407,9 +1407,19 @@ var ICEcoder = { // let's enumerate all folders to find whether clicked file is a folder or not var dir = top.filesFrame.contentDocument.getElementsByClassName("pft-directory"); var thisFileId = top.ICEcoder.selectedFiles[0]; + var liNode, aNode, spanNode; for (var i = 0 ; i < dir.length; i++){ - if (thisFileId === dir[i].childNodes[0].childNodes[1].getAttribute('id')){ - return true; + liNode = dir[i]; + if ("underfined" != typeof liNode){ + aNode = liNode.childNodes[0]; + if ("undefined" != typeof aNode){ + spanNode = aNode.childNodes[1]; + if ("undefined" != typeof spanNode){ + if (thisFileId === spanNode.getAttribute('id')){ + return true; + } + } + } } } return false; diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 5418def..bc95b89 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -60,9 +60,9 @@ a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\ pasteFiles:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b"+top.t["Pasting File"]+"
    "+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])}, duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(), event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;ac&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity= +top.get(b)),top.get(b+"Nav").style.color="#fff",get("fileOptions").style.opacity=1)},isPathFolder:function(a){a=top.filesFrame.contentDocument.getElementsByClassName("pft-directory");for(var b=top.ICEcoder.selectedFiles[0],c,d=0;dc&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity= "1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,f,e,g){var k,h,l,p,n,m,t;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//", "/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='        '+c+' '+d+"";if(3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m, From f278394346e253493e8de17508fbde9241a8f0bb Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Tue, 24 Feb 2015 18:12:02 +0300 Subject: [PATCH 16/20] When Esc is used within Find window - return to text editor --- index.php | 2 +- lib/ice-coder.js | 6 ++- lib/ice-coder.min.js | 114 +++++++++++++++++++++---------------------- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/index.php b/index.php index f7fc4f6..62413a5 100644 --- a/index.php +++ b/index.php @@ -266,7 +266,7 @@ $t = $text['index'];
    - +

    '; -farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,f,e,g,k,h,l,p,n;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;f=a.pageY-this.offsetTop;e=b.getImageData(d,f,1,1).data;g=e[0];k=e[1];h=e[2];l=g+","+k+","+h;p=top.ICEcoder.rgbToHex(g, +farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,e,f,g,k,h,l,p,n;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;e=a.pageY-this.offsetTop;f=b.getImageData(d,e,1,1).data;g=f[0];k=f[1];h=f[2];l=g+","+k+","+h;p=top.ICEcoder.rgbToHex(g, k,h);top.get("rgbMouseXY").value=l;top.get("hexMouseXY").value="#"+p;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+p;n=128>g||128>k||128>h&&200>g&&200>k&&50'+top.t["Cancelled tasks"]+"");setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g, "").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf)},autoOpenFiles:function(){if(0';top.ICEcoder.showHide("show", top.get("blackMask"))},githubTokenAsk:function(a){if(githubAuthToken=top.ICEcoder.getInput(top.t["Please enter your..."],""))top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/github.php?action=auth&token="+githubAuthToken+"&goNext="+a+"&csrf="+top.ICEcoder.csrf,githubAuthToken=""},showHideGithubNav:function(a){top.get("githubNav").style.display="show"==a?"block":"none";top.get("fileNav").style.display="show"==a?"none":"block"},githubManager:function(){top.ICEcoder.githubAuthTokenSet? (top.get("mediaContainer").innerHTML='',top.ICEcoder.showHide("show",top.get("blackMask"))):top.ICEcoder.githubTokenAsk("showManager")},githubDiffToggle:function(){var a;if(!top.ICEcoder.githubAuthTokenSet)top.ICEcoder.githubTokenAsk("loadFiles");else if(top.ICEcoder.githubDiff||top.ICEcoder.ask(top.t["This will compare..."]))top.ICEcoder.githubDiff=!top.ICEcoder.githubDiff,a=top.ICEcoder.githubDiff? -"true":"false",top.ICEcoder.filesFrame.src="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},useNewSettings:function(a,b,c,d,f,e,g,k,h,l,p,n,m,t,u,v,w,x){var q,r=a.slice(0,a.lastIndexOf("?")),r=r.slice(r.lastIndexOf("/")+1,r.lastIndexOf("."));top.ICEcoder.theme!==r&&(top.ICEcoder.theme=r,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type","text/css"),q.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q), +"true":"false",top.ICEcoder.filesFrame.src="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},useNewSettings:function(a,b,c,d,e,f,g,k,h,l,p,n,m,t,u,v,w,x){var q,r=a.slice(0,a.lastIndexOf("?")),r=r.slice(r.lastIndexOf("/")+1,r.lastIndexOf("."));top.ICEcoder.theme!==r&&(top.ICEcoder.theme=r,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type","text/css"),q.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q), q=-1<"3024-day base16-light eclipse elegant neat paraiso-light solarized xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":"#000",top.ICEcoder.switchTab(top.ICEcoder.selectedTab));b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||(ICEcoder.changeFilesW("contract"),top.ICEcoder.hideFileMenu());b=ICEcoder.content.contentWindow.document.styleSheets[4];a=b.rules?"rules":"cssRules";b[a][0].style.fontSize= -g;b[a][4].style["border-left-width"]=e?"1px":"0";b[a][4].style["margin-left"]=e?"-1px":"0";b[a][2].style.cssText="background-color: "+q+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.indentWithTabs=h;top.ICEcoder.indentSize=p;top.ICEcoder.indentAuto=l;for(e=0;echMod "+b+" on
    "+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0chMod "+b+" on
    "+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0

    Click anywhere to continue using ICEcoder...

    '},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(d){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(f){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}return null},openBugReport:function(){var a; +top.ICEcoder.versionNo+'!

    Click anywhere to continue using ICEcoder...

    '},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(d){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(f){}return null},openBugReport:function(){var a; "off"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["You can start..."]);"error"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["Error cannot find..."]);"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["No new errors..."]);"bugs"==top.ICEcoder.bugReportStatus&&(a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/")),-1/g,">").replace(/"/g,""").replace(/'/g,"'")},printCode:function(){var a, b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1ICEcoder code output
    '+top.ICEcoder.xssClean(a.getValue())+"
    ";b.focus();b.print();a.focus()},indicateChanges:function(){var a;if(!top.ICEcoder.loadingFile){a="ICEcoder v "+top.ICEcoder.versionNo; -for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=" \u2744";break}top.document.title=a}},switchTab:function(a,b){var c,d;ICEcoder.selectedTab=a;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();if(-1 '+b.slice(b.lastIndexOf("/")).replace(/\//,"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//, @@ -133,22 +133,22 @@ top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTab d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask(top.t["You have made..."]));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;db?parseInt(c*g,10)-parseInt(c*(g-1),10):150,f=0==g?53:parseInt(top.get("tab"+g).style.left,10),e=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=f+e+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(f+e);top.get("newTab").style.left=f+e+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart= +setTimeout(function(){top.ICEcoder.canSwitchTabs=!0},100)},closeAllTabs:function(){if(0b?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart= (top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,10)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left, 10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+ -c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.savedPoints,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var f=0;f Date: Wed, 25 Feb 2015 02:59:50 +0300 Subject: [PATCH 17/20] make goToLine if filename contains line number and file is already opened --- lib/ice-coder.js | 3 +++ lib/ice-coder.min.js | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index dd9e8df..89669fc 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1174,6 +1174,9 @@ var ICEcoder = { } if (top.ICEcoder.thisFileFolderLink != "/[NEW]" && top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)!==false) { top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1); + if (line > 1){ + top.ICEcoder.goToLine(line); + } } else if (top.ICEcoder.thisFileFolderLink!="" && top.ICEcoder.thisFileFolderType=="file") { // work out a shortened URL for the file diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 197583f..46a1812 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -48,13 +48,13 @@ b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.styl d=0"+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^(.*)\s+line\s+(\d+)/.exec(a),null!==b?(c= -b[2],a=b[1]):0"+top.t["Opening File"]+"
    "+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView", -1)))},openFilesFromList:function(a){for(var b=0;b"+ -top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0"+top.t.Saving+"
    "+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title= -b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1', +b[2],a=b[1]):0"+top.t["Opening File"]+"
    "+top.ICEcoder.shortURL)): +top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0"+top.t.Saving+"
    "+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g, +"/")),-1',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//, +""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1', c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),confirm("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
    "+b)),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a= a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0"+top.t["Deleting File"]+"
    "+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
    "+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])}, @@ -151,4 +151,4 @@ top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):223==c&& "content"==a?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1 Date: Sun, 1 Mar 2015 18:29:30 +0300 Subject: [PATCH 18/20] allow opening files with name (... on line \d+) - open + goto line --- lib/ice-coder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 89669fc..42d5104 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1153,11 +1153,11 @@ var ICEcoder = { var shortURL, canOpenFile; var line = 1; if ("undefined" != typeof fileLink) { - var re = /^(.*)\s+line\s+(\d+)/; + var re = /^([^ ]*)\s+(on\s+)?line\s+(\d+)/; var reMatch = re.exec(fileLink); if (null !== reMatch) { - line = reMatch[2]; + line = reMatch[3]; fileLink = reMatch[1]; } else if (fileLink.indexOf(':') > 0){ line = fileLink.split(':')[1]; From b3acb6120124fae5532a4cfefb895e0025439669 Mon Sep 17 00:00:00 2001 From: Andrey Grinenko Date: Sun, 1 Mar 2015 18:34:39 +0300 Subject: [PATCH 19/20] ice-coder.min.js updated to get changes of previous commit 7d66f32e5bca53537a3cbcfcc551f7198ee90eda --- lib/ice-coder.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 46a1812..e465220 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -47,8 +47,8 @@ top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selec b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},boxSelect:function(a,b){var c,d;c=top.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast="");top.ICEcoder.mouseDown&&"drag"==b&&(top.ICEcoder.fmDraggedBox=!0, d=0"+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^(.*)\s+line\s+(\d+)/.exec(a),null!==b?(c= -b[2],a=b[1]):0"+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^([^ ]*)\s+(on\s+)?line\s+(\d+)/.exec(a),null!== +b?(c=b[3],a=b[1]):0"+top.t["Opening File"]+"
    "+top.ICEcoder.shortURL)): top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0 Date: Fri, 13 Mar 2015 17:59:46 +0300 Subject: [PATCH 20/20] handling another file+line case: "filename on 123" --- lib/ice-coder.js | 6 +++--- lib/ice-coder.min.js | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 42d5104..99dbbe8 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1153,11 +1153,11 @@ var ICEcoder = { var shortURL, canOpenFile; var line = 1; if ("undefined" != typeof fileLink) { - var re = /^([^ ]*)\s+(on\s+)?line\s+(\d+)/; + var re = /^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/; var reMatch = re.exec(fileLink); if (null !== reMatch) { - line = reMatch[3]; + line = reMatch[4]; fileLink = reMatch[1]; } else if (fileLink.indexOf(':') > 0){ line = fileLink.split(':')[1]; @@ -3401,4 +3401,4 @@ var ICEcoder = { top.ICEcoder.focus(top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? true : false); } } -}; \ No newline at end of file +}; diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index e465220..5bec52f 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -47,14 +47,14 @@ top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selec b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},boxSelect:function(a,b){var c,d;c=top.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast="");top.ICEcoder.mouseDown&&"drag"==b&&(top.ICEcoder.fmDraggedBox=!0, d=0"+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^([^ ]*)\s+(on\s+)?line\s+(\d+)/.exec(a),null!== -b?(c=b[3],a=b[1]):0"+top.t["Opening File"]+"
    "+top.ICEcoder.shortURL)): -top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0"+top.t.Saving+"
    "+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g, -"/")),-1',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//, -""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1', +newFolder:function(){var a,b;a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage(""+top.t["Creating Folder"]+"
    "+b)},openFile:function(a){var b,c=1;"undefined"!=typeof a&&(b=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a), +null!==b?(c=b[4],a=b[1]):0"+top.t["Opening File"]+ +"
    "+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
    "+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0"+top.t.Saving+"
    "+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."], +c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML= +closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf,b),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
    "+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1', c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),confirm("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|")),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
    "+b)),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a= a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0"+top.t["Deleting File"]+"
    "+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
    "+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])}, @@ -151,4 +151,4 @@ top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):223==c&& "content"==a?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1