|
From: Jon O. <jon...@us...> - 2008-06-27 18:44:10
|
Update of /cvsroot/mxbb/mx_bugsbt/bugsbt/shared/XulTabs In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10700/XulTabs Added Files: XulTabs.css.php XulTabs.js Log Message: cvs weirness, i had to readd all these files... --- NEW FILE: XulTabs.js --- // +--------------------------------------------------------------------+ // | DO NOT REMOVE THIS | // +--------------------------------------------------------------------+ // | XulTabs.js | // | Automatic tabs creation. | // +--------------------------------------------------------------------+ // | Author: Cezary Tomczak [www.gosu.pl] | // | Project: SimpleDoc | // | URL: http://gosu.pl/php/simpledoc.html | // | License: GPL | // +--------------------------------------------------------------------+ function XulTabs(id) { this.init = function() { this.parse(document.getElementById(this.id).childNodes); if (this.tabs != this.data) { alert("XulTabs.init() failed, tabs="+this.tabs+", data="+this.data); } }; this.parse = function(nodes) { for (var i = 0; i < nodes.length; i++) { if (nodes[i].nodeType != 1) { continue; } if (/tab/.test(nodes[i].className)) { nodes[i].id = this.id+"-"+this.tabs; nodes[i].onclick = click; this.tabs++; } if (/data/.test(nodes[i].className)) { nodes[i].id = this.id+"-"+this.data+"-data"; this.data++; } if (nodes[i].childNodes) { this.parse(nodes[i].childNodes); } } }; this.show = function(id) { this.hide(); document.getElementById(id).className = document.getElementById(id).className.replace(/tab/, "tab-active"); document.getElementById(id+"-data").style.display = "block"; this.active = id; }; this.hide = function() { if (this.active) { document.getElementById(this.active).className = document.getElementById(this.active).className.replace(/tab-active/, "tab"); document.getElementById(this.active+"-data").style.display = "none"; this.active = ""; } }; function click() { self.show(this.id); this.blur(); } var self = this; this.id = id; this.active = ""; this.tabs = 0; this.data = 0; } --- NEW FILE: XulTabs.css.php --- /* SimpleDoc [www.gosu.pl], style for tabs */ .XulTabs .wrap1 { height: 23px; } .XulTabs .wrap1 td { vertical-align: bottom; } .XulTabs .tab, .XulTabs .tab:hover, .XulTabs .tab-active, .XulTabs .tab-active:hover { text-decoration: none; padding: 3px 10px 3px 10px; border-top: 1px solid #91A7B4; border-left: 1px solid #919B9C; color: #000000; cursor: default; white-space: nowrap; display: block; } .XulTabs .tab:hover { border-top: 2px solid #FFC73C; padding-top: 2px; } .XulTabs .tab-active, .XulTabs .tab-active:hover { border-top: 3px solid #FFC73C; padding-top: 2px; padding-bottom: 4px; font-weight: bold; } .XulTabs .view { border-right: 1px solid #919B9C; } .XulTabs .content { border: 1px solid #919B9C; background: #ffffff; width: 100%; height: 100%; } .XulTabs .wrap2 { vertical-align: top; padding: 15px; } .XulTabs .data { display: none; } * html .XulTabs .tab, * html .XulTabs .tab:hover, * html .XulTabs .tab-active, * html .XulTabs .tab-active:hover { width: 100%; } |