if (typeof(PhpDebugBar) == 'undefined') { // namespace var PhpDebugBar = {}; PhpDebugBar.$ = jQuery; } (function($) { /** * @namespace */ PhpDebugBar.Widgets = {}; /** * Replaces spaces with   and line breaks with
* * @param {String} text * @return {String} */ var htmlize = PhpDebugBar.Widgets.htmlize = function(text) { return text.replace(/\n/g, '
').replace(/\s/g, " ") }; /** * Returns a string representation of value, using JSON.stringify * if it's an object. * * @param {Object} value * @param {Boolean} prettify Uses htmlize() if true * @return {String} */ var renderValue = PhpDebugBar.Widgets.renderValue = function(value, prettify) { if (typeof(value) !== 'string') { if (prettify) { return htmlize(JSON.stringify(value, undefined, 2)); } return JSON.stringify(value); } return value; }; /** * Returns a prefixed css class name * * @param {String} cls * @return {String} */ var csscls = function(cls) { return PhpDebugBar.utils.csscls(cls, 'phpdebugbar-widgets-'); }; // ------------------------------------------------------------------ // Generic widgets // ------------------------------------------------------------------ /** * Displays array element in a