// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
myHtmlSettings = {
    nameSpace:       "html", // Useful to prevent multi-instances CSS conflict
    onShiftEnter:    { keepDefault:false, replaceWith:'<br />\n' },
    onCtrlEnter:     { keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n' },
    onTab:           { keepDefault:false, openWith:'     ' },
    markupSet:  [
        {name:'| HEADING 2 | Select portion of text first. Click on this button to create heading.', key:'2', openWith:'<h2>', closeWith:'</h2>', placeHolder:'Heading, level 2' },
        {separator:'---------------' },
        {name:'| BOLD | Select portion of text first. Click on this button to make it look bold.', key:'B', openWith:'<strong>', closeWith:'</strong>' },
        {name:'| ITALIC | Select portion of text first. Click on this button to make it look bold.', key:'I', openWith:'<em>', closeWith:'</em>'  },
        {name:'| STRIKE THROUGH | Select portion of text first. Click on this button to make it strike through.', key:'S', openWith:'<del>', closeWith:'</del>' },
        {separator:'---------------' },
        {name:'| UL | Click on this button to create unordered list opening and closing tag.', openWith:'<ul>\n', closeWith:'</ul>\n' },
        {name:'| LI | Select portion of text between &lt;ul&gt; and &lt;/ul&gt; tags. Click on this button to make list item.', openWith:'<li>', closeWith:'</li>' },
        {separator:'---------------' },
        {name:'| LINK | Select portion of text first. Click on this button to create a link.', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Create link' },
		{separator:'---------------' },
        {name:'| QUOTES | Select portion of text first. Click on this button to create quotes.', openWith:'<blockquote>\n', closeWith:'</blockquote>\n' },
		{separator:'---------------' },
        {name:'| CODE BLOCK | Select portion of code first. Click on this button to create preformated code block.', openWith:'<pre><code>\n', closeWith:'</code></pre>\n' },
        {name:'| ENCODE HTML SPECIAL CHARS | If pasted code contains special characters (&lt;, &gt;) it must be encoded first to enable save! Select portion of code first and click to Encode.',
         className:"encodechars", 
         replaceWith:function( markItUp ) { 
            c = document.createElement( 'div' );
            c.appendChild( document.createTextNode( markItUp.selection ) );
            return c.innerHTML; 
         }
        },
        {separator:'---------------' },
        {name:'| CLEAN | Select portion of HTML formatted text first. Click on this button to clean up HTML code.', replaceWith:function(h) { return h.selection.replace(/<(.*?)>/g, "") } },
		{separator:'---------------' },
        {name:'| PREVIEW | Click on this button to preview your entry!', call:'preview', className:'preview' }
    ]
}
