<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>project/build/src/XRay.scala</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
 project/boot/
 target/
 src/test/
+src_managed/</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
-#Project Properties
-#Fri Apr 10 10:46:15 EDT 2009
+#Project properties
+#Wed Apr 22 08:06:46 EDT 2009
+project.organization=sxr
 project.name=sxr
-project.organization=empty
-scala.version=2.7.3
-project.version=0.1
 sbt.version=0.4.3
+project.version=0.1
+scala.version=2.7.3</diff>
      <filename>project/build.properties</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,8 @@
 .int { color: #008080; }
 .comment { color: gray; font-style: italic; }
 
-/* to highlight the target of a clicked link*/
-:target
+/* to highlight a reference or definition */
+:target, .highlighted
 {
 	background: #FFaaaa;
 }
@@ -34,4 +34,4 @@
 	background: #D4E1EC;
 	border: 1px solid #B5BFC9;
 	z-index: 10000;
-}
\ No newline at end of file
+}</diff>
      <filename>src/main/resources/default-style.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,115 +1,27 @@
-function initializeLinked()
-{
-	foreachElementWithID(&quot;a&quot;, addHandlers)
-	foreachLink(null, addHandlers)
-}
-function addHandlers(element)
-{
-	if(element &amp;&amp; !element.onmouseout)
-	{
-		element.onmouseout = outHandler
-		element.onmouseover = overHandler
-	}
-}
-
-function overHandler(e)
-{
-	highlight(e, &quot;#FFaaaa&quot;)
-}
-function outHandler(e)
-{
-	highlight(e, &quot;transparent&quot;)
-}
-function highlight(e, color)
-{
-	var element = getTarget(e)
-	while(element.id || element.href)
-	{
-		var definition = getDefinition(element)
-		if(definition)
-			highlightDefinition(definition, color)
-		else
-		{
-			var referenced = getReference(element)
-			if(referenced)
-				highlightReferences(referenced, color)
-		}
-		element = element.parentNode
-	}
-}
-function getReference(element)
-{
-	return element.id
-}
-function getDefinition(element)
-{
-	var href = element.href
-	if(href)
-	{
-		var idIndex = href.lastIndexOf('#')
-		if(idIndex)
-			return href.slice(idIndex+1)
-		else
-			return null
-	}
-	else
-		return null
-}
-function highlightDefinition(id, color)
-{
-	setBackground(document.getElementById(id), color)
-}
-function highlightReferences(id, color)
-{
-	foreachLink(id,
-		function (linkElement) { setBackground(linkElement, color) }
+$(function() {
+	$(&quot;[id]&quot;).live(&quot;mouseover&quot;,
+		function() { $(this).references().highlight() }
+	).live(&quot;mouseout&quot;,
+		function() { $(this).references().unhighlight() }
 	)
-}
-function foreachLink(id, f)
-{
-	var linkElement, i, href, links
-	if(id)
-		href = '#' + id
-	else
-		href = null
-	links = document.links
-	for(i = 0; linkElement = links[i]; i++)
-	{
-		if(!href || endsWith(linkElement.href, href))
-			f(linkElement)
-	}
-}
-//base.endsWith(check)
-function endsWith(base, check)
-{
-	var checkLength, baseLength
-	checkLength = check.length
-	baseLength = base.length
-	return checkLength &lt;= baseLength &amp;&amp; base.slice(baseLength - checkLength) === check
-}
-function foreachElementWithID(elementName, f)
-{
-	var element, i, elements
-	elements = document.getElementsByTagName(elementName)
-	for(i = 0; element = elements[i]; i++)
-	{
-		if(element.id)
-			f(element)
+	$(&quot;a[href^='#']&quot;).live(&quot;mouseover&quot;,
+		function() { $(this).definition().highlight() }
+	).live(&quot;mouseout&quot;,
+		function() { $(this).definition().unhighlight() }
+	)
+})
+
+jQuery.fn.extend({
+	definition: function() {
+		return $(&quot;#&quot; + /#(\d+)$/.exec(this.attr('href'))[1])
+	},
+	references: function() {
+		return $(&quot;a[href$='#&quot; + this.attr('id') +&quot;']&quot;)
+	},
+	highlight:	function() {
+		return this.addClass(&quot;highlighted&quot;);
+	},
+	unhighlight: function() {
+		return this.removeClass(&quot;highlighted&quot;);
 	}
-}
-function setBackground(element, color)
-{
-	if(element)
-		element.style.background = color
-}
-// function getTarget from http://www.quirksmode.org !
-function getTarget(e)
-{
-	var targ;
-	if (!e) var e = window.event;
-	if (e.target) targ = e.target;
-	else if (e.srcElement) targ = e.srcElement;
-	if (targ.nodeType == 3) // defeat Safari bug
-		targ = targ.parentNode;
-	return targ;
-}
\ No newline at end of file
+})</diff>
      <filename>src/main/resources/linked.js</filename>
    </modified>
    <modified>
      <diff>@@ -32,8 +32,10 @@ abstract class Browse extends Plugin
 	{
 		val cssFile = new File(outputDirectory, CSSRelativePath)
 		val jsFile = new File(outputDirectory, JSRelativePath)
+		val jQueryFile = new File(outputDirectory, JQueryRelativePath)
 		writeDefaultCSS(cssFile)
 		writeJS(jsFile)
+		writeJQuery(jQueryFile)
 		var outputFiles = List[File]()
 		for(unit &lt;- currentRun.units)
 		{
@@ -43,13 +45,14 @@ abstract class Browse extends Plugin
 			outputFiles ::= outputFile
 			val relativizedCSSPath = FileUtil.relativePath(outputFile, cssFile)
 			val relativizedJSPath = FileUtil.relativePath(outputFile, jsFile)
+			val relativizedJQueryPath = FileUtil.relativePath(outputFile, jQueryFile)
 
 			// generate the tokens
 			val tokens = scan(unit)
 			val traverser = new Traverse(tokens, unit.source)
 			traverser(unit.body)
 
-			val styler = new BasicStyler(tokens, relativeSourcePath, relativizedCSSPath, relativizedJSPath)
+			val styler = new BasicStyler(tokens, relativeSourcePath, relativizedCSSPath, relativizedJSPath, relativizedJQueryPath)
 			Annotate(sourceFile, outputFile, tokens, styler)
 		}
 		val indexFile = new File(outputDirectory, IndexRelativePath)
@@ -337,15 +340,23 @@ object Browse
 	val CSSRelativePath = &quot;style.css&quot;
 	/** The location to store the script relative to the output directory.*/
 	val JSRelativePath = &quot;linked.js&quot;
+
+	val jquery_version = &quot;1.3.2&quot;
+	/** The location to store jQuery relative to the output directory.*/
+	val JQueryRelativePath = &quot;jquery-&quot; + jquery_version + &quot;.min.js&quot;
 	/** The path of the default style sheet resource.*/
 	val DefaultCSS = &quot;/default-style.css&quot;
 	/** The path of the default script resource.*/
 	val LinkedJS = &quot;/linked.js&quot;
+	/** The path of the default script resource.*/
+	val LinkedJQuery = &quot;/&quot; + JQueryRelativePath
 	
 	/** Copies the default style sheet available as a resource on the classpath to the file 'to'.*/
 	def writeDefaultCSS(to: File) { FileUtil.writeResource(DefaultCSS, to) }
 	/** Copies the default script available as a resource on the classpath to the file 'to'.*/
 	def writeJS(to: File) { FileUtil.writeResource(LinkedJS, to) }
+	/** Copies the jQuery script available as a resource on the classpath to the file 'to'.*/
+	def writeJQuery(to: File) { FileUtil.writeResource(LinkedJQuery, to) }
 	
 	def writeIndex(to: File, files: Iterable[File])
 	{</diff>
      <filename>src/main/scala/Browse.scala</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ object Classes
 {
 	val Keyword = &quot;keyword&quot;
 }
-private class BasicStyler(tokens: TreeSet[Token], title: String, baseStyle: String, baseJs: String) extends Styler
+private class BasicStyler(tokens: TreeSet[Token], title: String, baseStyle: String, baseJs: String, baseJQuery: String) extends Styler
 {
 	Collapse(tokens)
 	
@@ -29,10 +29,11 @@ private class BasicStyler(tokens: TreeSet[Token], title: String, baseStyle: Stri
 			|&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 			|    &lt;head&gt;
 			|        &lt;title&gt;&quot;&quot;&quot; + title + &quot;&quot;&quot;&lt;/title&gt;
+			|        &lt;script type=&quot;text/javascript&quot; src=&quot;&quot;&quot; + '&quot;' + baseJQuery + '&quot;' + &quot;&quot;&quot;&gt;&lt;/script&gt;
 			|        &lt;script type=&quot;text/javascript&quot; src=&quot;&quot;&quot; + '&quot;' + baseJs + '&quot;' + &quot;&quot;&quot;&gt;&lt;/script&gt;
 			|        &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&quot;&quot; + '&quot;' + baseStyle + '&quot;' + &quot;&quot;&quot; title=&quot;Style&quot;&gt;
 			|    &lt;/head&gt;
-			|    &lt;body onload=&quot;initializeLinked()&quot;&gt;
+			|    &lt;body&gt;
 			|        &lt;pre&gt;
 			|&quot;&quot;&quot;).stripMargin
 	def tail =</diff>
      <filename>src/main/scala/Styler.scala</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bdb2e7996c62fac2358e5c8e7a2dbc4727564e61</id>
    </parent>
  </parents>
  <author>
    <name>Mark Harrah</name>
    <email>dmharrah@gmail.com</email>
  </author>
  <url>http://github.com/harrah/browse/commit/8a0041dcfa80efe689d351cb1099e8a6bb2a4177</url>
  <id>8a0041dcfa80efe689d351cb1099e8a6bb2a4177</id>
  <committed-date>2009-04-22T05:25:39-07:00</committed-date>
  <authored-date>2009-04-22T05:25:39-07:00</authored-date>
  <message>Nathan's patches for using jQuery</message>
  <tree>6b88fada65b69ebd37323c19ee1018757592585a</tree>
  <committer>
    <name>Mark Harrah</name>
    <email>dmharrah@gmail.com</email>
  </committer>
</commit>
