Merge remote branch 'origin/master'

This commit is contained in:
Pootle server
2010-12-28 22:40:22 +01:00
2 changed files with 28 additions and 14 deletions

View File

@@ -1520,10 +1520,10 @@ function toggle_enum_notice(selectElement) {
var enum_notice_id = selectElement.attr("id").split("_")[1]; var enum_notice_id = selectElement.attr("id").split("_")[1];
enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1); enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1);
var selectedType = selectElement.attr("value"); var selectedType = selectElement.attr("value");
if(selectedType == "ENUM" || selectedType == "SET") { if (selectedType == "ENUM" || selectedType == "SET") {
$("p[id='enum_notice_" + enum_notice_id + "']").show(); $("p[id='enum_notice_" + enum_notice_id + "']").show();
} else { } else {
$("p[id='enum_notice_" + enum_notice_id + "']").hide(); $("p[id='enum_notice_" + enum_notice_id + "']").hide();
} }
} }
@@ -1652,6 +1652,7 @@ $(document).ready(function() {
.dialog({ .dialog({
title: PMA_messages['strCreateTable'], title: PMA_messages['strCreateTable'],
width: 900, width: 900,
open: PMA_verifyTypeOfAllColumns,
buttons : button_options buttons : button_options
}); // end dialog options }); // end dialog options
}) // end $.get() }) // end $.get()
@@ -2038,14 +2039,22 @@ $(document).ready(function() {
* the page loads and when the selected data type changes * the page loads and when the selected data type changes
*/ */
$(document).ready(function() { $(document).ready(function() {
$.each($("select[class='column_type']"), function() { // is called here for normal page loads and also when opening
toggle_enum_notice($(this)); // the Create table dialog
}); PMA_verifyTypeOfAllColumns();
$("select[class='column_type']").change(function() { //
// needs live() to work also in the Create Table dialog
$("select[class='column_type']").live('change', function() {
toggle_enum_notice($(this)); toggle_enum_notice($(this));
}); });
}); });
function PMA_verifyTypeOfAllColumns() {
$("select[class='column_type']").each(function() {
toggle_enum_notice($(this));
});
}
/** /**
* Closes the ENUM/SET editor and removes the data in it * Closes the ENUM/SET editor and removes the data in it
*/ */
@@ -2061,7 +2070,8 @@ function disable_popup() {
* Opens the ENUM/SET editor and controls its functions * Opens the ENUM/SET editor and controls its functions
*/ */
$(document).ready(function() { $(document).ready(function() {
$("a[class='open_enum_editor']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='open_enum_editor']").live('click', function() {
// Center the popup // Center the popup
var windowWidth = document.documentElement.clientWidth; var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight; var windowHeight = document.documentElement.clientHeight;
@@ -2100,22 +2110,26 @@ $(document).ready(function() {
}); });
// If the "close" link is clicked, close the enum editor // If the "close" link is clicked, close the enum editor
$("a[class='close_enum_editor']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='close_enum_editor']").live('click', function() {
disable_popup(); disable_popup();
}); });
// If the "cancel" link is clicked, close the enum editor // If the "cancel" link is clicked, close the enum editor
$("a[class='cancel_enum_editor']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='cancel_enum_editor']").live('click', function() {
disable_popup(); disable_popup();
}); });
// When "add a new value" is clicked, append an empty text field // When "add a new value" is clicked, append an empty text field
$("a[class='add_value']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='add_value']").live('click', function() {
$("#enum_editor #values").append("<input type='text' />"); $("#enum_editor #values").append("<input type='text' />");
}); });
// When the submit button is clicked, put the data back into the original form // When the submit button is clicked, put the data back into the original form
$("#enum_editor input[type='submit']").click(function() { // Needs live() to work also in the Create table dialog
$("#enum_editor input[type='submit']").live('click', function() {
var value_array = new Array(); var value_array = new Array();
$.each($("#enum_editor #values input"), function(index, input_element) { $.each($("#enum_editor #values input"), function(index, input_element) {
val = jQuery.trim(input_element.value); val = jQuery.trim(input_element.value);

View File

@@ -790,12 +790,12 @@ if ($action == 'tbl_create.php') {
<center><?php echo PMA_showMySQLDocu('SQL-Syntax', 'CREATE_TABLE'); ?></center> <center><?php echo PMA_showMySQLDocu('SQL-Syntax', 'CREATE_TABLE'); ?></center>
<div id="enum_editor"> <div id="enum_editor">
<a class="close_enum_editor">Close</a> <a class="close_enum_editor"><?php echo __('Close'); ?></a>
<h3><?php printf(__('Values for the column "%s"'), isset($row['Field']) ? htmlspecialchars($row['Field']) : ""); ?></h3> <h3><?php printf(__('Values for the column "%s"'), isset($row['Field']) ? htmlspecialchars($row['Field']) : ""); ?></h3>
<p><?php echo __('Enter each value in a separate field.'); ?></p> <p><?php echo __('Enter each value in a separate field.'); ?></p>
<div id="values"></div> <div id="values"></div>
<p><a class="add_value">+ Add a new value</a></p> <p><a class="add_value"><?php echo __('+ Add a new value'); ?></a></p>
<input type="submit" value="Go" /> <a class="cancel_enum_editor">Cancel</a> <input type="submit" value="<?php echo __('Go'); ?>" /> <a class="cancel_enum_editor"><?php echo __('Cancel'); ?></a>
</div> </div>
<div id="popup_background"></div> <div id="popup_background"></div>