DmitrMakeev commited on
Commit
84ce02a
·
verified ·
1 Parent(s): 645171a

Update forms.html

Browse files
Files changed (1) hide show
  1. forms.html +5 -41
forms.html CHANGED
@@ -2,48 +2,12 @@
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>Formeo with JSON Copy</title>
7
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/formeo/1.0.3/css/formeo.min.css">
8
- <style>
9
- body {
10
- font-family: Arial, sans-serif;
11
- margin: 20px;
12
- }
13
- button {
14
- padding: 10px 20px;
15
- margin-top: 20px;
16
- cursor: pointer;
17
- }
18
- </style>
19
  </head>
20
  <body>
21
- <h1>Formeo with JSON Copy</h1>
22
- <div id="formeo-editor"></div>
23
- <button id="copyJsonButton">Копировать JSON в буфер обмена</button>
24
-
25
  <script src="https://cdnjs.cloudflare.com/ajax/libs/formeo/1.0.3/js/formeo.min.js"></script>
26
- <script>
27
- document.addEventListener('DOMContentLoaded', function() {
28
- // Инициализация Formeo
29
- const formeoEditor = new FormeoEditor({
30
- editorContainer: '#formeo-editor'
31
- });
32
-
33
- // Добавление обработчика события для кнопки
34
- document.getElementById('copyJsonButton').addEventListener('click', function() {
35
- formeoEditor.getJSON().then(json => {
36
- const jsonString = JSON.stringify(json, null, 2);
37
- navigator.clipboard.writeText(jsonString).then(() => {
38
- alert('JSON скопирован в буфер обмена');
39
- }).catch(err => {
40
- alert('Не удалось скопировать JSON в буфер обмена: ' + err);
41
- });
42
- }).catch(err => {
43
- alert('Ошибка при получении JSON: ' + err);
44
- });
45
- });
46
- });
47
- </script>
48
  </body>
49
- </html>
 
 
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <title>Formeo example</title>
6
+ <link rel="stylesheet" href="node_modules/formeo/dist/formeo.min.css" media="screen">
 
 
 
 
 
 
 
 
 
 
 
 
7
  </head>
8
  <body>
9
+ <div id="formeo-editor"></div>
 
 
 
10
  <script src="https://cdnjs.cloudflare.com/ajax/libs/formeo/1.0.3/js/formeo.min.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  </body>
12
+ </html>
13
+