-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1387 from insideout10/release/3.31.4
Release/3.31.4
- Loading branch information
Showing
14 changed files
with
109 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 45 additions & 37 deletions
82
src/wordlift/videoobject/pages/assets/videoobject-import-page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,55 @@ | ||
window.addEventListener("load", function () { | ||
const startBtn = document.getElementById("wl-start-btn"); | ||
const stopBtn = document.getElementById("wl-stop-btn"); | ||
const startBtn = document.getElementById("wl-start-btn"); | ||
const stopBtn = document.getElementById("wl-stop-btn"); | ||
const {restUrl, nonce} = _wlVideoObjectImportSettings | ||
|
||
const updateProgressBar = function () { | ||
wp.apiRequest({ path: "wordlift/v1/videos/background/get_state", method: "POST" }).success( | ||
(data) => { | ||
let percentage = (data.index * 100.0) / data.count; | ||
if ( percentage > 100 ) { | ||
percentage = 100 | ||
} | ||
document.querySelector(".wl-task__progress__bar").style.width = | ||
percentage + "%"; | ||
const updateProgressBar = function () { | ||
fetch(restUrl + "wordlift/v1/videos/background/get_state", { | ||
method: "POST", | ||
headers: {"X-WP-Nonce": nonce } | ||
}) | ||
.then(response => response.json()) | ||
.catch(() => { | ||
}) | ||
.then((data) => { | ||
let percentage = (data.index * 100.0) / data.count; | ||
if (percentage > 100) { | ||
percentage = 100 | ||
} | ||
document.querySelector(".wl-task__progress__bar").style.width = | ||
percentage + "%"; | ||
|
||
if ("started" === data.state) { | ||
if (!startBtn.classList.contains("hidden")) | ||
startBtn.classList.add("hidden"); | ||
if (stopBtn.classList.contains("hidden")) | ||
stopBtn.classList.remove("hidden"); | ||
} else { | ||
if (startBtn.classList.contains("hidden")) | ||
startBtn.classList.remove("hidden"); | ||
if (!stopBtn.classList.contains("hidden")) | ||
stopBtn.classList.add("hidden"); | ||
} | ||
if ("started" === data.state) { | ||
if (!startBtn.classList.contains("hidden")) | ||
startBtn.classList.add("hidden"); | ||
if (stopBtn.classList.contains("hidden")) | ||
stopBtn.classList.remove("hidden"); | ||
} else { | ||
if (startBtn.classList.contains("hidden")) | ||
startBtn.classList.remove("hidden"); | ||
if (!stopBtn.classList.contains("hidden")) | ||
stopBtn.classList.add("hidden"); | ||
} | ||
|
||
setTimeout(updateProgressBar, 1000); | ||
} | ||
); | ||
}; | ||
setTimeout(updateProgressBar, 1000); | ||
}); | ||
}; | ||
|
||
setTimeout(updateProgressBar, 1000); | ||
setTimeout(updateProgressBar, 1000); | ||
|
||
startBtn.addEventListener("click", function () { | ||
wp.apiRequest({ | ||
method: "POST", | ||
path: "wordlift/v1/videos/background/start", | ||
startBtn.addEventListener("click", function () { | ||
fetch(restUrl + "wordlift/v1/videos/background/start", { | ||
method: "POST", | ||
headers: {"X-WP-Nonce": nonce } | ||
}).then(() => { | ||
}); | ||
}); | ||
}); | ||
|
||
stopBtn.addEventListener("click", function () { | ||
wp.apiRequest({ | ||
method: "POST", | ||
path: "wordlift/v1/videos/background/stop", | ||
stopBtn.addEventListener("click", function () { | ||
fetch(restUrl + "wordlift/v1/videos/background/stop", { | ||
method: "POST", | ||
headers: {"X-WP-Nonce": nonce } | ||
}).then(() => { | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters