return commandConfig.commandType === constants.commandType.inline ?
configuration.defaultInlineTag : configuration.defaultBlockTag;
};
var constructCommandOptions = function(commandName, options) {
var attr = commandAttrType(commandName, options);
var commandConfig = configuration.commands[commandName];
var commandOptions = {
textArea: this,
commandAttrType: attr,
commandName: commandName,
tagName: commandConfig.tagName,
applierTagName: getTagNameOrDefault(commandName, attr, options)
};
var commandValue = getCommandValueOrDefault(commandName, attr, options);
switch (attr) {
case constants.commandAttrType.className:
commandOptions.classNameRegex = commandConfig.classNameRegex;
commandOptions.className = commandValue;
break;
case constants.commandAttrType.styleName:
commandOptions.styleName = commandConfig.styleName;
commandOptions.styleValue = commandValue;
break;
}
return $.extend(options, commandOptions);
};
$.extend($.Arte.TextArea.prototype, {
"bold": function(options) {
exec.apply(this, ["bold", options]);
},
"italic": function(options) {
exec.apply(this, ["italic", options]);
},
"underline": function(options) {
exec.apply(this, ["underline", options]);
},
"blockquote": function() {
exec.apply(this, ["blockquote"]);
},
"h1": function() {
exec.apply(this, ["h1"]);
},
"h2": function() {
exec.apply(this, ["h2"]);
},
"h3": function() {
exec.apply(this, ["h3"]);
},
"h4": function() {
exec.apply(this, ["h4"]);
},
"h5": function() {
exec.apply(this, ["h5"]);
},
"h6": function() {
exec.apply(this, ["h6"]);
},
"subscript": function() {
exec.apply(this, ["subscript"]);
},
"superscript": function() {
exec.apply(this, ["superscript"]);
},
"fontSize": function(options) {
exec.apply(this, ["fontSize", options]);
},
"fontFamily": function(options) {
exec.apply(this, ["fontFamily", options]);
},
"color": function(options) {
exec.apply(this, ["color", options]);
},
"backgroundColor": function(options) {
exec.apply(this, ["backgroundColor", options]);
},
"unorderedList": function(options) {
exec.apply(this, ["unorderedList", options]);
},
"orderedList": function(options) {
exec.apply(this, ["orderedList", options]);
},
"textAlign": function(options) {
exec.apply(this, ["textAlign", options]);
},