nodes.attr("id", hash)
# initialize multi-line select
- $("#tree-content-holder .line_numbers a[id^=L]").on("click", handleMultiSelect)
+ $("#tree-content-holder .line-numbers a[id^=L]").on("click", handleMultiSelect)
# Highlight the correct lines on load
highlightBlobLines()
class Dispatcher
constructor: () ->
@initSearch()
+ @initHighlight()
@initPageScripts()
initPageScripts: ->
project_ref = opts.data('autocomplete-project-ref')
new SearchAutocomplete(path, project_id, project_ref)
+
+ initHighlight: ->
+ $('pre code').each (i, e) ->
+ hljs.highlightBlock(e)
+ $(e).html($.map($(e).html().split("\n"), (line, i) ->
+ "<div class='line' id='LC" + (i + 1) + "'>" + line + "</div>"
+ ).join("\n"))
document.addEventListener("page:change", stopSpinner)
$ ->
- $('pre code').each (i, e) ->
- hljs.highlightBlock(e)
-
# Click a .one_click_select field, select the contents
$(".one_click_select").on 'click', -> $(@).select()
code {
white-space: pre;
word-wrap: normal;
+ padding: 0;
+
+ .line {
+ display: inline;
+ }
}
}
.dark {
background-color: #232323;
+ .line.hll {
+ background: #558;
+ }
+
.highlight{
border-left: 1px solid #444;
}
.hljs {
display: block;
- padding: 0.5em;
background: #232323;
color: #E6E1DC;
}
border-left: 1px solid #444;
}
+ .line.hll {
+ background: #558;
+ }
+
.line-numbers a {
color: #666;
}
}
.hljs {
- display: block; padding: 0.5em;
+ display: block;
background: #272822;
}
border-left: 1px solid #113b46;
}
+ .line.hll {
+ background: #000;
+ }
+
pre {
background-color: #002B36;
color: #eee;
.hljs {
display: block;
- padding: 0.5em;
background: #002b36;
color: #839496;
}
.white {
background-color: #fff;
+ .line.hll {
+ background: #FFA;
+ }
+
.highlight{
border-left: 1px solid #eee;
}
}
.hljs {
- display: block; padding: 0.5em;
+ display: block;
background: #fff; color: black;
}