/*! wysihtml - v0.6.beta (2016-05-13) */ wysihtml.commands.alignCenterStyle=function(){var a={styleProperty:"textAlign",styleValue:"center",toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.alignJustifyStyle=function(){var a={styleProperty:"textAlign",styleValue:"justify",toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.alignLeftStyle=function(){var a={styleProperty:"textAlign",styleValue:"left",toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.alignRightStyle=function(){var a={styleProperty:"textAlign",styleValue:"right",toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.bgColorStyle=function(){return{exec:function(a,b,c){var d,e=wysihtml.quirks.styleParser.parseColor("background-color:"+(c.color||c),"background-color");e&&(d=(1===e[3]?"rgb("+[e[0],e[1],e[2]].join(", "):"rgba("+e.join(", "))+")",wysihtml.commands.formatInline.exec(a,b,{styleProperty:"backgroundColor",styleValue:d}))},state:function(a,b,c){var d,e=c?wysihtml.quirks.styleParser.parseColor("background-color:"+(c.color||c),"background-color"):null;return e&&(d=(1===e[3]?"rgb("+[e[0],e[1],e[2]].join(", "):"rgba("+e.join(", "))+")"),wysihtml.commands.formatInline.state(a,b,{styleProperty:"backgroundColor",styleValue:d})},remove:function(a,b){return wysihtml.commands.formatInline.remove(a,b,{styleProperty:"backgroundColor"})},stateValue:function(a,b,c){var d,e=this.state(a,b),f=!1;return e&&wysihtml.lang.object(e).isArray()&&(e=e[0]),e&&(d=e.getAttribute("style"))?(f=wysihtml.quirks.styleParser.parseColor(d,"background-color"),wysihtml.quirks.styleParser.unparseColor(f,c)):!1}}}(),wysihtml.commands.bold=function(){var a={nodeName:"B",toggle:!0};return{exec:function(b,c){wysihtml.commands.formatInline.exec(b,c,a)},state:function(b,c){return wysihtml.commands.formatInline.state(b,c,a)}}}(),wysihtml.commands.formatCode=function(){return{exec:function(a,b,c){var d,e,f,g=this.state(a)[0];g?a.selection.executeAndRestore(function(){d=g.querySelector("code"),wysihtml.dom.replaceWithChildNodes(g),d&&wysihtml.dom.replaceWithChildNodes(d)}):(e=a.selection.getRange(),f=e.extractContents(),g=a.doc.createElement("pre"),d=a.doc.createElement("code"),c&&(d.className=c),g.appendChild(d),d.appendChild(f),e.insertNode(g),a.selection.selectNode(g))},state:function(a){var b,c=a.selection.getSelectedNode();return c&&c.nodeName&&"PRE"==c.nodeName&&c.firstChild&&c.firstChild.nodeName&&"CODE"==c.firstChild.nodeName?[c]:(b=wysihtml.dom.getParentElement(c,{query:"pre code"}),b?[b.parentNode]:!1)}}}(),wysihtml.commands.insertImage=function(){var a="IMG";return{exec:function(b,c,d){d="object"==typeof d?d:{src:d};var e,f,g=b.doc,h=this.state(b);if(h&&!d.src)return b.selection.setBefore(h),f=h.parentNode,f.removeChild(h),wysihtml.dom.removeEmptyTextNodes(f),"A"!==f.nodeName||f.firstChild||(b.selection.setAfter(f),f.parentNode.removeChild(f)),void wysihtml.quirks.redraw(b.element);if(h)for(var i in d)d.hasOwnProperty(i)&&h.setAttribute("className"===i?"class":i,d[i]);else{h=g.createElement(a);for(var j in d)h.setAttribute("className"===j?"class":j,d[j]);b.selection.insertNode(h),wysihtml.browser.hasProblemsSettingCaretAfterImg()?(e=g.createTextNode(wysihtml.INVISIBLE_SPACE),b.selection.insertNode(e),b.selection.setAfter(e)):b.selection.setAfter(h)}},state:function(b){var c,d,e,f=b.doc;return wysihtml.dom.hasElementWithTagName(f,a)&&(c=b.selection.getSelectedNode())?c.nodeName===a?c:c.nodeType!==wysihtml.ELEMENT_NODE?!1:(d=b.selection.getText(),(d=wysihtml.lang.string(d).trim())?!1:(e=b.selection.getNodes(wysihtml.ELEMENT_NODE,function(a){return"IMG"===a.nodeName}),1!==e.length?!1:e[0])):!1}}}(),wysihtml.commands.fontSize=function(){var a=/wysiwyg-font-size-[0-9a-z\-]+/g;return{exec:function(b,c,d){wysihtml.commands.formatInline.exec(b,c,{className:"wysiwyg-font-size-"+d,classRegExp:a,toggle:!0})},state:function(a,b,c){return wysihtml.commands.formatInline.state(a,b,{className:"wysiwyg-font-size-"+c})}}}(),wysihtml.commands.fontSizeStyle=function(){return{exec:function(a,b,c){c=c.size||c,/^\s*$/.test(c)||wysihtml.commands.formatInline.exec(a,b,{styleProperty:"fontSize",styleValue:c,toggle:!1})},state:function(a,b,c){return wysihtml.commands.formatInline.state(a,b,{styleProperty:"fontSize",styleValue:c||void 0})},remove:function(a,b){return wysihtml.commands.formatInline.remove(a,b,{styleProperty:"fontSize"})},stateValue:function(a,b){var c,d=this.state(a,b);return d&&wysihtml.lang.object(d).isArray()&&(d=d[0]),d&&(c=d.getAttribute("style"))?wysihtml.quirks.styleParser.parseFontSize(c):!1}}}(),wysihtml.commands.foreColor=function(){var a=/wysiwyg-color-[0-9a-z]+/g;return{exec:function(b,c,d){wysihtml.commands.formatInline.exec(b,c,{className:"wysiwyg-color-"+d,classRegExp:a,toggle:!0})},state:function(a,b,c){return wysihtml.commands.formatInline.state(a,b,{className:"wysiwyg-color-"+c})}}}(),wysihtml.commands.foreColorStyle=function(){return{exec:function(a,b,c){var d,e;c&&(d=wysihtml.quirks.styleParser.parseColor("color:"+(c.color||c),"color"),d&&(e=(1===d[3]?"rgb("+[d[0],d[1],d[2]].join(", "):"rgba("+d.join(", "))+")",wysihtml.commands.formatInline.exec(a,b,{styleProperty:"color",styleValue:e})))},state:function(a,b,c){var d,e=c?wysihtml.quirks.styleParser.parseColor("color:"+(c.color||c),"color"):null;return e&&(d=(1===e[3]?"rgb("+[e[0],e[1],e[2]].join(", "):"rgba("+e.join(", "))+")"),wysihtml.commands.formatInline.state(a,b,{styleProperty:"color",styleValue:d})},remove:function(a,b){return wysihtml.commands.formatInline.remove(a,b,{styleProperty:"color"})},stateValue:function(a,b,c){var d,e=this.state(a,b),f=!1;return e&&wysihtml.lang.object(e).isArray()&&(e=e[0]),e&&(d=e.getAttribute("style"))?(f=wysihtml.quirks.styleParser.parseColor(d,"color"),wysihtml.quirks.styleParser.unparseColor(f,c)):!1}}}(),wysihtml.commands.insertBlockQuote=function(){var a={nodeName:"BLOCKQUOTE",toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.insertOrderedList=function(){return{exec:function(a,b){wysihtml.commands.insertList.exec(a,b,"OL")},state:function(a,b){return wysihtml.commands.insertList.state(a,b,"OL")}}}(),wysihtml.commands.insertUnorderedList=function(){return{exec:function(a,b){wysihtml.commands.insertList.exec(a,b,"UL")},state:function(a,b){return wysihtml.commands.insertList.state(a,b,"UL")}}}(),wysihtml.commands.italic=function(){var a={nodeName:"I",toggle:!0};return{exec:function(b,c){wysihtml.commands.formatInline.exec(b,c,a)},state:function(b,c){return wysihtml.commands.formatInline.state(b,c,a)}}}(),wysihtml.commands.justifyCenter=function(){var a={className:"wysiwyg-text-align-center",classRegExp:/wysiwyg-text-align-[0-9a-z]+/g,toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.justifyFull=function(){var a={className:"wysiwyg-text-align-justify",classRegExp:/wysiwyg-text-align-[0-9a-z]+/g,toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.justifyLeft=function(){var a={className:"wysiwyg-text-align-left",classRegExp:/wysiwyg-text-align-[0-9a-z]+/g,toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.justifyRight=function(){var a={className:"wysiwyg-text-align-right",classRegExp:/wysiwyg-text-align-[0-9a-z]+/g,toggle:!0};return{exec:function(b,c){return wysihtml.commands.formatBlock.exec(b,"formatBlock",a)},state:function(b,c){return wysihtml.commands.formatBlock.state(b,"formatBlock",a)}}}(),wysihtml.commands.subscript=function(){var a={nodeName:"SUB",toggle:!0};return{exec:function(b,c){wysihtml.commands.formatInline.exec(b,c,a)},state:function(b,c){return wysihtml.commands.formatInline.state(b,c,a)}}}(),wysihtml.commands.superscript=function(){var a={nodeName:"SUP",toggle:!0};return{exec:function(b,c){wysihtml.commands.formatInline.exec(b,c,a)},state:function(b,c){return wysihtml.commands.formatInline.state(b,c,a)}}}(),wysihtml.commands.underline=function(){var a={nodeName:"U",toggle:!0};return{exec:function(b,c){wysihtml.commands.formatInline.exec(b,c,a)},state:function(b,c){return wysihtml.commands.formatInline.state(b,c,a)}}}(); //# sourceMappingURL=wysihtml.all-commands.min.map