diff options
Diffstat (limited to 'sca-cpp/trunk/modules/edit/htdocs/menu.html')
-rw-r--r-- | sca-cpp/trunk/modules/edit/htdocs/menu.html | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/edit/htdocs/menu.html b/sca-cpp/trunk/modules/edit/htdocs/menu.html index 6346075df3..0b9b7ddd8a 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/menu.html +++ b/sca-cpp/trunk/modules/edit/htdocs/menu.html @@ -51,12 +51,25 @@ function appname() { return ui.queryParams()['app']; } +/** + * Return the link to an app. + */ +function applink(appname) { + var protocol = window.location.protocol; + var host = window.location.hostname; + var port = ':' + window.location.port; + if (port == ':80' || port == ':443' || port == ':') + port = ''; + var link = protocol + '//' + appname + '.' + host + port + '/'; + return link; +} + // Display the menu bar var mdiv = $('menu'); var name = appname(); mdiv.innerHTML = ui.menubar( append(mklist(ui.menu('Home', '/'), ui.menu('Store', '/store'), ui.menu('Dashboard', '/dash')), - (isNil(name) || name == 'undefined')? mklist() : mklist(ui.menu('Composition', '/graph/?app=' + name), ui.menu('Page', '/page/?app=' + name), ui.menu('Settings', '/props/?app=' + name))), + (isNil(name) || name == 'undefined')? mklist() : mklist(ui.menu('Composition', '/graph/?app=' + name), ui.menu('Page', '/page/?app=' + name), ui.menu('Settings', '/props/?app=' + name), ui.menu(name + '.' + window.location.hostname, applink(name), '_' + name))), mklist(userMenu(), ui.menu('Account', '/account'), ui.menu('Sign out', '/logout'))); </script> |