home *** CD-ROM | disk | FTP | other *** search
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
- <HTML id=dlgLink style="font-family: ms sans serif; font-size: 8pt;
- width: 36.7em; height: 12.3em; ">
- <HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>Hyperlink</TITLE>
- <SCRIPT>
- function callHelp(elm)
- {
- if (null != elm.helpid)
- {
- window.showHelp(elm.helpfile, "" + parseInt(elm.helpid));
- }
- else
- {
- if ("BODY" != elm.tagName)
- {
- callHelp(elm.parentElement);
- }
- }
- }
- function btnCancelClick()
- {
- window.close();
- }
- function getTextRange(elm)
- {
- var r = elm.parentTextEdit.createTextRange();
- r.moveToElementText(elm);
- return r;
- }
- function mouseClick()
- {
- if (window.event.srcElement.id.substring(0,3)
- == "txt")
- {
- return;
- }
- if (window.event.button == 2)
- {
- callHelp(window.event.srcElement);
- }
- }
- function txtDefaultESC()
- {
- if (event.keyCode == 27)
- {
- window.close();
- return;
- }
- }
- var g_fOKEnabled = false;
- var g_fURLLoaded = false;
- function findAnchor(range)
- {
- var rangeWorking;
- var elmWorking;
- var index;
- elmWorking = range.parentElement()
- while ("HTML" != elmWorking.tagName)
- {
- if ("A" == elmWorking.tagName)
- {
- return elmWorking;
- }
- else
- {
- elmWorking = elmWorking.parentElement
- }
- }
- rangeWorking = range.duplicate();
- rangeWorking.collapse(true);
- rangeWorking.moveEnd("character", 1);
- while (rangeWorking.compareEndPoints("EndToEnd", range) < 0)
- {
- rangeWorking.move("Character");
- if (null != findAnchor(rangeWorking))
- {
- return findAnchor(rangeWorking);
- }
- }
- return null;
- }
- function getProtocolFromURL(strURL)
- {
- var index;
- return strURL.substring(0, strURL.indexOf(":") + 1);
- }
- function updateProtocolSel()
- {
- var index;
- var strProtocol = getProtocolFromURL(txtURL.value);
- selProtocol.value = strProtocol;
- if (selProtocol.value != strProtocol)
- {
- selProtocol.value = "";
- }
- }
- function updateProtocolTxt()
- {
- var strSlashProts = " file:ftp:gopher:http:https:";
- var strProtocolTxt = getProtocolFromURL(txtURL.value);
- var strProtocolSel = selProtocol.value;
- var strTempURL;
- if ("//" == (txtURL.value.substring(strProtocolTxt.length,
- strProtocolTxt.length + 2)))
- {
- strProtocolTxt = strProtocolTxt + "//";
- }
- strTempURL = txtURL.value.substring(strProtocolTxt.length);
- if (0 < strSlashProts.indexOf(strProtocolSel))
- {
- strProtocolSel = strProtocolSel + "//";
- }
- txtURL.value = strProtocolSel + strTempURL;
- }
- function setOKState(fKeyPress)
- {
- var htmlKeyAlt = 18;
- if (!g_fURLLoaded)
- {
- if (!fKeyPress || htmlKeyAlt != event.keyCode)
- {
- if ((("" == txtURL.value) || (txtURL.value == selProtocol.value)
- ||(txtURL.value == selProtocol.value + "//"))
- == g_fOKEnabled)
- {
- btnOK.disabled = g_fOKEnabled
- g_fOKEnabled = !g_fOKEnabled;
- }
- }
- else
- {
- window.setTimeout("setOKState(false)", 10);
- }
- }
- }
- function bdyLoad()
- {
- var globalDoc = window.dialogArguments.document;
- var rngMaster;
- var rngLink;
- var elmLink;
- document.onhelp = new
- Function("callHelp(window.event.srcElement)");
- document.onmouseup = new Function("mouseClick()");
- selProtocol.onchange = new Function("updateProtocolTxt()");
- btnOK.onclick = new Function("btnOKClick()");
- btnCancel.onclick = new Function("btnCancelClick()");
- txtURL.onfocus = new Function("txtURL.select()");
- txtURL.onkeyup = new Function("setOKState(true)");
- txtURL.onkeypress = new Function("txtDefaultESC()");
- if (("Text" == globalDoc.selection.type) ||
- ("None" == globalDoc.selection.type))
- {
- rngMaster = globalDoc.selection.createRange();
- elmLink = findAnchor(rngMaster);
- if (null != elmLink)
- {
- rngLink = getTextRange(elmLink);
- if (rngLink.compareEndPoints("StartToStart", rngMaster) < 0)
- {
- rngMaster.setEndPoint("StartToStart", rngLink);
- }
- if (rngLink.compareEndPoints("EndToEnd", rngMaster) > 0)
- {
- rngMaster.setEndPoint("EndToEnd", rngLink);
- }
- rngMaster.select();
- if ("" != elmLink.href)
- {
- txtURL.value = elmLink.href;
- txtURL.href = elmLink.href;
- g_fURLLoaded = true;
- btnOK.disabled = false;
- }
- updateProtocolSel();
- }
- txtURL.select();
- setOKState(false);
- }
- }
- function btnOKClick()
- {
- var globalDoc = window.dialogArguments.document;
- var cmdCreateLink = "CreateLink";
- var cmdUnlink = "Unlink";
- var range = globalDoc.selection.createRange();
- var strSlashProts = " file:ftp:gopher:http:https:";
- var strProtocol = selProtocol.value;
- if ("" == txtURL.value)
- {
- range.execCommand(cmdUnlink, false);
- window.close();
- return;
- }
- if (g_fURLLoaded && (txtURL.value == txtURL.href))
- {
- window.close();
- return;
- }
- updateProtocolSel();
- if (0 < strSlashProts.indexOf(strProtocol))
- {
- strProtocol = strProtocol + "//";
- }
- range.execCommand(cmdCreateLink, false, txtURL.value);
- window.close();
- }
- </SCRIPT>
- </HEAD>
- <BODY style="font-family: ms sans serif; font-size: 8pt;
- background: threedface;" onLoad="bdyLoad()">
- <FIELDSET id=fldLink style="font-family: ms sans serif; font-size: 8pt;
- position: absolute; left: 0.98em; top: .8em; width: 25.76em;
- height: 7.9em;">
- <LEGEND>
- Hyperlink Information
- </LEGEND>
- </FIELDSET>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 1.82em; top: 2.8899em; width: 2.66em; height: 1.2168em; " id=div2>
- <LABEL FOR=selProtocol tabIndex=-1 helpid="35550" helpfile="msimn.hlp">
- <u>T</u>ype:
- </LABEL>
- </DIV>
- <select id=selProtocol size=1 ACCESSKEY=t tabIndex=50
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 5.04em; top: 2.7378em; width: 6.44em; height: 2.1294em; "
- helpid="35550" helpfile="msimn.hlp">
- <OPTION value=""> (other) </OPTION>
- <OPTION value="file:"> file: </OPTION>
- <OPTION value="ftp:"> ftp: </OPTION>
- <OPTION value="gopher:"> gopher: </OPTION>
- <OPTION value="http:" SELECTED> http: </OPTION>
- <OPTION value="https:"> https: </OPTION>
- <OPTION value="mailto:"> mailto: </OPTION>
- <OPTION value="news:"> news: </OPTION>
- <OPTION value="telnet:"> telnet: </OPTION>
- <OPTION value="wais:"> wais: </OPTION>
- </select>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 1.82em; top: 5.9319em; width: 2.52em; height: 1.2168em; " id=div3>
- <LABEL FOR=txtURL tabIndex=-1 helpid="35550" helpfile="msimn.hlp">
- <u>U</u>RL:
- </LABEL>
- </DIV>
- <input accesskey=u ID="txtURL" value="http://" type=text size=35
- maxlength=256 tabIndex=15 helpid="35550" helpfile="msimn.hlp"
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 5.04em; top: 5.6277em; width: 20.72em; height: 2.1294em; ">
- <BUTTON id=btnOK tabIndex=35 DISABLED=1 helpid="28443" helpfile="windows.hlp"
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 28em; top: 1.521em; width: 7em; height: 2.1294em; " type=submit>
- OK
- </BUTTON>
- <BUTTON id=btnCancel tabIndex=40 helpid="28444" helpfile="windows.hlp"
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 28em; top: 4.1067em; width: 7em; height: 2.1294em; " type=reset>
- Cancel
- </BUTTON>
- </BODY>
- </HTML>
-