ICEcoder objectThere is a single ICEcoder object and everything resides within it, variables and functions. There are also a number of settings within, followed by the functions themselves. The ICEcoder object also has aliases for header, files, account, fmLock, filesFrame, editor, tabsBar, findBar, content, footer, nestValid, nestDisplay and charDisplay which refer to those elements on the page by that id.
This sets the layout of the page again, especially useful after you modify the size of an element. You can pass anything as the dontSetEditor argument to not resize the editor pane.
Pass an argument of expand or contract to respectively expand or contract the file manager.
Calling this will toggle between locking & unlocking the file manager.
dir can be up or down to move the currently selected line in that direction.
Will select the given line.
- goToLine(lineNo, charNo, noFocus)
Will place the cursor on a line and also character if provided. If no line or character is provided it will set the cursor according to the value in the Go to Line textfield. noFocus is a bool, if true is passed the editpr won't be focused on, false means it will.
Comment or uncomment the current line or text selection.
This function works with the nesting display to highlight or deselect text according to a specified nest. nestPos is the position of the ICEcoder.htmlTagArray array to be selected. If the hide argument is passed, it will deselect the text and return to what was selected previously.
This will set the cursor position according to the nestPos of ICEcoder.htmlTagArray on the given line number and tag.
This will wrap the selected text with tags according to the tag variable. Passing div as the tag will add line breaks & indents and passing a as the tag will also add href="" and set the cursor within the quotes.
Adds a <br> tag the end of the line. If line is not passed, it will add to the end of the current line.
Creates a duplicate of the line. If line is not passed, it will duplicate the current line.
Removes the line. If line is not passed, it will remove the current line.
Will try to move the cursor to the definition for the string the cursor is currently on within the current document. Will attempt to find it through a number of common definition formats.
The action argument can be either select or deselect and the file/folder with a matching id of the file argument will be highlighted as appropriate.
Remove selection styling from all files.
Starts a new tab and prompts for a filename, saving it immediately.
Prompts for a folder name then creates a folder with that name & path on the server.
When called without an argument it will open the file selected in the file manager (if a single file is selected). If the fileLink argument is passed as a relative path, it will open that file.
Opens a dialog prompt asking user for file path or remote URL to open.
Gets the remote URL and opens in a new tab.
When called without an argument, it will save the current document. If a saveAs argument is passed, it will prompt the user for a filename and save as that.
Renames the oldName path as newName path.
Prompts to delete all currently selected files.
Makes a note of which file is to be copied.
Pastes a copy of the file (path noted by the copyFile function) at the given location.
Displays the multiple file select dialog for user to select files they wish to upload.
Begins uploading the files set on the file input form object. This should be passed as obj.
Show the file manager context menu. The position of the menu will depend on the ICEcoder.mouseX and ICEcoder.mouseY variables and the options shown depend on what is contained in ICEcoder.selectedFiles array.
Hides the file manager context menu.
Updates the file manager according to given arguments. action can be add, rename, chmod or delete. location is the relative path of the target. file is the filename, perms are the permissions to set and oldName is the current name (used when renaming).
Reloads the file manager.
find & replace
Replaces find argument with replace argument in fileRef argument, which should be a relative path.
info & display
Update the ICEcoder.htmlTagArray array with values according to the current cursor position. updateNestDisplay should be passed to also update the nest display.
Indicate if the nesting structure of the code is OK or broken.
Update the code type, line & character display.
Update the number of bytes display.
Toggle the char/byte display. Pass 'char' or 'byte' to show that display and hide the other.
Call this function with doVis set as show or hide and the DOM elem you'd like to show or hide. This will set the CSS visibility property on the element as visible or hidden respectively.
This will return the DOM object for the CodeMirror instance of the current document. Now you have all of the CodeMirror API available to you. For instance cm = ICEcoder.getcMInstance() will set the var to the DOM object. You can now use say cm.setValue('New content') to set the content. Full CodeMirror API can be found at codemirror.net.
Call this to get the users absolute mouse X & Y positions. These values are stored in ICEcoder.mouseX and ICEcoder.mouseY.
Messages are shown at the bottom of the file manager as an indication to the user. The message argument should be short and HTML is accepted, so you can style what is displayed. Calling this function without a message argument will clear the message.
Show the color picker on screen. You can pass a hex value as color to set that color in the picker on open.
- fMIconVis(icon, vis)
Change the CSS opacity of icon to the vis value.
Check if the document in the file argument is open in the ICEcoder.openFiles array.
If the JSHint plugin is available, this will update the hints you see in the current documemt.
Send text to the output pane.
Switch code assist on/off.
The server queue is where all interaction with the server begins. This means you can call many operations and they will be dealt with in turn to avoid jams or unexpected results. The action parameter should be either add or delete to add to the end of the queue or delete from the front. The item parameter should be a file control process currently used as standard by ICEcoder.
This will perform a window.stop call, remove everything but the running task from the server queue, hide the loading screen and show a server message to the user that tasks are being cancelled.
Set the current previousFiles array in the settings file
Opens all files in the previousFiles array.
Call this function with show as the vis argument and it will show the settings screen.
Show the help screen.
Show the ICEcoder manual.
Show the properties screen for the given fileName path.
This will switch between full screen and standard view when called.
Zip up the tgt path using the ZipIt plugin. If no tgt is given, it will zip up at the root level.
Set the perms argument on the file argument path.
Opens the current document as a new window to view as a webpage. Created as a named child window so live editing is possible.
Opens the inbuilt terminal as a new window.
Log out of ICEcoder.
Alert the msg argument.
Confirm the question argument.
Prompt the user with a question and show the defaultValue argument as the answer.
Show a message on the data screen, shown when no documents are visible.
Show or hide the requested tool, which can be a string of terminal, output, database or git.
Call this function with a parameter to switch to that tab. Starts at 0.
Adds a new empty tab.
Cycle to the next tab to the right or loop back to the first tab.
Cycle to the next tab to the left or loop back to the last tab.
Reset all tabs to be without a highlight and then highlight the tab as per value in ICEcoder.selectedTab.
Closes the given closeTabNum argument. Add true as dontSetPV to not update & save the previously opened files array.
Closes all open tabs.
Resize the tab widths according to the space available.
Call this and pass through an array of tab numbers as newOrder to sort into that order. If you have 3 tabs open you could say pass [2,1,3] as newOrder.
Sorts tabs into alphabetical order by filename.