rl.setWindowTitle() to rl.setTitle()

This commit is contained in:
the-djmaze 2022-11-14 09:15:25 +01:00
parent 951ba62621
commit 089f016633
7 changed files with 11 additions and 12 deletions

View file

@ -212,7 +212,7 @@ export class AppUser extends AbstractApp {
start() { start() {
if (SettingsGet('Auth')) { if (SettingsGet('Auth')) {
rl.setWindowTitle(i18n('GLOBAL/LOADING')); rl.setTitle(i18n('GLOBAL/LOADING'));
SMAudio.notifications(!!SettingsGet('SoundNotification')); SMAudio.notifications(!!SettingsGet('SoundNotification'));
NotificationUserStore.enabled(!!SettingsGet('DesktopNotifications')); NotificationUserStore.enabled(!!SettingsGet('DesktopNotifications'));

View file

@ -8,6 +8,6 @@ export class LoginAdminScreen extends AbstractScreen {
} }
onShow() { onShow() {
rl.setWindowTitle(); rl.setTitle();
} }
} }

View file

@ -37,6 +37,6 @@ export class SettingsAdminScreen extends AbstractSettingsScreen {
} }
onShow() { onShow() {
rl.setWindowTitle(); rl.setTitle();
} }
} }

View file

@ -8,6 +8,6 @@ export class LoginUserScreen extends AbstractScreen {
} }
onShow() { onShow() {
rl.setWindowTitle(); rl.setTitle();
} }
} }

View file

@ -46,7 +46,7 @@ export class MailBoxUserScreen extends AbstractScreen {
const count = Settings.app('listPermanentFiltered') ? 0 : FolderUserStore.foldersInboxUnreadCount(), const count = Settings.app('listPermanentFiltered') ? 0 : FolderUserStore.foldersInboxUnreadCount(),
email = AccountUserStore.email(); email = AccountUserStore.email();
rl.setWindowTitle( rl.setTitle(
(email (email
? '' + (0 < count ? '(' + count + ') ' : ' ') + email + ' - ' ? '' + (0 < count ? '(' + count + ') ' : ' ') + email + ' - '
: '' : ''

View file

@ -72,6 +72,6 @@ export class SettingsUserScreen extends AbstractSettingsScreen {
setSettingsTitle() { setSettingsTitle() {
const sEmail = AccountUserStore.email(); const sEmail = AccountUserStore.email();
rl.setWindowTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle); rl.setTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle);
} }
} }

View file

@ -1,13 +1,11 @@
(doc => { (doc => {
navigator.cookieEnabled || doc.location.replace('./?/NoCookie');
const const
eId = id => doc.getElementById('rl-'+id), eId = id => doc.getElementById('rl-'+id),
app = eId('app'), app = eId('app'),
admin = app && '1' == app.dataset.admin, admin = app && '1' == app.dataset.admin,
layout = doc.cookie.match(/(^|;) ?rllayout=([^;]+)/) || '', layout = doc.cookie.match(/(^|;) ?rllayout=([^;]+)/) || '',
badBrowser = () => doc.location.replace('./?/BadBrowser'), redirect = path => doc.location.replace('./?/'+path),
showError = msg => { showError = msg => {
let div = eId('loading-error'); let div = eId('loading-error');
@ -30,7 +28,8 @@ const
}); });
}; };
[].flat || badBrowser(); navigator.cookieEnabled || redirect('NoCookie');
[].flat || redirect('BadBrowser');
let RL_APP_DATA = {}; let RL_APP_DATA = {};
@ -45,13 +44,13 @@ window.rl = {
app: name => RL_APP_DATA.System[name] app: name => RL_APP_DATA.System[name]
}, },
setWindowTitle: title => setTitle: title =>
doc.title = (title || '') + (RL_APP_DATA.Title ? (title ? ' - ' : '') + RL_APP_DATA.Title : ''), doc.title = (title || '') + (RL_APP_DATA.Title ? (title ? ' - ' : '') + RL_APP_DATA.Title : ''),
initData: appData => { initData: appData => {
RL_APP_DATA = appData; RL_APP_DATA = appData;
const url = appData.StaticLibsJs, const url = appData.StaticLibsJs,
cb = () => rl.app ? rl.app.bootstart() : badBrowser(); cb = () => rl.app.bootstart();
loadScript(url) loadScript(url)
.then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`))) .then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`)))
.then(() => appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve()) .then(() => appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve())