summaryrefslogtreecommitdiff
path: root/code/admin/editor-bind-code.html
blob: d6a9825aa8d043e0ee1992ce392a1ea3e60762ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!-- Editor deffered loading -->
<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.1.js"></script>
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
<script>
	var Aloha = window.Aloha || ( window.Aloha = {} );
	
	Aloha.settings = {
		locale: 'fr',
		plugins: {
			format: {
				config : [ 'b', 'i','sub','sup'],
			  	editables : {
					// no formatting allowed for title
					'#title'	: [ ], 
					// formatting for all editable DIVs
					'div'		: [ 'b', 'i', 'del', 'sub', 'sup'  ], 
					// content is a DIV and has class .article so it gets both buttons
					'.article'	: [ 'b', 'i', 'p', 'title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'removeFormat']
			  	}
			},
			list: {
			 	// all elements with no specific configuration get an UL, just for fun :)
				config : [ 'ul' ],
			  	editables : {
					// Even if this is configured it is not set because OL and UL are not allowed in H1.
					'#title'	: [ 'ol' ], 
					// all divs get OL
					'div'		: [ 'ol' ], 
					// content is a DIV. It would get only OL but with class .article it also gets UL.
					'.article'	: [ 'ul' ]
			  	}
			},
			link: {
				config : [ 'a' ],
			  	editables : {
					// No links in the title.
					'#title'	: [  ]
			  	}
			}
		},
		sidebar: {
			disabled: false
		}
	};
</script>

<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/aloha.js"
			data-aloha-plugins="common/ui,
								common/format,
		                        common/table,
		                        common/list,
		                        common/link,
		                        common/highlighteditables,
		                        common/block,
		                        common/undo,
		                        common/image,
		                        common/contenthandler,
		                        common/paste,
		                        common/commands,
		                        common/abbr"></script>

<script type="text/javascript">
Aloha.ready(function() {
	// mark the editable parts
	$('#title').aloha();
	$('#teaser').aloha();
	$('#content').aloha();	
});

</script>