mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 15:24:00 +01:00
JS lang items used and print pre wrap fix
This commit is contained in:
@@ -115,7 +115,7 @@ var ICEcoder = {
|
||||
if (!dontSetEditor) {
|
||||
this.editor.style.width = ICEcoder.content.style.width = (winW-this.filesW) + "px";
|
||||
ICEcoder.content.style.height = (winH-headerH-tabsBarH-findBarH-26) + "px";
|
||||
|
||||
|
||||
// Resize the CodeMirror instances to match the window size
|
||||
setTimeout(function(){
|
||||
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||
@@ -545,7 +545,7 @@ var ICEcoder = {
|
||||
}
|
||||
window.open("http://www.google.com/#output=search&q="+searchPrefix+top.ICEcoder.getcMInstance().getSelection());
|
||||
} else {
|
||||
top.ICEcoder.message('No text selected to search on');
|
||||
top.ICEcoder.message(top.t['No text selected...']);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -702,7 +702,7 @@ var ICEcoder = {
|
||||
if (newFolder) {
|
||||
newFolder = (shortURL + "/" + newFolder).replace(/\/\//,"/");
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+newFolder.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Creating Folder</b><br>'+newFolder);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Creating Folder']+'</b><br>'+newFolder);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -724,7 +724,7 @@ var ICEcoder = {
|
||||
canOpenFile = true;
|
||||
// Limit to 100 files open at a time
|
||||
if (top.ICEcoder.openFiles.length>=100) {
|
||||
top.ICEcoder.message('Sorry, you can only have 100 files open at a time!');
|
||||
top.ICEcoder.message(top.t['Sorry you can...']);
|
||||
canOpenFile = false;
|
||||
}
|
||||
|
||||
@@ -735,7 +735,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.serverMessage('<b>Opening File</b><br>'+top.ICEcoder.shortURL);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Opening File']+'</b><br>'+top.ICEcoder.shortURL);
|
||||
} else {
|
||||
top.ICEcoder.createNewTab();
|
||||
}
|
||||
@@ -757,7 +757,7 @@ var ICEcoder = {
|
||||
openPrompt: function() {
|
||||
var fileLink;
|
||||
|
||||
if(fileLink = top.ICEcoder.getInput('Enter relative file path (prefixed with /) or remote URL','')) {
|
||||
if(fileLink = top.ICEcoder.getInput(top.t['Enter relative file...'],'')) {
|
||||
fileLink.indexOf("://")>-1
|
||||
? top.ICEcoder.getRemoteFile(fileLink)
|
||||
: top.ICEcoder.openFile(fileLink);
|
||||
@@ -767,7 +767,7 @@ var ICEcoder = {
|
||||
// Get remote file contents
|
||||
getRemoteFile: function(remoteFile) {
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=getRemoteFile&file="+remoteFile+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Getting</b><br>'+remoteFile);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Getting']+'</b><br>'+remoteFile);
|
||||
},
|
||||
|
||||
// Save a file
|
||||
@@ -784,7 +784,7 @@ var ICEcoder = {
|
||||
}
|
||||
filePath = filePath.replace("||","|");
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+filePath+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+saveType+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""));
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Saving']+'</b><br>'+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""));
|
||||
},
|
||||
|
||||
// Prompt a rename dialog
|
||||
@@ -798,7 +798,7 @@ var ICEcoder = {
|
||||
shortURL = oldName.replace(/\|/g,"/");
|
||||
}
|
||||
if (!newName) {
|
||||
newName = top.ICEcoder.getInput('Please enter the new name for',shortURL);
|
||||
newName = top.ICEcoder.getInput(top.t['Please enter the...'],shortURL);
|
||||
}
|
||||
if (newName) {
|
||||
i = top.ICEcoder.openFiles.indexOf(shortURL.replace(/\|/g,"/"));
|
||||
@@ -811,7 +811,7 @@ var ICEcoder = {
|
||||
top.get('tab'+(i+1)).title = newName;
|
||||
}
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Renaming to']+'</b><br>'+newName);
|
||||
|
||||
top.ICEcoder.setPreviousFiles();
|
||||
}
|
||||
@@ -832,7 +832,7 @@ var ICEcoder = {
|
||||
top.get('tab'+(i+1)).title = newName;
|
||||
}
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=move&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Moving to</b><br>'+newName);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Moving to']+'</b><br>'+newName);
|
||||
|
||||
top.ICEcoder.setPreviousFiles();
|
||||
}
|
||||
@@ -846,7 +846,7 @@ var ICEcoder = {
|
||||
tgtListDisplay = tgtFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n");
|
||||
if (tgtFiles.length>0 && top.ICEcoder.ask('Delete:\n\n'+tgtListDisplay+'?')) {
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+tgtFiles.join(";")+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Deleting File</b><br>'+tgtListDisplay);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Deleting File']+'</b><br>'+tgtListDisplay);
|
||||
};
|
||||
},
|
||||
|
||||
@@ -870,13 +870,13 @@ var ICEcoder = {
|
||||
for (var i=0; i<top.ICEcoder.copiedFiles.length; i++) {
|
||||
if (top.ICEcoder.copiedFiles[i]!="|") {
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFiles[i]+"&location="+location+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFiles[i].toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Pasting File']+'</b><br>'+top.ICEcoder.copiedFiles[i].toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
||||
} else {
|
||||
top.ICEcoder.message("Sorry, cannot paste a whole root");
|
||||
top.ICEcoder.message(top.t['Sorry cannot paste...']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
top.ICEcoder.message("Nothing to paste, copy a file/folder first!");
|
||||
top.ICEcoder.message(top.t['Nothing to paste...']);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1029,7 +1029,7 @@ var ICEcoder = {
|
||||
if (locNest.childNodes[i].className) {
|
||||
// Identify if the item we're considering is a file or folder
|
||||
elemType = locNest.childNodes[i].className.indexOf('directory')>0 ? "folder" : "file";
|
||||
|
||||
|
||||
// Get the name of the item
|
||||
nameLI = locNest.childNodes[i].getElementsByTagName('span')[0].innerHTML;
|
||||
|
||||
@@ -1290,7 +1290,7 @@ var ICEcoder = {
|
||||
// Replace text in a file
|
||||
replaceInFile: function(fileRef,find,replace) {
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+fileRef.replace(/\//g,"|")+"&find="+find+"&replace="+replace+"&csrf="+top.ICEcoder.csrf);
|
||||
top.ICEcoder.serverMessage('<b>Replacing text in</b><br>'+fileRef);
|
||||
top.ICEcoder.serverMessage('<b>'+top.t['Replacing text in']+'</b><br>'+fileRef);
|
||||
},
|
||||
|
||||
// ==============
|
||||
@@ -1686,7 +1686,7 @@ var ICEcoder = {
|
||||
ICEcoder.serverQueueItems.splice(1,ICEcoder.serverQueueItems.length);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.get('loadingMask'));
|
||||
top.ICEcoder.serverMessage('<b style="color: #d00">Cancelled tasks</b>');
|
||||
top.ICEcoder.serverMessage('<b style="color: #d00">'+top.t['Cancelled tasks']+'</b>');
|
||||
setTimeout(function() {top.ICEcoder.serverMessage();},2000);
|
||||
},
|
||||
|
||||
@@ -1702,7 +1702,7 @@ var ICEcoder = {
|
||||
|
||||
// Opens the last files we had open
|
||||
autoOpenFiles: function() {
|
||||
if (top.ICEcoder.previousFiles.length>0 && top.ICEcoder.ask('Open previous files?\n\n'+top.ICEcoder.previousFiles.length+' files:\n'+top.ICEcoder.previousFiles.join('\n').replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,'gi'),""))) {
|
||||
if (top.ICEcoder.previousFiles.length>0 && top.ICEcoder.ask(top.t['Open previous files']+'\n\n'+top.ICEcoder.previousFiles.length+' files:\n'+top.ICEcoder.previousFiles.join('\n').replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,'gi'),""))) {
|
||||
for (var i=0;i<top.ICEcoder.previousFiles.length;i++) {
|
||||
top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[i].replace('|','/');
|
||||
top.ICEcoder.thisFileFolderType='file';
|
||||
@@ -1748,7 +1748,7 @@ var ICEcoder = {
|
||||
|
||||
// Ask user for GitHub token
|
||||
githubTokenAsk: function(goNext) {
|
||||
if (githubAuthToken = top.ICEcoder.getInput('Please enter your GitHub token (either personal access token or client/secret pair token). See tooltip next to \'Github Auth Token\' on Help > Settings screen for more info','')) {
|
||||
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="+goNext+"&csrf="+top.ICEcoder.csrf;
|
||||
// Clear the token from the var for security
|
||||
githubAuthToken = "";
|
||||
@@ -1774,7 +1774,7 @@ var ICEcoder = {
|
||||
|
||||
if (!top.ICEcoder.githubAuthTokenSet) {
|
||||
top.ICEcoder.githubTokenAsk('loadFiles');
|
||||
} else if (top.ICEcoder.githubDiff || top.ICEcoder.ask("This will compare and show a diff view between your local dir and the repo. OK?")) {
|
||||
} else if (top.ICEcoder.githubDiff || top.ICEcoder.ask(top.t['This will compare...'])) {
|
||||
top.ICEcoder.githubDiff = !top.ICEcoder.githubDiff;
|
||||
gHDiff = top.ICEcoder.githubDiff ? "true" : "false";
|
||||
|
||||
@@ -1953,11 +1953,7 @@ var ICEcoder = {
|
||||
update: function() {
|
||||
var autoUpdate;
|
||||
|
||||
autoUpdate = confirm( "Updating is currently an experimental feature. While it should work fine, please note there may be issues here, plus the following isn't yet part of this:\n\n"
|
||||
+"- Settings not ported to new version\n- Plugins not ported to new version\n- Any mods you've made not ported to new version\n\n"
|
||||
+"If you have write access on the whole of ICEcoder (ie, running locally) it should work fine. If tho you need to recover ICEcoder for any reason, you'll find this current version in its tmp dir.\n\n"
|
||||
+"Click OK to proceed with an auto-update or cancel to visit the ICEcoder site so you can grab the zip and update manually"
|
||||
);
|
||||
autoUpdate = confirm(top.t['Please note for...']);
|
||||
if (autoUpdate) {
|
||||
top.ICEcoder.showHide('show',top.get('loadingMask'));
|
||||
window.location = "lib/updater.php";
|
||||
@@ -1982,13 +1978,13 @@ var ICEcoder = {
|
||||
var bugReportOpenFilePos;
|
||||
|
||||
if(top.ICEcoder.bugReportStatus=="off") {
|
||||
top.ICEcoder.message('You can start bug reporting in Help > Settings');
|
||||
top.ICEcoder.message(top.t['You can start...']);
|
||||
}
|
||||
if(top.ICEcoder.bugReportStatus=="error") {
|
||||
top.ICEcoder.message('Error: can\'t find/access the error file paths');
|
||||
top.ICEcoder.message(top.t['Error cannot find...']);
|
||||
}
|
||||
if(top.ICEcoder.bugReportStatus=="ok") {
|
||||
top.ICEcoder.message('No new errors found');
|
||||
top.ICEcoder.message(top.t['No new errors...']);
|
||||
}
|
||||
if(top.ICEcoder.bugReportStatus=="bugs") {
|
||||
// Close bug-report without saving previousFiles and without confirming close if we made changes on the bug report
|
||||
@@ -2045,13 +2041,13 @@ var ICEcoder = {
|
||||
}
|
||||
top.ICEcoder.bugFilesSizesActual = statusArray['filesSizesSeen'];
|
||||
top.ICEcoder.bugReportPath = statusArray['bugReportPath'];
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
// console.log('Calling '+bugCheckURL+' via XHR');
|
||||
xhr.open("GET",bugCheckURL,true);
|
||||
xhr.send();
|
||||
|
||||
|
||||
},parseInt(top.ICEcoder.bugFileCheckTimer*1000,10));
|
||||
// State that we're checking for bugs
|
||||
top.ICEcoder.bugReportStatus = "ok";
|
||||
@@ -2079,7 +2075,7 @@ var ICEcoder = {
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
printIFrame = top.ICEcoder.filesFrame.contentWindow.frames['fileControl'];
|
||||
// Print page content injected into iFrame, escaped with pre and xssClean
|
||||
printIFrame.window.document.body.innerHTML = '<!DOCTYPE html><head><title>ICEcoder code output</title></head><body><pre>'+top.ICEcoder.xssClean(cM.getValue())+'</pre></body></html>';
|
||||
printIFrame.window.document.body.innerHTML = '<!DOCTYPE html><head><title>ICEcoder code output</title></head><body><pre style="white-space: pre-wrap">'+top.ICEcoder.xssClean(cM.getValue())+'</pre></body></html>';
|
||||
printIFrame.focus();
|
||||
printIFrame.print();
|
||||
// Focus back on code
|
||||
@@ -2256,7 +2252,7 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
okToRemove = true;
|
||||
if (!dontAsk && ICEcoder.savedPoints[closeTabNum-1]!=top.ICEcoder.getcMInstance(closeTabNum).changeGeneration()) {
|
||||
okToRemove = top.ICEcoder.ask('You have made changes.\n\nAre you sure you want to close without saving?');
|
||||
okToRemove = top.ICEcoder.ask(top.t['You have made...']);
|
||||
}
|
||||
|
||||
if (okToRemove) {
|
||||
@@ -2319,7 +2315,7 @@ var ICEcoder = {
|
||||
|
||||
// Close all tabs
|
||||
closeAllTabs: function() {
|
||||
if (top.ICEcoder.cMInstances.length>0 && ICEcoder.ask("Close all tabs?")) {
|
||||
if (top.ICEcoder.cMInstances.length>0 && ICEcoder.ask(top.t['Close all tabs'])) {
|
||||
for (var i=top.ICEcoder.cMInstances.length; i>0; i--) {
|
||||
top.ICEcoder.closeTab(i, i>1? true:false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user