W
wilsoncpu
I have a WYSIWYG editor (WidgEditor) I'm using on one of my sites.
It's nice, but the only function it has to enter an image into the
code being edited is a prompt box. ("Enter the location of the image",
and a text box.)
This works, but is in no way user-friendly. I could make a popup
window with a selection of thumbnails in it, and let them choose one,
at which point I can populate a text field in the popup window. I
suppose I could even copy that value to a hidden field inside the
opening file.
("opener.document.getElementById('imagepath')=this.getAttribute('imagechoice')").
But that sort of open isn't going to wait in the calling routine the
same way it does for a construct like:
var theImage = prompt("Enter the location for this image:", "");
if ([value of theImage is OK,proceed...]) ...
(a) Is there a way to build a replacement for the prompt that can be
customized the way I want, and still act like a prompt, with the
calling routine pausing until the prompt is satisfied?
(b) If not, are there any other suggestions?
I'm guessing this is basically a common problem, but I'm a bit
constrained by not wanting to completely re-write the WYSIWYG editor;
I'm just trying to add some helpful functionality for my users.
It's nice, but the only function it has to enter an image into the
code being edited is a prompt box. ("Enter the location of the image",
and a text box.)
This works, but is in no way user-friendly. I could make a popup
window with a selection of thumbnails in it, and let them choose one,
at which point I can populate a text field in the popup window. I
suppose I could even copy that value to a hidden field inside the
opening file.
("opener.document.getElementById('imagepath')=this.getAttribute('imagechoice')").
But that sort of open isn't going to wait in the calling routine the
same way it does for a construct like:
var theImage = prompt("Enter the location for this image:", "");
if ([value of theImage is OK,proceed...]) ...
(a) Is there a way to build a replacement for the prompt that can be
customized the way I want, and still act like a prompt, with the
calling routine pausing until the prompt is satisfied?
(b) If not, are there any other suggestions?
I'm guessing this is basically a common problem, but I'm a bit
constrained by not wanting to completely re-write the WYSIWYG editor;
I'm just trying to add some helpful functionality for my users.