/*!pl SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
(function(e){"use strict";e.sceditor.plugins.format=function(){var t,n,o=this,i={p:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",address:"Address",pre:"Preformatted Text"};o.init=function(){var t=this.opts,o=t.paragraphformat;e.sceditor.plugins.bbcode&&t.plugins&&t.plugins.indexOf("bbcode")>-1||(o&&(o.tags&&(i=o.tags),o.excludeTags&&e.each(o.excludeTags,function(e,t){delete i[t]})),this.commands.format||(this.commands.format={exec:n,txtExec:n,tooltip:"Format Paragraph"}),t.toolbar===e.sceditor.defaultOptions.toolbar&&(t.toolbar=t.toolbar.replace(",color,",",color,format,")))},t=function(e,t){e.sourceMode()?e.insert("<"+t+">","</"+t+">"):e.execCommand("formatblock","<"+t+">")},n=function(n){var o=this,r=e("<div />");e.each(i,function(n,i){e('<a class="sceditor-option" href="#">'+(i.name||i)+"</a>").click(function(){return o.closeDropDown(!0),i.exec?i.exec(o):t(o,n),!1}).appendTo(r)}),o.createDropDown(n,"format",r)}}})(jQuery);