diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /skins | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'skins')
66 files changed, 1345 insertions, 3921 deletions
diff --git a/skins/ArchLinux.php b/skins/ArchLinux.php index 62942536..02598641 100644 --- a/skins/ArchLinux.php +++ b/skins/ArchLinux.php @@ -22,25 +22,22 @@ class SkinArchLinux extends SkinTemplate { function setupSkinUserCss( OutputPage $out ) { global $wgHandheldStyle; - parent::setupSkinUserCss( $out ); - // Append to the default screen common & print styles... - $out->addStyle( 'archlinux/main.css', 'screen' ); + $out->addModuleStyles( 'skins.archlinux' ); + + // Ugh. Can't do this properly because $wgHandheldStyle may be a URL if( $wgHandheldStyle ) { // Currently in testing... try 'chick/main.css' $out->addStyle( $wgHandheldStyle, 'handheld' ); } + // TODO: Migrate all of these $out->addStyle( 'archlinux/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); $out->addStyle( 'archlinux/IE55Fixes.css', 'screen', 'IE 5.5000' ); $out->addStyle( 'archlinux/IE60Fixes.css', 'screen', 'IE 6' ); $out->addStyle( 'archlinux/IE70Fixes.css', 'screen', 'IE 7' ); - $out->addStyle( 'archlinux/rtl.css', 'screen', '', 'rtl' ); - - $out->addStyle( 'archlinux/archnavbar.css', 'screen' ); - $out->addStyle( 'archlinux/arch.css', 'screen' ); } } @@ -48,8 +45,13 @@ class SkinArchLinux extends SkinTemplate { * @todo document * @ingroup Skins */ -class ArchLinuxTemplate extends QuickTemplate { +class ArchLinuxTemplate extends BaseTemplate { + + /** + * @var Skin + */ var $skin; + /** * Template filter callback for ArchLinux skin. * Takes an associative array of data set from a SkinTemplate-based @@ -59,37 +61,15 @@ class ArchLinuxTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgRequest, $wgArchNavBar, $wgArchHome, $wgArchNavBarSelected, $wgArchNavBarSelectedDefault; - $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); + global $wgArchNavBar, $wgArchHome, $wgArchNavBarSelected, $wgArchNavBarSelectedDefault; + $this->skin = $this->data['skin']; // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - // fold footerlinks into a single array using a bit of trickery - $footerlinks = call_user_func_array('array_merge', array_values($footerlinks)); - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset any icons which don't have an image - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) { - if ( !is_string($footerIcon) && !isset($footerIcon["src"]) ) { - unset($footerIconsBlock[$footerIconKey]); - } - } - } - // Redo removal of any empty blocks - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - if ( count($footerIconsBlock) <= 0 ) { - unset($footericons[$footerIconsKey]); - } - } - $this->html( 'headelement' ); +?> -if (empty($_REQUEST['printable'])) {?> <div id="archnavbar"><!-- Arch Linux global navigation bar --> <div id="archnavbarlogo"> <p><a id="logo" href="<?php if (isset($wgArchHome)) { echo $wgArchHome; } ?>"></a></p> @@ -112,10 +92,9 @@ if (empty($_REQUEST['printable'])) {?> </ul> </div> </div><!-- #archnavbar --> -<?php } -?><div id="globalWrapper"> -<div id="column-content"><div id="content" <?php $this->html("specialpageattributes") ?>> +<div id="globalWrapper"> +<div id="column-content"><div id="content"> <a id="top"></a> <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> @@ -139,77 +118,45 @@ if (empty($_REQUEST['printable'])) {?> </div> </div></div> <div id="column-one"<?php $this->html('userlangattributes') ?>> - <div id="p-cactions" class="portlet"> - <h5><?php $this->msg('views') ?></h5> - <div class="pBody"> - <ul><?php - foreach($this->data['content_actions'] as $key => $tab) { - echo ' - <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"'; - if( $tab['class'] ) { - echo ' class="'.htmlspecialchars($tab['class']).'"'; - } - echo '><a href="'.htmlspecialchars($tab['href']).'"'; - # We don't want to give the watch tab an accesskey if the - # page is being edited, because that conflicts with the - # accesskey on the watch checkbox. We also don't want to - # give the edit tab an accesskey, because that's fairly su- - # perfluous and conflicts with an accesskey (Ctrl-E) often - # used for editing in Safari. - if( in_array( $action, array( 'edit', 'submit' ) ) - && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) { - echo $skin->tooltip( "ca-$key" ); - } else { - echo $skin->tooltipAndAccesskey( "ca-$key" ); - } - echo '>'.htmlspecialchars($tab['text']).'</a></li>'; - } ?> - - </ul> - </div> - </div> +<?php $this->cactions(); ?> <div class="portlet" id="p-personal"> <h5><?php $this->msg('personaltools') ?></h5> <div class="pBody"> <ul<?php $this->html('userlangattributes') ?>> -<?php foreach($this->data['personal_urls'] as $key => $item) { ?> - <li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php - if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php - echo htmlspecialchars($item['href']) ?>"<?php echo $skin->tooltipAndAccesskey('pt-'.$key) ?><?php - if(!empty($item['class'])) { ?> class="<?php - echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php - echo htmlspecialchars($item['text']) ?></a></li> -<?php } ?> +<?php foreach($this->getPersonalTools() as $key => $item) { ?> + <?php echo $this->makeListItem($key, $item); ?> + +<?php } ?> </ul> </div> </div> <div class="portlet" id="p-logo"> - <a style="background-image: url(<?php $this->text('logopath') ?>);" <?php - ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php - echo $skin->tooltipAndAccesskey('p-logo') ?>></a> + <?php + $logoAttribs = array() + Linker::tooltipAndAccesskeyAttribs('p-logo'); + $logoAttribs['style'] = "background-image: url({$this->data['logopath']});"; + $logoAttribs['href'] = $this->data['nav_urls']['mainpage']['href']; + echo Html::element( 'a', $logoAttribs ); + ?> + </div> <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script> <?php - $sidebar = $this->data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } + $this->renderPortals( $this->data['sidebar'] ); ?> </div><!-- end of the left (by default at least) column --> <div class="visualClear"></div> +<?php + $validFooterIcons = $this->getFooterIcons( "icononly" ); + $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links + + if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?> <div id="footer"<?php $this->html('userlangattributes') ?>> -<?php foreach ( $footericons as $blockName => $footerIcons ) { ?> +<?php + $footerEnd = '</div>'; + } else { + $footerEnd = ''; + } + foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?> <div id="f-<?php echo htmlspecialchars($blockName); ?>ico"> <?php foreach ( $footerIcons as $icon ) { ?> <?php echo $this->skin->makeFooterIcon( $icon ); ?> @@ -219,42 +166,50 @@ if (empty($_REQUEST['printable'])) {?> </div> <?php } - // Generate additional footer links - $validFooterLinks = array(); - foreach( $footerlinks as $aLink ) { - if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { - $validFooterLinks[] = $aLink; - } - } if ( count( $validFooterLinks ) > 0 ) { ?> <ul id="f-list"> <?php - foreach( $validFooterLinks as $aLink ) { - if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { -?> <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li> -<?php } + foreach( $validFooterLinks as $aLink ) { ?> + <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li> +<?php } ?> </ul> <?php } +echo $footerEnd; ?> -</div> -</div> -<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -<?php $this->html('reporttime') ?> -<?php if ( $this->data['debug'] ): ?> -<!-- Debug output: -<?php $this->text( 'debug' ); ?> - ---> -<?php endif; +</div> +<?php + $this->printTrail(); echo Html::closeElement( 'body' ); echo Html::closeElement( 'html' ); wfRestoreWarnings(); } // end of execute() method /*************************************************************************************************/ + + protected function renderPortals( $sidebar ) { + if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; + if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; + if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; + + foreach( $sidebar as $boxName => $content ) { + if ( $content === false ) + continue; + + if ( $boxName == 'SEARCH' ) { + $this->searchBox(); + } elseif ( $boxName == 'TOOLBOX' ) { + $this->toolbox(); + } elseif ( $boxName == 'LANGUAGES' ) { + $this->languageBox(); + } else { + $this->customBox( $boxName, $content ); + } + } + } + function searchBox() { global $wgUseTwoButtonsSearchForm; ?> @@ -263,19 +218,15 @@ if (empty($_REQUEST['printable'])) {?> <div id="searchBody" class="pBody"> <form action="<?php $this->text('wgScript') ?>" id="searchform"> <input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/> - <?php - echo Html::input( 'search', - isset( $this->data['search'] ) ? $this->data['search'] : '', 'search', - array( - 'id' => 'searchInput', - 'title' => $this->skin->titleAttrib( 'search' ), - 'accesskey' => $this->skin->accesskey( 'search' ) - ) ); ?> + <?php echo $this->makeSearchInput(array( "id" => "searchInput" )); ?> - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>  - <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?> + <?php echo $this->makeSearchButton("go", array( "id" => "searchGoButton", "class" => "searchButton" )); + if ($wgUseTwoButtonsSearchForm): ?>  + <?php echo $this->makeSearchButton("fulltext", array( "id" => "mw-searchButton", "class" => "searchButton" )); + else: ?> - <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?> + <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php + endif; ?> </form> </div> @@ -283,6 +234,43 @@ if (empty($_REQUEST['printable'])) {?> <?php } + /** + * Prints the cactions bar. + * Shared between MonoBook and Modern + */ + function cactions() { +?> + <div id="p-cactions" class="portlet"> + <h5><?php $this->msg('views') ?></h5> + <div class="pBody"> + <ul><?php + foreach($this->data['content_actions'] as $key => $tab) { + $linkAttribs = array( 'href' => $tab['href'] ); + + if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) { + $title = Linker::titleAttrib( "ca-$key" ); + if ( $title !== false ) { + $linkAttribs['title'] = $title; + } + } else { + $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" ); + } + $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] ); + + /* Surround with a <li> */ + $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) ); + if( $tab['class'] ) { + $liAttribs['class'] = $tab['class']; + } + echo ' + ' . Html::rawElement( 'li', $liAttribs, $linkHtml ); + } ?> + + </ul> + </div> + </div> +<?php + } /*************************************************************************************************/ function toolbox() { ?> @@ -291,51 +279,13 @@ if (empty($_REQUEST['printable'])) {?> <div class="pBody"> <ul> <?php - if($this->data['notspecialpage']) { ?> - <li id="t-whatlinkshere"><a href="<?php - echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li> -<?php - if( $this->data['nav_urls']['recentchangeslinked'] ) { ?> - <li id="t-recentchangeslinked"><a href="<?php - echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li> -<?php } - } - if( isset( $this->data['nav_urls']['trackbacklink'] ) && $this->data['nav_urls']['trackbacklink'] ) { ?> - <li id="t-trackbacklink"><a href="<?php - echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li> -<?php } - if($this->data['feeds']) { ?> - <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) { - ?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php - echo htmlspecialchars($feed['href']) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>  - <?php } ?></li><?php - } - - foreach( array('contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) { - - if($this->data['nav_urls'][$special]) { - ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) ?></a></li> -<?php } - } - - if(!empty($this->data['nav_urls']['print']['href'])) { ?> - <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href']) - ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php - } + foreach ( $this->getToolbox() as $key => $tbitem ) { ?> + <?php echo $this->makeListItem($key, $tbitem); ?> - if(!empty($this->data['nav_urls']['permalink']['href'])) { ?> - <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php - } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?> - <li id="t-ispermalink"<?php echo $this->skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php +<?php } - wfRunHooks( 'ArchLinuxTemplateToolboxEnd', array( &$this ) ); - wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); + wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) ); ?> </ul> </div> @@ -351,10 +301,9 @@ if (empty($_REQUEST['printable'])) {?> <h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5> <div class="pBody"> <ul> -<?php foreach($this->data['language_urls'] as $langlink) { ?> - <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php - ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>" title="<?php - echo htmlspecialchars($langlink['title']) ?>"><?php echo $langlink['text'] ?></a></li> +<?php foreach($this->data['language_urls'] as $key => $langlink) { ?> + <?php echo $this->makeListItem($key, $langlink); ?> + <?php } ?> </ul> </div> @@ -365,16 +314,21 @@ if (empty($_REQUEST['printable'])) {?> /*************************************************************************************************/ function customBox( $bar, $cont ) { + $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) ); + $tooltip = Linker::titleAttrib( "p-$bar" ); + if ( $tooltip !== false ) { + $portletAttribs['title'] = $tooltip; + } + echo ' ' . Html::openElement( 'div', $portletAttribs ); ?> - <div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip('p-'.$bar) ?>> - <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5> + + <h5><?php $msg = wfMessage( $bar ); echo htmlspecialchars( $msg->exists() ? $msg->text() : $bar ); ?></h5> <div class='pBody'> <?php if ( is_array( $cont ) ) { ?> <ul> -<?php foreach($cont as $val) { ?> - <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php - if ( $val['active'] ) { ?> class="active" <?php } - ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $this->skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li> +<?php foreach($cont as $key => $val) { ?> + <?php echo $this->makeListItem($key, $val); ?> + <?php } ?> </ul> <?php } else { diff --git a/skins/Chick.php b/skins/Chick.php index c8eb8152..b7cef695 100644 --- a/skins/Chick.php +++ b/skins/Chick.php @@ -23,8 +23,10 @@ class SkinChick extends SkinTemplate { function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); - // Append to the default screen common & print styles... - $out->addStyle( 'chick/main.css', 'screen,handheld' ); + + $out->addModuleStyles( 'skins.chick' ); + + // TODO: Migrate all of these to RL $out->addStyle( 'chick/IE50Fixes.css', 'screen,handheld', 'lt IE 5.5000' ); $out->addStyle( 'chick/IE55Fixes.css', 'screen,handheld', 'IE 5.5000' ); $out->addStyle( 'chick/IE60Fixes.css', 'screen,handheld', 'IE 6' ); diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 1ff2ccab..58b00fc6 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -15,37 +15,67 @@ if( !defined( 'MEDIAWIKI' ) ) { * @todo document * @ingroup Skins */ -class SkinCologneBlue extends Skin { +class SkinCologneBlue extends SkinLegacy { + var $skinname = 'cologneblue', $stylename = 'cologneblue', + $template = 'CologneBlueTemplate'; - function getStylesheet() { - return 'common/cologneblue.css'; - } + function setupSkinUserCss( OutputPage $out ){ + parent::setupSkinUserCss( $out ); + $out->addModuleStyles( 'skins.cologneblue' ); + + $qb = $this->qbSetting(); + $rules = array(); - function getSkinName() { - return 'cologneblue'; + if ( 2 == $qb ) { # Right + $rules[] = "/* @noflip */#quickbar { position: absolute; right: 4px; }"; + $rules[] = "/* @noflip */#article { margin-left: 4px; margin-right: 148px; }"; + $rules[] = "/* @noflip */#footer { margin-right: 152px; }"; + } elseif ( 1 == $qb ) { + $rules[] = "/* @noflip */#quickbar { position: absolute; left: 4px; }"; + $rules[] = "/* @noflip */#article { margin-left: 148px; margin-right: 4px; }"; + $rules[] = "/* @noflip */#footer { margin-left: 152px; }"; + } elseif ( 3 == $qb ) { # Floating left + $rules[] = "/* @noflip */#quickbar { position:absolute; left:4px }"; + $rules[] = "/* @noflip */#topbar { margin-left: 148px }"; + $rules[] = "/* @noflip */#article { margin-left:148px; margin-right: 4px; }"; + $rules[] = "/* @noflip */body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto; bottom:4px;}"; # Hides from IE + $rules[] = "/* @noflip */#footer { margin-left: 152px; }"; + } elseif ( 4 == $qb ) { # Floating right + $rules[] = "/* @noflip */#quickbar { position: fixed; right: 4px; }"; + $rules[] = "/* @noflip */#topbar { margin-right: 148px }"; + $rules[] = "/* @noflip */#article { margin-right: 148px; margin-left: 4px; }"; + $rules[] = "/* @noflip */body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE + $rules[] = "/* @noflip */#footer { margin-right: 152px; }"; + } + $style = implode( "\n", $rules ); + $out->addInlineStyle( $style, 'flip' ); } +} + +class CologneBlueTemplate extends LegacyTemplate { + function doBeforeContent() { $mainPageObj = Title::newMainPage(); $s = "\n<div id='content'>\n<div id='topbar'>" . '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>'; - $s .= '<td class="top" align="left" valign="middle" nowrap="nowrap">'; + $s .= '<td class="top" nowrap="nowrap">'; $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">'; $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>'; - $s .= '</td><td class="top" align="right" valign="bottom" width="100%">'; + $s .= '</td><td class="top" id="top-syslinks" width="100%">'; $s .= $this->sysLinks(); - $s .= '</td></tr><tr><td valign="top">'; + $s .= '</td></tr><tr><td class="top-subheader">'; $s .= '<font size="-1"><span id="sitesub">'; $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>'; - $s .= '</td><td align="right">'; + $s .= '</td><td class="top-linkcollection">'; $s .= '<font size="-1"><span id="langlinks">'; $s .= str_replace( '<br />', '', $this->otherLanguages() ); - $cat = $this->getCategoryLinks(); + $cat = '<div id="catlinks" class="catlinks">' . $this->getSkin()->getCategoryLinks() . '</div>'; if( $cat ) { $s .= "<br />$cat\n"; } @@ -56,7 +86,7 @@ class SkinCologneBlue extends Skin { $s .= "\n</div>\n<div id='article'>"; - $notice = wfGetSiteNotice(); + $notice = $this->getSkin()->getSiteNotice(); if( $notice ) { $s .= "\n<div id='siteNotice'>$notice</div>\n"; } @@ -73,75 +103,38 @@ class SkinCologneBlue extends Skin { $s .= "\n<div id='footer'>"; $s .= '<table width="98%" border="0" cellspacing="0"><tr>'; - $qb = $this->qbSetting(); - if ( 1 == $qb || 3 == $qb ) { # Left - $s .= $this->getQuickbarCompensator(); - } - $s .= '<td class="bottom" align="center" valign="top">'; + $s .= '<td class="bottom">'; $s .= $this->bottomLinks(); $s .= $wgLang->pipeList( array( - "\n<br />" . $this->link( + "\n<br />" . Linker::link( Title::newMainPage(), null, array(), array(), array( 'known', 'noclasses' ) ), - $this->aboutLink(), + $this->getSkin()->aboutLink(), $this->searchForm( wfMsg( 'qbfind' ) ) ) ); $s .= "\n<br />" . $this->pageStats(); $s .= '</td>'; - if ( 2 == $qb ) { # Right - $s .= $this->getQuickbarCompensator(); - } $s .= "</tr></table>\n</div>\n</div>\n"; - if ( 0 != $qb ) { + if ( $this->getSkin()->qbSetting() != 0 ) { $s .= $this->quickBar(); } return $s; } - function setupSkinUserCss( OutputPage $out ){ - global $wgContLang; - $qb = $this->qbSetting(); - $rules = array(); - - if ( 2 == $qb ) { # Right - $rules[] = "#quickbar { position: absolute; right: 4px; }"; - $rules[] = "#article { margin-left: 4px; margin-right: 148px; }"; - } elseif ( 1 == $qb ) { - $rules[] = "#quickbar { position: absolute; left: 4px; }"; - $rules[] = "#article { margin-left: 148px; margin-right: 4px; }"; - } elseif ( 3 == $qb ) { # Floating left - $rules[] = "#quickbar { position:absolute; left:4px }"; - $rules[] = "#topbar { margin-left: 148px }"; - $rules[] = "#article { margin-left:148px; margin-right: 4px; }"; - $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE - } elseif ( 4 == $qb ) { # Floating right - $rules[] = "#quickbar { position: fixed; right: 4px; }"; - $rules[] = "#topbar { margin-right: 148px }"; - $rules[] = "#article { margin-right: 148px; margin-left: 4px; }"; - $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE - } - $style = implode( "\n", $rules ); - if ( $wgContLang->getDir() === 'rtl' ) { - $style = CSSJanus::transform( $style, true, false ); - } - $out->addInlineStyle( $style ); - parent::setupSkinUserCss( $out ); - } - function sysLinks() { global $wgUser, $wgLang; $li = SpecialPage::getTitleFor( 'Userlogin' ); $lo = SpecialPage::getTitleFor( 'Userlogout' ); - $rt = $this->mTitle->getPrefixedURL(); + $rt = $this->getSkin()->getTitle()->getPrefixedURL(); if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { $q = array(); } else { @@ -149,20 +142,20 @@ class SkinCologneBlue extends Skin { } $s = array( - $this->mainPageLink(), - $this->linkKnown( + $this->getSkin()->mainPageLink(), + Linker::linkKnown( Title::newFromText( wfMsgForContent( 'aboutpage' ) ), wfMsg( 'about' ) ), - $this->linkKnown( + Linker::linkKnown( Title::newFromText( wfMsgForContent( 'helppage' ) ), wfMsg( 'help' ) ), - $this->linkKnown( + Linker::linkKnown( Title::newFromText( wfMsgForContent( 'faqpage' ) ), wfMsg( 'faq' ) ), - $this->specialLink( 'Specialpages' ) + Linker::specialLink( 'Specialpages' ) ); /* show links to different language variants */ @@ -173,14 +166,14 @@ class SkinCologneBlue extends Skin { $s[] = $this->extensionTabLinks(); } if ( $wgUser->isLoggedIn() ) { - $s[] = $this->linkKnown( + $s[] = Linker::linkKnown( $lo, wfMsg( 'logout' ), array(), $q ); } else { - $s[] = $this->linkKnown( + $s[] = Linker::linkKnown( $li, wfMsg( 'login' ), array(), @@ -198,7 +191,7 @@ class SkinCologneBlue extends Skin { function quickBar(){ global $wgOut, $wgUser; - $tns = $this->mTitle->getNamespace(); + $tns = $this->getSkin()->getTitle()->getNamespace(); $s = "\n<div id='quickbar'>"; @@ -209,24 +202,38 @@ class SkinCologneBlue extends Skin { $s .= $this->menuHead( 'qbbrowse' ); # Use the first heading from the Monobook sidebar as the "browse" section - $bar = $this->buildSidebar(); + $bar = $this->getSkin()->buildSidebar(); unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); - $browseLinks = reset( $bar ); - foreach ( $browseLinks as $link ) { - if ( $link['text'] != '-' ) { - $s .= "<a href=\"{$link['href']}\">" . - htmlspecialchars( $link['text'] ) . '</a>' . $sep; + $barnumber = 1; + foreach ( $bar as $heading => $browseLinks ) { + if ( $barnumber > 1 ) { + $headingMsg = wfMessage( $heading ); + if ( $headingMsg->exists() ) { + $h = $headingMsg->text(); + } else { + $h = $heading; + } + $s .= "\n<h6>" . htmlspecialchars( $h ) . "</h6>"; + } + if( is_array( $browseLinks ) ) { + foreach ( $browseLinks as $link ) { + if ( $link['text'] != '-' ) { + $s .= "<a href=\"{$link['href']}\">" . + htmlspecialchars( $link['text'] ) . '</a>' . $sep; + } + } } + $barnumber++; } if ( $wgOut->isArticle() ) { $s .= $this->menuHead( 'qbedit' ); $s .= '<strong>' . $this->editThisPage() . '</strong>'; - $s .= $sep . $this->linkKnown( + $s .= $sep . Linker::linkKnown( Title::newFromText( wfMsgForContent( 'edithelppage' ) ), wfMsg( 'edithelp' ) ); @@ -264,10 +271,10 @@ class SkinCologneBlue extends Skin { . $sep . $this->watchPageLinksLink(); if( $tns == NS_USER || $tns == NS_USER_TALK ) { - $id = User::idFromName( $this->mTitle->getText() ); + $id = User::idFromName( $this->getSkin()->getTitle()->getText() ); if( $id != 0 ) { $s .= $sep . $this->userContribsLink(); - if( $this->showEmailUser( $id ) ) { + if( $this->getSkin()->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); } } @@ -277,7 +284,7 @@ class SkinCologneBlue extends Skin { $s .= $this->menuHead( 'qbmyoptions' ); if ( $wgUser->isLoggedIn() ) { - $tl = $this->link( + $tl = Linker::link( $wgUser->getTalkPage(), wfMsg( 'mytalk' ), array(), @@ -288,30 +295,30 @@ class SkinCologneBlue extends Skin { $tl .= ' *'; } - $s .= $this->link( + $s .= Linker::link( $wgUser->getUserPage(), wfMsg( 'mypage' ), array(), array(), array( 'known', 'noclasses' ) - ) . $sep . $tl . $sep . $this->specialLink( 'Watchlist' ) + ) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' ) . $sep . - $this->link( + Linker::link( SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), wfMsg( 'mycontris' ), array(), array(), array( 'known', 'noclasses' ) - ) . $sep . $this->specialLink( 'Preferences' ) - . $sep . $this->specialLink( 'Userlogout' ); + ) . $sep . Linker::specialLink( 'Preferences' ) + . $sep . Linker::specialLink( 'Userlogout' ); } else { - $s .= $this->specialLink( 'Userlogin' ); + $s .= Linker::specialLink( 'Userlogin' ); } $s .= $this->menuHead( 'qbspecialpages' ) - . $this->specialLink( 'Newpages' ) - . $sep . $this->specialLink( 'Listfiles' ) - . $sep . $this->specialLink( 'Statistics' ); + . Linker::specialLink( 'Newpages' ) + . $sep . Linker::specialLink( 'Listfiles' ) + . $sep . Linker::specialLink( 'Statistics' ); if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { $s .= $sep . $this->getUploadLink(); } @@ -323,7 +330,7 @@ class SkinCologneBlue extends Skin { . wfMsg( 'sitesupport' ) . '</a>'; } - $s .= $sep . $this->link( + $s .= $sep . Linker::link( SpecialPage::getTitleFor( 'Specialpages' ), wfMsg( 'moredotdotdot' ), array(), @@ -344,7 +351,7 @@ class SkinCologneBlue extends Skin { global $wgRequest, $wgUseTwoButtonsSearchForm; $search = $wgRequest->getText( 'search' ); - $action = $this->escapeSearchLink(); + $action = $this->data['searchaction']; $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">"; if( $label != '' ) { $s .= "{$label}: "; diff --git a/skins/Modern.php b/skins/Modern.php index 752d0ded..c4070b5d 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -22,11 +22,8 @@ class SkinModern extends SkinTemplate { $template = 'ModernTemplate', $useHeadElement = true; function setupSkinUserCss( OutputPage $out ){ - // Do not call parent::setupSkinUserCss(), we have our own print style - $out->addStyle( 'common/shared.css', 'screen' ); - $out->addStyle( 'modern/main.css', 'screen' ); - $out->addStyle( 'modern/print.css', 'print' ); - $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' ); + parent::setupSkinUserCss( $out ); + $out->addModuleStyles ('skins.modern'); } } @@ -35,6 +32,10 @@ class SkinModern extends SkinTemplate { * @ingroup Skins */ class ModernTemplate extends MonoBookTemplate { + + /** + * @var Skin + */ var $skin; /** * Template filter callback for Modern skin. @@ -45,25 +46,11 @@ class ModernTemplate extends MonoBookTemplate { * @access private */ function execute() { - global $wgRequest; $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - // fold footerlinks into a single array using a bit of trickery - $footerlinks = call_user_func_array('array_merge', array_values($footerlinks)); - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset copyright.copyright since we don't need the icon and already output a copyright from footerlinks - unset($footericons["copyright"]["copyright"]); - if ( count($footericons["copyright"]) <= 0 ) { - unset($footericons["copyright"]); - } - $this->html( 'headelement' ); ?> @@ -73,41 +60,14 @@ class ModernTemplate extends MonoBookTemplate { <div id="mw_main"> <div id="mw_contentwrapper"> <!-- navigation portlet --> - <div id="p-cactions" class="portlet"> - <h5><?php $this->msg('views') ?></h5> - <div class="pBody"> - <ul> - <?php foreach($this->data['content_actions'] as $key => $tab) { - echo ' - <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"'; - if( $tab['class'] ) { - echo ' class="'.htmlspecialchars($tab['class']).'"'; - } - echo'><a href="'.htmlspecialchars($tab['href']).'"'; - # We don't want to give the watch tab an accesskey if the - # page is being edited, because that conflicts with the - # accesskey on the watch checkbox. We also don't want to - # give the edit tab an accesskey, because that's fairly su- - # perfluous and conflicts with an accesskey (Ctrl-E) often - # used for editing in Safari. - if( in_array( $action, array( 'edit', 'submit' ) ) - && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) { - echo $skin->tooltip( "ca-$key" ); - } else { - echo $skin->tooltipAndAccesskey( "ca-$key" ); - } - echo '>'.htmlspecialchars($tab['text']).'</a></li>'; - } ?> - </ul> - </div> - </div> +<?php $this->cactions(); ?> <!-- content --> <div id="mw_content"> <!-- contentholder does nothing by default, but it allows users to style the text inside the content area without affecting the meaning of 'em' in #mw_content, which is used for the margins --> - <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>> + <div id="mw_contentholder"> <div class='mw-topboxes'> <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div> <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div> @@ -135,24 +95,7 @@ class ModernTemplate extends MonoBookTemplate { <div id="mw_portlets"<?php $this->html("userlangattributes") ?>> <!-- portlets --> - <?php - $sidebar = $this->data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } - ?> + <?php $this->renderPortals( $this->data['sidebar'] ); ?> </div><!-- mw_portlets --> @@ -166,14 +109,10 @@ class ModernTemplate extends MonoBookTemplate { <h5><?php $this->msg('personaltools') ?></h5> <div class="pBody"> <ul> -<?php foreach($this->data['personal_urls'] as $key => $item) { ?> - <li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php - if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php - echo htmlspecialchars($item['href']) ?>"<?php echo $skin->tooltipAndAccesskey('pt-'.$key) ?><?php - if(!empty($item['class'])) { ?> class="<?php - echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php - echo htmlspecialchars($item['text']) ?></a></li> -<?php } ?> +<?php foreach($this->getPersonalTools() as $key => $item) { ?> + <?php echo $this->makeListItem($key, $item); ?> + +<?php } ?> </ul> </div> </div> @@ -183,7 +122,7 @@ class ModernTemplate extends MonoBookTemplate { <div id="footer"<?php $this->html('userlangattributes') ?>> <ul id="f-list"> <?php - foreach( $footerlinks as $aLink ) { + foreach( $this->getFooterLinks("flat") as $aLink ) { if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li> <?php } @@ -191,7 +130,7 @@ class ModernTemplate extends MonoBookTemplate { ?> </ul> <?php - foreach ( $footericons as $blockName => $footerIcons ) { ?> + foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?> <div id="mw_<?php echo htmlspecialchars($blockName); ?>"> <?php foreach ( $footerIcons as $icon ) { ?> @@ -205,13 +144,7 @@ class ModernTemplate extends MonoBookTemplate { ?> </div> - <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -<?php $this->html('reporttime') ?> -<?php if ( $this->data['debug'] ): ?> -<!-- Debug output: -<?php $this->text( 'debug' ); ?> ---> -<?php endif; ?> + <?php $this->printTrail(); ?> </body></html> <?php wfRestoreWarnings(); diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 95833e56..0cf72e93 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -25,23 +25,22 @@ class SkinMonoBook extends SkinTemplate { function setupSkinUserCss( OutputPage $out ) { global $wgHandheldStyle; - parent::setupSkinUserCss( $out ); - // Append to the default screen common & print styles... - $out->addStyle( 'monobook/main.css', 'screen' ); + $out->addModuleStyles( 'skins.monobook' ); + + // Ugh. Can't do this properly because $wgHandheldStyle may be a URL if( $wgHandheldStyle ) { // Currently in testing... try 'chick/main.css' $out->addStyle( $wgHandheldStyle, 'handheld' ); } + // TODO: Migrate all of these $out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' ); $out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' ); $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' ); $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' ); - $out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' ); - } } @@ -49,8 +48,13 @@ class SkinMonoBook extends SkinTemplate { * @todo document * @ingroup Skins */ -class MonoBookTemplate extends QuickTemplate { +class MonoBookTemplate extends BaseTemplate { + + /** + * @var Skin + */ var $skin; + /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based @@ -60,38 +64,14 @@ class MonoBookTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgRequest; - - $this->skin = $skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); + $this->skin = $this->data['skin']; // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - // fold footerlinks into a single array using a bit of trickery - $footerlinks = call_user_func_array('array_merge', array_values($footerlinks)); - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset any icons which don't have an image - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) { - if ( !is_string($footerIcon) && !isset($footerIcon["src"]) ) { - unset($footerIconsBlock[$footerIconKey]); - } - } - } - // Redo removal of any empty blocks - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - if ( count($footerIconsBlock) <= 0 ) { - unset($footericons[$footerIconsKey]); - } - } - $this->html( 'headelement' ); ?><div id="globalWrapper"> -<div id="column-content"><div id="content"<?php $this->html("specialpageattributes") ?>> +<div id="column-content"><div id="content"> <a id="top"></a> <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> @@ -115,77 +95,45 @@ class MonoBookTemplate extends QuickTemplate { </div> </div></div> <div id="column-one"<?php $this->html('userlangattributes') ?>> - <div id="p-cactions" class="portlet"> - <h5><?php $this->msg('views') ?></h5> - <div class="pBody"> - <ul><?php - foreach($this->data['content_actions'] as $key => $tab) { - echo ' - <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"'; - if( $tab['class'] ) { - echo ' class="'.htmlspecialchars($tab['class']).'"'; - } - echo '><a href="'.htmlspecialchars($tab['href']).'"'; - # We don't want to give the watch tab an accesskey if the - # page is being edited, because that conflicts with the - # accesskey on the watch checkbox. We also don't want to - # give the edit tab an accesskey, because that's fairly su- - # perfluous and conflicts with an accesskey (Ctrl-E) often - # used for editing in Safari. - if( in_array( $action, array( 'edit', 'submit' ) ) - && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) { - echo $skin->tooltip( "ca-$key" ); - } else { - echo $skin->tooltipAndAccesskey( "ca-$key" ); - } - echo '>'.htmlspecialchars($tab['text']).'</a></li>'; - } ?> - - </ul> - </div> - </div> +<?php $this->cactions(); ?> <div class="portlet" id="p-personal"> <h5><?php $this->msg('personaltools') ?></h5> <div class="pBody"> <ul<?php $this->html('userlangattributes') ?>> -<?php foreach($this->data['personal_urls'] as $key => $item) { ?> - <li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php - if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php - echo htmlspecialchars($item['href']) ?>"<?php echo $skin->tooltipAndAccesskey('pt-'.$key) ?><?php - if(!empty($item['class'])) { ?> class="<?php - echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php - echo htmlspecialchars($item['text']) ?></a></li> -<?php } ?> +<?php foreach($this->getPersonalTools() as $key => $item) { ?> + <?php echo $this->makeListItem($key, $item); ?> + +<?php } ?> </ul> </div> </div> <div class="portlet" id="p-logo"> - <a style="background-image: url(<?php $this->text('logopath') ?>);" <?php - ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php - echo $skin->tooltipAndAccesskey('p-logo') ?>></a> + <?php + $logoAttribs = array() + Linker::tooltipAndAccesskeyAttribs('p-logo'); + $logoAttribs['style'] = "background-image: url({$this->data['logopath']});"; + $logoAttribs['href'] = $this->data['nav_urls']['mainpage']['href']; + echo Html::element( 'a', $logoAttribs ); + ?> + </div> <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script> <?php - $sidebar = $this->data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } + $this->renderPortals( $this->data['sidebar'] ); ?> </div><!-- end of the left (by default at least) column --> <div class="visualClear"></div> +<?php + $validFooterIcons = $this->getFooterIcons( "icononly" ); + $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links + + if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?> <div id="footer"<?php $this->html('userlangattributes') ?>> -<?php foreach ( $footericons as $blockName => $footerIcons ) { ?> +<?php + $footerEnd = '</div>'; + } else { + $footerEnd = ''; + } + foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?> <div id="f-<?php echo htmlspecialchars($blockName); ?>ico"> <?php foreach ( $footerIcons as $icon ) { ?> <?php echo $this->skin->makeFooterIcon( $icon ); ?> @@ -195,42 +143,50 @@ class MonoBookTemplate extends QuickTemplate { </div> <?php } - // Generate additional footer links - $validFooterLinks = array(); - foreach( $footerlinks as $aLink ) { - if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { - $validFooterLinks[] = $aLink; - } - } if ( count( $validFooterLinks ) > 0 ) { ?> <ul id="f-list"> <?php - foreach( $validFooterLinks as $aLink ) { - if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { -?> <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li> -<?php } + foreach( $validFooterLinks as $aLink ) { ?> + <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li> +<?php } ?> </ul> <?php } +echo $footerEnd; ?> -</div> -</div> -<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -<?php $this->html('reporttime') ?> -<?php if ( $this->data['debug'] ): ?> -<!-- Debug output: -<?php $this->text( 'debug' ); ?> - ---> -<?php endif; +</div> +<?php + $this->printTrail(); echo Html::closeElement( 'body' ); echo Html::closeElement( 'html' ); wfRestoreWarnings(); } // end of execute() method /*************************************************************************************************/ + + protected function renderPortals( $sidebar ) { + if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; + if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; + if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; + + foreach( $sidebar as $boxName => $content ) { + if ( $content === false ) + continue; + + if ( $boxName == 'SEARCH' ) { + $this->searchBox(); + } elseif ( $boxName == 'TOOLBOX' ) { + $this->toolbox(); + } elseif ( $boxName == 'LANGUAGES' ) { + $this->languageBox(); + } else { + $this->customBox( $boxName, $content ); + } + } + } + function searchBox() { global $wgUseTwoButtonsSearchForm; ?> @@ -239,19 +195,15 @@ class MonoBookTemplate extends QuickTemplate { <div id="searchBody" class="pBody"> <form action="<?php $this->text('wgScript') ?>" id="searchform"> <input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/> - <?php - echo Html::input( 'search', - isset( $this->data['search'] ) ? $this->data['search'] : '', 'search', - array( - 'id' => 'searchInput', - 'title' => $this->skin->titleAttrib( 'search' ), - 'accesskey' => $this->skin->accesskey( 'search' ) - ) ); ?> + <?php echo $this->makeSearchInput(array( "id" => "searchInput" )); ?> - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>  - <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?> + <?php echo $this->makeSearchButton("go", array( "id" => "searchGoButton", "class" => "searchButton" )); + if ($wgUseTwoButtonsSearchForm): ?>  + <?php echo $this->makeSearchButton("fulltext", array( "id" => "mw-searchButton", "class" => "searchButton" )); + else: ?> - <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?> + <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php + endif; ?> </form> </div> @@ -259,6 +211,43 @@ class MonoBookTemplate extends QuickTemplate { <?php } + /** + * Prints the cactions bar. + * Shared between MonoBook and Modern + */ + function cactions() { +?> + <div id="p-cactions" class="portlet"> + <h5><?php $this->msg('views') ?></h5> + <div class="pBody"> + <ul><?php + foreach($this->data['content_actions'] as $key => $tab) { + $linkAttribs = array( 'href' => $tab['href'] ); + + if( isset( $tab["tooltiponly"] ) && $tab["tooltiponly"] ) { + $title = Linker::titleAttrib( "ca-$key" ); + if ( $title !== false ) { + $linkAttribs['title'] = $title; + } + } else { + $linkAttribs += Linker::tooltipAndAccesskeyAttribs( "ca-$key" ); + } + $linkHtml = Html::element( 'a', $linkAttribs, $tab['text'] ); + + /* Surround with a <li> */ + $liAttribs = array( 'id' => Sanitizer::escapeId( "ca-$key" ) ); + if( $tab['class'] ) { + $liAttribs['class'] = $tab['class']; + } + echo ' + ' . Html::rawElement( 'li', $liAttribs, $linkHtml ); + } ?> + + </ul> + </div> + </div> +<?php + } /*************************************************************************************************/ function toolbox() { ?> @@ -267,51 +256,13 @@ class MonoBookTemplate extends QuickTemplate { <div class="pBody"> <ul> <?php - if($this->data['notspecialpage']) { ?> - <li id="t-whatlinkshere"><a href="<?php - echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li> -<?php - if( $this->data['nav_urls']['recentchangeslinked'] ) { ?> - <li id="t-recentchangeslinked"><a href="<?php - echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li> -<?php } - } - if( isset( $this->data['nav_urls']['trackbacklink'] ) && $this->data['nav_urls']['trackbacklink'] ) { ?> - <li id="t-trackbacklink"><a href="<?php - echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li> -<?php } - if($this->data['feeds']) { ?> - <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) { - ?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php - echo htmlspecialchars($feed['href']) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>  - <?php } ?></li><?php - } - - foreach( array('contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) { - - if($this->data['nav_urls'][$special]) { - ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) ?></a></li> -<?php } - } - - if(!empty($this->data['nav_urls']['print']['href'])) { ?> - <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href']) - ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php - } + foreach ( $this->getToolbox() as $key => $tbitem ) { ?> + <?php echo $this->makeListItem($key, $tbitem); ?> - if(!empty($this->data['nav_urls']['permalink']['href'])) { ?> - <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href']) - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php - } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?> - <li id="t-ispermalink"<?php echo $this->skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php +<?php } - wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) ); - wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); + wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) ); ?> </ul> </div> @@ -327,10 +278,9 @@ class MonoBookTemplate extends QuickTemplate { <h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5> <div class="pBody"> <ul> -<?php foreach($this->data['language_urls'] as $langlink) { ?> - <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php - ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>" title="<?php - echo htmlspecialchars($langlink['title']) ?>"><?php echo $langlink['text'] ?></a></li> +<?php foreach($this->data['language_urls'] as $key => $langlink) { ?> + <?php echo $this->makeListItem($key, $langlink); ?> + <?php } ?> </ul> </div> @@ -341,16 +291,21 @@ class MonoBookTemplate extends QuickTemplate { /*************************************************************************************************/ function customBox( $bar, $cont ) { + $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) ); + $tooltip = Linker::titleAttrib( "p-$bar" ); + if ( $tooltip !== false ) { + $portletAttribs['title'] = $tooltip; + } + echo ' ' . Html::openElement( 'div', $portletAttribs ); ?> - <div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip('p-'.$bar) ?>> - <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5> + + <h5><?php $msg = wfMessage( $bar ); echo htmlspecialchars( $msg->exists() ? $msg->text() : $bar ); ?></h5> <div class='pBody'> <?php if ( is_array( $cont ) ) { ?> <ul> -<?php foreach($cont as $val) { ?> - <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php - if ( $val['active'] ) { ?> class="active" <?php } - ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $this->skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li> +<?php foreach($cont as $key => $val) { ?> + <?php echo $this->makeListItem($key, $val); ?> + <?php } ?> </ul> <?php } else { diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index 6c599b21..a4fd985d 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -14,19 +14,22 @@ if( !defined( 'MEDIAWIKI' ) ) { * @todo document * @ingroup Skins */ -class SkinNostalgia extends Skin { +class SkinNostalgia extends SkinLegacy { + var $skinname = 'nostalgia', $stylename = 'nostalgia', + $template = 'NostalgiaTemplate'; - function getStylesheet() { - return 'common/nostalgia.css'; + function setupSkinUserCss( OutputPage $out ){ + parent::setupSkinUserCss( $out ); + $out->addModuleStyles( 'skins.nostalgia' ); } - function getSkinName() { - return 'nostalgia'; - } +} + +class NostalgiaTemplate extends LegacyTemplate { function doBeforeContent() { $s = "\n<div id='content'>\n<div id='top'>\n"; - $s .= '<div id="logo">' . $this->logoText( 'right' ) . '</div>'; + $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>'; $s .= $this->pageTitle(); $s .= $this->pageSubtitle() . "\n"; @@ -34,7 +37,7 @@ class SkinNostalgia extends Skin { $s .= '<div id="topbar">'; $s .= $this->topLinks() . "\n<br />"; - $notice = wfGetSiteNotice(); + $notice = $this->getSkin()->getSiteNotice(); if( $notice ) { $s .= "\n<div id='siteNotice'>$notice</div>\n"; } @@ -45,7 +48,7 @@ class SkinNostalgia extends Skin { $s .= '<br />' . $ol; } - $cat = $this->getCategoryLinks(); + $cat = '<div id="catlinks" class="catlinks">' . $this->getSkin()->getCategoryLinks() . '</div>'; if( $cat ) { $s .= '<br />' . $cat; } @@ -60,40 +63,41 @@ class SkinNostalgia extends Skin { global $wgOut, $wgUser; $sep = " |\n"; - $s = $this->mainPageLink() . $sep - . $this->specialLink( 'Recentchanges' ); + $s = $this->getSkin()->mainPageLink() . $sep + . Linker::specialLink( 'Recentchanges' ); if ( $wgOut->isArticle() ) { - $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->historyLink(); + $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() . + $sep . $this->historyLink(); } /* show links to different language variants */ $s .= $this->variantLinks(); $s .= $this->extensionTabLinks(); if ( $wgUser->isAnon() ) { - $s .= $sep . $this->specialLink( 'Userlogin' ); + $s .= $sep . Linker::specialLink( 'Userlogin' ); } else { /* show user page and user talk links */ - $s .= $sep . $this->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) ); - $s .= $sep . $this->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) ); + $s .= $sep . Linker::link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) ); + $s .= $sep . Linker::link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) ); if ( $wgUser->getNewtalk() ) { $s .= ' *'; } /* show watchlist link */ - $s .= $sep . $this->specialLink( 'Watchlist' ); + $s .= $sep . Linker::specialLink( 'Watchlist' ); /* show my contributions link */ - $s .= $sep . $this->link( + $s .= $sep . Linker::link( SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), wfMsgHtml( 'mycontris' ) ); /* show my preferences link */ - $s .= $sep . $this->specialLink( 'Preferences' ); + $s .= $sep . Linker::specialLink( 'Preferences' ); /* show upload file link */ if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) { $s .= $sep . $this->getUploadLink(); } /* show log out link */ - $s .= $sep . $this->specialLink( 'Userlogout' ); + $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' ); } $s .= $sep . $this->specialPagesList(); @@ -108,8 +112,8 @@ class SkinNostalgia extends Skin { $s .= $this->bottomLinks(); $s .= "\n<br />" . $this->pageStats(); - $s .= "\n<br />" . $this->mainPageLink() - . ' | ' . $this->aboutLink() + $s .= "\n<br />" . $this->getSkin()->mainPageLink() + . ' | ' . $this->getSkin()->aboutLink() . ' | ' . $this->searchForm(); $s .= "\n</div>\n</div>\n"; diff --git a/skins/Simple.php b/skins/Simple.php index 87bb0b7e..61b6e786 100644 --- a/skins/Simple.php +++ b/skins/Simple.php @@ -27,12 +27,12 @@ class SkinSimple extends SkinTemplate { $out->addModuleStyles( 'skins.simple' ); /* Add some userprefs specific CSS styling */ - global $wgUser, $wgContLang; + global $wgUser; $rules = array(); $underline = ""; if ( $wgUser->getOption( 'underline' ) < 2 ) { - $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . ";"; + $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline !important' : 'none' . ";"; } /* Also inherits from resourceloader */ @@ -42,10 +42,7 @@ class SkinSimple extends SkinTemplate { $rules[] = "a.stub:after { $underline; }"; } $style = implode( "\n", $rules ); - if ( $wgContLang->getDir() === 'rtl' ) { - $style = CSSJanus::transform( $style, true, false ); - } - $out->addInlineStyle( $style ); + $out->addInlineStyle( $style, 'flip' ); } } diff --git a/skins/Standard.php b/skins/Standard.php index 2ea6896d..8ae4b3b1 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -14,38 +14,42 @@ if( !defined( 'MEDIAWIKI' ) ) { * @todo document * @ingroup Skins */ -class SkinStandard extends Skin { +class SkinStandard extends SkinLegacy { + var $skinname = 'standard', $stylename = 'standard', + $template = 'StandardTemplate'; - /** - * - */ function setupSkinUserCss( OutputPage $out ){ - global $wgContLang; + parent::setupSkinUserCss( $out ); + $out->AddModuleStyles( 'skins.standard' ); + $qb = $this->qbSetting(); $rules = array(); if ( 2 == $qb ) { # Right - $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }"; - $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }"; + $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }"; + $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }"; + $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }"; } elseif ( 1 == $qb || 3 == $qb ) { - $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }"; - $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }"; + $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }"; + $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }"; + $rules[] = "/* @noflip */#topbar, #footer { margin-left: 152px; }"; if( 3 == $qb ) { - $rules[] = "#quickbar { position: fixed; padding: 4px; }"; + $rules[] = "/* @noflip */#quickbar { position: fixed; padding: 4px; }"; } } elseif ( 4 == $qb ) { - $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; - $rules[] = "#quickbar { border-right: 1px solid gray; }"; - $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }"; + $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; + $rules[] = "/* @noflip */#quickbar { border-right: 1px solid gray; }"; + $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }"; + $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }"; } $style = implode( "\n", $rules ); - if ( $wgContLang->getDir() === 'rtl' ) { - $style = CSSJanus::transform( $style, true, false ); - } - $out->addInlineStyle( $style ); - parent::setupSkinUserCss( $out ); + $out->addInlineStyle( $style, 'flip' ); } +} + +class StandardTemplate extends LegacyTemplate { + function doAfterContent() { global $wgContLang, $wgLang; wfProfileIn( __METHOD__ ); @@ -57,42 +61,26 @@ class SkinStandard extends Skin { wfProfileOut( __METHOD__ . '-1' ); wfProfileIn( __METHOD__ . '-2' ); - - $qb = $this->qbSetting(); - $shove = ( $qb != 0 ); - $left = ( $qb == 1 || $qb == 3 ); - if( $wgContLang->isRTL() ) { - $left = !$left; - } - - if ( $shove && $left ) { # Left - $s .= $this->getQuickbarCompensator(); - } - wfProfileOut( __METHOD__ . '-2' ); - wfProfileIn( __METHOD__ . '-3' ); - $l = $wgContLang->alignStart(); + $l = $this->getSkin()->getLang()->alignStart(); $s .= "<td class='bottom' align='$l' valign='top'>"; $s .= $this->bottomLinks(); $s .= "\n<br />" . $wgLang->pipeList( array( - $this->mainPageLink(), - $this->aboutLink(), - $this->specialLink( 'Recentchanges' ), + $this->getSkin()->mainPageLink(), + $this->getSkin()->aboutLink(), + Linker::specialLink( 'Recentchanges' ), $this->searchForm() ) ) . '<br /><span id="pagestats">' . $this->pageStats() . '</span>'; $s .= '</td>'; - if ( $shove && !$left ) { # Right - $s .= $this->getQuickbarCompensator(); - } $s .= "</tr></table>\n</div>\n</div>\n"; - wfProfileOut( __METHOD__ . '-3' ); - wfProfileIn( __METHOD__ . '-4' ); - if ( 0 != $qb ) { + wfProfileOut( __METHOD__ . '-2' ); + wfProfileIn( __METHOD__ . '-3' ); + if ( $this->getSkin()->qbSetting() != 0 ) { $s .= $this->quickBar(); } - wfProfileOut( __METHOD__ . '-4' ); + wfProfileOut( __METHOD__ . '-3' ); wfProfileOut( __METHOD__ ); return $s; } @@ -104,39 +92,49 @@ class SkinStandard extends Skin { $action = $wgRequest->getText( 'action' ); $wpPreview = $wgRequest->getBool( 'wpPreview' ); - $tns = $this->mTitle->getNamespace(); + $tns = $this->getSkin()->getTitle()->getNamespace(); $s = "\n<div id='quickbar'>"; - $s .= "\n" . $this->logoText() . "\n<hr class='sep' />"; + $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />"; $sep = "\n<br />"; # Use the first heading from the Monobook sidebar as the "browse" section - $bar = $this->buildSidebar(); + $bar = $this->getSkin()->buildSidebar(); unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); - $browseLinks = reset( $bar ); - foreach ( $browseLinks as $link ) { - if ( $link['text'] != '-' ) { - $s .= "<a href=\"{$link['href']}\">" . - htmlspecialchars( $link['text'] ) . '</a>' . $sep; + $barnumber = 1; + foreach ( $bar as $browseLinks ) { + if ( is_array( $browseLinks ) ) { + if ( $barnumber > 1 ) { + $s .= "\n<hr class='sep' />"; + } + foreach ( $browseLinks as $link ) { + if ( $link['text'] != '-' ) { + $s .= "<a href=\"{$link['href']}\">" . + htmlspecialchars( $link['text'] ) . '</a>' . $sep; + } + } + } + if ( $barnumber == 1 ) { + // only show watchlist link if logged in + if( $wgUser->isLoggedIn() ) { + $s.= Linker::specialLink( 'Watchlist' ) ; + $s .= $sep . Linker::linkKnown( + SpecialPage::getTitleFor( 'Contributions' ), + wfMsg( 'mycontris' ), + array(), + array( 'target' => $wgUser->getName() ) + ); + } } + $barnumber = $barnumber + 1; } - if( $wgUser->isLoggedIn() ) { - $s.= $this->specialLink( 'Watchlist' ) ; - $s .= $sep . $this->linkKnown( - SpecialPage::getTitleFor( 'Contributions' ), - wfMsg( 'mycontris' ), - array(), - array( 'target' => $wgUser->getName() ) - ); - } - // only show watchlist link if logged in $s .= "\n<hr class='sep' />"; - $articleExists = $this->mTitle->getArticleId(); + $articleExists = $this->getSkin()->getTitle()->getArticleId(); if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) { if( $wgOut->isArticle() ) { $s .= '<strong>' . $this->editThisPage() . '</strong>'; @@ -181,17 +179,14 @@ class SkinStandard extends Skin { $text = wfMsg( 'articlepage' ); } - $link = $this->mTitle->getText(); + $link = $this->getSkin()->getTitle()->getText(); $nstext = $wgContLang->getNsText( $tns ); if( $nstext ) { # add namespace if necessary $link = $nstext . ':' . $link; } - $s .= $this->link( - Title::newFromText( $link ), - $text - ); - } elseif( $this->mTitle->getNamespace() != NS_SPECIAL ) { + $s .= Linker::link( Title::newFromText( $link ), $text ); + } elseif( $this->getSkin()->getTitle()->getNamespace() != NS_SPECIAL ) { # we just throw in a "New page" text to tell the user that he's in edit mode, # and to avoid messing with the separator that is prepended to the next item $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>'; @@ -199,9 +194,9 @@ class SkinStandard extends Skin { } # "Post a comment" link - if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) - $s .= '<br />' . $this->link( - $this->mTitle, + if( ( $this->getSkin()->getTitle()->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) + $s .= '<br />' . $this->getSkin()->link( + $this->getSkin()->getTitle(), wfMsg( 'postcomment' ), array(), array( @@ -221,7 +216,7 @@ class SkinStandard extends Skin { if( $action != 'edit' && $action != 'submit' ) { $s .= $sep . $this->watchThisPage(); } - if ( $this->mTitle->userCan( 'edit' ) ) + if ( $this->getSkin()->getTitle()->userCan( 'edit' ) ) $s .= $sep . $this->moveThisPage(); } if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) { @@ -239,17 +234,17 @@ class SkinStandard extends Skin { } if ( - NS_USER == $this->mTitle->getNamespace() || - $this->mTitle->getNamespace() == NS_USER_TALK + NS_USER == $this->getSkin()->getTitle()->getNamespace() || + $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK ) { - $id = User::idFromName( $this->mTitle->getText() ); - $ip = User::isIP( $this->mTitle->getText() ); + $id = User::idFromName( $this->getSkin()->getTitle()->getText() ); + $ip = User::isIP( $this->getSkin()->getTitle()->getText() ); if( $id || $ip ){ $s .= $sep . $this->userContribsLink(); } - if( $this->showEmailUser( $id ) ) { + if( $this->getSkin()->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); } } @@ -260,7 +255,7 @@ class SkinStandard extends Skin { $s .= $this->getUploadLink() . $sep; } - $s .= $this->specialLink( 'Specialpages' ); + $s .= Linker::specialLink( 'Specialpages' ); global $wgSiteSupportPage; if( $wgSiteSupportPage ) { diff --git a/skins/Vector.php b/skins/Vector.php index 84f38d30..97161611 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -1,7 +1,7 @@ <?php /** - * Vector - Branch of MonoBook which has many usability improvements and - * somewhat cleaner code. + * Vector - Modern version of MonoBook with fresh look and many usability + * improvements. * * @todo document * @file @@ -18,7 +18,6 @@ if( !defined( 'MEDIAWIKI' ) ) { */ class SkinVector extends SkinTemplate { - /* Functions */ var $skinname = 'vector', $stylename = 'vector', $template = 'VectorTemplate', $useHeadElement = true; @@ -30,7 +29,7 @@ class SkinVector extends SkinTemplate { global $wgLocalStylePath, $wgRequest; parent::initPage( $out ); - + // Append CSS which includes IE only behavior fixes for hover support - // this is better than including this in a CSS fille since it doesn't // wait for the CSS file to load before fetching the HTC file. @@ -40,6 +39,8 @@ class SkinVector extends SkinTemplate { htmlspecialchars( $wgLocalStylePath ) . "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->" ); + + $out->addModuleScripts( 'skins.vector' ); } /** @@ -51,355 +52,66 @@ class SkinVector extends SkinTemplate { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.vector' ); } - - /** - * Builds a structured array of links used for tabs and menus - * @return array - * @private - */ - function buildNavigationUrls() { - global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle; - global $wgDisableLangConversion, $wgVectorUseIconWatch; - - wfProfileIn( __METHOD__ ); - - $links = array( - 'namespaces' => array(), - 'views' => array(), - 'actions' => array(), - 'variants' => array() - ); - - // Detects parameters - $action = $wgRequest->getVal( 'action', 'view' ); - $section = $wgRequest->getVal( 'section' ); - - $userCanRead = $this->mTitle->userCanRead(); - - // Checks if page is some kind of content - if( $this->iscontent ) { - // Gets page objects for the related namespaces - $subjectPage = $this->mTitle->getSubjectPage(); - $talkPage = $this->mTitle->getTalkPage(); - - // Determines if this is a talk page - $isTalk = $this->mTitle->isTalkPage(); - - // Generates XML IDs from namespace names - $subjectId = $this->mTitle->getNamespaceKey( '' ); - - if ( $subjectId == 'main' ) { - $talkId = 'talk'; - } else { - $talkId = "{$subjectId}_talk"; - } - - // Adds namespace links - $links['namespaces'][$subjectId] = $this->tabAction( - $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', $userCanRead - ); - $links['namespaces'][$subjectId]['context'] = 'subject'; - $links['namespaces'][$talkId] = $this->tabAction( - $talkPage, 'talk', $isTalk, '', $userCanRead - ); - $links['namespaces'][$talkId]['context'] = 'talk'; - - // Adds view view link - if ( $this->mTitle->exists() && $userCanRead ) { - $links['views']['view'] = $this->tabAction( - $isTalk ? $talkPage : $subjectPage, - 'vector-view-view', ( $action == 'view' || $action == 'purge' ), '', true - ); - } - - wfProfileIn( __METHOD__ . '-edit' ); - - // Checks if user can... - if ( - // read and edit the current page - $userCanRead && $this->mTitle->quickUserCan( 'edit' ) && - ( - // if it exists - $this->mTitle->exists() || - // or they can create one here - $this->mTitle->quickUserCan( 'create' ) - ) - ) { - // Builds CSS class for talk page links - $isTalkClass = $isTalk ? ' istalk' : ''; - - // Determines if we're in edit mode - $selected = ( - ( $action == 'edit' || $action == 'submit' ) && - ( $section != 'new' ) - ); - $links['views']['edit'] = array( - 'class' => ( $selected ? 'selected' : '' ) . $isTalkClass, - 'text' => $this->mTitle->exists() - ? wfMsg( 'vector-view-edit' ) - : wfMsg( 'vector-view-create' ), - 'href' => - $this->mTitle->getLocalURL( $this->editUrlOptions() ) - ); - // Checks if this is a current rev of talk page and we should show a new - // section link - if ( ( $isTalk && $wgArticle && $wgArticle->isCurrent() ) || ( $wgOut->showNewSectionLink() ) ) { - // Checks if we should ever show a new section link - if ( !$wgOut->forceHideNewSectionLink() ) { - // Adds new section link - //$links['actions']['addsection'] - $links['views']['addsection'] = array( - 'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ), - 'text' => wfMsg( 'vector-action-addsection' ), - 'href' => $this->mTitle->getLocalURL( - 'action=edit§ion=new' - ) - ); - } - } - // Checks if the page has some kind of viewable content - } elseif ( $this->mTitle->hasSourceText() && $userCanRead ) { - // Adds view source view link - $links['views']['viewsource'] = array( - 'class' => ( $action == 'edit' ) ? 'selected' : false, - 'text' => wfMsg( 'vector-view-viewsource' ), - 'href' => - $this->mTitle->getLocalURL( $this->editUrlOptions() ) - ); - } - wfProfileOut( __METHOD__ . '-edit' ); - - wfProfileIn( __METHOD__ . '-live' ); - - // Checks if the page exists - if ( $this->mTitle->exists() && $userCanRead ) { - // Adds history view link - $links['views']['history'] = array( - 'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ), - 'text' => wfMsg( 'vector-view-history' ), - 'href' => $this->mTitle->getLocalURL( 'action=history' ), - 'rel' => 'archives', - ); - - if( $wgUser->isAllowed( 'delete' ) ) { - $links['actions']['delete'] = array( - 'class' => ( $action == 'delete' ) ? 'selected' : false, - 'text' => wfMsg( 'vector-action-delete' ), - 'href' => $this->mTitle->getLocalURL( 'action=delete' ) - ); - } - if ( $this->mTitle->quickUserCan( 'move' ) ) { - $moveTitle = SpecialPage::getTitleFor( - 'Movepage', $this->thispage - ); - $links['actions']['move'] = array( - 'class' => $this->mTitle->isSpecial( 'Movepage' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-move' ), - 'href' => $moveTitle->getLocalURL() - ); - } - - if ( - $this->mTitle->getNamespace() !== NS_MEDIAWIKI && - $wgUser->isAllowed( 'protect' ) - ) { - if ( !$this->mTitle->isProtected() ) { - $links['actions']['protect'] = array( - 'class' => ( $action == 'protect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-protect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=protect' ) - ); - - } else { - $links['actions']['unprotect'] = array( - 'class' => ( $action == 'unprotect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-unprotect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=unprotect' ) - ); - } - } - } else { - // article doesn't exist or is deleted - if ( - $wgUser->isAllowed( 'deletedhistory' ) && - $wgUser->isAllowed( 'undelete' ) - ) { - $n = $this->mTitle->isDeleted(); - if( $n ) { - $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); - $links['actions']['undelete'] = array( - 'class' => false, - 'text' => wfMsgExt( - 'vector-action-undelete', - array( 'parsemag' ), - $wgLang->formatNum( $n ) - ), - 'href' => $undelTitle->getLocalURL( - 'target=' . urlencode( $this->thispage ) - ) - ); - } - } - - if ( - $this->mTitle->getNamespace() !== NS_MEDIAWIKI && - $wgUser->isAllowed( 'protect' ) - ) { - if ( !$this->mTitle->getRestrictions( 'create' ) ) { - $links['actions']['protect'] = array( - 'class' => ( $action == 'protect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-protect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=protect' ) - ); - - } else { - $links['actions']['unprotect'] = array( - 'class' => ( $action == 'unprotect' ) ? - 'selected' : false, - 'text' => wfMsg( 'vector-action-unprotect' ), - 'href' => - $this->mTitle->getLocalURL( 'action=unprotect' ) - ); - } - } - } - wfProfileOut( __METHOD__ . '-live' ); - /** - * The following actions use messages which, if made particular to - * the Vector skin, would break the Ajax code which makes this - * action happen entirely inline. Skin::makeGlobalVariablesScript - * defines a set of messages in a javascript object - and these - * messages are assumed to be global for all skins. Without making - * a change to that procedure these messages will have to remain as - * the global versions. - */ - // Checks if the user is logged in - if ( $this->loggedin ) { - if ( $wgVectorUseIconWatch ) { - $class = 'icon'; - $place = 'views'; - } else { - $class = ''; - $place = 'actions'; - } - $mode = $this->mTitle->userIsWatching() ? 'unwatch' : 'watch'; - $links[$place][$mode] = array( - 'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ), - 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message - 'href' => $this->mTitle->getLocalURL( 'action=' . $mode ) - ); - } - // This is instead of SkinTemplateTabs - which uses a flat array - wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) ); - - // If it's not content, it's got to be a special page - } else { - $links['namespaces']['special'] = array( - 'class' => 'selected', - 'text' => wfMsg( 'nstab-special' ), - 'href' => $wgRequest->getRequestURL() - ); - // Equiv to SkinTemplateBuildContentActionUrlsAfterSpecialPage - wfRunHooks( 'SkinTemplateNavigation::SpecialPage', array( &$this, &$links ) ); - } - - // Gets list of language variants - $variants = $wgContLang->getVariants(); - // Checks that language conversion is enabled and variants exist - if( !$wgDisableLangConversion && count( $variants ) > 1 ) { - // Gets preferred variant - $preferred = $wgContLang->getPreferredVariant(); - // Loops over each variant - foreach( $variants as $code ) { - // Gets variant name from language code - $varname = $wgContLang->getVariantname( $code ); - // Checks if the variant is marked as disabled - if( $varname == 'disable' ) { - // Skips this variant - continue; - } - // Appends variant link - $links['variants'][] = array( - 'class' => ( $code == $preferred ) ? 'selected' : false, - 'text' => $varname, - 'href' => $this->mTitle->getLocalURL( '', $code ) - ); - } - } - - // Equiv to SkinTemplateContentActions - wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$links ) ); - - wfProfileOut( __METHOD__ ); - - return $links; - } } /** * QuickTemplate class for Vector skin * @ingroup Skins */ -class VectorTemplate extends QuickTemplate { +class VectorTemplate extends BaseTemplate { /* Members */ /** - * @var Cached skin object + * @var Skin Cached skin object */ var $skin; /* Functions */ /** - * Outputs the entire contents of the XHTML page + * Outputs the entire contents of the (X)HTML page */ public function execute() { - global $wgRequest, $wgLang; + global $wgLang, $wgVectorUseIconWatch; $this->skin = $this->data['skin']; - $action = $wgRequest->getText( 'action' ); // Build additional attributes for navigation urls - $nav = $this->skin->buildNavigationUrls(); + //$nav = $this->skin->buildNavigationUrls(); + $nav = $this->data['content_navigation']; + + if ( $wgVectorUseIconWatch ) { + $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch'; + if ( isset( $nav['actions'][$mode] ) ) { + $nav['views'][$mode] = $nav['actions'][$mode]; + $nav['views'][$mode]['class'] = rtrim( 'icon ' . $nav['views'][$mode]['class'], ' ' ); + $nav['views'][$mode]['primary'] = true; + unset( $nav['actions'][$mode] ); + } + } + + $xmlID = ''; foreach ( $nav as $section => $links ) { foreach ( $links as $key => $link ) { - $xmlID = $key; - if ( isset( $link['context'] ) && $link['context'] == 'subject' ) { - $xmlID = 'ca-nstab-' . $xmlID; - } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) { - $xmlID = 'ca-talk'; - } else { - $xmlID = 'ca-' . $xmlID; + if ( $section == 'views' && !( isset( $link['primary'] ) && $link['primary'] ) ) { + $link['class'] = rtrim( 'collapsible ' . $link['class'], ' ' ); } + + $xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID; $nav[$section][$key]['attributes'] = ' id="' . Sanitizer::escapeId( $xmlID ) . '"'; - if ( $nav[$section][$key]['class'] ) { + if ( $link['class'] ) { $nav[$section][$key]['attributes'] .= ' class="' . htmlspecialchars( $link['class'] ) . '"'; unset( $nav[$section][$key]['class'] ); } - // We don't want to give the watch tab an accesskey if the page - // is being edited, because that conflicts with the accesskey on - // the watch checkbox. We also don't want to give the edit tab - // an accesskey, because that's fairly superfluous and conflicts - // with an accesskey (Ctrl-E) often used for editing in Safari. - if ( - in_array( $action, array( 'edit', 'submit' ) ) && - in_array( $key, array( 'edit', 'watch', 'unwatch' ) ) - ) { + if ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) { $nav[$section][$key]['key'] = - $this->skin->tooltip( $xmlID ); + Linker::tooltip( $xmlID ); } else { $nav[$section][$key]['key'] = - $this->skin->tooltipAndAccesskey( $xmlID ); + Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) ); } } } @@ -407,49 +119,7 @@ class VectorTemplate extends QuickTemplate { $this->data['view_urls'] = $nav['views']; $this->data['action_urls'] = $nav['actions']; $this->data['variant_urls'] = $nav['variants']; - // Build additional attributes for personal_urls - foreach ( $this->data['personal_urls'] as $key => $item) { - $this->data['personal_urls'][$key]['attributes'] = - ' id="' . Sanitizer::escapeId( "pt-$key" ) . '"'; - if ( isset( $item['active'] ) && $item['active'] ) { - $this->data['personal_urls'][$key]['attributes'] .= - ' class="active"'; - } - $this->data['personal_urls'][$key]['key'] = - $this->skin->tooltipAndAccesskey('pt-'.$key); - } - // Generate additional footer links - $footerlinks = $this->data["footerlinks"]; - - // Reduce footer links down to only those which are being used - $validFooterLinks = array(); - foreach( $footerlinks as $category => $links ) { - $validFooterLinks[$category] = array(); - foreach( $links as $link ) { - if( isset( $this->data[$link] ) && $this->data[$link] ) { - $validFooterLinks[$category][] = $link; - } - } - } - - // Generate additional footer icons - $footericons = $this->data["footericons"]; - // Unset any icons which don't have an image - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) { - if ( !is_string($footerIcon) && !isset($footerIcon["src"]) ) { - unset($footerIconsBlock[$footerIconKey]); - } - } - } - // Redo removal of any empty blocks - foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) { - if ( count($footerIconsBlock) <= 0 ) { - unset($footericons[$footerIconsKey]); - } - } - // Reverse horizontally rendered navigation elements if ( $wgLang->isRTL() ) { $this->data['view_urls'] = @@ -465,9 +135,9 @@ class VectorTemplate extends QuickTemplate { <div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <!-- content --> - <div id="content"<?php $this->html('specialpageattributes') ?>> + <div id="content"> <a id="top"></a> - <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes') ?>></div> + <div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div> <?php if ( $this->data['sitenotice'] ): ?> <!-- sitenotice --> <div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div> @@ -478,18 +148,20 @@ class VectorTemplate extends QuickTemplate { <!-- /firstHeading --> <!-- bodyContent --> <div id="bodyContent"> + <?php if ( $this->data['isarticle'] ): ?> <!-- tagline --> <div id="siteSub"><?php $this->msg( 'tagline' ) ?></div> <!-- /tagline --> + <?php endif; ?> <!-- subtitle --> - <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div> + <div id="contentSub"<?php $this->html( 'userlangattributes' ) ?>><?php $this->html( 'subtitle' ) ?></div> <!-- /subtitle --> <?php if ( $this->data['undelete'] ): ?> <!-- undelete --> <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div> <!-- /undelete --> <?php endif; ?> - <?php if($this->data['newtalk'] ): ?> + <?php if( $this->data['newtalk'] ): ?> <!-- newtalk --> <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div> <!-- /newtalk --> @@ -502,9 +174,16 @@ class VectorTemplate extends QuickTemplate { </div> <!-- /jumpto --> <?php endif; ?> - <!-- bodytext --> - <?php $this->html( 'bodytext' ) ?> - <!-- /bodytext --> + <!-- bodycontent --> + <?php $this->html( 'bodycontent' ) ?> + <!-- /bodycontent --> + <?php if ( $this->data['printfooter'] ): ?> + <!-- printfooter --> + <div class="printfooter"> + <?php $this->html( 'printfooter' ); ?> + </div> + <!-- /printfooter --> + <?php endif; ?> <?php if ( $this->data['catlinks'] ): ?> <!-- catlinks --> <?php $this->html( 'catlinks' ); ?> @@ -516,6 +195,9 @@ class VectorTemplate extends QuickTemplate { <!-- /dataAfterContent --> <?php endif; ?> <div class="visualClear"></div> + <!-- debughtml --> + <?php $this->html( 'debughtml' ); ?> + <!-- /debughtml --> </div> <!-- /bodyContent --> </div> @@ -534,28 +216,25 @@ class VectorTemplate extends QuickTemplate { <!-- panel --> <div id="mw-panel" class="noprint"> <!-- logo --> - <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey( 'p-logo' ) ?>></a></div> + <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>></a></div> <!-- /logo --> <?php $this->renderPortals( $this->data['sidebar'] ); ?> </div> <!-- /panel --> <!-- footer --> - <div id="footer"<?php $this->html('userlangattributes') ?>> - <?php foreach( $validFooterLinks as $category => $links ): ?> - <?php if ( count( $links ) > 0 ): ?> + <div id="footer"<?php $this->html( 'userlangattributes' ) ?>> + <?php foreach( $this->getFooterLinks() as $category => $links ): ?> <ul id="footer-<?php echo $category ?>"> <?php foreach( $links as $link ): ?> - <?php if( isset( $this->data[$link] ) && $this->data[$link] ): ?> <li id="footer-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li> - <?php endif; ?> <?php endforeach; ?> </ul> - <?php endif; ?> <?php endforeach; ?> -<?php if ( count( $footericons ) > 0 ): ?> + <?php $footericons = $this->getFooterIcons("icononly"); + if ( count( $footericons ) > 0 ): ?> <ul id="footer-icons" class="noprint"> <?php foreach ( $footericons as $blockName => $footerIcons ): ?> - <li id="footer-<?php echo htmlspecialchars($blockName); ?>ico"> + <li id="footer-<?php echo htmlspecialchars( $blockName ); ?>ico"> <?php foreach ( $footerIcons as $icon ): ?> <?php echo $this->skin->makeFooterIcon( $icon ); ?> @@ -567,14 +246,11 @@ class VectorTemplate extends QuickTemplate { <div style="clear:both"></div> </div> <!-- /footer --> - <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?> <!-- fixalpha --> - <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script> + <script type="<?php $this->text( 'jsmimetype' ) ?>"> if ( window.isMSIE55 ) fixalpha(); </script> <!-- /fixalpha --> - <?php $this->html( 'reporttime' ) ?> - <?php if ( $this->data['debug'] ): ?> - <!-- Debug output: <?php $this->text( 'debug' ); ?> --> - <?php endif; ?> + <?php $this->printTrail(); ?> + </body> </html> <?php @@ -582,96 +258,75 @@ class VectorTemplate extends QuickTemplate { /** * Render a series of portals + * + * @param $portals array */ private function renderPortals( $portals ) { // Force the rendering of the following portals - if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true; - if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true; - if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true; + if ( !isset( $portals['SEARCH'] ) ) { + $portals['SEARCH'] = true; + } + if ( !isset( $portals['TOOLBOX'] ) ) { + $portals['TOOLBOX'] = true; + } + if ( !isset( $portals['LANGUAGES'] ) ) { + $portals['LANGUAGES'] = true; + } // Render portals foreach ( $portals as $name => $content ) { + if ( $content === false ) + continue; + echo "\n<!-- {$name} -->\n"; switch( $name ) { case 'SEARCH': break; case 'TOOLBOX': -?> -<div class="portal" id="p-tb"> - <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5> - <div class="body"> - <ul> - <?php if( $this->data['notspecialpage'] ): ?> - <li id="t-whatlinkshere"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['whatlinkshere']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-whatlinkshere' ) ?>><?php $this->msg( 'whatlinkshere' ) ?></a></li> - <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?> - <li id="t-recentchangeslinked"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['recentchangeslinked']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-recentchangeslinked' ) ?>><?php $this->msg( 'recentchangeslinked-toolbox' ) ?></a></li> - <?php endif; ?> - <?php endif; ?> - <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?> - <li id="t-trackbacklink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['trackbacklink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-trackbacklink' ) ?>><?php $this->msg( 'trackbacklink' ) ?></a></li> - <?php endif; ?> - <?php if( $this->data['feeds']): ?> - <li id="feedlinks"> - <?php foreach( $this->data['feeds'] as $key => $feed ): ?> - <a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php echo htmlspecialchars( $feed['href'] ) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey( 'feed-' . $key ) ?>><?php echo htmlspecialchars( $feed['text'] ) ?></a> - <?php endforeach; ?> - </li> - <?php endif; ?> - <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?> - <?php if( $this->data['nav_urls'][$special]): ?> - <li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars( $this->data['nav_urls'][$special]['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-' . $special ) ?>><?php $this->msg( $special ) ?></a></li> - <?php endif; ?> - <?php endforeach; ?> - <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?> - <li id="t-print"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['print']['href'] ) ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey( 't-print' ) ?>><?php $this->msg( 'printableversion' ) ?></a></li> - <?php endif; ?> - <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?> - <li id="t-permalink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['permalink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-permalink' ) ?>><?php $this->msg( 'permalink' ) ?></a></li> - <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?> - <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li> - <?php endif; ?> - <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?> - </ul> - </div> -</div> -<?php + $this->renderPortal( 'tb', $this->getToolbox(), 'toolbox', 'SkinTemplateToolboxEnd' ); break; case 'LANGUAGES': if ( $this->data['language_urls'] ) { -?> -<div class="portal" id="p-lang"> - <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5> - <div class="body"> - <ul> - <?php foreach ( $this->data['language_urls'] as $langlink ): ?> - <li class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href="<?php echo htmlspecialchars( $langlink['href'] ) ?>" title="<?php echo htmlspecialchars( $langlink['title'] ) ?>"><?php echo $langlink['text'] ?></a></li> - <?php endforeach; ?> - </ul> - </div> -</div> -<?php + $this->renderPortal( 'lang', $this->data['language_urls'], 'otherlanguages' ); } break; default: -?> -<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>> - <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?></h5> + $this->renderPortal( $name, $content ); + break; + } + echo "\n<!-- /{$name} -->\n"; + } + } + + private function renderPortal( $name, $content, $msg = null, $hook = null ) { + if ( !isset( $msg ) ) { + $msg = $name; + } + ?> +<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::tooltip( 'p-' . $name ) ?>> + <h5<?php $this->html( 'userlangattributes' ) ?>><?php $msgObj = wfMessage( $msg ); echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); ?></h5> <div class="body"> - <?php if ( is_array( $content ) ): ?> +<?php + if ( is_array( $content ) ): ?> <ul> - <?php foreach( $content as $val ): ?> - <li id="<?php echo Sanitizer::escapeId( $val['id'] ) ?>"<?php if ( $val['active'] ): ?> class="active" <?php endif; ?>><a href="<?php echo htmlspecialchars( $val['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( $val['id'] ) ?>><?php echo htmlspecialchars( $val['text'] ) ?></a></li> - <?php endforeach; ?> +<?php + foreach( $content as $key => $val ): ?> + <?php echo $this->makeListItem( $key, $val ); ?> + +<?php + endforeach; + if ( isset( $hook ) ) { + wfRunHooks( $hook, array( &$this, true ) ); + } + ?> </ul> - <?php else: ?> +<?php + else: ?> <?php echo $content; /* Allow raw HTML block to be defined by extensions */ ?> - <?php endif; ?> +<?php + endif; ?> </div> </div> <?php - break; - } - echo "\n<!-- /{$name} -->\n"; - } } /** @@ -679,14 +334,14 @@ class VectorTemplate extends QuickTemplate { * when UI is in RTL mode */ private function renderNavigation( $elements ) { - global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser; + global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang; // If only one element was given, wrap it in an array, allowing more // flexible arguments if ( !is_array( $elements ) ) { $elements = array( $elements ); // If there's a series of elements, reverse them when in RTL mode - } else if ( wfUILang()->isRTL() ) { + } elseif ( $wgLang->isRTL() ) { $elements = array_reverse( $elements ); } // Render elements @@ -696,9 +351,9 @@ class VectorTemplate extends QuickTemplate { case 'NAMESPACES': ?> <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>"> - <h5><?php $this->msg('namespaces') ?></h5> - <ul<?php $this->html('userlangattributes') ?>> - <?php foreach ($this->data['namespace_urls'] as $link ): ?> + <h5><?php $this->msg( 'namespaces' ) ?></h5> + <ul<?php $this->html( 'userlangattributes' ) ?>> + <?php foreach ( $this->data['namespace_urls'] as $link ): ?> <li <?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></span></li> <?php endforeach; ?> </ul> @@ -717,9 +372,9 @@ class VectorTemplate extends QuickTemplate { <?php endforeach; ?> </h4> <?php endif; ?> - <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5> + <h5><span><?php $this->msg( 'variants' ) ?></span><a href="#"></a></h5> <div class="menu"> - <ul<?php $this->html('userlangattributes') ?>> + <ul<?php $this->html( 'userlangattributes' ) ?>> <?php foreach ( $this->data['variant_urls'] as $link ): ?> <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> <?php endforeach; ?> @@ -730,11 +385,16 @@ class VectorTemplate extends QuickTemplate { break; case 'VIEWS': ?> -<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>"> +<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>"> <h5><?php $this->msg('views') ?></h5> <ul<?php $this->html('userlangattributes') ?>> <?php foreach ( $this->data['view_urls'] as $link ): ?> - <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ? '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : htmlspecialchars( $link['text'] ) ) ?></a></span></li> + <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php + // $link['text'] can be undefined - bug 27764 + if ( array_key_exists( 'text', $link ) ) { + echo array_key_exists( 'img', $link ) ? '<img src="' . $link['img'] . '" alt="' . $link['text'] . '" />' : htmlspecialchars( $link['text'] ); + } + ?></a></span></li> <?php endforeach; ?> </ul> </div> @@ -743,10 +403,10 @@ class VectorTemplate extends QuickTemplate { case 'ACTIONS': ?> <div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>"> - <h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5> + <h5><span><?php $this->msg( 'actions' ) ?></span><a href="#"></a></h5> <div class="menu"> - <ul<?php $this->html('userlangattributes') ?>> - <?php foreach ($this->data['action_urls'] as $link ): ?> + <ul<?php $this->html( 'userlangattributes' ) ?>> + <?php foreach ( $this->data['action_urls'] as $link ): ?> <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> <?php endforeach; ?> </ul> @@ -757,11 +417,12 @@ class VectorTemplate extends QuickTemplate { case 'PERSONAL': ?> <div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>"> - <h5><?php $this->msg('personaltools') ?></h5> - <ul<?php $this->html('userlangattributes') ?>> - <?php foreach($this->data['personal_urls'] as $item): ?> - <li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li> - <?php endforeach; ?> + <h5><?php $this->msg( 'personaltools' ) ?></h5> + <ul<?php $this->html( 'userlangattributes' ) ?>> +<?php foreach( $this->getPersonalTools() as $key => $item ) { ?> + <?php echo $this->makeListItem( $key, $item ); ?> + +<?php } ?> </ul> </div> <?php @@ -769,23 +430,23 @@ class VectorTemplate extends QuickTemplate { case 'SEARCH': ?> <div id="p-search"> - <h5<?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> + <h5<?php $this->html( 'userlangattributes' ) ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?> <div id="simpleSearch"> <?php if ( $this->data['rtl'] ): ?> - <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-rtl.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button> + <?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->skin->getSkinStylePath( 'images/search-rtl.png' ) ) ); ?> <?php endif; ?> - <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> /> + <?php echo $this->makeSearchInput( array( 'id' => 'searchInput', 'type' => 'text' ) ); ?> <?php if ( !$this->data['rtl'] ): ?> - <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-ltr.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button> + <?php echo $this->makeSearchButton( 'image', array( 'id' => 'searchButton', 'src' => $this->skin->getSkinStylePath( 'images/search-ltr.png' ) ) ); ?> <?php endif; ?> </div> <?php else: ?> - <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> /> - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /> - <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /> + <?php echo $this->makeSearchInput( array( 'id' => 'searchInput' ) ); ?> + <?php echo $this->makeSearchButton( 'go', array( 'id' => 'searchGoButton', 'class' => 'searchButton' ) ); ?> + <?php echo $this->makeSearchButton( 'fulltext', array( 'id' => 'mw-searchButton', 'class' => 'searchButton' ) ); ?> <?php endif; ?> </form> </div> diff --git a/skins/archlinux/IE60Fixes.css b/skins/archlinux/IE60Fixes.css index 56e0a16b..3bcd0479 100644 --- a/skins/archlinux/IE60Fixes.css +++ b/skins/archlinux/IE60Fixes.css @@ -11,16 +11,33 @@ div#column-content div#content { margin-top: 3em; height: 1%; } +.rtl div#column-content div#content { + margin-right: 12.2em; + margin-left: 0; +} div#column-one { position: absolute; top: 0; left: 0; z-index: 4; } +.rtl div#column-one { + left: auto; + right: 0; +} div#footer { margin-left: 13.6em; border-left: 1px solid #fabd23; } +.rtl div#footer { + margin-left: 0; + margin-right: 13.6em; + border-left: none; + border-right: 1px solid #fabd23; +} + + /* the tabs */ + /* the tabs */ @@ -85,7 +102,6 @@ textarea { width: 96%; } -div.editsection, #catlinks, div.tright, div.tleft { diff --git a/skins/archlinux/IE70Fixes.css b/skins/archlinux/IE70Fixes.css index 91b39efd..fc009e6e 100644 --- a/skins/archlinux/IE70Fixes.css +++ b/skins/archlinux/IE70Fixes.css @@ -9,6 +9,9 @@ div#column-content div#content { height: 1%; } +.rtl div#column-content div#content { margin-right: 12.2em; margin-left: 0; } + + .rtl div#column-one { /* For some reason it tries to inherit the padding-top into every div, * and I can't figure out how to get it back off. @@ -18,9 +21,13 @@ div#column-content div#content { margin-top: 160px; } -.rtl #bodyContent a.external { - background-image: url(external-rtl.png); - padding: 0 13px 0 0; +/* These elements also have padding-left: 20px; in main.css, but in RTL mode this is flipped. + * That's good in normal browsers, but in IE7 it needs to not be flipped for some daft reason. + * Also clear the right margin (originally margin-left: 1em) + */ +li#pt-userpage, li#pt-anonuserpage, li#pt-login { + padding-left: 20px; + margin-right: 0; } .rtl a.feedlink { @@ -69,7 +76,6 @@ textarea { } /* -div.editsection, #catlinks, div.tright, div.tleft { diff --git a/skins/archlinux/external.png b/skins/archlinux/external-ltr.png Binary files differindex acf260fc..acf260fc 100644 --- a/skins/archlinux/external.png +++ b/skins/archlinux/external-ltr.png diff --git a/skins/archlinux/main.css b/skins/archlinux/main.css index d2330eba..edf79abb 100644 --- a/skins/archlinux/main.css +++ b/skins/archlinux/main.css @@ -41,10 +41,13 @@ div#content { body { font: x-small sans-serif; + /* @embed */ background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; color: black; margin: 0; padding: 0; + direction: ltr; /* Needed for RTL flipping */ + unicode-bidi: embed; } /* scale back up to a sane default */ @@ -136,6 +139,7 @@ ul { list-style-type: square; margin: .3em 0 0 1.5em; padding: 0; + /* @embed */ list-style-image: url(bullet.gif); } ol { @@ -263,6 +267,7 @@ span.subpages { vertical-align: middle; } #siteNotice { + position: relative; text-align: center; font-size: 95%; padding: 0 0.9em; @@ -306,7 +311,7 @@ in the bottom-right corner of the content area */ margin-right: auto; } /* small for tables and similar */ -.small, .small * { +.small { font-size: 94%; } table.small { @@ -344,7 +349,7 @@ table.small { list-style-type: none; list-style-image: none; margin-left: 0; - padding-left: 0; + padding: 0; text-align: left; } #toc ul ul, @@ -363,10 +368,7 @@ table.small { } /* images */ -div.floatright, table.floatright { - clear: right; - float: right; - position: relative; +/* @noflip */div.floatright, table.floatright { margin: 0 0 .5em .5em; border: 0; /* @@ -375,10 +377,7 @@ div.floatright, table.floatright { */ } div.floatright p { font-style: italic; } -div.floatleft, table.floatleft { - float: left; - clear: left; - position: relative; +/* @noflip */div.floatleft, table.floatleft { margin: 0 .5em .5em 0; border: 0; /* @@ -421,22 +420,15 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } -div.tright { - clear: right; - float: right; +/* @noflip */div.tright { margin: .5em 0 1.3em 1.4em; } -div.tleft { - float: left; - clear: left; +/* @noflip */div.tleft { margin: .5em 1.4em 1.3em 0; } img.thumbborder { border: 1px solid #dddddd; } -.hiddenStructure { - display: none; -} /* ** classes for special content elements like town boxes @@ -476,36 +468,39 @@ table.rimage { */ #bodyContent a.external, #bodyContent a.external[href ^="gopher://"] { - background: url(external.png) center right no-repeat; - padding: 0 13px; -} -.rtl #bodyContent a.external, -.rtl #bodyContent a.external[href ^="gopher://"] { - background-image: url(external-rtl.png); + /* @embed */ + background: url(external-ltr.png) center right no-repeat; + padding-right: 13px; } #bodyContent a.external[href ^="https://"], .link-https { + /* @embed */ background: url(lock_icon.gif) center right no-repeat; - padding: 0 16px; + padding-right: 16px; } #bodyContent a.external[href ^="mailto:"], .link-mailto { + /* @embed */ background: url(mail_icon.gif) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href ^="news://"] { + /* @embed */ background: url(news_icon.png) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href ^="ftp://"], .link-ftp { + /* @embed */ background: url(file_icon.gif) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href ^="irc://"], +#bodyContent a.external[href ^="ircs://"], .link-irc { + /* @embed */ background: url(discussionitem_icon.gif) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href $=".ogg"], #bodyContent a.external[href $=".OGG"], #bodyContent a.external[href $=".mid"], #bodyContent a.external[href $=".MID"], @@ -514,49 +509,54 @@ table.rimage { #bodyContent a.external[href $=".wav"], #bodyContent a.external[href $=".WAV"], #bodyContent a.external[href $=".wma"], #bodyContent a.external[href $=".WMA"], .link-audio { + /* @embed */ background: url("audio.png") center right no-repeat; - padding: 0 13px; + padding-right: 13px; } #bodyContent a.external[href $=".ogm"], #bodyContent a.external[href $=".OGM"], #bodyContent a.external[href $=".avi"], #bodyContent a.external[href $=".AVI"], #bodyContent a.external[href $=".mpeg"], #bodyContent a.external[href $=".MPEG"], #bodyContent a.external[href $=".mpg"], #bodyContent a.external[href $=".MPG"], .link-video { + /* @embed */ background: url("video.png") center right no-repeat; - padding: 0 13px; + padding-right: 13px; } #bodyContent a.external[href $=".pdf"], #bodyContent a.external[href $=".PDF"], #bodyContent a.external[href *=".pdf#"], #bodyContent a.external[href *=".PDF#"], #bodyContent a.external[href *=".pdf?"], #bodyContent a.external[href *=".PDF?"], .link-document { + /* @embed */ background: url("document.png") center right no-repeat; - padding: 0 12px; -} - -/* for rtl wikis */ -.rtl #bodyContent a.external { - background-position: left; - padding-right: 0; -} -.rtl a.feedlink { - background-position: right; - padding-right: 16px; - padding-left: 0; + padding-right: 12px; } - -/* correction for ltr wikis */ -.ltr #bodyContent a.external { - padding-left: 0; -} - -/* disable interwiki styling */ + +/* Interwiki Styling */ #bodyContent a.extiw, #bodyContent a.extiw:active { color: #36b; + /* Don't show icons for interwiki links */ + background: none; + padding: 0; } +#bodyContent a.extiw:visited { + color: #636; +} +#bodyContent a.extiw:active { + color: #b63; +} + +/* External links */ #bodyContent a.external { color: #36b; } +#bodyContent a.external:visited { + color: #636; /* bug 3112 */ +} +#bodyContent a.external:active { + color: #b63; +} + /* ** Structural Elements */ @@ -617,6 +617,7 @@ table.rimage { .portlet ul { line-height: 1.5em; list-style-type: square; + /* @embed */ list-style-image: url(bullet.gif); font-size: 95%; } @@ -753,6 +754,7 @@ in bg url to hide it from iemac */ li#pt-userpage, li#pt-anonuserpage, li#pt-login { + /* @embed */ background: url(user.gif) top left no-repeat; padding-left: 20px; text-transform: none; @@ -848,9 +850,6 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print { border: 0; padding: 0; } -#p-cactions .hiddenStructure { - display: none; -} #p-cactions li a { text-transform: lowercase; } @@ -1007,10 +1006,6 @@ div#userlogin form#userlogin2 { background-color: #f9f9f9; float: left; } -.rtl div#userloginForm form, -.rtl div#userlogin form#userlogin2 { - float: right; -} div#userloginForm table, div#userlogin form#userlogin2 table { @@ -1080,7 +1075,6 @@ div#userloginForm .captcha { display: inline; margin-bottom: 0; } -* html div.editsection { font-size: smaller; } #pagehistory li.selected { position: relative; } /* Mac IE 5.0 fix; floated content turns invisible */ @@ -1254,4 +1248,4 @@ div.mw-lag-warn-high { /* Tooltips are outside of the normal body code, so this helps make the size of the text sensible */ .tipsy { font-size: 127%; -}
\ No newline at end of file +} diff --git a/skins/archlinux/print.css b/skins/archlinux/print.css new file mode 100644 index 00000000..a2780f7a --- /dev/null +++ b/skins/archlinux/print.css @@ -0,0 +1,3 @@ +#archnavbar { + display: none; +} diff --git a/skins/archlinux/rtl.css b/skins/archlinux/rtl.css deleted file mode 100644 index 52507676..00000000 --- a/skins/archlinux/rtl.css +++ /dev/null @@ -1,251 +0,0 @@ -/* -Right-to-left fixes for MonoBook. -Places sidebar on right, tweaks various alignment issues. - -Works mostly ok nicely on Safari 1.2.1; fine in Mozilla. - -Safari bugs (1.2.1): -* Tabs are still appearing in left-to-right order. (Try after localizing) - -Opera bugs (7.23 linux): -* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other - -IE/mac bugs: -* The thing barfs on Hebrew and Arabic anyway, so no point testing. - -Missing features due to lack of support: -* external link icons - -To test: -* Opera6 -* IE 5.0 -* etc - -*/ -body { - direction: rtl; - unicode-bidi: embed; -} -div#column-content { - margin: 0 -12.2em 0 0; - float: left; -} -div#column-content div#content{ - margin-left: 0; - margin-right: 12.2em; - border-right: 1px solid #aaaaaa; - border-left: none; -} -html > body .portlet { - float: right; - clear: right; -} -.editsection { - float: left; - margin-right: 5px; - margin-left: 0; /* bug 9122: undo default LTR */ -} -/* recover IEMac (might be fine with the float, but usually it's close to IE */ -*>body .portlet { - float: none; - clear: none; -} -.pBody { - padding-right: 0.8em; - padding-left: 0.5em; -} - -/* Fix alignment */ -.documentByLine, -.portletDetails, -.portletMore, -#p-personal { - text-align: left; -} - -div div.thumbcaption { - text-align: right; -} - -div.magnify, -#p-logo { - left: auto; - right: 0; -} -#p-personal { - left: auto; - right: 0; -} - -#p-cactions { - left: auto; - right: 11.5em; - padding-left: 0; - padding-right: 1em; -} -#p-cactions li { - margin-left: 0.3em; - margin-right: 0; - float: right; -} -* html #p-cactions li a { - display: block; - padding-bottom: 0; -} -* html #p-cactions li a:hover { - padding-bottom: 0.2em; -} -/* offsets to distinguish the tab groups */ -li#ca-talk { - margin-right: auto; - margin-left: 1.6em; -} -li#ca-watch,li#ca-unwatch { - margin-right: 1.6em !important; -} - -/* Fix margins for non-css2 browsers */ -/* top right bottom left */ - -ul { - margin-left: 0; - margin-right: 1.5em; -} -ol { - margin-left: 0; - margin-right: 2.4em; -} -dd { - margin-left: 0; - margin-right: 1.6em; -} -#contentSub { - margin-right: 1em; - margin-left: 0; -} -.tocindent { - margin-left: 0; - margin-right: 2em; -} -div.tright, div.floatright, table.floatright { - clear: none; -} -div.tleft, div.floatleft, table.floatleft { - clear: left; -} -#p-personal li { - margin-left: 0; - margin-right: 1em; -} - -li#ca-talk, -li#ca-watch { - margin-right: auto; - margin-left: 1.6em; -} - -#p-personal li { - float: left; -} -/* Fix link icons -.external, a.feedlink { - padding: 0 !important; - background: none !important; -} -*/ -div#footer { - clear: both; -} -#f-poweredbyico { - float: left; - height: 1%; -} -#f-copyrightico { - float: right; - height: 1%; -} -* html div#footer { - margin-left: 0; - margin-right: 13.6em; - border-left: 0; - border-right: 1px solid #fabd23; -} -* html div#column-content { - float: none; - margin-left: 0; - margin-right: 0; -} -* html div#column-content div#content { - margin-left: 0; - margin-top: 3em; -} -* html div#column-one { right: 0; } - -/* js pref toc */ - -#preftoc { - margin-right: 1em; -} - -.errorbox, .successbox, #preftoc li, .prefsection fieldset { - float: right; -} - -.prefsection { - padding-right: 2em; -} - -/* workaround for moz bug, displayed bullets on left side */ - -#toc ul { - text-align: right; -} - -#toc ul ul { - margin: 0 2em 0 0; -} - -input#wpSave, input#wpDiff { - margin-right: 0; - margin-left: .33em; -} - -#userlogin { - margin: 0 0 1em 3em; -} -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons { - float: left; -} - -.toggle { - margin-left: 0em; - margin-right: 2em; -} -table.filehistory th { - text-align: right; -} - -/* Special:AllPages styling */ -td.mw-allpages-nav, p.mw-allpages-nav, td.mw-allpages-alphaindexline { - text-align: left; -} - -/* Special:PrefixIndex styling */ -td#mw-prefixindex-nav-form { - text-align: left; -} - -/** - * Lists: - * The following lines don't have a visible effect on non-Gecko browsers - * They fix a problem ith Gecko browsers rendering lists to the right of - * left-floated objects in an RTL layout. - */ -html > body div#article ul { - display: table; -} -html > body div#bodyContent ul#filetoc { - display: block; -} diff --git a/skins/chick/main.css b/skins/chick/main.css index 961d1c0a..4501ccd0 100644 --- a/skins/chick/main.css +++ b/skins/chick/main.css @@ -231,7 +231,7 @@ in the bottom-right corner of the content area */ margin-right: auto; } /* small for tables and similar */ -.small, .small * { font-size: 94%; } +.small { font-size: 94%; } table.small { font-size: 100% } /* @@ -245,7 +245,7 @@ table.small { font-size: 100% } padding:5px; font-size: 95%; } -#toc ul { margin-left: 2em; } +#toc ul { margin: 0 2em; } #toc .toctoggle { font-size: 94%; } #toc .editsection { margin-top: 0.7em; @@ -253,20 +253,14 @@ table.small { font-size: 100% } } /* images */ -div.floatright, table.floatright { - clear: right; - float: right; +/* @noflip */div.floatright, table.floatright { margin: 0; - position: relative; border: 0.5em solid white; border-width: 0.5em 0 0.8em 1.4em; } div.floatright p { font-style: italic; } -div.floatleft, table.floatleft { - float: left; - clear: left; +/* @noflip */div.floatleft, table.floatleft { margin: 0.3em 0.5em 0.5em 0; - position: relative; border: 0.5em solid white; border-width: 0.5em 1.4em 0.8em 0; } @@ -303,24 +297,16 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } -div.tright { - clear: right; - float: right; +/* @noflip */div.tright { margin: 0.5em 0 1.3em 1.4em; } -div.tleft { - float: left; - clear: left; +/* @noflip */div.tleft { margin: 0.5em 1.4em 1.3em 0; } img.thumbborder { border: 1px solid #dddddd; } -.hiddenStructure { - display: none; -} - /* ** classes for special content elements like town boxes ** intended to be referenced directly from the wiki src diff --git a/skins/common/cologneblue.css b/skins/cologneblue/screen.css index c7b6eac1..03504b99 100644 --- a/skins/common/cologneblue.css +++ b/skins/cologneblue/screen.css @@ -96,10 +96,30 @@ td.top a { font-size: 10pt; } +td#top-syslinks { + text-align: right; + vertical-align: bottom; +} +td.top-linkcollection { + text-align: right; +} +td.top-subheader { + vertical-align: top; +} + +/** + * Overrides text justification (user preference) + * See bug 31990 + */ +td.top-linkcollection #catlinks { + text-align: right; +} td.bottom { font-family: Verdana, Arial, sans-serif; font-size: 10pt; padding: 0; + text-align: center; + vertical-align: bottom; } #pagestats { @@ -207,4 +227,4 @@ small { input.mw-searchInput { width: 106px; -}
\ No newline at end of file +} diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js index ba4dc66b..7f3b9c0f 100644 --- a/skins/common/IEFixes.js +++ b/skins/common/IEFixes.js @@ -69,9 +69,9 @@ window.relativeforfloats = function() { if ( bc ) { var tables = bc.getElementsByTagName( 'table' ); var divs = bc.getElementsByTagName( 'div' ); + setrelative( tables ); + setrelative( divs ); } - setrelative( tables ); - setrelative( divs ); }; window.setrelative = function( nodes ) { diff --git a/skins/common/Makefile b/skins/common/Makefile deleted file mode 100644 index 56e60bd4..00000000 --- a/skins/common/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -jquery.min.js: jquery.js - php ../../maintenance/minify.php $< --outfile $@ diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 1cad75ed..2a93373f 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -154,8 +154,6 @@ window.sajax_do_call = function(func_name, args, target) { } else { alert( 'bad target for sajax_do_call: not a function or object: ' + target ); } - - return; }; sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data ); diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js deleted file mode 100644 index aaf6360c..00000000 --- a/skins/common/ajaxwatch.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Animate watch/unwatch links to use asynchronous API requests to - * watch pages, rather than clicking on links. Requires jQuery. - * Uses jsMsg() from wikibits.js. - */ - -if ( typeof wgAjaxWatch === 'undefined' || !wgAjaxWatch ) { - window.wgAjaxWatch = { }; -} - -wgAjaxWatch.setLinkText = function( $link, action ) { - if ( action == 'watch' || action == 'unwatch' ) { - // save the accesskey from the title - var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ ) ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0] : ''; - $link.attr( 'title', mediaWiki.msg( 'tooltip-ca-' + action ) + ' ' + keyCommand ); - } - if ( $link.data( 'icon' ) ) { - $link.attr( 'alt', mediaWiki.msg( action ) ); - if ( action == 'watching' || action == 'unwatching' ) { - $link.addClass( 'loading' ); - } else { - $link.removeClass( 'loading' ); - } - } else { - $link.html( mediaWiki.msg( action ) ); - } -}; - -wgAjaxWatch.processResult = function( response ) { - response = response.watch; - var $link = $( this ); - // To ensure we set the same status for all watch links with the - // same target we trigger a custom event on *all* watch links. - if( response.watched !== undefined ) { - wgAjaxWatch.$links.trigger( 'mw-ajaxwatch', [response.title, 'watch'] ); - } else if ( response.unwatched !== undefined ) { - wgAjaxWatch.$links.trigger( 'mw-ajaxwatch', [response.title, 'unwatch'] ); - } else { - // Either we got an error code or it just plain broke. - window.location.href = $link.attr( 'href' ); - return; - } - - jsMsg( response.message, 'watch' ); - - // Bug 12395 - update the watch checkbox on edit pages when the - // page is watched or unwatched via the tab. - if( response.watched !== undefined ) { - $( '#wpWatchthis' ).attr( 'checked', '1' ); - } else { - $( '#wpWatchthis' ).removeAttr( 'checked' ); - } -}; - -$( document ).ready( function() { - var $links = $( '.mw-watchlink a, a.mw-watchlink' ); - // BC with older skins - $links = $links - .add( $( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) ) - .add( $( 'a#mw-unwatch-link2, a#mw-watch-link2, a#mw-watch-link1' ) ); - // allowing people to add inline animated links is a little scary - $links = $links.filter( ':not( #bodyContent *, #content * )' ); - - $links.each( function() { - var $link = $( this ); - $link - .data( 'icon', $link.parents( 'li' ).hasClass( 'icon' ) ) - .data( 'action', $link.attr( 'href' ).match( /[\?&]action=unwatch/i ) ? 'unwatch' : 'watch' ); - var title = $link.attr( 'href' ).match( /[\?&]title=(.*?)&/i )[1]; - $link.data( 'target', decodeURIComponent( title ).replace( /_/g, ' ' ) ); - }); - - $links.click( function( event ) { - var $link = $( this ); - - if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) { - // Lazy initialization so we don't toss up - // ActiveX warnings on initial page load - // for IE 6 users with security settings. - wgAjaxWatch.$links.unbind( 'click' ); - return true; - } - - wgAjaxWatch.setLinkText( $link, $link.data( 'action' ) + 'ing' ); - $.get( wgScriptPath - + '/api' + wgScriptExtension + '?action=watch&format=json&title=' - + encodeURIComponent( $link.data( 'target' ) ) - + ( $link.data( 'action' ) == 'unwatch' ? '&unwatch' : '' ), - {}, - wgAjaxWatch.processResult, - 'json' - ); - - return false; - }); - - // When a request returns, a custom event 'mw-ajaxwatch' is triggered - // on *all* watch links, so they can be updated if necessary - $links.bind( 'mw-ajaxwatch', function( event, target, action ) { - var $link = $( this ); - var foo = $link.data( 'target' ); - if( $link.data( 'target' ) == target ) { - var otheraction = action == 'watch' - ? 'unwatch' - : 'watch'; - - $link.data( 'action', otheraction ); - wgAjaxWatch.setLinkText( $link, otheraction ); - $link.attr( 'href', $link.attr( 'href' ).replace( '/&action=' + action + '/', '&action=' + otheraction ) ); - if( $link.parents( 'li' ).attr( 'id' ) == 'ca-' + action ) { - $link.parents( 'li' ).attr( 'id', 'ca-' + otheraction ); - // update the link text with the new message - $link.text( mediaWiki.msg( otheraction ) ); - } - }; - return false; - }); - - wgAjaxWatch.$links = $links; -}); diff --git a/skins/common/block.js b/skins/common/block.js deleted file mode 100644 index fb86cbd6..00000000 --- a/skins/common/block.js +++ /dev/null @@ -1,89 +0,0 @@ -// @TODO: find some better JS file for this -// Note: borrows from IP.php -window.isIPv4Address = function( address, allowBlock ) { - var block = allowBlock ? '(?:\\/(?:3[0-2]|[12]?\\d))?' : ''; - var RE_IP_BYTE = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|0?[0-9]?[0-9])'; - var RE_IP_ADD = '(?:' + RE_IP_BYTE + '\\.){3}' + RE_IP_BYTE; - return address.search( new RegExp( '^' + RE_IP_ADD + block + '$' ) ) != -1; -}; - -// @TODO: find some better JS file for this -// Note: borrows from IP.php -window.isIPv6Address = function( address, allowBlock ) { - var block = allowBlock ? '(?:\\/(?:12[0-8]|1[01][0-9]|[1-9]?\\d))?' : ''; - var RE_IPV6_ADD = - '(?:' + // starts with "::" (including "::") - ':(?::|(?::' + '[0-9A-Fa-f]{1,4}' + '){1,7})' + - '|' + // ends with "::" (except "::") - '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){0,6}::' + - '|' + // contains no "::" - '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){7}' + - ')'; - if ( address.search( new RegExp( '^' + RE_IPV6_ADD + block + '$' ) ) != -1 ) { - return true; - } - var RE_IPV6_ADD = // contains one "::" in the middle (single '::' check below) - '[0-9A-Fa-f]{1,4}' + '(?:::?' + '[0-9A-Fa-f]{1,4}' + '){1,6}'; - return address.search( new RegExp( '^' + RE_IPV6_ADD + block + '$' ) ) != -1 - && address.search( /::/ ) != -1 && address.search( /::.*::/ ) == -1; -}; - -window.considerChangingExpiryFocus = function() { - if ( !document.getElementById ) { - return; - } - var drop = document.getElementById( 'wpBlockExpiry' ); - if ( !drop ) { - return; - } - var field = document.getElementById( 'wpBlockOther' ); - if ( !field ) { - return; - } - var opt = drop.value; - if ( opt == 'other' ) { - field.style.display = ''; - } else { - field.style.display = 'none'; - } -}; - -window.updateBlockOptions = function() { - if ( !document.getElementById ) { - return; - } - - var target = document.getElementById( 'mw-bi-target' ); - if ( !target ) { - return; - } - - var addy = target.value.replace( /(^\s*|\s*$)/, '' ); // trim - var isEmpty = (addy == ""); - - var isIp = isIPv4Address( addy, true ) || isIPv6Address( addy, true ); - var isIpRange = isIp && addy.match(/\/\d+$/); - - var anonymousRow = document.getElementById( 'wpAnonOnlyRow' ); - if( anonymousRow ) { - anonymousRow.style.display = ( !isIp && !isEmpty ) ? 'none' : ''; - } - - var autoblockRow = document.getElementById( 'wpEnableAutoblockRow' ); - if( autoblockRow ) { - autoblockRow.style.display = isIp && !isEmpty ? 'none' : ''; - } - - var hideuserRow = document.getElementById( 'wpEnableHideUser' ); - if( hideuserRow ) { - hideuserRow.style.display = isIp && !isEmpty ? 'none' : ''; - } - - var watchuserRow = document.getElementById( 'wpEnableWatchUser' ); - if( watchuserRow ) { - watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : ''; - } -}; - -addOnloadHook( updateBlockOptions ); -addOnloadHook( considerChangingExpiryFocus ); diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 56203aa4..58703a33 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -78,11 +78,13 @@ html .thumbcaption { div.magnify { display: none; } +/* @noflip */ div.tright { float: right; clear: right; margin: 0.5em 0 0.8em 1.4em; } +/* @noflip */ div.tleft { float: left; clear: left; @@ -139,11 +141,14 @@ ul { border: none ! important; padding: 0 ! important; margin: 0 ! important; + direction: ltr; } #footer { background : white; color : black; - border-top: 1px solid black; + margin-top: 1em; + border-top: 1px solid #AAA; + direction: ltr; } h1, h2, h3, h4, h5, h6 { @@ -235,7 +240,6 @@ span.texhtml { font-family: serif; } /* Galleries (see shared.css for more info) */ li.gallerybox { vertical-align: top; - background-color: #f9f9f9; border: solid 2px white; display: -moz-inline-box; display: inline-block; @@ -341,3 +345,31 @@ p { widows: 3; orphans: 3; } + +/** + * Categories + */ +.catlinks ul { + display: inline; + margin: 0px; + list-style: none; + list-style-type: none; + list-style-image: none; + vertical-align: middle !ie; +} + +.catlinks li { + display: inline-block; + line-height: 1.15em; + padding: 0 .4em; + border-left: 1px solid #AAA; + margin: 0.1em 0; + zoom: 1; + display: inline !ie; +} + +.catlinks li:first-child { + padding-left: .2em; + border-left: none; +} + diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css deleted file mode 100644 index a0c485f0..00000000 --- a/skins/common/common_rtl.css +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file contains CSS settings common to RTL wikis use the old - * pre-Monobook skins Wikistandard, Nostalgia and CologneBlue - * NOTE: This file is not used in Monobook! - */ - -/* js pref toc */ -#preftoc { float: right; } -/* workaround for moz bug, displayed bullets on left side */ -#preftoc li { list-style: none; } -#prefcontrol { float: right; } -fieldset.prefsection, -fieldset.operaprefsection { - margin-left: 0; - margin-right: 18em; -} -/* page history */ -#pagehistory .history-user { - margin-right: 1.4em; - margin-left: 0.4em; -} -.editsection { - float: left; - margin-right: 5px; -} -div.tright, div.floatright { - clear: none; -} -div.tleft, div.floatleft { - clear: left; -} -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons, -p.mw-revdel-editreasons { - float: left; -} -table.filehistory th { - text-align: right; -} - -/** - * Lists: - * The following lines don't have a visible effect on non-Gecko browsers - * They fix a problem ith Gecko browsers rendering lists to the right of - * left-floated objects in an RTL layout. - */ -html > body div#article ul { - display: table; -} -html > body div#bodyContent ul#filetoc { - display: block; -} - -/* feed links */ -a.feedlink { - background: none !important; - padding-left: 0 !important; -} diff --git a/skins/common/config.css b/skins/common/config.css index 341a9038..434f27d5 100644 --- a/skins/common/config.css +++ b/skins/common/config.css @@ -68,24 +68,6 @@ .config-error-box { border: 2px solid #f00; - margin: 0.4em; - clear: left; -} - -.config-warning-box { - border: 2px solid #ff7f00; - margin: 0.4em; - clear: left; -} - -.config-info-left { - margin: 7px; - float: left; - width: 35px; -} - -.config-info-right { - margin: 0.5em 0.5em 0.5em 49px; } .config-page-current { @@ -159,6 +141,6 @@ margin-left: 2em; } -#config-update-log { - width: 75%; +#config-live-log { + margin-right: 18em; } diff --git a/skins/common/config.js b/skins/common/config.js index 511966ad..e5af7d14 100644 --- a/skins/common/config.js +++ b/skins/common/config.js @@ -29,7 +29,7 @@ } ); // Scroll to the bottom of upgrade log - $( "#config-update-log" ).each( function() { this.scrollTop = this.scrollHeight; } ); + $( '#config-live-log' ).find( '> textarea' ).each( function() { this.scrollTop = this.scrollHeight; } ); // Show/hide Creative Commons thingy $( '.licenseRadio' ).click( function() { diff --git a/skins/common/diff.css b/skins/common/diff.css deleted file mode 100644 index 80286d8e..00000000 --- a/skins/common/diff.css +++ /dev/null @@ -1,75 +0,0 @@ -/* -** Diff rendering -*/ -table.diff, td.diff-otitle, td.diff-ntitle { - background-color: white; -} -td.diff-otitle, -td.diff-ntitle { - text-align: center; -} -td.diff-marker { - text-align: right; -} -td.diff-lineno { - font-weight: bold; -} -td.diff-addedline { - background: #cfc; - font-size: smaller; -} -td.diff-deletedline { - background: #ffa; - font-size: smaller; -} -td.diff-context { - background: #eee; - font-size: smaller; -} -.diffchange { - color: red; - font-weight: bold; - text-decoration: none; - white-space: pre-wrap; - white-space: -moz-pre-wrap; -} - -table.diff { - border: none; - width: 98%; - border-spacing: 4px; - - /* Fixed layout is required to ensure that cells containing long URLs - don't widen in Safari, Internet Explorer, or iCab */ - table-layout: fixed; -} -table.diff td { - padding: 0; -} -table.diff col.diff-marker { - width: 2%; -} -table.diff col.diff-content { - width: 48%; -} -table.diff td div { - /* Force-wrap very long lines such as URLs or page-widening char strings. - CSS 3 only (In Gecko 1.9.1 / Firefox 3.5): - https://bugzilla.mozilla.org/show_bug.cgi?id=99457 - https://developer.mozilla.org/web-tech/2008/08/20/word-wrap-break-word/ - https://developer.mozilla.org/En/CSS/Word-wrap */ - word-wrap: break-word; - - /* As fallback, scrollbars will be added for very wide cells - instead of text overflowing or widening */ - overflow: auto; - - /* The above rule breaks on very old versions of Mozilla due - to a bug which collapses the table cells to a single line. - - In Mozilla 1.1 and below with JavaScript enabled, the rule - will be overridden with this by diff.js; wide cell contents - then spill horizontally without widening the rest of the - table: */ - /* overflow: visible; */ -} diff --git a/skins/common/diff.js b/skins/common/diff.js deleted file mode 100644 index 5fd151fc..00000000 --- a/skins/common/diff.js +++ /dev/null @@ -1,20 +0,0 @@ -/* -Workaround for overflow bug in Mozilla 1.1 and earlier, where scrolling -<div>s in <td> cells collapse their height to a single line. - -Known to be fixed in 1.2.1 (Gecko 20021130), but the CSS hacks I've tried -with overflow-x disable the scrolling all the way until Mozilla 1.8 / FF 1.5 -and break Opera as well. - -So... we check for reaaaally old Gecko and hack in an alternate rule to let -the wide cells spill instead of scrolling them. Not ideal as it won't work -if JS is disabled, of course. -*/ - -if (navigator && navigator.product == "Gecko" && navigator.productSub < "20021130") { - var sheets = document.styleSheets; - var lastSheet = sheets[sheets.length-1]; - lastSheet.insertRule( - "table.diff td div { overflow: visible; }", - lastSheet.cssRules.length); -} diff --git a/skins/common/edit.js b/skins/common/edit.js deleted file mode 100644 index f986c854..00000000 --- a/skins/common/edit.js +++ /dev/null @@ -1,231 +0,0 @@ -window.currentFocused = undefined; - -// this function adds a toolbar button to the mwEditButtons list -window.addButton = function( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ) { - // Don't generate buttons for browsers which don't fully - // support it. - mwEditButtons.push({ - 'imageId': imageId, - 'imageFile': imageFile, - 'speedTip': speedTip, - 'tagOpen': tagOpen, - 'tagClose': tagClose, - 'sampleText': sampleText - }); -}; - -// this function adds one toolbar button from a mwEditButtons/mwCustomEditButtons item -window.mwInsertEditButton = function( parent, item ) { - var image = document.createElement( 'img' ); - image.width = 23; - image.height = 22; - image.className = 'mw-toolbar-editbutton'; - if ( item.imageId ) { - image.id = item.imageId; - } - image.src = item.imageFile; - image.border = 0; - image.alt = item.speedTip; - image.title = item.speedTip; - image.style.cursor = 'pointer'; - image.onclick = function() { - insertTags( item.tagOpen, item.tagClose, item.sampleText ); - // click tracking - if ( ( typeof $ != 'undefined' ) && ( typeof $.trackAction != 'undefined' ) ) { - $.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") ); - } - return false; - }; - - parent.appendChild( image ); - return true; -}; - -// this function generates the actual toolbar buttons with localized text -// we use it to avoid creating the toolbar where javascript is not enabled -window.mwSetupToolbar = function() { - var toolbar = document.getElementById( 'toolbar' ); - if ( !toolbar ) { - return false; - } - - // Don't generate buttons for browsers which don't fully - // support it. - // but don't assume wpTextbox1 is always here - var textboxes = document.getElementsByTagName( 'textarea' ); - if ( !textboxes.length ) { - // No toolbar if we can't find any textarea - return false; - } - // Only check for selection capability if the textarea is visible - errors will occur otherwise - just because - // the textarea is not visible, doesn't mean we shouldn't build out the toolbar though - it might have been replaced - // with some other kind of control - if ( textboxes[0].style.display != 'none' ) { - if ( !( document.selection && document.selection.createRange ) - && textboxes[0].selectionStart === null ) { - return false; - } - } - for ( var i = 0; i < mwEditButtons.length; i++ ) { - mwInsertEditButton( toolbar, mwEditButtons[i] ); - } - for ( var i = 0; i < mwCustomEditButtons.length; i++ ) { - mwInsertEditButton( toolbar, mwCustomEditButtons[i] ); - } - return true; -}; - -// apply tagOpen/tagClose to selection in textarea, -// use sampleText instead of selection if there is none -window.insertTags = function( tagOpen, tagClose, sampleText ) { - if ( typeof $ != 'undefined' && typeof $.fn.textSelection != 'undefined' && currentFocused && - ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) { - $( '#wpTextbox1' ).textSelection( - 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose } - ); - return; - } - var txtarea; - if ( document.editform ) { - txtarea = currentFocused; - } else { - // some alternate form? take the first one we can find - var areas = document.getElementsByTagName( 'textarea' ); - txtarea = areas[0]; - } - var selText, isSample = false; - - if ( document.selection && document.selection.createRange ) { // IE/Opera - // save window scroll position - if ( document.documentElement && document.documentElement.scrollTop ) { - var winScroll = document.documentElement.scrollTop - } else if ( document.body ) { - var winScroll = document.body.scrollTop; - } - // get current selection - txtarea.focus(); - var range = document.selection.createRange(); - selText = range.text; - // insert tags - checkSelectedText(); - range.text = tagOpen + selText + tagClose; - // mark sample text as selected - if ( isSample && range.moveStart ) { - if ( window.opera ) { - tagClose = tagClose.replace(/\n/g,''); - } - range.moveStart('character', - tagClose.length - selText.length); - range.moveEnd('character', - tagClose.length); - } - range.select(); - // restore window scroll position - if ( document.documentElement && document.documentElement.scrollTop ) { - document.documentElement.scrollTop = winScroll; - } else if ( document.body ) { - document.body.scrollTop = winScroll; - } - - } else if ( txtarea.selectionStart || txtarea.selectionStart == '0' ) { // Mozilla - // save textarea scroll position - var textScroll = txtarea.scrollTop; - // get current selection - txtarea.focus(); - var startPos = txtarea.selectionStart; - var endPos = txtarea.selectionEnd; - selText = txtarea.value.substring( startPos, endPos ); - // insert tags - checkSelectedText(); - txtarea.value = txtarea.value.substring(0, startPos) - + tagOpen + selText + tagClose - + txtarea.value.substring(endPos, txtarea.value.length); - // set new selection - if ( isSample ) { - txtarea.selectionStart = startPos + tagOpen.length; - txtarea.selectionEnd = startPos + tagOpen.length + selText.length; - } else { - txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length; - txtarea.selectionEnd = txtarea.selectionStart; - } - // restore textarea scroll position - txtarea.scrollTop = textScroll; - } - - function checkSelectedText() { - if ( !selText ) { - selText = sampleText; - isSample = true; - } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char - selText = selText.substring(0, selText.length - 1); - tagClose += ' '; - } - } - -}; - -/** - * Restore the edit box scroll state following a preview operation, - * and set up a form submission handler to remember this state - */ -window.scrollEditBox = function() { - var editBox = document.getElementById( 'wpTextbox1' ); - var scrollTop = document.getElementById( 'wpScrolltop' ); - var editForm = document.getElementById( 'editform' ); - if( editForm && editBox && scrollTop ) { - if( scrollTop.value ) { - editBox.scrollTop = scrollTop.value; - } - addHandler( editForm, 'submit', function() { - scrollTop.value = editBox.scrollTop; - } ); - } -}; -hookEvent( 'load', scrollEditBox ); -hookEvent( 'load', mwSetupToolbar ); -hookEvent( 'load', function() { - currentFocused = document.getElementById( 'wpTextbox1' ); - // http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html - // focus does not bubble normally, but using a trick we can do event delegation - // on the focus event on all text inputs to make the toolbox usable on all of them - var editForm = document.getElementById( 'editform' ); - if ( !editForm ) { - return; - } - function onfocus( e ) { - var elm = e.target || e.srcElement; - if ( !elm ) { - return; - } - var tagName = elm.tagName.toLowerCase(); - var type = elm.type || ''; - if ( tagName !== 'textarea' && tagName !== 'input' ) { - return; - } - if ( tagName === 'input' && type.toLowerCase() !== 'text' ) { - return; - } - - currentFocused = elm; - } - - if ( editForm.addEventListener ) { - // Gecko, WebKit, Opera, etc... (all standards compliant browsers) - editForm.addEventListener( 'focus', onfocus, true ); // This MUST be true to work - } else if ( editForm.attachEvent ) { - // IE needs a specific trick here since it doesn't support the standard - editForm.attachEvent( 'onfocusin', function() { onfocus( event ); } ); - } - - // HACK: make currentFocused work with the usability iframe - // With proper focus detection support (HTML 5!) this'll be much cleaner - if ( typeof $ != 'undefined' ) { - var iframe = $( '.wikiEditor-ui-text iframe' ); - if ( iframe.length > 0 ) { - $( iframe.get( 0 ).contentWindow.document ) - .add( iframe.get( 0 ).contentWindow.document.body ) // for IE - .focus( function() { currentFocused = iframe.get( 0 ); } ); - } - } - - editForm -} ); - diff --git a/skins/common/enhancedchanges.js b/skins/common/enhancedchanges.js deleted file mode 100644 index bcc2cc88..00000000 --- a/skins/common/enhancedchanges.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - JavaScript file for enhanced recentchanges - */ - -/* - * Add the CSS to hide parts that should be collapsed - * - * We do this with JS so everything will be expanded by default - * if JS is disabled - */ -appendCSS('.mw-changeslist-hidden {'+ - ' display:none;'+ - '}'+ - 'div.mw-changeslist-expanded {'+ - ' display:block;'+ - '}'+ - 'span.mw-changeslist-expanded {'+ - ' display:inline !important;'+ - ' visibility:visible !important;'+ - '}' -); - -/* - * Switch an RC line between hidden/shown - * @param int idNumber : the id number of the RC group -*/ -window.toggleVisibility = function(idNumber) { - var openarrow = document.getElementById("mw-rc-openarrow-"+idNumber); - var closearrow = document.getElementById("mw-rc-closearrow-"+idNumber); - var subentries = document.getElementById("mw-rc-subentries-"+idNumber); - if (openarrow.className == 'mw-changeslist-expanded') { - openarrow.className = 'mw-changeslist-hidden'; - closearrow.className = 'mw-changeslist-expanded'; - subentries.className = 'mw-changeslist-expanded'; - } else { - openarrow.className = 'mw-changeslist-expanded'; - closearrow.className = 'mw-changeslist-hidden'; - subentries.className = 'mw-changeslist-hidden'; - } -}; diff --git a/skins/common/history.js b/skins/common/history.js deleted file mode 100644 index 33845a75..00000000 --- a/skins/common/history.js +++ /dev/null @@ -1,77 +0,0 @@ -window.historyRadios = function(parent) { - var inputs = parent.getElementsByTagName('input'); - var radios = []; - for (var i = 0; i < inputs.length; i++) { - if (inputs[i].name == "diff" || inputs[i].name == "oldid") { - radios[radios.length] = inputs[i]; - } - } - return radios; -}; - -// check selection and tweak visibility/class onclick -window.diffcheck = function() { - var dli = false; // the li where the diff radio is checked - var oli = false; // the li where the oldid radio is checked - var hf = document.getElementById('pagehistory'); - if (!hf) { - return true; - } - var lis = hf.getElementsByTagName('li'); - for (var i=0;i<lis.length;i++) { - var inputs = historyRadios(lis[i]); - if (inputs[1] && inputs[0]) { - if (inputs[1].checked || inputs[0].checked) { // this row has a checked radio button - if (inputs[1].checked && inputs[0].checked && inputs[0].value == inputs[1].value) { - return false; - } - if (oli) { // it's the second checked radio - if (inputs[1].checked) { - if ( (typeof oli.className) != 'undefined') { - oli.classNameOriginal = oli.className.replace( 'selected', '' ); - } else { - oli.classNameOriginal = ''; - } - - oli.className = "selected "+oli.classNameOriginal; - return false; - } - } else if (inputs[0].checked) { - return false; - } - if (inputs[0].checked) { - dli = lis[i]; - } - if (!oli) { - inputs[0].style.visibility = 'hidden'; - } - if (dli) { - inputs[1].style.visibility = 'hidden'; - } - if ( (typeof lis[i].className) != 'undefined') { - lis[i].classNameOriginal = lis[i].className.replace( 'selected', '' ); - } else { - lis[i].classNameOriginal = ''; - } - - lis[i].className = "selected "+lis[i].classNameOriginal; - oli = lis[i]; - } else { // no radio is checked in this row - if (!oli) { - inputs[0].style.visibility = 'hidden'; - } else { - inputs[0].style.visibility = 'visible'; - } - if (dli) { - inputs[1].style.visibility = 'hidden'; - } else { - inputs[1].style.visibility = 'visible'; - } - if ( typeof lis[i].classNameOriginal != 'undefined' ) { - lis[i].className = lis[i].classNameOriginal; - } - } - } - } - return true; -}; diff --git a/skins/common/htmlform.js b/skins/common/htmlform.js deleted file mode 100644 index 900b1660..00000000 --- a/skins/common/htmlform.js +++ /dev/null @@ -1,40 +0,0 @@ -// Find select-or-other fields. -addOnloadHook( function() { - var fields = getElementsByClassName( document, 'select', 'mw-htmlform-select-or-other' ); - - for( var i = 0; i < fields.length; i++ ) { - var select = fields[i]; - - addHandler( select, 'change', htmlforms.selectOrOtherSelectChanged ); - - // Use a fake 'e' to update it. - htmlforms.selectOrOtherSelectChanged( { 'target': select } ); - } -} ); - -window.htmlforms = { - 'selectOrOtherSelectChanged' : function( e ) { - var select; - if ( !e ) { - e = window.event; - } - if ( e.target ) { - select = e.target; - } else if ( e.srcElement ) { - select = e.srcElement; - } - if ( select.nodeType == 3 ) { // defeat Safari bug - select = select.parentNode; - } - - var id = select.id; - var textbox = document.getElementById( id + '-other' ); - - if ( select.value == 'other' ) { - textbox.disabled = false; - } else { - textbox.disabled = true; - } - } -}; - diff --git a/skins/common/images/cc-by.png b/skins/common/images/cc-by.png Binary files differnew file mode 100644 index 00000000..822491ed --- /dev/null +++ b/skins/common/images/cc-by.png diff --git a/skins/common/images/critical-32.png b/skins/common/images/critical-32.png Binary files differindex 8f65041e..2bff7511 100644 --- a/skins/common/images/critical-32.png +++ b/skins/common/images/critical-32.png diff --git a/skins/common/images/download-32.png b/skins/common/images/download-32.png Binary files differindex 0087e10d..c571ea30 100644 --- a/skins/common/images/download-32.png +++ b/skins/common/images/download-32.png diff --git a/skins/common/images/info-32.png b/skins/common/images/info-32.png Binary files differindex ecefa9a6..70d7f20a 100644 --- a/skins/common/images/info-32.png +++ b/skins/common/images/info-32.png diff --git a/skins/common/images/magnify-clip-rtl.png b/skins/common/images/magnify-clip-rtl.png Binary files differnew file mode 100644 index 00000000..8398a82c --- /dev/null +++ b/skins/common/images/magnify-clip-rtl.png diff --git a/skins/common/images/sort_down.gif b/skins/common/images/sort_down.gif Binary files differdeleted file mode 100644 index d97e8285..00000000 --- a/skins/common/images/sort_down.gif +++ /dev/null diff --git a/skins/common/images/sort_none.gif b/skins/common/images/sort_none.gif Binary files differdeleted file mode 100644 index edd07e58..00000000 --- a/skins/common/images/sort_none.gif +++ /dev/null diff --git a/skins/common/images/sort_up.gif b/skins/common/images/sort_up.gif Binary files differdeleted file mode 100644 index 488cf279..00000000 --- a/skins/common/images/sort_up.gif +++ /dev/null diff --git a/skins/common/images/tick-32.png b/skins/common/images/tick-32.png Binary files differindex 584cef22..dfde1707 100644 --- a/skins/common/images/tick-32.png +++ b/skins/common/images/tick-32.png diff --git a/skins/common/images/warning-32.png b/skins/common/images/warning-32.png Binary files differindex aa6b298b..6267cbc9 100644 --- a/skins/common/images/warning-32.png +++ b/skins/common/images/warning-32.png diff --git a/skins/common/metadata.js b/skins/common/metadata.js deleted file mode 100644 index 8fafc955..00000000 --- a/skins/common/metadata.js +++ /dev/null @@ -1,53 +0,0 @@ -// Exif metadata display for MediaWiki file uploads -// -// Add an expand/collapse link and collapse by default if set to -// (with JS disabled, user will see all items) -// -// attachMetadataToggle('mw_metadata', 'More...', 'Fewer...'); - -window.attachMetadataToggle = function( tableId, showText, hideText ) { - if ( document.createTextNode ) { - var box = document.getElementById( tableId ); - if ( !box ) { - return false; - } - - var tbody = box.getElementsByTagName('tbody')[0]; - - var row = document.createElement( 'tr' ); - - var col = document.createElement( 'td' ); - col.colSpan = 2; - - var link = document.createElement( 'a' ); - link.href = '#'; - - link.onclick = function() { - if ( box.className == 'mw_metadata collapsed' ) { - changeText( link, hideText ); - box.className = 'mw_metadata expanded'; - } else { - changeText( link, showText ); - box.className = 'mw_metadata collapsed'; - } - return false; - }; - - var text = document.createTextNode( hideText ); - - link.appendChild( text ); - col.appendChild( link ); - row.appendChild( col ); - tbody.appendChild( row ); - - // And collapse! - link.onclick(); - - return true; - } - return false; -}; - -$( document ).ready( function() { - attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) ); -} ); diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js index d7dd5ad8..6971d30d 100644 --- a/skins/common/mwsuggest.js +++ b/skins/common/mwsuggest.js @@ -52,14 +52,16 @@ window.os_enabled = true; /** * <datalist> is a new HTML5 element that allows you to manually supply * suggestion lists and have them rendered according to the right platform - * conventions. However, the only shipping browser as of early 2010 is Opera, - * and that has a fatal problem: the suggestion lags behind what the user types - * by one keypress. (Reported as DSK-276870 to Opera's secret bug tracker.) - * The code here otherwise seems to work, though, so this can be flipped on - * (maybe with a UA check) when some browser has a better implementation. + * conventions. Opera as of version 11 has a fatal problem: the suggestion + * lags behind what the user types by one keypress. (Reported as DSK-276870 to + * Opera's secret bug tracker.) However, Firefox 4 supports it without + * problems, so Opera is just blacklisted here. Ideally we wouldn't blacklist + * future versions, in case they fix it, but the fallback isn't bad at all and + * the failure if they don't fix it is very annoying, so in this case we'll + * blacklist future versions too. */ -// var os_use_datalist = 'list' in document.createElement( 'input' ); -window.os_use_datalist = false; +window.os_use_datalist = 'list' in document.createElement( 'input' ) + && $.client.profile().name != 'opera'; /** Timeout timer class that will fetch the results */ window.os_Timer = function( id, r, query ) { @@ -750,36 +752,28 @@ window.os_getElementPosition = function( elemID ) { }; /** Create the container div that will hold the suggested titles */ -window.os_createContainer = function(r) { - var c = document.createElement('div'); - var s = document.getElementById(r.searchbox); - var pos = os_getElementPosition(r.searchbox); +window.os_createContainer = function( r ) { + var c = document.createElement( 'div' ); + var s = document.getElementById( r.searchbox ); + var pos = os_getElementPosition( r.searchbox ); var left = pos.left; var top = pos.top + s.offsetHeight; c.className = 'os-suggest'; - c.setAttribute('id', r.container); - document.body.appendChild(c); + c.setAttribute( 'id', r.container ); + document.body.appendChild( c ); // dynamically generated style params // IE workaround, cannot explicitely set "style" attribute - c = document.getElementById(r.container); + c = document.getElementById( r.container ); c.style.top = top + 'px'; c.style.left = left + 'px'; c.style.width = s.offsetWidth + 'px'; // mouse event handlers - c.onmouseover = function(event) { - os_eventMouseover(r.searchbox, event); - }; - c.onmousemove = function(event) { - os_eventMousemove(r.searchbox, event); - }; - c.onmousedown = function(event) { - return os_eventMousedown(r.searchbox, event); - }; - c.onmouseup = function(event) { - os_eventMouseup(r.searchbox, event); - }; + c.onmouseover = function( event ) { os_eventMouseover( r.searchbox, event ); }; + c.onmousemove = function( event ) { os_eventMousemove( r.searchbox, event ); }; + c.onmousedown = function( event ) { return os_eventMousedown( r.searchbox, event ); }; + c.onmouseup = function( event ) { os_eventMouseup( r.searchbox, event ); }; return c; }; diff --git a/skins/common/oldshared.css b/skins/common/oldshared.css index 33047ec9..4be14f37 100644 --- a/skins/common/oldshared.css +++ b/skins/common/oldshared.css @@ -30,22 +30,26 @@ h6 .editsection { font-size: 133%; } #footer { clear: both } /* images */ +/* @noflip */ div.floatright { float: right; clear: right; margin: 0 0 1em 1em; } +/* @noflip */ div.floatright p { font-style: italic; } +/* @noflip */ div.floatleft { float: left; clear: left; margin: 0.3em 0.5em 0.5em 0; } +/* @noflip */ div.floatleft p { font-style: italic; } @@ -100,11 +104,13 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } +/* @noflip */ div.tright { clear: right; float: right; border-width: .5em 0 .8em 1.4em; } +/* @noflip */ div.tleft { float: left; clear: left; @@ -141,8 +147,7 @@ img { border: none; } .toc ul { list-style-type: none; list-style-image: none; - margin-left: 0; - padding-left: 0; + padding: 0; text-align: left; } #toc ul ul, @@ -208,7 +213,7 @@ fieldset.operaprefsection { } /* small for tables and similar */ -.small, .small * { +.small { font-size: 94%; } table.small { @@ -428,8 +433,29 @@ form#specialpages { } body { + direction: ltr; + unicode-bidi: embed; background-color: #ffffec; } body.ns-0 { background-color: white; } + +/** RTL specific CSS starts here **/ + +/** + * Lists: + * The following lines don't have a visible effect on non-Gecko browsers + * They fix a problem with Gecko browsers rendering lists to the right of + * left-floated objects in an RTL layout. + */ +/* @noflip */ +html > body.rtl div#article ul { + display: table; +} +/* @noflip */ +html > body.rtl div#bodyContent ul#filetoc { + display: block; +} + +/* RTL specific CSS ends here **/
\ No newline at end of file diff --git a/skins/common/prefs.js b/skins/common/prefs.js deleted file mode 100644 index 1eb8e5bf..00000000 --- a/skins/common/prefs.js +++ /dev/null @@ -1,138 +0,0 @@ -// Timezone stuff -// tz in format [+-]HHMM -window.checkTimezone = function( tz, msg ) { - var localclock = new Date(); - // returns negative offset from GMT in minutes - var tzRaw = localclock.getTimezoneOffset(); - var tzHour = Math.floor( Math.abs( tzRaw ) / 60 ); - var tzMin = Math.abs( tzRaw ) % 60; - var tzString = ( ( tzRaw >= 0 ) ? '-' : '+' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin; - if ( tz != tzString ) { - var junk = msg.split('$1'); - document.write( junk[0] + 'UTC' + tzString + junk[1] ); - } -}; - -window.timezoneSetup = function() { - var tzSelect = document.getElementById( 'mw-input-wptimecorrection' ); - var tzTextbox = document.getElementById( 'mw-input-wptimecorrection-other' ); - - if ( tzSelect && tzTextbox ) { - addHandler( tzSelect, 'change', function( e ) { updateTimezoneSelection( false ); } ); - addHandler( tzTextbox, 'blur', function( e ) { updateTimezoneSelection( true ); } ); - } - - updateTimezoneSelection( false ); -}; - -// in [-]HH:MM format... -// won't yet work with non-even tzs -window.fetchTimezone = function() { - // FIXME: work around Safari bug - var localclock = new Date(); - // returns negative offset from GMT in minutes - var tzRaw = localclock.getTimezoneOffset(); - var tzHour = Math.floor( Math.abs( tzRaw ) / 60 ); - var tzMin = Math.abs( tzRaw ) % 60; - var tzString = ( ( tzRaw >= 0 ) ? '-' : '' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour + - ':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin; - return tzString; -}; - -window.guessTimezone = function() { - var textbox = document.getElementById( 'mw-input-wptimecorrection-other' ); - var selector = document.getElementById( 'mw-input-wptimecorrection' ); - - selector.value = 'other'; - textbox.value = fetchTimezone(); - textbox.disabled = false; // The changed handler doesn't trip, obviously. - updateTimezoneSelection( true ); -}; - -window.updateTimezoneSelection = function( force_offset ) { - var selector = document.getElementById( 'mw-input-wptimecorrection' ); - - if ( selector.value == 'guess' ) { - return guessTimezone(); - } - - var textbox = document.getElementById( 'mw-input-wptimecorrection-other' ); - var localtimeHolder = document.getElementById( 'wpLocalTime' ); - var servertime = document.getElementsByName( 'wpServerTime' )[0].value; - var minDiff = 0; - - // Compatibility code. - if ( !selector.value ) { - selector.value = selector.options[selector.selectedIndex].value; - } - - // Handle force_offset - if ( force_offset ) { - selector.value = 'other'; - } - - // Get min_diff - if ( selector.value == 'other' ) { - // Grab data from the textbox, parse it. - var diffArr = textbox.value.split(':'); - if ( diffArr.length == 1 ) { - // Specification is of the form [-]XX - minDiff = parseInt( diffArr[0], 10 ) * 60; - } else { - // Specification is of the form [-]XX:XX - minDiff = Math.abs( parseInt( diffArr[0], 10 ) ) * 60 + parseInt( diffArr[1], 10 ); - if ( parseInt( diffArr[0], 10 ) < 0 ) { - minDiff = -minDiff; - } - } - } else { - // Grab data from the selector value - var diffArr = selector.value.split('|'); - minDiff = parseInt( diffArr[1], 10 ); - } - - // Gracefully handle non-numbers. - if ( isNaN( minDiff ) ) { - minDiff = 0; - } - - // Determine local time from server time and minutes difference, for display. - var localTime = parseInt( servertime, 10 ) + minDiff; - - // Bring time within the [0,1440) range. - while ( localTime < 0 ) { - localTime += 1440; - } - while ( localTime >= 1440 ) { - localTime -= 1440; - } - - // Split to hour and minute - var hour = String( Math.floor( localTime / 60 ) ); - if ( hour.length < 2 ) { - hour = '0' + hour; - } - var min = String(localTime%60); - if ( min.length < 2 ) { - min = '0' + min; - } - changeText( localtimeHolder, hour + ':' + min ); - - // If the user selected from the drop-down, fill the offset field. - if ( selector.value != 'other' ) { - hour = String( Math.abs( Math.floor( minDiff / 60 ) ) ); - if ( hour.length < 2 ) { - hour = '0' + hour; - } - if ( minDiff < 0 ) { - hour = '-' + hour; - } - min = String(minDiff%60); - if ( min.length < 2 ) { - min = '0' + min; - } - textbox.value = hour + ':' + min; - } -}; - -addOnloadHook( timezoneSetup ); diff --git a/skins/common/preview.js b/skins/common/preview.js index 234dd545..82b27bc1 100644 --- a/skins/common/preview.js +++ b/skins/common/preview.js @@ -9,28 +9,28 @@ var postData = $('#editform').formToArray(); postData.push( { 'name' : 'wpPreview', 'value' : '1' } ); - + // Hide active diff, used templates, old preview if shown var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats', '#catlinks']; var copySelector = copyElements.join(','); - + $.each( copyElements, function(k,v) { $(v).fadeOut('fast'); } ); // Display a loading graphic var loadSpinner = $('<div class="mw-ajax-loader"/>'); $('#wikiPreview').before( loadSpinner ); - + var page = $('<div/>'); var target = $('#editform').attr('action'); - + if ( !target ) { target = window.location.href; } - + page.load( target + ' ' + copySelector, postData, function() { - + for( var i=0; i<copyElements.length; ++i) { // For all the specified elements, find the elements in the loaded page // and the real page, empty the element in the real page, and fill it @@ -40,12 +40,12 @@ var newClasses = page.find( copyElements[i] ).attr('class'); $(copyElements[i]).attr( 'class', newClasses ); } - + $.each( copyElements, function(k,v) { // Don't belligerently show elements that are supposed to be hidden $(v).fadeIn( 'fast', function() { $(this).css('display', ''); } ); } ); - + loadSpinner.remove(); $( mw ).trigger( 'LivePreviewDone', [copyElements] ); diff --git a/skins/common/protect.js b/skins/common/protect.js index a284c3f8..b77c2e06 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -45,6 +45,8 @@ window.ProtectionForm = { check.checked = !this.areAllTypesMatching(); this.enableUnchainedInputs( check.checked ); } + + $( '#mwProtect-reason' ).byteLimit( 180 ); this.updateCascadeCheckbox(); diff --git a/skins/common/search.css b/skins/common/search.css deleted file mode 100644 index 22c3ca4a..00000000 --- a/skins/common/search.css +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Fixes sister projects box moving down the extract - * of the first result (bug #16886). - * It only happens when the window is small and - * This changes slightly the layout for big screens - * where there was space for the extracts and the - * sister projects and thus it showed like in any - * other browser. - * - * This will only affect IE 7 and lower - */ -html > body .searchresult { - display: inline; -} diff --git a/skins/common/search.js b/skins/common/search.js deleted file mode 100644 index 26d807db..00000000 --- a/skins/common/search.js +++ /dev/null @@ -1,50 +0,0 @@ -// JS specific to Special:Search - -// change the search link to what user entered -window.mwSearchHeaderClick = function( obj ) { - var searchbox = document.getElementById( 'searchText' ); - if( searchbox === null ) { - searchbox = document.getElementById( 'powerSearchText' ); - } - if( searchbox === null ) { - return; // should always have either normal or advanced search - } - - var searchterm = searchbox.value; - var parts = obj.getAttribute( 'href', 2).split( 'search=' ); - var lastpart = ''; - var prefix = 'search='; - if( parts.length > 1 && parts[1].indexOf('&') >= 0 ) { - lastpart = parts[1].substring( parts[1].indexOf('&') ); - } else { - prefix = '&search='; - } - obj.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart; -}; - -window.mwToggleSearchCheckboxes = function( btn ) { - if( !document.getElementById ) { - return; - } - - var nsInputs = document.getElementById( 'powersearch' ).getElementsByTagName( 'input' ); - var isChecked = false; - - for ( var i = 0; i < nsInputs.length; i++ ) { - var pattern = /^ns/; - if ( ( nsInputs[i].type == 'checkbox' ) && ( pattern.test( nsInputs[i].name ) ) ) { - switch ( btn ) { - case 'none': - if ( nsInputs[i].checked ) { - nsInputs[i].checked = false; - } - break; - case 'all': - if ( !nsInputs[i].checked ) { - nsInputs[i].checked = true; - } - break; - } - } - } -}; diff --git a/skins/common/shared.css b/skins/common/shared.css index 00032b3f..3612ee0f 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -1,9 +1,23 @@ /** * CSS in this file is used by *all* skins (that have any CSS at all). Be * careful what you put in here, since what looks good in one skin may not in - * another, but don't ignore the poor non-Monobook users either. + * another, but don't ignore the poor pre-Monobook users either. */ +/* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */ +/* These classes should be used for text depending on the content direction. +Content stuff like editsection, ul/ol and TOC depend on this. */ + /* @noflip */.mw-content-ltr { direction: ltr; } +/* @noflip */.mw-content-rtl { direction: rtl; } +/* Most input fields should be in site direction */ +/* @noflip */.sitedir-ltr textarea, .sitedir-ltr input { direction: ltr; } +/* @noflip */.sitedir-rtl textarea, .sitedir-rtl input { direction: rtl; } +/* Input types that should follow user direction, like buttons */ +input[type="submit"], input[type="button"], input[type="reset"], input[type="file"] { direction: ltr; } +/* Override default values */ +/* @noflip */textarea[dir="ltr"], input[dir="ltr"] { direction: ltr; } +/* @noflip */textarea[dir="rtl"], input[dir="rtl"] { direction: rtl; } + /* Default style for semantic tags */ abbr, acronym, .explain { border-bottom: 1px dotted black; @@ -17,7 +31,10 @@ abbr, acronym, .explain { /* Links to redirects appear italicized on [[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Watchlist/edit]] and in category listings */ -.allpagesredirect, .redirect-in-category, .watchlistredir { font-style: italic; } +.allpagesredirect, .redirect-in-category, .watchlistredir { + font-style: italic; +} + /* Comment and username portions of RC entries */ span.comment { @@ -44,7 +61,9 @@ span.texhtml { font-family: serif; } #editform, #toolbar, #wpTextbox1 { clear: both; } - +#toolbar img { + cursor: pointer; +} div#mw-js-message { margin: 1em 5%; padding: 0.5em 2.5%; @@ -57,7 +76,9 @@ div#mw-js-message { float: right; margin-left: 5px; } - +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */.mw-content-ltr .editsection, .mw-content-rtl .mw-content-ltr .editsection { float: right; } +/* @noflip */.mw-content-rtl .editsection, .mw-content-ltr .mw-content-rtl .editsection { float: left; } /** * File histories */ @@ -127,6 +148,15 @@ tr.mw-htmlform-vertical-label td.mw-label { text-align: left !important; } +.mw-htmlform-invalid-input td.mw-input input { + border-color: red; +} +.mw-htmlform-multiselect-flatlist div.mw-htmlform-multiselect-item { + display: inline; + margin-right: 1em; + white-space: nowrap; +} + input#wpSummary { width: 80%; } @@ -138,226 +168,53 @@ input#wpSummary { .magnify { float: right; } /** - * Hidden categories + * Categories */ -.mw-hidden-cats-hidden { display: none; } -.catlinks-allhidden { display: none; } - -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons, -p.mw-revdel-editreasons { - font-size: 90%; - float: right; -} - -/* Search results */ -.searchresults { -} - -.searchresults p { - margin-left: 0.4em; - margin-top: 1em; - margin-bottom: 1.2em; -} - -div.searchresult { - font-size: 95%; - width: 38em; -} - -.mw-search-results { - margin-left: 0.4em; +#catlinks { + /** + * Overrides text justification (user preference) + * See bug 31990 + */ + text-align: left; } - -.mw-search-results li { - padding-bottom: 1em; +#catlinks ul { + display:inline; + margin: 0px; + padding: 0px; list-style: none; + list-style-type: none; list-style-image: none; -} -.mw-search-results li a { - font-size: 108%; -} - -.mw-search-result-data { - color: green; - font-size: 97%; -} - -.mw-search-formheader { - background-color: #f3f3f3; - margin-top: 1em; - border: 1px solid silver; -} -.mw-search-formheader div.search-types { - float: left; - padding-left: 0.25em; -} -.mw-search-formheader div.search-types ul { - margin: 0 !important; - padding: 0 !important; - list-style: none !important; -} -.mw-search-formheader div.search-types ul li { - float: left; - margin: 0; - padding: 0; -} -.mw-search-formheader div.search-types ul li a { - display: block; - padding: 0.5em; -} -.mw-search-formheader div.search-types ul li.current a { - color: #333333; - cursor: default; -} -.mw-search-formheader div.search-types ul li.current a:hover { - text-decoration: none; -} -.mw-search-formheader div.results-info { - float: right; - padding: 0.5em; - padding-right: 0.75em; -} -.mw-search-formheader div.results-info ul { - margin: 0 !important; - padding: 0 !important; - list-style: none !important; -} -.mw-search-formheader div.results-info ul li { - float: right; - margin: 0; - padding: 0; -} -fieldset#mw-searchoptions { - margin: 0; - padding-left: 0.75em !important; - padding-right: 0.75em !important; - padding-bottom: 0.5em !important; - padding-top: 0.5em !important; - border: none; - background-color: #f9f9f9; - border: 1px solid silver !important; - border-top-width: 0 !important; -} -fieldset#mw-searchoptions legend { - display: none; -} -fieldset#mw-searchoptions h4 { - padding: 0; - margin: 0; - float: left; -} -fieldset#mw-searchoptions div#mw-search-togglebox { - float: right; -} - -fieldset#mw-searchoptions div#mw-search-togglebox label { - margin-right: 0.25em; -} -fieldset#mw-searchoptions div#mw-search-togglebox input { - margin-left: 0.25em; -} -fieldset#mw-searchoptions table { - float: left; - margin-right: 3em; -} -fieldset#mw-searchoptions table td { - padding-right: 1em; -} -fieldset#mw-searchoptions div.divider { - clear: both; - border-bottom: 1px solid #DDDDDD; - padding-top: 0.5em; - margin-bottom: 0.5em; -} - -td#mw-search-menu { - padding-left:6em; - font-size:85%; + vertical-align: middle !ie; } -div#mw-search-interwiki { - float: right; - width: 18em; - border-style: solid; - border-color: #AAAAAA; - border-width: 1px; - margin-top: 2ex; +#catlinks li { + display:inline-block; + line-height: 1.35em; + padding: 0 .7em; + border-left: 1px solid #AAA; + margin: 0.3em 0; + zoom: 1; + display:inline !ie; } -div#mw-search-interwiki li { - font-size: 95%; +#catlinks li:first-child { + padding-left: .4em; + border-left: none; } +/** + * Hidden categories + */ +.mw-hidden-cats-hidden { display: none; } +.catlinks-allhidden { display: none; } -.mw-search-interwiki-more { - float: right; +/* Convenience links to edit block, delete and protect reasons */ +p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, +p.mw-filedelete-editreasons, p.mw-delete-editreasons, +p.mw-revdel-editreasons { font-size: 90%; -} - -div#mw-search-interwiki-caption { - text-align: center; - font-weight: bold; - font-size: 95%; -} - -.mw-search-interwiki-project { - font-size: 97%; - text-align: left; - padding-left: 0.2em; - padding-right: 0.15em; - padding-bottom: 0.2em; - padding-top: 0.15em; - background-color: #ececec; - border-top: 1px solid #BBBBBB; -} - -span.searchalttitle { - font-size: 95%; -} - -div.searchdidyoumean { - font-size: 127%; - margin-top: 0.8em; - /* Note that this color won't affect the link, as desired. */ - color: #c00; -} - -div.searchdidyoumean em { - font-weight: bold; -} - -.searchmatch { - font-weight: bold; -} - - -/* - * Advanced PowerSearch box - */ -td#mw-search-togglebox { text-align: right; } -table#mw-search-powertable { - width: 100%; -} - -form#powersearch { - clear: both; -} - -/* - * UserRights stuff - */ -.mw-userrights-disabled { - color: #888; -} - -table.mw-userrights-groups * td,table.mw-userrights-groups * th { - padding-right: 1.5em; -} - /* * OpenSearch ajax suggestions */ @@ -436,36 +293,12 @@ table.os-suggest-results { border: 1px dashed #aaa; } -/** Generic minor/bot/newpage styling */ -.newpage, .minor, .bot { - font-weight: bold; -} - -/* Special:Contributions styling */ -.mw-uctop { - font-weight: bold; -} - -/* Special:ListGroupRights styling */ -table.mw-listgrouprights-table tr { - vertical-align: top; -} -.listgrouprights-revoked { - text-decoration: line-through; -} - -/* Special:Statistics styling */ -td.mw-statistics-numbers { - text-align: right; +.mw-history-revisiondelete-button, #mw-fileduplicatesearch-icon { + float: right; } -/* Special:SpecialPages styling */ -h4.mw-specialpagesgroup { - background-color: #dcdcdc; - padding: 2px; - margin: .3em 0em 0em 0em; -} -.mw-specialpagerestricted { +/** Generic minor/bot/newpage styling */ +.newpage, .minor, .bot { font-weight: bold; } @@ -473,42 +306,6 @@ h4.mw-specialpagesgroup { font-style: italic; } -/* Special:EmailUser styling */ -table.mw-emailuser-table { - width: 98%; -} -td#mw-emailuser-sender, td#mw-emailuser-recipient { - font-weight: bold; -} - -/* Special:Allpages styling */ -table.mw-allpages-table-form, table.mw-allpages-table-chunk { - width: 100%; -} -td.mw-allpages-alphaindexline { - text-align: right; -} -td.mw-allpages-nav, p.mw-allpages-nav { - text-align: right; - font-size: smaller; - margin-bottom: 1em; -} -table.mw-allpages-table-form tr { - vertical-align: top; -} - -/* Special:Prefixindex styling */ -table#mw-prefixindex-list-table, -table#mw-prefixindex-nav-table { - width: 98%; -} -td#mw-prefixindex-nav-form { - font-size: smaller; - margin-bottom: 1em; - text-align: right; - vertical-align: top; -} - /* * Recreating deleted page warning * Reupload file warning @@ -553,6 +350,11 @@ a.feedlink { background: none !important; padding: 0 !important; } +/* External URLs should always be treated as LTR (bug 4330) */ +/* @noflip */ .rtl a.external.free, .rtl a.external.autonumber { + direction: ltr; + unicode-bidi: embed; +} /* wikitable class for skinning normal tables * keep on sync with commonPrint.css @@ -586,11 +388,15 @@ table.collapsed tr.collapsable { color: green; font-size: larger; } +.warning { + color: #FFA500; /* orange */ + font-size: larger; +} .error { color: red; font-size: larger; } -.errorbox, .successbox { +.errorbox, .warningbox, .successbox { font-size: larger; border: 2px solid; padding: .5em 1em; @@ -602,11 +408,15 @@ table.collapsed tr.collapsable { border-color: red; background-color: #fff2f2; } +.warningbox { + border-color: #FF8C00; /* darkorange */ + background-color: #FFFFC0; +} .successbox { border-color: green; background-color: #dfd; } -.errorbox h2, .successbox h2 { +.errorbox h2, .warningbox h2, .successbox h2 { font-size: 1em; font-weight: bold; display: inline; @@ -614,6 +424,24 @@ table.collapsed tr.collapsable { border: none; } +/* general info/warning box for SP */ +.mw-infobox { + border: 2px solid #ff7f00; + margin: 0.5em; + clear: left; + overflow: hidden; +} + +.mw-infobox-left { + margin: 7px; + float: left; + width: 35px; +} + +.mw-infobox-right { + margin: 0.5em 0.5em 0.5em 49px; +} + /* Note on preview page */ .previewnote { color: #c00; @@ -647,6 +475,13 @@ table.collapsed tr.collapsable { min-width: 80%; border-collapse: collapse; } +.TablePager_nav { + margin: 0 auto; +} +.TablePager_nav td { + padding: 3px; + text-align: center; +} .TablePager_nav a { text-decoration: none; } @@ -677,23 +512,6 @@ table.collapsed tr.collapsable { background-color: #ccccff; } - /* Allmessages table */ -#mw-allmessagestable .allmessages-customised td.am_default { - background-color: #fcffc4; -} - -#mw-allmessagestable tr.allmessages-customised:hover td.am_default { - background-color: #faff90; -} - -#mw-allmessagestable td.am_actual { - background-color: #e2ffe2; -} - -#mw-allmessagestable tr.allmessages-customised:hover + tr.allmessages-customised td.am_actual { - background-color: #b1ffb1; -} - /* filetoc */ ul#filetoc { text-align: center; @@ -717,7 +535,7 @@ table.mw_metadata { font-size: 0.8em; margin-left: 0.5em; margin-bottom: 0.5em; - width: 300px; + width: 400px; } table.mw_metadata caption { @@ -740,8 +558,8 @@ table.mw_metadata { table.mw_metadata td, table.mw_metadata th { text-align: center; border: 1px solid #aaaaaa; - padding-left: 0.1em; - padding-right: 0.1em; + padding-left: 5px; + padding-right: 5px; } table.mw_metadata th { @@ -752,18 +570,65 @@ table.mw_metadata td { background-color: #fcfcfc; } +table.mw_metadata ul.metadata-langlist { + list-style-type: none; + list-style-image: none; + padding-right: 5px; + padding-left: 5px; + margin: 0; +} + +/* Correct directionality when page dir is different from site/user dir */ +.mw-content-ltr ul, +.mw-content-rtl .mw-content-ltr ul { + /* @noflip */ + margin: 0.3em 0 0 1.5em; + padding: 0; +} +.mw-content-rtl ul, +.mw-content-ltr .mw-content-rtl ul { + /* @noflip */ + margin: 0.3em 1.5em 0 0; + padding: 0; +} +.mw-content-ltr ol, +.mw-content-rtl .mw-content-ltr ol { + /* @noflip */ + margin: 0.3em 0 0 3.2em; + padding: 0; +} +.mw-content-rtl ol, +.mw-content-ltr .mw-content-rtl ol { + /* @noflip */ + margin: 0.3em 3.2em 0 0; + padding: 0; +} + +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */.mw-content-ltr ul, .mw-content-rtl .mw-content-ltr ul { + margin: .3em 0 0 1.5em; +} +/* @noflip */.mw-content-rtl ul, .mw-content-ltr .mw-content-rtl ul { + margin: .3em 1.5em 0 0; +} +/* @noflip */.mw-content-ltr ol, .mw-content-rtl .mw-content-ltr ol { + margin: .3em 0 0 3.2em; +} +/* @noflip */.mw-content-rtl ol, .mw-content-ltr .mw-content-rtl ol { + margin: .3em 3.2em 0 0; +} + /* Galleries */ /* These display attributes look nonsensical, but are needed to support IE and FF2 */ /* Don't forget to update commonPrint.css */ li.gallerybox { vertical-align: top; - background-color: #f9f9f9; border: solid 2px white; display: -moz-inline-box; + display: inline-block; } ul.gallery, li.gallerybox { - display: inline-block; zoom: 1; *display: inline; } @@ -784,9 +649,15 @@ li.gallerycaption { li.gallerybox div.thumb { text-align: center; border: 1px solid #ccc; + background-color: #f9f9f9; margin: 2px; } +li.gallerybox div.thumb img { + display: block; + margin: 0 auto; +} + div.gallerytext { overflow: hidden; font-size: 94%; @@ -794,44 +665,6 @@ div.gallerytext { word-wrap: break-word; } -table.mw-enhanced-rc { - background: none; - border:0; - border-spacing:0; -} -td.mw-enhanced-rc { - white-space:nowrap; - padding:0; - vertical-align:top; - font-family:monospace -} - -#mw-addcategory-prompt { - display: inline; - margin-left: 1em; -} - -#mw-addcategory-prompt input { - margin-left: 0.5em; - margin-right: 0.5em; -} - -.mw-remove-category { - padding: 8px; - /* @embed */ - background-image: url(images/remove.png); - background-position: center center; - background-repeat: no-repeat; -} - -.mw-ajax-addcategory { - padding-left: 20px; - /* @embed */ - background-image: url(images/add.png); - background-position: left center; - background-repeat: no-repeat; -} - .mw-ajax-loader { /* @embed */ background-image: url(images/ajax-loader.gif); @@ -851,11 +684,6 @@ td.mw-enhanced-rc { background-repeat: no-repeat; } -/* Sort arrows added by SortableTables */ -a.sortheader { - margin: 0 0.3em; -} - /* Localised ordered list numbering for some languages */ ol:lang(bcc) li, ol:lang(bqi) li, @@ -872,26 +700,60 @@ ol:lang(ckb) li { list-style-type: arabic-indic; } +ol:lang(as) li, ol:lang(bn) li { list-style-type: -moz-bengali; list-style-type: bengali; } +ol:lang(or) li { + list-style-type: -moz-oriya; + list-style-type: oriya; +} + +#toc ul, .toc ul { + margin: .3em 0; +} + +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */.mw-content-ltr .toc ul, .mw-content-ltr #toc ul, +.mw-content-rtl .mw-content-ltr .toc ul, .mw-content-rtl .mw-content-ltr #toc ul { + text-align: left; +} +/* @noflip */.mw-content-rtl .toc ul, .mw-content-rtl #toc ul, +.mw-content-ltr .mw-content-rtl .toc ul, .mw-content-ltr .mw-content-rtl #toc ul { + text-align: right; +} +/* @noflip */.mw-content-ltr .toc ul ul, .mw-content-ltr #toc ul ul, +.mw-content-rtl .mw-content-ltr .toc ul ul, .mw-content-rtl .mw-content-ltr #toc ul ul { + margin: 0 0 0 2em; +} +/* @noflip */.mw-content-rtl .toc ul ul, .mw-content-rtl #toc ul ul, +.mw-content-ltr .mw-content-rtl .toc ul ul, .mw-content-ltr .mw-content-rtl #toc ul ul { + margin: 0 2em 0 0; +} + +#toc #toctitle, +.toc #toctitle, +#toc .toctitle, +.toc .toctitle { + direction: ltr; +} + /* tooltip styles */ .mw-help-field-hint { display: none; - padding: 0px; - padding-left: 15px; margin-left: 2px; margin-bottom: -8px; + padding: 0px 0px 0px 15px; /* @embed */ background-image: url('images/help-question.gif'); background-position: left center; background-repeat: no-repeat; - color: #0645ad; - text-decoration: underline; cursor: pointer; font-size: .8em; + text-decoration: underline; + color: #0645ad; } .mw-help-field-hint:hover { /* @embed */ @@ -904,9 +766,94 @@ ol:lang(bn) li { border: 1px solid #5dc9f4; margin-left: 20px; } -.tipsy { padding: 5px 5px 10px; font-size: 12px; position: absolute; z-index: 100000; overflow: visible; } -.tipsy-inner { padding: 5px 8px 4px 8px; background-color: #d6f3ff; color: black; border: 1px solid #5dc9f4; max-width: 300px; text-align: left; } -.tipsy-arrow { position: absolute; /* @embed */ background: url( 'images/tipsy-arrow.gif' ) no-repeat top left; width: 13px; height: 13px; } -.tipsy-se .tipsy-arrow { bottom: -2px; right: 10px; background-position: 0% 100%; } +.tipsy { + padding: 5px 5px 10px; + font-size: 12px; + position: absolute; + z-index: 100000; + overflow: visible; +} +.tipsy-inner { + padding: 5px 8px 4px 8px; + background-color: #d6f3ff; + color: black; + border: 1px solid #5dc9f4; + max-width: 300px; + text-align: left; +} +.tipsy-arrow { + position: absolute; + /* @embed */ + background: url(images/tipsy-arrow.gif) no-repeat top left; + width: 13px; + height: 13px; +} +.tipsy-se .tipsy-arrow { + bottom: -2px; + right: 10px; + background-position: 0% 100%; +} +/* Table Sorting */ +table.sortable th.headerSort { + background-image: url(images/sort_both.gif); + cursor: pointer; + background-repeat: no-repeat; + background-position: center right; + padding-right: 21px; +} +table.sortable th.headerSortUp { + background-image: url(images/sort_up.gif); +} +table.sortable th.headerSortDown { + background-image: url(images/sort_down.gif); +} + +/* LTR content in RTL layout */ +.ltr { + /* @noflip */ + direction: ltr; + unicode-bidi: embed; +} +#mw-clearyourcache, #mw-sitecsspreview, #mw-sitejspreview, #mw-usercsspreview, #mw-userjspreview { + direction: ltr; + unicode-bidi: embed; +} + +/* Correct user & content directionality when viewing a diff */ +.diff-currentversion-title, .diff { + direction: ltr; + unicode-bidi: embed; +} +/* @noflip */ .diff-contentalign-right td { + direction: rtl; + unicode-bidi: embed; +} +/* @noflip */ .diff-contentalign-left td { + direction: ltr; + unicode-bidi: embed; +} +.diff-otitle, .diff-ntitle, .diff-lineno { + direction: ltr !important; + unicode-bidi: embed; +} + +#mw-revision-info, #mw-revision-nav { + direction: ltr; +} + +/* Images */ +/* @noflip */div.tright, div.floatright, table.floatright { + clear: right; + float: right; +} +/* @noflip */div.tleft, div.floatleft, table.floatleft { + float: left; + clear: left; +} +div.floatright, table.floatright, div.floatleft, table.floatleft { + position: relative; +} +/* bug 12205 */ +#mw-credits a { unicode-bidi: embed; } diff --git a/skins/common/upload.js b/skins/common/upload.js index c877620b..99917c75 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -35,11 +35,6 @@ window.wgUploadSetup = function() { } } - // Toggle source type - var sourceTypeCheckboxes = document.getElementsByName( 'wpSourceType' ); - for ( var i = 0; i < sourceTypeCheckboxes.length; i++ ) { - sourceTypeCheckboxes[i].onchange = toggleUploadInputs; - } // AJAX wpDestFile warnings if ( wgAjaxUploadDestCheck ) { @@ -86,44 +81,6 @@ window.wgUploadSetup = function() { }; }; -/** - * Iterate over all upload source fields and disable all except the selected one. - * - * @return emptiness - */ -window.toggleUploadInputs = function() { - // Iterate over all rows with UploadSourceField - var rows; - if ( document.getElementsByClassName ) { - rows = document.getElementsByClassName( 'mw-htmlform-field-UploadSourceField' ); - } else { - // Older browsers don't support getElementsByClassName - rows = new Array(); - - var allRows = document.getElementsByTagName( 'tr' ); - for ( var i = 0; i < allRows.length; i++ ) { - if ( allRows[i].className == 'mw-htmlform-field-UploadSourceField' ) - rows.push( allRows[i] ); - } - } - - for ( var i = 0; i < rows.length; i++ ) { - var inputs = rows[i].getElementsByTagName( 'input' ); - - // Check if this row is selected - var isChecked = true; // Default true in case wpSourceType is not found - for ( var j = 0; j < inputs.length; j++ ) { - if ( inputs[j].name == 'wpSourceType' ) - isChecked = inputs[j].checked; - } - - // Disable all unselected rows - for ( var j = 0; j < inputs.length; j++ ) { - if ( inputs[j].type != 'radio') - inputs[j].disabled = !isChecked; - } - } -}; window.wgUploadWarningObj = { 'responseCache' : { '' : ' ' }, @@ -289,11 +246,7 @@ window.toggleFilenameFiller = function() { if(!document.getElementById) return; var upfield = document.getElementById('wpUploadFile'); var destName = document.getElementById('wpDestFile').value; - if (destName=='' || destName==' ') { - wgUploadAutoFill = true; - } else { - wgUploadAutoFill = false; - } + wgUploadAutoFill = ( destName == '' || destName == ' ' ); }; window.wgUploadLicenseObj = { diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index fcf2713e..5cb037be 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -136,42 +136,6 @@ if ( 'wgBreakFrames' in window && window.wgBreakFrames ) { } } -window.showTocToggle = function() { - if ( document.createTextNode ) { - // Uses DOM calls to avoid document.write + XHTML issues - - var linkHolder = document.getElementById( 'toctitle' ); - var existingLink = document.getElementById( 'togglelink' ); - if ( !linkHolder || existingLink ) { - // Don't add the toggle link twice - return; - } - - var outerSpan = document.createElement( 'span' ); - outerSpan.className = 'toctoggle'; - - var toggleLink = document.createElement( 'a' ); - toggleLink.id = 'togglelink'; - toggleLink.className = 'internal'; - toggleLink.href = '#'; - addClickHandler( toggleLink, function( evt ) { toggleToc(); return killEvt( evt ); } ); - - toggleLink.appendChild( document.createTextNode( mediaWiki.msg( 'hidetoc' ) ) ); - - outerSpan.appendChild( document.createTextNode( '[' ) ); - outerSpan.appendChild( toggleLink ); - outerSpan.appendChild( document.createTextNode( ']' ) ); - - linkHolder.appendChild( document.createTextNode( ' ' ) ); - linkHolder.appendChild( outerSpan ); - - var cookiePos = document.cookie.indexOf( "hidetoc=" ); - if ( cookiePos > -1 && document.cookie.charAt( cookiePos + 8 ) == 1 ) { - toggleToc(); - } - } -}; - window.changeText = function( el, newText ) { // Safari work around if ( el.innerText ) { @@ -192,25 +156,6 @@ window.killEvt = function( evt ) { return false; // Don't follow the link (IE) }; -window.toggleToc = function() { - var tocmain = document.getElementById( 'toc' ); - var toc = document.getElementById('toc').getElementsByTagName('ul')[0]; - var toggleLink = document.getElementById( 'togglelink' ); - - if ( toc && toggleLink && toc.style.display == 'none' ) { - changeText( toggleLink, mediaWiki.msg( 'hidetoc' ) ); - toc.style.display = 'block'; - document.cookie = "hidetoc=0"; - tocmain.className = 'toc'; - } else { - changeText( toggleLink, mediaWiki.msg( 'showtoc' ) ); - toc.style.display = 'none'; - document.cookie = "hidetoc=1"; - tocmain.className = 'toc tochidden'; - } - return false; -}; - window.mwEditButtons = []; window.mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js @@ -412,7 +357,7 @@ window.getInnerText = function( el ) { for ( var i = 0; i < l; i++ ) { switch ( cs[i].nodeType ) { case 1: // ELEMENT_NODE - str += ts_getInnerText( cs[i] ); + str += getInnerText( cs[i] ); break; case 3: // TEXT_NODE str += cs[i].nodeValue; @@ -572,380 +517,6 @@ window.redirectToFragment = function( fragment ) { } }; -/* - * Table sorting script based on one (c) 1997-2006 Stuart Langridge and Joost - * de Valk: - * http://www.joostdevalk.nl/code/sortable-table/ - * http://www.kryogenix.org/code/browser/sorttable/ - * - * @todo don't break on colspans/rowspans (bug 8028) - * @todo language-specific digit grouping/decimals (bug 8063) - * @todo support all accepted date formats (bug 8226) - */ - -window.ts_image_path = stylepath + '/common/images/'; -window.ts_image_up = 'sort_up.gif'; -window.ts_image_down = 'sort_down.gif'; -window.ts_image_none = 'sort_none.gif'; -window.ts_europeandate = wgContentLanguage != 'en'; // The non-American-inclined can change to "true" -window.ts_alternate_row_colors = false; -window.ts_number_transform_table = null; -window.ts_number_regex = null; - -window.sortables_init = function() { - var idnum = 0; - // Find all tables with class sortable and make them sortable - var tables = getElementsByClassName( document, 'table', 'sortable' ); - for ( var ti = 0; ti < tables.length ; ti++ ) { - if ( !tables[ti].id ) { - tables[ti].setAttribute( 'id', 'sortable_table_id_' + idnum ); - ++idnum; - } - ts_makeSortable( tables[ti] ); - } -}; - -window.ts_makeSortable = function( table ) { - var firstRow; - if ( table.rows && table.rows.length > 0 ) { - if ( table.tHead && table.tHead.rows.length > 0 ) { - firstRow = table.tHead.rows[table.tHead.rows.length-1]; - } else { - firstRow = table.rows[0]; - } - } - if ( !firstRow ) { - return; - } - - // We have a first row: assume it's the header, and make its contents clickable links - for ( var i = 0; i < firstRow.cells.length; i++ ) { - var cell = firstRow.cells[i]; - if ( (' ' + cell.className + ' ').indexOf(' unsortable ') == -1 ) { - $(cell).append ( '<a href="#" class="sortheader" ' - + 'onclick="ts_resortTable(this);return false;">' - + '<span class="sortarrow">' - + '<img src="' - + ts_image_path - + ts_image_none - + '" alt="↓"/></span></a>'); - } - } - if ( ts_alternate_row_colors ) { - ts_alternate( table ); - } -}; - -window.ts_getInnerText = function( el ) { - return getInnerText( el ); -}; - -window.ts_resortTable = function( lnk ) { - // get the span - var span = lnk.getElementsByTagName('span')[0]; - - var td = lnk.parentNode; - var tr = td.parentNode; - var column = td.cellIndex; - - var table = tr.parentNode; - while ( table && !( table.tagName && table.tagName.toLowerCase() == 'table' ) ) { - table = table.parentNode; - } - if ( !table ) { - return; - } - - if ( table.rows.length <= 1 ) { - return; - } - - // Generate the number transform table if it's not done already - if ( ts_number_transform_table === null ) { - ts_initTransformTable(); - } - - // Work out a type for the column - // Skip the first row if that's where the headings are - var rowStart = ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 ); - var bodyRows = 0; - if (rowStart == 0 && table.tBodies) { - for (var i=0; i < table.tBodies.length; i++ ) { - bodyRows += table.tBodies[i].rows.length; - } - if (bodyRows < table.rows.length) - rowStart = 1; - } - - var itm = ''; - for ( var i = rowStart; i < table.rows.length; i++ ) { - if ( table.rows[i].cells.length > column ) { - itm = ts_getInnerText(table.rows[i].cells[column]); - itm = itm.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, ''); - if ( itm != '' ) { - break; - } - } - } - - // TODO: bug 8226, localised date formats - var sortfn = ts_sort_generic; - var preprocessor = ts_toLowerCase; - if ( /^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/.test( itm ) ) { - preprocessor = ts_dateToSortKey; - } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/.test( itm ) ) { - preprocessor = ts_dateToSortKey; - } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d$/.test( itm ) ) { - preprocessor = ts_dateToSortKey; - // (minus sign)([pound dollar euro yen currency]|cents) - } else if ( /(^([-\u2212] *)?[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/.test( itm ) ) { - preprocessor = ts_currencyToSortKey; - } else if ( ts_number_regex.test( itm ) ) { - preprocessor = ts_parseFloat; - } - - var reverse = ( span.getAttribute( 'sortdir' ) == 'down' ); - - var newRows = new Array(); - var staticRows = new Array(); - for ( var j = rowStart; j < table.rows.length; j++ ) { - var row = table.rows[j]; - if( (' ' + row.className + ' ').indexOf(' unsortable ') < 0 ) { - var keyText = ts_getInnerText( row.cells[column] ); - if( keyText === undefined ) { - keyText = ''; - } - var oldIndex = ( reverse ? -j : j ); - var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, '') ); - - newRows[newRows.length] = new Array( row, preprocessed, oldIndex ); - } else { - staticRows[staticRows.length] = new Array( row, false, j-rowStart ); - } - } - - newRows.sort( sortfn ); - - var arrowHTML; - if ( reverse ) { - arrowHTML = '<img src="' + ts_image_path + ts_image_down + '" alt="↓"/>'; - newRows.reverse(); - span.setAttribute( 'sortdir', 'up' ); - } else { - arrowHTML = '<img src="' + ts_image_path + ts_image_up + '" alt="↑"/>'; - span.setAttribute( 'sortdir', 'down' ); - } - - for ( var i = 0; i < staticRows.length; i++ ) { - var row = staticRows[i]; - newRows.splice( row[2], 0, row ); - } - - // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones - // don't do sortbottom rows - for ( var i = 0; i < newRows.length; i++ ) { - if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') == -1 ) { - table.tBodies[0].appendChild( newRows[i][0] ); - } - } - // do sortbottom rows only - for ( var i = 0; i < newRows.length; i++ ) { - if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') != -1 ) { - table.tBodies[0].appendChild( newRows[i][0] ); - } - } - - // Delete any other arrows there may be showing - var spans = getElementsByClassName( tr, 'span', 'sortarrow' ); - for ( var i = 0; i < spans.length; i++ ) { - spans[i].innerHTML = '<img src="' + ts_image_path + ts_image_none + '" alt="↓"/>'; - } - span.innerHTML = arrowHTML; - - if ( ts_alternate_row_colors ) { - ts_alternate( table ); - } -}; - -window.ts_initTransformTable = function() { - if ( typeof wgSeparatorTransformTable == 'undefined' - || ( wgSeparatorTransformTable[0] == '' && wgDigitTransformTable[2] == '' ) ) - { - var digitClass = "[0-9,.]"; - ts_number_transform_table = false; - } else { - ts_number_transform_table = {}; - // Unpack the transform table - // Separators - var ascii = wgSeparatorTransformTable[0].split("\t"); - var localised = wgSeparatorTransformTable[1].split("\t"); - for ( var i = 0; i < ascii.length; i++ ) { - ts_number_transform_table[localised[i]] = ascii[i]; - } - // Digits - ascii = wgDigitTransformTable[0].split("\t"); - localised = wgDigitTransformTable[1].split("\t"); - for ( var i = 0; i < ascii.length; i++ ) { - ts_number_transform_table[localised[i]] = ascii[i]; - } - - // Construct regex for number identification - var digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ',', '\\.']; - var maxDigitLength = 1; - for ( var digit in ts_number_transform_table ) { - // Escape regex metacharacters - digits.push( - digit.replace( /[\\\\$\*\+\?\.\(\)\|\{\}\[\]\-]/, - function( s ) { return '\\' + s; } ) - ); - if ( digit.length > maxDigitLength ) { - maxDigitLength = digit.length; - } - } - if ( maxDigitLength > 1 ) { - var digitClass = '[' + digits.join( '', digits ) + ']'; - } else { - var digitClass = '(' + digits.join( '|', digits ) + ')'; - } - } - - // We allow a trailing percent sign, which we just strip. This works fine - // if percents and regular numbers aren't being mixed. - ts_number_regex = new RegExp( - "^(" + - "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific - "|" + - "[-+\u2212]?" + digitClass + "+%?" + // Generic localised - ")$", "i" - ); -}; - -window.ts_toLowerCase = function( s ) { - return s.toLowerCase(); -}; - -window.ts_dateToSortKey = function( date ) { - // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX - if ( date.length == 11 ) { - switch ( date.substr( 3, 3 ).toLowerCase() ) { - case 'jan': - var month = '01'; - break; - case 'feb': - var month = '02'; - break; - case 'mar': - var month = '03'; - break; - case 'apr': - var month = '04'; - break; - case 'may': - var month = '05'; - break; - case 'jun': - var month = '06'; - break; - case 'jul': - var month = '07'; - break; - case 'aug': - var month = '08'; - break; - case 'sep': - var month = '09'; - break; - case 'oct': - var month = '10'; - break; - case 'nov': - var month = '11'; - break; - case 'dec': - var month = '12'; - break; - // default: var month = '00'; - } - return date.substr( 7, 4 ) + month + date.substr( 0, 2 ); - } else if ( date.length == 10 ) { - if ( ts_europeandate == false ) { - return date.substr( 6, 4 ) + date.substr( 0, 2 ) + date.substr( 3, 2 ); - } else { - return date.substr( 6, 4 ) + date.substr( 3, 2 ) + date.substr( 0, 2 ); - } - } else if ( date.length == 8 ) { - var yr = date.substr( 6, 2 ); - if ( parseInt( yr ) < 50 ) { - yr = '20' + yr; - } else { - yr = '19' + yr; - } - if ( ts_europeandate == true ) { - return yr + date.substr( 3, 2 ) + date.substr( 0, 2 ); - } else { - return yr + date.substr( 0, 2 ) + date.substr( 3, 2 ); - } - } - return '00000000'; -}; - -window.ts_parseFloat = function( s ) { - if ( !s ) { - return 0; - } - if ( ts_number_transform_table != false ) { - var newNum = '', c; - - for ( var p = 0; p < s.length; p++ ) { - c = s.charAt( p ); - if ( c in ts_number_transform_table ) { - newNum += ts_number_transform_table[c]; - } else { - newNum += c; - } - } - s = newNum; - } - var num = parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') ); - return ( isNaN( num ) ? -Infinity : num ); -}; - -window.ts_currencyToSortKey = function( s ) { - return ts_parseFloat(s.replace(/[^-\u22120-9.,]/g,'')); -}; - -window.ts_sort_generic = function( a, b ) { - return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2]; -}; - -window.ts_alternate = function( table ) { - // Take object table and get all it's tbodies. - var tableBodies = table.getElementsByTagName( 'tbody' ); - // Loop through these tbodies - for ( var i = 0; i < tableBodies.length; i++ ) { - // Take the tbody, and get all it's rows - var tableRows = tableBodies[i].getElementsByTagName( 'tr' ); - // Loop through these rows - // Start at 1 because we want to leave the heading row untouched - for ( var j = 0; j < tableRows.length; j++ ) { - // Check if j is even, and apply classes for both possible results - var oldClasses = tableRows[j].className.split(' '); - var newClassName = ''; - for ( var k = 0; k < oldClasses.length; k++ ) { - if ( oldClasses[k] != '' && oldClasses[k] != 'even' && oldClasses[k] != 'odd' ) { - newClassName += oldClasses[k] + ' '; - } - } - tableRows[j].className = newClassName + ( j % 2 == 0 ? 'even' : 'odd' ); - } - } -}; - -/* - * End of table sorting code - */ - - /** * Add a cute little box at the top of the screen to inform the user of * something, replacing any preexisting message. @@ -1041,11 +612,6 @@ window.runOnloadHook = function() { // might cause the function to terminate prematurely doneOnloadHook = true; - updateTooltipAccessKeys( null ); - setupCheckboxShiftClick(); - - jQuery( document ).ready( sortables_init ); - // Run any added-on functions for ( var i = 0; i < onloadFuncts.length; i++ ) { onloadFuncts[i](); @@ -1101,6 +667,4 @@ hookEvent( 'load', runOnloadHook ); if ( ie6_bugs ) { importScriptURI( stylepath + '/common/IEFixes.js' ); -} - -showTocToggle(); +}
\ No newline at end of file diff --git a/skins/modern/main.css b/skins/modern/main.css index 9dc17170..910a53bc 100644 --- a/skins/modern/main.css +++ b/skins/modern/main.css @@ -8,6 +8,9 @@ body { font-family: sans-serif; color: black; background-color: #f0f0f0; + + direction: ltr; + unicode-bidi: embed; } #mw_main, @@ -182,6 +185,7 @@ textarea { } ul { + /* @embed */ list-style-image: url(bullet.gif); } @@ -245,6 +249,7 @@ ul { #footer { background-color: #f0f0f0; + /* @embed */ background: url(footer-grad.png) repeat-x 0 0; padding: 10px 1em 1em 1em; clear:both; @@ -406,32 +411,38 @@ h1, h2, h3, h4, h5, h6 { } #mw_content a.external, -#mw_content a[href ^="gopher://"] { +#mw_content a.external[href ^="gopher://"] { + /* @embed */ background: url(external.png) center right no-repeat; padding-right: 13px; } -#mw_content a[href ^="https://"], +#mw_content a.external[href ^="https://"], .link-https { + /* @embed */ background: url(lock_icon.gif) center right no-repeat; padding-right: 16px; } -#mw_content a[href ^="mailto:"], +#mw_content a.external[href ^="mailto:"], .link-mailto { + /* @embed */ background: url(mail_icon.gif) center right no-repeat; padding-right: 18px; } -#mw_content a[href ^="news://"] { +#mw_content a.external[href ^="news://"] { + /* @embed */ background: url(news_icon.png) center right no-repeat; padding-right: 18px; } -#mw_content a[href ^="ftp://"], +#mw_content a.external[href ^="ftp://"], .link-ftp { + /* @embed */ background: url(file_icon.gif) center right no-repeat; padding-right: 18px; } -#mw_content a[href ^="irc://"], -#mw_content a.extiw[href ^="irc://"], +#mw_content a.external[href ^="irc://"], +#mw_content a.external[href ^="ircs://"], .link-irc { + /* @embed */ background: url(discussionitem_icon.gif) center right no-repeat; padding-right: 18px; } @@ -443,6 +454,7 @@ h1, h2, h3, h4, h5, h6 { #mw_content a.external[href $=".wav"], #mw_content a.external[href $=".WAV"], #mw_content a.external[href $=".wma"], #mw_content a.external[href $=".WMA"], .link-audio { + /* @embed */ background: url("audio.png") center right no-repeat; padding-right: 13px; } @@ -451,6 +463,7 @@ h1, h2, h3, h4, h5, h6 { #mw_content a.external[href $=".mpeg"], #mw_content a.external[href $=".MPEG"], #mw_content a.external[href $=".mpg"], #mw_content a.external[href $=".MPG"], .link-video { + /* @embed */ background: url("video.png") center right no-repeat; padding-right: 13px; } @@ -458,15 +471,13 @@ h1, h2, h3, h4, h5, h6 { #mw_content a.external[href *=".pdf#"], #mw_content a.external[href *=".PDF#"], #mw_content a.external[href *=".pdf?"], #mw_content a.external[href *=".PDF?"], .link-document { + /* @embed */ background: url("document.png") center right no-repeat; padding-right: 12px; } /* images */ -div.floatright, table.floatright { - clear: right; - float: right; - position: relative; +/* @noflip */div.floatright, table.floatright { margin: 0 0 .5em .5em; border: 0; /* @@ -475,10 +486,7 @@ div.floatright, table.floatright { */ } div.floatright p { font-style: italic; } -div.floatleft, table.floatleft { - float: left; - clear: left; - position: relative; +/* @noflip */div.floatleft, table.floatleft { margin: 0 .5em .5em 0; border: 0; /* @@ -521,22 +529,15 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } -div.tright { - clear: right; - float: right; +/* @noflip */div.tright { margin: .5em 0 .8em 1.4em; } -div.tleft { - float: left; - clear: left; +/* @noflip */div.tleft { margin: .5em 1.4em .8em 0; } img.thumbborder { border: 1px solid #dddddd; } -.hiddenStructure { - display: none; -} .mw-warning { border: 1px solid #aaa; background-color: #f9f9f9; @@ -584,7 +585,7 @@ img.thumbborder { list-style-type: none; list-style-image: none; margin: 0 1em 0 1em; - padding-left: 0; + padding: 0; text-align: left; } @@ -621,15 +622,12 @@ img.thumbborder { #mw_content a.extiw, #mw_content a.extiw:active { color: #36b; - background: none; - padding: 0; } #mw_content a.external { color: #36b; } - .redirectText { font-size: 150%; margin: 5px; @@ -793,6 +791,7 @@ ul { list-style-type: square; margin: .3em 0 0 1.5em; padding: 0; + /* @embed */ list-style-image: url(bullet.gif); } ol { @@ -836,6 +835,7 @@ pre { border-collapse: collapse; margin: 0 -1em 1em -1em; padding: 0 0 8px 0; + /* @embed */ background: url(footer-grad.png) repeat-x bottom left; } @@ -880,4 +880,20 @@ pre { /* Tooltips are outside of the normal body code, so this helps make the size of the text sensible */ .tipsy { font-size: 130%; -}
\ No newline at end of file +} + +/** + * Lists: + * The following lines don't have a visible effect on non-Gecko browsers + * They fix a problem ith Gecko browsers rendering lists to the right of + * left-floated objects in an RTL layout. + */ +/* @noflip */ +html > body.rtl div#mw_contentholder ul { + display: table; +} + +/* @noflip */ +html > body.rtl div#mw_contentholder ul#filetoc { + display: block; +} diff --git a/skins/modern/rtl.css b/skins/modern/rtl.css deleted file mode 100644 index 66d9017a..00000000 --- a/skins/modern/rtl.css +++ /dev/null @@ -1,162 +0,0 @@ -body { - direction: rtl; - unicode-bidi: embed; -} - -.editsection { - float: left; - margin-right: 5px; - margin-left: 0; /* bug 9122: undo default LTR */ -} - -/* Fix alignment */ -.documentByLine, -.portletDetails, -.portletMore { - text-align: left; -} - -div div.thumbcaption { - text-align: right; -} - -div.magnify { - left: auto; - right: 0; -} - -/* Fix margins for non-css2 browsers */ -/* top right bottom left */ - -dd { - margin-left: 0; - margin-right: 1.6em; -} -.tocindent { - margin-left: 0; - margin-right: 2em; -} -div.tright, div.floatright, table.floatright { - clear: none; -} -div.tleft, div.floatleft, table.floatleft { - clear: left; -} - -/* Fix link icons */ -.external, a.feedlink { - padding: 0 !important; - background: none !important; -} - -/* js pref toc */ - -#preftoc { - margin-right: 1em; -} - -.errorbox, .successbox, #preftoc li, .prefsection fieldset { - float: right; -} - -.prefsection { - padding-right: 2em; -} - -/* workaround for moz bug, displayed bullets on left side */ - -#toc ul { - text-align: right; -} - -#toc ul ul { - margin: 0 2em 0 0; -} - -input#wpSave, input#wpDiff { - margin-right: 0; - margin-left: .33em; -} - -#userlogin { - margin: 0 0 1em 3em; -} -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons { - float: left; -} - -.toggle { - margin-left: 0em; - margin-right: 2em; -} -table.filehistory th { - text-align: right; -} - -#mw_contentwrapper { - margin: 0 -15em 0 0; - float: left; -} - -#mw_content { - margin: 0 14em 0 0; - border-left: none; - border-right: solid 1px #bbbbbb; -} - -.portlet ul { - margin: 0 1.5em 0 0; - padding: 0 0 0 0; -} - -.portlet h5 { - padding: 0.1em 1em 0.3em 0; -} - -#p-cactions li { - float: right; -} - -#p-personal li { - float: right; -} - -#p-cactions { - margin: 0 14em 0 0; -} - -#mw_portlets { - border-right: none; - border-left: solid 1px #bbbbbb; -} - -/** - * Lists: - * The following lines don't have a visible effect on non-Gecko browsers - * They fix a problem ith Gecko browsers rendering lists to the right of - * left-floated objects in an RTL layout. - */ -html > body div#mw_contentholder ul { - display: table; -} -html > body div#mw_contentholder ul li { - margin-right:10px; -} -html > body div.pBody ul li { - margin-right:4px; -} -html > body div#mw_contentholder ul#filetoc { - display: block; -} - -/* Special:Allpages styling */ -td.mw-allpages-nav, p.mw-allpages-nav, td.mw-allpages-alphaindexline { - text-align: left; -} - -/* Special:PrefixIndex styling */ -td#mw-prefixindex-nav-form { - text-align: left; -} diff --git a/skins/monobook/IE60Fixes.css b/skins/monobook/IE60Fixes.css index 56e0a16b..3bcd0479 100644 --- a/skins/monobook/IE60Fixes.css +++ b/skins/monobook/IE60Fixes.css @@ -11,16 +11,33 @@ div#column-content div#content { margin-top: 3em; height: 1%; } +.rtl div#column-content div#content { + margin-right: 12.2em; + margin-left: 0; +} div#column-one { position: absolute; top: 0; left: 0; z-index: 4; } +.rtl div#column-one { + left: auto; + right: 0; +} div#footer { margin-left: 13.6em; border-left: 1px solid #fabd23; } +.rtl div#footer { + margin-left: 0; + margin-right: 13.6em; + border-left: none; + border-right: 1px solid #fabd23; +} + + /* the tabs */ + /* the tabs */ @@ -85,7 +102,6 @@ textarea { width: 96%; } -div.editsection, #catlinks, div.tright, div.tleft { diff --git a/skins/monobook/IE70Fixes.css b/skins/monobook/IE70Fixes.css index 91b39efd..fc009e6e 100644 --- a/skins/monobook/IE70Fixes.css +++ b/skins/monobook/IE70Fixes.css @@ -9,6 +9,9 @@ div#column-content div#content { height: 1%; } +.rtl div#column-content div#content { margin-right: 12.2em; margin-left: 0; } + + .rtl div#column-one { /* For some reason it tries to inherit the padding-top into every div, * and I can't figure out how to get it back off. @@ -18,9 +21,13 @@ div#column-content div#content { margin-top: 160px; } -.rtl #bodyContent a.external { - background-image: url(external-rtl.png); - padding: 0 13px 0 0; +/* These elements also have padding-left: 20px; in main.css, but in RTL mode this is flipped. + * That's good in normal browsers, but in IE7 it needs to not be flipped for some daft reason. + * Also clear the right margin (originally margin-left: 1em) + */ +li#pt-userpage, li#pt-anonuserpage, li#pt-login { + padding-left: 20px; + margin-right: 0; } .rtl a.feedlink { @@ -69,7 +76,6 @@ textarea { } /* -div.editsection, #catlinks, div.tright, div.tleft { diff --git a/skins/monobook/external.png b/skins/monobook/external-ltr.png Binary files differindex acf260fc..acf260fc 100644 --- a/skins/monobook/external.png +++ b/skins/monobook/external-ltr.png diff --git a/skins/monobook/main.css b/skins/monobook/main.css index d2330eba..edf79abb 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -41,10 +41,13 @@ div#content { body { font: x-small sans-serif; + /* @embed */ background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; color: black; margin: 0; padding: 0; + direction: ltr; /* Needed for RTL flipping */ + unicode-bidi: embed; } /* scale back up to a sane default */ @@ -136,6 +139,7 @@ ul { list-style-type: square; margin: .3em 0 0 1.5em; padding: 0; + /* @embed */ list-style-image: url(bullet.gif); } ol { @@ -263,6 +267,7 @@ span.subpages { vertical-align: middle; } #siteNotice { + position: relative; text-align: center; font-size: 95%; padding: 0 0.9em; @@ -306,7 +311,7 @@ in the bottom-right corner of the content area */ margin-right: auto; } /* small for tables and similar */ -.small, .small * { +.small { font-size: 94%; } table.small { @@ -344,7 +349,7 @@ table.small { list-style-type: none; list-style-image: none; margin-left: 0; - padding-left: 0; + padding: 0; text-align: left; } #toc ul ul, @@ -363,10 +368,7 @@ table.small { } /* images */ -div.floatright, table.floatright { - clear: right; - float: right; - position: relative; +/* @noflip */div.floatright, table.floatright { margin: 0 0 .5em .5em; border: 0; /* @@ -375,10 +377,7 @@ div.floatright, table.floatright { */ } div.floatright p { font-style: italic; } -div.floatleft, table.floatleft { - float: left; - clear: left; - position: relative; +/* @noflip */div.floatleft, table.floatleft { margin: 0 .5em .5em 0; border: 0; /* @@ -421,22 +420,15 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } -div.tright { - clear: right; - float: right; +/* @noflip */div.tright { margin: .5em 0 1.3em 1.4em; } -div.tleft { - float: left; - clear: left; +/* @noflip */div.tleft { margin: .5em 1.4em 1.3em 0; } img.thumbborder { border: 1px solid #dddddd; } -.hiddenStructure { - display: none; -} /* ** classes for special content elements like town boxes @@ -476,36 +468,39 @@ table.rimage { */ #bodyContent a.external, #bodyContent a.external[href ^="gopher://"] { - background: url(external.png) center right no-repeat; - padding: 0 13px; -} -.rtl #bodyContent a.external, -.rtl #bodyContent a.external[href ^="gopher://"] { - background-image: url(external-rtl.png); + /* @embed */ + background: url(external-ltr.png) center right no-repeat; + padding-right: 13px; } #bodyContent a.external[href ^="https://"], .link-https { + /* @embed */ background: url(lock_icon.gif) center right no-repeat; - padding: 0 16px; + padding-right: 16px; } #bodyContent a.external[href ^="mailto:"], .link-mailto { + /* @embed */ background: url(mail_icon.gif) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href ^="news://"] { + /* @embed */ background: url(news_icon.png) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href ^="ftp://"], .link-ftp { + /* @embed */ background: url(file_icon.gif) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href ^="irc://"], +#bodyContent a.external[href ^="ircs://"], .link-irc { + /* @embed */ background: url(discussionitem_icon.gif) center right no-repeat; - padding: 0 18px; + padding-right: 18px; } #bodyContent a.external[href $=".ogg"], #bodyContent a.external[href $=".OGG"], #bodyContent a.external[href $=".mid"], #bodyContent a.external[href $=".MID"], @@ -514,49 +509,54 @@ table.rimage { #bodyContent a.external[href $=".wav"], #bodyContent a.external[href $=".WAV"], #bodyContent a.external[href $=".wma"], #bodyContent a.external[href $=".WMA"], .link-audio { + /* @embed */ background: url("audio.png") center right no-repeat; - padding: 0 13px; + padding-right: 13px; } #bodyContent a.external[href $=".ogm"], #bodyContent a.external[href $=".OGM"], #bodyContent a.external[href $=".avi"], #bodyContent a.external[href $=".AVI"], #bodyContent a.external[href $=".mpeg"], #bodyContent a.external[href $=".MPEG"], #bodyContent a.external[href $=".mpg"], #bodyContent a.external[href $=".MPG"], .link-video { + /* @embed */ background: url("video.png") center right no-repeat; - padding: 0 13px; + padding-right: 13px; } #bodyContent a.external[href $=".pdf"], #bodyContent a.external[href $=".PDF"], #bodyContent a.external[href *=".pdf#"], #bodyContent a.external[href *=".PDF#"], #bodyContent a.external[href *=".pdf?"], #bodyContent a.external[href *=".PDF?"], .link-document { + /* @embed */ background: url("document.png") center right no-repeat; - padding: 0 12px; -} - -/* for rtl wikis */ -.rtl #bodyContent a.external { - background-position: left; - padding-right: 0; -} -.rtl a.feedlink { - background-position: right; - padding-right: 16px; - padding-left: 0; + padding-right: 12px; } - -/* correction for ltr wikis */ -.ltr #bodyContent a.external { - padding-left: 0; -} - -/* disable interwiki styling */ + +/* Interwiki Styling */ #bodyContent a.extiw, #bodyContent a.extiw:active { color: #36b; + /* Don't show icons for interwiki links */ + background: none; + padding: 0; } +#bodyContent a.extiw:visited { + color: #636; +} +#bodyContent a.extiw:active { + color: #b63; +} + +/* External links */ #bodyContent a.external { color: #36b; } +#bodyContent a.external:visited { + color: #636; /* bug 3112 */ +} +#bodyContent a.external:active { + color: #b63; +} + /* ** Structural Elements */ @@ -617,6 +617,7 @@ table.rimage { .portlet ul { line-height: 1.5em; list-style-type: square; + /* @embed */ list-style-image: url(bullet.gif); font-size: 95%; } @@ -753,6 +754,7 @@ in bg url to hide it from iemac */ li#pt-userpage, li#pt-anonuserpage, li#pt-login { + /* @embed */ background: url(user.gif) top left no-repeat; padding-left: 20px; text-transform: none; @@ -848,9 +850,6 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print { border: 0; padding: 0; } -#p-cactions .hiddenStructure { - display: none; -} #p-cactions li a { text-transform: lowercase; } @@ -1007,10 +1006,6 @@ div#userlogin form#userlogin2 { background-color: #f9f9f9; float: left; } -.rtl div#userloginForm form, -.rtl div#userlogin form#userlogin2 { - float: right; -} div#userloginForm table, div#userlogin form#userlogin2 table { @@ -1080,7 +1075,6 @@ div#userloginForm .captcha { display: inline; margin-bottom: 0; } -* html div.editsection { font-size: smaller; } #pagehistory li.selected { position: relative; } /* Mac IE 5.0 fix; floated content turns invisible */ @@ -1254,4 +1248,4 @@ div.mw-lag-warn-high { /* Tooltips are outside of the normal body code, so this helps make the size of the text sensible */ .tipsy { font-size: 127%; -}
\ No newline at end of file +} diff --git a/skins/monobook/rtl.css b/skins/monobook/rtl.css deleted file mode 100644 index 52507676..00000000 --- a/skins/monobook/rtl.css +++ /dev/null @@ -1,251 +0,0 @@ -/* -Right-to-left fixes for MonoBook. -Places sidebar on right, tweaks various alignment issues. - -Works mostly ok nicely on Safari 1.2.1; fine in Mozilla. - -Safari bugs (1.2.1): -* Tabs are still appearing in left-to-right order. (Try after localizing) - -Opera bugs (7.23 linux): -* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other - -IE/mac bugs: -* The thing barfs on Hebrew and Arabic anyway, so no point testing. - -Missing features due to lack of support: -* external link icons - -To test: -* Opera6 -* IE 5.0 -* etc - -*/ -body { - direction: rtl; - unicode-bidi: embed; -} -div#column-content { - margin: 0 -12.2em 0 0; - float: left; -} -div#column-content div#content{ - margin-left: 0; - margin-right: 12.2em; - border-right: 1px solid #aaaaaa; - border-left: none; -} -html > body .portlet { - float: right; - clear: right; -} -.editsection { - float: left; - margin-right: 5px; - margin-left: 0; /* bug 9122: undo default LTR */ -} -/* recover IEMac (might be fine with the float, but usually it's close to IE */ -*>body .portlet { - float: none; - clear: none; -} -.pBody { - padding-right: 0.8em; - padding-left: 0.5em; -} - -/* Fix alignment */ -.documentByLine, -.portletDetails, -.portletMore, -#p-personal { - text-align: left; -} - -div div.thumbcaption { - text-align: right; -} - -div.magnify, -#p-logo { - left: auto; - right: 0; -} -#p-personal { - left: auto; - right: 0; -} - -#p-cactions { - left: auto; - right: 11.5em; - padding-left: 0; - padding-right: 1em; -} -#p-cactions li { - margin-left: 0.3em; - margin-right: 0; - float: right; -} -* html #p-cactions li a { - display: block; - padding-bottom: 0; -} -* html #p-cactions li a:hover { - padding-bottom: 0.2em; -} -/* offsets to distinguish the tab groups */ -li#ca-talk { - margin-right: auto; - margin-left: 1.6em; -} -li#ca-watch,li#ca-unwatch { - margin-right: 1.6em !important; -} - -/* Fix margins for non-css2 browsers */ -/* top right bottom left */ - -ul { - margin-left: 0; - margin-right: 1.5em; -} -ol { - margin-left: 0; - margin-right: 2.4em; -} -dd { - margin-left: 0; - margin-right: 1.6em; -} -#contentSub { - margin-right: 1em; - margin-left: 0; -} -.tocindent { - margin-left: 0; - margin-right: 2em; -} -div.tright, div.floatright, table.floatright { - clear: none; -} -div.tleft, div.floatleft, table.floatleft { - clear: left; -} -#p-personal li { - margin-left: 0; - margin-right: 1em; -} - -li#ca-talk, -li#ca-watch { - margin-right: auto; - margin-left: 1.6em; -} - -#p-personal li { - float: left; -} -/* Fix link icons -.external, a.feedlink { - padding: 0 !important; - background: none !important; -} -*/ -div#footer { - clear: both; -} -#f-poweredbyico { - float: left; - height: 1%; -} -#f-copyrightico { - float: right; - height: 1%; -} -* html div#footer { - margin-left: 0; - margin-right: 13.6em; - border-left: 0; - border-right: 1px solid #fabd23; -} -* html div#column-content { - float: none; - margin-left: 0; - margin-right: 0; -} -* html div#column-content div#content { - margin-left: 0; - margin-top: 3em; -} -* html div#column-one { right: 0; } - -/* js pref toc */ - -#preftoc { - margin-right: 1em; -} - -.errorbox, .successbox, #preftoc li, .prefsection fieldset { - float: right; -} - -.prefsection { - padding-right: 2em; -} - -/* workaround for moz bug, displayed bullets on left side */ - -#toc ul { - text-align: right; -} - -#toc ul ul { - margin: 0 2em 0 0; -} - -input#wpSave, input#wpDiff { - margin-right: 0; - margin-left: .33em; -} - -#userlogin { - margin: 0 0 1em 3em; -} -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons { - float: left; -} - -.toggle { - margin-left: 0em; - margin-right: 2em; -} -table.filehistory th { - text-align: right; -} - -/* Special:AllPages styling */ -td.mw-allpages-nav, p.mw-allpages-nav, td.mw-allpages-alphaindexline { - text-align: left; -} - -/* Special:PrefixIndex styling */ -td#mw-prefixindex-nav-form { - text-align: left; -} - -/** - * Lists: - * The following lines don't have a visible effect on non-Gecko browsers - * They fix a problem ith Gecko browsers rendering lists to the right of - * left-floated objects in an RTL layout. - */ -html > body div#article ul { - display: table; -} -html > body div#bodyContent ul#filetoc { - display: block; -} diff --git a/skins/common/nostalgia.css b/skins/nostalgia/screen.css index e1b774df..1cac7a73 100644 --- a/skins/common/nostalgia.css +++ b/skins/nostalgia/screen.css @@ -46,3 +46,6 @@ p.subtitle { padding-top: 0; margin-top: 0; } +div.sitenotice { + clear: both; +} diff --git a/skins/simple/main.css b/skins/simple/main.css index 8b65d4de..b4b24d23 100644 --- a/skins/simple/main.css +++ b/skins/simple/main.css @@ -198,32 +198,32 @@ pre { h1.firstHeading, h2 { border-bottom: solid 1px black; } -#bodyContent a[href ^="http://"], -#bodyContent a[href ^="gopher://"] { +#bodyContent a.external, +#bodyContent a.external[href ^="gopher://"] { background: url("external.png") center right no-repeat; padding-right: 13px; } -#bodyContent a[href ^="https://"], +#bodyContent a.external[href ^="https://"], .link-https { background: url("lock_icon.gif") center right no-repeat; padding-right: 16px; } -#bodyContent a[href ^="mailto:"], +#bodyContent a.external[href ^="mailto:"], .link-mailto { background: url("mail_icon.gif") center right no-repeat; padding-right: 18px; } -#bodyContent a[href ^="news://"] { +#bodyContent a.external[href ^="news://"] { background: url("news_icon.png") center right no-repeat; padding-right: 18px; } -#bodyContent a[href ^="ftp://"], +#bodyContent a.external[href ^="ftp://"], .link-ftp { background: url("file_icon.gif") center right no-repeat; padding-right: 18px; } -#bodyContent a[href ^="irc://"], -#bodyContent a.extiw[href ^="irc://"], +#bodyContent a.external[href ^="irc://"], +#bodyContent a.external[href ^="ircs://"], .link-irc { background: url("discussionitem_icon.gif") center right no-repeat; padding-right: 18px; @@ -232,8 +232,6 @@ h1.firstHeading, h2 { #bodyContent a.extiw, #bodyContent a.extiw:active { color: #5E7CFF; - background: none; - padding: 0; } td.diff-addedline { @@ -257,19 +255,13 @@ div.tocindent { border-bottom: solid 1px black; } -div.floatright, table.floatright { - clear: right; - float: right; +/* @noflip */div.floatright, table.floatright { margin: 0; - position: relative; border-width: 0.5em 0 0.8em 1.4em; } div.floatright p { font-style: italic; } -div.floatleft, table.floatleft { - float: left; - clear: left; +/* @noflip */div.floatleft, table.floatleft { margin: 0.3em 0.5em 0.5em 0; - position: relative; border-width: 0.5em 1.4em 0.8em 0; } div.floatleft p { font-style: italic; } @@ -300,14 +292,10 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } -div.tright { - clear: right; - float: right; +/* @noflip */div.tright { border-width: 0.5em 0 0.8em 1.4em; } -div.tleft { - float: left; - clear: left; +/* @noflip */div.tleft { margin-right:0.5em; border-width: 0.5em 1.4em 0.8em 0; } @@ -323,6 +311,13 @@ a.new, li.new { text-decoration: line-through; } +/** + * Overrides text justification (user preference) + * See bug 31990 + */ +#catlinks { + text-align: center; +} .catlinks { text-align: center; width: 80%; diff --git a/skins/vector/images/arrow-down-icon.png b/skins/vector/images/arrow-down-icon.png Binary files differindex 437b9518..90c907bf 100644 --- a/skins/vector/images/arrow-down-icon.png +++ b/skins/vector/images/arrow-down-icon.png diff --git a/skins/vector/images/user-icon.png b/skins/vector/images/user-icon.png Binary files differindex 2fbfe4e5..a3b38b3a 100644 --- a/skins/vector/images/user-icon.png +++ b/skins/vector/images/user-icon.png diff --git a/skins/vector/screen.css b/skins/vector/screen.css index 703db0ab..a7428473 100644 --- a/skins/vector/screen.css +++ b/skins/vector/screen.css @@ -165,10 +165,6 @@ div#mw-head h5 { height: 1.9em; padding-left: 0.5em; padding-right: 0.5em; - /* @embed */ - background-image: url(images/tab-break.png); - background-position: bottom right; - background-repeat: no-repeat; color: #0645ad; cursor: pointer; font-size: 0.8em; @@ -177,6 +173,10 @@ div#mw-head h5 { div.vectorTabs li > a { display: block; } + div.vectorTabs li.icon a { + background-position: bottom right; + background-repeat: no-repeat; + } /* OVERRIDDEN BY COMPLIANT BROWSERS */ div.vectorTabs span a { display: inline-block; @@ -188,6 +188,13 @@ div#mw-head h5 { float: left; display: block; } + div.vectorTabs span { + display: inline-block; + /* @embed */ + background-image: url(images/tab-break.png); + background-position: bottom right; + background-repeat: no-repeat; + } div.vectorTabs li.selected a, div.vectorTabs li.selected a:visited{ color: #333333; @@ -204,10 +211,15 @@ div#mw-head h5 { float: left; /* @embed */ background-image: url(images/arrow-down-icon.png); - background-position: 100% 60%; + background-position: 0px 60%; background-repeat: no-repeat; cursor: pointer; } + div.vectorMenuFocus { + /* @embed */ + background-image: url(images/arrow-down-focus-icon.png); + background-position: 100% 60%; + } /* @noflip */ body.rtl div.vectorMenu { direction: rtl; @@ -280,7 +292,8 @@ div#mw-head h5 { x:-moz-any-link { margin-left: 23px; } - div.vectorMenu:hover div.menu { + /* Enable forcing showing of the menu for accessibility */ + div.vectorMenu:hover div.menu, div.vectorMenu div.menuForceShow { display: block; } div.vectorMenu ul { @@ -411,13 +424,14 @@ div#mw-head h5 { right: 0; top: 0; padding: 0; - padding-top: 0.2em; + padding-top: 0.3em; padding-bottom: 0.2em; padding-right: 0.4em; margin: 0; border: none; cursor: pointer; background-color: transparent; + background-image: none; } /* OVERRIDDEN BY COMPLIANT BROWSERS */ div#simpleSearch button#searchButton img { @@ -522,6 +536,7 @@ div#footer #footer-icons li { float: left; margin-left: 0.5em; line-height: 2em; + text-align: right; } div#footer #footer-places li { float: left; @@ -617,15 +632,15 @@ div#footer #footer-places li { /* @embed */ background-image: url(images/preferences-base.png); } +#preferences fieldset { + border: none; + border-top: solid 1px #cccccc; +} #preferences fieldset.prefsection { border: none; padding: 0; margin: 1em; } -#preferences fieldset.prefsection fieldset { - border: none; - border-top: solid 1px #cccccc; -} #preferences legend { color: #666666; } @@ -781,7 +796,7 @@ pre { border: 1px dashed #2f6fab; color: black; background-color: #f9f9f9; - line-height: 1.1em; + line-height: 1.3em; } ul { line-height: 1.5em; @@ -871,7 +886,7 @@ select { list-style-type: none; list-style-image: none; margin-left: 0; - padding-left: 0; + padding: 0; text-align: left; } #toc ul ul, @@ -883,18 +898,12 @@ select { font-size: 94%; } /* Images */ -div.floatright, table.floatright { - clear: right; - float: right; - position: relative; +/* @noflip */div.floatright, table.floatright { margin: 0 0 .5em .5em; border: 0; } div.floatright p { font-style: italic; } -div.floatleft, table.floatleft { - float: left; - clear: left; - position: relative; +/* @noflip */div.floatleft, table.floatleft { margin: 0 .5em .5em 0; border: 0; } @@ -933,24 +942,15 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } -/* @noflip */ -div.tright { - clear: right; - float: right; +/* @noflip */div.tright { margin: .5em 0 1.3em 1.4em; } -/* @noflip */ -div.tleft { - float: left; - clear: left; +/* @noflip */div.tleft { margin: .5em 1.4em 1.3em 0; } img.thumbborder { border: 1px solid #dddddd; } -.hiddenStructure { - display: none; -} /* Warning */ .mw-warning { margin-left: 50px; @@ -1012,7 +1012,7 @@ span.subpages { margin-right: auto; } /* Small for tables and similar */ -.small, .small * { +.small { font-size: 94%; } table.small { @@ -1035,36 +1035,36 @@ h3, h4, h5 { padding-bottom: 0; } div#content a.external, -div#content a[href ^="gopher://"] { +div#content a.external[href ^="gopher://"] { /* @embed */ background: url(images/external-link-ltr-icon.png) center right no-repeat; padding-right: 13px; } -div#content a[href ^="https://"], +div#content a.external[href ^="https://"], .link-https { /* @embed */ background: url(images/lock-icon.png) center right no-repeat; padding-right: 13px; } -div#content a[href ^="mailto:"], +div#content a.external[href ^="mailto:"], .link-mailto { /* @embed */ background: url(images/mail-icon.png) center right no-repeat; padding-right: 13px; } -div#content a[href ^="news://"] { +div#content a.external[href ^="news://"] { /* @embed */ background: url(images/news-icon.png) center right no-repeat; padding-right: 13px; } -div#content a[href ^="ftp://"], +div#content a.external[href ^="ftp://"], .link-ftp { /* @embed */ background: url(images/file-icon.png) center right no-repeat; padding-right: 13px; } -div#content a[href ^="irc://"], -div#content a.extiw[href ^="irc://"], +div#content a.external[href ^="irc://"], +div#content a.external[href ^="ircs://"], .link-irc { /* @embed */ background: url(images/talk-icon.png) center right no-repeat; @@ -1098,16 +1098,34 @@ div#content a.external[href *=".pdf?"], div#content a.external[href *=".PDF?"], background: url("images/document-icon.png?2") center right no-repeat; padding-right: 13px; } -/* Interwiki Styling (Disabled) */ + +/* Interwiki Styling */ div#content a.extiw, div#content a.extiw:active { color: #36b; + /* Don't show icons for interwiki links */ background: none; padding: 0; } +div#content a.extiw:visited { + color: #636; +} +div#content a.extiw:active { + color: #b63; +} + +/* External links */ div#content a.external { color: #36b; } +div#content a.external:visited { + color: #636; /* bug 3112 */ +} +div#content a.external:active { + color: #b63; +} + + div#content .printfooter { display: none; } @@ -1121,6 +1139,14 @@ div#content .printfooter { text-transform: none; } +.redirectText { + font-size: 140%; +} + +.redirectMsg img { + vertical-align: text-bottom; +} + .toccolours { border: 1px solid #aaa; background-color: #f9f9f9; @@ -1139,10 +1165,6 @@ div#bodyContent { } /* Watch/Unwatch Icon Styling */ -#ca-unwatch.icon, -#ca-watch.icon { - margin-right:1px; -} #ca-unwatch.icon a, #ca-watch.icon a { margin: 0; @@ -1191,13 +1213,7 @@ div.vectorTabs ul { background-repeat:no-repeat; } -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons { - float: right; -} - /* Tooltips are outside of the normal body code, so this helps make the size of the text sensible */ .tipsy { font-size: 0.8em; -}
\ No newline at end of file +} diff --git a/skins/vector/vector.js b/skins/vector/vector.js new file mode 100644 index 00000000..757f7c8c --- /dev/null +++ b/skins/vector/vector.js @@ -0,0 +1,19 @@ +/* + * Vector-specific scripts + */ +jQuery( function( $ ) { + var $pCactions = $( '#p-cactions' ); + $pCactions.find( 'h5 a' ) + // For accessibility, show the menu when the hidden link in the menu is clicked (bug 24298) + .click( function( e ) { + $pCactions.find( '.menu' ).toggleClass( 'menuForceShow' ); + e.preventDefault(); + }) + // When the hidden link has focus, also set a class that will change the arrow icon + .focus( function() { + $pCactions.addClass( 'vectorMenuFocus' ); + }) + .blur( function() { + $pCactions.removeClass( 'vectorMenuFocus' ); + }); +}); |