diff options
author | stephenbroyer <stephen.broyer@sonarsource.com> | 2013-08-09 16:14:53 +0200 |
---|---|---|
committer | stephenbroyer <stephen.broyer@sonarsource.com> | 2013-08-09 16:20:29 +0200 |
commit | 7f9a02b7506387c7e72f46b113a04e0af81e1176 (patch) | |
tree | 59d9291308c95f8d9b74cec9345ac6fd6d9473df /sonar-server | |
parent | 3101eb72ccb3ec055a653844852bcac161f3cafd (diff) | |
download | sonarqube-7f9a02b7506387c7e72f46b113a04e0af81e1176.tar.gz sonarqube-7f9a02b7506387c7e72f46b113a04e0af81e1176.zip |
SONAR-4517 move Quality Profiles pages to Jquery
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb | 21 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/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 -%> +<form onsubmit="$j.ajax + ({ + url: '<%= ApplicationController.root_context-%>/dashboard/save_widget?wid=<%=widget.id-%>', + type: 'post', + data: $j(this).serialize(), + error: function(request) + { + $j('#error<%=widget.id-%>').text(request.responseText); + $j('#error<%=widget.id-%>').show(); + }, + }); + return false;" + method="post" + action="<%= ApplicationController.root_context-%>/dashboard/save_widget?wid=<%=widget.id-%>"> <div id="error<%= widget.id -%>" class="error" style="display: none"></div> <table class="table width100"> <tbody> @@ -56,4 +65,4 @@ </tbody> </table> <%= hidden_field_tag "widgetid", "", :class => "widgetid" %> -<% end -%> +</form> 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(); </script> |