exec-command-debug.js revision 453c0694eb896076de933e8d82bd76a9ad450b4d
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav GlassYUI.add('exec-command', function(Y) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass
5aab19b8b78189ce79cf89283f2d505566d4e6a8Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * Plugin for the frame module to handle execCommands for Editor
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @module editor
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @submodule exec-command
d0199bcbfc68b65683c19c4e3e0c38e238142e7eDav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * Plugin for the frame module to handle execCommands for Editor
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @class Plugin.ExecCommand
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @extends Base
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @constructor
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass var ExecCommand = function() {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass ExecCommand.superclass.constructor.apply(this, arguments);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass };
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass Y.extend(ExecCommand, Y.Base, {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
d0199bcbfc68b65683c19c4e3e0c38e238142e7eDav Glass * An internal reference to the keyCode of the last key that was pressed.
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @private
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @property _lastKey
d0199bcbfc68b65683c19c4e3e0c38e238142e7eDav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass _lastKey: null,
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * An internal reference to the instance of the frame plugged into.
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @private
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @property _inst
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass _inst: null,
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * Execute a command on the frame's document.
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @method command
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @param {String} action The action to perform (bold, italic, fontname)
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @param {String} value The optional value (helvetica)
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @return {Node/NodeList} Should return the Node/Nodelist affected
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass command: function(action, value) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass var fn = ExecCommand.COMMANDS[action];
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass Y.log('execCommand(' + action + '): "' + value + '"', 'info', 'exec-command');
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass if (fn) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass return fn.call(this, action, value);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass } else {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass return this._command(action, value);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass },
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * The private version of execCommand that doesn't filter for overrides.
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @private
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @method _command
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @param {String} action The action to perform (bold, italic, fontname)
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @param {String} value The optional value (helvetica)
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass _command: function(action, value) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass var inst = this.getInstance();
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass try {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass try {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass inst.config.doc.execCommand('styleWithCSS', null, 1);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass } catch (e1) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass try {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass inst.config.doc.execCommand('useCSS', null, 0);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass } catch (e2) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass Y.log('Internal execCommand(' + action + '): "' + value + '"', 'info', 'exec-command');
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass inst.config.doc.execCommand(action, null, value);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass } catch (e) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass Y.log(e.message, 'error', 'exec-command');
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass },
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * Get's the instance of YUI bound to the parent frame
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @method getInstance
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @return {YUI} The YUI instance bound to the parent frame
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass getInstance: function() {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass if (!this._inst) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass this._inst = this.get('host').getInstance();
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass return this._inst;
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass },
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass initializer: function() {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass Y.mix(this.get('host'), {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass execCommand: function(action, value) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass return this.exec.command(action, value);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass },
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass _execCommand: function(action, value) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass return this.exec._command(action, value);
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass });
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass this.get('host').on('dom:keypress', Y.bind(function(e) {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass this._lastKey = e.keyCode;
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }, this));
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }, {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * execCommand
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @property NAME
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @static
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass NAME: 'execCommand',
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass /**
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * exec
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @property NS
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass * @static
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass */
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass NS: 'exec',
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass ATTRS: {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass host: {
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass value: false
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass }
33d85edf47749fa345d7b636b9b4b9d0d0386f44Dav Glass },
/**
* Static object literal of execCommand overrides
* @property COMMANDS
* @static
*/
COMMANDS: {
/**
* Wraps the content with a new element of type (tag)
* @method COMMANDS.wrap
* @static
* @param {String} cmd The command executed: wrap
* @param {String} tag The tag to wrap the selection with
* @return {NodeList} NodeList of the items touched by this command.
*/
wrap: function(cmd, tag) {
var inst = this.getInstance();
return (new inst.Selection()).wrapContent(tag);
},
/**
* Inserts the provided HTML at the cursor, should be a single element.
* @method COMMANDS.inserthtml
* @static
* @param {String} cmd The command executed: inserthtml
* @param {String} html The html to insert
* @return {Node} Node instance of the item touched by this command.
*/
inserthtml: function(cmd, html) {
var inst = this.getInstance();
if (inst.Selection.hasCursor() || Y.UA.ie) {
return (new inst.Selection()).insertContent(html);
} else {
this._command('inserthtml', html);
}
},
/**
* Inserts the provided HTML at the cursor, and focuses the cursor afterwards.
* @method COMMANDS.insertandfocus
* @static
* @param {String} cmd The command executed: insertandfocus
* @param {String} html The html to insert
* @return {Node} Node instance of the item touched by this command.
*/
insertandfocus: function(cmd, html) {
var inst = this.getInstance(), out, sel;
if (inst.Selection.hasCursor()) {
html += inst.Selection.CURSOR;
out = this.command('inserthtml', html);
sel = new inst.Selection();
sel.focusCursor(true, true);
} else {
this.command('inserthtml', html);
}
return out;
},
/**
* Inserts a BR at the current cursor position
* @method COMMANDS.insertbr
* @static
* @param {String} cmd The command executed: insertbr
*/
insertbr: function(cmd) {
var inst = this.getInstance(),
sel = new inst.Selection(),
html = '<var>|</var>', last = null,
q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var';
if (sel._selection.pasteHTML) {
sel._selection.pasteHTML(html);
} else {
this._command('inserthtml', html);
}
var insert = function(n) {
var c = inst.Node.create('<br>');
n.insert(c, 'before');
return c;
}
inst.all(q).each(function(n) {
var g = true;
if (Y.UA.webkit) {
g = false;
if (n.get('innerHTML') === '|') {
g = true;
}
}
if (g) {
last = insert(n);
if ((!last.previous() || !last.previous().test('br')) && Y.UA.gecko) {
var s = last.cloneNode();
last.insert(s, 'after');
last = s;
}
n.remove();
}
});
if (Y.UA.webkit && last) {
insert(last);
sel.selectNode(last);
}
},
/**
* Inserts an image at the cursor position
* @method COMMANDS.insertimage
* @static
* @param {String} cmd The command executed: insertimage
* @param {String} img The url of the image to be inserted
* @return {Node} Node instance of the item touched by this command.
*/
insertimage: function(cmd, img) {
return this.command('inserthtml', '<img src="' + img + '">');
},
/**
* Add a class to all of the elements in the selection
* @method COMMANDS.addclass
* @static
* @param {String} cmd The command executed: addclass
* @param {String} cls The className to add
* @return {NodeList} NodeList of the items touched by this command.
*/
addclass: function(cmd, cls) {
var inst = this.getInstance();
return (new inst.Selection()).getSelected().addClass(cls);
},
/**
* Remove a class from all of the elements in the selection
* @method COMMANDS.removeclass
* @static
* @param {String} cmd The command executed: removeclass
* @param {String} cls The className to remove
* @return {NodeList} NodeList of the items touched by this command.
*/
removeclass: function(cmd, cls) {
var inst = this.getInstance();
return (new inst.Selection()).getSelected().removeClass(cls);
},
/**
* Adds a forecolor to the current selection, or creates a new element and applies it
* @method COMMANDS.forecolor
* @static
* @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.
*/
forecolor: function(cmd, val) {
var inst = this.getInstance(),
sel = new inst.Selection(), n;
if (!Y.UA.ie) {
this._command('useCSS', false);
}
if (inst.Selection.hasCursor()) {
if (sel.isCollapsed) {
if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === '&nbsp;')) {
sel.anchorNode.setStyle('color', val);
n = sel.anchorNode;
} else {
n = this.command('inserthtml', '<span style="color: ' + val + '">' + inst.Selection.CURSOR + '</span>');
sel.focusCursor(true, true);
}
return n;
} else {
return this._command(cmd, val);
}
} else {
this._command(cmd, val);
}
},
/**
* Adds a background color to the current selection, or creates a new element and applies it
* @method COMMANDS.backcolor
* @static
* @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.
*/
backcolor: function(cmd, val) {
var inst = this.getInstance(),
sel = new inst.Selection(), n;
if (Y.UA.gecko || Y.UA.opera) {
cmd = 'hilitecolor';
}
if (!Y.UA.ie) {
this._command('useCSS', false);
}
if (inst.Selection.hasCursor()) {
if (sel.isCollapsed) {
if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === '&nbsp;')) {
sel.anchorNode.setStyle('backgroundColor', val);
n = sel.anchorNode;
} else {
n = this.command('inserthtml', '<span style="background-color: ' + val + '">' + inst.Selection.CURSOR + '</span>');
sel.focusCursor(true, true);
}
return n;
} else {
return this._command(cmd, val);
}
} else {
this._command(cmd, val);
}
},
/**
* Sugar method, calles backcolor
* @method COMMANDS.hilitecolor
* @static
* @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.
*/
hilitecolor: function() {
return ExecCommand.COMMANDS.backcolor.apply(this, arguments);
},
/**
* Adds a font name to the current selection, or creates a new element and applies it
* @method COMMANDS.fontname2
* @deprecated
* @static
* @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.
*/
fontname2: function(cmd, val) {
this._command('fontname', val);
var inst = this.getInstance(),
sel = new inst.Selection();
if (sel.isCollapsed && (this._lastKey != 32)) {
if (sel.anchorNode.test('font')) {
sel.anchorNode.set('face', val);
}
}
},
/**
* Adds a fontsize to the current selection, or creates a new element and applies it
* @method COMMANDS.fontsize2
* @deprecated
* @static
* @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.
*/
fontsize2: function(cmd, val) {
this._command('fontsize', val);
var inst = this.getInstance(),
sel = new inst.Selection();
if (sel.isCollapsed && sel.anchorNode && (this._lastKey != 32)) {
if (Y.UA.webkit) {
if (sel.anchorNode.getStyle('lineHeight')) {
sel.anchorNode.setStyle('lineHeight', '');
}
}
if (sel.anchorNode.test('font')) {
sel.anchorNode.set('size', val);
} else if (Y.UA.gecko) {
var p = sel.anchorNode.ancestor(inst.Selection.DEFAULT_BLOCK_TAG);
if (p) {
p.setStyle('fontSize', '');
}
}
}
},
/**
* Overload for COMMANDS.list
* @method COMMANDS.insertorderedlist
* @static
* @param {String} cmd The command executed: list, ul
*/
insertunorderedlist: function(cmd) {
this.command('list', 'ul');
},
/**
* Overload for COMMANDS.list
* @method COMMANDS.insertunorderedlist
* @static
* @param {String} cmd The command executed: list, ol
*/
insertorderedlist: function(cmd) {
this.command('list', 'ol');
},
/**
* Noramlizes lists creation/destruction for IE. All others pass through to native calls
* @method COMMANDS.list
* @static
* @param {String} cmd The command executed: list (not used)
* @param {String} tag The tag to deal with
*/
list: function(cmd, tag) {
var inst = this.getInstance(), html,
sel = new inst.Selection();
cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';
if (Y.UA.ie && !sel.isCollapsed) {
var range = sel._selection;
html = range.htmlText;
var div = inst.Node.create(html);
if (div.test(tag)) {
var elm = range.item ? range.item(0) : range.parentElement();
var n = inst.one(elm),
lis = n.all('li');
var str = '<div>';
lis.each(function(l) {
str += l.get('innerHTML') + '<br>';
});
str += '</div>';
var s = inst.Node.create(str);
if (n.get('parentNode').test('div')) {
n = n.get('parentNode');
}
n.replace(s);
range.moveToElementText(s._node);
range.select();
} else {
html = html.split(/<br>/i);
var list = '<' + tag + ' id="ie-list">';
Y.each(html, function(v) {
list += '<li>' + v + '</li>';
});
list += '<' + tag + '>';
range.pasteHTML(list);
var el = inst.config.doc.getElementById('ie-list');
el.id = '';
range.moveToElementText(el);
range.select();
}
} else if (Y.UA.ie) {
var p = inst.one(sel._selection.parentElement());
if (p.test('p')) {
html = Y.Selection.getText(p);
if (html === '') {
var l = inst.Node.create(Y.Lang.sub('<{tag}><li></li></{tag}>', { tag: tag }));
p.replace(l);
sel.selectNode(l.one('li'));
}
}
} else {
this._command(cmd, null);
}
},
/**
* Noramlizes alignment for Webkit Browsers
* @method COMMANDS.justify
* @static
* @param {String} cmd The command executed: justify (not used)
* @param {String} val The actual command from the justify{center,all,left,right} stubs
*/
justify: function(cmd, val) {
if (Y.UA.webkit) {
var inst = this.getInstance(),
sel = new inst.Selection(),
aNode = sel.anchorNode;
var bgColor = aNode.getStyle('backgroundColor');
this._command(val);
sel = new inst.Selection();
if (sel.anchorNode.test('div')) {
var html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';
sel.anchorNode.set('innerHTML', html);
sel.anchorNode.one('span').setStyle('backgroundColor', bgColor);
sel.selectNode(sel.anchorNode.one('span'));
}
} else {
this._command(val);
}
},
/**
* Override method for COMMANDS.justify
* @method COMMANDS.justifycenter
* @static
*/
justifycenter: function(cmd) {
this.command('justify', 'justifycenter');
},
/**
* Override method for COMMANDS.justify
* @method COMMANDS.justifyleft
* @static
*/
justifyleft: function(cmd) {
this.command('justify', 'justifyleft');
},
/**
* Override method for COMMANDS.justify
* @method COMMANDS.justifyright
* @static
*/
justifyright: function(cmd) {
this.command('justify', 'justifyright');
},
/**
* Override method for COMMANDS.justify
* @method COMMANDS.justifyfull
* @static
*/
justifyfull: function(cmd) {
this.command('justify', 'justifyfull');
}
}
});
/**
* This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.
* @method fixIETags
* @protected
* @param {String} cmd The command to execute
* @param {String} tag The tag to create
* @param {String} rule The rule that we are looking for.
*/
var fixIETags = function(cmd, tag, rule) {
var inst = this.getInstance(),
doc = inst.config.doc,
sel = doc.selection.createRange(),
o = doc.queryCommandValue(cmd),
html, reg, m, p, d, s, c;
if (o) {
html = sel.htmlText;
reg = new RegExp(rule, 'g');
m = html.match(reg);
if (m) {
html = html.replace(rule + ';', '').replace(rule, '');
sel.pasteHTML('<var id="yui-ie-bs">');
p = doc.getElementById('yui-ie-bs');
d = doc.createElement('div');
s = doc.createElement(tag);
d.innerHTML = html;
if (p.parentNode !== inst.config.doc.body) {
p = p.parentNode;
}
c = d.childNodes;
p.parentNode.replaceChild(s, p);
Y.each(c, function(f) {
s.appendChild(f);
});
sel.collapse();
sel.moveToElementText(s);
sel.select();
}
}
this._command(cmd);
};
if (Y.UA.ie) {
ExecCommand.COMMANDS.bold = function() {
fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold');
};
ExecCommand.COMMANDS.italic = function() {
fixIETags.call(this, 'italic', 'i', 'FONT-STYLE: italic');
};
ExecCommand.COMMANDS.underline = function() {
fixIETags.call(this, 'underline', 'u', 'TEXT-DECORATION: underline');
};
}
Y.namespace('Plugin');
Y.Plugin.ExecCommand = ExecCommand;
}, '@VERSION@' ,{requires:['frame'], skinnable:false});