Skip to content

Commit

Permalink
Merge branch 'master-2.23'
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Jan 15, 2020
2 parents 4e8f5a6 + 2b98c4e commit d822fd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions admin/install.php
Expand Up @@ -568,7 +568,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
foreach( $t_prefix_defaults as $t_db_type => $t_defaults ) {
echo '<div id="default_' . $t_db_type . '" class="hidden">';
foreach( $t_defaults as $t_key => $t_value ) {
echo "\n\t" . '<span id="' . $t_key . '">' . $t_value . '</span>';
echo "\n\t" . '<span class="' . $t_key . '">' . $t_value . '</span>';
}
echo "\n" . '</div>' . "\n";
}
Expand Down Expand Up @@ -676,7 +676,10 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
echo "<tr>\n\t<td>\n";
echo "\t\t" . $t_prefix_labels[$t_key] . "\n";
echo "\t</td>\n\t<td>\n\t\t";
echo '<input id="' . $t_key . '" name="' . $t_key . '" type="text" class="db-table-prefix" value="' . $f_db_table_prefix . '">';
printf( '<input id="%1$s" name="%1$s" type="text" class="table-prefix" value="%2$s">',
$t_key,
${'f_' . $t_key} // The actual value of the corresponding form variable
);
echo "\n&nbsp;";
if( $t_key != 'db_table_suffix' ) {
$t_id_sample = $t_key. '_sample';
Expand Down
11 changes: 6 additions & 5 deletions js/install.js
Expand Up @@ -36,16 +36,17 @@ $('#db_type').change(
$('#oracle_size_warning').hide();
}

// Loop over the selected DB's default values for each pre/suffix
$('#default_' + db + ' span').each(
function (i, el) {
var target = $('#' + el.id);
function () {
var target = $("#" + this.className);
var oldVal = target.data('defval');
// Only change the value if not changed from default
if (typeof oldVal === 'undefined' || oldVal == target.val()) {
target.val($(el).text());
target.val(this.textContent);
}
// Store default value
target.data('defval', $(el).text());
target.data('defval', this.textContent);
}
);

Expand All @@ -56,7 +57,7 @@ $('#db_type').change(
/**
* Populate sample table names based on given prefix/suffix
*/
$('.db-table-prefix').on('input', update_sample_table_names);
$('input.table-prefix').on('input', update_sample_table_names);

update_sample_table_names();
});
Expand Down

0 comments on commit d822fd7

Please sign in to comment.