summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-12-06 18:19:14 +0100
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-12-06 18:19:42 +0100
commit69d25bdcd1d6907768826674c9f6c32b449f80f0 (patch)
treecda5b07a97ec33e2de5304f29c11f9965fd55fb7 /sonar-server
parentf47d95888bd7694b7c29021144f246d16bd9e5f2 (diff)
downloadsonarqube-69d25bdcd1d6907768826674c9f6c32b449f80f0.tar.gz
sonarqube-69d25bdcd1d6907768826674c9f6c32b449f80f0.zip
SONAR-37 Improve HTML for Selenium ITs
- Add IDs on <a> - Change "select2.on" to a regular ".change()"
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb33
1 files changed, 18 insertions, 15 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb
index 0fb8461ac90..dbac84ef89b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb
@@ -81,13 +81,14 @@
<script>
// we don't want this parameter to be submitted, so we set its name to ''
$j('#new_metric').attr('name', '');
- $j('#new_metric').on("change", function (e) {
- if (e.val != null) {
+ $j('#new_metric').change(function (event) {
+ var metric = event.target.value;
+ if (metric != null) {
var currentMetrics = $j('#metrics').val();
if (currentMetrics.length > 0) {
currentMetrics += ',';
}
- currentMetrics += e.val;
+ currentMetrics += metric;
$j('#metrics').val(currentMetrics);
$j('#compare-form').submit();
}
@@ -105,7 +106,7 @@
<tr>
<td style="vertical-align: bottom;">
<% if index > 0 %>
- <a href="#" onclick="moveLeft(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_left.png" title="<%= message('comparison.move_left') -%>"/></a>
+ <a href="#" onclick="moveLeft(<%= index -%>)" id="left-<%= index -%>"><img src="<%= ApplicationController.root_context -%>/images/controls/move_left.png" title="<%= message('comparison.move_left') -%>"/></a>
<% else %>
<img src="<%= ApplicationController.root_context -%>/images/transparent_16.gif"/>
<% end %>
@@ -118,12 +119,12 @@
<span class="note"><%= human_short_date s.created_at -%></span>
<div style="width: 100%; text-align: center;">
- <a href="#" onclick="removeFromList(<%= index -%>, $j('#sids'))"><img src="<%= ApplicationController.root_context -%>/images/cross-gray.png" title="<%= message('comparison.remove_resource') -%>"/></a>
+ <a href="#" onclick="removeFromList(<%= index -%>, $j('#sids'))" id="del-r-<%= index -%>"><img src="<%= ApplicationController.root_context -%>/images/cross-gray.png" title="<%= message('comparison.remove_resource') -%>"/></a>
</div>
</td>
<td class="thin" style="vertical-align: bottom;">
<% if index < last_index %>
- <a href="#" onclick="moveRight(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_right.png" title="<%= message('comparison.move_right') -%>"/></a>
+ <a href="#" onclick="moveRight(<%= index -%>)" id="right-<%= index -%>"><img src="<%= ApplicationController.root_context -%>/images/controls/move_right.png" title="<%= message('comparison.move_right') -%>"/></a>
<% else %>
<img src="<%= ApplicationController.root_context -%>/images/transparent_16.gif"/>
<% end %>
@@ -143,13 +144,14 @@
<script>
// we don't want this parameter to be submitted, so we set its name to ''
$j('#new_resource').attr('name', '');
- $j('#new_resource').on("change", function (e) {
- if (e.val != null) {
+ $j('#new_resource').change(function (event) {
+ var id = event.target.value;
+ if (id != null) {
$j('#version_loading').show();
$j.ajax({
type:'GET',
url:'<%= ApplicationController.root_context -%>/comparison/versions?resource='
- + e.val + '&sids='
+ + id + '&sids='
+ $j('#sids').val(),
success:function (data) {
$j('#new_version').html(data);
@@ -171,13 +173,14 @@
<select id="new_version">
</select>
<script>
- $j('#new_version').on("change", function (e) {
- if (e.val != null) {
+ $j('#new_version').change(function (event) {
+ var id = event.target.value;
+ if (id != null) {
var currentSnapshotIds = $j('#sids').val();
if (currentSnapshotIds.length > 0) {
currentSnapshotIds += ',';
}
- currentSnapshotIds += e.val;
+ currentSnapshotIds += id;
$j('#sids').val(currentSnapshotIds);
$j('#compare-form').submit();
}
@@ -197,12 +200,12 @@
<div style="float: left; vertical-align: bottom;"><%= m.short_name -%></div>
<div style="float: right">
<% if index > 0 %>
- <a href="#" onclick="moveUp(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_up.png" title="<%= message('comparison.move_up') -%>"/></a>
+ <a href="#" onclick="moveUp(<%= index -%>)" id="up-<%= index -%>"><img src="<%= ApplicationController.root_context -%>/images/controls/move_up.png" title="<%= message('comparison.move_up') -%>"/></a>
<% end %>
<% if index < last_index %>
- <a href="#" onclick="moveDown(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_down.png" title="<%= message('comparison.move_down') -%>"/></a>
+ <a href="#" onclick="moveDown(<%= index -%>)" id="down-<%= index -%>"><img src="<%= ApplicationController.root_context -%>/images/controls/move_down.png" title="<%= message('comparison.move_down') -%>"/></a>
<% end %>
- <a href="#" onclick="removeFromList(<%= index -%>, $j('#metrics'))"><img src="<%= ApplicationController.root_context -%>/images/cross-gray.png" title="<%= message('comparison.remove_metric') -%>"/></a>
+ <a href="#" onclick="removeFromList(<%= index -%>, $j('#metrics'))" id="del-m-<%= index -%>"><img src="<%= ApplicationController.root_context -%>/images/cross-gray.png" title="<%= message('comparison.remove_metric') -%>"/></a>
</div>
</td>