2 // this value should be identical to the value used in whproxy.js
\r
3 window.whname = "wh_stub";
\r
5 // this file will be used by Topic and NavBar and NavPane and other components
\r
6 // and this file is used in child frame html.
\r
7 // and the whstub.js will be used in the start page.
\r
8 // see reference in whstub.js.
\r
10 var gbInited = false;
\r
11 var gWndStubPage = null;
\r
12 function getStubPage()
\r
16 gWndStubPage = getStubPage_inter(window);
\r
19 return gWndStubPage;
\r
22 function getStubPage_inter(wCurrent) {
\r
23 if (null == wCurrent.parent || wCurrent.parent == wCurrent)
\r
26 if (wCurrent.parent.whname && "wh_stub" == wCurrent.parent.whname)
\r
27 return wCurrent.parent;
\r
29 if (wCurrent.parent.frames.length != 0 && wCurrent.parent != wCurrent)
\r
30 return getStubPage_inter(wCurrent.parent);
\r
35 // Public interface begin here................
\r
36 function RegisterListener(framename, nMessageId)
\r
38 var wStartPage = getStubPage();
\r
39 if (wStartPage && wStartPage != this) {
\r
40 return wStartPage.RegisterListener(framename, nMessageId);
\r
46 function RegisterListener2(oframe, nMessageId)
\r
48 var wStartPage = getStubPage();
\r
49 if (wStartPage && wStartPage != this) {
\r
50 return wStartPage.RegisterListener2(oframe, nMessageId);
\r
56 function UnRegisterListener2(oframe, nMessageId)
\r
58 var wStartPage = getStubPage();
\r
59 if (wStartPage && wStartPage != this && wStartPage.UnRegisterListener2) {
\r
60 return wStartPage.UnRegisterListener2(oframe, nMessageId);
\r
66 function SendMessage(oMessage)
\r
68 var nMsgId = oMessage.nMessageId;
\r
69 if (nMsgId == WH_MSG_ISINFRAMESET && oMessage.wSender != this)
\r
71 var wStartPage = getStubPage();
\r
72 if (wStartPage && wStartPage != this && wStartPage.SendMessage)
\r
74 return wStartPage.SendMessage(oMessage);
\r