From 089f01663316c3db14a4129f362e1feaabb6015c Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 14 Nov 2022 09:15:25 +0100 Subject: [PATCH] rl.setWindowTitle() to rl.setTitle() --- dev/App/User.js | 2 +- dev/Screen/Admin/Login.js | 2 +- dev/Screen/Admin/Settings.js | 2 +- dev/Screen/User/Login.js | 2 +- dev/Screen/User/MailBox.js | 2 +- dev/Screen/User/Settings.js | 2 +- dev/boot.js | 11 +++++------ 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dev/App/User.js b/dev/App/User.js index 3edb406d6..37491cc8f 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -212,7 +212,7 @@ export class AppUser extends AbstractApp { start() { if (SettingsGet('Auth')) { - rl.setWindowTitle(i18n('GLOBAL/LOADING')); + rl.setTitle(i18n('GLOBAL/LOADING')); SMAudio.notifications(!!SettingsGet('SoundNotification')); NotificationUserStore.enabled(!!SettingsGet('DesktopNotifications')); diff --git a/dev/Screen/Admin/Login.js b/dev/Screen/Admin/Login.js index 7d0301b2f..76b224d71 100644 --- a/dev/Screen/Admin/Login.js +++ b/dev/Screen/Admin/Login.js @@ -8,6 +8,6 @@ export class LoginAdminScreen extends AbstractScreen { } onShow() { - rl.setWindowTitle(); + rl.setTitle(); } } diff --git a/dev/Screen/Admin/Settings.js b/dev/Screen/Admin/Settings.js index a57cc8219..95d024691 100644 --- a/dev/Screen/Admin/Settings.js +++ b/dev/Screen/Admin/Settings.js @@ -37,6 +37,6 @@ export class SettingsAdminScreen extends AbstractSettingsScreen { } onShow() { - rl.setWindowTitle(); + rl.setTitle(); } } diff --git a/dev/Screen/User/Login.js b/dev/Screen/User/Login.js index c6282f67e..8865353bb 100644 --- a/dev/Screen/User/Login.js +++ b/dev/Screen/User/Login.js @@ -8,6 +8,6 @@ export class LoginUserScreen extends AbstractScreen { } onShow() { - rl.setWindowTitle(); + rl.setTitle(); } } diff --git a/dev/Screen/User/MailBox.js b/dev/Screen/User/MailBox.js index 5040305d7..ba3852c7b 100644 --- a/dev/Screen/User/MailBox.js +++ b/dev/Screen/User/MailBox.js @@ -46,7 +46,7 @@ export class MailBoxUserScreen extends AbstractScreen { const count = Settings.app('listPermanentFiltered') ? 0 : FolderUserStore.foldersInboxUnreadCount(), email = AccountUserStore.email(); - rl.setWindowTitle( + rl.setTitle( (email ? '' + (0 < count ? '(' + count + ') ' : ' ') + email + ' - ' : '' diff --git a/dev/Screen/User/Settings.js b/dev/Screen/User/Settings.js index b6d5116f7..69fcafe1b 100644 --- a/dev/Screen/User/Settings.js +++ b/dev/Screen/User/Settings.js @@ -72,6 +72,6 @@ export class SettingsUserScreen extends AbstractSettingsScreen { setSettingsTitle() { const sEmail = AccountUserStore.email(); - rl.setWindowTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle); + rl.setTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle); } } diff --git a/dev/boot.js b/dev/boot.js index 936ee38d2..f4d131326 100644 --- a/dev/boot.js +++ b/dev/boot.js @@ -1,13 +1,11 @@ (doc => { -navigator.cookieEnabled || doc.location.replace('./?/NoCookie'); - const eId = id => doc.getElementById('rl-'+id), app = eId('app'), admin = app && '1' == app.dataset.admin, layout = doc.cookie.match(/(^|;) ?rllayout=([^;]+)/) || '', - badBrowser = () => doc.location.replace('./?/BadBrowser'), + redirect = path => doc.location.replace('./?/'+path), showError = msg => { let div = eId('loading-error'); @@ -30,7 +28,8 @@ const }); }; -[].flat || badBrowser(); +navigator.cookieEnabled || redirect('NoCookie'); +[].flat || redirect('BadBrowser'); let RL_APP_DATA = {}; @@ -45,13 +44,13 @@ window.rl = { app: name => RL_APP_DATA.System[name] }, - setWindowTitle: title => + setTitle: title => doc.title = (title || '') + (RL_APP_DATA.Title ? (title ? ' - ' : '') + RL_APP_DATA.Title : ''), initData: appData => { RL_APP_DATA = appData; const url = appData.StaticLibsJs, - cb = () => rl.app ? rl.app.bootstart() : badBrowser(); + cb = () => rl.app.bootstart(); loadScript(url) .then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`))) .then(() => appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve())