Created page with "→Any JavaScript here will be loaded for all users on every page load.: →===== BlueSpice Galaxy – chatbot hero banner ===== Paste into MediaWiki:Common.js. Makes "Chat with Nova" open your existing chatbot instead of following the link. Without JavaScript, the link still leads to the Help:ChatBot page as a fallback.: mw.hook( 'wikipage.content' ).add( function ( $content ) { $content.find( '.bs-hero__cta a' ).each( function () { var link = this; li..." |
No edit summary |
||
| Line 9: | Line 9: | ||
link.setAttribute( 'role', 'button' ); | link.setAttribute( 'role', 'button' ); | ||
link.addEventListener( 'click', function ( e ) { | link.addEventListener( 'click', function ( e ) { | ||
// | // BlueSpice ChatBot launch button ("Chat maximieren") | ||
var launcher = document. | var launcher = document.getElementById( 'maximizeChat' ); | ||
if ( launcher ) { | if ( launcher ) { | ||
e.preventDefault(); | e.preventDefault(); | ||
Revision as of 10:42, 16 October 2026
/* Any JavaScript here will be loaded for all users on every page load. */
/* ===== BlueSpice Galaxy – chatbot hero banner =====
Paste into MediaWiki:Common.js.
Makes "Chat with Nova" open your existing chatbot instead of following the link.
Without JavaScript, the link still leads to the Help:ChatBot page as a fallback. */
mw.hook( 'wikipage.content' ).add( function ( $content ) {
$content.find( '.bs-hero__cta a' ).each( function () {
var link = this;
link.setAttribute( 'role', 'button' );
link.addEventListener( 'click', function ( e ) {
// BlueSpice ChatBot launch button ("Chat maximieren")
var launcher = document.getElementById( 'maximizeChat' );
if ( launcher ) {
e.preventDefault();
launcher.click();
}
} );
link.addEventListener( 'keydown', function ( e ) {
if ( e.key === ' ' ) { e.preventDefault(); link.click(); }
} );
} );
} );