]> SALOME platform Git repositories - modules/gui.git/blob - doc/salome/gui/KERNEL/whtopic.js
Salome HOME
Initial version
[modules/gui.git] / doc / salome / gui / KERNEL / whtopic.js
1 var gsPPath = "";\r
2 var gaPaths = new Array();\r
3 var gaAvenues = new Array();\r
4 \r
5 var goFrame = null;\r
6 var gsStartPage = "";\r
7 var gsRelCurPagePath = "";\r
8 var gsSearchFormHref  = "";\r
9 var gnTopicOnly = -1;\r
10 var gnOutmostTopic = -1;\r
11 \r
12 var BTN_TEXT=1;\r
13 var BTN_IMG=2;\r
14 \r
15 var goSync = null;\r
16 \r
17 var goShow = null;\r
18 var goHide = null;\r
19 \r
20 var goPrev = null;\r
21 var goNext = null;\r
22 var gnForm = 0;\r
23 var goShowNav = null;\r
24 var goHideNav = null;\r
25 \r
26 var goWebSearch = null;\r
27 \r
28 var gsBtnStyle = "";\r
29 var gaButtons = new Array();\r
30 var gaTypes = new Array();\r
31 var whtopic_foldUnload = null;\r
32 var gbWhTopic=false;\r
33 var gbCheckSync=false;\r
34 var gbSyncEnabled=false;\r
35 \r
36 function setButtonFont(sType, sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration)\r
37 {\r
38         var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration);\r
39         gsBtnStyle += ".whtbtn" + sType + "{"+getFontStyle(vFont) + "}";\r
40 }\r
41 \r
42 function writeBtnStyle()\r
43 {\r
44         if (gaButtons.length > 0)\r
45         {\r
46                 if (gsBtnStyle.length > 0)\r
47                 {\r
48                         var sStyle = "<style type='text/css'>";\r
49                         sStyle+= gsBtnStyle + "</style>";\r
50                         document.write(sStyle);\r
51                 }\r
52         }\r
53 }\r
54 \r
55 function button(sText, nWidth, nHeight)\r
56 {\r
57         this.sText = sText;\r
58         this.nWidth = nWidth;\r
59         this.nHeight = nHeight;\r
60         \r
61         this.aImgs = new Array();\r
62         var i = 0;\r
63         while (button.arguments.length > i + 3)\r
64         {\r
65                 this.aImgs[i] = button.arguments[3 + i];\r
66                 i ++;\r
67         }\r
68 }\r
69 \r
70 // project info\r
71 function setRelStartPage(sPath)\r
72 {\r
73         if (gsPPath.length == 0)\r
74         {\r
75                 gsPPath = _getFullPath(_getPath(document.location.href),  _getPath(sPath));\r
76                 gsStartPage = _getFullPath(_getPath(document.location.href), sPath);\r
77                 gsRelCurPagePath = _getRelativeFileName(gsStartPage, document.location.href);\r
78         }\r
79 }\r
80 \r
81 function getImage(oImage, sType)\r
82 {\r
83         var sImg="";\r
84         if (oImage && oImage.aImgs && (oImage.aImgs.length > 0))\r
85         {\r
86                 sImg+="<img alt=\""+ sType + "\" src=\"" + oImage.aImgs[0] + "\"";\r
87                 if (oImage.nWidth > 0)\r
88                         sImg+=" width=" + oImage.nWidth;\r
89                 if (oImage.nHeight > 0)\r
90                         sImg+=" height=" + oImage.nHeight;\r
91                 sImg+=" border=no>";\r
92         }\r
93         return sImg;\r
94 }\r
95 \r
96 function addTocInfo(sTocPath)\r
97 {\r
98         gaPaths[gaPaths.length] = sTocPath;\r
99 }\r
100 \r
101 function addAvenueInfo(sName, sPrev, sNext)\r
102 {\r
103         gaAvenues[gaAvenues.length] = new avenueInfo(sName, sPrev, sNext);      \r
104 }\r
105 \r
106 function addButton(sType, nStyle, sText, sHref, sOnClick, sOnMouseOver, sOnLoad, nWidth, nHeight, sImg1, sImg2, sImg3)\r
107 {\r
108         var sButton = "";\r
109         var nBtn=gaButtons.length;\r
110         if (sType == "prev")\r
111         {\r
112                 if (canGo(false))\r
113                 {\r
114                         var sTitle = "Previous Topic";\r
115                         goPrev = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
116                         sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnprev\" href=\"javascript:void(0);\" onclick=\"goAvenue(false);return false;\">";\r
117                         if (nStyle == BTN_TEXT)\r
118                                 sButton += goPrev.sText;\r
119                         else\r
120                                 sButton += getImage(goPrev, sTitle);\r
121                         sButton += "</a>";\r
122                 }\r
123         }\r
124         else if (sType == "next")\r
125         {\r
126                 if (canGo(true))\r
127                 {\r
128                         var sTitle = "Next Topic";\r
129                         goNext = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
130                         sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnnext\" href=\"javascript:void(0);\" onclick=\"goAvenue(true);return false;\">";\r
131                         if (nStyle == BTN_TEXT)\r
132                                 sButton += goNext.sText;\r
133                         else\r
134                                 sButton += getImage(goNext, sTitle);\r
135                         sButton += "</a>";\r
136                 }\r
137         }\r
138         else if (sType == "show")\r
139         {\r
140                 if (isTopicOnly())\r
141                 {\r
142                         var sTitle = "Show Navigation Component";\r
143                         goShow = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
144                         sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnshow\" href=\"javascript:void(0);\" onclick=\"show();return false;\">";\r
145                         if (nStyle == BTN_TEXT)\r
146                                 sButton += goShow.sText;\r
147                         else\r
148                                 sButton += getImage(goShow, sTitle);\r
149                         sButton += "</a>";\r
150                 }\r
151         }\r
152         else if (sType == "hide")\r
153         {\r
154                 if (!isTopicOnly())\r
155                 {\r
156                         var sTitle = "Hide Navigation Component";\r
157                         goHide = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
158                         sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnhide\" href=\"javascript:void(0);\" onclick=\"hide();return false;\">";\r
159                         if (nStyle == BTN_TEXT)\r
160                                 sButton += goHide.sText;\r
161                         else\r
162                                 sButton += getImage(goHide, sTitle);\r
163                         sButton += "</a>";\r
164                 }\r
165         }\r
166         else if (sType == "shownav")\r
167         {\r
168                 \r
169                 if (isShowHideEnable())\r
170                 {\r
171                         var sTitle = "Show Navigation Component";\r
172                         goShowNav = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
173                         sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnshownav\" href=\"javascript:void(0);\" onclick=\"showHidePane(true);return false;\">";\r
174                         if (nStyle == BTN_TEXT)\r
175                                 sButton += goShowNav.sText;\r
176                         else\r
177                                 sButton += getImage(goShowNav, sTitle);\r
178                         sButton += "</a>";\r
179                 }\r
180         }\r
181         else if (sType == "hidenav")\r
182         {\r
183                 if (isShowHideEnable())\r
184                 {\r
185                         var sTitle = "Hide Navigation Component";\r
186                         goHideNav = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
187                         sButton = "<a title=\"" + sTitle + "\" class=\"whtbtnhidenav\" href=\"javascript:void(0);\" onclick=\"showHidePane(false);return false;\">";\r
188                         if (nStyle == BTN_TEXT)\r
189                                 sButton += goHideNav.sText;\r
190                         else\r
191                                 sButton += getImage(goHideNav, sTitle);\r
192                         sButton += "</a>";\r
193                 }\r
194         }\r
195         else if (sType == "synctoc")\r
196         {\r
197                 if (gaPaths.length > 0)\r
198                 {\r
199                         var sTitle = "Sync TOC";\r
200                         goSync = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
201                         sButton = "<a title=\""+ sTitle + "\" class=\"whtbtnsynctoc\" href=\"javascript:void(0);\" onclick=\"syncWithShow();return false;\">";\r
202                         if (nStyle == BTN_TEXT)\r
203                                 sButton += goSync.sText;\r
204                         else\r
205                                 sButton += getImage(goSync, sTitle);\r
206                         sButton += "</a>";\r
207                 }\r
208         }\r
209         else if (sType == "websearch")\r
210         {\r
211                 if (gsSearchFormHref.length > 0)\r
212                 {\r
213                         var sTitle = "WebSearch";\r
214                         goWebSearch = new button(sText, nWidth, nHeight, sImg1, sImg2, sImg3);\r
215                         sButton = "<a title=\""+ sTitle + "\" class=\"whtbtnwebsearch\" href=\"" + gsSearchFormHref + "\">";\r
216                         if (nStyle == BTN_TEXT)\r
217                                 sButton += goWebSearch.sText;\r
218                         else\r
219                                 sButton += getImage(goWebSearch, sTitle);\r
220                         sButton += "</a>";\r
221                 }\r
222         }\r
223         else if (sType == "searchform")\r
224         {\r
225                 gaButtons[nBtn] = "NeedSearchForm";\r
226                 gaTypes[nBtn] = sType;\r
227         }\r
228         if (sButton.length != 0)\r
229         {\r
230                 if (nStyle == BTN_TEXT)\r
231                         sButton += "&nbsp;";\r
232                 gaButtons[nBtn] = "<td>" + sButton + "</td>";\r
233                 gaTypes[nBtn] = sType;\r
234         }\r
235 }\r
236 \r
237 function isSyncEnabled()\r
238 {\r
239         if (!gbCheckSync)\r
240         {\r
241                 var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null);\r
242                 if(SendMessage(oMsg))\r
243                 {\r
244                         gbSyncEnabled=oMsg.oParam;\r
245                 }\r
246                 gbCheckSync=true;\r
247         }\r
248         return gbSyncEnabled;\r
249 }\r
250 \r
251 function isInPopup()\r
252 {\r
253         return (window.name.indexOf("BSSCPopup") != -1);\r
254 }\r
255 \r
256 function getIntopicBar(sAlign)\r
257 {\r
258         var sHTML = "";\r
259         if (gaButtons.length > 0)\r
260         {\r
261                 sHTML += "<div align="+ sAlign + ">";\r
262 \r
263                 sHTML += "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\"><tr>";\r
264                 for (var i = 0; i < gaButtons.length; i++)\r
265                 {\r
266                         if (gaTypes[i]!="synctoc" || isSyncEnabled())\r
267                         {\r
268                                 if (gaButtons[i] == "NeedSearchForm")\r
269                                         sHTML += getSearchFormHTML();\r
270                                 else\r
271                                         sHTML += gaButtons[i];\r
272                         }\r
273                 }\r
274                 sHTML += "</tr></table>";\r
275 \r
276                 sHTML += "</div>";\r
277         }\r
278         return sHTML;\r
279 }\r
280 \r
281 \r
282 function writeIntopicBar(nAligns)\r
283 {\r
284         if (isInPopup()) return;\r
285         if (gaButtons.length > 0)\r
286         {\r
287                 var sHTML = "";\r
288                 if (nAligns != 0)\r
289                 {\r
290                         sHTML += "<table width=100%><tr>"\r
291                         if (nAligns & 1)\r
292                                 sHTML += "<td width=33%>" + getIntopicBar("left") + "</td>";\r
293                         if (nAligns & 2)\r
294                                 sHTML += "<td width=34%>" + getIntopicBar("center") + "</td>";\r
295                         if (nAligns & 4)\r
296                                 sHTML += "<td width=33%>" + getIntopicBar("right") + "</td>";\r
297                         sHTML += "</tr></table>";\r
298                         document.write(sHTML);\r
299                 }\r
300         }\r
301 }\r
302 \r
303 function sendAveInfoOut()\r
304 {\r
305         if (!isInPopup())\r
306                 setTimeout("sendAveInfo();", 100);\r
307 }\r
308 \r
309 function sendAveInfo()\r
310 {\r
311         var oMsg = new whMessage(WH_MSG_AVENUEINFO, this, 1, gaAvenues);\r
312         SendMessage(oMsg);\r
313 }\r
314 \r
315 \r
316 function onNext()\r
317 {\r
318         var oMsg = new whMessage(WH_MSG_NEXT, this, 1, null);\r
319         SendMessage(oMsg);\r
320 }\r
321 \r
322 function onPrev()\r
323 {\r
324         var oMsg = new whMessage(WH_MSG_PREV, this, 1, null);\r
325         SendMessage(oMsg);\r
326 }\r
327 \r
328 function createSyncInfo()\r
329 {\r
330         var oParam = new Object();\r
331         if (gsPPath.length == 0)\r
332                 gsPPath = _getPath(document.location.href);\r
333         oParam.sPPath = gsPPath;\r
334         oParam.sTPath = document.location.href;\r
335         oParam.aPaths = gaPaths;\r
336         return oParam;\r
337 }\r
338 \r
339 function syncWithShow()\r
340 {\r
341         if (isTopicOnly())\r
342                 show();\r
343         else \r
344         {\r
345                 sync();\r
346                 showTocPane();\r
347         }\r
348 }\r
349 \r
350 function showTocPane()\r
351 {\r
352         var oMsg = new whMessage(WH_MSG_SHOWTOC, this, 1, null);\r
353         SendMessage(oMsg);\r
354 }\r
355 \r
356 function sendSyncInfo()\r
357 {\r
358         if (!isInPopup())\r
359         {\r
360                 var oParam = null;\r
361                 if (gaPaths.length > 0)\r
362                 {\r
363                         oParam = createSyncInfo();\r
364                 }\r
365                 var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, oParam);\r
366                 SendMessage(oMsg);\r
367         }\r
368 }\r
369 \r
370 function sendInvalidSyncInfo()\r
371 {\r
372         if (!isInPopup())\r
373         {\r
374                 var oMsg = new whMessage(WH_MSG_SYNCINFO, this, 1, null);\r
375                 SendMessage(oMsg);\r
376         }\r
377 }\r
378 \r
379 function enableWebSearch(bEnable)\r
380 {\r
381         if (!isInPopup())\r
382         {\r
383                 var oMsg = new whMessage(WH_MSG_ENABLEWEBSEARCH, this, 1, bEnable);\r
384                 SendMessage(oMsg);\r
385         }\r
386 }\r
387 \r
388 function autoSync(nSync)\r
389 {\r
390         if (nSync == 0) return;\r
391         if (isInPopup()) return;\r
392         if (isOutMostTopic())\r
393                 sync();\r
394 }\r
395 \r
396 function isOutMostTopic()\r
397 {\r
398         if (gnOutmostTopic == -1)\r
399         {\r
400                 var oMessage = new whMessage(WH_MSG_ISINFRAMESET, this, 1 , null);\r
401                 if (SendMessage(oMessage))\r
402                         gnOutmostTopic = 0;\r
403                 else\r
404                         gnOutmostTopic = 1;\r
405         }\r
406         return (gnOutmostTopic == 1);\r
407 }\r
408 \r
409 function sync()\r
410 {\r
411         if (gaPaths.length > 0)\r
412         {\r
413                 var oParam = createSyncInfo();\r
414                 var oMessage = new whMessage(WH_MSG_SYNCTOC, this, 1, oParam);\r
415                 SendMessage(oMessage);\r
416         }\r
417 }\r
418 \r
419 \r
420 function avenueInfo(sName, sPrev, sNext)\r
421 {\r
422         this.sName = sName;\r
423         this.sPrev = sPrev;\r
424         this.sNext = sNext;\r
425 }\r
426 \r
427 function getCurrentAvenue()\r
428 {\r
429         var oParam = new Object();\r
430         oParam.sAvenue = null;\r
431         var oMessage = new whMessage(WH_MSG_GETCURRENTAVENUE, this, 1, oParam);\r
432         SendMessage(oMessage);\r
433         return oParam.sAvenue;\r
434 }\r
435 \r
436 function unRegisterListener()\r
437 {\r
438         sendInvalidSyncInfo();\r
439         enableWebSearch(false);\r
440         if (whtopic_foldUnload)\r
441                 whtopic_foldUnload();\r
442 }\r
443 \r
444 function onSendMessage(oMsg)\r
445 {\r
446         var nMsgId = oMsg.nMessageId;\r
447         if (nMsgId == WH_MSG_GETAVIAVENUES)\r
448         {\r
449                 oMsg.oParam.aAvenues = gaAvenues;\r
450                 return false;\r
451         }\r
452         else if (nMsgId == WH_MSG_GETTOCPATHS)\r
453         {\r
454                 if (isOutMostTopic())\r
455                 {\r
456                         oMsg.oParam.oTocInfo = createSyncInfo();\r
457                         return false;           \r
458                 }\r
459                 else\r
460                         return true;\r
461         }\r
462         else if (nMsgId == WH_MSG_NEXT)\r
463         {\r
464                 goAvenue(true);\r
465         }\r
466         else if (nMsgId == WH_MSG_PREV)\r
467         {\r
468                 goAvenue(false);\r
469         }\r
470         else if (nMsgId == WH_MSG_WEBSEARCH)\r
471         {\r
472                 websearch();\r
473         }\r
474         return true;\r
475 }\r
476 \r
477 function goAvenue(bNext)\r
478 {\r
479         var sTopic = null;\r
480         var sAvenue = getCurrentAvenue();\r
481         var nAvenue = -1;\r
482         if (sAvenue != null && sAvenue != "")\r
483         {\r
484                 for (var i = 0; i < gaAvenues.length ; i ++)\r
485                 {\r
486                         if (gaAvenues[i].sName == sAvenue)\r
487                         {\r
488                                 nAvenue = i;\r
489                                 break;\r
490                         }\r
491                 }\r
492                 if (nAvenue != -1)\r
493                 {\r
494                         if (bNext)\r
495                                 sTopic = gaAvenues[nAvenue].sNext;\r
496                         else\r
497                                 sTopic = gaAvenues[nAvenue].sPrev;\r
498                 }\r
499         }\r
500         else\r
501         { \r
502                 for (var i = 0; i < gaAvenues.length ; i ++)\r
503                 {\r
504                         if (gaAvenues[i].sNext != null && gaAvenues[i].sNext.length > 0 && bNext)\r
505                         {\r
506                                 sTopic = gaAvenues[i].sNext;\r
507                                 break;\r
508                         }\r
509                         else if (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext)\r
510                         {\r
511                                 sTopic = gaAvenues[i].sPrev;\r
512                                 break;\r
513                         }\r
514                 }\r
515         }\r
516         \r
517         if (sTopic != null && sTopic != "")\r
518         {\r
519                 if (gsPPath != null && gsPPath != "")\r
520                 {\r
521                         sFullTopicPath = _getFullPath(gsPPath, sTopic);\r
522                         document.location = sFullTopicPath;\r
523                 }\r
524         }\r
525 }\r
526 \r
527 function canGo(bNext)\r
528 {\r
529         for (var i = 0; i < gaAvenues.length ; i ++)\r
530         {\r
531                 if ((gaAvenues[i].sNext != null && gaAvenues[i].sNext.length > 0 && bNext) ||\r
532                         (gaAvenues[i].sPrev != null && gaAvenues[i].sPrev.length > 0 && !bNext))\r
533                         return true;\r
534         }\r
535         return false;\r
536 }\r
537 \r
538 function show()\r
539 {\r
540         if (gsStartPage != "")\r
541                 window.location =  gsStartPage + "#" + gsRelCurPagePath;\r
542 }\r
543 \r
544 function hide()\r
545 {\r
546         if (goFrame != null)\r
547         {\r
548                 goFrame.location = window.location;\r
549         }\r
550 }\r
551 \r
552 function isTopicOnly()\r
553 {\r
554         if (gnTopicOnly == -1)\r
555         {\r
556                 var oParam = new Object();\r
557                 oParam.oFrame = null;\r
558                 var oMsg = new whMessage(WH_MSG_GETSTARTFRAME, this, 1, oParam);\r
559                 if (SendMessage(oMsg))\r
560                 {\r
561                         goFrame = oParam.oFrame;\r
562                         gnTopicOnly = 0;\r
563                 }\r
564                 else\r
565                         gnTopicOnly = 1;\r
566         }\r
567         if (gnTopicOnly == 1)\r
568                 return true;\r
569         else\r
570                 return false;\r
571 }\r
572 \r
573 function websearch()\r
574 {\r
575         if (gbNav4)\r
576         {\r
577                 if (document.ehelpform)\r
578                         document.ehelpform.submit();\r
579         }\r
580         else\r
581         {\r
582                 if (window.ehelpform)\r
583                         window.ehelpform.submit();\r
584         }\r
585 }\r
586 \r
587 function addSearchFormHref(sHref)\r
588 {\r
589         gsSearchFormHref = sHref;\r
590         enableWebSearch(true);\r
591 }\r
592 \r
593 function searchB(nForm)\r
594 {\r
595         var sValue = eval("document.searchForm" + nForm + ".searchString.value");\r
596         var oMsg = new whMessage(WH_MSG_SEARCHTHIS, this, 1, sValue);\r
597         SendMessage(oMsg);\r
598 }\r
599 \r
600 function getSearchFormHTML()\r
601 {\r
602         var sHTML = "";\r
603         gnForm ++;\r
604         var sFormName = "searchForm" + gnForm;\r
605         var sButton = "<form name=\"" + sFormName + "\" method=\"POST\" action=\"javascript:searchB("+ gnForm + ")\">"\r
606         sButton += "<input type=\"text\" name=\"searchString\" value=\"- Full Text search -\" size=\"20\"/>";\r
607         if ("" == "text")\r
608         {\r
609                 sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\"" + sFormName + ".submit(); return false;\"></a>";\r
610         }\r
611         else if ("" == "image")\r
612         {\r
613                 sButton+="<a class=\"searchbtn\" href=\"javascript:void(0);\" onclick=\"" + sFormName + ".submit(); return false;\">"\r
614                 sButton+="<img src=\"\" border=0></a>";\r
615         }\r
616         sButton += "</form>";\r
617         sHTML ="<td align=\"center\">" + sButton + "</td>";\r
618         return sHTML;\r
619 }\r
620 \r
621 function showHidePane(bShow)\r
622 {\r
623         var oMsg=null;\r
624         if (bShow)\r
625                 oMsg=new whMessage(WH_MSG_SHOWPANE, this, 1, null);\r
626         else\r
627                 oMsg=new whMessage(WH_MSG_HIDEPANE, this, 1, null);\r
628         SendMessage(oMsg);\r
629 }\r
630 \r
631 function isShowHideEnable()\r
632 {\r
633         if (gbIE4)\r
634                 return true;\r
635         else\r
636                 return false;\r
637 }\r
638 \r
639 if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)\r
640 {\r
641         RegisterListener("bsscright", WH_MSG_GETAVIAVENUES);\r
642         RegisterListener("bsscright", WH_MSG_GETTOCPATHS);\r
643         RegisterListener("bsscright", WH_MSG_NEXT);\r
644         RegisterListener("bsscright", WH_MSG_PREV);\r
645         RegisterListener("bsscright", WH_MSG_WEBSEARCH);\r
646         if (gbMac && gbIE4)\r
647         {\r
648                 if (typeof(window.onunload) != "unknown")\r
649                         whtopic_foldUnload = window.onunload;\r
650         }\r
651         else\r
652         {\r
653                 if (window.onunload)\r
654                         whtopic_foldUnload = window.onunload;\r
655         }\r
656         window.onunload = unRegisterListener;\r
657         setButtonFont("show","","10pt","","","","");\r
658 \r
659         gbWhTopic=true;\r
660 }\r
661 else\r
662         document.location.reload();