1
0
mirror of https://github.com/Hutchy68/pivot.git synced 2024-11-22 02:19:03 +01:00

Code fixes, cleanup

This commit is contained in:
Tom Hutchison 2015-11-04 09:53:51 -05:00
parent 3194c4122b
commit b8944ceeef
5 changed files with 88 additions and 1215 deletions

View File

@ -45,7 +45,7 @@ class Skinpivot extends SkinTemplate {
$out->addModuleStyles('skins.pivot'); $out->addModuleStyles('skins.pivot');
} }
public function initPage( OutputPage $out ) { public function initPage(OutputPage $out) {
global $wgLocalStylePath; global $wgLocalStylePath;
parent::initPage($out); parent::initPage($out);
@ -79,14 +79,10 @@ class pivotTemplate extends BaseTemplate {
} }
switch ($wgPivotFeatures['showFooterIcons']) { switch ($wgPivotFeatures['showFooterIcons']) {
case true: case true:
$footerLeftClass = 'small-12 medium-8 large-9 columns';
$footerRightClass = 'small-12 medium-4 large-3 columns';
$poweredbyType = "icononly"; $poweredbyType = "icononly";
$poweredbyMakeType = 'withImage'; $poweredbyMakeType = 'withImage';
break; break;
default: default:
$footerLeftClass = 'small-12 medium-8 large-9 columns';
$footerRightClass = 'small-12 medium-4 large-3 columns';
$poweredbyType = "nocopyright"; $poweredbyType = "nocopyright";
$poweredbyMakeType = 'withoutImage'; $poweredbyMakeType = 'withoutImage';
break; break;
@ -96,7 +92,7 @@ class pivotTemplate extends BaseTemplate {
<!-- START PIVOTTEMPLATE --> <!-- START PIVOTTEMPLATE -->
<div class="off-canvas-wrap docs-wrap" data-offcanvas=""> <div class="off-canvas-wrap docs-wrap" data-offcanvas="">
<div class="inner-wrap"> <div class="inner-wrap">
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "<div class='fixed'>";?> <?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "<div class='fixed'>"; ?>
<nav class="tab-bar"> <nav class="tab-bar">
<section id="left-nav-aside" class="left-small show-for-small"> <section id="left-nav-aside" class="left-small show-for-small">
<a class="left-off-canvas-toggle"><span id="menu-user"><i class="fa fa-navicon fa-lg"></i></span></a> <a class="left-off-canvas-toggle"><span id="menu-user"><i class="fa fa-navicon fa-lg"></i></span></a>
@ -116,7 +112,7 @@ class pivotTemplate extends BaseTemplate {
<a class="right-off-canvas-toggle"><span id="menu-user"><i class="fa <?php if ($wgUser->isLoggedIn()): ?>fa-user<?php else: ?>fa-navicon<?php endif; ?> fa-lg"></i></span></a> <a class="right-off-canvas-toggle"><span id="menu-user"><i class="fa <?php if ($wgUser->isLoggedIn()): ?>fa-user<?php else: ?>fa-navicon<?php endif; ?> fa-lg"></i></span></a>
</section> </section>
</nav> </nav>
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "</div>";?> <?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "</div>"; ?>
<aside class="left-off-canvas-menu"> <aside class="left-off-canvas-menu">
<ul class="off-canvas-list"> <ul class="off-canvas-list">
@ -138,7 +134,7 @@ class pivotTemplate extends BaseTemplate {
<ul class="off-canvas-list"> <ul class="off-canvas-list">
<?php if ($wgUser->isLoggedIn()): ?> <?php if ($wgUser->isLoggedIn()): ?>
<li id="personal-tools"><label>Personal</label></li> <li id="personal-tools"><label>Personal</label></li>
<?php foreach ( $this->getPersonalTools() as $key => $item ) { echo $this->makeListItem($key, $item); } ?> <?php foreach ($this->getPersonalTools() as $key => $item) { echo $this->makeListItem($key, $item); } ?>
<?php else: ?> <?php else: ?>
<?php if (isset($this->data['personal_urls']['anonlogin'])): ?> <?php if (isset($this->data['personal_urls']['anonlogin'])): ?>
<li><a href="<?php echo $this->data['personal_urls']['anonlogin']['href']; ?>"><?php echo wfMessage( 'login' )->text() ?></a></li> <li><a href="<?php echo $this->data['personal_urls']['anonlogin']['href']; ?>"><?php echo wfMessage( 'login' )->text() ?></a></li>
@ -195,8 +191,8 @@ class pivotTemplate extends BaseTemplate {
<?php if ($wgUser->isLoggedIn() || $wgPivotFeatures['showActionsForAnon']): ?> <?php if ($wgUser->isLoggedIn() || $wgPivotFeatures['showActionsForAnon']): ?>
<a href="#" data-options="align:left" data-dropdown="drop1" class="button secondary small radius pull-right" id="drop"><i class="fa fa-navicon fa-lg"><span id="page-actions" class="show-for-medium-up">&nbsp;<?php echo wfMessage( 'actions' )->text() ?></span></i></a> <a href="#" data-options="align:left" data-dropdown="drop1" class="button secondary small radius pull-right" id="drop"><i class="fa fa-navicon fa-lg"><span id="page-actions" class="show-for-medium-up">&nbsp;<?php echo wfMessage( 'actions' )->text() ?></span></i></a>
<ul id="drop1" class="tiny content f-dropdown" data-dropdown-content> <ul id="drop1" class="tiny content f-dropdown" data-dropdown-content>
<?php foreach( $this->data['content_actions'] as $key => $item ) { echo preg_replace(array('/\sprimary="1"/','/\scontext="[a-z]+"/','/\srel="archives"/'),'',$this->makeListItem($key, $item)); } ?> <?php foreach($this->data['content_actions'] as $key => $item) { echo preg_replace(array('/\sprimary="1"/', '/\scontext="[a-z]+"/', '/\srel="archives"/'),'',$this->makeListItem($key, $item)); } ?>
<?php wfRunHooks( SkinTemplateToolboxEnd, array( &$this, true ) ); ?> <?php wfRunHooks(SkinTemplateToolboxEnd, array(&$this, true)); ?>
</ul> </ul>
<?php if ($wgUser->isLoggedIn()): ?> <?php if ($wgUser->isLoggedIn()): ?>
<div id="echo-notifications"></div> <div id="echo-notifications"></div>
@ -239,14 +235,14 @@ class pivotTemplate extends BaseTemplate {
<footer class="row"> <footer class="row">
<div id="footer"> <div id="footer">
<div id="footer-left" class="<?php echo $footerLeftClass;?>"> <div id="footer-left" class="small-12 medium-8 large-9 columns">
<ul id="footer-left"> <ul id="footer-left">
<?php foreach ( $this->getFooterLinks( "flat" ) as $key ) { ?> <?php foreach ($this->getFooterLinks("flat") as $key) { ?>
<li id="footer-<?php echo $key ?>"><?php $this->html( $key ) ?></li> <li id="footer-<?php echo $key ?>"><?php $this->html($key) ?></li>
<?php } ?> <?php } ?>
</ul> </ul>
</div> </div>
<div id="footer-right-icons" class="<?php echo $footerRightClass;?>"> <div id="footer-right-icons" class="small-12 medium-4 large-3 columns">
<ul id="footer-right"> <ul id="footer-right">
<li class="social-follow"> <li class="social-follow">
<?php if ($wgPivotFeatures['useAddThisFollow'] != false) { ?> <?php if ($wgPivotFeatures['useAddThisFollow'] != false) { ?>
@ -256,9 +252,9 @@ class pivotTemplate extends BaseTemplate {
</div> </div>
<?php } ?> <?php } ?>
</li> </li>
<?php foreach ( $this->getFooterIcons( $poweredbyType ) as $blockName => $footerIcons ) { ?> <?php foreach ($this->getFooterIcons($poweredbyType) as $blockName => $footerIcons) { ?>
<li class="<?php echo $blockName ?>"><?php foreach ( $footerIcons as $icon ) { ?> <li class="<?php echo $blockName ?>"><?php foreach ($footerIcons as $icon) { ?>
<?php echo $this->getSkin()->makeFooterIcon( $icon, $poweredbyMakeType ); ?> <?php echo $this->getSkin()->makeFooterIcon($icon, $poweredbyMakeType); ?>
<?php } ?> <?php } ?>
</li> </li>
<?php } ?> <?php } ?>
@ -282,7 +278,7 @@ class pivotTemplate extends BaseTemplate {
<?php $this->printTrail(); ?> <?php $this->printTrail(); ?>
<?php if ($wgPivotFeatures['addThisFollowPUBID'] != '') { ?> <?php if ($wgPivotFeatures['addThisFollowPUBID'] != '') { ?>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgPivotFeatures['addThisPUBID'];?>" async="async">></script> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgPivotFeatures['addThisPUBID']; ?>" async="async">></script>
<?php } ?> <?php } ?>
</body> </body>
</html> </html>

View File

@ -2,6 +2,8 @@ body { line-height: 1.6em; font-size: 16px; }
p, ul, ol, dl { font-size: 16px; } p, ul, ol, dl { font-size: 16px; }
h4,h5,h6 {color: 2e2e2e;}
#toc ul, .toc ul { font-size: 16px; } #toc ul, .toc ul { font-size: 16px; }
@media only screen and (min-width: 40.0625em) { @media only screen and (min-width: 40.0625em) {
@ -10,7 +12,7 @@ p, ul, ol, dl { font-size: 14px; }
#toc ul, .toc ul { font-size: 13.3px; } #toc ul, .toc ul { font-size: 13.3px; }
} }
p, table { margin-bottom: 1em; max-width: 100%; } p, table { border: none; margin-bottom: 1em; max-width: 100%; }
a.label:hover, a.label:hover,
@ -77,10 +79,18 @@ body.action-formedit .row.hide-on-form-edit { display: none;}
#p-cactions > a.button { #p-cactions > a.button {
float:right; } float:right; }
/* Fix scaling issue for menu icon */
@media only screen and (min-width: 40.0625em) {
#drop .fa.fa-navicon.fa-lg {
font-size: 1.25em;
}
span#page-actions { span#page-actions {
font-size: .75em; font-size: 0.85em;
font-family: sans-serif; font-family: sans-serif;
vertical-align: top; vertical-align: middle;
padding:0 0 0 10px;
}
} }
/* Make sure top bar is even more z-indx! */ /* Make sure top bar is even more z-indx! */
@ -98,11 +108,8 @@ color: #eee;
section.middle.tab-bar-section a { section.middle.tab-bar-section a {
color: #fff; color: #fff;
} }
ul.off-canvas-list form#searchform {
margin: 1em;
}
ul.off-canvas-list form#searchform-offcanvas { ul.off-canvas-list form#searchform-offcanvas {
margin: 1em; margin: 1em;
} }
a.feedlink { a.feedlink {
background: none; background: none;
@ -211,15 +218,12 @@ ul#drop1.f-dropdown {
color: #222; color: #222;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.mw-content-ltr ul { .mw-content-ltr ul {
margin: .5em 0 1em 2em; margin: .5em 0 1em 2em;
} }
ul.accordion { ul.accordion {
margin: 0; margin: 0;
} }
.columns ul.special li { .columns ul.special li {
float:none; float:none;
width: 100%; width: 100%;
@ -321,6 +325,22 @@ li.social-follow {
font-weight: bold; font-weight: bold;
} }
/* Fix Tables on narrow pages for Special Pages and Category Pages */
@media screen and (max-width:782px) {
.ns-14 #mw-subcategories table td,
.ns-14 #mw-pages table td,
.ns--1 table.mw-specialpages-table td {
display: inline;
}
.ns-14 table,
.ns--1 table {
overflow:hidden;
}
.ns-14 table ul,
.ns--1 table ul {
margin: 0 0 0 2em;
}
}
/* TABS */ /* TABS */
@ -852,7 +872,7 @@ body.mw-special-Userlogin h2.title {
} }
/* Aside CSS */ /* Aside CSS */
ul.off-canvas-list input#searchInput, ul.off-canvas-list input#searchInput-offcanvas,
ul.off-canvas-list button.button.search { ul.off-canvas-list button.button.search {
height: 2rem; height: 2rem;
margin: 0; margin: 0;
@ -875,7 +895,8 @@ ul.side-nav .button {
margin: 0; margin: 0;
} }
ul.side-nav input[type="search"] { ul.side-nav input[type="search"] {
height: 2.1em; height: 1.9rem;
font-size: 0.9rem;
} }
.side-nav li a:not(.button) { .side-nav li a:not(.button) {
padding: 0 0 0 .5em; padding: 0 0 0 .5em;
@ -898,8 +919,9 @@ ul.off-canvas-list li a:hover {
background: #f1f0ff; background: #f1f0ff;
} }
.side-nav li a:not(.button):hover { .side-nav li a:not(.button):hover,
background: #eeffee; .side-nav li a:not(.button):focus {
background: transparent;
color: #0b0080; color: #0b0080;
} }
@ -915,7 +937,6 @@ body {
} }
li.name.logo { li.name.logo {
margin-bottom: 1em; margin-bottom: 1em;
display: table;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
} }
@ -1146,3 +1167,14 @@ td.htmlform-tip {
.orbit-bullets { .orbit-bullets {
margin: 0 auto 30px auto !important; margin: 0 auto 30px auto !important;
} }
/* Block-Grid UL fixes */
ul[class*="block-grid"] {
margin: 0;
}
/* WikiEditor Label Fix */
.wikiEditor-ui-toolbar .label {
background: transparent;
color: #000;
}

1166
pivot.css

File diff suppressed because it is too large Load Diff

View File

@ -3,15 +3,16 @@
/** /**
* Pivot Skin * Pivot Skin
* *
* @file * @file Since Version 1.0
* @ingroup Skins * @ingroup Skins
* @author Garrick Van Buren, Jamie Thingelstad * @author Garrick Van Buren, Jamie Thingelstad
* @author Tom Hutchison
* @license 2-clause BSD * @license 2-clause BSD
*/ */
if ( ! defined('MEDIAWIKI')) if ( ! defined('MEDIAWIKI'))
{ {
die("Wiki Wonders What You're Doing"); die("Not Directly Called So What Are You Doing");
} }

View File

@ -1,16 +1,26 @@
<?php <?php
/**
* Pivot Skin
*
* @file Builds the Sidebar reducing code duplication
* @since Version 1.0
* @ingroup Skins
* @author Tom Hutchison
* @license 2-clause BSD
*/
if ( ! defined('MEDIAWIKI')) if ( ! defined('MEDIAWIKI'))
{ {
die("Wiki Wonders What You're Doing"); die("Not Directly Called So What Are You Doing?");
} }
foreach ( $this->getSidebar() as $boxName => $box ) { if ( ($box['header'] != wfMessage( 'toolbox' )->text()) ) { ?> foreach ($this->getSidebar() as $boxName => $box) { if ( ($box['header'] != wfMessage( 'toolbox' )->text()) ) { ?>
<li id='<?php echo Sanitizer::escapeId( $box['id'] ) ?>'<?php echo Linker::tooltip( $box['id'] ) ?>> <li id='<?php echo Sanitizer::escapeId( $box['id'] ) ?>'<?php echo Linker::tooltip( $box['id'] ) ?>>
<li><label><?php echo htmlspecialchars( $box['header'] ); ?></label></li> <li><label><?php echo htmlspecialchars( $box['header'] ); ?></label></li>
<?php if ( is_array( $box['content'] ) ) { ?> <?php if ( is_array( $box['content'] ) ) { ?>
<?php foreach ( $box['content'] as $key => $item ) { echo $this->makeListItem( $key, $item ); } ?> <?php foreach ($box['content'] as $key => $item) { echo $this->makeListItem($key, $item); } ?>
<?php } } ?> <?php } } ?>
<?php } ?> <?php } ?>
<li><label>Toolbox</label></li> <li><label>Toolbox</label></li>
<?php foreach ( $this->getToolbox() as $key => $item ) { echo $this->makeListItem($key, $item); } ?> <?php foreach ($this->getToolbox() as $key => $item) { echo $this->makeListItem($key, $item); } ?>