Update pages.html
Browse files- pages.html +3 -52
pages.html
CHANGED
|
@@ -51,7 +51,7 @@
|
|
| 51 |
<script src="https://unpkg.com/grapesjs-user-blocks"></script>
|
| 52 |
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
|
| 57 |
<style>
|
|
@@ -405,18 +405,7 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
|
|
| 405 |
<p>Некоторый текст в модальном теле</p>
|
| 406 |
|
| 407 |
|
| 408 |
-
|
| 409 |
-
<div>
|
| 410 |
-
<div class="input-row">
|
| 411 |
-
<label for="title">Название:</label>
|
| 412 |
-
<input type="text" id="title" placeholder="Введите название">
|
| 413 |
-
<label for="file">Ссылка на файл:</label>
|
| 414 |
-
<input type="text" id="file" placeholder="Введите ссылку">
|
| 415 |
-
</div>
|
| 416 |
-
<button id="addVideo">Добавить медиа</button>
|
| 417 |
-
<button id="saveToClipboard">Сохранить в буфер обмена</button>
|
| 418 |
-
</div>
|
| 419 |
-
<div id="jsoneditor"></div>
|
| 420 |
|
| 421 |
|
| 422 |
|
|
@@ -814,45 +803,7 @@ window.onclick = function(event) {
|
|
| 814 |
|
| 815 |
|
| 816 |
|
| 817 |
-
|
| 818 |
-
// Редактор медиа листов Json
|
| 819 |
-
|
| 820 |
-
document.addEventListener('DOMContentLoaded', function() {
|
| 821 |
-
const container = document.getElementById('jsoneditor');
|
| 822 |
-
const options = {
|
| 823 |
-
mode: 'code',
|
| 824 |
-
modes: ['code', 'tree'],
|
| 825 |
-
onError: function(err) {
|
| 826 |
-
alert(err.toString());
|
| 827 |
-
}
|
| 828 |
-
};
|
| 829 |
-
const editor = new JSONEditor(container, options);
|
| 830 |
-
let videoList = [];
|
| 831 |
-
editor.set(videoList);
|
| 832 |
-
document.getElementById('addVideo').addEventListener('click', function() {
|
| 833 |
-
const title = document.getElementById('title').value;
|
| 834 |
-
const file = document.getElementById('file').value;
|
| 835 |
-
if (title && file) {
|
| 836 |
-
videoList.push({ title, file });
|
| 837 |
-
editor.set(videoList);
|
| 838 |
-
document.getElementById('title').value = '';
|
| 839 |
-
document.getElementById('file').value = '';
|
| 840 |
-
} else {
|
| 841 |
-
alert('Please fill in both title and file URL.');
|
| 842 |
-
}
|
| 843 |
-
});
|
| 844 |
-
document.getElementById('saveToClipboard').addEventListener('click', function() {
|
| 845 |
-
const json = editor.get();
|
| 846 |
-
const jsonString = JSON.stringify(json); // Убираем параметры отступов
|
| 847 |
-
navigator.clipboard.writeText(jsonString).then(function() {
|
| 848 |
-
alert('JSON saved to clipboard!');
|
| 849 |
-
}, function(err) {
|
| 850 |
-
console.error('Could not copy text: ', err);
|
| 851 |
-
});
|
| 852 |
-
});
|
| 853 |
-
});
|
| 854 |
-
|
| 855 |
-
</script>
|
| 856 |
|
| 857 |
|
| 858 |
|
|
|
|
| 51 |
<script src="https://unpkg.com/grapesjs-user-blocks"></script>
|
| 52 |
|
| 53 |
|
| 54 |
+
|
| 55 |
|
| 56 |
|
| 57 |
<style>
|
|
|
|
| 405 |
<p>Некоторый текст в модальном теле</p>
|
| 406 |
|
| 407 |
|
| 408 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 409 |
|
| 410 |
|
| 411 |
|
|
|
|
| 803 |
|
| 804 |
|
| 805 |
|
| 806 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 807 |
|
| 808 |
|
| 809 |
|