mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +02:00
JSLint
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@620 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -124,12 +124,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0) {
|
|||||||
<td><input type="radio" name="auto_increment_col" value="" /><?php echo lang('Auto Increment'); ?></td>
|
<td><input type="radio" name="auto_increment_col" value="" /><?php echo lang('Auto Increment'); ?></td>
|
||||||
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?></td>
|
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td><input type="image" name="add[0]" src="plus.gif" title="<?php echo lang('Add next'); ?>" />
|
<td><input type="image" name="add[0]" src="plus.gif" title="<?php echo lang('Add next'); ?>" /><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script></td>
|
||||||
<script type="text/javascript">
|
|
||||||
var added = '.';
|
|
||||||
var row_count = <?php echo count($fields); ?>;
|
|
||||||
</script>
|
|
||||||
</td>
|
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<?php
|
<?php
|
||||||
foreach ($fields as $i => $field) {
|
foreach ($fields as $i => $field) {
|
||||||
|
25
functions.js
25
functions.js
@@ -1,3 +1,5 @@
|
|||||||
|
document.body.className = 'js';
|
||||||
|
|
||||||
function toggle(id) {
|
function toggle(id) {
|
||||||
var el = document.getElementById(id);
|
var el = document.getElementById(id);
|
||||||
el.className = (el.className == 'hidden' ? '' : 'hidden');
|
el.className = (el.className == 'hidden' ? '' : 'hidden');
|
||||||
@@ -20,6 +22,8 @@ function tables_check(el) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function where_change(op) {
|
function where_change(op) {
|
||||||
for (var i=0; i < op.form.elements.length; i++) {
|
for (var i=0; i < op.form.elements.length; i++) {
|
||||||
var el = op.form.elements[i];
|
var el = op.form.elements[i];
|
||||||
@@ -46,11 +50,15 @@ function select_add_row(field) {
|
|||||||
field.onchange = function () { };
|
field.onchange = function () { };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var added = '.', row_count;
|
||||||
|
|
||||||
function editing_add_row(button, allowed) {
|
function editing_add_row(button, allowed) {
|
||||||
if (allowed && row_count >= allowed) {
|
if (allowed && row_count >= allowed) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var match = /([0-9]+)(\.[0-9]+)?/.exec(button.name)
|
var match = /([0-9]+)(\.[0-9]+)?/.exec(button.name);
|
||||||
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
|
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
|
||||||
var row = button.parentNode.parentNode;
|
var row = button.parentNode.parentNode;
|
||||||
var row2 = row.cloneNode(true);
|
var row2 = row.cloneNode(true);
|
||||||
@@ -119,6 +127,8 @@ function partition_name_change(el) {
|
|||||||
el.onchange = function () {};
|
el.onchange = function () {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function foreign_add_row(field) {
|
function foreign_add_row(field) {
|
||||||
var row = field.parentNode.parentNode.cloneNode(true);
|
var row = field.parentNode.parentNode.cloneNode(true);
|
||||||
var selects = row.getElementsByTagName('select');
|
var selects = row.getElementsByTagName('select');
|
||||||
@@ -130,6 +140,8 @@ function foreign_add_row(field) {
|
|||||||
field.onchange = function () { };
|
field.onchange = function () { };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function indexes_add_row(field) {
|
function indexes_add_row(field) {
|
||||||
var row = field.parentNode.parentNode.cloneNode(true);
|
var row = field.parentNode.parentNode.cloneNode(true);
|
||||||
var spans = row.getElementsByTagName('span');
|
var spans = row.getElementsByTagName('span');
|
||||||
@@ -158,9 +170,12 @@ function indexes_add_column(field) {
|
|||||||
field.onchange = function () { };
|
field.onchange = function () { };
|
||||||
}
|
}
|
||||||
|
|
||||||
function schema_mousedown(el, event, top) {
|
|
||||||
|
|
||||||
|
var that, x, y, em, table_pos;
|
||||||
|
|
||||||
|
function schema_mousedown(el, event) {
|
||||||
that = el;
|
that = el;
|
||||||
em = document.getElementById('schema').offsetHeight / top;
|
|
||||||
x = event.clientX - el.offsetLeft;
|
x = event.clientX - el.offsetLeft;
|
||||||
y = event.clientY - el.offsetTop;
|
y = event.clientY - el.offsetTop;
|
||||||
}
|
}
|
||||||
@@ -223,6 +238,8 @@ function schema_mouseup(ev) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dump_check(a, name, value) {
|
function dump_check(a, name, value) {
|
||||||
var inputs = a.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('input');
|
var inputs = a.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('input');
|
||||||
for (var i=0; i < inputs.length; i++) {
|
for (var i=0; i < inputs.length; i++) {
|
||||||
@@ -232,5 +249,3 @@ function dump_check(a, name, value) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.className = 'js';
|
|
||||||
|
@@ -50,17 +50,16 @@ while ($row = $result->fetch_assoc()) {
|
|||||||
$result->free();
|
$result->free();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<div id="schema" style="height: <?php echo $top; ?>em;">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var that, x, y, em;
|
table_pos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
||||||
var table_pos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>;
|
||||||
document.onmousemove = schema_mousemove;
|
document.onmousemove = schema_mousemove;
|
||||||
document.onmouseup = schema_mouseup;
|
document.onmouseup = schema_mouseup;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="schema" style="height: <?php echo $top; ?>em;">
|
|
||||||
<?php
|
<?php
|
||||||
foreach ($schema as $name => $table) {
|
foreach ($schema as $name => $table) {
|
||||||
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event, $top);'>";
|
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event);'>";
|
||||||
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br />\n";
|
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br />\n";
|
||||||
foreach ($table["fields"] as $field) {
|
foreach ($table["fields"] as $field) {
|
||||||
$val = htmlspecialchars($field["field"]);
|
$val = htmlspecialchars($field["field"]);
|
||||||
|
Reference in New Issue
Block a user