/* SCEditor v2.1.2 | (C) 2017, Sam Clarke | sceditor.com/license */

!function(e){"use strict";e.plugins.format=function(){var t,a,o={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"};this.init=function(){var t=this.opts,r=t.paragraphformat;t.format&&"bbcode"===t.format||(r&&(r.tags&&(o=r.tags),r.excludeTags&&r.excludeTags.forEach(function(e){delete o[e]})),this.commands.format||(this.commands.format={exec:a,txtExec:a,tooltip:"Format Paragraph"}),t.toolbar===e.defaultOptions.toolbar&&(t.toolbar=t.toolbar.replace(",color,",",color,format,")))},t=function(e,t){e.sourceMode()?e.insert("<"+t+">","</"+t+">"):e.execCommand("formatblock","<"+t+">")},a=function(a){var r=this,n=document.createElement("div");e.utils.each(o,function(e,a){var o=document.createElement("a");o.className="sceditor-option",o.textContent=a.name||a,o.addEventListener("click",function(o){r.closeDropDown(!0),a.exec?a.exec(r):t(r,e),o.preventDefault()}),n.appendChild(o)}),r.createDropDown(a,"format",n)}}}(sceditor);