A directory of browser-based WYSIWYG editors


Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
browse for image / upload image

The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.



Jan 5, 2004, 2:34 PM

Post #1 of 2 (3464 views)
browse for image / upload image Can't Post


HTML area rocks!

But as in life itself there is always more that can be done and much that probably has if one only knew about it.

I have extended the insert_image.html page called when one clicks the 'image' button on the toolbar with a button that calls up another pop-up window to browse the contents of a folder and shows images in it with thumbnails and the image name alongside (this using PHP). I have a function to put a file name when clicked in my new window into the Windows clipboard and it can then be manually pasted (Ctrl + V) back into the 'Image URL' field of the insert_image.html HTML area dialog.

What I would REALLY like to do is make the field in the HTML area dialog refresh with the name I am clicking on automatically. This should be possible with some javascript something like:


function sendfilename(mytext){

But opener does not seem to work and I do not have a handle to a window name or perhaps as important a form name which would be expected (there is none it would seem on the page perhaps as it is a dialog?)

Anyone who can point me in the right direction would be for evermore considered as a hero, especially as I hope to use the same automatic updating of this dialog from a second window I want to call which will allow images to be uploaded.

I could of course just be re-inventing a wheel in which case if anyone can point me at a garage?



Dec 7, 2004, 5:49 PM

Post #2 of 2 (2877 views)
Re: [aeon] browse for image / upload image [In reply to] Can't Post

Hi. I think I may have a solution for you. Begin by checking out my screendump below.

The image browser is situated in an iframe, as is the preview. When an image is clicked in the image browser the following code is invoked. Remember that the code is situated in an iframe hence the "parent" which you can probably skip in your implementation.

I just did this customizing today and I found it really easy to combine it with my existing CMS. htmlArea is the answer to many of my prayers.

  function previewImage(imageURL) {  

parent.document.getElementById('txtFileName').value = imageURL;
var breakpoint = imageURL.lastIndexOf('/');
var imagesLocation = imageURL.slice(0,breakpoint);
var imageName = imageURL.slice(breakpoint,imageURL.length);
var thumbURL = imagesLocation + "/_thumbs" + imageName;
parent.previewImage.location = thumbURL; }

(This post was edited by jonnyl on Dec 7, 2004, 5:50 PM)
Attachments: screendump.gif (82.4 KB)


Search for (options)