/*jsl:import ipa.js */ /* 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, either version 3 of the License, or * (at your option) any later version. * * 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, see . */ IPA.nav = { tabs_lists : {}, nav_container : {}, push_state : function (params) { if (!IPA.test_dirty()){ return false; } $.bbq.pushState(params); return true; }, get_state : function (key) { return $.bbq.getState(key, true); }, remove_state : function (key) { $.bbq.removeState(key); }, create : function (nls, container, tabclass) { if (!container) container = $('#navigation'); if (!tabclass) tabclass = 'tabs'; IPA.nav.tabs_lists = nls; IPA.nav.nav_container = container; IPA.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; return IPA.nav.push_state(state); } }); IPA.nav.update_tabs(); }, generate_tabs : function (nls, container, tabclass, depth) { container.addClass(tabclass); container.addClass('tabs'+depth); var ul = $('