Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irma_idin_webclient
Commits
fdd744e1
Commit
fdd744e1
authored
Apr 04, 2017
by
Fabian van den Broek
Browse files
WIP including error-handling
parent
15b42ed9
Changes
7
Hide whitespace changes
Inline
Side-by-side
JS/common.js
0 → 100644
View file @
fdd744e1
function
showError
(
message
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-danger
\"
role=
\"
alert
\"
>
"
+
"
<strong>
"
+
message
+
"
</strong></div>
"
);
}
var
showWarning
=
function
(
msg
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-warning
\"
role=
\"
alert
\"
>
"
+
"
<strong>Warning:</strong>
"
+
msg
+
"
</div>
"
);
};
var
showSuccess
=
function
(
msg
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-success
\"
role=
\"
alert
\"
>
"
+
msg
+
"
</div>
"
);
};
iDIN-enroll.js
→
JS/
iDIN-enroll.js
View file @
fdd744e1
...
...
@@ -13,22 +13,6 @@ $(function() {
}
}
function
showError
(
message
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-danger
\"
role=
\"
alert
\"
>
"
+
"
<strong>
"
+
message
+
"
</strong></div>
"
);
}
var
showWarning
=
function
(
msg
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-warning
\"
role=
\"
alert
\"
>
"
+
"
<strong>Warning:</strong>
"
+
msg
+
"
</div>
"
);
};
var
showSuccess
=
function
(
msg
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-success
\"
role=
\"
alert
\"
>
"
+
msg
+
"
</div>
"
);
};
function
displayAttributes
(
attr
,
translator
){
$
.
each
(
attr
,
function
(
key
,
value
){
addTableLine
(
translator
.
hasOwnProperty
(
key
)?
translator
[
key
]:
key
,
value
);
...
...
JS/iDIN-error.js
0 → 100644
View file @
fdd744e1
$
(
function
()
{
showError
(
Cookies
.
get
(
"
error
"
));
});
iDIN.js
→
JS/
iDIN.js
View file @
fdd744e1
...
...
@@ -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
"
]);
}
});
});
});
...
...
enroll.html
View file @
fdd744e1
...
...
@@ -10,13 +10,14 @@
<link
href=
"css/bootstrap.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
type=
"text/javascript"
src=
"https://privacybydesign.foundation/tomcat/irma_api_server/bower_components/jwt-decode/build/jwt-decode.js"
></script>
<script
type=
"text/javascript"
src=
"https://privacybydesign.foundation/tomcat/irma_api_server/client/irma.js"
></script>
<script
type=
"text/javascript"
src=
"js.cookie.js"
></script>
<script
type=
"text/javascript"
src=
"
JS/
js.cookie.js"
></script>
<title>
Basis attributen laden met iDIN
</title>
<script
type=
"text/javascript"
src=
"jquery-3.2.0.js"
></script>
<script
type=
"text/javascript"
src=
"
JS/
jquery-3.2.0.js"
></script>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>-->
<script
type=
"text/javascript"
src=
"iDIN-enroll.js"
></script>
<script
type=
"text/javascript"
src=
"JS/common.js"
></script>
<script
type=
"text/javascript"
src=
"JS/iDIN-enroll.js"
></script>
</head>
<body>
...
...
error.html
0 → 100644
View file @
fdd744e1
<!DOCTYPE html>
<html
lang=
"nl"
>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
href=
"css/bootstrap.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script
type=
"text/javascript"
src=
"JS/js.cookie.js"
></script>
<title>
Basis attributen laden met iDIN - ERROR
</title>
<script
type=
"text/javascript"
src=
"JS/jquery-3.2.0.js"
></script>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>-->
<script
type=
"text/javascript"
src=
"JS/common.js"
></script>
<script
type=
"text/javascript"
src=
"JS/iDIN-error.js"
></script>
</head>
<body>
<div
class=
"container"
>
<div
class=
"row"
>
<div
id=
"logo"
class=
"col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3"
>
<hr/>
<a
href=
"#"
>
<img
class=
"logo-img"
src=
"images/iDIN_logo_64.png"
/>
</a>
</div>
<div
class=
"col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3"
>
<h2>
Foutmelding
</h2>
<div
id=
"alert_box"
></div>
<p>
Keer terug naar de
<a
href=
"index.html"
>
iDIN issue pagina
</a></p>
<hr
/>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
index.html
View file @
fdd744e1
...
...
@@ -12,9 +12,10 @@
<title>
IRMA attributen vanuit iDIN
</title>
<script
type=
"text/javascript"
src=
"jquery-3.2.0.js"
></script>
<script
type=
"text/javascript"
src=
"
JS/
jquery-3.2.0.js"
></script>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>-->
<script
type=
"text/javascript"
src=
"iDIN.js"
></script>
<script
type=
"text/javascript"
src=
"JS/common.js"
></script>
<script
type=
"text/javascript"
src=
"JS/iDIN.js"
></script>
</head>
<body>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment