* finish task #3086.
This commit is contained in:
@@ -112,6 +112,9 @@ function initKindeditor(afterInit)
|
||||
var file = original.clipboardData.items[0].getAsFile();
|
||||
if(file)
|
||||
{
|
||||
$('#submit').attr('disabled', 'disabled');
|
||||
$("body").click(function(){$('#submit').removeAttr('disabled');});
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(evt)
|
||||
{
|
||||
@@ -121,13 +124,17 @@ function initKindeditor(afterInit)
|
||||
var contentType = arr[0].split(";")[0].split(":")[1];
|
||||
|
||||
html = '<img src="' + result + '" alt="" />';
|
||||
$.post(createLink('file', 'ajaxPasteImage', 'uid=' + kuid), {editor: html}, function(data){cmd.inserthtml(data);});
|
||||
$.post(createLink('file', 'ajaxPasteImage', 'uid=' + kuid), {editor: html}, function(data)
|
||||
{
|
||||
cmd.inserthtml(data);
|
||||
$('#submit').removeAttr('disabled');
|
||||
});
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
/* Paste in firefox and other firefox.*/
|
||||
/* Paste in firefox and other firefox. */
|
||||
else
|
||||
{
|
||||
K(doc.body).bind('paste', function(ev)
|
||||
@@ -137,10 +144,13 @@ function initKindeditor(afterInit)
|
||||
var html = K(doc.body).html();
|
||||
if(html.search(/<img src="data:.+;base64,/) > -1)
|
||||
{
|
||||
$('#submit').attr('disabled', 'disabled');
|
||||
$("body").click(function(){$('#submit').removeAttr('disabled');});
|
||||
$.post(createLink('file', 'ajaxPasteImage', 'uid=' + kuid), {editor: html}, function(data)
|
||||
{
|
||||
if(data.indexOf('<img') == 0) data = '<p>' + data + '</p>';
|
||||
frame.html(data);
|
||||
$('#submit').removeAttr('disabled');
|
||||
});
|
||||
}
|
||||
}, 80);
|
||||
|
||||
Reference in New Issue
Block a user