- A upload form which submits to itself using AJAX, using code from http://www.webtoolkit.info/ajax-file-upload.html, the location of the uploaded image will be automatically inserted into the URL field and the dropdown list
- A dropdown list with a list of all images in a directory, users can select an image from the list which will then be inserted in the url field. New uploads will automatically appear in this list. This dropdown is filled by AJAX when the image dioloag is opened.
For these to work I've edited the dialogImageHtml section in jquery.wymeditor.js to add the fields and load the AJAX. I've also used two files: wymeditorajax.js which contains the ajax code and wymeditorajax.php which handles the uploads and returns file information. The PHP file returns Javascriptcode which is then eval'd by the JS-file.
To use it just edit the 3th line of the PHP file to your images directory, and make sure your HTML files are using jquery.wymeditor.js and not the packed or mini-version. I've added a zip with all the files needed to get this working.
I hope someone will find this mod usefull and/or can use my code for creating a proper plugin to do this. I have only tested it on my own server with Firefox, but it should work on most PHP enabled servers using a decent browser.