The branch, master has been updated via 02b9dc80089d3277f5c96d526d0b9fca8c189cb3 (commit) from 45ec0da621e96c108bc70395eb01ad9495f281d0 (commit)
- Log ----------------------------------------------------------------- commit 02b9dc80089d3277f5c96d526d0b9fca8c189cb3 Author: Marc Delisle marc@infomarc.info Date: Sat Dec 18 08:47:50 2010 -0500
"Continue insertion" feature did not work with "Browse foreign values" links
-----------------------------------------------------------------------
Summary of changes: js/tbl_change.js | 25 +++++++++++++++++++++---- tbl_change.php | 12 ++---------- 2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/js/tbl_change.js b/js/tbl_change.js index 758add1..90d28fe 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -258,6 +258,9 @@ function unNullify(urlField, multi_edit) */ $(document).ready(function() {
+ // these were hidden via the "hide" class + $('.foreign_values_anchor').show(); + /** * Handles all current checkboxes for Null * @@ -363,10 +366,15 @@ $(document).ready(function() { */ var last_row = $("#insertForm").find(".insertRowTable:last");
+ // need to access this at more than one level + // (also needs improvement because it should be calculated + // just once per cloned row, not once per column) + var new_row_index = 0; + //Clone the insert tables $(last_row) .clone() - .insertBefore("#insertForm > fieldset") + .insertBefore("#actions_panel") .find('input[name*=multi_edit],select[name*=multi_edit]') .each(function() {
@@ -387,7 +395,7 @@ $(document).ready(function() { var old_row_index = parseInt(old_row_index_string.match(/\d+/)[0]);
/** calculate next index i.e. 11 */ - var new_row_index = old_row_index + 1; + new_row_index = old_row_index + 1; /** generate the new name i.e. funcs[multi_edit][11][foobarbaz] */ var new_name = name_parts[0] + '[' + new_row_index + ']' + name_parts[1];
@@ -417,8 +425,17 @@ $(document).ready(function() { ); }) .end(); - - }); + }) + .end() + .find('.foreign_values_anchor') + .each(function() { + $anchor = $(this); + var new_value = 'pk=' + new_row_index; + // needs improvement in case something else inside + // the href contains this pattern + var new_href = $anchor.attr('href').replace(/pk=\d+/, new_value); + $anchor.attr('href', new_href ); + });
//Insert/Clone the ignore checkboxes if(curr_rows == 1 ) { diff --git a/tbl_change.php b/tbl_change.php index eaf0bc3..60f3bf5 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -659,15 +659,7 @@ foreach ($rows as $row_id => $vrow) { tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>" id="field_<?php echo ($idindex); ?>_3" value="<?php echo htmlspecialchars($data); ?>" /> - <script type="text/javascript"> - //<![CDATA[ - document.writeln('<a target="_blank" onclick="window.open(this.href, \'foreigners\', \'width=640,height=240,scrollbars=yes,resizable=yes\'); return false"'); - document.write(' href="browse_foreigners.php?'); - document.write('<?php echo PMA_generate_common_url($db, $table); ?>'); - document.writeln('&field=<?php echo PMA_escapeJsString(urlencode($field['Field']) . $browse_foreigners_uri); ?>">'); - document.writeln('<?php echo str_replace("'", "\'", $titles['Browse']); ?></a>'); - //]]> - </script> + <a class="hide foreign_values_anchor" target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes,resizable=yes'); return false;" href="browse_foreigners.php?<?php echo PMA_generate_common_url($db, $table); ?>&field=<?php echo PMA_escapeJsString(urlencode($field['Field']) . $browse_foreigners_uri); ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a> <?php } elseif (is_array($foreignData['disp_row'])) { echo $backup_field . "\n"; @@ -1015,7 +1007,7 @@ $(function() { ?> <br />
- <fieldset> + <fieldset id="actions_panel"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td valign="middle" nowrap="nowrap">
hooks/post-receive