From 9bfd40cea296023d6f4dd4c7432f05e74da48635 Mon Sep 17 00:00:00 2001 From: buddh4 Date: Mon, 27 Mar 2017 16:30:31 +0200 Subject: [PATCH] - Enh: Added global copyToClipboard --- protected/humhub/docs/CHANGELOG.md | 4 ++-- .../humhub/modules/content/resources/js/humhub.content.js | 2 +- static/css/temp.css | 1 - static/js/humhub/humhub.ui.additions.js | 6 ++++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index 6024c6110a..b2d4de5990 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -17,9 +17,9 @@ HumHub Change Log - Fix: Default user & space module configuration lost after foreign key migration - Fix: Respect pinned post when inserting a a new stream entry - Fix: Show comments in modal not working -- Fix: #2381 Comment input not focused on comment link click +- Fix: #2374 Comment input not focused on comment link click - Enh: Toggle comment box - +- Enh: Added global copyToClipboard 1.2.0-beta.3 (March 20, 2017) -------------------------------- diff --git a/protected/humhub/modules/content/resources/js/humhub.content.js b/protected/humhub/modules/content/resources/js/humhub.content.js index 6922a0e929..2b65dbd03e 100644 --- a/protected/humhub/modules/content/resources/js/humhub.content.js +++ b/protected/humhub/modules/content/resources/js/humhub.content.js @@ -135,7 +135,7 @@ humhub.module('content', function (module, require, $) { }; var templates = { - permalinkBody: '

{info}

', + permalinkBody: '

{info}

', permalinkFooter: '{buttonClose}{buttonOpen}' }; diff --git a/static/css/temp.css b/static/css/temp.css index 2f0596fdc8..e202c41cc1 100644 --- a/static/css/temp.css +++ b/static/css/temp.css @@ -1,4 +1,3 @@ div.required label:after { content: " *"; - //color: red; } \ No newline at end of file diff --git a/static/js/humhub/humhub.ui.additions.js b/static/js/humhub/humhub.ui.additions.js index de8b89e21f..897536b2fc 100644 --- a/static/js/humhub/humhub.ui.additions.js +++ b/static/js/humhub/humhub.ui.additions.js @@ -93,6 +93,10 @@ humhub.module('ui.additions', function (module, require, $) { event.on('humhub:ready', function (evt) { module.applyTo($('body')); }); + + require('action').registerHandler('copyToClipboard', function(evt) { + clipboard.copy(evt.$target.text()); + }); // workaround for jp-player since it sets display to inline which results in a broken view... $(document).on('click.humhub-jp-play', '.jp-play', function () { @@ -201,8 +205,6 @@ humhub.module('ui.additions', function (module, require, $) { } }; - //TODO: additions.extend('id', handler); for extending existing additions. - /** * Cleanup some nodes required to prevent memoryleaks in pjax mode. * @returns {undefined}