From 7f9a02b7506387c7e72f46b113a04e0af81e1176 Mon Sep 17 00:00:00 2001 From: stephenbroyer Date: Fri, 9 Aug 2013 16:14:53 +0200 Subject: [PATCH] SONAR-4517 move Quality Profiles pages to Jquery --- .../dashboard/_widget_properties.html.erb | 21 +++++++++++++------ .../app/views/dashboard/configure.html.erb | 14 ++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb index ae05758e1ca..dd951d22941 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb @@ -1,8 +1,17 @@ -<% form_remote_tag :url => {:action => :save_widget, :wid => widget.id, :id => params[:id]}, - :method => :post, - :update => {:failure => "error#{widget.id}"}, - :failure => "$('error#{widget.id}').show()", - :id => "form-edit-#{widget.key.parameterize}" do -%> +
@@ -56,4 +65,4 @@
<%= hidden_field_tag "widgetid", "", :class => "widgetid" %> -<% end -%> +
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb index 137945150f1..3b6aeb0f3e0 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb @@ -70,12 +70,12 @@ Event.observe(window, 'load', init_dashboard, false); function filterWidgetsByCategory(category) { - new Ajax.Updater( - 'widget_defs', - '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category), - {asynchronous:true, evalScripts:true}); - $('filter-widgets-loading').show(); - return false; + $j('#filter-widgets-loading').show(); + $j.ajax ({ url: '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category), + success: function(responseHTML){$j('#widget_defs').html(responseHTML);}, + error:function(error){alert('error');}, + }); + return false; } var widgetContents = [ @@ -106,5 +106,5 @@ } //--> - $('filter-widget-box').focus(); + $j('#filter-widget-box').focus(); -- 2.39.5