mirror of
https://github.com/WatchOutNewsAgency/wona.github.com.git
synced 2026-01-01 01:16:26 +00:00
added support for pygments.rb removing dependency on pygments, added support for caching highlighted code from pygments.rb and added default line numbering. Javascript auto line numbering now only occurs for embedded gists
This commit is contained in:
@ -48,8 +48,7 @@ function testFeatures() {
|
||||
|
||||
function addCodeLineNumbers(){
|
||||
if (navigator.appName == 'Microsoft Internet Explorer') { return }
|
||||
$('div.highlight pre code').each(function(el){ addDivLines(el); });
|
||||
$('div.highlight, div.gist-highlight').each(function(code){
|
||||
$('div.gist-highlight').each(function(code){
|
||||
var tableStart = '<table cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter">';
|
||||
var lineNumbers = '<pre class="line-numbers">';
|
||||
var tableMiddle = '</pre></td><td class="code" width="100%">';
|
||||
@ -62,16 +61,6 @@ function addCodeLineNumbers(){
|
||||
$(code).html(table);
|
||||
});
|
||||
}
|
||||
function addDivLines(el){
|
||||
var content = $(el).html();
|
||||
var lines = content.replace(/\s*$/g, '').split(/\n/);
|
||||
var count = lines.length;
|
||||
$(lines).each(function(line, index){
|
||||
if(line == '') line = ' ';
|
||||
lines[index] = '<div class="line">' + line + '</div>';
|
||||
});
|
||||
$(el).html(lines.join(''));
|
||||
}
|
||||
|
||||
function flashVideoFallback(){
|
||||
var flashplayerlocation = "/assets/jwplayer/player.swf",
|
||||
|
||||
Reference in New Issue
Block a user