Cleanup spaces
This commit is contained in:
parent
ed23518a44
commit
7af88c04c7
@ -227,21 +227,21 @@ function closeGISEditor(){
|
||||
function prepareJSVersion() {
|
||||
// Hide 'Go' buttons associated with the dropdowns
|
||||
$('.go').hide();
|
||||
|
||||
|
||||
// Change the text on the submit button
|
||||
$("input[name='gis_data[save]']")
|
||||
.attr('value', PMA_messages['strCopy'])
|
||||
.insertAfter($('#gis_data_textarea'))
|
||||
.before('<br><br>');
|
||||
|
||||
|
||||
// Add close and cancel links
|
||||
$('#gis_data_editor').prepend('<a class="close_gis_editor">' + PMA_messages['strClose'] + '</a>');
|
||||
$('<a class="cancel_gis_editor"> ' + PMA_messages['strCancel'] + '</a>')
|
||||
.insertAfter($("input[name='gis_data[save]']"));
|
||||
|
||||
|
||||
// Remove the unnecessary text
|
||||
$('div#gis_data_output p').remove();
|
||||
|
||||
|
||||
// Remove 'add' buttons and add links
|
||||
$('.add').each(function(e) {
|
||||
var $button = $(this);
|
||||
@ -279,9 +279,9 @@ function addDataPoint(pointNumber, prefix) {
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.open_gis_editor').live('click', function(event) {
|
||||
$('.open_gis_editor').live('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
// Center the popup
|
||||
var $span = $(this);
|
||||
var windowWidth = document.documentElement.clientWidth;
|
||||
@ -300,10 +300,10 @@ $(document).ready(function() {
|
||||
// Names of input field and null checkbox
|
||||
var input_name = $span.parents('tr').children('td:nth-child(5)').find('input:nth-child(3)').attr('name');
|
||||
var null_checkbox_name = $span.parents('tr').children('td:nth-child(4)').find('.checkbox_null').attr('name');
|
||||
|
||||
|
||||
$.post('gis_data_editor.php', {
|
||||
'field' : field,
|
||||
'value' : value,
|
||||
'field' : field,
|
||||
'value' : value,
|
||||
'input_name' : input_name,
|
||||
'null_checkbox_name' : null_checkbox_name,
|
||||
'get_gis_editor' : true,
|
||||
@ -316,24 +316,24 @@ $(document).ready(function() {
|
||||
PMA_ajaxShowMessage(data.error);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// Make it appear
|
||||
$("#popup_background").css({"opacity":"0.7"});
|
||||
$("#popup_background").fadeIn("fast");
|
||||
$gis_editor.fadeIn("fast");
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* Prepare and insert the GIS data in Well Known Text format
|
||||
* to the input field.
|
||||
*/
|
||||
$("input[name='gis_data[save]']").live('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
var input_name = $form.find("input[name='input_name']").val();
|
||||
var null_checkbox_name = $form.find("input[name='null_checkbox_name']").val();
|
||||
|
||||
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&generate=true", function(data) {
|
||||
if(data.success == true) {
|
||||
$("input[name='" + null_checkbox_name + "']").attr('checked', false);
|
||||
@ -342,9 +342,9 @@ $(document).ready(function() {
|
||||
PMA_ajaxShowMessage(data.error);
|
||||
}
|
||||
});
|
||||
closeGISEditor();
|
||||
closeGISEditor();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Trigger asynchronous calls on data change and update the output.
|
||||
*/
|
||||
@ -358,14 +358,14 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Update the form on change of the GIS type.
|
||||
*/
|
||||
$(".gis_type").live('change', function(event) {
|
||||
var $gis_editor = $("#gis_editor");
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
|
||||
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&get_gis_editor=true", function(data) {
|
||||
if(data.success == true) {
|
||||
$gis_editor.html(data.gis_editor);
|
||||
@ -375,14 +375,14 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Handles closing of the GIS data editor.
|
||||
*/
|
||||
$('.close_gis_editor, .cancel_gis_editor').live('click', function() {
|
||||
closeGISEditor();
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* Handles adding data points
|
||||
*/
|
||||
@ -399,7 +399,7 @@ $(document).ready(function() {
|
||||
$a.before(html);
|
||||
$noOfPointsInput.attr('value', noOfPoints + 1);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Handles adding linestrings and inner rings
|
||||
*/
|
||||
@ -429,7 +429,7 @@ $(document).ready(function() {
|
||||
html += addDataPoint(i, (prefix + '[' + noOfLines + ']'));
|
||||
}
|
||||
html += '<a class="point addJs" name="' + prefix + '[' + noOfLines + '][add_point]">+ Add a point</a><br>';
|
||||
|
||||
|
||||
$a.before(html);
|
||||
$noOfLinesInput.attr('value', noOfLines + 1);
|
||||
});
|
||||
@ -490,23 +490,23 @@ $(document).ready(function() {
|
||||
|
||||
/**
|
||||
* Handles all current checkboxes for Null; this only takes care of the
|
||||
* checkboxes on currently displayed rows as the rows generated by
|
||||
* "Continue insertion" are handled in the "Continue insertion" code
|
||||
*
|
||||
* checkboxes on currently displayed rows as the rows generated by
|
||||
* "Continue insertion" are handled in the "Continue insertion" code
|
||||
*
|
||||
*/
|
||||
$('.checkbox_null').bind('click', function(e) {
|
||||
nullify(
|
||||
// use hidden fields populated by tbl_change.php
|
||||
$(this).siblings('.nullify_code').val(),
|
||||
$(this).closest('tr').find('input:hidden').first().val(),
|
||||
$(this).closest('tr').find('input:hidden').first().val(),
|
||||
$(this).siblings('.hashed_field').val(),
|
||||
$(this).siblings('.multi_edit').val()
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Submission of data to be inserted or updated
|
||||
*
|
||||
* Submission of data to be inserted or updated
|
||||
*
|
||||
* @uses PMA_ajaxShowMessage()
|
||||
*
|
||||
* This section has been deactivated. Here are the problems that I've
|
||||
@ -521,9 +521,9 @@ $(document).ready(function() {
|
||||
* 2. This code can be called if we are editing or inserting. If editing,
|
||||
* the "and then" action can be "go back to this page" or "edit next
|
||||
* row", in which cases it makes sense to use AJAX. But the "go back
|
||||
* to previous page" and "insert another new row" actions, using AJAX
|
||||
* to previous page" and "insert another new row" actions, using AJAX
|
||||
* has no obvious advantage. If inserting, the "go back to previous"
|
||||
* action needs a page refresh anyway.
|
||||
* action needs a page refresh anyway.
|
||||
*/
|
||||
$("#insertFormDEACTIVATED").live('submit', function(event) {
|
||||
|
||||
@ -652,8 +652,8 @@ $(document).ready(function() {
|
||||
.bind('change', function(e) {
|
||||
var $changed_element = $(this);
|
||||
verificationsAfterFieldChange(
|
||||
$changed_element.data('hashed_field'),
|
||||
$changed_element.data('new_row_index'),
|
||||
$changed_element.data('hashed_field'),
|
||||
$changed_element.data('new_row_index'),
|
||||
$changed_element.closest('tr').find('span.column_type').html()
|
||||
);
|
||||
});
|
||||
@ -665,15 +665,15 @@ $(document).ready(function() {
|
||||
// to the original row, not the cloned one, so unbind()
|
||||
.unbind('click')
|
||||
// Keep these values to be used when the element
|
||||
// will be clicked
|
||||
// will be clicked
|
||||
.data('hashed_field', hashed_field)
|
||||
.data('new_row_index', new_row_index)
|
||||
.bind('click', function(e) {
|
||||
var $changed_element = $(this);
|
||||
nullify(
|
||||
$changed_element.siblings('.nullify_code').val(),
|
||||
$this_element.closest('tr').find('input:hidden').first().val(),
|
||||
$changed_element.data('hashed_field'),
|
||||
$this_element.closest('tr').find('input:hidden').first().val(),
|
||||
$changed_element.data('hashed_field'),
|
||||
'[multi_edit][' + $changed_element.data('new_row_index') + ']'
|
||||
);
|
||||
});
|
||||
@ -725,7 +725,7 @@ $(document).ready(function() {
|
||||
// IMO it's not really important to handle the tabindex for
|
||||
// function and Null
|
||||
var tabindex = 0;
|
||||
$('.textfield')
|
||||
$('.textfield')
|
||||
.each(function() {
|
||||
tabindex++;
|
||||
$(this).attr('tabindex', tabindex);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user