-
Notifications
You must be signed in to change notification settings - Fork 0
/
whproxy.js
74 lines (65 loc) · 1.37 KB
/
whproxy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// WebHelp 5.10.001
var gbInited=false;
var gWndStubPage=null;
function getStubPage()
{
if(!gbInited)
{
gWndStubPage=getStubPage_inter(window);
gbInited=true;
}
return gWndStubPage;
}
function getStubPage_inter(wCurrent)
{
if(null==wCurrent.parent||wCurrent.parent==wCurrent)
return null;
if(typeof(wCurrent.parent.whname)=="string"&&"wh_stub"==wCurrent.parent.whname)
return wCurrent.parent;
else
if(wCurrent.parent.frames.length!=0&&wCurrent.parent!=wCurrent)
return getStubPage_inter(wCurrent.parent);
else
return null;
}
function RegisterListener(framename,nMessageId)
{
var wSP=getStubPage();
if(wSP&&wSP!=this)
return wSP.RegisterListener(framename,nMessageId);
else
return false;
}
function RegisterListener2(oframe,nMessageId)
{
var wSP=getStubPage();
if(wSP&&wSP!=this)
return wSP.RegisterListener2(oframe,nMessageId);
else
return false;
}
function UnRegisterListener2(oframe,nMessageId)
{
var wSP=getStubPage();
if(wSP&&wSP!=this&&wSP.UnRegisterListener2)
return wSP.UnRegisterListener2(oframe,nMessageId);
else
return false;
}
function SendMessage(oMessage)
{
var wSP=getStubPage();
if(wSP&&wSP!=this&&wSP.SendMessage)
return wSP.SendMessage(oMessage);
else
return false;
}
var gbWhProxy=true;
var gbPreview=false;
gbPreview=false;
if (gbPreview)
document.oncontextmenu=contextMenu;
function contextMenu()
{
return false;
}