Creates a new instance of the dialog and registers for the relevant events.
Arguments:
Returns: !goog.ui.editor.LinkDialog
The dialog.
|
code » | |||
![]()
No description.
|
code » | |||
![]()
Handles execCommand by opening the dialog.
Arguments:
Returns: *
Always returns true, indicating the dialog was shown.
|
code » | |||
No description.
Returns: goog.editor.Link
The link being edited.
|
code » | |||
No description.
Returns: goog.events.EventHandler.<T>
The event handler.
|
code » | |||
Returns whether the"open link in new window" checkbox was checked last time
the dialog was closed.
Returns: boolean
Whether the"open link in new window" checkbox was checked
last time the dialog was closed.
|
code » | |||
![]()
Handles when the dialog closes.
Arguments:
|
code » | |||
![]()
Handles the BeforeTestLink event fired when the 'test' link is clicked.
Arguments:
|
code » | |||
![]()
Handles the CANCEL event from the dialog by clearing the anchor if needed.
Arguments:
|
code » | |||
![]()
Handles the OK event from the dialog by updating the link in the field.
Arguments:
|
code » | |||
Determines whether or not a url has a scheme which is safe to open.
Schemes like javascript are unsafe due to the possibility of XSS.
|
code » | |||
![]()
Tells the plugin whether to block URLs with schemes not in the whitelist.
If blocking is enabled, this plugin will stop the 'Test Link' popup
window from being created. Blocking doesn't affect link creation--if the
user clicks the 'OK' button with an unsafe URL, the link will still be
created as normal.
Arguments:
|
code » | |||
![]()
Sets the warning message to show to users about including email addresses on
public web pages.
Arguments:
|
code » | |||
![]()
Sets a whitelist of allowed URL schemes that are safe to open.
Schemes should all be in lowercase. If the plugin is set to block opening
unsafe schemes, user-entered URLs will be converted to lowercase and checked
against this list. The whitelist has no effect if blocking is not enabled.
|
code » | |||
Checks whether the plugin should open the given url in a new window.
|
code » | |||
![]()
Tells the dialog to show a checkbox where the user can choose to have the
link open in a new window.
Arguments:
|
code » | |||
![]()
Tells the dialog to show a checkbox where the user can choose to have
'rel=nofollow' attribute added to the link.
|
code » | |||
![]()
Tells the plugin to stop leaking the page's url via the referrer header when
the "test this link" link is clicked. When the user clicks on a link, the
browser makes a request for the link url, passing the url of the current page
in the request headers. If the user wants the current url to be kept secret
(e.g. an unpublished document), the owner of the url that was clicked will
see the secret url in the request headers, and it will no longer be a secret.
Calling this method will not send a referrer header in the request, just as
if the user had opened a blank window and typed the url in themselves.
|
code » | |||
![]()
Apply the necessary properties to a link upon Ok being clicked in the dialog.
Arguments:
|
code » |
Creates a new instance of this plugin's dialog. Must be overridden by
subclasses.
Arguments:
Returns: goog.ui.editor.AbstractDialog
The newly created dialog.
|
code » | |||
![]()
Disposes of the dialog if needed. It is this abstract class' responsibility
to dispose of the dialog. The "if needed" refers to the fact this method
might be called twice (nested calls, not sequential) in the dispose flow, so
if the dialog was already disposed once it should not be disposed again.
|
code » | |||
![]()
No description.
|
code » | |||
![]()
Cleans up the structure used to save the original selection before the dialog
was opened. Should be used by subclasses that don't restore the original
selection via restoreOriginalSelection.
|
code » | |||
![]()
Handles execCommand. Dialog plugins don't make any changes when they open a
dialog, just when the dialog closes (because only modal dialogs are
supported). Hence this method does not dispatch the change events that the
superclass method does.
Arguments:
Returns: *
The result of the execCommand, if any.
|
code » | |||
![]()
Handles execCommand by opening the dialog. Dispatches
goog.editor.plugins.AbstractDialogPlugin.EventType.OPENED after the
dialog is shown.
Arguments:
Returns: *
Always returns true, indicating the dialog was shown.
|
code » | |||
Returns the current dialog that was created and opened by this plugin.
Returns: goog.ui.editor.AbstractDialog
The current dialog that was created
and opened by this plugin.
|
code » | |||
![]()
Cleans up after the dialog has closed, including restoring the selection to
what it was before the dialog was opened. If a subclass modifies the editable
field's content such that the original selection is no longer valid (usually
the case when the user clicks OK, and sometimes also on Cancel), it is that
subclass' responsibility to place the selection in the desired place during
the OK or Cancel (or other) handler. In that case, this method will leave the
selection in place.
Arguments:
|
code » | |||
![]()
No description.
|
code » | |||
![]()
Restores the selection in the editable field to what it was before the dialog
was opened. This is not guaranteed to work if the contents of the field
have changed.
|
code » | |||
![]()
Sets whether this plugin should reuse the same instance of the dialog each
time execCommand is called or create a new one. This is intended for use by
subclasses only, hence protected.
Arguments:
|
code » |
No description.
Returns: boolean
If true, field will not disable the command
when the field becomes uneditable.
|
code » | ||||
![]()
Cleans the contents of the node passed to it. The node contents are modified
directly, and the modifications will subsequently be used, for operations
such as saving the innerHTML of the editor etc. Since the plugins act on
the DOM directly, this method can be very expensive.
This op is invoked even on disabled plugins.
Arguments:
|
code » | ||||
Cleans the html contents of Trogedit. Both cleanContentsDom and
and cleanContentsHtml will be called on contents extracted from Trogedit.
The inverse of prepareContentsHtml.
This op is invoked even on disabled plugins.
|
code » | ||||
![]()
Disables this plugin for the specified, registered field object.
Arguments:
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
Enables this plugin for the specified, registered field object. A field
object should only be enabled when it is loaded.
Arguments:
|
code » | ||||
![]()
Handles execCommand. This default implementation handles dispatching
BEFORECHANGE, CHANGE, and SELECTIONCHANGE events, and calls
execCommandInternal to perform the actual command. Plugins that want to
do their own event dispatching should override execCommand, otherwise
it is preferred to only override execCommandInternal.
This version of execCommand will only work for single field plugins.
Multi-field plugins must override execCommand.
Arguments:
Returns: *
The result of the execCommand, if any.
|
code » | ||||
![]()
Handles execCommand. This default implementation does nothing, and is
called by execCommand, which handles event dispatching. This method should
be overriden by plugins that don't need to do their own event dispatching.
If custom event dispatching is needed, execCommand shoul be overriden
instead.
Arguments:
Returns: *
The result of the execCommand, if any.
|
code » | ||||
No description.
Returns: ?goog.dom.DomHelper
The dom helper object associated with the
currently active field.
|
code » | ||||
Sets the field object for use with this plugin.
Returns: goog.editor.Field
The editable field object.
|
code » | ||||
No description.
Returns: string
The ID unique to this plugin class. Note that different
instances off the plugin share the same classId.
|
code » | ||||
Handles keydown. It is run before handleKeyboardShortcut and if it returns
true handleKeyboardShortcut will not be called.
Arguments:
Returns: boolean
Whether the event was handled and thus should *not* be
propagated to other plugins or handleKeyboardShortcut.
|
code » | ||||
Handles keypress. It is run before handleKeyboardShortcut and if it returns
true handleKeyboardShortcut will not be called.
Arguments:
Returns: boolean
Whether the event was handled and thus should *not* be
propagated to other plugins or handleKeyboardShortcut.
|
code » | ||||
Handles keyup.
Arguments:
Returns: boolean
Whether the event was handled and thus should *not* be
propagated to other plugins.
|
code » | ||||
Handles keyboard shortcuts. Preferred to using handleKey* as it will use
the proper event based on browser and will be more performant. If
handleKeyPress/handleKeyDown returns true, this will not be called. If the
plugin handles the shortcut, it is responsible for dispatching appropriate
events (change, selection change at the time of this comment). If the plugin
calls execCommand on the editable field, then execCommand already takes care
of dispatching events.
NOTE: For performance reasons this is only called when any key is pressed
in conjunction with ctrl/meta keys OR when a small subset of keys (defined
in goog.editor.Field.POTENTIAL_SHORTCUT_KEYCODES_) are pressed without
ctrl/meta keys. We specifically don't invoke it when altKey is pressed since
alt key is used in many i8n UIs to enter certain characters.
Arguments:
Returns: boolean
Whether the event was handled and thus should *not* be
propagated to other plugins. We also call preventDefault on the event if
the return value is true.
|
code » | ||||
Handles selection change.
Arguments:
Returns: boolean
Whether the event was handled and thus should *not* be
propagated to other plugins.
|
code » | ||||
No description.
Returns: boolean
Whether or not this plugin should automatically be disposed
when it's registered field is disposed.
|
code » | ||||
Returns whether this plugin is enabled for the field object.
Arguments:
Returns: boolean
Whether this plugin is enabled for the field object.
|
code » | ||||
No description.
|
code » | ||||
Whether the string corresponds to a command this plugin handles.
|
code » | ||||
Prepares the given HTML for editing. Strips out content that should not
appear in an editor, and normalizes content as appropriate. The inverse
of cleanContentsHtml.
This op is invoked even on disabled plugins.
|
code » | ||||
![]()
Gets the state of this command if this plugin serves that command.
Arguments:
Returns: *
The value of the command.
|
code » | ||||
![]()
Registers the field object for use with this plugin.
Arguments:
|
code » | ||||
![]()
Set if this plugin should automatically be disposed when the registered
field is disposed.
Arguments:
|
code » | ||||
![]()
Sets the field object for use with this plugin.
Arguments:
|
code » | ||||
![]()
Unregisters and disables this plugin for the current field object.
Arguments:
|
code » |
![]()
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:
|
code » | |||||
![]()
Asserts that the event target instance is initialized properly.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
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 » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
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 » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
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:
|
code » | |||||
![]()
Sets the parent of this event target to use for capture/bubble
mechanism.
Arguments:
|
code » | |||||
![]()
Sets the target to be used for
event.target when firing
event. Mainly used for testing. For example, see
goog.testing.events.mixinListenable .
Arguments:
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
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 » | |||
![]()
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 » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
Whether to block opening links with a non-whitelisted URL scheme.
|
Code » | |
![]()
No description.
|
Code » | |
Link object that the dialog is editing.
|
Code » | |
![]()
Optional warning to show about email addresses.
|
Code » | |
Event handler for this object.
|
Code » | |
![]()
Whether the "open link in new window" checkbox should be checked when the
dialog is shown, and also whether it was checked last time the dialog was
closed.
|
Code » | |
![]()
A list of whitelisted URL schemes which are safe to open.
|
Code » | |
![]()
Whether to show a checkbox where the user can choose to have the link open in
a new window.
|
Code » | |
![]()
Weather to show a checkbox where the user can choose to add 'rel=nofollow'
attribute added to the link.
|
Code » | |
![]()
Whether to stop referrer leaks. Defaults to false.
|
Code » |
![]()
The command that this plugin handles.
|
Code » | |
![]()
No description.
|
Code » | |
The current dialog that was created and opened by this plugin.
|
Code » | |
![]()
Mutex to prevent recursive calls to disposeDialog_.
|
Code » | |
![]()
Whether this plugin should reuse the same instance of the dialog each time
execCommand is called or create a new one.
|
Code » | |
SavedRange representing the selection before the dialog was opened.
|
Code » |
![]()
Indicates if this plugin should be automatically disposed when the
registered field is disposed. This should be changed to false for
plugins used as multi-field plugins.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
Whether this plugin is enabled for the registered field object.
|
Code » | |
The field object this plugin is attached to.
|
Code » | |
The logger for this plugin.
|
Code » |
The object to use for event.target. Useful when mixing in an
EventTarget to another object.
|
Code » | |
![]()
No description.
|
Code » | |
Maps of event type to an array of listeners.
|
Code » | |
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 » |
![]()
No description.
|
Code » |