MediaWiki:Mobile.js: Difference between revisions
Content deleted Content added
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 158:
/* ======================================================= */
/* ADD 'BIZ BOOKS' TO MOBILE SIDEBAR (
/* ======================================================= */
▲ function injectBizBooks() {
// It is usually ID 'mw-mf-page-left'▼
var $sidebar = $('#mw-mf-page-left');▼
//
if ( $drawer.length === 0 ) return false;
//
if ( $menu.length === 0 ) return false;
▲ // Create the new list item
var $newItem = $('<li>')▼
.addClass('mw-ui-icon-extra') ▼
.attr('id', 'mobile-nav-biz-books');▼
//
if ( $menu.find( '#mobile-nav-biz-books' ).length > 0 ) return true;
// Note: If the 'book' icon is blank, change 'mw-ui-icon-minerva-book' to 'mw-ui-icon-minerva-list'▼
var $newLink = $('<a>')▼
.attr('href', '/wiki/Biz/Books')▼
.text('Biz Books');▼
$newItem.append($newLink);▼
// 4. Create the List Item
▲ .attr( 'id', 'mobile-nav-biz-books' );
// We use 'mw-ui-icon-minerva-home' first because we KNOW it exists.
// We also add a temporary red border to ensure you can see it.
▲ .attr( 'href', '/wiki/Biz/Books' )
▲
.css( 'border', '1px solid red' ); // DEBUG STYLE: Remove this line later
▲ // We append it to the end of the list.
▲ // If you want it at the top, change .append() to .prepend()
}
//
// LISTEN FOR CLICK on the Hamburger Button
$( 'body' ).on( 'click', '.mw-ui-icon-minerva-mainmenu', function() {
console.log( 'BizSlash Debug: Hamburger clicked. Starting search...' );
// Retry every 50ms for 2 seconds (handles lazy loading)
// Stop if successful or after 40 attempts (2 seconds)
▲ }
if ( success || attempts > 40 ) {
});
});
} );▼
▲});
| |||