# HG changeset patch # User Marcin Kuzminski # Date 2017-07-19 09:38:34 # Node ID 51b8a8f9a3831d4d626056379ea6dd6815b1d2b6 # Parent d8551a6b70b687d69deac71b2b3db313db708c02 clipboard: added dummy placeholders for copying commits/paths via clipboard.js diff --git a/rhodecode/public/css/rcicons.less b/rhodecode/public/css/rcicons.less --- a/rhodecode/public/css/rcicons.less +++ b/rhodecode/public/css/rcicons.less @@ -60,6 +60,7 @@ .icon-hg:before { content: '\e82d'; } /* '' */ .icon-svn:before { content: '\e82e'; } /* '' */ .icon-plus:before { content: '\e813'; } /* '' */ +.icon-clipboard:before { content: '\e813'; } /* '' */ .icon-minus:before { content: '\e814'; } /* '' */ .icon-remove:before { content: '\e815'; } /* '' */ .icon-bookmark:before { content: '\e803'; } /* '' */ diff --git a/rhodecode/public/js/src/rhodecode.js b/rhodecode/public/js/src/rhodecode.js --- a/rhodecode/public/js/src/rhodecode.js +++ b/rhodecode/public/js/src/rhodecode.js @@ -210,6 +210,20 @@ var timeagoActivate = function() { $("time.timeago").timeago(); }; + +var clipboardActivate = function() { + /* + * + * + * */ + var clipboard = new Clipboard('.clipboard-action'); + + clipboard.on('success', function(e) { + e.clearSelection(); + }); +}; + + // Formatting values in a Select2 dropdown of commit references var formatSelect2SelectionRefs = function(commit_ref){ var tmpl = ''; diff --git a/rhodecode/templates/base/root.mako b/rhodecode/templates/base/root.mako --- a/rhodecode/templates/base/root.mako +++ b/rhodecode/templates/base/root.mako @@ -133,6 +133,7 @@ c.template_context['default_user'] = { $(document).ready(function(){ show_more_event(); timeagoActivate(); + clipboardActivate(); }) diff --git a/rhodecode/templates/changelog/changelog_elements.mako b/rhodecode/templates/changelog/changelog_elements.mako --- a/rhodecode/templates/changelog/changelog_elements.mako +++ b/rhodecode/templates/changelog/changelog_elements.mako @@ -45,6 +45,8 @@ + + ${h.show_id(commit)} diff --git a/rhodecode/templates/changeset/changeset.mako b/rhodecode/templates/changeset/changeset.mako --- a/rhodecode/templates/changeset/changeset.mako +++ b/rhodecode/templates/changeset/changeset.mako @@ -35,6 +35,7 @@

${_('Commit')} + ${h.show_id(c.commit)} % if hasattr(c.commit, 'phase'): ${c.commit.phase} diff --git a/rhodecode/templates/files/files_source.mako b/rhodecode/templates/files/files_source.mako --- a/rhodecode/templates/files/files_source.mako +++ b/rhodecode/templates/files/files_source.mako @@ -10,7 +10,8 @@ | ${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])} | ${h.format_byte_size_binary(c.file.size)} | ${c.file.mimetype} - | ${h.get_lexer_for_filenode(c.file).__class__.__name__} + | ${h.get_lexer_for_filenode(c.file).__class__.__name__} + |