Closed Bug 1007293 Opened 10 years ago Closed 8 years ago

"Blame" link should scroll to selected line

Categories

(Webtools Graveyard :: DXR, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: new_one)

References

()

Details

(Whiteboard: mxr-parity)

Attachments

(1 file)

39 bytes, text/x-github-pull-request
Details | Review
When I click "Blame", I'd like the blame page to scroll to the same line (selected by being the search result, or explicitly by clicking a line number).

MXR does this:
<a href="http://hg.mozilla.org/mozilla-central/annotate/4e4e0f502969/js/src/builtin/TestingFunctions.cpp#l24" onfocus="updateHgBlameHash(this, event)" onmouseover="updateHgBlameHash(this, event)">Hg Blame</a>
This is a really annoying papercut. I tried to look into fixing it, but I can't figure out (a) how to run dxr locally without running the indexing backend, and (b) how to cleanly add this because the 'navigation' box is in a plugin, and there are no plugins that provide js functionality, and so I'm not sure how to integrate it 'correctly'.
I just rewrite all the DXR documentation, including a good page on getting started developing. I think this is the bit you need: http://dxr.readthedocs.org/en/latest/development.html#running-a-test-index. (If you already found this and it was confusing, please let me know.)

As for JS, feel free to edit the core JS files: panel.js is probably the most appropriate place to put nav panel changes. The easiest path forward is probably to have the omniglot plugin return "javascript:..." for the href of the blame link and have that call some panel.js code. Sorry for the delay getting back to you on this; your patches are most welcome.
Using "javascript:..." as the href won't play well with "Open link in new tab". mxr's approach (update onfocus / onmouseover) seems better to me.
Good point. You can just register the onwhatever listeners in navpanel.js; jQuery should make it easy to do nothing if the links aren't there.
Blocks: 1097091
No longer blocks: 1097091
Whiteboard: mxr-parity
OS: Mac OS X → All
Hardware: x86_64 → All
I forgot to take the bug before I started work on it; here's a link to my pull request. https://github.com/mozilla/dxr/pull/448
Assignee: nobody → peter.elmers
Status: NEW → ASSIGNED
Attached file updated patch
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: