PluginProbe
Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch / trunk
Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch vtrunk
2.1.1 2.1.0 trunk 1.0 1.1 1.2 1.4.2 1.5.2 1.5.5 1.6.1 1.6.2 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
yt-player / assets / js / script.js

script.js in Video Player for YouTube – Embed Videos Your Visitors Will Love to Watch trunk, at assets/js/script.js

24 lines 676 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 document.addEventListener("DOMContentLoaded", function () {
2 console.log("loaded");
3 const importBtn = document.getElementById("ytp_import_btn");
4 importBtn?.addEventListener("click", function (e) {
5 e.preventDefault();
6 const data = new FormData();
7 data.append("action", "ytp_import_data");
8 fetch(ytpAdmin?.ajaxUrl, {
9 method: "POST",
10 body: data,
11 credentials: "same-origin",
12 })
13 .then((res) => {
14 console.log({ res });
15 return res.json();
16 })
17 .then((data) => {
18 if (data?.success) {
19 location.href = location.origin + location.pathname + "?ytp_import=success";
20 }
21 });
22 });
23 });
24