mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Revamp Mobile/Desktop switcher without completely reloading.
Remove switcher from login page, it became useless.
This commit is contained in:
parent
292f3289ac
commit
d7994ddab6
35 changed files with 159 additions and 202 deletions
|
|
@ -3,9 +3,9 @@ import ko from 'ko';
|
||||||
import {
|
import {
|
||||||
doc,
|
doc,
|
||||||
$htmlCL,
|
$htmlCL,
|
||||||
|
elementById,
|
||||||
leftPanelDisabled,
|
leftPanelDisabled,
|
||||||
Settings,
|
Settings
|
||||||
isMobile
|
|
||||||
} from 'Common/Globals';
|
} from 'Common/Globals';
|
||||||
|
|
||||||
import { KeyState } from 'Common/Enums';
|
import { KeyState } from 'Common/Enums';
|
||||||
|
|
@ -49,7 +49,7 @@ export class AbstractApp {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
download(link) {
|
download(link) {
|
||||||
if (isMobile()) {
|
if (ThemeStore.isMobile()) {
|
||||||
open(link, '_self');
|
open(link, '_self');
|
||||||
focus();
|
focus();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -110,7 +110,7 @@ export class AbstractApp {
|
||||||
register('Select', SelectComponent);
|
register('Select', SelectComponent);
|
||||||
register('TextArea', TextAreaComponent);
|
register('TextArea', TextAreaComponent);
|
||||||
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
|
register('CheckboxSimple', CheckboxComponent, 'CheckboxComponent');
|
||||||
if (isMobile() || !Settings.app('materialDesign')) {
|
if (/*ThemeStore.isMobile() || */!Settings.app('materialDesign')) {
|
||||||
register('Checkbox', CheckboxComponent);
|
register('Checkbox', CheckboxComponent);
|
||||||
} else {
|
} else {
|
||||||
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
register('Checkbox', CheckboxMaterialDesignComponent, 'CheckboxMaterialDesignComponent');
|
||||||
|
|
@ -118,11 +118,8 @@ export class AbstractApp {
|
||||||
|
|
||||||
initOnStartOrLangChange();
|
initOnStartOrLangChange();
|
||||||
|
|
||||||
if (isMobile()) {
|
leftPanelDisabled(ThemeStore.isMobile());
|
||||||
leftPanelDisabled(true);
|
addEventListener('resize', () => leftPanelDisabled(ThemeStore.isMobile() || 767 >= innerWidth));
|
||||||
} else {
|
|
||||||
window.addEventListener('resize', () => leftPanelDisabled(767 >= window.innerWidth));
|
|
||||||
}
|
|
||||||
|
|
||||||
leftPanelDisabled.valueHasMutated();
|
leftPanelDisabled.valueHasMutated();
|
||||||
|
|
||||||
|
|
@ -134,9 +131,8 @@ export class AbstractApp {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
hideLoading() {
|
hideLoading() {
|
||||||
const id = id => doc.getElementById(id);
|
elementById('rl-content').hidden = false;
|
||||||
id('rl-content').hidden = false;
|
elementById('rl-loading').remove();
|
||||||
id('rl-loading').remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,14 @@ import {
|
||||||
ClientSideKeyName
|
ClientSideKeyName
|
||||||
} from 'Common/EnumsUser';
|
} from 'Common/EnumsUser';
|
||||||
|
|
||||||
import { doc, createElement, $htmlCL, Settings, leftPanelDisabled, isMobile } from 'Common/Globals';
|
import {
|
||||||
|
doc,
|
||||||
|
elementById,
|
||||||
|
createElement,
|
||||||
|
$htmlCL,
|
||||||
|
Settings,
|
||||||
|
leftPanelDisabled
|
||||||
|
} from 'Common/Globals';
|
||||||
|
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
|
|
||||||
|
|
@ -50,6 +57,7 @@ import FolderStore from 'Stores/User/Folder';
|
||||||
import PgpStore from 'Stores/User/Pgp';
|
import PgpStore from 'Stores/User/Pgp';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
import QuotaStore from 'Stores/User/Quota';
|
import QuotaStore from 'Stores/User/Quota';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
|
|
@ -866,18 +874,18 @@ class AppUser extends AbstractApp {
|
||||||
(bDisable || !$htmlCL.contains('rl-bottom-preview-pane')) ? null : 'height');
|
(bDisable || !$htmlCL.contains('rl-bottom-preview-pane')) ? null : 'height');
|
||||||
};
|
};
|
||||||
if (top && bottom) {
|
if (top && bottom) {
|
||||||
fDisable(false);
|
fDisable(ThemeStore.isMobile());
|
||||||
addEventListener('rl-layout', e => fDisable(Layout.BottomPreview !== e.detail));
|
addEventListener('rl-layout', e => fDisable(Layout.BottomPreview !== e.detail));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initVerticalLayoutResizer() {
|
initVerticalLayoutResizer() {
|
||||||
const left = doc.getElementById('rl-left'),
|
const left = elementById('rl-left'),
|
||||||
right = doc.getElementById('rl-right'),
|
right = elementById('rl-right'),
|
||||||
fDisable = bDisable =>
|
fDisable = bDisable =>
|
||||||
this.setLayoutResizer(left, right, ClientSideKeyName.FolderListSize, bDisable ? null : 'width');
|
this.setLayoutResizer(left, right, ClientSideKeyName.FolderListSize, bDisable ? null : 'width');
|
||||||
if (left && right) {
|
if (left && right) {
|
||||||
fDisable(false);
|
fDisable(ThemeStore.isMobile());
|
||||||
leftPanelDisabled.subscribe(value => fDisable(value));
|
leftPanelDisabled.subscribe(value => fDisable(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1022,9 +1030,7 @@ class AppUser extends AbstractApp {
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMobile()) {
|
setTimeout(() => this.initVerticalLayoutResizer(), 1);
|
||||||
setTimeout(() => this.initVerticalLayoutResizer(), 1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.logout();
|
this.logout();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,9 @@ export const doc = document;
|
||||||
|
|
||||||
export const $htmlCL = doc.documentElement.classList;
|
export const $htmlCL = doc.documentElement.classList;
|
||||||
|
|
||||||
export const Settings = rl.settings;
|
export const elementById = id => doc.getElementById(id);
|
||||||
|
|
||||||
/** @media screen and (max-width: 600px) { */
|
export const Settings = rl.settings;
|
||||||
export const isMobile = () => $htmlCL.contains('rl-mobile');
|
|
||||||
|
|
||||||
export const dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 });
|
export const dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { SaveSettingsStep } from 'Common/Enums';
|
import { SaveSettingsStep } from 'Common/Enums';
|
||||||
import { doc } from 'Common/Globals';
|
import { doc, elementById } from 'Common/Globals';
|
||||||
|
|
||||||
export const
|
export const
|
||||||
isArray = Array.isArray,
|
isArray = Array.isArray,
|
||||||
|
|
@ -29,7 +29,7 @@ export function pString(value) {
|
||||||
export function inFocus() {
|
export function inFocus() {
|
||||||
try {
|
try {
|
||||||
return doc.activeElement && doc.activeElement.matches(
|
return doc.activeElement && doc.activeElement.matches(
|
||||||
'input,textarea,iframe,.cke_editable'
|
'input,textarea,.cke_editable'
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -83,13 +83,13 @@ let __themeTimer = 0,
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export function changeTheme(value, themeTrigger = ()=>{}) {
|
export function changeTheme(value, themeTrigger = ()=>{}) {
|
||||||
const themeLink = doc.getElementById('app-theme-link'),
|
const themeLink = elementById('app-theme-link'),
|
||||||
clearTimer = () => {
|
clearTimer = () => {
|
||||||
__themeTimer = setTimeout(() => themeTrigger(SaveSettingsStep.Idle), 1000);
|
__themeTimer = setTimeout(() => themeTrigger(SaveSettingsStep.Idle), 1000);
|
||||||
__themeJson = null;
|
__themeJson = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
let themeStyle = doc.getElementById('app-theme-style'),
|
let themeStyle = elementById('app-theme-style'),
|
||||||
url = (themeLink && themeLink.href) || (themeStyle && themeStyle.dataset.href);
|
url = (themeLink && themeLink.href) || (themeStyle && themeStyle.dataset.href);
|
||||||
|
|
||||||
if (url) {
|
if (url) {
|
||||||
|
|
|
||||||
107
dev/External/User/ko.js
vendored
107
dev/External/User/ko.js
vendored
|
|
@ -2,8 +2,9 @@ import 'External/ko';
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { HtmlEditor } from 'Common/Html';
|
import { HtmlEditor } from 'Common/Html';
|
||||||
import { timeToNode } from 'Common/Momentor';
|
import { timeToNode } from 'Common/Momentor';
|
||||||
import { doc, isMobile } from 'Common/Globals';
|
import { elementById } from 'Common/Globals';
|
||||||
import { EmailAddressesComponent } from 'Component/EmailAddresses';
|
import { EmailAddressesComponent } from 'Component/EmailAddresses';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
const rlContentType = 'snappymail/action',
|
const rlContentType = 'snappymail/action',
|
||||||
|
|
||||||
|
|
@ -86,72 +87,68 @@ ko.bindingHandlers.emailsTags = {
|
||||||
// Start dragging selected messages
|
// Start dragging selected messages
|
||||||
ko.bindingHandlers.dragmessages = {
|
ko.bindingHandlers.dragmessages = {
|
||||||
init: (element, fValueAccessor) => {
|
init: (element, fValueAccessor) => {
|
||||||
if (!isMobile()) {
|
element.addEventListener("dragstart", e => {
|
||||||
element.addEventListener("dragstart", e => {
|
let data = fValueAccessor()(e);
|
||||||
let data = fValueAccessor()(e);
|
dragImage || (dragImage = elementById('messagesDragImage'));
|
||||||
dragImage || (dragImage = doc.getElementById('messagesDragImage'));
|
if (data && dragImage && !ThemeStore.isMobile()) {
|
||||||
if (data && dragImage) {
|
dragImage.querySelector('.text').textContent = data.uids.length;
|
||||||
dragImage.querySelector('.text').textContent = data.uids.length;
|
let img = dragImage.querySelector('.icon-white');
|
||||||
let img = dragImage.querySelector('.icon-white');
|
img.classList.toggle('icon-copy', e.ctrlKey);
|
||||||
img.classList.toggle('icon-copy', e.ctrlKey);
|
img.classList.toggle('icon-mail', !e.ctrlKey);
|
||||||
img.classList.toggle('icon-mail', !e.ctrlKey);
|
|
||||||
|
|
||||||
// Else Chrome doesn't show it
|
// Else Chrome doesn't show it
|
||||||
dragImage.style.left = e.clientX + 'px';
|
dragImage.style.left = e.clientX + 'px';
|
||||||
dragImage.style.top = e.clientY + 'px';
|
dragImage.style.top = e.clientY + 'px';
|
||||||
dragImage.style.right = 'auto';
|
dragImage.style.right = 'auto';
|
||||||
|
|
||||||
setDragAction(e, 'messages', e.ctrlKey ? 'copy' : 'move', data, dragImage);
|
setDragAction(e, 'messages', e.ctrlKey ? 'copy' : 'move', data, dragImage);
|
||||||
|
|
||||||
// Remove the Chrome visibility
|
// Remove the Chrome visibility
|
||||||
dragImage.style.cssText = '';
|
dragImage.style.cssText = '';
|
||||||
} else {
|
} else {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
element.addEventListener("dragend", () => dragData = null);
|
element.addEventListener("dragend", () => dragData = null);
|
||||||
element.setAttribute('draggable', true);
|
element.setAttribute('draggable', true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Drop selected messages on folder
|
// Drop selected messages on folder
|
||||||
ko.bindingHandlers.dropmessages = {
|
ko.bindingHandlers.dropmessages = {
|
||||||
init: (element, fValueAccessor) => {
|
init: (element, fValueAccessor) => {
|
||||||
if (!isMobile()) {
|
const folder = fValueAccessor(),
|
||||||
const folder = fValueAccessor(),
|
// folder = ko.dataFor(element),
|
||||||
// folder = ko.dataFor(element),
|
fnStop = e => {
|
||||||
fnStop = e => {
|
e.preventDefault();
|
||||||
e.preventDefault();
|
element.classList.remove('droppableHover');
|
||||||
element.classList.remove('droppableHover');
|
dragTimer.stop();
|
||||||
dragTimer.stop();
|
},
|
||||||
},
|
fnHover = e => {
|
||||||
fnHover = e => {
|
if ('messages' === getDragAction(e)) {
|
||||||
if ('messages' === getDragAction(e)) {
|
fnStop(e);
|
||||||
fnStop(e);
|
element.classList.add('droppableHover');
|
||||||
element.classList.add('droppableHover');
|
if (folder && folder.collapsed()) {
|
||||||
if (folder && folder.collapsed()) {
|
dragTimer.start(() => {
|
||||||
dragTimer.start(() => {
|
folder.collapsed(false);
|
||||||
folder.collapsed(false);
|
rl.app.setExpandedFolder(folder.fullNameHash, true);
|
||||||
rl.app.setExpandedFolder(folder.fullNameHash, true);
|
}, 500);
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
element.addEventListener("dragenter", fnHover);
|
|
||||||
element.addEventListener("dragover", fnHover);
|
|
||||||
element.addEventListener("dragleave", fnStop);
|
|
||||||
element.addEventListener("drop", e => {
|
|
||||||
fnStop(e);
|
|
||||||
if ('messages' === getDragAction(e) && ['move','copy'].includes(e.dataTransfer.effectAllowed)) {
|
|
||||||
let data = dragData.data;
|
|
||||||
if (folder && data && data.folder && Array.isArray(data.uids)) {
|
|
||||||
rl.app.moveMessagesToFolder(data.folder, data.uids, folder.fullNameRaw, data.copy && e.ctrlKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
element.addEventListener("dragenter", fnHover);
|
||||||
|
element.addEventListener("dragover", fnHover);
|
||||||
|
element.addEventListener("dragleave", fnStop);
|
||||||
|
element.addEventListener("drop", e => {
|
||||||
|
fnStop(e);
|
||||||
|
if ('messages' === getDragAction(e) && ['move','copy'].includes(e.dataTransfer.effectAllowed)) {
|
||||||
|
let data = dragData.data;
|
||||||
|
if (folder && data && data.folder && Array.isArray(data.uids)) {
|
||||||
|
rl.app.moveMessagesToFolder(data.folder, data.uids, folder.fullNameRaw, data.copy && e.ctrlKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
||||||
|
|
||||||
import { pString } from 'Common/Utils';
|
import { pString } from 'Common/Utils';
|
||||||
import { settings } from 'Common/Links';
|
import { settings } from 'Common/Links';
|
||||||
import { doc } from 'Common/Globals';
|
import { doc, elementById } from 'Common/Globals';
|
||||||
|
|
||||||
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
import { AbstractScreen } from 'Knoin/AbstractScreen';
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ export class AbstractSettingsScreen extends AbstractScreen {
|
||||||
if (RoutedSettingsViewModel.__builded && RoutedSettingsViewModel.__vm) {
|
if (RoutedSettingsViewModel.__builded && RoutedSettingsViewModel.__vm) {
|
||||||
settingsScreen = RoutedSettingsViewModel.__vm;
|
settingsScreen = RoutedSettingsViewModel.__vm;
|
||||||
} else {
|
} else {
|
||||||
const vmPlace = doc.getElementById('rl-settings-subscreen');
|
const vmPlace = elementById('rl-settings-subscreen');
|
||||||
if (vmPlace) {
|
if (vmPlace) {
|
||||||
settingsScreen = new RoutedSettingsViewModel();
|
settingsScreen = new RoutedSettingsViewModel();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Capa } from 'Common/Enums';
|
import { Capa } from 'Common/Enums';
|
||||||
import { Focused } from 'Common/EnumsUser';
|
import { Focused } from 'Common/EnumsUser';
|
||||||
import { doc, leftPanelDisabled, leftPanelType, moveAction, Settings, isMobile } from 'Common/Globals';
|
import { doc, leftPanelDisabled, leftPanelType, moveAction, Settings } from 'Common/Globals';
|
||||||
import { pString, pInt } from 'Common/Utils';
|
import { pString, pInt } from 'Common/Utils';
|
||||||
import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache';
|
import { getFolderFromCacheList, getFolderFullNameRaw, getFolderInboxName } from 'Common/Cache';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
@ -10,6 +10,7 @@ import AccountStore from 'Stores/User/Account';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import { SystemDropDownMailBoxUserView } from 'View/User/MailBox/SystemDropDown';
|
import { SystemDropDownMailBoxUserView } from 'View/User/MailBox/SystemDropDown';
|
||||||
import { FolderListMailBoxUserView } from 'View/User/MailBox/FolderList';
|
import { FolderListMailBoxUserView } from 'View/User/MailBox/FolderList';
|
||||||
|
|
@ -56,7 +57,7 @@ export class MailBoxUserScreen extends AbstractScreen {
|
||||||
AppStore.focusedState(Focused.None);
|
AppStore.focusedState(Focused.None);
|
||||||
AppStore.focusedState(Focused.MessageList);
|
AppStore.focusedState(Focused.MessageList);
|
||||||
|
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
|
|
||||||
if (Settings.capa(Capa.Folders)) {
|
if (Settings.capa(Capa.Folders)) {
|
||||||
leftPanelType('');
|
leftPanelType('');
|
||||||
|
|
@ -115,9 +116,7 @@ export class MailBoxUserScreen extends AbstractScreen {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
onBuild() {
|
onBuild() {
|
||||||
if (!isMobile()) {
|
setTimeout(() => rl.app.initHorizontalLayoutResizer(), 1);
|
||||||
setTimeout(() => rl.app.initHorizontalLayoutResizer(), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
doc.addEventListener('click', event =>
|
doc.addEventListener('click', event =>
|
||||||
event.target.closest('#rl-right') && moveAction(false)
|
event.target.closest('#rl-right') && moveAction(false)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import { Capa, KeyState } from 'Common/Enums';
|
import { Capa, KeyState } from 'Common/Enums';
|
||||||
import { keyScope, leftPanelType, leftPanelDisabled, Settings, isMobile } from 'Common/Globals';
|
import { keyScope, leftPanelType, leftPanelDisabled, Settings } from 'Common/Globals';
|
||||||
import { runSettingsViewModelHooks } from 'Common/Plugins';
|
import { runSettingsViewModelHooks } from 'Common/Plugins';
|
||||||
import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import AppStore from 'Stores/User/App';
|
import AppStore from 'Stores/User/App';
|
||||||
import AccountStore from 'Stores/User/Account';
|
import AccountStore from 'Stores/User/Account';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import { AbstractSettingsScreen, settingsAddViewModel } from 'Screen/AbstractSettings';
|
import { AbstractSettingsScreen, settingsAddViewModel } from 'Screen/AbstractSettings';
|
||||||
|
|
||||||
|
|
@ -104,7 +105,7 @@ export class SettingsUserScreen extends AbstractSettingsScreen {
|
||||||
keyScope(KeyState.Settings);
|
keyScope(KeyState.Settings);
|
||||||
leftPanelType('');
|
leftPanelType('');
|
||||||
|
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setSettingsTitle() {
|
setSettingsTitle() {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { isMobile } from 'Common/Globals';
|
import { $htmlCL } from 'Common/Globals';
|
||||||
|
|
||||||
export const ThemeStore = {
|
export const ThemeStore = {
|
||||||
themes: ko.observableArray(),
|
themes: ko.observableArray(),
|
||||||
|
|
@ -12,7 +12,7 @@ export const ThemeStore = {
|
||||||
|
|
||||||
this.themes(Array.isArray(themes) ? themes : []);
|
this.themes(Array.isArray(themes) ? themes : []);
|
||||||
this.theme(Settings.get('Theme'));
|
this.theme(Settings.get('Theme'));
|
||||||
if (!isMobile()) {
|
if (!this.isMobile()) {
|
||||||
this.themeBackgroundName(Settings.get('UserBackgroundName'));
|
this.themeBackgroundName(Settings.get('UserBackgroundName'));
|
||||||
this.themeBackgroundHash(Settings.get('UserBackgroundHash'));
|
this.themeBackgroundHash(Settings.get('UserBackgroundHash'));
|
||||||
}
|
}
|
||||||
|
|
@ -20,3 +20,6 @@ export const ThemeStore = {
|
||||||
};
|
};
|
||||||
|
|
||||||
ThemeStore.theme = ko.observable('').extend({ limitedList: ThemeStore.themes });
|
ThemeStore.theme = ko.observable('').extend({ limitedList: ThemeStore.themes });
|
||||||
|
|
||||||
|
ThemeStore.isMobile = ko.observable($htmlCL.contains('rl-mobile'));
|
||||||
|
ThemeStore.isMobile.subscribe(value => $htmlCL.toggle('rl-mobile', value));
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { KeyState } from 'Common/Enums';
|
import { KeyState } from 'Common/Enums';
|
||||||
import { Focused } from 'Common/EnumsUser';
|
import { Focused } from 'Common/EnumsUser';
|
||||||
|
import { keyScope, leftPanelDisabled, Settings } from 'Common/Globals';
|
||||||
import { keyScope, leftPanelDisabled, Settings, isMobile } from 'Common/Globals';
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
class AppUserStore {
|
class AppUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -26,15 +26,15 @@ class AppUserStore {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case Focused.MessageList:
|
case Focused.MessageList:
|
||||||
keyScope(KeyState.MessageList);
|
keyScope(KeyState.MessageList);
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
break;
|
break;
|
||||||
case Focused.MessageView:
|
case Focused.MessageView:
|
||||||
keyScope(KeyState.MessageView);
|
keyScope(KeyState.MessageView);
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
break;
|
break;
|
||||||
case Focused.FolderList:
|
case Focused.FolderList:
|
||||||
keyScope(KeyState.FolderList);
|
keyScope(KeyState.FolderList);
|
||||||
isMobile() && leftPanelDisabled(false);
|
ThemeStore.isMobile() && leftPanelDisabled(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
||||||
|
|
||||||
import { StorageResultType, Notification } from 'Common/Enums';
|
import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { Focused, MessageSetAction } from 'Common/EnumsUser';
|
import { Focused, MessageSetAction } from 'Common/EnumsUser';
|
||||||
import { doc } from 'Common/Globals';
|
import { doc, elementById } from 'Common/Globals';
|
||||||
import { pInt, pString } from 'Common/Utils';
|
import { pInt, pString } from 'Common/Utils';
|
||||||
import { plainToHtml } from 'Common/UtilsUser';
|
import { plainToHtml } from 'Common/UtilsUser';
|
||||||
|
|
||||||
|
|
@ -493,7 +493,7 @@ class MessageUserStore {
|
||||||
if (messagesDom) {
|
if (messagesDom) {
|
||||||
id = 'rl-mgs-' + message.hash.replace(/[^a-zA-Z0-9]/g, '');
|
id = 'rl-mgs-' + message.hash.replace(/[^a-zA-Z0-9]/g, '');
|
||||||
|
|
||||||
const textBody = doc.getElementById(id);
|
const textBody = elementById(id);
|
||||||
if (textBody) {
|
if (textBody) {
|
||||||
message.body = textBody;
|
message.body = textBody;
|
||||||
message.fetchDataFromDom();
|
message.fetchDataFromDom();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ import ko from 'ko';
|
||||||
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
||||||
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
|
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
|
||||||
import { pInt } from 'Common/Utils';
|
import { pInt } from 'Common/Utils';
|
||||||
import { doc, isMobile } from 'Common/Globals';
|
import { $htmlCL } from 'Common/Globals';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
class SettingsUserStore {
|
class SettingsUserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -34,17 +35,16 @@ class SettingsUserStore {
|
||||||
autoLogout: 30
|
autoLogout: 30
|
||||||
});
|
});
|
||||||
|
|
||||||
this.usePreviewPane = ko.computed(() => Layout.NoPreview !== this.layout() && !isMobile());
|
this.usePreviewPane = ko.computed(() => Layout.NoPreview !== this.layout() && !ThemeStore.isMobile());
|
||||||
|
|
||||||
this.subscribers();
|
this.subscribers();
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribers() {
|
subscribers() {
|
||||||
const htmlCL = doc.documentElement.classList;
|
|
||||||
this.layout.subscribe(value => {
|
this.layout.subscribe(value => {
|
||||||
htmlCL.toggle('rl-no-preview-pane', Layout.NoPreview === value);
|
$htmlCL.toggle('rl-no-preview-pane', Layout.NoPreview === value);
|
||||||
htmlCL.toggle('rl-side-preview-pane', Layout.SidePreview === value);
|
$htmlCL.toggle('rl-side-preview-pane', Layout.SidePreview === value);
|
||||||
htmlCL.toggle('rl-bottom-preview-pane', Layout.BottomPreview === value);
|
$htmlCL.toggle('rl-bottom-preview-pane', Layout.BottomPreview === value);
|
||||||
dispatchEvent(new CustomEvent('rl-layout', {detail:value}));
|
dispatchEvent(new CustomEvent('rl-layout', {detail:value}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -58,7 +58,7 @@ class SettingsUserStore {
|
||||||
this.messagesPerPage(settingsGet('MPP'));
|
this.messagesPerPage(settingsGet('MPP'));
|
||||||
|
|
||||||
this.showImages(!!settingsGet('ShowImages'));
|
this.showImages(!!settingsGet('ShowImages'));
|
||||||
this.useCheckboxesInList(!!(isMobile() || settingsGet('UseCheckboxesInList')));
|
this.useCheckboxesInList(!!(ThemeStore.isMobile() || settingsGet('UseCheckboxesInList')));
|
||||||
this.allowDraftAutosave(!!settingsGet('AllowDraftAutosave'));
|
this.allowDraftAutosave(!!settingsGet('AllowDraftAutosave'));
|
||||||
this.useThreads(!!settingsGet('UseThreads'));
|
this.useThreads(!!settingsGet('UseThreads'));
|
||||||
this.replySameFolder(!!settingsGet('ReplySameFolder'));
|
this.replySameFolder(!!settingsGet('ReplySameFolder'));
|
||||||
|
|
|
||||||
|
|
@ -165,19 +165,6 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.e-mobile-switcher {
|
|
||||||
color: var(--login-switch-color, #333);
|
|
||||||
margin-top: 8px;
|
|
||||||
text-align: center;
|
|
||||||
a {
|
|
||||||
color: var(--login-switch-color, #333);
|
|
||||||
text-decoration: underline;
|
|
||||||
&:hover {
|
|
||||||
filter: brightness(1.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 480px) {
|
@media screen and (max-width: 480px) {
|
||||||
|
|
|
||||||
|
|
@ -59,22 +59,6 @@
|
||||||
color: #DA4F49;
|
color: #DA4F49;
|
||||||
}
|
}
|
||||||
|
|
||||||
.b-message-view-iframe {
|
|
||||||
}
|
|
||||||
|
|
||||||
.b-message-view-iframe-backdrop {
|
|
||||||
display: none;
|
|
||||||
background: transparent;
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
opacity: .1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ import { KeyboardShortcutsHelpPopupView } from 'View/Popup/KeyboardShortcutsHelp
|
||||||
import { AccountPopupView } from 'View/Popup/Account';
|
import { AccountPopupView } from 'View/Popup/Account';
|
||||||
import { ContactsPopupView } from 'View/Popup/Contacts';
|
import { ContactsPopupView } from 'View/Popup/Contacts';
|
||||||
|
|
||||||
import { Settings } from 'Common/Globals';
|
import { doc, Settings, leftPanelDisabled } from 'Common/Globals';
|
||||||
|
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
export class AbstractSystemDropDownUserView extends AbstractViewRight {
|
export class AbstractSystemDropDownUserView extends AbstractViewRight {
|
||||||
constructor(name) {
|
constructor(name) {
|
||||||
|
|
@ -82,6 +84,22 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
layoutDesktop()
|
||||||
|
{
|
||||||
|
doc.cookie = 'rllayout=desktop';
|
||||||
|
ThemeStore.isMobile(false);
|
||||||
|
leftPanelDisabled(false);
|
||||||
|
// location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
layoutMobile()
|
||||||
|
{
|
||||||
|
doc.cookie = 'rllayout=mobile';
|
||||||
|
ThemeStore.isMobile(true);
|
||||||
|
leftPanelDisabled(true);
|
||||||
|
// location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
logoutClick() {
|
logoutClick() {
|
||||||
rl.app.logout();
|
rl.app.logout();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
||||||
|
|
||||||
import { Capa, KeyState } from 'Common/Enums';
|
import { Capa, KeyState } from 'Common/Enums';
|
||||||
import { Focused } from 'Common/EnumsUser';
|
import { Focused } from 'Common/EnumsUser';
|
||||||
import { leftPanelDisabled, moveAction, Settings, isMobile } from 'Common/Globals';
|
import { leftPanelDisabled, moveAction, Settings } from 'Common/Globals';
|
||||||
import { mailBox, settings } from 'Common/Links';
|
import { mailBox, settings } from 'Common/Links';
|
||||||
import { setFolderHash } from 'Common/Cache';
|
import { setFolderHash } from 'Common/Cache';
|
||||||
|
|
||||||
|
|
@ -10,6 +10,7 @@ import AppStore from 'Stores/User/App';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import { showScreenPopup } from 'Knoin/Knoin';
|
import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
||||||
|
|
@ -56,7 +57,7 @@ export class FolderListMailBoxUserView extends AbstractViewLeft {
|
||||||
eqs = (ev, s) => ev.target.closestWithin(s, dom),
|
eqs = (ev, s) => ev.target.closestWithin(s, dom),
|
||||||
fSelectFolder = (el, event, starred) => {
|
fSelectFolder = (el, event, starred) => {
|
||||||
const isMove = moveAction();
|
const isMove = moveAction();
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
|
|
||||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||||
|
|
||||||
import { doc, leftPanelDisabled, moveAction, Settings, isMobile } from 'Common/Globals';
|
import { doc, leftPanelDisabled, moveAction, Settings } from 'Common/Globals';
|
||||||
|
|
||||||
import { computedPaginatorHelper } from 'Common/UtilsUser';
|
import { computedPaginatorHelper } from 'Common/UtilsUser';
|
||||||
import { File } from 'Common/File';
|
import { File } from 'Common/File';
|
||||||
|
|
@ -37,6 +37,7 @@ import QuotaStore from 'Stores/User/Quota';
|
||||||
import SettingsStore from 'Stores/User/Settings';
|
import SettingsStore from 'Stores/User/Settings';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Fetch';
|
import Remote from 'Remote/User/Fetch';
|
||||||
|
|
||||||
|
|
@ -172,9 +173,9 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
||||||
isUnSpamVisible: () =>
|
isUnSpamVisible: () =>
|
||||||
this.isSpamFolder() && !this.isSpamDisabled() && !this.isDraftFolder() && !this.isSentFolder(),
|
this.isSpamFolder() && !this.isSpamDisabled() && !this.isDraftFolder() && !this.isSentFolder(),
|
||||||
|
|
||||||
mobileCheckedStateShow: () => isMobile() ? 0 < MessageStore.messageListChecked().length : true,
|
mobileCheckedStateShow: () => ThemeStore.isMobile() ? 0 < MessageStore.messageListChecked().length : true,
|
||||||
|
|
||||||
mobileCheckedStateHide: () => isMobile() ? !MessageStore.messageListChecked().length : true,
|
mobileCheckedStateHide: () => ThemeStore.isMobile() ? !MessageStore.messageListChecked().length : true,
|
||||||
|
|
||||||
messageListFocused: () => Focused.MessageList === AppStore.focusedState()
|
messageListFocused: () => Focused.MessageList === AppStore.focusedState()
|
||||||
});
|
});
|
||||||
|
|
@ -673,7 +674,7 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
||||||
this.selector.init(dom.querySelector('.b-content'), KeyState.MessageList);
|
this.selector.init(dom.querySelector('.b-content'), KeyState.MessageList);
|
||||||
|
|
||||||
dom.addEventListener('click', event => {
|
dom.addEventListener('click', event => {
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
|
|
||||||
if (eqs(event, '.messageList .b-message-list-wrapper') && Focused.MessageView === AppStore.focusedState()) {
|
if (eqs(event, '.messageList .b-message-list-wrapper') && Focused.MessageView === AppStore.focusedState()) {
|
||||||
AppStore.focusedState(Focused.MessageList);
|
AppStore.focusedState(Focused.MessageList);
|
||||||
|
|
@ -699,7 +700,7 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
||||||
this.initUploaderForAppend();
|
this.initUploaderForAppend();
|
||||||
this.initShortcuts();
|
this.initShortcuts();
|
||||||
|
|
||||||
if (!isMobile() && Settings.capa(Capa.Prefetch)) {
|
if (!ThemeStore.isMobile() && Settings.capa(Capa.Prefetch)) {
|
||||||
ifvisible.idle(this.prefetchNextTick.bind(this));
|
ifvisible.idle(this.prefetchNextTick.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
MessageSetAction
|
MessageSetAction
|
||||||
} from 'Common/EnumsUser';
|
} from 'Common/EnumsUser';
|
||||||
|
|
||||||
import { $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings, isMobile } from 'Common/Globals';
|
import { $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings } from 'Common/Globals';
|
||||||
|
|
||||||
import { inFocus } from 'Common/Utils';
|
import { inFocus } from 'Common/Utils';
|
||||||
import { mailToHelper } from 'Common/UtilsUser';
|
import { mailToHelper } from 'Common/UtilsUser';
|
||||||
|
|
@ -32,6 +32,7 @@ import SettingsStore from 'Stores/User/Settings';
|
||||||
import AccountStore from 'Stores/User/Account';
|
import AccountStore from 'Stores/User/Account';
|
||||||
import FolderStore from 'Stores/User/Folder';
|
import FolderStore from 'Stores/User/Folder';
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import * as Local from 'Storage/Client';
|
import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
|
|
@ -413,7 +414,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
|
||||||
|
|
||||||
const eqs = (ev, s) => ev.target.closestWithin(s, dom);
|
const eqs = (ev, s) => ev.target.closestWithin(s, dom);
|
||||||
dom.addEventListener('click', event => {
|
dom.addEventListener('click', event => {
|
||||||
isMobile() && leftPanelDisabled(true);
|
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||||
|
|
||||||
let el = eqs(event, 'a');
|
let el = eqs(event, 'a');
|
||||||
if (el) {
|
if (el) {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
import { KeyState } from 'Common/Enums';
|
import { KeyState } from 'Common/Enums';
|
||||||
import { leftPanelDisabled, isMobile } from 'Common/Globals';
|
import { leftPanelDisabled } from 'Common/Globals';
|
||||||
import { settings, mailbox } from 'Common/Links';
|
import { settings, mailbox } from 'Common/Links';
|
||||||
import { getFolderInboxName } from 'Common/Cache';
|
import { getFolderInboxName } from 'Common/Cache';
|
||||||
|
|
||||||
import { settingsMenuKeysHandler } from 'Knoin/Knoin';
|
import { settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||||
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
||||||
|
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
export class MenuSettingsUserView extends AbstractViewLeft {
|
export class MenuSettingsUserView extends AbstractViewLeft {
|
||||||
/**
|
/**
|
||||||
* @param {Object} screen
|
* @param {Object} screen
|
||||||
|
|
@ -19,9 +21,11 @@ export class MenuSettingsUserView extends AbstractViewLeft {
|
||||||
}
|
}
|
||||||
|
|
||||||
onBuild(dom) {
|
onBuild(dom) {
|
||||||
isMobile() && dom.addEventListener('click', event =>
|
dom.addEventListener('click', event =>
|
||||||
event.target.closestWithin('.b-settings-menu .e-item.selectable', dom) && leftPanelDisabled(true)
|
ThemeStore.isMobile()
|
||||||
);
|
&& event.target.closestWithin('.b-settings-menu .e-item.selectable', dom)
|
||||||
|
&& leftPanelDisabled(true)
|
||||||
|
);
|
||||||
|
|
||||||
shortcuts.add('arrowup,arrowdown', '', KeyState.Settings,
|
shortcuts.add('arrowup,arrowdown', '', KeyState.Settings,
|
||||||
settingsMenuKeysHandler(dom.querySelectorAll('.b-settings-menu .e-item')));
|
settingsMenuKeysHandler(dom.querySelectorAll('.b-settings-menu .e-item')));
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import { mailbox } from 'Common/Links';
|
import { mailbox } from 'Common/Links';
|
||||||
import { getFolderInboxName } from 'Common/Cache';
|
import { getFolderInboxName } from 'Common/Cache';
|
||||||
import { leftPanelDisabled, isMobile } from 'Common/Globals';
|
import { leftPanelDisabled } from 'Common/Globals';
|
||||||
|
|
||||||
import MessageStore from 'Stores/User/Message';
|
import MessageStore from 'Stores/User/Message';
|
||||||
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
|
|
||||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||||
|
|
||||||
|
|
@ -32,7 +33,7 @@ export class PaneSettingsUserView extends AbstractViewRight {
|
||||||
}
|
}
|
||||||
|
|
||||||
onBuild(dom) {
|
onBuild(dom) {
|
||||||
isMobile() && dom.addEventListener('click', () => leftPanelDisabled(true));
|
dom.addEventListener('click', () => ThemeStore.isMobile() && leftPanelDisabled(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
backToMailBoxClick() {
|
backToMailBoxClick() {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const
|
||||||
doc = document,
|
doc = document,
|
||||||
eId = id => doc.getElementById(id),
|
eId = id => doc.getElementById(id),
|
||||||
app = eId('rl-app'),
|
app = eId('rl-app'),
|
||||||
options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {},
|
admin = app && '1' == app.dataset.admin,
|
||||||
|
|
||||||
getCookie = name => {
|
getCookie = name => {
|
||||||
let data = doc.cookie.match('(^|;) ?'+name+'=([^;]*)(;|$)');
|
let data = doc.cookie.match('(^|;) ?'+name+'=([^;]*)(;|$)');
|
||||||
|
|
@ -121,7 +121,7 @@ win.rl = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: () => RL_APP_DATA,
|
data: () => RL_APP_DATA,
|
||||||
adminArea: () => options.admin,
|
adminArea: () => admin,
|
||||||
settings: {
|
settings: {
|
||||||
get: name => null == RL_APP_DATA[name] ? null : RL_APP_DATA[name],
|
get: name => null == RL_APP_DATA[name] ? null : RL_APP_DATA[name],
|
||||||
set: (name, value) => RL_APP_DATA[name] = value,
|
set: (name, value) => RL_APP_DATA[name] = value,
|
||||||
|
|
@ -179,7 +179,7 @@ setInterval(setTimestamp, 60000); // 1m
|
||||||
|
|
||||||
[eId('app-css'),eId('app-theme-link')].forEach(css => css.href = css.dataset.href);
|
[eId('app-css'),eId('app-theme-link')].forEach(css => css.href = css.dataset.href);
|
||||||
|
|
||||||
loadScript(`./?/${options.admin ? 'Admin' : ''}AppData/${rl.hash.get() || '0'}/${Math.random().toString().substr(2)}/`)
|
loadScript(`./?/${admin ? 'Admin' : ''}AppData/${rl.hash.get() || '0'}/${Math.random().toString().substr(2)}/`)
|
||||||
.then(() => {});
|
.then(() => {});
|
||||||
|
|
||||||
})(this);
|
})(this);
|
||||||
|
|
|
||||||
4
dev/bootstrap.js
vendored
4
dev/bootstrap.js
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
import { doc, dropdownVisibility } from 'Common/Globals';
|
import { doc, elementById, dropdownVisibility } from 'Common/Globals';
|
||||||
import { StorageResultType } from 'Common/Enums';
|
import { StorageResultType } from 'Common/Enums';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
|
|
@ -136,7 +136,7 @@ export default (App) => {
|
||||||
window.__APP_BOOT = fErrorCallback => {
|
window.__APP_BOOT = fErrorCallback => {
|
||||||
const cb = () => setTimeout(() => {
|
const cb = () => setTimeout(() => {
|
||||||
if (rl.TEMPLATES) {
|
if (rl.TEMPLATES) {
|
||||||
doc.getElementById('rl-templates').innerHTML = rl.TEMPLATES;
|
elementById('rl-templates').innerHTML = rl.TEMPLATES;
|
||||||
setTimeout(() => App.bootstart(), 10);
|
setTimeout(() => App.bootstart(), 10);
|
||||||
} else {
|
} else {
|
||||||
fErrorCallback();
|
fErrorCallback();
|
||||||
|
|
|
||||||
|
|
@ -241,12 +241,7 @@ class Service
|
||||||
'{{BaseAppBootCss}}' => \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot.min.css'),
|
'{{BaseAppBootCss}}' => \file_get_contents(APP_VERSION_ROOT_PATH.'static/css/boot.min.css'),
|
||||||
'{{BaseCssClass}}' => '',
|
'{{BaseCssClass}}' => '',
|
||||||
'{{LoadingDescriptionEsc}}' => \htmlspecialchars($LoadingDescription, ENT_QUOTES|ENT_IGNORE, 'UTF-8'),
|
'{{LoadingDescriptionEsc}}' => \htmlspecialchars($LoadingDescription, ENT_QUOTES|ENT_IGNORE, 'UTF-8'),
|
||||||
'{{RainloopBootData}}' => \json_encode(array(
|
'{{BaseAppAdmin}}' => $bAdmin ? 1 : 0
|
||||||
'admin' => $bAdmin,
|
|
||||||
'language' => $sLanguage,
|
|
||||||
'theme' => $sTheme,
|
|
||||||
'mobile' => $bMobile
|
|
||||||
))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$aTemplateParameters['{{BaseHash}}'] = \md5(
|
$aTemplateParameters['{{BaseHash}}'] = \md5(
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ namespace RainLoop;
|
||||||
|
|
||||||
class ServiceActions
|
class ServiceActions
|
||||||
{
|
{
|
||||||
const RL_LAYOUT = 'rllayout';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \MailSo\Base\Http
|
* @var \MailSo\Base\Http
|
||||||
*/
|
*/
|
||||||
|
|
@ -673,20 +671,6 @@ class ServiceActions
|
||||||
return $this->localAppData(true);
|
return $this->localAppData(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ServiceMobileVersion() : string
|
|
||||||
{
|
|
||||||
Utils::SetCookie(self::RL_LAYOUT, 'mobile', 0, null, null, null, false);
|
|
||||||
$this->oActions->Location('./');
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function ServiceDesktopVersion() : string
|
|
||||||
{
|
|
||||||
Utils::SetCookie(self::RL_LAYOUT, 'desktop', 0, null, null, null, false);
|
|
||||||
$this->oActions->Location('./');
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function ServiceNoScript() : string
|
public function ServiceNoScript() : string
|
||||||
{
|
{
|
||||||
return $this->localError($this->oActions->StaticI18N('STATIC/NO_SCRIPT_TITLE'), $this->oActions->StaticI18N('STATIC/NO_SCRIPT_DESC'));
|
return $this->localError($this->oActions->StaticI18N('STATIC/NO_SCRIPT_TITLE'), $this->oActions->StaticI18N('STATIC/NO_SCRIPT_DESC'));
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="rl-app" data-boot='{{RainloopBootData}}'>
|
<div id="rl-app" data-admin='{{BaseAppAdmin}}'>
|
||||||
<div id="rl-loading">
|
<div id="rl-loading">
|
||||||
<div id="rl-loading-desc">{{LoadingDescriptionEsc}}</div>
|
<div id="rl-loading-desc">{{LoadingDescriptionEsc}}</div>
|
||||||
<div class="e-spinner">
|
<div class="e-spinner">
|
||||||
|
|
|
||||||
|
|
@ -106,17 +106,5 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="e-mobile-switcher">
|
|
||||||
<span class="hide-mobile">
|
|
||||||
<i class="fontastic">📱</i>
|
|
||||||
|
|
||||||
<a href="./?/MobileVersion/" tabindex="-1" data-i18n="MOBILE/BUTTON_MOBILE_VERSION"></a>
|
|
||||||
</span>
|
|
||||||
<span class="show-mobile">
|
|
||||||
<i class="fontastic">💻</i>
|
|
||||||
|
|
||||||
<a href="./?/DesktopVersion/" tabindex="-1" data-i18n="MOBILE/BUTTON_DESKTOP_VERSION"></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -65,13 +65,13 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="e-item dividerbar show-mobile" role="presentation">
|
<li class="e-item dividerbar show-mobile" role="presentation">
|
||||||
<a class="e-link menuitem" href="./?/DesktopVersion/" tabindex="-1">
|
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: layoutDesktop">
|
||||||
<i class="fontastic">💻</i>
|
<i class="fontastic">💻</i>
|
||||||
<span data-i18n="MOBILE/BUTTON_DESKTOP_VERSION"></span>
|
<span data-i18n="MOBILE/BUTTON_DESKTOP_VERSION"></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="e-item dividerbar hide-mobile" role="presentation">
|
<li class="e-item dividerbar hide-mobile" role="presentation">
|
||||||
<a class="e-link menuitem" href="./?/MobileVersion/" tabindex="-1">
|
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: layoutMobile">
|
||||||
<i class="fontastic">📱</i>
|
<i class="fontastic">📱</i>
|
||||||
<span data-i18n="MOBILE/BUTTON_MOBILE_VERSION"></span>
|
<span data-i18n="MOBILE/BUTTON_MOBILE_VERSION"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #ddd;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #ddd;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #ddd;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #ddd;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #fff;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
--login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #ddd;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
--login-bg-color: rgba(255,255,255,0.5);
|
--login-bg-color: rgba(255,255,255,0.5);
|
||||||
--login-border: none;
|
--login-border: none;
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-switch-color: #ddd;
|
|
||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
--dropdown-menu-color: #333;
|
--dropdown-menu-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
--login-border-radius: 7px;
|
--login-border-radius: 7px;
|
||||||
--login-gradient-start: none; // #f4f4f4
|
--login-gradient-start: none; // #f4f4f4
|
||||||
--login-gradient-end: none; // #dfdfdf
|
--login-gradient-end: none; // #dfdfdf
|
||||||
--login-switch-color: #333;
|
|
||||||
|
|
||||||
--spinner-background: rgba(0,0,0,.3);
|
--spinner-background: rgba(0,0,0,.3);
|
||||||
--spinner-color: #fff;
|
--spinner-color: #fff;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue