Modified the dump function, and fixed several places that needed to declare variables using var. Changed the pmgr.jquery.js file to jquery.hoverIntent.js. Fixed a bug causing no ordered lists, since padding and margin were set to 0 for all elements.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@819 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -22,11 +22,6 @@
|
||||
*/
|
||||
|
||||
|
||||
* {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
/* Layout */
|
||||
#container {
|
||||
text-align: left;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
* Overall page layout
|
||||
*/
|
||||
|
||||
body { padding: 0; margin: 0 }
|
||||
table#layout { width: 100% }
|
||||
td#sidecolumn ,
|
||||
td#pagecolumn { vertical-align: top; }
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* array/hash/object that is given.
|
||||
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
|
||||
*/
|
||||
function dump(arr,level) {
|
||||
function dump_old(arr,level) {
|
||||
var dumped_text = "";
|
||||
if(!level) level = 0;
|
||||
|
||||
@@ -34,53 +34,55 @@ function dump(arr,level) {
|
||||
return dumped_text;
|
||||
}
|
||||
|
||||
function dump(element, limit, depth) {
|
||||
limit = (limit == null) ? 1 : limit;
|
||||
depth = (depth == null) ? 0 : depth;
|
||||
|
||||
function var_dump(element, limit, depth)
|
||||
{
|
||||
depth = depth?depth:0;
|
||||
limit = limit?limit:1;
|
||||
var rep1 = new Array(5);
|
||||
var pad1 = rep1.join(" ");
|
||||
var rep = new Array(depth+1);
|
||||
var pad = rep.join(pad1);
|
||||
|
||||
returnString = '<ol>';
|
||||
|
||||
for(property in element)
|
||||
var props = new Array;
|
||||
for(property in element)
|
||||
{
|
||||
//Property domConfig isn't accessable
|
||||
if (property != 'domConfig')
|
||||
{
|
||||
returnString += '<li><strong>'+ property + '</strong> <small>(' + (typeof element[property]) +')</small>';
|
||||
//Property domConfig isn't accessable
|
||||
if (property == 'domConfig')
|
||||
continue;
|
||||
|
||||
if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
|
||||
returnString += ' : <em>' + element[property] + '</em>';
|
||||
if (typeof element[property] == 'string' && element[property])
|
||||
returnString += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
|
||||
element[property].replace(/</g, '&lt;').replace(/>/g, '&gt;') + '</code></div>';
|
||||
var propstr = '<strong>'+ property + '</strong>';
|
||||
propstr += ' <small>(' + (typeof element[property]) +')</small>';
|
||||
|
||||
if ((typeof element[property] == 'object') && (depth < limit))
|
||||
returnString += var_dump(element[property], limit, (depth + 1));
|
||||
if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
|
||||
propstr += ' : <em>' + element[property] + '</em>';
|
||||
if (typeof element[property] == 'string' && element[property])
|
||||
propstr += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
|
||||
htmlEscape(element[property]) + '</code></div>';
|
||||
if ((typeof element[property] == 'object') && (depth < limit))
|
||||
propstr += "\n" + pad + dump(element[property], limit, (depth + 1));
|
||||
|
||||
returnString += '</li>';
|
||||
}
|
||||
props.push(propstr);
|
||||
}
|
||||
returnString += '</ol>';
|
||||
|
||||
if(depth == 0)
|
||||
{
|
||||
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
|
||||
winpop.document.write('<pre>'+returnString+ '</pre>');
|
||||
winpop.document.close();
|
||||
}
|
||||
if (props.length == 0)
|
||||
return '';
|
||||
|
||||
return returnString;
|
||||
return pad + '<ol><li>' + props.join("</li>\n" + pad + pad1 + "<li>") + "</li>\n" + pad + "</ol>";
|
||||
}
|
||||
|
||||
function dump_window(element, limit) {
|
||||
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
|
||||
winpop.document.write(dump(element, limit));
|
||||
winpop.document.close();
|
||||
}
|
||||
|
||||
function htmlEncode(s)
|
||||
{
|
||||
//return s;
|
||||
function htmlEscape (s) {
|
||||
return s.replace(/&(?!\w+([;\s]|$))/g, "&")
|
||||
.replace(/</g, "<").replace(/>/g, ">");
|
||||
}
|
||||
|
||||
function htmlEncode(s) { return htmlEscape(s); }
|
||||
|
||||
function addDiv(id_name, div_name, into_div_name, flash, html, script) {
|
||||
var id = $('#'+id_name).val();
|
||||
|
||||
@@ -128,7 +130,7 @@ function fmtCurrency(amount) {
|
||||
// Get rid of any extraneous characters, determine
|
||||
// the sign, and round to the nearest cent.
|
||||
amount = amount.toString().replace(/\$|\,/g,'');
|
||||
sign = (amount == (amount = Math.abs(amount)));
|
||||
var sign = (amount == (amount = Math.abs(amount)));
|
||||
amount = (amount+0.0000000001).toFixed(2);
|
||||
|
||||
// Insert thousands separator
|
||||
@@ -146,7 +148,7 @@ function fmtCurrency(amount) {
|
||||
// Datepicker helpers
|
||||
|
||||
function datepickerNow(id, usetime) {
|
||||
now = new Date();
|
||||
var now = new Date();
|
||||
// datepicker seems to squash the time portion,
|
||||
// so we have to pass in a copy of now instead.
|
||||
$("#"+id).datepicker('setDate', new Date(now));
|
||||
@@ -163,6 +165,7 @@ function datepickerNow(id, usetime) {
|
||||
}
|
||||
|
||||
function datepickerSet(fromid, id, a, b) {
|
||||
var dt;
|
||||
if (fromid == null)
|
||||
dt = new Date();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user