OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
videoAII
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
22-01-25index.php
6.03 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
audio
-
01/22/2025 10:53:48 AM
rwxrwxrwx
📄
export.php
7.04 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
files
-
01/22/2025 05:04:49 AM
rwxrwxrwx
📄
index.php
6.26 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
script.js
7.77 KB
01/22/2025 05:33:18 AM
rw-r--r--
📄
styles.css
1.01 KB
01/22/2025 05:05:09 AM
rw-r--r--
📄
test.php
7.58 KB
05/19/2025 10:07:22 AM
rwxrwxrwx
📁
testing
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📁
uploads
-
01/22/2025 10:13:10 AM
rwxrwxrwx
📄
video_process.php
11.27 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zexport.php
3.56 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zindex.php
4.48 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zscript.js
5.78 KB
01/22/2025 05:05:09 AM
rw-r--r--
Editing: script.js
Close
// let rowCount = 1; // function previewImage(input, index) { // const preview = document.getElementById("preview" + index); // const file = input.files[0]; // const reader = new FileReader(); // reader.onload = function (e) { // preview.src = e.target.result; // }; // reader.readAsDataURL(file); // } // function addRow() { // const storyboard = document.getElementById("storyboard"); // rowCount++; // // Create new storyboard item // const storyboardItem = document.createElement("div"); // storyboardItem.className = "storyboard-item"; // const img = document.createElement("img"); // img.id = "preview" + rowCount; // img.style.maxWidth = "100px"; // img.style.height = "auto"; // const fileInput = document.createElement("input"); // fileInput.type = "file"; // fileInput.name = "images[]"; // fileInput.accept = "image/*"; // fileInput.onchange = function () { // previewImage(this, rowCount); // }; // fileInput.required = true; // const durationInput = document.createElement("input"); // durationInput.type = "number"; // durationInput.name = "durations[]"; // durationInput.step = "0.1"; // durationInput.min = "0.1"; // durationInput.value = "5"; // durationInput.required = true; // storyboardItem.appendChild(img); // storyboardItem.appendChild(fileInput); // storyboardItem.appendChild(durationInput); // const deleteButton = document.createElement("span"); // deleteButton.className = "delete-row"; // deleteButton.textContent = "Delete"; // deleteButton.onclick = function () { // deleteRow(storyboardItem); // }; // storyboardItem.appendChild(deleteButton); // storyboard.appendChild(storyboardItem); // } // function deleteRow(storyboardItem) { // storyboardItem.parentNode.removeChild(storyboardItem); // rowCount--; // // Reorder storyboard item IDs // const storyboardItems = document.querySelectorAll(".storyboard-item"); // storyboardItems.forEach((item, index) => { // item.querySelector("img").setAttribute("id", "preview" + (index + 1)); // item // .querySelector('input[type="file"]') // .setAttribute("onchange", "previewImage(this, " + (index + 1) + ")"); // }); // } // function validateForm() { // const inputs = document.querySelectorAll('input[name="images[]"]'); // for (let i = 0; i < inputs.length; i++) { // if (!inputs[i].files.length) { // alert("Please upload all images."); // return false; // } // } // return true; // } let rowCount = 1; // Initialize rowCount // Preview images when the user selects files // function previewImages(input, index) { // const previewContainer = document.getElementById("preview-container" + index); // previewContainer.innerHTML = ''; // Clear existing previews // const files = input.files; // for (let i = 0; i < files.length; i++) { // const file = files[i]; // const reader = new FileReader(); // reader.onload = function (e) { // const img = document.createElement("img"); // img.style.maxWidth = "100px"; // img.style.height = "auto"; // img.src = e.target.result; // previewContainer.appendChild(img); // }; // reader.readAsDataURL(file); // } // } function previewMedia(input, index) { const previewContainer = document.getElementById("preview-container" + index); previewContainer.innerHTML = ''; // Clear existing previews const files = input.files; for (let i = 0; i < files.length; i++) { const file = files[i]; const reader = new FileReader(); reader.onload = function (e) { const fileURL = e.target.result; if (file.type.startsWith('image/')) { // Display image preview const img = document.createElement("img"); img.style.maxWidth = "100px"; img.style.height = "auto"; img.src = fileURL; console.log(img.src); previewContainer.appendChild(img); } else if (file.type.startsWith('video/')) { // Display video preview const video = document.createElement("video"); video.style.maxWidth = "100px"; video.style.height = "auto"; video.src = fileURL; video.controls = true; previewContainer.appendChild(video); } }; reader.readAsDataURL(file); } } // Add a new row (storyboard item) with the image input, caption, and duration function addRow() { const storyboard = document.getElementById("storyboard"); rowCount++; // Create new storyboard item const storyboardItem = document.createElement("div"); storyboardItem.className = "storyboard-item"; storyboardItem.id = "item" + rowCount; const previewContainer = document.createElement("div"); previewContainer.id = "preview-container" + rowCount; const fileInput = document.createElement("input"); fileInput.type = "file"; fileInput.name = "media[]"; fileInput.accept = "image/*,video/*"; fileInput.onchange = function () { previewMedia(this, rowCount); }; fileInput.required = true; // fileInput.multiple = true; // Allow multiple file selection const durationInput = document.createElement("input"); durationInput.type = "number"; durationInput.name = "durations[]"; durationInput.step = "0.1"; durationInput.min = "0.1"; durationInput.value = "5"; durationInput.required = true; const captionTextarea = document.createElement("textarea"); captionTextarea.name = "captions[]"; captionTextarea.rows = "2"; captionTextarea.placeholder = "Enter caption for this image..."; captionTextarea.required = true; const deleteButton = document.createElement("span"); deleteButton.className = "delete-row"; deleteButton.textContent = "Delete"; deleteButton.onclick = function () { deleteRow(this); }; storyboardItem.appendChild(previewContainer); storyboardItem.appendChild(fileInput); storyboardItem.appendChild(durationInput); storyboardItem.appendChild(captionTextarea); storyboardItem.appendChild(deleteButton); storyboard.appendChild(storyboardItem); } // Delete a storyboard item when the delete button is clicked function deleteRow(button) { const storyboardItem = button.parentNode; storyboardItem.parentNode.removeChild(storyboardItem); rowCount--; // Reorder storyboard item IDs const storyboardItems = document.querySelectorAll(".storyboard-item"); storyboardItems.forEach((item, index) => { const itemIndex = index + 1; item.id = "item" + itemIndex; item.querySelector("div").id = "preview-container" + itemIndex; item.querySelector('input[type="file"]').setAttribute("onchange", `previewMedia(this, ${itemIndex})`); }); } // Validate the form before submitting function validateForm() { const imageInputs = document.querySelectorAll('input[name="media[]"]'); for (let i = 0; i < imageInputs.length; i++) { if (!imageInputs[i].files.length) { alert("Please upload at least one image for each storyboard item."); return false; } } const captionTextareas = document.querySelectorAll('textarea[name="captions[]"]'); for (let i = 0; i < captionTextareas.length; i++) { if (!captionTextareas[i].value.trim()) { alert("Please enter captions for all images."); return false; } } return true; }