Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
AddThis patch (#317)
Browse files Browse the repository at this point in the history
* Fixes for addThis #295 

* Clean up README and fixing print.css

* Some final fixes for AddThis - easy on CSS of Follow Icons let user decide

* Bump version to 2.1.0-rc (Yay a release candidate!)
  • Loading branch information
Hutchy68 committed Feb 13, 2018
1 parent 534eee0 commit 9964d94
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 75 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Version 2.1

* [bug fix] AddThis div container #295
* [enhancement] Hide AddThis on non content pages by disabling <script> from running
* [bug fix] Fixes for VisualEditor changes in editor layout #313
* [compatibilit] Remove IE 8 Support entirely
* [code] CSS fixes for Issues #88, #172 and #196 (Print.css, firstHeading and Wikitable override by Foundation)
Expand Down
24 changes: 15 additions & 9 deletions Foreground.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public function setupSkinUserCss(OutputPage $out) {
'wikiName' => &$GLOBALS['wgSitename'],
'navbarIcon' => false,
'IeEdgeCode' => 1,
'showFooterIcons' => 0,
'addThisFollowPUBID' => ''
'showFooterIcons' => false,
'addThisPUBID' => '',
'useAddThisShare' => '',
'useAddThisFollow' => ''
);
foreach ($wgForegroundFeaturesDefaults as $fgOption => $fgOptionValue) {
if ( !isset($wgForegroundFeatures[$fgOption]) ) {
Expand Down Expand Up @@ -210,6 +212,11 @@ public function execute() {
?><h4 class="namespace label"><?php print $namespace; ?></h4><?php } ?>
<div id="content">
<h1 id="firstHeading" class="title"><?php print $displaytitle; ?></h1>
<?php if ($wgForegroundFeatures['useAddThisShare'] !== '') { ?>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="<?php echo $wgForegroundFeatures['useAddThisShare']; ?> hide-for-print"></div>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<?php } ?>
<?php if ( $this->data['isarticle'] ) { ?><h3 id="tagline"><?php $this->msg( 'tagline' ) ?></h3><?php } ?>
<h5 id="siteSub" class="subtitle"><?php $this->html('subtitle') ?></h5>
<div id="contentSub" class="clear_both"></div>
Expand All @@ -234,13 +241,10 @@ public function execute() {

<footer class="row">
<div id="footer">
<?php if ($wgForegroundFeatures['addThisFollowPUBID'] != '') { ?>
<div class="social-footer large-12 small-12 columns">
<div class="social-links">
<?php if ($wgForegroundFeatures['useAddThisFollow'] !== '') { ?>
<div class="social-follow hide-for-print">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_horizontal_follow_toolbox"></div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgForegroundFeatures['addThisFollowPUBID'];?>"></script>
</div>
<div class="<?php echo $wgForegroundFeatures['useAddThisFollow']; ?> hide-for-print"></div>
</div>
<?php } ?>
<div id="footer-left" class="<?php echo $footerLeftClass;?>">
Expand All @@ -266,7 +270,9 @@ public function execute() {
</div>

<?php $this->printTrail(); ?>

<?php if ($this->data['isarticle'] && $wgForegroundFeatures['addThisPUBID'] !== '') { ?>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgForegroundFeatures['addThisPUBID']; ?>" async="async">></script>
<?php } ?>
</body>
</html>

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ Use following features in `LocalSettings.php` to change the behavior.
- `wikiName => 'Alternate WikiName'` sets top navbar name to a different output of the wiki's name. Useful if your `$wgSitename` is long but need to keep it for other purposes.
- `navbarIcon => true` to display an icon in the top navbar. See below for more information.
- `IeEdgeCode => 1` will produce a meta tag with "X-UA-Compatible" content="IE=edge", `2` will sent a header, `0` nothing will be done
- `showFooterIcons => 0` suppresses the output of footer icons. Set to `true` or `1` to display them.
- `addThisFollowPUBID => 'your-id'` add an id to display Follow Us horizontal bar of icons from various social media sites available on [addThis](https://addthis.com).
- `showFooterIcons => false` suppresses the output of footer icons. Set to `true` or `1` to display them.
- `addThisPUBID => ''` empty string will not fire the AddThis script, `'ra-##-#######'` publisher ID will allow the run the AddThis script in async on content pages only.
- `useAddThisShare => ''` default empty string, do not use AddThis share, `your_addthis_specific_div_class_string` will insert the share toolbox div directly under page title, but before the tagline with your custom div class.
- `useAddThisFollow => ''` default empty string, do not use AddThis follow, `your_addthis_specific_div_class_string` will insert the follow toolbox div in the `footer` area before icon or text output with your custom div class.

These are the default values:

Expand All @@ -57,8 +59,10 @@ These are the default values:
'wikiName' => &$GLOBALS['wgSitename'],
'navbarIcon' => false,
'IeEdgeCode' => 1,
'showFooterIcons' => 0,
'addThisFollowPUBID' => ''
'showFooterIcons' => false,
'addThisPUBID' => '',
'useAddThisShare' => '',
'useAddThisFollow' => ''
);

### Usage of NavWrapperType
Expand Down
36 changes: 3 additions & 33 deletions assets/stylesheets/foreground-print.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Show what will print */
/* Control what will print */

@media screen {
@media print {
/* stop double border at bottom with print */
footer.row {
border: none;
Expand Down Expand Up @@ -29,37 +29,7 @@
nav {
display: none !important;
}
}

/* Print what is shown */

@media print {
/* stop double border at bottom with print */
footer.row {
border: none;
}
/*make namespace labels stand out */
h4.namespace.label {
padding: 0.25em;
font-size: 1.4em !important;
font-weight: normal;
background-color: #777777 !important;
color: #fff !important;
}
/* hide actions button as it is not needed */
#p-cactions a.button.dropdown.small.secondary.radius {
display: none !important;
}
/* if addThis share is used, make sure to hide mobile content from js */
#at4m-dock, .at4-show,
#atstbx {
display: none !important;
}
/* hide Echo if being used */
#echo-notifications {
display: none !important;
}
nav {
a#actions-button {
display: none !important;
}
}
Expand Down
31 changes: 3 additions & 28 deletions assets/stylesheets/foreground.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,35 +240,10 @@ footer.row ul.views.columns li {
list-style-type: none;
}

/* Make social footer center need overflow:hidden and other div classes */

.social-footer {
margin: 0 0 1em;
font-size: 90%;
overflow: hidden;
}

/* Hide all text in p elements */

.social-footer p {
display: none;
}

/* Outer wrap */

.social-links {
position: relative;
left: 50%;
float: left;
}
/* Make social follow float right */

/* addThis container (inner wrap) */

.addthis_horizontal_follow_toolbox {
position: relative;
left: -50%;
float: left;
z-index: 100000;
.social-follow {
float: right;
}

/* end social footer classes */
Expand Down
2 changes: 1 addition & 1 deletion skin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Foreground",
"version": "2.1.0-beta",
"version": "2.1.0-rc",
"author": [
"Garrick Van Buren",
"Jamie Thingelstad",
Expand Down

0 comments on commit 9964d94

Please sign in to comment.