// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// BBCode tags example
// http://en.wikipedia.org/wiki/Bbcode
// ----------------------------------------------------------------------------
// Feel free to add more tags
// ----------------------------------------------------------------------------
mySettings = {
	previewParserPath:	'', // path to your BBCode parser
	markupSet: [
		{name:'Полужирный', key:'B', openWith:'[b]', closeWith:'[/b]'},
		{name:'Наклонный текст', key:'I', openWith:'[i]', closeWith:'[/i]'},
		{name:'Подчеркнутый текст', key:'U', openWith:'[u]', closeWith:'[/u]'},
		{separator:'---------------' },
		{name:'Изображение', className:'tinyUrl', openWith:function(markItUp) { return miu.picUpload(markItUp) }, closeWith:'' },
		{name:'Видео', className:'tinyUrl', openWith:function(markItUp) { return miu2.movUpload(markItUp) }, closeWith:'',
		dropMenu :[
			{name:'Загрузить своё', openWith:function(markItUp) { return miu2.movUpload(markItUp) }, closeWith:'' },
			{name:'YouTube', openWith:'[youtube=[![Введите ссылку вида - http://www.youtube.com/watch?v=tQb8i9x-S7M]!]]', closeWith:'' },
			{name:'RuTube', openWith:'[rutube=[![Введите ссылку вида - http://rutube.ru/tracks/863503.html?v=15141a521c9551567ac9709aa1df39bb]!]]', closeWith:'' },
			{name:'Smotri', openWith:'[smotri=[![Введите ссылку вида - http://smotri.com/video/view/?id=v513282968e]!]]', closeWith:'' }
		]},
		{name:'Музыка', className:'tinyUrl', openWith:function(markItUp) { return miu3.mp3Upload(markItUp) }, closeWith:'' },
		{name:'Ссылка', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
		{separator:'---------------' },
		{name:'Размер шрифта', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]',
		dropMenu :[
			{name:'Большой', openWith:'[size=200]', closeWith:'[/size]' },
			{name:'Нормальный', openWith:'[size=100]', closeWith:'[/size]' },
			{name:'Маленький', openWith:'[size=50]', closeWith:'[/size]' }
		]},
		{separator:'---------------' },
		{name:'Маркированный список', openWith:'[list]\n', closeWith:'\n[/list]'},
		{name:'Числовой список', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'}, 
		{name:'Пункт списка', openWith:'[*] '},
		{separator:'---------------' },
		{name:'Цитата', openWith:'[quote]', closeWith:'[/quote]'},
		{name:'Код', openWith:'[code]', closeWith:'[/code]'}, 
		{separator:'---------------' },
		{name:'Очистить', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } }
	]
}

guestSettings = {
	previewParserPath:	'', // path to your BBCode parser
	markupSet: [
		{name:'Полужирный', key:'B', openWith:'[b]', closeWith:'[/b]'},
		{name:'Наклонный текст', key:'I', openWith:'[i]', closeWith:'[/i]'},
		{name:'Подчеркнутый текст', key:'U', openWith:'[u]', closeWith:'[/u]'},
		{separator:'---------------' },
		{name:'Размер шрифта', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]',
		dropMenu :[
			{name:'Большой', openWith:'[size=200]', closeWith:'[/size]' },
			{name:'Нормальный', openWith:'[size=100]', closeWith:'[/size]' },
			{name:'Маленький', openWith:'[size=50]', closeWith:'[/size]' }
		]},
		{separator:'---------------' },
		{name:'Маркированный список', openWith:'[list]\n', closeWith:'\n[/list]'},
		{name:'Числовой список', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'}, 
		{name:'Пункт списка', openWith:'[*] '},
		{separator:'---------------' },
		{name:'Цитата', openWith:'[quote]', closeWith:'[/quote]'},
		{separator:'---------------' },
		{name:'Очистить', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } }
	]
}

miu = {
	picUpload: function (markItUp)
	{
		window.open('/editor/add/image/', '', 'toolbar=0,location=0,status=0, left=270, top=220, menubar=0, scrollbars=yes, resizable=0, width=280, height=325');
	}
}

miu2 = {
	movUpload: function (markItUp)
	{
		window.open('/editor/add/movie/', '', 'toolbar=0,location=0,status=0, left=270, top=220, menubar=0, scrollbars=yes, resizable=0, width=330, height=425');
	}
}

miu3 = {
	mp3Upload: function (markItUp)
	{
		window.open('/editor/add/music/', '', 'toolbar=0,location=0,status=0, left=270, top=220, menubar=0, scrollbars=yes, resizable=0, width=330, height=425');
	}
}