mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Merge branch 'ios-candidate'
This commit is contained in:
@@ -25,7 +25,6 @@ class ImageViewer {
|
||||
this.loadingInterval = setInterval(callback, 100);
|
||||
}
|
||||
}
|
||||
|
||||
cancel() {
|
||||
clearInterval(this.loadingInterval);
|
||||
this.hideLoadingIndicator();
|
||||
@@ -45,6 +44,7 @@ class ImageViewer {
|
||||
y: rect.y,
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
imageTitle: this.img.title,
|
||||
imageURL: canvas.toDataURL(),
|
||||
};
|
||||
|
||||
@@ -58,7 +58,6 @@ class ImageViewer {
|
||||
|
||||
showImage() {
|
||||
this.img.style.opacity = 1
|
||||
window.webkit.messageHandlers.imageWasShown.postMessage("");
|
||||
}
|
||||
|
||||
showLoadingIndicator() {
|
||||
@@ -128,6 +127,7 @@ function showClickedImage() {
|
||||
if (activeImageViewer) {
|
||||
activeImageViewer.showImage();
|
||||
}
|
||||
window.webkit.messageHandlers.imageWasShown.postMessage("");
|
||||
}
|
||||
|
||||
// Add the playsinline attribute to any HTML5 videos that don"t have it.
|
||||
@@ -136,6 +136,7 @@ function showClickedImage() {
|
||||
function inlineVideos() {
|
||||
document.querySelectorAll("video").forEach(element => {
|
||||
element.setAttribute("playsinline", true)
|
||||
element.setAttribute("controls", true)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -143,3 +144,18 @@ function postRenderProcessing() {
|
||||
ImageViewer.init();
|
||||
inlineVideos();
|
||||
}
|
||||
|
||||
function stopMediaPlayback() {
|
||||
document.querySelectorAll("iframe").forEach(element => {
|
||||
var iframeSrc = element.src;
|
||||
element.src = iframeSrc;
|
||||
});
|
||||
|
||||
document.querySelectorAll("video, audio").forEach(element => {
|
||||
element.pause();
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
window.webkit.messageHandlers.domContentLoaded.postMessage("");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user