Skip to content

Instantly share code, notes, and snippets.

@mayli
Last active October 17, 2019 00:10
Show Gist options
  • Save mayli/d349360df3a5c738ee0ebcccb980cf03 to your computer and use it in GitHub Desktop.
Save mayli/d349360df3a5c738ee0ebcccb980cf03 to your computer and use it in GitHub Desktop.
opengrok jump to line
// ==UserScript==
// @name Opengrok jump to line
// @namespace http://tampermonkey.net/
// @version 0.1
// @description does it work?
// @author You
// @include /^https?://opengrok.*$/
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @updateUrl https://gist.github.com/mayli/d349360df3a5c738ee0ebcccb980cf03/raw/351ada4d06837c1ee2218894e57587961eecc5b3/opengrok.user.js
// @downloadUrl https://gist.github.com/mayli/d349360df3a5c738ee0ebcccb980cf03/raw/351ada4d06837c1ee2218894e57587961eecc5b3/opengrok.user.js
// ==/UserScript==
var $ = window.jQuery;
$(document).ready(function() {
var line = window.location.href.split("#")[1];
if(line) {
$("a[name='" + line + "']").get(0).scrollIntoView();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment