summaryrefslogtreecommitdiff
path: root/httemplate/elements/fckeditor/editor/fckdebug.html
blob: e3b34203652db8eaf81befffbd136ab7b20903ce (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * This is the Debug window.
 * It automatically popups if the Debug = true in the configuration file.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>FCKeditor Debug Window</title>
	<meta name="robots" content="noindex, nofollow" />
	<script type="text/javascript">

var oWindow ;
var oDiv ;

if ( !window.FCKMessages )
	window.FCKMessages = new Array() ;

window.onload = function()
{
	oWindow = document.getElementById('xOutput').contentWindow ;
	oWindow.document.open() ;
	oWindow.document.write( '<div id="divMsg"><\/div>' ) ;
	oWindow.document.close() ;
	oDiv	= oWindow.document.getElementById('divMsg') ;
}

function Output( message, color, noParse )
{
	if ( !noParse && message != null && isNaN( message ) )
		message = message.replace(/</g, "&lt;") ;

	if ( color )
		message = '<font color="' + color + '">' + message + '<\/font>' ;

	window.FCKMessages[ window.FCKMessages.length ] = message ;
	StartTimer() ;
}

function OutputObject( anyObject, color )
{
	var message ;

	if ( anyObject != null )
	{
		message = 'Properties of: ' + anyObject + '</b><blockquote>' ;

		for (var prop in anyObject)
		{
			try
			{
				var sVal = anyObject[ prop ] != null ? anyObject[ prop ] + '' : '[null]' ;
				message += '<b>' + prop + '</b> : ' + sVal.replace(/</g, '&lt;') + '<br>' ;
			}
			catch (e)
			{
				try
				{
					message += '<b>' + prop + '</b> : [' + typeof( anyObject[ prop ] ) + ']<br>' ;
				}
				catch (e)
				{
					message += '<b>' + prop + '</b> : [-error-]<br>' ;
				}
			}
		}

		message += '</blockquote><b>' ;
	} else
		message = 'OutputObject : Object is "null".' ;

	Output( message, color, true ) ;
}

function StartTimer()
{
	window.setTimeout( 'CheckMessages()', 100 ) ;
}

function CheckMessages()
{
	if ( window.FCKMessages.length > 0 )
	{
		// Get the first item in the queue
		var sMessage = window.FCKMessages[0] ;

		// Removes the first item from the queue
		var oTempArray = new Array() ;
		for ( i = 1 ; i < window.FCKMessages.length ; i++ )
			oTempArray[ i - 1 ] = window.FCKMessages[ i ] ;
		window.FCKMessages = oTempArray ;

		var d = new Date() ;
		var sTime =
			( d.getHours() + 100 + '' ).substr( 1,2 ) + ':' +
			( d.getMinutes() + 100 + '' ).substr( 1,2 ) + ':' +
			( d.getSeconds() + 100 + '' ).substr( 1,2 ) + ':' +
			( d.getMilliseconds() + 1000 + '' ).substr( 1,3 ) ;

		var oMsgDiv = oWindow.document.createElement( 'div' ) ;
		oMsgDiv.innerHTML = sTime + ': <b>' + sMessage + '<\/b>' ;
		oDiv.appendChild( oMsgDiv ) ;
		oMsgDiv.scrollIntoView() ;
	}
}

function Clear()
{
	oDiv.innerHTML = '' ;
}
	</script>
</head>
<body style="margin: 10px">
	<table style="height: 100%" cellspacing="5" cellpadding="0" width="100%" border="0">
		<tr>
			<td>
				<table cellspacing="0" cellpadding="0" width="100%" border="0">
					<tr>
						<td style="font-weight: bold; font-size: 1.2em;">
							FCKeditor Debug Window</td>
						<td align="right">
							<input type="button" value="Clear" onclick="Clear();" /></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr style="height: 100%">
			<td style="border: #696969 1px solid">
				<iframe id="xOutput" width="100%" height="100%" scrolling="auto" src="javascript:void(0)"
					frameborder="0"></iframe>
			</td>
		</tr>
	</table>
</body>
</html>