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:
abijah
2009-08-29 17:24:06 +00:00
parent 63704682fa
commit bf8aaea041
5 changed files with 39 additions and 40 deletions

View File

@@ -73,7 +73,7 @@
echo $html->css('themes/'.$theme.'/ui.all') . "\n"; echo $html->css('themes/'.$theme.'/ui.all') . "\n";
echo $javascript->link('jquery.form') . "\n"; echo $javascript->link('jquery.form') . "\n";
echo $javascript->link('pmgr.jquery') . "\n"; echo $javascript->link('jquery.hoverIntent') . "\n";
echo $javascript->link('pmgr') . "\n"; echo $javascript->link('pmgr') . "\n";
echo $scripts_for_layout . "\n"; echo $scripts_for_layout . "\n";
?> ?>

View File

@@ -22,11 +22,6 @@
*/ */
* {
margin:0;
padding:0;
}
/* Layout */ /* Layout */
#container { #container {
text-align: left; text-align: left;

View File

@@ -11,6 +11,7 @@
* Overall page layout * Overall page layout
*/ */
body { padding: 0; margin: 0 }
table#layout { width: 100% } table#layout { width: 100% }
td#sidecolumn , td#sidecolumn ,
td#pagecolumn { vertical-align: top; } td#pagecolumn { vertical-align: top; }

View File

@@ -9,7 +9,7 @@
* array/hash/object that is given. * array/hash/object that is given.
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php * 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 = ""; var dumped_text = "";
if(!level) level = 0; if(!level) level = 0;
@@ -34,53 +34,55 @@ function dump(arr,level) {
return dumped_text; return dumped_text;
} }
function dump(element, limit, depth) {
limit = (limit == null) ? 1 : limit;
depth = (depth == null) ? 0 : depth;
function var_dump(element, limit, depth) var rep1 = new Array(5);
{ var pad1 = rep1.join(" ");
depth = depth?depth:0; var rep = new Array(depth+1);
limit = limit?limit:1; var pad = rep.join(pad1);
returnString = '<ol>';
var props = new Array;
for(property in element) for(property in element)
{ {
//Property domConfig isn't accessable //Property domConfig isn't accessable
if (property != 'domConfig') if (property == 'domConfig')
{ continue;
returnString += '<li><strong>'+ property + '</strong> <small>(' + (typeof element[property]) +')</small>';
var propstr = '<strong>'+ property + '</strong>';
propstr += ' <small>(' + (typeof element[property]) +')</small>';
if (typeof element[property] == 'number' || typeof element[property] == 'boolean') if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
returnString += ' : <em>' + element[property] + '</em>'; propstr += ' : <em>' + element[property] + '</em>';
if (typeof element[property] == 'string' && element[property]) if (typeof element[property] == 'string' && element[property])
returnString += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' + propstr += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
element[property].replace(/</g, '&amp;lt;').replace(/>/g, '&amp;gt;') + '</code></div>'; htmlEscape(element[property]) + '</code></div>';
if ((typeof element[property] == 'object') && (depth < limit)) if ((typeof element[property] == 'object') && (depth < limit))
returnString += var_dump(element[property], limit, (depth + 1)); 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();
} }
return returnString; if (props.length == 0)
return '';
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) function htmlEscape (s) {
{
//return s;
return s.replace(/&(?!\w+([;\s]|$))/g, "&amp;") return s.replace(/&(?!\w+([;\s]|$))/g, "&amp;")
.replace(/</g, "&lt;").replace(/>/g, "&gt;"); .replace(/</g, "&lt;").replace(/>/g, "&gt;");
} }
function htmlEncode(s) { return htmlEscape(s); }
function addDiv(id_name, div_name, into_div_name, flash, html, script) { function addDiv(id_name, div_name, into_div_name, flash, html, script) {
var id = $('#'+id_name).val(); var id = $('#'+id_name).val();
@@ -128,7 +130,7 @@ function fmtCurrency(amount) {
// Get rid of any extraneous characters, determine // Get rid of any extraneous characters, determine
// the sign, and round to the nearest cent. // the sign, and round to the nearest cent.
amount = amount.toString().replace(/\$|\,/g,''); amount = amount.toString().replace(/\$|\,/g,'');
sign = (amount == (amount = Math.abs(amount))); var sign = (amount == (amount = Math.abs(amount)));
amount = (amount+0.0000000001).toFixed(2); amount = (amount+0.0000000001).toFixed(2);
// Insert thousands separator // Insert thousands separator
@@ -146,7 +148,7 @@ function fmtCurrency(amount) {
// Datepicker helpers // Datepicker helpers
function datepickerNow(id, usetime) { function datepickerNow(id, usetime) {
now = new Date(); var now = new Date();
// datepicker seems to squash the time portion, // datepicker seems to squash the time portion,
// so we have to pass in a copy of now instead. // so we have to pass in a copy of now instead.
$("#"+id).datepicker('setDate', new Date(now)); $("#"+id).datepicker('setDate', new Date(now));
@@ -163,6 +165,7 @@ function datepickerNow(id, usetime) {
} }
function datepickerSet(fromid, id, a, b) { function datepickerSet(fromid, id, a, b) {
var dt;
if (fromid == null) if (fromid == null)
dt = new Date(); dt = new Date();
else else