paste image on chrome

This commit is contained in:
life
2014-06-08 18:03:23 +08:00
parent c55f364153
commit 63b65920db
4 changed files with 30 additions and 14 deletions

View File

@ -281,7 +281,6 @@ define("tinymce/pasteplugin/Clipboard", [
}
// load image if there is a pasted image
if (blob) {
log(blob);
var reader = new FileReader();
reader.onload = function(event) {
// 上传之
@ -323,10 +322,14 @@ define("tinymce/pasteplugin/Clipboard", [
});
};
reader.readAsDataURL(blob);
return true;
}
return false;
}
editor.on('paste', function(e) {
var clipboardContent = getClipboardContent(e);
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 100;
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
@ -378,13 +381,18 @@ define("tinymce/pasteplugin/Clipboard", [
pasteHtml(html, clipboardContent['text/plain']);
}
}, 0);
//-----------
// paste image
try {
if(pasteImage(e)) {
return;
}
} catch(e) {};
});
//-----------
// paste image
try {
pasteImage(e);
} catch(e) {};
self.pasteHtml = pasteHtml;
self.pasteText = pasteText;

View File

@ -117,4 +117,4 @@
writeScripts();
})(this);
// $hash: 5b06d9e98fb338fd1b0ff7ee116ca480
// $hash: cbcf61872b3ecc41bd22dcf691e2e4dd

View File

@ -466,7 +466,6 @@ define("tinymce/pasteplugin/Clipboard", [
}
// load image if there is a pasted image
if (blob) {
log(blob);
var reader = new FileReader();
reader.onload = function(event) {
// 上传之
@ -508,10 +507,14 @@ define("tinymce/pasteplugin/Clipboard", [
});
};
reader.readAsDataURL(blob);
return true;
}
return false;
}
editor.on('paste', function(e) {
var clipboardContent = getClipboardContent(e);
var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 100;
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
@ -563,13 +566,18 @@ define("tinymce/pasteplugin/Clipboard", [
pasteHtml(html, clipboardContent['text/plain']);
}
}, 0);
//-----------
// paste image
try {
if(pasteImage(e)) {
return;
}
} catch(e) {};
});
//-----------
// paste image
try {
pasteImage(e);
} catch(e) {};
self.pasteHtml = pasteHtml;
self.pasteText = pasteText;

File diff suppressed because one or more lines are too long