From 2f05753c8e857654bd602141de2742a1fcbc7ffc Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 8 Oct 2017 16:15:15 +1300 Subject: [PATCH] working paste uploader --- static/sdk.js | 7 +++++++ static/widget.html | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/static/sdk.js b/static/sdk.js index 5e0ab69..172fd71 100644 --- a/static/sdk.js +++ b/static/sdk.js @@ -122,6 +122,13 @@ var contented = (function ($, currentScriptPath) { 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); var setProgressCaption = function(message) { diff --git a/static/widget.html b/static/widget.html index ddbacf6..a1d09da 100644 --- a/static/widget.html +++ b/static/widget.html @@ -75,8 +75,7 @@ .contented textarea { resize: none; width:100%; - height:100%; - padding: 0; + height:calc(100% - 1em - 15px); box-sizing:border-box; } .contented-progress-bar { @@ -137,7 +136,8 @@
- + +