clipboard: added dummy placeholders for copying commits/paths via clipboard.js
This commit is contained in:
parent
87b9dede56
commit
a98d55f137
6 changed files with 21 additions and 1 deletions
|
|
@ -60,6 +60,7 @@
|
||||||
.icon-hg:before { content: '\e82d'; } /* '' */
|
.icon-hg:before { content: '\e82d'; } /* '' */
|
||||||
.icon-svn:before { content: '\e82e'; } /* '' */
|
.icon-svn:before { content: '\e82e'; } /* '' */
|
||||||
.icon-plus:before { content: '\e813'; } /* '' */
|
.icon-plus:before { content: '\e813'; } /* '' */
|
||||||
|
.icon-clipboard:before { content: '\e813'; } /* '' */
|
||||||
.icon-minus:before { content: '\e814'; } /* '' */
|
.icon-minus:before { content: '\e814'; } /* '' */
|
||||||
.icon-remove:before { content: '\e815'; } /* '' */
|
.icon-remove:before { content: '\e815'; } /* '' */
|
||||||
.icon-bookmark:before { content: '\e803'; } /* '' */
|
.icon-bookmark:before { content: '\e803'; } /* '' */
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,20 @@ var timeagoActivate = function() {
|
||||||
$("time.timeago").timeago();
|
$("time.timeago").timeago();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var clipboardActivate = function() {
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* <i class="tooltip icon-plus clipboard-action" data-clipboard-text="${commit.raw_id}" title="${_('Copy the full commit id')}"></i>
|
||||||
|
* */
|
||||||
|
var clipboard = new Clipboard('.clipboard-action');
|
||||||
|
|
||||||
|
clipboard.on('success', function(e) {
|
||||||
|
e.clearSelection();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Formatting values in a Select2 dropdown of commit references
|
// Formatting values in a Select2 dropdown of commit references
|
||||||
var formatSelect2SelectionRefs = function(commit_ref){
|
var formatSelect2SelectionRefs = function(commit_ref){
|
||||||
var tmpl = '';
|
var tmpl = '';
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ c.template_context['default_user'] = {
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
show_more_event();
|
show_more_event();
|
||||||
timeagoActivate();
|
timeagoActivate();
|
||||||
|
clipboardActivate();
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="td-hash">
|
<td class="td-hash">
|
||||||
<code>
|
<code>
|
||||||
|
<i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${commit.raw_id}" title="${_('Copy the full commit id')}"></i>
|
||||||
|
|
||||||
<a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">
|
<a href="${h.url('changeset_home',repo_name=c.repo_name,revision=commit.raw_id)}">
|
||||||
<span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span>
|
<span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
<span class="breadcrumbs files_location">
|
<span class="breadcrumbs files_location">
|
||||||
<h4>${_('Commit')}
|
<h4>${_('Commit')}
|
||||||
<code>
|
<code>
|
||||||
|
<i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
|
||||||
${h.show_id(c.commit)}
|
${h.show_id(c.commit)}
|
||||||
% if hasattr(c.commit, 'phase'):
|
% if hasattr(c.commit, 'phase'):
|
||||||
<span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
|
<span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@
|
||||||
<span> | ${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])}</span>
|
<span> | ${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])}</span>
|
||||||
<span> | ${h.format_byte_size_binary(c.file.size)}</span>
|
<span> | ${h.format_byte_size_binary(c.file.size)}</span>
|
||||||
<span> | ${c.file.mimetype} </span>
|
<span> | ${c.file.mimetype} </span>
|
||||||
<span class="item last"> | ${h.get_lexer_for_filenode(c.file).__class__.__name__}</span>
|
<span> | ${h.get_lexer_for_filenode(c.file).__class__.__name__}</span>
|
||||||
|
<span class="item last"> | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.file.path}" title="${_('Copy the full path')}"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a id="file_history_overview" href="#">
|
<a id="file_history_overview" href="#">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue