Permalink
Browse files

Join editing.js in compilation

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@815 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 5acd5a2 commit df03f4f03895ad1380f10f7adacbc60c6a09f7ee jakubvrana committed Jul 13, 2009
Showing with 14 additions and 15 deletions.
  1. +8 −11 adminer/include/bootstrap.inc.php
  2. +1 −1 adminer/include/design.inc.php
  3. +5 −3 compile.php
@@ -17,24 +17,21 @@
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
if ($_GET["file"] == "favicon.ico") {
header("Content-Type: image/x-icon");
- echo base64_decode("compile_file('favicon.ico', 'base64_encode')");
+ echo base64_decode("compile_file('../adminer/favicon.ico', 'base64_encode');");
} elseif ($_GET["file"] == "default.css") {
header("Content-Type: text/css");
- ?>compile_file('default.css', 'minify_css')<?php
+ ?>compile_file('../adminer/default.css', 'minify_css');<?php
} elseif ($_GET["file"] == "functions.js") {
header("Content-Type: text/javascript");
- ?>compile_file('functions.js', 'JSMin::minify')<?php
- } elseif ($_GET["file"] == "editing.js") {
- header("Content-Type: text/javascript");
- ?>compile_file('editing.js', 'JSMin::minify')<?php
+ ?>compile_file('../adminer/functions.js', 'JSMin::minify');compile_file('editing.js', 'JSMin::minify');<?php
} else {
header("Content-Type: image/gif");
switch ($_GET["file"]) {
- case "plus.gif": echo base64_decode("compile_file('plus.gif', 'base64_encode')"); break;
- case "cross.gif": echo base64_decode("compile_file('cross.gif', 'base64_encode')"); break;
- case "up.gif": echo base64_decode("compile_file('up.gif', 'base64_encode')"); break;
- case "down.gif": echo base64_decode("compile_file('down.gif', 'base64_encode')"); break;
- case "arrow.gif": echo base64_decode("compile_file('arrow.gif', 'base64_encode')"); break;
+ case "plus.gif": echo base64_decode("compile_file('../adminer/plus.gif', 'base64_encode');"); break;
+ case "cross.gif": echo base64_decode("compile_file('../adminer/cross.gif', 'base64_encode');"); break;
+ case "up.gif": echo base64_decode("compile_file('../adminer/up.gif', 'base64_encode');"); break;
+ case "down.gif": echo base64_decode("compile_file('../adminer/down.gif', 'base64_encode');"); break;
+ case "arrow.gif": echo base64_decode("compile_file('../adminer/arrow.gif', 'base64_encode');"); break;
}
}
exit;
@@ -17,7 +17,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<body onload="body_load();<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verify_version('$VERSION');"); ?>">
<script type="text/javascript" src="../adminer/functions.js"></script>
-<script type="text/javascript" src="./editing.js<?php // "./" to distinguish from $_GET["file"] ?>"></script>
+<script type="text/javascript" src="editing.js"></script>
<div id="content">
<?php
View
@@ -170,7 +170,8 @@ function minify_css($file) {
}
function compile_file($match) {
- return call_user_func($match[2], file_get_contents(dirname(__FILE__) . "/adminer/$match[1]"));
+ global $project;
+ return call_user_func($match[2], file_get_contents(dirname(__FILE__) . "/$project/$match[1]"));
}
error_reporting(4343); // errors and warnings
@@ -203,9 +204,10 @@ function compile_file($match) {
$file = str_replace("<?php switch_lang(); ?>\n", "", $file);
$file = str_replace('<?php echo $LANG; ?>', $_COOKIE["adminer_lang"], $file);
}
-$file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\)~", 'compile_file', $file); // integrate static files
+$file = str_replace('<script type="text/javascript" src="editing.js"></script>' . "\n", "", $file);
+$file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
$replace = 'htmlspecialchars(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&amp;version=' . $VERSION;
-$file = preg_replace('~(?:\\.\\./adminer/|\\./)(default\\.css|functions\\.js|editing\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
+$file = preg_replace('~(?:\\.\\./adminer/|\\./)(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
$file = preg_replace('~\\.\\./adminer/((plus|cross|up|down|arrow)\\.gif)~', '" . ' . $replace, $file);
$file = str_replace("../externals/jush/", "http://jush.sourceforge.net/", $file);
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);

0 comments on commit df03f4f

Please sign in to comment.