// Get any elem by ID var get = function(elem) { return top.document.getElementById(elem); }; // Main ICEcoder object var ICEcoder = { // ============== // 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') mouseDownMinimap: false, // If the mouse is down on Minimap nav box 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 serverQueueItems: [], // Array of URLs to call in order miniMapBoxTop: 0, // Top of the minimap box highlighter miniMapBoxHeight: 0, // Height of the minimap box highlighter 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 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 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 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 // 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", "docExplorer", "miniMap", "miniMapContainer", "miniMapContent", "functionClassList"]; // Create our ID aliases for (var i=0;i