diff options
author | 2019-04-19 10:11:32 -0400 | |
---|---|---|
committer | 2019-04-19 10:11:32 -0400 | |
commit | a35049f14ed3c6d78253568277969aaa4814c0eb (patch) | |
tree | cac256cd6947aa6990e2e169d000af4d1ab5f0c9 | |
parent | Optimize code a bit (diff) | |
parent | Remove deprecated functions (diff) | |
download | skin-tyrian-a35049f14ed3c6d78253568277969aaa4814c0eb.tar.gz skin-tyrian-a35049f14ed3c6d78253568277969aaa4814c0eb.tar.bz2 skin-tyrian-a35049f14ed3c6d78253568277969aaa4814c0eb.zip |
Merge branch 'wikitest'v1.30.1.3
Signed-off-by: Brian Evans <grknight@gentoo.org>
-rw-r--r-- | SkinTyrian.php | 16 | ||||
-rw-r--r-- | TyrianTemplate.php | 18 |
2 files changed, 22 insertions, 12 deletions
diff --git a/SkinTyrian.php b/SkinTyrian.php index edc0aa4..9a731ff 100644 --- a/SkinTyrian.php +++ b/SkinTyrian.php @@ -40,4 +40,20 @@ class SkinTyrian extends SkinTemplate { $out->addMeta('theme-color', '#54487a'); return true; } + + public function initPage( OutputPage $out ) { + parent::initPage( $out ); + $cdnURL = self::CDN_URL . 'bootstrap.min.js'; + $script = <<<EOS +function defer(method) { + if (window.jQuery) { + method(); + } else { + setTimeout(function() { defer(method) }, 50); + } +} +defer(function() { mw.loader.load( '$cdnURL'); }); +EOS; + $out->addInlineScript($script); + } } diff --git a/TyrianTemplate.php b/TyrianTemplate.php index 2f12ff4..f0e28f5 100644 --- a/TyrianTemplate.php +++ b/TyrianTemplate.php @@ -8,7 +8,7 @@ */ class TyrianTemplate extends BaseTemplate { public function execute() { - wfSuppressWarnings(); + MediaWiki\suppressWarnings(); $this->html( 'headelement' ); @@ -62,18 +62,12 @@ class TyrianTemplate extends BaseTemplate { </div> </div> - <?php $this->footer(); ?> - - <script> - window.RLQ = window.RLQ || []; window.RLQ.push( function () { - $.getScript("https://assets.gentoo.org/tyrian/bootstrap.min.js"); - } ); - </script> <?php + $this->footer(); $this->printTrail(); echo Html::closeElement( 'body' ); echo Html::closeElement( 'html' ); - wfRestoreWarnings(); + MediaWiki\suppressWarnings(true); } // end of execute() method /*************************************************************************************************/ @@ -178,8 +172,8 @@ class TyrianTemplate extends BaseTemplate { <div class="col-xs-3 col-md-2"> <ul class="footerlinks three-icons"> <li><a href="https://twitter.com/gentoo" title="@Gentoo on Twitter"><span class="fa fa-twitter fa-fw"></span></a></li> - <li><a href="https://plus.google.com/+Gentoo" title="+Gentoo on Google+"><span class="fa fa-google-plus fa-fw"></span></a></li> <li><a href="https://www.facebook.com/gentoo.org" title="Gentoo on Facebook"><span class="fa fa-facebook fa-fw"></span></a></li> + <li></li> </ul> </div> <div class="col-xs-9 col-md-9"> @@ -315,8 +309,8 @@ class TyrianTemplate extends BaseTemplate { echo $this->makeListItem( $key, $tbitem ); } - wfRunHooks( 'MonoBookTemplateToolboxEnd', [&$this] ); - wfRunHooks( 'SkinTemplateToolboxEnd', [ &$this, true ] ); + Hooks::Run( 'MonoBookTemplateToolboxEnd', [&$this] ); + Hooks::Run( 'SkinTemplateToolboxEnd', [ &$this, true ] ); ?> </ul> </li> |