-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utilities.js
60 lines (54 loc) · 1002 Bytes
/
Utilities.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
var intQuestionCounter = 0,
ASCII_QUESTION = 63;
function CheckForDebugCommand(e)
{
var intKeyCode = 0;
if (window.event)
{
e = window.event;
intKeyCode = e.keyCode;
}
else
{
intKeyCode = e.which;
}
if (intKeyCode == ASCII_QUESTION)
{
intQuestionCounter++;
if (intQuestionCounter == 3)
{
intQuestionCounter = 0;
ShowDebugWindow();
}
}
else if (intKeyCode != 0)
{
/*in FireFox, the shift key comes through as a
keypress with code of 0...we want to ignore this */
intQuestionCounter = 0;
}
}
function DoCPExit()
{
if(window != window.parent && window.parent && window.parent["DoCPExit"] !== undefined )
{
window.parent.DoCPExit();
}
else
{
if(window.top == self)
{
var win = window.open("","_self");
win.close();
}
else
{
var win = window.top.open("","_self");
win.top.close();
}
}
}
function trace( msg )
{
if(msg) WriteToDebug("CP:"+msg);
}