I am working with content management system,
here an Admin can add a new content with text,images,etc..
while doing this i want to add a Text as hyperlink.
If we want to add a image then we will click the image button it brings a small popup window, there u can browse the image. The image url will be placed in a textbox, then the image will be place in the content once u have clicked the ok button.
var htmlSelectionControl = "Control";
var globalDoc = window.dialogArguments;
var grngMaster = globalDoc.selection.createRange();
idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID
grngMaster.execCommand("InsertImage", false, idstr);
elmLink = globalDoc.all['556e697175657e537472696e67'];
elmLink.src = txtFilevideo.value;
similarly I want to click a image button it should bring a popup window, there I can browse the image.
The image url should be placed in one textbox and the Name of the Image should be typed in another textbox.
If I click ok button the Name should be placed inside the content as Hyperlink. If I click the hyperlink
it will open the image separately.
How the globalDoc.seletion.CreateRange() is working and what is the need of idstr.
I have tried a a lot with the above script, I don't know where I am struggling. Can anyone tell me how to full fill my requirement.
similar example scripts available here.