this.tag_image = function()
{
var FoundErrors = '';
var need_loop = true;
var oFields = {
"URL" : {
"text" : oText['enter_image'],
"default" : "http://",
"error" : oErrors['no_url'],
"value" : ""}};
var selection = t.GetSelection();
if (selection != false && selection.search(/^(http|https|news|ftp|aim|mailto)\:\/\//gi) > -1)
{
oFields["URL"]["default"] = selection;
}
else
{
selection = false;
}
for (var ii in oFields)
{
need_loop = true;
do
{
var res = prompt(oFields[ii]["text"], oFields[ii]["default"]);
if (res == null)
{
need_loop = false;
return false;
}
else if (res.length <= 0)
{
alert("Error! " + oFields[ii]["error"]);
}
else
{
oFields[ii]["value"] = res;
need_loop = false;
}
}
while(need_loop);
}
this.Insert("[IMG]", "[/IMG]", oFields["URL"]["value"]);
}, |