]> git.joonet.de Git - adminer.git/commitdiff
Run <script> in AJAX
authorJakub Vrana <jakub@vrana.cz>
Mon, 22 Nov 2010 16:40:44 +0000 (17:40 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 22 Nov 2010 17:00:53 +0000 (18:00 +0100)
adminer/create.inc.php
adminer/static/functions.js
changes.txt

index e1128e6ff6f1f368d346800c18aa107f6eb059d5..6b7e5287f14b7ddea3d5d675dd58f3058f3f86cc 100644 (file)
@@ -157,9 +157,7 @@ foreach ($engines as $engine) {
 </table>
 <p>
 <?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
-<script type="text/javascript">
-document.write('<label><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?><\/label>');
-</script>
+<label><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?></label>
 <?php echo (support("comment") ? checkbox("", "", $comments, lang('Comment'), "columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();") . ' <input id="Comment" name="Comment" value="' . h($row["Comment"]) . '" maxlength="60"' . ($comments ? '' : ' class="hidden"') . '>' : ''); ?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
index 436d827e3c81c83a04a7f1b601558a898520c4cc..4edba2e951c4f9047854bf0cd0e6fd4dd652b4f0 100644 (file)
@@ -236,6 +236,14 @@ function ajaxSend(url, data) {
                if (currentState == ajaxState) {
                        clearTimeout(ajaxTimeout);
                        setHtml('content', text);
+                       var content = document.getElementById('content');
+                       var scripts = content.getElementsByTagName('script');
+                       var length = scripts.length; // required to avoid infinite loop
+                       for (var i=0; i < length; i++) {
+                               var script = document.createElement('script');
+                               script.text = scripts[i].text;
+                               content.appendChild(script);
+                       }
                        if (window.jush) {
                                jush.highlight_tag('code', 0);
                        }
index 4ba42d8367f8d209f55e61123b70a62ffefa85e0..0dfe60a8367fe8a8f5faaf437a033190741f3da3 100644 (file)
@@ -1,6 +1,6 @@
 Adminer 3.2.0-dev:
 Get long texts and slow information by AJAX
-All operations on select page by AJAX in browsers with support for history.pushState
+All links and some forms by AJAX in browsers with support for history.pushState
 
 Adminer 3.1.0 (released 2010-11-16):
 TSV export and import