Index: branches/RC/core/admin_templates/js/script.js =================================================================== diff -u -r11495 -r11525 --- branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 11495) +++ branches/RC/core/admin_templates/js/script.js (.../script.js) (revision 11525) @@ -557,7 +557,12 @@ // get template name from url var $regex = new RegExp('(.*)\?env=(' + document.getElementById('sid').value + ')?-(.*?):(m[^:]+)'); $regex = $regex.exec($url); + var $t = $regex[3]; + if ($regex[4].match(/^m([\d]+)-/)) { + // remember category from url + $additional['m_cat_id'] = RegExp.$1; + } // substitute form action with selector's url var $kf = document.getElementById($form_name); @@ -1568,28 +1573,26 @@ Application.setHook('m:OnAfterWindowLoad', func); } -function replaceFireBug($load) { - if (!isset($load)) { - $load = true; - } - +function replaceFireBug() { if (window.console === undefined || !console.firebug) { - if ($load && $.isFunction(window.loadFirebugConsole)) { - window.loadFirebugConsole(); - return replaceFireBug(false); - } - var names = [ 'log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd' ]; - window.console = {}; - for (var i = 0; i < names.length; ++i) { - window.console[names[i]] = function($msg) { - alert('FireBug console object methods are not available outside Firefox!' + "\n" + $msg); - } + if (window.top.console !== undefined || window.top.firebug) { + // console is not defined in iframes, so define it here + window.console = window.top.console; } + else { + window.console = {}; + + for (var i = 0; i < names.length; ++i) { + window.console[names[i]] = function($msg) { + alert('FireBug console object methods are not available outside Firefox!' + "\n" + $msg); + } + } + } } } function runOnChange(elId) { @@ -1649,7 +1652,7 @@ function getWindowOpener($window) { // use this intead of "window.opener" - if ($window.name == 'main') { + if ($window.name == 'main' || $window.name == 'main_frame') { return null; }