// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Html tags
// http://en.wikipedia.org/wiki/html
// ----------------------------------------------------------------------------
// Basic set. Feel free to add more tags
// ----------------------------------------------------------------------------
html_image_base_string = '<img src="{src}" alt="{alt}" title="{title}" />';
//html_image_base_string = '<a href="{big_src}" title="{title}"><img src="{src}" alt="{alt}" title="{title}" /></a>';
html_link_base_string = '<a href="{src}" title="{title}">{text}</a>';

html_normal = {
	previewParserPath:	'/render_text/html/',
	onShiftEnter:	{keepDefault:false, replaceWith:'<br />\n'},
	onCtrlEnter:	{keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
	onTab:			{keepDefault:false, openWith:'	 '},
	markupSet: [
		{name:'Heading 1', className:'markItUpHtmlH1Button', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpHtmlH2Button', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpHtmlH3Button', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpHtmlH5Button', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpHtmlH5Button', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpHtmlH6Button', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpHtmlPButton', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpHtmlBoldButton', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
		{name:'Italic', className:'markItUpHtmlItalicButton', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
		{name:'Stroke through', className:'markItUpHtmlStrokeButton', key:'S', openWith:'<del>', closeWith:'</del>' },
		{separator:'---------------' },
		{name:'Ul', className:'markItUpHtmlBulletListButton', openWith:'<ul>\n', closeWith:'</ul>\n' },
		{name:'Ol', className:'markItUpHtmlNumericListButton', openWith:'<ol>\n', closeWith:'</ol>\n' },
		{name:'Li', className:'markItUpHtmlListItemButton', openWith:'<li>', closeWith:'</li>' },
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', html_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture', className:'markItUpHtmlPictureButton', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
		{name:'Link', className:'markItUpHtmlLinkButton', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
		{separator:'---------------' },
		{name:'Clean', className:'markItUpHtmlCleanButton', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
		{name:'Preview', className:'markItUpHtmlPreviewButton', call:'preview' }
	]
}

html_text_only = {
	previewParserPath:	'/render_text/html/',
	onShiftEnter:	{keepDefault:false, replaceWith:'<br />\n'},
	onCtrlEnter:	{keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
	onTab:			{keepDefault:false, openWith:'	 '},
	markupSet: [
		{name:'Heading 1', className:'markItUpHtmlH1Button', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpHtmlH2Button', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpHtmlH3Button', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpHtmlH5Button', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpHtmlH5Button', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpHtmlH6Button', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpHtmlPButton', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpHtmlBoldButton', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
		{name:'Italic', className:'markItUpHtmlItalicButton', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
		{name:'Stroke through', className:'markItUpHtmlStrokeButton', key:'S', openWith:'<del>', closeWith:'</del>' },
		{separator:'---------------' },
		{name:'Ul', className:'markItUpHtmlBulletListButton', openWith:'<ul>\n', closeWith:'</ul>\n' },
		{name:'Ol', className:'markItUpHtmlNumericListButton', openWith:'<ol>\n', closeWith:'</ol>\n' },
		{name:'Li', className:'markItUpHtmlListItemButton', openWith:'<li>', closeWith:'</li>' },
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', html_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{separator:'---------------' },
		{name:'Clean', className:'markItUpHtmlCleanButton', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
		{name:'Preview', className:'markItUpHtmlPreviewButton', call:'preview' }
	]
}

html_library = {
	previewParserPath:	'/render_text/html/',
	onShiftEnter:	{keepDefault:false, replaceWith:'<br />\n'},
	onCtrlEnter:	{keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
	onTab:			{keepDefault:false, openWith:'	 '},
	markupSet: [
		{name:'Heading 1', className:'markItUpHtmlH1Button', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpHtmlH2Button', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpHtmlH3Button', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpHtmlH5Button', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpHtmlH5Button', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpHtmlH6Button', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpHtmlPButton', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpHtmlBoldButton', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
		{name:'Italic', className:'markItUpHtmlItalicButton', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
		{name:'Stroke through', className:'markItUpHtmlStrokeButton', key:'S', openWith:'<del>', closeWith:'</del>' },
		{separator:'---------------' },
		{name:'Ul', className:'markItUpHtmlBulletListButton', openWith:'<ul>\n', closeWith:'</ul>\n' },
		{name:'Ol', className:'markItUpHtmlNumericListButton', openWith:'<ol>\n', closeWith:'</ol>\n' },
		{name:'Li', className:'markItUpHtmlListItemButton', openWith:'<li>', closeWith:'</li>' },
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', html_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture Library', className:'markItUpMarkdownPicutreLibraryButton', 
            beforeInsert:function() { 
                $("#pictureLibraryPlugin").load(
                    '/ajax/picture_library/view/' + pictureLibraryObjectId + "/",
                    function() {
                        $(".pictureLibrarySelection").attr('baseString', html_image_base_string);
                        $("#pictureLibraryPlugin").modal();
                    }
                );
            }
        },
		{name:'Picture', className:'markItUpHtmlPictureButton', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
		{name:'Link', className:'markItUpHtmlLinkButton', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
		{separator:'---------------' },
		{name:'Clean', className:'markItUpHtmlCleanButton', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
		{name:'Preview', className:'markItUpHtmlPreviewButton', call:'preview' }
	]
}

html_cms_page = {
	previewParserPath:	'/render_text/html/',
	onShiftEnter:	{keepDefault:false, replaceWith:'<br />\n'},
	onCtrlEnter:	{keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
	onTab:			{keepDefault:false, openWith:'	 '},
	markupSet: [
		{name:'Heading 1', className:'markItUpHtmlH1Button', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpHtmlH2Button', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpHtmlH3Button', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpHtmlH5Button', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpHtmlH5Button', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpHtmlH6Button', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpHtmlPButton', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpHtmlBoldButton', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
		{name:'Italic', className:'markItUpHtmlItalicButton', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
		{name:'Stroke through', className:'markItUpHtmlStrokeButton', key:'S', openWith:'<del>', closeWith:'</del>' },
		{separator:'---------------' },
		{name:'Ul', className:'markItUpHtmlBulletListButton', openWith:'<ul>\n', closeWith:'</ul>\n' },
		{name:'Ol', className:'markItUpHtmlNumericListButton', openWith:'<ol>\n', closeWith:'</ol>\n' },
		{name:'Li', className:'markItUpHtmlListItemButton', openWith:'<li>', closeWith:'</li>' },
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', html_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture Library', className:'markItUpMarkdownPicutreLibraryButton', 
            beforeInsert:function() { 
                $("#pictureLibraryPlugin").load(
                    '/ajax/picture_library/view/' + pictureLibraryObjectId + "/",
                    function() {
                        $(".pictureLibrarySelection").attr('baseString', html_image_base_string);
                        $("#pictureLibraryPlugin").modal();
                    }
                );
            }
        },
		{name:'Picture', className:'markItUpHtmlPictureButton', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
		{name:'Internal Link', className:'markItUpMarkdownPageSelectorLinkButton',
            beforeInsert:function() {
                $("#pageSelectorPlugin").load(
                    "/ajax/page_list_selector/",
                    function () {
                        $(".pageListSelection").attr('baseString', html_link_base_string);
                        $("#pageSelectorPlugin").modal();
                    }
                );
            }
		},
		{name:'External Link', className:'markItUpHtmlLinkButton', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
		{separator:'---------------' },
		{name:'Clean', className:'markItUpHtmlCleanButton', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
		{name:'Preview', className:'markItUpHtmlPreviewButton', call:'preview' }
	]
}

