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
Jérome Perrin
gitlab-ce
Commits
569645a8
Commit
569645a8
authored
Dec 09, 2016
by
victorwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up commit copy to clipboard and make consistent
parent
b544ec86
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
15 deletions
+6
-15
app/assets/javascripts/copy_to_clipboard.js
app/assets/javascripts/copy_to_clipboard.js
+2
-2
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+1
-1
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+2
-7
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+1
-5
No files found.
app/assets/javascripts/copy_to_clipboard.js
View file @
569645a8
...
...
@@ -6,7 +6,7 @@
var
genericError
,
genericSuccess
,
showTooltip
;
genericSuccess
=
function
(
e
)
{
showTooltip
(
e
.
trigger
,
'
Copied
!
'
);
showTooltip
(
e
.
trigger
,
'
Copied
'
);
// Clear the selection and blur the trigger so it loses its border
e
.
clearSelection
();
return
$
(
e
.
trigger
).
blur
();
...
...
@@ -31,7 +31,7 @@
var
originalTitle
=
$target
.
data
(
'
original-title
'
);
$target
.
attr
(
'
title
'
,
'
Copied
!
'
)
.
attr
(
'
title
'
,
'
Copied
'
)
.
tooltip
(
'
fixTitle
'
)
.
tooltip
(
'
show
'
)
.
attr
(
'
title
'
,
originalTitle
)
...
...
app/helpers/button_helper.rb
View file @
569645a8
...
...
@@ -16,7 +16,7 @@ module ButtonHelper
# See http://clipboardjs.com/#usage
def
clipboard_button
(
data
=
{})
css_class
=
data
[
:class
]
||
'btn-clipboard btn-transparent'
title
=
data
[
:title
]
||
'Copy to
C
lipboard'
title
=
data
[
:title
]
||
'Copy to
c
lipboard'
data
=
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}.
merge
(
data
)
content_tag
:button
,
icon
(
'clipboard'
),
...
...
app/views/projects/commit/_commit_box.html.haml
View file @
569645a8
.page-content-header
.header-main-content
%strong
Commit
%strong
.monospace.js-details-short
=
@commit
.
short_id
=
link_to
(
"#"
,
class:
"js-details-expand hidden-xs hidden-sm"
)
do
%span
.text-expander
\...
%span
.js-details-content.hide
%strong
.monospace.commit-hash-full
=
@commit
.
id
%strong
=
clipboard_button
(
clipboard_text:
@commit
.
id
)
=
@commit
.
short_id
%span
.hidden-xs
authored
#{
time_ago_with_tooltip
(
@commit
.
authored_date
)
}
%span
by
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
569645a8
...
...
@@ -5,14 +5,10 @@
%tr
%th
Name
%th
.hidden-xs
.pull-left
Last Commit
.last-commit.hidden-sm.pull-left
%i
.fa.fa-angle-right
%small
.light
=
clipboard_button
(
clipboard_text:
@commit
.
id
)
=
link_to
@commit
.
short_id
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"monospace"
–
=
time_ago_with_tooltip
(
@commit
.
committed_date
)
=
@commit
.
full_title
%small
.commit-history-link-spacer
|
...
...
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