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