Remove GitHub related items, add scrollBarStyle to ice-coder.js

This commit is contained in:
mattpass
2020-03-14 09:08:03 +00:00
parent d1845ef476
commit 112cd883f9

View File

@@ -58,8 +58,6 @@ var ICEcoder = {
bugReportPath: "", // Bug report file path
bugFilesSizesSeen: [], // Array of last seen sizes of bug files
bugFilesSizesActual: [], // Array of actual sizes of bug files
githubDiff: false, // Toggle for viewing GitHub/FM diff view
githubAuthTokenSet: false, // Has the user set their GitHub token yet
splitPane: false, // Single or split pane editing
splitPaneLeftPerc: 100, // Width of left pane as a percentage
renderLineStyle: [], // Array of styles to apply on renderLine event
@@ -1614,16 +1612,6 @@ var ICEcoder = {
}
}
// If in GitHub mode, update the selected count and button colours
if (this.githubDiff) {
get('githubNavSelectedCount').innerHTML = "Selected: " + this.selectedFiles.length;
get('githubNavCommit').style.color = this.selectedFiles.length > 0 ? "#fff" : "#333";
get('githubNavCommit').style.background = this.selectedFiles.length > 0 ? "#2187e7" : "#555";
get('githubNavSelectedCount').style.color = this.selectedFiles.length > 0 ? "#fff" : "#333";
get('githubNavPull').style.color = this.selectedFiles.length > 0 ? "#fff" : "#333";
get('githubNavPull').style.background = this.selectedFiles.length > 0 ? "#2187e7" : "#555";
}
// Adjust the file & replace select dropdown values accordingly
document.findAndReplace.target[2].innerHTML = !this.selectedFiles[0] ? t['all files'] : t['selected files'];
document.findAndReplace.target[3].innerHTML = !this.selectedFiles[0] ? t['all filenames'] : t['selected filenames'];
@@ -3247,52 +3235,6 @@ var ICEcoder = {
this.filesFrame.contentWindow.frames['fileControl'].location.href = iceLoc+"/lib/go-localhost-root.php";
},
// Show the GitHub commit screen
githubAction: function(action) {
get('mediaContainer').innerHTML = '<iframe src="'+iceLoc+'/lib/github.php?action='+action+'&selectedFiles='+this.selectedFiles.join(";")+'&csrf='+this.csrf+'" class="whiteGlow" style="width: 340px; height: 340px"></iframe>';
this.showHide('show',get('blackMask'));
},
// Ask user for GitHub token
githubTokenAsk: function(goNext) {
if (githubAuthToken = this.getInput(t['Please enter your...'],'')) {
this.filesFrame.contentWindow.frames['fileControl'].location.href = iceLoc+"/lib/github.php?action=auth&token="+githubAuthToken+"&goNext="+goNext+"&csrf="+this.csrf;
// Clear the token from the var for security
githubAuthToken = "";
}
},
// Show/Hide the GitHub file nav
showHideGithubNav: function(vis) {
get('githubNav').style.display = vis == "show" ? "block" : "none";
get('fileNav').style.display = vis == "show" ? "none" : "block";
},
// Show the GitHub manager
githubManager: function() {
var githubAuthToken;
if (this.githubAuthTokenSet) {
get('mediaContainer').innerHTML = '<iframe src="'+iceLoc+'/lib/github-manager.php" class="whiteGlow" style="width: 660px; height: 450px"></iframe>';
this.showHide('show',get('blackMask'));
} else {
this.githubTokenAsk('showManager');
}
},
// Toggle the GitHub diff on/off view
githubDiffToggle: function() {
var gHDiff;
if (!this.githubAuthTokenSet) {
this.githubTokenAsk('loadFiles');
} else if (this.githubDiff || this.ask(t['This will compare...'])) {
this.githubDiff = !this.githubDiff;
gHDiff = this.githubDiff ? "true" : "false";
this.filesFrame.src = "files.php?githubDiff="+gHDiff+"&csrf="+this.csrf;
}
},
// Show the FTP manager
ftpManager: function() {
get('mediaContainer').innerHTML = '<iframe src="'+iceLoc+'/lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';
@@ -3300,7 +3242,7 @@ var ICEcoder = {
},
// Update the settings used when we make a change to them
useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,autoComplete,visibleTabs,fontSize,lineWrapping,lineNumbers,showTrailingSpace,matchBrackets,autoCloseTags,autoCloseBrackets,indentWithTabs,indentAuto,indentSize,pluginPanelAligned,bugFilePaths,bugFileCheckTimer,bugFileMaxLines,githubAuthTokenSet,updateDiffOnSave,autoLogoutMins,refreshFM) {
useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,autoComplete,visibleTabs,fontSize,lineWrapping,lineNumbers,showTrailingSpace,matchBrackets,autoCloseTags,autoCloseBrackets,indentWithTabs,indentAuto,indentSize,pluginPanelAligned,scrollbarStyle,bugFilePaths,bugFileCheckTimer,bugFileMaxLines,updateDiffOnSave,autoLogoutMins,refreshFM) {
var styleNode, thisCSS, strCSS, activeLineBG;
// cut out ?microtime= at the end
@@ -3367,6 +3309,7 @@ var ICEcoder = {
this.indentWithTabs = indentWithTabs;
this.indentSize = indentSize;
this.indentAuto = indentAuto;
this.scrollbarStyle = scrollbarStyle;
for (var i=0;i<this.cMInstances.length;i++) {
// Main pane
this.content.contentWindow['cM'+this.cMInstances[i]].setOption("lineWrapping", this.lineWrapping);
@@ -3378,6 +3321,7 @@ var ICEcoder = {
this.content.contentWindow['cM'+this.cMInstances[i]].setOption("indentWithTabs", this.indentWithTabs);
this.content.contentWindow['cM'+this.cMInstances[i]].setOption("indentUnit", this.indentSize);
this.content.contentWindow['cM'+this.cMInstances[i]].setOption("tabSize", this.indentSize);
this.content.contentWindow['cM'+this.cMInstances[i]].setOption("scrollbarStyle", this.scrollbarStyle);
this.content.contentWindow['cM'+this.cMInstances[i]].refresh();
// Diff pane
this.content.contentWindow['cM'+this.cMInstances[i]+'diff'].setOption("lineWrapping", this.lineWrapping);
@@ -3389,6 +3333,7 @@ var ICEcoder = {
this.content.contentWindow['cM'+this.cMInstances[i]+'diff'].setOption("indentWithTabs", this.indentWithTabs);
this.content.contentWindow['cM'+this.cMInstances[i]+'diff'].setOption("indentUnit", this.indentSize);
this.content.contentWindow['cM'+this.cMInstances[i]+'diff'].setOption("tabSize", this.indentSize);
this.content.contentWindow['cM'+this.cMInstances[i]+'diff'].setOption("scrollbarStyle", this.scrollbarStyle);
this.content.contentWindow['cM'+this.cMInstances[i]+'diff'].refresh();
}
@@ -3421,9 +3366,6 @@ var ICEcoder = {
this.updateDiffs();
}
// Set the flag to indicate if the GitHub auth token is set
this.githubAuthTokenSet = githubAuthTokenSet;
// Set the flag to indicate if we update diff pane on save
this.updateDiffOnSave = updateDiffOnSave;