diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index 20acc89..b43471e 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -1,87 +1,87 @@ // Get any elem by ID -var get = function(elem) { +const get = function(elem) { return document.getElementById(elem); }; -var iceLoc = window.location.pathname; +// URL we're viewing ICEcoder from +const iceLoc = window.location.pathname; // Main ICEcoder object var ICEcoder = { -// ============== -// INIT -// ============== + // ==== + // INIT + // ==== // Define settings - filesW: 250, // Width of files pane - minFilesW: 14, // Min width of files pane - maxFilesW: 250, // Max width of files pane - selectedTab: 0, // The tab that's currently selected - savedPoints: [], // Ints array to indicate save points for docs - savedContents: [], // Array of last known saved contents - canSwitchTabs: true, // Stops switching of tabs when trying to close - openFiles: [], // Array of open file URLs - openFileMDTs: [], // Array of open file modification datetimes - openFileVersions: [], // Array of open file version counts - cMInstances: [], // List of CodeMirror instance no's - nextcMInstance: 1, // Next available CodeMirror instance no - selectedFiles: [], // Array of selected files - findMode: false, // States if we're in find/replace mode - 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') - draggingFilesW: false, // If we're dragging the file manager width - draggingTab: false, // If we're dragging a tab - draggingWithKey: false, // The key that's down while dragging, false if no key - tabLeftPos: [], // Array of left positions of tabs inside content area - tabBGcurrent: '#1d1d1b', // BG of current tab - tabBGselected: '#49d', // BG of selected tab - tabBGopen: '#c3c3c3', // BG of open tab - tabBGnormal: 'transparent', // BG of normal tab - tabFGcurrent: '#fff', // FG of selected tab - tabFGselected: '#fff', // FG of selected tab - tabFGopenFile: '#000', // FG of open file - tabFGnormalFile: '#eee', // FG of normal file - tabFGnormalTab: '#888', // FG of normal tab - prevTab: 0, // Previous tab to current - serverQueueItems: [], // Array of URLs to call in order - previewWindow: false, // Target variable for the preview window - previewWindowLoading: false, // Loading state of preview window - pluginIntervalRefs: [], // Array of plugin interval refs - overPopup: false, // Indicates if we're over a popup or not - cmdKey: false, // Tracking apple Command key up/down state - codeZoomedOut: false, // If true, code on non declaration lines is zoomed out - showingTool: false, // Which tool is showing right now (terminal, output, database, git etc) - oppTagReplaceData: [], // Will contain data for automatic opposite tag replacement to sync them - fmReady: false, // Indicates if the file manager is ready for action - bugReportStatus: "off", // Values of: off, error, ok, bugs - bugReportPath: "", // Bug report file path - bugFilesSizesSeen: [], // Array of last seen sizes of bug files - bugFilesSizesActual: [], // Array of actual sizes of bug files - 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 - renderPaneShiftAmount: 0, // Shift comparison main (negative) vs diff pane (positive) - debounce: "", // Contains debounce timeout object - editorFocusInstance: "", // Name of editor instance that has focus - openSeconds: 0, // Number of seconds ICEcoder has been open for - indexing: false, // Indicates if ICEcoder is currently indexing - ready: false, // Indicates if ICEcoder is ready for action + filesW: 250, // Width of files pane + minFilesW: 14, // Min width of files pane + maxFilesW: 250, // Max width of files pane + selectedTab: 0, // The tab that's currently selected + savedPoints: [], // Ints array to indicate save points for docs + savedContents: [], // Array of last known saved contents + canSwitchTabs: true, // Stops switching of tabs when trying to close + openFiles: [], // Array of open file URLs + openFileMDTs: [], // Array of open file modification datetimes + openFileVersions: [], // Array of open file version counts + cMInstances: [], // List of CodeMirror instance no's + nextcMInstance: 1, // Next available CodeMirror instance no + selectedFiles: [], // Array of selected files + findMode: false, // States if we're in find/replace mode + 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') + draggingFilesW: false, // If we're dragging the file manager width + draggingTab: false, // If we're dragging a tab + draggingWithKey: false, // The key that's down while dragging, false if no key + tabLeftPos: [], // Array of left positions of tabs inside content area + tabBGcurrent: '#1d1d1b', // BG of current tab + tabBGselected: '#49d', // BG of selected tab + tabBGopen: '#c3c3c3', // BG of open tab + tabBGnormal: 'transparent', // BG of normal tab + tabFGcurrent: '#fff', // FG of selected tab + tabFGselected: '#fff', // FG of selected tab + tabFGopenFile: '#000', // FG of open file + tabFGnormalFile: '#eee', // FG of normal file + tabFGnormalTab: '#888', // FG of normal tab + prevTab: 0, // Previous tab to current + serverQueueItems: [], // Array of URLs to call in order + previewWindow: false, // Target variable for the preview window + previewWindowLoading: false, // Loading state of preview window + pluginIntervalRefs: [], // Array of plugin interval refs + overPopup: false, // Indicates if we're over a popup or not + cmdKey: false, // Tracking apple Command key up/down state + codeZoomedOut: false, // If true, code on non declaration lines is zoomed out + showingTool: false, // Which tool is showing right now (terminal, output, database, git etc) + oppTagReplaceData: [], // Will contain data for automatic opposite tag replacement to sync them + fmReady: false, // Indicates if the file manager is ready for action + bugReportStatus: "off", // Values of: off, error, ok, bugs + bugReportPath: "", // Bug report file path + bugFilesSizesSeen: [], // Array of last seen sizes of bug files + bugFilesSizesActual: [], // Array of actual sizes of bug files + 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 + renderPaneShiftAmount: 0, // Shift comparison main (negative) vs diff pane (positive) + editorFocusInstance: "", // Name of editor instance that has focus + openSeconds: 0, // Number of seconds ICEcoder has been open for + indexing: false, // Indicates if ICEcoder is currently indexing + ready: false, // Indicates if ICEcoder is ready for action // Set our aliases initAliases: function() { - var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame", "editor", "tabsBar", "findBar", "terminal", "output", "database", "git", "content", "tools", "footer", "nestValid", "versionsDisplay", "splitPaneControls", "splitPaneNamesMain", "splitPaneNamesDiff", "charDisplay", "byteDisplay"]; + const aliasArray = ["header", "files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame", "editor", "tabsBar", "findBar", "terminal", "output", "database", "git", "content", "tools", "footer", "versionsDisplay", "splitPaneControls", "splitPaneNamesMain", "splitPaneNamesDiff", "charDisplay", "byteDisplay"]; // Create our ID aliases - for (var i=0;i