/* Authors: * Pavel Zuna * * Copyright (C) 2010 Red Hat * see file 'COPYING' for use and warranty information * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; version 2 only * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ var nav_tabs_lists; var nav_container; function nav_push_state(params) { $.bbq.pushState(params); } function nav_get_state(key) { return $.bbq.getState(key, true); } function nav_remove_state(key) { $.bbq.removeState(key); } function nav_create(nls, container, tabclass) { if (!container) container = $('#navigation'); if (!tabclass) tabclass = 'tabs'; nav_tabs_lists = nls; nav_container = container; nav_generate_tabs(nls, container, tabclass, 1); var tabs = $('.' + tabclass); tabs.tabs({ select: function(event, ui) { var panel = $(ui.panel); var parent = panel.parent(); var id = parent.attr('id'); var state = {}; state[id] = ui.index; nav_push_state(state); return true; } }); nav_update_tabs(); } function nav_generate_tabs(nls, container, tabclass, depth) { container.addClass(tabclass); container.addClass('tabs'+depth); var ul = $('