mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +02:00
Simplify JUSH replacement
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
// Adminer specific functions
|
// Adminer specific functions
|
||||||
|
|
||||||
|
var jushRoot = '../externals/jush/'; // global variable to allow simple customization
|
||||||
|
|
||||||
/** Load syntax highlighting
|
/** Load syntax highlighting
|
||||||
* @param string first three characters of database system version
|
* @param string first three characters of database system version
|
||||||
*/
|
*/
|
||||||
@@ -7,29 +9,30 @@ function bodyLoad(version) {
|
|||||||
if (history.state !== undefined) { // copied from editor/static/editing.js
|
if (history.state !== undefined) { // copied from editor/static/editing.js
|
||||||
onpopstate(history);
|
onpopstate(history);
|
||||||
}
|
}
|
||||||
var jushRoot = '../externals/jush/';
|
if (jushRoot) {
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = jushRoot + 'jush.js';
|
script.src = jushRoot + 'jush.js';
|
||||||
script.onload = function () {
|
script.onload = function () {
|
||||||
if (window.jush) { // IE runs in case of an error too
|
if (window.jush) { // IE runs in case of an error too
|
||||||
jush.create_links = ' target="_blank" rel="noreferrer"';
|
jush.create_links = ' target="_blank" rel="noreferrer"';
|
||||||
jush.urls.sql_sqlset = jush.urls.sql[0] = jush.urls.sqlset[0] = jush.urls.sqlstatus[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
|
jush.urls.sql_sqlset = jush.urls.sql[0] = jush.urls.sqlset[0] = jush.urls.sqlstatus[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
|
||||||
var pgsql = 'http://www.postgresql.org/docs/' + version + '/static/';
|
var pgsql = 'http://www.postgresql.org/docs/' + version + '/static/';
|
||||||
jush.urls.pgsql_pgsqlset = jush.urls.pgsql[0] = pgsql + '$key';
|
jush.urls.pgsql_pgsqlset = jush.urls.pgsql[0] = pgsql + '$key';
|
||||||
jush.urls.pgsqlset[0] = pgsql + 'runtime-config-$key.html#GUC-$1';
|
jush.urls.pgsqlset[0] = pgsql + 'runtime-config-$key.html#GUC-$1';
|
||||||
jush.style(jushRoot + 'jush.css');
|
jush.style(jushRoot + 'jush.css');
|
||||||
if (window.jushLinks) {
|
if (window.jushLinks) {
|
||||||
jush.custom_links = jushLinks;
|
jush.custom_links = jushLinks;
|
||||||
|
}
|
||||||
|
jush.highlight_tag('code', 0);
|
||||||
}
|
}
|
||||||
jush.highlight_tag('code', 0);
|
};
|
||||||
}
|
script.onreadystatechange = function () {
|
||||||
};
|
if (/^(loaded|complete)$/.test(script.readyState)) {
|
||||||
script.onreadystatechange = function () {
|
script.onload();
|
||||||
if (/^(loaded|complete)$/.test(script.readyState)) {
|
}
|
||||||
script.onload();
|
};
|
||||||
}
|
document.body.appendChild(script);
|
||||||
};
|
}
|
||||||
document.body.appendChild(script);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get value of dynamically created form field
|
/** Get value of dynamically created form field
|
||||||
|
Reference in New Issue
Block a user