1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-15 11:04:02 +02:00

Always try to enable syntax highlighting

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@629 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-05-31 14:18:17 +00:00
parent 18ec59f636
commit 8642e59472
3 changed files with 18 additions and 12 deletions

View File

@@ -13,6 +13,22 @@ function check_version(version) {
document.body.appendChild(script); document.body.appendChild(script);
} }
function load_jush() {
var script = document.createElement('script');
script.src = 'externals/jush/jush.js';
script.onload = function () {
jush.style('externals/jush/jush.css');
jush.highlight_tag('pre');
jush.highlight_tag('code');
}
script.onreadystatechange = function () {
if (script.readyState == 'loaded' || script.readyState == 'complete') {
script.onload();
}
}
document.body.appendChild(script);
}
function tables_check(el) { function tables_check(el) {
var elems = el.form.elements; var elems = el.form.elements;
for (var i=0; i < elems.length; i++) { for (var i=0; i < elems.length; i++) {

View File

@@ -106,15 +106,8 @@ function page_footer($missing = false) {
?> ?>
</div> </div>
<?php if ($_COOKIE["highlight"] == "jush") { ?> <?php if (!$missing) { ?>
<script type="text/javascript" src="externals/jush/jush.js"></script> <script type="text/javascript">onload = load_jush;</script>
<script type="text/javascript">
if (typeof jush != 'undefined') {
jush.style('externals/jush/jush.css');
jush.highlight_tag('pre');
jush.highlight_tag('code');
}
</script>
<?php } ?> <?php } ?>
</body> </body>

View File

@@ -67,9 +67,6 @@ if (!$error && $_POST) {
<p> <p>
<input type="hidden" name="token" value="<?php echo $token; ?>" /> <input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Execute'); ?>" /> <input type="submit" value="<?php echo lang('Execute'); ?>" />
<script type="text/javascript">// <![CDATA[
document.write('<label><input type="checkbox" name="highlight" value="jush"<?php echo ($_COOKIE["highlight"] == "jush" ? ' checked="checked"' : ''); ?> /><?php echo addcslashes(lang('Syntax highlighting'), "\r\n'\\"); ?></label>');
// ]]></script>
<label><input type="checkbox" name="error_stops" value="1"<?php echo ($_POST["error_stops"] ? " checked='checked'" : ""); ?> /><?php echo lang('Stop on error'); ?></label> <label><input type="checkbox" name="error_stops" value="1"<?php echo ($_POST["error_stops"] ? " checked='checked'" : ""); ?> /><?php echo lang('Stop on error'); ?></label>
</p> </p>
</form> </form>