From b9ad279ad2d8d93dd501115a028783cf8fe7fcbd Mon Sep 17 00:00:00 2001 From: Adam Young Date: Wed, 19 Jan 2011 12:26:14 -0500 Subject: rename static to ui Directory rename --- install/ui/navigation.js | 149 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 install/ui/navigation.js (limited to 'install/ui/navigation.js') diff --git a/install/ui/navigation.js b/install/ui/navigation.js new file mode 100644 index 00000000..7ae5b656 --- /dev/null +++ b/install/ui/navigation.js @@ -0,0 +1,149 @@ +/*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 . +*/ + +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 = $('