// -------------------------------------------------------------------
// markItUp!
// --------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// -------------------------------------------------------------------
// Dotclear Wiki tags example
// -------------------------------------------------------------------
// Feel free to add more tags
// -------------------------------------------------------------------
dotclear_image_base_string = '(({src}|{alt}))';
//dotclear_image_base_string = '[{text}|{big_src}|en|(({src}|{alt}))]';
dotclear_link_base_string = '[{text}|{src}|en|{title}]';

dotclear_normal = {
	previewParserPath:	'/render_text/dotclear/',
	onShiftEnter:		{keepDefault:false, replaceWith:'%%%\n'},
	onCtrlEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpDotclearH1Button', key:'1', openWith:'!!!!!', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpDotclearH2Button', key:'2', openWith:'!!!!', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpDotclearH3Button', key:'3', openWith:'!!!', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpDotclearH4Button', key:'4', openWith:'!!', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpDotclearH5Button', key:'5', openWith:'!', placeHolder:'Your title here...' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpDotclearBoldButton', key:'B', openWith:'__', closeWith:'__'}, 
		{name:'Italic', className:'markItUpDotclearItalicButton', key:'I', openWith:"''", closeWith:"''"}, 
		{name:'Stroke through', className:'markItUpDotclearStrokeButton', key:'S', openWith:'--', closeWith:'--'}, 
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpDotclearBulletListButton', openWith:'(!(* |!|*)!)'}, 
		{name:'Numeric list', className:'markItUpDotclearNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', dotclear_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture', className:'markItUpDotclearPictureButton', key:"P", replaceWith:'(([![Url:!:http://]!]|[![Alternative text]!](!(|[![Position:!:L]!])!)))'}, 
		{name:'Link', className:'markItUpDotclearLinkButton', key:"L", openWith:"[", closeWith:'|[![Url:!:http://]!]|[![Language:!:en]!]|[![Title]!]]', placeHolder:'Your text to link here...' }, 
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpDotclearQuoteButton', openWith:'{{', closeWith:'}}'}, 
		{name:'Code', className:'markItUpDotclearCodeButton', openWith:'@@', closeWith:'@@'}, 
		{separator:'---------------' },
		{name:'Preview', className:'markItUpDotclearPreviewButton', call:'preview'}
	]
}

dotclear_text_only = {
	previewParserPath:	'/render_text/dotclear/',
	onShiftEnter:		{keepDefault:false, replaceWith:'%%%\n'},
	onCtrlEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpDotclearH1Button', key:'1', openWith:'!!!!!', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpDotclearH2Button', key:'2', openWith:'!!!!', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpDotclearH3Button', key:'3', openWith:'!!!', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpDotclearH4Button', key:'4', openWith:'!!', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpDotclearH5Button', key:'5', openWith:'!', placeHolder:'Your title here...' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpDotclearBoldButton', key:'B', openWith:'__', closeWith:'__'}, 
		{name:'Italic', className:'markItUpDotclearItalicButton', key:'I', openWith:"''", closeWith:"''"}, 
		{name:'Stroke through', className:'markItUpDotclearStrokeButton', key:'S', openWith:'--', closeWith:'--'}, 
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpDotclearBulletListButton', openWith:'(!(* |!|*)!)'}, 
		{name:'Numeric list', className:'markItUpDotclearNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', dotclear_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpDotclearQuoteButton', openWith:'{{', closeWith:'}}'}, 
		{name:'Code', className:'markItUpDotclearCodeButton', openWith:'@@', closeWith:'@@'}, 
		{separator:'---------------' },
		{name:'Preview', className:'markItUpDotclearPreviewButton', call:'preview'}
	]
}

dotclear_library = {
	previewParserPath:	'/render_text/dotclear/',
	onShiftEnter:		{keepDefault:false, replaceWith:'%%%\n'},
	onCtrlEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpDotclearH1Button', key:'1', openWith:'!!!!!', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpDotclearH2Button', key:'2', openWith:'!!!!', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpDotclearH3Button', key:'3', openWith:'!!!', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpDotclearH4Button', key:'4', openWith:'!!', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpDotclearH5Button', key:'5', openWith:'!', placeHolder:'Your title here...' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpDotclearBoldButton', key:'B', openWith:'__', closeWith:'__'}, 
		{name:'Italic', className:'markItUpDotclearItalicButton', key:'I', openWith:"''", closeWith:"''"}, 
		{name:'Stroke through', className:'markItUpDotclearStrokeButton', key:'S', openWith:'--', closeWith:'--'}, 
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpDotclearBulletListButton', openWith:'(!(* |!|*)!)'}, 
		{name:'Numeric list', className:'markItUpDotclearNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', dotclear_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture Library', className:'markItUpMarkdownPicutreLibraryButton', 
            beforeInsert:function() { 
                $("#pictureLibraryPlugin").load(
                    '/ajax/picture_library/view/' + pictureLibraryObjectId + "/",
                    function() {
                        $(".pictureLibrarySelection").attr('baseString', dotclear_image_base_string);
                        $("#pictureLibraryPlugin").modal();
                    }
                );
            }
        },
		{name:'Picture', className:'markItUpDotclearPictureButton', key:"P", replaceWith:'(([![Url:!:http://]!]|[![Alternative text]!](!(|[![Position:!:L]!])!)))'}, 
		{name:'Link', className:'markItUpDotclearLinkButton', key:"L", openWith:"[", closeWith:'|[![Url:!:http://]!]|[![Language:!:en]!]|[![Title]!]]', placeHolder:'Your text to link here...' }, 
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpDotclearQuoteButton', openWith:'{{', closeWith:'}}'}, 
		{name:'Code', className:'markItUpDotclearCodeButton', openWith:'@@', closeWith:'@@'}, 
		{separator:'---------------' },
		{name:'Preview', className:'markItUpDotclearPreviewButton', call:'preview'}
	]
}

dotclear_cms_page = {
	previewParserPath:	'/render_text/dotclear/',
	onShiftEnter:		{keepDefault:false, replaceWith:'%%%\n'},
	onCtrlEnter:		{keepDefault:false, replaceWith:'\n\n'},
	markupSet: [
		{name:'Heading 1', className:'markItUpDotclearH1Button', key:'1', openWith:'!!!!!', placeHolder:'Your title here...' },
		{name:'Heading 2', className:'markItUpDotclearH2Button', key:'2', openWith:'!!!!', placeHolder:'Your title here...' },
		{name:'Heading 3', className:'markItUpDotclearH3Button', key:'3', openWith:'!!!', placeHolder:'Your title here...' },
		{name:'Heading 4', className:'markItUpDotclearH4Button', key:'4', openWith:'!!', placeHolder:'Your title here...' },
		{name:'Heading 5', className:'markItUpDotclearH5Button', key:'5', openWith:'!', placeHolder:'Your title here...' },
		{separator:'---------------' },
		{name:'Bold', className:'markItUpDotclearBoldButton', key:'B', openWith:'__', closeWith:'__'}, 
		{name:'Italic', className:'markItUpDotclearItalicButton', key:'I', openWith:"''", closeWith:"''"}, 
		{name:'Stroke through', className:'markItUpDotclearStrokeButton', key:'S', openWith:'--', closeWith:'--'}, 
		{separator:'---------------' },
		{name:'Bulleted list', className:'markItUpDotclearBulletListButton', openWith:'(!(* |!|*)!)'}, 
		{name:'Numeric list', className:'markItUpDotclearNumericListButton', openWith:'(!(# |!|#)!)'}, 
		{separator:'---------------' },
		{name:'Crochet Symbols', className:'markItUpMarkdownCrochetSymbolsButton',
            beforeInsert:function() { 
                $('.markItUpCrochetSymbol').attr('baseString', dotclear_image_base_string);
                $("#crochetSymbolsPlugin").modal();
            }
		},
		{name:'Picture Library', className:'markItUpMarkdownPicutreLibraryButton', 
            beforeInsert:function() { 
                $("#pictureLibraryPlugin").load(
                    '/ajax/picture_library/view/' + pictureLibraryObjectId + "/",
                    function() {
                        $(".pictureLibrarySelection").attr('baseString', dotclear_image_base_string);
                        $("#pictureLibraryPlugin").modal();
                    }
                );
            }
        },
		{name:'Picture', className:'markItUpDotclearPictureButton', key:"P", replaceWith:'(([![Url:!:http://]!]|[![Alternative text]!](!(|[![Position:!:L]!])!)))'}, 
		{name:'Internal Link', className:'markItUpMarkdownPageSelectorLinkButton',
            beforeInsert:function() {
                $("#pageSelectorPlugin").load(
                    "/ajax/page_list_selector/",
                    function () {
                        $(".pageListSelection").attr('baseString', dotclear_link_base_string);
                        $("#pageSelectorPlugin").modal();
                    }
                );
            }
		},
		{name:'External Link', className:'markItUpDotclearLinkButton', key:"L", openWith:"[", closeWith:'|[![Url:!:http://]!]|[![Language:!:en]!]|[![Title]!]]', placeHolder:'Your text to link here...' }, 
		{separator:'---------------' },
		{name:'Quotes', className:'markItUpDotclearQuoteButton', openWith:'{{', closeWith:'}}'}, 
		{name:'Code', className:'markItUpDotclearCodeButton', openWith:'@@', closeWith:'@@'}, 
		{separator:'---------------' },
		{name:'Preview', className:'markItUpDotclearPreviewButton', call:'preview'}
	]
}

