all.

I'm having a hard time figuring this out, it's the second time I need to do something with tinyMCE but this time I just can't find the answer.

Here's what I want to do: I have added a button on my editor that opens a new popup with a single text input field and a button. I want to click the button and grab the value I set in my input field, then use that value to modify what I have in my editor.

Here's what I have so far - only relevant code:

    init : function( ed, url ) {
        ed.addCommand( 'mceTooltip', function() {
            ed.windowManager.open({
                file: 'imageurl.html',
                width: 480,
                height: 180,
                inline: 1,
                title: 'Please enter an image URL'
            }, {});
        });
    }

This is what imageurl.html has:

<input type="text" id="image-url" />
<input type="button" id="submit-image-url" value="Ok" />

So, what I need to do is get whatever "image-url" text input has whenever I click the OK button, and use that text inside my editor. I know I can use ed.selection.setContent( fieldValue ) and it will replace my selected text with the image-url value, I just don't know how to get the image-url value.

The most detailed info I was able to find was http://www.tinymce.com/wiki.php/How-to_implement_a_custom_file_browser but I can't make it work for my needs. Anybody who can help me out with this? I'm sure it should be simple for somebody with more experience on this.

Thank you all for your attention.

Updated imageurl.html **

        <script>
            document.getElementById( 'submit-image-url' ).onclick = function(){
                var imageUrl = document.getElementById( 'image-url' ).value;

                window.p
Edit
Report