]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4663 Remove prototypejs from Resource Viewer
authorstephenbroyer <stephen.broyer@sonarsource.com>
Fri, 20 Sep 2013 12:15:01 +0000 (14:15 +0200)
committerstephenbroyer <stephen.broyer@sonarsource.com>
Fri, 20 Sep 2013 12:18:05 +0000 (14:18 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_duplications_source_snippet.html.erb

index 534f1119c26092dd7d74bd8ef7a3986f195ff362..1bd6b69c5fa8d1dd7c57161edfd0a971f445882d 100644 (file)
            included_to_line = from_line + ResourceHelper::DUPLICATION_SNIPPET_DEFAULT_NB_OF_LINES - 1
          end
       %>
-      <%= link_to_remote link_text,
-                         :url => {:action => :show_duplication_snippet, :params => {:id => resource.id, :original_resource_id => original_resource.id, :from_line => from_line, :to_line => included_to_line, :lines_count => lines_count, :group_index => group_index}},
-                         :update => "source-#{group_index}",
-                         :before => "$('expanding-#{group_index}').addClassName('loading')" -%>
+        <a     onclick="
+        $j('#expanding<%= group_index -%>').addClass('loading');
+          $j.ajax({
+            url:'<%= url_for (:action => :show_duplication_snippet, :params => {:id =>         resource.id, :original_resource_id => original_resource.id, :from_line => from_line, :to_line => included_to_line, :lines_count => lines_count, :group_index => group_index}) -%>',
+            type:'post',
+            success:function(response){$j('#source-<%= group_index -%>').html(response);},
+            complete:function(response){$j('#expanding-<%= group_index -%>').removeClass('loading');}});
+          return false;"
+            href="#">
+            <%= link_text -%></a>
       <span id="expanding-<%= group_index -%>"></span>
     </p>
   <% end %>