Permalink
Browse files

Now mouse over will highlight, but will not scroll the other window.

  • Loading branch information...
1 parent b44f118 commit 17b0dafaa16a518533bbea44c2920f24101ca111 @yinwang0 committed Jul 22, 2011
Showing with 18 additions and 5 deletions.
  1. +5 −2 README
  2. +13 −3 nav-div.js
View
@@ -3,8 +3,11 @@
yDiff is implemented in Scheme. The Scheme implementation I'm using is Racket.
You can find it from http://racket-lang.org.
-yDiff supports multiple languages but currently it is not cleanly modularized
-for different languages, and there is no Unix command line interface. In order
+yDiff supports multiple languages but currently it is not
+cleanly modularized for different languages. There are
+global parameters, which I should remove later.
+
+There is no Unix command line interface. In order
to use it, you need to load the 'diff-<lang>.ss' files in the Racket repl before
invoking the diff-<lang> functions. For example:
View
@@ -201,7 +201,7 @@ function clearHighlight() {
* Highlight the link, target nodes and their lines,
* then start animation to move the other window to match.
*/
-function highlight(me, linkId, targetId, linkLineId, targetLineId)
+function highlight(me, linkId, targetId, linkLineId, targetLineId, doMatch)
{
if (me.id === 'left') {
matchId1 = linkId;
@@ -218,7 +218,9 @@ function highlight(me, linkId, targetId, linkLineId, targetLineId)
putHighlight(linkLineId, lineHLColor);
putHighlight(targetLineId, lineHLColor);
- matchWindow(linkId, targetId, nSteps);
+ if (doMatch) {
+ matchWindow(linkId, targetId, nSteps);
+ }
}
@@ -257,7 +259,15 @@ window.onload =
var lid = t.id
var tid = t.getAttribute('tid')
var container = getContainer(t)
- highlight(container, lid, tid, 'ignore', 'ignore')
+ highlight(container, lid, tid, 'ignore', 'ignore', false)
+ }
+ tags[i].onclick =
+ function (e) {
+ var t = getTarget(e)
+ var lid = t.id
+ var tid = t.getAttribute('tid')
+ var container = getContainer(t)
+ highlight(container, lid, tid, 'ignore', 'ignore', true)
}
}

0 comments on commit 17b0daf

Please sign in to comment.