[Phpfreechat-svn] SF.net SVN: phpfreechat: [828] trunk
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-16 14:46:36
|
Revision: 828 http://svn.sourceforge.net/phpfreechat/?rev=828&view=rev Author: kerphi Date: 2006-10-16 07:46:26 -0700 (Mon, 16 Oct 2006) Log Message: ----------- [en] Add pfcCommand::trace(...) function used for debug [30min] [fr] Ajout de la fonction pfcCommand::trace(...) utilis?\195?\169e pour le debug [30min] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/pfccommand.class.php trunk/themes/default/style.css Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-10-08 19:02:16 UTC (rev 827) +++ trunk/src/client/chat.js.tpl.php 2006-10-16 14:46:26 UTC (rev 828) @@ -160,6 +160,6 @@ color = '#DDD'; pfc_debug_color = true; } - $('pfc_debug').innerHTML += '<p style="margin:0;border-bottom:1px solid #555;background-color:'+color+'">' + text + '</p>'; + $('pfc_debug').innerHTML = '<p style="margin:0;border-bottom:1px solid #555;background-color:'+color+'">' + text + '</p>' + $('pfc_debug').innerHTML ; } <?php } ?> Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-10-08 19:02:16 UTC (rev 827) +++ trunk/src/pfccommand.class.php 2006-10-16 14:46:26 UTC (rev 828) @@ -131,7 +131,7 @@ { die(_pfc("%s must be implemented", get_class($this)."::".__FUNCTION__)); } - + /** * Force whois reloading */ @@ -172,8 +172,21 @@ } } } + + function trace(&$xml_reponse, $msg, $data = NULL) + { + if ($data != NULL) + { + require_once(dirname(__FILE__)."/../lib/json/JSON.php"); + $json = new Services_JSON(); + $js = $json->encode($data); + $xml_reponse->addScript("trace('".$msg." -> ".$js."');"); + } + else + $xml_reponse->addScript("trace('".$msg."');"); + + } - } ?> Modified: trunk/themes/default/style.css =================================================================== --- trunk/themes/default/style.css 2006-10-08 19:02:16 UTC (rev 827) +++ trunk/themes/default/style.css 2006-10-16 14:46:26 UTC (rev 828) @@ -338,4 +338,8 @@ img.pfc_nickbutton { cursor: pointer; +} + +div#pfc_debug { + font-size: 11px; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |