04 Jun, 2017, 01:30 PM
este, hay que leer el tuto siguiente:
Cita:Webkit allows you to copy and paste images to content-editable regions, but the result is an aptly-named "webkit-fake-url" that (as far as I can tell) is completely useless for anything other than displaying the image in the local browser (there's apparently no way to get at the data from Javascript).
There's an open (but unassigned) issue in the Webkit tracker requesting that this be replaced with a data-uri:https://bugs.webkit.org/show_bug.cgi?id=49141
Steps to reproduce:
The image will appear, but inspection of the HTML source code shows the (useless) webkit-fake-url.
- Open a Mercury editor in Safari.
- Open an image file in an application that allows copying (e.g., Preview on the Mac).
- Copy the image and paste it into the Mercury editor.
This is likely to be confusing to users, since it looks like the image has been pasted successfully, but it will be broken if the content is saved and then viewed on another machine (or if the browser is closed and reopened -- the fake URLs go away when the browser is closed).
I worked around the issue with this crude patch, but there may be a more elegant way.
Código:Editable.prototype.handlePaste = function(prePasteContent) {
var cleaned, container, content, pasted;
pasted = prePasteContent.singleDiff(this.content());
if(pasted.indexOf("webkit-fake-url://") != -1){
this.content(prePasteContent); // Just throw away the paste.
}
// Normal handlePaste code continues...
Si Lucifer fue capaz de incitar una rebelión en el cielo, eso significa celos, envidia y violencia en el cielo pese a prometerte un paraíso perfecto