Chat: pasting image from clipboard

This commit is contained in:
2015-04-20 23:48:11 +02:00
parent 0a605ead50
commit 110723a404
9 changed files with 129 additions and 166 deletions

View File

@@ -153,7 +153,7 @@ databap.onKeyDown = function(e)
function initImageUpload()
{
//load Uploader
//Load Uploader
self.tmp('uploader', new qq.FileUploader
(
{
@@ -190,8 +190,19 @@ function initImageUpload()
));
$('.uploader_box').append($('#message_input').children());
//prompt file explorer
//Prompt file explorer
$('#upload_img').click(function(){$('#c1_file').click();});
//Clipboard handling
$(function(){$.pasteimage(function(sSource)
{
//Parse the uri to strip out "base64"
var sSourceSplit = sSource.split("base64,");
var sSourceString = sSourceSplit[1];
//Write base64-encoded string into input field
postMessage('/imgsrc '+sSourceString);
});});
}
function initSideBar()