Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 155f4b6

Browse files
committed
Release glass style
1 parent 7ffa5af commit 155f4b6

File tree

12 files changed

+36
-69
lines changed

12 files changed

+36
-69
lines changed

dev/App/Abstract.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@ class AbstractApp extends AbstractBoot
332332
leftPanelDisabled(false);
333333
});
334334

335+
if (Settings.appSettingsGet('loginGlassStyle'))
336+
{
337+
$html.addClass('glass');
338+
}
339+
335340
if (!mobile)
336341
{
337342
ssm.addState({

dev/Common/Cmd.js

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import window from 'window';
33
import $ from '$';
44
import _ from '_';
55
import ko from 'ko';
6-
import {$html, $body} from 'Common/Globals';
6+
import {$body} from 'Common/Globals';
77
import {EventKeyCode, Magics} from 'Common/Enums';
88
import {trim, inArray, changeTheme} from 'Common/Utils';
99
import {reload as translatorReload} from 'Common/Translator';
@@ -40,43 +40,6 @@ function cmdHelp(cmds) {
4040
return require('Html/Cmds/Help.html').replace('{{ commands }}', cmds.join(' '));
4141
}
4242

43-
/**
44-
* @returns {void}
45-
*/
46-
function initGlass() {
47-
let state = null;
48-
try {
49-
if (window.localStorage && window.localStorage.setItem)
50-
{
51-
state = '1' === '' + window.localStorage.getItem('rl-labs-glass');
52-
}
53-
}
54-
catch (e) {} // eslint-disable-line no-empty
55-
56-
if (null !== state)
57-
{
58-
$html.toggleClass('glass', !!state);
59-
}
60-
}
61-
62-
/**
63-
* @returns {string}
64-
*/
65-
function cmdGlass() {
66-
const state = !$html.hasClass('glass');
67-
68-
try {
69-
if (window.localStorage && window.localStorage.setItem)
70-
{
71-
window.localStorage.setItem('rl-labs-glass', state ? '1' : '0');
72-
}
73-
}
74-
catch (e) {} // eslint-disable-line no-empty
75-
76-
$html.toggleClass('glass', state);
77-
return '';
78-
}
79-
8043
/**
8144
* @returns {string}
8245
*/
@@ -124,7 +87,7 @@ class CmdContoller
12487

12588
cmdHelper = ko.observable('');
12689

127-
cmds = ['help', 'version', 'glass', 'clear', 'theme', 'lang'];
90+
cmds = ['help', 'version', 'clear', 'theme', 'lang'];
12891
cmdsWithParameters = ['theme', 'lang'];
12992

13093
isAdmin = false;
@@ -205,9 +168,6 @@ class CmdContoller
205168
case 'help':
206169
result = cmdHelp(this.cmds);
207170
break;
208-
case 'glass':
209-
result = cmdGlass();
210-
break;
211171
case 'v':
212172
case 'version':
213173
result = cmdVersion();
@@ -390,6 +350,3 @@ export function toggle()
390350
}, Magics.Time50ms);
391351
}
392352
}
393-
394-
// init
395-
initGlass();

dev/Settings/Admin/Prem/Licensing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import ko from 'ko';
3+
import moment from 'moment';
34

45
import {settingsGet} from 'Storage/Settings';
56
import {showScreenPopup} from 'Knoin/Knoin';
@@ -60,7 +61,6 @@ class LicensingPremAdminSettings
6061
*/
6162
licenseExpiredMomentValue() {
6263
const
63-
moment = require('moment'),
6464
time = this.licenseExpired(),
6565
momentUnix = moment.unix(time);
6666

dev/Styles/Login.less

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060

6161
.wrapper {
62-
padding: 40px 40px 12px 40px;
62+
padding: 40px 40px 20px 40px;
6363
}
6464

6565
#recaptcha_image img {
@@ -102,6 +102,12 @@
102102
font-size: 17px;
103103
line-height: 29px;
104104
color: #999;
105+
106+
&.login-submit-icon{
107+
font-size: 24px;
108+
padding-top: 2px;
109+
cursor: pointer;
110+
}
105111
}
106112

107113
.controls.error .add-on i, .control-group.error .add-on i {

dev/Styles/Ui.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ html.rgba .g-ui-resizable-delimiter-highlight {
174174
}
175175
}
176176

177+
.display-none {
178+
display: none;
179+
}
180+
177181
.e-spinner {
178182
display: none;
179183
}

dev/View/User/Login.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {view, command, ViewType, routeOff, showScreenPopup} from 'Knoin/Knoin';
3636
import {AbstractViewNext} from 'Knoin/AbstractViewNext';
3737

3838
@view({
39-
name: 'View/User/Login',
39+
name: ['View/App/Login', 'View/User/Login'],
4040
type: ViewType.Center,
4141
templateID: 'Login'
4242
})
@@ -83,7 +83,6 @@ class LoginUserView extends AbstractViewNext
8383

8484
this.emailFocus = ko.observable(false);
8585
this.passwordFocus = ko.observable(false);
86-
this.submitFocus = ko.observable(false);
8786

8887
this.email.subscribe(() => {
8988
this.emailError(false);
@@ -335,7 +334,7 @@ class LoginUserView extends AbstractViewNext
335334
onShowWithDelay() {
336335
if ('' !== this.email() && '' !== this.password())
337336
{
338-
this.submitFocus(true);
337+
this.passwordFocus(true);
339338
}
340339
else if ('' === this.email())
341340
{
@@ -352,7 +351,6 @@ class LoginUserView extends AbstractViewNext
352351
}
353352

354353
onHide() {
355-
this.submitFocus(false);
356354
this.emailFocus(false);
357355
this.passwordFocus(false);
358356
}

rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,7 @@ public function AppDataSystem($bAdmin = false, $bMobile = false, $bMobileDevice
14551455
'customLogoutLink' => $oConfig->Get('labs', 'custom_logout_link', ''),
14561456
'forgotPasswordLinkUrl' => \trim($oConfig->Get('login', 'forgot_password_link_url', '')),
14571457
'registrationLinkUrl' => \trim($oConfig->Get('login', 'registration_link_url', '')),
1458+
'loginGlassStyle' => (bool) $oConfig->Get('login', 'glass_style', true),
14581459
'jsHash' => \md5(\RainLoop\Utils::GetConnectionToken()),
14591460
'useImapThread' => (bool) $oConfig->Get('labs', 'use_imap_thread', false),
14601461
'useImapSubscribe' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true),

rainloop/v/0.0.0/app/libraries/RainLoop/Config/Application.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ protected function defaultValues()
249249

250250
'welcome_page' => array(false, ''),
251251

252+
'glass_style' => array(true, ''),
253+
252254
'forgot_password_link_url' => array('', ''),
253255
'registration_link_url' => array('', ''),
254256

rainloop/v/0.0.0/app/templates/Views/Admin/AdminLogin.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
style="padding-right: 35px;"
2727
autocorrect="off" autocapitalize="off" spellcheck="false" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD"
2828
data-bind="textInput: password, disable: submitRequest" />
29-
<span class="add-on">
30-
<i class="icon-key"></i>
29+
<span class="add-on" data-bind="command: submitCommand">
30+
<i class="icon-key" data-bind="visible: '' === password()"></i>
31+
<i class="icon-right-middle login-submit-icon" data-bind="visible: '' !== password()"></i>
3132
</span>
3233
</div>
3334
</div>
34-
<div class="controls">
35+
<div class="controls controls-submit-wrp display-none">
3536
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand">
3637
<span data-i18n="LOGIN/BUTTON_LOGIN"></span>
3738
</button>

rainloop/v/0.0.0/app/templates/Views/User/Login.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
style="padding-right: 35px;"
4545
autocorrect="off" autocapitalize="off" spellcheck="false"
4646
data-bind="textInput: password, hasFocus: passwordFocus, disable: submitRequest" data-i18n="[placeholder]LOGIN/LABEL_PASSWORD" />
47-
<span class="add-on">
48-
<i class="icon-key"></i>
47+
<span class="add-on i18n" data-bind="command: submitCommand, tooltip: 'LOGIN/BUTTON_SIGN_IN'">
48+
<i class="icon-key" data-bind="visible: '' === password()"></i>
49+
<i class="icon-right-middle login-submit-icon" data-bind="visible: '' !== password()"></i>
4950
</span>
5051
</div>
5152
</div>
@@ -70,12 +71,12 @@
7071
}"></div>
7172
</div>
7273
{{INCLUDE/BottomControlGroup/PLACE}}
73-
<div class="controls">
74-
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand, hasFocus: submitFocus">
74+
<div class="controls controls-submit-wrp display-none">
75+
<button type="submit" class="btn btn-large btn-block buttonLogin" data-bind="command: submitCommand">
7576
<span class="i18n i18n-animation" data-i18n="LOGIN/BUTTON_SIGN_IN"></span>
7677
</button>
7778
</div>
78-
<div class="controls clearfix" style="margin-bottom: 20px">
79+
<div class="controls clearfix" style="margin-bottom: 10px">
7980
<div class="pull-right social-buttons">
8081
<a href="#" tabindex="-1" class="social-button" data-bind="visible: facebookLoginEnabled, command: facebookCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_FACEBOOK'">
8182
<i class="icon-facebook-alt"></i>

0 commit comments

Comments
 (0)