mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Release glass style
This commit is contained in:
parent
7ffa5af91f
commit
155f4b6df2
12 changed files with 36 additions and 69 deletions
|
|
@ -332,6 +332,11 @@ class AbstractApp extends AbstractBoot
|
||||||
leftPanelDisabled(false);
|
leftPanelDisabled(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (Settings.appSettingsGet('loginGlassStyle'))
|
||||||
|
{
|
||||||
|
$html.addClass('glass');
|
||||||
|
}
|
||||||
|
|
||||||
if (!mobile)
|
if (!mobile)
|
||||||
{
|
{
|
||||||
ssm.addState({
|
ssm.addState({
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import window from 'window';
|
||||||
import $ from '$';
|
import $ from '$';
|
||||||
import _ from '_';
|
import _ from '_';
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import {$html, $body} from 'Common/Globals';
|
import {$body} from 'Common/Globals';
|
||||||
import {EventKeyCode, Magics} from 'Common/Enums';
|
import {EventKeyCode, Magics} from 'Common/Enums';
|
||||||
import {trim, inArray, changeTheme} from 'Common/Utils';
|
import {trim, inArray, changeTheme} from 'Common/Utils';
|
||||||
import {reload as translatorReload} from 'Common/Translator';
|
import {reload as translatorReload} from 'Common/Translator';
|
||||||
|
|
@ -40,43 +40,6 @@ function cmdHelp(cmds) {
|
||||||
return require('Html/Cmds/Help.html').replace('{{ commands }}', cmds.join(' '));
|
return require('Html/Cmds/Help.html').replace('{{ commands }}', cmds.join(' '));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
function initGlass() {
|
|
||||||
let state = null;
|
|
||||||
try {
|
|
||||||
if (window.localStorage && window.localStorage.setItem)
|
|
||||||
{
|
|
||||||
state = '1' === '' + window.localStorage.getItem('rl-labs-glass');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {} // eslint-disable-line no-empty
|
|
||||||
|
|
||||||
if (null !== state)
|
|
||||||
{
|
|
||||||
$html.toggleClass('glass', !!state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
function cmdGlass() {
|
|
||||||
const state = !$html.hasClass('glass');
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (window.localStorage && window.localStorage.setItem)
|
|
||||||
{
|
|
||||||
window.localStorage.setItem('rl-labs-glass', state ? '1' : '0');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e) {} // eslint-disable-line no-empty
|
|
||||||
|
|
||||||
$html.toggleClass('glass', state);
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
|
|
@ -124,7 +87,7 @@ class CmdContoller
|
||||||
|
|
||||||
cmdHelper = ko.observable('');
|
cmdHelper = ko.observable('');
|
||||||
|
|
||||||
cmds = ['help', 'version', 'glass', 'clear', 'theme', 'lang'];
|
cmds = ['help', 'version', 'clear', 'theme', 'lang'];
|
||||||
cmdsWithParameters = ['theme', 'lang'];
|
cmdsWithParameters = ['theme', 'lang'];
|
||||||
|
|
||||||
isAdmin = false;
|
isAdmin = false;
|
||||||
|
|
@ -205,9 +168,6 @@ class CmdContoller
|
||||||
case 'help':
|
case 'help':
|
||||||
result = cmdHelp(this.cmds);
|
result = cmdHelp(this.cmds);
|
||||||
break;
|
break;
|
||||||
case 'glass':
|
|
||||||
result = cmdGlass();
|
|
||||||
break;
|
|
||||||
case 'v':
|
case 'v':
|
||||||
case 'version':
|
case 'version':
|
||||||
result = cmdVersion();
|
result = cmdVersion();
|
||||||
|
|
@ -390,6 +350,3 @@ export function toggle()
|
||||||
}, Magics.Time50ms);
|
}, Magics.Time50ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// init
|
|
||||||
initGlass();
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
import {settingsGet} from 'Storage/Settings';
|
import {settingsGet} from 'Storage/Settings';
|
||||||
import {showScreenPopup} from 'Knoin/Knoin';
|
import {showScreenPopup} from 'Knoin/Knoin';
|
||||||
|
|
@ -60,7 +61,6 @@ class LicensingPremAdminSettings
|
||||||
*/
|
*/
|
||||||
licenseExpiredMomentValue() {
|
licenseExpiredMomentValue() {
|
||||||
const
|
const
|
||||||
moment = require('moment'),
|
|
||||||
time = this.licenseExpired(),
|
time = this.licenseExpired(),
|
||||||
momentUnix = moment.unix(time);
|
momentUnix = moment.unix(time);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
padding: 40px 40px 12px 40px;
|
padding: 40px 40px 20px 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#recaptcha_image img {
|
#recaptcha_image img {
|
||||||
|
|
@ -102,6 +102,12 @@
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
line-height: 29px;
|
line-height: 29px;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
||||||
|
&.login-submit-icon{
|
||||||
|
font-size: 24px;
|
||||||
|
padding-top: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls.error .add-on i, .control-group.error .add-on i {
|
.controls.error .add-on i, .control-group.error .add-on i {
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,10 @@ html.rgba .g-ui-resizable-delimiter-highlight {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.display-none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.e-spinner {
|
.e-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import {view, command, ViewType, routeOff, showScreenPopup} from 'Knoin/Knoin';
|
||||||
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
|
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
|
||||||
|
|
||||||
@view({
|
@view({
|
||||||
name: 'View/User/Login',
|
name: ['View/App/Login', 'View/User/Login'],
|
||||||
type: ViewType.Center,
|
type: ViewType.Center,
|
||||||
templateID: 'Login'
|
templateID: 'Login'
|
||||||
})
|
})
|
||||||
|
|
@ -83,7 +83,6 @@ class LoginUserView extends AbstractViewNext
|
||||||
|
|
||||||
this.emailFocus = ko.observable(false);
|
this.emailFocus = ko.observable(false);
|
||||||
this.passwordFocus = ko.observable(false);
|
this.passwordFocus = ko.observable(false);
|
||||||
this.submitFocus = ko.observable(false);
|
|
||||||
|
|
||||||
this.email.subscribe(() => {
|
this.email.subscribe(() => {
|
||||||
this.emailError(false);
|
this.emailError(false);
|
||||||
|
|
@ -335,7 +334,7 @@ class LoginUserView extends AbstractViewNext
|
||||||
onShowWithDelay() {
|
onShowWithDelay() {
|
||||||
if ('' !== this.email() && '' !== this.password())
|
if ('' !== this.email() && '' !== this.password())
|
||||||
{
|
{
|
||||||
this.submitFocus(true);
|
this.passwordFocus(true);
|
||||||
}
|
}
|
||||||
else if ('' === this.email())
|
else if ('' === this.email())
|
||||||
{
|
{
|
||||||
|
|
@ -352,7 +351,6 @@ class LoginUserView extends AbstractViewNext
|
||||||
}
|
}
|
||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
this.submitFocus(false);
|
|
||||||
this.emailFocus(false);
|
this.emailFocus(false);
|
||||||
this.passwordFocus(false);
|
this.passwordFocus(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1455,6 +1455,7 @@ class Actions
|
||||||
'customLogoutLink' => $oConfig->Get('labs', 'custom_logout_link', ''),
|
'customLogoutLink' => $oConfig->Get('labs', 'custom_logout_link', ''),
|
||||||
'forgotPasswordLinkUrl' => \trim($oConfig->Get('login', 'forgot_password_link_url', '')),
|
'forgotPasswordLinkUrl' => \trim($oConfig->Get('login', 'forgot_password_link_url', '')),
|
||||||
'registrationLinkUrl' => \trim($oConfig->Get('login', 'registration_link_url', '')),
|
'registrationLinkUrl' => \trim($oConfig->Get('login', 'registration_link_url', '')),
|
||||||
|
'loginGlassStyle' => (bool) $oConfig->Get('login', 'glass_style', true),
|
||||||
'jsHash' => \md5(\RainLoop\Utils::GetConnectionToken()),
|
'jsHash' => \md5(\RainLoop\Utils::GetConnectionToken()),
|
||||||
'useImapThread' => (bool) $oConfig->Get('labs', 'use_imap_thread', false),
|
'useImapThread' => (bool) $oConfig->Get('labs', 'use_imap_thread', false),
|
||||||
'useImapSubscribe' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true),
|
'useImapSubscribe' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true),
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,8 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
|
|
||||||
'welcome_page' => array(false, ''),
|
'welcome_page' => array(false, ''),
|
||||||
|
|
||||||
|
'glass_style' => array(true, ''),
|
||||||
|
|
||||||
'forgot_password_link_url' => array('', ''),
|
'forgot_password_link_url' => array('', ''),
|
||||||
'registration_link_url' => array('', ''),
|
'registration_link_url' => array('', ''),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,13 @@
|
||||||
style="padding-right: 35px;"
|
style="padding-right: 35px;"
|
||||||
autocorrect="off" autocapitalize="off" spellcheck="false" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD"
|
autocorrect="off" autocapitalize="off" spellcheck="false" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD"
|
||||||
data-bind="textInput: password, disable: submitRequest" />
|
data-bind="textInput: password, disable: submitRequest" />
|
||||||
<span class="add-on">
|
<span class="add-on" data-bind="command: submitCommand">
|
||||||
<i class="icon-key"></i>
|
<i class="icon-key" data-bind="visible: '' === password()"></i>
|
||||||
|
<i class="icon-right-middle login-submit-icon" data-bind="visible: '' !== password()"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls controls-submit-wrp display-none">
|
||||||
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand">
|
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand">
|
||||||
<span data-i18n="LOGIN/BUTTON_LOGIN"></span>
|
<span data-i18n="LOGIN/BUTTON_LOGIN"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,9 @@
|
||||||
style="padding-right: 35px;"
|
style="padding-right: 35px;"
|
||||||
autocorrect="off" autocapitalize="off" spellcheck="false"
|
autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||||
data-bind="textInput: password, hasFocus: passwordFocus, disable: submitRequest" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD" />
|
data-bind="textInput: password, hasFocus: passwordFocus, disable: submitRequest" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD" />
|
||||||
<span class="add-on">
|
<span class="add-on i18n" data-bind="command: submitCommand, tooltip: 'LOGIN/BUTTON_SIGN_IN'">
|
||||||
<i class="icon-key"></i>
|
<i class="icon-key" data-bind="visible: '' === password()"></i>
|
||||||
|
<i class="icon-right-middle login-submit-icon" data-bind="visible: '' !== password()"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -70,12 +71,12 @@
|
||||||
}"></div>
|
}"></div>
|
||||||
</div>
|
</div>
|
||||||
{{INCLUDE/BottomControlGroup/PLACE}}
|
{{INCLUDE/BottomControlGroup/PLACE}}
|
||||||
<div class="controls">
|
<div class="controls controls-submit-wrp display-none">
|
||||||
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand, hasFocus: submitFocus">
|
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand">
|
||||||
<span class="i18n i18n-animation" data-i18n="LOGIN/BUTTON_SIGN_IN"></span>
|
<span class="i18n i18n-animation" data-i18n="LOGIN/BUTTON_SIGN_IN"></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls clearfix" style="margin-bottom: 20px">
|
<div class="controls clearfix" style="margin-bottom: 10px">
|
||||||
<div class="pull-right social-buttons">
|
<div class="pull-right social-buttons">
|
||||||
<a href="#" tabindex="-1" class="social-button" data-bind="visible: facebookLoginEnabled, command: facebookCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_FACEBOOK'">
|
<a href="#" tabindex="-1" class="social-button" data-bind="visible: facebookLoginEnabled, command: facebookCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_FACEBOOK'">
|
||||||
<i class="icon-facebook-alt"></i>
|
<i class="icon-facebook-alt"></i>
|
||||||
|
|
|
||||||
|
|
@ -12,18 +12,10 @@ Scenario('login/page', function(I) {
|
||||||
I.see('Remember Me');
|
I.see('Remember Me');
|
||||||
});
|
});
|
||||||
|
|
||||||
Scenario('login/empty-fields-error', function(I) {
|
|
||||||
I.fillField('.inputEmail', '');
|
|
||||||
I.fillField('.inputPassword', '');
|
|
||||||
I.click('.buttonLogin');
|
|
||||||
I.see('Remember Me');
|
|
||||||
I.seeElement('.controls.error');
|
|
||||||
});
|
|
||||||
|
|
||||||
Scenario('login/auth-error', function(I) {
|
Scenario('login/auth-error', function(I) {
|
||||||
I.fillField('.inputEmail', 'xxx');
|
I.fillField('.inputEmail', 'xxx');
|
||||||
I.fillField('.inputPassword', 'yyy');
|
I.fillField('.inputPassword', 'yyy');
|
||||||
I.click('.buttonLogin');
|
I.click('.login-submit-icon');
|
||||||
I.waitForVisible('.alertError', 3);
|
I.waitForVisible('.alertError', 3);
|
||||||
I.see('Authentication failed', '.alertError');
|
I.see('Authentication failed', '.alertError');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ Before((I) => {
|
||||||
I.waitForElement('.e-powered', 10);
|
I.waitForElement('.e-powered', 10);
|
||||||
I.fillField('.inputEmail', cfg.user);
|
I.fillField('.inputEmail', cfg.user);
|
||||||
I.fillField('.inputPassword', cfg.pass);
|
I.fillField('.inputPassword', cfg.pass);
|
||||||
I.click('.buttonLogin');
|
I.click('.login-submit-icon');
|
||||||
I.waitForText('test@rainloop.de', 10, '.accountPlace');
|
I.waitForText('test@rainloop.de', 10, '.accountPlace');
|
||||||
I.resizeWindow(1000, 1000);
|
I.resizeWindow(1000, 1000);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue