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
Léo-Paul Géneau
gitlab-ce
Commits
101c3708
Commit
101c3708
authored
Mar 07, 2018
by
haseeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes based on review
parent
c5cd3114
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
app/assets/javascripts/snippet/snippet_embed.js
app/assets/javascripts/snippet/snippet_embed.js
+4
-4
app/assets/stylesheets/snippets.scss
app/assets/stylesheets/snippets.scss
+3
-3
app/helpers/snippets_helper.rb
app/helpers/snippets_helper.rb
+1
-1
app/views/shared/snippets/_header.html.haml
app/views/shared/snippets/_header.html.haml
+5
-5
No files found.
app/assets/javascripts/snippet/snippet_embed.js
View file @
101c3708
export
default
()
=>
{
const
{
protocol
,
host
,
pathname
}
=
location
;
const
shareBtn
=
document
.
querySelector
(
'
#
share-btn
'
);
const
embedBtn
=
document
.
querySelector
(
'
#
embed-btn
'
);
const
snippetUrlArea
=
document
.
querySelector
(
'
#
snippet-url-area
'
);
const
embedAction
=
document
.
querySelector
(
'
#
embed-action
'
);
const
shareBtn
=
document
.
querySelector
(
'
.js-
share-btn
'
);
const
embedBtn
=
document
.
querySelector
(
'
.js-
embed-btn
'
);
const
snippetUrlArea
=
document
.
querySelector
(
'
.js-
snippet-url-area
'
);
const
embedAction
=
document
.
querySelector
(
'
.js-
embed-action
'
);
const
url
=
`
${
protocol
}
//
${
host
+
pathname
}
`
;
shareBtn
.
addEventListener
(
'
click
'
,
()
=>
{
...
...
app/assets/stylesheets/snippets.scss
View file @
101c3708
...
...
@@ -22,9 +22,9 @@
height
:
16px
;
background-size
:
cover
;
&
.gl-snippet-icon-doc_code
{
background-position
:
-0
-
0
;
}
&
.gl-snippet-icon-doc_text
{
background-position
:
-
0
-16px
;
}
&
.gl-snippet-icon-download
{
background-position
:
-
0
-32px
;
}
&
.gl-snippet-icon-doc_code
{
background-position
:
0
0
;
}
&
.gl-snippet-icon-doc_text
{
background-position
:
0
-16px
;
}
&
.gl-snippet-icon-download
{
background-position
:
0
-32px
;
}
}
.blob-viewer
{
...
...
app/helpers/snippets_helper.rb
View file @
101c3708
...
...
@@ -116,7 +116,7 @@ module SnippetsHelper
raw_project_snippet_url
(
@snippet
.
project
,
@snippet
)
end
link_to
external_snippet_icon
(
'doc_code'
),
snippet_raw_url
,
class:
'btn'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
,
title:
'Open raw'
,
data:
{
container:
'body'
}
link_to
external_snippet_icon
(
'doc_code'
),
snippet_raw_url
,
class:
'btn'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
,
title:
'Open raw'
end
def
embedded_snippet_download_button
...
...
app/views/shared/snippets/_header.html.haml
View file @
101c3708
...
...
@@ -34,17 +34,17 @@
.input-group
.input-group-btn
%button
.btn.embed-toggle
{
'data-toggle'
:
'dropdown'
,
type:
'button'
}
%span
#
embed-action
=
_
(
"Embed"
)
%span
.js-
embed-action
=
_
(
"Embed"
)
=
sprite_icon
(
'angle-down'
,
size:
12
)
%ul
.dropdown-menu.dropdown-menu-selectable.embed-toggle-list
%li
%button
#
embed-btn
.btn.btn-transparent.is-active
{
type:
'button'
}
%button
.js-
embed-btn.btn.btn-transparent.is-active
{
type:
'button'
}
%strong
.embed-toggle-list-item
=
_
(
"Embed"
)
%li
%button
#
share-btn
.btn.btn-transparent
{
type:
'button'
}
%button
.js-
share-btn.btn.btn-transparent
{
type:
'button'
}
%strong
.embed-toggle-list-item
=
_
(
"Share"
)
%input
#
snippet-url-area
.snippet-embed-input.form-control
{
type:
"text"
,
autocomplete:
'off'
,
value:
snippet_embed
}
%input
.js-
snippet-url-area.snippet-embed-input.form-control
{
type:
"text"
,
autocomplete:
'off'
,
value:
snippet_embed
}
.input-group-btn
%button
#clipboard-btn
.btn.btn-default
{
title:
"Copy to clipboard"
,
type:
"button"
,
data:
{
toggle:
"tooltip"
,
placement:
"bottom"
,
title:
"Copy source to clipboard"
,
container:
"body"
,
clipboard_target:
'#snippet-url-area'
}
}
%button
.js-clipboard-btn.btn.btn-default.has-tooltip
{
title:
"Copy to clipboard"
,
'data-clipboard-target'
:
'#snippet-url-area'
}
=
sprite_icon
(
'duplicate'
,
size:
16
)
.clearfix
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