I wanted to add an example of the yuiImgUploader script working with YUI version 2.6.0. If you haven't read the original YUI Image Uploader page, start there. After that, you can use this page for an example getting the script to work with the latest YUI.

That changes from the previous 2.5 Image uploader are quite small. If you were using a pre 2.6 version of the editor, simply change the location of a couple scripts and add your editor name to the yuiImgUploader function parameters.

Here is the new yui-image-uploader26.js file.


Here is the initialization JavaScript for the editor on this page. You can find information on Yahoo's Rich text editor here.

 
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/assets/skins/sam/skin.css" />
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/element/element-beta-min.js"></script>
<script src="http://yui.yahooapis.com/2.6.0/build/container/container_core-min.js"></script>
<script src="http://yui.yahooapis.com/2.6.0/build/menu/menu-min.js"></script>
<script src="http://yui.yahooapis.com/2.6.0/build/button/button-min.js"></script>
<script src="http://yui.yahooapis.com/2.6.0/build/editor/editor-min.js"></script>
<script src="http://yui.yahooapis.com/2.6.0/build/connection/connection-min.js"></script>
<script src="/wp-content/uploads/2007/10/yui-image-uploader26.js"></script>
<script type="text/javascript">
var myEditor = new YAHOO.widget.Editor('example_editor', { 
	    height: '300px', 
	    width: '522px', 
	    dompath: true, 
	    animate: true 
	}); 
/*
 Don't forget to replace yuiImgUploader parameters with proper values for your server.
*/
yuiImgUploader(myEditor, 'example_editor', '/wp-content/uploads/2007/12/yui_img_uploader.php','image');
	myEditor.render(); 
</script>

I left the server side image upload script the same as with previous versions of this script.

Feel free to leave a comment or contact me if you have questions or suggestions.