Small fixes and changes

This commit is contained in:
RainLoop Team 2015-01-19 01:57:29 +04:00
parent 91b3f1a3e9
commit 54edeaa645
15 changed files with 77 additions and 94 deletions

View file

@ -271,15 +271,6 @@
'FalseResult': 0
};
/**
* @enum {string}
*/
Enums.InterfaceAnimation = {
'None': 'None',
'Normal': 'Normal',
'Full': 'Full'
};
/**
* @enum {number}
*/

View file

@ -111,11 +111,6 @@
*/
Globals.bXMLHttpRequestSupported = !!window.XMLHttpRequest;
/**
* @type {string}
*/
Globals.sAnimationType = '';
/**
* @type {*}
*/

View file

@ -871,10 +871,8 @@
{
oData.editorDefaultType = ko.observable(Enums.EditorDefaultType.Html);
oData.showImages = ko.observable(false);
oData.interfaceAnimation = ko.observable(Enums.InterfaceAnimation.Full);
oData.contactsAutosave = ko.observable(false);
Globals.sAnimationType = Enums.InterfaceAnimation.Full;
oData.interfaceAnimation = ko.observable(true);
oData.capaThemes = ko.observable(true);
oData.capaUserBackground = ko.observable(false);
@ -893,26 +891,14 @@
return Enums.Layout.NoPreview !== oData.layout();
});
oData.interfaceAnimation.subscribe(function (sValue) {
if (Globals.bMobileDevice || sValue === Enums.InterfaceAnimation.None)
oData.interfaceAnimation.subscribe(function (bValue) {
if (Globals.bMobileDevice || !bValue)
{
Globals.$html.removeClass('rl-anim rl-anim-full').addClass('no-rl-anim');
Globals.sAnimationType = Enums.InterfaceAnimation.None;
Globals.$html.removeClass('rl-anim').addClass('no-rl-anim');
}
else
{
switch (sValue)
{
case Enums.InterfaceAnimation.Full:
Globals.$html.removeClass('no-rl-anim').addClass('rl-anim rl-anim-full');
Globals.sAnimationType = sValue;
break;
case Enums.InterfaceAnimation.Normal:
Globals.$html.removeClass('no-rl-anim rl-anim-full').addClass('rl-anim');
Globals.sAnimationType = sValue;
break;
}
Globals.$html.removeClass('no-rl-anim').addClass('rl-anim');
}
});

View file

@ -28,9 +28,12 @@
this.loadingDesc = ko.observable(Settings.settingsGet('LoadingDescription'));
this.loadingDesc.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.loginLogo = ko.observable(Settings.settingsGet('LoginLogo'));
this.loginLogo = ko.observable(Settings.settingsGet('LoginLogo') || '');
this.loginLogo.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.userLogo = ko.observable(Settings.settingsGet('UserLogo') || '');
this.userLogo.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.loginDescription = ko.observable(Settings.settingsGet('LoginDescription'));
this.loginDescription.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
@ -56,7 +59,8 @@
f2 = Utils.settingsSaveHelperSimpleFunction(self.loadingDesc.trigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.loginLogo.trigger, self),
f4 = Utils.settingsSaveHelperSimpleFunction(self.loginDescription.trigger, self),
f5 = Utils.settingsSaveHelperSimpleFunction(self.loginCss.trigger, self)
f5 = Utils.settingsSaveHelperSimpleFunction(self.loginCss.trigger, self),
f6 = Utils.settingsSaveHelperSimpleFunction(self.userLogo.trigger, self)
;
self.title.subscribe(function (sValue) {
@ -77,6 +81,12 @@
});
});
self.userLogo.subscribe(function (sValue) {
Remote.saveAdminConfig(f6, {
'UserLogo': Utils.trim(sValue)
});
});
self.loginDescription.subscribe(function (sValue) {
Remote.saveAdminConfig(f4, {
'LoginDescription': Utils.trim(sValue)

View file

@ -26,7 +26,6 @@
this.mainMessagesPerPageArray = Consts.Defaults.MessagesPerPageArray;
this.editorDefaultType = Data.editorDefaultType;
this.showImages = Data.showImages;
this.interfaceAnimation = Data.interfaceAnimation;
this.useDesktopNotifications = Data.useDesktopNotifications;
this.threading = Data.threading;
this.useThreads = Data.useThreads;
@ -128,12 +127,6 @@
});
});
Data.interfaceAnimation.subscribe(function (sValue) {
Remote.saveSettings(null, {
'InterfaceAnimation': sValue
});
});
Data.useDesktopNotifications.subscribe(function (bValue) {
Utils.timeOutAction('SaveDesktopNotifications', function () {
Remote.saveSettings(null, {

View file

@ -61,7 +61,7 @@
this.editorDefaultType(Settings.settingsGet('EditorDefaultType'));
this.showImages(!!Settings.settingsGet('ShowImages'));
this.contactsAutosave(!!Settings.settingsGet('ContactsAutosave'));
this.interfaceAnimation(Settings.settingsGet('InterfaceAnimation'));
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
this.mainMessagesPerPage(Settings.settingsGet('MPP'));

View file

@ -134,6 +134,16 @@ html.rl-no-preview-pane {
border-radius: 5px;
padding: 10px 15px;
}
.emptySubjectText {
display: none;
font-style: italic;
color: #999;
}
&.emptySubject .emptySubjectText {
display: inline;
}
}
.messageItem {
@ -147,16 +157,6 @@ html.rl-no-preview-pane {
-webkit-overflow-scrolling: touch;
border-radius: @rlLowBorderRadius;
.emptySubjectText {
display: none;
font-style: italic;
color: #999;
}
&.emptySubject .emptySubjectText {
display: inline;
}
.buttonUp, .buttonUnFull, .buttonFull {
display: inline-block;
position: fixed;

View file

@ -7,6 +7,8 @@
_ = require('_'),
ko = require('ko'),
Utils = require('Common/Utils'),
Settings = require('Storage/Settings'),
Data = require('Storage/Admin/Data'),
Remote = require('Storage/Admin/Remote'),

View file

@ -1060,6 +1060,7 @@ class Actions
'LoginDescription' => '',
'LoginCss' => '',
'LoginPowered' => true,
'UserLogo' => '',
'Token' => $oConfig->Get('security', 'csrf_protection', false) ? \RainLoop\Utils::GetCsrfToken() : '',
'InIframe' => (bool) $oConfig->Get('labs', 'in_iframe', false),
'AllowAdminPanel' => (bool) $oConfig->Get('security', 'allow_admin_panel', true),
@ -1120,6 +1121,7 @@ class Actions
$aResult['LoginDescription'] = $oConfig->Get('branding', 'login_desc', '');
$aResult['LoginCss'] = $oConfig->Get('branding', 'login_css', '');
$aResult['LoginPowered'] = !!$oConfig->Get('branding', 'login_powered', true);
$aResult['UserLogo'] = $oConfig->Get('branding', 'user_logo', '');
}
$aResult['LoadingDescriptionEsc'] = \htmlspecialchars($aResult['LoadingDescription'], ENT_QUOTES|ENT_IGNORE, 'UTF-8');
@ -1340,7 +1342,7 @@ class Actions
$aResult['SignatureToAll'] = false;
$aResult['EnableTwoFactor'] = false;
$aResult['ParentEmail'] = '';
$aResult['InterfaceAnimation'] = \RainLoop\Enumerations\InterfaceAnimation::NORMAL;
$aResult['InterfaceAnimation'] = true;
$aResult['UserBackgroundName'] = '';
$aResult['UserBackgroundHash'] = '';
@ -1371,7 +1373,6 @@ class Actions
$aResult['ReplySameFolder'] = (bool) $oSettings->GetConf('ReplySameFolder', $aResult['ReplySameFolder']);
$aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']);
$aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']);
$aResult['InterfaceAnimation'] = (string) $oSettings->GetConf('InterfaceAnimation', $aResult['InterfaceAnimation']);
if ($oConfig->Get('webmail', 'allow_user_background', false))
{
@ -1389,9 +1390,6 @@ class Actions
$aResult['ParentEmail'] = $oAccount->ParentEmail();
}
$aResult['InterfaceAnimation'] = \RainLoop\Enumerations\InterfaceAnimation::NONE === $aResult['InterfaceAnimation']
? $aResult['InterfaceAnimation'] : \RainLoop\Enumerations\InterfaceAnimation::NORMAL;
if (0 < \strlen($aResult['ParentEmail']))
{
$aResult['AllowGoogleSocial'] = false;
@ -2661,7 +2659,7 @@ class Actions
$this->setConfigFromParams($oConfig, 'DetermineUserLanguage', 'login', 'determine_user_language', 'bool');
$this->setConfigFromParams($oConfig, 'DetermineUserDomain', 'login', 'determine_user_domain', 'bool');
if ($this->HasOneOfActionParams(array('Title', 'LoadingDescription', 'LoginLogo', 'LoginDescription', 'LoginCss', 'LoginPowered')) && $this->PremType())
if ($this->HasOneOfActionParams(array('Title', 'LoadingDescription', 'LoginLogo', 'LoginDescription', 'LoginCss', 'LoginPowered', 'UserLogo')) && $this->PremType())
{
$this->setConfigFromParams($oConfig, 'Title', 'webmail', 'title', 'string');
$this->setConfigFromParams($oConfig, 'LoadingDescription', 'webmail', 'loading_description', 'string');
@ -2670,6 +2668,8 @@ class Actions
$this->setConfigFromParams($oConfig, 'LoginDescription', 'branding', 'login_desc', 'string');
$this->setConfigFromParams($oConfig, 'LoginCss', 'branding', 'login_css', 'string');
$this->setConfigFromParams($oConfig, 'LoginPowered', 'branding', 'login_powered', 'bool');
$this->setConfigFromParams($oConfig, 'UserLogo', 'branding', 'user_logo', 'string');
}
$this->setConfigFromParams($oConfig, 'TokenProtection', 'security', 'csrf_protection', 'bool');
@ -4048,13 +4048,6 @@ class Actions
$this->setSettingsFromParams($oSettings, 'EditorDefaultType', 'string');
$this->setSettingsFromParams($oSettings, 'ShowImages', 'bool');
$this->setSettingsFromParams($oSettings, 'ContactsAutosave', 'bool');
$this->setSettingsFromParams($oSettings, 'InterfaceAnimation', 'string', function ($sValue) {
return (\in_array($sValue,
array(\RainLoop\Enumerations\InterfaceAnimation::NONE,
\RainLoop\Enumerations\InterfaceAnimation::NORMAL,
\RainLoop\Enumerations\InterfaceAnimation::FULL)) ? $sValue :
\RainLoop\Enumerations\InterfaceAnimation::FULL);
});
$this->setSettingsFromParams($oSettings, 'DesktopNotifications', 'bool');
$this->setSettingsFromParams($oSettings, 'UseThreads', 'bool');
$this->setSettingsFromParams($oSettings, 'ReplySameFolder', 'bool');

View file

@ -88,7 +88,8 @@ class Application extends \RainLoop\Config\AbstractConfig
'login_logo' => array(''),
'login_desc' => array(''),
'login_css' => array(''),
'login_powered' => array(true)
'login_powered' => array(true),
'user_logo' => array('')
),
'contacts' => array(

View file

@ -1,10 +0,0 @@
<?php
namespace RainLoop\Enumerations;
class InterfaceAnimation
{
const NONE = 'None';
const NORMAL = 'Normal';
const FULL = 'Full';
}

View file

@ -21,7 +21,7 @@
<div class="b-content" data-bind="nano: true">
<div class="content g-scrollbox">
<div class="content-wrapper">
<div id="rl-settings-subscreen" class="b-settings-content"></div>
<div id="rl-settings-subscreen" class="b-settings-content" style="position: relative; z-index: 2"></div>
</div>
</div>
</div>

View file

@ -42,7 +42,7 @@
</div>
<br />
<div class="legend">
Login Screen
Login Page
</div>
<div class="control-group">
<label class="control-label">
@ -77,18 +77,6 @@
}"></div>
</div>
</div>
<div class="control-group">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: {
enable: capa,
label: 'Show &quot;Powered by RainLoop&quot; link',
value: loginPowered
}
}"></div>
</div>
</div>
<div class="control-group">
<label class="control-label">
Custom CSS
@ -106,5 +94,40 @@
}"></div>
</div>
</div>
<div class="control-group">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: {
enable: capa,
label: 'Show &quot;Powered by RainLoop&quot; link',
value: loginPowered
}
}"></div>
</div>
</div>
<!--
<br />
<div class="legend">
User Page
</div>
<div class="control-group">
<label class="control-label">
Logo
</label>
<div class="controls">
<div data-bind="component: {
name: 'Input',
params: {
value: userLogo,
trigger: userLogo.trigger,
placeholder: 'https://',
size: 5,
enable: capa
}
}"></div>
</div>
</div>
-->
</div>
</div>

View file

@ -58,7 +58,6 @@
</div>
<div class="message-fixed-button-toolbar clearfix" data-bind="visible: message">
<!--<div class="message-fixed-button-toolbar clearfix" data-bind="visible: message, initFixedTrigger: ['.b-message-view-wrapper', 20]">-->
<nobr>
<div class="btn-group colored-toggle pull-right">
<a class="btn btn-dark-disabled-border buttonReply" data-tooltip-placement="bottom"
@ -187,7 +186,7 @@
</div>
<div data-bind="visible: message">
<div class="messageItemHeader">
<div class="messageItemHeader" data-bind="css: {'emptySubject': '' === viewSubject()}">
<div>
<img class="fromPic" data-bind="visible: viewUserPicVisible, attr: {'src': viewUserPic() }">
<div style="overflow: hidden;">

View file

@ -11,7 +11,7 @@
<div class="b-content" data-bind="nano: true">
<div class="content g-scrollbox">
<div class="content-wrapper">
<div id="rl-settings-subscreen" class="b-settings-content"></div>
<div id="rl-settings-subscreen" class="b-settings-content" style="position: relative; z-index: 2"></div>
</div>
</div>
</div>