Thread: [Codestriker-commits] CVS update: codestriker/template/en/default createproject.html.tmpl createtopi
Brought to you by:
sits
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=8012688&action=view User: sits Date: 05/02/21 03:25:35 Modified: . codestriker.conf lib/Codestriker/Action ViewTopic.pm lib/Codestriker/Http Render.pm Response.pm lib/Codestriker/Model Comment.pm template/en/default createproject.html.tmpl createtopic.html.tmpl editproject.html.tmpl header.html.tmpl listprojects.html.tmpl listtopics.html.tmpl metricsreport.html.tmpl search.html.tmpl submitnewcomment.html.tmpl submitnewtopic.html.tmpl viewtopic.html.tmpl viewtopiccomments.html.tmpl viewtopicheader.html.tmpl viewtopicinfo.html.tmpl viewtopicproperties.html.tmpl Added: html codestriker.js xbdhtml.js Log: Store the comment data in javascript-land as well, which allows the comment tooltips to navigate between the different comments, using some overlib and CSS-P magic. Still needs some more work, but this is a good start. Eventually, we should be able to add a comment via overlib as well, perhaps within an IFRAME. Index: codestriker.conf =================================================================== RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- codestriker.conf 21 Dec 2004 22:44:22 -0000 1.68 +++ codestriker.conf 21 Feb 2005 11:25:00 -0000 1.69 @@ -1,8 +1,10 @@ # -*-perl-*- # Configuration file for codestriker.pl. -# Database to use for storing codestriker data. Examples given are -# Oracle, SQL Server, PostgreSQL and MySQL. +# Database to use for storing codestriker data. Examples given are +# Oracle, SQL Server, PostgreSQL and MySQL. Refer to the +# documentation on how to create the Codestriker database. + #$db = 'DBI:Oracle:host=127.0.0.1;sid=local'; #$db = 'DBI:ODBC:Codestriker'; #$db = 'DBI:Pg:dbname=codestrikerdb'; @@ -64,7 +66,7 @@ # end of this string when URLs are generated. This can be left blank if # there is no need for bug-tracking integration. $bugtracker = ''; -#$bugtracker = 'http://localhost.localdomain/show_bug.cgi?id='; +$bugtracker = 'http://localhost.localdomain/bugzilla/show_bug.cgi?id='; # Valid repositories which may be selected at the create topic screen. # The order shown here is the order presented in the option list. Most @@ -294,8 +296,8 @@ # $bug_db to "bugzilla", and set the following parameters to your setup. # if the $bug_db is an empty string, all bug-tracking related features will # be disabled. -$bug_db = ''; -#$bug_db = 'bugzilla'; +#$bug_db = ''; +$bug_db = 'bugzilla'; # Bug database connection details. $bug_db_host = 'localhost'; Index: codestriker.js =================================================================== RCS file: codestriker.js diff -N codestriker.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ codestriker.js 21 Feb 2005 11:25:05 -0000 1.1 @@ -0,0 +1,65 @@ +// Global settings for overLIB. +ol_fgcolor = '#FFFFCC'; +ol_textsize = '2'; + +// Records what topicid is being processed. +var topicid = ''; + +// Handle to the popup window. +var windowHandle = ''; + +function myOpen(url,name) { + windowHandle = window.open(url,name, + 'toolbar=no,width=800,height=600,status=yes,scrollbars=yes,resizable=yes,menubar=no'); + // Indicate who initiated this operation. + windowHandle.opener = window; + + windowHandle.focus(); +} + +// Edit open function. Name is kept short to reduce output size. +function eo(fn,line,newfile) { + var location = window.location; + myOpen(location.protocol + '//' + location.host + + location.pathname + '?fn=' + fn + '&line=' + line + + '&new=' + newfile + '&topic=' + topicid + '&action=edit&a=' + + fn + '|' + line + '|' + newfile, 'e'); +} + +function gotoAnchor(anchor, reload) { + if (anchor == "" || opener == null) return; + + var index = opener.location.href.lastIndexOf("#"); + if (index != -1) { + opener.location.href = + opener.location.href.substr(0, index) + "#" + anchor; + } + else { + opener.location.href += "#" + anchor; + } + + if (reload) opener.location.reload(reload); + opener.focus(); +} + +// Called by a body onload handler for the view topic page, to tooltip +// the comment associated with an anchor that has comments made +// against it. +function view_topic_on_load_handler() +{ + // If the URL loaded contains an anchor, check if there is a comment + // associated with it. + var anchor = window.location.hash; + if (anchor != null) { + // Remove the leading # character. + anchor = anchor.substr(1); + var comment_number = comment_hash[anchor]; + if (comment_number != null) { + // We have a comment on this line, bring up the tooltip. + overlib(comment_text[comment_number], STICKY, + FIXX, getEltPageLeft(getElt('c' + comment_number)), + FIXY, getEltPageTop(getElt('c' + comment_number))); + } + } +} + Index: xbdhtml.js =================================================================== RCS file: xbdhtml.js diff -N xbdhtml.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ xbdhtml.js 21 Feb 2005 11:25:05 -0000 1.1 @@ -0,0 +1,913 @@ +/* xbdhtml.js (Cross-Browser Nav4/Gecko/IE DHTML API) + 14 May 98, Eric Krock, Copyright Netscape Communications + Permission is granted to reuse, redistribute, and modify + without charge. + + Updated 18 July 2000 by Vladimir Ermakov, Netscape Communications, + and Marcell Ortutay, Plugged in Enterprises, to include support of + the new Netscape Gecko layout engine. + + Updated 15 of February 2001 by Vladimir Ermakov, Netscape Communications: + New Features + -showElt/hideElt -convenience functions to use insead of setEltVisibility + -setEltWidth/setEltHeight -Set the width/height of a layer + -getEltPageLeft/getEltPageTop -XBrowser version of Nav4 pageX/pageY + -stringToNumber -Returns 0 instead of NaN + Improved: + -getEltWidth/getEltHeight -Return offsetWidth if width not specified. + -Also, where possible, replaced detection by browser with detection by property + + Updated October 02, 2001 by Bob Clary, Netscape Communications + Misc + - changed reference to Ultimate Browser Sniffer on mozilla.org + Bugs Fixed + - hideElt -fixed missing argument to setEltVisibility + - getEltPageTop -added marginTop for IE5/Mac + + Makes CSSP functionality and properties of positioned, named + elements accessible from JavaScript in Netscape 4.x, IE and user + agents implementing Gecko layout engine offering a single set of functions which + can be used on both browsers, bridging DOM differences. + + Allows you to do these things from JavaScript on Nav4+/IE4+/Gecko: + - get element object by specifying its name + - hide/show element + - get/set X, Y, Z position of element + - get element height/width + - get/set clipping area (visible area) of element + - get/set background color and background image of element + + Also includes simplified JavaScript client sniffer and + functions to ease dynamic, conditional generation of HTML + markup via document.write() statements. + + Design goals: + - forwardly compatible with future DOM enhancements + - redefinable stub function API + - coexist peacefully with other libraries + - no function name conflicts with cbdhtml.js, etc. + - keep # of functions reasonable and use parameters to specify values + - naming convention for functions easy to learn and remember + - make as short as possible to type + - loadable (though not executable!) without error on Nav3 since Nav3 + sometimes loads <SCRIPT LANGUAGE="JavaScript1.2" SRC=___.js> + - usable in part or in whole; don't have to use whole thing + - can copy and paste individual functions into existing code + Exceptions to this rule: + 1) you must include Is() constructor function and an + instance of "is" global variable; all functions depend on this. + 2) getEltBackgroundColor depends on the color-related functions; + to use it, you must include the others as well; + 3) all the functions for getting the clipping area + (getEltClipLeft getEltClipTop getEltClipRight + getEltClipBottom getEltClipWidth getEltClipHeight) + depend on tempClipObj for use on IE4. + + Usage notes: + - Place the SCRIPT element which links to this JavaScript file, xbdhtml.js, + before your own SCRIPT which calls its functions. + + Example of correct usage: in the HEAD, place this HTML markup: + + <!-- This external script defines cross-browser functions for + accessing CSSP and element properties. --> + <SCRIPT LANGUAGE="JavaScript1.2" SRC=xbdhtml.js> </SCRIPT> + <!-- Make your function calls to manipulate elements in this + SCRIPT, now that the functions have been loaded. --> + <SCRIPT LANGUAGE="JavaScript1.2"><!-- + //-*** put your function calls here *** + //--></SCRIPT> +*/ + + +// This is a simplified version of the JavaScript Client Sniffer code +// found at http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html + +function Is () +{ // convert all characters to lowercase to simplify testing + var agt=navigator.userAgent.toLowerCase() + + // --- BROWSER VERSION --- + this.major = stringToNumber(navigator.appVersion) + this.minor = parseFloat(navigator.appVersion) + + this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) + && (agt.indexOf('compatible') == -1))) + this.nav2 = (this.nav && (this.major == 2)) + this.nav3 = (this.nav && (this.major == 3)) + this.nav4 = (this.nav && (this.major == 4)) + + //Netscape 6 + this.nav5 = (this.nav && (this.major == 5)) + this.nav6 = (this.nav && (this.major == 5)) + this.gecko = (this.nav && (this.major >= 5)) + + this.ie = (agt.indexOf("msie") != -1) + this.ie3 = (this.ie && (this.major == 2)) + this.ie4 = (this.ie && (this.major == 3)) + this.ie5 = (this.ie && (this.major == 4)) + + + this.opera = (agt.indexOf("opera") != -1) + + this.nav4up = this.nav && (this.major >= 4) + this.ie4up = this.ie && (this.major >= 4) +} + + +var is = new Is(); + +// Convenience functions to ease dynamic/conditional markup +// generation depending upon browser vendor/version/OS. + +// convenience function to save typing out document.write("STRING"); +// if optional second argument minVersion passed in, +// only write if >= that version; +// if optional third argument maxVersion passed in, +// only execute if <= that version; + +function dw(str, minVersion, maxVersion) +{ if ( ((dw.arguments.length < 3) || (is.major <= maxVersion)) + && ((dw.arguments.length < 2) || (is.major >= minVersion))) + document.write(str) +} + + + +// document write boolean +// convenience function to save typing out +// if (aBoolean) document.write("STRING"); +// if optional second argument aBoolean passed in, only write if +// aBoolean is true. + +function dwb (str, aBoolean) +{ if ((dwb.arguments.length < 2) || aBoolean) + document.write(str) +} + + + +// string version: +// convenience function to return str or "" depending on version; +// if optional second argument version passed in, +// only return str if >= that version; +// if optional third argument maxVersion passed in, +// only return str if <= that version; + +function sv(str, minVersion, maxVersion) +{ if ( ((sv.arguments.length < 3) || (is.major <= maxVersion)) + && ((sv.arguments.length < 2) || (is.major >= minVersion))) + return str; + else return ""; +} + + + +// string boolean +// convenience function to save typing out +// (aBoolean)?"STRING":"" +// if optional second argument aBoolean passed in, only return +// str if aBoolean is true, else return "". + +function sb (str, aBoolean) +{ if ((sb.arguments.length < 2) || aBoolean) + return str; + else return ""; +} + + + + +/* The following stub function API for cross-browser HTML + element positioning and visibility (CSSP access) was + derived from Mike Hall's excellent CBDHTML API. + + Thanks also to Danny Goodman (http://www.dannyg.com/) + and Dan Steinman (http://members.xoom.com/dynduo/). + + USAGE NOTE: when using the functions which get element CSSP + properties [getEltLeft, getEltTop, etc.], keep in mind the + following IE4 CSSP property initialization problem: if you + initialize a property value by CSSP markup, e.g.: + #foo { left: 100px } + rather than initializing them from JavaScript, e.g.: + var fooElt = getElt ("foo"); + setEltLeft (fooElt, 100); + ... the property value for the element's JavaScript style + object (i.e. document.all.foo.style.left) is not set to the + initial value! This is true for a number of IE4 style object + properties including left, top, and clip. Before you get one of these + properties in IE4, you must first set it from JavaScript. + Workaround: set the property via JavaScript instead of CSSP + markup, or set it from both to the same value. +*/ + + +/* functions genElt, writeElt, and layerClipOrder + + Sometimes dynamically generating markup which is optimized for the + current browser will simplify development. genElt will generate + a named DIV on IE4 and Netscape6, and a LAYER/ILAYER tag on Nav4 as a string. + writeElt will create the same string and write it out. + + These three functions must be reused as a group. writeElt calls + genElt, and those two both call layerClipOrder. + + ARGUMENTS OF FUNCTIONS genElt AND writeElt + + genElt and writeElt have identical argument lists. + + The first argument, name, is required. All of the other arguments + default to false and can be explicitly set to false or + omitted. Those properties will be hard coded into the HTML markup + if the argument is provided, and left unset if the argument is set + to false or omitted. + + For example, both of these function calls have the same effect. + They will generate a named, positioned element but not specify + any of the properties, and will write out + the element and content even on Nav3/IE3 and earlier: + writeElt ("foo"); + writeElt ("foo", false, false, false); + + name STRING. Name of element's ID. + content STRING. Content written within element. + left INTEGER. Left edge of element in pixels. + top INTEGER. Top edge of element in pixels. + z INTEGER. z-index of element. + width INTEGER. width in pixels. + height INTEGER. height in pixels. + visibility STRING. "visible", "hidden", or "inherit". + backgroundColor STRING. Background color of element. + backgroundImage STRING. Background image of element. + clip STRING. Comma-delimited list (no spaces!) of 4 + integers in top-right-bottom-left order. Sets clip. + relative BOOLEAN. If true, position relatively, else absolutely. + On Nav4, this determines whether LAYER (absolute) or + ILAYER (relative) is generated. + hideEltOnOlderBrowsers BOOLEAN. If true, return '' on Nav3, IE3, and older. + useDivInsteadOfLayer BOOLEAN. If true, generate DIV on Nav4 not I/LAYER. + classname STRING. CLASS attribute value for element. + + 'genElt' is short for 'generate element markup'. +*/ + +/* maps css order <top>,<right>,<bottom>,<left> to + LAYER CLIP= order <left>,<top>,<right>,<bottom> */ +function layerClipOrder (cssClipString) +{ var commaPos = cssClipString.lastIndexOf(","); + return (cssClipString.substring(commaPos+1) + "," + cssClipString.substring(0,commaPos)); +} + +function genElt (name, content, left, top, z, width, height, visibility, + backgroundColor, backgroundImage, clip, relative, + hideEltOnOlderBrowsers, useDivInsteadOfLayer, classname) +{ var markup = ""; + if (is.gecko) + { + markup = '<DIV ID="' + name + '"' + + ((classname)?' CLASS="' + classname + '"':'') + + ' STYLE="position:' + ((relative)?'relative;':'absolute;') + + ' overflow:none;' + + ((left)?' left:' + left + 'px;':'') + + ((top)?' top:' + top + 'px;':'') + + ((height)?' height:' + height + 'px;':'') + + ((width)?' width:' + width + 'px;':'') + + ((visibility && (visibility!='')) ? ' visibility:' + visibility + ';' : '') + + ((z)?' z-index:' + z + ';':'') + + ((backgroundColor)?' background-color:' + backgroundColor + ';':'') + + ((backgroundImage)?' background-image:url("' + backgroundImage + '");':'') + + ((clip)?' clip:rect("' + clip + '");':'') + + '">' + ((content)?content:'') + '</DIV>'; + } + + else if (is.nav && (is.major == 4 || !hideEltOnOlderBrowsers) && + !useDivInsteadOfLayer) + { var tagname = (relative)?'ILAYER':'LAYER'; + if (visibility && (visibility!='')) + { if (visibility=="hidden") visibility = "hide"; + else if (visibility=="visible") visibility = "show"; + } + markup = '<' + tagname + ' ID="' + name + '"' + ((classname)?' CLASS="' + + classname + '"':'') + ((left)?' LEFT="' + left + '"':'') + + ((top)?' TOP="' + top + '"':'') + ((width)?' WIDTH="' + width + '"':'') + + ((height)?' HEIGHT="' + height + '"':'') + + ((visibility && (visibility!='')) ? ' VISIBILITY="' + visibility + '"' : '') + + ((z)?' Z-INDEX="' + z + '"':'') + + ((backgroundColor)?' BGCOLOR="' + backgroundColor + '"':'') + + ((backgroundImage)?' BACKGROUND="' + backgroundImage + '"':'') + + ((clip)?' CLIP="' + layerClipOrder(clip) + '"':'') + + '>' + ((content)?content:'') + '</' + tagname + '>'; + } + + else if ((is.ie || (is.nav && useDivInsteadOfLayer)) && (is.major>=4 || !hideEltOnOlderBrowsers)) + { markup = '<DIV ID="' + name + '"' + + ((classname)?' CLASS="' + classname + '"':'') + + ' STYLE="position:' + ((relative)?'relative;':'absolute;') + + ' overflow:none;' + + ((left)?' left:' + left + 'px;':'') + + ((top)?' top:' + top + 'px;':'') + + ((height)?' height:' + height + 'px;':'') + + ((width)?' width:' + width + 'px;':'') + + ((visibility && (visibility!='')) ? ' visibility:' + visibility + ';' : '') + + ((z)?' z-index:' + z + ';':'') + + ((backgroundColor)?' background-color:' + backgroundColor + ';':'') + + ((backgroundImage)?' background-image:url("' + backgroundImage + '");':'') + + ((clip)?' clip:rect("' + clip + '");':'') + + '">' + ((content)?content:'') + '</DIV>'; + } + + return markup; +} + +function writeElt (name, content, left, top, z, width, height, visibility, + backgroundColor, backgroundImage, clip, relative, + hideEltOnOlderBrowsers, useDivInsteadOfLayer, classname) +{ if (writeElt.arguments.length < 15) classname = false; + if (writeElt.arguments.length < 14) useDivInsteadOfLayer = false; + if (writeElt.arguments.length < 13) hideEltOnOlderBrowsers = false; + if (writeElt.arguments.length < 12) relative = false; + if (writeElt.arguments.length < 11) clip = false; + if (writeElt.arguments.length < 10) backgroundImage = false; + if (writeElt.arguments.length < 9) backgroundColor = false; + if (writeElt.arguments.length < 8) visibility = false; + if (writeElt.arguments.length < 7) height = false; + if (writeElt.arguments.length < 6) width = false; + if (writeElt.arguments.length < 5) z = false; + if (writeElt.arguments.length < 4) top = false; + if (writeElt.arguments.length < 3) left = false; + if (writeElt.arguments.length < 2) content = false; + document.write (genElt (name, content, left, top, z, width, height, visibility, + backgroundColor, backgroundImage, clip, relative, + hideEltOnOlderBrowsers, useDivInsteadOfLayer, classname)); +} + + +/* CALLING SYNTAX: each Name is a string which is an element's + ID attribute value or a LAYER tag's NAME attribute value. + + getElt (topLevelElementName, childElementName, grandchildElementName ... + targetElementName) + + Example of getting a top-level element: + var fooElement = getElt ("foo") + + Example of getting a nested element: + var fooElement = getElt ("bar", "baz", "foo") + ... where baz is foo's containing parent, and bar is a top-level + element which is baz's containing parent. +*/ + +function getElt () +{ if (is.nav4) + { + var currentLayer = document.layers[getElt.arguments[0]]; + for (var i=1; i<getElt.arguments.length && currentLayer; i++) + { currentLayer = currentLayer.document.layers[getElt.arguments[i]]; + } + return currentLayer; + } + else if(document.getElementById && document.getElementsByName) + { + var name = getElt.arguments[getElt.arguments.length-1]; + if(document.getElementById(name)) //First try to find by id + return document.getElementById(name); + else if (document.getElementsByName(name)) //Then if that fails by name + return document.getElementsByName(name)[0]; + } + else if (is.ie4up) { + var elt = eval('document.all.' + getElt.arguments[getElt.arguments.length-1]); + return(elt); + } + +} + +function showElt(elt) +{ + setEltVisibility(elt,'visible'); +} + +function hideElt(elt) +{ + setEltVisibility(elt, 'hidden'); +} + +/* value must be "visible", "hidden", or "inherit". + These values work on Nav4, Gecko and IE for setting visibility. +*/ +function setEltVisibility (elt, value) +{ if (is.nav4) elt.visibility = value; + else if (elt.style) elt.style.visibility = value; +} + + + +/* Return values are strings "visible", "hidden", or "inherit". + This is consistent with CSS1 and IE4 usage and the settable + values on all three browsers. Note that Nav4 + by default returns "show" and "hide" and that these values + are mapped to "visible" and "hidden" to provide consistent + return values across browsers. */ + +function getEltVisibility (elt) +{ if (is.nav4) + { var value = elt.visibility; + if (value == "show") return "visible"; + else if (value == "hide") return "hidden"; + else return value; + } + else if (elt.style) return elt.style.visibility; +} + + + +/* Move elt to pixel location x,y within its coordinate system, + which is the window content area for top-level elements or + the parent element's coordinates for nested elements which + have an absolutely positioned parent. +*/ + +function moveEltTo (elt, x, y) +{ if (is.nav4) elt.moveTo(x, y); + else if (is.ie4up) { + elt.style.pixelLeft = x; + elt.style.pixelTop = y; + } + else if (is.gecko) { + elt.style.left = x; + elt.style.top = y; + } +} + + +/* Offset elt's pixel location by x,y pixels. */ + +function moveEltBy (elt, x, y) +{ if (is.nav4) elt.moveBy(x, y); + else if (is.ie4up) { + elt.style.pixelLeft += x; + elt.style.pixelTop += y; + } + else if (is.gecko) { + elt.style.left = (stringToNumber(elt.style.left) + x + "px"); + elt.style.top = (stringToNumber(elt.style.top) + y + "px"); + } +} + +/* xbrowser pageX equivalent*/ +function getEltPageLeft(elt) { + var x; + + if (is.nav4) + return elt.pageX; + if (is.ie4up) { + x = 0; + while (elt.offsetParent != null) { + x += elt.offsetLeft; + elt = elt.offsetParent; + } + x += elt.offsetLeft; + return x; + } + if (is.gecko) { + x = 0; + while (elt.offsetParent != null) { + x += elt.offsetLeft; + elt = elt.offsetParent; + } + x += elt.offsetLeft; + return x; + } + return -1; +} + +/* xbrowser pageY equivalent */ +function getEltPageTop(elt) { + var y = 0; + + if (is.nav4) + return elt.pageY; + if (is.ie4up) { + while (elt.offsetParent != null) { + y += elt.offsetTop; + elt = elt.offsetParent; + } + y += elt.offsetTop; + return y; + } + + /* ie5/mac modification added per comment from David Weingard */ + if (is.mac && is.ie5) + { + y += stringToNumber(document.body.currentStyle.marginTop); + } + + if (is.gecko) { + while (elt.offsetParent != null) { + y += elt.offsetTop; + elt = elt.offsetParent; + } + y += elt.offsetTop; + return y; + } + return -1; +} + +/* Sets position of left edge of elt in pixels. */ +function setEltLeft (elt, x) { + if (is.nav4) elt.left=x; + else if (is.ie4up) elt.style.pixelLeft=x; + else if (is.gecko) elt.style.left = (x + "px"); +} + + +/* Returns left edge of elt in pixels. */ +function getEltLeft (elt) { + if (is.nav4) return (elt.left); + else if (is.ie4up) return (elt.style.pixelLeft); + else if (is.gecko) return stringToNumber(elt.style.left); +} + +/* Sets top edge of elt in pixels. */ +function setEltTop (elt, y) +{ if (is.nav4) elt.top=y; + else if (is.ie4up) elt.style.pixelTop=y; + else if (is.gecko) elt.style.top= (y + "px"); +} + +/* Returns top edge of elt in pixels. */ +function getEltTop (elt) +{ if (is.nav4) return (elt.top); + else if (is.ie4up) return (elt.style.pixelTop); + else if (is.gecko) return stringToNumber(elt.style.top); +} + +/* Returns width of elt in pixels. */ +function getEltWidth(elt) { + + if (is.nav4) { + if (elt.document.width) + return elt.document.width; + else + return elt.clip.right - elt.clip.left; + } + if (is.ie4up) { + if (elt.style.pixelWidth) + return elt.style.pixelWidth; + + else + return elt.offsetWidth; + } + if (is.gecko) { + if (elt.style.width) + return stringToNumber(elt.style.width); + else + return stringToNumber(elt.offsetWidth); + } + return -1; +} + +/* set width of elt in pixels */ +function setEltWidth(elt,wdth) +{ + if(is.nav4) + { + elt.document.width = wdth; + } + else if(elt.style) + { + elt.style.width = wdth; + } +} + +/* Returns height of elt in pixels. */ +function getEltHeight(elt) { + if (is.nav4) { + if (elt.document.height) + return elt.document.height; + else + return elt.clip.bottom - elt.clip.top; + } + if (is.ie4up) { + if (elt.style.pixelHeight) + return elt.style.pixelHeight; + else + return elt.clientHeight; + } + if (is.gecko) { + if (elt.style.height) + return stringToNumber(elt.style.height); + else + return stringToNumber(elt.offsetHeight); + } + return -1; +} + +/* set width of elt in pixels */ + +function setEltHeight(elt,hght) +{ + if(is.nav4) + { + elt.document.height = hght; + } + else if(elt.style) + { + elt.style.height = hght; + } +} + +/* Sets element clipping area. + NOTE ORDER: top, right, bottom, left to be consistent with CSS usage. + cliptop, clipright, clipbottom, and clipleft are integers. +*/ +function setEltClip (elt, cliptop, clipright, clipbottom, clipleft) +{ if (is.nav4) { + elt.clip.left = clipleft; + elt.clip.top = cliptop; + elt.clip.right = clipright; + elt.clip.bottom = clipbottom; + } + else if (is.ie4up) elt.style.clip = 'rect(' + cliptop + ' ' + + clipright + ' ' + clipbottom + ' ' + clipleft +')'; + else if (is.gecko) elt.style.clip = 'rect(' + cliptop + ' ' + + clipright + ' ' + clipbottom + ' ' + clipleft +')'; +} + +/* utility function for IE only -- does not use regular expressions + in order to avoid triggering syntax error if parsed by Nav3 */ +function tempClipObj (elt) +{ var clipStr = elt.style.clip; + + clipStr = clipStr.substring (clipStr.indexOf("(") + 1); + this.top = stringToNumber(clipStr); + clipStr = clipStr.substring (clipStr.indexOf(" ") + 1); + this.right = stringToNumber(clipStr); + clipStr = clipStr.substring (clipStr.indexOf(" ") + 1); + this.bottom = stringToNumber(clipStr); + clipStr = clipStr.substring (clipStr.indexOf(" ") + 1); + this.left = stringToNumber(clipStr); +} + +/* Returns left edge of clipping area of elt in pixels. */ +function getEltClipLeft (elt) +{ if (is.nav4) return (elt.clip.left); + else if (elt.style) + { var tempClip = new tempClipObj (elt); + return tempCli... [truncated message content] |