mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
Remove user customized theme (simplification)
Added theme folders (regardless of the RainLoop version)
This commit is contained in:
parent
f3823333d7
commit
d08689759d
26 changed files with 125 additions and 618 deletions
|
@ -14,7 +14,6 @@ function AdminGeneral()
|
|||
this.theme = oData.theme;
|
||||
|
||||
this.allowThemes = oData.allowThemes;
|
||||
this.allowCustomTheme = oData.allowCustomTheme;
|
||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
||||
this.allowIdentities = oData.allowIdentities;
|
||||
|
@ -63,12 +62,6 @@ AdminGeneral.prototype.onBuild = function ()
|
|||
});
|
||||
});
|
||||
|
||||
self.allowCustomTheme.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowCustomTheme': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.allowAdditionalAccounts.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowAdditionalAccounts': bValue ? '1' : '0'
|
||||
|
|
|
@ -6,13 +6,9 @@
|
|||
function LinkBuilder()
|
||||
{
|
||||
this.sBase = '#/';
|
||||
this.sCdnStaticDomain = RL.settingsGet('CdnStaticDomain');
|
||||
this.sVersion = RL.settingsGet('Version');
|
||||
this.sSpecSuffix = RL.settingsGet('AuthAccountHash') || '0';
|
||||
|
||||
this.sServer = (RL.settingsGet('IndexFile') || './') + '?';
|
||||
this.sCdnStaticDomain = '' === this.sCdnStaticDomain ? this.sCdnStaticDomain :
|
||||
('/' === this.sCdnStaticDomain.substr(-1) ? this.sCdnStaticDomain : this.sCdnStaticDomain + '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,8 +244,7 @@ LinkBuilder.prototype.exportContactsCsv = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.emptyContactPic = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/css/images/empty-contact.png';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/css/images/empty-contact.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -258,8 +253,7 @@ LinkBuilder.prototype.emptyContactPic = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.sound = function (sFileName)
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/sounds/' + sFileName;
|
||||
return 'rainloop/v/' + this.sVersion + '/static/sounds/' + sFileName;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -268,8 +262,14 @@ LinkBuilder.prototype.sound = function (sFileName)
|
|||
*/
|
||||
LinkBuilder.prototype.themePreviewLink = function (sTheme)
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/themes/' + encodeURI(sTheme) + '/images/preview.png';
|
||||
var sPrefix = 'rainloop/v/' + this.sVersion + '/';
|
||||
if ('@custom' === sTheme.substr(-7))
|
||||
{
|
||||
sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7));
|
||||
sPrefix = '';
|
||||
}
|
||||
|
||||
return sPrefix + 'themes/' + encodeURI(sTheme) + '/images/preview.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -277,8 +277,7 @@ LinkBuilder.prototype.themePreviewLink = function (sTheme)
|
|||
*/
|
||||
LinkBuilder.prototype.notificationMailIcon = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/css/images/icom-message-notification.png';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/css/images/icom-message-notification.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -286,8 +285,7 @@ LinkBuilder.prototype.notificationMailIcon = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.openPgpJs = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/js/openpgp.min.js';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/js/openpgp.min.js';
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -934,7 +934,6 @@ Utils.initDataConstructorBySettings = function (oData)
|
|||
}
|
||||
});
|
||||
|
||||
oData.allowCustomTheme = ko.observable(false);
|
||||
oData.allowAdditionalAccounts = ko.observable(false);
|
||||
oData.allowIdentities = ko.observable(false);
|
||||
oData.allowGravatar = ko.observable(false);
|
||||
|
@ -1262,7 +1261,12 @@ Utils.disableSettingsViewModel = function (SettingsViewModelClass)
|
|||
|
||||
Utils.convertThemeName = function (sTheme)
|
||||
{
|
||||
return Utils.trim(sTheme.replace(/[^a-zA-Z]/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' '));
|
||||
if ('@custom' === sTheme.substr(-7))
|
||||
{
|
||||
sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7));
|
||||
}
|
||||
|
||||
return Utils.trim(sTheme.replace(/[^a-zA-Z]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' '));
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,22 +11,8 @@ function SettingsThemes()
|
|||
;
|
||||
|
||||
this.mainTheme = oData.mainTheme;
|
||||
this.customThemeType = ko.observable(RL.settingsGet('CustomThemeType'));
|
||||
this.customThemeImg = ko.observable(RL.settingsGet('CustomThemeImg'));
|
||||
|
||||
this.themesObjects = ko.observableArray([]);
|
||||
|
||||
this.customThemeUploaderProgress = ko.observable(false);
|
||||
this.customThemeUploaderButton = ko.observable(null);
|
||||
|
||||
this.showCustomThemeConfig = ko.computed(function () {
|
||||
return 'Custom' === this.mainTheme();
|
||||
}, this);
|
||||
|
||||
this.showCustomThemeConfig.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
});
|
||||
|
||||
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle).extend({'throttle': 100});
|
||||
|
||||
this.oLastAjax = null;
|
||||
|
@ -52,7 +38,7 @@ function SettingsThemes()
|
|||
if (sUrl)
|
||||
{
|
||||
sUrl = sUrl.toString().replace(/\/-\/[^\/]+\/\-\//, '/-/' + sValue + '/-/');
|
||||
sUrl = sUrl.toString().replace(/\/Css\/[^\/]+\/User\//, '/Css/' + ('Custom' === sValue && window.__rlah ? window.__rlah() || '0' : '0') + '/User/');
|
||||
sUrl = sUrl.toString().replace(/\/Css\/[^\/]+\/User\//, '/Css/0/User/');
|
||||
|
||||
if ('Json/' !== sUrl.substring(sUrl.length - 5, sUrl.length))
|
||||
{
|
||||
|
@ -115,18 +101,9 @@ function SettingsThemes()
|
|||
|
||||
Utils.addSettingsViewModel(SettingsThemes, 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
|
||||
SettingsThemes.prototype.removeCustomThemeImg = function ()
|
||||
{
|
||||
this.customThemeImg('');
|
||||
};
|
||||
|
||||
SettingsThemes.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sCurrentTheme = RL.data().theme()
|
||||
;
|
||||
|
||||
var sCurrentTheme = RL.data().theme();
|
||||
this.themesObjects(_.map(RL.data().themes(), function (sTheme) {
|
||||
return {
|
||||
'name': sTheme,
|
||||
|
@ -135,92 +112,4 @@ SettingsThemes.prototype.onBuild = function ()
|
|||
'themePreviewSrc': RL.link().themePreviewLink(sTheme)
|
||||
};
|
||||
}));
|
||||
|
||||
_.delay(function () {
|
||||
|
||||
self.customThemeType.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(function () {
|
||||
RL.data().theme.valueHasMutated();
|
||||
}, {
|
||||
'CustomThemeType': sValue
|
||||
});
|
||||
});
|
||||
|
||||
self.customThemeImg.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(function () {
|
||||
RL.data().theme.valueHasMutated();
|
||||
}, {
|
||||
'CustomThemeImg': sValue
|
||||
});
|
||||
});
|
||||
|
||||
}, 50);
|
||||
|
||||
this.initCustomThemeUploader();
|
||||
};
|
||||
|
||||
SettingsThemes.prototype.initCustomThemeUploader = function ()
|
||||
{
|
||||
if (this.customThemeUploaderButton())
|
||||
{
|
||||
var
|
||||
oJua = new Jua({
|
||||
'action': RL.link().uploadBackground(),
|
||||
'name': 'uploader',
|
||||
'queueSize': 1,
|
||||
'multipleSizeLimit': 1,
|
||||
'disableFolderDragAndDrop': true,
|
||||
'clickElement': this.customThemeUploaderButton()
|
||||
})
|
||||
;
|
||||
|
||||
oJua
|
||||
.on('onSelect', _.bind(function (sId, oData) {
|
||||
|
||||
var
|
||||
sFileName = Utils.isUnd(oData.FileName) ? '' : oData.FileName.toString(),
|
||||
sFileNameExt = sFileName.substring(sFileName.length - 4, sFileName.length),
|
||||
mSize = Utils.isNormal(oData.Size) ? Utils.pInt(oData.Size) : null
|
||||
;
|
||||
|
||||
if (-1 === Utils.inArray(sFileNameExt, ['jpeg', '.jpg', '.png']))
|
||||
{
|
||||
window.alert(Utils.i18n('SETTINGS_THEMES/ERROR_FILE_TYPE_ERROR'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (1024 * 1024 < mSize)
|
||||
{
|
||||
window.alert(Utils.i18n('SETTINGS_THEMES/ERROR_FILE_IS_TOO_BIG'));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}, this))
|
||||
.on('onStart', _.bind(function () {
|
||||
this.customThemeUploaderProgress(true);
|
||||
}, this))
|
||||
.on('onComplete', _.bind(function (sId, bResult, oData) {
|
||||
if (!bResult || !oData || !oData.Result)
|
||||
{
|
||||
window.alert(
|
||||
oData && oData.ErrorCode ? Utils.getUploadErrorDescByCode(oData.ErrorCode) : Utils.getUploadErrorDescByCode(Enums.UploadErrorCode.Unknown)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.customThemeImg(oData.Result);
|
||||
}
|
||||
|
||||
this.customThemeUploaderProgress(false);
|
||||
}, this))
|
||||
;
|
||||
|
||||
|
||||
return !!oJua;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
|
|
@ -84,7 +84,6 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.mainLanguage(RL.settingsGet('Language'));
|
||||
this.mainTheme(RL.settingsGet('Theme'));
|
||||
|
||||
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
||||
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
||||
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
||||
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "RainLoop",
|
||||
"title": "RainLoop Webmail",
|
||||
"version": "1.6.6",
|
||||
"release": "919",
|
||||
"release": "921",
|
||||
"description": "Simple, modern & fast web-based email client",
|
||||
"homepage": "http://rainloop.net",
|
||||
"main": "Gruntfile.js",
|
||||
|
|
|
@ -990,14 +990,12 @@ class Actions
|
|||
'LoginDefaultDomain' => $oConfig->Get('login', 'default_domain', ''),
|
||||
'DetermineUserLanguage' => (bool) $oConfig->Get('login', 'determine_user_language', true),
|
||||
'AllowThemes' => (bool) $oConfig->Get('webmail', 'allow_themes', true),
|
||||
'AllowCustomTheme' => (bool) $oConfig->Get('webmail', 'allow_custom_theme', true),
|
||||
'ChangePasswordIsAllowed' => false,
|
||||
'ContactsIsAllowed' => false,
|
||||
'JsHash' => \md5(\RainLoop\Utils::GetConnectionToken()),
|
||||
'UseImapThread' => (bool) $oConfig->Get('labs', 'use_imap_thread', false),
|
||||
'UseImapSubscribe' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true),
|
||||
'AllowAppendMessage' => (bool) $oConfig->Get('labs', 'allow_message_append', false),
|
||||
'CdnStaticDomain' => $oConfig->Get('labs', 'cdn_static_domain', ''),
|
||||
'Plugins' => array()
|
||||
);
|
||||
|
||||
|
@ -1148,7 +1146,7 @@ class Actions
|
|||
$sLanguage = $oConfig->Get('webmail', 'language', 'en');
|
||||
$sTheme = $oConfig->Get('webmail', 'theme', 'Default');
|
||||
|
||||
$aResult['Themes'] = $this->GetThemes($bAdmin);
|
||||
$aResult['Themes'] = $this->GetThemes();
|
||||
$aResult['Languages'] = $this->GetLanguages();
|
||||
$aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true);
|
||||
$aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true);
|
||||
|
@ -1173,8 +1171,6 @@ class Actions
|
|||
$aResult['EnableTwoFactor'] = false;
|
||||
$aResult['ParentEmail'] = '';
|
||||
$aResult['InterfaceAnimation'] = \RainLoop\Enumerations\InterfaceAnimation::NORMAL;
|
||||
$aResult['CustomThemeType'] = \RainLoop\Enumerations\CustomThemeType::LIGHT;
|
||||
$aResult['CustomThemeImg'] = '';
|
||||
|
||||
if (!$bAdmin && $oSettings instanceof \RainLoop\Settings)
|
||||
{
|
||||
|
@ -1204,8 +1200,6 @@ class Actions
|
|||
$aResult['Layout'] = (int) $oSettings->GetConf('Layout', $aResult['Layout']);
|
||||
$aResult['UseCheckboxesInList'] = (bool) $oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']);
|
||||
$aResult['InterfaceAnimation'] = (string) $oSettings->GetConf('InterfaceAnimation', $aResult['InterfaceAnimation']);
|
||||
$aResult['CustomThemeType'] = (string) $oSettings->GetConf('CustomThemeType', $aResult['CustomThemeType']);
|
||||
$aResult['CustomThemeImg'] = (string) $oSettings->GetConf('CustomThemeImg', $aResult['CustomThemeImg']);
|
||||
|
||||
$aResult['DisplayName'] = $oSettings->GetConf('DisplayName', $aResult['DisplayName']);
|
||||
$aResult['ReplyTo'] = $oSettings->GetConf('ReplyTo', $aResult['ReplyTo']);
|
||||
|
@ -1219,13 +1213,6 @@ class Actions
|
|||
$aResult['InterfaceAnimation'] = \RainLoop\Enumerations\InterfaceAnimation::NONE === $aResult['InterfaceAnimation']
|
||||
? $aResult['InterfaceAnimation'] : \RainLoop\Enumerations\InterfaceAnimation::NORMAL;
|
||||
|
||||
if (!in_array($aResult['CustomThemeType'], array(
|
||||
\RainLoop\Enumerations\CustomThemeType::LIGHT, \RainLoop\Enumerations\CustomThemeType::DARK
|
||||
)))
|
||||
{
|
||||
$aResult['CustomThemeType'] = \RainLoop\Enumerations\CustomThemeType::LIGHT;
|
||||
}
|
||||
|
||||
if (0 < \strlen($aResult['ParentEmail']))
|
||||
{
|
||||
$aResult['AllowGoogleSocial'] = false;
|
||||
|
@ -1237,10 +1224,6 @@ class Actions
|
|||
|
||||
$sTheme = $this->ValidateTheme($sTheme);
|
||||
$sNewThemeLink = APP_INDEX_FILE.'?/Css/0/'.($bAdmin ? 'Admin' : 'User').'/-/'.($bAdmin ? 'Default' : $sTheme).'/-/'.$sStaticCache.'/';
|
||||
if (!$bAdmin && 0 < \strlen($sAuthAccountHash) && 'Custom' === $sTheme)
|
||||
{
|
||||
$sNewThemeLink = \str_replace('/Css/0/User/-/Custom/-/', '/Css/'.$sAuthAccountHash.'/User/-/Custom/-/', $sNewThemeLink);
|
||||
}
|
||||
|
||||
$bUserLanguage = false;
|
||||
if (!$bAdmin && !$aResult['Auth'] && !empty($_COOKIE['rllang']) &&
|
||||
|
@ -2079,7 +2062,6 @@ class Actions
|
|||
});
|
||||
|
||||
$this->setConfigFromParams($oConfig, 'AllowThemes', 'webmail', 'allow_themes', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'AllowCustomTheme', 'webmail', 'allow_custom_theme', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'AllowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'AllowLanguagesOnLogin', 'login', 'allow_languages_on_login', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'AllowCustomLogin', 'login', 'allow_custom_login', 'bool');
|
||||
|
@ -3245,12 +3227,6 @@ class Actions
|
|||
$oSettings->SetConf('Theme', $this->ValidateLanguage($oConfig->Get('webmail', 'theme', 'Default')));
|
||||
}
|
||||
|
||||
$this->setSettingsFromParams($oSettings, 'CustomThemeType', 'string', function ($sCustomThemeType) {
|
||||
return \in_array($sCustomThemeType, array(
|
||||
\RainLoop\Enumerations\CustomThemeType::LIGHT, \RainLoop\Enumerations\CustomThemeType::DARK)) ?
|
||||
$sCustomThemeType : \RainLoop\Enumerations\CustomThemeType::LIGHT;
|
||||
});
|
||||
|
||||
$this->setSettingsFromParams($oSettings, 'MPP', 'int', function ($iValue) {
|
||||
return (int) (\in_array($iValue, array(10, 20, 30, 50, 100, 150, 200, 300)) ? $iValue : 20);
|
||||
});
|
||||
|
@ -5871,91 +5847,6 @@ class Actions
|
|||
return $this->DefaultResponse(__FUNCTION__, $mResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function UploadBackground()
|
||||
{
|
||||
$oAccount = $this->getAccountFromToken();
|
||||
|
||||
$sInputName = 'uploader';
|
||||
$mResponse = false;
|
||||
|
||||
$iError = UploadError::UNKNOWN;
|
||||
$iSizeLimit = 1024 * 1024;
|
||||
if ($oAccount)
|
||||
{
|
||||
$iError = UPLOAD_ERR_OK;
|
||||
$_FILES = isset($_FILES) ? $_FILES : null;
|
||||
if (isset($_FILES, $_FILES[$sInputName], $_FILES[$sInputName]['name'], $_FILES[$sInputName]['tmp_name'], $_FILES[$sInputName]['size']))
|
||||
{
|
||||
$iError = (isset($_FILES[$sInputName]['error'])) ? (int) $_FILES[$sInputName]['error'] : UPLOAD_ERR_OK;
|
||||
|
||||
if (UPLOAD_ERR_OK === $iError && 0 < $iSizeLimit && $iSizeLimit < (int) $_FILES[$sInputName]['size'])
|
||||
{
|
||||
$iError = UploadError::CONFIG_SIZE;
|
||||
}
|
||||
|
||||
if (UPLOAD_ERR_OK === $iError && !\in_array(\strtolower($_FILES[$sInputName]['type']), array('image/png', 'image/jpg', 'image/jpeg')))
|
||||
{
|
||||
$iError = UploadError::FILE_TYPE;
|
||||
}
|
||||
|
||||
$sSavedName = 'upload-post-'.md5($_FILES[$sInputName]['name'].$_FILES[$sInputName]['tmp_name']);
|
||||
|
||||
if (UPLOAD_ERR_OK === $iError)
|
||||
{
|
||||
if (!$this->FilesProvider()->MoveUploadedFile($oAccount, $sSavedName, $_FILES[$sInputName]['tmp_name']))
|
||||
{
|
||||
$iError = UploadError::ON_SAVING;
|
||||
}
|
||||
|
||||
$mData = $this->FilesProvider()->GetFile($oAccount, $sSavedName);
|
||||
if ($mData)
|
||||
{
|
||||
$this->StorageProvider()->Put($oAccount,
|
||||
\RainLoop\Providers\Storage\Enumerations\StorageType::USER, 'CustomThemeBackground',
|
||||
'data:'.$_FILES[$sInputName]['type'].';base64,'.base64_encode(
|
||||
\stream_get_contents($mData)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (\is_resource($mData))
|
||||
{
|
||||
\fclose($mData);
|
||||
}
|
||||
|
||||
unset($mData);
|
||||
$this->FilesProvider()->Clear($oAccount, $sSavedName);
|
||||
|
||||
$mResponse = $_FILES[$sInputName]['name'];
|
||||
}
|
||||
|
||||
}
|
||||
else if (!isset($_FILES) || !is_array($_FILES) || 0 === count($_FILES))
|
||||
{
|
||||
$iError = UPLOAD_ERR_INI_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$iError = UploadError::EMPTY_FILES_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
if (UPLOAD_ERR_OK !== $iError)
|
||||
{
|
||||
$iClientError = UploadClientError::NORMAL;
|
||||
$sError = $this->getUploadErrorMessageByCode($iError, $iClientError);
|
||||
if (!empty($sError))
|
||||
{
|
||||
return $this->FalseResponse(__FUNCTION__, $iClientError, $sError);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $mResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*
|
||||
|
@ -6324,14 +6215,13 @@ class Actions
|
|||
|
||||
/**
|
||||
* @staticvar array $aCache
|
||||
* @param bool $bAdmin = false
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function GetThemes($bAdmin = false)
|
||||
public function GetThemes()
|
||||
{
|
||||
static $aCache = null;
|
||||
if (is_array($aCache))
|
||||
if (\is_array($aCache))
|
||||
{
|
||||
return $aCache;
|
||||
}
|
||||
|
@ -6340,16 +6230,16 @@ class Actions
|
|||
$bDefault = false;
|
||||
$sList = array();
|
||||
$sDir = APP_VERSION_ROOT_PATH.'themes';
|
||||
if (@is_dir($sDir))
|
||||
if (@\is_dir($sDir))
|
||||
{
|
||||
$rDirH = opendir($sDir);
|
||||
$rDirH = \opendir($sDir);
|
||||
if ($rDirH)
|
||||
{
|
||||
while (($sFile = readdir($rDirH)) !== false)
|
||||
while (($sFile = \readdir($rDirH)) !== false)
|
||||
{
|
||||
if ('.' !== $sFile{0} && is_dir($sDir.'/'.$sFile) && file_exists($sDir.'/'.$sFile.'/styles.less'))
|
||||
if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
|
||||
{
|
||||
if ('Default' !== $sFile && 'Clear' !== $sFile && 'Custom' !== $sFile)
|
||||
if ('Default' !== $sFile && 'Clear' !== $sFile)
|
||||
{
|
||||
$sList[] = $sFile;
|
||||
}
|
||||
|
@ -6370,20 +6260,35 @@ class Actions
|
|||
}
|
||||
}
|
||||
|
||||
sort($sList);
|
||||
if ($bDefault)
|
||||
$sDir = APP_INDEX_ROOT_PATH.'themes'; // custom user themes
|
||||
if (@\is_dir($sDir))
|
||||
{
|
||||
array_unshift($sList, 'Default');
|
||||
}
|
||||
|
||||
if ($bClear)
|
||||
{
|
||||
array_push($sList, 'Clear');
|
||||
$rDirH = \opendir($sDir);
|
||||
if ($rDirH)
|
||||
{
|
||||
while (($sFile = \readdir($rDirH)) !== false)
|
||||
{
|
||||
if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
|
||||
{
|
||||
$sList[] = $sFile.'@custom';
|
||||
}
|
||||
}
|
||||
|
||||
@\closedir($rDirH);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$bAdmin && $this->Config()->Get('webmail', 'allow_custom_theme', true))
|
||||
$sList = \array_unique($sList);
|
||||
\sort($sList);
|
||||
|
||||
if ($bDefault)
|
||||
{
|
||||
array_push($sList, 'Custom');
|
||||
\array_unshift($sList, 'Default');
|
||||
}
|
||||
|
||||
if ($bClear)
|
||||
{
|
||||
\array_push($sList, 'Clear');
|
||||
}
|
||||
|
||||
$aCache = $sList;
|
||||
|
|
|
@ -62,7 +62,6 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
|
||||
'theme' => array('Default', 'Theme used by default'),
|
||||
'allow_themes' => array(true, 'Allow theme selection on settings screen'),
|
||||
'allow_custom_theme' => array(true, ''),
|
||||
|
||||
'language' => array('en', 'Language used by default'),
|
||||
'allow_languages_on_settings' => array(true, 'Allow language selection on settings screen'),
|
||||
|
@ -238,7 +237,6 @@ Enables caching in the system'),
|
|||
'repo_type' => array('stable'),
|
||||
'custom_repo' => array(''),
|
||||
'additional_repo' => array(''),
|
||||
'cdn_static_domain' => array(''),
|
||||
'curl_proxy' => array(''),
|
||||
'curl_proxy_auth' => array(''),
|
||||
'in_iframe' => array(false),
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace RainLoop\Enumerations;
|
||||
|
||||
class CustomThemeType
|
||||
{
|
||||
const LIGHT = 'Light';
|
||||
const DARK = 'Dark';
|
||||
}
|
|
@ -222,7 +222,6 @@ class Service
|
|||
{
|
||||
return \md5(APP_WEB_PATH.
|
||||
$this->oActions->Config()->Get('webmail', 'loading_description', 'RainLoop').
|
||||
$this->oActions->Config()->Get('labs', 'cdn_static_domain', '').
|
||||
\md5($this->oActions->Config()->Get('cache', 'index', '')).
|
||||
$this->oActions->Plugins()->Hash().
|
||||
APP_VERSION.($bAppJsDebug ? 'd' : 'm').($bAdmin ? 'a' : 'w'));
|
||||
|
@ -248,14 +247,8 @@ class Service
|
|||
|
||||
$bAppJsDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_js', false);
|
||||
$bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false);
|
||||
$sCdnStaticDomain = $this->oActions->Config()->Get('labs', 'cdn_static_domain', '');
|
||||
|
||||
$sStaticPrefix = APP_WEB_STATIC_PATH;
|
||||
if (0 < \strlen($sCdnStaticDomain))
|
||||
{
|
||||
$sStaticPrefix = \trim($sCdnStaticDomain, ' /\\').'/'.APP_VERSION.'/static/';
|
||||
}
|
||||
|
||||
return array(
|
||||
'Language' => $sLanguage,
|
||||
'Theme' => $sTheme,
|
||||
|
|
|
@ -519,9 +519,6 @@ class ServiceActions
|
|||
public function ServiceCss()
|
||||
{
|
||||
$sResult = '';
|
||||
$bCustom = false;
|
||||
$oAccount = null;
|
||||
$oSettings = null;
|
||||
|
||||
$bAdmin = !empty($this->aPaths[2]) && 'Admin' === $this->aPaths[2];
|
||||
$bJson = !empty($this->aPaths[7]) && 'Json' === $this->aPaths[7];
|
||||
|
@ -539,24 +536,22 @@ class ServiceActions
|
|||
if (!empty($this->aPaths[4]))
|
||||
{
|
||||
$sTheme = $this->oActions->ValidateTheme($this->aPaths[4]);
|
||||
if ('Custom' === $sTheme && !empty($this->aPaths[1]) && '0' !== $this->aPaths[1])
|
||||
$sRealTheme = $sTheme;
|
||||
|
||||
$bCustomTheme = '@custom' === \substr($sTheme, -7);
|
||||
if ($bCustomTheme)
|
||||
{
|
||||
$bCustom = true;
|
||||
$oAccount = $this->oActions->GetAccount(false);
|
||||
if ($oAccount)
|
||||
{
|
||||
$oSettings = $this->oActions->SettingsProvider()->Load($oAccount);
|
||||
}
|
||||
$sRealTheme = \substr($sTheme, 0, -7);
|
||||
}
|
||||
|
||||
$bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true);
|
||||
if ($bCacheEnabled && !$bCustom)
|
||||
if ($bCacheEnabled)
|
||||
{
|
||||
$this->oActions->verifyCacheByKey($this->sQuery);
|
||||
}
|
||||
|
||||
$sCacheFileName = '';
|
||||
if ($bCacheEnabled && !$bCustom)
|
||||
if ($bCacheEnabled)
|
||||
{
|
||||
$sCacheFileName = 'THEMES/PLUGINS:'.$sTheme.':'.$this->Plugins()->Hash();
|
||||
$sResult = $this->Cacher()->Get($sCacheFileName);
|
||||
|
@ -574,39 +569,22 @@ class ServiceActions
|
|||
|
||||
$aResult = array();
|
||||
|
||||
$sThemeFile = ($bCustomTheme ? APP_INDEX_ROOT_PATH : APP_VERSION_ROOT_PATH).'themes/'.$sRealTheme.'/styles.less';
|
||||
$sThemeExtFile = ($bCustomTheme ? APP_INDEX_ROOT_PATH : APP_VERSION_ROOT_PATH).'themes/'.$sRealTheme.'/ext.less';
|
||||
|
||||
$sThemeValuesFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/values.less';
|
||||
if ($bCustom)
|
||||
{
|
||||
$sThemeFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/custom-values-light.less';
|
||||
if ($oSettings)
|
||||
{
|
||||
if (\RainLoop\Enumerations\CustomThemeType::LIGHT === (string) $oSettings->GetConf('CustomThemeType', \RainLoop\Enumerations\CustomThemeType::LIGHT))
|
||||
{
|
||||
$sThemeFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/custom-values-light.less';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sThemeFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/custom-values-dark.less';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sThemeFile = APP_VERSION_ROOT_PATH.'themes/'.$sTheme.'/styles.less';
|
||||
}
|
||||
|
||||
$sThemeTemplateFile = APP_VERSION_ROOT_PATH.'app/templates/Themes/template.less';
|
||||
|
||||
if (\file_exists($sThemeFile) && \file_exists($sThemeTemplateFile) && \file_exists($sThemeValuesFile))
|
||||
{
|
||||
$aResult[] = '@base: "'.APP_WEB_PATH.'themes/'.$sTheme.'/";';
|
||||
$aResult[] = '@base: "'.($bCustomTheme ? '' : APP_WEB_PATH).'themes/'.$sRealTheme.'/";';
|
||||
$aResult[] = \file_get_contents($sThemeValuesFile);
|
||||
$aResult[] = \file_get_contents($sThemeFile);
|
||||
$aResult[] = \file_get_contents($sThemeTemplateFile);
|
||||
|
||||
if (\file_exists(APP_VERSION_ROOT_PATH.'themes/'.$sTheme.'/ext.less'))
|
||||
if (\file_exists($sThemeExtFile))
|
||||
{
|
||||
$aResult[] = \file_get_contents(APP_VERSION_ROOT_PATH.'themes/'.$sTheme.'/ext.less');
|
||||
$aResult[] = \file_get_contents($sThemeExtFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -614,16 +592,7 @@ class ServiceActions
|
|||
|
||||
$sResult = $oLess->compile(\implode("\n", $aResult));
|
||||
|
||||
if ($bCustom && $oAccount)
|
||||
{
|
||||
$mData = $this->oActions->StorageProvider()->Get($oAccount, \RainLoop\Providers\Storage\Enumerations\StorageType::USER, 'CustomThemeBackground', '');
|
||||
if (!empty($mData) && 'data:' === \substr($mData, 0, 5))
|
||||
{
|
||||
$sResult = \str_replace('background-image:link', 'background-image:url("'.$mData.'")', $sResult);
|
||||
}
|
||||
}
|
||||
|
||||
if ($bCacheEnabled && !$bCustom)
|
||||
if ($bCacheEnabled)
|
||||
{
|
||||
if (0 < \strlen($sCacheFileName))
|
||||
{
|
||||
|
@ -637,7 +606,7 @@ class ServiceActions
|
|||
}
|
||||
}
|
||||
|
||||
if ($bCacheEnabled && !$bCustom)
|
||||
if ($bCacheEnabled)
|
||||
{
|
||||
$this->oActions->cacheByKey($this->sQuery);
|
||||
}
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
|
||||
// MAIN
|
||||
@main-color: #333;
|
||||
@main-background-color: #48525C;
|
||||
@main-background-image: link;
|
||||
|
||||
// LOADING
|
||||
@loading-color: #ddd;
|
||||
@loading-text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
|
||||
|
||||
// LOGIN
|
||||
@login-color: #eee;
|
||||
@login-background-color: #2b333d;
|
||||
@login-rgba-background-color: rgba(0,0,0,0.5);
|
||||
@login-box-shadow: 0px 2px 10px rgba(0,0,0,0.5);
|
||||
@login-border: none;
|
||||
@login-border-radius: 7px;
|
||||
|
||||
// MENU
|
||||
@dropdown-menu-color: #333;
|
||||
@dropdown-menu-background-color: #fff;
|
||||
@dropdown-menu-hover-background-color: #48525C;
|
||||
@dropdown-menu-hover-color: #eee;
|
||||
@dropdown-menu-disabled-color: #999;
|
||||
|
||||
// FOLDERS
|
||||
@folders-color: #fff;
|
||||
@folders-disabled-color: #aaa;
|
||||
@folders-selected-color: #fff;
|
||||
@folders-selected-background-color: #2b333d;
|
||||
@folders-selected-rgba-background-color: rgba(0,0,0,0.5);
|
||||
@folders-focused-color: #fff;
|
||||
@folders-focused-background-color: #2b333d;
|
||||
@folders-focused-rgba-background-color: rgba(0,0,0,0.7);
|
||||
@folders-hover-color: #fff;
|
||||
@folders-hover-background-color: #2b333d;
|
||||
@folders-hover-rgba-background-color: rgba(0,0,0,0.5);
|
||||
@folders-drop-color: #fff;
|
||||
@folders-drop-background-color: #2b333d;
|
||||
@folders-drop-rgba-background-color: rgba(0,0,0,0.5);
|
||||
|
||||
// SETTINGS
|
||||
@settings-menu-color: #fff;
|
||||
@settings-menu-disabled-color: #aaa;
|
||||
@settings-menu-selected-color: #fff;
|
||||
@settings-menu-selected-background-color: #2b333d;
|
||||
@settings-menu-selected-rgba-background-color: rgba(0,0,0,0.5);
|
||||
@settings-menu-hover-color: #fff;
|
||||
@settings-menu-hover-background-color: #2b333d;
|
||||
@settings-menu-hover-rgba-background-color: rgba(0,0,0,0.5);
|
||||
|
||||
// MESSAGE LIST
|
||||
@message-list-toolbar-background-color: #eee;
|
||||
@message-list-toolbar-gradient-start: #f4f4f4;
|
||||
@message-list-toolbar-gradient-end: #dfdfdf;
|
||||
|
||||
// MESSAGE
|
||||
@message-background-color: #fff;
|
||||
@message-rgba-background-color: rgba(255,255,255,0.95);
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
<div class="form-horizontal">
|
||||
<div class="legend">
|
||||
General
|
||||
Interface
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
|
@ -46,10 +46,6 @@
|
|||
<i data-bind="css: allowThemes() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||
Allow theme selection on settings screen
|
||||
</label>
|
||||
<label data-bind="click: function () { allowCustomTheme(!allowCustomTheme()); }">
|
||||
<i data-bind="css: allowCustomTheme() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||
Allow customized theme
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
|
|
@ -11,49 +11,4 @@
|
|||
<img class="e-image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-bind="attr: { 'src': themePreviewSrc }" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<div class="form-horizontal" data-bind="visible: showCustomThemeConfig">
|
||||
<div class="legend">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_THEMES/LEGEND_THEMES_CUSTOM"></span>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" style="padding-top: 0;">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_THEMES/LABEL_CUSTOM_TYPE"></span>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<label for="customThemeTypeID1">
|
||||
<input type="radio" id="customThemeTypeID1" name="customThemeType" value="Light" data-bind="checked: customThemeType" style="position: absolute; left: -10000px" />
|
||||
<i data-bind="css: 'Light' === customThemeType() ? ' icon-radio-checked' : 'icon-radio-unchecked'"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="SETTINGS_THEMES/LABEL_CUSTOM_TYPE_LIGHT"></span>
|
||||
</label>
|
||||
<label for="customThemeTypeID2">
|
||||
<input type="radio" id="customThemeTypeID2" name="customThemeType" value="Dark" data-bind="checked: customThemeType" style="position: absolute; left: -10000px" />
|
||||
<i data-bind="css: 'Dark' === customThemeType() ? ' icon-radio-checked' : 'icon-radio-unchecked'"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="SETTINGS_THEMES/LABEL_CUSTOM_TYPE_DARK"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" style="padding-top: 0;">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_THEMES/LABEL_CUSTOM_BACKGROUND_IMAGE"></span>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<div data-bind="visible: '' !== customThemeImg()">
|
||||
<strong data-bind="text: customThemeImg"></strong>
|
||||
|
||||
<i class="icon-remove" style="cursor: pointer" data-bind="click: removeCustomThemeImg"></i>
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
<a class="btn" data-bind="visible: '' === customThemeImg(), initDom: customThemeUploaderButton">
|
||||
<i data-bind="css: {'icon-image': !customThemeUploaderProgress(), 'icon-spinner animated': customThemeUploaderProgress()}"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="SETTINGS_THEMES/BUTTON_UPLOAD_BACKGROUND_IMAGE"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1658,7 +1658,6 @@ Utils.initDataConstructorBySettings = function (oData)
|
|||
}
|
||||
});
|
||||
|
||||
oData.allowCustomTheme = ko.observable(false);
|
||||
oData.allowAdditionalAccounts = ko.observable(false);
|
||||
oData.allowIdentities = ko.observable(false);
|
||||
oData.allowGravatar = ko.observable(false);
|
||||
|
@ -1986,7 +1985,12 @@ Utils.disableSettingsViewModel = function (SettingsViewModelClass)
|
|||
|
||||
Utils.convertThemeName = function (sTheme)
|
||||
{
|
||||
return Utils.trim(sTheme.replace(/[^a-zA-Z]/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' '));
|
||||
if ('@custom' === sTheme.substr(-7))
|
||||
{
|
||||
sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7));
|
||||
}
|
||||
|
||||
return Utils.trim(sTheme.replace(/[^a-zA-Z]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' '));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3377,13 +3381,9 @@ ko.observable.fn.validateFunc = function (fFunc)
|
|||
function LinkBuilder()
|
||||
{
|
||||
this.sBase = '#/';
|
||||
this.sCdnStaticDomain = RL.settingsGet('CdnStaticDomain');
|
||||
this.sVersion = RL.settingsGet('Version');
|
||||
this.sSpecSuffix = RL.settingsGet('AuthAccountHash') || '0';
|
||||
|
||||
this.sServer = (RL.settingsGet('IndexFile') || './') + '?';
|
||||
this.sCdnStaticDomain = '' === this.sCdnStaticDomain ? this.sCdnStaticDomain :
|
||||
('/' === this.sCdnStaticDomain.substr(-1) ? this.sCdnStaticDomain : this.sCdnStaticDomain + '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3619,8 +3619,7 @@ LinkBuilder.prototype.exportContactsCsv = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.emptyContactPic = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/css/images/empty-contact.png';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/css/images/empty-contact.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3629,8 +3628,7 @@ LinkBuilder.prototype.emptyContactPic = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.sound = function (sFileName)
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/sounds/' + sFileName;
|
||||
return 'rainloop/v/' + this.sVersion + '/static/sounds/' + sFileName;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3639,8 +3637,14 @@ LinkBuilder.prototype.sound = function (sFileName)
|
|||
*/
|
||||
LinkBuilder.prototype.themePreviewLink = function (sTheme)
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/themes/' + encodeURI(sTheme) + '/images/preview.png';
|
||||
var sPrefix = 'rainloop/v/' + this.sVersion + '/';
|
||||
if ('@custom' === sTheme.substr(-7))
|
||||
{
|
||||
sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7));
|
||||
sPrefix = '';
|
||||
}
|
||||
|
||||
return sPrefix + 'themes/' + encodeURI(sTheme) + '/images/preview.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3648,8 +3652,7 @@ LinkBuilder.prototype.themePreviewLink = function (sTheme)
|
|||
*/
|
||||
LinkBuilder.prototype.notificationMailIcon = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/css/images/icom-message-notification.png';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/css/images/icom-message-notification.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3657,8 +3660,7 @@ LinkBuilder.prototype.notificationMailIcon = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.openPgpJs = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/js/openpgp.min.js';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/js/openpgp.min.js';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -5766,7 +5768,6 @@ function AdminGeneral()
|
|||
this.theme = oData.theme;
|
||||
|
||||
this.allowThemes = oData.allowThemes;
|
||||
this.allowCustomTheme = oData.allowCustomTheme;
|
||||
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
|
||||
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
|
||||
this.allowIdentities = oData.allowIdentities;
|
||||
|
@ -5815,12 +5816,6 @@ AdminGeneral.prototype.onBuild = function ()
|
|||
});
|
||||
});
|
||||
|
||||
self.allowCustomTheme.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowCustomTheme': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.allowAdditionalAccounts.subscribe(function (bValue) {
|
||||
RL.remote().saveAdminConfig(null, {
|
||||
'AllowAdditionalAccounts': bValue ? '1' : '0'
|
||||
|
@ -6847,7 +6842,6 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.mainLanguage(RL.settingsGet('Language'));
|
||||
this.mainTheme(RL.settingsGet('Theme'));
|
||||
|
||||
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
||||
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
||||
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
||||
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
|
||||
|
|
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
8
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1662,7 +1662,6 @@ Utils.initDataConstructorBySettings = function (oData)
|
|||
}
|
||||
});
|
||||
|
||||
oData.allowCustomTheme = ko.observable(false);
|
||||
oData.allowAdditionalAccounts = ko.observable(false);
|
||||
oData.allowIdentities = ko.observable(false);
|
||||
oData.allowGravatar = ko.observable(false);
|
||||
|
@ -1990,7 +1989,12 @@ Utils.disableSettingsViewModel = function (SettingsViewModelClass)
|
|||
|
||||
Utils.convertThemeName = function (sTheme)
|
||||
{
|
||||
return Utils.trim(sTheme.replace(/[^a-zA-Z]/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' '));
|
||||
if ('@custom' === sTheme.substr(-7))
|
||||
{
|
||||
sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7));
|
||||
}
|
||||
|
||||
return Utils.trim(sTheme.replace(/[^a-zA-Z]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' '));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3381,13 +3385,9 @@ ko.observable.fn.validateFunc = function (fFunc)
|
|||
function LinkBuilder()
|
||||
{
|
||||
this.sBase = '#/';
|
||||
this.sCdnStaticDomain = RL.settingsGet('CdnStaticDomain');
|
||||
this.sVersion = RL.settingsGet('Version');
|
||||
this.sSpecSuffix = RL.settingsGet('AuthAccountHash') || '0';
|
||||
|
||||
this.sServer = (RL.settingsGet('IndexFile') || './') + '?';
|
||||
this.sCdnStaticDomain = '' === this.sCdnStaticDomain ? this.sCdnStaticDomain :
|
||||
('/' === this.sCdnStaticDomain.substr(-1) ? this.sCdnStaticDomain : this.sCdnStaticDomain + '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3623,8 +3623,7 @@ LinkBuilder.prototype.exportContactsCsv = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.emptyContactPic = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/css/images/empty-contact.png';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/css/images/empty-contact.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3633,8 +3632,7 @@ LinkBuilder.prototype.emptyContactPic = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.sound = function (sFileName)
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/sounds/' + sFileName;
|
||||
return 'rainloop/v/' + this.sVersion + '/static/sounds/' + sFileName;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3643,8 +3641,14 @@ LinkBuilder.prototype.sound = function (sFileName)
|
|||
*/
|
||||
LinkBuilder.prototype.themePreviewLink = function (sTheme)
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/themes/' + encodeURI(sTheme) + '/images/preview.png';
|
||||
var sPrefix = 'rainloop/v/' + this.sVersion + '/';
|
||||
if ('@custom' === sTheme.substr(-7))
|
||||
{
|
||||
sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7));
|
||||
sPrefix = '';
|
||||
}
|
||||
|
||||
return sPrefix + 'themes/' + encodeURI(sTheme) + '/images/preview.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3652,8 +3656,7 @@ LinkBuilder.prototype.themePreviewLink = function (sTheme)
|
|||
*/
|
||||
LinkBuilder.prototype.notificationMailIcon = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/css/images/icom-message-notification.png';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/css/images/icom-message-notification.png';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3661,8 +3664,7 @@ LinkBuilder.prototype.notificationMailIcon = function ()
|
|||
*/
|
||||
LinkBuilder.prototype.openPgpJs = function ()
|
||||
{
|
||||
return ('' === this.sCdnStaticDomain ? 'rainloop/v/' : this.sCdnStaticDomain) +
|
||||
this.sVersion + '/static/js/openpgp.min.js';
|
||||
return 'rainloop/v/' + this.sVersion + '/static/js/openpgp.min.js';
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -14820,22 +14822,8 @@ function SettingsThemes()
|
|||
;
|
||||
|
||||
this.mainTheme = oData.mainTheme;
|
||||
this.customThemeType = ko.observable(RL.settingsGet('CustomThemeType'));
|
||||
this.customThemeImg = ko.observable(RL.settingsGet('CustomThemeImg'));
|
||||
|
||||
this.themesObjects = ko.observableArray([]);
|
||||
|
||||
this.customThemeUploaderProgress = ko.observable(false);
|
||||
this.customThemeUploaderButton = ko.observable(null);
|
||||
|
||||
this.showCustomThemeConfig = ko.computed(function () {
|
||||
return 'Custom' === this.mainTheme();
|
||||
}, this);
|
||||
|
||||
this.showCustomThemeConfig.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
});
|
||||
|
||||
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle).extend({'throttle': 100});
|
||||
|
||||
this.oLastAjax = null;
|
||||
|
@ -14861,7 +14849,7 @@ function SettingsThemes()
|
|||
if (sUrl)
|
||||
{
|
||||
sUrl = sUrl.toString().replace(/\/-\/[^\/]+\/\-\//, '/-/' + sValue + '/-/');
|
||||
sUrl = sUrl.toString().replace(/\/Css\/[^\/]+\/User\//, '/Css/' + ('Custom' === sValue && window.__rlah ? window.__rlah() || '0' : '0') + '/User/');
|
||||
sUrl = sUrl.toString().replace(/\/Css\/[^\/]+\/User\//, '/Css/0/User/');
|
||||
|
||||
if ('Json/' !== sUrl.substring(sUrl.length - 5, sUrl.length))
|
||||
{
|
||||
|
@ -14924,18 +14912,9 @@ function SettingsThemes()
|
|||
|
||||
Utils.addSettingsViewModel(SettingsThemes, 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
|
||||
SettingsThemes.prototype.removeCustomThemeImg = function ()
|
||||
{
|
||||
this.customThemeImg('');
|
||||
};
|
||||
|
||||
SettingsThemes.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sCurrentTheme = RL.data().theme()
|
||||
;
|
||||
|
||||
var sCurrentTheme = RL.data().theme();
|
||||
this.themesObjects(_.map(RL.data().themes(), function (sTheme) {
|
||||
return {
|
||||
'name': sTheme,
|
||||
|
@ -14944,96 +14923,8 @@ SettingsThemes.prototype.onBuild = function ()
|
|||
'themePreviewSrc': RL.link().themePreviewLink(sTheme)
|
||||
};
|
||||
}));
|
||||
|
||||
_.delay(function () {
|
||||
|
||||
self.customThemeType.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(function () {
|
||||
RL.data().theme.valueHasMutated();
|
||||
}, {
|
||||
'CustomThemeType': sValue
|
||||
});
|
||||
});
|
||||
|
||||
self.customThemeImg.subscribe(function (sValue) {
|
||||
RL.remote().saveSettings(function () {
|
||||
RL.data().theme.valueHasMutated();
|
||||
}, {
|
||||
'CustomThemeImg': sValue
|
||||
});
|
||||
});
|
||||
|
||||
}, 50);
|
||||
|
||||
this.initCustomThemeUploader();
|
||||
};
|
||||
|
||||
SettingsThemes.prototype.initCustomThemeUploader = function ()
|
||||
{
|
||||
if (this.customThemeUploaderButton())
|
||||
{
|
||||
var
|
||||
oJua = new Jua({
|
||||
'action': RL.link().uploadBackground(),
|
||||
'name': 'uploader',
|
||||
'queueSize': 1,
|
||||
'multipleSizeLimit': 1,
|
||||
'disableFolderDragAndDrop': true,
|
||||
'clickElement': this.customThemeUploaderButton()
|
||||
})
|
||||
;
|
||||
|
||||
oJua
|
||||
.on('onSelect', _.bind(function (sId, oData) {
|
||||
|
||||
var
|
||||
sFileName = Utils.isUnd(oData.FileName) ? '' : oData.FileName.toString(),
|
||||
sFileNameExt = sFileName.substring(sFileName.length - 4, sFileName.length),
|
||||
mSize = Utils.isNormal(oData.Size) ? Utils.pInt(oData.Size) : null
|
||||
;
|
||||
|
||||
if (-1 === Utils.inArray(sFileNameExt, ['jpeg', '.jpg', '.png']))
|
||||
{
|
||||
window.alert(Utils.i18n('SETTINGS_THEMES/ERROR_FILE_TYPE_ERROR'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (1024 * 1024 < mSize)
|
||||
{
|
||||
window.alert(Utils.i18n('SETTINGS_THEMES/ERROR_FILE_IS_TOO_BIG'));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}, this))
|
||||
.on('onStart', _.bind(function () {
|
||||
this.customThemeUploaderProgress(true);
|
||||
}, this))
|
||||
.on('onComplete', _.bind(function (sId, bResult, oData) {
|
||||
if (!bResult || !oData || !oData.Result)
|
||||
{
|
||||
window.alert(
|
||||
oData && oData.ErrorCode ? Utils.getUploadErrorDescByCode(oData.ErrorCode) : Utils.getUploadErrorDescByCode(Enums.UploadErrorCode.Unknown)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.customThemeImg(oData.Result);
|
||||
}
|
||||
|
||||
this.customThemeUploaderProgress(false);
|
||||
}, this))
|
||||
;
|
||||
|
||||
|
||||
return !!oJua;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
@ -15186,7 +15077,6 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
this.mainLanguage(RL.settingsGet('Language'));
|
||||
this.mainTheme(RL.settingsGet('Theme'));
|
||||
|
||||
this.allowCustomTheme(!!RL.settingsGet('AllowCustomTheme'));
|
||||
this.allowAdditionalAccounts(!!RL.settingsGet('AllowAdditionalAccounts'));
|
||||
this.allowIdentities(!!RL.settingsGet('AllowIdentities'));
|
||||
this.allowGravatar(!!RL.settingsGet('AllowGravatar'));
|
||||
|
|
18
rainloop/v/0.0.0/static/js/app.min.js
vendored
18
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,4 +0,0 @@
|
|||
|
||||
html.backgroundsize .thm-body {
|
||||
background-size: 100%;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 719 B |
BIN
themes/LinenNew/images/background.jpg
Normal file
BIN
themes/LinenNew/images/background.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
BIN
themes/LinenNew/images/background.png
Normal file
BIN
themes/LinenNew/images/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
themes/LinenNew/images/preview.png
Normal file
BIN
themes/LinenNew/images/preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
|
@ -2,7 +2,7 @@
|
|||
// MAIN
|
||||
@main-color: #333;
|
||||
@main-background-color: #eee;
|
||||
@main-background-image: link;
|
||||
@main-background-image: "images/background.jpg";
|
||||
|
||||
// LOADING
|
||||
@loading-color: #000;
|
||||
|
@ -20,10 +20,10 @@
|
|||
@dropdown-menu-background-color: #fff;
|
||||
@dropdown-menu-hover-background-color: #757575;
|
||||
@dropdown-menu-hover-color: #eee;
|
||||
@dropdown-menu-disabled-color: #999;
|
||||
@dropdown-menu-disable-color: #999;
|
||||
|
||||
// FOLDERS
|
||||
@folders-color: #000;
|
||||
@folders-color: #333;
|
||||
@folders-disabled-color: #999;
|
||||
@folders-selected-color: #eee;
|
||||
@folders-selected-background-color: #757575;
|
||||
|
@ -39,7 +39,7 @@
|
|||
@folders-drop-rgba-background-color: rgba(0,0,0,0.5);
|
||||
|
||||
// SETTINGS
|
||||
@settings-menu-color: #000;
|
||||
@settings-menu-color: #333;
|
||||
@settings-menu-disabled-color: #999;
|
||||
@settings-menu-selected-color: #eee;
|
||||
@settings-menu-selected-background-color: #757575;
|
||||
|
@ -52,7 +52,3 @@
|
|||
@message-list-toolbar-background-color: #eee;
|
||||
@message-list-toolbar-gradient-start: #f4f4f4;
|
||||
@message-list-toolbar-gradient-end: #dfdfdf;
|
||||
|
||||
// MESSAGE
|
||||
@message-background-color: #fff;
|
||||
@message-rgba-background-color: rgba(255,255,255,0.95);
|
BIN
themes/Red/images/preview.png
Normal file
BIN
themes/Red/images/preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 961 B |
0
themes/Red/styles.less
Normal file
0
themes/Red/styles.less
Normal file
Loading…
Reference in a new issue