Attempt to implement image save using data URLs.
commit0efecd74a533dcaa5f27bf5061618cc54fb2e33e
authorMihai Sucan <mihai.sucan@gmail.com>
Fri, 24 Jul 2009 19:03:24 +0000 (24 22:03 +0300)
committerMihai Sucan <mihai.sucan@gmail.com>
Mon, 16 Nov 2009 17:05:53 +0000 (16 19:05 +0200)
tree9b6c4435d509f92670e7026158ce5b2e4df3e2da
parent173e9c9c7aac676793726e8b83aefddfd0327312
Attempt to implement image save using data URLs.

The attempt consisted of getting the TinyMCE plugin and the Moodle extension for
PaintWeb to update the target image src attribute to hold the data URL generated
by the browser. This is doable, but the attempt pretty much failed. Reasons:

- TinyMCE does not really allow a plugin to manually change the .src DOM
attribute for the image element, thus I must use their dom.setAttrib() method.
If I do, their attribute value processing functions break the date URL making it
invalid. If I manually set image.src to be what I want, it looks good in the
browser, but when you save the textarea content will still point to the old
image src attribute. Yay!

- For some reason, Webkit considers images with data URLs as "external
resources", thus when I draw them in Canvas, the Canvas is marked as dirty
(security violation). Therefore, In Chrome/Safari one cannot edit data URLs and
save them again.

- Firefox crashes/freezes sometimes when TinyMCE + data URLs are used. Uh-oh.
lang/en_utf8/paintweb.php
lib/editor/tinymce/jscripts/tiny_mce/plugins/paintweb/editor_plugin.js
lib/editor/tinymce/jscripts/tiny_mce/plugins/paintweb/editor_plugin_src.js
lib/paintweb/build/paintweb.js
lib/paintweb/build/paintweb.src.js
lib/paintweb/ext/moodle/gen_moodlelang.php
lib/paintweb/ext/tinymce-plugin/paintweb/editor_plugin.js
lib/paintweb/ext/tinymce-plugin/paintweb/editor_plugin_src.js
lib/paintweb/src/extensions/moodle.js