]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/WebHelp/whskin_papplet.htm
Salome HOME
Context help is introduced.
[tools/siman.git] / Workspace / Siman / WebContent / WebHelp / whskin_papplet.htm
1 <html>
2 <head>
3 <title>Navigation Pane</title>
4
5 <meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">
6 <meta name="description" content="WebHelp 5.50">
7 <script language="javascript" src="whver.js"></script>
8 <script language="javascript1.2" src="whmsg.js"></script>
9 <script language="javascript1.2" src="whproxy.js"></script>
10 <script language="javascript1.2" src="whutils.js"></script>
11 <script language="javascript1.2">
12 <!--
13 var gsInitPane="toc";
14 var gsCurrentPane="";
15 var gbLoading = "unknown";
16 var gbTryTime = 0;
17 var gbMaxTryTime = 6;
18 var gbPassPhase0 = 0;
19 var gbretried = 0;
20 var gbmaxretry = 3;
21 var gbretrytime = new Array();
22
23 var origWidth = 0;
24 var origHeight = 0;
25
26 gbretrytime[0]= 5000;
27 gbretrytime[1]= 30000;
28 gbretrytime[2]= 60000;
29
30 function addPane(sName, sFile)
31 {
32 }
33
34 function setShowPane(sName)
35 {
36         gsInitPane=sName;
37 }
38   addPane("toc","whtdhtml.htm");
39   addPane("fts","whfdhtml.htm");
40   setShowPane("toc");
41
42
43 function window_unload()
44 {
45         if (!gbNav4 || gbNav6) // resize will call unload, but the register code will never be called on Netscape 4.
46         {
47                 UnRegisterListener2(this, WH_MSG_SHOWTOC);
48                 UnRegisterListener2(this, WH_MSG_SHOWIDX);
49                 UnRegisterListener2(this, WH_MSG_SHOWFTS);
50                 UnRegisterListener2(this, WH_MSG_SHOWGLO);
51                 UnRegisterListener2(this, WH_MSG_SYNCTOC);
52                 UnRegisterListener2(this, WH_MSG_SEARCHTHIS);
53                 UnRegisterListener2(this, WH_MSG_GETPANEINFO);
54         }
55 }
56
57 function window_OnLoad()
58 {
59         var bHidePane=false;
60         var oMsg=new whMessage(WH_MSG_GETCMD,this,1,null);
61         if (SendMessage(oMsg))
62         {
63                 if(oMsg.oParam>0)
64                 {
65                         if(oMsg.oParam==1)
66                                 gsInitPane="toc";
67                         else if(oMsg.oParam==2)
68                                 gsInitPane="idx";
69                         else if(oMsg.oParam==3)
70                                 gsInitPane="fts";
71                         else if(oMsg.oParam==4)
72                                 gsInitPane="glo";
73                 }
74                 else if(oMsg.oParam==0)
75                 {
76                         bHidePane=true;
77                 }
78         }
79         if (bHidePane)
80         {
81                 oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null)
82                 SendMessage(oMsg);
83         }
84         else if (gsInitPane == "toc")
85         {
86                 oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null)
87                 SendMessage(oMsg);      
88         }
89         else if (gsInitPane=="idx")
90         {
91                 oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null)
92                 SendMessage(oMsg);      
93         }
94         else if (gsInitPane=="fts")
95         {
96                 oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null)
97                 SendMessage(oMsg);      
98         }
99         else if (gsInitPane=="glo")
100         {
101                 oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null)
102                 SendMessage(oMsg);      
103         }
104         
105 }
106
107 function onResize()
108 {
109         var oMsg=null;
110         if (gbIE4)
111         {
112                 if(document.body)
113                 {
114                         if(document.body.clientWidth > 1 && document.body.clientHeight>1)
115                         {
116                                 oMsg = new whMessage(WH_MSG_RESIZEPANE,this,1,null);
117                                 SendMessage(oMsg);
118                         }
119                 }
120         }
121         else 
122         {
123                 if (window.innerWidth != 0 && window.innerHeight != 0)
124                 {
125                         oMsg = new whMessage(WH_MSG_RESIZEPANE,this,1,null);
126                         SendMessage(oMsg);
127                 }
128         }
129 }
130
131 function CheckLoadingPhase0()
132 {
133         if (!gbPassPhase0) {
134                 setTimeout("CheckLoadingPhase0()", 1000);
135                 document.applets[0];
136                 gbPassPhase0 = 1;
137         }
138         else {
139                 CheckLoadingPhase1();
140         }
141 }
142
143 function CheckLoadingPhase1()
144 {
145         if (gbNav4) {
146                 if ("unknown" == gbLoading && document.readystate < 4) {
147                         setTimeout("CheckLoadingPhase1()", 1000);
148                 }
149                 else if ("unknown" == gbLoading) {
150                         CheckLoadingPhase2();
151                 }
152         }
153 }
154
155 function CheckLoadingPhase2()
156 {
157         if (gbNav4) {
158                 gbTryTime ++;
159                 if ("unknown" == gbLoading) {
160                         if (gbTryTime <= gbMaxTryTime )
161                                 setTimeout("CheckLoadingPhase2()", 1000);
162                         else {
163                                 if (gnVerMinor != 4.60) {
164                                         alert("Unable to load applet. If you are using an old version of Netscape, the prefs.js file needs to be edited.");
165                                 }
166                         }       
167                 }
168         }
169 }
170
171 function CheckAppletLoaded()
172 {
173         if (typeof(document.WebHelp) == "undefined")
174         {
175                 document.location.reload();
176                 if (gbretried < gbmaxretry)
177                 {
178                         gbretried ++;
179                         setTimeout("CheckAppletLoaded();", gbretrytime[gbretried]);
180                 }
181         }
182 }
183
184 function reDo() 
185 {
186         if (innerWidth != origWidth || innerHeight != origHeight)  
187         {
188                 //reloaded applet if nessary
189                 gbretried = 0;
190
191                 if (gnVerMinor == 4.60) 
192                 {
193                         //reload the applet again.
194                         document.location.reload();
195                         gbretried ++;
196                 }
197                 setTimeout("CheckAppletLoaded();", gbretrytime[gbretried]);
198         }
199 }
200
201 function onSendMessage(oMsg)
202 {
203         if (oMsg)
204         {       
205                 var nMsgId = oMsg.nMessageId;
206                 var WebHelpApplet = null;
207                 if (gbNav4)
208                 {
209                         WebHelpApplet = document.applets["WebHelp"];
210                         if (!WebHelpApplet.Command)
211                                 document.location="whskin_plist.htm";
212                 }
213                 else
214                         WebHelpApplet = window.WebHelp;
215
216                 if(nMsgId==WH_MSG_GETPANEINFO)
217                 {
218                         oMsg.oParam=gsCurrentPane;
219                         return false;
220                 }
221                 else if(gbLoading!="unknown" || gbNav6)
222                 {
223                         if (nMsgId == WH_MSG_SHOWTOC)
224                         {
225                                 gsCurrentPane="toc";
226                                 WebHelpApplet.Command("Contents",null);
227                                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"toc");
228                                 SendMessage(onMsg);
229                                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
230                                 SendMessage(onMsg);
231                         }
232                         else if(nMsgId==WH_MSG_SHOWIDX)
233                         {
234                                 gsCurrentPane="idx";
235                                 WebHelpApplet.Command("Index",null);
236                                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"idx");
237                                 SendMessage(onMsg);
238                                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
239                                 SendMessage(onMsg);
240                         }
241                         else if(nMsgId==WH_MSG_SHOWFTS)
242                         {
243                                 gsCurrentPane="fts";
244                                 WebHelpApplet.Command("Search",null);
245                                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"fts");
246                                 SendMessage(onMsg);
247                                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
248                                 SendMessage(onMsg);
249                         }
250                         else if(nMsgId==WH_MSG_SHOWGLO)
251                         {
252                                 gsCurrentPane="glo";
253                                 WebHelpApplet.Command("Glossary",null);
254                                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"glo");
255                                 SendMessage(onMsg);
256                                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
257                                 SendMessage(onMsg);
258                         }
259                         else if(nMsgId==WH_MSG_SYNCTOC)
260                         {
261                                 gsCurrentPane="toc";
262                                 var oTopicParam=oMsg.oParam;
263                                 if(oTopicParam&&oTopicParam.aPaths&&oTopicParam.aPaths.length>0&&oTopicParam.sPPath)
264                                 {
265                                         var sPPath=_browserStringToText(oTopicParam.sPPath);
266                                         var sParam="";
267                                         for(var i=0;i<oTopicParam.aPaths.length;i++)
268                                         {
269                                                 sParam+=oTopicParam.aPaths[i]+"\r\r";
270                                         }
271                                         WebHelpApplet.Command("SyncToc",sPPath,sParam);
272                                 }
273                         }
274                         else if(nMsgId==WH_MSG_SEARCHTHIS)
275                         {
276                                 gsCurrentPane="fts";
277                                 WebHelpApplet.Command("Search",oMsg.oParam);
278                                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"fts");
279                                 SendMessage(onMsg);
280                                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
281                                 SendMessage(onMsg);
282                         }
283                 }
284         }
285         return true;
286 }
287
288 function getInitTocInfo()
289 {
290         var oParam=new Object();
291         oParam.oTocInfo=null;
292         var oMsg=new whMessage(WH_MSG_GETTOCPATHS,this,1,oParam);
293         if(SendMessage(oMsg))
294         {
295                 var oTopicParam=oMsg.oParam.oTocInfo;
296                 if(oTopicParam&&oTopicParam.aPaths&&oTopicParam.aPaths.length>0&&oTopicParam.sPPath)
297                 {
298                         var sPPath=_browserStringToText(oTopicParam.sPPath);
299                         var sParam="";
300                         for(var i=0;i<oTopicParam.aPaths.length;i++)
301                         {
302                                 sParam+=oTopicParam.aPaths[i]+"\r\r";
303                         }
304                         var WebHelpApplet;
305                         if(gbNav4)
306                                 WebHelpApplet=document.applets["WebHelp"];
307                         else
308                                 WebHelpApplet=WebHelp;
309                         WebHelpApplet.Command("SyncToc",sPPath,sParam);
310                 }
311         }
312 }
313
314 if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
315 {
316         RegisterListener2(this, WH_MSG_SHOWTOC);
317         RegisterListener2(this, WH_MSG_SHOWIDX);
318         RegisterListener2(this, WH_MSG_SHOWFTS);
319         RegisterListener2(this, WH_MSG_SHOWGLO);
320         RegisterListener2(this, WH_MSG_SYNCTOC);
321         RegisterListener2(this, WH_MSG_SEARCHTHIS);
322         RegisterListener2(this, WH_MSG_GETPANEINFO);
323
324         window.onresize=onResize;
325         window.onunload = window_unload;
326         window.onload=window_OnLoad;
327         window.onerror = null;
328         var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
329
330         if (gbNav4 && !gbNav6 && gbWindows) {
331                 setTimeout("CheckLoadingPhase0()", 1000);
332         }
333         if (gbNav4)
334         {
335                 origWidth = innerWidth;
336                 origHeight = innerHeight;
337                 onresize = reDo;
338         }
339 }
340 else
341         document.location.reload();
342
343 if (window.gbNav6)
344 {
345         var oMsg=new whMessage(WH_MSG_RELOADNS6,this, 1,null);
346         SendMessage(oMsg);
347 }
348 //-->
349 </script>
350 </head>
351 <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="c0c0c0">
352 <applet code=WebHelp.class name=WebHelp  archive=webhelp.jar width=100% height=100% MAYSCRIPT hspace=0 vspace=0>
353 <PARAM name=ProjectFile value=whproj.xml><PARAM name=ResourceFile value=whres.xml>
354 <PARAM name=HideTabs value=true>
355 <PARAM name=Frame value=bsscright>
356 <PARAM name=cabbase value=webhelp.cab>
357 </applet>
358 </body>
359 </html>