Sound notification

Additional code refactoring
This commit is contained in:
RainLoop Team 2015-01-27 01:06:00 +04:00
parent b42ce01e7e
commit aa84077ac4
87 changed files with 1573 additions and 574 deletions

View file

@ -1233,7 +1233,7 @@ class Actions
$aResult['AllowDropboxSocial'] = (bool) $oConfig->Get('social', 'dropbox_enable', false);
$aResult['DropboxApiKey'] = \trim($oConfig->Get('social', 'dropbox_api_key', ''));
if (!$aResult['AllowDropboxSocial'])
{
$aResult['DropboxApiKey'] = '';
@ -1332,6 +1332,7 @@ class Actions
$aResult['ShowImages'] = (bool) $oConfig->Get('webmail', 'show_images', false);
$aResult['ContactsAutosave'] = true;
$aResult['MPP'] = (int) $oConfig->Get('webmail', 'messages_per_page', 25);
$aResult['SoundNotification'] = false;
$aResult['DesktopNotifications'] = false;
$aResult['UseThreads'] = false;
$aResult['ReplySameFolder'] = false;
@ -1370,6 +1371,7 @@ class Actions
$aResult['ShowImages'] = (bool) $oSettings->GetConf('ShowImages', $aResult['ShowImages']);
$aResult['ContactsAutosave'] = (bool) $oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']);
$aResult['MPP'] = (int) $oSettings->GetConf('MPP', $aResult['MPP']);
$aResult['SoundNotification'] = (bool) $oSettings->GetConf('SoundNotification', $aResult['SoundNotification']);
$aResult['DesktopNotifications'] = (bool) $oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']);
$aResult['UseThreads'] = (bool) $oSettings->GetConf('UseThreads', $aResult['UseThreads']);
$aResult['ReplySameFolder'] = (bool) $oSettings->GetConf('ReplySameFolder', $aResult['ReplySameFolder']);
@ -1409,7 +1411,7 @@ class Actions
$bUserLanguage = false;
if (!$bAdmin && !$aResult['Auth'] && !empty($_COOKIE['rllang']) &&
$oConfig->Get('webmail', 'allow_languages_on_login', true))
$oConfig->Get('login', 'allow_languages_on_login', true))
{
$sLanguage = $_COOKIE['rllang'];
}
@ -1417,6 +1419,7 @@ class Actions
{
$sUserLanguage = '';
if (!$bAdmin && !$aResult['Auth'] &&
$oConfig->Get('login', 'allow_languages_on_login', true) &&
$oConfig->Get('login', 'determine_user_language', true))
{
$sUserLanguage = $this->detectUserLanguage();
@ -4057,6 +4060,7 @@ class Actions
$this->setSettingsFromParams($oSettings, 'ShowImages', 'bool');
$this->setSettingsFromParams($oSettings, 'ContactsAutosave', 'bool');
$this->setSettingsFromParams($oSettings, 'DesktopNotifications', 'bool');
$this->setSettingsFromParams($oSettings, 'SoundNotification', 'bool');
$this->setSettingsFromParams($oSettings, 'UseThreads', 'bool');
$this->setSettingsFromParams($oSettings, 'ReplySameFolder', 'bool');
$this->setSettingsFromParams($oSettings, 'UseCheckboxesInList', 'bool');

View file

@ -29,9 +29,9 @@
name: 'Checkbox',
params: { value: allowLanguagesOnLogin, label: 'Allow language selection on login screen' }
}"></div>
<div data-bind="component: {
<div data-bind="visible: allowLanguagesOnLogin, component: {
name: 'Checkbox',
params: { value: determineUserLanguage, label: 'Try to determine user language' }
params: { enable: allowLanguagesOnLogin, value: determineUserLanguage, label: 'Try to determine user language' }
}"></div>
</div>
</div>

View file

@ -9,18 +9,10 @@
name: 'Checkbox',
params: { value: capaTwoFactorAuth, label: 'Allow 2-Step Verification (Google Authenticator)' }
}"></div>
</div>
</div>
<div class="control-group">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: { value: useLocalProxyForExternalImages, label: 'Use local proxy for external images' }
}"></div>
</div>
</div>
<div class="control-group">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: { value: capaOpenPGP, label: 'Allow OpenPGP', inline: true }
@ -35,36 +27,6 @@
</div>
</div>
</div>
<div class="form-horizontal">
<div class="legend">
SSL
</div>
<div class="control-group">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: {
value: verifySslCertificate,
label: 'Require verification of SSL certificate used (IMAP/SMTP)',
inline: true
}
}"></div>
&nbsp;&nbsp;
<span style="color:red">(unstable)</span>
<br />
<div data-bind="component: {
name: 'Checkbox',
params: {
enable: verifySslCertificate,
value: allowSelfSigned,
label: 'Allow self signed certificates'
}
}"></div>
</div>
</div>
</div>
<br />
<div class="form-horizontal">
<div class="legend">
Admin Panel Access Credentials
@ -116,4 +78,33 @@
</div>
</div>
</div>
<div class="form-horizontal">
<div class="legend">
SSL
</div>
<div class="control-group">
<div class="controls">
<div data-bind="component: {
name: 'Checkbox',
params: {
value: verifySslCertificate,
label: 'Require verification of SSL certificate used (IMAP/SMTP)',
inline: true
}
}"></div>
&nbsp;&nbsp;
<span style="color:red">(unstable)</span>
<br />
<div data-bind="component: {
name: 'Checkbox',
params: {
enable: verifySslCertificate,
value: allowSelfSigned,
label: 'Allow self signed certificates'
}
}"></div>
</div>
</div>
</div>
</div>

View file

@ -74,6 +74,8 @@
<i class="icon-filter"></i>
&nbsp;
<a href="#" class="g-ui-link">Sieve configuration</a>
&nbsp;&nbsp;
<span style="color:red">(beta)</span>
</span>
</div>
</div>
@ -91,7 +93,6 @@
</div>
</div>
<div data-bind="visible: useSieve">
<br />
<div class="row">
<div class="span5">
<div data-bind="component: {

View file

@ -91,6 +91,7 @@
value: useCheckboxesInList
}
}"></div>
<br />
<div data-bind="visible: threading, component: {
name: 'Checkbox',
params: {
@ -108,9 +109,9 @@
</div>
</div>
</div>
<div class="form-horizontal" data-bind="visible: isDesktopNotificationSupported">
<div class="form-horizontal" data-bind="visible: isDesktopNotificationSupported() || soundNotificationIsSupported()">
<div class="legend">
<span class="i18n i18n-animation" data-i18n-text="SETTINGS_GENERAL/LABEL_CHROME_NOTIFICATION"></span>
<span class="i18n i18n-animation" data-i18n-text="SETTINGS_GENERAL/LABEL_NOTIFICATIONS"></span>
</div>
<div class="control-group">
<div class="controls">
@ -129,6 +130,20 @@
<span class="i18n" style="color: #999" data-i18n-text="SETTINGS_GENERAL/LABEL_CHROME_NOTIFICATION_DESC_DENIED"></span>
</span>
</div>
<div data-bind="visible: soundNotificationIsSupported">
<div data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_GENERAL/LABEL_SOUND_NOTIFICATION',
value: enableSoundNotification,
inline: true
}
}"></div>
&nbsp;&nbsp;
<span data-bind="click: testSoundNotification" style="color:red;cursor:pointer">
<i class="icon-right-dir iconsize20"></i>
</span>
</div>
</div>
</div>
</div>