Introduction To Javascript Variables.
VConsole relies heavily on javascript to perform a lot of the client side functions like right clicking, menu drop downs, moving and resizing columns, and of course, the AJAX operations. If you are interested in executing your own javascript, then this is the place to start. In this section, we will list all the javascript variables that you can use in your own javascript functions. Remember that VConsole is heavily reliant on javascript so if you modify any of these variables, you risk messing up the VConsole interface. We also recommend looking at the javascript files that are located in the vconsole/javascript/ folder. They are available for you to review in plain text. We provide these javascript files in plain text because we want VConsole developers to have a better understanding of how the application and interface works.
IMPORTANT: If you modify any of the javascript files in the vconsole/javascript/ folder, they may end up getting overwritten by an automatic update. Always backup your changes and check to see if they are still there after an update. If you can, we recommend that you avoid modifying the .js files in the vconsole/javascript/ folder. The 2 exceptions are the wysiwyg.js which is meant to be modified so that the WYSIWYG fields in the wizardmanager and propertiesmanager meet your needs and the customscripts.js file which is meant for you to put your own custom javascript functions which are available anytime after VConsole loads. So, if you need to add your own custom javascript functions, you should put them in the customscripts.js file.
Javascript GLOBAL Variables. (As of Version 4.5-5, all global javascript variables are located in the javascript global array G.)
- G['NOAJAX'] - This will be set to a message that is displayed if the user's browser does not support AJAX. You can change this in the vconsole/skins/vsource/templates/main.html file.
- G['startrange'] - This is used for shift-checking in the data manager interface and is always set to the index of the checkbox that is the start checkbox in a shift click operation.
- G['checkname'] - This is used for shift-checking in the data manager interface and is always set to the name of the checkbox that is the start checkbox in a shift click operation.
- G['shiftdown'] - This is used for shift-checking in the data manager interface and is always set to 1 if the shift button is down or 0 if it is up.
- G['checkstate'] - This is used for shift-checking in the data manager interface and is set to 1 if the current shift click operation is a check operation or 0 if it is an unckeck operation.
- G['datamanagerSelected'] - This is an object that is used to keep track of which records are currently checked in the datamanager. It will contain a list of record ids.
- G['colorField'] - This is used in color selection fields and references the hidden field that gets the actual CSS color code.
- G['shColorField'] - This is used in color selection fields and references the non-hidden field that shows the Red, Green, Blue components of a selected color.
- G['colorBlock'] - This is used in color selection fields and references the HTML component that shows the selected color next to the color selector field.
- G['selColorCallback'] - This is used in color selection fields and is set to callback javascript for when a color is selected.
- G['curDMRowIndex'] - This variable is not currently used.
- G['xmlHttp'] - This variable holds the main xmlHTTP object for use with AJAX operations.
- G['noProcessEnterKey'] - This variable is a Boolian. It is set to true when the user is focused on a textarea so that they can hit the enter key without submitting the wizardmanager or propertiesmanager form.
- G['sHL'] - Used for checking rows as you roll your mouse over them while the mouse button is down. Set to true while records are being checked or unchecked and false otherwise.
- G['sHT'] - Used for checking rows as you roll your mouse over them while the mouse button is down. Set to 'h' while records are being checked and 'u' while they are being unchecked.
- G['EditField'] - Used for inline editing in the data manager. Set to the name of the datamanager field that is being edited.
- G['EditID'] - Used for inline editing in the data manager. Set to the tableindex id of the record that is being edited.
- G['dataTableIsDoneLoading'] - Used for the datamanager. When data is done loading, this is set to true. Other functions use it to determine if data is currently loading or not.
- G['gotDMAction'] - Used for parsing datamanager actions. If set to true, then the action that was passed in the GET url (if any) has already been processed.
- G['PromptResponse'] - This variable is not currently used.
- G['cbmouseover'] - This variable is used to determine whether or not the mouse is over a datamanager checkbox. If true, then the mouse is currently over a datamanager checkbox.
- G['DPcallback'] - This variable holds the current "Do Prompt" call back. In version 4.5-5 we eliminated the prompt() javascript function and instead replaced it with a floating div input box. This variable holds the javascript that is executed after the user enters their input in the floating div input box.
- G['DPvalue'] - This variable holds the current "Do Prompt" input from the user and is set when the doPrompt() javascript function is called.
- G['DPnovalue'] - This variable is set to true if, when the doPrompt() javascript function is called, the user does not enter anything, but clicks on the OK button.
- G['floatTitleTimer'] - This is an array of Float Title Timers. There is usually only 1, but it is possible to have more than one. A Float Title Timer holds the set_timeout() reference for moving the floating title in the datamanager. The floating title is the title bar that follows the user as they scroll down through the records of a datamanager module.
- G['coldrag'] - Used in drag and drop column move operations. Set to true when a column is being dragged.
- G['movecol'] - Used in drag and drop column move operations. Set to the header cell that is being dragged.
- G['dropTargets'] - Used in drag and drop column move operations. Set to an array of header cells that are allowed to be dropped onto.
- G['isTarget'] - Used in drag and drop column move operations. Set to true during a drag operation when the mouse is over a valid drop target or false otherwise.
- G['rightclicked'] - This is set to true when the user right clicks on a datamanager header cell. This is used to determine whether or not to start a column drag operation.
- G['WizardManagerFileFields'] - Used for uploading files using the Wizard Manager. Set to true when files have already been uploaded or false if not.
- G['WizardManagerFileCancel'] - Used for canceling file upload during the Wizard Manage file upload. Set to true when the "Cancel" button has bee pressed or false if not.
- G['CBMaxChoices'] - Used for choicebuilder fields. Set to the max number of choices that a user can add.
- G['CBMinChoices'] - Used for choicebuilder fields. Set to the minimum number of choices that a user can have.
- G['CBOptNum'] - Used for choicebuilder fields. Set to the current number of choices that is showing.
- G['CBFieldName'] - Used for choicebuilder fields. Set to the name of the choicebuilder field.
- G['currentTinyMCEInstances'] - This is an array of current TinyMCE instances. When a textarea is transformed into a WYSIWYG field, an element of that instance is added to this array.
- G['isSelectorDM'] - If the current Datamanager is part of a selector field, then this variable is set to true. If not, then it is set to false.
- G['selectorSHFLD'] - This is set to the selector show input field dom object for a selector in the wizardmanager or propertiesmanager module.
- G['selectorVALFLD'] - This is set to the selector value input field dom object for a selector in the wizardmanager or propertiesmanager module.
- G['selectorMODULE'] - This is set to the selector module name for a selector in the wizardmanager or propertiesmanager module.
- G['selectorSH'] - This is set show value for a selector in the wizardmanager or propertiesmanager module.
- G['selectorVAL'] - This is set input value for a selector in the wizardmanager or propertiesmanager module.
- G['signCanvas'] - This will be set when a user signs a document in VConsole. It is set to the return value of canvas.getContext('2d'). It is used to generate an image to embed into the document after the user signs it.
- G['SELECTORID'] - This will be set to the id (or primary key) of the selected record for a selector field.
- G['updateWizardFileQryString'] - This variable is used to store a query string that is passed to VConsole via ajax when files are uploading using a wizardmanager or propertiesmanager file upload field.
- G['vf'] - This variable is used to store the value field name of a selector field.
- G['WMqryString'] - This variable is used to store a query string that is passed to VConsole via ajax when a wizardmanager or propertiesmanager operation is in progress.
- G['MONTH_NAMES'] - This is an array of month names. The first 12 elements are full month names and the last 12 are month abbreviations.
- G['DAY_NAMES'] - This is an array of day names (Monday, Tuesday, etc..) The first 7 elements are full day names and the last 7 are day abbreviations.
- G['SET'] - This is the text that is used in calendar fields for the "Set" button.
- G['TODAY'] - This is the text that is used in calendar fields for the "Today" button.
- G['CLOSE'] - This is the text that is used in calendar fields for the "Close" button.
- G['HOUR'] - This is the text that is used in calendar fields for the "Hour" button.
- G['MINUTE'] - This is the text that is used in calendar fields for the "Minute" button.
- G['AMORPM'] - This is the text that is used in calendar fields for the "AM or PM" button.
- G['AM'] - This is the text that is used in calendar fields for the "AM" button.
- G['PM'] - This is the text that is used in calendar fields for the "PM" button.
- G['DISP_YEAR'] - Used in calendar fields. Year to display in calendar
- G['DISP_MONTH'] - Used in calendar fields. Month to display in calendar
- G['DISP_DAY'] - Used in calendar fields. Day to display in calendar
- G['DISP_HOUR'] - Used in calendar fields. Hour to display in calendar
- G['DISP_MIN'] - Used in calendar fields. Minute to display in calendar
- G['DISP_AP'] - Used in calendar fields. AM or PM to display in calendar
- G['SEL_YEAR'] - Used in calendar fields. Year to display as selected in calendar
- G['SEL_MONTH'] - Used in calendar fields. Month to display as selected in calendar
- G['SEL_DAY'] - Used in calendar fields. Day to display as selected in calendar
- G['NOW_YEAR'] - Used in calendar fields. Year to show as now in calendar
- G['NOW_MONTH'] - Used in calendar fields. Month to show as now in calendar
- G['NOW_DAY'] - Used in calendar fields. Day to show as now in calendar
- G['SHOW_OBJ'] - Used in calendar fields. The show object text input field
- G['INPUT_OBJ'] - Used in calendar fields. The input object input field
- G['CALLBACK'] - Used in calendar fields. The callback function to execute when the calendar is set
- G['CALOVER'] - Used in calendar fields. Variable that detects when the mouse is over the calendar.
- G['SHOW_YEAR'] - Used in calendar fields. Variable that keeps the shown year.
- G['SHOW_TIME'] - Used in calendar fields. Variable that tells us whether to show the time along with the date
- G['SHOW_SEL'] - Used in calendar fields. Variable that tells us which selector is currently displayed on the left side
- G['posX'] - This is always set to the current mouse X position in pixels.
- G['posY'] - This is always set to the current mouse Y position in pixels.
- G['dragOffsetY'] - Used for drag and drop operations. Set to the difference in pixels between the current mouse Y position and the Y position of the top edge of the drag object.
- G['dragOfsettX'] - Used for drag and drop operations. Set to the difference in pixels between the current mouse X position and the X position of the left edge of the drag object.
- G['dragOBJ'] - Used for drag and drop operations. References the drag object.
- G['IE'] - Set to true if the browser supports the document.all otherwise this is set to false.
- G['ns6'] - Set to true if the browser does not support document.all AND does support document.getElementById otherwise this is set to false.
- G['tooltipTimeout'] - This is set to the return object for the setTimeout() javascript function when the tooltip is to be displayed.
- G['ajaxHelpUpdateTimeout'] - Used when retrieving help or tool tip content via AJAX. This is set to the return value of the setTimeout() that initiates calling AJAX to retrieve the help content.
- G['SCManualInputHasFocus'] - Used in smooth color selector fields. Set to true when the manual input field has focus, or false otherwise.
- G['JSCOVER'] - Used in smooth color selector fields. Holds the setTimeout() variable that hides the color selector when it hasn't been used for a second.
- G['ShowMoveCol'] - This variable determines whether or not to show the drag and drop column when attempting to drag and drop columns to reorder them in the datamanager.
- G['minWidth'] - Used in column resize operations. Set to the minimum width that a column can be in pixels.
- G['dragingColumn'] - Used in column resize operations. References the column that is being resized.
- G['startingX'] - Used in column resize operations. Set to the starting X point where a column resize began.
- G['currentX'] - Used in column resize operations. Set to the current X point where a column resize is currently at.
- G['startingY'] - Used in column resize operations. Set to the starting Y point where a column resize began.
- G['currentY'] - Used in column resize operations. Set to the current Y point where a column resize is currently at.
- G['startingWidth'] - Used in column resize operations. Set to the starting width of the column that is being resized.
- G['ColPadding'] - Used in column resize operations. Set to the number of pixels to add the ending column size when a column has been resized.
- G['isCurrentNoSelect'] - This variable is set to true when the noSelect() javascript function is called. If set, then when the reSelect() javascript function is called, it is actually executed. This speeds up noSelect() / reSelect() operations.
- G['vsMenuOffsetTop'] - Used for cascading drop down menus. The number of pixels to lower (or negative to raise) the menu below the target.
- G['vsMenuOffsetLeft'] - Used for cascading drop down menus. The number of pixels to move the menu to the right (or negative to move to the left) in respect to the left side of the target.
- G['vsMenuOffsetSubTop'] - Used for cascading drop down menus. The number of pixels to lower (or negative to raise) the menu below the target (sub menus only).
- G['vsMenuOffsetSubLeft'] - Used for cascading drop down menus. The number of pixels to move the menu to the right (or negative to move to the left) in respect to the left side of the target (sub menus only).
- G['vsMenuRightOffsetTop'] - Used for cascading drop down menus. The number of pixels to lower (or negative to raise) the right click menu below the mouse.
- G['vsMenuRightOffsetLeft'] - Used for cascading drop down menus. The number of pixels to move the right click menu to the right (or negative to move to the left) in respect to the left side of the mouse.
- G['vsMenuTimeout'] - Used for cascading drop down menus. The number of miliseconds to wait before closing a menu once the mouse has left it.
- G['vsMenuStartMenu'] - Used for cascading drop down menus. Set to 1 when a right click menu is shown and '' when one is not shown.
- G['vsMenuTimeoutHolder'] - Used for cascading drop down menus. This variable holds the return value of the setTimeout() javascript function when a cascading menu is about to be hidden.
There are no comments at this time.