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
iv
gitlab-ce
Commits
14d08d14
Commit
14d08d14
authored
Jun 03, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated design of markdown buttons
parent
05dcec95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
24 deletions
+48
-24
app/assets/stylesheets/framework/markdown_area.scss
app/assets/stylesheets/framework/markdown_area.scss
+23
-0
app/helpers/gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+13
-0
app/views/projects/_md_preview.html.haml
app/views/projects/_md_preview.html.haml
+12
-24
No files found.
app/assets/stylesheets/framework/markdown_area.scss
View file @
14d08d14
...
...
@@ -104,3 +104,26 @@
}
}
}
.toolbar-group
{
float
:
left
;
margin-right
:
-5px
;
margin-left
:
$gl-padding
;
&
:first-child
{
margin-left
:
0
;
}
}
.toolbar-btn
{
float
:
left
;
padding
:
0
5px
;
color
:
#959494
;
background
:
transparent
;
border
:
0
;
outline
:
0
;
&
:hover
{
color
:
$gl-link-color
;
}
}
app/helpers/gitlab_markdown_helper.rb
View file @
14d08d14
...
...
@@ -185,4 +185,17 @@ module GitlabMarkdownHelper
''
end
end
def
markdown_toolbar_button
(
options
=
{})
data
=
options
[
:data
].
merge
({
container:
"body"
})
content_tag
:button
,
type:
"button"
,
class:
"toolbar-btn js-md has-tooltip hidden-xs"
,
tabindex:
-
1
,
data:
data
,
title:
options
[
:title
],
aria:
{
label:
options
[
:title
]
}
do
icon
(
options
[
:icon
])
end
end
end
app/views/projects/_md_preview.html.haml
View file @
14d08d14
...
...
@@ -14,29 +14,17 @@
%span
This is a confidential issue. Your comment will not be visible to the public.
%li
.pull-right
%a
.btn.btn-xs.js-md
{
'data-md-tag'
=>
'**'
}
=
icon
(
'bold fw'
)
%a
.btn.btn-xs.js-md
{
'data-md-tag'
=>
'*'
}
=
icon
(
'italic fw'
)
%a
.btn.btn-xs.js-md
{
'data-md-tag'
=>
'`'
}
=
icon
(
'code fw'
)
%a
.btn.btn-xs.js-md.js-list
{
'data-md-tag'
=>
'* '
,
'data-md-prepend'
=>
true
}
=
icon
(
'list-ul fw'
)
%a
.btn.btn-xs.js-md.js-list.hidden-xs
{
'data-md-tag'
=>
'1. '
,
'data-md-prepend'
=>
true
}
=
icon
(
'list-ol fw'
)
%a
.btn.btn-xs.js-md.js-list.hidden-xs
{
'data-md-tag'
=>
'* [ ] '
,
'data-md-prepend'
=>
true
}
=
icon
(
'check-square-o fw'
)
%a
.btn.btn-xs.js-md.js-list.hidden-xs
{
'data-md-tag'
=>
'> '
,
'data-md-prepend'
=>
true
}
=
icon
(
'quote-right fw'
)
%a
.btn.btn-xs.js-md.js-list.hidden-xs
{
'data-md-tag'
=>
'!'
,
'data-md-prepend'
=>
true
}
=
icon
(
'tasks fw'
)
%a
.btn.btn-xs.js-md.js-list.hidden-xs
{
'data-md-tag'
=>
'#'
,
'data-md-prepend'
=>
true
}
=
icon
(
'exclamation-circle fw'
)
%a
.btn.btn-xs.js-zen-enter.hidden-xs
=
icon
(
'arrows-alt fw'
)
.toolbar-group
=
markdown_toolbar_button
({
icon:
"bold fw"
,
data:
{
"md-tag"
=>
"**"
},
title:
"Add bold text"
})
=
markdown_toolbar_button
({
icon:
"italic fw"
,
data:
{
"md-tag"
=>
"*"
},
title:
"Add italic text"
})
=
markdown_toolbar_button
({
icon:
"quote-right fw"
,
data:
{
"md-tag"
=>
"> "
,
"md-prepend"
=>
true
},
title:
"Insert a quote"
})
=
markdown_toolbar_button
({
icon:
"code fw"
,
data:
{
"md-tag"
=>
"`"
},
title:
"Insert code"
})
=
markdown_toolbar_button
({
icon:
"list-ul fw"
,
data:
{
"md-tag"
=>
"* "
,
"md-prepend"
=>
true
},
title:
"Add a bullet list"
})
=
markdown_toolbar_button
({
icon:
"list-ol fw"
,
data:
{
"md-tag"
=>
"1. "
,
"md-prepend"
=>
true
},
title:
"Add a numbered list"
})
=
markdown_toolbar_button
({
icon:
"check-square-o fw"
,
data:
{
"md-tag"
=>
"* [ ] "
,
"md-prepend"
=>
true
},
title:
"Add a task list"
})
.toolbar-group
%button
.toolbar-btn.js-zen-enter.has-tooltip.hidden-xs
{
type:
"button"
,
tabindex:
-
1
,
aria:
{
label:
"Go full screen"
},
title:
"Go full screen"
,
data:
{
container:
"body"
}
}
=
icon
(
"arrows-alt fw"
)
.md-write-holder
=
yield
...
...
@@ -45,7 +33,7 @@
-
if
defined?
(
referenced_users
)
&&
referenced_users
%div
.referenced-users.hide
%span
=
icon
(
'exclamation-triangle'
)
=
icon
(
"exclamation-triangle"
)
You are about to add
%strong
%span
.js-referenced-users-count
0
...
...
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