Changeset - 853f1465b314
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-03-04 18:46:02
marcin@python-works.com
codecleaner
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/files/files_source.html
Show inline comments
 
@@ -41,69 +41,69 @@
 
        </div>
 
        <div class="commit">${h.urlify_commit(c.file_changeset.message,c.repo_name)}</div>
 
    </div>
 
    <div class="code-body">
 
       %if c.file.is_binary:
 
           ${_('Binary file (%s)') % c.file.mimetype}
 
       %else:
 
        % if c.file.size < c.cut_off_limit:
 
            %if c.annotate:
 
              ${h.pygmentize_annotation(c.repo_name,c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
 
            %else:
 
              ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
 
            %endif
 
        %else:
 
            ${_('File is too big to display')} ${h.link_to(_('show as raw'),
 
            h.url('files_raw_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id,f_path=c.f_path))}
 
        %endif
 
     %endif
 
    </div>
 
</div>
 

	
 
<script type="text/javascript">
 
YUE.onDOMReady(function(){
 
    function highlight_lines(lines){
 
        for(pos in lines){
 
          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);
 
	  var _first_line= YUD.get('L'+h_lines[0]);
 
	  if(_first_line){
 
		  _first_line.scrollIntoView()
 
	  }
 
      highlight_lines(h_lines);
 
      var _first_line= YUD.get('L'+h_lines[0]);
 
      if(_first_line){
 
          _first_line.scrollIntoView()
 
      }
 
    }
 

	
 
    // select code link event
 
    YUE.on('hlcode', 'mouseup', getSelectionLink);
 

	
 
    //load history of file
 
    YUE.on('load_node_history', 'click', function(e){
 
        var _url = node_history_url.replace('__REV__','${c.file_changeset.raw_id}').replace('__FPATH__', '${c.f_path}');
 
        ypjax(_url, 'node_history', function(o){
 
            tooltip_activate();
 
        })
 
    });
 

	
 
   });
 

	
 
</script>
0 comments (0 inline, 0 general)