Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | <html> |
2 | <title>DynAPI Debugger</title> |
||
3 | <head> |
||
4 | <script> |
||
5 | function handleError(msg, url, lno) { |
||
6 | if (!(dynapi && dynapi.debug)) alert(msg); |
||
7 | else dynapi.debug.error(msg, "Debugger", lno); |
||
8 | }; |
||
9 | |||
10 | var dynapi |
||
11 | var dform |
||
12 | var win = this; |
||
13 | var lastCaller=window.opener; |
||
14 | var imgwatch,imgnormal,imghelp,imginspect,imgreload; |
||
15 | var imgclear,imgeval,imgnext,imgprev; |
||
16 | |||
17 | win.onload = function() { |
||
18 | // move the debug window to the right edge? |
||
19 | //dynapi.debug.win.clientWidth = 200; |
||
20 | //win.document.body.style.width = 200; //clientWidth=200 |
||
21 | //alert(win.setSize) |
||
22 | //alert(win.document.body.clientWidth) |
||
23 | |||
24 | var w = dynapi.ua.mac? (dynapi.ua.ie?330:300) : 360; |
||
25 | if (dynapi.ua.ie) { |
||
26 | var f = dynapi.frame; |
||
27 | var b = f.document.body; |
||
28 | var x = Math.min(f.screenLeft+b.clientWidth+20,screen.width-w-10); |
||
29 | dynapi.debug.win.moveTo(x,f.screenTop-50); |
||
30 | } |
||
31 | else if (dynapi.ua.ns4) { |
||
32 | var f = dynapi.frame; |
||
33 | var x=f.screenX+f.outerWidth; |
||
34 | var y=f.screenY+50; |
||
35 | dynapi.debug.win.moveTo(x,y); |
||
36 | }else{ |
||
37 | dynapi.debug.win.moveTo(100,100) |
||
38 | } |
||
39 | |||
40 | dform=document.forms['debugform']; |
||
41 | dynapi.debug.print(); |
||
42 | dynapi.debug.setEvaluate(); |
||
43 | |||
44 | window.setTimeout('window.onfocus = setFocus;',500); |
||
45 | } |
||
46 | |||
47 | function NullFn(){}; // null function |
||
48 | function setFocus(){ |
||
49 | dynapi={'_imageHook':NullFn}; |
||
50 | if(window.opener) dynapi = window.opener.dynapi; |
||
51 | if(dynapi && dynapi.debug) { |
||
52 | if(!dynapi.debug.win) dynapi.debug.win=win; |
||
53 | var url = dynapi.documentPath+dynapi.library.path+'ext/'; |
||
54 | var f=dynapi.functions; |
||
55 | imgwatch=f.getImage(url+'images/debug_imgwatch.gif',25,22,{alias:"DebugIMGWatch",name:"DebugIMGWatch",downsrc:url+"images/debug_imgwatch_down.gif",oversrc:url+"images/debug_imgwatch_on.gif",onclick:"dynapi.functions.False(dynapi.debug.switchMode('watch'))",tooltip:"Show Watch Mode"}).getHTML(); |
||
56 | imgnormal=f.getImage(url+'images/debug_imgnormal.gif',25,22,{alias:"DebugIMGNormal",name:"DebugIMGNormal",downsrc:url+"images/debug_imgnormal_down.gif",oversrc:url+"images/debug_imgnormal_on.gif",onclick:"dynapi.functions.False(dynapi.debug.switchMode('normal'))",tooltip:"Show Normal Mode"}).getHTML(); |
||
57 | imginspect=f.getImage(url+'images/debug_imginspect.gif',80,22,{alias:"DebugIMGInspect",name:"DebugIMGInspect",oversrc:url+"images/debug_imginspect_on.gif",onclick:"dynapi.functions.False(dynapi.debug.inspect(dynapi.debug.win.document.debugform.inspect.value))",tooltip:"Inspect Variable/Object",hspace:1}).getHTML(); |
||
58 | imgreload=f.getImage(url+'images/debug_imgreload.gif',25,22,{alias:"DebugIMGReload",name:"DebugIMGReload",oversrc:url+"images/debug_imgreload_on.gif",onclick:"dynapi.functions.False(dynapi.debug.reload(dynapi.debug.win.document.debugform.reload.value))",tooltip:"Load/Reload DynAPI Packages, HTML Pages and JavaScript (.js) files",hspace:1}).getHTML(); |
||
59 | imgclear=f.getImage(url+'images/debug_imgclear.gif',46,22,{alias:"DebugIMGClear",name:"DebugIMGClear",oversrc:url+"images/debug_imgclear_on.gif",onclick:"dynapi.functions.False(dynapi.debug.reset());",tooltip:"Clear debug window",hspace:1}).getHTML(); |
||
60 | imgeval=f.getImage(url+'images/debug_imgeval.gif',100,22,{alias:"DebugIMGEval",name:"DebugIMGEval",oversrc:url+"images/debug_imgeval_on.gif",onclick:"dynapi.functions.False(dynapi.debug.evaluate(dynapi.debug.win.document.debugform.eval.value));",tooltip:"Evalute JavaScript",hspace:2}).getHTML(); |
||
61 | imgnext=f.getImage(url+'images/debug_imgnext.gif',25,22,{alias:"DebugIMGNext",name:"DebugIMGNext",oversrc:url+"images/debug_imgnext_on.gif",onclick:"dynapi.functions.False(dynapi.debug.getEvalHistory(1))",tooltip:"Forward",hspace:1}).getHTML(); |
||
62 | imgprev=f.getImage(url+'images/debug_imgprev.gif',25,22,{alias:"DebugIMGPrev",name:"DebugIMGPrev",oversrc:url+"images/debug_imgprev_on.gif",onclick:"dynapi.functions.False(dynapi.debug.getEvalHistory(-1))",tooltip:"Backward",hspace:1}).getHTML(); |
||
63 | imghelp=f.getImage(url+'images/debug_imghelp.gif',25,22,{alias:"DebugIMGHelp",name:"DebugIMGHelp",downsrc:url+"images/debug_imghelp_down.gif",oversrc:url+"images/debug_imghelp_on.gif",onclick:"dynapi.functions.False(dynapi.debug.showHelp())",tooltip:"Quick Help",hspace:1}).getHTML(); |
||
64 | } |
||
65 | // if main window was closed then create a dynapi._imageHook() function |
||
66 | // this will disable image roller and clicks |
||
67 | if(!dynapi) dynapi={'_imageHook':NullFn}; |
||
68 | } |
||
69 | |||
70 | // set focus to debug window |
||
71 | setFocus(); |
||
72 | |||
73 | if (!dynapi.ua.ns6) self.onerror = handleError; |
||
74 | |||
75 | // write out debug style |
||
76 | if(!dynapi.ua.ns4){ |
||
77 | document.write('<style type="text/css">\n' |
||
78 | +'BODY {\n' |
||
79 | +' border-width:1px;\n' |
||
80 | +' border-style:solid;\n' |
||
81 | +' border-color:#000000;\n' |
||
82 | +'}\n' |
||
83 | +'.debugtextbox {\n' |
||
84 | +' border-width:1;\n' |
||
85 | +' border-style:solid;\n' |
||
86 | +' border-color:#3399CC;\n' |
||
87 | +'}\n' |
||
88 | +'.textinspect{width:90px;}' |
||
89 | +'.textreload{width:130px;}' |
||
90 | +'.textprint{width:340px; height:180px;}' |
||
91 | +'.textstat{width:340px;}' |
||
92 | +'.texteval{width:340px;height:132px;}' |
||
93 | +'.cboprev{width:340px;}' |
||
94 | +'</style>'); |
||
95 | } |
||
96 | </script> |
||
97 | </head> |
||
98 | <body bgcolor="#0033CC" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" scrolling=no style="overflow:hidden"> |
||
99 | <!--D4D0C8--> |
||
100 | <script> |
||
101 | var ua=dynapi.ua; |
||
102 | var url = dynapi.documentPath+dynapi.library.path+'ext/'; |
||
103 | var str = ua.ie?"Internet Explorer":(ua.ns?"Netscape":(ua.moz?"Mozilla":ua.b)); |
||
104 | var status = 'DynAPI '+dynapi.version+' ['+str+' '+dynapi.ua.v+']'; |
||
105 | |||
106 | var s=0;h=[]; |
||
107 | h[s++]='<form name="debugform"><div align="center"><center><font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">\n'; |
||
108 | h[s++]='<table border="0" bgcolor="#EFEBDE" cellspacing="0">\n'; |
||
109 | h[s++]='<tr><td colspan="2" bgcolor="#0033CC"><table border="0" width="100%" cellspacing="0" cellpadding="0">\n'; |
||
110 | h[s++]='<tr><td width="50%" nowrap><b><font size="2" color="#FFFFFF" face="Arial"><span style="cursor:default"><img border="0" src="'+url+'images/debug_icon.gif" align="absmiddle" width="32" height="32"> DynAPI Debugger</span></font></b></td>\n'; |
||
111 | h[s++]='<td width="50%" bgcolor="#0033CC"><table border="0" width="100%"><tr><td width="100%" align="right">\n'; |
||
112 | h[s++]='<font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+imgwatch+' '+imgnormal+' '+imghelp+'</font></td></tr>\n'; |
||
113 | h[s++]='</table></td></tr></table></td></tr>\n'; |
||
114 | h[s++]='<tr><td colspan="2"><table border="0" cellspacing="0"><tr><td valign="middle">\n'; |
||
115 | h[s++]='<input type="text" name="inspect" size="10" class="debugtextbox textinspect"></td><td>'+imginspect+'</td><td>\n'; |
||
116 | h[s++]='<input type="text" name="reload" size="15" class="debugtextbox textreload"></td><td>'+imgreload+'</td></tr></table></td></tr><tr><td align="center" colspan="2">\n'; |
||
117 | h[s++]='<textarea name="print" rows="11" cols="40" class="debugtextbox textprint" wrap="off"></textarea></td></tr>\n'; |
||
118 | h[s++]='<tr><td nowrap><table border="0" cellspacing="0"><tr><td>\n'; |
||
119 | h[s++]='<font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+imgclear+'</font></td><td>\n'; |
||
120 | h[s++]='<font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+imgeval+'</font></td><td align="right">\n'; |
||
121 | h[s++]='<font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+imgprev+'</font></td><td align="right">\n'; |
||
122 | h[s++]='<font face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" size="1">'+imgnext+'</font></td></tr></table>\n'; |
||
123 | h[s++]='</td><td nowrap align="center"><font size="2" face="'+(dynapi.ua.mac?'Monaco':'Courier')+'" color="#000000">JavaScript </font>\n'; |
||
124 | h[s++]='</td></tr><tr><td align="center" colspan="2">\n'; |
||
125 | h[s++]='<textarea name="eval" rows="7" cols="40" class="debugtextbox texteval" wrap="off"></textarea></td></tr>\n'; |
||
126 | h[s++]='<tr><td align="center" colspan="2">\n'; |
||
127 | h[s++]='<input type="text" name="stat" size="42" '+(dynapi.ua.mac? 'style="font-family:Monaco"':'')+' value="'+status+'" class="debugtextbox textstat"></td>\n'; |
||
128 | h[s++]='</tr></table></font></center></div></form>\n'; |
||
129 | |||
130 | document.open(); |
||
131 | document.write(h.join('')); |
||
132 | document.close(); |
||
133 | </script> |
||
134 | |||
135 | </body> |
||
136 | </html> |