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