DmitrMakeev commited on
Commit
ca225b4
·
verified ·
1 Parent(s): c2c0e46

Create builder.html

Browse files
Files changed (1) hide show
  1. builder.html +52 -0
builder.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>GrapesJS Example</title>
7
+ <!-- GrapesJS CSS -->
8
+ <link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
9
+
10
+ </head>
11
+ <body>
12
+ <div id="gjs"></div>
13
+
14
+ <!-- GrapesJS JS -->
15
+ <script src="https://unpkg.com/grapesjs"></script>
16
+ <!-- GrapesJS Russian Language File -->
17
+ <script src="https://unpkg.com/grapesjs/dist/i18n/ru.js"></script>
18
+
19
+
20
+ <script type="text/javascript">
21
+ const editor = grapesjs.init({
22
+ container: '#gjs',
23
+ fromElement: true,
24
+ height: '100vh',
25
+ storageManager: { type: 0 },
26
+ plugins: [],
27
+ pluginsOpts: {},
28
+ i18n: {
29
+ locale: 'ru', // Устанавливаем русский язык
30
+ detectLocale: true, // Автоматически определяем язык браузера
31
+ localeFallback: 'en', // Язык по умолчанию, если язык не поддерживается
32
+ messages: {
33
+ ru: {
34
+ 'blockManager.labels.section': 'Раздел',
35
+ 'blockManager.labels.text': 'Текст',
36
+ 'blockManager.labels.image': 'Изображение',
37
+ // Добавьте другие переводы здесь
38
+ }
39
+ }
40
+ }
41
+ });
42
+
43
+ // Example of adding a button with JavaScript code
44
+ const blockManager = editor.BlockManager;
45
+ blockManager.add('example-button', {
46
+ label: 'Пример кнопки',
47
+ content: `<button onclick="alert('Привет, Мир!');">Нажми меня</button>`,
48
+ attributes: { class: 'gjs-block-section' }
49
+ });
50
+ </script>
51
+ </body>
52
+ </html>