- Timestamp:
- 10/26/08 22:31:31 (2 months ago)
- Files:
-
- 1 modified
-
util/smartlinks.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
util/smartlinks.pl
r22739 r22778 148 148 return false; 149 149 } 150 151 function toggle_hilite(id,url) { 152 var el = document.getElementById(id); 153 if(el) { 154 if(el.style.display == "none") { 155 el.src = url; 156 el.style.display = "block"; 157 } else { 158 el.style.display = "none"; 159 } 160 } 161 return false; 162 } 163 150 164 _EOC_ 151 165 … … 579 593 580 594 my $nlines = $to - $from + 1; 581 my $hilited_file = $file; 582 $hilited_file =~ s{t/spec/}{}; 583 $hilited_file =~ s{/([^/]+)\.t$}{/_$1.html}; 595 my $html_file = $file; 596 $html_file =~ s{t/spec/}{}; 597 my $simple_html = $html_file . ".simple.html"; 598 my $full_html = $html_file . ".html"; 599 my $simple_snippet_id = "simple_$snippet_id"; 600 584 601 my $html = <<"_EOC_"; 585 602 <p>From $file lines $from–$to$stat:<span id="smartlink_skip_${snippet_id}"> <a href="#smartlink_skipto_${snippet_id}">(skip)</a></span></p> … … 588 605 </div> 589 606 <span id="smartlink_skipto_${snippet_id}"> </span> 590 <a href="http://feather.perl6.nl/~azawawi/html/$hilited_file" target="_blank"> 591 STD_syntax_highlight-ed $file 607 <div style="color:DarkBlue">Highlight $file 608 <br/> 609 <a href="#" 610 onclick="return toggle_hilite('$simple_snippet_id','/~azawawi/html/$simple_html')"> 611 Small version 592 612 </a> 613 | 614 <a href="/~azawawi/html/$full_html" target="_blank"> 615 Full version 616 </a> 617 </div> 618 <iframe id="$simple_snippet_id" style="display:none;" width="100%"></iframe> 593 619 _EOC_ 594 620 $snippets[$snippet_id] = $html;
