1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
function showConfirm(mess, response) {
window.MyConfirm = {lastConfirm: null , confirmTime: 0};
var confirmWait = setInterval(function(){
console.log(window.MyConfirm.lastConfirm);
if(typeof(window.MyConfirm.lastConfirm) == 'boolean') {
clearInterval(confirmWait);
$(document).delay(3000);
return window.MyConfirm.lastConfirm;
}
}, 2000);
if(typeof(response) == 'boolean') {
window.MyConfirm.lastConfirm = response;
} else {
if(window.Browser == 'oldie') { return confirm(mess); } else {
var content = '<div>' + mess + '<input type="button" onclick="showConfirm(null, true);" value="OK" /><input type="button" onclick="return false;" value="Annuler" /></div>';
var notification = new NotificationFx({
message : content,
layout : 'growl',
effect : 'scale',
type : 'warning',
ttl: 300000
});
notification.show();
}
}
}
var confirm = showConfirm('<p>Confirmation</p>');//Stoper tous les scripts ici temps que "showConfirm" n'a pas retourner un boolean
console.log(confirm); |
Partager