Added "[labs] startup_url" setting

This commit is contained in:
RainLoop Team 2015-05-16 00:15:22 +04:00
parent 9a98bff931
commit 28d93f70ae
4 changed files with 13 additions and 3 deletions

View file

@ -225,6 +225,7 @@
{ {
var var
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
sStartupUrl = Utils.pString(Settings.settingsGet('StartupUrl')),
sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')), sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')),
bInIframe = !!Settings.settingsGet('InIframe') bInIframe = !!Settings.settingsGet('InIframe')
; ;
@ -234,6 +235,7 @@
if (bLogout) if (bLogout)
{ {
sStartupUrl = '';
this.clearClientSideToken(); this.clearClientSideToken();
} }
@ -242,6 +244,11 @@
window.close(); window.close();
} }
if (bAdmin)
{
sStartupUrl = '';
}
sCustomLogoutLink = sCustomLogoutLink || (bAdmin ? Links.rootAdmin() : Links.rootUser()); sCustomLogoutLink = sCustomLogoutLink || (bAdmin ? Links.rootAdmin() : Links.rootUser());
if (bLogout && window.location.href !== sCustomLogoutLink) if (bLogout && window.location.href !== sCustomLogoutLink)
@ -260,7 +267,7 @@
else else
{ {
kn.routeOff(); kn.routeOff();
kn.setHash(Links.root(), true); kn.setHash(Links.root(sStartupUrl), true);
kn.routeOff(); kn.routeOff();
_.delay(function () { _.delay(function () {

View file

@ -39,11 +39,12 @@
}; };
/** /**
* @param {string=} sStartupUrl
* @return {string} * @return {string}
*/ */
Links.prototype.root = function () Links.prototype.root = function (sStartupUrl)
{ {
return this.sBase; return this.sBase + Utils.pString(sStartupUrl);
}; };
/** /**

View file

@ -1354,6 +1354,7 @@ class Actions
'AllowAppendMessage' => (bool) $oConfig->Get('labs', 'allow_message_append', false), 'AllowAppendMessage' => (bool) $oConfig->Get('labs', 'allow_message_append', false),
'MaterialDesign' => (bool) $oConfig->Get('labs', 'use_material_design', true), 'MaterialDesign' => (bool) $oConfig->Get('labs', 'use_material_design', true),
'FolderSpecLimit' => (int) $oConfig->Get('labs', 'folders_spec_limit', 50), 'FolderSpecLimit' => (int) $oConfig->Get('labs', 'folders_spec_limit', 50),
'StartupUrl' => \trim(\ltrim(\trim($oConfig->Get('labs', 'startup_url', '')), '#/')),
'Community' => true, 'Community' => true,
'PremType' => false, 'PremType' => false,
'Admin' => array(), 'Admin' => array(),

View file

@ -320,6 +320,7 @@ Enables caching in the system'),
'fast_cache_memcache_port' => array(11211), 'fast_cache_memcache_port' => array(11211),
'fast_cache_memcache_expire' => array(43200), 'fast_cache_memcache_expire' => array(43200),
'use_local_proxy_for_external_images' => array(false), 'use_local_proxy_for_external_images' => array(false),
'startup_url' => array(''),
'dev_email' => array(''), 'dev_email' => array(''),
'dev_password' => array('') 'dev_password' => array('')
), ),