Yahoo! UI Library

editor  3.2.0

Yahoo! UI Library > editor > Plugin.ExecCommand
Search:
 
Filters

Class Plugin.ExecCommand - extends Base

Plugin for the frame module to handle execCommands for Editor

Constructor

Plugin.ExecCommand ( )

Properties

_inst - private object

An internal reference to the instance of the frame plugged into.

COMMANDS - static object

Static object literal of execCommand overrides

COMMANDS.bidi - object

bidi execCommand override for setting the text direction of a node.

NAME - static object

execCommand

NS - static object

exec

Properties inherited from Attribute:

Properties inherited from Base:

Methods

_command

private void _command ( action , value )
The private version of execCommand that doesn't filter for overrides.
Parameters:
action <String> The action to perform (bold, italic, fontname)
value <String> The optional value (helvetica)

command

Node/NodeList command ( action , value )
Execute a command on the frame's document.
Parameters:
action <String> The action to perform (bold, italic, fontname)
value <String> The optional value (helvetica)
Returns: Node/NodeList
Should return the Node/Nodelist affected

COMMANDS.addclass

static NodeList COMMANDS.addclass ( cmd , cls )
Add a class to all of the elements in the selection
Parameters:
cmd <String> The command executed: addclass
cls <String> The className to add
Returns: NodeList
NodeList of the items touched by this command.

COMMANDS.backcolor

static NodeList COMMANDS.backcolor ( cmd , val )
Adds a background color to the current selection, or creates a new element and applies it
Parameters:
cmd <String> The command executed: backcolor
val <String> The color value to apply
Returns: NodeList
NodeList of the items touched by this command.

COMMANDS.fontname

static NodeList COMMANDS.fontname ( cmd , val )
Adds a font name to the current selection, or creates a new element and applies it
Parameters:
cmd <String> The command executed: fontname
val <String> The font name to apply
Returns: NodeList
NodeList of the items touched by this command.

COMMANDS.fontsize

static NodeList COMMANDS.fontsize ( cmd , val )
Adds a fontsize to the current selection, or creates a new element and applies it
Parameters:
cmd <String> The command executed: fontsize
val <String> The font size to apply
Returns: NodeList
NodeList of the items touched by this command.

COMMANDS.hilitecolor

static NodeList COMMANDS.hilitecolor ( cmd , val )
Sugar method, calles backcolor
Parameters:
cmd <String> The command executed: backcolor
val <String> The color value to apply
Returns: NodeList
NodeList of the items touched by this command.

COMMANDS.insertandfocus

static Node COMMANDS.insertandfocus ( cmd , html )
Inserts the provided HTML at the cursor, and focuses the cursor afterwards.
Parameters:
cmd <String> The command executed: insertandfocus
html <String> The html to insert
Returns: Node
Node instance of the item touched by this command.

COMMANDS.insertbr

static void COMMANDS.insertbr ( cmd )
Inserts a BR at the current cursor position
Parameters:
cmd <String> The command executed: insertbr

COMMANDS.inserthtml

static Node COMMANDS.inserthtml ( cmd , html )
Inserts the provided HTML at the cursor, should be a single element.
Parameters:
cmd <String> The command executed: inserthtml
html <String> The html to insert
Returns: Node
Node instance of the item touched by this command.

COMMANDS.insertimage

static Node COMMANDS.insertimage ( cmd , img )
Inserts an image at the cursor position
Parameters:
cmd <String> The command executed: insertimage
img <String> The url of the image to be inserted
Returns: Node
Node instance of the item touched by this command.

COMMANDS.removeclass

static NodeList COMMANDS.removeclass ( cmd , cls )
Remove a class from all of the elements in the selection
Parameters:
cmd <String> The command executed: removeclass
cls <String> The className to remove
Returns: NodeList
NodeList of the items touched by this command.

COMMANDS.wrap

static NodeList COMMANDS.wrap ( cmd , tag )
Wraps the content with a new element of type (tag)
Parameters:
cmd <String> The command executed: wrap
tag <String> The tag to wrap the selection with
Returns: NodeList
NodeList of the items touched by this command.

getInstance

YUI getInstance ( )
Get's the instance of YUI bound to the parent frame
Returns: YUI
The YUI instance bound to the parent frame

Events inherited from Base:

Configuration attributes inherited from Base:


Copyright © 2010 Yahoo! Inc. All rights reserved.