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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3b98cb16
Commit
3b98cb16
authored
Nov 21, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for custom highlighting slash commands via warning flags
parent
1fc450d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+15
-3
app/assets/stylesheets/framework/markdown_area.scss
app/assets/stylesheets/framework/markdown_area.scss
+12
-0
No files found.
app/assets/javascripts/gfm_auto_complete.js
View file @
3b98cb16
...
@@ -62,9 +62,11 @@ class GfmAutoComplete {
...
@@ -62,9 +62,11 @@ class GfmAutoComplete {
skipMarkdownCharacterTest
:
true
,
skipMarkdownCharacterTest
:
true
,
data
:
GfmAutoComplete
.
defaultLoadingData
,
data
:
GfmAutoComplete
.
defaultLoadingData
,
displayTpl
(
value
)
{
displayTpl
(
value
)
{
const
cssClasses
=
[];
if
(
GfmAutoComplete
.
isLoading
(
value
))
return
GfmAutoComplete
.
Loading
.
template
;
if
(
GfmAutoComplete
.
isLoading
(
value
))
return
GfmAutoComplete
.
Loading
.
template
;
// eslint-disable-next-line no-template-curly-in-string
// eslint-disable-next-line no-template-curly-in-string
let
tpl
=
'
<li><span class="name">/${name}</span>
'
;
let
tpl
=
'
<li
class="<%- className %>"
><span class="name">/${name}</span>
'
;
if
(
value
.
aliases
.
length
>
0
)
{
if
(
value
.
aliases
.
length
>
0
)
{
tpl
+=
'
<small class="aliases">(or /<%- aliases.join(", /") %>)</small>
'
;
tpl
+=
'
<small class="aliases">(or /<%- aliases.join(", /") %>)</small>
'
;
}
}
...
@@ -72,10 +74,19 @@ class GfmAutoComplete {
...
@@ -72,10 +74,19 @@ class GfmAutoComplete {
tpl
+=
'
<small class="params"><%- params.join(" ") %></small>
'
;
tpl
+=
'
<small class="params"><%- params.join(" ") %></small>
'
;
}
}
if
(
value
.
description
!==
''
)
{
if
(
value
.
description
!==
''
)
{
tpl
+=
'
<small class="description"><i><%- description %></i></small>
'
;
tpl
+=
'
<small class="description"><i><%- description %>
<%- warningText %>
</i></small>
'
;
}
}
tpl
+=
'
</li>
'
;
tpl
+=
'
</li>
'
;
return
_
.
template
(
tpl
)(
value
);
if
(
value
.
warning
)
{
cssClasses
.
push
(
'
has-warning
'
);
}
return
_
.
template
(
tpl
)({
...
value
,
className
:
cssClasses
.
join
(
'
'
),
warningText
:
value
.
warning
?
`(
${
value
.
warning
}
)`
:
''
,
});
},
},
insertTpl
(
value
)
{
insertTpl
(
value
)
{
// eslint-disable-next-line no-template-curly-in-string
// eslint-disable-next-line no-template-curly-in-string
...
@@ -104,6 +115,7 @@ class GfmAutoComplete {
...
@@ -104,6 +115,7 @@ class GfmAutoComplete {
aliases
:
c
.
aliases
,
aliases
:
c
.
aliases
,
params
:
c
.
params
,
params
:
c
.
params
,
description
:
c
.
description
,
description
:
c
.
description
,
warning
:
c
.
warning
,
search
,
search
,
};
};
});
});
...
...
app/assets/stylesheets/framework/markdown_area.scss
View file @
3b98cb16
...
@@ -219,6 +219,13 @@
...
@@ -219,6 +219,13 @@
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
.has-warning
{
.name
,
.description
{
color
:
$orange-700
;
}
}
.cur
{
.cur
{
.avatar
{
.avatar
{
@include
disableAllAnimation
;
@include
disableAllAnimation
;
...
@@ -246,6 +253,11 @@
...
@@ -246,6 +253,11 @@
small
{
small
{
color
:
inherit
;
color
:
inherit
;
}
}
&
.has-warning
{
color
:
$orange-700
;
background-color
:
$orange-100
;
}
}
}
div
.avatar
{
div
.avatar
{
...
...
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