working paste uploader
This commit is contained in:
parent
36145c0a2f
commit
2f05753c8e
@ -122,6 +122,13 @@ var contented = (function ($, currentScriptPath) {
|
|||||||
handleUploadFrom($(".contented-file-selector")[0].files);
|
handleUploadFrom($(".contented-file-selector")[0].files);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$f.find('.contented-paste-upload').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
var blob = new Blob([$(".contented-if-paste textarea").val()], {type : 'text/plain'});
|
||||||
|
handleUploadFrom([blob]);
|
||||||
|
});
|
||||||
|
|
||||||
$("body").append($f);
|
$("body").append($f);
|
||||||
|
|
||||||
var setProgressCaption = function(message) {
|
var setProgressCaption = function(message) {
|
||||||
|
@ -75,8 +75,7 @@
|
|||||||
.contented textarea {
|
.contented textarea {
|
||||||
resize: none;
|
resize: none;
|
||||||
width:100%;
|
width:100%;
|
||||||
height:100%;
|
height:calc(100% - 1em - 15px);
|
||||||
padding: 0;
|
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
}
|
}
|
||||||
.contented-progress-bar {
|
.contented-progress-bar {
|
||||||
@ -137,7 +136,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="contented-upload-if contented-if-paste">
|
<div class="contented-upload-if contented-if-paste">
|
||||||
<textarea name="paste-content"></textarea>
|
<textarea placeholder="Paste content here"></textarea>
|
||||||
|
<button class="contented-paste-upload">Upload »</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="contented-upload-if contented-if-progress">
|
<div class="contented-upload-if contented-if-progress">
|
||||||
|
Loading…
Reference in New Issue
Block a user