Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
891ea6f6
Commit
891ea6f6
authored
Jan 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve highlight for notes
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
86e4f6e0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
14 deletions
+11
-14
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+1
-1
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+6
-0
app/assets/stylesheets/generic/highlight.scss
app/assets/stylesheets/generic/highlight.scss
+1
-4
app/assets/stylesheets/main/mixins.scss
app/assets/stylesheets/main/mixins.scss
+1
-1
app/assets/stylesheets/sections/notes.scss
app/assets/stylesheets/sections/notes.scss
+0
-4
lib/redcarpet/render/gitlab_html.rb
lib/redcarpet/render/gitlab_html.rb
+1
-3
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+1
-1
No files found.
app/assets/javascripts/dispatcher.js.coffee
View file @
891ea6f6
...
@@ -56,7 +56,7 @@ class Dispatcher
...
@@ -56,7 +56,7 @@ class Dispatcher
new
SearchAutocomplete
(
path
,
project_id
,
project_ref
)
new
SearchAutocomplete
(
path
,
project_id
,
project_ref
)
initHighlight
:
->
initHighlight
:
->
$
(
'pre code'
).
each
(
i
,
e
)
->
$
(
'
.highlight
pre code'
).
each
(
i
,
e
)
->
hljs
.
highlightBlock
(
e
)
hljs
.
highlightBlock
(
e
)
$
(
e
).
html
(
$
.
map
(
$
(
e
).
html
().
split
(
"
\n
"
),
(
line
,
i
)
->
$
(
e
).
html
(
$
.
map
(
$
(
e
).
html
().
split
(
"
\n
"
),
(
line
,
i
)
->
"<div class='line' id='LC"
+
(
i
+
1
)
+
"'>"
+
line
+
"</div>"
"<div class='line' id='LC"
+
(
i
+
1
)
+
"'>"
+
line
+
"</div>"
...
...
app/assets/javascripts/notes.js.coffee
View file @
891ea6f6
...
@@ -94,6 +94,9 @@ class Notes
...
@@ -94,6 +94,9 @@ class Notes
if
@
isNewNote
(
note
)
if
@
isNewNote
(
note
)
@
note_ids
.
push
(
note
.
id
)
@
note_ids
.
push
(
note
.
id
)
$
(
'ul.main-notes-list'
).
append
(
note
.
html
)
$
(
'ul.main-notes-list'
).
append
(
note
.
html
)
code
=
"#note_"
+
note
.
id
+
" .highlight pre code"
$
(
code
).
each
(
i
,
e
)
->
hljs
.
highlightBlock
(
e
)
###
###
...
@@ -253,6 +256,9 @@ class Notes
...
@@ -253,6 +256,9 @@ class Notes
updateNote
:
(
xhr
,
note
,
status
)
=>
updateNote
:
(
xhr
,
note
,
status
)
=>
note_li
=
$
(
"#note_"
+
note
.
id
)
note_li
=
$
(
"#note_"
+
note
.
id
)
note_li
.
replaceWith
(
note
.
html
)
note_li
.
replaceWith
(
note
.
html
)
code
=
"#note_"
+
note
.
id
+
" .highlight pre code"
$
(
code
).
each
(
i
,
e
)
->
hljs
.
highlightBlock
(
e
)
###
###
Called in response to clicking the edit note link
Called in response to clicking the edit note link
...
...
app/assets/stylesheets/generic/highlight.scss
View file @
891ea6f6
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
table-layout
:
fixed
;
table-layout
:
fixed
;
pre
{
pre
{
padding
:
10px
;
border
:
none
;
border
:
none
;
border-radius
:
0
;
border-radius
:
0
;
font-family
:
$monospace_font
;
font-family
:
$monospace_font
;
...
@@ -57,10 +58,6 @@
...
@@ -57,10 +58,6 @@
pre
{
pre
{
white-space
:
pre
;
white-space
:
pre
;
word-wrap
:
normal
;
word-wrap
:
normal
;
.line
{
padding
:
0
10px
;
}
}
}
}
}
}
}
app/assets/stylesheets/main/mixins.scss
View file @
891ea6f6
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
}
}
}
}
code
{
p
>
code
{
font-size
:
inherit
;
font-size
:
inherit
;
font-weight
:
inherit
;
font-weight
:
inherit
;
color
:
#555
;
color
:
#555
;
...
...
app/assets/stylesheets/sections/notes.scss
View file @
891ea6f6
...
@@ -92,10 +92,6 @@ ul.notes {
...
@@ -92,10 +92,6 @@ ul.notes {
.note-body
{
.note-body
{
@include
md-typography
;
@include
md-typography
;
margin-left
:
45px
;
margin-left
:
45px
;
.highlight
{
@include
border-radius
(
4px
);
}
}
}
.note-header
{
.note-header
{
padding-bottom
:
5px
;
padding-bottom
:
5px
;
...
...
lib/redcarpet/render/gitlab_html.rb
View file @
891ea6f6
...
@@ -23,9 +23,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
...
@@ -23,9 +23,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
<div class="highlighted-data
#{
h
.
user_color_scheme_class
}
">
<div class="highlighted-data
#{
h
.
user_color_scheme_class
}
">
<div class="highlight">
<div class="highlight">
<pre>
<pre><code class="
#{
language
}
">
#{
code
}
</code></pre>
<code class="
#{
language
}
">
#{
code
}
</code>
</pre>
</div>
</div>
</div>
</div>
...
...
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
891ea6f6
...
@@ -378,7 +378,7 @@ describe GitlabMarkdownHelper do
...
@@ -378,7 +378,7 @@ describe GitlabMarkdownHelper do
it
"should leave code blocks untouched"
do
it
"should leave code blocks untouched"
do
helper
.
stub
(
:user_color_scheme_class
).
and_return
(
:white
)
helper
.
stub
(
:user_color_scheme_class
).
and_return
(
:white
)
target_html
=
"
\n
<div class=
\"
highlighted-data white
\"
>
\n
<div class=
\"
highlight
\"
>
\n
<pre>
\n
<code class=
\"\"
>some code from $
#{
snippet
.
id
}
\n
here too
\n
</code>
\n
</pre>
\n
</div>
\n
</div>
\n\n
"
target_html
=
"
\n
<div class=
\"
highlighted-data white
\"
>
\n
<div class=
\"
highlight
\"
>
\n
<pre>
<code class=
\"\"
>some code from $
#{
snippet
.
id
}
\n
here too
\n
</code>
</pre>
\n
</div>
\n
</div>
\n\n
"
helper
.
markdown
(
"
\n
some code from $
#{
snippet
.
id
}
\n
here too
\n
"
).
should
==
target_html
helper
.
markdown
(
"
\n
some code from $
#{
snippet
.
id
}
\n
here too
\n
"
).
should
==
target_html
helper
.
markdown
(
"
\n
```
\n
some code from $
#{
snippet
.
id
}
\n
here too
\n
```
\n
"
).
should
==
target_html
helper
.
markdown
(
"
\n
```
\n
some code from $
#{
snippet
.
id
}
\n
here too
\n
```
\n
"
).
should
==
target_html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment