diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 6c163a0b..f2654b36 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -263,14 +263,11 @@ function ajaxSetHtml(url) { /** Replace favicon * @param string -* @return string original href */ function replaceFavicon(href) { var favicon = document.getElementById('favicon'); - var orig = favicon.href; favicon.href = href; favicon.parentNode.appendChild(favicon); // to replace the icon in Firefox - return orig; } var ajaxState = 0; @@ -283,7 +280,7 @@ var ajaxState = 0; */ function ajaxSend(url, data, popState) { var currentState = ++ajaxState; - var favicon = replaceFavicon('../adminer/static/loader.gif'); + replaceFavicon('../adminer/static/loader.gif'); setHtml('loader', ''); return ajax(url, function (xmlhttp) { if (currentState == ajaxState) { @@ -298,7 +295,7 @@ function ajaxSend(url, data, popState) { } return ajaxSend(redirect); } - replaceFavicon(favicon); + replaceFavicon('../adminer/static/favicon.ico'); if (!xmlhttp.status) { setHtml('loader', ''); } else { diff --git a/compile.php b/compile.php index f1dbbc57..d643245a 100644 --- a/compile.php +++ b/compile.php @@ -262,6 +262,7 @@ foreach (array("adminer", "editor") as $project) { $file = str_replace('' . "\n", "", $file); $file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files $replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&version=' . $VERSION; + $file = preg_replace("~'\\.\\./adminer/static/(loader\\.gif|favicon\\.ico)~", "location.pathname+'?file=\\1&version=$VERSION", $file); $file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&version=$VERSION", $file); $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '', $file); $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);