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

Making massive improvements for print-css and hide-for-print. Will now print from regular page without having to go to printable version link.

This commit is contained in:
Tom Hutchison 2017-03-12 15:35:35 -04:00
parent 3c46af8dba
commit 8765cf2750
3 changed files with 22 additions and 14 deletions

View File

@ -62,7 +62,7 @@ class pivotTemplate extends BaseTemplate {
public function execute() { public function execute() {
global $wgUser; global $wgUser;
global $wgPivotFeatures; global $wgPivotFeatures;
//wfSuppressWarnings(); wfSuppressWarnings();
$this->html('headelement'); $this->html('headelement');
switch ($wgPivotFeatures['usePivotTabs']) { switch ($wgPivotFeatures['usePivotTabs']) {
case true: case true:
@ -94,7 +94,7 @@ class pivotTemplate extends BaseTemplate {
<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 hide-for-print">
<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>
</section> </section>
@ -156,7 +156,7 @@ class pivotTemplate extends BaseTemplate {
<div class="row"> <div class="row">
<div id="sidebar" class="large-2 medium-3 columns hide-for-small"> <div id="sidebar" class="large-2 medium-3 columns hide-for-small hide-for-print">
<ul class="side-nav"> <ul class="side-nav">
<li class="name logo"> <li class="name logo">
<a href="<?php echo $this->data['nav_urls']['mainpage']['href']; ?>"> <a href="<?php echo $this->data['nav_urls']['mainpage']['href']; ?>">
@ -190,10 +190,10 @@ class pivotTemplate extends BaseTemplate {
</div> </div>
<?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 hide-for-print" 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 => $tab) { echo preg_replace(array('/\sprimary="1"/', '/\scontext="[a-z]+"/', '/\srel="archives"/'),'',$this->makeListItem($key, $tab)); } ?>
<?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>
@ -209,7 +209,7 @@ class pivotTemplate extends BaseTemplate {
<h2 class="title"><?php print $displaytitle; ?></h2> <h2 class="title"><?php print $displaytitle; ?></h2>
<?php if ($wgPivotFeatures['useAddThisShare'] != false) { ?> <?php if ($wgPivotFeatures['useAddThisShare'] != false) { ?>
<!-- Go to www.addthis.com/dashboard to customize your tools --> <!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_sharing_toolbox show-for-large-up"></div> <div class="addthis_sharing_toolbox show-for-large-up hide-for-print"></div>
<!-- Go to www.addthis.com/dashboard to customize your tools --> <!-- Go to www.addthis.com/dashboard to customize your tools -->
<?php } ?> <?php } ?>
<?php if ( $this->data['isarticle'] ) { ?><h3 id="tagline"><?php $this->msg( 'tagline' ) ?></h3><?php } ?> <?php if ( $this->data['isarticle'] ) { ?><h3 id="tagline"><?php $this->msg( 'tagline' ) ?></h3><?php } ?>
@ -245,9 +245,9 @@ class pivotTemplate extends BaseTemplate {
<?php } ?> <?php } ?>
</ul> </ul>
</div> </div>
<div id="footer-right-icons" class="small-12 medium-4 large-3 columns"> <div id="footer-right-icons" class="small-12 medium-4 large-3 columns hide-for-print">
<ul id="footer-right"> <ul id="footer-right">
<li class="social-follow"> <li class="social-follow hide-for-print">
<?php if ($wgPivotFeatures['useAddThisFollow'] != false) { ?> <?php if ($wgPivotFeatures['useAddThisFollow'] != false) { ?>
<div class="social-links"> <div class="social-links">
<!-- Go to www.addthis.com/dashboard to customize your tools --> <!-- Go to www.addthis.com/dashboard to customize your tools -->
@ -302,7 +302,7 @@ class pivotTemplate extends BaseTemplate {
} } } }
} }
echo '<li><label>Toolbox</label></li>'; echo '<li><label>Toolbox</label></li>';
foreach ($toolbox as $key => $item) { echo $this->makeListItem($key, $item); } foreach ($toolbox as $key => $tbitem) { echo $this->makeListItem($key, $tbitem); }
} }
} }
?> ?>

View File

@ -1,3 +1,13 @@
@media print { @media print {
nav, footer { display:none; } nav, footer { display:none; }
}4.namespace.label {
padding: 0.25em;
font-size: 1.4em !important;
font-weight: normal;
background-color: #2284a1 !important;
color: #fff !important;
}
#at4m-dock {
display: none;
}
} }

View File

@ -283,7 +283,6 @@ footer.row ul.views.columns li {
footer.row { footer.row {
border-top: 1px solid #c3c3e5; border-top: 1px solid #c3c3e5;
padding-top: 1em;
padding-bottom: 2em; padding-bottom: 2em;
color: #333; color: #333;
max-width: 100%; max-width: 100%;
@ -887,8 +886,6 @@ margin: 0;
padding-top: 1.5em; padding-top: 1.5em;
padding-bottom: .5em; padding-bottom: .5em;
background-color: #fff; background-color: #fff;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
} }
ul.side-nav .button { ul.side-nav .button {
@ -939,6 +936,7 @@ li.name.logo {
margin-bottom: 1em; margin-bottom: 1em;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
text-align: center;
} }
@media only screen and (min-width: 642px) { @media only screen and (min-width: 642px) {
.tab-bar-section.middle { left: .8125rem; text-align: left; } .tab-bar-section.middle { left: .8125rem; text-align: left; }
@ -1009,7 +1007,7 @@ h5.subtitle {
} }
h4.namespace.label { h4.namespace.label {
padding:0.25em; padding:0.25em;
font-size:1.1em !important; font-size:1.25em !important;
font-weight:normal; font-weight:normal;
background-color: #2284a1; background-color: #2284a1;
} }