Add clipboard button to upload modal. Fixes #1401.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//= require jquery-1.7.2.min
|
||||
//= require identicon
|
||||
//= require mousetrap.min
|
||||
//= require clipboard.min
|
||||
//= require gollum
|
||||
//= require gollum.dialog
|
||||
//= require gollum.placeholder
|
||||
|
||||
+7
File diff suppressed because one or more lines are too long
@@ -119,6 +119,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
if ($('#minibutton-upload-page').length) {
|
||||
new ClipboardJS('#ClipboardJSlink');
|
||||
$('#minibutton-upload-page').parent().removeClass('jaws');
|
||||
$('#minibutton-upload-page').click(function(e) {
|
||||
e.preventDefault();
|
||||
@@ -161,7 +162,10 @@ $(document).ready(function() {
|
||||
$('#gollum-dialog-action-ok').attr('disabled', true);
|
||||
$('input:file').on('change', function() {
|
||||
if ($(this).val()) {
|
||||
news = 'Your uploaded file will be accessible at<br>/' + uploadDest + '/' + $('input[type=file]').val().split('\\').pop();
|
||||
filename = $('input[type=file]').val().split('\\').pop();
|
||||
upload_path = '/' + uploadDest + '/' + filename;
|
||||
clipboard_button = '<button class="btn btn-sm mb-2" id="ClipboardJSlink" data-clipboard-text="' + upload_path + '"><%=rocticon('clippy')%></button>'
|
||||
news = 'Your uploaded file will be accessible at<br>' + clipboard_button + ' ' + upload_path;
|
||||
$(".context").html(news);
|
||||
$('#gollum-dialog-action-ok').attr('disabled', false);
|
||||
|
||||
|
||||
@@ -16,8 +16,16 @@ https://github.com/stewartlord/identicon.js/blob/master/README.md
|
||||
|
||||
---
|
||||
|
||||
CSS Spinner by Franz Heidl is used under the MIT license
|
||||
CSS Spinner by Franz Heidl is used under the MIT license.
|
||||
|
||||
https://github.com/franzheidl/spinners
|
||||
|
||||
lib/gollum/public/gollum/stylesheets/_spinners.scss
|
||||
|
||||
---
|
||||
|
||||
ClipboardJS is used under the MIT license.
|
||||
|
||||
https://github.com/zenorocha/clipboard.js
|
||||
|
||||
lib/gollum/public/gollum/javascript/clipboard.min.js
|
||||
Reference in New Issue
Block a user