diff options
author | Gemorroj <wapinet@gmail.com> | 2013-01-26 16:35:29 +0400 |
---|---|---|
committer | Gemorroj <wapinet@gmail.com> | 2013-01-26 16:35:29 +0400 |
commit | fc51a91713b1e99e0aee9aa778402ee59f860d3d (patch) | |
tree | 546859f5467b6b3a7badb32a7b388887e28b6c07 /js/gis_data_editor.js | |
parent | c3f2796544bf027ac85577cd18715b0c7af7de94 (diff) |
many some minor fixes (sorry, see diff)
Diffstat (limited to 'js/gis_data_editor.js')
-rw-r--r-- | js/gis_data_editor.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/js/gis_data_editor.js b/js/gis_data_editor.js index 2cae190fd0..99dc70d529 100644 --- a/js/gis_data_editor.js +++ b/js/gis_data_editor.js @@ -14,7 +14,7 @@ var gisEditorLoaded = false; function closeGISEditor(){ $("#popup_background").fadeOut("fast"); $("#gis_editor").fadeOut("fast", function () { - $(this).html(''); + $(this).empty(); }); } @@ -26,7 +26,7 @@ function prepareJSVersion() { $("#gis_editor input[name='gis_data[save]']") .val(PMA_messages['strCopy']) .insertAfter($('#gis_data_textarea')) - .before('<br><br>'); + .before('<br/><br/>'); // Add close and cancel links $('#gis_data_editor').prepend('<a class="close_gis_editor" href="#">' + PMA_messages['strClose'] + '</a>'); @@ -56,11 +56,11 @@ function prepareJSVersion() { * @returns the HTML for a data point */ function addDataPoint(pointNumber, prefix) { - return '<br>' + $.sprintf(PMA_messages['strPointN'], (pointNumber + 1)) + ': ' + return '<br/>' + $.sprintf(PMA_messages['strPointN'], (pointNumber + 1)) + ': ' + '<label for="x">' + PMA_messages['strX'] + '</label>' - + '<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value="">' + + '<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value=""/>' + '<label for="y">' + PMA_messages['strY'] + '</label>' - + '<input type="text" name="' + prefix + '[' + pointNumber + '][y]" value="">'; + + '<input type="text" name="' + prefix + '[' + pointNumber + '][y]" value=""/>'; } /** @@ -97,7 +97,7 @@ function loadJSAndGISEditor(value, field, type, input_name, token) { 'js/jquery/jquery.event.drag-2.0.js', 'js/tbl_gis_visualization.js' ]; - for (i = 0; i < smallScripts.length; i++) { + for (var i = 0; i < smallScripts.length; i++) { script = document.createElement('script'); script.type = 'text/javascript'; script.src = smallScripts[i]; @@ -175,7 +175,7 @@ function openGISEditor() { $backgrouond.css({"opacity":"0.7"}); $gis_editor.append('<div id="gis_data_editor"><img class="ajaxIcon" id="loadingMonitorIcon" src="' - + pmaThemeImage + 'ajax_clock_small.gif" alt=""></div>' + + pmaThemeImage + 'ajax_clock_small.gif" alt=""/></div>' ); // Make it appear @@ -313,7 +313,7 @@ AJAX.registerOnload('gis_data_editor.js', function() { var noOfLines = parseInt($noOfLinesInput.val()); // Add the new linesting of inner ring based on the type - var html = '<br>'; + var html = '<br/>'; if (type == 'MULTILINESTRING') { html += PMA_messages['strLineString'] + ' ' + (noOfLines + 1) + ':'; var noOfPoints = 2; @@ -321,12 +321,12 @@ AJAX.registerOnload('gis_data_editor.js', function() { html += PMA_messages['strInnerRing'] + ' ' + noOfLines + ':'; var noOfPoints = 4; } - html += '<input type="hidden" name="' + prefix + '[' + noOfLines + '][no_of_points]" value="' + noOfPoints + '">'; - for (i = 0; i < noOfPoints; i++) { + html += '<input type="hidden" name="' + prefix + '[' + noOfLines + '][no_of_points]" value="' + noOfPoints + '"/>'; + for (var i = 0; i < noOfPoints; i++) { html += addDataPoint(i, (prefix + '[' + noOfLines + ']')); } html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfLines + '][add_point]" href="#">+ ' - + PMA_messages['strAddPoint'] + '</a><br>'; + + PMA_messages['strAddPoint'] + '</a><br/>'; $a.before(html); $noOfLinesInput.val(noOfLines + 1); @@ -345,17 +345,17 @@ AJAX.registerOnload('gis_data_editor.js', function() { var noOfPolygons = parseInt($noOfPolygonsInput.val()); // Add the new polygon - var html = PMA_messages['strPolygon'] + ' ' + (noOfPolygons + 1) + ':<br>'; - html += '<input type="hidden" name="' + prefix + '[' + noOfPolygons + '][no_of_lines]" value="1">'; - + '<br>' + PMA_messages['strOuterRing'] + ':'; - + '<input type="hidden" name="' + prefix + '[' + noOfPolygons + '][0][no_of_points]" value="4">'; - for (i = 0; i < 4; i++) { + var html = PMA_messages['strPolygon'] + ' ' + (noOfPolygons + 1) + ':<br/>'; + html += '<input type="hidden" name="' + prefix + '[' + noOfPolygons + '][no_of_lines]" value="1"/>'; + + '<br/>' + PMA_messages['strOuterRing'] + ':'; + + '<input type="hidden" name="' + prefix + '[' + noOfPolygons + '][0][no_of_points]" value="4"/>'; + for (var i = 0; i < 4; i++) { html += addDataPoint(i, (prefix + '[' + noOfPolygons + '][0]')); } html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfPolygons + '][0][add_point]" href="#">+ ' - + PMA_messages['strAddPoint'] + '</a><br>' + + PMA_messages['strAddPoint'] + '</a><br/>' + '<a class="addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]" href="#">+ ' - + PMA_messages['strAddInnerRing'] + '</a><br><br>'; + + PMA_messages['strAddInnerRing'] + '</a><br/><br/>'; $a.before(html); $noOfPolygonsInput.val(noOfPolygons + 1); @@ -371,15 +371,15 @@ AJAX.registerOnload('gis_data_editor.js', function() { var $noOfGeomsInput = $("input[name='" + prefix + "[geom_count]" + "']"); var noOfGeoms = parseInt($noOfGeomsInput.val()); - var html1 = PMA_messages['strGeometry'] + ' ' + (noOfGeoms + 1) + ':<br>'; + var html1 = PMA_messages['strGeometry'] + ' ' + (noOfGeoms + 1) + ':<br/>'; var $geomType = $("select[name='gis_data[" + (noOfGeoms - 1) + "][gis_type]']").clone(); $geomType.attr('name', 'gis_data[' + noOfGeoms + '][gis_type]').val('POINT'); - var html2 = '<br>' + PMA_messages['strPoint'] + ' :' + var html2 = '<br/>' + PMA_messages['strPoint'] + ' :' + '<label for="x"> ' + PMA_messages['strX'] + ' </label>' - + '<input type="text" name="gis_data[' + noOfGeoms + '][POINT][x]" value="">' + + '<input type="text" name="gis_data[' + noOfGeoms + '][POINT][x]" value=""/>' + '<label for="y"> ' + PMA_messages['strY'] + ' </label>' - + '<input type="text" name="gis_data[' + noOfGeoms + '][POINT][y]" value="">' - + '<br><br>'; + + '<input type="text" name="gis_data[' + noOfGeoms + '][POINT][y]" value=""/>' + + '<br/><br/>'; $a.before(html1); $geomType.insertBefore($a); $a.before(html2); $noOfGeomsInput.val(noOfGeoms + 1); |