mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Update ckeditor
Avoid empty commands Small fixes
This commit is contained in:
parent
969f15dd6b
commit
a60ffc06e1
167 changed files with 12173 additions and 12278 deletions
|
|
@ -232,6 +232,11 @@ class CmdContoller
|
|||
cmdParts = trim(cmdLine).replace().split(/[\s]+/),
|
||||
cmd = cmdParts.shift();
|
||||
|
||||
if ('' === trim(cmdLine))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isTab)
|
||||
{
|
||||
if (-1 < inArray(cmd, this.cmds))
|
||||
|
|
@ -274,6 +279,8 @@ class CmdContoller
|
|||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
onEsc() {
|
||||
|
|
|
|||
3
dev/External/ko.js
vendored
3
dev/External/ko.js
vendored
|
|
@ -131,9 +131,8 @@ ko.bindingHandlers.pikaday = {
|
|||
ko.bindingHandlers.visibleAnimated = {
|
||||
init: (element, fValueAccessor) => {
|
||||
const $el = $(element);
|
||||
$el.addClass('rl-animated-visible');
|
||||
if (ko.unwrap(fValueAccessor())) {
|
||||
$el.how();
|
||||
$el.show();
|
||||
} else {
|
||||
$el.hide();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,36 +145,34 @@
|
|||
|
||||
.submitting-pane {
|
||||
position: relative;
|
||||
&.submitting {
|
||||
&:before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: transparent;
|
||||
background: rgba(0,0,0,.3);
|
||||
z-index: 1051;
|
||||
border-radius: 8px;
|
||||
}
|
||||
&:after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -30px;
|
||||
margin-left: -30px;
|
||||
&.submitting:before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: transparent;
|
||||
background: rgba(0,0,0,.3);
|
||||
z-index: 1051;
|
||||
border-radius: 8px;
|
||||
}
|
||||
html.cssanimations &.submitting:after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -30px;
|
||||
margin-left: -30px;
|
||||
|
||||
border: 8px solid transparent;
|
||||
border-color: transparent;
|
||||
border-top-color: #fff;
|
||||
animation: loginRotation 1s infinite ease-in-out;
|
||||
border: 8px solid transparent;
|
||||
border-color: transparent;
|
||||
border-top-color: #fff;
|
||||
animation: loginRotation 1s infinite ease-in-out;
|
||||
|
||||
border-radius: 50%;
|
||||
z-index: 1052;
|
||||
}
|
||||
border-radius: 50%;
|
||||
z-index: 1052;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,13 +16,9 @@ import * as Settings from 'Storage/Settings';
|
|||
|
||||
import {getApp} from 'Helper/Apps/User';
|
||||
|
||||
import {view, ViewType, showScreenPopup, setHash} from 'Knoin/Knoin';
|
||||
import {showScreenPopup, setHash} from 'Knoin/Knoin';
|
||||
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
type: ViewType.Right,
|
||||
templateID: 'SystemDropDown'
|
||||
})
|
||||
class AbstractSystemDropDownUserView extends AbstractViewNext
|
||||
{
|
||||
constructor() {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
import {
|
||||
trim, inArray, pInt,
|
||||
convertLangName,
|
||||
createCommand,
|
||||
createCommand, createCommandLegacy,
|
||||
triggerAutocompleteInputChange
|
||||
} from 'Common/Utils';
|
||||
|
||||
|
|
@ -150,137 +150,6 @@ class LoginUserView extends AbstractViewNext
|
|||
() => LoginSignMeType.Unused !== this.signMeType()
|
||||
);
|
||||
|
||||
this.submitCommand = createCommand(() => {
|
||||
triggerAutocompleteInputChange();
|
||||
|
||||
this.emailError(false);
|
||||
this.passwordError(false);
|
||||
|
||||
this.emailError('' === trim(this.email()));
|
||||
this.passwordError('' === trim(this.password()));
|
||||
|
||||
if (this.additionalCode.visibility())
|
||||
{
|
||||
this.additionalCode.error(false);
|
||||
this.additionalCode.error('' === trim(this.additionalCode()));
|
||||
}
|
||||
|
||||
if (this.emailError() || this.passwordError() ||
|
||||
(this.additionalCode.visibility() && this.additionalCode.error()))
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case this.emailError():
|
||||
this.emailFocus(true);
|
||||
break;
|
||||
case this.passwordError():
|
||||
this.passwordFocus(true);
|
||||
break;
|
||||
case this.additionalCode.visibility() && this.additionalCode.error():
|
||||
this.additionalCode.focused(true);
|
||||
break;
|
||||
// no default
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let
|
||||
pluginResultCode = 0,
|
||||
pluginResultMessage = '';
|
||||
|
||||
const
|
||||
fSubmitResult = (iResultCode, sResultMessage) => {
|
||||
pluginResultCode = iResultCode || 0;
|
||||
pluginResultMessage = sResultMessage || '';
|
||||
};
|
||||
|
||||
Plugins.runHook('user-login-submit', [fSubmitResult]);
|
||||
if (0 < pluginResultCode)
|
||||
{
|
||||
this.submitError(getNotification(pluginResultCode));
|
||||
return false;
|
||||
}
|
||||
else if ('' !== pluginResultMessage)
|
||||
{
|
||||
this.submitError(pluginResultMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.submitRequest(true);
|
||||
|
||||
const
|
||||
fLoginRequest = (sLoginPassword) => {
|
||||
|
||||
Remote.login((sResult, oData) => {
|
||||
|
||||
if (StorageResultType.Success === sResult && oData && 'Login' === oData.Action)
|
||||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
if (oData.TwoFactorAuth)
|
||||
{
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(true);
|
||||
this.submitRequest(false);
|
||||
|
||||
_.delay(() => this.additionalCode.focused(true), Magics.Time100ms);
|
||||
}
|
||||
else if (oData.Admin)
|
||||
{
|
||||
getApp().redirectToAdminPanel();
|
||||
}
|
||||
else
|
||||
{
|
||||
getApp().loginAndLogoutReload(false);
|
||||
}
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
if (-1 < inArray(oData.ErrorCode, [Notification.InvalidInputArgument]))
|
||||
{
|
||||
oData.ErrorCode = Notification.AuthError;
|
||||
}
|
||||
|
||||
this.submitError(getNotificationFromResponse(oData));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
else if (oData.ErrorMessageAdditional)
|
||||
{
|
||||
this.submitErrorAddidional(oData.ErrorMessageAdditional);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this.email(), '', sLoginPassword, !!this.signMe(),
|
||||
this.bSendLanguage ? this.language() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
);
|
||||
|
||||
Local.set(ClientSideKeyName.LastSignMe, this.signMe() ? '-1-' : '-0-');
|
||||
|
||||
};
|
||||
|
||||
fLoginRequest(this.password());
|
||||
|
||||
return true;
|
||||
|
||||
}, () => !this.submitRequest());
|
||||
|
||||
this.facebookLoginEnabled = ko.observable(false);
|
||||
|
||||
this.facebookCommand = createCommand(() => {
|
||||
|
|
@ -325,6 +194,140 @@ class LoginUserView extends AbstractViewNext
|
|||
{
|
||||
this.submitError(Settings.settingsGet('AdditionalLoginError'));
|
||||
}
|
||||
|
||||
// commands // todo
|
||||
this.submitCommand = createCommandLegacy(this, this.submitCommand, () => !this.submitRequest());
|
||||
}
|
||||
|
||||
submitCommand() {
|
||||
|
||||
triggerAutocompleteInputChange();
|
||||
|
||||
this.emailError(false);
|
||||
this.passwordError(false);
|
||||
|
||||
this.emailError('' === trim(this.email()));
|
||||
this.passwordError('' === trim(this.password()));
|
||||
|
||||
if (this.additionalCode.visibility())
|
||||
{
|
||||
this.additionalCode.error(false);
|
||||
this.additionalCode.error('' === trim(this.additionalCode()));
|
||||
}
|
||||
|
||||
if (this.emailError() || this.passwordError() ||
|
||||
(this.additionalCode.visibility() && this.additionalCode.error()))
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case this.emailError():
|
||||
this.emailFocus(true);
|
||||
break;
|
||||
case this.passwordError():
|
||||
this.passwordFocus(true);
|
||||
break;
|
||||
case this.additionalCode.visibility() && this.additionalCode.error():
|
||||
this.additionalCode.focused(true);
|
||||
break;
|
||||
// no default
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let
|
||||
pluginResultCode = 0,
|
||||
pluginResultMessage = '';
|
||||
|
||||
const
|
||||
fSubmitResult = (iResultCode, sResultMessage) => {
|
||||
pluginResultCode = iResultCode || 0;
|
||||
pluginResultMessage = sResultMessage || '';
|
||||
};
|
||||
|
||||
Plugins.runHook('user-login-submit', [fSubmitResult]);
|
||||
if (0 < pluginResultCode)
|
||||
{
|
||||
this.submitError(getNotification(pluginResultCode));
|
||||
return false;
|
||||
}
|
||||
else if ('' !== pluginResultMessage)
|
||||
{
|
||||
this.submitError(pluginResultMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.submitRequest(true);
|
||||
|
||||
const
|
||||
fLoginRequest = (sLoginPassword) => {
|
||||
|
||||
Remote.login((sResult, oData) => {
|
||||
|
||||
if (StorageResultType.Success === sResult && oData && 'Login' === oData.Action)
|
||||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
if (oData.TwoFactorAuth)
|
||||
{
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(true);
|
||||
this.submitRequest(false);
|
||||
|
||||
_.delay(() => this.additionalCode.focused(true), Magics.Time100ms);
|
||||
}
|
||||
else if (oData.Admin)
|
||||
{
|
||||
getApp().redirectToAdminPanel();
|
||||
}
|
||||
else
|
||||
{
|
||||
getApp().loginAndLogoutReload(false);
|
||||
}
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
if (-1 < inArray(oData.ErrorCode, [Notification.InvalidInputArgument]))
|
||||
{
|
||||
oData.ErrorCode = Notification.AuthError;
|
||||
}
|
||||
|
||||
this.submitError(getNotificationFromResponse(oData));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
else if (oData.ErrorMessageAdditional)
|
||||
{
|
||||
this.submitErrorAddidional(oData.ErrorMessageAdditional);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this.email(), '', sLoginPassword, !!this.signMe(),
|
||||
this.bSendLanguage ? this.language() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
);
|
||||
|
||||
Local.set(ClientSideKeyName.LastSignMe, this.signMe() ? '-1-' : '-0-');
|
||||
|
||||
};
|
||||
|
||||
fLoginRequest(this.password());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
displayMainForm() {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
|
||||
import {view} from 'Knoin/Knoin';
|
||||
import {view, ViewType} from 'Knoin/Knoin';
|
||||
import {AbstractSystemDropDownUserView} from 'View/User/AbstractSystemDropDown';
|
||||
|
||||
@view({
|
||||
name: 'View/User/MailBox/SystemDropDown'
|
||||
name: 'View/User/MailBox/SystemDropDown',
|
||||
type: ViewType.Right,
|
||||
templateID: 'SystemDropDown'
|
||||
})
|
||||
class SystemDropDownMailBoxUserView extends AbstractSystemDropDownUserView {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
|
||||
import {view} from 'Knoin/Knoin';
|
||||
import {view, ViewType} from 'Knoin/Knoin';
|
||||
import {AbstractSystemDropDownUserView} from 'View/User/AbstractSystemDropDown';
|
||||
|
||||
@view({
|
||||
name: 'View/User/Settings/SystemDropDown'
|
||||
name: 'View/User/Settings/SystemDropDown',
|
||||
type: ViewType.Right,
|
||||
templateID: 'SystemDropDown'
|
||||
})
|
||||
class SystemDropDownSettingsUserView extends AbstractSystemDropDownUserView {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue