var nbchat; var oldchat; var toutvar; var linktmp = ''; var offre = 'SupShop'; function openSupshop() { clearTimeout(toutvar); let chatlink = 'https://supshop.bexter.fr/webview/webchat.php?supshop_id=boutiquedemari'; if (chatlink == linktmp) { // console.log('ok'); return; } frameshopsrc.location= chatlink; linktmp = chatlink; jQuery('#supshop_notif').hide(); jQuery('#supshop_iframe').show(); } function closeSupshop() { clearTimeout(toutvar); jQuery('#supshop_iframe').hide(); linktmp = 'https://supshop.bexter.fr/webview/wait.php'; frameshopsrc.location= 'https://supshop.bexter.fr/webview/wait.php'; // Pour arreter les maj jQuery('#supshop_notif').show(); var tmout = 0 + ''; if(tmout != '0'){ jQuery.ajax('https://supshop.bexter.fr/webview/nochat.php', { type: 'POST', data: {'id': '48ae8d7e54917f482a10be1230dcd1de'}, success: function(result) { //console.log('log', result); } }); } } jQuery(window).load(function(){ var htmlicon = `
SupShop Bexter : Plug-in Boutique en ligne Bexter
`; if(offre === 'SupShop'){ htmlicon = `
`; } jQuery('#supshop').html(`
`+ htmlicon +`
`); var tmout = 0 + '000'; console.log(tmout, 'supshop timeout'); if(tmout=='-1000') { openSupshop(); // sans attendre } else if(tmout != '0000'){ toutvar = setTimeout(openSupshop, tmout); } })