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 );
} );
Explore
Main page Explore Bharatpedia Random article Discover something new Categories Browse topics and subjects Recent changes See what's changing
Useful
Preferences
Language
Appearance
Font size
Accessibility
Help
Not logged in

You are not logged in. Edits from this browser are recorded under your IP address.

Log in or create an account to get credit for future edits and access more features.

Not logged in
Please sign up or log in to edit Bharatpedia.
Create account