1 // this value should be identical to the value used in whproxy.js
\r
2 window.whname = "wh_stub";
\r
4 // this file will be used by Topic and NavBar and NavPane and other components
\r
5 // and this file is used in child frame html.
\r
6 // and the whstub.js will be used in the start page.
\r
7 // see reference in whstub.js.
\r
9 var gbInited = false;
\r
10 var gWndStubPage = null;
\r
11 function getStubPage()
\r
15 gWndStubPage = getStubPage_inter(window);
\r
18 return gWndStubPage;
\r
21 function getStubPage_inter(wCurrent) {
\r
22 if (null == wCurrent.parent || wCurrent.parent == wCurrent)
\r
25 if (wCurrent.parent.whname && "wh_stub" == wCurrent.parent.whname)
\r
26 return wCurrent.parent;
\r
28 if (wCurrent.parent.frames.length != 0 && wCurrent.parent != wCurrent)
\r
29 return getStubPage_inter(wCurrent.parent);
\r
34 // Public interface begin here................
\r
35 function RegisterListener(framename, nMessageId)
\r
37 var wStartPage = getStubPage();
\r
38 if (wStartPage && wStartPage != this) {
\r
39 return wStartPage.RegisterListener(framename, nMessageId);
\r
45 function RegisterListener2(oframe, nMessageId)
\r
47 var wStartPage = getStubPage();
\r
48 if (wStartPage && wStartPage != this) {
\r
49 return wStartPage.RegisterListener2(oframe, nMessageId);
\r
55 function UnRegisterListener2(oframe, nMessageId)
\r
57 var wStartPage = getStubPage();
\r
58 if (wStartPage && wStartPage != this && wStartPage.UnRegisterListener2) {
\r
59 return wStartPage.UnRegisterListener2(oframe, nMessageId);
\r
65 function SendMessage(oMessage)
\r
67 var nMsgId = oMessage.nMessageId;
\r
68 if (nMsgId == WH_MSG_ISINFRAMESET && oMessage.wSender != this)
\r
70 var wStartPage = getStubPage();
\r
71 if (wStartPage && wStartPage != this && wStartPage.SendMessage)
\r
73 return wStartPage.SendMessage(oMessage);
\r