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

1.39 #116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

1.39 #116

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 6 additions & 26 deletions Pivot.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@


class SkinPivot extends SkinTemplate {
public $skinname = 'pivot', $stylename = 'pivot', $template = 'pivotTemplate', $useHeadElement = true;

public function getDefaultModules() {
global $wgPivotFeatures;
$wgPivotFeaturesDefaults = array(
Expand All @@ -37,29 +35,16 @@ public function getDefaultModules() {
if ( $wgPivotFeatures['preloadFontAwesome'] ) {
$this->getOutput()->addHeadItem('font', '<link rel="preload" href="'.$wgLocalStylePath.'/pivot/assets/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" type="font/woff2" crossorigin="anonymous" />');
}

$this->getOutput()->addModuleStyles('skins.pivot.styles');
return parent::getDefaultModules();
}

public function initPage(OutputPage $out) {
global $wgLocalStylePath;
parent::initPage($out);

$viewport_meta = 'width=device-width, user-scalable=yes, initial-scale=1.0';
$out->addMeta('viewport', $viewport_meta);
$out->addModules('skins.pivot.js');
return parent::getDefaultModules();
}

}


class pivotTemplate extends BaseTemplate {
class PivotTemplate extends BaseTemplate {
public function execute() {
global $wgUser;
global $wgPivotFeatures;
Wikimedia\suppressWarnings();
$this->html('headelement');
switch ($wgPivotFeatures['usePivotTabs']) {
case true:
ob_start();
Expand Down Expand Up @@ -106,7 +91,7 @@ public function execute() {
</section>

<section id="right-nav-aside" class="right-small">
<a href="#" 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 href="#" class="right-off-canvas-toggle"><span id="menu-user"><i class="fa <?php if ($wgUser->isRegistered()): ?>fa-user<?php else: ?>fa-navicon<?php endif; ?> fa-lg"></i></span></a>
</section>
</nav>
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "</div>"; ?>
Expand All @@ -129,7 +114,7 @@ public function execute() {

<aside class="right-off-canvas-menu">
<ul class="off-canvas-list">
<?php if ($wgUser->isLoggedIn()): ?>
<?php if ($wgUser->isRegistered()): ?>
<li id="personal-tools"><label><?php echo wfMessage( 'pivot-personal-tools' )->text() ?></label></li>
<?php foreach ($this->getPersonalTools() as $key => $item) { echo $this->makeListItem($key, $item); } ?>
<?php else: ?>
Expand Down Expand Up @@ -173,7 +158,7 @@ public function execute() {
<!-- Output page indicators -->
<?php echo $this->getIndicators(); ?>
<!-- If user is logged in output echo location -->
<?php if ($wgUser->isLoggedIn()): ?>
<?php if ($wgUser->isRegistered()): ?>
<div id="echo-notifications">
<div id="echo-notifications-alerts"></div>
<div id="echo-notifications-messages"></div>
Expand All @@ -189,7 +174,7 @@ public function execute() {
</div>
</div>

<?php if ($wgUser->isLoggedIn() || $wgPivotFeatures['showActionsForAnon']): ?>
<?php if ($wgUser->isRegistered() || $wgPivotFeatures['showActionsForAnon']): ?>
<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>
<?php foreach($this->data['content_actions'] as $key => $tab) { echo preg_replace(array('/\sprimary="1"/', '/\scontext="[a-z]+"/', '/\srel="archives"/'),'',$this->makeListItem($key, $tab)); } ?>
Expand Down Expand Up @@ -277,15 +262,10 @@ public function execute() {
<div>
<a class="exit-off-canvas"></a>
</div>


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

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

<?php
Wikimedia\restoreWarnings();
Expand Down
20 changes: 18 additions & 2 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,26 @@
"descriptionmsg": "pivot-desc",
"type": "skin",
"ValidSkinNames": {
"pivot": "Pivot"
"pivot": {
"class": "SkinPivot",
"args": [
{
"name": "pivot",
"template": "PivotTemplate",
"bodyOnly": true,
"responsive": true,
"scripts": [
"skins.pivot.js"
],
"styles": [
"skins.pivot.styles"
]
}
]
}
},
"requires": {
"MediaWiki": ">= 1.35.0"
"MediaWiki": ">= 1.39.0"
},
"MessagesDirs": {
"Skinpivot": [
Expand Down