// -------------------------------------------------------------------
// markItUp!
// -------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// -------------------------------------------------------------------
// Textile tags example
// http://en.wikipedia.org/wiki/Textile_(markup_language)
// http://www.textism.com/
// -------------------------------------------------------------------
// Feel free to add more tags
// -------------------------------------------------------------------
textile_image_base_string = '!{src}({alt})!';
//textile_image_base_string = '"!{src}({alt})!({title})":{big_src}';
textile_link_base_string = '"{text}({title})":{src}';

textile_normal = {
	previewParserPath:	'/render_text/textile/',
	onShiftEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpTextileH1Button', key:'1', openWith:'h1(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpTextileH2Button', key:'2', openWith:'h2(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpTextileH3Button', key:'3', openWith:'h3(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpTextileH4Button', key:'4', openWith:'h4(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpTextileH5Button', key:'5', openWith:'h5(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpTextileH6Button', key:'6', openWith:'h6(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpTextilePButton', key:'P', openWith:'p(!(([![Class]!]))!). '},
		{separator:'---------------' },
		{name:'Bold', className:'markItUpTextileBoldButton', key:'B', closeWith:'*', openWith:'*'},
		{name:'Italic', className:'markItUpTextileItalicButton', key:'I', closeWith:'_', openWith:'_'},
		{name:'Stroke through', className:'markItUpTextileStrokeButton', key:'S', closeWith:'-', openWith:'-'},
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpTextileBulletListButton', openWith:'(!(* |!|*)!)'},
		{name:'Numeric list', className:'markItUpTextileNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', textile_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture', className:'markItUpTextilePictureButton', replaceWith:'![![Source:!:http://]!]([![Alternative text]!])!'}, 
		{name:'Link', className:'markItUpTextileLinkButton', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Your text to link here...' },
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpTextileQuoteButton', openWith:'bq(!(([![Class]!])!)). '},
		{name:'Code', className:'markItUpTextileCodeButton', openWith:'@', closeWith:'@'},
		{separator:'---------------' },
		{name:'Preview', className:'markItUpTextilePreviewButton', call:'preview'}
	]
}

textile_text_only = {
	previewParserPath:	'/render_text/textile/',
	onShiftEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpTextileH1Button', key:'1', openWith:'h1(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpTextileH2Button', key:'2', openWith:'h2(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpTextileH3Button', key:'3', openWith:'h3(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpTextileH4Button', key:'4', openWith:'h4(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpTextileH5Button', key:'5', openWith:'h5(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpTextileH6Button', key:'6', openWith:'h6(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpTextilePButton', key:'P', openWith:'p(!(([![Class]!]))!). '},
		{separator:'---------------' },
		{name:'Bold', className:'markItUpTextileBoldButton', key:'B', closeWith:'*', openWith:'*'},
		{name:'Italic', className:'markItUpTextileItalicButton', key:'I', closeWith:'_', openWith:'_'},
		{name:'Stroke through', className:'markItUpTextileStrokeButton', key:'S', closeWith:'-', openWith:'-'},
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpTextileBulletListButton', openWith:'(!(* |!|*)!)'},
		{name:'Numeric list', className:'markItUpTextileNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', textile_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpTextileQuoteButton', openWith:'bq(!(([![Class]!])!)). '},
		{name:'Code', className:'markItUpTextileCodeButton', openWith:'@', closeWith:'@'},
		{separator:'---------------' },
		{name:'Preview', className:'markItUpTextilePreviewButton', call:'preview'}
	]
}

textile_library = {
	previewParserPath:	'/render_text/textile/',
	onShiftEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpTextileH1Button', key:'1', openWith:'h1(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpTextileH2Button', key:'2', openWith:'h2(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpTextileH3Button', key:'3', openWith:'h3(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpTextileH4Button', key:'4', openWith:'h4(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpTextileH5Button', key:'5', openWith:'h5(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpTextileH6Button', key:'6', openWith:'h6(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpTextilePButton', key:'P', openWith:'p(!(([![Class]!]))!). '},
		{separator:'---------------' },
		{name:'Bold', className:'markItUpTextileBoldButton', key:'B', closeWith:'*', openWith:'*'},
		{name:'Italic', className:'markItUpTextileItalicButton', key:'I', closeWith:'_', openWith:'_'},
		{name:'Stroke through', className:'markItUpTextileStrokeButton', key:'S', closeWith:'-', openWith:'-'},
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpTextileBulletListButton', openWith:'(!(* |!|*)!)'},
		{name:'Numeric list', className:'markItUpTextileNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', textile_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture Library', className:'markItUpMarkdownPicutreLibraryButton', 
            beforeInsert:function() { 
                $("#pictureLibraryPlugin").load(
                    '/ajax/picture_library/view/' + pictureLibraryObjectId + "/",
                    function() {
                        $(".pictureLibrarySelection").attr('baseString', textile_image_base_string);
                        $("#pictureLibraryPlugin").modal();
                    }
                );
            }
        },
		{name:'Picture', className:'markItUpTextilePictureButton', replaceWith:'![![Source:!:http://]!]([![Alternative text]!])!'}, 
		{name:'Link', className:'markItUpTextileLinkButton', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Your text to link here...' },
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpTextileQuoteButton', openWith:'bq(!(([![Class]!])!)). '},
		{name:'Code', className:'markItUpTextileCodeButton', openWith:'@', closeWith:'@'},
		{separator:'---------------' },
		{name:'Preview', className:'markItUpTextilePreviewButton', call:'preview'}
	]
}

textile_cms_page = {
	previewParserPath:	'/render_text/textile/',
	onShiftEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpTextileH1Button', key:'1', openWith:'h1(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpTextileH2Button', key:'2', openWith:'h2(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpTextileH3Button', key:'3', openWith:'h3(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpTextileH4Button', key:'4', openWith:'h4(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpTextileH5Button', key:'5', openWith:'h5(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Heading 6', className:'markItUpTextileH6Button', key:'6', openWith:'h6(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
		{name:'Paragraph', className:'markItUpTextilePButton', key:'P', openWith:'p(!(([![Class]!]))!). '},
		{separator:'---------------' },
		{name:'Bold', className:'markItUpTextileBoldButton', key:'B', closeWith:'*', openWith:'*'},
		{name:'Italic', className:'markItUpTextileItalicButton', key:'I', closeWith:'_', openWith:'_'},
		{name:'Stroke through', className:'markItUpTextileStrokeButton', key:'S', closeWith:'-', openWith:'-'},
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpTextileBulletListButton', openWith:'(!(* |!|*)!)'},
		{name:'Numeric list', className:'markItUpTextileNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', textile_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture Library', className:'markItUpMarkdownPicutreLibraryButton', 
            beforeInsert:function() { 
                $("#pictureLibraryPlugin").load(
                    '/ajax/picture_library/view/' + pictureLibraryObjectId + "/",
                    function() {
                        $(".pictureLibrarySelection").attr('baseString', textile_image_base_string);
                        $("#pictureLibraryPlugin").modal();
                    }
                );
            }
        },
		{name:'Picture', className:'markItUpTextilePictureButton', replaceWith:'![![Source:!:http://]!]([![Alternative text]!])!'}, 
		{name:'Internal Link', className:'markItUpMarkdownPageSelectorLinkButton',
            beforeInsert:function() {
                $("#pageSelectorPlugin").load(
                    "/ajax/page_list_selector/",
                    function () {
                        $(".pageListSelection").attr('baseString', textile_link_base_string);
                        $("#pageSelectorPlugin").modal();
                    }
                );
            }
		},
		{name:'External Link', className:'markItUpTextileLinkButton', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Your text to link here...' },
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpTextileQuoteButton', openWith:'bq(!(([![Class]!])!)). '},
		{name:'Code', className:'markItUpTextileCodeButton', openWith:'@', closeWith:'@'},
		{separator:'---------------' },
		{name:'Preview', className:'markItUpTextilePreviewButton', call:'preview'}
	]
}

