- Enh: Added global copyToClipboard

This commit is contained in:
buddh4 2017-03-27 16:30:31 +02:00
parent f75ea2a803
commit 9bfd40cea2
4 changed files with 7 additions and 6 deletions

View File

@ -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)
--------------------------------

View File

@ -135,7 +135,7 @@ humhub.module('content', function (module, require, $) {
};
var templates = {
permalinkBody: '<textarea rows="3" class="form-control permalink-txt" spellcheck="false" readonly>{permalink}</textarea><p class="help-block pull-right"><a href="#" onClick="clipboard.copy($(\'.permalink-txt\').text())"><i class="fa fa-clipboard" aria-hidden="true"></i> {info}</a></p>',
permalinkBody: '<div class="clearfix"><textarea rows="3" class="form-control permalink-txt" spellcheck="false" readonly>{permalink}</textarea><p class="help-block pull-right"><a href="#" data-action-click="copyToClipboard" data-action-target=".permalink-txt"><i class="fa fa-clipboard" aria-hidden="true"></i> {info}</a></p></div>',
permalinkFooter: '<a href="#" data-modal-close class="btn btn-default">{buttonClose}</a><a href="{permalink}" class="btn btn-primary" data-ui-loader>{buttonOpen}</a>'
};

View File

@ -1,4 +1,3 @@
div.required label:after {
content: " *";
//color: red;
}

View File

@ -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}