« MediaWiki:Common.js » : différence entre les versions
De DMS
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 32 : | Ligne 32 : | ||
// }); | // }); | ||
window.addEventListener('message', function(event) { | |||
if (event.data.name === 'webchatReady') { | |||
window.botpressWebChat.sendEvent({ | |||
type: 'proactive-trigger', | |||
channel: 'web', | |||
payload: { text: 'Salut' } | |||
}) | |||
} | |||
}); | |||
}); | }); |
Version du 20 octobre 2022 à 08:47
/* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */ mw.loader.load( "/chatTest2/assets/modules/channel-web/inject.js"); $( function () { setTimeout(function() { window.botpressWebChat.init({ host: '/chatTest2', backgroundColor: '#ffff00', botId: 'myfirst', locale: 'fr', botConvoDescription: 'nous sommes en test', enableReset: true, showConversationsButton: false, enableTranscriptDownload: false, showUserName: false, showPoweredBy: false, botName: 'Test', extraStylesheet: '/default-emulator.css', botConvoTitle: 'Tech', enableArrowNavigation: true, exposeStore: true }); },900); // window.addEventListener("message", function(event) { // if (event.data && event.data.name === "webchatLoaded") { // window.botpressWebChat.mergeConfig({ // layoutWidth: "100%", // }); // } // }); window.addEventListener('message', function(event) { if (event.data.name === 'webchatReady') { window.botpressWebChat.sendEvent({ type: 'proactive-trigger', channel: 'web', payload: { text: 'Salut' } }) } }); });