* @version $Revision: 1.2 $ $Date: 2005/11/06 23:02:33 $ * @package System.Web.UI.WebControls */ /** * TJavascriptLogger class. * * Provides logging for client-side javascript. Example: template code * * * Client-side javascript code to log info, error, warn, debug * Logger.warn('A warning'); * Logger.info('something happend'); * * * To see the logger and console, press ALT-D (or CTRL-D on OS X). * More information on the logger can be found at * http://gleepglop.com/javascripts/logger/ * * @author Wei Zhuo * @version $Revision: 1.2 $ $Date: 2005/11/06 23:02:33 $ * @package System.Web.UI.WebControls * @since 2.0.2 */ class TJavascriptLogger extends TWebControl { /** * @return string tag name of the panel */ protected function getTagName() { return 'div'; } /** * Register the required javascript libraries and * display some general usage information. * @param THtmlWriter the writer used for the rendering purpose */ protected function renderContents($writer) { $this->Page->ClientScript->registerClientScript('logger'); $info = '(more info).'; $usage = 'Press ALT-D (Or CTRL-D on OS X) to toggle the javascript log console'; $writer->write("{$usage} {$info}"); parent::renderContents($writer); } } ?>