diff options
-rw-r--r-- | COPYING | 1 | ||||
-rw-r--r-- | SkinTyrian.php | 56 | ||||
-rw-r--r-- | Tyrian.php | 52 | ||||
-rw-r--r-- | TyrianTemplate.php | 419 | ||||
-rw-r--r-- | i18n/de.json | 11 | ||||
-rw-r--r-- | i18n/en.json | 9 | ||||
-rw-r--r-- | i18n/qqq.json | 11 | ||||
-rw-r--r-- | main.css | 68 |
8 files changed, 627 insertions, 0 deletions
@@ -0,0 +1 @@ +TODO
\ No newline at end of file diff --git a/SkinTyrian.php b/SkinTyrian.php new file mode 100644 index 0000000..5c3cb2c --- /dev/null +++ b/SkinTyrian.php @@ -0,0 +1,56 @@ +<?php +/** + * MonoBook nouveau. + * + * Translated from gwicke's previous TAL template version to remove + * dependency on PHPTAL. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup Skins + */ + +/** + * Inherit main code from SkinTemplate, set the CSS and template filter. + * @ingroup Skins + */ +class SkinTyrian extends SkinTemplate { + public $skinname = 'tyrian'; + public $stylename = 'Tyrian'; + public $template = 'TyrianTemplate'; + + /** + * @param OutputPage $out + */ + function setupSkinUserCss( OutputPage $out ) { + parent::setupSkinUserCss( $out ); + + $out->addStyle( 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/bootstrap.min.css' ); + $out->addStyle( 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/tyrian.min.css' ); + //$out->addStyle( 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/chameleon.min.css' ); + + $out->addModuleStyles( array( + 'mediawiki.skinning.interface', + 'mediawiki.skinning.content.externallinks', + 'skins.tyrian.styles' + ) ); + + // // TODO: Migrate all of these + // $out->addStyle( $this->stylename . '/IE60Fixes.css', 'screen', 'IE 6' ); + // $out->addStyle( $this->stylename . '/IE70Fixes.css', 'screen', 'IE 7' ); + } +} diff --git a/Tyrian.php b/Tyrian.php new file mode 100644 index 0000000..a168dd5 --- /dev/null +++ b/Tyrian.php @@ -0,0 +1,52 @@ +<?php +/** + * MonoBook nouveau. + * + * Translated from gwicke's previous TAL template version to remove + * dependency on PHPTAL. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup Skins + */ + +$wgExtensionCredits['skin'][] = array( + 'path' => __FILE__, + 'name' => 'Tyrian', + 'namemsg' => 'skinname-tyrian', + 'descriptionmsg' => 'tyrian-desc', + 'url' => 'http://www.gentoo.org/', + 'author' => array( 'Alex Legler' ), + 'license-name' => 'GPLv3+', +); + +// Register files +$wgAutoloadClasses['SkinTyrian'] = __DIR__ . '/SkinTyrian.php'; +$wgAutoloadClasses['TyrianTemplate'] = __DIR__ . '/TyrianTemplate.php'; +$wgMessagesDirs['Tyrian'] = __DIR__ . '/i18n'; + +// Register skin +$wgValidSkinNames['tyrian'] = 'Tyrian'; + +// Register modules +$wgResourceModules['skins.tyrian.styles'] = array( + 'styles' => array( + 'main.css' => array( 'media' => 'screen' ), + ), + 'remoteSkinPath' => 'Tyrian', + 'localBasePath' => __DIR__, +); diff --git a/TyrianTemplate.php b/TyrianTemplate.php new file mode 100644 index 0000000..f7a2d06 --- /dev/null +++ b/TyrianTemplate.php @@ -0,0 +1,419 @@ +<?php +/** + * @ingroup Skins + */ +class TyrianTemplate extends BaseTemplate { + function execute() { + wfSuppressWarnings(); + + $this->html( 'headelement' ); + ?> + <header> + <div class="site-title"> + <div class="container"> + <div class="row"> + <div class="site-title-buttons"> + <div class="btn-group btn-group-sm"> + <a href="http://get.gentoo.org/" role="button" class="btn get-gentoo"><span class="fa fa-download"></span> <strong>Get Gentoo!</strong></a> + <div class="btn-group btn-group-sm"> + <button type="button" class="btn gentoo-org-sites dropdown-toggle" data-toggle="dropdown"> + <span class="glyphicon glyphicon-globe"></span> gentoo.org sites <span class="caret"></span> + </button> + <ul class="dropdown-menu"> + <li><a href="http://www.gentoo.org/" title="Main Gentoo website"><span class="fa fa-home fa-fw"></span> gentoo.org</a></li> + <li><a href="http://wiki.gentoo.org/" title="Find and contribute documentation"><span class="fa fa-file-text fa-fw"></span> Wiki</a></li> + <li><a href="https://bugs.gentoo.org/" title="Report issues and find common issues"><span class="fa fa-bug fa-fw"></span> Bugs</a></li> + <li><a href="http://forums.gentoo.org/" title="Discuss with the community"><span class="fa fa-comments-o fa-fw"></span> Forums</a></li> + <li><a href="http://packages.gentoo.org/" title="Find software for your Gentoo"><span class="fa fa-hdd-o fa-fw"></span> Packages</a></li> + <li class="divider"></li> + <li><a href="http://overlays.gentoo.org/" title="Collaborate on maintaining packages"><span class="fa fa-code-fork fa-fw"></span> Overlays</a></li> + <li><a href="http://planet.gentoo.org/" title="Find out what's going on in the developer community"><span class="fa fa-rss fa-fw"></span> Planet</a></li> + <li><a href="http://archives.gentoo.org/" title="Read up on past discussions"><span class="fa fa-archive fa-fw"></span> Archives</a></li> + <li><a href="http://sources.gentoo.org/" title="Browse our source code"><span class="fa fa-code fa-fw"></span> Sources</a></li> + <li class="divider"></li> + <li><a href="http://infra-status.gentoo.org/" title="Get updates on the services provided by Gentoo"><span class="fa fa-tasks fa-fw"></span> Infra Status</a></li> + </ul> + </div> + </div> + </div> + <div class="logo"> + <img src="https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/site-logo.png" data-at2x="https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/site-logo@2x.png" alt="Gentoo Linux Logo"/> + <span class="site-label">Wiki</span> + </div> + </div> + </div> + </div> + <nav class="tyrian-navbar" role="navigation"> + <div class="container"> + <div class="row"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + <div class="collapse navbar-collapse navbar-main-collapse"> + <ul class="nav navbar-nav"> + <?php + $this->renderPortals( $this->data['sidebar'] ); + ?> + </ul> + <ul class="nav navbar-nav navbar-right"> + <?php + $this->toolbox(); + $this->personaltools(); + ?> + </ul> + </div> + </div> + </div> + </nav> + <?php $this->cactions(); ?> + </header> + + <div class="container"> + <div class="row"> + <div class="col-md-12"> + <div id="content" class="mw-body" role="main"> + <a id="top"></a> + <?php + if ( $this->data['sitenotice'] ) { + ?> + <div id="siteNotice"><?php + $this->html( 'sitenotice' ) + ?></div><?php + } + ?> + + <h1 id="firstHeading" class="first-header" lang="<?php + $this->data['pageLanguage'] = + $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode(); + $this->text( 'pageLanguage' ); + ?>"><span dir="auto"><?php $this->html( 'title' ) ?></span></h1> + + <div id="bodyContent" class="mw-body-content"> + <div id="siteSub"><?php $this->msg( 'tagline' ) ?></div> + <div id="contentSub"<?php + $this->html( 'userlangattributes' ) ?>><?php $this->html( 'subtitle' ) + ?></div> + <?php if ( $this->data['undelete'] ) { ?> + <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div> + <?php +} + ?><?php + if ( $this->data['newtalk'] ) { + ?> + <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div> + <?php + } + ?> + <div id="jump-to-nav" class="mw-jump"><?php + $this->msg( 'jumpto' ) + ?> <a href="#column-one"><?php + $this->msg( 'jumptonavigation' ) + ?></a><?php + $this->msg( 'comma-separator' ) + ?><a href="#searchInput"><?php + $this->msg( 'jumptosearch' ) + ?></a></div> + + <!-- start content --> + <?php $this->html( 'bodytext' ) ?> + <?php + if ( $this->data['catlinks'] ) { ?> + <div class="well well-sm"> <?php + $this->html( 'catlinks' ); + ?></div> + <?php } + ?> + <!-- end content --> + <?php + if ( $this->data['dataAfterContent'] ) { + $this->html( 'dataAfterContent' + ); + } + ?> + </div> + </div> + </div></div> + </div> + <?php + $validFooterIcons = $this->getFooterIcons( "icononly" ); + $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links + ?> + <footer> + <div class="container"> + <div class="row"> + <div class="col-md-8"> + <?php + if ( count( $validFooterLinks ) > 0 ) { + ?> + <ul id="f-list"> + <?php + foreach ( $validFooterLinks as $aLink ) { + ?> + <li id="<?php echo $aLink ?>"><?php $this->html( $aLink ) ?></li> + <?php + } + ?> + </ul> + <?php + } ?> + </div> + <div class="col-md-4 footericons"> + <?php + foreach ( $validFooterIcons as $blockName => $footerIcons ) { + ?> + <div id="f-<?php echo htmlspecialchars( $blockName ); ?>ico" style="display: inline-block;"> + <?php foreach ( $footerIcons as $icon ) { ?> + <?php echo $this->getSkin()->makeFooterIcon( $icon ); ?> + + <?php + } + ?> + </div> + <?php + } ?> + </div> + </div> + <div class="row"> + <div class="col-md-12"> + <strong>© 2001-2015 Gentoo Foundation, Inc.</strong><br /> + <small> + Gentoo is a trademark of the Gentoo Foundation, Inc. + The contents of this document, unless otherwise expressly stated, are licensed under the + <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">CC-BY-SA-3.0</a> license. + The <a href="http://www.gentoo.org/main/en/name-logo.xml">Gentoo Name and Logo Usage Guidelines</a> apply. + </small> + </div> + </div> + </div> + </footer> + + <?php + echo $footerEnd; + ?> + + </div> + <script src="https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/bootstrap.min.js"></script> + <script src="https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/retina.min.js"></script> + <?php + $this->printTrail(); + echo Html::closeElement( 'body' ); + echo Html::closeElement( 'html' ); + wfRestoreWarnings(); + } // end of execute() method + + /*************************************************************************************************/ + + /** + * @param array $sidebar + */ + protected function renderPortals( $sidebar ) { + // These are already rendered elsewhere + $sidebar['SEARCH'] = false; + $sidebar['TOOLBOX'] = false; + $sidebar['LANGUAGES'] = false; + + foreach ( $sidebar as $boxName => $content ) { + if ( $content === false ) { + continue; + } + + $this->customBox( $boxName, $content ); + } + } + + function searchBox() { + ?> + <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform" class="navbar-form navbar-right" role="search"> + <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> + + <div class="input-group"> + <?php echo $this->makeSearchInput( array( "id" => "searchInput", "class" => "form-control", "placeholder" => $this->getMsg( 'search' )->escaped() ) ); ?> + <div class="input-group-btn"><?php + echo $this->makeSearchButton( + "go", + array( "id" => "searchGoButton", "class" => "searchButton btn btn-default" ) + ); + + echo $this->makeSearchButton( + "fulltext", + array( "id" => "mw-searchButton", "class" => "searchButton btn btn-default" ) + ); + ?></div> + </div> + </form> + <?php + } + + function cactions() { + $context_actions = array(); + $primary_actions = array(); + $secondary_actions = array(); + + foreach ( $this->data['content_actions'] as $key => $tab ) { + // TODO: handling form_edit separately here is a hack, no idea how it works in Vector. + if ( isset($tab['primary']) && $tab['primary'] == '1' || $key == 'form_edit' ) { + if ( isset($tab['context']) ) { + $context_actions[$key] = $tab; + + if ( strpos( $tab['class'], 'selected' ) !== false ) { + $context_actions[$key]['class'] .= ' active'; + } + } else { + $primary_actions[$key] = $tab; + + if ( strpos( $tab['class'], 'selected' ) !== false ) { + $primary_actions[$key]['class'] .= ' active'; + } + } + } else { + $secondary_actions[$key] = $tab; + + if ( strpos( $tab['class'], 'selected' ) !== false ) { + $secondary_actions[$key]['class'] .= ' active'; + } + } + } + ?> + + <nav class="navbar navbar-grey" id="wiki-actions" role="navigation"> + <div class="container"><div class="row"> + <!-- Brand and toggle get grouped for better mobile display --> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#gw-toolbar"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + + <!-- Collect the nav links, forms, and other content for toggling --> + <div class="collapse navbar-collapse" id="gw-toolbar"> + <ul class="nav navbar-nav"> + <?php + foreach ( $context_actions as $key => $tab ) { + echo $this->makeListItem( $key, $tab ); + } + ?> + </ul> + <?php + $this->searchBox(); + ?> + <ul class="nav navbar-nav navbar-right"> + <?php + foreach ( $primary_actions as $key => $tab ) { + echo $this->makeListItem( $key, $tab ); + } + ?> <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">more <span class="caret"></span></a> + <ul class="dropdown-menu" role="menu"> + <?php + foreach ( $secondary_actions as $key => $tab ) { + echo $this->makeListItem( $key, $tab ); + } + ?> + </ul> + </li> + </ul> + </div><!-- /.navbar-collapse --> + </div></div><!-- /.container-fluid --> + </nav> + <?php + } + + /*************************************************************************************************/ + function toolbox() { + ?> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-cog"></i> <?php $this->msg( 'toolbox' ) ?> <span class="caret"></span></a> + <ul class="dropdown-menu" role="menu"> + <?php + foreach ( $this->getToolbox() as $key => $tbitem) { + echo $this->makeListItem( $key, $tbitem ); + } + + wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) ); + wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) ); + ?> + </ul> + </li> + <?php + } + + /*************************************************************************************************/ + function personaltools() { + ?> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + <span class="glyphicon glyphicon-user" aria-label="<?php $this->msg( 'personaltools' ) ?>"></span> + <?php $this->msg( 'listfiles_user' ) ?> + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <?php + foreach ( $this->getPersonalTools() as $key => $item ) { + echo $this->makeListItem( $key, $item ); + } + ?> + </ul> + </li> + <?php + } + + /*************************************************************************************************/ + function languageBox() { + if ( $this->data['language_urls'] !== false ) { + ?> + <div id="p-lang" class="portlet" role="navigation"> + <h3<?php $this->html( 'userlangattributes' ) ?>><?php $this->msg( 'otherlanguages' ) ?></h3> + + <div class="pBody"> + <ul> + <?php foreach ( $this->data['language_urls'] as $key => $langlink ) { ?> + <?php echo $this->makeListItem( $key, $langlink ); ?> + + <?php +} + ?> + </ul> + + <?php $this->renderAfterPortlet( 'lang' ); ?> + </div> + </div> + <?php + } + } + + /*************************************************************************************************/ + /** + * @param string $bar + * @param array|string $cont + */ + function customBox( $bar, $cont ) { + $msgObj = wfMessage( $bar ); + + if ( $bar !== 'navigation' ) { ?> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $bar ); ?> <span class="caret"></span></a> + <ul class="dropdown-menu" role="menu"> + <?php } + + if ( is_array ( $cont ) ) { + foreach ( $cont as $key => $val ) { + echo $this->makeListItem( $key, $val ); + } + } else { + echo "<!-- This would have been a box, but it contains custom html which is not supported. -->"; + } + + if ( $bar !== 'navigation' ) { ?> + </ul> + </li> + <?php } + } +} // end of class diff --git a/i18n/de.json b/i18n/de.json new file mode 100644 index 0000000..69db577 --- /dev/null +++ b/i18n/de.json @@ -0,0 +1,11 @@ +{ + "@metadata": { + "authors": [ + "A3li" + ] + }, + "skinname-tyrian": "Tyrian", + "tyrian-desc": "Das neue Aussehen der Gentoo-Webseiten, auf MediaWiki portiert.", + "tyrian.css": "/* Das folgende CSS wird für Benutzer der Tyrian-Benutzeroberfläche geladen */", + "tyrian.js": "/* Das folgende JavaScript wird für Benutzer der Tyrian-Benutzeroberfläche geladen. */" +} diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..c4e109b --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,9 @@ +{ + "@metadata": { + "authors": ["A3li"] + }, + "skinname-tyrian": "Tyrian", + "tyrian-desc": "Gentoo's new web theme ported to MediaWiki.", + "tyrian.css": "/* CSS placed here will affect users of the Tyrian skin */", + "tyrian.js": "/* Any JavaScript here will be loaded for users using the Tyrian skin */" +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 0000000..7091dc4 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,11 @@ +{ + "@metadata": { + "authors": [ + "A3li" + ] + }, + "skinname-tyrian": "{{optional}}", + "tyrian-desc": "{{desc|what=skin|name=Tyrian|url=https://wiki.gentoo.org/}}", + "tyrian.css": "{{optional}}\nCSS applied to users using Tyrian skin.", + "tyrian.js": "{{optional}}\nJS for users using Tyrian skin." +} diff --git a/main.css b/main.css new file mode 100644 index 0000000..36e5517 --- /dev/null +++ b/main.css @@ -0,0 +1,68 @@ +/* This file contains overrides for mediawiki stuff we don't want for Tyrian */ + +h1, h2, h3, h4, h5, h6 { + padding-top: 0px; + border-bottom: none; +} + +.uls-menu { + z-index: 2000 !important; +} + +a.get-gentoo { + color: white !important; +} + +nav#wiki-actions { + margin-top: -20px; + background-color: #e1e1e1; + border: none; +} + +nav#wiki-actions ul.nav li.active { + background-color: #fafafa; + font-weight: bold; +} + +nav li { + margin-bottom: 0; +} + +#f-list { + list-style-type: none; + padding: 0; + margin: 0; + margin-bottom: 3em; +} + +#privacy, #about, #disclaimer { + float: left; + padding-right: 2em; +} + +div.footericons { + text-align: right; +} + +div.footericons div { + display: inline-block; +} + +body.page-Main_Page h1#firstHeading { + display: none; +} + +div.jumbotron h1 { + font-size: 25pt; +} + +body.page-Main_Page div.jumbotron img { + margin-top: -2em; +} + +body.skin-tyrian .catlinks { + margin-top: 0; + padding: 0; + border: none; + background: none; +}
\ No newline at end of file |