Update buil_json.html
Browse files- buil_json.html +18 -8
buil_json.html
CHANGED
@@ -4,6 +4,7 @@
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Video List Editor</title>
|
|
|
7 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.9.2/jsoneditor.min.css" />
|
8 |
<style>
|
9 |
body {
|
@@ -101,15 +102,24 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
101 |
alert('Please fill in both title and file URL.');
|
102 |
}
|
103 |
});
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
});
|
|
|
113 |
});
|
114 |
|
115 |
</script>
|
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Video List Editor</title>
|
7 |
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
|
8 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/9.9.2/jsoneditor.min.css" />
|
9 |
<style>
|
10 |
body {
|
|
|
102 |
alert('Please fill in both title and file URL.');
|
103 |
}
|
104 |
});
|
105 |
+
document.getElementById('saveToClipboard').addEventListener('click', function() {
|
106 |
+
const json = editor.get();
|
107 |
+
const jsonString = JSON.stringify(json, null, 2); // Добавляем отступы для читаемости
|
108 |
+
navigator.clipboard.writeText(jsonString).then(function() {
|
109 |
+
Toastify({
|
110 |
+
text: "Видеолист скопирован!",
|
111 |
+
duration: 3000, // Показывать 3 секунды
|
112 |
+
newWindow: true,
|
113 |
+
close: true,
|
114 |
+
gravity: "top", // Показывать сверху
|
115 |
+
position: "center", // Позиционировать по центру
|
116 |
+
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
117 |
+
stopOnFocus: true // Останавливать таймер при фокусе на сообщении
|
118 |
+
}).showToast();
|
119 |
+
}, function(err) {
|
120 |
+
console.error('Could not copy text: ', err);
|
121 |
});
|
122 |
+
});
|
123 |
});
|
124 |
|
125 |
</script>
|