forked from codinova-tech/editorjs-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
executable file
·151 lines (138 loc) · 4.86 KB
/
test.html
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test of Table</title>
<style>
body, html {
margin: 0;
}
body {
display: flex;
flex-direction: column;
align-items: center;
}
#editorjs {
width: 800px;
margin-top: 10px;
}
</style>
</head>
<body>
<div id="editorjs"></div>
<div class="ce-example__output">
<pre class="ce-example__output-content" id="output"></pre>
</div>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
<script src="./dist/bundle.umd.js"></script>
<script>
const editor = new EditorJS({
autofocus: true,
placeholder: 'Table tool test',
holder: 'editorjs',
tools: {
table: {
class: Table,
inlineToolbar: true,
config: {
rows: 0,
cols: 0
},
},
},
i18n: {
messages: {
tools: {
table: {
"Insert column before": "Insert column before TRANSLATION",
"Insert column after": "Insert column after TRANSLATION",
"Insert row before": "Insert row before TRANSLATION",
"Insert row after": "Insert row after TRANSLATION",
"Delete row": "Delete row TRANSLATION",
"Delete column": "Delete column TRANSLATION",
}
},
},
},
data: {
blocks: [
{
"type": "table",
"data": {
"content": [
[
{
cell: {
type: 'image',
value: 'https://placehold.co/160x50'
},
attributes: {
colspan: 2
},
styles: {
textAlign: 'center'
}
},
],
[
{
cell: {
type: 'text',
value: 'Перевернутый текст'
},
attributes: {
colspan: 2
},
styles: {
borderTop: '1px dashed blue',
borderLeft: '1px dashed red',
borderRight: '6px dashed green',
borderBottom: '1px dashed red',
writingMode: 'vertical-rl',
transform: 'scale(-1)'
}
},
],
[
{
cell: {
type: 'text',
value: 'asd1',
},
},
{
cell: {
type: 'text',
value: 'asd2',
},
},
{
cell: {
type: 'text',
value: 'asd2',
},
}
],
[
{
cell: {
type: 'text',
value: 'asd1',
},
},
{
cell: {
type: 'text',
value: 'asd2',
},
}
]
]
}
}
]
},
})
</script>
</body>
</html>