include all favicons in favicon change

This commit is contained in:
schlagmichdoch 2023-01-20 15:56:20 +01:00
parent a0f46475dd
commit 8c0d7bae49
2 changed files with 13 additions and 5 deletions

View file

@ -25,7 +25,7 @@
<meta name="twitter:description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup."> <meta name="twitter:description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup.">
<meta name="og:description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup."> <meta name="og:description" content="Instantly share images, videos, PDFs, and links with people nearby. Peer2Peer and Open Source. No Setup, No Signup.">
<!-- Icons --> <!-- Icons -->
<link rel="icon" id="favicon" sizes="96x96" href="images/favicon-96x96.png"> <link rel="icon" sizes="96x96" href="images/favicon-96x96.png">
<link rel="shortcut icon" href="images/favicon-96x96.png"> <link rel="shortcut icon" href="images/favicon-96x96.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png"> <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<meta name="msapplication-TileImage" content="images/mstile-150x150.png"> <meta name="msapplication-TileImage" content="images/mstile-150x150.png">

View file

@ -423,7 +423,7 @@ class Dialog {
window.blur(); window.blur();
} }
document.title = 'PairDrop'; document.title = 'PairDrop';
document.getElementById('favicon').href = "images/favicon-96x96.png"; document.changeFavicon("images/favicon-96x96.png");
} }
} }
@ -574,7 +574,7 @@ class ReceiveFileDialog extends ReceiveDialog {
this.createPreviewElement(files[0]).then(_ => { this.createPreviewElement(files[0]).then(_ => {
document.title = `PairDrop - ${files.length} Files received`; document.title = `PairDrop - ${files.length} Files received`;
document.getElementById('favicon').href = "images/favicon-96x96-notification.png"; document.changeFavicon("images/favicon-96x96-notification.png");
this.show(); this.show();
Events.fire('set-progress', { Events.fire('set-progress', {
peerId: peerId, peerId: peerId,
@ -648,7 +648,7 @@ class ReceiveRequestDialog extends ReceiveDialog {
} }
document.title = 'PairDrop - File Transfer Requested'; document.title = 'PairDrop - File Transfer Requested';
document.getElementById('favicon').href = "images/favicon-96x96-notification.png"; document.changeFavicon("images/favicon-96x96-notification.png");
this.show() this.show()
} }
@ -986,7 +986,7 @@ class ReceiveTextDialog extends Dialog {
this.$text.textContent = text; this.$text.textContent = text;
} }
document.title = 'PairDrop - Message Received'; document.title = 'PairDrop - Message Received';
document.getElementById('favicon').href = "images/favicon-96x96-notification.png"; document.changeFavicon("images/favicon-96x96-notification.png");
this.show(); this.show();
window.blop.play(); window.blop.play();
} }
@ -1572,6 +1572,14 @@ Events.on('load', () => {
}; };
init(); init();
animate(); animate();
let icon = document.querySelector('[rel="icon"]'),
shortcutIcon = document.querySelector('[rel="shortcut icon"]');
document.changeFavicon = function (src) {
icon.href = src;
shortcutIcon.href = src;
}
}); });
// close About PairDrop page on Escape // close About PairDrop page on Escape