diff options
author | Michal Čihař <mcihar@suse.cz> | 2013-10-02 13:45:19 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2013-10-02 13:45:46 +0400 |
commit | 4f5a9e40a2af221cde83b636d04bd3e041476f0c (patch) | |
tree | 222a4848fc752ef84f866c01a5f1aa625c7cc7a6 /js/gis_data_editor.js | |
parent | 424e2ee75b84cf363dcf51754aaa2be6dc652b0a (diff) |
Coding style: line breaking before +
Diffstat (limited to 'js/gis_data_editor.js')
-rw-r--r-- | js/gis_data_editor.js | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/js/gis_data_editor.js b/js/gis_data_editor.js index 295dc69339..bdd896459c 100644 --- a/js/gis_data_editor.js +++ b/js/gis_data_editor.js @@ -42,8 +42,9 @@ function prepareJSVersion() { $button.addClass('addJs').removeClass('add'); var classes = $button.attr('class'); $button.replaceWith( - '<a class="' + classes + '" name="' + $button.attr('name') - + '" href="#">+ ' + $button.val() + '</a>' + '<a class="' + classes + + '" name="' + $button.attr('name') + + '" href="#">+ ' + $button.val() + '</a>' ); }); } @@ -56,11 +57,12 @@ function prepareJSVersion() { * @returns the HTML for a data point */ function addDataPoint(pointNumber, prefix) { - return '<br/>' + $.sprintf(PMA_messages.strPointN, (pointNumber + 1)) + ': ' - + '<label for="x">' + PMA_messages.strX + '</label>' - + '<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value=""/>' - + '<label for="y">' + PMA_messages.strY + '</label>' - + '<input type="text" name="' + prefix + '[' + pointNumber + '][y]" value=""/>'; + return '<br/>' + + $.sprintf(PMA_messages.strPointN, (pointNumber + 1)) + ': ' + + '<label for="x">' + PMA_messages.strX + '</label>' + + '<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value=""/>' + + '<label for="y">' + PMA_messages.strY + '</label>' + + '<input type="text" name="' + prefix + '[' + pointNumber + '][y]" value=""/>'; } /** @@ -174,8 +176,11 @@ function openGISEditor() { $gis_editor.css({"top": popupOffsetTop, "left": popupOffsetLeft, "width": popupWidth, "height": popupHeight}); $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>' + $gis_editor.append( + '<div id="gis_data_editor">' + + '<img class="ajaxIcon" id="loadingMonitorIcon" src="' + + pmaThemeImage + 'ajax_clock_small.gif" alt=""/>' + + '</div>' ); // Make it appear @@ -326,8 +331,8 @@ AJAX.registerOnload('gis_data_editor.js', function () { 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/>'; + html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfLines + '][add_point]" href="#">+ ' + + PMA_messages.strAddPoint + '</a><br/>'; $a.before(html); $noOfLinesInput.val(noOfLines + 1); @@ -347,16 +352,16 @@ AJAX.registerOnload('gis_data_editor.js', function () { // 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"/>'; + 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/>' - + '<a class="addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]" href="#">+ ' - + PMA_messages.strAddInnerRing + '</a><br/><br/>'; + html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfPolygons + '][0][add_point]" href="#">+ ' + + PMA_messages.strAddPoint + '</a><br/>' + + '<a class="addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]" href="#">+ ' + + PMA_messages.strAddInnerRing + '</a><br/><br/>'; $a.before(html); $noOfPolygonsInput.val(noOfPolygons + 1); @@ -375,12 +380,12 @@ AJAX.registerOnload('gis_data_editor.js', function () { 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 + ' :' - + '<label for="x"> ' + PMA_messages.strX + ' </label>' - + '<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/>'; + var html2 = '<br/>' + PMA_messages.strPoint + ' :' + + '<label for="x"> ' + PMA_messages.strX + ' </label>' + + '<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/>'; $a.before(html1); $geomType.insertBefore($a); |