DmitrMakeev commited on
Commit
c250c33
·
verified ·
1 Parent(s): 07db342

Update js/sav_html.js

Browse files
Files changed (1) hide show
  1. js/sav_html.js +7 -2
js/sav_html.js CHANGED
@@ -3,7 +3,7 @@ function exportHtml() {
3
  const cssCode = editor.getCss();
4
  const jsCode = editor.getJs();
5
 
6
- // Собираем выбранные скрипты
7
  const selectedScripts = [];
8
  if (document.getElementById('script1-checkbox').checked) {
9
  selectedScripts.push(document.getElementById('script1-checkbox').value);
@@ -18,6 +18,11 @@ function exportHtml() {
18
  // Собираем дополнительные скрипты
19
  const additionalScripts = selectedScripts.map(script => `<script src="${script}"><\/script>`).join('');
20
 
 
 
 
 
 
21
  // Объединение всего в один HTML-файл
22
  const fullHtml = `
23
  <!DOCTYPE html>
@@ -27,8 +32,8 @@ function exportHtml() {
27
  </head>
28
  <body>
29
  ${htmlCode}
30
- <script>${jsCode}<\/script>
31
  ${additionalScripts}
 
32
  </body>
33
  </html>
34
  `;
 
3
  const cssCode = editor.getCss();
4
  const jsCode = editor.getJs();
5
 
6
+ // Собираем выбранные скрипты по галочкам
7
  const selectedScripts = [];
8
  if (document.getElementById('script1-checkbox').checked) {
9
  selectedScripts.push(document.getElementById('script1-checkbox').value);
 
18
  // Собираем дополнительные скрипты
19
  const additionalScripts = selectedScripts.map(script => `<script src="${script}"><\/script>`).join('');
20
 
21
+ // Собираем собственные скрипты, которые вы написали
22
+ const customScripts = `
23
+ ${jsCode}
24
+ `;
25
+
26
  // Объединение всего в один HTML-файл
27
  const fullHtml = `
28
  <!DOCTYPE html>
 
32
  </head>
33
  <body>
34
  ${htmlCode}
 
35
  ${additionalScripts}
36
+ ${customScripts}
37
  </body>
38
  </html>
39
  `;