diff --git a/JS/common.js b/JS/common.js new file mode 100644 index 0000000000000000000000000000000000000000..3fdddbfaf3e0229b94335d9a5df5c91daf01db65 --- /dev/null +++ b/JS/common.js @@ -0,0 +1,17 @@ + +function showError(message) { + $("#alert_box").html("
" + + "" + message + "
"); +} + +var showWarning = function(msg) { + $("#alert_box").html("
" + + "Warning: " + msg + "
"); +}; + +var showSuccess = function(msg) { + $("#alert_box").html("
" + + msg + "
"); +}; + + diff --git a/iDIN-enroll.js b/JS/iDIN-enroll.js similarity index 70% rename from iDIN-enroll.js rename to JS/iDIN-enroll.js index a04323c406ac97ff8e872db5c24b185d7fd87e94..9f30c8a2120e024a07d5e541033121b6c5e18887 100644 --- a/iDIN-enroll.js +++ b/JS/iDIN-enroll.js @@ -13,22 +13,6 @@ $(function() { } } - function showError(message) { - $("#alert_box").html("
" - + "" + message + "
"); - } - - var showWarning = function(msg) { - $("#alert_box").html("
" - + "Warning: " + msg + "
"); - }; - - var showSuccess = function(msg) { - $("#alert_box").html("
" - + msg + "
"); - }; - - function displayAttributes (attr, translator){ $.each(attr,function(key, value){ addTableLine(translator.hasOwnProperty(key)?translator[key]:key, value); diff --git a/JS/iDIN-error.js b/JS/iDIN-error.js new file mode 100644 index 0000000000000000000000000000000000000000..9d16d0432339588908370960293e93e4a4afeae1 --- /dev/null +++ b/JS/iDIN-error.js @@ -0,0 +1,3 @@ +$(function() { + showError(Cookies.get("error")); +}); diff --git a/iDIN.js b/JS/iDIN.js similarity index 84% rename from iDIN.js rename to JS/iDIN.js index 06a900058c4aa950a3fb12064730127c33a660e2..691228bbe3f7215989458cea1b19ea8d418fd367 100644 --- a/iDIN.js +++ b/JS/iDIN.js @@ -38,6 +38,11 @@ $(function() { $('#form').submit(function(event) { console.log("submit pressed"); event.preventDefault(); + + //clear all errors + $(".form-group").removeClass("has-error"); + $("#alert_box").empty(); + var issuerID = $("#bank-select").prop("value"); $.ajax({ @@ -49,7 +54,11 @@ $(function() { console.log("redirect to: " + data); window.location.replace(data); }, - error: error + error: function (jqXHR, status, error) { + console.log(jqXHR, status, error); + showError(jqXHR.responseJSON["description"]); + } + }); }); }); diff --git a/enroll.html b/enroll.html index ef6765c7bd5e45f76911f96b98f09553700a38cb..49388e18a459e2bfc5e2e4dde580c12bf786a355 100644 --- a/enroll.html +++ b/enroll.html @@ -10,13 +10,14 @@ - + Basis attributen laden met iDIN - + - + + diff --git a/error.html b/error.html new file mode 100644 index 0000000000000000000000000000000000000000..e9453d168c102030ec53efec540efd91c4611dfa --- /dev/null +++ b/error.html @@ -0,0 +1,38 @@ + + + + + + + + + + Basis attributen laden met iDIN - ERROR + + + + + + + + +
+
+ +
+

Foutmelding

+ +
+ +

Keer terug naar de iDIN issue pagina

+
+
+
+
+ + \ No newline at end of file diff --git a/index.html b/index.html index de2d5aa6a56c1b4bbf8a04be8067d35c38921378..f1f0a0e4823721c880db86635f1aff2f39f780de 100644 --- a/index.html +++ b/index.html @@ -12,9 +12,10 @@ IRMA attributen vanuit iDIN - + - + +