1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--Thanks to Tom Bovingdon and Rob Rix-->
5 <script>document.write("<title>"+window.opener.lblInsertLink+"</title>");</script>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <style type="text/css">
9 body { background-color: #EFEDDE; margin: 10px;}
10 table { font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12px; }
11 legend { font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 14px; padding-left: 5px; padding-right: 8px; }
12 .style2 {font-size: 18px; background:black; font-wieght:bold; color:white; display:block; width:100%; }
13 .show {left:auto;top:auto;position:auto;}
14 .hide {left:-1000px;top:-1000px;position:absolute;}
17 <script language="JavaScript" type="text/javascript">
20 window.resizeTo(525, 255);
22 window.resizeTo(513, 250);
24 function get_anchors() {
25 document.getElementById('trDocumentAnchors').className="hide";
26 rte = window.opener.document.getElementById('hdn'+window.opener.currentRTE).value
27 re = new RegExp("<[aA][^>]+?name=\"?(.+?)(\".*?>|>)", "m")
32 m = re.exec(RegExp.rightContext)
35 s = anchors.length + " matches:\n"
36 for(i = 0; i < anchors.length; i++) {
37 s = s + "- " + anchors[i] + "\n"
38 document.forms['linkForm'].DocumentAnchors.options[i] = new Option(anchors[i],anchors[i]);
42 document.forms['linkForm'].DocumentAnchors.options[0] = new Option(window.opener.lblLinkNoA,'');
48 function setType(type) {
49 var aa = document.getElementById('trText');
50 var ab = document.getElementById('trTarget');
51 var ac = document.getElementById('trAddress');
52 var ad = document.getElementById('trDocumentAnchors');
55 baseurl= '<a href="mailto:';
61 window.resizeTo(525, 225);
63 window.resizeTo(513, 218);
73 window.resizeTo(525, 190);
75 window.resizeTo(513, 185);
79 baseurl= '<a href=""';
86 window.resizeTo(525, 222);
88 window.resizeTo(513, 218);
98 window.resizeTo(525, 255);
100 window.resizeTo(513, 250);
106 var oForm = document.linkForm;
111 var selIndex = document.linkForm.linktype.options[document.linkForm.linktype.selectedIndex].value;
127 oForm.url.value=document.linkForm.DocumentAnchors.options[document.linkForm.DocumentAnchors.selectedIndex].value;
131 oForm.linkText.value=' ';
138 if (oForm.url.value == '') {
139 alert(window.opener.lblLinkVal0);
142 if (oForm.linkText.value != '' && (selIndex == "http" || selIndex == "https" || selIndex == "ftp" || selIndex == "relative" )) {
143 html = '<a '+ prefix + '="'+protocol + document.linkForm.url.value + '" target="' + document.linkForm.linkTarget.options[document.linkForm.linkTarget.selectedIndex].value + '">' + document.linkForm.linkText.value + '</a>';
144 window.opener.insertHTML(html);
145 } else if(oForm.linkText.value != '') {
146 html = '<a '+ prefix + '="'+protocol + document.linkForm.url.value + '">' + document.linkForm.linkText.value + '</a>';
147 window.opener.insertHTML(html);
149 var param=protocol+document.linkForm.url.value + '" target="' + document.linkForm.linkTarget.options[document.linkForm.linkTarget.selectedIndex].value + '"';
150 window.opener.document.getElementById(rte).contentWindow.document.execCommand('createLink',false,param );
157 </head><body onload="get_anchors()"><form name="linkForm">
158 <table cellpadding="0" cellspacing="0" border="0" width=100%><tr>
159 <td><fieldset style="margin-left: 5px;"><legend><script>document.write(window.opener.lblInsertLink);</script></legend>
160 <div style="padding: 2px;"></div><table cellpadding="4" cellspacing="0" border="0" width=100%><tr>
161 <td align="right" nowrap><script>document.write(window.opener.lblLinkType);</script>:</td>
162 <td><select name="linktype" onChange="setType(this.value);" style="height:18px;font-size:14px">
163 <option value="http" selected>http://</option>
164 <option value="https">https://</option>
165 <option value="ftp">ftp://</option>
166 <script>if(!document.all) document.write("<option value=\"relative\">relative</option>")</script>
167 <option value="mailto">email</option>
168 <option value="oldanchor"><script>document.write(window.opener.lblLinkOldA);</script></option>
169 <option value="newanchor"><script>document.write(window.opener.lblLinkNewA);</script></option>
173 <tr name="trDocumentAnchors" id="trDocumentAnchors">
174 <td align="right" nowrap><script>document.write(window.opener.lblLinkAnchors);</script>:</td>
176 <select name="DocumentAnchors" id="DocumentAnchors" style="height:18px;font-size:14px">
179 <tr name="trAddress" id="trAddress">
180 <td align="right" nowrap><script>document.write(window.opener.lblLinkAddress);</script>:</td>
181 <td><input name="url" type="text" id="url" style="width:250px;height:18px;font-size:14px" value=""></td>
183 <tr name="trText" id="trText">
184 <td align="right" nowrap><script>document.write(window.opener.lblLinkText);</script>:</td>
185 <td><input name="linkText" type="text" id="linkText" style="width:250px;height:18px;font-size:14px" value=""></td>
187 <tr name="trTarget" id="trTarget">
188 <td align="right" nowrap><script>document.write(window.opener.lblLinkOpenIn);</script>:</td>
190 <select name="linkTarget" id="linkTarget" style="width:180px;height:18px;font-size:14px">
191 <option value="_blank">_blank</option>
192 <option value="_self" selected>_self</option>
193 <option value="_parent">_parent</option>
194 <option value="_top">_top</option>
199 <div style="padding: 2px;"></div>
200 </fieldset></td><td><td align="left" valign="top" style="padding: 8px;">
201 <input type="button" name="btnsubmit" value="" onclick="AddLink();" style="width:100px;"/><br>
202 <input type="button" name="btncancel" value="" onClick="window.close();" style="width:100px;"/>
203 </td></tr></table></form></body></html>
205 document.getElementById('trDocumentAnchors').className="hide";
206 document.linkForm.btnsubmit.value = window.opener.lblLinkSubmit;
207 document.linkForm.btncancel.value = window.opener.lblLinkCancel;