Changeset - 6e070138d173
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-01-28 14:45:30
marcin@python-works.com
implemented #107 variable lines can be now highlighted
1 file changed with 31 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/files/files_source.html
Show inline comments
 
@@ -42,6 +42,37 @@
 
			${_('File is to big to display')} ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))}
 
		%endif
 
		
 
       <script type="text/javascript">
 
           function highlight_lines(lines){
 
               for(pos in lines){
 
                   console.log('L'+lines[pos]);
 
                 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE');                       
 
               }              
 
           }       
 
           page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
 
           if (page_highlights.length == 2){
 
              highlight_ranges  = page_highlights[1].split(",");
 

	
 
              var h_lines = [];
 
              for (pos in highlight_ranges){
 
                   var _range = highlight_ranges[pos].split('-');
 
                   if(_range.length == 2){
 
                       var start = parseInt(_range[0]);
 
                       var end = parseInt(_range[1]);
 
                       if (start < end){
 
                           for(var i=start;i<=end;i++){
 
                               h_lines.push(i);
 
                           }
 
                       } 
 
                   }
 
                   else{
 
                       h_lines.push(parseInt(highlight_ranges[pos]));
 
                   }
 
             }
 
           highlight_lines(h_lines);              
 
           }
 
       </script>		
 
	</div>
 
</div>
 

	
0 comments (0 inline, 0 general)