1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
(function callee(arg){
/* JS counterpart of info.c:output_text_with_line_numbers()
which ties an event handler to the line numbers to allow
selection of individual lines or ranges. */
var tbl = arg || document.querySelectorAll('table.numbered-lines');
if(!tbl) return;
else if(tbl.length>1){
tbl.forEach( (t)=>callee(t) );
return;
}else{
tbl = tbl[0];
}
const tdLn = tbl.querySelector('td'),
urlArgs = (window.location.search||'').replace(/&?\bln=[^&]*/,'');
console.debug("urlArgs =",urlArgs);
tdLn.addEventListener('click', function f(ev){
if(!f.selectedRange){
f.selectedRange = [0,0];
|
|
|
>
|
|
|
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
(function callee(arg){
/* JS counterpart of info.c:output_text_with_line_numbers()
which ties an event handler to the line numbers to allow
selection of individual lines or ranges. */
var tbl = arg || document.querySelectorAll('table.numbered-lines');
if(!tbl) return /* no matching elements */;
else if(!arg){
if(tbl.length>1){ /* multiple query results: recurse */
tbl.forEach( (t)=>callee(t) );
return;
}else{/* single query result */
tbl = tbl[0];
}
}
const tdLn = tbl.querySelector('td'),
urlArgs = (window.location.search||'').replace(/&?\bln=[^&]*/,'');
console.debug("urlArgs =",urlArgs);
tdLn.addEventListener('click', function f(ev){
if(!f.selectedRange){
f.selectedRange = [0,0];
|