exec-command.js revision a2621d519886de7d60c30c5a0850f5c17fd2fb36
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * Plugin for the frame module to handle execCommands for Editor
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @module editor
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @submodule exec-command
daeb6d531149c45a2ceb543ae2cf1e56e5235bbeDav Glass * Plugin for the frame module to handle execCommands for Editor
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @class Plugin.ExecCommand
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @extends Base
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @constructor
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass var ExecCommand = function() {
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass ExecCommand.superclass.constructor.apply(this, arguments);
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * An internal reference to the instance of the frame plugged into.
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @property _inst
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * Execute a command on the frame's document.
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @method command
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @param {String} action The action to perform (bold, italic, fontname)
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @param {String} value The optional value (helvetica)
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @return {Node/NodeList} Should return the Node/Nodelist affected
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass Y.log('execCommand(' + action + '): "' + value + '"', 'info', 'exec-command');
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * The private version of execCommand that doesn't filter for overrides.
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @method _command
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @param {String} action The action to perform (bold, italic, fontname)
b357b56da58949fa86ab8e56983972e0db5cbffbDav Glass * @param {String} value The optional value (helvetica)
b357b56da58949fa86ab8e56983972e0db5cbffbDav Glass Y.log('Internal execCommand(' + action + '): "' + value + '"', 'info', 'exec-command');
b357b56da58949fa86ab8e56983972e0db5cbffbDav Glass inst.config.doc.execCommand(action, false, value);
b357b56da58949fa86ab8e56983972e0db5cbffbDav Glass } catch (e) {
5cbdc947eb0c9c5e840d59ff8e1dd49a0e2a1887Dav Glass * Get's the instance of YUI bound to the parent frame
5cbdc947eb0c9c5e840d59ff8e1dd49a0e2a1887Dav Glass * @method getInstance
5cbdc947eb0c9c5e840d59ff8e1dd49a0e2a1887Dav Glass * @return {YUI} The YUI instance bound to the parent frame
5cbdc947eb0c9c5e840d59ff8e1dd49a0e2a1887Dav Glass getInstance: function() {
1e44d35dd310d594ecc977ee4ed7cf6ef3746045Dav Glass if (!this._inst) {
6e43f558138d36538a82459ec79e0279ffae22e0Dav Glass return this._inst;
6e43f558138d36538a82459ec79e0279ffae22e0Dav Glass initializer: function() {
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * execCommand
dbf2c770f8178b12e8fe3c36bfa29df58ef13959Dav Glass * @property NAME
ATTRS: {
host: {
value: false
COMMANDS: {
return out;
n = this.command('inserthtml', '<span style="background-color: ' + val + '"><span> </span> </span>');
hilitecolor: function() {