Class type Goog.​Geditor.​field

class type field = object..end


method inModalMode : bool Js.t Js.meth

Returns Whether we're in modal interaction mode. When this returns true, another plugin is interacting with the field contents in a synchronous way, and expects you not to make changes to the field's DOM structure or selection.

method setModalMode : bool Js.t -> unit Js.meth
method getHashCode : Js.js_string Js.t Js.meth

Returns a string usable as a hash code for this field. For field's that were created with an id, the hash code is guaranteed to be the id. TODO(user): I think we can get rid of this. Seems only used from editor.

Returns The hash code for this editable field.

method getElement : Dom_html.element Js.t Js.meth

Returns the editable DOM element or null if this field is not editable. <p>On IE or Safari this is the element with contentEditable=true (in whitebox mode, the iFrame body). <p>On Gecko this is the iFrame body TODO(user): How do we word this for subclass version?

Returns The editable DOM element, defined as above.

method getOriginalElement : Dom_html.element Js.t Js.meth

Returns original DOM element that is being made editable by Trogedit or null if that element has not yet been found in the appropriate document.

Returns The original element.

method addListener : 
(Js.js_string Js.t, Js.js_string Js.t Js.js_array Js.t) Goog.Tools.Union.t ->
(unit -> unit) Js.callback -> bool Js.t Js.opt -> unit Js.meth

Registers a keyboard event listener on the field. This is necessary for Gecko since the fields are contained in an iFrame and there is no way to auto-propagate key events up to the main window.

method getPluginByClassId : Js.js_string Js.t -> plugin Js.t Js.meth

Returns the registered plugin with the given classId.

Returns Registered plugin with the given classId.

method setInitialStyle : Js.js_string Js.t -> unit Js.meth

Sets the value that will replace the style attribute of this field's element when the field is made non-editable. This method is called with the current value of the style attribute when the field is made editable.

method resetOriginalElemProperties : unit Js.meth

Reset the properties on the original field element to how it was before it was made editable.

method isModified : bool Js.t Js.opt -> bool Js.t Js.meth

Checks the modified state of the field. Note: Changes that take place while the goog.editor.Field.EventType.CHANGE event is stopped do not effect the modified state.

Returns Whether the field has been modified.

method usesIframe : bool Js.t Js.meth

Returns Whether the field is implemented as an iframe.

method isFixedHeight : bool Js.t Js.meth

Returns Whether the field should be rendered with a fixed height, or should expand to fit its contents.

method setAppWindow : Dom_html.window Js.t -> unit Js.meth

Sets the application window.

method getAppWindow : Dom_html.window Js.t Js.meth

Returns the "application" window, where dialogs and bubbles should be rendered.

Returns The window.

method setBaseZindex : int -> unit Js.meth

Sets the zIndex that the field should be based off of. TODO(user): Get rid of this completely. Here for Sites. Should this be set directly on UI plugins?

method getBaseZindex : int Js.meth

Returns the zindex of the base level of the field.

Returns The base zindex of the editor.

method disposeInternal : unit Js.meth

Removes all listeners and destroys the eventhandler object.

method attachWrapper : 
'a. (#Goog.Disposable.disposable as 'a) Js.t -> unit Js.meth

Attach an wrapper to this field, to be thrown out when the field is disposed.

method removeAllWrappers : unit Js.meth

Removes all wrappers and destroys them.

method getInjectableContents : 
Js.js_string Js.t -> Js.js_string Js.t Js.meth

Returns prepared contents that can be injected into the editable field.

Returns The prepared contents.

method getEditableDomHelper : Goog.Gdom.domHelper Js.t Js.opt Js.meth

Returns The dom helper for the editable node.

method dispatchSelectionChangeEvent : 
'b. (#Goog.Events.browserEvent as 'b) Js.t -> unit Js.meth

Dispatch a selection change event, optionally caused by the given browser event.

method dispatchBeforeChange : unit Js.meth

This dispatches the beforechange event on the editable field

method stopChangeEvents : 
bool Js.t Js.opt -> bool Js.t Js.opt -> unit Js.meth

Temporarily ignore change events. If the time has already been set, it will fire immediately now. Further setting of the timer is stopped and dispatching of events is stopped until startChangeEvents is called.

method startChangeEvents : 
bool Js.t Js.opt -> bool Js.t Js.opt -> unit Js.meth

Start change events again and fire once if desired.

method stopEvent : Js.js_string Js.t -> unit Js.meth

Stops the event of the given type from being dispatched.

method startEvent : Js.js_string Js.t -> unit Js.meth

Re-starts the event of the given type being dispatched, if it had previously been stopped with stopEvent().

method debounceEvent : Js.js_string Js.t Js.meth

Block an event for a short amount of time. Intended for the situation where an event pair fires in quick succession (e.g., mousedown/mouseup, keydown/keyup, focus/blur), and we want the second event in the pair to get "debounced."

WARNING: This should never be used to solve race conditions or for mission-critical actions. It should only be used for UI improvements, where it's okay if the behavior is non-deterministic.

method manipulateDom : 
(unit -> unit) Js.callback -> bool Js.t Js.opt -> unit Js.meth

Calls a function to manipulate the dom of this field. This method should be used whenever Trogedit clients need to modify the dom of the field, so that delayed change events are handled appropriately. Extra delayed change events will cause undesired states to be added to the undo-redo stack. This method will always fire at most one delayed change event, depending on the value of opt_preventDelayedChange.

method dispatchCommandValueChange : 
Js.js_string Js.t Js.js_array Js.t -> unit Js.meth

Dispatches a command value change event.

method dispatchChange : bool Js.t Js.opt -> unit Js.meth

Dispatches the appropriate set of change events. This only fires synchronous change events in blended-mode, iframe-using mozilla. It just starts the appropriate timer for goog.editor.Field.EventType.DELAYEDCHANGE. This also starts up change events again if they were stopped.

method handleChange : unit Js.meth

Handle a change in the Editable Field. Marks the field has modified, dispatches the change event on the editable field (moz only), starts the timer for the delayed change event. Note that these actions only occur if the proper events are not stopped.

method clearDelayedChange : unit Js.meth

Don't wait for the timer and just fire the delayed change event if it's pending.

method isSelectionEditable : bool Js.t Js.meth

Returns Whether the selection is editable.

method getCleanContents : Js.js_string Js.t Js.meth

Retrieve the HTML contents of a field.

Do NOT just get the innerHTML of a field directly--there's a lot of processing that needs to happen.

Returns The scrubbed contents of the field.

method setHtml : 
bool Js.t ->
Js.js_string Js.t Js.opt ->
bool Js.t Js.opt -> bool Js.t Js.opt -> unit Js.meth

Sets the contents of the field.

method isUneditable : bool Js.t Js.meth

Returns Whether the field is uneditable.

method isLoaded : bool Js.t Js.meth

Returns Whether the field has finished loading.

method isLoading : bool Js.t Js.meth

Returns Whether the field is in the process of loading.

method focus : unit Js.meth

Gives the field focus.

method focusAndPlaceCursorAtStart : unit Js.meth

Gives the field focus and places the cursor at the start of the field.

method placeCursorAtStart : unit Js.meth

Place the cursor at the start of this field. It's recommended that you only use this method (and manipulate the selection in general) when there is not an existing selection in the field.

method makeEditable : Js.js_string Js.t Js.opt -> unit Js.meth

Makes a field editable.

method makeUneditable : bool Js.t Js.opt -> unit Js.meth

Closes the field and cancels all pending change timers. Note that this means that if a change event has not fired yet, it will not fire. Clients should check fieldOj.isModified() if they depend on the final change event. Throws an error if the field is already uneditable.