mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Reading the full file path, extracting the suffix, then using that to pick the brush
for syntax highlighting.
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
var showFile = function(txt) {
|
||||
$("source").style.display = "";
|
||||
$("source").innerHTML="<pre class='first-line: 1;brush: objc'>"+txt+"</pre>";
|
||||
|
||||
SyntaxHighlighter.defaults['toolbar'] = false;
|
||||
SyntaxHighlighter.highlight();
|
||||
|
||||
return;
|
||||
var showFile = function(txt, fileName) {
|
||||
$("source").style.display = "";
|
||||
var brush = "objc";
|
||||
if (fileName && fileName != '') {
|
||||
brush = fileName.substr(fileName.lastIndexOf('.') + 1);
|
||||
}
|
||||
$("source").innerHTML="<pre class='first-line: 1;brush: " + brush + "'>" + txt + "</pre>";
|
||||
|
||||
SyntaxHighlighter.defaults['toolbar'] = false;
|
||||
SyntaxHighlighter.highlight();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var test=function(txt) {
|
||||
SyntaxHighlighter.defaults['toolbar'] = false;
|
||||
SyntaxHighlighter.highlight();
|
||||
|
||||
return;
|
||||
SyntaxHighlighter.defaults['toolbar'] = false;
|
||||
SyntaxHighlighter.highlight();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user