Salome HOME
2fefa3ad420c5ddf286c98184fb936c02268ca41
[modules/smesh.git] / doc / salome / gui / SMESH / cshdat_webhelp.htm
1 <html>\r
2 <head>\r
3 <title>SMESH reference manual</title>\r
4 \r
5 <meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
6 <meta name="description" content="WebHelp 5.50">\r
7 </head>\r
8 <body>\r
9 <script language="JavaScript">\r
10 <!--\r
11 \r
12 var gArrayCsh = new Array();\r
13 \r
14 var gstrWindowOption = "";\r
15 var gstrURL = "";\r
16 var gbWithNavPane = false;\r
17 \r
18 function CshEntityItem(strAliasId, nTopicNum, strUrl) \r
19 {\r
20     this.strAliasId = strAliasId;\r
21     this.nTopicNum = nTopicNum;\r
22     this.strUrl = strUrl;\r
23 }\r
24 \r
25 \r
26 //Try to get to topic number from hash string\r
27 function GetTopicNumberAuto(strMayBeNumber)\r
28 {\r
29    var nNum = -1;\r
30    if (strMayBeNumber.length >= 1)\r
31    {\r
32                 var strTmp = strMayBeNumber;\r
33                 var iEnd = strTmp.length;\r
34                 for (var i=0; i<iEnd; i++)\r
35                 {\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
43                 }\r
44                 nNum = parseInt(strTmp);\r
45    }\r
46    return nNum;\r
47 }\r
48 \r
49 function GetTopicNumber(strHashString)\r
50 {\r
51         var nTopicEndPos = strHashString.indexOf(',')\r
52         if (nTopicEndPos == -1) { // no window option.\r
53                 return GetTopicNumberOnly(strHashString);\r
54         }\r
55         else {\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
59                 {\r
60                         if (strWindowOption.length > strWithNavPane.length)\r
61                                 gstrWindowOption = strWindowOption.substring(strWithNavPane.length + 1);\r
62                         else\r
63                                 gstrWindowOption = "";\r
64                         gbWithNavPane = true;\r
65                 }\r
66                 else\r
67                         gstrWindowOption = strWindowOption;\r
68                 return GetTopicNumberOnly(strHashString.substring(0, nTopicEndPos));            \r
69         }\r
70 }\r
71 \r
72 function GetTopicNumberOnly(strTopicString)\r
73 {\r
74         var nEqualPos = strTopicString.indexOf('=');\r
75         if (nEqualPos == -1) {\r
76                 return GetTopicNumberAuto(strTopicString);\r
77         }\r
78         else {\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("topicid") == 0) {\r
83                         return GetTopicNumberById(strValue);\r
84                 } else if (strTopicString.toLowerCase().indexOf("remoteurl") == 0) {\r
85                         gstrURL = strValue;\r
86                         return -1;\r
87                 }\r
88 \r
89         }\r
90 }\r
91 \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
95 {\r
96         if (parent && parent != this && parent.goNext)\r
97         {\r
98                 var sHome = parent.goNext();\r
99                 if (sHome != "")\r
100                         RedirectTo(sHome);\r
101         }\r
102 }\r
103 \r
104 function getHomePage()\r
105 {\r
106         if (parent && parent != this && parent.getRelHomePage)\r
107         {\r
108                 return parent.getRelHomePage(document.location.href);\r
109         }\r
110         return "";\r
111 }\r
112 \r
113 function addRemoteProject(strPath)\r
114 {\r
115         if (parent && parent != this && parent.addProject)\r
116         {\r
117                 parent.addProject(strPath);\r
118         }\r
119 }\r
120 \r
121 //Redirect page to...\r
122 function RedirectTo(strUrl)\r
123 {\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
127                 wnd.focus();\r
128                 if (parent)\r
129                         parent.close();\r
130    }\r
131    else {\r
132         parent.document.location.href = strUrl;\r
133         window.focus();\r
134   }\r
135 }\r
136 \r
137 //Prompt the user that we can not find...\r
138 function FailToFind(strMsg)\r
139 {\r
140     RedirectToHomePage();\r
141 }\r
142 \r
143 //Find topic by topic number (defined in h file)\r
144 function FindTopicByTopicNum(nTopicNum)\r
145 {\r
146         var i = 0;\r
147         var iEnd = gArrayCsh.length;\r
148         for (i=0; i<iEnd; i++)\r
149         {\r
150                 if (gArrayCsh[i].nTopicNum == nTopicNum)\r
151                 {\r
152                         var strURL = gArrayCsh[i].strUrl;\r
153                         if (gbWithNavPane)\r
154                         {\r
155                                 var strHomePage = getHomePage();\r
156                                 if (strHomePage.length != 0)\r
157                                         strURL = strHomePage + strURL;\r
158                         }       \r
159                         RedirectTo(strURL);\r
160                         return true;\r
161                 }\r
162         }\r
163         FailToFind("Fail to find topic assocaite with topic number: " + nTopicNum);\r
164         return false;\r
165 }\r
166 \r
167 //Find topic by topic id (alias id defined in ali file)\r
168 function GetTopicNumberById(strTopicId)\r
169 {\r
170    var i = 0;\r
171    var iEnd = gArrayCsh.length;\r
172    for (i=0; i<iEnd; i++)\r
173    {\r
174         if (gArrayCsh[i].strAliasId == strTopicId)\r
175         {\r
176             return gArrayCsh[i].nTopicNum;\r
177          }\r
178    }\r
179    gstrURL = "";\r
180    return -1;\r
181 }\r
182 \r
183 //Set Context-sensitive help entity...\r
184 function SetCsh(n, strAliasId, nTopicNum, strUrl)\r
185 {\r
186    gArrayCsh[n] = new CshEntityItem(strAliasId,nTopicNum,strUrl);\r
187 }\r
188 \r
189 \r
190 function getHash()\r
191 {\r
192         if (parent && parent != this)\r
193                 return parent.location.hash;\r
194         else\r
195                 return "";\r
196 }\r
197 //-->\r
198 </script>\r
199 <script language="javascript">\r
200 <!--\r
201 \r
202 \r
203 //-->\r
204 </script>\r
205 <script language="javascript">\r
206 <!--\r
207 //Find CSH according to hash string after this page\r
208 if (getHash().length > 0)\r
209 {\r
210    // VH 05/16/00 now support \r
211    // TopicID=\r
212    // TopicNumber=\r
213    // RemoteURL=   \r
214    // and WindowsOptions\r
215    // with the format #a=xxx,b=xxx,c=xxx...\r
216    var strHashString = getHash().toString();\r
217    // 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
218    // so here need to change it back.\r
219    strHashString = strHashString.substring(1,strHashString.length);\r
220    strHashString = strHashString.replace("%072%057%057", "://");\r
221    var nTopicNum = GetTopicNumber(strHashString);\r
222 \r
223    if (nTopicNum != -1)\r
224    {\r
225       FindTopicByTopicNum(nTopicNum);\r
226    }\r
227    else\r
228    {\r
229       if (gstrURL.length > 0) \r
230         RedirectTo(gstrURL);\r
231       else\r
232         RedirectToHomePage();\r
233    }\r
234 }\r
235 else\r
236 {\r
237    RedirectToHomePage();\r
238 }\r
239 //-->\r
240 </script>\r
241 <noscript>\r
242  <p> Your browser does not support JavaScript. WebHelp Context-Sensitive Help requires JavaScript support to run.</p>\r
243 </noscript>\r
244 </body>\r
245 </html>\r
246 \r
247 \r
248 \r
249 \r
250 \r
251 \r