-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplugin.js
132 lines (105 loc) · 4.09 KB
/
plugin.js
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
CKEDITOR.plugins.add( 'tabletoolstoolbar', {
requires: 'table,tabletools',
icons: 'table,tablealignleft,tablealigncenter,tablealignright,tablecellaligleft,tablecellinsertbefore,tablecellinsertafter,tablecelldelete,tablecellproperties,tablecellsmerge,tablecellmergeright,tablecellmergedown,tablecellsplithorizontal,tablecellsplitvertical,tabledelete,tableinsert,tableproperties,tablerowinsertbefore,tablerowinsertafter,tablerowdelete,tablecolumninsertbefore,tablecolumninsertafter,tablecolumndelete',
init: function( editor ) {
var lang = editor.lang.table;
//---------- BUTTONS
//-----------BUTTONS > table
editor.ui.addButton( 'tableinsert', {
label: lang.toolbar,
command: 'table',
toolbar: 'table'
});
editor.ui.addButton( 'tabledelete', {
label: lang.deleteTable,
command: 'tableDelete',
toolbar: 'table'
});
editor.ui.addButton( 'tableproperties', {
label: lang.menu,
command: 'tableProperties',
toolbar: 'table'
});
//TODO: How to add separator?
//-----------BUTTONS > tabletools
//-----------BUTTONS > tabletools > row
editor.ui.addButton( 'tablerowinsertbefore', {
label: lang.row.insertBefore,
command: 'rowInsertBefore',
toolbar: 'tablerow'
});
editor.ui.addButton( 'tablerowinsertafter', {
label: lang.row.insertAfter,
command: 'rowInsertAfter',
toolbar: 'tablerow'
});
editor.ui.addButton( 'tablerowdelete', {
label: lang.row.deleteRow,
command: 'rowDelete',
toolbar: 'tablerow'
});
//-----------BUTTONS > tabletools > column
editor.ui.addButton( 'tablecolumninsertbefore', {
label: lang.column.insertBefore,
command: 'columnInsertBefore',
toolbar: 'tablecolumn'
});
editor.ui.addButton( 'tablecolumninsertafter', {
label: lang.column.insertAfter,
command: 'columnInsertAfter',
toolbar: 'tablecolumn'
});
editor.ui.addButton( 'tablecolumndelete', {
label: lang.column.deleteColumn,
command: 'columnDelete',
toolbar: 'tablecolumn'
});
//-----------BUTTONS > tabletools > cell
editor.ui.addButton( 'tablecellinsertbefore', {
label: lang.cell.insertBefore,
command: 'cellInsertBefore',
toolbar: 'tablecell'
});
editor.ui.addButton( 'tablecellinsertafter', {
label: lang.cell.insertAfter,
command: 'cellInsertAfter',
toolbar: 'tablecell'
});
editor.ui.addButton( 'tablecelldelete', {
label: lang.cell.deleteCell,
command: 'cellDelete',
toolbar: 'tablecell'
});
editor.ui.addButton( 'tablecellproperties', {
label: lang.cell.title,
command: 'cellProperties',
toolbar: 'tablecell'
});
//-----------BUTTONS > tabletools > cell merge/split
editor.ui.addButton( 'tablecellsmerge', {
label: lang.cell.merge,
command: 'cellMerge',
toolbar: 'tablecellmergesplit'
});
editor.ui.addButton( 'tablecellmergeright', {
label: lang.cell.mergeRight,
command: 'cellMergeRight',
toolbar: 'tablecellmergesplit'
});
editor.ui.addButton( 'tablecellmergedown', {
label: lang.cell.mergeDown,
command: 'cellMergeDown',
toolbar: 'tablecellmergesplit'
});
editor.ui.addButton( 'tablecellsplithorizontal', {
label: lang.cell.splitHorizontal,
command: 'cellHorizontalSplit',
toolbar: 'tablecellmergesplit'
});
editor.ui.addButton( 'tablecellsplitvertical', {
label: lang.cell.splitVertical,
command: 'cellVerticalSplit',
toolbar: 'tablecellmergesplit'
});
}
});