コード例 #1
0
ファイル: Branding.js プロジェクト: falu/rainloop-webmail
	/**
	 * @constructor
	 */
	function BrandingAdminSettings()
	{
		var
			Enums = require('Common/Enums'),
			Settings = require('Storage/Settings'),
			AppStore = require('Stores/Admin/App')
		;

		this.capa = AppStore.prem;

		this.title = ko.observable(Settings.settingsGet('Title'));
		this.title.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.loadingDesc = ko.observable(Settings.settingsGet('LoadingDescription'));
		this.loadingDesc.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.loginLogo = ko.observable(Settings.settingsGet('LoginLogo') || '');
		this.loginLogo.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.loginBackground = ko.observable(Settings.settingsGet('LoginBackground') || '');
		this.loginBackground.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.userLogo = ko.observable(Settings.settingsGet('UserLogo') || '');
		this.userLogo.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.userLogoMessage = ko.observable(Settings.settingsGet('UserLogoMessage') || '');
		this.userLogoMessage.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.userLogoTitle = ko.observable(Settings.settingsGet('UserLogoTitle') || '');
		this.userLogoTitle.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.loginDescription = ko.observable(Settings.settingsGet('LoginDescription'));
		this.loginDescription.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.loginCss = ko.observable(Settings.settingsGet('LoginCss'));
		this.loginCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.userCss = ko.observable(Settings.settingsGet('UserCss'));
		this.userCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.welcomePageUrl = ko.observable(Settings.settingsGet('WelcomePageUrl'));
		this.welcomePageUrl.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.welcomePageDisplay = ko.observable(Settings.settingsGet('WelcomePageDisplay'));
		this.welcomePageDisplay.trigger = ko.observable(Enums.SaveSettingsStep.Idle);

		this.welcomePageDisplay.options = ko.computed(function () {
			Translator.trigger();
			return [
				{'optValue': 'none', 'optText': Translator.i18n('TAB_BRANDING/OPTION_WELCOME_PAGE_DISPLAY_NONE')},
				{'optValue': 'once', 'optText': Translator.i18n('TAB_BRANDING/OPTION_WELCOME_PAGE_DISPLAY_ONCE')},
				{'optValue': 'always', 'optText': Translator.i18n('TAB_BRANDING/OPTION_WELCOME_PAGE_DISPLAY_ALWAYS')}
			];
		});

		this.loginPowered = ko.observable(!!Settings.settingsGet('LoginPowered'));

		this.community = RL_COMMUNITY || AppStore.community();
	}
コード例 #2
0
ファイル: About.js プロジェクト: 2km/rainloop-webmail
	constructor() {
		this.version = ko.observable(appSettingsGet('version'));
		this.access = ko.observable(!!settingsGet('CoreAccess'));
		this.errorDesc = ko.observable('');

		this.coreReal = CoreStore.coreReal;
		this.coreChannel = CoreStore.coreChannel;
		this.coreType = CoreStore.coreType;
		this.coreUpdatable = CoreStore.coreUpdatable;
		this.coreAccess = CoreStore.coreAccess;
		this.coreChecking = CoreStore.coreChecking;
		this.coreUpdating = CoreStore.coreUpdating;
		this.coreWarning = CoreStore.coreWarning;
		this.coreVersion = CoreStore.coreVersion;
		this.coreRemoteVersion = CoreStore.coreRemoteVersion;
		this.coreRemoteRelease = CoreStore.coreRemoteRelease;
		this.coreVersionCompare = CoreStore.coreVersionCompare;

		this.community = RL_COMMUNITY || AppStore.community();

		this.coreRemoteVersionHtmlDesc = ko.computed(() => {
			translatorTrigger();
			return i18n('TAB_ABOUT/HTML_NEW_VERSION', {'VERSION': this.coreRemoteVersion()});
		});

		this.statusType = ko.computed(() => {
			let type = '';
			const
				versionToCompare = this.coreVersionCompare(),
				isChecking = this.coreChecking(),
				isUpdating = this.coreUpdating(),
				isReal = this.coreReal();

			if (isChecking)
			{
				type = 'checking';
			}
			else if (isUpdating)
			{
				type = 'updating';
			}
			else if (isReal && 0 === versionToCompare)
			{
				type = 'up-to-date';
			}
			else if (isReal && -1 === versionToCompare)
			{
				type = 'available';
			}
			else if (!isReal)
			{
				type = 'error';
				this.errorDesc('Cannot access the repository at the moment.');
			}

			return type;
		});
	}
コード例 #3
0
ファイル: Plugins.js プロジェクト: Rona111/rainloop-webmail
	/**
	 * @constructor
	 */
	function PluginsAdminSettings()
	{
		this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins'));

		this.plugins = PluginStore.plugins;
		this.pluginsError = PluginStore.plugins.error;

		this.community = RL_COMMUNITY || AppStore.community();

		this.visibility = ko.computed(function () {
			return PluginStore.plugins.loading() ? 'visible' : 'hidden';
		}, this);

		this.onPluginLoadRequest = _.bind(this.onPluginLoadRequest, this);
		this.onPluginDisableRequest = _.bind(this.onPluginDisableRequest, this);
	}
コード例 #4
0
ファイル: About.js プロジェクト: Rudloff/rainloop-webmail
/**
 * @constructor
 */
function AboutAdminSettings()
{
	this.version = ko.observable(Settings.appSettingsGet('version'));
	this.access = ko.observable(!!Settings.settingsGet('CoreAccess'));
	this.errorDesc = ko.observable('');

	this.coreReal = CoreStore.coreReal;
	this.coreChannel = CoreStore.coreChannel;
	this.coreType = CoreStore.coreType;
	this.coreUpdatable = CoreStore.coreUpdatable;
	this.coreAccess = CoreStore.coreAccess;
	this.coreChecking = CoreStore.coreChecking;
	this.coreUpdating = CoreStore.coreUpdating;
	this.coreWarning = CoreStore.coreWarning;
	this.coreVersion = CoreStore.coreVersion;
	this.coreRemoteVersion = CoreStore.coreRemoteVersion;
	this.coreRemoteRelease = CoreStore.coreRemoteRelease;
	this.coreVersionCompare = CoreStore.coreVersionCompare;

	this.community = RL_COMMUNITY || AppStore.community();

	this.coreRemoteVersionHtmlDesc = ko.computed(function() {
		Translator.trigger();
		return Translator.i18n('TAB_ABOUT/HTML_NEW_VERSION', {'VERSION': this.coreRemoteVersion()});
	}, this);

	this.statusType = ko.computed(function() {

		var
			sType = '',
			iVersionCompare = this.coreVersionCompare(),
			bChecking = this.coreChecking(),
			bUpdating = this.coreUpdating(),
			bReal = this.coreReal();

		if (bChecking)
		{
			sType = 'checking';
		}
		else if (bUpdating)
		{
			sType = 'updating';
		}
		else if (bReal && 0 === iVersionCompare)
		{
			sType = 'up-to-date';
		}
		else if (bReal && -1 === iVersionCompare)
		{
			sType = 'available';
		}
		else if (!bReal)
		{
			sType = 'error';
			this.errorDesc('Cannot access the repository at the moment.');
		}

		return sType;

	}, this);
}