Forum OpenACS Q&A: Re: In widget URL changing to a relative link, deleting Sub Domain required.

Thanks for your reply Torben. However, the code to do this is in Javascript.

Below is the  Javascript function AddLink, and there's more code for the function dlgInsertLink

I believe it's the  dlgInsertLink that I need to change because that's where the first part of the link is stripped off.  Can anyone confirm this for me please?

<script language="JavaScript" type="text/javascript">
<!--
function AddLink() {
    var oForm = document.linkForm;

    //validate form
    if (oForm.url.value == '') {
        alert('Please enter a url.');
        return false;
    }
    if (oForm.linkText.value == '') {
        alert('Please enter link text.');
        return false;
    }

    var html = '<a href="' + document.linkForm.url.value + '" target="' + document.linkForm.linkTarget.options[document.linkForm.linkTarget.selectedIndex].value + '">' + document.linkForm.linkText.value + '</a>';

window.opener.insertHTML(html);
    window.close();
    return true;
}
//-->

=================

/acs-templating/www/resources/rte/richtext.js has some code for insert_link.  Insert Link calls dlgInsertLink

Is this where I need to change the code to make the Link always  Absolute.

document.writeln('
<td>
<img class="rteImage" src="' + imagesPath + 'hyperlink.gif" width="25" height="24"
alt="Insert Link" title="Insert Link" onClick="dlgInsertLink(\'' + rte + '\', \'link\')">

</td>');

This is function  dlgInsertLink(rte, command)

document.writeln('              <td><img class="rteImage" src="' + imagesPath + 'hyperlink.gif" width="25" height="24"
alt="Insert Link" title="Insert Link" onClick="dlgInsertLink(\'' + rte + '\', \'link\')"></td>');

Thanks in advance,

Julienane