Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Annotate strips away URL anchor #715

Closed
vladak opened this issue Jan 3, 2014 · 2 comments
Closed

Annotate strips away URL anchor #715

vladak opened this issue Jan 3, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@vladak
Copy link
Member

vladak commented Jan 3, 2014

When browsing a page at certain line (e.g. http://grok/source/xref/OpenGrok/web/more.jsp#44) and clicking on Annotate link the anchor gets lost and top of the file is displayed instead of displaying the line which was previously selected. The resulting URL is in the form of http://grok/source/xref/OpenGrok/web/more.jsp?a=true&h=44 so there was some attempt to preserve the line however it does not work.

@vladak
Copy link
Member Author

vladak commented Jan 3, 2014

If I modify utils.js to use this:

function get_annotations() {
    link = document.link +  "?a=true";
    if (document.rev.length > 0) {
        link += '&' + document.rev;
    }
    hash = "&h=" + window.location.hash.substring(1, window.location.hash.length);
    window.location = link + hash + '#' + window.location.hash.substring(1, window.location.hash.length);
}

then it works.

@vladak
Copy link
Member Author

vladak commented Jan 3, 2014

Actually, the bug is elsewhere - the hash is being passed correctly and saved to document however the retrieval is wrong:

mast.jsp:

76%><body>
77<script type="text/javascript">/* <![CDATA[ */
78    document.hash = '<%= cfg.getDocumentHash()

retrieves the h= parameter value from the URI.

utils.js should retrieve it:

53function domReadyMast() {
54    var h = document.locHash;   <<< !!!!

however Jens left the old name of the variable there, it should match mast.jsp.

@ghost ghost assigned vladak Jan 3, 2014
@vladak vladak closed this as completed in e6b0a01 Jan 3, 2014
@tarzanek tarzanek modified the milestone: 0.12 Apr 8, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants