3 <title>SMESH reference manual</title>
\r
4 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
\r
5 <meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
\r
6 <meta name "description" content="WebHelp 2002">
\r
9 <script language="JavaScript">
\r
12 var gArrayCsh = new Array();
\r
14 var gstrWindowOption = "";
\r
16 var gbWithNavPane = false;
\r
18 function CshEntityItem(strAliasId, nTopicNum, strUrl)
\r
20 this.strAliasId = strAliasId;
\r
21 this.nTopicNum = nTopicNum;
\r
22 this.strUrl = strUrl;
\r
26 //Try to get to topic number from hash string
\r
27 function GetTopicNumberAuto(strMayBeNumber)
\r
30 if (strMayBeNumber.length >= 1)
\r
32 var strTmp = strMayBeNumber;
\r
33 var iEnd = strTmp.length;
\r
34 for (var i=0; i<iEnd; i++)
\r
36 var ch = strTmp.charAt(i);
\r
37 if (!((ch == "0") || (ch == "1") ||
\r
38 (ch == "2") || (ch == "3") ||
\r
39 (ch == "4") || (ch == "5") ||
\r
40 (ch == "6") || (ch == "7") ||
\r
41 (ch == "8") || (ch == "9")))
\r
42 return GetTopicNumberById(strTmp);
\r
44 nNum = parseInt(strTmp);
\r
49 function GetTopicNumber(strHashString)
\r
51 var nTopicEndPos = strHashString.indexOf(',')
\r
52 if (nTopicEndPos == -1) { // no window option.
\r
53 return GetTopicNumberOnly(strHashString);
\r
56 var strWindowOption = strHashString.substring(nTopicEndPos + 1, strHashString.length);
\r
57 var strWithNavPane = 'withnavpane=true';
\r
58 if (strWindowOption.toLowerCase().indexOf(strWithNavPane) == 0)
\r
60 if (strWindowOption.length > strWithNavPane.length)
\r
61 gstrWindowOption = strWindowOption.substring(strWithNavPane.length + 1);
\r
63 gstrWindowOption = "";
\r
64 gbWithNavPane = true;
\r
67 gstrWindowOption = strWindowOption;
\r
68 return GetTopicNumberOnly(strHashString.substring(0, nTopicEndPos));
\r
72 function GetTopicNumberOnly(strTopicString)
\r
74 var nEqualPos = strTopicString.indexOf('=');
\r
75 if (nEqualPos == -1) {
\r
76 return GetTopicNumberAuto(strTopicString);
\r
79 var strValue=strTopicString.substring(nEqualPos + 1, strTopicString.length);
\r
80 if (strTopicString.toLowerCase().indexOf("topicnumber") == 0) {
\r
81 return parseInt(strValue);
\r
82 } else if (strTopicString.toLowerCase().indexOf("context") == 0) {
\r
83 return GetTopicNumberById(strValue);
\r
84 } else if (strTopicString.toLowerCase().indexOf("remoteurl") == 0) {
\r
92 //Find HomePage of the WebHelp system
\r
93 // we try to get the topic from remote project if it exists.
\r
94 function RedirectToHomePage()
\r
96 if (parent && parent != this && parent.goNext)
\r
98 var sHome = parent.goNext();
\r
104 function getHomePage()
\r
106 if (parent && parent != this && parent.getRelHomePage)
\r
108 return parent.getRelHomePage(document.location.href);
\r
113 function addRemoteProject(strPath)
\r
115 if (parent && parent != this && parent.addProject)
\r
117 parent.addProject(strPath);
\r
121 //Redirect page to...
\r
122 function RedirectTo(strUrl)
\r
124 if (gstrWindowOption.length != 0) {
\r
125 var wnd = window.open(strUrl, "HelpStub", gstrWindowOption);
\r
126 // close current window and rename the stub window to current window.
\r
133 parent.document.location.href = strUrl;
\r
138 //Prompt the user that we can not find...
\r
139 function FailToFind(strMsg)
\r
141 RedirectToHomePage();
\r
144 //Find topic by topic number (defined in h file)
\r
145 function FindTopicByTopicNum(nTopicNum)
\r
148 var iEnd = gArrayCsh.length;
\r
149 for (i=0; i<iEnd; i++)
\r
151 if (gArrayCsh[i].nTopicNum == nTopicNum)
\r
153 var strURL = gArrayCsh[i].strUrl;
\r
156 var strHomePage = getHomePage();
\r
157 if (strHomePage.length != 0)
\r
158 strURL = strHomePage + strURL;
\r
160 RedirectTo(strURL);
\r
164 FailToFind("Fail to find topic assocaite with topic number: " + nTopicNum);
\r
168 //Find topic by topic id (alias id defined in ali file)
\r
169 function GetTopicNumberById(strTopicId)
\r
172 var iEnd = gArrayCsh.length;
\r
173 for (i=0; i<iEnd; i++)
\r
175 if (gArrayCsh[i].strAliasId.toLowerCase() == strTopicId.toLowerCase())
\r
177 return gArrayCsh[i].nTopicNum;
\r
184 //Set Context-sensitive help entity...
\r
185 function SetCsh(n, strAliasId, nTopicNum, strUrl)
\r
187 gArrayCsh[n] = new CshEntityItem(strAliasId,nTopicNum,strUrl);
\r
193 if (parent && parent != this)
\r
194 return parent.location.hash;
\r
200 <script language="javascript">
\r
206 <script language="javascript">
\r
208 //Find CSH according to hash string after this page
\r
209 if (getHash().length > 0)
\r
211 // VH 05/16/00 now support
\r
215 // and WindowsOptions
\r
216 // with the format #a=xxx,b=xxx,c=xxx...
\r
217 var strHashString = getHash().toString();
\r
218 // change ? to : for remote URL. because java applet have some problem to pass a URL with two : inside the URL so we changed it.
\r
219 // so here need to change it back.
\r
220 strHashString = strHashString.substring(1,strHashString.length);
\r
221 strHashString = strHashString.replace("%072%057%057", "://");
\r
222 var nTopicNum = GetTopicNumber(strHashString);
\r
224 if (nTopicNum != -1)
\r
226 FindTopicByTopicNum(nTopicNum);
\r
230 if (gstrURL.length > 0)
\r
231 RedirectTo(gstrURL);
\r
233 RedirectToHomePage();
\r
238 RedirectToHomePage();
\r
243 <p> Your browser does not support JavaScript. WebHelp Context-Sensitive Help requires JavaScript support to run.</p>
\r