mirror of
https://github.com/Hutchy68/pivot.git
synced 2025-04-02 19:23:14 +02:00
Merge f831643f08c974b5913f7f2676b440fc38e7cc1f into 0d3d6b03a83afd7e1cb170aa41bdf23c0ce3e93b
This commit is contained in:
commit
3c745a27e1
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
|
|
||||||
class SkinPivot extends SkinTemplate {
|
class SkinPivot extends SkinTemplate {
|
||||||
public $skinname = 'pivot', $stylename = 'pivot', $template = 'pivotTemplate', $useHeadElement = true;
|
|
||||||
|
|
||||||
public function getDefaultModules() {
|
public function getDefaultModules() {
|
||||||
global $wgPivotFeatures;
|
global $wgPivotFeatures;
|
||||||
$wgPivotFeaturesDefaults = array(
|
$wgPivotFeaturesDefaults = array(
|
||||||
@ -37,29 +35,16 @@ class SkinPivot extends SkinTemplate {
|
|||||||
if ( $wgPivotFeatures['preloadFontAwesome'] ) {
|
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()->addHeadItem('font', '<link rel="preload" href="'.$wgLocalStylePath.'/pivot/assets/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" type="font/woff2" crossorigin="anonymous" />');
|
||||||
}
|
}
|
||||||
|
return parent::getDefaultModules();
|
||||||
$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');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class pivotTemplate extends BaseTemplate {
|
class PivotTemplate extends BaseTemplate {
|
||||||
public function execute() {
|
public function execute() {
|
||||||
global $wgUser;
|
global $wgUser;
|
||||||
global $wgPivotFeatures;
|
global $wgPivotFeatures;
|
||||||
Wikimedia\suppressWarnings();
|
Wikimedia\suppressWarnings();
|
||||||
$this->html('headelement');
|
|
||||||
switch ($wgPivotFeatures['usePivotTabs']) {
|
switch ($wgPivotFeatures['usePivotTabs']) {
|
||||||
case true:
|
case true:
|
||||||
ob_start();
|
ob_start();
|
||||||
@ -106,7 +91,7 @@ class pivotTemplate extends BaseTemplate {
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="right-nav-aside" class="right-small">
|
<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>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "</div>"; ?>
|
<?php if ($wgPivotFeatures['fixedNavBar'] != false) echo "</div>"; ?>
|
||||||
@ -129,7 +114,7 @@ class pivotTemplate extends BaseTemplate {
|
|||||||
|
|
||||||
<aside class="right-off-canvas-menu">
|
<aside class="right-off-canvas-menu">
|
||||||
<ul class="off-canvas-list">
|
<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>
|
<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 foreach ($this->getPersonalTools() as $key => $item) { echo $this->makeListItem($key, $item); } ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@ -173,7 +158,7 @@ class pivotTemplate extends BaseTemplate {
|
|||||||
<!-- Output page indicators -->
|
<!-- Output page indicators -->
|
||||||
<?php echo $this->getIndicators(); ?>
|
<?php echo $this->getIndicators(); ?>
|
||||||
<!-- If user is logged in output echo location -->
|
<!-- If user is logged in output echo location -->
|
||||||
<?php if ($wgUser->isLoggedIn()): ?>
|
<?php if ($wgUser->isRegistered()): ?>
|
||||||
<div id="echo-notifications">
|
<div id="echo-notifications">
|
||||||
<div id="echo-notifications-alerts"></div>
|
<div id="echo-notifications-alerts"></div>
|
||||||
<div id="echo-notifications-messages"></div>
|
<div id="echo-notifications-messages"></div>
|
||||||
@ -189,7 +174,7 @@ class pivotTemplate extends BaseTemplate {
|
|||||||
</div>
|
</div>
|
||||||
</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"> <?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"> <?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 => $tab) { echo preg_replace(array('/\sprimary="1"/', '/\scontext="[a-z]+"/', '/\srel="archives"/'),'',$this->makeListItem($key, $tab)); } ?>
|
<?php foreach($this->data['content_actions'] as $key => $tab) { echo preg_replace(array('/\sprimary="1"/', '/\scontext="[a-z]+"/', '/\srel="archives"/'),'',$this->makeListItem($key, $tab)); } ?>
|
||||||
@ -277,15 +262,10 @@ class pivotTemplate extends BaseTemplate {
|
|||||||
<div>
|
<div>
|
||||||
<a class="exit-off-canvas"></a>
|
<a class="exit-off-canvas"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php $this->printTrail(); ?>
|
|
||||||
|
|
||||||
<?php if ($this->data['isarticle'] && $wgPivotFeatures['addThisPUBID'] !== '') { ?>
|
<?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>
|
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo $wgPivotFeatures['addThisPUBID']; ?>" async="async"></script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
Wikimedia\restoreWarnings();
|
Wikimedia\restoreWarnings();
|
||||||
|
20
skin.json
20
skin.json
@ -10,10 +10,26 @@
|
|||||||
"descriptionmsg": "pivot-desc",
|
"descriptionmsg": "pivot-desc",
|
||||||
"type": "skin",
|
"type": "skin",
|
||||||
"ValidSkinNames": {
|
"ValidSkinNames": {
|
||||||
"pivot": "Pivot"
|
"pivot": {
|
||||||
|
"class": "SkinPivot",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "pivot",
|
||||||
|
"template": "PivotTemplate",
|
||||||
|
"bodyOnly": true,
|
||||||
|
"responsive": true,
|
||||||
|
"scripts": [
|
||||||
|
"skins.pivot.js"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"skins.pivot.styles"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"requires": {
|
"requires": {
|
||||||
"MediaWiki": ">= 1.35.0"
|
"MediaWiki": ">= 1.39.0"
|
||||||
},
|
},
|
||||||
"MessagesDirs": {
|
"MessagesDirs": {
|
||||||
"Skinpivot": [
|
"Skinpivot": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user