20 |
20 |
<input type="checkbox" id="dgfip"/>
|
21 |
21 |
</p>
|
22 |
22 |
<script>
|
|
23 |
function popupwindow(url, title, w, h) {
|
|
24 |
var left = (screen.width/2)-(w/2);
|
|
25 |
var top = (screen.height/2)-(h/2);
|
|
26 |
return window.open(
|
|
27 |
url, title,
|
|
28 |
'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
|
|
29 |
}
|
23 |
30 |
var popup = null;
|
24 |
|
const popupCenter = function(url, title, w, h) {
|
25 |
|
// Fixes dual-screen position Most browsers Firefox
|
26 |
|
const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
|
27 |
|
const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
|
28 |
|
|
29 |
|
const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
|
30 |
|
const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
|
31 |
|
|
32 |
|
const systemZoom = width / window.screen.availWidth;
|
33 |
|
const left = (width - w) / 2 / systemZoom + dualScreenLeft
|
34 |
|
const top = (height - h) / 2 / systemZoom + dualScreenTop
|
35 |
|
popup = window.open(url, title,
|
36 |
|
`
|
37 |
|
scrollbars=yes,
|
38 |
|
width=${w / systemZoom},
|
39 |
|
height=${h / systemZoom},
|
40 |
|
top=${top},
|
41 |
|
left=${left}
|
42 |
|
`
|
43 |
|
)
|
44 |
|
|
45 |
|
if (window.focus) popup.focus();
|
46 |
|
};
|
47 |
31 |
|
48 |
32 |
$('#start').on('click', function () {
|
49 |
33 |
$('#user-info').hide();
|
... | ... | |
53 |
37 |
if (checkbox && checkbox.checked) {
|
54 |
38 |
url += '&mode=dgfip';
|
55 |
39 |
};
|
56 |
|
popupCenter(url, 'FranceConnect', 1000, 670);
|
|
40 |
popup = popupwindow(url, 'FranceConnect', 1000, 670);
|
|
41 |
if (window.focus) {
|
|
42 |
popup.focus();
|
|
43 |
}
|
57 |
44 |
});
|
58 |
45 |
$(window).on('message', function(event) {
|
59 |
46 |
var data = event.originalEvent.data;
|
60 |
|
-
|