1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-27 08:14:35 +02:00

Include JUSH in the compiled version

This commit is contained in:
Jakub Vrana
2013-12-19 12:34:15 -08:00
parent f41ffd9ee1
commit 2c8d81c1ae
7 changed files with 42 additions and 52 deletions

View File

@@ -12,10 +12,10 @@ if ($_GET["file"] == "favicon.ico") {
echo lzw_decompress(compile_file('../adminer/static/favicon.ico', 'lzw_compress'));
} elseif ($_GET["file"] == "default.css") {
header("Content-Type: text/css; charset=utf-8");
echo lzw_decompress(compile_file('../adminer/static/default.css', 'minify_css'));
echo lzw_decompress(compile_file('../adminer/static/default.css;../externals/jush/jush.css', 'minify_css'));
} elseif ($_GET["file"] == "functions.js") {
header("Content-Type: text/javascript; charset=utf-8");
echo lzw_decompress(compile_file('../adminer/static/functions.js;static/editing.js', 'minify_js'));
echo lzw_decompress(compile_file('../adminer/static/functions.js;static/editing.js;../externals/jush/modules/jush.js;../externals/jush/modules/jush-sql.js;../externals/jush/modules/jush-pgsql.js;../externals/jush/modules/jush-sqlite.js;../externals/jush/modules/jush-mssql.js;../externals/jush/modules/jush-oracle.js;../externals/jush/modules/jush-simpledb.js', 'minify_js'));
} else {
header("Content-Type: image/gif");
switch ($_GET["file"]) {

View File

@@ -19,8 +19,11 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<meta name="robots" content="noindex">
<title><?php echo $title_page; ?></title>
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<link rel="stylesheet" type="text/css" href="../externals/jush/jush.css">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
<?php if ($adminer->head()) { ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">

View File

@@ -1,56 +1,35 @@
// Adminer specific functions
var jushRoot = '../externals/jush/'; // global variable to allow simple customization
/** Load syntax highlighting
* @param string first three characters of database system version
*/
function bodyLoad(version) {
if (jushRoot) {
// copy of jush.style to load JS and CSS at once
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = jushRoot + 'jush.css';
document.getElementsByTagName('head')[0].appendChild(link);
var script = document.createElement('script');
script.src = jushRoot + 'jush.js';
script.onload = function () {
if (window.jush) { // IE runs in case of an error too
jush.create_links = ' target="_blank" rel="noreferrer"';
for (var key in jush.urls) {
var obj = jush.urls;
if (typeof obj[key] != 'string') {
obj = obj[key];
key = 0;
}
obj[key] = obj[key]
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
;
}
if (window.jushLinks) {
jush.custom_links = jushLinks;
}
jush.highlight_tag('code', 0);
var tags = document.getElementsByTagName('textarea');
for (var i = 0; i < tags.length; i++) {
if (/(^|\s)jush-/.test(tags[i].className)) {
var pre = jush.textarea(tags[i]);
if (pre) {
setupSubmitHighlightInput(pre);
}
}
if (window.jush) {
jush.create_links = ' target="_blank" rel="noreferrer"';
for (var key in jush.urls) {
var obj = jush.urls;
if (typeof obj[key] != 'string') {
obj = obj[key];
key = 0;
}
obj[key] = obj[key]
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
;
}
if (window.jushLinks) {
jush.custom_links = jushLinks;
}
jush.highlight_tag('code', 0);
var tags = document.getElementsByTagName('textarea');
for (var i = 0; i < tags.length; i++) {
if (/(^|\s)jush-/.test(tags[i].className)) {
var pre = jush.textarea(tags[i]);
if (pre) {
setupSubmitHighlightInput(pre);
}
}
};
script.onreadystatechange = function () {
if (/^(loaded|complete)$/.test(script.readyState)) {
script.onload();
}
};
document.body.appendChild(script);
}
}
}