exec-command-debug.js revision 0849f3ba6df9f9aaf5677409f2b00d9f2ad9af32
5852N/A * Plugin for the frame module to handle execCommands for Editor 5852N/A * Plugin for the frame module to handle execCommands for Editor 5852N/A * @class Plugin.ExecCommand 5852N/A * An internal reference to the keyCode of the last key that was pressed. 5852N/A * An internal reference to the instance of the frame plugged into. 5852N/A * Execute a command on the frame's document. 5852N/A * @param {String} action The action to perform (bold, italic, fontname) 5852N/A * @param {String} value The optional value (helvetica) 5852N/A * The private version of execCommand that doesn't filter for overrides. 5852N/A * @param {String} action The action to perform (bold, italic, fontname) 5852N/A * @param {String} value The optional value (helvetica) 5852N/A * Get's the instance of YUI bound to the parent frame 5852N/A * @return {YUI} The YUI instance bound to the parent frame 5852N/A * Static object literal of execCommand overrides 5852N/A * Wraps the content with a new element of type (tag) 4203N/A * @param {String} cmd The command executed: wrap 4203N/A * @param {String} tag The tag to wrap the selection with 4203N/A * @return {NodeList} NodeList of the items touched by this command. 4203N/A * Inserts the provided HTML at the cursor, should be a single element. 4203N/A * @method COMMANDS.inserthtml 4203N/A * @param {String} cmd The command executed: inserthtml 4203N/A * @param {String} html The html to insert 4203N/A * @return {Node} Node instance of the item touched by this command. 5852N/A * Inserts the provided HTML at the cursor, and focuses the cursor afterwards. 5852N/A * @method COMMANDS.insertandfocus 5852N/A * @param {String} cmd The command executed: insertandfocus 5852N/A * @param {String} html The html to insert 5852N/A * @return {Node} Node instance of the item touched by this command. 5852N/A * Inserts a BR at the current cursor position 5852N/A * @method COMMANDS.insertbr 4203N/A * @param {String} cmd The command executed: insertbr 4203N/A * Inserts an image at the cursor position 4203N/A * @method COMMANDS.insertimage 5852N/A * @param {String} cmd The command executed: insertimage 5852N/A * @param {String} img The url of the image to be inserted 4203N/A * @return {Node} Node instance of the item touched by this command. 4203N/A * Add a class to all of the elements in the selection 5852N/A * @method COMMANDS.addclass 5852N/A * @param {String} cmd The command executed: addclass 5852N/A * @param {String} cls The className to add 5852N/A * @return {NodeList} NodeList of the items touched by this command. 5852N/A * Remove a class from all of the elements in the selection 4203N/A * @method COMMANDS.removeclass * @param {String} cmd The command executed: removeclass * @param {String} cls The className to remove * @return {NodeList} NodeList of the items touched by this command. * Adds a forecolor to the current selection, or creates a new element and applies it * @method COMMANDS.forecolor * @param {String} cmd The command executed: forecolor * @param {String} val The color value to apply * @return {NodeList} NodeList of the items touched by this command. * Adds a background color to the current selection, or creates a new element and applies it * @method COMMANDS.backcolor * @param {String} cmd The command executed: backcolor * @param {String} val The color value to apply * @return {NodeList} NodeList of the items touched by this command. * Sugar method, calles backcolor * @method COMMANDS.hilitecolor * @param {String} cmd The command executed: backcolor * @param {String} val The color value to apply * @return {NodeList} NodeList of the items touched by this command. * Adds a font name to the current selection, or creates a new element and applies it * @method COMMANDS.fontname2 * @param {String} cmd The command executed: fontname * @param {String} val The font name to apply * @return {NodeList} NodeList of the items touched by this command. * Adds a fontsize to the current selection, or creates a new element and applies it * @method COMMANDS.fontsize2 * @param {String} cmd The command executed: fontsize * @param {String} val The font size to apply * @return {NodeList} NodeList of the items touched by this command. * Overload for COMMANDS.list * @method COMMANDS.insertorderedlist * @param {String} cmd The command executed: list, ul * Overload for COMMANDS.list * @method COMMANDS.insertunorderedlist * @param {String} cmd The command executed: list, ol * @param {String} cmd The command executed: list (not used) * @param {String} tag The tag to deal with DIR =
'dir',
cls =
'yui3-touched',
dir,
range,
div,
elm, n,
str, s,
par,
list,
lis,
cmd =
'insert' + ((
tag ===
'ul') ?
'un' :
'') +
'orderedlist';
str += l.
get(
'innerHTML') +
'<br>';
if (n.
get(
'parentNode').
test(
'div')) {
list =
'<' +
tag +
' id="ie-list">';
list +=
'<li>' + v +
'</li>';
* Noramlizes alignment for Webkit Browsers * @method COMMANDS.justify * @param {String} cmd The command executed: justify (not used) * @param {String} val The actual command from the justify{center,all,left,right} stubs * Override method for COMMANDS.justify * @method COMMANDS.justifycenter this.
command(
'justify',
'justifycenter');
* Override method for COMMANDS.justify * @method COMMANDS.justifyleft this.
command(
'justify',
'justifyleft');
* Override method for COMMANDS.justify * @method COMMANDS.justifyright this.
command(
'justify',
'justifyright');
* Override method for COMMANDS.justify * @method COMMANDS.justifyfull this.
command(
'justify',
'justifyfull');
* This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling. * @param {String} cmd The command to execute * @param {String} tag The tag to create * @param {String} rule The rule that we are looking for. fixIETags.
call(
this,
'underline',
'u',
'TEXT-DECORATION: underline');