diff --git a/site/views/layouts/default.ctp b/site/views/layouts/default.ctp index c123318..0bd6e7f 100644 --- a/site/views/layouts/default.ctp +++ b/site/views/layouts/default.ctp @@ -73,7 +73,7 @@ echo $html->css('themes/'.$theme.'/ui.all') . "\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 $scripts_for_layout . "\n"; ?> diff --git a/site/webroot/css/cake.generic.css b/site/webroot/css/cake.generic.css index ff97edb..0e7b266 100644 --- a/site/webroot/css/cake.generic.css +++ b/site/webroot/css/cake.generic.css @@ -22,11 +22,6 @@ */ -* { - margin:0; - padding:0; -} - /* Layout */ #container { text-align: left; diff --git a/site/webroot/css/layout.css b/site/webroot/css/layout.css index df70489..ba42552 100644 --- a/site/webroot/css/layout.css +++ b/site/webroot/css/layout.css @@ -11,6 +11,7 @@ * Overall page layout */ +body { padding: 0; margin: 0 } table#layout { width: 100% } td#sidecolumn , td#pagecolumn { vertical-align: top; } diff --git a/site/webroot/js/pmgr.jquery.js b/site/webroot/js/jquery.hoverIntent.js similarity index 100% rename from site/webroot/js/pmgr.jquery.js rename to site/webroot/js/jquery.hoverIntent.js diff --git a/site/webroot/js/pmgr.js b/site/webroot/js/pmgr.js index b9ce8a0..7c17050 100644 --- a/site/webroot/js/pmgr.js +++ b/site/webroot/js/pmgr.js @@ -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 = '
    '; - - for(property in element) + var props = new Array; + for(property in element) { - //Property domConfig isn't accessable - if (property != 'domConfig') - { - returnString += '
  1. '+ property + ' (' + (typeof element[property]) +')'; + //Property domConfig isn't accessable + if (property == 'domConfig') + continue; - if (typeof element[property] == 'number' || typeof element[property] == 'boolean') - returnString += ' : ' + element[property] + ''; - if (typeof element[property] == 'string' && element[property]) - returnString += ':
    ' + - element[property].replace(//g, '>') + '
    '; + var propstr = ''+ property + ''; + propstr += ' (' + (typeof element[property]) +')'; - 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 += ' : ' + element[property] + ''; + if (typeof element[property] == 'string' && element[property]) + propstr += ':
    ' + + htmlEscape(element[property]) + '
    '; + if ((typeof element[property] == 'object') && (depth < limit)) + propstr += "\n" + pad + dump(element[property], limit, (depth + 1)); - returnString += '
  2. '; - } + props.push(propstr); } - returnString += '
'; - if(depth == 0) - { - winpop = window.open("", "","width=800,height=600,scrollbars,resizable"); - winpop.document.write('
'+returnString+ '
'); - winpop.document.close(); - } + if (props.length == 0) + return ''; - return returnString; + return pad + '
  1. ' + props.join("
  2. \n" + pad + pad1 + "
  3. ") + "
  4. \n" + pad + "
"; } +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, ">"); } +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