event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / fckeditor / editor / fckdebug.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
2 <!--\r
3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
4  * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r
5  *\r
6  * == BEGIN LICENSE ==\r
7  *\r
8  * Licensed under the terms of any of the following licenses at your\r
9  * choice:\r
10  *\r
11  *  - GNU General Public License Version 2 or later (the "GPL")\r
12  *    http://www.gnu.org/licenses/gpl.html\r
13  *\r
14  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
15  *    http://www.gnu.org/licenses/lgpl.html\r
16  *\r
17  *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
18  *    http://www.mozilla.org/MPL/MPL-1.1.html\r
19  *\r
20  * == END LICENSE ==\r
21  *\r
22  * This is the Debug window.\r
23  * It automatically popups if the Debug = true in the configuration file.\r
24 -->\r
25 <html xmlns="http://www.w3.org/1999/xhtml">\r
26 <head>\r
27         <title>FCKeditor Debug Window</title>\r
28         <meta name="robots" content="noindex, nofollow" />\r
29         <script type="text/javascript">\r
30 \r
31 var oWindow ;\r
32 var oDiv ;\r
33 \r
34 if ( !window.FCKMessages )\r
35         window.FCKMessages = new Array() ;\r
36 \r
37 window.onload = function()\r
38 {\r
39         oWindow = document.getElementById('xOutput').contentWindow ;\r
40         oWindow.document.open() ;\r
41         oWindow.document.write( '<div id="divMsg"><\/div>' ) ;\r
42         oWindow.document.close() ;\r
43         oDiv    = oWindow.document.getElementById('divMsg') ;\r
44 }\r
45 \r
46 function Output( message, color, noParse )\r
47 {\r
48         if ( !noParse && message != null && isNaN( message ) )\r
49                 message = message.replace(/</g, "&lt;") ;\r
50 \r
51         if ( color )\r
52                 message = '<font color="' + color + '">' + message + '<\/font>' ;\r
53 \r
54         window.FCKMessages[ window.FCKMessages.length ] = message ;\r
55         StartTimer() ;\r
56 }\r
57 \r
58 function OutputObject( anyObject, color )\r
59 {\r
60         var message ;\r
61 \r
62         if ( anyObject != null )\r
63         {\r
64                 message = 'Properties of: ' + anyObject + '</b><blockquote>' ;\r
65 \r
66                 for (var prop in anyObject)\r
67                 {\r
68                         try\r
69                         {\r
70                                 var sVal = anyObject[ prop ] != null ? anyObject[ prop ] + '' : '[null]' ;\r
71                                 message += '<b>' + prop + '</b> : ' + sVal.replace(/</g, '&lt;') + '<br>' ;\r
72                         }\r
73                         catch (e)\r
74                         {\r
75                                 try\r
76                                 {\r
77                                         message += '<b>' + prop + '</b> : [' + typeof( anyObject[ prop ] ) + ']<br>' ;\r
78                                 }\r
79                                 catch (e)\r
80                                 {\r
81                                         message += '<b>' + prop + '</b> : [-error-]<br>' ;\r
82                                 }\r
83                         }\r
84                 }\r
85 \r
86                 message += '</blockquote><b>' ;\r
87         } else\r
88                 message = 'OutputObject : Object is "null".' ;\r
89 \r
90         Output( message, color, true ) ;\r
91 }\r
92 \r
93 function StartTimer()\r
94 {\r
95         window.setTimeout( 'CheckMessages()', 100 ) ;\r
96 }\r
97 \r
98 function CheckMessages()\r
99 {\r
100         if ( window.FCKMessages.length > 0 )\r
101         {\r
102                 // Get the first item in the queue\r
103                 var sMessage = window.FCKMessages[0] ;\r
104 \r
105                 // Removes the first item from the queue\r
106                 var oTempArray = new Array() ;\r
107                 for ( i = 1 ; i < window.FCKMessages.length ; i++ )\r
108                         oTempArray[ i - 1 ] = window.FCKMessages[ i ] ;\r
109                 window.FCKMessages = oTempArray ;\r
110 \r
111                 var d = new Date() ;\r
112                 var sTime =\r
113                         ( d.getHours() + 100 + '' ).substr( 1,2 ) + ':' +\r
114                         ( d.getMinutes() + 100 + '' ).substr( 1,2 ) + ':' +\r
115                         ( d.getSeconds() + 100 + '' ).substr( 1,2 ) + ':' +\r
116                         ( d.getMilliseconds() + 1000 + '' ).substr( 1,3 ) ;\r
117 \r
118                 var oMsgDiv = oWindow.document.createElement( 'div' ) ;\r
119                 oMsgDiv.innerHTML = sTime + ': <b>' + sMessage + '<\/b>' ;\r
120                 oDiv.appendChild( oMsgDiv ) ;\r
121                 oMsgDiv.scrollIntoView() ;\r
122         }\r
123 }\r
124 \r
125 function Clear()\r
126 {\r
127         oDiv.innerHTML = '' ;\r
128 }\r
129         </script>\r
130 </head>\r
131 <body style="margin: 10px">\r
132         <table style="height: 100%" cellspacing="5" cellpadding="0" width="100%" border="0">\r
133                 <tr>\r
134                         <td>\r
135                                 <table cellspacing="0" cellpadding="0" width="100%" border="0">\r
136                                         <tr>\r
137                                                 <td style="font-weight: bold; font-size: 1.2em;">\r
138                                                         FCKeditor Debug Window</td>\r
139                                                 <td align="right">\r
140                                                         <input type="button" value="Clear" onclick="Clear();" /></td>\r
141                                         </tr>\r
142                                 </table>\r
143                         </td>\r
144                 </tr>\r
145                 <tr style="height: 100%">\r
146                         <td style="border: #696969 1px solid">\r
147                                 <iframe id="xOutput" width="100%" height="100%" scrolling="auto" src="javascript:void(0)"\r
148                                         frameborder="0"></iframe>\r
149                         </td>\r
150                 </tr>\r
151         </table>\r
152 </body>\r
153 </html>\r