/*
Script: MooEditable.Extras.js
	Extends MooEditable to include more (simple) toolbar buttons.

License:
	MIT-style license.
*/

MooEditable.Actions.extend({

	formatBlock: {
		title: 'Formatage',
		type: 'menu-list',
		options: {
			list: [
				{text: 'Paragraphe', value: 'p'},
				{text: 'Titre 1', value: 'h1', style: 'font-size:24px; font-weight:bold;'},
				{text: 'Titre 2', value: 'h2', style: 'font-size:18px; font-weight:bold;'},
				{text: 'Titre 3', value: 'h3', style: 'font-size:14px; font-weight:bold;'}
			]
		},
		states: {
			tags: ['p', 'h1', 'h2', 'h3']
		},
		command: function(menulist, name){
			var argument = '<' + name + '>';
			this.focus();
			this.execute('formatBlock', false, argument);
		}
	},
	
	justifyleft:{
		title: 'Aligner à gauche',
		states: {
			css: {'text-align': 'left'}
		}
	},
	
	justifyright:{
		title: 'Aligner à droite',
		states: {
			css: {'text-align': 'right'}
		}
	},
	
	justifycenter:{
		title: 'Centrer',
		states: {
			tags: ['center'],
			css: {'text-align': 'center'}
		}
	},
	
	justifyfull:{
		title: 'Justifier',
		states: {
			css: {'text-align': 'justify'}
		}
	}

});
