MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
Run after the page is ready; header slogan moved to MediaWiki:Sitetitle; remove duplicate Termly loader; fix mobile footer bug |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
(function () { | /* Site-wide JavaScript for IEF.wiki. | ||
* - The header slogan now comes from [[MediaWiki:Sitetitle]], so no script is needed for it. | |||
* - Termly's cookie banner is loaded by LocalSettings.php, so it is not loaded a second time here. | |||
* - Everything below waits until the page is ready (it used to run too early and fail). | |||
*/ | |||
$( function () { | |||
var disclaimer = 'IEF.wiki is open-source. All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution.'; | |||
var contact = 'IEF.wiki is a platform developed by We Are Not Limited (registered in Ireland, registration number 791583). For inquiries, you can reach us via email at hello@ief.wiki or by phone at +353 87 450 8112.'; | |||
if ( document.body.classList.contains( 'skin-vector-2022' ) ) { | |||
var footer = document.querySelector( '#footer-info' ); | |||
if ( footer ) { | |||
[ disclaimer, contact ].forEach( function ( text ) { | |||
var li = document.createElement( 'li' ); | |||
li.textContent = text; | |||
footer.appendChild( li ); | |||
} ); | |||
} | |||
} else { | |||
var footerMinerva = document.querySelector( '#footer-info-lastmod' ); | |||
if ( footerMinerva ) { | |||
footerMinerva.innerHTML = disclaimer + '<br><br>' + contact; | |||
} | |||
} | |||
} ); | |||
} else { | |||
Latest revision as of 08:38, 15 November 2026
/* Site-wide JavaScript for IEF.wiki.
* - The header slogan now comes from [[MediaWiki:Sitetitle]], so no script is needed for it.
* - Termly's cookie banner is loaded by LocalSettings.php, so it is not loaded a second time here.
* - Everything below waits until the page is ready (it used to run too early and fail).
*/
$( function () {
var disclaimer = 'IEF.wiki is open-source. All content, data, and information contributed to the IEF.wiki is made available under the CC0 1.0 Universal (Public Domain Dedication) license. This means that anyone is free to: Copy, modify, distribute, and use the content for any purpose, including commercial purposes, without asking for permission or providing attribution.';
var contact = 'IEF.wiki is a platform developed by We Are Not Limited (registered in Ireland, registration number 791583). For inquiries, you can reach us via email at hello@ief.wiki or by phone at +353 87 450 8112.';
if ( document.body.classList.contains( 'skin-vector-2022' ) ) {
var footer = document.querySelector( '#footer-info' );
if ( footer ) {
[ disclaimer, contact ].forEach( function ( text ) {
var li = document.createElement( 'li' );
li.textContent = text;
footer.appendChild( li );
} );
}
} else {
var footerMinerva = document.querySelector( '#footer-info-lastmod' );
if ( footerMinerva ) {
footerMinerva.innerHTML = disclaimer + '<br><br>' + contact;
}
}
} );