diff --git a/includes/SkinMonoBook.php b/includes/SkinMonoBook.php index 7cbb80f..52dcd60 100644 --- a/includes/SkinMonoBook.php +++ b/includes/SkinMonoBook.php @@ -50,6 +50,9 @@ class SkinMonoBook extends SkinTemplate { 'mediawiki.skinning.content.externallinks', 'skins.monobook.styles' ] ); + $out->addModules( [ + 'skins.monobook.mobile' + ] ); // TODO: Migrate all of these (get RL support for conditional IE) // Force desktop styles in IE 8-; no support for @media widths diff --git a/resources/images/icon-close.gif b/resources/images/icon-close.gif new file mode 100644 index 0000000..5b50d96 Binary files /dev/null and b/resources/images/icon-close.gif differ diff --git a/resources/images/icon-close.svg b/resources/images/icon-close.svg new file mode 100644 index 0000000..711e0d6 --- /dev/null +++ b/resources/images/icon-close.svg @@ -0,0 +1,21 @@ + + diff --git a/resources/images/icon-edit.gif b/resources/images/icon-edit.gif new file mode 100644 index 0000000..ec2b6e0 Binary files /dev/null and b/resources/images/icon-edit.gif differ diff --git a/resources/images/icon-edit.svg b/resources/images/icon-edit.svg new file mode 100644 index 0000000..48fb0b4 --- /dev/null +++ b/resources/images/icon-edit.svg @@ -0,0 +1,41 @@ + + diff --git a/resources/mobile.js b/resources/mobile.js new file mode 100644 index 0000000..010d1ef --- /dev/null +++ b/resources/mobile.js @@ -0,0 +1,92 @@ +( function ( mw, $ ) { + $( function () { + var mobileCutoffWidth = 850, + // Track if DOM has been set up for mobile fanciness yet + monobookMobileElements = false, + // Toggles and targets for popouts + toggles = { + '#sidebar-toggle': '#sidebar-mobilejs', + '#p-personal-toggle': '#p-personal', + '#ca-more a': '#p-cactions', + '#ca-languages a': '#p-lang', + '#ca-tools a': '#p-tb' + }; + + // Close menus + function closeMenus() { + $( '.mobile-menu-active' ).removeClass( 'mobile-menu-active' ); + $( '.menus-cover' ).removeClass( 'visible' ); + } + + // Set up DOM for mobile fanciness + // We don't automatically do this because MonoBook; most users will be on desktop + function setupMonoBookMobile() { + if ( !monobookMobileElements && $( window ).width() <= mobileCutoffWidth ) { + // Duplicate nav + $( '#column-one' ).append( + $( '#sidebar' ).clone().find( '*' ).addBack().each( function () { + if ( this.id ) { + this.id = this.id + '-mobilejs'; + } + } ).end().end() + ); + // Thing to fade out the content while menus are active + $( '#column-one' ).append( $( '