mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Enh: Added Clipboard.js and Permalink "Copy to clipboard" link
This commit is contained in:
parent
094405df2b
commit
20bc9e74dc
@ -45,7 +45,8 @@
|
||||
"bower-asset/nprogress": "*",
|
||||
"bower-asset/At.js": "^1.5.1",
|
||||
"bower-asset/animate.css": "*",
|
||||
"bower-asset/html5shiv": "^3.7"
|
||||
"bower-asset/html5shiv": "^3.7",
|
||||
"bower-asset/clipboard.js": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"yiisoft/yii2-codeception": "~2.0.0",
|
||||
|
@ -92,6 +92,7 @@ class AppAsset extends AssetBundle
|
||||
'humhub\assets\IE9FixesAsset',
|
||||
'humhub\assets\IEFixesAsset',
|
||||
'humhub\assets\PagedownConverterAsset',
|
||||
'humhub\assets\ClipboardJsAsset',
|
||||
];
|
||||
|
||||
/**
|
||||
|
36
protected/humhub/assets/ClipboardJsAsset.php
Normal file
36
protected/humhub/assets/ClipboardJsAsset.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
/**
|
||||
* Clipboard JS
|
||||
*
|
||||
* @author luke
|
||||
*/
|
||||
class ClipboardJsAsset extends AssetBundle
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $sourcePath = '@bower/clipboard.js';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $js = ['clipboard.min.js'];
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $css = [];
|
||||
|
||||
}
|
@ -19,6 +19,7 @@ HumHub Change Log
|
||||
- Fix: Show default error in status bar if invalid message object was provided
|
||||
- Fix #2304: Users not loaded in user selection fields.
|
||||
- Enh: Added User module 'displayNameCallback' attribute for custom display name formats
|
||||
- Enh: Added Clipboard.js and Permalink "Copy to clipboard" link
|
||||
|
||||
1.2.0-beta.2 (February 24, 2017)
|
||||
--------------------------------
|
||||
|
@ -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">{info}</p>',
|
||||
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>',
|
||||
permalinkFooter: '<a href="#" data-modal-close class="btn btn-default">{buttonClose}</a><a href="{permalink}" class="btn btn-primary" data-ui-loader>{buttonOpen}</a>'
|
||||
};
|
||||
|
||||
|
@ -121,7 +121,7 @@ class CoreJsConfig extends Widget
|
||||
'modal' => [
|
||||
'permalink' => [
|
||||
'head' => Yii::t('ContentModule.widgets_views_permaLink', '<strong>Permalink</strong> to this post'),
|
||||
'info' => Yii::t('base', 'Copy to clipboard: Ctrl/Cmd+C'),
|
||||
'info' => Yii::t('base', 'Copy to clipboard'),
|
||||
'buttonOpen' => Yii::t('base', 'Open'),
|
||||
'buttonClose' => Yii::t('base', 'Close'),
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user