From 18e319379e920b20ed6d4120c13b7f6bbf475871 Mon Sep 17 00:00:00 2001 From: Amanda Anganes Date: Fri, 22 Mar 2013 12:26:39 -0400 Subject: [PATCH] Got bootstrap modal alert working, but not sure if it is the right approach. It looks different than the confirmation window. --- .../src/main/webapp/WEB-INF/tags/header.tag | 8 +++++++- .../src/main/webapp/resources/js/scope.js | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/openid-connect-server/src/main/webapp/WEB-INF/tags/header.tag b/openid-connect-server/src/main/webapp/WEB-INF/tags/header.tag index ceac91b1f..1847766dc 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/tags/header.tag +++ b/openid-connect-server/src/main/webapp/WEB-INF/tags/header.tag @@ -63,7 +63,7 @@ } .inputError { - border: 1px solid red !important; + border: 1px solid #b94a48 !important; } a.brand { @@ -107,4 +107,10 @@ + + +
\ No newline at end of file diff --git a/openid-connect-server/src/main/webapp/resources/js/scope.js b/openid-connect-server/src/main/webapp/resources/js/scope.js index 4942b0915..6d3743496 100644 --- a/openid-connect-server/src/main/webapp/resources/js/scope.js +++ b/openid-connect-server/src/main/webapp/resources/js/scope.js @@ -76,13 +76,25 @@ var SystemScopeView = Backbone.View.extend({ this.model.destroy({ success:function () { + self.$el.fadeTo("fast", 0.00, function () { //fade $(this).slideUp("fast", function () { //slide up $(this).remove(); //then remove from the DOM app.systemScopeListView.togglePlaceholder(); }); }); - } + }, + error:function () { + + //Display an alert with an error message + $('#modalAlert div.modal-body').html("
Warning! An error occurred when processing your request. Please refresh the page and try again.
"); + + $("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog + "backdrop" : "static", + "keyboard" : true, + "show" : true // ensure the modal is shown immediately + }); + } }); app.systemScopeListView.delegateEvents(); @@ -235,6 +247,11 @@ var SystemScopeFormView = Backbone.View.extend({ }); } + else { + //TODO: if there are any other known error cases, catch those by response status and display + //appropriate messages. + $('#value.control-group').before('
A system error occurred when processing your request.
'); + } } }); }