summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-09-18 20:05:54 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-09-18 20:05:54 (GMT)
commit81f0c232dff0a2232d697834a5b6d9bff94c3681 (patch)
tree63f92c0f835c7a4ea9d4d325a694030e5de07aa4 /index.html
parent3b0e5ec6227f1b4ab89a1e7a11a2b6f190ec0a73 (diff)
added support apps
Diffstat (limited to 'index.html')
-rw-r--r--index.html49
1 files changed, 45 insertions, 4 deletions
diff --git a/index.html b/index.html
index b5504e7..12b32a9 100644
--- a/index.html
+++ b/index.html
@@ -23,6 +23,7 @@
<script type="text/javascript">
var username = sessionStorage.getItem("username");
var token = sessionStorage.getItem("token");
+ var app = sessionStorage.getItem("app");
alertbox = function() {}
alertbox.warning = function (heading, message) {
@@ -35,24 +36,50 @@
$('#alertbox').html('<div class="alert alert-info"><a class="close" data-dismiss="alert" href="#">&times;</a><h4 class="alert-heading">' + heading + '</h4>' + message + '</div>');
}
+ function selectApp(app) {
+ switch(app) {
+ case "musicpools":
+ $('#app-shows').hide();
+ $('#nav-btn-shows').removeClass('active');
+ $('#app-musicpools').show();
+ $('#nav-btn-musicpools').addClass('active');
+ break;
+ default:
+ $('#app-shows').show();
+ $('#nav-btn-shows').addClass('active');
+ $('#app-musicpools').hide();
+ $('#nav-btn-musicpools').removeClass('active');
+ app = 'shows';
+ }
+ sessionStorage.setItem("app", app);
+ }
+
function authSuccess(data) {
if (data.status == 'OK') {
username = data.username;
sessionStorage.setItem("username", username);
+
token = data.token;
sessionStorage.setItem("token", token);
+ selectApp('shows');
+
$('#username-field').html(username);
$('#loginbox').slideUp();
$('#mainwindow').fadeIn();
} else {
alertbox.error("Fehler beim Login", data.errorstring);
+
sessionStorage.removeItem("username");
delete username;
$("#username").val('').focus();
+
sessionStorage.removeItem("token");
delete token;
$("#password").val('');
+
+ sessionStorage.removeItem("app");
+ delete app;
}
}
@@ -83,6 +110,8 @@
delete username;
sessionStorage.removeItem("token");
delete token;
+ sessionStorage.removeItem("app");
+ delete app;
$(".alert").alert('close');
$("#username").val('');
@@ -124,8 +153,8 @@
<span class="brand">Radio Helsinki - Import</span>
<div class="nav-collapse">
<ul class="nav">
- <li class="active"><a href="#">Sendungen</a></li>
- <li><a href="#">Musikpools</a></li>
+ <li id="nav-btn-shows"><a href="#" onclick="selectApp('shows')">Sendungen</a></li>
+ <li id="nav-btn-musicpools"><a href="#" onclick="selectApp('musicpools')">Musikpools</a></li>
</ul>
<form id="logoutform" class="navbar-form pull-right">
<span class="navbar-text">angmeldet als <strong id="username-field">UNKNOWN</strong></span>&nbsp;&nbsp;
@@ -138,10 +167,10 @@
</div>
</div>
- <div class="container-fluid">
+ <div id="app-shows" class="container-fluid">
<div class="span12">
<div class="hero-unit">
- <h1>Hello, world!</h1>
+ <h1>Sendungen</h1>
<p>
This is a template for a simple marketing or informational website.
It includes a large callout called the hero unit and three supporting
@@ -152,6 +181,17 @@
</div>
</div>
+ <div id="app-musicpools" class="container-fluid">
+ <div class="span12">
+ <div class="hero-unit">
+ <h1>Musikpools</h1>
+ <p>
+ coming soon!
+ </p>
+ </div>
+ </div>
+ </div>
+
</div>
</div>
@@ -159,6 +199,7 @@
<script type="text/javascript">
$("#loginform").submit(function(event) { login(); event.preventDefault(); });
$('#username-field').html(username);
+ selectApp('shows');
if(token && username) {
$("#loginbox").hide();
} else {