/* * rhwebimport * * Copyright (C) 2014-2015 Christian Pointner * * This file is part of rhwebimport. * * rhwebimport is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * rhwebimport is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with rhwebimport. If not, see . */ var apps_current; function apps_select(app) { switch(app) { case "musicpools": $('#app-shows').hide(); $('#nav-btn-shows').removeClass('active'); $('#app-jingles').hide(); $('#nav-btn-jingles').removeClass('active'); $('#app-musicpools').show(); $('#nav-btn-musicpools').addClass('active'); musicpools_init(); break; case "jingles": $('#app-shows').hide(); $('#nav-btn-shows').removeClass('active'); $('#app-musicpools').hide(); $('#nav-btn-musicpools').removeClass('active'); $('#app-jingles').show(); $('#nav-btn-jingles').addClass('active'); musicpools_init(); break; default: $('#app-jingles').hide(); $('#nav-btn-jingles').removeClass('active'); $('#app-musicpools').hide(); $('#nav-btn-musicpools').removeClass('active'); $('#app-shows').show(); $('#nav-btn-shows').addClass('active'); apps_current = 'shows'; shows_init(); } sessionStorage.setItem("apps_current", app); } function apps_init() { apps_current = sessionStorage.getItem("apps_current"); if(auth_token && auth_username) { apps_select(apps_current); } } function apps_cleanup() { shows_cleanup(); jingles_cleanup(); musicpools_cleanup(); sessionStorage.removeItem("apps_current"); delete apps_current; }