fckdebug.html 3.8 KB

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