BigW Consortium Gitlab

Init highlgiht js and render for blob. Improve css for it

parent b95a56c1
...@@ -59,6 +59,8 @@ $ -> ...@@ -59,6 +59,8 @@ $ ->
# Click a .one_click_select field, select the contents # Click a .one_click_select field, select the contents
$(".one_click_select").on 'click', -> $(@).select() $(".one_click_select").on 'click', -> $(@).select()
hljs.initHighlightingOnLoad()
$('.remove-row').bind 'ajax:success', -> $('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut() $(this).closest('li').fadeOut()
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
&.code { &.code {
padding: 0; padding: 0;
table.lines { .highlighted-data {
border: none; border: none;
box-shadow: none; box-shadow: none;
margin: 0px; margin: 0px;
...@@ -158,47 +158,34 @@ ...@@ -158,47 +158,34 @@
font-size: 12px !important; font-size: 12px !important;
line-height: 16px !important; line-height: 16px !important;
margin: 0; margin: 0;
padding: 10px 0;
} }
td {
border: none;
margin: 0;
padding: 0;
vertical-align: top;
&:first-child { .hljs {
background: #eee; padding: 0;
width: 50px;
}
&:last-child {
}
}
tr:hover {
background: none;
} }
pre.line_numbers { .line-numbers {
color: #666; padding: 10px;
padding: 10px 6px 10px 0;
text-align: right; text-align: right;
background: #EEE; float: left;
width: 60px;
a { a {
color: #666; display: block;
font-size: 12px !important;
line-height: 16px !important;
i { i {
display: none; display: none;
font-size: 14px;
line-height: 14px;
} }
&:hover i { &:hover i {
display: inherit; display: inline;
} }
} }
} }
.highlight { .highlight {
border-left: 1px solid #DEE2E3;
overflow: auto; overflow: auto;
overflow-y: hidden; overflow-y: hidden;
......
...@@ -8,7 +8,16 @@ ...@@ -8,7 +8,16 @@
- else - else
.file-content.code .file-content.code
- unless blob.empty? - unless blob.empty?
%div{class: user_color_scheme_class} %div.highlighted-data{class: user_color_scheme_class}
= raw blob.colorize(formatter: :gitlab) .line-numbers
- blob.data.lines.size.times do |index|
- i = index + 1
= link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do
%i.icon-link
= i
.highlight
%pre
%code
= raw blob.data
- else - else
%p.nothing_here_message Empty file %p.nothing_here_message Empty file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment