Scheduled Server Maintenance:
Bharatpedia is currently undergoing server maintenance. During this period, logged-in users may experience temporary service disruptions, session interruptions, or login issues. We kindly request your patience and understanding while the maintenance work is in progress.
All services are expected to resume normally once maintenance is complete. This notice will be removed as soon as the maintenance is finished. Thank you for your cooperation.
All services are expected to resume normally once maintenance is complete. This notice will be removed as soon as the maintenance is finished. Thank you for your cooperation.
Test: add Mobile view link to Neo footer (personal test) |
Test v2: Mobile view link also for the main page remix footer |
||
| Line 1: | Line 1: | ||
/* Mobile view switch test: BharatpediaNeo does not render the | /* Mobile view switch test v2: BharatpediaNeo does not render the | ||
MobileFrontend footer toggle, so add a Mobile view link. */ | MobileFrontend footer toggle, so add a Mobile view link. | ||
v2 also covers the main page's remix footer. */ | |||
$( function () { | $( function () { | ||
if ( document.getElementById( 'bpneo-mobile-view-link' ) ) { | if ( document.getElementById( 'bpneo-mobile-view-link' ) ) { | ||
| Line 6: | Line 7: | ||
} | } | ||
var target = document.querySelector( '.bp-footer-bottom' ) || | var target = document.querySelector( '.bp-footer-bottom' ) || | ||
document.querySelector( '.bpneo-remix-footer-links' ) || | |||
document.querySelector( '.bp-footer-inner' ) || | document.querySelector( '.bp-footer-inner' ) || | ||
document.querySelector( 'footer.bp-footer' ); | document.querySelector( 'footer.bp-footer' ) || | ||
document.querySelector( 'footer.bpneo-remix-footer' ); | |||
if ( !target ) { | if ( !target ) { | ||
return; | return; | ||
Revision as of 08:29, 1 November 2026
/* Mobile view switch test v2: BharatpediaNeo does not render the
MobileFrontend footer toggle, so add a Mobile view link.
v2 also covers the main page's remix footer. */
$( function () {
if ( document.getElementById( 'bpneo-mobile-view-link' ) ) {
return;
}
var target = document.querySelector( '.bp-footer-bottom' ) ||
document.querySelector( '.bpneo-remix-footer-links' ) ||
document.querySelector( '.bp-footer-inner' ) ||
document.querySelector( 'footer.bp-footer' ) ||
document.querySelector( 'footer.bpneo-remix-footer' );
if ( !target ) {
return;
}
var a = document.createElement( 'a' );
a.id = 'bpneo-mobile-view-link';
a.textContent = 'Mobile view';
a.style.marginLeft = '1em';
a.href = '/w/index.php?title=' +
encodeURIComponent( mw.config.get( 'wgPageName' ) ) +
'&mobileaction=toggle_view_mobile';
target.appendChild( a );
} );