mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-06 13:14:18 +08:00
Compress audio and clean links
This commit is contained in:
parent
0b64083543
commit
b7c02321fa
5 changed files with 6 additions and 21 deletions
Binary file not shown.
Binary file not shown.
|
@ -108,7 +108,7 @@ export const SMAudio = new class {
|
|||
if ('running' == audioCtx.state && (this.supportedMp3 || this.supportedOgg)) {
|
||||
if (!notificator) {
|
||||
notificator = createNewObject();
|
||||
notificator.src = Links.sound('new-mail.'+ (this.supportedMp3 ? 'mp3' : 'ogg'));
|
||||
notificator.src = Links.staticLink('sounds/new-mail.'+ (this.supportedMp3 ? 'mp3' : 'ogg'));
|
||||
}
|
||||
if (notificator) {
|
||||
notificator.volume = silent ? 0.01 : 1;
|
||||
|
|
|
@ -93,37 +93,22 @@ export function langLink(lang, isAdmin) {
|
|||
* @param {string} path
|
||||
* @returns {string}
|
||||
*/
|
||||
export function staticPrefix(path) {
|
||||
export function staticLink(path) {
|
||||
return VERSION_PREFIX + 'static/' + path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} fileName
|
||||
* @returns {string}
|
||||
*/
|
||||
export function sound(fileName) {
|
||||
return staticPrefix('sounds/' + fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
export function notificationMailIcon() {
|
||||
return staticPrefix('css/images/icon-message-notification.png');
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
export function openPgpJs() {
|
||||
return staticPrefix('js/min/openpgp.min.js');
|
||||
return staticLink('js/min/openpgp.min.js');
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
export function openPgpWorkerJs() {
|
||||
return staticPrefix('js/min/openpgp.worker.min.js');
|
||||
return staticLink('js/min/openpgp.worker.min.js');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,7 +69,7 @@ export const NotificationUserStore = new class {
|
|||
if (DesktopNotifications && NotificationsGranted()) {
|
||||
const options = {
|
||||
body: text,
|
||||
icon: imageSrc || Links.notificationMailIcon(),
|
||||
icon: imageSrc || Links.staticLink('css/images/icon-message-notification.png'),
|
||||
data: messageData
|
||||
};
|
||||
if (messageData && messageData.Uid) {
|
||||
|
@ -78,7 +78,7 @@ export const NotificationUserStore = new class {
|
|||
if (WorkerNotifications) {
|
||||
// Service-Worker-Allowed HTTP header to allow the scope.
|
||||
WorkerNotifications.register('/serviceworker.js')
|
||||
// WorkerNotifications.register(Links.staticPrefix('js/serviceworker.js'), {scope:'/'})
|
||||
// WorkerNotifications.register(Links.staticLink('js/serviceworker.js'), {scope:'/'})
|
||||
.then(() =>
|
||||
WorkerNotifications.ready.then(registration =>
|
||||
/* Show the notification */
|
||||
|
|
Loading…
Add table
Reference in a new issue