Update pages.html
Browse files- pages.html +117 -1
pages.html
CHANGED
@@ -518,7 +518,123 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
|
|
518 |
<h2>HTMLешка</h2>
|
519 |
</div>
|
520 |
<div class="modal-body_3">
|
521 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
<br><br><br>
|
523 |
</div>
|
524 |
<div class="modal-footer_3">
|
|
|
518 |
<h2>HTMLешка</h2>
|
519 |
</div>
|
520 |
<div class="modal-body_3">
|
521 |
+
<style>
|
522 |
+
body {
|
523 |
+
font-family: Arial, sans-serif;
|
524 |
+
text-align: center;
|
525 |
+
background-color: #f0f0f0;
|
526 |
+
margin: 0;
|
527 |
+
padding: 0;
|
528 |
+
max-height: 250px; /* Устанавливаем максимальную высоту страницы */
|
529 |
+
}
|
530 |
+
h1 {
|
531 |
+
background-color: #4CAF50;
|
532 |
+
color: white;
|
533 |
+
padding: 20px;
|
534 |
+
margin: 0;
|
535 |
+
border-bottom: 2px solid #388E3C;
|
536 |
+
}
|
537 |
+
.input-row {
|
538 |
+
display: flex;
|
539 |
+
justify-content: center;
|
540 |
+
gap: 10px;
|
541 |
+
margin-top: 20px;
|
542 |
+
}
|
543 |
+
.input-row input, .input-row textarea {
|
544 |
+
padding: 10px;
|
545 |
+
font-size: 16px;
|
546 |
+
border: 1px solid #ccc;
|
547 |
+
border-radius: 5px;
|
548 |
+
}
|
549 |
+
#jsoneditor {
|
550 |
+
width: 50%;
|
551 |
+
height: 300px;
|
552 |
+
margin: 20px auto;
|
553 |
+
}
|
554 |
+
#addVideo, #saveToClipboard {
|
555 |
+
color: white;
|
556 |
+
background-color: #4CAF50;
|
557 |
+
border: none;
|
558 |
+
cursor: pointer;
|
559 |
+
padding: 10px 20px;
|
560 |
+
font-size: 16px;
|
561 |
+
border-radius: 5px;
|
562 |
+
margin-top: 20px;
|
563 |
+
}
|
564 |
+
#addVideo:hover, #saveToClipboard:hover {
|
565 |
+
background-color: #388E3C;
|
566 |
+
}
|
567 |
+
.jsoneditor-menu {
|
568 |
+
background-color: #4CAF50 !important;
|
569 |
+
border-bottom: 1px solid #388E3C !important;
|
570 |
+
}
|
571 |
+
.jsoneditor{
|
572 |
+
border: 1px #4CAF50 !important;
|
573 |
+
border-bottom: 2px solid #388E3C !important;
|
574 |
+
}
|
575 |
+
</style>
|
576 |
+
|
577 |
+
<h1>Редактор медиа листов</h1>
|
578 |
+
<div>
|
579 |
+
<div class="input-row">
|
580 |
+
<label for="title">Название:</label>
|
581 |
+
<input type="text" id="title" placeholder="Введите название">
|
582 |
+
<label for="file">Ссылка на файл:</label>
|
583 |
+
<input type="text" id="file" placeholder="Введите ссылку">
|
584 |
+
</div>
|
585 |
+
<button id="addVideo">Добавить медиа</button>
|
586 |
+
<button id="saveToClipboard">Сохранить в буфер обмена</button>
|
587 |
+
</div>
|
588 |
+
<div id="jsoneditor"></div>
|
589 |
+
|
590 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.9.2/jsoneditor.min.js"></script>
|
591 |
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
|
592 |
+
<script>
|
593 |
+
document.addEventListener('DOMContentLoaded', function() {
|
594 |
+
const container = document.getElementById('jsoneditor');
|
595 |
+
const options = {
|
596 |
+
mode: 'code',
|
597 |
+
modes: ['code', 'tree'],
|
598 |
+
onError: function(err) {
|
599 |
+
alert(err.toString());
|
600 |
+
}
|
601 |
+
};
|
602 |
+
const editor = new JSONEditor(container, options);
|
603 |
+
let videoList = [];
|
604 |
+
editor.set(videoList);
|
605 |
+
document.getElementById('addVideo').addEventListener('click', function() {
|
606 |
+
const title = document.getElementById('title').value;
|
607 |
+
const file = document.getElementById('file').value;
|
608 |
+
if (title && file) {
|
609 |
+
videoList.push({ title, file });
|
610 |
+
editor.set(videoList);
|
611 |
+
document.getElementById('title').value = '';
|
612 |
+
document.getElementById('file').value = '';
|
613 |
+
} else {
|
614 |
+
alert('Please fill in both title and file URL.');
|
615 |
+
}
|
616 |
+
});
|
617 |
+
document.getElementById('saveToClipboard').addEventListener('click', function() {
|
618 |
+
const json = editor.get();
|
619 |
+
const jsonString = JSON.stringify(json, null, 2); // Добавляем отступы для читаемости
|
620 |
+
navigator.clipboard.writeText(jsonString).then(function() {
|
621 |
+
Toastify({
|
622 |
+
text: "Видеолист скопирован!",
|
623 |
+
duration: 3000, // Показывать 3 секунды
|
624 |
+
newWindow: true,
|
625 |
+
close: true,
|
626 |
+
gravity: "top", // Показывать сверху
|
627 |
+
position: "center", // Позиционировать по центру
|
628 |
+
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
629 |
+
stopOnFocus: true // Останавливать таймер при фокусе на сообщении
|
630 |
+
}).showToast();
|
631 |
+
}, function(err) {
|
632 |
+
console.error('Could not copy text: ', err);
|
633 |
+
});
|
634 |
+
});
|
635 |
+
});
|
636 |
+
|
637 |
+
</script>
|
638 |
<br><br><br>
|
639 |
</div>
|
640 |
<div class="modal-footer_3">
|