From cecb985bee3bdd252e1b8dc0bd500b37cd52be01 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 16 May 2007 20:58:53 +0000 Subject: Aktualisierung auf MediaWiki 1.10.0 Plugins angepasst und verbessert kleine Korrekturen am Design --- skins/Chick.deps.php | 2 +- skins/Chick.php | 8 +- skins/CologneBlue.php | 6 +- skins/MonoBook.php | 48 ++- skins/MySkin.deps.php | 2 +- skins/MySkin.php | 8 +- skins/Nostalgia.php | 6 +- skins/Simple.deps.php | 2 +- skins/Simple.php | 8 +- skins/Standard.php | 8 +- skins/archlinux/handheld.css | 32 +- skins/archlinux/main.css | 38 +-- skins/archlinux/rtl.css | 5 + skins/chick/main.css | 22 +- skins/common/IEFixes.js | 8 +- skins/common/ajax.js | 32 +- skins/common/ajaxsearch.js | 6 +- skins/common/block.js | 47 +++ skins/common/common.css | 55 +++- skins/common/commonPrint.css | 8 +- skins/common/common_rtl.css | 6 +- skins/common/images/Checker-16x16.png | Bin 0 -> 81 bytes skins/common/metadata.js | 18 +- skins/common/preview.js | 91 +++++- skins/common/protect.js | 41 ++- skins/common/sticky.js | 10 +- skins/common/wikibits.js | 538 +++++++++++++++++++++++++++------- skins/disabled/HTMLDump.php | 8 +- skins/disabled/MonoBookCBT.php | 6 +- skins/monobook/handheld.css | 32 +- skins/monobook/main.css | 58 ++-- skins/monobook/rtl.css | 5 + skins/simple/main.css | 18 +- 33 files changed, 857 insertions(+), 325 deletions(-) create mode 100644 skins/common/block.js create mode 100644 skins/common/images/Checker-16x16.png (limited to 'skins') diff --git a/skins/Chick.deps.php b/skins/Chick.deps.php index a178a791..54614c49 100644 --- a/skins/Chick.deps.php +++ b/skins/Chick.deps.php @@ -9,5 +9,5 @@ if ( ! defined( 'MEDIAWIKI' ) ) die( 1 ); require_once('includes/SkinTemplate.php'); -require_once('MonoBook.php'); +require_once( dirname(__FILE__) . '/MonoBook.php' ); ?> diff --git a/skins/Chick.php b/skins/Chick.php index d5a4a080..9721900c 100644 --- a/skins/Chick.php +++ b/skins/Chick.php @@ -3,20 +3,18 @@ * See skin.txt * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) die( -1 ); /** */ -require_once('MonoBook.php'); +require_once( dirname(__FILE__) . '/MonoBook.php' ); /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinChick extends SkinTemplate { function initPage( &$out ) { diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 6862274a..b066a1ac 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -3,8 +3,7 @@ * See skin.txt * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) @@ -12,8 +11,7 @@ if( !defined( 'MEDIAWIKI' ) ) /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinCologneBlue extends Skin { diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 0b9619a2..50d7f00f 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -6,8 +6,7 @@ * dependency on PHPTAL. * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) @@ -19,8 +18,7 @@ require_once('includes/SkinTemplate.php'); /** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinMonoBook extends SkinTemplate { /** Using monobook. */ @@ -34,8 +32,7 @@ class SkinMonoBook extends SkinTemplate { /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class MonoBookTemplate extends QuickTemplate { /** @@ -47,6 +44,9 @@ class MonoBookTemplate extends QuickTemplate { * @access private */ function execute() { + global $wgUser; + $skin = $wgUser->getSkin(); + // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -89,7 +89,7 @@ class MonoBookTemplate extends QuickTemplate { data['trackbackhtml']) print $this->data['trackbackhtml']; ?> - html('headscripts') ?> +html('headscripts') ?> data['body_ondblclick']) { ?>ondblclick="text('body_ondblclick') ?>" data['body_onload' ]) { ?>onload="text('body_onload') ?>" @@ -120,9 +120,9 @@ class MonoBookTemplate extends QuickTemplate {
@@ -135,7 +135,7 @@ class MonoBookTemplate extends QuickTemplate { data['personal_urls'] as $key => $item) { ?>
  • class="active">"tooltipAndAccesskey('pt-'.$key) ?> class="">
  • @@ -145,19 +145,19 @@ class MonoBookTemplate extends QuickTemplate {
    data['sidebar'] as $bar => $cont) { ?> -
    +
    tooltip('p-'.$bar) ?>>
    @@ -167,9 +167,7 @@ class MonoBookTemplate extends QuickTemplate {
    - haveMsg('accesskey-search')) { - ?>accesskey="msg('accesskey-search') ?>"tooltipAndAccesskey('search'); if( isset( $this->data['search'] ) ) { ?> value="text('search') ?>" />   @@ -185,23 +183,23 @@ class MonoBookTemplate extends QuickTemplate { if($this->data['notspecialpage']) { ?>
  • msg('whatlinkshere') ?>
  • + ?>"tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?> data['nav_urls']['recentchangeslinked'] ) { ?>
  • msg('recentchangeslinked') ?>
  • + ?>"tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?> data['nav_urls']['trackbacklink'])) { ?> + ?>"tooltipAndAccesskey('t-trackbacklink') ?>>msg('trackbacklink') ?> data['feeds']) { ?> data['nav_urls'][$special]) { ?>
  • msg($special) ?>
  • + ?>"tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?> data['nav_urls']['print']['href'])) { ?>
  • msg('printableversion') ?>
  • "tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>data['nav_urls']['permalink']['href'])) { ?> "tooltipAndAccesskey('t-permalink') ?>>msg('permalink') ?>data['nav_urls']['permalink']['href'] === '') { ?> - tooltip('t-ispermalink') ?>>msg('permalink') ?> diff --git a/skins/MySkin.php b/skins/MySkin.php index cb24fdc4..5331e215 100644 --- a/skins/MySkin.php +++ b/skins/MySkin.php @@ -3,20 +3,18 @@ * See skin.txt * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) die( -1 ); /** */ -require_once('MonoBook.php'); +require_once( dirname(__FILE__) . '/MonoBook.php' ); /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinMySkin extends SkinTemplate { function initPage( &$out ) { diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index 3b19e41e..1bb180ed 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -3,8 +3,7 @@ * See skin.txt * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) @@ -12,8 +11,7 @@ if( !defined( 'MEDIAWIKI' ) ) /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinNostalgia extends Skin { diff --git a/skins/Simple.deps.php b/skins/Simple.deps.php index 369f6b00..b7f1f5eb 100644 --- a/skins/Simple.deps.php +++ b/skins/Simple.deps.php @@ -9,5 +9,5 @@ if ( ! defined( 'MEDIAWIKI' ) ) die( 1 ); require_once('includes/SkinTemplate.php'); -require_once('MonoBook.php'); +require_once( dirname(__FILE__) . '/MonoBook.php' ); ?> diff --git a/skins/Simple.php b/skins/Simple.php index d1ebd7d9..a9c0cc51 100644 --- a/skins/Simple.php +++ b/skins/Simple.php @@ -3,20 +3,18 @@ * See skin.txt * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) die( -1 ); /** */ -require_once('MonoBook.php'); +require_once( dirname(__FILE__) . '/MonoBook.php' ); /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinSimple extends SkinTemplate { function initPage( &$out ) { diff --git a/skins/Standard.php b/skins/Standard.php index 517fd194..f79571a5 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -3,8 +3,7 @@ * See skin.txt * * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ if( !defined( 'MEDIAWIKI' ) ) @@ -12,8 +11,7 @@ if( !defined( 'MEDIAWIKI' ) ) /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinStandard extends Skin { @@ -248,7 +246,7 @@ class SkinStandard extends Skin { { $s .= $sep . $this->watchThisPage(); } - if ( $wgTitle->userCanEdit() ) + if ( $wgTitle->userCan( 'edit' ) ) $s .= $sep . $this->moveThisPage(); } if ( $wgUser->isAllowed('delete') and $articleExists ) { diff --git a/skins/archlinux/handheld.css b/skins/archlinux/handheld.css index 38fe1ebe..754aba9f 100644 --- a/skins/archlinux/handheld.css +++ b/skins/archlinux/handheld.css @@ -559,7 +559,7 @@ td.diff-context { background: #eee; font-size: smaller; } -span.diffchange { +.diffchange { color: red; font-weight: bold; } @@ -997,15 +997,6 @@ span.updatedmarker { color: black; background-color: #0f0; } -span.newpageletter { - font-weight: bold; - color: black; - background-color: yellow; -} -span.minoreditletter { - color: black; - background-color: #c5ffe6; -} table.gallery { border: 1px solid #ccc; @@ -1024,8 +1015,12 @@ table.gallery td { border: solid 2px white; } +/* Keep this temporarily so that cached pages will display right */ table.gallery td.galleryheader { - text-align: center; + text-align: center; + font-weight: bold; +} +table.gallery caption { font-weight: bold; } @@ -1325,13 +1320,18 @@ tr.sv-space td { display: none; } .mw-summary-preview { margin: 0.1em 0; } -#toolbar { clear: both; } - -.mw-plusminus-null { color: #aaa; } - @media handheld { .nonessential { /* Kill big bulky stuff that will clog up the screen */ display: none; } -} \ No newline at end of file +} + +/** + * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. + * When the day comes, it can be moved to a *real* common.css. + */ +.mw-plusminus-null { color: #aaa; } +.texvc { direction: ltr; unicode-bidi: embed; } +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } \ No newline at end of file diff --git a/skins/archlinux/main.css b/skins/archlinux/main.css index 8f35623a..7eabb56a 100644 --- a/skins/archlinux/main.css +++ b/skins/archlinux/main.css @@ -38,7 +38,7 @@ background: white; color: black; border: 1px solid #aaa; - border-right: none; +/* border-right: none; */ line-height: 1.5em; } @@ -611,9 +611,10 @@ td.diff-context { background: #eee; font-size: smaller; } -span.diffchange { +.diffchange { color: red; font-weight: bold; + text-decoration: none; } /* @@ -824,16 +825,18 @@ special external link styling */ input.searchButton { margin-top: 1px; - font-size: 95%; + height:20px; + width:40px; + font-size:10px; } #searchGoButton { - padding-left: .5em; - padding-right: .5em; + padding-left: 0px; + padding-right: 0px; font-weight: bold; - display:none; + width:70px; } #searchInput { - width: 10.9em; + width: 120px; margin: 0; font-size: 95%; } @@ -1057,8 +1060,7 @@ input.searchButton { display: inline; margin: 0 1.3em; } -/* hide from incapable browsers */ -head:first-child+body #footer li { white-space: nowrap; } + #f-poweredbyico, #f-copyrightico { margin: 0 8px; position: relative; @@ -1308,15 +1310,6 @@ span.updatedmarker { color: black; background-color: #0f0; } -span.newpageletter { - font-weight: bold; - color: black; - background-color: yellow; -} -span.minoreditletter { - color: black; - background-color: #c5ffe6; -} table.gallery { border: 1px solid #ccc; @@ -1339,10 +1332,12 @@ table.gallery td.galleryheader { text-align: center; font-weight: bold; } +table.gallery caption { + font-weight: bold; +} div.gallerybox { margin: 2px; - width: 150px; } div.gallerybox div.thumb { @@ -1620,7 +1615,7 @@ tr.sv-space td { display: none; } .TablePager_nav a { text-decoration: none; } .TablePager { border-collapse: collapse; } .TablePager, .TablePager td, .TablePager th { - border: 0.15em solid #777777; + border: 1px solid #aaaaaa; padding: 0 0.15em 0 0.15em; } .TablePager th { background-color: #eeeeff } @@ -1637,6 +1632,3 @@ tr.sv-space td { display: none; } .mw-summary-preview { margin: 0.1em 0; } -#toolbar { clear: both; } - -.mw-plusminus-null { color: #aaa; } diff --git a/skins/archlinux/rtl.css b/skins/archlinux/rtl.css index f4a67683..ce87855d 100644 --- a/skins/archlinux/rtl.css +++ b/skins/archlinux/rtl.css @@ -44,6 +44,7 @@ html>body .portlet { .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 { @@ -214,3 +215,7 @@ input#wpSave, input#wpDiff { float: right; margin: 0 0 1em 3em; } +/* Unblock and Ipblocklist links of Special:Blockip */ +p.mw-ipb-conveniencelinks { + float: left; +} diff --git a/skins/chick/main.css b/skins/chick/main.css index b84b291e..26d4f925 100644 --- a/skins/chick/main.css +++ b/skins/chick/main.css @@ -415,7 +415,7 @@ td.diff-context { background:#eeeeee; font-size: smaller; } -span.diffchange { color: red; } +.diffchange { color: red; text-decoration: none; } a.external { color: #3366bb; } @@ -445,15 +445,6 @@ span.updatedmarker { color:black; background-color:#00FF00; } -span.newpageletter { - font-weight:bold; - color:black; - background-color:yellow; -} -span.minoreditletter { - color:black; - background-color:#C5FFE6; -} table.gallery { border: 1px solid #cccccc; @@ -494,6 +485,11 @@ div.gallerytext { .templatesUsed { margin-top: 1.5em; } -#toolbar { clear: both; } - -.mw-plusminus-null { color: #aaa; } \ No newline at end of file +/** + * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. + * When the day comes, it can be moved to a *real* common.css. + */ +.mw-plusminus-null { color: #aaa; } +.texvc { direction: ltr; unicode-bidi: embed; } +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } \ No newline at end of file diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js index 9c25adf0..f85f506c 100644 --- a/skins/common/IEFixes.js +++ b/skins/common/IEFixes.js @@ -33,7 +33,7 @@ function fixalpha() { if (imageUrl.substr(imageUrl.length-4).toLowerCase() == '.png') { var logospan = logoa.appendChild(document.createElement('span')); - + logoa.style.backgroundImage = 'none'; logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')'; logospan.style.height = '100%'; @@ -41,7 +41,7 @@ function fixalpha() { logospan.style.width = logoa.currentStyle.width; logospan.style.cursor = 'hand'; // Center image with hack for IE5.5 - if (document.documentElement.dir == "rtl") + if (document.documentElement.dir == "rtl") { logospan.style.right = '50%'; logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"'); @@ -53,7 +53,7 @@ function fixalpha() { } logospan.style.top = '50%'; logospan.style.setExpression('marginTop', '"-" + (this.offsetHeight / 2) + "px"'); - + var linkFix = logoa.appendChild(logoa.cloneNode()); linkFix.style.position = 'absolute'; linkFix.style.height = '100%'; @@ -124,4 +124,4 @@ onafterprint = function() for (var i=0; i < expandedURLs.length; i++) if (expandedURLs[i]) expandedURLs[i].removeNode(true); -} \ No newline at end of file +} diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 40065593..d90bea09 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -10,30 +10,30 @@ var sajax_request_type = "GET"; */ function sajax_debug(text) { if (!sajax_debug_mode) return false; - + var e= document.getElementById('sajax_debug'); - + if (!e) { e= document.createElement("p"); e.className= 'sajax_debug'; e.id= 'sajax_debug'; - + var b= document.getElementsByTagName("body")[0]; - + if (b.firstChild) b.insertBefore(e, b.firstChild); else b.appendChild(e); } - + var m= document.createElement("div"); m.appendChild( document.createTextNode( text ) ); - + e.appendChild( m ); - + return true; } /** -* compatibility wrapper for creating a new XMLHttpRequest object. +* compatibility wrapper for creating a new XMLHttpRequest object. */ function sajax_init_object() { sajax_debug("sajax_init_object() called..") @@ -51,7 +51,7 @@ function sajax_init_object() { A = new XMLHttpRequest(); if (!A) sajax_debug("Could not create connection object."); - + return A; } @@ -95,7 +95,7 @@ function sajax_do_call(func_name, args, target) { alert("AJAX not supported"); return false; } - + try { x.open(sajax_request_type, uri, true); } catch (e) { @@ -113,13 +113,13 @@ function sajax_do_call(func_name, args, target) { x.onreadystatechange = function() { if (x.readyState != 4) return; - + sajax_debug("received (" + x.status + " " + x.statusText + ") " + x.responseText); - + //if (x.status != 200) // alert("Error: " + x.status + " " + x.statusText + ": " + x.responseText); //else - + if ( typeof( target ) == 'function' ) { target( x ); } @@ -136,14 +136,14 @@ function sajax_do_call(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); x.send(post_data); sajax_debug(func_name + " waiting.."); delete x; - + return true; } diff --git a/skins/common/ajaxsearch.js b/skins/common/ajaxsearch.js index e6ea31ab..1e972236 100644 --- a/skins/common/ajaxsearch.js +++ b/skins/common/ajaxsearch.js @@ -32,7 +32,7 @@ function Search_Typing() { if (event.keyCode == 13) { event.cancelBubble = true; - event.returnValue = false; + event.returnValue = true; } } } @@ -44,7 +44,7 @@ function Searching_SetResult( request ) alert("Error: " + request.status + " " + request.statusText + ": " + request.responseText); return; } - + var result = request.responseText; //body.innerHTML = result; @@ -90,7 +90,7 @@ function Searching_Call() { return; } - + sajax_do_call( "wfSajaxSearch", [ x ], Searching_SetResult ); } } diff --git a/skins/common/block.js b/skins/common/block.js new file mode 100644 index 00000000..c9c02446 --- /dev/null +++ b/skins/common/block.js @@ -0,0 +1,47 @@ + +function considerChangingExpiryFocus() { + 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'; + } +} + +function updateBlockOptions() { + if (!document.getElementById) + return; + + var target = document.getElementById('mw-bi-target'); + if (!target) + return; + + var addy = target.value; + var isEmpty = addy.match(/^\s*$/); + var isIp = addy.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|:(:[0-9A-Fa-f]{1,4}){1,7}|[0-9A-Fa-f]{1,4}(:{1,2}[0-9A-Fa-f]{1,4}|::$){1,7})(\/\d+)?$/); + + /* + var anonymousCheck = document.getElementById('wpAnonOnly'); + anonymousCheck.disabled = !isIp && !isEmpty; + + var autoblockCheck = document.getElementById('wpEnableAutoblock'); + autoblockCheck.disabled = isIp && !isEmpty; + */ + + var anonymousRow = document.getElementById('wpAnonOnlyRow'); + anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : ''; + + var autoblockRow = document.getElementById('wpEnableAutoblockRow'); + autoblockRow.style.display = isIp && !isEmpty ? 'none' : ''; +} diff --git a/skins/common/common.css b/skins/common/common.css index f3e5b574..e39910c3 100644 --- a/skins/common/common.css +++ b/skins/common/common.css @@ -125,7 +125,11 @@ td.diff-context { background:#eeeeee; font-size: 94%; } -span.diffchange { color: red; font-weight: bold; } +.diffchange { + color: red; + font-weight: bold; + text-decoration: none; +} img { border: none; } img.tex { vertical-align: middle; } @@ -268,15 +272,6 @@ span.updatedmarker { color:black; background-color:#00FF00; } -span.newpageletter { - font-weight:bold; - color:black; - background-color:yellow; -} -span.minoreditletter { - color:black; - background-color:#C5FFE6; -} table.gallery { border: 1px solid #cccccc; @@ -286,7 +281,7 @@ table.gallery { } table.gallery tr { - vertical-align:top; + vertical-align:top; } table.gallery td { @@ -410,8 +405,12 @@ table.collapsed tr.collapsable { display: none; } +/* Keep this temporarily so that cached pages will display right */ table.gallery td.galleryheader { - text-align: center; + text-align: center; + font-weight: bold; +} +table.gallery caption { font-weight: bold; } @@ -462,6 +461,34 @@ table.multipageimage td { .templatesUsed { margin-top: 1em; } -#toolbar { clear: both; } +/* Convenience links on Special:Ipblocklist */ +p.mw-ipb-conveniencelinks { + font-size: 90%; + float: right; +} + +/** + * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. + * When the day comes, it can be moved to a *real* common.css. + */ +.mw-plusminus-null { color: #aaa; } +.texvc { direction: ltr; unicode-bidi: embed; } +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } + +/* +#file img, .gallerybox .thumb img { + background: url(images/Checker-16x16.png) repeat; +} +*/ +.MediaTransformError { + border: thin solid #777; + background-color: #ccc; + padding: 0.1em; +} +.MediaTransformError td { + text-align: center; + vertical-align: middle; + font-size: 90%; +} -.mw-plusminus-null { color: #aaa; } \ No newline at end of file diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 992ac4db..4fddafaa 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -117,7 +117,6 @@ ul { #content { background: none; border: none ! important; - font-size: 11pt; padding: 0 ! important; margin: 0 ! important; } @@ -284,5 +283,8 @@ td.diff-context { background:#eeeeee; font-size: smaller; } -span.diffchange { color: silver; font-weight: bold; text-decoration: underline; } - +.diffchange { + color: silver; + font-weight: bold; + text-decoration: underline; +} diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css index 54186bb8..0c08de55 100644 --- a/skins/common/common_rtl.css +++ b/skins/common/common_rtl.css @@ -25,4 +25,8 @@ div.tright, div.floatright { } div.tleft, div.floatleft { clear: left; -} \ No newline at end of file +} +/* Unblock and Ipblocklist links of Special:Blockip */ +p.mw-ipb-conveniencelinks { + float: left; +} diff --git a/skins/common/images/Checker-16x16.png b/skins/common/images/Checker-16x16.png new file mode 100644 index 00000000..3e9e3d09 Binary files /dev/null and b/skins/common/images/Checker-16x16.png differ diff --git a/skins/common/metadata.js b/skins/common/metadata.js index 9f7a8e01..a73b6937 100644 --- a/skins/common/metadata.js +++ b/skins/common/metadata.js @@ -11,17 +11,17 @@ function attachMetadataToggle(tableId, showText, hideText) { 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); @@ -32,17 +32,17 @@ function attachMetadataToggle(tableId, showText, hideText) { } 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; diff --git a/skins/common/preview.js b/skins/common/preview.js index b117e85b..ec612963 100644 --- a/skins/common/preview.js +++ b/skins/common/preview.js @@ -18,16 +18,15 @@ function openXMLHttpRequest() { function livePreview(target, text, postUrl) { prevTarget = target; if( !target ) { - window.alert('Live preview failed!\nTry normal preview.'); - var fallback = document.getElementById('wpPreview'); - if ( fallback ) { fallback.style.display = 'inline'; } + window.alert(i18n(wgLivepreviewMessageFailed)); + showFallback(); } prevReq = openXMLHttpRequest(); if( !prevReq ) return false; - + prevReq.onreadystatechange = updatePreviewText; prevReq.open("POST", postUrl, true); - + var postData = 'wpTextbox1=' + encodeURIComponent(text); prevReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); prevReq.send(postData); @@ -35,19 +34,89 @@ function livePreview(target, text, postUrl) { } function updatePreviewText() { - if( prevReq.readyState != 4 ) { + + if (prevReq.readyState > 0 && prevReq.readyState < 4) { + notify(i18n(wgLivepreviewMessageLoading)); + } + + if(prevReq.readyState != 4) { return; } + + dismissNotify(i18n(wgLivepreviewMessageReady), 750); + if( prevReq.status != 200 ) { - window.alert('Failed to connect: ' + prevReq.status + - ' "' + prevReq.statusText + '"'); - var fallback = document.getElementById('wpPreview'); - if ( fallback ) { fallback.style.display = 'inline'; } + var keys = new Array(); + keys[0] = prevReq.status; + keys[1] = prevReq.statusText; + window.alert(i18n(wgLivepreviewMessageError, keys)); + showFallback(); return; } - prevTarget.innerHTML = prevReq.responseText; + + var xmlObject = prevReq.responseXML.documentElement; + var previewElement = xmlObject.getElementsByTagName('preview')[0]; + prevTarget.innerHTML = previewElement.firstChild.data; /* Hide the active diff if it exists */ var diff = document.getElementById('wikiDiff'); if ( diff ) { diff.style.display = 'none'; } } + +function showFallback() { + var fallback = document.getElementById('wpPreview'); + if ( fallback ) { fallback.style.display = 'inline'; } +} + + +// TODO: move elsewhere +/* Small non-intrusive popup which can be used for example to notify the user + * about completed AJAX action + */ +function notify(message) { + var notifyElement = document.getElementById('mw-js-notify'); + if ( !notifyElement ) { + createNotify(); + var notifyElement = document.getElementById('mw-js-notify'); + } + notifyElement.style.display = 'block'; + notifyElement.innerHTML = message; +} + +function dismissNotify(message, timeout) { + var notifyElement = document.getElementById('mw-js-notify'); + if ( notifyElement ) { + if ( timeout == 0 ) { + notifyElement.style.display = 'none'; + } else { + notify(message); + setTimeout("dismissNotify('', 0)", timeout); + } + } +} + +function createNotify() { + var div = document.createElement("div"); + var txt = '###PLACEHOLDER###' + var txtNode = document.createTextNode(txt); + div.appendChild(txtNode); + div.id = 'mw-js-notify'; + // TODO: move styles to css + div.setAttribute('style', + 'display: none; position: fixed; bottom: 0px; right: 0px; color: white; background-color: DarkRed; z-index: 5; padding: 0.1em 1em 0.1em 1em; font-size: 120%;'); + var body = document.getElementsByTagName('body')[0]; + body.appendChild(div); +} + + + +/* Helper function similar to wfMsgReplaceArgs() */ +function i18n(message, keys) { + var localMessage = message; + if ( !keys ) { return localMessage; } + for( var i = 0; i < keys.length; i++) { + var myregexp = new RegExp("\\$"+(i+1), 'g'); + localMessage = localMessage.replace(myregexp, keys[i]); + } + return localMessage; +} \ No newline at end of file diff --git a/skins/common/protect.js b/skins/common/protect.js index 4baa5e4c..d8d1aa1c 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -3,29 +3,29 @@ function protectInitialize(tableId, labelText) { var box = document.getElementById(tableId); if (!box) return false; - + var tbody = box.getElementsByTagName('tbody')[0]; var row = document.createElement('tr'); tbody.appendChild(row); - + row.appendChild(document.createElement('td')); var col2 = document.createElement('td'); row.appendChild(col2); - + var check = document.createElement('input'); check.id = "mwProtectUnchained"; check.type = "checkbox"; check.onclick = protectChainUpdate; col2.appendChild(check); - + var space = document.createTextNode(" "); col2.appendChild(space); - + var label = document.createElement('label'); label.setAttribute("for", "mwProtectUnchained"); label.appendChild(document.createTextNode(labelText)); col2.appendChild(label); - + if (protectAllMatch()) { check.checked = false; protectEnable(false); @@ -34,15 +34,43 @@ function protectInitialize(tableId, labelText) { protectEnable(true); } + allowCascade(); + return true; } return false; } +function allowCascade() { + var pr_types = document.getElementsByTagName("select"); + for (var i = 0; i < pr_types.length; i++) { + if (pr_types[i].id.match(/^mwProtect-level-/)) { + var selected_level = pr_types[i].getElementsByTagName("option")[pr_types[i].selectedIndex].value; + if ( !isCascadeableLevel(selected_level) ) { + document.getElementById('mwProtect-cascade').checked=false; + document.getElementById('mwProtect-cascade').disabled=true; + return false; + } + } + } + document.getElementById('mwProtect-cascade').disabled=false; + return true; +} + +function isCascadeableLevel( level ) { + for (var k = 0; k < wgCascadeableLevels.length; k++) { + if ( wgCascadeableLevels[k] == level ) { + return true; + } + } + return false; +} + function protectLevelsUpdate(source) { if (!protectUnchained()) { protectUpdateAll(source.selectedIndex); } + allowCascade(); } function protectChainUpdate() { @@ -52,6 +80,7 @@ function protectChainUpdate() { protectChain(); protectEnable(false); } + allowCascade(); } diff --git a/skins/common/sticky.js b/skins/common/sticky.js index cf248c3e..a4904c03 100644 --- a/skins/common/sticky.js +++ b/skins/common/sticky.js @@ -36,7 +36,7 @@ lastY=10;YOffset=0;staticYOffset=10;refreshMS=25; // emulate css 'position: fixed' in IE5+ Win // code by aclover@1value.com fix_elements = new Array(); - + function fix_event(){ var i; for (i=0; i < fix_elements.length; i++){ @@ -95,7 +95,7 @@ lastY=10;YOffset=0;staticYOffset=10;refreshMS=25; else if(document.all){this.css=document.all[eID].style;} return this } - + function checkBrowser(){ this.ver=navigator.appVersion; this.name=navigator.appName; @@ -112,13 +112,13 @@ lastY=10;YOffset=0;staticYOffset=10;refreshMS=25; this.standards=document.getElementById?true:false; this.dhtml=this.standards||this.ie4||this.ns4; } - + function showMe(eID){ myFloater=new makeLayerObj(eID) myFloater.css.visibility="visible"; } - + function hideMe(eID){ myFloater=new makeLayerObj(eID) myFloater.css.visibility="hidden"; - } \ No newline at end of file + } diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 1e8e10ae..6299e5fa 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -330,11 +330,12 @@ var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js // this function generates the actual toolbar buttons with localized text // we use it to avoid creating the toolbar where javascript is not enabled -function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText) { +function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) { // Don't generate buttons for browsers which don't fully // support it. mwEditButtons[mwEditButtons.length] = - {"imageFile": imageFile, + {"imageId": imageId, + "imageFile": imageFile, "speedTip": speedTip, "tagOpen": tagOpen, "tagClose": tagClose, @@ -347,6 +348,8 @@ function mwInsertEditButton(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; @@ -356,7 +359,7 @@ function mwInsertEditButton(parent, item) { insertTags(item.tagOpen, item.tagClose, item.sampleText); return false; }; - + parent.appendChild(image); return true; } @@ -367,17 +370,17 @@ function mwSetupToolbar() { var textbox = document.getElementById('wpTextbox1'); if (!textbox) { return false; } - + // Don't generate buttons for browsers which don't fully // support it. if (!document.selection && textbox.selectionStart === null) { return false; } - - for (var i in mwEditButtons) { + + for (var i = 0; i < mwEditButtons.length; i++) { mwInsertEditButton(toolbar, mwEditButtons[i]); } - for (i in mwCustomEditButtons) { + for (var i = 0; i < mwCustomEditButtons.length; i++) { mwInsertEditButton(toolbar, mwCustomEditButtons[i]); } return true; @@ -473,32 +476,142 @@ function insertTags(tagOpen, tagClose, sampleText) { } } + /** - * Set up accesskeys/tooltips. If doId is specified, only set up for that id. + * Set the accesskey prefix based on browser detection. + */ +var tooltipAccessKeyPrefix = 'alt-'; +if (is_opera) { + tooltipAccessKeyPrefix = 'shift-esc-'; +} else if (is_safari + || navigator.userAgent.toLowerCase().indexOf('mac') != -1 + || navigator.userAgent.toLowerCase().indexOf('konqueror') != -1 ) { + tooltipAccessKeyPrefix = 'ctrl-'; +} else if (is_ff2_x11 || is_ff2_win) { + tooltipAccessKeyPrefix = 'alt-shift-'; +} +var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?.\]$/; + +/** + * Add the appropriate prefix to the accesskey shown in the tooltip. + * If the nodeList parameter is given, only those nodes are updated; + * otherwise, all the nodes that will probably have accesskeys by + * default are updated. * - * @param mixed doId string or null + * @param Array nodeList -- list of elements to update */ -function akeytt( doId ) { - if (typeof ta == "undefined" || !ta) { +function updateTooltipAccessKeys( nodeList ) { + if ( !nodeList ) { + // skins without a "column-one" element don't seem to have links with accesskeys either + var columnOne = document.getElementById("column-one"); + if ( columnOne ) + updateTooltipAccessKeys( columnOne.getElementsByTagName("a") ); + // these are rare enough that no such optimization is needed + updateTooltipAccessKeys( document.getElementsByTagName("input") ); + updateTooltipAccessKeys( document.getElementsByTagName("label") ); return; } - var pref; - if (is_opera) { - pref = 'shift-esc-'; - } else if (is_safari || navigator.userAgent.toLowerCase().indexOf('mac') + 1 - || navigator.userAgent.toLowerCase().indexOf('konqueror') + 1 ) { - pref = 'control-'; - } else if (is_ff2_win || is_ff2_x11) { - pref = 'alt-shift-'; - } else { - pref = 'alt-'; + for ( var i = 0; i < nodeList.length; i++ ) { + var element = nodeList[i]; + var tip = element.getAttribute("title"); + var key = element.getAttribute("accesskey"); + if ( key && tooltipAccessKeyRegexp.exec(tip) ) { + tip = tip.replace(tooltipAccessKeyRegexp, + "["+tooltipAccessKeyPrefix+key+"]"); + element.setAttribute("title", tip ); + } + } +} + +/** + * Add a link to one of the portlet menus on the page, including: + * + * p-cactions: Content actions (shown as tabs above the main content in Monobook) + * p-personal: Personal tools (shown at the top right of the page in Monobook) + * p-navigation: Navigation + * p-tb: Toolbox + * + * This function exists for the convenience of custom JS authors. All + * but the first three parameters are optional, though providing at + * least an id and a tooltip is recommended. + * + * By default the new link will be added to the end of the list. To + * add the link before a given existing item, pass the DOM node of + * that item (easily obtained with document.getElementById()) as the + * nextnode parameter; to add the link _after_ an existing item, pass + * the node's nextSibling instead. + * + * @param String portlet -- id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb") + * @param String href -- link URL + * @param String text -- link text (will be automatically lowercased by CSS for p-cactions in Monobook) + * @param String id -- id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-") + * @param String tooltip -- text to show when hovering over the link, without accesskey suffix + * @param String accesskey -- accesskey to activate this link (one character, try to avoid conflicts) + * @param Node nextnode -- the DOM node before which the new item should be added, should be another item in the same list + * + * @return Node -- the DOM node of the new item (an LI element) or null + */ +function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) { + var node = document.getElementById(portlet); + if ( !node ) return null; + node = node.getElementsByTagName( "ul" )[0]; + if ( !node ) return null; + + var link = document.createElement( "a" ); + link.appendChild( document.createTextNode( text ) ); + link.href = href; + + var item = document.createElement( "li" ); + item.appendChild( link ); + if ( id ) item.id = id; + + if ( accesskey ) { + link.setAttribute( "accesskey", accesskey ); + tooltip += " ["+accesskey+"]"; + } + if ( tooltip ) { + link.setAttribute( "title", tooltip ); } + if ( accesskey && tooltip ) { + updateTooltipAccessKeys( new Array( link ) ); + } + + if ( nextnode && nextnode.parentNode == node ) + node.insertBefore( item, nextnode ); + else + node.appendChild( item ); // IE compatibility (?) + + return item; +} + +/** + * Set up accesskeys/tooltips from the deprecated ta array. If doId + * is specified, only set up for that id. Note that this function is + * deprecated and will not be supported indefinitely -- use + * updateTooltipAccessKey() instead. + * + * @param mixed doId string or null + */ +function akeytt( doId ) { + // A lot of user scripts (and some of the code below) break if + // ta isn't defined, so we make sure it is. Explictly using + // window.ta avoids a "ta is not defined" error. + if (!window.ta) window.ta = new Array; + + // Make a local, possibly restricted, copy to avoid clobbering + // the original. + var ta; if ( doId ) { - ta = [ta[doId]]; + ta = new Array; + ta[doId] = window.ta[doId]; + } else { + ta = window.ta; } + // Now deal with evil deprecated ta + var watchCheckboxExists = document.getElementById( 'wpWatchthis' ) ? true : false; for (var id in ta) { var n = document.getElementById(id); if (n) { @@ -515,10 +628,9 @@ function akeytt( doId ) { } // Don't add an accesskey for the watch tab if the watch // checkbox is also available. - if (a && ((id != 'ca-watch' && id != 'ca-unwatch') || - !(window.location.search.match(/[\?&](action=edit|action=submit)/i)))) { + if (a && ((id != 'ca-watch' && id != 'ca-unwatch') || !watchCheckboxExists)) { a.accessKey = ta[id][0]; - ak = ' ['+pref+ta[id][0]+']'; + ak = ' ['+tooltipAccessKeyPrefix+ta[id][0]+']'; } } else { // We don't care what type the object is when assigning tooltip @@ -580,48 +692,35 @@ function addRightClickEditHandler(el) { } } +var checkboxes; +var lastCheckbox; + function setupCheckboxShiftClick() { - if (document.getElementsByTagName) { - var uls = document.getElementsByTagName('ul'); - var len = uls.length; - for (var i = 0; i < len; ++i) { - addCheckboxClickHandlers(uls[i]); - } - } + checkboxes = []; + lastCheckbox = null; + var inputs = document.getElementsByTagName('input'); + addCheckboxClickHandlers(inputs); } -function addCheckboxClickHandlers(ul, start, finish) { - if (ul.checkboxHandlersTimer) { - clearInterval(ul.checkboxHandlersTimer); - } - if ( !ul.childNodes ) { - return; - } - var len = ul.childNodes.length; - if (len < 2) { - return; - } - start = start || 0; - finish = finish || start + 250; - if ( finish > len ) { finish = len; } - ul.checkboxes = ul.checkboxes || []; - ul.lastCheckbox = ul.lastCheckbox || null; - for (var i = start; i inputs.length ) + finish = inputs.length; + + for ( var i = start; i < finish; i++ ) { + var cb = inputs[i]; + if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) + continue; + cb.index = checkboxes.push(cb) - 1; + cb.onmouseup = checkboxMouseupHandler; } - if (finish < len) { - var f=function(){ addCheckboxClickHandlers(ul, finish, finish+250); }; - ul.checkboxHandlersTimer=setInterval(f, 200); + + if ( finish < inputs.length ) { + setTimeout( function () { + addCheckboxClickHandlers(inputs, finish); + }, 200 ); } } @@ -629,8 +728,8 @@ function checkboxMouseupHandler(e) { if (typeof e == 'undefined') { e = window.event; } - if ( !e.shiftKey || this.container.lastCheckbox === null ) { - this.container.lastCheckbox = this.index; + if ( !e.shiftKey || lastCheckbox === null ) { + lastCheckbox = this.index; return true; } var endState = !this.checked; @@ -638,17 +737,17 @@ function checkboxMouseupHandler(e) { endState = !endState; } var start, finish; - if ( this.index < this.container.lastCheckbox ) { + if ( this.index < lastCheckbox ) { start = this.index + 1; - finish = this.container.lastCheckbox; + finish = lastCheckbox; } else { - start = this.container.lastCheckbox; + start = lastCheckbox; finish = this.index - 1; } for (var i = start; i <= finish; ++i ) { - this.container.checkboxes[i].checked = endState; + checkboxes[i].checked = endState; } - this.container.lastCheckbox = this.index; + lastCheckbox = this.index; return true; } @@ -695,27 +794,6 @@ function fillDestFilename(id) { } } - -function considerChangingExpiryFocus() { - 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'; - } -} - function scrollEditBox() { var editBoxEl = document.getElementById("wpTextbox1"); var scrollTopEl = document.getElementById("wpScrolltop"); @@ -851,12 +929,6 @@ function getElementsByClassName(oElm, strTagName, oClassNames){ return (arrReturnElements) } -function sortableTables() { - if (getElementsByClassName(document, "table", "sortable").length != 0) { - document.write(''); - } -} - function redirectToFragment(fragment) { var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/); if (match) { @@ -879,26 +951,292 @@ function redirectToFragment(fragment) { } } +/* + * Table sorting script by Joost de Valk, check it out at http://www.joostdevalk.nl/code/sortable-table/. + * Based on a script from http://www.kryogenix.org/code/browser/sorttable/. + * Distributed under the MIT license: http://www.kryogenix.org/code/browser/licence.html . + * + * Copyright (c) 1997-2006 Stuart Langridge, Joost de Valk. + * + * @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) + */ + +var ts_image_path = stylepath+"/common/images/"; +var ts_image_up = "sort_up.gif"; +var ts_image_down = "sort_down.gif"; +var ts_image_none = "sort_none.gif"; +var ts_europeandate = wgContentLanguage != "en"; // The non-American-inclined can change to "true" +var ts_alternate_row_colors = true; +var SORT_COLUMN_INDEX; + +function sortables_init() { + 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]); + } +} + +function ts_makeSortable(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.innerHTML += '  ↓'; + } + } + if (ts_alternate_row_colors) { + ts_alternate(table); + } +} + +function ts_getInnerText(el) { + if (typeof el == "string") return el; + if (typeof el == "undefined") { return el }; + if (el.innerText) return el.innerText; // Not needed but it is faster + var str = ""; + + var cs = el.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) { + switch (cs[i].nodeType) { + case 1: //ELEMENT_NODE + str += ts_getInnerText(cs[i]); + break; + case 3: //TEXT_NODE + str += cs[i].nodeValue; + break; + } + } + return str; +} + +function ts_resortTable(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; + + // Work out a type for the column + if (table.rows.length <= 1) return; + + // Skip the first row if that's where the headings are + var rowStart = (table.tHead && table.tHead.rows.length > 0 ? 0 : 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; + } + } + + sortfn = ts_sort_caseinsensitive; + if (itm.match(/^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/)) + sortfn = ts_sort_date; + if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/)) + sortfn = ts_sort_date; + if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/)) + sortfn = ts_sort_date; + if (itm.match(/^[\u00a3$\u20ac]/)) // pound dollar euro + sortfn = ts_sort_currency; + if (itm.match(/^[\d.,]+\%?$/)) + sortfn = ts_sort_numeric; + + var reverse = (span.getAttribute("sortdir") == 'down'); + + var newRows = new Array(); + for (var j = rowStart; j < table.rows.length; j++) { + var row = table.rows[j]; + var keyText = ts_getInnerText(row.cells[column]); + var oldIndex = (reverse ? -j : j); + + newRows[newRows.length] = new Array(row, keyText, oldIndex); + } + + newRows.sort(sortfn); + + var arrowHTML; + if (reverse) { + arrowHTML = '↓'; + newRows.reverse(); + span.setAttribute('sortdir','up'); + } else { + arrowHTML = '↑'; + span.setAttribute('sortdir','down'); + } + + // 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 = '↓'; + } + span.innerHTML = arrowHTML; + + ts_alternate(table); +} + +function ts_dateToSortKey(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) { + 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"; +} + +function ts_parseFloat(num) { + if (!num) return 0; + num = parseFloat(num.replace(/,/, "")); + return (isNaN(num) ? 0 : num); +} + +function ts_sort_date(a,b) { + var aa = ts_dateToSortKey(a[1]); + var bb = ts_dateToSortKey(b[1]); + return (aa < bb ? -1 : aa > bb ? 1 : a[2] - b[2]); +} + +function ts_sort_currency(a,b) { + var aa = ts_parseFloat(a[1].replace(/[^0-9.]/g,'')); + var bb = ts_parseFloat(b[1].replace(/[^0-9.]/g,'')); + return (aa != bb ? aa - bb : a[2] - b[2]); +} + +function ts_sort_numeric(a,b) { + var aa = ts_parseFloat(a[1]); + var bb = ts_parseFloat(b[1]); + return (aa != bb ? aa - bb : a[2] - b[2]); +} + +function ts_sort_caseinsensitive(a,b) { + var aa = a[1].toLowerCase(); + var bb = b[1].toLowerCase(); + return (aa < bb ? -1 : aa > bb ? 1 : a[2] - b[2]); +} + +function ts_sort_default(a,b) { + return (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2]); +} + +function ts_alternate(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 + */ + function runOnloadHook() { // don't run anything below this for non-dom browsers if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName)) { return; } + // set this before running any hooks, since any errors below + // might cause the function to terminate prematurely + doneOnloadHook = true; + histrowinit(); unhidetzbutton(); tabbedprefs(); + updateTooltipAccessKeys( null ); akeytt( null ); scrollEditBox(); setupCheckboxShiftClick(); - sortableTables(); + sortables_init(); // Run any added-on functions for (var i = 0; i < onloadFuncts.length; i++) { onloadFuncts[i](); } - - doneOnloadHook = true; } //note: all skins should call runOnloadHook() at the end of html output, diff --git a/skins/disabled/HTMLDump.php b/skins/disabled/HTMLDump.php index 5f739a37..4e1ca4e9 100644 --- a/skins/disabled/HTMLDump.php +++ b/skins/disabled/HTMLDump.php @@ -13,8 +13,7 @@ require_once( 'includes/SkinTemplate.php' ); /** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class SkinHTMLDump extends SkinTemplate { /** Using monobook. */ @@ -76,7 +75,7 @@ class SkinHTMLDump extends SkinTemplate { if ( $nt->getNamespace() == NS_CATEGORY ) { # Determine if the category has any articles in it - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); $hasMembers = $dbr->selectField( 'categorylinks', '1', array( 'cl_to' => $nt->getDBkey() ), __METHOD__ ); if ( $hasMembers ) { @@ -93,8 +92,7 @@ class SkinHTMLDump extends SkinTemplate { /** * @todo document - * @package MediaWiki - * @subpackage Skins + * @addtogroup Skins */ class HTMLDumpTemplate extends QuickTemplate { /** diff --git a/skins/disabled/MonoBookCBT.php b/skins/disabled/MonoBookCBT.php index 3d145b24..aa9abb00 100644 --- a/skins/disabled/MonoBookCBT.php +++ b/skins/disabled/MonoBookCBT.php @@ -499,8 +499,8 @@ class SkinMonoBookCBT extends SkinTemplate { } function is_special() { return cbt_value( $this->mTitle->getNamespace() == NS_SPECIAL, 'title' ); } - function can_edit() { return cbt_value( (string)($this->mTitle->userCanEdit()), 'dynamic' ); } - function can_move() { return cbt_value( (string)($this->mTitle->userCanMove()), 'dynamic' ); } + function can_edit() { return cbt_value( (string)($this->mTitle->userCan( 'edit' )), 'dynamic' ); } + function can_move() { return cbt_value( (string)($this->mTitle->userCan( 'move' )), 'dynamic' ); } function is_talk() { return cbt_value( (string)($this->mTitle->isTalkPage()), 'title' ); } function is_protected() { return cbt_value( (string)$this->mTitle->isProtected(), 'dynamic' ); } function nskey() { return cbt_value( $this->mTitle->getNamespaceKey(), 'title' ); } @@ -1017,7 +1017,7 @@ class SkinMonoBookCBT extends SkinTemplate { global $wgPageShowWatchingUsers; if ( !$wgPageShowWatchingUsers ) return ''; - $dbr =& wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_SLAVE ); extract( $dbr->tableNames( 'watchlist' ) ); $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . diff --git a/skins/monobook/handheld.css b/skins/monobook/handheld.css index 38fe1ebe..754aba9f 100644 --- a/skins/monobook/handheld.css +++ b/skins/monobook/handheld.css @@ -559,7 +559,7 @@ td.diff-context { background: #eee; font-size: smaller; } -span.diffchange { +.diffchange { color: red; font-weight: bold; } @@ -997,15 +997,6 @@ span.updatedmarker { color: black; background-color: #0f0; } -span.newpageletter { - font-weight: bold; - color: black; - background-color: yellow; -} -span.minoreditletter { - color: black; - background-color: #c5ffe6; -} table.gallery { border: 1px solid #ccc; @@ -1024,8 +1015,12 @@ table.gallery td { border: solid 2px white; } +/* Keep this temporarily so that cached pages will display right */ table.gallery td.galleryheader { - text-align: center; + text-align: center; + font-weight: bold; +} +table.gallery caption { font-weight: bold; } @@ -1325,13 +1320,18 @@ tr.sv-space td { display: none; } .mw-summary-preview { margin: 0.1em 0; } -#toolbar { clear: both; } - -.mw-plusminus-null { color: #aaa; } - @media handheld { .nonessential { /* Kill big bulky stuff that will clog up the screen */ display: none; } -} \ No newline at end of file +} + +/** + * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. + * When the day comes, it can be moved to a *real* common.css. + */ +.mw-plusminus-null { color: #aaa; } +.texvc { direction: ltr; unicode-bidi: embed; } +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } \ No newline at end of file diff --git a/skins/monobook/main.css b/skins/monobook/main.css index dbfc0801..ff18f349 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -497,6 +497,14 @@ span.texhtml { font-family: serif; } +/* Have a checkered background on images on the description pages and in galleries + to make transparency visible + +#file img, .gallerybox .thumb img { + background: url(Checker-16x16.png) repeat; +} +*/ + /* ** classes for special content elements like town boxes ** intended to be referenced directly from the wiki src @@ -591,9 +599,10 @@ td.diff-context { background: #eee; font-size: smaller; } -span.diffchange { +.diffchange { color: red; font-weight: bold; + text-decoration: none; } /* @@ -1034,8 +1043,6 @@ input.searchButton { display: inline; margin: 0 1.3em; } -/* hide from incapable browsers */ -head:first-child+body #footer li { white-space: nowrap; } #f-poweredbyico, #f-copyrightico { margin: 0 8px; position: relative; @@ -1283,15 +1290,6 @@ span.updatedmarker { color: black; background-color: #0f0; } -span.newpageletter { - font-weight: bold; - color: black; - background-color: yellow; -} -span.minoreditletter { - color: black; - background-color: #c5ffe6; -} table.gallery { border: 1px solid #ccc; @@ -1309,15 +1307,17 @@ table.gallery td { background-color: #f9f9f9; border: solid 2px white; } - +/* Keep this temporarily so that cached pages will display right */ table.gallery td.galleryheader { - text-align: center; + text-align: center; + font-weight: bold; +} +table.gallery caption { font-weight: bold; } div.gallerybox { margin: 2px; - width: 150px; } div.gallerybox div.thumb { @@ -1594,7 +1594,7 @@ tr.sv-space td { display: none; } .TablePager_nav a { text-decoration: none; } .TablePager { border-collapse: collapse; } .TablePager, .TablePager td, .TablePager th { - border: 0.15em solid #777777; + border: 1px solid #aaaaaa; padding: 0 0.15em 0 0.15em; } .TablePager th { background-color: #eeeeff } @@ -1611,6 +1611,28 @@ tr.sv-space td { display: none; } .mw-summary-preview { margin: 0.1em 0; } -#toolbar { clear: both; } -.mw-plusminus-null { color: #aaa; } \ No newline at end of file +/* Convenience links on Special:Ipblocklist */ +p.mw-ipb-conveniencelinks { + font-size: 90%; + float: right; +} + +/** + * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. + * When the day comes, it can be moved to a *real* common.css. + */ +.mw-plusminus-null { color: #aaa; } +.texvc { direction: ltr; unicode-bidi: embed; } +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } + +.MediaTransformError { + background-color: #ccc; + padding: 0.1em; +} +.MediaTransformError td { + text-align: center; + vertical-align: middle; + font-size: 90%; +} diff --git a/skins/monobook/rtl.css b/skins/monobook/rtl.css index f4a67683..ce87855d 100644 --- a/skins/monobook/rtl.css +++ b/skins/monobook/rtl.css @@ -44,6 +44,7 @@ html>body .portlet { .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 { @@ -214,3 +215,7 @@ input#wpSave, input#wpDiff { float: right; margin: 0 0 1em 3em; } +/* Unblock and Ipblocklist links of Special:Blockip */ +p.mw-ipb-conveniencelinks { + float: left; +} diff --git a/skins/simple/main.css b/skins/simple/main.css index e474f436..ea682ecc 100644 --- a/skins/simple/main.css +++ b/skins/simple/main.css @@ -268,7 +268,7 @@ td.diff-deletedline { background-color: #f8ffaa; } -span.diffchange { background-color: #FFCDF3; } +.diffchange { background-color: #FFCDF3; text-decoration: none; } .autocomment { color: grey; } #pagehistory span.user { margin-left: 1.4em; @@ -437,6 +437,18 @@ table.collapsed tr.collapsable { } .templatesUsed { margin-top: 1.5em; } -#toolbar { clear: both; } -.mw-plusminus-null { color: #aaa; } \ No newline at end of file +/** + * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. + * When the day comes, it can be moved to a *real* common.css. + */ +.mw-plusminus-null { color: #aaa; } +.texvc { direction: ltr; unicode-bidi: embed; } +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } + +/* +#file img, .gallerybox .thumb img { + background: url(../common/images/Checker-16x16.png) repeat; +} +*/ \ No newline at end of file -- cgit v1.2.3-54-g00ecf