Index: branches/RC/core/admin_templates/js/script.js =================================================================== diff -u -r11281 -r11368 --- branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 11281) +++ branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 11368) @@ -20,7 +20,6 @@ // hook processing var hBEFORE = 1; // this is const, but including this twice causes errors var hAFTER = 2; // this is const, but including this twice causes errors - var $hooks = new Array(); replaceFireBug(); } @@ -664,7 +663,6 @@ case 27: search_reset($prefix_special, $grid, parseInt($ajax)); break; - } } @@ -1396,6 +1394,7 @@ function findPos(obj, with_scroll) { if (!with_scroll) var with_scroll = false; var curleft = curtop = 0; + if (obj.offsetParent) { curleft = obj.offsetLeft - (with_scroll ? obj.scrollLeft : 0) curtop = obj.offsetTop - (with_scroll ? obj.scrollTop : 0) @@ -1404,6 +1403,7 @@ curtop += obj.offsetTop - (with_scroll ? obj.scrollTop : 0) } } + return [curleft,curtop]; } @@ -1420,19 +1420,9 @@ } }; -function addLoadEvent(func, wnd) { - if (!wnd) wnd = window - var oldonload = wnd.onload; - if (typeof wnd.onload != 'function') { - wnd.onload = func; - } else { - wnd.onload = function() { - if (oldonload) { - oldonload(); - } - func(); - } - } +function addLoadEvent(func, wnd) +{ + Application.setHook('m:OnAfterWindowLoad', func); } function replaceFireBug() { @@ -1442,8 +1432,8 @@ window.console = {}; for (var i = 0; i < names.length; ++i) { - window.console[names[i]] = function() { - alert('FireBug console object methods are not available outside Firefox!'); + window.console[names[i]] = function($msg) { + alert('FireBug console object methods are not available outside Firefox!' + "\n" + $msg); } } } @@ -1479,4 +1469,12 @@ if (typeof UploadsManager != 'undefined') { UploadsManager.iterate($method); } +} + +String.prototype.trim = function () { + return this.replace(/\s*((\S+\s*)*)/, "$1").replace(/((\s*\S+)*)\s*/, "$1"); +} + +String.prototype.toNumeric = function () { + return parseInt( this.replace(/(auto|medium)/, '0px').replace(/[a-z]/gi,'') ); } \ No newline at end of file