field.js
Class to encapsulate an editable field. Always uses an iframe to contain the editable area, never inherits the style of the surrounding page, and is always a fixed height.

File Location

editor/field.js

Classes

goog.editor.Field
This class encapsulates an editable field. event: load Fires when the field is loaded event: unload Fires when the field is unloaded (made not editable) event: beforechange Fires before the content of the field might change event: delayedchange Fires a short time after field has changed. If multiple change events happen really close to each other only the last one will trigger the delayedchange event. event: beforefocus Fires before the field becomes active event: focus Fires when the field becomes active. Fires after the blur event event: blur Fires when the field becomes inactive TODO: figure out if blur or beforefocus fires first in IE and make FF match

Public Protected Private

Global Functions

goog.editor.Field.cancelLinkClick_(e)
Event handler for clicks in browsers that will follow a link when the user clicks, even if it's editable. We stop the click manually
Arguments:
e :
The event.
code »
goog.editor.Field.getActiveFieldId()
No description.
Returns:   The id of the active field.
code »
goog.editor.Field.isGeneratingKey_(etestAllKeys)
Returns true if the keypress generates a change in contents.
Arguments:
e :
The event.
testAllKeys :
True to test for all types of generating keys. False to test for only the keys found in goog.editor.Field.KEYS_CAUSING_CHANGES_.
Returns:   Whether the keypress generates a change in contents.
code »
goog.editor.Field.isSpecialGeneratingKey_(e)
Returns true if the keypress generates a change in the contents. due to a special key listed in goog.editor.Field.KEYS_CAUSING_CHANGES_
Arguments:
e :
The event.
Returns:   Whether the keypress generated a change in the contents.
code »
goog.editor.Field.setActiveFieldId(fieldId)
Sets the active field id.
Arguments:
fieldId :
The active field id.
code »

Global Properties

goog.editor.Field.CHANGE_FREQUENCY :
Number of milliseconds after a change when the change event should be fired.
Code »
goog.editor.Field.CTRL_KEYS_CAUSING_CHANGES_ :
Map of keyCodes (not charCodes) that when used in conjunction with the Ctrl key cause changes in the field contents. These are the keys that are not handled by basic formatting trogedit plugins.
Code »
goog.editor.Field.CTRL_KEYS_CAUSING_SELECTION_CHANGES_ :
Map of keyCodes (not charCodes) that when used in conjunction with the Ctrl key cause selection changes in the field contents. These are the keys that are not handled by the basic formatting trogedit plugins. Note that combinations like Ctrl-left etc are already handled in SELECTION_CHANGE_KEYCODES_
Code »
goog.editor.Field.DEBOUNCE_TIME_MS_ :
The amount of time that a debounce blocks an event. TODO: As of 9/30/07, this is only used for blocking a keyup event after a keydown. We might need to tweak this for other types of events. Maybe have a per-event debounce time?
Code »
goog.editor.Field.DELAYED_CHANGE_FREQUENCY :
Number of milliseconds between delayed change events.
Code »
goog.editor.Field.KEYS_CAUSING_CHANGES_ :
Map of keyCodes (not charCodes) that cause changes in the field contents.
Code »
goog.editor.Field.MUTATION_EVENTS_GECKO :
List of mutation events in Gecko browsers.
Code »
goog.editor.Field.POTENTIAL_SHORTCUT_KEYCODES_ :
Map of keyCodes (not charCodes) that might need to be handled as a keyboard shortcut (even when ctrl/meta key is not pressed) by some plugin. Currently it is a small list. If it grows too big we can optimize it by using ranges or extending it from SELECTION_CHANGE_KEYCODES_
Code »
goog.editor.Field.SELECTION_CHANGE_FREQUENCY_ :
Frequency to check for selection changes.
Code »
goog.editor.Field.activeFieldId_ :
There is at most one "active" field at a time. By "active" field, we mean a field that has focus and is being used.
Code »

Directory editor

File Reference