[Mapbender-commits] r5963 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Apr 15 10:36:17 EDT 2010
Author: christoph
Date: 2010-04-15 10:36:15 -0400 (Thu, 15 Apr 2010)
New Revision: 5963
Added:
trunk/mapbender/http/plugins/mb_tabs_horizontal.js
Log:
refactoring
Added: trunk/mapbender/http/plugins/mb_tabs_horizontal.js
===================================================================
--- trunk/mapbender/http/plugins/mb_tabs_horizontal.js (rev 0)
+++ trunk/mapbender/http/plugins/mb_tabs_horizontal.js 2010-04-15 14:36:15 UTC (rev 5963)
@@ -0,0 +1,53 @@
+/**
+ * Package: mb_tabs_horizontal
+ *
+ * Description:
+ *
+ * Puts existing elements into horizontal tabs, using jQuery UI tabs.
+ * List the elements comma-separated under target, and make sure they
+ * have a title.
+ *
+ * Files:
+ * - http/plugins/mb_tabs_horizontal.js
+ *
+ * SQL:
+ * > INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment,
+ * > e_title, e_element, e_src, e_attributes, e_left, e_top, e_width,
+ * > e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file,
+ * > e_mb_mod, e_target, e_requires, e_url) VALUES('<appId>',
+ * > 'mb_tabs_horizontal',1,1,'Puts existing elements into horizontal tabs, using jQuery UI tabs. List the elements comma-separated under target, and make sure they have a title.',
+ * > '','div','','',NULL ,NULL ,NULL ,NULL ,NULL ,'','<ul></ul>','div',
+ * > '../plugins/mb_tabs_horizontal.js','','mb_metadata_select','jq_ui_tabs',
+ * > '');
+ *
+ * Help:
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License
+ * and Simplified BSD license.
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
+
+var $tabs = $(this);
+options.$target.each(function () {
+ var $currentTabEntry = $(this);
+ var tabId = $tabs.attr("id") + "_" + this.id;
+
+ $tabs.find("ul").append(
+ "<li><a href='#" + tabId + "'>" +
+ $currentTabEntry.mapbender("currentTitle") +
+ "</a></li>"
+ )
+ .end()
+ .append("<div id='" + tabId + "'/>")
+ .find("#" + tabId)
+ .append($currentTabEntry);
+});
+
+if (options.$target.size() > 0) {
+ $tabs.tabs();
+}
More information about the Mapbender_commits
mailing list