This plugin provides the basis for an 'anchor' (link) dialog and an extension of it provides the image link dialog.
The command provided by this plugin is:
Parameter | Type | Description |
---|---|---|
args | Object |
Optional Initial settings for any of the attributes. |
See the dijit/_editor/plugins/LinkDialog reference documentation for more information.
Pointer to dijit/form/Button or other widget (ex: dijit/form/FilteringSelect)
that is added to the toolbar to control this plugin.
If not specified, will be created on initialization according to buttonClass
String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command.
Passed to editor.execCommand() if useDefaultCommand
is true.
Flag to indicate if this plugin has been disabled and should do nothing helps control button state, among other things. Set via the setter api.
Used for validating input as correct email address. Taken from dojox.validate
String used for templating the HTML to insert at the desired point.
The CSS class name for the button node is formed from iconClassPrefix
and command
Template for contents of TooltipDialog to pick URL
Used for validating input as correct URL. While file:// urls are not terribly useful, they are technically valid.
A function to listen for onChange events and test the input contents for valid information, such as valid urls with http/https/ftp and if not present, try and guess if the input url is relative or not, and if not, append http:// to it. Also validates other fields as determined by the internal _isValid function.
Function to check the values in args and 'fix' them up as needed.
Parameter | Type | Description |
---|---|---|
args | Object | Content being set. |
Content being set.
Over-ridable function that connects tag specific events.
Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.
Parameter | Type | Description |
---|---|---|
name | undefined |
Over-ride for getting the values to set in the dropdown.
Parameter | Type | Description |
---|---|---|
a | undefined | The anchor/link to process for data for the dropdown. |
Internal function to allow validating of the inputs for a link to determine if set should be disabled or not
Parameter | Type | Description |
---|---|---|
callback | undefined |
Helper function to set new value for specified attribute
Parameter | Type | Description |
---|---|---|
name | String | |
value | anything |
Helper for _initButton above. Not sure why it's a separate method.
Parameter | Type | Description |
---|---|---|
staticPanel | undefined |
Function to set the plugin state and call updateState to make sure the button is updated appropriately.
Parameter | Type | Description |
---|---|---|
disabled | undefined |
Deprecated. Use this.own() with dojo/on or dojo/aspect.instead.
Make a connect.connect() that is automatically disconnected when this plugin is destroyed.
Similar to dijit/_Widget.connect()
.
Parameter | Type | Description |
---|---|---|
o | undefined | |
f | undefined | |
tf | undefined |
Get a property from a plugin.
Get a named property from a plugin. The property may potentially be retrieved via a getter method. If no getter is defined, this just retrieves the object's property. For example, if the plugin has a properties "foo" and "bar" and a method named "_getFooAttr", calling:
plugin.get("foo");
would be equivalent to writing:
plugin._getFooAttr();
and:
plugin.get("bar");
would be equivalent to writing:
plugin.bar;
Parameter | Type | Description |
---|---|---|
name | undefined | The property to get. |
Returns the label to use for the button
Parameter | Type | Description |
---|---|---|
key | String |
Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
The array of specified handles, so you can do for example:
var handle = this.own(on(...))[0];
Set a property on a plugin
Sets named properties on a plugin which may potentially be handled by a setter in the plugin. For example, if the plugin has a properties "foo" and "bar" and a method named "_setFooAttr", calling:
plugin.set("foo", "Howdy!");
would be equivalent to writing:
plugin._setFooAttr("Howdy!");
and:
plugin.set("bar", 3);
would be equivalent to writing:
plugin.bar = 3;
set() may also be called with a hash of name/value pairs, ex:
plugin.set({ foo: "Howdy", bar: 3 })
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
Parameter | Type | Description |
---|---|---|
name | attribute | The property to set. |
value | anything | The value to set in the property. |
Set a property on a plugin
Tell the plugin which Editor it is associated with.
Parameter | Type | Description |
---|---|---|
editor | dijit/Editor |
Tell the plugin to add it's controller widget (often a button) to the toolbar. Does nothing if there is no controller widget.
Parameter | Type | Description |
---|---|---|
toolbar | dijit/Toolbar |
Callback from the dialog when user presses "set" button.
Parameter | Type | Description |
---|---|---|
args | undefined |
Change state of the plugin to respond to events in the editor.
This is called on meaningful events in the editor, such as change of selection or caret position (but not simple typing of alphanumeric keys). It gives the plugin a chance to update the CSS of its button.
For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the characters next to the caret are bold or not.
Only makes sense when useDefaultCommand
is true, as it calls Editor.queryCommandEnabled(command
).
Function to define a behavior on double clicks on the element type this dialog edits to select it and pop up the editor dialog.
Parameter | Type | Description |
---|---|---|
e | Object | The double-click event. |
Handler for when the dialog is opened. If the caret is currently in a URL then populate the URL's info into the dialog.