editor.SeamlessField Extends goog.editor.Field
This class encapsulates an editable field that blends in with the surrounding page. To see events fired by this object, please see the base class.

Inheritance

Constructor

goog.editor.SeamlessField(idopt_doc)

Parameters

id : string
An identifer for the field. This is used to find the field and the element associated with this field.
opt_doc : Document=
The document that the element with the given id can be found it.

Instance Methods

Public Protected Private
acquireSizeIframeLockGecko_() boolean
Acquires a lock on resizing the field iframe. This is used to ensure that modifications we make while in a mutation event handler don't cause infinite loops.
Returns: boolean  False if the lock is already acquired.
code »
attachIframe()
No description.
code »
autoDetectFixedHeight_()
Auto-detect whether the current field should have a fixed height.
code »
clearListeners()
No description.
code »
dispatchBlur()
No description.
code »
doFieldSizingGecko()
Perform all the sizing immediately.
code »
getFieldFormatInfo()
No description.
code »
getIframeAttributes()
No description.
code »
getIframeBodyHeightGecko_() number
No description.
Returns: number  The height of the editable iframe's body.
code »
getIframeableCss(opt_forceRegeneration) string
Gets the css rules that should be used to style an iframe's body as if it were the original element that we made editable.
Arguments:
opt_forceRegeneration : boolean=
Set to true to not read the cached copy and instead completely regenerate the css rules.
Returns: string  The string containing the css rules to use.
code »
handleChange()
No description.
code »
handleFieldLoad()
No description.
code »
handleOuterDocChange_()
Resize the iframe in response to the wrapper div changing size.
code »
inheritBlendedCSS()
Applies CSS from the wrapper-div to the field iframe.
code »
installStyles()
No description.
code »
isFixedHeight() boolean
No description.
Returns: boolean  Whether the field should be rendered with a fixed height, or should expand to fit its contents.
code »
makeEditableInternal()
No description.
code »
overrideFixedHeight(newVal)
No description.
Arguments:
newVal : boolean
Explicitly set whether the field should be of a fixed-height. This overrides auto-detection.
code »
releaseSizeIframeLockGecko_()
Releases a lock on resizing the field iframe. This is used to ensure that modifications we make while in a mutation event handler don't cause infinite loops.
code »
restoreDom()
No description.
code »
setIframeableCss(iframeableCss)
Sets the css rules that should be used inside the editable iframe. Note: to clear the css cache between makeNotEditable/makeEditable, call this with "" as iframeableCss. TODO(user): Unify all these css setting methods + Nick's open CL. This is getting ridiculous.
Arguments:
iframeableCss : string
String containing the css rules to use.
code »
setMinHeight(height)
Sets the min height of this editable field's iframe. Only used in growing mode when an iframe is used. This will cause an immediate field sizing to update the field if necessary based on the new min height.
Arguments:
height : number
The min height specified as a number of pixels, e.g., 75.
code »
setupMutationEventHandlersGecko()
No description.
code »
sizeIframeToBodyHeightGecko_()
Sizes the iframe to its body's height.
code »
sizeIframeToWrapperGecko_()
Sizes the iframe to its container div's width. The width of the div is controlled by its containing context, not by its contents. if it extends outside of it's contents, then it gets a horizontal scroll.
code »
turnOnDesignModeGecko()
No description.
code »
usesIframe()
No description.
code »
writeIframeContent()
No description.
code »
addListener(typelisteneropt_captureopt_handler)
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.
Arguments:
type : string | Array.<string>
Event type to listen for or array of event types, for example goog.events.EventType.KEYDOWN.
listener : Function
Function to be used as the listener.
opt_capture : boolean=
Whether to use capture phase (optional, defaults to false).
opt_handler : Object=
Object in whose scope to call the listener.
code »
attachIframe(iframe)
Given the original field element, and the iframe that is destined to become the editable field, styles them appropriately and add the iframe to the dom.
Arguments:
iframe : HTMLIFrameElement
The iframe element.
code »
attachWrapper(wrapper)
Attach an wrapper to this field, to be thrown out when the field is disposed.
Arguments:
wrapper : goog.Disposable
The wrapper to attach.
code »
clearDelayedChange()
Don't wait for the timer and just fire the delayed change event if it's pending.
code »
clearFieldLoadListener_()
Clears fieldLoadListener for a field. Must be called even (especially?) if the field is not yet loaded and therefore not in this.fieldMap_
code »
clearListeners()
Stops all listeners and timers.
code »
debounceEvent(eventType)
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.
Arguments:
eventType : goog.editor.Field.EventType
type of event to debounce.
code »
dispatchBeforeChange()
This dispatches the beforechange event on the editable field
code »
dispatchBeforeFocus_()
Dispatches a before focus event.
code »
dispatchBeforeTab_(e) boolean
This dispatches the beforetab event on the editable field. If this event is cancelled, then the default tab behavior is prevented.
Arguments:
e : goog.events.BrowserEvent
The tab event.
Returns: boolean  The result of dispatchEvent.
code »
dispatchBlur()
Dispatches a blur event.
code »
dispatchChange(opt_noDelay)
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.
Arguments:
opt_noDelay : boolean=
True if goog.editor.Field.EventType.DELAYEDCHANGE should be fired syncronously.
code »
dispatchCommandValueChange(opt_commands)
Dispatches a command value change event.
Arguments:
opt_commands : Array.<string>>
Commands whose state has changed.
code »
dispatchDelayedChange_()
Dispatch a delayed change event.
code »
dispatchFocusAndBeforeFocus_()
Dispatch beforefocus and focus for FF. Note that both of these actually happen in the document's "focus" event. Unfortunately, we don't actually have a way of getting in before the focus event in FF (boo! hiss!). In IE, we use onfocusin for before focus and onfocus for focus.
code »
dispatchFocus_()
Dispatches a focus event.
code »
dispatchLoadEvent_()
Signal that the field is loaded and ready to use. Change events now are in effect.
code »
dispatchSelectionChangeEvent(opt_eopt_target)
Dispatch a selection change event, optionally caused by the given browser event or selecting the given target.
Arguments:
opt_e : goog.events.BrowserEvent=
Optional browser event causing this event.
opt_target : Node=
The node the selection changed to.
code »
disposeInternal()
No description.
code »
execCommand(commandvar_args) *
Executes an editing command as per the registered plugins.
Arguments:
command : string
The command to execute.
var_args : ...*
Any additional parameters needed to execute the command.
Returns: *  False if the command wasn't handled, otherwise, the result of the command.
code »
focus()
Gives the field focus.
code »
focusAndPlaceCursorAtStart()
Gives the field focus and places the cursor at the start of the field.
code »
getAppWindow() !Window
Returns the "application" window, where dialogs and bubbles should be rendered.
Returns: !Window  The window.
code »
getBaseZindex() number
Returns the zindex of the base level of the field.
Returns: number  The base zindex of the editor.
code »
getCleanContents() string
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: string  The scrubbed contents of the field.
code »
getEditableDomHelper() ?goog.dom.DomHelper
No description.
Returns: ?goog.dom.DomHelper  The dom helper for the editable node.
code »
getEditableIframe() HTMLIFrameElement
No description.
Returns: HTMLIFrameElement  The iframe that's body is editable.
code »
getElement() Element
Returns the editable DOM element or null if this field is not editable.

On IE or Safari this is the element with contentEditable=true (in whitebox mode, the iFrame body).

On Gecko this is the iFrame body TODO(user): How do we word this for subclass version?

Returns: Element  The editable DOM element, defined as above.
code »
getFieldCopy() !Element
Get the copy of the editable field element, which has the innerHTML set correctly.
Returns: !Element  The copy of the editable field.
code »
getFieldFormatInfo(extraStyles) !goog.editor.icontent.FieldFormatInfo
No description.
Arguments:
extraStyles : Object
A map of extra styles.
Returns: !goog.editor.icontent.FieldFormatInfo  The FieldFormatInfo object for this field's configuration.
code »
getHashCode() string
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: string  The hash code for this editable field.
code »
getIframeAttributes() !Object
No description.
Returns: !Object  Get the HTML attributes for this field's iframe.
code »
getInjectableContents(contentsstyles) string
Returns prepared contents that can be injected into the editable field.
Arguments:
contents : ?string
The contents to prepare.
styles : Object
A map that will be populated with styles that should be applied to the field element together with the contents.
Returns: string  The prepared contents.
code »
getOriginalElement() Element
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: Element  The original element.
code »
getPluginByClassId(classId) goog.editor.Plugin
Returns the registered plugin with the given classId.
Arguments:
classId : string
classId of the plugin.
Returns: goog.editor.Plugin  Registered plugin with the given classId.
code »
getRange() ?goog.dom.AbstractRange
No description.
Returns: ?goog.dom.AbstractRange  Closure range object wrapping the selection in this field or null if this field is not currently editable.
code »
handleBeforeChangeKeyEvent_(e) boolean
Handle before change key events and fire the beforetab event if appropriate. This needs to happen on keydown in IE and keypress in FF.
Arguments:
e : goog.events.BrowserEvent
The browser event.
Returns: boolean  Whether to still perform the default key action. Only set to true if the actual event has already been canceled.
code »
handleChange()
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.
code »
handleDomAttrChange(handlerbrowserEvent)
Fires a change event only if the attribute change effects the editiable field. We ignore events that are internal browser events (ie scrollbar state change)
Arguments:
handler : Function
The function to call if this is not an internal browser event.
browserEvent : goog.events.BrowserEvent
The browser event.
code »
handleDragStart_(e)
Handle drag start. Needs to cancel listening for the mouse up event on the window.
Arguments:
e : goog.events.BrowserEvent
The event.
code »
handleDrop_(e)
Handle drop events. Deal with focus/selection issues and set the document as changed.
Arguments:
e : goog.events.BrowserEvent
The browser event.
code »
handleFieldLoad()
Handle the loading of the field (e.g. once the field is ready to setup). TODO(user): this should probably just be moved into dispatchLoadEvent_.
code »
handleKeyDown_(e)
Handles keydown on the field.
Arguments:
e : goog.events.BrowserEvent
The browser event.
code »
handleKeyPress_(e)
Handles keypress on the field.
Arguments:
e : goog.events.BrowserEvent
The browser event.
code »
handleKeyUp_(e)
Handles keyup on the field.
Arguments:
e : goog.events.BrowserEvent
The browser event.
code »
handleKeyboardShortcut_(e)
Handles keyboard shortcuts on the field. Note that we bake this into our handleKeyPress/handleKeyDown rather than using goog.events.KeyHandler or goog.ui.KeyboardShortcutHandler for performance reasons. Since these are handled on every key stroke, we do not want to be going out to the event system every time.
Arguments:
e : goog.events.BrowserEvent
The browser event.
code »
handleMouseDown_(e)
Handle mouse down inside the editable field.
Arguments:
e : goog.events.BrowserEvent
The event.
code »
handleMouseUp_(e)
Handle mouse up inside the editable field.
Arguments:
e : goog.events.BrowserEvent
The event.
code »
handleMutationEventGecko_(e)
Handle a mutation event.
Arguments:
e : goog.events.BrowserEvent | Event
The browser event.
code »
handleSelectionChangeTimer_()
Dispatch a selection change event using a browser event that was asynchronously saved earlier.
code »
iframeFieldLoadHandler(iframeinnerHtmlstyles)
The function to call when the editable iframe loads.
Arguments:
iframe : HTMLIFrameElement
Iframe that just loaded.
innerHtml : string
Html to put inside the body of the iframe.
styles : Object
Property-value map of CSS styles to install on editable field.
code »
inModalMode() boolean
No description.
Returns: boolean  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.
code »
injectContents(contentsfield)
Prepare the given contents, then inject them into the editable field.
Arguments:
contents : ?string
The contents to prepare.
field : Element
The field element.
code »
installStyles()
Installs styles if needed. Only writes styles when they can't be written inline directly into the field.
code »
invokeOp_(opvar_args)
Invoke this operation on all plugins with the given arguments.
Arguments:
op : goog.editor.Plugin.Op
A plugin op.
var_args : ...*
The arguments to the plugin.
code »
invokeShortCircuitingOp_(opvar_args) boolean
Calls all the plugins of the given operation, in sequence, with the given arguments. This is short-circuiting: once one plugin cancels the event, no more plugins will be invoked.
Arguments:
op : goog.editor.Plugin.Op
A plugin op.
var_args : ...*
The arguments to the plugin.
Returns: boolean  True if one of the plugins cancel the event, false otherwise.
code »
isEventStopped(eventType) boolean
Checks if the event of the given type has stopped being dispatched
Arguments:
eventType : goog.editor.Field.EventType
type of event to check.
Returns: boolean  true if the event has been stopped with stopEvent().
code »
isFixedHeight() boolean
No description.
Returns: boolean  Whether the field should be rendered with a fixed height, or should expand to fit its contents.
code »
isLoaded() boolean
No description.
Returns: boolean  Whether the field has finished loading.
code »
isLoading() boolean
No description.
Returns: boolean  Whether the field is in the process of loading.
code »
isModified(opt_useIsEverModified) boolean
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.
Arguments:
opt_useIsEverModified : boolean=
Set to true to check if the field has ever been modified since it was created, otherwise checks if the field has been modified since the last goog.editor.Field.EventType.DELAYEDCHANGE event was dispatched.
Returns: boolean  Whether the field has been modified.
code »
isSelectionEditable() boolean
No description.
Returns: boolean  Whether the selection is editable.
code »
isUneditable() boolean
No description.
Returns: boolean  Whether the field is uneditable.
code »
makeEditable(opt_iframeSrc)
Makes a field editable.
Arguments:
opt_iframeSrc : string=
URL to set the iframe src to if necessary.
code »
makeEditableInternal(opt_iframeSrc)
Handles actually making something editable - creating necessary nodes, injecting content, etc.
Arguments:
opt_iframeSrc : string=
URL to set the iframe src to if necessary.
code »
makeIframeField_(opt_iframeSrc)
Start the editable iframe creation process for Mozilla or IE whitebox. The iframes load asynchronously.
Arguments:
opt_iframeSrc : string=
URL to set the iframe src to if necessary.
code »
makeUneditable(opt_skipRestore)
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.
Arguments:
opt_skipRestore : boolean=
True to prevent copying of editable field contents back into the original node.
code »
manipulateDom(funcopt_preventDelayedChangeopt_handler)
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.
Arguments:
func : function()
The function to call that will manipulate the dom.
opt_preventDelayedChange : boolean=
Whether delayed change should be prevented after calling func. Defaults to always firing delayed change.
opt_handler : Object=
Object in whose scope to call the listener.
code »
placeCursorAtEnd()
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.
code »
placeCursorAtStart()
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.
code »
placeCursorAtStartOrEnd_(isStart)
Helper method to place the cursor at the start or end of this field.
Arguments:
isStart : boolean
True for start, false for end.
code »
queryCommandValue(commands) *
Gets the value of command(s).
Arguments:
commands : string | Array.<string>
String name(s) of the command.
Returns: *  Value of each command. Returns false (or array of falses) if designMode is off or the field is otherwise uneditable, and there are no activeOnUneditable plugins for the command.
code »
queryCommandValueInternal_(commandisEditable) *
Gets the value of this command.
Arguments:
command : string
The command to check.
isEditable : boolean
Whether the field is currently editable.
Returns: *  The state of this command. Null if not handled. False if the field is uneditable and there are no handlers for uneditable commands.
code »
reduceOp_(opargvar_args) string
Reduce this argument over all plugins. The result of each plugin invocation will be passed to the next plugin invocation. See goog.array.reduce.
Arguments:
op : goog.editor.Plugin.Op
A plugin op.
arg : string
The argument to reduce. For now, we assume it's a string, but we should widen this later if there are reducing plugins that don't operate on strings.
var_args : ...*
Any extra arguments to pass to the plugin. These args will not be reduced.
Returns: string  The reduced argument.
code »
registerPlugin(plugin)
Registers the plugin with the editable field.
Arguments:
plugin : goog.editor.Plugin
The plugin to register.
code »
removeAllWrappers()
Removes all wrappers and destroys them.
code »
resetOriginalElemProperties()
Reset the properties on the original field element to how it was before it was made editable.
code »
restoreDom()
Restores the dom to how it was before being made editable.
code »
restoreSavedRange(opt_range)
Restore a saved range, and set the focus on the field. If no range is specified, we simply set the focus.
Arguments:
opt_range : goog.dom.SavedRange=
A previously saved selected range.
code »
setAppWindow(appWindow)
Sets the application window.
Arguments:
appWindow : !Window
The window where dialogs and bubbles should be rendered.
code »
setBaseZindex(zindex)
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?
Arguments:
zindex : number
The base zIndex of the editor.
code »
setHtml(addParashtmlopt_dontFireDelayedChangeopt_applyLorem)
Sets the contents of the field.
Arguments:
addParas : boolean
Boolean to specify whether to add paragraphs to long fields.
html : ?string
html to insert. If html=null, then this defaults to a nsbp for mozilla and an empty string for IE.
opt_dontFireDelayedChange : boolean=
True to make this content change not fire a delayed change event.
opt_applyLorem : boolean=
Whether to apply lorem ipsum styles.
code »
setInitialStyle(cssText)
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.
Arguments:
cssText : string
The value of the style attribute.
code »
setInnerHtml_(html)
Sets the inner HTML of the field. Works on both editable and uneditable fields.
Arguments:
html : ?string
The new inner HTML of the field.
code »
setModalMode(inModalMode)
No description.
Arguments:
inModalMode : boolean
Sets whether we're in modal interaction mode.
code »
setUseWindowMouseUp(flag)
Sets flag to control whether to use window mouse up after seeing a mouse down operation on the field.
Arguments:
flag : boolean
True to track window mouse up.
code »
setupChangeListeners_()
Initialize listeners on the field.
code »
setupFieldObject(field)
Sets up the field object and window util of this field, and enables this editable field with all registered plugins. This is essential to the initialization of the field. It must be called when the field becomes fully loaded and editable.
Arguments:
field : Element
The field property.
code »
setupMutationEventHandlersGecko()
Mutation events tell us when something has changed for mozilla.
code »
shouldLoadAsynchronously() boolean
Returns true if the field needs to be loaded asynchrnously.
Returns: boolean  True if loads are async.
code »
shouldRefocusOnInputMobileSafari() boolean
No description.
Returns: boolean  Whether the field should be refocused on input. This is a workaround for the iOS bug that text input doesn't work when the main window listens touch events.
code »
startChangeEvents(opt_fireChangeopt_fireDelayedChange)
Start change events again and fire once if desired.
Arguments:
opt_fireChange : boolean=
Whether to fire the change event immediately.
opt_fireDelayedChange : boolean=
Whether to fire the delayed change event immediately.
code »
startEvent(eventType)
Re-starts the event of the given type being dispatched, if it had previously been stopped with stopEvent().
Arguments:
eventType : goog.editor.Field.EventType
type of event to start.
code »
stopChangeEvents(opt_stopChangeopt_stopDelayedChange)
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.
Arguments:
opt_stopChange : boolean=
Whether to ignore base change events.
opt_stopDelayedChange : boolean=
Whether to ignore delayed change events.
code »
stopEvent(eventType)
Stops the event of the given type from being dispatched.
Arguments:
eventType : goog.editor.Field.EventType
type of event to stop.
code »
tearDownFieldObject_()
Help make the field not editable by setting internal data structures to null, and disabling this field with all registered plugins.
code »
turnOnDesignModeGecko()
Attemps to turn on designMode for a document. This function can fail under certain circumstances related to the load event, and will throw an exception.
code »
unregisterPlugin(plugin)
Unregisters the plugin with this field.
Arguments:
plugin : goog.editor.Plugin
The plugin to unregister.
code »
usesIframe() boolean
No description.
Returns: boolean  Whether the field is implemented as an iframe.
code »
writeIframeContent(iframeinnerHtmlextraStyles)
Writes the html content into the iframe. Handles writing any aditional styling as well.
Arguments:
iframe : HTMLIFrameElement
Iframe to write contents into.
innerHtml : string
The html content to write into the iframe.
extraStyles : Object
A map of extra style attributes.
code »
addEventListener(typeopt_captureopt_handlerScope)
Use #listen instead, when possible. Otherwise, use goog.events.listen if you are passing Object (instead of Function) as handler. Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.
Arguments:
type : string
The type of the event to listen for.
: ?function():? | ?{handleEvent:function():?
No description.
opt_capture : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope : Object=
Object in whose scope to call the listener.
code »
assertInitialized_()
Asserts that the event target instance is initialized properly.
code »
dispatchEvent()
No description.
code »
disposeInternal()
Removes listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners.
code »
fireListeners()
No description.
code »
getListener()
No description.
code »
getListeners()
No description.
code »
getParentEventTarget() goog.events.EventTarget
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget  The parent EventTarget or null if there is no parent.
code »
hasListener()
No description.
code »
listen()
No description.
code »
listenOnce()
No description.
code »
removeAllListeners()
No description.
code »
removeEventListener(typeopt_captureopt_handlerScope)
Use #unlisten instead, when possible. Otherwise, use goog.events.unlisten if you are passing Object (instead of Function) as handler. Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.
Arguments:
type : string
The type of the event to listen for.
: ?function():? | ?{handleEvent:function():?
No description.
opt_capture : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope : Object=
Object in whose scope to call the listener.
code »
setParentEventTarget(parent)
Sets the parent of this event target to use for capture/bubble mechanism.
Arguments:
parent : goog.events.EventTarget
Parent listenable (null if none).
code »
setTargetForTesting(target)
Sets the target to be used for event.target when firing event. Mainly used for testing. For example, see goog.testing.events.mixinListenable.
Arguments:
target : !Object
The target.
code »
unlisten()
No description.
code »
unlistenByKey()
No description.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
  mypackage.MyClass = function() {
    mypackage.MyClass.base(this, 'constructor');
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    mypackage.MyClass.base(this, 'disposeInternal');
  };
code »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

constructor :
No description.
Code »
iframeableCss_ :
String containing the css rules that, if applied to a document's body, would style that body as if it were the original element we made editable. See goog.cssom.iframe.style.getElementContext for more details.
Code »
isFixedHeightOverridden_ :
Whether the fixed-height handling has been overridden manually.
Code »
isFixedHeight_ :
Whether the field should be rendered with a fixed height, or should expand to fit its contents.
Code »
listenForDragOverEventKey_ :
The key used for listening for the "dragover" event.
Code »
listenForIframeLoadEventKey_ :
The key used for listening for the iframe "load" event.
Code »
appWindow_ :
The window where dialogs and bubbles should be rendered.
Code »
changeTimerGecko_ : goog.async.Delay
No description.
Code »
constructor :
No description.
Code »
cssStyles :
Additional styles to install for the editable field.
Code »
debouncedEvents_ :
No description.
Code »
delayedChangeTimer_ : goog.async.Delay
No description.
Code »
editableDomHelper : goog.dom.DomHelper
Dom helper for the editable node.
Code »
eventRegister : goog.events.EventHandler
No description.
Code »
field :
The editable dom node.
Code »
hashCode_ :
The hash code for this field. Should be equal to the id.
Code »
id :
The id for this editable field, which must match the id of the element associated with this field.
Code »
inModalMode_ :
Whether this field is in "modal interaction" mode. This usually means that it's being edited by a dialog.
Code »
indexedPlugins_ :
Plugins registered on this field, indexed by the goog.editor.Plugin.Op that they support.
Code »
isEverModified_ :
No description.
Code »
isModified_ :
No description.
Code »
loadState_ :
No description.
Code »
Logging object.
Code »
originalDomHelper : goog.dom.DomHelper
The dom helper for the node to be made editable.
Code »
originalElement :
The original node that is being made editable, or null if it has not yet been found.
Code »
plugins_ :
Map of class id to registered plugin.
Code »
selectionChangeTarget_ :
Target node to be used when dispatching SELECTIONCHANGE asynchronously on mouseup (to avoid IE quirk). Should be set just before starting the timer and nulled right after consuming.
Code »
stoppedEvents_ :
No description.
Code »
useWindowMouseUp_ :
Flag controlling wether to capture mouse up events on the window or not.
Code »
waitingForMouseUp_ :
FLag indicating the handling of a mouse event sequence.
Code »
wrappers_ :
No description.
Code »
actualEventTarget_ : goog.events.EventTarget
The object to use for event.target. Useful when mixing in an EventTarget to another object.
Code »
constructor :
No description.
Code »
eventTargetListeners_ : goog.events.ListenerMap
Maps of event type to an array of listeners.
Code »
parentEventTarget_ : goog.events.EventTarget
Parent event target, used during event bubbling. TODO(user): Change this to goog.events.Listenable. This currently breaks people who expect getParentEventTarget to return goog.events.EventTarget.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Methods

goog.editor.SeamlessField.getScrollbarWidth_() number
Grabs the width of a scrollbar from the browser and caches the result.
Returns: number  The scrollbar width in pixels.
code »

Static Properties

goog.editor.SeamlessField.haveInstalledCss_ :
Used to ensure that CSS stylings are only installed once for none iframe seamless mode. TODO(user): Make it a formal part of the API that you can only set one set of styles globally. In seamless, non-iframe mode, all the stylings would go in the same document and conflict.
Code »
goog.editor.SeamlessField.scrollbarWidth_ :
No description.
Code »
goog.editor.SeamlessField.superClass_ :
No description.
Code »

Package editor

Package Reference