diff --git a/BootstrapMediaWiki.skin.php b/BootstrapMediaWiki.skin.php index 5c85470..a73cc77 100644 --- a/BootstrapMediaWiki.skin.php +++ b/BootstrapMediaWiki.skin.php @@ -4,7 +4,9 @@ * * @Version 1.0.0 * @Author Matthew Batchelder + * @Author Creative Commons Corporation * @Copyright Matthew Batchelder 2012 - http://borkweb.com/ + * @Copyright Creative Commons Corporation 2015 - https://github.com/creativecommons/bootstrap-mediawiki * @License: GPLv2 (http://www.gnu.org/copyleft/gpl.html) */ @@ -64,7 +66,7 @@ class BootstrapMediaWikiTemplate extends QuickTemplate { /** * @var Cached skin object */ - public $skin; + //public $skin; /** * Template filter callback for Bootstrap skin. @@ -82,7 +84,7 @@ public function execute() { global $wgNavBarClasses; global $wgSubnavBarClasses; - $this->skin = $this->data['skin']; + //$this->skin = $this->data['skin']; $action = $wgRequest->getText( 'action' ); $url_prefix = str_replace( '$1', '', $wgArticlePath ); @@ -125,8 +127,7 @@ public function execute() { if ( $wgUser->isLoggedIn() ) { if ( count( $this->data['personal_urls'] ) > 0 ) { $user_icon = ''; - $name = strtolower( $wgUser->getName() ); - $user_nav = $this->get_array_links( $this->data['personal_urls'], $user_icon . $name, 'user' ); + $user_nav = $this->get_array_links( $this->data['personal_urls'], $user_icon . $wgUser->getName(), 'user' ); ?> html('userlangattributes') ?> class="nav navbar-nav navbar-right"> @@ -144,7 +145,7 @@ public function execute() { ?>
- includePage('Bootstrap:Footer'); ?> - +
diff --git a/NoUserLoginForm.php b/NoUserLoginForm.php new file mode 100644 index 0000000..eb9ffbb --- /dev/null +++ b/NoUserLoginForm.php @@ -0,0 +1,37 @@ + 'NoUserCreateForm', + 'version' => '0.1', + 'author' => 'Creative Commons Corporation', + 'url' => 'https://github.com/creativecommons/bootstrap-mediawiki', + 'description' => 'Removes the standard user creation form' +); + +$wgHooks['UserLoginForm'][] = 'noUserLoginForm'; + +class NoUserLoginFormTemplate extends BaseTemplate { + + function execute() { + // A link to log in/out would be confusing, text would require i18n + echo ''; + } +} + +function noUserLoginForm( &$template ) { + $template = new NoUserLoginFormTemplate(); + return true ; +} diff --git a/js/behavior.js b/js/behavior.js index 6629515..f8e221f 100644 --- a/js/behavior.js +++ b/js/behavior.js @@ -4,7 +4,7 @@ $(function() { $('#page-contents a').click(function(e){ e.preventDefault(); var $target = $(this).attr('href'); - $(document).scrollTop( $($target).offset().top-100 ); + $(document).scrollTop( $($target).offset().top-100 ); }); $( document ).on('change', '#subnav-select', function() { @@ -53,53 +53,39 @@ $(function() { }); $('.tip').tooltip(); - $('[data-toggle="popover"]').popover(); + //$('[data-toggle="popover"]').popover(); - if ( $('.toc-sidebar').length > 0 ) { - if ( 0 === $('#toc').length ) { - $('.toc-sidebar').remove(); - $('.wiki-body-section').removeClass('col-md-9').addClass('col-md-12'); - } else { - $('.toc-sidebar').append('

Contents

'); - $('#toc').each(function() { - $(this).find('ul:first').appendTo( '.toc-sidebar' ); - $(this).remove(); - }); + $('.toc-sidebar').remove(); + $('.wiki-body-section').removeClass('col-md-9').addClass('col-md-12'); - $('.toc-sidebar').attr('id', 'toc'); - }//end else - } else { - $('#toc').each(function() { - var $toc = $(this); - var $title = $toc.find('#toctitle'); - var $links = $title.siblings('ul'); + //$('.page-header').prepend(''); - $('.page-header').prepend('
'); + if( $('.page-header .nav').length === 0 ) { + $('.page-header').prepend(''); + }//end if - $('.page-header #page-contents').find('.dropdown-menu').html( $links.html() ); - }); + var $header = $('.page-header'); + var $hero = $('.hero-unit'); + var $edit = $('.navbar .content-actions .edit'); + if( $edit.length > 0 ) { + if( $hero.length ) { + if( ! $hero.find('.nav-pills').length ) { + $hero.prepend(''); + }//end if - if( $('.page-header .nav').length === 0 ) { - $('.page-header').prepend(''); - }//end if - - var $header = $('.page-header'); - var $hero = $('.hero-unit'); - var $edit = $('.navbar .content-actions .edit'); - if( $edit.length > 0 ) { - if( $hero.length ) { - if( ! $hero.find('.nav-pills').length ) { - $hero.prepend(''); - }//end if - - $edit.closest('li').clone().prependTo( $hero.find('.nav-pills') ); - } else { - $edit.closest('li').clone().prependTo( $header.find('.nav-pills') ); - }//end else - }//end if + $edit.closest('li').clone().prependTo( $hero.find('.nav-pills') ); + } else { + $edit.closest('li').clone().prependTo( $header.find('.nav-pills') ); + }//end else }//end if +// }//end if + + prettyPrint(); - prettyPrint(); + $('#toc').addClass('panel panel-default'); + //$('#toc #toctitle').addClass('panel-heading'); + $('#toc #toctitle h2').addClass('panel-title'); + //$('#toc ul').addClass('panel-body'); $('#wiki-body .body a[title="Special:UserLogin"]').click(); $('.dropdown-toggle').dropdown(); diff --git a/style.css b/style.css index f22b08b..5791f07 100644 --- a/style.css +++ b/style.css @@ -174,51 +174,22 @@ option.unclickable { height: auto !important; } -#toc:not(.toc-sidebar) { - display: none; - float: right; - margin: 0 0 1em 1em; -} - -#toc td { - background: #eee; - border: 1px solid #ddd; - border-radius: 0.5em; - display: block; - -moz-border-radius: 0.5em; - -webkit-border-radius: 0.5em; - padding: 0 1em 1em 1em; - - box-shadow: 0 0 5px 0 rgba( 0, 0, 0, 0.2 ); -} - -#toc.toc-sidebar td { - background: transparent; - border: none; - box-shadow: none; - display: table-cell; - padding: 0; -} - -#toc.toc-sidebar li { - line-height: 20px; - list-style-type: none; -} - -#toc.toc-sidebar li li { - margin-left: 20px; +#toc { + display: inline-block; + padding: 12px; } -#toc.toc-sidebar h3 { - font-size: 1em; +@media (min-width: 481px) { + #toc { + min-width: 390px; /* Rough hack based on 480px */ + } } -.toc-sidebar .toctoggle { - display: none; -} - -#toctitle h2 { - font-size: 16px; +#toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding: 0; } a.new { @@ -475,11 +446,6 @@ pre.linenums ol { @media (max-width: 979px) { body { padding-top: 103px; } - .mw-headline { - margin-top: -103px; - padding-top: 103px; - } - .subnav #subnav-select { margin-left: 20px; display: inline-block; @@ -511,9 +477,7 @@ pre.linenums ol { /* responsive */ @media (max-width: 480px) { - #toc { - float: none; width: 100%; margin-left: 0; }