Update builder2.html
Browse files- builder2.html +23 -8
builder2.html
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
<script src="https://unpkg.com/grapesjs-plugin-forms"></script>
|
9 |
<script src="https://unpkg.com/grapesjs-custom-code"></script>
|
10 |
<style>
|
11 |
-
|
12 |
height: 100%;
|
13 |
margin: 0;
|
14 |
}
|
@@ -35,7 +35,7 @@
|
|
35 |
</head>
|
36 |
<body>
|
37 |
<div id="gjs" style="height:0px; overflow:hidden;">
|
38 |
-
|
39 |
<h1 class="welcome">Добро пожаловать!</h1>
|
40 |
<div class="big-title">
|
41 |
<img class="logo" src="https://via.placeholder.com/70x70.png?text=Logo" alt="Logo">
|
@@ -131,6 +131,13 @@
|
|
131 |
</style>
|
132 |
</div>
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
<!-- Кнопка для экспорта HTML -->
|
135 |
<button id="export-html">Export HTML</button>
|
136 |
|
@@ -164,17 +171,25 @@
|
|
164 |
}
|
165 |
});
|
166 |
|
167 |
-
// Функция для экспорта HTML с дополнительными скриптами
|
168 |
function exportHtml() {
|
169 |
const htmlCode = editor.getHtml();
|
170 |
const cssCode = editor.getCss();
|
171 |
const jsCode = editor.getJs();
|
172 |
|
173 |
-
//
|
174 |
-
const
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
// Объединение всего в один HTML-файл
|
180 |
const fullHtml = `
|
|
|
8 |
<script src="https://unpkg.com/grapesjs-plugin-forms"></script>
|
9 |
<script src="https://unpkg.com/grapesjs-custom-code"></script>
|
10 |
<style>
|
11 |
+
body, html {
|
12 |
height: 100%;
|
13 |
margin: 0;
|
14 |
}
|
|
|
35 |
</head>
|
36 |
<body>
|
37 |
<div id="gjs" style="height:0px; overflow:hidden;">
|
38 |
+
<div class="panel">
|
39 |
<h1 class="welcome">Добро пожаловать!</h1>
|
40 |
<div class="big-title">
|
41 |
<img class="logo" src="https://via.placeholder.com/70x70.png?text=Logo" alt="Logo">
|
|
|
131 |
</style>
|
132 |
</div>
|
133 |
|
134 |
+
<!-- Интерфейс для выбора скриптов -->
|
135 |
+
<div>
|
136 |
+
<label><input type="checkbox" id="script1-checkbox" value="https://example.com/your-additional-script1.js"> Script 1</label>
|
137 |
+
<label><input type="checkbox" id="script2-checkbox" value="https://example.com/your-additional-script2.js"> Script 2</label>
|
138 |
+
<label><input type="checkbox" id="script3-checkbox" value="https://example.com/your-additional-script3.js"> Script 3</label>
|
139 |
+
</div>
|
140 |
+
|
141 |
<!-- Кнопка для экспорта HTML -->
|
142 |
<button id="export-html">Export HTML</button>
|
143 |
|
|
|
171 |
}
|
172 |
});
|
173 |
|
|
|
174 |
function exportHtml() {
|
175 |
const htmlCode = editor.getHtml();
|
176 |
const cssCode = editor.getCss();
|
177 |
const jsCode = editor.getJs();
|
178 |
|
179 |
+
// Собираем выбранные скрипты
|
180 |
+
const selectedScripts = [];
|
181 |
+
if (document.getElementById('script1-checkbox').checked) {
|
182 |
+
selectedScripts.push(document.getElementById('script1-checkbox').value);
|
183 |
+
}
|
184 |
+
if (document.getElementById('script2-checkbox').checked) {
|
185 |
+
selectedScripts.push(document.getElementById('script2-checkbox').value);
|
186 |
+
}
|
187 |
+
if (document.getElementById('script3-checkbox').checked) {
|
188 |
+
selectedScripts.push(document.getElementById('script3-checkbox').value);
|
189 |
+
}
|
190 |
+
|
191 |
+
// Собираем дополнительные скрипты
|
192 |
+
const additionalScripts = selectedScripts.map(script => `<script src="${script}"><\/script>`).join('');
|
193 |
|
194 |
// Объединение всего в один HTML-файл
|
195 |
const fullHtml = `
|