summaryrefslogtreecommitdiff
path: root/skins
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /skins
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'skins')
-rw-r--r--skins/ArchLinux.php199
-rw-r--r--skins/Chick.php16
-rw-r--r--skins/CologneBlue.php274
-rw-r--r--skins/Modern.php107
-rw-r--r--skins/MonoBook.php154
-rw-r--r--skins/MySkin.php14
-rw-r--r--skins/Nostalgia.php29
-rw-r--r--skins/Simple.php31
-rw-r--r--skins/Skin.sample19
-rw-r--r--skins/Standard.php182
-rw-r--r--skins/Vector.deps.php11
-rw-r--r--skins/Vector.php767
-rw-r--r--skins/archlinux/IEMacFixes.css44
-rw-r--r--skins/archlinux/discussionitem_icon.gifbin949 -> 549 bytes
-rw-r--r--skins/archlinux/file_icon.gifbin921 -> 323 bytes
-rw-r--r--skins/archlinux/link_icon.gifbin942 -> 342 bytes
-rw-r--r--skins/archlinux/lock_icon.gifbin918 -> 918 bytes
-rw-r--r--skins/archlinux/magnify-clip.pngbin237 -> 170 bytes
-rw-r--r--skins/archlinux/mail_icon.gifbin918 -> 321 bytes
-rw-r--r--skins/archlinux/main.css318
-rw-r--r--skins/archlinux/rtl.css18
-rw-r--r--skins/archlinux/user.gifbin923 -> 325 bytes
-rw-r--r--skins/archlinux/video.pngbin215 -> 169 bytes
-rw-r--r--skins/archlinux/wiki.pngbin23064 -> 22987 bytes
-rw-r--r--skins/chick/main.css390
-rw-r--r--skins/common/IE80Fixes.css15
-rw-r--r--skins/common/IEFixes.js205
-rw-r--r--skins/common/Makefile2
-rw-r--r--skins/common/ajaxwatch.js53
-rw-r--r--skins/common/allmessages.js83
-rw-r--r--skins/common/block.js37
-rw-r--r--skins/common/commonPrint.css36
-rw-r--r--skins/common/common_rtl.css7
-rw-r--r--skins/common/edit.js209
-rw-r--r--skins/common/history.js11
-rw-r--r--skins/common/htmlform.js40
-rw-r--r--skins/common/images/Arr_.pngbin918 -> 246 bytes
-rw-r--r--skins/common/images/Arr_r.xcfbin1437 -> 0 bytes
-rw-r--r--skins/common/images/Arr_u.pngbin1044 -> 425 bytes
-rw-r--r--skins/common/images/Zoom_sans.gifbin901 -> 901 bytes
-rw-r--r--skins/common/images/add.pngbin0 -> 3329 bytes
-rw-r--r--skins/common/images/ajax-loader.gifbin0 -> 3208 bytes
-rw-r--r--skins/common/images/arrow_first.svg85
-rw-r--r--skins/common/images/arrow_left.svg78
-rw-r--r--skins/common/images/be-tarask/button_bold.pngbin575 -> 554 bytes
-rw-r--r--skins/common/images/be-tarask/button_italic.pngbin638 -> 592 bytes
-rw-r--r--skins/common/images/be-tarask/button_link.pngbin550 -> 466 bytes
-rw-r--r--skins/common/images/button_bold.pngbin978 -> 288 bytes
-rw-r--r--skins/common/images/button_extlink.pngbin1093 -> 494 bytes
-rw-r--r--skins/common/images/button_headline.pngbin497 -> 465 bytes
-rw-r--r--skins/common/images/button_hr.pngbin372 -> 251 bytes
-rw-r--r--skins/common/images/button_image.pngbin1110 -> 584 bytes
-rw-r--r--skins/common/images/button_italic.pngbin975 -> 292 bytes
-rw-r--r--skins/common/images/button_link.pngbin434 -> 337 bytes
-rw-r--r--skins/common/images/button_math.pngbin730 -> 617 bytes
-rw-r--r--skins/common/images/button_media.pngbin1155 -> 780 bytes
-rw-r--r--skins/common/images/button_nowiki.pngbin375 -> 352 bytes
-rw-r--r--skins/common/images/button_sig.pngbin1217 -> 953 bytes
-rw-r--r--skins/common/images/button_template.pngbin362 -> 233 bytes
-rw-r--r--skins/common/images/cyrl/button_italic.pngbin461 -> 460 bytes
-rw-r--r--skins/common/images/cyrl/button_link.pngbin353 -> 347 bytes
-rw-r--r--skins/common/images/de/button_bold.pngbin1013 -> 328 bytes
-rw-r--r--skins/common/images/de/button_italic.pngbin1021 -> 351 bytes
-rw-r--r--skins/common/images/fa/button_bold.pngbin504 -> 500 bytes
-rw-r--r--skins/common/images/fa/button_headline.pngbin438 -> 434 bytes
-rw-r--r--skins/common/images/fa/button_italic.pngbin577 -> 573 bytes
-rw-r--r--skins/common/images/fa/button_link.pngbin538 -> 535 bytes
-rw-r--r--skins/common/images/fileicon.xcfbin26160 -> 0 bytes
-rw-r--r--skins/common/images/gnu-fdl.pngbin1748 -> 1730 bytes
-rw-r--r--skins/common/images/gnu-fdl.xcfbin5578 -> 0 bytes
-rw-r--r--skins/common/images/icons/fileicon-c.pngbin2995 -> 2211 bytes
-rw-r--r--skins/common/images/icons/fileicon-cpp.pngbin2250 -> 1882 bytes
-rw-r--r--skins/common/images/icons/fileicon-deb.pngbin5528 -> 4801 bytes
-rw-r--r--skins/common/images/icons/fileicon-djvu.pngbin11137 -> 10752 bytes
-rw-r--r--skins/common/images/icons/fileicon-dvi.pngbin13042 -> 12778 bytes
-rw-r--r--skins/common/images/icons/fileicon-exe.pngbin5864 -> 5680 bytes
-rw-r--r--skins/common/images/icons/fileicon-h.pngbin1195 -> 1191 bytes
-rw-r--r--skins/common/images/icons/fileicon-html.pngbin7601 -> 7422 bytes
-rw-r--r--skins/common/images/icons/fileicon-iso.pngbin6673 -> 6450 bytes
-rw-r--r--skins/common/images/icons/fileicon-java.pngbin6825 -> 5989 bytes
-rw-r--r--skins/common/images/icons/fileicon-mid.pngbin7191 -> 6657 bytes
-rw-r--r--skins/common/images/icons/fileicon-mov.pngbin7946 -> 7716 bytes
-rw-r--r--skins/common/images/icons/fileicon-o.pngbin2893 -> 2204 bytes
-rw-r--r--skins/common/images/icons/fileicon-ogg.pngbin6143 -> 3750 bytes
-rw-r--r--skins/common/images/icons/fileicon-pdf.pngbin5138 -> 4976 bytes
-rw-r--r--skins/common/images/icons/fileicon-ps.pngbin3293 -> 3012 bytes
-rw-r--r--skins/common/images/icons/fileicon-rm.pngbin4977 -> 2851 bytes
-rw-r--r--skins/common/images/icons/fileicon-rpm.pngbin4753 -> 4103 bytes
-rw-r--r--skins/common/images/icons/fileicon-svg.pngbin5193 -> 5094 bytes
-rw-r--r--skins/common/images/icons/fileicon-tar.pngbin6544 -> 6347 bytes
-rw-r--r--skins/common/images/icons/fileicon-tex.pngbin4203 -> 3997 bytes
-rw-r--r--skins/common/images/icons/fileicon-ttf.pngbin3625 -> 3469 bytes
-rw-r--r--skins/common/images/icons/fileicon-txt.pngbin6801 -> 3638 bytes
-rw-r--r--skins/common/images/ksh/button_S_italic.pngbin3812 -> 3206 bytes
-rw-r--r--skins/common/images/link_icon.gifbin942 -> 342 bytes
-rw-r--r--skins/common/images/magnify-clip.pngbin267 -> 204 bytes
-rw-r--r--skins/common/images/mediawiki-small.xcfbin36011 -> 0 bytes
-rw-r--r--skins/common/images/mediawiki.pngbin23064 -> 22987 bytes
-rw-r--r--skins/common/images/poweredby_mediawiki_88x31.pngbin1933 -> 1927 bytes
-rw-r--r--skins/common/images/public-domain.pngbin2892 -> 2251 bytes
-rw-r--r--skins/common/images/redirectltr.pngbin1024 -> 381 bytes
-rw-r--r--skins/common/images/redirectrtl.pngbin1017 -> 381 bytes
-rw-r--r--skins/common/images/remove.pngbin0 -> 3346 bytes
-rw-r--r--skins/common/images/sort_down.gifbin879 -> 464 bytes
-rw-r--r--skins/common/images/sort_none.gifbin877 -> 462 bytes
-rw-r--r--skins/common/images/sort_up.gifbin881 -> 466 bytes
-rw-r--r--skins/common/images/spinner.gifbin586 -> 4648 bytes
-rw-r--r--skins/common/images/wiki.pngbin24954 -> 24801 bytes
-rw-r--r--skins/common/jquery.js4384
-rw-r--r--skins/common/jquery.min.js433
-rw-r--r--skins/common/metadata.js36
-rw-r--r--skins/common/mwsuggest.js1312
-rw-r--r--skins/common/oldshared.css61
-rw-r--r--skins/common/prefs.js205
-rw-r--r--skins/common/preview.js208
-rw-r--r--skins/common/protect.js2
-rw-r--r--skins/common/search.js50
-rw-r--r--skins/common/shared.css587
-rw-r--r--skins/common/sticky.js124
-rw-r--r--skins/common/upload.js203
-rw-r--r--skins/common/wikibits.js782
-rw-r--r--skins/disabled/MonoBook.tpl200
-rw-r--r--skins/disabled/MonoBookCBT.php1389
-rw-r--r--skins/modern/discussionitem_icon.gifbin949 -> 549 bytes
-rw-r--r--skins/modern/file_icon.gifbin921 -> 323 bytes
-rw-r--r--skins/modern/link_icon.gifbin942 -> 342 bytes
-rw-r--r--skins/modern/lock_icon.gifbin918 -> 321 bytes
-rw-r--r--skins/modern/mail_icon.gifbin918 -> 321 bytes
-rw-r--r--skins/modern/main.css193
-rw-r--r--skins/modern/rtl.css6
-rw-r--r--skins/monobook/IEMacFixes.css44
-rw-r--r--skins/monobook/discussionitem_icon.gifbin949 -> 549 bytes
-rw-r--r--skins/monobook/file_icon.gifbin921 -> 323 bytes
-rw-r--r--skins/monobook/link_icon.gifbin942 -> 342 bytes
-rw-r--r--skins/monobook/lock_icon.gifbin918 -> 918 bytes
-rw-r--r--skins/monobook/magnify-clip.pngbin237 -> 170 bytes
-rw-r--r--skins/monobook/mail_icon.gifbin918 -> 321 bytes
-rw-r--r--skins/monobook/main.css318
-rw-r--r--skins/monobook/rtl.css18
-rw-r--r--skins/monobook/user.gifbin923 -> 325 bytes
-rw-r--r--skins/monobook/video.pngbin215 -> 169 bytes
-rw-r--r--skins/monobook/wiki.pngbin23064 -> 22987 bytes
-rw-r--r--skins/simple/discussionitem_icon.gifbin949 -> 549 bytes
-rw-r--r--skins/simple/file_icon.gifbin921 -> 323 bytes
-rw-r--r--skins/simple/link_icon.gifbin942 -> 342 bytes
-rw-r--r--skins/simple/lock_icon.gifbin918 -> 321 bytes
-rw-r--r--skins/simple/mail_icon.gifbin918 -> 321 bytes
-rw-r--r--skins/simple/main.css11
-rw-r--r--skins/simple/rtl.css6
-rw-r--r--skins/vector/Makefile18
-rw-r--r--skins/vector/csshover.htc262
-rw-r--r--skins/vector/cssjanus/COPYING13
-rw-r--r--skins/vector/cssjanus/LICENSE202
-rw-r--r--skins/vector/cssjanus/README91
-rw-r--r--skins/vector/cssjanus/cssjanus.py574
-rw-r--r--skins/vector/cssjanus/csslex.py114
-rw-r--r--skins/vector/experiments/babaco-colors-a.css109
-rw-r--r--skins/vector/experiments/babaco-colors-b.css67
-rw-r--r--skins/vector/experiments/babaco-colors-c.css91
-rw-r--r--skins/vector/experiments/images/new-border.pngbin0 -> 124 bytes
-rw-r--r--skins/vector/experiments/images/new-portal-break-ltr.pngbin0 -> 891 bytes
-rw-r--r--skins/vector/experiments/images/new-portal-break-rtl.pngbin0 -> 891 bytes
-rw-r--r--skins/vector/experiments/images/page-base-fade.pngbin0 -> 306 bytes
-rw-r--r--skins/vector/experiments/images/page-base-updated.pngbin0 -> 124 bytes
-rw-r--r--skins/vector/experiments/images/tab-active-first.pngbin0 -> 981 bytes
-rw-r--r--skins/vector/experiments/images/tab-active-last.pngbin0 -> 980 bytes
-rw-r--r--skins/vector/experiments/images/tab-fade.pngbin0 -> 226 bytes
-rw-r--r--skins/vector/experiments/images/tab-first.pngbin0 -> 1057 bytes
-rw-r--r--skins/vector/experiments/images/tab-last.pngbin0 -> 1057 bytes
-rw-r--r--skins/vector/experiments/images/tab-new-fade.pngbin0 -> 216 bytes
-rw-r--r--skins/vector/experiments/new-tabs.css322
-rw-r--r--skins/vector/images/arrow-down-icon.pngbin0 -> 181 bytes
-rw-r--r--skins/vector/images/audio-icon.pngbin0 -> 345 bytes
-rw-r--r--skins/vector/images/border.pngbin0 -> 119 bytes
-rw-r--r--skins/vector/images/bullet-icon.pngbin0 -> 152 bytes
-rw-r--r--skins/vector/images/document-icon.pngbin0 -> 345 bytes
-rw-r--r--skins/vector/images/edit-icon.pngbin0 -> 358 bytes
-rw-r--r--skins/vector/images/external-link-ltr-icon.pngbin0 -> 279 bytes
-rw-r--r--skins/vector/images/external-link-rtl-icon.pngbin0 -> 277 bytes
-rw-r--r--skins/vector/images/file-icon.pngbin0 -> 402 bytes
-rw-r--r--skins/vector/images/link-icon.pngbin0 -> 429 bytes
-rw-r--r--skins/vector/images/lock-icon.pngbin0 -> 370 bytes
-rw-r--r--skins/vector/images/magnify-clip.pngbin0 -> 204 bytes
-rw-r--r--skins/vector/images/mail-icon.pngbin0 -> 375 bytes
-rw-r--r--skins/vector/images/news-icon.pngbin0 -> 359 bytes
-rw-r--r--skins/vector/images/page-base.pngbin0 -> 119 bytes
-rw-r--r--skins/vector/images/page-fade.pngbin0 -> 253 bytes
-rw-r--r--skins/vector/images/portal-break-ltr.pngbin0 -> 287 bytes
-rw-r--r--skins/vector/images/portal-break-rtl.pngbin0 -> 280 bytes
-rw-r--r--skins/vector/images/portal-break.pngbin0 -> 242 bytes
-rw-r--r--skins/vector/images/preferences-base.pngbin0 -> 119 bytes
-rw-r--r--skins/vector/images/preferences-break.pngbin0 -> 286 bytes
-rw-r--r--skins/vector/images/preferences-edge.pngbin0 -> 119 bytes
-rw-r--r--skins/vector/images/preferences-fade.pngbin0 -> 248 bytes
-rw-r--r--skins/vector/images/search-fade.pngbin0 -> 185 bytes
-rw-r--r--skins/vector/images/search-ltr.pngbin0 -> 214 bytes
-rw-r--r--skins/vector/images/search-rtl.pngbin0 -> 214 bytes
-rw-r--r--skins/vector/images/tab-break.pngbin0 -> 263 bytes
-rw-r--r--skins/vector/images/tab-current-fade.pngbin0 -> 121 bytes
-rw-r--r--skins/vector/images/tab-normal-fade.pngbin0 -> 254 bytes
-rw-r--r--skins/vector/images/talk-icon.pngbin0 -> 377 bytes
-rw-r--r--skins/vector/images/user-icon.pngbin0 -> 345 bytes
-rw-r--r--skins/vector/images/video-icon.pngbin0 -> 395 bytes
-rw-r--r--skins/vector/images/watch-icon-loading.gifbin0 -> 840 bytes
-rw-r--r--skins/vector/images/watch-icons.pngbin0 -> 1745 bytes
-rw-r--r--skins/vector/main-ltr.css1128
-rw-r--r--skins/vector/main-rtl.css1128
-rw-r--r--skins/vector/wiki-indexed.pngbin0 -> 8205 bytes
-rw-r--r--skins/vector/wiki.pngbin0 -> 22987 bytes
209 files changed, 12954 insertions, 5171 deletions
diff --git a/skins/ArchLinux.php b/skins/ArchLinux.php
index 511e20f6..ec17c343 100644
--- a/skins/ArchLinux.php
+++ b/skins/ArchLinux.php
@@ -17,12 +17,8 @@ if( !defined( 'MEDIAWIKI' ) )
*/
class SkinArchLinux extends SkinTemplate {
/** Using archlinux. */
- function initPage( OutputPage $out ) {
- parent::initPage( $out );
- $this->skinname = 'archlinux';
- $this->stylename = 'archlinux';
- $this->template = 'ArchLinuxTemplate';
- }
+ var $skinname = 'archlinux', $stylename = 'archlinux',
+ $template = 'ArchLinuxTemplate', $useHeadElement = true;
function setupSkinUserCss( OutputPage $out ) {
global $wgHandheldStyle;
@@ -70,104 +66,69 @@ class ArchLinuxTemplate extends QuickTemplate {
// Suppress warnings to prevent notices about missing indexes in $this->data
wfSuppressWarnings();
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
- foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
- ?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
- } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
- <head>
- <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
- <?php $this->html('headlinks') ?>
- <title><?php $this->text('pagetitle') ?></title>
- <?php $this->html('csslinks') ?>
-
- <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
- <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
-
- <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
-
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
- <!-- Head Scripts -->
-<?php $this->html('headscripts') ?>
-<?php if($this->data['jsvarurl']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl') ?>"><!-- site js --></script>
-<?php } ?>
-<?php if($this->data['pagecss']) { ?>
- <style type="text/css"><?php $this->html('pagecss') ?></style>
-<?php }
- if($this->data['usercss']) { ?>
- <style type="text/css"><?php $this->html('usercss') ?></style>
-<?php }
- if($this->data['userjs']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
-<?php }
- if($this->data['userjsprev']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
-<?php }
- if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
- </head>
-<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
-<?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
- class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
+ $this->html( 'headelement' );
- <?php 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>
- </div>
- <div id="archnavbarmenu">
- <ul id="archnavbarlist">
- <?php
- if (isset($wgArchNavBar)) {
- foreach ($wgArchNavBar as $name => $url) {
- if ((isset($wgArchNavBarSelected) && $this->data['title'] == $name && in_array($name, $wgArchNavBarSelected))
- || (!(isset($wgArchNavBarSelected) && in_array($this->data['title'], $wgArchNavBarSelected)) && isset($wgArchNavBarSelectedDefault) && $name == $wgArchNavBarSelectedDefault)) {
- $anbClass = ' class="anb-selected"';
- } else {
- $anbClass = '';
- }
- echo '<li id="anb-'.strtolower($name).'"'.$anbClass.'><a href="'.$url.'">'.$name.'</a></li>';
+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>
+ </div>
+ <div id="archnavbarmenu">
+ <ul id="archnavbarlist">
+ <?php
+ if (isset($wgArchNavBar)) {
+ foreach ($wgArchNavBar as $name => $url) {
+ if ((isset($wgArchNavBarSelected) && $this->data['title'] == $name && in_array($name, $wgArchNavBarSelected))
+ || (!(isset($wgArchNavBarSelected) && in_array($this->data['title'], $wgArchNavBarSelected)) && isset($wgArchNavBarSelectedDefault) && $name == $wgArchNavBarSelectedDefault)) {
+ $anbClass = ' class="anb-selected"';
+ } else {
+ $anbClass = '';
}
+ echo '<li id="anb-'.strtolower($name).'"'.$anbClass.'><a href="'.$url.'">'.$name.'</a></li>';
}
- ?>
- </ul>
- </div>
- </div><!-- #archnavbar -->
- <?php } ?>
-
- <div id="globalWrapper">
- <div id="column-content">
- <div id="content">
- <a name="top" id="top"></a>
- <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
- <h1 id="firstHeading" class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1>
- <div id="bodyContent">
- <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
- <div id="contentSub"><?php $this->html('subtitle') ?></div>
- <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
- <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
- <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
- <!-- start content -->
- <?php $this->html('bodytext') ?>
- <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
- <!-- end content -->
- <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
- <div class="visualClear"></div>
- </div>
+ }
+ ?>
+ </ul>
</div>
- </div>
- <div id="column-one">
+</div><!-- #archnavbar -->
+<?php }
+
+?><div id="globalWrapper">
+<div id="column-content"><div id="content" <?php $this->html("specialpageattributes") ?>>
+ <a id="top"></a>
+ <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
+
+ <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
+ <div id="bodyContent">
+ <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
+ <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
+<?php if($this->data['undelete']) { ?>
+ <div id="contentSub2"><?php $this->html('undelete') ?></div>
+<?php } ?><?php if($this->data['newtalk'] ) { ?>
+ <div class="usermessage"><?php $this->html('newtalk') ?></div>
+<?php } ?><?php if($this->data['showjumplinks']) { ?>
+ <div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div>
+<?php } ?>
+ <!-- start content -->
+<?php $this->html('bodytext') ?>
+ <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
+ <!-- end content -->
+ <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
+ <div class="visualClear"></div>
+ </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) {
+ <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']).'"';
+ 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
@@ -182,13 +143,14 @@ class ArchLinuxTemplate extends QuickTemplate {
}
echo '>'.htmlspecialchars($tab['text']).'</a></li>';
} ?>
+
</ul>
</div>
</div>
<div class="portlet" id="p-personal">
<h5><?php $this->msg('personaltools') ?></h5>
<div class="pBody">
- <ul>
+ <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
@@ -223,16 +185,16 @@ class ArchLinuxTemplate extends QuickTemplate {
}
}
?>
- </div><!-- end of the left (by default at least) column -->
- <div class="visualClear"></div>
- <div id="footer">
+</div><!-- end of the left (by default at least) column -->
+<div class="visualClear"></div>
+<div id="footer"<?php $this->html('userlangattributes') ?>>
<?php
- if($this->data['poweredbyico']) { ?>
- <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
-<?php }
- if($this->data['copyrightico']) { ?>
- <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
-<?php }
+if($this->data['poweredbyico']) { ?>
+ <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
+<?php }
+if($this->data['copyrightico']) { ?>
+ <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
+<?php }
// Generate additional footer links
$footerlinks = array(
@@ -246,18 +208,18 @@ class ArchLinuxTemplate extends QuickTemplate {
}
}
if ( count( $validFooterLinks ) > 0 ) {
-?> <ul id="f-list">
+?> <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>
+?> <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
<?php }
}
?>
- </ul>
+ </ul>
<?php }
?>
- </div>
+</div>
</div>
<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
<?php $this->html('reporttime') ?>
@@ -279,17 +241,23 @@ class ArchLinuxTemplate extends QuickTemplate {
<div id="p-search" class="portlet">
<h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div id="searchBody" class="pBody">
- <form action="<?php $this->text('wgScript') ?>" id="searchform"><div>
+ <form action="<?php $this->text('wgScript') ?>" id="searchform">
<input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/>
- <input id="searchInput" name="search" type="text"<?php echo $this->skin->tooltipAndAccesskey('search');
- if( isset( $this->data['search'] ) ) {
- ?> value="<?php $this->text('search') ?>"<?php } ?> />
+ <?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' )
+ ) ); ?>
+
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>&nbsp;
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?>
<div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
- </div></form>
+ </form>
</div>
</div>
<?php
@@ -311,10 +279,10 @@ class ArchLinuxTemplate extends QuickTemplate {
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') ?></a></li>
+ ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li>
<?php }
}
- if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
+ 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>
@@ -360,7 +328,7 @@ class ArchLinuxTemplate extends QuickTemplate {
if( $this->data['language_urls'] ) {
?>
<div id="p-lang" class="portlet">
- <h5><?php $this->msg('otherlanguages') ?></h5>
+ <h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
<ul>
<?php foreach($this->data['language_urls'] as $langlink) { ?>
@@ -378,7 +346,7 @@ class ArchLinuxTemplate extends QuickTemplate {
function customBox( $bar, $cont ) {
?>
<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 $bar; else echo $out; ?></h5>
+ <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
<div class='pBody'>
<?php if ( is_array( $cont ) ) { ?>
<ul>
@@ -397,7 +365,6 @@ class ArchLinuxTemplate extends QuickTemplate {
</div>
<?php
}
-
} // end of class
diff --git a/skins/Chick.php b/skins/Chick.php
index a95a72ce..c8eb8152 100644
--- a/skins/Chick.php
+++ b/skins/Chick.php
@@ -1,8 +1,8 @@
<?php
/**
- * See docs/skin.txt
+ * Chick: A lightweight Monobook skin with no sidebar, the sidebar links are
+ * given at the bottom of the page instead, as in the unstyled MySkin.
*
- * @todo document
* @file
* @ingroup Skins
*/
@@ -14,16 +14,12 @@ if( !defined( 'MEDIAWIKI' ) )
require_once( dirname(__FILE__) . '/MonoBook.php' );
/**
- * @todo document
+ * Inherit main code from SkinTemplate, set the CSS and template filter.
* @ingroup Skins
*/
class SkinChick extends SkinTemplate {
- function initPage( OutputPage $out ) {
- SkinTemplate::initPage( $out );
- $this->skinname = 'chick';
- $this->stylename = 'chick';
- $this->template = 'MonoBookTemplate';
- }
+ var $skinname = 'chick', $stylename = 'chick',
+ $template = 'MonoBookTemplate', $useHeadElement = true;
function setupSkinUserCss( OutputPage $out ){
parent::setupSkinUserCss( $out );
@@ -34,5 +30,3 @@ class SkinChick extends SkinTemplate {
$out->addStyle( 'chick/IE60Fixes.css', 'screen,handheld', 'IE 6' );
}
}
-
-
diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php
index c650cbee..a7aac8a0 100644
--- a/skins/CologneBlue.php
+++ b/skins/CologneBlue.php
@@ -1,14 +1,15 @@
<?php
/**
- * See docs/skin.txt
+ * Cologne Blue: A nicer-looking alternative to Standard.
*
* @todo document
* @file
* @ingroup Skins
*/
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
/**
* @todo document
@@ -19,37 +20,38 @@ class SkinCologneBlue extends Skin {
function getStylesheet() {
return 'common/cologneblue.css';
}
+
function getSkinName() {
- return "cologneblue";
+ return 'cologneblue';
}
function doBeforeContent() {
-
- $s = "";
$qb = $this->qbSetting();
$mainPageObj = Title::newMainPage();
- $s .= "\n<div id='content'>\n<div id='topbar'>" .
- "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
+ $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 .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
- $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
+ $s .= '<td class="top" align="left" valign="middle" 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" align="right" valign="bottom" width="100%">';
$s .= $this->sysLinks();
- $s .= "</td></tr><tr><td valign='top'>";
+ $s .= '</td></tr><tr><td valign="top">';
- $s .= "<font size='-1'><span id='sitesub'>";
- $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
- $s .= "</td><td align='right'>" ;
+ $s .= '<font size="-1"><span id="sitesub">';
+ $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
+ $s .= '</td><td align="right">';
- $s .= "<font size='-1'><span id='langlinks'>" ;
- $s .= str_replace ( "<br />" , "" , $this->otherLanguages() );
+ $s .= '<font size="-1"><span id="langlinks">';
+ $s .= str_replace( '<br />', '', $this->otherLanguages() );
$cat = $this->getCategoryLinks();
- if( $cat ) $s .= "<br />$cat\n";
- $s .= "<br />" . $this->pageTitleLinks();
- $s .= "</span></font>";
+ if( $cat ) {
+ $s .= "<br />$cat\n";
+ }
+ $s .= '<br />' . $this->pageTitleLinks();
+ $s .= '</span></font>';
$s .= "</td></tr></table>\n";
@@ -64,37 +66,44 @@ class SkinCologneBlue extends Skin {
return $s;
}
- function doAfterContent()
- {
- global $wgOut, $wgLang;
+ function doAfterContent(){
+ global $wgLang;
$s = "\n</div><br clear='all' />\n";
$s .= "\n<div id='footer'>";
- $s .= "<table width='98%' border='0' cellspacing='0'><tr>";
+ $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" align="center" valign="top">';
$s .= $this->bottomLinks();
$s .= $wgLang->pipeList( array(
- "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ),
+ "\n<br />" . $this->link(
+ Title::newMainPage(),
+ null,
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ),
$this->aboutLink(),
- $this->searchForm( wfMsg( "qbfind" ) )
+ $this->searchForm( wfMsg( 'qbfind' ) )
) );
$s .= "\n<br />" . $this->pageStats();
- $s .= "</td>";
+ $s .= '</td>';
if ( 2 == $qb ) { # Right
$s .= $this->getQuickbarCompensator();
}
$s .= "</tr></table>\n</div>\n</div>\n";
- if ( 0 != $qb ) { $s .= $this->quickBar(); }
+ if ( 0 != $qb ) {
+ $s .= $this->quickBar();
+ }
return $s;
}
@@ -104,42 +113,51 @@ class SkinCologneBlue extends Skin {
if ( 2 == $qb ) { # Right
$s .= "#quickbar { position: absolute; right: 4px; }\n" .
- "#article { margin-left: 4px; margin-right: 148px; }\n";
- } else if ( 1 == $qb ) {
+ "#article { margin-left: 4px; margin-right: 148px; }\n";
+ } elseif ( 1 == $qb ) {
$s .= "#quickbar { position: absolute; left: 4px; }\n" .
- "#article { margin-left: 148px; margin-right: 4px; }\n";
- } else if ( 3 == $qb ) { # Floating left
+ "#article { margin-left: 148px; margin-right: 4px; }\n";
+ } elseif ( 3 == $qb ) { # Floating left
$s .= "#quickbar { position:absolute; left:4px } \n" .
- "#topbar { margin-left: 148px }\n" .
- "#article { margin-left:148px; margin-right: 4px; } \n" .
- "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
- } else if ( 4 == $qb ) { # Floating right
+ "#topbar { margin-left: 148px }\n" .
+ "#article { margin-left:148px; margin-right: 4px; } \n" .
+ "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
+ } elseif ( 4 == $qb ) { # Floating right
$s .= "#quickbar { position: fixed; right: 4px; } \n" .
- "#topbar { margin-right: 148px }\n" .
- "#article { margin-right: 148px; margin-left: 4px; } \n" .
- "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
+ "#topbar { margin-right: 148px }\n" .
+ "#article { margin-right: 148px; margin-left: 4px; } \n" .
+ "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
}
return $s;
}
function sysLinks() {
- global $wgUser, $wgLang, $wgContLang, $wgTitle;
- $li = $wgContLang->specialPage("Userlogin");
- $lo = $wgContLang->specialPage("Userlogout");
+ global $wgUser, $wgLang, $wgContLang;
+ $li = SpecialPage::getTitleFor( 'Userlogin' );
+ $lo = SpecialPage::getTitleFor( 'Userlogout' );
- $rt = $wgTitle->getPrefixedURL();
+ $rt = $this->mTitle->getPrefixedURL();
if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
- $q = "";
+ $q = array();
} else {
- $q = "returnto={$rt}";
+ $q = array( 'returnto' => $rt );
}
$s = array(
$this->mainPageLink(),
- $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ),
- $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ),
- $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ),
- $this->specialLink( "specialpages" )
+ $this->linkKnown(
+ Title::newFromText( wfMsgForContent( 'aboutpage' ) ),
+ wfMsg( 'about' )
+ ),
+ $this->linkKnown(
+ Title::newFromText( wfMsgForContent( 'helppage' ) ),
+ wfMsg( 'help' )
+ ),
+ $this->linkKnown(
+ Title::newFromText( wfMsgForContent( 'faqpage' ) ),
+ wfMsg( 'faq' )
+ ),
+ $this->specialLink( 'specialpages' )
);
/* show links to different language variants */
@@ -150,9 +168,19 @@ class SkinCologneBlue extends Skin {
$s[] = $this->extensionTabLinks();
}
if ( $wgUser->isLoggedIn() ) {
- $s[] = $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
+ $s[] = $this->linkKnown(
+ $lo,
+ wfMsg( 'logout' ),
+ array(),
+ $q
+ );
} else {
- $s[] = $this->makeKnownLink( $li, wfMsg( "login" ), $q );
+ $s[] = $this->linkKnown(
+ $li,
+ wfMsg( 'login' ),
+ array(),
+ $q
+ );
}
return $wgLang->pipeList( $s );
@@ -162,19 +190,18 @@ class SkinCologneBlue extends Skin {
* Compute the sidebar
* @access private
*/
- function quickBar()
- {
- global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
+ function quickBar(){
+ global $wgOut, $wgUser, $wgEnableUploads;
- $tns=$wgTitle->getNamespace();
+ $tns = $this->mTitle->getNamespace();
$s = "\n<div id='quickbar'>";
- $sep = "<br />";
- $s .= $this->menuHead( "qbfind" );
+ $sep = '<br />';
+ $s .= $this->menuHead( 'qbfind' );
$s .= $this->searchForm();
- $s .= $this->menuHead( "qbbrowse" );
+ $s .= $this->menuHead( 'qbbrowse' );
# Use the first heading from the Monobook sidebar as the "browse" section
$bar = $this->buildSidebar();
@@ -191,46 +218,49 @@ class SkinCologneBlue extends Skin {
}
if ( $wgOut->isArticle() ) {
- $s .= $this->menuHead( "qbedit" );
- $s .= "<strong>" . $this->editThisPage() . "</strong>";
+ $s .= $this->menuHead( 'qbedit' );
+ $s .= '<strong>' . $this->editThisPage() . '</strong>';
- $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
+ $s .= $sep . $this->linkKnown(
+ Title::newFromText( wfMsgForContent( 'edithelppage' ) ),
+ wfMsg( 'edithelp' )
+ );
if( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->moveThisPage();
}
- if ( $wgUser->isAllowed('delete') ) {
+ if ( $wgUser->isAllowed( 'delete' ) ) {
$dtp = $this->deleteThisPage();
- if ( "" != $dtp ) {
+ if ( $dtp != '' ) {
$s .= $sep . $dtp;
}
}
- if ( $wgUser->isAllowed('protect') ) {
+ if ( $wgUser->isAllowed( 'protect' ) ) {
$ptp = $this->protectThisPage();
- if ( "" != $ptp ) {
+ if ( $ptp != '' ) {
$s .= $sep . $ptp;
}
}
$s .= $sep;
- $s .= $this->menuHead( "qbpageoptions" );
+ $s .= $this->menuHead( 'qbpageoptions' );
$s .= $this->talkLink()
- . $sep . $this->commentLink()
- . $sep . $this->printableLink();
+ . $sep . $this->commentLink()
+ . $sep . $this->printableLink();
if ( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->watchThisPage();
}
$s .= $sep;
- $s .= $this->menuHead("qbpageinfo")
- . $this->historyLink()
- . $sep . $this->whatLinksHere()
- . $sep . $this->watchPageLinksLink();
+ $s .= $this->menuHead( 'qbpageinfo' )
+ . $this->historyLink()
+ . $sep . $this->whatLinksHere()
+ . $sep . $this->watchPageLinksLink();
if( $tns == NS_USER || $tns == NS_USER_TALK ) {
- $id=User::idFromName($wgTitle->getText());
- if ($id != 0) {
+ $id = User::idFromName( $this->mTitle->getText() );
+ if( $id != 0 ) {
$s .= $sep . $this->userContribsLink();
if( $this->showEmailUser( $id ) ) {
$s .= $sep . $this->emailUserLink();
@@ -240,72 +270,92 @@ class SkinCologneBlue extends Skin {
$s .= $sep;
}
- $s .= $this->menuHead( "qbmyoptions" );
+ $s .= $this->menuHead( 'qbmyoptions' );
if ( $wgUser->isLoggedIn() ) {
$name = $wgUser->getName();
- $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
- wfMsg( 'mytalk' ) );
+ $tl = $this->link(
+ $wgUser->getTalkPage(),
+ wfMsg( 'mytalk' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
if ( $wgUser->getNewtalk() ) {
- $tl .= " *";
+ $tl .= ' *';
}
- $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
- wfMsg( "mypage" ) )
- . $sep . $tl
- . $sep . $this->specialLink( "watchlist" )
- . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
- wfMsg( "mycontris" ) )
- . $sep . $this->specialLink( "preferences" )
- . $sep . $this->specialLink( "userlogout" );
+ $s .= $this->link(
+ $wgUser->getUserPage(),
+ wfMsg( 'mypage' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ) . $sep . $tl . $sep . $this->specialLink( 'watchlist' )
+ . $sep .
+ $this->link(
+ SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
+ wfMsg( 'mycontris' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ) . $sep . $this->specialLink( 'preferences' )
+ . $sep . $this->specialLink( 'userlogout' );
} else {
- $s .= $this->specialLink( "userlogin" );
+ $s .= $this->specialLink( 'userlogin' );
}
- $s .= $this->menuHead( "qbspecialpages" )
- . $this->specialLink( "newpages" )
- . $sep . $this->specialLink( "listfiles" )
- . $sep . $this->specialLink( "statistics" );
+ $s .= $this->menuHead( 'qbspecialpages' )
+ . $this->specialLink( 'newpages' )
+ . $sep . $this->specialLink( 'listfiles' )
+ . $sep . $this->specialLink( 'statistics' );
if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
- $s .= $sep . $this->specialLink( "upload" );
+ $s .= $sep . $this->specialLink( 'upload' );
}
+
global $wgSiteSupportPage;
- if( $wgSiteSupportPage) {
- $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
- .wfMsg( "sitesupport" )."</a>";
+
+ if( $wgSiteSupportPage ) {
+ $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
+ . wfMsg( 'sitesupport' ) . '</a>';
}
- $s .= $sep . $this->makeKnownLinkObj(
+ $s .= $sep . $this->link(
SpecialPage::getTitleFor( 'Specialpages' ),
- wfMsg( 'moredotdotdot' ) );
+ wfMsg( 'moredotdotdot' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
$s .= $sep . "\n</div>\n";
return $s;
}
- function menuHead( $key )
- {
+ function menuHead( $key ) {
$s = "\n<h6>" . wfMsg( $key ) . "</h6>";
return $s;
}
- function searchForm( $label = "" )
- {
+ function searchForm( $label = '' ) {
global $wgRequest, $wgUseTwoButtonsSearchForm;
$search = $wgRequest->getText( 'search' );
$action = $this->escapeSearchLink();
$s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
- if ( "" != $label ) { $s .= "{$label}: "; }
+ if( $label != '' ) {
+ $s .= "{$label}: ";
+ }
$s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
- . htmlspecialchars(substr($search,0,256)) . "\" /><br />"
- . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />";
-
- if ($wgUseTwoButtonsSearchForm)
- $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n";
- else
- $s .= '<div><a href="$action" rel="search">' . wfMsg ('powersearch-legend') . "</a></div>\n";
-
+ . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
+ . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
+
+ if( $wgUseTwoButtonsSearchForm ) {
+ $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
+ } else {
+ $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
+ }
+
$s .= '</form>';
// Ensure unique id's for search boxes made after the first
@@ -314,5 +364,3 @@ class SkinCologneBlue extends Skin {
return $s;
}
}
-
-
diff --git a/skins/Modern.php b/skins/Modern.php
index 6b6651d1..ef1b1a1e 100644
--- a/skins/Modern.php
+++ b/skins/Modern.php
@@ -16,8 +16,11 @@ if( !defined( 'MEDIAWIKI' ) )
* @ingroup Skins
*/
class SkinModern extends SkinTemplate {
+ var $skinname = 'modern', $stylename = 'modern',
+ $template = 'ModernTemplate', $useHeadElement = true;
+
/*
- * We don't like the default getPoweredBy, the icon clashes with the
+ * We don't like the default getPoweredBy, the icon clashes with the
* skin L&F.
*/
function getPoweredBy() {
@@ -25,14 +28,9 @@ class SkinModern extends SkinTemplate {
return "<div class='mw_poweredby'>Powered by MediaWiki $wgVersion</div>";
}
- function initPage( OutputPage $out ) {
- parent::initPage( $out );
- $this->skinname = 'modern';
- $this->stylename = 'modern';
- $this->template = 'ModernTemplate';
- }
-
function setupSkinUserCss( OutputPage $out ){
+ global $wgStyleVersion, $wgJsMimeType, $wgStylePath;
+
// Do not call parent::setupSkinUserCss(), we have our own print style
$out->addStyle( 'common/shared.css', 'screen' );
$out->addStyle( 'modern/main.css', 'screen' );
@@ -56,53 +54,18 @@ class ModernTemplate extends QuickTemplate {
* @access private
*/
function execute() {
- global $wgRequest;
+ global $wgRequest, $wgOut;
$this->skin = $skin = $this->data['skin'];
$action = $wgRequest->getText( 'action' );
// Suppress warnings to prevent notices about missing indexes in $this->data
wfSuppressWarnings();
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
- foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
- ?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
- } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
- <head>
- <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
- <?php $this->html('headlinks') ?>
- <title><?php $this->text('pagetitle') ?></title>
- <?php $this->html('csslinks') ?>
- <!--[if lt IE 7]><meta http-equiv="imagetoolbar" content="no" /><![endif]-->
-
- <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
-
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
- <!-- Head Scripts -->
-<?php $this->html('headscripts') ?>
-<?php if($this->data['jsvarurl' ]) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"><!-- site js --></script>
-<?php } ?>
-<?php if($this->data['pagecss' ]) { ?>
- <style type="text/css"><?php $this->html('pagecss' ) ?></style>
-<?php }
- if($this->data['usercss' ]) { ?>
- <style type="text/css"><?php $this->html('usercss' ) ?></style>
-<?php }
- if($this->data['userjs' ]) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
-<?php }
- if($this->data['userjsprev']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
-<?php }
- if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
- </head>
-<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
-<?php if($this->data['body_onload' ]) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
- class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
+ $this->html( 'headelement' );
+?>
<!-- heading -->
- <div id="mw_header"><h1 id="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1></div>
+ <div id="mw_header"><h1 id="firstHeading"><?php $this->html('title') ?></h1></div>
<div id="mw_main">
<div id="mw_contentwrapper">
@@ -141,9 +104,9 @@ class ModernTemplate extends QuickTemplate {
<!-- 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">
+ <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
<div class='mw-topboxes'>
- <div id="mw-js-message" style="display:none;"></div>
+ <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
<div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
<?php if($this->data['newtalk'] ) {
?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
@@ -153,7 +116,7 @@ class ModernTemplate extends QuickTemplate {
<?php } ?>
</div>
- <div id="contentSub"><?php $this->html('subtitle') ?></div>
+ <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
<?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
<?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#mw_portlets"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
@@ -166,11 +129,11 @@ class ModernTemplate extends QuickTemplate {
</div><!-- mw_content -->
</div><!-- mw_contentwrapper -->
- <div id="mw_portlets">
+ <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
<!-- portlets -->
- <?php
- $sidebar = $this->data['sidebar'];
+ <?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;
@@ -213,8 +176,8 @@ class ModernTemplate extends QuickTemplate {
</div>
- <!-- footer -->
- <div id="footer">
+ <!-- footer -->
+ <div id="footer"<?php $this->html('userlangattributes') ?>>
<ul id="f-list">
<?php
$footerlinks = array(
@@ -251,7 +214,7 @@ class ModernTemplate extends QuickTemplate {
<div id="p-search" class="portlet">
<h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div id="searchBody" class="pBody">
- <form action="<?php $this->text('wgScript') ?>" id="searchform"><div>
+ <form action="<?php $this->text('wgScript') ?>" id="searchform">
<input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/>
<input id="searchInput" name="search" type="text"<?php echo $this->skin->tooltipAndAccesskey('search');
if( isset( $this->data['search'] ) ) {
@@ -261,9 +224,9 @@ class ModernTemplate extends QuickTemplate {
<div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
- </div></form>
- </div><!-- pBody -->
- </div><!-- portlet -->
+ </form>
+ </div>
+ </div>
<?php
}
@@ -284,7 +247,7 @@ class ModernTemplate extends QuickTemplate {
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') ?></a></li>
+ ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li>
<?php }
}
if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
@@ -320,18 +283,17 @@ class ModernTemplate extends QuickTemplate {
}
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) );
-?> </ul>
- </div><!-- pBody -->
- </div><!-- portlet -->
+?>
+ </ul>
+ </div>
+ </div>
<?php
}
/*************************************************************************************************/
function languageBox() {
+ if( $this->data['language_urls'] ) {
?>
- <!-- languages -->
-<?php
- if( $this->data['language_urls'] ) { ?>
<div id="p-lang" class="portlet">
<h5><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
@@ -341,8 +303,8 @@ class ModernTemplate extends QuickTemplate {
?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
<?php } ?>
</ul>
- </div><!-- pBody -->
- </div><!-- portlet -->
+ </div>
+ </div>
<?php
}
}
@@ -364,12 +326,13 @@ class ModernTemplate extends QuickTemplate {
<?php } else {
# allow raw HTML block to be defined by extensions
print $cont;
- }
+ }
?>
- </div><!-- pBody -->
- </div><!-- portlet -->
+ </div>
+ </div>
<?php
}
} // end of class
-?>
+
+
diff --git a/skins/MonoBook.php b/skins/MonoBook.php
index 2312de0f..fdc1684d 100644
--- a/skins/MonoBook.php
+++ b/skins/MonoBook.php
@@ -20,13 +20,8 @@ if( !defined( 'MEDIAWIKI' ) )
*/
class SkinMonoBook extends SkinTemplate {
/** Using monobook. */
- function initPage( OutputPage $out ) {
- parent::initPage( $out );
- $this->skinname = 'monobook';
- $this->stylename = 'monobook';
- $this->template = 'MonoBookTemplate';
-
- }
+ var $skinname = 'monobook', $stylename = 'monobook',
+ $template = 'MonoBookTemplate', $useHeadElement = true;
function setupSkinUserCss( OutputPage $out ) {
global $wgHandheldStyle;
@@ -46,6 +41,7 @@ class SkinMonoBook extends SkinTemplate {
$out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
$out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' );
+
}
}
@@ -65,84 +61,50 @@ class MonoBookTemplate extends QuickTemplate {
*/
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();
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
- foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
- ?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
- } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
- <head>
- <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
- <?php $this->html('headlinks') ?>
- <title><?php $this->text('pagetitle') ?></title>
- <?php $this->html('csslinks') ?>
-
- <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
- <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
-
- <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
+ $this->html( 'headelement' );
+?><div id="globalWrapper">
+<div id="column-content"><div id="content" <?php $this->html("specialpageattributes") ?>>
+ <a id="top"></a>
+ <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
- <!-- Head Scripts -->
-<?php $this->html('headscripts') ?>
-<?php if($this->data['jsvarurl']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl') ?>"><!-- site js --></script>
-<?php } ?>
-<?php if($this->data['pagecss']) { ?>
- <style type="text/css"><?php $this->html('pagecss') ?></style>
-<?php }
- if($this->data['usercss']) { ?>
- <style type="text/css"><?php $this->html('usercss') ?></style>
-<?php }
- if($this->data['userjs']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
-<?php }
- if($this->data['userjsprev']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
-<?php }
- if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
- </head>
-<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
-<?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
- class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
- <div id="globalWrapper">
- <div id="column-content">
- <div id="content">
- <a name="top" id="top"></a>
- <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
- <h1 id="firstHeading" class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1>
- <div id="bodyContent">
- <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
- <div id="contentSub"><?php $this->html('subtitle') ?></div>
- <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
- <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
- <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
- <!-- start content -->
- <?php $this->html('bodytext') ?>
- <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
- <!-- end content -->
- <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
- <div class="visualClear"></div>
- </div>
+ <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
+ <div id="bodyContent">
+ <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
+ <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
+<?php if($this->data['undelete']) { ?>
+ <div id="contentSub2"><?php $this->html('undelete') ?></div>
+<?php } ?><?php if($this->data['newtalk'] ) { ?>
+ <div class="usermessage"><?php $this->html('newtalk') ?></div>
+<?php } ?><?php if($this->data['showjumplinks']) { ?>
+ <div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div>
+<?php } ?>
+ <!-- start content -->
+<?php $this->html('bodytext') ?>
+ <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
+ <!-- end content -->
+ <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
+ <div class="visualClear"></div>
</div>
- </div>
- <div id="column-one">
+</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) {
+ <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']).'"';
+ 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
@@ -157,13 +119,14 @@ class MonoBookTemplate extends QuickTemplate {
}
echo '>'.htmlspecialchars($tab['text']).'</a></li>';
} ?>
+
</ul>
</div>
</div>
<div class="portlet" id="p-personal">
<h5><?php $this->msg('personaltools') ?></h5>
<div class="pBody">
- <ul>
+ <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
@@ -198,16 +161,16 @@ class MonoBookTemplate extends QuickTemplate {
}
}
?>
- </div><!-- end of the left (by default at least) column -->
- <div class="visualClear"></div>
- <div id="footer">
+</div><!-- end of the left (by default at least) column -->
+<div class="visualClear"></div>
+<div id="footer"<?php $this->html('userlangattributes') ?>>
<?php
- if($this->data['poweredbyico']) { ?>
- <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
-<?php }
- if($this->data['copyrightico']) { ?>
- <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
-<?php }
+if($this->data['poweredbyico']) { ?>
+ <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
+<?php }
+if($this->data['copyrightico']) { ?>
+ <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
+<?php }
// Generate additional footer links
$footerlinks = array(
@@ -221,18 +184,18 @@ class MonoBookTemplate extends QuickTemplate {
}
}
if ( count( $validFooterLinks ) > 0 ) {
-?> <ul id="f-list">
+?> <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>
+?> <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li>
<?php }
}
?>
- </ul>
+ </ul>
<?php }
?>
- </div>
+</div>
</div>
<?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
<?php $this->html('reporttime') ?>
@@ -254,17 +217,23 @@ class MonoBookTemplate extends QuickTemplate {
<div id="p-search" class="portlet">
<h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div id="searchBody" class="pBody">
- <form action="<?php $this->text('wgScript') ?>" id="searchform"><div>
+ <form action="<?php $this->text('wgScript') ?>" id="searchform">
<input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/>
- <input id="searchInput" name="search" type="text"<?php echo $this->skin->tooltipAndAccesskey('search');
- if( isset( $this->data['search'] ) ) {
- ?> value="<?php $this->text('search') ?>"<?php } ?> />
+ <?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' )
+ ) ); ?>
+
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>&nbsp;
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?>
<div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
- </div></form>
+ </form>
</div>
</div>
<?php
@@ -286,10 +255,10 @@ class MonoBookTemplate extends QuickTemplate {
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') ?></a></li>
+ ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li>
<?php }
}
- if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
+ 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>
@@ -335,7 +304,7 @@ class MonoBookTemplate extends QuickTemplate {
if( $this->data['language_urls'] ) {
?>
<div id="p-lang" class="portlet">
- <h5><?php $this->msg('otherlanguages') ?></h5>
+ <h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
<ul>
<?php foreach($this->data['language_urls'] as $langlink) { ?>
@@ -353,7 +322,7 @@ class MonoBookTemplate extends QuickTemplate {
function customBox( $bar, $cont ) {
?>
<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 $bar; else echo $out; ?></h5>
+ <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
<div class='pBody'>
<?php if ( is_array( $cont ) ) { ?>
<ul>
@@ -372,7 +341,6 @@ class MonoBookTemplate extends QuickTemplate {
</div>
<?php
}
-
} // end of class
diff --git a/skins/MySkin.php b/skins/MySkin.php
index 46098454..8859a71a 100644
--- a/skins/MySkin.php
+++ b/skins/MySkin.php
@@ -1,8 +1,8 @@
<?php
/**
- * See docs/skin.txt
+ * MySkin: Monobook without the CSS. The idea is that you
+ * customise it using user or site CSS
*
- * @todo document
* @file
* @ingroup Skins
*/
@@ -11,14 +11,10 @@ if( !defined( 'MEDIAWIKI' ) )
die( -1 );
/**
- * @todo document
+ * Inherit main code from SkinTemplate, set the CSS and template filter.
* @ingroup Skins
*/
class SkinMySkin extends SkinTemplate {
- function initPage( OutputPage $out ) {
- parent::initPage( $out );
- $this->skinname = 'myskin';
- $this->stylename = 'myskin';
- $this->template = 'MonoBookTemplate';
- }
+ var $skinname = 'myskin', $stylename = 'myskin',
+ $template = 'MonoBookTemplate', $useHeadElement = true;
}
diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php
index d4dee0f4..d4f3f06f 100644
--- a/skins/Nostalgia.php
+++ b/skins/Nostalgia.php
@@ -1,14 +1,14 @@
<?php
/**
- * See docs/skin.txt
+ * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
*
- * @todo document
* @file
* @ingroup Skins
*/
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
/**
* @todo document
@@ -19,18 +19,19 @@ class SkinNostalgia extends Skin {
function getStylesheet() {
return 'common/nostalgia.css';
}
+
function getSkinName() {
- return "nostalgia";
+ return 'nostalgia';
}
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->logoText( 'right' ) . '</div>';
$s .= $this->pageTitle();
$s .= $this->pageSubtitle() . "\n";
- $s .= "<div id=\"topbar\">";
+ $s .= '<div id="topbar">';
$s .= $this->topLinks() . "\n<br />";
$notice = wfGetSiteNotice();
@@ -40,10 +41,14 @@ class SkinNostalgia extends Skin {
$s .= $this->pageTitleLinks();
$ol = $this->otherLanguages();
- if($ol) $s .= "<br />" . $ol;
+ if( $ol ) {
+ $s .= '<br />' . $ol;
+ }
$cat = $this->getCategoryLinks();
- if($cat) $s .= "<br />" . $cat;
+ if( $cat ) {
+ $s .= '<br />' . $cat;
+ }
$s .= "<br clear='all' /></div><hr />\n</div>\n";
$s .= "\n<div id='article'>";
@@ -79,7 +84,7 @@ class SkinNostalgia extends Skin {
$s .= $sep . $this->specialLink( 'watchlist' );
/* show my contributions link */
$s .= $sep . $this->link(
- SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
+ SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
wfMsgHtml( 'mycontris' ) );
/* show my preferences link */
$s .= $sep . $this->specialLink( 'preferences' );
@@ -104,13 +109,11 @@ class SkinNostalgia extends Skin {
$s .= $this->bottomLinks();
$s .= "\n<br />" . $this->pageStats();
$s .= "\n<br />" . $this->mainPageLink()
- . " | " . $this->aboutLink()
- . " | " . $this->searchForm();
+ . ' | ' . $this->aboutLink()
+ . ' | ' . $this->searchForm();
$s .= "\n</div>\n</div>\n";
return $s;
}
}
-
-
diff --git a/skins/Simple.php b/skins/Simple.php
index b26f50d0..416dc3f6 100644
--- a/skins/Simple.php
+++ b/skins/Simple.php
@@ -1,8 +1,8 @@
<?php
/**
- * See docs/skin.txt
+ * Simple: A lightweight skin with a simple white-background sidebar and no
+ * top bar.
*
- * @todo document
* @file
* @ingroup Skins
*/
@@ -14,34 +14,29 @@ if( !defined( 'MEDIAWIKI' ) )
require_once( dirname(__FILE__) . '/MonoBook.php' );
/**
- * @todo document
+ * Inherit main code from SkinTemplate, set the CSS and template filter.
* @ingroup Skins
*/
class SkinSimple extends SkinTemplate {
- function initPage( OutputPage $out ) {
- SkinTemplate::initPage( $out );
- $this->skinname = 'simple';
- $this->stylename = 'simple';
- $this->template = 'MonoBookTemplate';
- }
+ var $skinname = 'simple', $stylename = 'simple',
+ $template = 'MonoBookTemplate', $useHeadElement = true;
function setupSkinUserCss( OutputPage $out ){
$out->addStyle( 'simple/main.css', 'screen' );
$out->addStyle( 'simple/rtl.css', '', '', 'rtl' );
-
}
function reallyGenerateUserStylesheet() {
global $wgUser;
$s = '';
- if (($undopt = $wgUser->getOption("underline")) != 2) {
+ if( ( $undopt = $wgUser->getOption( 'underline' ) ) != 2 ) {
$underline = $undopt ? 'underline' : 'none';
$s .= "a { text-decoration: $underline; }\n";
}
- if ($wgUser->getOption('highlightbroken')) {
+ if( $wgUser->getOption( 'highlightbroken' ) ) {
$s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n";
} else {
- $s .= <<<END
+ $s .= <<<CSS
a.new, #quickbar a.new,
a.stub, #quickbar a.stub {
color: inherit;
@@ -57,19 +52,17 @@ a.stub:after, #quickbar a.stub:after {
color: #772233;
text-decoration: $underline;
}
-END;
+CSS;
}
- if ($wgUser->getOption('justify')) {
+ if( $wgUser->getOption( 'justify' ) ) {
$s .= "#article, #bodyContent { text-align: justify; }\n";
}
- if (!$wgUser->getOption('showtoc')) {
+ if( !$wgUser->getOption( 'showtoc' ) ) {
$s .= "#toc { display: none; }\n";
}
- if (!$wgUser->getOption('editsection')) {
+ if( !$wgUser->getOption( 'editsection' ) ) {
$s .= ".editsection { display: none; }\n";
}
return $s;
}
}
-
-
diff --git a/skins/Skin.sample b/skins/Skin.sample
deleted file mode 100644
index c011c143..00000000
--- a/skins/Skin.sample
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-# Your class extension is defined there.
-#
-# Do NOT use PHPTal with this sample, if you want PHPTal support have a look at
-# the other sample : SkinPHPTal.sample.
-#
-# The class name MUST begin with 'Skin' and the rest is the name of the file
-# excluding '.php'
-# This file is named Skin.sample (but it should end with php). So the
-# class name will be 'Skin' . 'Skin'
-
-class SkinSkin extends Skin {
-# Override method below
-#
-
-}
-
-}
-?>
diff --git a/skins/Standard.php b/skins/Standard.php
index 694bc5e3..e57cfaf9 100644
--- a/skins/Standard.php
+++ b/skins/Standard.php
@@ -1,14 +1,14 @@
<?php
/**
- * See docs/skin.txt
+ * Standard (a.k.a. Classic) skin: old MediaWiki default skin
*
- * @todo document
* @file
* @ingroup Skins
*/
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
/**
* @todo document
@@ -19,24 +19,10 @@ class SkinStandard extends Skin {
/**
*
*/
- function getHeadScripts( $allowUserJs ) {
- global $wgStylePath, $wgJsMimeType, $wgStyleVersion;
-
- $s = parent::getHeadScripts( $allowUserJs );
- if ( 3 == $this->qbSetting() ) { # Floating left
- $s .= "<script language='javascript' type='$wgJsMimeType' " .
- "src='{$wgStylePath}/common/sticky.js?$wgStyleVersion'></script>\n";
- }
- return $s;
- }
-
- /**
- *
- */
function setupSkinUserCss( OutputPage $out ){
if ( 3 == $this->qbSetting() ) { # Floating left
$out->addStyle( 'common/quickbar.css' );
- } else if ( 4 == $this->qbSetting() ) { # Floating right
+ } elseif ( 4 == $this->qbSetting() ) { # Floating right
$out->addStyle( 'common/quickbar-right.css' );
}
parent::setupSkinUserCss( $out );
@@ -51,60 +37,44 @@ class SkinStandard extends Skin {
if ( 2 == $qb ) { # Right
$s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
- "border-left: 2px solid #000000; }\n" .
- "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }\n";
- } else if ( 1 == $qb || 3 == $qb ) {
+ "border-left: 2px solid #000000; }\n" .
+ "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }\n";
+ } elseif ( 1 == $qb || 3 == $qb ) {
$s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
- "border-right: 1px solid gray; }\n" .
- "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }\n";
- } else if ( 4 == $qb) {
+ "border-right: 1px solid gray; }\n" .
+ "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }\n";
+ } elseif ( 4 == $qb ) {
$s .= "#quickbar { border-right: 1px solid gray; }\n" .
- "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }\n";
+ "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }\n";
}
return $s;
}
- /**
- *
- */
- function getBodyOptions() {
- $a = parent::getBodyOptions();
-
- if ( 3 == $this->qbSetting() ) { # Floating left
- $qb = "setup(\"quickbar\")";
- if($a["onload"]) {
- $a["onload"] .= ";$qb";
- } else {
- $a["onload"] = $qb;
- }
- }
- return $a;
- }
-
function doAfterContent() {
global $wgContLang, $wgLang;
- $fname = 'SkinStandard::doAfterContent';
- wfProfileIn( $fname );
- wfProfileIn( $fname.'-1' );
+ wfProfileIn( __METHOD__ );
+ wfProfileIn( __METHOD__ . '-1' );
$s = "\n</div><br style=\"clear:both\" />\n";
$s .= "\n<div id='footer'>";
$s .= '<table border="0" cellspacing="0"><tr>';
- wfProfileOut( $fname.'-1' );
- wfProfileIn( $fname.'-2' );
+ wfProfileOut( __METHOD__ . '-1' );
+ wfProfileIn( __METHOD__ . '-2' );
$qb = $this->qbSetting();
- $shove = ($qb != 0);
- $left = ($qb == 1 || $qb == 3);
- if($wgContLang->isRTL()) $left = !$left;
+ $shove = ( $qb != 0 );
+ $left = ( $qb == 1 || $qb == 3 );
+ if( $wgContLang->isRTL() ) {
+ $left = !$left;
+ }
if ( $shove && $left ) { # Left
- $s .= $this->getQuickbarCompensator();
+ $s .= $this->getQuickbarCompensator();
}
- wfProfileOut( $fname.'-2' );
- wfProfileIn( $fname.'-3' );
- $l = $wgContLang->isRTL() ? 'right' : 'left';
+ wfProfileOut( __METHOD__ . '-2' );
+ wfProfileIn( __METHOD__ . '-3' );
+ $l = $wgContLang->alignStart();
$s .= "<td class='bottom' align='$l' valign='top'>";
$s .= $this->bottomLinks();
@@ -113,32 +83,33 @@ class SkinStandard extends Skin {
$this->aboutLink(),
$this->specialLink( 'recentchanges' ),
$this->searchForm() ) )
- . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
+ . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
- $s .= "</td>";
+ $s .= '</td>';
if ( $shove && !$left ) { # Right
$s .= $this->getQuickbarCompensator();
}
$s .= "</tr></table>\n</div>\n</div>\n";
- wfProfileOut( $fname.'-3' );
- wfProfileIn( $fname.'-4' );
- if ( 0 != $qb ) { $s .= $this->quickBar(); }
- wfProfileOut( $fname.'-4' );
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ . '-3' );
+ wfProfileIn( __METHOD__ . '-4' );
+ if ( 0 != $qb ) {
+ $s .= $this->quickBar();
+ }
+ wfProfileOut( __METHOD__ . '-4' );
+ wfProfileOut( __METHOD__ );
return $s;
}
function quickBar() {
- global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgContLang;
+ global $wgOut, $wgUser, $wgRequest, $wgContLang;
global $wgEnableUploads, $wgRemoteUploads;
- $fname = 'Skin::quickBar';
- wfProfileIn( $fname );
+ wfProfileIn( __METHOD__ );
$action = $wgRequest->getText( 'action' );
$wpPreview = $wgRequest->getBool( 'wpPreview' );
- $tns=$wgTitle->getNamespace();
+ $tns = $this->mTitle->getNamespace();
$s = "\n<div id='quickbar'>";
$s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
@@ -161,18 +132,22 @@ class SkinStandard extends Skin {
if( $wgUser->isLoggedIn() ) {
$s.= $this->specialLink( 'watchlist' ) ;
- $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
- wfMsg( 'mycontris' ), 'target=' . wfUrlencode($wgUser->getName() ) );
+ $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 = $wgTitle->getArticleId();
- if ( $wgOut->isArticle() || $action =='edit' || $action =='history' || $wpPreview) {
- if($wgOut->isArticle()) {
+ $articleExists = $this->mTitle->getArticleId();
+ if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) {
+ if( $wgOut->isArticle() ) {
$s .= '<strong>' . $this->editThisPage() . '</strong>';
} else { # backlink to the article in edit or history mode
- if($articleExists){ # no backlink if no article
- switch($tns) {
+ if( $articleExists ){ # no backlink if no article
+ switch( $tns ) {
case NS_TALK:
case NS_USER_TALK:
case NS_PROJECT_TALK:
@@ -208,29 +183,40 @@ class SkinStandard extends Skin {
$text = wfMsg( 'categorypage' );
break;
default:
- $text= wfMsg( 'articlepage' );
+ $text = wfMsg( 'articlepage' );
}
- $link = $wgTitle->getText();
- if ($nstext = $wgContLang->getNsText($tns) ) { # add namespace if necessary
- $link = $nstext . ':' . $link ;
+ $link = $this->mTitle->getText();
+ if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary
+ $link = $nstext . ':' . $link;
}
- $s .= $this->makeLink( $link, $text );
- } elseif( $wgTitle->getNamespace() != NS_SPECIAL ) {
+ $s .= $this->link(
+ Title::newFromText( $link ),
+ $text
+ );
+ } elseif( $this->mTitle->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>';
+ $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
}
-
}
# "Post a comment" link
- if( ( $wgTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
- $s .= '<br />' . $this->makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
-
+ if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
+ $s .= '<br />' . $this->link(
+ $this->mTitle,
+ wfMsg( 'postcomment' ),
+ array(),
+ array(
+ 'action' => 'edit',
+ 'section' => 'new'
+ ),
+ array( 'known', 'noclasses' )
+ );
+
#if( $tns%2 && $action!='edit' && !$wpPreview) {
- #$s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
+ #$s.= '<br />'.$this->linkKnown( Title::newFromText( $wgTitle->getPrefixedText() ),wfMsg('postcomment'),array(),array('action'=>'edit','section'=>'new'));
#}
/*
@@ -239,33 +225,34 @@ class SkinStandard extends Skin {
article with "Watch this article" checkbox disabled, the article is transparently
unwatched. Therefore we do not show the "Watch this page" link in edit mode
*/
- if ( $wgUser->isLoggedIn() && $articleExists) {
- if($action!='edit' && $action != 'submit' )
- {
+ if ( $wgUser->isLoggedIn() && $articleExists ) {
+ if( $action != 'edit' && $action != 'submit' ) {
$s .= $sep . $this->watchThisPage();
}
- if ( $wgTitle->userCan( 'edit' ) )
+ if ( $this->mTitle->userCan( 'edit' ) )
$s .= $sep . $this->moveThisPage();
}
- if ( $wgUser->isAllowed('delete') and $articleExists ) {
+ if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
$s .= $sep . $this->deleteThisPage() .
$sep . $this->protectThisPage();
}
$s .= $sep . $this->talkLink();
- if ($articleExists && $action !='history') {
+ if( $articleExists && $action != 'history' ) {
$s .= $sep . $this->historyLink();
}
- $s.=$sep . $this->whatLinksHere();
+ $s .= $sep . $this->whatLinksHere();
- if($wgOut->isArticleRelated()) {
+ if( $wgOut->isArticleRelated() ) {
$s .= $sep . $this->watchPageLinksLink();
}
- if ( NS_USER == $wgTitle->getNamespace()
- || $wgTitle->getNamespace() == NS_USER_TALK ) {
+ if (
+ NS_USER == $this->mTitle->getNamespace() ||
+ $this->mTitle->getNamespace() == NS_USER_TALK
+ ) {
- $id=User::idFromName($wgTitle->getText());
- $ip=User::isIP($wgTitle->getText());
+ $id = User::idFromName( $this->mTitle->getText() );
+ $ip = User::isIP( $this->mTitle->getText() );
if( $id || $ip ){
$s .= $sep . $this->userContribsLink();
@@ -289,9 +276,8 @@ class SkinStandard extends Skin {
}
$s .= "\n<br /></div>\n";
- wfProfileOut( $fname );
+ wfProfileOut( __METHOD__ );
return $s;
}
-
}
diff --git a/skins/Vector.deps.php b/skins/Vector.deps.php
new file mode 100644
index 00000000..7a8c2881
--- /dev/null
+++ b/skins/Vector.deps.php
@@ -0,0 +1,11 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// MonoBook.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+// see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
+
+if ( ! defined( 'MEDIAWIKI' ) )
+ die( 1 );
+
+require_once( dirname( dirname( __FILE__ ) ) . '/includes/SkinTemplate.php');
diff --git a/skins/Vector.php b/skins/Vector.php
new file mode 100644
index 00000000..b678b7e3
--- /dev/null
+++ b/skins/Vector.php
@@ -0,0 +1,767 @@
+<?php
+/**
+ * Vector - Branch of MonoBook which has many usability improvements and
+ * somewhat cleaner code.
+ *
+ * @todo document
+ * @file
+ * @ingroup Skins
+ */
+
+if( !defined( 'MEDIAWIKI' ) )
+ die( -1 );
+
+/**
+ * SkinTemplate class for Vector skin
+ * @ingroup Skins
+ */
+class SkinVector extends SkinTemplate {
+
+ /* Functions */
+ var $skinname = 'vector', $stylename = 'vector',
+ $template = 'VectorTemplate', $useHeadElement = true;
+
+ /**
+ * Initializes output page and sets up skin-specific parameters
+ * @param object $out Output page object to initialize
+ */
+ public function initPage( OutputPage $out ) {
+ global $wgStylePath, $wgJsMimeType, $wgStyleVersion, $wgScriptPath, $wgVectorExtraStyles;
+
+ parent::initPage( $out );
+
+ // Append skin-specific styles
+ $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
+ $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
+ // 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.
+ $out->addScript(
+ '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
+ $wgStylePath .
+ '/vector/csshover.htc")}</style><![endif]-->'
+ );
+ // Add extra stylesheets
+ // THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE.
+ if ( is_array( $wgVectorExtraStyles ) ) {
+ foreach ( $wgVectorExtraStyles as $style ) {
+ $out->addStyle( 'vector/' . $style, 'screen' );
+ }
+ }
+ }
+ /**
+ * Builds a structured array of links used for tabs and menus
+ * @return array
+ * @private
+ */
+ function buildNavigationUrls() {
+ global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
+ 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' );
+
+ // 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";
+ }
+ $currentId = $isTalk ? $talkId : $subjectId;
+
+ // Adds namespace links
+ $links['namespaces'][$subjectId] = $this->tabAction(
+ $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
+ );
+ $links['namespaces'][$subjectId]['context'] = 'subject';
+ $links['namespaces'][$talkId] = $this->tabAction(
+ $talkPage, 'vector-namespace-talk', $isTalk, '', true
+ );
+ $links['namespaces'][$talkId]['context'] = 'talk';
+
+ // Adds view view link
+ if ( $this->mTitle->exists() ) {
+ $links['views']['view'] = $this->tabAction(
+ $isTalk ? $talkPage : $subjectPage,
+ 'vector-view-view', ( $action == 'view' ), '', true
+ );
+ }
+
+ wfProfileIn( __METHOD__ . '-edit' );
+
+ // Checks if user can...
+ if (
+ // edit the current page
+ $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->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&section=new'
+ )
+ );
+ }
+ }
+ // Checks if the page is known (some kind of viewable content)
+ } elseif ( $this->mTitle->isKnown() ) {
+ // 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() ) {
+ // 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' )
+ ) {
+ if( $n = $this->mTitle->isDeleted() ) {
+ $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( 'vector-namespace-special' ),
+ 'href' => $wgRequest->getRequestURL()
+ );
+ }
+
+ // 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 )
+ );
+ }
+ }
+
+ wfProfileOut( __METHOD__ );
+
+ return $links;
+ }
+}
+
+/**
+ * QuickTemplate class for Vector skin
+ * @ingroup Skins
+ */
+class VectorTemplate extends QuickTemplate {
+
+ /* Members */
+
+ /**
+ * @var Cached skin object
+ */
+ var $skin;
+
+ /* Functions */
+
+ /**
+ * Outputs the entire contents of the XHTML page
+ */
+ public function execute() {
+ global $wgRequest, $wgOut, $wgContLang;
+
+ $this->skin = $this->data['skin'];
+ $action = $wgRequest->getText( 'action' );
+
+ // Build additional attributes for navigation urls
+ $nav = $this->skin->buildNavigationUrls();
+ 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;
+ }
+ $nav[$section][$key]['attributes'] =
+ ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
+ if ( $nav[$section][$key]['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' ) )
+ ) {
+ $nav[$section][$key]['key'] =
+ $this->skin->tooltip( $xmlID );
+ } else {
+ $nav[$section][$key]['key'] =
+ $this->skin->tooltipAndAccesskey( $xmlID );
+ }
+ }
+ }
+ $this->data['namespace_urls'] = $nav['namespaces'];
+ $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 = array(
+ 'info' => array(
+ 'lastmod',
+ 'viewcount',
+ 'numberofwatchingusers',
+ 'credits',
+ 'copyright',
+ 'tagline',
+ ),
+ 'places' => array(
+ 'privacy',
+ 'about',
+ 'disclaimer',
+ ),
+ );
+ // 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;
+ }
+ }
+ }
+ // Reverse horizontally rendered navigation elements
+ if ( $wgContLang->isRTL() ) {
+ $this->data['view_urls'] =
+ array_reverse( $this->data['view_urls'] );
+ $this->data['namespace_urls'] =
+ array_reverse( $this->data['namespace_urls'] );
+ $this->data['personal_urls'] =
+ array_reverse( $this->data['personal_urls'] );
+ }
+ // Output HTML Page
+ $this->html( 'headelement' );
+?>
+ <div id="mw-page-base" class="noprint"></div>
+ <div id="mw-head-base" class="noprint"></div>
+ <!-- content -->
+ <div id="content" <?php $this->html('specialpageattributes') ?>>
+ <a id="top"></a>
+ <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>
+ <!-- /sitenotice -->
+ <?php endif; ?>
+ <!-- firstHeading -->
+ <h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title' ) ?></h1>
+ <!-- /firstHeading -->
+ <!-- bodyContent -->
+ <div id="bodyContent">
+ <!-- tagline -->
+ <h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3>
+ <!-- /tagline -->
+ <!-- subtitle -->
+ <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'] ): ?>
+ <!-- newtalk -->
+ <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
+ <!-- /newtalk -->
+ <?php endif; ?>
+ <?php if ( $this->data['showjumplinks'] ): ?>
+ <!-- jumpto -->
+ <div id="jump-to-nav">
+ <?php $this->msg( 'jumpto' ) ?> <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a>,
+ <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
+ </div>
+ <!-- /jumpto -->
+ <?php endif; ?>
+ <!-- bodytext -->
+ <?php $this->html( 'bodytext' ) ?>
+ <!-- /bodytext -->
+ <?php if ( $this->data['catlinks'] ): ?>
+ <!-- catlinks -->
+ <?php $this->html( 'catlinks' ); ?>
+ <!-- /catlinks -->
+ <?php endif; ?>
+ <?php if ( $this->data['dataAfterContent'] ): ?>
+ <!-- dataAfterContent -->
+ <?php $this->html( 'dataAfterContent' ); ?>
+ <!-- /dataAfterContent -->
+ <?php endif; ?>
+ <div class="visualClear"></div>
+ </div>
+ <!-- /bodyContent -->
+ </div>
+ <!-- /content -->
+ <!-- header -->
+ <div id="mw-head" class="noprint">
+ <?php $this->renderNavigation( 'PERSONAL' ); ?>
+ <div id="left-navigation">
+ <?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?>
+ </div>
+ <div id="right-navigation">
+ <?php $this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?>
+ </div>
+ </div>
+ <!-- /header -->
+ <!-- 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>
+ <!-- /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 ): ?>
+ <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; ?>
+ <ul id="footer-icons" class="noprint">
+ <?php if ( $this->data['poweredbyico'] ): ?>
+ <li id="footer-icon-poweredby"><?php $this->html( 'poweredbyico' ) ?></li>
+ <?php endif; ?>
+ <?php if ( $this->data['copyrightico'] ): ?>
+ <li id="footer-icon-copyright"><?php $this->html( 'copyrightico' ) ?></li>
+ <?php endif; ?>
+ </ul>
+ <div style="clear:both"></div>
+ </div>
+ <!-- /footer -->
+ <!-- fixalpha -->
+ <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
+ <!-- /fixalpha -->
+ <?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; ?>
+ </body>
+</html>
+<?php
+ }
+
+ /**
+ * Render a series of portals
+ */
+ 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;
+ // Render portals
+ foreach ( $portals as $name => $content ) {
+ 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
+ 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'] ) ?>"><?php echo $langlink['text'] ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+</div>
+<?php
+ }
+ 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>
+ <div class="body">
+ <?php if ( is_array( $content ) ): ?>
+ <ul>
+ <?php foreach( $content as $key => $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; ?>
+ </ul>
+ <?php else: ?>
+ <?php echo $content; /* Allow raw HTML block to be defined by extensions */ ?>
+ <?php endif; ?>
+ </div>
+</div>
+<?php
+ break;
+ }
+ echo "\n<!-- /{$name} -->\n";
+ }
+ }
+
+ /**
+ * Render one or more navigations elements by name, automatically reveresed
+ * when UI is in RTL mode
+ */
+ private function renderNavigation( $elements ) {
+ global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
+
+ // 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 ( $wgContLang->isRTL() ) {
+ $elements = array_reverse( $elements );
+ }
+ // Render elements
+ foreach ( $elements as $name => $element ) {
+ echo "\n<!-- {$name} -->\n";
+ switch ( $element ) {
+ 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 $key => $link ): ?>
+ <li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
+ <?php endforeach; ?>
+ </ul>
+</div>
+<?php
+ break;
+ case 'VARIANTS':
+?>
+<div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+ <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
+ <div class="menu">
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach ($this->data['variant_urls'] as $key => $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>
+ </div>
+</div>
+<?php
+ break;
+ case 'VIEWS':
+?>
+<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 $key => $link ): ?>
+ <li<?php echo $link['attributes'] ?>><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'].'" />' : '<span>'.htmlspecialchars( $link['text'] ).'</span>') ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+</div>
+<?php
+ break;
+ 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>
+ <div class="menu">
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach ($this->data['action_urls'] as $key => $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>
+ </div>
+</div>
+<?php
+ break;
+ 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 $key => $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; ?>
+ </ul>
+</div>
+<?php
+ break;
+ case 'SEARCH':
+?>
+<div id="p-search">
+ <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 ): ?>
+ <div id="simpleSearch">
+ <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; ?> />
+ <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>>&nbsp;</button>
+ </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 endif; ?>
+ </form>
+</div>
+<?php
+
+ break;
+ }
+ echo "\n<!-- /{$name} -->\n";
+ }
+ }
+}
diff --git a/skins/archlinux/IEMacFixes.css b/skins/archlinux/IEMacFixes.css
deleted file mode 100644
index f1b05719..00000000
--- a/skins/archlinux/IEMacFixes.css
+++ /dev/null
@@ -1,44 +0,0 @@
-/* IE/Mac only fix stylesheet, imported from main.css */
-#portal-column-content {
- margin: 0 0 4.8em 0;
- float: none;
-}
-#portal-column-content #content {
- z-index: 0;
-}
-#portal-column-one {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 3;
-}
-#portal-footer {
- margin-left: 12em;
-}
-/*
-#portlet-contentViews {
- top: 0.6em !important;
- left: 14.5em !important;
-}
-*/
-#portlet-contentViews li,
-#portlet-contentViews .selected {
- border: none !important;
-}
-#portlet-contentViews li a {
- border: 1px solid #aaaaaa;
- border-bottom: none;
-}
-#portlet-contentViews li.selected a {
- border: 1px solid #fabd23;
- border-bottom: none;
-}
-/* no background images */
-li#personaltools-userpage,
-li#personaltools-login/* */ {
- background: none;
- padding-left: none;
-}
-#mactest {
- color: green;
-}
diff --git a/skins/archlinux/discussionitem_icon.gif b/skins/archlinux/discussionitem_icon.gif
index baec471a..e3ca6d9e 100644
--- a/skins/archlinux/discussionitem_icon.gif
+++ b/skins/archlinux/discussionitem_icon.gif
Binary files differ
diff --git a/skins/archlinux/file_icon.gif b/skins/archlinux/file_icon.gif
index 847f6485..69dbeaf7 100644
--- a/skins/archlinux/file_icon.gif
+++ b/skins/archlinux/file_icon.gif
Binary files differ
diff --git a/skins/archlinux/link_icon.gif b/skins/archlinux/link_icon.gif
index 815ccb1b..168c1a2f 100644
--- a/skins/archlinux/link_icon.gif
+++ b/skins/archlinux/link_icon.gif
Binary files differ
diff --git a/skins/archlinux/lock_icon.gif b/skins/archlinux/lock_icon.gif
index 8a87e283..f71cd9b8 100644
--- a/skins/archlinux/lock_icon.gif
+++ b/skins/archlinux/lock_icon.gif
Binary files differ
diff --git a/skins/archlinux/magnify-clip.png b/skins/archlinux/magnify-clip.png
index 992aa2e3..ffd7637f 100644
--- a/skins/archlinux/magnify-clip.png
+++ b/skins/archlinux/magnify-clip.png
Binary files differ
diff --git a/skins/archlinux/mail_icon.gif b/skins/archlinux/mail_icon.gif
index 50a87a9a..cf5680d9 100644
--- a/skins/archlinux/mail_icon.gif
+++ b/skins/archlinux/mail_icon.gif
Binary files differ
diff --git a/skins/archlinux/main.css b/skins/archlinux/main.css
index d6a67c1e..727355bb 100644
--- a/skins/archlinux/main.css
+++ b/skins/archlinux/main.css
@@ -54,9 +54,6 @@ body {
margin: 0;
padding: 0;
}
-.visualClear {
- clear: both;
-}
/* general styles */
@@ -281,43 +278,12 @@ span.subpages {
#siteNotice {
text-align: center;
font-size: 95%;
- padding: 0 .9em;
+ padding: 0 0.9em;
}
#siteNotice p {
margin: 0;
padding: 0;
}
-.success {
- color: green;
- font-size: larger;
-}
-.error {
- color: red;
- font-size: larger;
-}
-.errorbox, .successbox {
- font-size: larger;
- border: 2px solid;
- padding: .5em 1em;
- float: left;
- margin-bottom: 2em;
- color: #000;
-}
-.errorbox {
- border-color: red;
- background-color: #fff2f2;
-}
-.successbox {
- border-color: green;
- background-color: #dfd;
-}
-.errorbox h2, .successbox h2 {
- font-size: 1em;
- font-weight: bold;
- display: inline;
- margin: 0 .5em 0 0;
- border: none;
-}
.catlinks {
border: 1px solid #aaa;
@@ -525,35 +491,34 @@ table.rimage {
** this is css3, the validator doesn't like it when validating as css2
*/
#bodyContent a.external,
-#bodyContent a[href ^="gopher://"] {
+#bodyContent a.external[href ^="gopher://"] {
background: url(external.png) center right no-repeat;
padding: 0 13px;
}
.rtl #bodyContent a.external,
-.rtl #bodyContent a[href ^="gopher://"] {
+.rtl #bodyContent a.external[href ^="gopher://"] {
background-image: url(external-rtl.png);
}
-#bodyContent a[href ^="https://"],
+#bodyContent a.external[href ^="https://"],
.link-https {
background: url(lock_icon.gif) center right no-repeat;
padding: 0 16px;
}
-#bodyContent a[href ^="mailto:"],
+#bodyContent a.external[href ^="mailto:"],
.link-mailto {
background: url(mail_icon.gif) center right no-repeat;
padding: 0 18px;
}
-#bodyContent a[href ^="news://"] {
+#bodyContent a.external[href ^="news://"] {
background: url(news_icon.png) center right no-repeat;
padding: 0 18px;
}
-#bodyContent a[href ^="ftp://"],
+#bodyContent a.external[href ^="ftp://"],
.link-ftp {
background: url(file_icon.gif) center right no-repeat;
padding: 0 18px;
}
-#bodyContent a[href ^="irc://"],
-#bodyContent a.extiw[href ^="irc://"],
+#bodyContent a.external[href ^="irc://"],
.link-irc {
background: url(discussionitem_icon.gif) center right no-repeat;
padding: 0 18px;
@@ -604,18 +569,10 @@ table.rimage {
#bodyContent a.extiw,
#bodyContent a.extiw:active {
color: #36b;
- background: none;
- padding: 0;
}
#bodyContent a.external {
color: #36b;
}
-/* this can be used in the content area to switch off
-special external link styling */
-#bodyContent .plainlinks a {
- background: none !important;
- padding: 0 !important;
-}
/*
** Structural Elements
*/
@@ -920,6 +877,14 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
z-index: 3;
}
+/* Override text-transform on languages where capitalization is significant */
+.capitalize-all-nouns .portlet h5,
+.capitalize-all-nouns .portlet h6,
+.capitalize-all-nouns #p-personal ul,
+.capitalize-all-nouns #p-cactions ul li a {
+ text-transform: none;
+}
+
/* TODO: #t-iscite is only used by the Cite extension, come up with some
* system which allows extensions to add to this file on the fly
*/
@@ -956,6 +921,13 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
height: 1%;
}
+.mw-htmlform-submit {
+ font-weight: bold;
+ padding-left: .3em;
+ padding-right: .3em;
+ margin-right: 2em;
+}
+
/* js pref toc */
#preftoc {
margin: 0;
@@ -1005,10 +977,6 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
cursor: default;
text-decoration: none;
}
-#prefcontrol {
- padding-top: 2em;
- clear: both;
-}
#preferences {
margin: 0;
border: 1px solid #aaa;
@@ -1021,11 +989,7 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
padding: 0;
margin: 0;
}
-.prefsection fieldset {
- border: 1px solid #aaa;
- float: left;
- margin-right: 2em;
-}
+
.prefsection legend {
font-weight: bold;
}
@@ -1035,16 +999,11 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
.mainLegend {
display: none;
}
-div.prefsectiontip {
+td.htmlform-tip {
font-size: x-small;
padding: .2em 2em;
color: #666;
}
-.btnSavePrefs {
- font-weight: bold;
- padding-left: .3em;
- padding-right: .3em;
-}
.preferences-login {
clear: both;
@@ -1162,20 +1121,9 @@ div#userloginForm .captcha {
display: none;
}
-.not-patrolled {
- background-color: #ffa;
-}
+
div.patrollink {
clear: both;
- font-size: 75%;
- text-align: right;
-}
-span.newpage, span.minor, span.bot {
- font-weight: bold;
-}
-span.unpatrolled {
- font-weight: bold;
- color: red;
}
.sharedUploadNotice {
@@ -1187,66 +1135,14 @@ span.updatedmarker {
background-color: #0f0;
}
-table.gallery {
- border: 1px solid #ccc;
- margin: 2px;
- padding: 2px;
- background-color: white;
-}
-
-table.gallery tr {
- vertical-align: top;
-}
-
-table.gallery td {
- vertical-align: top;
- background-color: #f9f9f9;
- border: solid 2px white;
-}
-/* Keep this temporarily so that cached pages will display right */
-table.gallery td.galleryheader {
- text-align: center;
- font-weight: bold;
-}
-table.gallery caption {
- font-weight: bold;
-}
-
-div.gallerybox {
- margin: 2px;
-}
-
-div.gallerybox div.thumb {
- text-align: center;
- border: 1px solid #ccc;
- margin: 2px;
-}
-
-div.gallerytext {
- overflow: hidden;
- font-size: 94%;
- padding: 2px 4px;
-}
-
-span.comment {
- font-style: italic;
-}
-
-span.changedby {
- font-size: 95%;
-}
-
.previewnote {
- text-indent: 3em;
color: #c00;
- border-bottom: 1px solid #aaa;
- padding-bottom: 1em;
margin-bottom: 1em;
}
.previewnote p {
- margin: 0;
- padding: 0;
+ text-indent: 3em;
+ margin: 0.8em 0;
}
.editExternally {
@@ -1268,69 +1164,6 @@ span.changedby {
text-indent: -2em;
}
-/* Classes for EXIF data display */
-table.mw_metadata {
- font-size: 0.8em;
- margin-left: 0.5em;
- margin-bottom: 0.5em;
- width: 300px;
-}
-
-table.mw_metadata caption {
- font-weight: bold;
-}
-
-table.mw_metadata th {
- font-weight: normal;
-}
-
-table.mw_metadata td {
- padding: 0.1em;
-}
-
-table.mw_metadata {
- border: none;
- border-collapse: collapse;
-}
-
-table.mw_metadata td, table.mw_metadata th {
- text-align: center;
- border: 1px solid #aaaaaa;
- padding-left: 0.1em;
- padding-right: 0.1em;
-}
-
-table.mw_metadata th {
- background-color: #f9f9f9;
-}
-
-table.mw_metadata td {
- background-color: #fcfcfc;
-}
-
-table.collapsed tr.collapsable {
- display: none;
-}
-
-
-/* filetoc */
-ul#filetoc {
- text-align: center;
- border: 1px solid #aaaaaa;
- background-color: #f9f9f9;
- padding: 5px;
- font-size: 95%;
- margin-bottom: 0.5em;
- margin-left: 0;
- margin-right: 0;
-}
-
-#filetoc li {
- display: inline;
- list-style-type: none;
- padding-right: 2em;
-}
-
input#wpSummary {
width: 80%;
}
@@ -1368,32 +1201,6 @@ p.revision_saved {
font-weight:bold;
}
-#mw_trackbacks {
- border: solid 1px #bbbbff;
- background-color: #eeeeff;
- padding: 0.2em;
-}
-
-
-/* Allmessages table */
-
-#allmessagestable th {
- background-color: #b2b2ff;
-}
-
-#allmessagestable tr.orig {
- background-color: #ffe2e2;
-}
-
-#allmessagestable tr.new {
- background-color: #e2ffe2;
-}
-
-#allmessagestable tr.def {
- background-color: #f0f0ff;
-}
-
-
/* noarticletext */
div.noarticletext {
border: 1px solid #ccc;
@@ -1457,53 +1264,6 @@ table.multipageimage td {
text-align: center;
}
-/** Special:Version */
-
-table#sv-ext, table#sv-hooks, table#sv-software {
- margin: 1em;
- padding:0em;
-}
-
-#sv-ext td, #sv-hooks td, #sv-software td,
-#sv-ext th, #sv-hooks th, #sv-software th {
- border: 1px solid #A0A0A0;
- padding: 0 0.15em 0 0.15em;
-}
-#sv-ext th, #sv-hooks th, #sv-software th {
- background-color: #F0F0F0;
- color: black;
- padding: 0 0.15em 0 0.15em;
-}
-tr.sv-space{
- height: 0.8em;
- border:none;
-}
-tr.sv-space td { display: none; }
-
-/*
- Table pager (e.g. Special:Imagelist)
- - remove underlines from the navigation link
- - collapse borders
- - set the borders to outsets (similar to Special:Allmessages)
- - remove line wrapping for all td and th, set background color
- - restore line wrapping for the last two table cells (description and size)
-*/
-.TablePager { min-width: 80%; }
-.TablePager_nav a { text-decoration: none; }
-.TablePager { border-collapse: collapse; }
-.TablePager, .TablePager td, .TablePager th {
- border: 1px solid #aaaaaa;
- padding: 0 0.15em 0 0.15em;
-}
-.TablePager th { background-color: #eeeeff }
-.TablePager td { background-color: #ffffff }
-.TablePager tr:hover td { background-color: #eeeeff }
-
-.imagelist td, .imagelist th { white-space: nowrap }
-.imagelist .TablePager_col_links { background-color: #eeeeff }
-.imagelist .TablePager_col_img_description { white-space: normal }
-.imagelist th.TablePager_sort { background-color: #ccccff }
-
.templatesUsed { margin-top: 1.5em; }
.mw-summary-preview {
@@ -1537,24 +1297,12 @@ div.mw-lag-warn-high {
font-size: 90%;
}
-/** Special:Search stuff */
-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: #cae8ff;
-}
-
/* God-damned hack for the crappy layout */
.os-suggest {
font-size: 127%;
}
+
+/* Sometimes people don't want personal tools to be lowercase! */
+.no-text-transform {
+ text-transform: none;
+}
diff --git a/skins/archlinux/rtl.css b/skins/archlinux/rtl.css
index 9b8e4f44..b9bf43c0 100644
--- a/skins/archlinux/rtl.css
+++ b/skins/archlinux/rtl.css
@@ -211,7 +211,6 @@ input#wpSave, input#wpDiff {
}
#userlogin {
- float: right;
margin: 0 0 1em 3em;
}
/* Convenience links to edit block, delete and protect reasons */
@@ -228,20 +227,25 @@ 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#bodyContent ul {
+html > body div#article ul {
display: table;
}
html > body div#bodyContent ul#filetoc {
display: block;
}
-/* Special:Prefixindex styling */
-td#mw-prefixindex-nav-form {
- text-align: left;
-}
-
diff --git a/skins/archlinux/user.gif b/skins/archlinux/user.gif
index c9c9ab96..34b4839d 100644
--- a/skins/archlinux/user.gif
+++ b/skins/archlinux/user.gif
Binary files differ
diff --git a/skins/archlinux/video.png b/skins/archlinux/video.png
index 38103dac..fadc4c9b 100644
--- a/skins/archlinux/video.png
+++ b/skins/archlinux/video.png
Binary files differ
diff --git a/skins/archlinux/wiki.png b/skins/archlinux/wiki.png
index 69fce988..44389389 100644
--- a/skins/archlinux/wiki.png
+++ b/skins/archlinux/wiki.png
Binary files differ
diff --git a/skins/chick/main.css b/skins/chick/main.css
index fde03301..ac61b91b 100644
--- a/skins/chick/main.css
+++ b/skins/chick/main.css
@@ -7,10 +7,11 @@
*/
body {
- font-family: sans-serif;
- color: Black;
- margin: 0;
- padding: 0.3em;
+ font-family: sans-serif;
+ color: black;
+ background: white;
+ margin: 0;
+ padding: 0.3em;
}
a { color: #002bb8; }
@@ -23,32 +24,32 @@ a.new:visited,
#p-personal a.new:visited { color:#a55858; }
img {
- border: none;
- vertical-align: middle;
+ border: none;
+ vertical-align: middle;
}
p {
- margin: 0.4em 0em 0.5em 0em;
- line-height: 1.5em;
+ margin: 0.4em 0em 0.5em 0em;
+ line-height: 1.5em;
}
p img { margin: 0; }
hr {
- height: 1px;
- color: #aaaaaa;
- background-color: #aaaaaa;
- border: 0;
- margin: 0.2em 0 0.2em 0;
+ height: 1px;
+ color: #aaaaaa;
+ background-color: #aaaaaa;
+ border: 0;
+ margin: 0.2em 0 0.2em 0;
}
h1, h2, h3, h4, h5, h6 {
- color: Black;
- background: none;
- font-weight: normal;
- margin: 0;
- padding-top: 0.5em;
- padding-bottom: 0.17em;
- border-bottom: 1px solid #aaaaaa;
+ color: black;
+ background: none;
+ font-weight: normal;
+ margin: 0;
+ padding-top: 0.5em;
+ padding-bottom: 0.17em;
+ border-bottom: 1px solid #aaaaaa;
}
.editsection {
font-weight: normal;
@@ -58,8 +59,8 @@ h1 .editsection { font-size: 53.2%; }
h2 { font-size: 150%; }
h2 .editsection { font-size: 66.7%; }
h3, h4, h5, h6 {
- border-bottom: none;
- font-weight: bold;
+ border-bottom: none;
+ font-weight: bold;
}
h3 { font-size: 132%; }
h3 .editsection { font-size: 75.8%; }
@@ -70,97 +71,97 @@ h6 { font-size: 80%; }
h6 .editsection { font-size: 125%; }
ul {
- line-height: 1.5em;
- margin: 0.3em 0 0 1.5em;
- padding:0;
+ line-height: 1.5em;
+ margin: 0.3em 0 0 1.5em;
+ padding:0;
}
ol {
- line-height: 1.5em;
- margin: 0.3em 0 0 3.2em;
- padding:0;
- list-style-image: none;
+ line-height: 1.5em;
+ margin: 0.3em 0 0 3.2em;
+ padding:0;
+ list-style-image: none;
}
li { margin-bottom: 0.1em; }
dt {
- font-weight: bold;
- margin-bottom: 0.1em;
+ font-weight: bold;
+ margin-bottom: 0.1em;
}
dl{
- margin-top: 0.2em;
- margin-bottom: 0.5em;
+ margin-top: 0.2em;
+ margin-bottom: 0.5em;
}
dd {
- line-height: 1.5em;
- margin-left: 2em;
- margin-bottom: 0.1em;
+ line-height: 1.5em;
+ margin-left: 2em;
+ margin-bottom: 0.1em;
}
fieldset {
- border: 1px solid #2f6fab;
- margin: 1em 0em 1em 0em;
- padding: 0em 1em 1em 1em;
- line-height: 1.5em;
+ border: 1px solid #2f6fab;
+ margin: 1em 0em 1em 0em;
+ padding: 0em 1em 1em 1em;
+ line-height: 1.5em;
}
legend {
- background: White;
- padding: 0.5em;
- font-size: 95%;
+ background: white;
+ padding: 0.5em;
+ font-size: 95%;
}
form {
- border: none;
- margin: 0;
+ border: none;
+ margin: 0;
}
textarea {
- border: 1px solid #2f6fab;
- color: Black;
- background-color: white;
- width: 100%;
- padding: 0.1em;
- overflow: auto;
+ border: 1px solid #2f6fab;
+ color: black;
+ background-color: white;
+ width: 100%;
+ padding: 0.1em;
+ overflow: auto;
}
/* hide this from ie/mac and konq2.2 */
@media All {
- head:first-child+body input {
- visibility: visible;
- border: 1px solid #2f6fab;
- color: Black;
- background-color: white;
- vertical-align: middle;
- padding: 0.2em;
- }
+ head:first-child+body input {
+ visibility: visible;
+ border: 1px solid #2f6fab;
+ color: black;
+ background-color: white;
+ vertical-align: middle;
+ padding: 0.2em;
+ }
}
input.historysubmit {
- padding: 0 0.3em 0.3em 0.3em !important;
- font-size: 94%;
- cursor: pointer;
- height: 1.7em !important;
- margin-left: 1.6em;
+ padding: 0 0.3em 0.3em 0.3em !important;
+ font-size: 94%;
+ cursor: pointer;
+ height: 1.7em !important;
+ margin-left: 1.6em;
}
input[type="radio"],
input[type="checkbox"] { border:none; }
select {
- border: 1px solid #2f6fab;
- color: Black;
- vertical-align: top;
+ border: 1px solid #2f6fab;
+ color: black;
+ vertical-align: top;
}
abbr, acronym, .explain {
- border-bottom: 1px dotted Black;
- color: Black;
- background: none;
- cursor: help;
+ border-bottom: 1px dotted black;
+ color: black;
+ background: none;
+ cursor: help;
}
q {
- font-family: Times, "Times New Roman", serif;
- font-style: italic;
+ font-family: Times, "Times New Roman", serif;
+ font-style: italic;
}
code { background-color: #f9f9f9; }
pre {
- padding: 1em;
- border: 1px dashed #2f6fab;
- color: Black;
- background-color: #f9f9f9;
- line-height: 1.1em;
+ padding: 1em;
+ border: 1px dashed #2f6fab;
+ color: black;
+ background-color: #f9f9f9;
+ line-height: 1.1em;
}
/*
@@ -174,36 +175,36 @@ span.subpages { display: block; }
#bodyContent h3,
#bodyContent h4,
#bodyContent h5 {
- margin-bottom: 0.3em;
+ margin-bottom: 0.3em;
}
#firstHeading { margin-bottom:0.1em; }
/* user notification thing */
.usermessage {
- background-color: #ffce7b;
- border: 1px solid #ffa500;
- color: Black;
- font-weight: bold;
- margin: 0.1em 0 0 0;
- padding: 2px 5px;
- vertical-align: middle;
+ background-color: #ffce7b;
+ border: 1px solid #ffa500;
+ color: black;
+ font-weight: bold;
+ margin: 0.1em 0 0 0;
+ padding: 2px 5px;
+ vertical-align: middle;
}
#siteNotice {
- text-align: center;
- font-size: 95%;
- padding: 0 0.9em 0 0.9em;
+ text-align: center;
+ font-size: 95%;
+ padding: 0 0.9em 0 0.9em;
}
#siteNotice p { margin: 0; padding: 0; }
.error {
- color: red;
- font-size: larger;
+ color: red;
+ font-size: larger;
}
.catlinks {
- border:1px solid #aaaaaa;
- background-color:#f9f9f9;
- padding: 2px 5px;
- margin: 0.1em 0 0 0;
- clear: both;
+ border:1px solid #aaaaaa;
+ background-color:#f9f9f9;
+ padding: 2px 5px;
+ margin: 0.1em 0 0 0;
+ clear: both;
}
.catlinks { margin: 0; padding: 0; }
@@ -211,28 +212,28 @@ span.subpages { display: block; }
/* currently unused, intended to be used by a metadata box
in the bottom-right corner of the content area */
.documentDescription {
- /* The summary text describing the document */
- font-weight: bold;
- display: block;
- margin: 1em 0em;
- line-height: 1.5em;
+ /* The summary text describing the document */
+ font-weight: bold;
+ display: block;
+ margin: 1em 0em;
+ line-height: 1.5em;
}
.documentByLine {
- text-align: right;
- font-size: 90%;
- clear: both;
- font-weight: normal;
- color: #76797c;
+ text-align: right;
+ font-size: 90%;
+ clear: both;
+ font-weight: normal;
+ color: #76797c;
}
/* emulate center */
.center {
- width: 100%;
- text-align: center;
+ width: 100%;
+ text-align: center;
}
*.center * {
- margin-left: auto;
- margin-right: auto;
+ margin-left: auto;
+ margin-right: auto;
}
/* small for tables and similar */
.small, .small * { font-size: 94%; }
@@ -243,88 +244,88 @@ table.small { font-size: 100% }
*/
#toc {
- /*border:1px solid #2f6fab;*/
- border:1px solid #aaaaaa;
- background-color:#f9f9f9;
- padding:5px;
- font-size: 95%;
+ /*border:1px solid #2f6fab;*/
+ border:1px solid #aaaaaa;
+ background-color:#f9f9f9;
+ padding:5px;
+ font-size: 95%;
}
#toc ul { margin-left: 2em; }
#toc .toctoggle { font-size: 94%; }
#toc .editsection {
- margin-top: 0.7em;
- font-size: 94%;
+ margin-top: 0.7em;
+ font-size: 94%;
}
/* images */
div.floatright, table.floatright {
- clear: right;
- float: right;
- margin: 0;
- position: relative;
- border: 0.5em solid White;
- border-width: 0.5em 0 0.8em 1.4em;
+ clear: right;
+ float: right;
+ 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;
- margin: 0.3em 0.5em 0.5em 0;
- position: relative;
- border: 0.5em solid White;
- border-width: 0.5em 1.4em 0.8em 0;
+ float: left;
+ clear: left;
+ margin: 0.3em 0.5em 0.5em 0;
+ position: relative;
+ border: 0.5em solid white;
+ border-width: 0.5em 1.4em 0.8em 0;
}
div.floatleft p { font-style: italic; }
/* thumbnails */
div.thumb {
- margin-bottom: 0.5em;
- border-style: solid; border-color: White;
- width: auto;
-}
-div.thumb div {
- border:1px solid #cccccc;
- padding: 3px !important;
- background-color:#f9f9f9;
- font-size: 94%;
- text-align: center;
- overflow: hidden;
-}
-div.thumb div a img {
- border:1px solid #cccccc;
-}
-div.thumb div div.thumbcaption {
- border: none;
- text-align: left;
- line-height: 1.4em;
- padding: 0.3em 0 0.1em 0;
+ margin-bottom: 0.5em;
+ border-style: solid; border-color: white;
+ width: auto;
+}
+div.thumbinner {
+ border:1px solid #cccccc;
+ padding: 3px !important;
+ background-color:#f9f9f9;
+ font-size: 94%;
+ text-align: center;
+ overflow: hidden;
+}
+html .thumbimage {
+ border:1px solid #cccccc;
+}
+html .thumbcaption {
+ border: none;
+ text-align: left;
+ line-height: 1.4em;
+ padding: 0.3em 0 0.1em 0;
}
div.magnify {
- float: right;
- border: none !important;
- background: none !important;
+ float: right;
+ border: none !important;
+ background: none !important;
}
div.magnify a, div.magnify img {
- display: block;
- border: none !important;
- background: none !important;
+ display: block;
+ border: none !important;
+ background: none !important;
}
div.tright {
- clear: right;
- float: right;
- border-width: 0.5em 0 0.8em 1.4em;
+ clear: right;
+ float: right;
+ border-width: 0.5em 0 0.8em 1.4em;
}
div.tleft {
- float: left;
- clear: left;
- margin-right:0.5em;
- border-width: 0.5em 1.4em 0.8em 0;
+ float: left;
+ clear: left;
+ margin-right:0.5em;
+ border-width: 0.5em 1.4em 0.8em 0;
}
img.thumbborder {
border: 1px solid #dddddd;
}
.hiddenStructure {
- display: none;
+ display: none;
}
/*
@@ -337,26 +338,26 @@ img.thumbborder {
*/
/* table standards */
table.rimage {
- float:right;
- position:relative;
- margin-left:1em;
- margin-bottom:1em;
- text-align:center;
+ float:right;
+ position:relative;
+ margin-left:1em;
+ margin-bottom:1em;
+ text-align:center;
}
.toccolours {
- border:1px solid #aaaaaa;
- background-color:#f9f9f9;
- padding:5px;
- font-size: 95%;
+ border:1px solid #aaaaaa;
+ background-color:#f9f9f9;
+ padding:5px;
+ font-size: 95%;
}
/*
** edit views etc
*/
.special li {
- line-height: 1.4em;
- margin: 0;
- padding: 0;
+ line-height: 1.4em;
+ margin: 0;
+ padding: 0;
}
a.external { color: #3366bb; }
@@ -376,51 +377,18 @@ div.patrollink {
font-size: 75%;
text-align: right;
}
-span.newpage, span.minor {
- font-weight: bold;
-}
span.updatedmarker {
color:black;
background-color:#00FF00;
}
-table.gallery {
- border: 1px solid #cccccc;
- margin: 2px;
- padding: 2px;
- background-color:#ffffff;
-}
-
-table.gallery tr {
- vertical-align:top;
-}
-
-table.gallery td {
- vertical-align:top;
- background-color:#f9f9f9;
- border: solid 2px white;
-}
-
div.gallerybox {
- margin: 2px;
- width: 150px;
+ width: 150px;
}
-div.gallerybox div.thumb {
- text-align: center;
- border: 1px solid #cccccc;
- margin: 2px;
-}
-
-div.gallerytext {
- overflow: hidden;
- font-size: 94%;
- padding: 2px 4px;
-}
-
#xjump-to-nav {
- display: none;
+ display: none;
}
.templatesUsed { margin-top: 1.5em; }
@@ -440,4 +408,4 @@ div.gallerytext {
}
#f-poweredbyico, #f-copyrightico {
display: inline;
-} \ No newline at end of file
+}
diff --git a/skins/common/IE80Fixes.css b/skins/common/IE80Fixes.css
new file mode 100644
index 00000000..b6360f60
--- /dev/null
+++ b/skins/common/IE80Fixes.css
@@ -0,0 +1,15 @@
+/**
+ * Fixes textarea scrolling bug (bug #19334). The bug only occurs when a
+ * percentage width is given, so instead of width: 100%, use min-width: 100%;
+ * max-width: 100%. We also need to give a fixed width for the actual width
+ * property for the hack to work, although the actual value (500px here) ends
+ * up being ignored; min/max-width take precedence.
+ *
+ * More info: http://grantovich.net/posts/2009/06/that-weird-ie8-textarea-bug/
+ */
+#wpTextbox1 {
+ height: 390px;
+ width: 500px;
+ min-width: 100%;
+ max-width: 100%;
+}
diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js
index f85f506c..762d7a78 100644
--- a/skins/common/IEFixes.js
+++ b/skins/common/IEFixes.js
@@ -1,127 +1,128 @@
// IE fixes javascript
-var isMSIE55 = (window.showModalDialog && window.clipboardData && window.createPopup);
+var isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup );
var doneIETransform;
var doneIEAlphaFix;
-if (document.attachEvent)
- document.attachEvent('onreadystatechange', hookit);
+if ( document.attachEvent ) {
+ document.attachEvent( 'onreadystatechange', hookit );
+}
function hookit() {
- if (!doneIETransform && document.getElementById && document.getElementById('bodyContent')) {
- doneIETransform = true;
- relativeforfloats();
- fixalpha();
- }
+ if ( !doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) {
+ doneIETransform = true;
+ relativeforfloats();
+ fixalpha();
+ }
}
// png alpha transparency fixes
-function fixalpha() {
- // bg
- if (isMSIE55 && !doneIEAlphaFix)
- {
- var plogo = document.getElementById('p-logo');
- if (!plogo) return;
-
- var logoa = plogo.getElementsByTagName('a')[0];
- if (!logoa) return;
-
- var bg = logoa.currentStyle.backgroundImage;
- var imageUrl = bg.substring(5, bg.length-2);
-
- doneIEAlphaFix = true;
-
- 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%';
- logospan.style.position = 'absolute';
- logospan.style.width = logoa.currentStyle.width;
- logospan.style.cursor = 'hand';
- // Center image with hack for IE5.5
- if (document.documentElement.dir == "rtl")
- {
- logospan.style.right = '50%';
- logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"');
- }
- else
- {
- logospan.style.left = '50%';
- logospan.style.setExpression('marginLeft', '"-" + (this.offsetWidth / 2) + "px"');
- }
- 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%';
- linkFix.style.width = '100%';
- }
- }
+function fixalpha( logoId ) {
+ // bg
+ if ( isMSIE55 && !doneIEAlphaFix ) {
+ var plogo = document.getElementById( logoId || 'p-logo' );
+ if ( !plogo ) {
+ return;
+ }
+
+ var logoa = plogo.getElementsByTagName('a')[0];
+ if ( !logoa ) {
+ return;
+ }
+
+ var bg = logoa.currentStyle.backgroundImage;
+ var imageUrl = bg.substring( 5, bg.length - 2 );
+
+ doneIEAlphaFix = true;
+
+ 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%';
+ logospan.style.position = 'absolute';
+ logospan.style.width = logoa.currentStyle.width;
+ logospan.style.cursor = 'hand';
+ // Center image with hack for IE5.5
+ if ( document.documentElement.dir == 'rtl' ) {
+ logospan.style.right = '50%';
+ logospan.style.setExpression( 'marginRight', '"-" + (this.offsetWidth / 2) + "px"' );
+ } else {
+ logospan.style.left = '50%';
+ logospan.style.setExpression( 'marginLeft', '"-" + (this.offsetWidth / 2) + "px"' );
+ }
+ 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%';
+ linkFix.style.width = '100%';
+ }
+ }
}
// fix ie6 disappering float bug
function relativeforfloats() {
- var bc = document.getElementById('bodyContent');
- if (bc) {
- var tables = bc.getElementsByTagName('table');
- var divs = bc.getElementsByTagName('div');
- }
- setrelative(tables);
- setrelative(divs);
+ var bc = document.getElementById( 'bodyContent' );
+ if ( bc ) {
+ var tables = bc.getElementsByTagName( 'table' );
+ var divs = bc.getElementsByTagName( 'div' );
+ }
+ setrelative( tables );
+ setrelative( divs );
}
-function setrelative (nodes) {
- var i = 0;
- while (i < nodes.length) {
- if(((nodes[i].style.float && nodes[i].style.float != ('none') ||
- (nodes[i].align && nodes[i].align != ('none'))) &&
- (!nodes[i].style.position || nodes[i].style.position != 'relative')))
- {
- nodes[i].style.position = 'relative';
- }
- i++;
- }
+function setrelative( nodes ) {
+ var i = 0;
+ while ( i < nodes.length ) {
+ if( ( ( nodes[i].style.float && nodes[i].style.float != ( 'none' ) ||
+ ( nodes[i].align && nodes[i].align != ( 'none' ) ) ) &&
+ ( !nodes[i].style.position || nodes[i].style.position != 'relative' ) ) )
+ {
+ nodes[i].style.position = 'relative';
+ }
+ i++;
+ }
}
-
// Expand links for printing
-
-String.prototype.hasClass = function(classWanted)
-{
- var classArr = this.split(/\s/);
- for (var i=0; i<classArr.length; i++)
- if (classArr[i].toLowerCase() == classWanted.toLowerCase()) return true;
- return false;
+String.prototype.hasClass = function( classWanted ) {
+ var classArr = this.split(/\s/);
+ for ( var i = 0; i < classArr.length; i++ ) {
+ if ( classArr[i].toLowerCase() == classWanted.toLowerCase() ) {
+ return true;
+ }
+ }
+ return false;
}
var expandedURLs;
-onbeforeprint = function() {
- expandedURLs = [];
-
- var contentEl = document.getElementById("content");
-
- if (contentEl)
- {
- var allLinks = contentEl.getElementsByTagName("a");
-
- for (var i=0; i < allLinks.length; i++) {
- if (allLinks[i].className.hasClass("external") && !allLinks[i].className.hasClass("free")) {
- var expandedLink = document.createElement("span");
- var expandedText = document.createTextNode(" (" + allLinks[i].href + ")");
- expandedLink.appendChild(expandedText);
- allLinks[i].parentNode.insertBefore(expandedLink, allLinks[i].nextSibling);
- expandedURLs[i] = expandedLink;
- }
- }
- }
+onbeforeprint = function() {
+ expandedURLs = [];
+
+ var contentEl = document.getElementById( 'content' );
+
+ if ( contentEl ) {
+ var allLinks = contentEl.getElementsByTagName( 'a' );
+
+ for ( var i = 0; i < allLinks.length; i++ ) {
+ if ( allLinks[i].className.hasClass( 'external' ) && !allLinks[i].className.hasClass( 'free' ) ) {
+ var expandedLink = document.createElement( 'span' );
+ var expandedText = document.createTextNode( ' (' + allLinks[i].href + ')' );
+ expandedLink.appendChild( expandedText );
+ allLinks[i].parentNode.insertBefore( expandedLink, allLinks[i].nextSibling );
+ expandedURLs[i] = expandedLink;
+ }
+ }
+ }
}
-onafterprint = function()
-{
- for (var i=0; i < expandedURLs.length; i++)
- if (expandedURLs[i])
- expandedURLs[i].removeNode(true);
+onafterprint = function() {
+ for ( var i = 0; i < expandedURLs.length; i++ ) {
+ if ( expandedURLs[i] ) {
+ expandedURLs[i].removeNode( true );
+ }
+ }
}
diff --git a/skins/common/Makefile b/skins/common/Makefile
new file mode 100644
index 00000000..56e60bd4
--- /dev/null
+++ b/skins/common/Makefile
@@ -0,0 +1,2 @@
+jquery.min.js: jquery.js
+ php ../../maintenance/minify.php $< --outfile $@
diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js
index c8d90b80..7f546014 100644
--- a/skins/common/ajaxwatch.js
+++ b/skins/common/ajaxwatch.js
@@ -2,7 +2,7 @@
// * ajax.js:
/*extern sajax_init_object, sajax_do_call */
// * wikibits.js:
- /*extern changeText, akeytt, hookEvent, jsMsg */
+ /*extern changeText, hookEvent, jsMsg */
// These should have been initialized in the generated js
/*extern wgAjaxWatch, wgPageName */
@@ -12,7 +12,9 @@ if(typeof wgAjaxWatch === "undefined" || !wgAjaxWatch) {
watchMsg: "Watch",
unwatchMsg: "Unwatch",
watchingMsg: "Watching...",
- unwatchingMsg: "Unwatching..."
+ unwatchingMsg: "Unwatching...",
+ 'tooltip-ca-watchMsg': "Add this page to your watchlist",
+ 'tooltip-ca-unwatchMsg': "Remove this page from your watchlist"
};
}
@@ -21,17 +23,36 @@ wgAjaxWatch.watching = false; // currently watching page
wgAjaxWatch.inprogress = false; // ajax request in progress
wgAjaxWatch.timeoutID = null; // see wgAjaxWatch.ajaxCall
wgAjaxWatch.watchLinks = []; // "watch"/"unwatch" links
+wgAjaxWatch.iconMode = false; // new icon driven functionality
+wgAjaxWatch.imgBasePath = ""; // base img path derived from icons on load
-wgAjaxWatch.setLinkText = function(newText) {
- for (i = 0; i < wgAjaxWatch.watchLinks.length; i++) {
- changeText(wgAjaxWatch.watchLinks[i], newText);
+wgAjaxWatch.setLinkText = function( newText ) {
+ if( wgAjaxWatch.iconMode ) {
+ for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
+ wgAjaxWatch.watchLinks[i].firstChild.alt = newText;
+ if ( newText == wgAjaxWatch.watchingMsg || newText == wgAjaxWatch.unwatchingMsg ) {
+ wgAjaxWatch.watchLinks[i].className += ' loading';
+ } else if ( newText == wgAjaxWatch.watchMsg || newText == wgAjaxWatch.unwatchMsg ) {
+ wgAjaxWatch.watchLinks[i].className =
+ wgAjaxWatch.watchLinks[i].className.replace( /loading/i, '' );
+ // update the title text on the link
+ var keyCommand = wgAjaxWatch.watchLinks[i].title.match( /\[.*?\]$/ ) ?
+ wgAjaxWatch.watchLinks[i].title.match( /\[.*?\]$/ )[0] : "";
+ wgAjaxWatch.watchLinks[i].title = ( newText == wgAjaxWatch.watchMsg ?
+ wgAjaxWatch['tooltip-ca-watchMsg'] : wgAjaxWatch['tooltip-ca-unwatchMsg'] )
+ + " " + keyCommand;
+ }
+ }
+ } else {
+ for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
+ changeText( wgAjaxWatch.watchLinks[i], newText );
+ }
}
};
-wgAjaxWatch.setLinkID = function(newId) {
+wgAjaxWatch.setLinkID = function( newId ) {
// We can only set the first one
- wgAjaxWatch.watchLinks[0].setAttribute( 'id', newId );
- akeytt(newId); // update tooltips for Monobook
+ wgAjaxWatch.watchLinks[0].parentNode.setAttribute( 'id', newId );
};
wgAjaxWatch.setHref = function( string ) {
@@ -112,27 +133,33 @@ wgAjaxWatch.processResult = function(request) {
wgAjaxWatch.onLoad = function() {
// This document structure hardcoding sucks. We should make a class and
// toss all this out the window.
+
var el1 = document.getElementById("ca-unwatch");
var el2 = null;
- if (!el1) {
+ if ( !el1 ) {
el1 = document.getElementById("mw-unwatch-link1");
el2 = document.getElementById("mw-unwatch-link2");
}
- if(el1) {
+ if( el1 ) {
wgAjaxWatch.watching = true;
} else {
wgAjaxWatch.watching = false;
el1 = document.getElementById("ca-watch");
- if (!el1) {
+ if ( !el1 ) {
el1 = document.getElementById("mw-watch-link1");
el2 = document.getElementById("mw-watch-link2");
}
- if(!el1) {
+ if( !el1 ) {
wgAjaxWatch.supported = false;
return;
}
}
-
+
+ // Detect if the watch/unwatch feature is in icon mode
+ if ( el1.className.match( /icon/i ) ) {
+ wgAjaxWatch.iconMode = true;
+ }
+
// The id can be either for the parent (Monobook-based) or the element
// itself (non-Monobook)
wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a"
diff --git a/skins/common/allmessages.js b/skins/common/allmessages.js
deleted file mode 100644
index 9f07a481..00000000
--- a/skins/common/allmessages.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var allmessages_nodelist = false;
-var allmessages_modified = false;
-var allmessages_timeout = false;
-var allmessages_running = false;
-
-function allmessagesmodified() {
- allmessages_modified = !allmessages_modified;
- allmessagesfilter();
-}
-
-function allmessagesfilter() {
- if ( allmessages_timeout )
- window.clearTimeout( allmessages_timeout );
-
- if ( !allmessages_running )
- allmessages_timeout = window.setTimeout( 'allmessagesfilter_do();', 500 );
-}
-
-function allmessagesfilter_do() {
- if ( !allmessages_nodelist )
- return;
-
- var text = document.getElementById('allmessagesinput').value.toLowerCase();
- var nodef = allmessages_modified;
-
- allmessages_running = true;
-
- for ( var name in allmessages_nodelist ) {
- var nodes = allmessages_nodelist[name];
- var display = ( name.toLowerCase().indexOf( text ) == -1 ? 'none' : '' );
-
- for ( var i = 0; i < nodes.length; i++)
- nodes[i].style.display =
- ( nodes[i].className == "def" && nodef
- ? 'none' : display );
- }
-
- if ( text != document.getElementById('allmessagesinput').value.toLowerCase() ||
- nodef != allmessages_modified )
- allmessagesfilter_do(); // repeat
-
- allmessages_running = false;
-}
-
-function allmessagesfilter_init() {
- if ( allmessages_nodelist )
- return;
-
- var nodelist = new Array();
- var templist = new Array();
-
- var table = document.getElementById('allmessagestable');
- if ( !table ) return;
-
- var rows = document.getElementsByTagName('tr');
- for ( var i = 0; i < rows.length; i++ ) {
- var id = rows[i].getAttribute('id')
- if ( id && id.substring(0,16) != 'sp-allmessages-r' ) continue;
- templist[ id ] = rows[i];
- }
-
- var spans = table.getElementsByTagName('span');
- for ( var i = 0; i < spans.length; i++ ) {
- var id = spans[i].getAttribute('id')
- if ( id && id.substring(0,17) != 'sp-allmessages-i-' ) continue;
- if ( !spans[i].firstChild || spans[i].firstChild.nodeType != 3 ) continue;
-
- var nodes = new Array();
- var row1 = templist[ id.replace('i', 'r1') ];
- var row2 = templist[ id.replace('i', 'r2') ];
-
- if ( row1 ) nodes[nodes.length] = row1;
- if ( row2 ) nodes[nodes.length] = row2;
- nodelist[ spans[i].firstChild.nodeValue ] = nodes;
- }
-
- var k = document.getElementById('allmessagesfilter');
- if (k) { k.style.display = ''; }
-
- allmessages_nodelist = nodelist;
-}
-
-hookEvent( "load", allmessagesfilter_init );
diff --git a/skins/common/block.js b/skins/common/block.js
index 90211efa..ad04f810 100644
--- a/skins/common/block.js
+++ b/skins/common/block.js
@@ -1,19 +1,19 @@
-addOnloadHook(considerChangingExpiryFocus);
+addOnloadHook( considerChangingExpiryFocus );
function considerChangingExpiryFocus() {
- if (!document.getElementById) {
+ if ( !document.getElementById ) {
return;
}
- var drop = document.getElementById('wpBlockExpiry');
- if (!drop) {
+ var drop = document.getElementById( 'wpBlockExpiry' );
+ if ( !drop ) {
return;
}
- var field = document.getElementById('wpBlockOther');
- if (!field) {
+ var field = document.getElementById( 'wpBlockOther' );
+ if ( !field ) {
return;
}
var opt = drop.value;
- if (opt == 'other') {
+ if ( opt == 'other' ) {
field.style.display = '';
} else {
field.style.display = 'none';
@@ -21,39 +21,36 @@ function considerChangingExpiryFocus() {
}
function updateBlockOptions() {
- if (!document.getElementById)
+ if ( !document.getElementById ) {
return;
+ }
- var target = document.getElementById('mw-bi-target');
- if (!target)
+ 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 isIpRange = isIp && addy.match(/\/\d+$/);
- var anonymousRow = document.getElementById('wpAnonOnlyRow');
+ var anonymousRow = document.getElementById( 'wpAnonOnlyRow' );
if( anonymousRow ) {
- anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
+ anonymousRow.style.display = ( !isIp && !isEmpty ) ? 'none' : '';
}
- var autoblockRow = document.getElementById('wpEnableAutoblockRow');
+ var autoblockRow = document.getElementById( 'wpEnableAutoblockRow' );
if( autoblockRow ) {
autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';
}
-
- var emailblockRow = document.getElementById('wpEnableEmailBan');
- if( emailblockRow ) {
- emailblockRow.style.display = isIp && !isEmpty ? 'none' : '';
- }
- var hideuserRow = document.getElementById('wpEnableHideUser');
+ var hideuserRow = document.getElementById( 'wpEnableHideUser' );
if( hideuserRow ) {
hideuserRow.style.display = isIp && !isEmpty ? 'none' : '';
}
- var watchuserRow = document.getElementById('wpEnableWatchUser');
+ var watchuserRow = document.getElementById( 'wpEnableWatchUser' );
if( watchuserRow ) {
watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : '';
}
diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css
index ecf146de..0932fcea 100644
--- a/skins/common/commonPrint.css
+++ b/skins/common/commonPrint.css
@@ -48,17 +48,17 @@ div.thumb {
width: auto;
overflow: hidden;
}
-div.thumb div {
+div.thumbinner {
border:1px solid #cccccc;
padding: 3px !important;
background-color:#f9f9f9;
font-size: 94%;
text-align: center;
}
-div.thumb div a img {
+html .thumbimage {
border:1px solid #cccccc;
}
-div.thumb div div.thumbcaption {
+html .thumbcaption {
border: none;
padding: 0.3em 0 0.1em 0;
}
@@ -108,7 +108,8 @@ div#f-copyrightico,
li#viewcount,
li#about,
li#disclaimer,
-li#privacy {
+li#privacy,
+#mw-hidden-catlinks {
/* Hides all the elements irrelevant for printing */
display: none;
}
@@ -211,33 +212,14 @@ span.texhtml { font-family: serif; }
#siteNotice { display: none; }
-table.gallery {
- border: 1px solid #cccccc;
- margin: 2px;
- padding: 2px;
- background-color:#ffffff;
-}
-
-table.gallery tr {
- vertical-align:top;
-}
-
div.gallerybox {
- border: 1px solid #cccccc;
- margin: 2px;
- background-color:#f9f9f9;
- width: 150px;
+ border: 1px solid #cccccc;
+ background-color:#f9f9f9;
+ width: 150px;
}
-div.gallerybox div.thumb {
- text-align: center;
- border: 1px solid #cccccc;
- margin: 2px;
-}
-
div.gallerytext {
- font-size: 94%;
- padding: 2px 4px;
+ overflow: visible;
}
/*
diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css
index 4f075ae3..2e8bb980 100644
--- a/skins/common/common_rtl.css
+++ b/skins/common/common_rtl.css
@@ -1,6 +1,7 @@
/*
* 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 */
@@ -30,7 +31,8 @@ div.tleft, div.floatleft {
}
/* 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-filedelete-editreasons, p.mw-delete-editreasons,
+p.mw-revdel-editreasons {
float: left;
}
table.filehistory th {
@@ -46,6 +48,9 @@ table.filehistory th {
html > body div#article ul {
display: table;
}
+html > body div#bodyContent ul#filetoc {
+ display: block;
+}
/* feed links */
a.feedlink {
diff --git a/skins/common/edit.js b/skins/common/edit.js
index 945059e0..423205f8 100644
--- a/skins/common/edit.js
+++ b/skins/common/edit.js
@@ -1,137 +1,163 @@
+var currentFocused;
+
// 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, imageId) {
+function addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ) {
// Don't generate buttons for browsers which don't fully
// support it.
- mwEditButtons[mwEditButtons.length] =
- {"imageId": imageId,
- "imageFile": imageFile,
- "speedTip": speedTip,
- "tagOpen": tagOpen,
- "tagClose": tagClose,
- "sampleText": sampleText};
+ mwEditButtons.push({
+ 'imageId': imageId,
+ 'imageFile': imageFile,
+ 'speedTip': speedTip,
+ 'tagOpen': tagOpen,
+ 'tagClose': tagClose,
+ 'sampleText': sampleText
+ });
}
// this function generates the actual toolbar buttons with localized text
-// we use it to avoid creating the toolbar where javascript is not enabled
-function mwInsertEditButton(parent, item) {
- var image = document.createElement("img");
+// we use it to avoid creating the toolbar where JavaScript is not enabled
+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.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.style.cursor = 'pointer';
image.onclick = function() {
- insertTags(item.tagOpen, item.tagClose, item.sampleText);
+ insertTags( item.tagOpen, item.tagClose, item.sampleText );
+ // click tracking
+ if ( ( typeof $j != 'undefined' ) && ( typeof $j.trackAction != 'undefined' ) ) {
+ $j.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") );
+ }
return false;
};
- parent.appendChild(image);
+ parent.appendChild( image );
return true;
}
function mwSetupToolbar() {
- var toolbar = document.getElementById('toolbar');
- if (!toolbar) { return false; }
-
- var textbox = document.getElementById('wpTextbox1');
- if (!textbox) { return false; }
+ var toolbar = document.getElementById( 'toolbar' );
+ if ( !toolbar ) {
+ return false;
+ }
// Don't generate buttons for browsers which don't fully
// support it.
- if (!(document.selection && document.selection.createRange)
- && textbox.selectionStart === null) {
+ // 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;
}
-
- for (var i = 0; i < mwEditButtons.length; i++) {
- mwInsertEditButton(toolbar, mwEditButtons[i]);
+ // 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]);
+ 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
-function insertTags(tagOpen, tagClose, sampleText) {
+function insertTags( tagOpen, tagClose, sampleText ) {
+ if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' &&
+ ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) {
+ $j( '#wpTextbox1' ).textSelection(
+ 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose }
+ );
+ return;
+ }
var txtarea;
- if (document.editform) {
- txtarea = document.editform.wpTextbox1;
+ if ( document.editform ) {
+ txtarea = currentFocused;
} else {
// some alternate form? take the first one we can find
- var areas = document.getElementsByTagName('textarea');
+ 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)
+ 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)
+ } else if ( document.body ) {
var winScroll = document.body.scrollTop;
- //get current selection
+ }
+ // get current selection
txtarea.focus();
var range = document.selection.createRange();
selText = range.text;
- //insert tags
+ // insert tags
checkSelectedText();
range.text = tagOpen + selText + tagClose;
- //mark sample text as selected
- if (isSample && range.moveStart) {
- if (window.opera)
+ // 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.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)
+ 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
+ } else if ( txtarea.selectionStart || txtarea.selectionStart == '0' ) { // Mozilla
+ // save textarea scroll position
var textScroll = txtarea.scrollTop;
- //get current selection
+ // get current selection
txtarea.focus();
var startPos = txtarea.selectionStart;
var endPos = txtarea.selectionEnd;
- selText = txtarea.value.substring(startPos, endPos);
- //insert tags
+ 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) {
+ // 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
+ // restore textarea scroll position
txtarea.scrollTop = textScroll;
- }
+ }
- function checkSelectedText(){
- if (!selText) {
+ function checkSelectedText() {
+ if ( !selText ) {
selText = sampleText;
isSample = true;
- } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
+ } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char
selText = selText.substring(0, selText.length - 1);
- tagClose += ' '
- }
+ tagClose += ' ';
+ }
}
}
@@ -144,13 +170,62 @@ function scrollEditBox() {
var editBox = document.getElementById( 'wpTextbox1' );
var scrollTop = document.getElementById( 'wpScrolltop' );
var editForm = document.getElementById( 'editform' );
- if( editBox && scrollTop ) {
- if( scrollTop.value )
+ if( editForm && editBox && scrollTop ) {
+ if( scrollTop.value ) {
editBox.scrollTop = scrollTop.value;
+ }
addHandler( editForm, 'submit', function() {
- document.getElementById( 'wpScrolltop' ).value = document.getElementById( 'wpTextbox1' ).scrollTop;
+ 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 $j != 'undefined' ) {
+ var iframe = $j( '.wikiEditor-ui-text iframe' );
+ if ( iframe.length > 0 ) {
+ $j( 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/history.js b/skins/common/history.js
index 6a84b997..02651225 100644
--- a/skins/common/history.js
+++ b/skins/common/history.js
@@ -67,20 +67,19 @@ function diffcheck() {
} else {
inputs[1].style.visibility = 'visible';
}
- lis[i].className = lis[i].classNameOriginal;
+ if ( typeof lis[i].classNameOriginal != 'undefined' ) {
+ lis[i].className = lis[i].classNameOriginal;
+ }
}
}
}
return true;
}
-// page history stuff
-// attach event handlers to the input elements on history page
+// Attach event handlers to the input elements on history page
function histrowinit() {
var hf = document.getElementById('pagehistory');
- if (!hf) {
- return;
- }
+ if (!hf) return;
var lis = hf.getElementsByTagName('li');
for (var i = 0; i < lis.length; i++) {
var inputs = historyRadios(lis[i]);
diff --git a/skins/common/htmlform.js b/skins/common/htmlform.js
new file mode 100644
index 00000000..2045ab48
--- /dev/null
+++ b/skins/common/htmlform.js
@@ -0,0 +1,40 @@
+// 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 } );
+ }
+} );
+
+var 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/Arr_.png b/skins/common/images/Arr_.png
index 83fafc74..8d8d5d9c 100644
--- a/skins/common/images/Arr_.png
+++ b/skins/common/images/Arr_.png
Binary files differ
diff --git a/skins/common/images/Arr_r.xcf b/skins/common/images/Arr_r.xcf
deleted file mode 100644
index 83b7b2a8..00000000
--- a/skins/common/images/Arr_r.xcf
+++ /dev/null
Binary files differ
diff --git a/skins/common/images/Arr_u.png b/skins/common/images/Arr_u.png
index b8e3b6c6..75909865 100644
--- a/skins/common/images/Arr_u.png
+++ b/skins/common/images/Arr_u.png
Binary files differ
diff --git a/skins/common/images/Zoom_sans.gif b/skins/common/images/Zoom_sans.gif
index 6ba0adca..56a49de8 100644
--- a/skins/common/images/Zoom_sans.gif
+++ b/skins/common/images/Zoom_sans.gif
Binary files differ
diff --git a/skins/common/images/add.png b/skins/common/images/add.png
new file mode 100644
index 00000000..5b051f64
--- /dev/null
+++ b/skins/common/images/add.png
Binary files differ
diff --git a/skins/common/images/ajax-loader.gif b/skins/common/images/ajax-loader.gif
new file mode 100644
index 00000000..3288d103
--- /dev/null
+++ b/skins/common/images/ajax-loader.gif
Binary files differ
diff --git a/skins/common/images/arrow_first.svg b/skins/common/images/arrow_first.svg
deleted file mode 100644
index c1d8e364..00000000
--- a/skins/common/images/arrow_first.svg
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="512.85712"
- height="600"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- version="1.0"
- sodipodi:docbase="C:\htdocs\w\skins\common\images"
- sodipodi:docname="big_arrow_first.svg"
- inkscape:export-filename="C:\htdocs\w\skins\common\images\big_arrow_left.png"
- inkscape:export-xdpi="5.0520902"
- inkscape:export-ydpi="5.0520902">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="375"
- inkscape:cy="520"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- width="600.24px"
- height="600.88px"
- inkscape:window-width="853"
- inkscape:window-height="573"
- inkscape:window-x="66"
- inkscape:window-y="87" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-239.3783,-208.0743)">
- <path
- sodipodi:type="star"
- style="fill:#00a;fill-opacity:1;fill-rule:evenodd;stroke:#00a;stroke-width:10.35552788;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="path1874"
- sodipodi:sides="3"
- sodipodi:cx="94.285713"
- sodipodi:cy="343.79074"
- sodipodi:r1="75.484825"
- sodipodi:r2="37.742413"
- sodipodi:arg1="1.056345"
- sodipodi:arg2="2.1035426"
- inkscape:flatsided="true"
- inkscape:rounded="0"
- inkscape:randomized="0"
- d="M 131.42857,409.50502 L 18.804046,343.10026 L 132.62452,278.76694 L 131.42857,409.50502 z "
- transform="matrix(3.596688,0,0,4.278606,254.9147,-964.348)" />
- <rect
- style="fill:#00a;fill-opacity:1;stroke:#00a;stroke-width:39.31948471;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="rect3737"
- width="20.680517"
- height="560.68054"
- x="259.03799"
- y="227.73401" />
- </g>
-</svg>
diff --git a/skins/common/images/arrow_left.svg b/skins/common/images/arrow_left.svg
deleted file mode 100644
index bd4bbc74..00000000
--- a/skins/common/images/arrow_left.svg
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="450"
- height="600"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.44"
- version="1.0"
- sodipodi:docbase="C:\htdocs\w\skins\common\images"
- sodipodi:docname="big_arrow_left.svg"
- inkscape:export-filename="C:\htdocs\w\skins\common\images\big_arrow_left.png"
- inkscape:export-xdpi="5.0520902"
- inkscape:export-ydpi="5.0520902">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="375"
- inkscape:cy="520"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- width="600.24px"
- height="600.88px"
- inkscape:window-width="853"
- inkscape:window-height="573"
- inkscape:window-x="66"
- inkscape:window-y="87" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-302.2354,-208.0743)">
- <path
- sodipodi:type="star"
- style="fill:#00a;fill-opacity:1;fill-rule:evenodd;stroke:#00a;stroke-width:10.35552788;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="path1874"
- sodipodi:sides="3"
- sodipodi:cx="94.285713"
- sodipodi:cy="343.79074"
- sodipodi:r1="75.484825"
- sodipodi:r2="37.742413"
- sodipodi:arg1="1.056345"
- sodipodi:arg2="2.1035426"
- inkscape:flatsided="true"
- inkscape:rounded="0"
- inkscape:randomized="0"
- d="M 131.42857,409.50502 L 18.804046,343.10026 L 132.62452,278.76694 L 131.42857,409.50502 z "
- transform="matrix(3.596688,0,0,4.278606,254.9147,-964.348)" />
- </g>
-</svg>
diff --git a/skins/common/images/be-tarask/button_bold.png b/skins/common/images/be-tarask/button_bold.png
index f662c76c..d02aeeeb 100644
--- a/skins/common/images/be-tarask/button_bold.png
+++ b/skins/common/images/be-tarask/button_bold.png
Binary files differ
diff --git a/skins/common/images/be-tarask/button_italic.png b/skins/common/images/be-tarask/button_italic.png
index 88e1b3bb..d93e9f87 100644
--- a/skins/common/images/be-tarask/button_italic.png
+++ b/skins/common/images/be-tarask/button_italic.png
Binary files differ
diff --git a/skins/common/images/be-tarask/button_link.png b/skins/common/images/be-tarask/button_link.png
index f68d5d56..07bc6a19 100644
--- a/skins/common/images/be-tarask/button_link.png
+++ b/skins/common/images/be-tarask/button_link.png
Binary files differ
diff --git a/skins/common/images/button_bold.png b/skins/common/images/button_bold.png
index 5e52deed..2827dba0 100644
--- a/skins/common/images/button_bold.png
+++ b/skins/common/images/button_bold.png
Binary files differ
diff --git a/skins/common/images/button_extlink.png b/skins/common/images/button_extlink.png
index 12ec5f2e..e551e47e 100644
--- a/skins/common/images/button_extlink.png
+++ b/skins/common/images/button_extlink.png
Binary files differ
diff --git a/skins/common/images/button_headline.png b/skins/common/images/button_headline.png
index aa0ca540..9867c365 100644
--- a/skins/common/images/button_headline.png
+++ b/skins/common/images/button_headline.png
Binary files differ
diff --git a/skins/common/images/button_hr.png b/skins/common/images/button_hr.png
index 19cfc480..7f21402a 100644
--- a/skins/common/images/button_hr.png
+++ b/skins/common/images/button_hr.png
Binary files differ
diff --git a/skins/common/images/button_image.png b/skins/common/images/button_image.png
index 6c3c3308..abd47dde 100644
--- a/skins/common/images/button_image.png
+++ b/skins/common/images/button_image.png
Binary files differ
diff --git a/skins/common/images/button_italic.png b/skins/common/images/button_italic.png
index 96b1fb9f..f248fa93 100644
--- a/skins/common/images/button_italic.png
+++ b/skins/common/images/button_italic.png
Binary files differ
diff --git a/skins/common/images/button_link.png b/skins/common/images/button_link.png
index e9507b97..cc72b523 100644
--- a/skins/common/images/button_link.png
+++ b/skins/common/images/button_link.png
Binary files differ
diff --git a/skins/common/images/button_math.png b/skins/common/images/button_math.png
index e91fb613..507e4b51 100644
--- a/skins/common/images/button_math.png
+++ b/skins/common/images/button_math.png
Binary files differ
diff --git a/skins/common/images/button_media.png b/skins/common/images/button_media.png
index 02070790..56b1b239 100644
--- a/skins/common/images/button_media.png
+++ b/skins/common/images/button_media.png
Binary files differ
diff --git a/skins/common/images/button_nowiki.png b/skins/common/images/button_nowiki.png
index 7b2d5392..321a2cb4 100644
--- a/skins/common/images/button_nowiki.png
+++ b/skins/common/images/button_nowiki.png
Binary files differ
diff --git a/skins/common/images/button_sig.png b/skins/common/images/button_sig.png
index ef3a46d2..39de3b67 100644
--- a/skins/common/images/button_sig.png
+++ b/skins/common/images/button_sig.png
Binary files differ
diff --git a/skins/common/images/button_template.png b/skins/common/images/button_template.png
index 8e9cc267..ebbca3cf 100644
--- a/skins/common/images/button_template.png
+++ b/skins/common/images/button_template.png
Binary files differ
diff --git a/skins/common/images/cyrl/button_italic.png b/skins/common/images/cyrl/button_italic.png
index f5e588ec..f79170fd 100644
--- a/skins/common/images/cyrl/button_italic.png
+++ b/skins/common/images/cyrl/button_italic.png
Binary files differ
diff --git a/skins/common/images/cyrl/button_link.png b/skins/common/images/cyrl/button_link.png
index a690cb35..aa28e85a 100644
--- a/skins/common/images/cyrl/button_link.png
+++ b/skins/common/images/cyrl/button_link.png
Binary files differ
diff --git a/skins/common/images/de/button_bold.png b/skins/common/images/de/button_bold.png
index 8386828d..32a22800 100644
--- a/skins/common/images/de/button_bold.png
+++ b/skins/common/images/de/button_bold.png
Binary files differ
diff --git a/skins/common/images/de/button_italic.png b/skins/common/images/de/button_italic.png
index ec719998..875eb2a1 100644
--- a/skins/common/images/de/button_italic.png
+++ b/skins/common/images/de/button_italic.png
Binary files differ
diff --git a/skins/common/images/fa/button_bold.png b/skins/common/images/fa/button_bold.png
index 2f269a8d..49680152 100644
--- a/skins/common/images/fa/button_bold.png
+++ b/skins/common/images/fa/button_bold.png
Binary files differ
diff --git a/skins/common/images/fa/button_headline.png b/skins/common/images/fa/button_headline.png
index ef9d109f..9d62767e 100644
--- a/skins/common/images/fa/button_headline.png
+++ b/skins/common/images/fa/button_headline.png
Binary files differ
diff --git a/skins/common/images/fa/button_italic.png b/skins/common/images/fa/button_italic.png
index 84985848..fc9faf3d 100644
--- a/skins/common/images/fa/button_italic.png
+++ b/skins/common/images/fa/button_italic.png
Binary files differ
diff --git a/skins/common/images/fa/button_link.png b/skins/common/images/fa/button_link.png
index 4ad5ef56..de56a5c3 100644
--- a/skins/common/images/fa/button_link.png
+++ b/skins/common/images/fa/button_link.png
Binary files differ
diff --git a/skins/common/images/fileicon.xcf b/skins/common/images/fileicon.xcf
deleted file mode 100644
index 85a0a610..00000000
--- a/skins/common/images/fileicon.xcf
+++ /dev/null
Binary files differ
diff --git a/skins/common/images/gnu-fdl.png b/skins/common/images/gnu-fdl.png
index 1371aba8..10915329 100644
--- a/skins/common/images/gnu-fdl.png
+++ b/skins/common/images/gnu-fdl.png
Binary files differ
diff --git a/skins/common/images/gnu-fdl.xcf b/skins/common/images/gnu-fdl.xcf
deleted file mode 100644
index 364440dd..00000000
--- a/skins/common/images/gnu-fdl.xcf
+++ /dev/null
Binary files differ
diff --git a/skins/common/images/icons/fileicon-c.png b/skins/common/images/icons/fileicon-c.png
index 6da6916e..f7984fa0 100644
--- a/skins/common/images/icons/fileicon-c.png
+++ b/skins/common/images/icons/fileicon-c.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-cpp.png b/skins/common/images/icons/fileicon-cpp.png
index ba54e77f..0a9b4cbc 100644
--- a/skins/common/images/icons/fileicon-cpp.png
+++ b/skins/common/images/icons/fileicon-cpp.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-deb.png b/skins/common/images/icons/fileicon-deb.png
index ac1e2cf9..605bea17 100644
--- a/skins/common/images/icons/fileicon-deb.png
+++ b/skins/common/images/icons/fileicon-deb.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-djvu.png b/skins/common/images/icons/fileicon-djvu.png
index 2e1e2c9b..3eaca1f8 100644
--- a/skins/common/images/icons/fileicon-djvu.png
+++ b/skins/common/images/icons/fileicon-djvu.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-dvi.png b/skins/common/images/icons/fileicon-dvi.png
index 6c7aa1a1..790ec41b 100644
--- a/skins/common/images/icons/fileicon-dvi.png
+++ b/skins/common/images/icons/fileicon-dvi.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-exe.png b/skins/common/images/icons/fileicon-exe.png
index 6ccf1821..f310ad0d 100644
--- a/skins/common/images/icons/fileicon-exe.png
+++ b/skins/common/images/icons/fileicon-exe.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-h.png b/skins/common/images/icons/fileicon-h.png
index d091afff..cf158528 100644
--- a/skins/common/images/icons/fileicon-h.png
+++ b/skins/common/images/icons/fileicon-h.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-html.png b/skins/common/images/icons/fileicon-html.png
index 7c479525..1c3a1588 100644
--- a/skins/common/images/icons/fileicon-html.png
+++ b/skins/common/images/icons/fileicon-html.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-iso.png b/skins/common/images/icons/fileicon-iso.png
index b4192e9e..74b06615 100644
--- a/skins/common/images/icons/fileicon-iso.png
+++ b/skins/common/images/icons/fileicon-iso.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-java.png b/skins/common/images/icons/fileicon-java.png
index 757c6aec..730ab232 100644
--- a/skins/common/images/icons/fileicon-java.png
+++ b/skins/common/images/icons/fileicon-java.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-mid.png b/skins/common/images/icons/fileicon-mid.png
index aa826070..5254418e 100644
--- a/skins/common/images/icons/fileicon-mid.png
+++ b/skins/common/images/icons/fileicon-mid.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-mov.png b/skins/common/images/icons/fileicon-mov.png
index 2c0da0d8..37e479aa 100644
--- a/skins/common/images/icons/fileicon-mov.png
+++ b/skins/common/images/icons/fileicon-mov.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-o.png b/skins/common/images/icons/fileicon-o.png
index bf051cb8..24ac2cc5 100644
--- a/skins/common/images/icons/fileicon-o.png
+++ b/skins/common/images/icons/fileicon-o.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-ogg.png b/skins/common/images/icons/fileicon-ogg.png
index b8ba7714..c50d1ee8 100644
--- a/skins/common/images/icons/fileicon-ogg.png
+++ b/skins/common/images/icons/fileicon-ogg.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-pdf.png b/skins/common/images/icons/fileicon-pdf.png
index ee39b6c3..c195c761 100644
--- a/skins/common/images/icons/fileicon-pdf.png
+++ b/skins/common/images/icons/fileicon-pdf.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-ps.png b/skins/common/images/icons/fileicon-ps.png
index f1f504d7..342a84ee 100644
--- a/skins/common/images/icons/fileicon-ps.png
+++ b/skins/common/images/icons/fileicon-ps.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-rm.png b/skins/common/images/icons/fileicon-rm.png
index 5ba04e5a..534dbeb2 100644
--- a/skins/common/images/icons/fileicon-rm.png
+++ b/skins/common/images/icons/fileicon-rm.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-rpm.png b/skins/common/images/icons/fileicon-rpm.png
index 0f1c3b87..aab3ec39 100644
--- a/skins/common/images/icons/fileicon-rpm.png
+++ b/skins/common/images/icons/fileicon-rpm.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-svg.png b/skins/common/images/icons/fileicon-svg.png
index 8dc6d30f..16a666f3 100644
--- a/skins/common/images/icons/fileicon-svg.png
+++ b/skins/common/images/icons/fileicon-svg.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-tar.png b/skins/common/images/icons/fileicon-tar.png
index a4b15d7f..7266b5b5 100644
--- a/skins/common/images/icons/fileicon-tar.png
+++ b/skins/common/images/icons/fileicon-tar.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-tex.png b/skins/common/images/icons/fileicon-tex.png
index ee8c0226..55187918 100644
--- a/skins/common/images/icons/fileicon-tex.png
+++ b/skins/common/images/icons/fileicon-tex.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-ttf.png b/skins/common/images/icons/fileicon-ttf.png
index 1b53066e..13bd7ced 100644
--- a/skins/common/images/icons/fileicon-ttf.png
+++ b/skins/common/images/icons/fileicon-ttf.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-txt.png b/skins/common/images/icons/fileicon-txt.png
index 76e98909..bec58b4e 100644
--- a/skins/common/images/icons/fileicon-txt.png
+++ b/skins/common/images/icons/fileicon-txt.png
Binary files differ
diff --git a/skins/common/images/ksh/button_S_italic.png b/skins/common/images/ksh/button_S_italic.png
index 0761a1e1..00000a3c 100644
--- a/skins/common/images/ksh/button_S_italic.png
+++ b/skins/common/images/ksh/button_S_italic.png
Binary files differ
diff --git a/skins/common/images/link_icon.gif b/skins/common/images/link_icon.gif
index 815ccb1b..168c1a2f 100644
--- a/skins/common/images/link_icon.gif
+++ b/skins/common/images/link_icon.gif
Binary files differ
diff --git a/skins/common/images/magnify-clip.png b/skins/common/images/magnify-clip.png
index 50abcb68..00a9cee1 100644
--- a/skins/common/images/magnify-clip.png
+++ b/skins/common/images/magnify-clip.png
Binary files differ
diff --git a/skins/common/images/mediawiki-small.xcf b/skins/common/images/mediawiki-small.xcf
deleted file mode 100644
index 75355171..00000000
--- a/skins/common/images/mediawiki-small.xcf
+++ /dev/null
Binary files differ
diff --git a/skins/common/images/mediawiki.png b/skins/common/images/mediawiki.png
index 69fce988..0f35886a 100644
--- a/skins/common/images/mediawiki.png
+++ b/skins/common/images/mediawiki.png
Binary files differ
diff --git a/skins/common/images/poweredby_mediawiki_88x31.png b/skins/common/images/poweredby_mediawiki_88x31.png
index ce1765d1..3714414f 100644
--- a/skins/common/images/poweredby_mediawiki_88x31.png
+++ b/skins/common/images/poweredby_mediawiki_88x31.png
Binary files differ
diff --git a/skins/common/images/public-domain.png b/skins/common/images/public-domain.png
index e5fb33ce..f51f5602 100644
--- a/skins/common/images/public-domain.png
+++ b/skins/common/images/public-domain.png
Binary files differ
diff --git a/skins/common/images/redirectltr.png b/skins/common/images/redirectltr.png
index 9110ca13..bcf5742c 100644
--- a/skins/common/images/redirectltr.png
+++ b/skins/common/images/redirectltr.png
Binary files differ
diff --git a/skins/common/images/redirectrtl.png b/skins/common/images/redirectrtl.png
index 60fd59d3..8d99841a 100644
--- a/skins/common/images/redirectrtl.png
+++ b/skins/common/images/redirectrtl.png
Binary files differ
diff --git a/skins/common/images/remove.png b/skins/common/images/remove.png
new file mode 100644
index 00000000..0cbf7d73
--- /dev/null
+++ b/skins/common/images/remove.png
Binary files differ
diff --git a/skins/common/images/sort_down.gif b/skins/common/images/sort_down.gif
index 5ff08160..d97e8285 100644
--- a/skins/common/images/sort_down.gif
+++ b/skins/common/images/sort_down.gif
Binary files differ
diff --git a/skins/common/images/sort_none.gif b/skins/common/images/sort_none.gif
index 6bb02824..edd07e58 100644
--- a/skins/common/images/sort_none.gif
+++ b/skins/common/images/sort_none.gif
Binary files differ
diff --git a/skins/common/images/sort_up.gif b/skins/common/images/sort_up.gif
index 53002968..488cf279 100644
--- a/skins/common/images/sort_up.gif
+++ b/skins/common/images/sort_up.gif
Binary files differ
diff --git a/skins/common/images/spinner.gif b/skins/common/images/spinner.gif
index bdd59d52..37d3a43d 100644
--- a/skins/common/images/spinner.gif
+++ b/skins/common/images/spinner.gif
Binary files differ
diff --git a/skins/common/images/wiki.png b/skins/common/images/wiki.png
index 49913f6a..4f1dc263 100644
--- a/skins/common/images/wiki.png
+++ b/skins/common/images/wiki.png
Binary files differ
diff --git a/skins/common/jquery.js b/skins/common/jquery.js
new file mode 100644
index 00000000..c25ee31c
--- /dev/null
+++ b/skins/common/jquery.js
@@ -0,0 +1,4384 @@
+/*!
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){
+
+var
+ // Will speed up references to window, and allows munging its name.
+ window = this,
+ // Will speed up references to undefined, and allows munging its name.
+ undefined,
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ jQuery = window.jQuery = window.$ = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ // Make sure that a selection was provided
+ selector = selector || document;
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this[0] = selector;
+ this.length = 1;
+ this.context = selector;
+ return this;
+ }
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ var match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] )
+ selector = jQuery.clean( [ match[1] ], context );
+
+ // HANDLE: $("#id")
+ else {
+ var elem = document.getElementById( match[3] );
+
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem && elem.id != match[3] )
+ return jQuery().find( selector );
+
+ // Otherwise, we inject the element directly into the jQuery object
+ var ret = jQuery( elem || [] );
+ ret.context = document;
+ ret.selector = selector;
+ return ret;
+ }
+
+ // HANDLE: $(expr, [context])
+ // (which is just equivalent to: $(content).find(expr)
+ } else
+ return jQuery( context ).find( selector );
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) )
+ return jQuery( document ).ready( selector );
+
+ // Make sure that old selector state is passed along
+ if ( selector.selector && selector.context ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return this.setArray(jQuery.isArray( selector ) ?
+ selector :
+ jQuery.makeArray(selector));
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.3.2",
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num === undefined ?
+
+ // Return a 'clean' array
+ Array.prototype.slice.call( this ) :
+
+ // Return just the object
+ this[ num ];
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery( elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" )
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ else if ( name )
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Force the current matched set of elements to become
+ // the specified array of elements (destroying the stack in the process)
+ // You should use pushStack() in order to do this, but maintain the stack
+ setArray: function( elems ) {
+ // Resetting the length to 0, then using the native Array push
+ // is a super-fast way to populate an object with array-like properties
+ this.length = 0;
+ Array.prototype.push.apply( this, elems );
+
+ return this;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem && elem.jquery ? elem[0] : elem
+ , this );
+ },
+
+ attr: function( name, value, type ) {
+ var options = name;
+
+ // Look for the case where we're accessing a style value
+ if ( typeof name === "string" )
+ if ( value === undefined )
+ return this[0] && jQuery[ type || "attr" ]( this[0], name );
+
+ else {
+ options = {};
+ options[ name ] = value;
+ }
+
+ // Check to see if we're setting style values
+ return this.each(function(i){
+ // Set all the styles
+ for ( name in options )
+ jQuery.attr(
+ type ?
+ this.style :
+ this,
+ name, jQuery.prop( this, options[ name ], type, i, name )
+ );
+ });
+ },
+
+ css: function( key, value ) {
+ // ignore negative width and height values
+ if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
+ value = undefined;
+ return this.attr( key, value, "curCSS" );
+ },
+
+ text: function( text ) {
+ if ( typeof text !== "object" && text != null )
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+
+ var ret = "";
+
+ jQuery.each( text || this, function(){
+ jQuery.each( this.childNodes, function(){
+ if ( this.nodeType != 8 )
+ ret += this.nodeType != 1 ?
+ this.nodeValue :
+ jQuery.fn.text( [ this ] );
+ });
+ });
+
+ return ret;
+ },
+
+ wrapAll: function( html ) {
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).clone();
+
+ if ( this[0].parentNode )
+ wrap.insertBefore( this[0] );
+
+ wrap.map(function(){
+ var elem = this;
+
+ while ( elem.firstChild )
+ elem = elem.firstChild;
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ return this.each(function(){
+ jQuery( this ).contents().wrapAll( html );
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function(){
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function(elem){
+ if (this.nodeType == 1)
+ this.appendChild( elem );
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function(elem){
+ if (this.nodeType == 1)
+ this.insertBefore( elem, this.firstChild );
+ });
+ },
+
+ before: function() {
+ return this.domManip(arguments, false, function(elem){
+ this.parentNode.insertBefore( elem, this );
+ });
+ },
+
+ after: function() {
+ return this.domManip(arguments, false, function(elem){
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ },
+
+ end: function() {
+ return this.prevObject || jQuery( [] );
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: [].push,
+ sort: [].sort,
+ splice: [].splice,
+
+ find: function( selector ) {
+ if ( this.length === 1 ) {
+ var ret = this.pushStack( [], "find", selector );
+ ret.length = 0;
+ jQuery.find( selector, this[0], ret );
+ return ret;
+ } else {
+ return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
+ return jQuery.find( selector, elem );
+ })), "find", selector );
+ }
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function(){
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML;
+ if ( !html ) {
+ var div = this.ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
+ } else
+ return this.cloneNode(true);
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ var orig = this.find("*").andSelf(), i = 0;
+
+ ret.find("*").andSelf().each(function(){
+ if ( this.nodeName !== orig[i].nodeName )
+ return;
+
+ var events = jQuery.data( orig[i], "events" );
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+
+ i++;
+ });
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ filter: function( selector ) {
+ return this.pushStack(
+ jQuery.isFunction( selector ) &&
+ jQuery.grep(this, function(elem, i){
+ return selector.call( elem, i );
+ }) ||
+
+ jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
+ return elem.nodeType === 1;
+ }) ), "filter", selector );
+ },
+
+ closest: function( selector ) {
+ var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
+ closer = 0;
+
+ return this.map(function(){
+ var cur = this;
+ while ( cur && cur.ownerDocument ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
+ jQuery.data(cur, "closest", closer);
+ return cur;
+ }
+ cur = cur.parentNode;
+ closer++;
+ }
+ });
+ },
+
+ not: function( selector ) {
+ if ( typeof selector === "string" )
+ // test special case where just one selector is passed in
+ if ( isSimple.test( selector ) )
+ return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
+ else
+ selector = jQuery.multiFilter( selector, this );
+
+ var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
+ return this.filter(function() {
+ return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
+ });
+ },
+
+ add: function( selector ) {
+ return this.pushStack( jQuery.unique( jQuery.merge(
+ this.get(),
+ typeof selector === "string" ?
+ jQuery( selector ) :
+ jQuery.makeArray( selector )
+ )));
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.multiFilter( selector, this ).length > 0;
+ },
+
+ hasClass: function( selector ) {
+ return !!selector && this.is( "." + selector );
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if( jQuery.nodeName( elem, 'option' ) )
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type == "select-one";
+
+ // Nothing was selected
+ if ( index < 0 )
+ return null;
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one )
+ return value;
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(/\r/g, "");
+
+ }
+
+ return undefined;
+ }
+
+ if ( typeof value === "number" )
+ value += '';
+
+ return this.each(function(){
+ if ( this.nodeType != 1 )
+ return;
+
+ if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
+ this.checked = (jQuery.inArray(this.value, value) >= 0 ||
+ jQuery.inArray(this.name, value) >= 0);
+
+ else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(value);
+
+ jQuery( "option", this ).each(function(){
+ this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
+ jQuery.inArray( this.text, values ) >= 0);
+ });
+
+ if ( !values.length )
+ this.selectedIndex = -1;
+
+ } else
+ this.value = value;
+ });
+ },
+
+ html: function( value ) {
+ return value === undefined ?
+ (this[0] ?
+ this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") :
+ null) :
+ this.empty().append( value );
+ },
+
+ replaceWith: function( value ) {
+ return this.after( value ).remove();
+ },
+
+ eq: function( i ) {
+ return this.slice( i, +i + 1 );
+ },
+
+ slice: function() {
+ return this.pushStack( Array.prototype.slice.apply( this, arguments ),
+ "slice", Array.prototype.slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function(elem, i){
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ },
+
+ domManip: function( args, table, callback ) {
+ if ( this[0] ) {
+ var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
+ scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
+ first = fragment.firstChild;
+
+ if ( first )
+ for ( var i = 0, l = this.length; i < l; i++ )
+ callback.call( root(this[i], first), this.length > 1 || i > 0 ?
+ fragment.cloneNode(true) : fragment );
+
+ if ( scripts )
+ jQuery.each( scripts, evalScript );
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+function evalScript( i, elem ) {
+ if ( elem.src )
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+
+ else
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+
+ if ( elem.parentNode )
+ elem.parentNode.removeChild( elem );
+}
+
+function now(){
+ return +new Date;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) )
+ target = {};
+
+ // extend jQuery itself if only one argument is passed
+ if ( length == i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ )
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null )
+ // Extend the base object
+ for ( var name in options ) {
+ var src = target[ name ], copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy )
+ continue;
+
+ // Recurse if we're merging object values
+ if ( deep && copy && typeof copy === "object" && !copy.nodeType )
+ target[ name ] = jQuery.extend( deep,
+ // Never move original objects, clone them
+ src || ( copy.length != null ? [ ] : { } )
+ , copy );
+
+ // Don't bring in undefined values
+ else if ( copy !== undefined )
+ target[ name ] = copy;
+
+ }
+
+ // Return the modified object
+ return target;
+};
+
+// exclude the following css properties to add px
+var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ // cache defaultView
+ defaultView = document.defaultView || {},
+ toString = Object.prototype.toString;
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep )
+ window.jQuery = _jQuery;
+
+ return jQuery;
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ // check if an element is in a (or is an) XML document
+ isXMLDoc: function( elem ) {
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
+ },
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && /\S/.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+ if ( jQuery.support.scriptEval )
+ script.appendChild( document.createTextNode( data ) );
+ else
+ script.text = data;
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0, length = object.length;
+
+ if ( args ) {
+ if ( length === undefined ) {
+ for ( name in object )
+ if ( callback.apply( object[ name ], args ) === false )
+ break;
+ } else
+ for ( ; i < length; )
+ if ( callback.apply( object[ i++ ], args ) === false )
+ break;
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( length === undefined ) {
+ for ( name in object )
+ if ( callback.call( object[ name ], name, object[ name ] ) === false )
+ break;
+ } else
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
+ }
+
+ return object;
+ },
+
+ prop: function( elem, value, type, i, name ) {
+ // Handle executable functions
+ if ( jQuery.isFunction( value ) )
+ value = value.call( elem, i );
+
+ // Handle passing in a number to a CSS property
+ return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
+ value + "px" :
+ value;
+ },
+
+ className: {
+ // internal only, use addClass("class")
+ add: function( elem, classNames ) {
+ jQuery.each((classNames || "").split(/\s+/), function(i, className){
+ if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
+ elem.className += (elem.className ? " " : "") + className;
+ });
+ },
+
+ // internal only, use removeClass("class")
+ remove: function( elem, classNames ) {
+ if (elem.nodeType == 1)
+ elem.className = classNames !== undefined ?
+ jQuery.grep(elem.className.split(/\s+/), function(className){
+ return !jQuery.className.has( classNames, className );
+ }).join(" ") :
+ "";
+ },
+
+ // internal only, use hasClass("class")
+ has: function( elem, className ) {
+ return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options )
+ elem.style[ name ] = old[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name == "width" || name == "height" ) {
+ var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
+
+ function getWH() {
+ val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" )
+ return;
+
+ jQuery.each( which, function() {
+ if ( !extra )
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ if ( extra === "margin" )
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ else
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 )
+ getWH();
+ else
+ jQuery.swap( elem, props, getWH );
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style;
+
+ // We need to handle opacity special in IE
+ if ( name == "opacity" && !jQuery.support.opacity ) {
+ ret = jQuery.attr( style, "opacity" );
+
+ return ret == "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( name.match( /float/i ) )
+ name = styleFloat;
+
+ if ( !force && style && style[ name ] )
+ ret = style[ name ];
+
+ else if ( defaultView.getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( name.match( /float/i ) )
+ name = "float";
+
+ name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
+ try{
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+ }catch(e){
+ // Error in getting computedStyle
+ }
+ if ( computedStyle )
+ ret = computedStyle.getPropertyValue( name );
+
+ // We should always get a number back from opacity
+ if ( name == "opacity" && ret == "" )
+ ret = "1";
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(/\-(\w)/g, function(all, letter){
+ return letter.toUpperCase();
+ });
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = ret || 0;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ clean: function( elems, context, fragment ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" )
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
+ var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
+ if ( match )
+ return [ context.createElement( match[1] ) ];
+ }
+
+ var ret = [], scripts = [], div = context.createElement("div");
+
+ jQuery.each(elems, function(i, elem){
+ if ( typeof elem === "number" )
+ elem += '';
+
+ if ( !elem )
+ return;
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
+ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
+ all :
+ front + "></" + tag + ">";
+ });
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
+
+ var wrap =
+ // option or optgroup
+ !tags.indexOf("<opt") &&
+ [ 1, "<select multiple='multiple'>", "</select>" ] ||
+
+ !tags.indexOf("<leg") &&
+ [ 1, "<fieldset>", "</fieldset>" ] ||
+
+ tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+ [ 1, "<table>", "</table>" ] ||
+
+ !tags.indexOf("<tr") &&
+ [ 2, "<table><tbody>", "</tbody></table>" ] ||
+
+ // <thead> matched above
+ (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
+ [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
+
+ !tags.indexOf("<col") &&
+ [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
+
+ // IE can't serialize <link> and <script> tags normally
+ !jQuery.support.htmlSerialize &&
+ [ 1, "div<div>", "</div>" ] ||
+
+ [ 0, "", "" ];
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( wrap[0]-- )
+ div = div.lastChild;
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = /<tbody/i.test(elem),
+ tbody = !tags.indexOf("<table") && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] == "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j )
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
+ div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
+
+ elem = jQuery.makeArray( div.childNodes );
+ }
+
+ if ( elem.nodeType )
+ ret.push( elem );
+ else
+ ret = jQuery.merge( ret, elem );
+
+ });
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+ } else {
+ if ( ret[i].nodeType === 1 )
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ fragment.appendChild( ret[i] );
+ }
+ }
+
+ return scripts;
+ }
+
+ return ret;
+ },
+
+ attr: function( elem, name, value ) {
+ // don't set attributes on text and comment nodes
+ if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
+ return undefined;
+
+ var notxml = !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ // IE elem.getAttribute passes even for style
+ if ( elem.tagName ) {
+
+ // These attributes require special treatment
+ var special = /href|src|style/.test( name );
+
+ // Safari mis-reports the default selected property of a hidden option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name == "selected" && elem.parentNode )
+ elem.parentNode.selectedIndex;
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ){
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
+ throw "type property can't be changed";
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
+ return elem.getAttributeNode( name ).nodeValue;
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name == "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+ return attributeNode && attributeNode.specified
+ ? attributeNode.value
+ : elem.nodeName.match(/(button|input|object|select|textarea)/i)
+ ? 0
+ : elem.nodeName.match(/^(a|area)$/i) && elem.href
+ ? 0
+ : undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name == "style" )
+ return jQuery.attr( elem.style, "cssText", value );
+
+ if ( set )
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special
+ // Some attributes require a special call on IE
+ ? elem.getAttribute( name, 2 )
+ : elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name == "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ elem.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
+ (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+ }
+
+ return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
+ "";
+ }
+
+ name = name.replace(/-([a-z])/ig, function(all, letter){
+ return letter.toUpperCase();
+ });
+
+ if ( set && value != 'NaNpx' && value != 'nullpx' ) // Patched by Trevor, see http://is.gd/5NXiD
+ elem[ name ] = value;
+
+ return elem[ name ];
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( /^\s+|\s+$/g, "" );
+ },
+
+ makeArray: function( array ) {
+ var ret = [];
+
+ if( array != null ){
+ var i = array.length;
+ // The window, strings (and functions) also have 'length'
+ if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
+ ret[0] = array;
+ else
+ while( i )
+ ret[--i] = array[i];
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ for ( var i = 0, length = array.length; i < length; i++ )
+ // Use === because on IE, window == document
+ if ( array[ i ] === elem )
+ return i;
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ // We have to loop this way because IE & Opera overwrite the length
+ // expando of getElementsByTagName
+ var i = 0, elem, pos = first.length;
+ // Also, we need to make sure that the correct elements are being returned
+ // (IE returns comment nodes in a '*' query)
+ if ( !jQuery.support.getAll ) {
+ while ( (elem = second[ i++ ]) != null )
+ if ( elem.nodeType != 8 )
+ first[ pos++ ] = elem;
+
+ } else
+ while ( (elem = second[ i++ ]) != null )
+ first[ pos++ ] = elem;
+
+ return first;
+ },
+
+ unique: function( array ) {
+ var ret = [], done = {};
+
+ try {
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ var id = jQuery.data( array[ i ] );
+
+ if ( !done[ id ] ) {
+ done[ id ] = true;
+ ret.push( array[ i ] );
+ }
+ }
+
+ } catch( e ) {
+ ret = array;
+ }
+
+ return ret;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ )
+ if ( !inv != !callback( elems[ i ], i ) )
+ ret.push( elems[ i ] );
+
+ return ret;
+ },
+
+ map: function( elems, callback ) {
+ var ret = [];
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ var value = callback( elems[ i ], i );
+
+ if ( value != null )
+ ret[ ret.length ] = value;
+ }
+
+ return ret.concat.apply( [], ret );
+ }
+});
+
+// Use of jQuery.browser is deprecated.
+// It's included for backwards compatibility and plugins,
+// although they should work to migrate away.
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ safari: /webkit/.test( userAgent ),
+ opera: /opera/.test( userAgent ),
+ msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
+ mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
+};
+
+jQuery.each({
+ parent: function(elem){return elem.parentNode;},
+ parents: function(elem){return jQuery.dir(elem,"parentNode");},
+ next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
+ prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
+ nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
+ prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
+ siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
+ children: function(elem){return jQuery.sibling(elem.firstChild);},
+ contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
+}, function(name, fn){
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = jQuery.map( this, fn );
+
+ if ( selector && typeof selector == "string" )
+ ret = jQuery.multiFilter( selector, ret );
+
+ return this.pushStack( jQuery.unique( ret ), name, selector );
+ };
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function(name, original){
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector );
+
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, selector );
+ };
+});
+
+jQuery.each({
+ removeAttr: function( name ) {
+ jQuery.attr( this, name, "" );
+ if (this.nodeType == 1)
+ this.removeAttribute( name );
+ },
+
+ addClass: function( classNames ) {
+ jQuery.className.add( this, classNames );
+ },
+
+ removeClass: function( classNames ) {
+ jQuery.className.remove( this, classNames );
+ },
+
+ toggleClass: function( classNames, state ) {
+ if( typeof state !== "boolean" )
+ state = !jQuery.className.has( this, classNames );
+ jQuery.className[ state ? "add" : "remove" ]( this, classNames );
+ },
+
+ remove: function( selector ) {
+ if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ // Prevent memory leaks
+ jQuery( "*", this ).add([this]).each(function(){
+ jQuery.event.remove(this);
+ jQuery.removeData(this);
+ });
+ if (this.parentNode)
+ this.parentNode.removeChild( this );
+ }
+ },
+
+ empty: function() {
+ // Remove element nodes and prevent memory leaks
+ jQuery(this).children().remove();
+
+ // Remove any remaining nodes
+ while ( this.firstChild )
+ this.removeChild( this.firstChild );
+ }
+}, function(name, fn){
+ jQuery.fn[ name ] = function(){
+ return this.each( fn, arguments );
+ };
+});
+
+// Helper function used by the dimensions and offset modules
+function num(elem, prop) {
+ return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
+}
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+
+jQuery.extend({
+ cache: {},
+
+ data: function( elem, name, data ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // Compute a unique ID for the element
+ if ( !id )
+ id = elem[ expando ] = ++uuid;
+
+ // Only generate the data cache if we're
+ // trying to access or manipulate it
+ if ( name && !jQuery.cache[ id ] )
+ jQuery.cache[ id ] = {};
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined )
+ jQuery.cache[ id ][ name ] = data;
+
+ // Return the named cache data, or the ID for the element
+ return name ?
+ jQuery.cache[ id ][ name ] :
+ id;
+ },
+
+ removeData: function( elem, name ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( jQuery.cache[ id ] ) {
+ // Remove the section of cache data
+ delete jQuery.cache[ id ][ name ];
+
+ // If we've removed all the data, remove the element's cache
+ name = "";
+
+ for ( name in jQuery.cache[ id ] )
+ break;
+
+ if ( !name )
+ jQuery.removeData( elem );
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch(e){
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute )
+ elem.removeAttribute( expando );
+ }
+
+ // Completely remove the data cache
+ delete jQuery.cache[ id ];
+ }
+ },
+ queue: function( elem, type, data ) {
+ if ( elem ){
+
+ type = (type || "fx") + "queue";
+
+ var q = jQuery.data( elem, type );
+
+ if ( !q || jQuery.isArray(data) )
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+ else if( data )
+ q.push( data );
+
+ }
+ return q;
+ },
+
+ dequeue: function( elem, type ){
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift();
+
+ if( !type || type === "fx" )
+ fn = queue[0];
+
+ if( fn !== undefined )
+ fn.call(elem);
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ){
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length )
+ data = jQuery.data( this[0], key );
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
+ jQuery.data( this, key, value );
+ });
+ },
+
+ removeData: function( key ){
+ return this.each(function(){
+ jQuery.removeData( this, key );
+ });
+ },
+ queue: function(type, data){
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined )
+ return jQuery.queue( this[0], type );
+
+ return this.each(function(){
+ var queue = jQuery.queue( this, type, data );
+
+ if( type == "fx" && queue.length == 1 )
+ queue[0].call(this);
+ });
+ },
+ dequeue: function(type){
+ return this.each(function(){
+ jQuery.dequeue( this, type );
+ });
+ }
+});/*!
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
+ done = 0,
+ toString = Object.prototype.toString;
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 )
+ return [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, check, mode, extra, prune = true;
+
+ // Reset the position of the chunker regexp (start from head)
+ chunker.lastIndex = 0;
+
+ while ( (m = chunker.exec(selector)) !== null ) {
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = RegExp.rightContext;
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] )
+ selector += parts.shift();
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
+ set = Sizzle.filter( ret.expr, ret.set );
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, isXML(context) );
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, context, results, seed );
+
+ if ( sortOrder ) {
+ hasDuplicate = false;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.match[ type ].exec( expr )) ) {
+ var left = RegExp.leftContext;
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.match[ type ].exec( expr )) != null ) {
+ var filter = Expr.filter[ type ], found, item;
+ anyFound = false;
+
+ if ( curLoop == result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr == old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
+ },
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag && !isXML ) {
+ part = part.toUpperCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = isXML ? part : part.toUpperCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( !part.match(/\W/) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !part.match(/\W/) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context, isXML){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
+ if ( !inplace )
+ result.push( elem );
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ for ( var i = 0; curLoop[i] === false; i++ ){}
+ return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
+ },
+ CHILD: function(match){
+ if ( match[1] == "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 == i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 == i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while (node = node.previousSibling) {
+ if ( node.nodeType === 1 ) return false;
+ }
+ if ( type == 'first') return true;
+ node = elem;
+ case 'last':
+ while (node = node.nextSibling) {
+ if ( node.nodeType === 1 ) return false;
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first == 1 && last == 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first == 0 ) {
+ return diff == 0;
+ } else {
+ return ( diff % first == 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value != check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.selectNode(a);
+ aRange.collapse(true);
+ bRange.selectNode(b);
+ bRange.collapse(true);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("form"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<input name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( !!document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+})();
+
+if ( document.querySelectorAll ) (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ Sizzle.find = oldSizzle.find;
+ Sizzle.filter = oldSizzle.filter;
+ Sizzle.selectors = oldSizzle.selectors;
+ Sizzle.matches = oldSizzle.matches;
+})();
+
+if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
+ var div = document.createElement("div");
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ if ( div.getElementsByClassName("e").length === 0 )
+ return;
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 )
+ return;
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && isXML( elem.ownerDocument );
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.filter = Sizzle.filter;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+
+Sizzle.selectors.filters.hidden = function(elem){
+ return elem.offsetWidth === 0 || elem.offsetHeight === 0;
+};
+
+Sizzle.selectors.filters.visible = function(elem){
+ return elem.offsetWidth > 0 || elem.offsetHeight > 0;
+};
+
+Sizzle.selectors.filters.animated = function(elem){
+ return jQuery.grep(jQuery.timers, function(fn){
+ return elem === fn.elem;
+ }).length;
+};
+
+jQuery.multiFilter = function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return Sizzle.matches(expr, elems);
+};
+
+jQuery.dir = function( elem, dir ){
+ var matched = [], cur = elem[dir];
+ while ( cur && cur != document ) {
+ if ( cur.nodeType == 1 )
+ matched.push( cur );
+ cur = cur[dir];
+ }
+ return matched;
+};
+
+jQuery.nth = function(cur, result, dir, elem){
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] )
+ if ( cur.nodeType == 1 && ++num == result )
+ break;
+
+ return cur;
+};
+
+jQuery.sibling = function(n, elem){
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType == 1 && n != elem )
+ r.push( n );
+ }
+
+ return r;
+};
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function(elem, types, handler, data) {
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
+ return;
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && elem != window )
+ elem = window;
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid )
+ handler.guid = this.guid++;
+
+ // if data is passed, bind to handler
+ if ( data !== undefined ) {
+ // Create temporary function pointer to original handler
+ var fn = handler;
+
+ // Create unique handler function, wrapped around original handler
+ handler = this.proxy( fn );
+
+ // Store data in unique handler
+ handler.data = data;
+ }
+
+ // Init the element's event structure
+ var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
+ handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply(arguments.callee.elem, arguments) :
+ undefined;
+ });
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native
+ // event in IE.
+ handle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ jQuery.each(types.split(/\s+/), function(index, type) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ handler.type = namespaces.slice().sort().join(".");
+
+ // Get the current list of functions bound to this event
+ var handlers = events[type];
+
+ if ( jQuery.event.specialAll[type] )
+ jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
+
+ // Init the event handler queue
+ if (!handlers) {
+ handlers = events[type] = {};
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
+ // Bind the global event handler to the element
+ if (elem.addEventListener)
+ elem.addEventListener(type, handle, false);
+ else if (elem.attachEvent)
+ elem.attachEvent("on" + type, handle);
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers[handler.guid] = handler;
+
+ // Keep track of which events have been used, for global triggering
+ jQuery.event.global[type] = true;
+ });
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ guid: 1,
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function(elem, types, handler) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
+ return;
+
+ var events = jQuery.data(elem, "events"), ret, index;
+
+ if ( events ) {
+ // Unbind all events for the element
+ if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
+ for ( var type in events )
+ this.remove( elem, type + (types || "") );
+ else {
+ // types is actually an event object here
+ if ( types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Handle multiple events seperated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ jQuery.each(types.split(/\s+/), function(index, type){
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
+
+ if ( events[type] ) {
+ // remove the given handler for the given type
+ if ( handler )
+ delete events[type][handler.guid];
+
+ // remove all handlers for the given type
+ else
+ for ( var handle in events[type] )
+ // Handle the removal of namespaced events
+ if ( namespace.test(events[type][handle].type) )
+ delete events[type][handle];
+
+ if ( jQuery.event.specialAll[type] )
+ jQuery.event.specialAll[type].teardown.call(elem, namespaces);
+
+ // remove generic event handler if no more handlers exist
+ for ( ret in events[type] ) break;
+ if ( !ret ) {
+ if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
+ if (elem.removeEventListener)
+ elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
+ else if (elem.detachEvent)
+ elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
+ }
+ ret = null;
+ delete events[type];
+ }
+ }
+ });
+ }
+
+ // Remove the expando if it's no longer used
+ for ( ret in events ) break;
+ if ( !ret ) {
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) handle.elem = null;
+ jQuery.removeData( elem, "events" );
+ jQuery.removeData( elem, "handle" );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem, bubbling ) {
+ // Event object or event type
+ var type = event.type || event;
+
+ if( !bubbling ){
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+ // Only trigger if we've ever bound an event for it
+ if ( this.global[type] )
+ jQuery.each( jQuery.cache, function(){
+ if ( this.events && this.events[type] )
+ jQuery.event.trigger( event, data, this.handle.elem );
+ });
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
+ return undefined;
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray(data);
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data(elem, "handle");
+ if ( handle )
+ handle.apply( elem, data );
+
+ // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
+ if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
+ event.result = false;
+
+ // Trigger the native events (except for clicks on links)
+ if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
+ this.triggered = true;
+ try {
+ elem[ type ]();
+ // prevent IE from throwing an error for some hidden elements
+ } catch (e) {}
+ }
+
+ this.triggered = false;
+
+ if ( !event.isPropagationStopped() ) {
+ var parent = elem.parentNode || elem.ownerDocument;
+ if ( parent )
+ jQuery.event.trigger(event, data, parent, true);
+ }
+ },
+
+ handle: function(event) {
+ // returned undefined or false
+ var all, handlers;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ var namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+
+ // Cache this now, all = true means, any handler
+ all = !namespaces.length && !event.exclusive;
+
+ var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
+
+ handlers = ( jQuery.data(this, "events") || {} )[event.type];
+
+ for ( var j in handlers ) {
+ var handler = handlers[j];
+
+ // Filter the functions by class
+ if ( all || namespace.test(handler.type) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ var ret = handler.apply(this, arguments);
+
+ if( ret !== undefined ){
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if( event.isImmediatePropagationStopped() )
+ break;
+
+ }
+ }
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function(event) {
+ if ( event[expando] )
+ return event;
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ){
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target )
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType == 3 )
+ event.target = event.target.parentNode;
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement )
+ event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
+ event.which = event.charCode || event.keyCode;
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey )
+ event.metaKey = event.ctrlKey;
+
+ // Add which for click: 1 == left; 2 == middle; 3 == right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button )
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+
+ return event;
+ },
+
+ proxy: function( fn, proxy ){
+ proxy = proxy || function(){ return fn.apply(this, arguments); };
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: bindReady,
+ teardown: function() {}
+ }
+ },
+
+ specialAll: {
+ live: {
+ setup: function( selector, namespaces ){
+ jQuery.event.add( this, namespaces[0], liveHandler );
+ },
+ teardown: function( namespaces ){
+ if ( namespaces.length ) {
+ var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+ jQuery.each( (jQuery.data(this, "events").live || {}), function(){
+ if ( name.test(this.type) )
+ remove++;
+ });
+
+ if ( remove < 1 )
+ jQuery.event.remove( this, namespaces[0], liveHandler );
+ }
+ }
+ }
+ }
+};
+
+jQuery.Event = function( src ){
+ // Allow instantiation without the 'new' keyword
+ if( !this.preventDefault )
+ return new jQuery.Event(src);
+
+ // Event object
+ if( src && src.type ){
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ }else
+ this.type = src;
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[expando] = true;
+};
+
+function returnFalse(){
+ return false;
+}
+function returnTrue(){
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if( !e )
+ return;
+ // if preventDefault exists run it on the original event
+ if (e.preventDefault)
+ e.preventDefault();
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if( !e )
+ return;
+ // if stopPropagation exists run it on the original event
+ if (e.stopPropagation)
+ e.stopPropagation();
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation:function(){
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function(event) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+ // Traverse up the tree
+ while ( parent && parent != this )
+ try { parent = parent.parentNode; }
+ catch(e) { parent = this; }
+
+ if( parent != this ){
+ // set the correct event type
+ event.type = event.data;
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+};
+
+jQuery.each({
+ mouseover: 'mouseenter',
+ mouseout: 'mouseleave'
+}, function( orig, fix ){
+ jQuery.event.special[ fix ] = {
+ setup: function(){
+ jQuery.event.add( this, orig, withinElement, fix );
+ },
+ teardown: function(){
+ jQuery.event.remove( this, orig, withinElement );
+ }
+ };
+});
+
+jQuery.fn.extend({
+ bind: function( type, data, fn ) {
+ return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+ jQuery.event.add( this, type, fn || data, fn && data );
+ });
+ },
+
+ one: function( type, data, fn ) {
+ var one = jQuery.event.proxy( fn || data, function(event) {
+ jQuery(this).unbind(event, one);
+ return (fn || data).apply( this, arguments );
+ });
+ return this.each(function(){
+ jQuery.event.add( this, type, one, fn && data);
+ });
+ },
+
+ unbind: function( type, fn ) {
+ return this.each(function(){
+ jQuery.event.remove( this, type, fn );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function(){
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if( this[0] ){
+ var event = jQuery.Event(type);
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while( i < args.length )
+ jQuery.event.proxy( fn, args[i++] );
+
+ return this.click( jQuery.event.proxy( fn, function(event) {
+ // Figure out which function to execute
+ this.lastToggle = ( this.lastToggle || 0 ) % i;
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ this.lastToggle++ ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function(fnOver, fnOut) {
+ return this.mouseenter(fnOver).mouseleave(fnOut);
+ },
+
+ ready: function(fn) {
+ // Attach the listeners
+ bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady )
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ else
+ // Add the function to the wait list
+ jQuery.readyList.push( fn );
+
+ return this;
+ },
+
+ live: function( type, fn ){
+ var proxy = jQuery.event.proxy( fn );
+ proxy.guid += this.selector + type;
+
+ jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
+
+ return this;
+ },
+
+ die: function( type, fn ){
+ jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
+ return this;
+ }
+});
+
+function liveHandler( event ){
+ var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
+ stop = true,
+ elems = [];
+
+ jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
+ if ( check.test(fn.type) ) {
+ var elem = jQuery(event.target).closest(fn.data)[0];
+ if ( elem )
+ elems.push({ elem: elem, fn: fn });
+ }
+ });
+
+ elems.sort(function(a,b) {
+ return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
+ });
+
+ jQuery.each(elems, function(){
+ if ( this.fn.call(this.elem, event, this.fn.data) === false )
+ return (stop = false);
+ });
+
+ return stop;
+}
+
+function liveConvert(type, selector){
+ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
+}
+
+jQuery.extend({
+ isReady: false,
+ readyList: [],
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( jQuery.readyList ) {
+ // Execute all of them
+ jQuery.each( jQuery.readyList, function(){
+ this.call( document, jQuery );
+ });
+
+ // Reset the list of functions
+ jQuery.readyList = null;
+ }
+
+ // Trigger any bound ready events
+ jQuery(document).triggerHandler("ready");
+ }
+ }
+});
+
+var readyBound = false;
+
+function bindReady(){
+ if ( readyBound ) return;
+ readyBound = true;
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", function(){
+ document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
+ jQuery.ready();
+ }, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", function(){
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", arguments.callee );
+ jQuery.ready();
+ }
+ });
+
+ // If IE and not an iframe
+ // continually check to see if the document is ready
+ if ( document.documentElement.doScroll && window == window.top ) (function(){
+ if ( jQuery.isReady ) return;
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( arguments.callee, 0 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+ })();
+ }
+
+ // A fallback to window.onload, that will always work
+ jQuery.event.add( window, "load", jQuery.ready );
+}
+
+jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
+ "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
+ "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
+
+ // Handle event binding
+ jQuery.fn[name] = function(fn){
+ return fn ? this.bind(name, fn) : this.trigger(name);
+ };
+});
+
+// Prevent memory leaks in IE
+// And prevent errors on refresh with events like mouseover in other browsers
+// Window isn't included so as not to unbind existing unload events
+jQuery( window ).bind( 'unload', function(){
+ for ( var id in jQuery.cache )
+ // Skip the window
+ if ( id != 1 && jQuery.cache[ id ].handle )
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+});
+(function(){
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+
+ div.style.display = "none";
+ div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType == 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that you can get all elements in an <object> element
+ // IE 7 always returns no results
+ objectAll: !!div.getElementsByTagName("object")[0]
+ .getElementsByTagName("*").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ opacity: a.style.opacity === "0.5",
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Will be defined later
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e){}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function(){
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", arguments.callee);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ jQuery(function(){
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ });
+})();
+
+var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ "float": styleFloat,
+ cssFloat: styleFloat,
+ styleFloat: styleFloat,
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ tabindex: "tabIndex"
+};
+jQuery.fn.extend({
+ // Keep a copy of the old load
+ _load: jQuery.fn.load,
+
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" )
+ return this._load( url );
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params )
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if( typeof params === "object" ) {
+ params = jQuery.param( params );
+ type = "POST";
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ complete: function(res, status){
+ // If successful, inject the HTML into all the matched elements
+ if ( status == "success" || status == "notmodified" )
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div/>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+
+ if( callback )
+ self.each( callback, [res.responseText, status, res] );
+ }
+ });
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray(this.elements) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ (this.checked || /select|textarea/i.test(this.nodeName) ||
+ /text|hidden|password|search/i.test(this.type));
+ })
+ .map(function(i, elem){
+ var val = jQuery(this).val();
+ return val == null ? null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function(val, i){
+ return {name: elem.name, value: val};
+ }) :
+ {name: elem.name, value: val};
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+ jQuery.fn[o] = function(f){
+ return this.bind(o, f);
+ };
+});
+
+var jsc = now();
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was ommited
+ if ( jQuery.isFunction( data ) ) {
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ if ( jQuery.isFunction( data ) ) {
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr:function(){
+ return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+ },
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ script: "text/javascript, application/javascript",
+ json: "application/json, text/javascript",
+ text: "text/plain",
+ _default: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+
+ ajax: function( s ) {
+ // Extend the settings, but re-extend 's' so that it can be
+ // checked again later (in the test suite, specifically)
+ s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+ var jsonp, jsre = /=\?(&|$)/g, status, data,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" )
+ s.data = jQuery.param(s.data);
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType == "jsonp" ) {
+ if ( type == "GET" ) {
+ if ( !s.url.match(jsre) )
+ s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ } else if ( !s.data || !s.data.match(jsre) )
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+ jsonp = "jsonp" + jsc++;
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data )
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = function(tmp){
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+ try{ delete window[ jsonp ]; } catch(e){}
+ if ( head )
+ head.removeChild( script );
+ };
+ }
+
+ if ( s.dataType == "script" && s.cache == null )
+ s.cache = false;
+
+ if ( s.cache === false && type == "GET" ) {
+ var ts = now();
+ // try replacing _= if it is there
+ var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type == "GET" ) {
+ s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+ // IE likes to send both get and post data, prevent this
+ s.data = null;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ )
+ jQuery.event.trigger( "ajaxStart" );
+
+ // Matches an absolute URL, and saves the domain
+ var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType == "script" && type == "GET" && parts
+ && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
+
+ var head = document.getElementsByTagName("head")[0];
+ var script = document.createElement("script");
+ script.src = s.url;
+ if (s.scriptCharset)
+ script.charset = s.scriptCharset;
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function(){
+ if ( !done && (!this.readyState ||
+ this.readyState == "loaded" || this.readyState == "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ head.removeChild( script );
+ }
+ };
+ }
+
+ head.appendChild(script);
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if( s.username )
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ else
+ xhr.open(type, s.url, s.async);
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data )
+ xhr.setRequestHeader("Content-Type", s.contentType);
+
+ // Set the If-Modified-Since header, if ifModified mode.
+ if ( s.ifModified )
+ xhr.setRequestHeader("If-Modified-Since",
+ jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e){}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global )
+ jQuery.event.trigger("ajaxSend", [xhr, s]);
+
+ // Wait for a response to come back
+ var onreadystatechange = function(isTimeout){
+ // The request was aborted, clear the interval and decrement jQuery.active
+ if (xhr.readyState == 0) {
+ if (ival) {
+ // clear poll interval
+ clearInterval(ival);
+ ival = null;
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
+ requestDone = true;
+
+ // clear poll interval
+ if (ival) {
+ clearInterval(ival);
+ ival = null;
+ }
+
+ status = isTimeout == "timeout" ? "timeout" :
+ !jQuery.httpSuccess( xhr ) ? "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
+ "success";
+
+ if ( status == "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(e) {
+ status = "parsererror";
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status == "success" ) {
+ // Cache Last-Modified header, if ifModified mode.
+ var modRes;
+ try {
+ modRes = xhr.getResponseHeader("Last-Modified");
+ } catch(e) {} // swallow exception thrown by FF if header is not available
+
+ if ( s.ifModified && modRes )
+ jQuery.lastModified[s.url] = modRes;
+
+ // JSONP handles its own success callback
+ if ( !jsonp )
+ success();
+ } else
+ jQuery.handleError(s, xhr, status);
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout )
+ xhr.abort();
+
+ // Stop memory leaks
+ if ( s.async )
+ xhr = null;
+ }
+ };
+
+ if ( s.async ) {
+ // don't attach the handler to the request, just poll it instead
+ var ival = setInterval(onreadystatechange, 13);
+
+ // Timeout checker
+ if ( s.timeout > 0 )
+ setTimeout(function(){
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone )
+ onreadystatechange( "timeout" );
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send(s.data);
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async )
+ onreadystatechange();
+
+ function success(){
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success )
+ s.success( data, status );
+
+ // Fire the global callback
+ if ( s.global )
+ jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
+ }
+
+ function complete(){
+ // Process result
+ if ( s.complete )
+ s.complete(xhr, status);
+
+ // The request was completed
+ if ( s.global )
+ jQuery.event.trigger( "ajaxComplete", [xhr, s] );
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) s.error( xhr, status, e );
+
+ // Fire the global callback
+ if ( s.global )
+ jQuery.event.trigger( "ajaxError", [xhr, s, e] );
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol == "file:" ||
+ ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
+ } catch(e){}
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ try {
+ var xhrRes = xhr.getResponseHeader("Last-Modified");
+
+ // Firefox always returns 200. check Last-Modified date
+ return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
+ } catch(e){}
+ return false;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type"),
+ xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.tagName == "parsererror" )
+ throw "parsererror";
+
+ // Allow a pre-filtering function to sanitize the response
+ // s != null is checked to keep backwards compatibility
+ if( s && s.dataFilter )
+ data = s.dataFilter( data, type );
+
+ // The filter can actually parse the response
+ if( typeof data === "string" ){
+
+ // If the type is "script", eval it in global context
+ if ( type == "script" )
+ jQuery.globalEval( data );
+
+ // Get the JavaScript object, if JSON is used.
+ if ( type == "json" )
+ data = window["eval"]("(" + data + ")");
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a ) {
+ var s = [ ];
+
+ function add( key, value ){
+ s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ };
+
+ // If an array was passed in, assume that it is an array
+ // of form elements
+ if ( jQuery.isArray(a) || a.jquery )
+ // Serialize the form elements
+ jQuery.each( a, function(){
+ add( this.name, this.value );
+ });
+
+ // Otherwise, assume that it's an object of key/value pairs
+ else
+ // Serialize the key/values
+ for ( var j in a )
+ // If the value is an array then the key names need to be repeated
+ if ( jQuery.isArray(a[j]) )
+ jQuery.each( a[j], function(){
+ add( j, this );
+ });
+ else
+ add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
+
+ // Return the resulting serialization
+ return s.join("&").replace(/%20/g, "+");
+ }
+
+});
+var elemdisplay = {},
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+function genFx( type, num ){
+ var obj = {};
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
+ obj[ this ] = type;
+ });
+ return obj;
+}
+
+jQuery.fn.extend({
+ show: function(speed,callback){
+ if ( speed ) {
+ return this.animate( genFx("show", 3), speed, callback);
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var tagName = this[i].tagName, display;
+
+ if ( elemdisplay[ tagName ] ) {
+ display = elemdisplay[ tagName ];
+ } else {
+ var elem = jQuery("<" + tagName + " />").appendTo("body");
+
+ display = elem.css("display");
+ if ( display === "none" )
+ display = "block";
+
+ elem.remove();
+
+ elemdisplay[ tagName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function(speed,callback){
+ if ( speed ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" )
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ this[i].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ){
+ var bool = typeof fn === "boolean";
+
+ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+ this._toggle.apply( this, arguments ) :
+ fn == null || bool ?
+ this.each(function(){
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ }) :
+ this.animate(genFx("toggle", 3), fn, fn2);
+ },
+
+ fadeTo: function(speed,to,callback){
+ return this.animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ return this[ optall.queue === false ? "each" : "queue" ](function(){
+
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+ return opt.complete.call(this);
+
+ if ( ( p == "height" || p == "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+ }
+
+ if ( opt.overflow != null )
+ this.style.overflow = "hidden";
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function(name, val){
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( /toggle|show|hide/.test(val) )
+ e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+ else {
+ var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat(parts[2]),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit != "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] )
+ end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+ e.custom( start, end, unit );
+ } else
+ e.custom( start, val, "" );
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function(clearQueue, gotoEnd){
+ var timers = jQuery.timers;
+
+ if (clearQueue)
+ this.queue([]);
+
+ this.each(function(){
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- )
+ if ( timers[i].elem == this ) {
+ if (gotoEnd)
+ // force the next step to be the last
+ timers[i](true);
+ timers.splice(i, 1);
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if (!gotoEnd)
+ this.dequeue();
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ){
+ jQuery.fn[ name ] = function( speed, callback ){
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+
+ speed: function(speed, easing, fn) {
+ var opt = typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function(){
+ if ( opt.queue !== false )
+ jQuery(this).dequeue();
+ if ( jQuery.isFunction( opt.old ) )
+ opt.old.call( this );
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ){
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig )
+ options.orig = {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+
+ // Simple function for setting a style value
+ update: function(){
+ if ( this.options.step )
+ this.options.step.call( this.elem, this.now, this );
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
+ this.elem.style.display = "block";
+ },
+
+ // Get the current size
+ cur: function(force){
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
+ return this.elem[ this.prop ];
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function(from, to, unit){
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t(gotoEnd){
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(function(){
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ )
+ if ( !timers[i]() )
+ timers.splice(i--, 1);
+
+ if ( !timers.length ) {
+ clearInterval( timerId );
+ timerId = undefined;
+ }
+ }, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function(){
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery(this.elem).show();
+ },
+
+ // Simple 'hide' function
+ hide: function(){
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function(gotoEnd){
+ var t = now();
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ var done = true;
+ for ( var i in this.options.curAnim )
+ if ( this.options.curAnim[i] !== true )
+ done = false;
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ this.elem.style.display = this.options.display;
+ if ( jQuery.css(this.elem, "display") == "none" )
+ this.elem.style.display = "block";
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide )
+ jQuery(this.elem).hide();
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show )
+ for ( var p in this.options.curAnim )
+ jQuery.attr(this.elem.style, p, this.options.orig[p]);
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+
+};
+
+jQuery.extend( jQuery.fx, {
+ speeds:{
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+ step: {
+
+ opacity: function(fx){
+ jQuery.attr(fx.elem.style, "opacity", fx.now);
+ },
+
+ _default: function(fx){
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+ else
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+});
+if ( document.documentElement["getBoundingClientRect"] )
+ jQuery.fn.offset = function() {
+ if ( !this[0] ) return { top: 0, left: 0 };
+ if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
+ var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+ return { top: top, left: left };
+ };
+else
+ jQuery.fn.offset = function() {
+ if ( !this[0] ) return { top: 0, left: 0 };
+ if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
+ jQuery.offset.initialized || jQuery.offset.initialize();
+
+ var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView.getComputedStyle(elem, null),
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ computedStyle = defaultView.getComputedStyle(elem, null);
+ top -= elem.scrollTop, left -= elem.scrollLeft;
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop, left += elem.offsetLeft;
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
+ top += parseInt( computedStyle.borderTopWidth, 10) || 0,
+ left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
+ top += parseInt( computedStyle.borderTopWidth, 10) || 0,
+ left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
+ top += body.offsetTop,
+ left += body.offsetLeft;
+
+ if ( prevComputedStyle.position === "fixed" )
+ top += Math.max(docElem.scrollTop, body.scrollTop),
+ left += Math.max(docElem.scrollLeft, body.scrollLeft);
+
+ return { top: top, left: left };
+ };
+
+jQuery.offset = {
+ initialize: function() {
+ if ( this.initialized ) return;
+ var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
+ html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
+
+ rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
+ for ( prop in rules ) container.style[prop] = rules[prop];
+
+ container.innerHTML = html;
+ body.insertBefore(container, body.firstChild);
+ innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ body.style.marginTop = '1px';
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
+ body.style.marginTop = bodyMarginTop;
+
+ body.removeChild(container);
+ this.initialized = true;
+ },
+
+ bodyOffset: function(body) {
+ jQuery.offset.initialized || jQuery.offset.initialize();
+ var top = body.offsetTop, left = body.offsetLeft;
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
+ top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0,
+ left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
+ return { top: top, left: left };
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ var left = 0, top = 0, results;
+
+ if ( this[0] ) {
+ // Get *real* offsetParent
+ var offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= num( this, 'marginTop' );
+ offset.left -= num( this, 'marginLeft' );
+
+ // Add offsetParent borders
+ parentOffset.top += num( offsetParent, 'borderTopWidth' );
+ parentOffset.left += num( offsetParent, 'borderLeftWidth' );
+
+ // Subtract the two offsets
+ results = {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ }
+
+ return results;
+ },
+
+ offsetParent: function() {
+ var offsetParent = this[0].offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
+ offsetParent = offsetParent.offsetParent;
+ return jQuery(offsetParent);
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ['Left', 'Top'], function(i, name) {
+ var method = 'scroll' + name;
+
+ jQuery.fn[ method ] = function(val) {
+ if (!this[0]) return null;
+
+ return val !== undefined ?
+
+ // Set the scroll offset
+ this.each(function() {
+ this == window || this == document ?
+ window.scrollTo(
+ !i ? val : jQuery(window).scrollLeft(),
+ i ? val : jQuery(window).scrollTop()
+ ) :
+ this[ method ] = val;
+ }) :
+
+ // Return the scroll offset
+ this[0] == window || this[0] == document ?
+ self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
+ jQuery.boxModel && document.documentElement[ method ] ||
+ document.body[ method ] :
+ this[0][ method ];
+ };
+});
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function(i, name){
+
+ var tl = i ? "Left" : "Top", // top or left
+ br = i ? "Right" : "Bottom", // bottom or right
+ lower = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function(){
+ return this[0] ?
+ jQuery.css( this[0], lower, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function(margin) {
+ return this[0] ?
+ jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ var type = name.toLowerCase();
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ return this[0] == window ?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
+ document.body[ "client" + name ] :
+
+ // Get document width or height
+ this[0] == document ?
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ document.documentElement["client" + name],
+ document.body["scroll" + name], document.documentElement["scroll" + name],
+ document.body["offset" + name], document.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ (this.length ? jQuery.css( this[0], type ) : null) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+})();
+
+/**
+ * Add a suitable MW-specific alias
+ */
+$j = jQuery.noConflict();
+
diff --git a/skins/common/jquery.min.js b/skins/common/jquery.min.js
new file mode 100644
index 00000000..d872c9f0
--- /dev/null
+++ b/skins/common/jquery.min.js
@@ -0,0 +1,433 @@
+
+(function(){var
+window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this;}
+if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])
+selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])
+return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret;}}else
+return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))
+return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context;}
+return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector));},selector:"",jquery:"1.3.2",size:function(){return this.length;},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num];},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find")
+ret.selector=this.selector+(this.selector?" ":"")+selector;else if(name)
+ret.selector=this.selector+"."+name+"("+selector+")";return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(typeof name==="string")
+if(value===undefined)
+return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}
+return this.each(function(i){for(name in options)
+jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)
+value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!=="object"&&text!=null)
+return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)
+ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode)
+wrap.insertBefore(this[0]);wrap.map(function(){var elem=this;while(elem.firstChild)
+elem=elem.firstChild;return elem;}).append(this);}
+return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
+this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
+this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},push:[].push,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret;}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem);})),"find",selector);}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}
+return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0];}else
+return this.cloneNode(true);});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName)
+return;var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}
+i++;});}
+return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1;})),"filter",selector);},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur;}
+cur=cur.parentNode;closer++;}});},not:function(selector){if(typeof selector==="string")
+if(isSimple.test(selector))
+return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector);else
+selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return!!selector&&this.is("."+selector);},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,'option'))
+return(elem.attributes.value||{}).specified?elem.value:elem.text;if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)
+return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)
+return value;values.push(value);}}
+return values;}
+return(elem.value||"").replace(/\r/g,"");}
+return undefined;}
+if(typeof value==="number")
+value+='';return this.each(function(){if(this.nodeType!=1)
+return;if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type))
+this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)
+this.selectedIndex=-1;}else
+this.value=value;});},html:function(value){return value===undefined?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,+i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild;if(first)
+for(var i=0,l=this.length;i<l;i++)
+callback.call(root(this[i],first),this.length>1||i>0?fragment.cloneNode(true):fragment);if(scripts)
+jQuery.each(scripts,evalScript);}
+return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)
+jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)
+elem.parentNode.removeChild(elem);}
+function now(){return+new Date;}
+jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
+if(typeof target!=="object"&&!jQuery.isFunction(target))
+target={};if(length==i){target=this;--i;}
+for(;i<length;i++)
+if((options=arguments[i])!=null)
+for(var name in options){var src=target[name],copy=options[name];if(target===copy)
+continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)
+target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)
+target[name]=copy;}
+return target;};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)
+window.jQuery=_jQuery;return jQuery;},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument);},globalEval:function(data){if(data&&/\S/.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval)
+script.appendChild(document.createTextNode(data));else
+script.text=data;head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object)
+if(callback.apply(object[name],args)===false)
+break;}else
+for(;i<length;)
+if(callback.apply(object[i++],args)===false)
+break;}else{if(length===undefined){for(name in object)
+if(callback.call(object[name],name,object[name])===false)
+break;}else
+for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}
+return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))
+value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))
+elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)
+elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
+callback.call(elem);for(var name in options)
+elem.style[name]=old[name];},css:function(elem,name,force,extra){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border")
+return;jQuery.each(which,function(){if(!extra)
+val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;if(extra==="margin")
+val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;else
+val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});}
+if(elem.offsetWidth!==0)
+getWH();else
+jQuery.swap(elem,props,getWH);return Math.max(0,Math.round(val));}
+return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}
+if(name.match(/float/i))
+name=styleFloat;if(!force&&style&&style[name])
+ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))
+name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();try{var computedStyle=defaultView.getComputedStyle(elem,null);}catch(e){}
+if(computedStyle)
+ret=computedStyle.getPropertyValue(name);if(name=="opacity"&&ret=="")
+ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
+return ret;},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")
+context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match)
+return[context.createElement(match[1])];}
+var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number")
+elem+='';if(!elem)
+return;if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)
+div=div.lastChild;if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)
+if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)
+tbody[j].parentNode.removeChild(tbody[j]);}
+if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))
+div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes);}
+if(elem.nodeType)
+ret.push(elem);else
+ret=jQuery.merge(ret,elem);});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1)
+ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i]);}}
+return scripts;}
+return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)
+return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)
+elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)
+throw"type property can't be changed";elem[name]=value;}
+if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))
+return elem.getAttributeNode(name).nodeValue;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined;}
+return elem[name];}
+if(!jQuery.support.style&&notxml&&name=="style")
+return jQuery.attr(elem.style,"cssText",value);if(set)
+elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
+if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+
+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}
+return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}
+name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set&&value!='NaNpx'&&value!='nullpx')
+elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)
+ret[0]=array;else
+while(i)
+ret[--i]=array[i];}
+return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)
+if(array[i]===elem)
+return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)
+if(elem.nodeType!=8)
+first[pos++]=elem;}else
+while((elem=second[i++])!=null)
+first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}
+return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)
+if(!inv!=!callback(elems[i],i))
+ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)
+ret[ret.length]=value;}
+return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")
+ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
+return this.pushStack(ret,name,selector);};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)
+this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames,state){if(typeof state!=="boolean")
+state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)
+this.parentNode.removeChild(this);}},empty:function(){jQuery(this).children().remove();while(this.firstChild)
+this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}
+var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)
+id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])
+jQuery.cache[id]={};if(data!==undefined)
+jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])
+break;if(!name)
+jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)
+elem.removeAttribute(expando);}
+delete jQuery.cache[id];}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))
+q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)
+q.push(data);}
+return q;},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")
+fn=queue[0];if(fn!==undefined)
+fn.call(elem);}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)
+data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
+return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
+if(data===undefined)
+return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)
+queue[0].call(this);});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)
+return[];if(!selector||typeof selector!=="string"){return results;}
+var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
+if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
+selector+=parts.shift();set=posProcess(selector,set);}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
+while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
+if(pop==null){pop=context;}
+Expr.relative[cur](checkSet,pop,isXML(context));}}
+if(!checkSet){checkSet=set;}
+if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
+if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
+if(extra){Sizzle(extra,context,results,seed);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}}
+return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
+for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
+if(!set){set=context.getElementsByTagName("*");}
+return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
+if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
+if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
+if(found!==undefined){if(!inplace){curLoop=result;}
+expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
+break;}}}
+if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
+old=expr;}
+return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
+for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
+checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
+if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
+if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
+checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
+checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
+return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
+for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)
+result.push(elem);}else if(inplace){curLoop[i]=false;}}}
+return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
+return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
+match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
+if(match[2]==="~="){match[4]=" "+match[4]+" ";}
+return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
+return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
+return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
+return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false;}
+if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false;}
+return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
+var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
+parent.sizcache=doneName;}
+var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
+var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
+return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
+return ret;};}
+var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
+return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
+return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
+return ret;};}
+(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
+root.removeChild(form);})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
+results=tmp;}
+return results;};}
+div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
+Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
+return oldSizzle(query,context,extra,seed);};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
+return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
+return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
+elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
+if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
+if(elem.nodeName===cur){match=elem;break;}
+elem=elem[dir];}
+checkSet[i]=match;}}}
+function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
+elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
+if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
+if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
+elem=elem[dir];}
+checkSet[i]=match;}}}
+var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument);};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
+selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
+return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0;};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0;};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")";}
+return Sizzle.matches(expr,elems);};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)
+matched.push(cur);cur=cur[dir];}
+return matched;};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])
+if(cur.nodeType==1&&++num==result)
+break;return cur;};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)
+r.push(n);}
+return r;};return;window.Sizzle=Sizzle;})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)
+return;if(elem.setInterval&&elem!=window)
+elem=window;if(!handler.guid)
+handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data;}
+var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])
+jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener)
+elem.addEventListener(type,handle,false);else if(elem.attachEvent)
+elem.attachEvent("on"+type,handle);}}
+handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)
+return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)=="."))
+for(var type in events)
+this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}
+jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)
+delete events[type][handler.guid];else
+for(var handle in events[type])
+if(namespace.test(events[type][handle].type))
+delete events[type][handle];if(jQuery.event.specialAll[type])
+jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener)
+elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)
+elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}
+ret=null;delete events[type];}}});}
+for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
+if(!elem){event.stopPropagation();if(this.global[type])
+jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])
+jQuery.event.trigger(event,data,this.handle.elem);});}
+if(!elem||elem.nodeType==3||elem.nodeType==8)
+return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
+event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)
+handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)
+event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}
+this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)
+jQuery.event.trigger(event,data,parent,true);}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
+if(event.isImmediatePropagationStopped())
+break;}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando])
+return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
+if(!event.target)
+event.target=event.srcElement||document;if(event.target.nodeType==3)
+event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)
+event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}
+if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))
+event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)
+event.metaKey=event.ctrlKey;if(!event.which&&event.button)
+event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))
+remove++;});if(remove<1)
+jQuery.event.remove(this,namespaces[0],liveHandler);}}}}};jQuery.Event=function(src){if(!this.preventDefault)
+return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type;}else
+this.type=src;this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
+function returnTrue(){return true;}
+jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)
+return;if(e.preventDefault)
+e.preventDefault();e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)
+return;if(e.stopPropagation)
+e.stopPropagation();e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)
+try{parent=parent.parentNode;}
+catch(e){parent=this;}
+if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix);},teardown:function(){jQuery.event.remove(this,orig,withinElement);}};});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)
+jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)
+fn.call(document,jQuery);else
+jQuery.readyList.push(fn);return this;},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this;},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this;}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)
+elems.push({elem:elem,fn:fn});}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest");});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
+return(stop=false);});return stop;}
+function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".");}
+jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery);});jQuery.readyList=null;}
+jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready();}});if(document.documentElement.doScroll&&window==window.top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
+jQuery.ready();})();}
+jQuery.event.add(window,"load",jQuery.ready);}
+jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)
+if(id!=1&&jQuery.cache[id].handle)
+jQuery.event.remove(jQuery.cache[id].handle.elem);});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
+jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
+root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
+root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee);});div.cloneNode(true).fireEvent("onclick");}
+jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';});})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")
+return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
+var type="GET";if(params)
+if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params);type="POST";}
+var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")
+self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)
+self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}
+return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}
+return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string")
+s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))
+s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))
+s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}
+if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)
+s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}
+if(head)
+head.removeChild(script);};}
+if(s.dataType=="script"&&s.cache==null)
+s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}
+if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}
+if(s.global&&!jQuery.active++)
+jQuery.event.trigger("ajaxStart");var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)
+script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;head.removeChild(script);}};}
+head.appendChild(script);return undefined;}
+var requestDone=false;var xhr=s.xhr();if(s.username)
+xhr.open(type,s.url,s.async,s.username,s.password);else
+xhr.open(type,s.url,s.async);try{if(s.data)
+xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)
+xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}
+if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active)
+jQuery.event.trigger("ajaxStop");xhr.abort();return false;}
+if(s.global)
+jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)
+jQuery.event.trigger("ajaxStop");}}else if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}
+status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(e){status="parsererror";}}
+if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}
+if(s.ifModified&&modRes)
+jQuery.lastModified[s.url]=modRes;if(!jsonp)
+success();}else
+jQuery.handleError(s,xhr,status);complete();if(isTimeout)
+xhr.abort();if(s.async)
+xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)
+setTimeout(function(){if(xhr&&!requestDone)
+onreadystatechange("timeout");},s.timeout);}
+try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}
+if(!s.async)
+onreadystatechange();function success(){if(s.success)
+s.success(data,status);if(s.global)
+jQuery.event.trigger("ajaxSuccess",[xhr,s]);}
+function complete(){if(s.complete)
+s.complete(xhr,status);if(s.global)
+jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)
+jQuery.event.trigger("ajaxStop");}
+return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)
+jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223;}catch(e){}
+return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url];}catch(e){}
+return false;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")
+throw"parsererror";if(s&&s.dataFilter)
+data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")
+jQuery.globalEval(data);if(type=="json")
+data=window["eval"]("("+data+")");}
+return data;},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value);};if(jQuery.isArray(a)||a.jquery)
+jQuery.each(a,function(){add(this.name,this.value);});else
+for(var j in a)
+if(jQuery.isArray(a[j]))
+jQuery.each(a[j],function(){add(j,this);});else
+add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+");}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
+jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName];}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")
+display="block";elem.remove();elemdisplay[tagName]=display;}
+jQuery.data(this[i],"olddisplay",display);}}
+for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||"";}
+return this;}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")
+jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}
+for(var i=0,l=this.length;i<l;i++){this[i].style.display="none";}
+return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();}):this.animate(genFx("toggle",3),fn,fn2);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)
+return opt.complete.call(this);if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}
+if(opt.overflow!=null)
+this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))
+e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}
+if(parts[1])
+end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)
+this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)
+if(timers[i].elem==this){if(gotoEnd)
+timers[i](true);timers.splice(i,1);}});if(!gotoEnd)
+this.dequeue();return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)
+jQuery(this).dequeue();if(jQuery.isFunction(opt.old))
+opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)
+options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)
+this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)
+this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))
+return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
+t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)
+if(!timers[i]())
+timers.splice(i--,1);if(!timers.length){clearInterval(timerId);timerId=undefined;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)
+if(this.options.curAnim[i]!==true)
+done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")
+this.elem.style.display="block";}
+if(this.options.hide)
+jQuery(this.elem).hide();if(this.options.hide||this.options.show)
+for(var p in this.options.curAnim)
+jQuery.attr(this.elem.style,p,this.options.orig[p]);this.options.complete.call(this.elem);}
+return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}
+return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)
+fx.elem.style[fx.prop]=fx.now+fx.unit;else
+fx.elem[fx.prop]=fx.now;}}});if(document.documentElement["getBoundingClientRect"])
+jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};else
+jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
+top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
+if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
+top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
+if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
+top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
+top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left};};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true;},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)
+top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left};}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
+return results;},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))
+offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return null;return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null;};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");};});})();$j=jQuery.noConflict(); \ No newline at end of file
diff --git a/skins/common/metadata.js b/skins/common/metadata.js
index a73b6937..86fc6bd4 100644
--- a/skins/common/metadata.js
+++ b/skins/common/metadata.js
@@ -3,42 +3,42 @@
// 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...");
+// attachMetadataToggle('mw_metadata', 'More...', 'Fewer...');
-
-function attachMetadataToggle(tableId, showText, hideText) {
- if (document.createTextNode) {
- var box = document.getElementById(tableId);
- if (!box)
+function attachMetadataToggle( 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 row = document.createElement( 'tr' );
- var col = document.createElement('td');
+ var col = document.createElement( 'td' );
col.colSpan = 2;
- var link = document.createElement('a');
+ var link = document.createElement( 'a' );
link.href = '#';
link.onclick = function() {
- if (box.className == 'mw_metadata collapsed') {
- changeText(link, hideText);
+ if ( box.className == 'mw_metadata collapsed' ) {
+ changeText( link, hideText );
box.className = 'mw_metadata expanded';
} else {
- changeText(link, showText);
+ changeText( link, showText );
box.className = 'mw_metadata collapsed';
}
return false;
- }
+ };
- var text = document.createTextNode(hideText);
+ var text = document.createTextNode( hideText );
- link.appendChild(text);
- col.appendChild(link);
- row.appendChild(col);
- tbody.appendChild(row);
+ link.appendChild( text );
+ col.appendChild( link );
+ row.appendChild( col );
+ tbody.appendChild( row );
// And collapse!
link.onclick();
diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js
index 061a6451..8f638c47 100644
--- a/skins/common/mwsuggest.js
+++ b/skins/common/mwsuggest.js
@@ -13,7 +13,6 @@ var os_map = {};
var os_cache = {};
// global variables for suggest_keypress
var os_cur_keypressed = 0;
-var os_last_keypress = 0;
var os_keypressed_count = 0;
// type: Timer
var os_timer = null;
@@ -41,34 +40,33 @@ var os_animation_delay = 30;
var os_container_max_width = 2;
// currently active animation timer
var os_animation_timer = null;
+/**
+ * <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.
+ */
+// var os_use_datalist = 'list' in document.createElement( 'input' );
+var os_use_datalist = false;
/** Timeout timer class that will fetch the results */
-function os_Timer(id,r,query){
+function os_Timer( id, r, query ) {
this.id = id;
this.r = r;
this.query = query;
}
-/** Timer user to animate expansion/contraction of container width */
-function os_AnimationTimer(r, target){
- this.r = r;
- var current = document.getElementById(r.container).offsetWidth;
- this.inc = Math.round((target-current) / os_animation_steps);
- if(this.inc < os_animation_min_step && this.inc >=0)
- this.inc = os_animation_min_step; // minimal animation step
- if(this.inc > -os_animation_min_step && this.inc <0)
- this.inc = -os_animation_min_step;
- this.target = target;
-}
-
/** Property class for single search box */
-function os_Results(name, formname){
+function os_Results( name, formname ) {
this.searchform = formname; // id of the searchform
this.searchbox = name; // id of the searchbox
- this.container = name+"Suggest"; // div that holds results
- this.resultTable = name+"Result"; // id base for the result table (+num = table row)
- this.resultText = name+"ResultText"; // id base for the spans within result tables (+num)
- this.toggle = name+"Toggle"; // div that has the toggle (enable/disable) link
+ this.container = name + 'Suggest'; // div that holds results
+ this.resultTable = name + 'Result'; // id base for the result table (+num = table row)
+ this.resultText = name + 'ResultText'; // id base for the spans within result tables (+num)
+ this.toggle = name + 'Toggle'; // div that has the toggle (enable/disable) link
this.query = null; // last processed query
this.results = null; // parsed titles
this.resultCount = 0; // number of results
@@ -78,774 +76,920 @@ function os_Results(name, formname){
this.containerRow = 0; // height of result field in the container
this.containerTotal = 0; // total height of the container will all results
this.visible = false; // if container is visible
+ this.stayHidden = false; // don't try to show if lost focus
+}
+
+/** Timer user to animate expansion/contraction of container width */
+function os_AnimationTimer( r, target ) {
+ this.r = r;
+ var current = document.getElementById(r.container).offsetWidth;
+ this.inc = Math.round( ( target - current ) / os_animation_steps );
+ if( this.inc < os_animation_min_step && this.inc >=0 ) {
+ this.inc = os_animation_min_step; // minimal animation step
+ }
+ if( this.inc > -os_animation_min_step && this.inc < 0 ) {
+ this.inc = -os_animation_min_step;
+ }
+ this.target = target;
+}
+
+/******************
+ * Initialization
+ ******************/
+
+/** Initialization, call upon page onload */
+function os_MWSuggestInit() {
+ for( i = 0; i < os_autoload_inputs.length; i++ ) {
+ var id = os_autoload_inputs[i];
+ var form = os_autoload_forms[i];
+ element = document.getElementById( id );
+ if( element != null ) {
+ os_initHandlers( id, form, element );
+ }
+ }
+}
+
+/** Init Result objects and event handlers */
+function os_initHandlers( name, formname, element ) {
+ var r = new os_Results( name, formname );
+ // event handler
+ os_hookEvent( element, 'keyup', function( event ) { os_eventKeyup( event ); } );
+ os_hookEvent( element, 'keydown', function( event ) { os_eventKeydown( event ); } );
+ os_hookEvent( element, 'keypress', function( event ) { os_eventKeypress( event ); } );
+ if ( !os_use_datalist ) {
+ // These are needed for the div hack to hide it if the user blurs.
+ os_hookEvent( element, 'blur', function( event ) { os_eventBlur( event ); } );
+ os_hookEvent( element, 'focus', function( event ) { os_eventFocus( event ); } );
+ // We don't want browser auto-suggestions interfering with our div, but
+ // autocomplete must be on for datalist to work (at least in Opera
+ // 10.10).
+ element.setAttribute( 'autocomplete', 'off' );
+ }
+ // stopping handler
+ os_hookEvent( document.getElementById( formname ), 'submit', function( event ) { return os_eventOnsubmit( event ); } );
+ os_map[name] = r;
+ // toggle link
+ if( document.getElementById( r.toggle ) == null ) {
+ // TODO: disable this while we figure out a way for this to work in all browsers
+ /* if( name == 'searchInput' ) {
+ // special case: place above the main search box
+ var t = os_createToggle( r, 'os-suggest-toggle' );
+ var searchBody = document.getElementById( 'searchBody' );
+ var first = searchBody.parentNode.firstChild.nextSibling.appendChild(t);
+ } else {
+ // default: place below search box to the right
+ var t = os_createToggle( r, 'os-suggest-toggle-def' );
+ var top = element.offsetTop + element.offsetHeight;
+ var left = element.offsetLeft + element.offsetWidth;
+ t.style.position = 'absolute';
+ t.style.top = top + 'px';
+ t.style.left = left + 'px';
+ element.parentNode.appendChild( t );
+ // only now width gets calculated, shift right
+ left -= t.offsetWidth;
+ t.style.left = left + 'px';
+ t.style.visibility = 'visible';
+ } */
+ }
+
+}
+
+function os_hookEvent( element, hookName, hookFunct ) {
+ if ( element.addEventListener ) {
+ element.addEventListener( hookName, hookFunct, false );
+ } else if ( window.attachEvent ) {
+ element.attachEvent( 'on' + hookName, hookFunct );
+ }
+}
+
+/********************
+ * Keyboard events
+ ********************/
+
+/** Event handler that will fetch results on keyup */
+function os_eventKeyup( e ) {
+ var targ = os_getTarget( e );
+ var r = os_map[targ.id];
+ if( r == null ) {
+ return; // not our event
+ }
+
+ // some browsers won't generate keypressed for arrow keys, catch it
+ if( os_keypressed_count == 0 ) {
+ os_processKey( r, os_cur_keypressed, targ );
+ }
+ var query = targ.value;
+ os_fetchResults( r, query, os_search_timeout );
+}
+
+/** catch arrows up/down and escape to hide the suggestions */
+function os_processKey( r, keypressed, targ ) {
+ if ( keypressed == 40 && !r.visible && os_timer == null ) {
+ // If the user hits the down arrow, fetch results immediately if none
+ // are already displayed.
+ r.query = '';
+ os_fetchResults( r, targ.value, 0 );
+ }
+ // Otherwise, if we're not using datalist, we need to handle scrolling and
+ // so on.
+ if ( os_use_datalist ) {
+ return;
+ }
+ if ( keypressed == 40 ) { // Arrow Down
+ if ( r.visible ) {
+ os_changeHighlight( r, r.selected, r.selected + 1, true );
+ }
+ } else if ( keypressed == 38 ) { // Arrow Up
+ if ( r.visible ) {
+ os_changeHighlight( r, r.selected, r.selected - 1, true );
+ }
+ } else if( keypressed == 27 ) { // Escape
+ document.getElementById( r.searchbox ).value = r.original;
+ r.query = r.original;
+ os_hideResults( r );
+ } else if( r.query != document.getElementById( r.searchbox ).value ) {
+ // os_hideResults( r ); // don't show old suggestions
+ }
}
-/** Hide results div */
-function os_hideResults(r){
- var c = document.getElementById(r.container);
- if(c != null)
- c.style.visibility = "hidden";
+/** When keys is held down use a timer to output regular events */
+function os_eventKeypress( e ) {
+ var targ = os_getTarget( e );
+ var r = os_map[targ.id];
+ if( r == null ) {
+ return; // not our event
+ }
+
+ var keypressed = os_cur_keypressed;
+
+ os_keypressed_count++;
+ os_processKey( r, keypressed, targ );
+}
+
+/** Catch the key code (Firefox bug) */
+function os_eventKeydown( e ) {
+ if ( !e ) {
+ e = window.event;
+ }
+ var targ = os_getTarget( e );
+ var r = os_map[targ.id];
+ if( r == null ) {
+ return; // not our event
+ }
+
+ os_mouse_moved = false;
+
+ os_cur_keypressed = ( e.keyCode == undefined ) ? e.which : e.keyCode;
+ os_keypressed_count = 0;
+}
+
+
+/** When the form is submitted hide everything, cancel updates... */
+function os_eventOnsubmit( e ) {
+ var targ = os_getTarget( e );
+
+ os_is_stopped = true;
+ // kill timed requests
+ if( os_timer != null && os_timer.id != null ) {
+ clearTimeout( os_timer.id );
+ os_timer = null;
+ }
+ // Hide all suggestions
+ for( i = 0; i < os_autoload_inputs.length; i++ ) {
+ var r = os_map[os_autoload_inputs[i]];
+ if( r != null ) {
+ var b = document.getElementById( r.searchform );
+ if( b != null && b == targ ) {
+ // set query value so the handler won't try to fetch additional results
+ r.query = document.getElementById( r.searchbox ).value;
+ }
+ os_hideResults( r );
+ }
+ }
+ return true;
+}
+
+
+
+/** Hide results from the user, either making the div visibility=hidden or
+ * detaching the datalist from the input. */
+function os_hideResults( r ) {
+ if ( os_use_datalist ) {
+ document.getElementById( r.searchbox ).setAttribute( 'list', '' );
+ } else {
+ var c = document.getElementById( r.container );
+ if ( c != null ) {
+ c.style.visibility = 'hidden';
+ }
+ }
r.visible = false;
r.selected = -1;
}
+function os_decodeValue( value ) {
+ if ( decodeURIComponent ) {
+ return decodeURIComponent( value );
+ }
+ if( unescape ) {
+ return unescape( value );
+ }
+ return null;
+}
+
+function os_encodeQuery( value ) {
+ if ( encodeURIComponent ) {
+ return encodeURIComponent( value );
+ }
+ if( escape ) {
+ return escape( value );
+ }
+ return null;
+}
+
+/** Handles data from XMLHttpRequest, and updates the suggest results */
+function os_updateResults( r, query, text, cacheKey ) {
+ os_cache[cacheKey] = text;
+ r.query = query;
+ r.original = query;
+ if( text == '' ) {
+ r.results = null;
+ r.resultCount = 0;
+ os_hideResults( r );
+ } else {
+ try {
+ var p = eval( '(' + text + ')' ); // simple json parse, could do a safer one
+ if( p.length < 2 || p[1].length == 0 ) {
+ r.results = null;
+ r.resultCount = 0;
+ os_hideResults( r );
+ return;
+ }
+ if ( os_use_datalist ) {
+ os_setupDatalist( r, p[1] );
+ } else {
+ os_setupDiv( r, p[1] );
+ }
+ } catch( e ) {
+ // bad response from server or such
+ os_hideResults( r );
+ os_cache[cacheKey] = null;
+ }
+ }
+}
+
+/**
+ * Create and populate a <datalist>.
+ *
+ * @param r os_Result object
+ * @param results Array of the new results to replace existing ones
+ */
+function os_setupDatalist( r, results ) {
+ var s = document.getElementById( r.searchbox );
+ var c = document.getElementById( r.container );
+ if ( c == null ) {
+ c = document.createElement( 'datalist' );
+ c.setAttribute( 'id', r.container );
+ document.body.appendChild( c );
+ } else {
+ c.innerHTML = '';
+ }
+ s.setAttribute( 'list', r.container );
+
+ r.results = new Array();
+ r.resultCount = results.length;
+ r.visible = true;
+ for ( i = 0; i < results.length; i++ ) {
+ var title = os_decodeValue( results[i] );
+ var opt = document.createElement( 'option' );
+ opt.value = title;
+ r.results[i] = title;
+ c.appendChild( opt );
+ }
+}
+
+/** Fetch namespaces from checkboxes or hidden fields in the search form,
+ if none defined use wgSearchNamespaces global */
+function os_getNamespaces( r ) {
+ var namespaces = '';
+ var elements = document.forms[r.searchform].elements;
+ for( i = 0; i < elements.length; i++ ) {
+ var name = elements[i].name;
+ if( typeof name != 'undefined' && name.length > 2 && name[0] == 'n' &&
+ name[1] == 's' && (
+ ( elements[i].type == 'checkbox' && elements[i].checked ) ||
+ ( elements[i].type == 'hidden' && elements[i].value == '1' )
+ )
+ ) {
+ if( namespaces != '' ) {
+ namespaces += '|';
+ }
+ namespaces += name.substring( 2 );
+ }
+ }
+ if( namespaces == '' ) {
+ namespaces = wgSearchNamespaces.join('|');
+ }
+ return namespaces;
+}
+
+/** Update results if user hasn't already typed something else */
+function os_updateIfRelevant( r, query, text, cacheKey ) {
+ var t = document.getElementById( r.searchbox );
+ if( t != null && t.value == query ) { // check if response is still relevant
+ os_updateResults( r, query, text, cacheKey );
+ }
+ r.query = query;
+}
+
+/** Fetch results after some timeout */
+function os_delayedFetch() {
+ if( os_timer == null ) {
+ return;
+ }
+ var r = os_timer.r;
+ var query = os_timer.query;
+ os_timer = null;
+ var path = wgMWSuggestTemplate.replace( "{namespaces}", os_getNamespaces( r ) )
+ .replace( "{dbname}", wgDBname )
+ .replace( "{searchTerms}", os_encodeQuery( query ) );
+
+ // try to get from cache, if not fetch using ajax
+ var cached = os_cache[path];
+ if( cached != null && cached != undefined ) {
+ os_updateIfRelevant( r, query, cached, path );
+ } else {
+ var xmlhttp = sajax_init_object();
+ if( xmlhttp ) {
+ try {
+ xmlhttp.open( 'GET', path, true );
+ xmlhttp.onreadystatechange = function() {
+ if ( xmlhttp.readyState == 4 && typeof os_updateIfRelevant == 'function' ) {
+ os_updateIfRelevant( r, query, xmlhttp.responseText, path );
+ }
+ };
+ xmlhttp.send( null );
+ } catch ( e ) {
+ if ( window.location.hostname == 'localhost' ) {
+ alert( "Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing." );
+ }
+ throw e;
+ }
+ }
+ }
+}
+
+/** Init timed update via os_delayedUpdate() */
+function os_fetchResults( r, query, timeout ) {
+ if( query == '' ) {
+ r.query = '';
+ os_hideResults( r );
+ return;
+ } else if( query == r.query ) {
+ return; // no change
+ }
+
+ os_is_stopped = false; // make sure we're running
+
+ // cancel any pending fetches
+ if( os_timer != null && os_timer.id != null ) {
+ clearTimeout( os_timer.id );
+ }
+ // schedule delayed fetching of results
+ if( timeout != 0 ) {
+ os_timer = new os_Timer( setTimeout( "os_delayedFetch()", timeout ), r, query );
+ } else {
+ os_timer = new os_Timer( null, r, query );
+ os_delayedFetch(); // do it now!
+ }
+}
+
+/** Find event target */
+function os_getTarget( e ) {
+ if ( !e ) {
+ e = window.event;
+ }
+ if ( e.target ) {
+ return e.target;
+ } else if ( e.srcElement ) {
+ return e.srcElement;
+ } else {
+ return null;
+ }
+}
+
+/** Check if x is a valid integer */
+function os_isNumber( x ) {
+ if( x == '' || isNaN( x ) ) {
+ return false;
+ }
+ for( var i = 0; i < x.length; i++ ) {
+ var c = x.charAt( i );
+ if( !( c >= '0' && c <= '9' ) ) {
+ return false;
+ }
+ }
+ return true;
+}
+
+/** Call this to enable suggestions on input (id=inputId), on a form (name=formName) */
+function os_enableSuggestionsOn( inputId, formName ) {
+ os_initHandlers( inputId, formName, document.getElementById( inputId ) );
+}
+
+/** Call this to disable suggestios on input box (id=inputId) */
+function os_disableSuggestionsOn( inputId ) {
+ r = os_map[inputId];
+ if( r != null ) {
+ // cancel/hide results
+ os_timer = null;
+ os_hideResults( r );
+ // turn autocomplete on !
+ document.getElementById( inputId ).setAttribute( 'autocomplete', 'on' );
+ // remove descriptor
+ os_map[inputId] = null;
+ }
+
+ // Remove the element from the os_autoload_* arrays
+ var index = os_autoload_inputs.indexOf( inputId );
+ if ( index >= 0 ) {
+ os_autoload_inputs[index] = os_autoload_forms[index] = '';
+ }
+}
+
+/************************************************
+ * Div-only functions (irrelevant for datalist)
+ ************************************************/
+
+/** Event: loss of focus of input box */
+function os_eventBlur( e ) {
+ var targ = os_getTarget( e );
+ var r = os_map[targ.id];
+ if( r == null ) {
+ return; // not our event
+ }
+ if( !os_mouse_pressed ) {
+ os_hideResults( r );
+ // force canvas to stay hidden
+ r.stayHidden = true;
+ // cancel any pending fetches
+ if( os_timer != null && os_timer.id != null ) {
+ clearTimeout( os_timer.id );
+ }
+ os_timer = null;
+ }
+}
+
+/** Event: focus (catch only when stopped) */
+function os_eventFocus( e ) {
+ var targ = os_getTarget( e );
+ var r = os_map[targ.id];
+ if( r == null ) {
+ return; // not our event
+ }
+ r.stayHidden = false;
+}
+
+/**
+ * Create and populate a <div>, for non-<datalist>-supporting browsers.
+ *
+ * @param r os_Result object
+ * @param results Array of the new results to replace existing ones
+ */
+function os_setupDiv( r, results ) {
+ var c = document.getElementById( r.container );
+ if ( c == null ) {
+ c = os_createContainer( r );
+ }
+ c.innerHTML = os_createResultTable( r, results );
+ // init container table sizes
+ var t = document.getElementById( r.resultTable );
+ r.containerTotal = t.offsetHeight;
+ r.containerRow = t.offsetHeight / r.resultCount;
+ os_fitContainer( r );
+ os_trimResultText( r );
+ os_showResults( r );
+}
+
+/** Create the result table to be placed in the container div */
+function os_createResultTable( r, results ) {
+ var c = document.getElementById( r.container );
+ var width = c.offsetWidth - os_operaWidthFix( c.offsetWidth );
+ var html = '<table class="os-suggest-results" id="' + r.resultTable + '" style="width: ' + width + 'px;">';
+ r.results = new Array();
+ r.resultCount = results.length;
+ for( i = 0; i < results.length; i++ ) {
+ var title = os_decodeValue( results[i] );
+ r.results[i] = title;
+ html += '<tr><td class="os-suggest-result" id="' + r.resultTable + i + '"><span id="' + r.resultText + i + '">' + title + '</span></td></tr>';
+ }
+ html += '</table>';
+ return html;
+}
+
/** Show results div */
-function os_showResults(r){
- if(os_is_stopped)
+function os_showResults( r ) {
+ if( os_is_stopped ) {
+ return;
+ }
+ if( r.stayHidden ) {
return;
- os_fitContainer(r);
- var c = document.getElementById(r.container);
+ }
+ os_fitContainer( r );
+ var c = document.getElementById( r.container );
r.selected = -1;
- if(c != null){
+ if( c != null ) {
c.scrollTop = 0;
- c.style.visibility = "visible";
+ c.style.visibility = 'visible';
r.visible = true;
}
}
-function os_operaWidthFix(x){
- // TODO: better css2 incompatibility detection here
- if(is_opera || is_khtml || navigator.userAgent.toLowerCase().indexOf('firefox/1')!=-1){
- return 30; // opera&konqueror & old firefox don't understand overflow-x, estimate scrollbar width
+function os_operaWidthFix( x ) {
+ // For browsers that don't understand overflow-x, estimate scrollbar width
+ if( typeof document.body.style.overflowX != 'string' ) {
+ return 30;
}
return 0;
}
-function os_encodeQuery(value){
- if (encodeURIComponent) {
- return encodeURIComponent(value);
- }
- if(escape) {
- return escape(value);
- }
- return null;
-}
-function os_decodeValue(value){
- if (decodeURIComponent) {
- return decodeURIComponent(value);
- }
- if(unescape){
- return unescape(value);
- }
- return null;
-}
-
/** Brower-dependent functions to find window inner size, and scroll status */
function f_clientWidth() {
- return f_filterResults (
+ return f_filterResults(
window.innerWidth ? window.innerWidth : 0,
document.documentElement ? document.documentElement.clientWidth : 0,
document.body ? document.body.clientWidth : 0
);
}
+
function f_clientHeight() {
- return f_filterResults (
+ return f_filterResults(
window.innerHeight ? window.innerHeight : 0,
document.documentElement ? document.documentElement.clientHeight : 0,
document.body ? document.body.clientHeight : 0
);
}
+
function f_scrollLeft() {
- return f_filterResults (
+ return f_filterResults(
window.pageXOffset ? window.pageXOffset : 0,
document.documentElement ? document.documentElement.scrollLeft : 0,
document.body ? document.body.scrollLeft : 0
);
}
+
function f_scrollTop() {
- return f_filterResults (
+ return f_filterResults(
window.pageYOffset ? window.pageYOffset : 0,
document.documentElement ? document.documentElement.scrollTop : 0,
document.body ? document.body.scrollTop : 0
);
}
-function f_filterResults(n_win, n_docel, n_body) {
+
+function f_filterResults( n_win, n_docel, n_body ) {
var n_result = n_win ? n_win : 0;
- if (n_docel && (!n_result || (n_result > n_docel)))
+ if ( n_docel && ( !n_result || ( n_result > n_docel ) ) ) {
n_result = n_docel;
- return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
+ }
+ return n_body && ( !n_result || ( n_result > n_body ) ) ? n_body : n_result;
}
/** Get the height available for the results container */
-function os_availableHeight(r){
- var absTop = document.getElementById(r.container).style.top;
- var px = absTop.lastIndexOf("px");
- if(px > 0)
- absTop = absTop.substring(0,px);
- return f_clientHeight() - (absTop - f_scrollTop());
+function os_availableHeight( r ) {
+ var absTop = document.getElementById( r.container ).style.top;
+ var px = absTop.lastIndexOf( 'px' );
+ if( px > 0 ) {
+ absTop = absTop.substring( 0, px );
+ }
+ return f_clientHeight() - ( absTop - f_scrollTop() );
}
-
/** Get element absolute position {left,top} */
-function os_getElementPosition(elemID){
- var offsetTrail = document.getElementById(elemID);
+function os_getElementPosition( elemID ) {
+ var offsetTrail = document.getElementById( elemID );
var offsetLeft = 0;
var offsetTop = 0;
- while (offsetTrail){
+ while ( offsetTrail ) {
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
- if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
+ if ( navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined' ) {
offsetLeft += document.body.leftMargin;
offsetTop += document.body.topMargin;
}
- return {left:offsetLeft,top:offsetTop};
+ return { left:offsetLeft, top:offsetTop };
}
/** Create the container div that will hold the suggested titles */
-function os_createContainer(r){
- var c = document.createElement("div");
- var s = document.getElementById(r.searchbox);
- var pos = os_getElementPosition(r.searchbox);
+function os_createContainer( 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.className = 'os-suggest';
+ 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.style.top = top+"px";
- c.style.left = left+"px";
- c.style.width = s.offsetWidth+"px";
+ 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;
}
/** change container height to fit to screen */
-function os_fitContainer(r){
- var c = document.getElementById(r.container);
- var h = os_availableHeight(r) - 20;
+function os_fitContainer( r ) {
+ var c = document.getElementById( r.container );
+ var h = os_availableHeight( r ) - 20;
var inc = r.containerRow;
- h = parseInt(h/inc) * inc;
- if(h < (2 * inc) && r.resultCount > 1) // min: two results
+ h = parseInt( h / inc ) * inc;
+ if( h < ( 2 * inc ) && r.resultCount > 1 ) { // min: two results
h = 2 * inc;
- if((h/inc) > os_max_lines_per_suggest )
+ }
+ if( ( h / inc ) > os_max_lines_per_suggest ) {
h = inc * os_max_lines_per_suggest;
- if(h < r.containerTotal){
- c.style.height = h +"px";
- r.containerCount = parseInt(Math.round(h/inc));
- } else{
- c.style.height = r.containerTotal+"px";
+ }
+ if( h < r.containerTotal ) {
+ c.style.height = h + 'px';
+ r.containerCount = parseInt( Math.round( h / inc ) );
+ } else {
+ c.style.height = r.containerTotal + 'px';
r.containerCount = r.resultCount;
}
}
+
/** If some entries are longer than the box, replace text with "..." */
-function os_trimResultText(r){
+function os_trimResultText( r ) {
// find max width, first see if we could expand the container to fit it
var maxW = 0;
- for(var i=0;i<r.resultCount;i++){
- var e = document.getElementById(r.resultText+i);
- if(e.offsetWidth > maxW)
+ for( var i = 0; i < r.resultCount; i++ ) {
+ var e = document.getElementById( r.resultText + i );
+ if( e.offsetWidth > maxW ) {
maxW = e.offsetWidth;
+ }
}
- var w = document.getElementById(r.container).offsetWidth;
+ var w = document.getElementById( r.container ).offsetWidth;
var fix = 0;
- if(r.containerCount < r.resultCount){
+ if( r.containerCount < r.resultCount ) {
fix = 20; // give 20px for scrollbar
- } else
- fix = os_operaWidthFix(w);
- if(fix < 4)
+ } else {
+ fix = os_operaWidthFix( w );
+ }
+ if( fix < 4 ) {
fix = 4; // basic padding
+ }
maxW += fix;
// resize container to fit more data if permitted
- var normW = document.getElementById(r.searchbox).offsetWidth;
+ var normW = document.getElementById( r.searchbox ).offsetWidth;
var prop = maxW / normW;
- if(prop > os_container_max_width)
+ if( prop > os_container_max_width ) {
prop = os_container_max_width;
- else if(prop < 1)
+ } else if( prop < 1 ) {
prop = 1;
+ }
var newW = Math.round( normW * prop );
- if( w != newW ){
+ if( w != newW ) {
w = newW;
- if( os_animation_timer != null )
- clearInterval(os_animation_timer.id)
- os_animation_timer = new os_AnimationTimer(r,w);
- os_animation_timer.id = setInterval("os_animateChangeWidth()",os_animation_delay);
+ if( os_animation_timer != null ) {
+ clearInterval( os_animation_timer.id );
+ }
+ os_animation_timer = new os_AnimationTimer( r, w );
+ os_animation_timer.id = setInterval( "os_animateChangeWidth()", os_animation_delay );
w -= fix; // this much is reserved
}
// trim results
- if(w < 10)
+ if( w < 10 ) {
return;
- for(var i=0;i<r.resultCount;i++){
- var e = document.getElementById(r.resultText+i);
+ }
+ for( var i = 0; i < r.resultCount; i++ ) {
+ var e = document.getElementById( r.resultText + i );
var replace = 1;
- var lastW = e.offsetWidth+1;
+ var lastW = e.offsetWidth + 1;
var iteration = 0;
var changedText = false;
- while(e.offsetWidth > w && (e.offsetWidth < lastW || iteration<2)){
+ while( e.offsetWidth > w && ( e.offsetWidth < lastW || iteration < 2 ) ) {
changedText = true;
lastW = e.offsetWidth;
var l = e.innerHTML;
- e.innerHTML = l.substring(0,l.length-replace)+"...";
+ e.innerHTML = l.substring( 0, l.length - replace ) + '...';
iteration++;
replace = 4; // how many chars to replace
}
- if(changedText){
+ if( changedText ) {
// show hint for trimmed titles
- document.getElementById(r.resultTable+i).setAttribute("title",r.results[i]);
+ document.getElementById( r.resultTable + i ).setAttribute( 'title', r.results[i] );
}
}
}
/** Invoked on timer to animate change in container width */
-function os_animateChangeWidth(){
+function os_animateChangeWidth() {
var r = os_animation_timer.r;
- var c = document.getElementById(r.container);
+ var c = document.getElementById( r.container );
var w = c.offsetWidth;
- var normW = document.getElementById(r.searchbox).offsetWidth;
- var normL = os_getElementPosition(r.searchbox).left;
+ var normW = document.getElementById( r.searchbox ).offsetWidth;
+ var normL = os_getElementPosition( r.searchbox ).left;
var inc = os_animation_timer.inc;
var target = os_animation_timer.target;
var nw = w + inc;
- if( (inc > 0 && nw >= target) || (inc <= 0 && nw <= target) ){
+ if( ( inc > 0 && nw >= target ) || ( inc <= 0 && nw <= target ) ) {
// finished !
- c.style.width = target+"px";
- clearInterval(os_animation_timer.id)
+ c.style.width = target + 'px';
+ clearInterval( os_animation_timer.id );
os_animation_timer = null;
- } else{
+ } else {
// in-progress
- c.style.width = nw+"px";
- if(document.documentElement.dir == "rtl")
- c.style.left = (normL + normW + (target - nw) - os_animation_timer.target - 1)+"px";
- }
-}
-
-/** Handles data from XMLHttpRequest, and updates the suggest results */
-function os_updateResults(r, query, text, cacheKey){
- os_cache[cacheKey] = text;
- r.query = query;
- r.original = query;
- if(text == ""){
- r.results = null;
- r.resultCount = 0;
- os_hideResults(r);
- } else{
- try {
- var p = eval('('+text+')'); // simple json parse, could do a safer one
- if(p.length<2 || p[1].length == 0){
- r.results = null;
- r.resultCount = 0;
- os_hideResults(r);
- return;
- }
- var c = document.getElementById(r.container);
- if(c == null)
- c = os_createContainer(r);
- c.innerHTML = os_createResultTable(r,p[1]);
- // init container table sizes
- var t = document.getElementById(r.resultTable);
- r.containerTotal = t.offsetHeight;
- r.containerRow = t.offsetHeight / r.resultCount;
- os_fitContainer(r);
- os_trimResultText(r);
- os_showResults(r);
- } catch(e){
- // bad response from server or such
- os_hideResults(r);
- os_cache[cacheKey] = null;
+ c.style.width = nw + 'px';
+ if( document.documentElement.dir == 'rtl' ) {
+ c.style.left = ( normL + normW + ( target - nw ) - os_animation_timer.target - 1 ) + 'px';
}
}
}
-/** Create the result table to be placed in the container div */
-function os_createResultTable(r, results){
- var c = document.getElementById(r.container);
- var width = c.offsetWidth - os_operaWidthFix(c.offsetWidth);
- var html = "<table class=\"os-suggest-results\" id=\""+r.resultTable+"\" style=\"width: "+width+"px;\">";
- r.results = new Array();
- r.resultCount = results.length;
- for(i=0;i<results.length;i++){
- var title = os_decodeValue(results[i]);
- r.results[i] = title;
- html += "<tr><td class=\"os-suggest-result\" id=\""+r.resultTable+i+"\"><span id=\""+r.resultText+i+"\">"+title+"</span></td></tr>";
+/** Change the highlighted row (i.e. suggestion), from position cur to next */
+function os_changeHighlight( r, cur, next, updateSearchBox ) {
+ if ( next >= r.resultCount ) {
+ next = r.resultCount - 1;
+ }
+ if ( next < -1 ) {
+ next = -1;
+ }
+ r.selected = next;
+ if ( cur == next ) {
+ return; // nothing to do.
}
- html+="</table>"
- return html;
-}
-/** Fetch namespaces from checkboxes or hidden fields in the search form,
- if none defined use wgSearchNamespaces global */
-function os_getNamespaces(r){
- var namespaces = "";
- var elements = document.forms[r.searchform].elements;
- for(i=0; i < elements.length; i++){
- var name = elements[i].name;
- if(typeof name != 'undefined' && name.length > 2
- && name[0]=='n' && name[1]=='s'
- && ((elements[i].type=='checkbox' && elements[i].checked)
- || (elements[i].type=='hidden' && elements[i].value=="1")) ){
- if(namespaces!="")
- namespaces+="|";
- namespaces+=name.substring(2);
+ if( cur >= 0 ) {
+ var curRow = document.getElementById( r.resultTable + cur );
+ if( curRow != null ) {
+ curRow.className = 'os-suggest-result';
}
}
- if(namespaces == "")
- namespaces = wgSearchNamespaces.join("|");
- return namespaces;
-}
-
-/** Update results if user hasn't already typed something else */
-function os_updateIfRelevant(r, query, text, cacheKey){
- var t = document.getElementById(r.searchbox);
- if(t != null && t.value == query){ // check if response is still relevant
- os_updateResults(r, query, text, cacheKey);
+ var newText;
+ if( next >= 0 ) {
+ var nextRow = document.getElementById( r.resultTable + next );
+ if( nextRow != null ) {
+ nextRow.className = os_HighlightClass();
+ }
+ newText = r.results[next];
+ } else {
+ newText = r.original;
}
- r.query = query;
-}
-
-/** Fetch results after some timeout */
-function os_delayedFetch(){
- if(os_timer == null)
- return;
- var r = os_timer.r;
- var query = os_timer.query;
- os_timer = null;
- var path = wgMWSuggestTemplate.replace("{namespaces}",os_getNamespaces(r))
- .replace("{dbname}",wgDBname)
- .replace("{searchTerms}",os_encodeQuery(query));
- // try to get from cache, if not fetch using ajax
- var cached = os_cache[path];
- if(cached != null){
- os_updateIfRelevant(r, query, cached, path);
- } else{
- var xmlhttp = sajax_init_object();
- if(xmlhttp){
- try {
- xmlhttp.open("GET", path, true);
- xmlhttp.onreadystatechange=function(){
- if (xmlhttp.readyState==4 && typeof os_updateIfRelevant == 'function') {
- os_updateIfRelevant(r, query, xmlhttp.responseText, path);
- }
- };
- xmlhttp.send(null);
- } catch (e) {
- if (window.location.hostname == "localhost") {
- alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");
- }
- throw e;
- }
+ // adjust the scrollbar if any
+ if( r.containerCount < r.resultCount ) {
+ var c = document.getElementById( r.container );
+ var vStart = c.scrollTop / r.containerRow;
+ var vEnd = vStart + r.containerCount;
+ if( next < vStart ) {
+ c.scrollTop = next * r.containerRow;
+ } else if( next >= vEnd ) {
+ c.scrollTop = ( next - r.containerCount + 1 ) * r.containerRow;
}
}
-}
-
-/** Init timed update via os_delayedUpdate() */
-function os_fetchResults(r, query, timeout){
- if(query == ""){
- os_hideResults(r);
- return;
- } else if(query == r.query)
- return; // no change
-
- os_is_stopped = false; // make sure we're running
- /* var cacheKey = wgDBname+":"+query;
- var cached = os_cache[cacheKey];
- if(cached != null){
- os_updateResults(r,wgDBname,query,cached);
- return;
- } */
-
- // cancel any pending fetches
- if(os_timer != null && os_timer.id != null)
- clearTimeout(os_timer.id);
- // schedule delayed fetching of results
- if(timeout != 0){
- os_timer = new os_Timer(setTimeout("os_delayedFetch()",timeout),r,query);
- } else{
- os_timer = new os_Timer(null,r,query);
- os_delayedFetch(); // do it now!
+ // update the contents of the search box
+ if( updateSearchBox ) {
+ os_updateSearchQuery( r, newText );
}
-
-}
-/** Change the highlighted row (i.e. suggestion), from position cur to next */
-function os_changeHighlight(r, cur, next, updateSearchBox){
- if (next >= r.resultCount)
- next = r.resultCount-1;
- if (next < -1)
- next = -1;
- r.selected = next;
- if (cur == next)
- return; // nothing to do.
-
- if(cur >= 0){
- var curRow = document.getElementById(r.resultTable + cur);
- if(curRow != null)
- curRow.className = "os-suggest-result";
- }
- var newText;
- if(next >= 0){
- var nextRow = document.getElementById(r.resultTable + next);
- if(nextRow != null)
- nextRow.className = os_HighlightClass();
- newText = r.results[next];
- } else
- newText = r.original;
-
- // adjust the scrollbar if any
- if(r.containerCount < r.resultCount){
- var c = document.getElementById(r.container);
- var vStart = c.scrollTop / r.containerRow;
- var vEnd = vStart + r.containerCount;
- if(next < vStart)
- c.scrollTop = next * r.containerRow;
- else if(next >= vEnd)
- c.scrollTop = (next - r.containerCount + 1) * r.containerRow;
- }
-
- // update the contents of the search box
- if(updateSearchBox){
- os_updateSearchQuery(r,newText);
- }
}
function os_HighlightClass() {
var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
- if (match) {
- var webKitVersion = parseInt(match[1]);
- if (webKitVersion < 523) {
+ if ( match ) {
+ var webKitVersion = parseInt( match[1] );
+ if ( webKitVersion < 523 ) {
// CSS system highlight colors broken on old Safari
// https://bugs.webkit.org/show_bug.cgi?id=6129
// Safari 3.0.4, 3.1 known ok
- return "os-suggest-result-hl-webkit";
+ return 'os-suggest-result-hl-webkit';
}
}
- return "os-suggest-result-hl";
+ return 'os-suggest-result-hl';
}
-function os_updateSearchQuery(r,newText){
- document.getElementById(r.searchbox).value = newText;
- r.query = newText;
-}
-
-/** Find event target */
-function os_getTarget(e){
- if (!e) e = window.event;
- if (e.target) return e.target;
- else if (e.srcElement) return e.srcElement;
- else return null;
+function os_updateSearchQuery( r, newText ) {
+ document.getElementById( r.searchbox ).value = newText;
+ r.query = newText;
}
-
-/********************
- * Keyboard events
- ********************/
-
-/** Event handler that will fetch results on keyup */
-function os_eventKeyup(e){
- var targ = os_getTarget(e);
- var r = os_map[targ.id];
- if(r == null)
- return; // not our event
-
- // some browsers won't generate keypressed for arrow keys, catch it
- if(os_keypressed_count == 0){
- os_processKey(r,os_cur_keypressed,targ);
- }
- var query = targ.value;
- os_fetchResults(r,query,os_search_timeout);
-}
-
-/** catch arrows up/down and escape to hide the suggestions */
-function os_processKey(r,keypressed,targ){
- if (keypressed == 40){ // Arrow Down
- if (r.visible) {
- os_changeHighlight(r, r.selected, r.selected+1, true);
- } else if(os_timer == null){
- // user wants to get suggestions now
- r.query = "";
- os_fetchResults(r,targ.value,0);
- }
- } else if (keypressed == 38){ // Arrow Up
- if (r.visible){
- os_changeHighlight(r, r.selected, r.selected-1, true);
- }
- } else if(keypressed == 27){ // Escape
- document.getElementById(r.searchbox).value = r.original;
- r.query = r.original;
- os_hideResults(r);
- } else if(r.query != document.getElementById(r.searchbox).value){
- // os_hideResults(r); // don't show old suggestions
- }
-}
-
-/** When keys is held down use a timer to output regular events */
-function os_eventKeypress(e){
- var targ = os_getTarget(e);
- var r = os_map[targ.id];
- if(r == null)
- return; // not our event
-
- var keypressed = os_cur_keypressed;
- if(keypressed == 38 || keypressed == 40){
- var d = new Date()
- var now = d.getTime();
- if(now - os_last_keypress < 120){
- os_last_keypress = now;
- return;
- }
- }
-
- os_keypressed_count++;
- os_processKey(r,keypressed,targ);
-}
-
-/** Catch the key code (Firefox bug) */
-function os_eventKeydown(e){
- if (!e) e = window.event;
- var targ = os_getTarget(e);
- var r = os_map[targ.id];
- if(r == null)
- return; // not our event
-
- os_mouse_moved = false;
-
- os_cur_keypressed = (e.keyCode == undefined) ? e.which : e.keyCode;
- os_last_keypress = 0;
- os_keypressed_count = 0;
-}
-
-/** Event: loss of focus of input box */
-function os_eventBlur(e){
- var targ = os_getTarget(e);
- var r = os_map[targ.id];
- if(r == null)
- return; // not our event
- if(!os_mouse_pressed)
- os_hideResults(r);
-}
-
-/** Event: focus (catch only when stopped) */
-function os_eventFocus(e){
- // nothing happens here?
-}
-
-
-
/********************
* Mouse events
********************/
/** Mouse over the container */
-function os_eventMouseover(srcId, e){
- var targ = os_getTarget(e);
+function os_eventMouseover( srcId, e ) {
+ var targ = os_getTarget( e );
var r = os_map[srcId];
- if(r == null || !os_mouse_moved)
+ if( r == null || !os_mouse_moved ) {
return; // not our event
- var num = os_getNumberSuffix(targ.id);
- if(num >= 0)
- os_changeHighlight(r,r.selected,num,false);
-
+ }
+ var num = os_getNumberSuffix( targ.id );
+ if( num >= 0 ) {
+ os_changeHighlight( r, r.selected, num, false );
+ }
}
/* Get row where the event occured (from its id) */
-function os_getNumberSuffix(id){
- var num = id.substring(id.length-2);
- if( ! (num.charAt(0) >= '0' && num.charAt(0) <= '9') )
- num = num.substring(1);
- if(os_isNumber(num))
- return parseInt(num);
- else
+function os_getNumberSuffix( id ) {
+ var num = id.substring( id.length - 2 );
+ if( !( num.charAt( 0 ) >= '0' && num.charAt( 0 ) <= '9' ) ) {
+ num = num.substring( 1 );
+ }
+ if( os_isNumber( num ) ) {
+ return parseInt( num );
+ } else {
return -1;
+ }
}
/** Save mouse move as last action */
-function os_eventMousemove(srcId, e){
+function os_eventMousemove( srcId, e ) {
os_mouse_moved = true;
}
-/** Mouse button held down, register possible click */
-function os_eventMousedown(srcId, e){
- var targ = os_getTarget(e);
+/** Mouse button held down, register possible click */
+function os_eventMousedown( srcId, e ) {
+ var targ = os_getTarget( e );
var r = os_map[srcId];
- if(r == null)
+ if( r == null ) {
return; // not our event
- var num = os_getNumberSuffix(targ.id);
+ }
+ var num = os_getNumberSuffix( targ.id );
os_mouse_pressed = true;
- if(num >= 0){
+ if( num >= 0 ) {
os_mouse_num = num;
- // os_updateSearchQuery(r,r.results[num]);
+ // os_updateSearchQuery( r, r.results[num] );
}
// keep the focus on the search field
- document.getElementById(r.searchbox).focus();
+ document.getElementById( r.searchbox ).focus();
return false; // prevents selection
}
/** Mouse button released, check for click on some row */
-function os_eventMouseup(srcId, e){
- var targ = os_getTarget(e);
+function os_eventMouseup( srcId, e ) {
+ var targ = os_getTarget( e );
var r = os_map[srcId];
- if(r == null)
+ if( r == null ) {
return; // not our event
- var num = os_getNumberSuffix(targ.id);
+ }
+ var num = os_getNumberSuffix( targ.id );
- if(num >= 0 && os_mouse_num == num){
- os_updateSearchQuery(r,r.results[num]);
- os_hideResults(r);
- document.getElementById(r.searchform).submit();
+ if( num >= 0 && os_mouse_num == num ) {
+ os_updateSearchQuery( r, r.results[num] );
+ os_hideResults( r );
+ document.getElementById( r.searchform ).submit();
}
os_mouse_pressed = false;
// keep the focus on the search field
- document.getElementById(r.searchbox).focus();
+ document.getElementById( r.searchbox ).focus();
}
-/** Check if x is a valid integer */
-function os_isNumber(x){
- if(x == "" || isNaN(x))
- return false;
- for(var i=0;i<x.length;i++){
- var c = x.charAt(i);
- if( ! (c >= '0' && c <= '9') )
- return false;
- }
- return true;
-}
-
-
-/** When the form is submitted hide everything, cancel updates... */
-function os_eventOnsubmit(e){
- var targ = os_getTarget(e);
-
- os_is_stopped = true;
- // kill timed requests
- if(os_timer != null && os_timer.id != null){
- clearTimeout(os_timer.id);
- os_timer = null;
- }
- // Hide all suggestions
- for(i=0;i<os_autoload_inputs.length;i++){
- var r = os_map[os_autoload_inputs[i]];
- if(r != null){
- var b = document.getElementById(r.searchform);
- if(b != null && b == targ){
- // set query value so the handler won't try to fetch additional results
- r.query = document.getElementById(r.searchbox).value;
- }
- os_hideResults(r);
- }
- }
- return true;
-}
-
-function os_hookEvent(element, hookName, hookFunct) {
- if (element.addEventListener) {
- element.addEventListener(hookName, hookFunct, false);
- } else if (window.attachEvent) {
- element.attachEvent("on" + hookName, hookFunct);
- }
-}
-
-/** Init Result objects and event handlers */
-function os_initHandlers(name, formname, element){
- var r = new os_Results(name, formname);
- // event handler
- os_hookEvent(element, "keyup", function(event) { os_eventKeyup(event); });
- os_hookEvent(element, "keydown", function(event) { os_eventKeydown(event); });
- os_hookEvent(element, "keypress", function(event) { os_eventKeypress(event); });
- os_hookEvent(element, "blur", function(event) { os_eventBlur(event); });
- os_hookEvent(element, "focus", function(event) { os_eventFocus(event); });
- element.setAttribute("autocomplete","off");
- // stopping handler
- os_hookEvent(document.getElementById(formname), "submit", function(event){ return os_eventOnsubmit(event); });
- os_map[name] = r;
- // toggle link
- if(document.getElementById(r.toggle) == null){
- // TODO: disable this while we figure out a way for this to work in all browsers
- /* if(name=='searchInput'){
- // special case: place above the main search box
- var t = os_createToggle(r,"os-suggest-toggle");
- var searchBody = document.getElementById('searchBody');
- var first = searchBody.parentNode.firstChild.nextSibling.appendChild(t);
- } else{
- // default: place below search box to the right
- var t = os_createToggle(r,"os-suggest-toggle-def");
- var top = element.offsetTop + element.offsetHeight;
- var left = element.offsetLeft + element.offsetWidth;
- t.style.position = "absolute";
- t.style.top = top + "px";
- t.style.left = left + "px";
- element.parentNode.appendChild(t);
- // only now width gets calculated, shift right
- left -= t.offsetWidth;
- t.style.left = left + "px";
- t.style.visibility = "visible";
- } */
- }
-
-}
+/** Toggle stuff seems to be dead code? */
/** Return the span element that contains the toggle link */
-function os_createToggle(r,className){
- var t = document.createElement("span");
+function os_createToggle( r, className ) {
+ var t = document.createElement( 'span' );
t.className = className;
- t.setAttribute("id", r.toggle);
- var link = document.createElement("a");
- link.setAttribute("href","javascript:void(0);");
- link.onclick = function(){ os_toggle(r.searchbox,r.searchform) };
- var msg = document.createTextNode(wgMWSuggestMessages[0]);
- link.appendChild(msg);
- t.appendChild(link);
+ t.setAttribute( 'id', r.toggle );
+ var link = document.createElement( 'a' );
+ link.setAttribute( 'href', 'javascript:void(0);' );
+ link.onclick = function() { os_toggle( r.searchbox, r.searchform ); };
+ var msg = document.createTextNode( wgMWSuggestMessages[0] );
+ link.appendChild( msg );
+ t.appendChild( link );
return t;
}
/** Call when user clicks on some of the toggle links */
-function os_toggle(inputId,formName){
+function os_toggle( inputId, formName ) {
r = os_map[inputId];
var msg = '';
- if(r == null){
- os_enableSuggestionsOn(inputId,formName);
+ if( r == null ) {
+ os_enableSuggestionsOn( inputId, formName );
r = os_map[inputId];
msg = wgMWSuggestMessages[0];
} else{
- os_disableSuggestionsOn(inputId,formName);
+ os_disableSuggestionsOn( inputId, formName );
msg = wgMWSuggestMessages[1];
}
// change message
- var link = document.getElementById(r.toggle).firstChild;
- link.replaceChild(document.createTextNode(msg),link.firstChild);
-}
-
-/** Call this to enable suggestions on input (id=inputId), on a form (name=formName) */
-function os_enableSuggestionsOn(inputId, formName){
- os_initHandlers( inputId, formName, document.getElementById(inputId) );
-}
-
-/** Call this to disable suggestios on input box (id=inputId) */
-function os_disableSuggestionsOn(inputId){
- r = os_map[inputId];
- if(r != null){
- // cancel/hide results
- os_timer = null;
- os_hideResults(r);
- // turn autocomplete on !
- document.getElementById(inputId).setAttribute("autocomplete","on");
- // remove descriptor
- os_map[inputId] = null;
- }
-}
-
-/** Initialization, call upon page onload */
-function os_MWSuggestInit() {
- for(i=0;i<os_autoload_inputs.length;i++){
- var id = os_autoload_inputs[i];
- var form = os_autoload_forms[i];
- element = document.getElementById( id );
- if(element != null)
- os_initHandlers(id,form,element);
- }
+ var link = document.getElementById( r.toggle ).firstChild;
+ link.replaceChild( document.createTextNode( msg ), link.firstChild );
}
-hookEvent("load", os_MWSuggestInit);
+hookEvent( 'load', os_MWSuggestInit );
diff --git a/skins/common/oldshared.css b/skins/common/oldshared.css
index 3acd5e23..1bd1544e 100644
--- a/skins/common/oldshared.css
+++ b/skins/common/oldshared.css
@@ -144,6 +144,9 @@ img { border: none; }
}
/* preference page with js-genrated toc */
+#mw-pref-clear {
+ clear: both;
+}
#preftoc {
float: left;
margin: 1em 1em 1em 1em;
@@ -159,12 +162,12 @@ img { border: none; }
display: block;
color: #005189;
}
-#prefcontrol {
+.mw-prefs-buttons {
clear: left;
float: left;
margin-top: 1em;
}
-div.prefsectiontip {
+div.htmlform-tip {
font-size: 94%;
margin-top: 0.4em;
color: #666;
@@ -214,38 +217,8 @@ span.updatedmarker {
background-color:#00FF00;
}
-table.gallery {
- border: 1px solid #cccccc;
- margin: 2px;
- padding: 2px;
- background-color:#ffffff;
-}
-
-table.gallery tr {
- vertical-align:top;
-}
-
-table.gallery td {
- vertical-align:top;
- background-color:#f9f9f9;
- border: solid 2px white;
-}
-
div.gallerybox {
- margin: 2px;
- width: 150px;
-}
-
-div.gallerybox div.thumb {
- text-align: center;
- border: 1px solid #cccccc;
- margin: 2px;
-}
-
-div.gallerytext {
- overflow: hidden;
- font-size: 94%;
- padding: 2px 4px;
+ width: 150px;
}
span.comment {
@@ -319,12 +292,6 @@ table.collapsed tr.collapsable {
clear: both;
}
-#mw_trackbacks {
- border: solid 1px #bbbbff;
- background-color: #eeeeff;
- padding: 0.2em;
-}
-
/* Allmessages table */
#allmessagestable th {
@@ -347,15 +314,6 @@ table.collapsed tr.collapsable {
display: none;
}
-/* Keep this temporarily so that cached pages will display right */
-table.gallery td.galleryheader {
- text-align: center;
- font-weight: bold;
-}
-table.gallery caption {
- font-weight: bold;
-}
-
div.multipageimagenavbox {
border: solid 1px silver;
padding: 4px;
@@ -416,3 +374,10 @@ table.multipageimage td {
form#specialpages {
display: inline;
}
+
+body {
+ background-color: #ffffec;
+}
+body.ns-0 {
+ background-color: white;
+}
diff --git a/skins/common/prefs.js b/skins/common/prefs.js
index c2554c00..ca55632c 100644
--- a/skins/common/prefs.js
+++ b/skins/common/prefs.js
@@ -1,73 +1,74 @@
-
// generate toc from prefs form, fold sections
// XXX: needs testing on IE/Mac and safari
// more comments to follow
function tabbedprefs() {
- var prefform = document.getElementById('preferences');
- if (!prefform || !document.createElement) {
+ var prefform = document.getElementById( 'preferences' );
+ if ( !prefform || !document.createElement ) {
return;
}
- if (prefform.nodeName.toLowerCase() == 'a') {
+ if ( prefform.nodeName.toLowerCase() == 'a' ) {
return; // Occasional IE problem
}
prefform.className = prefform.className + 'jsprefs';
var sections = [];
var children = prefform.childNodes;
var seci = 0;
- for (var i = 0; i < children.length; i++) {
- if (children[i].nodeName.toLowerCase() == 'fieldset') {
+ for ( var i = 0; i < children.length; i++ ) {
+ if ( children[i].nodeName.toLowerCase() == 'fieldset' ) {
children[i].id = 'prefsection-' + seci;
children[i].className = 'prefsection';
- if (is_opera || is_khtml) {
+ if ( is_opera ) {
children[i].className = 'prefsection operaprefsection';
}
var legends = children[i].getElementsByTagName('legend');
sections[seci] = {};
- if (legends[0]) legends[0].className = 'mainLegend';
- if (legends[0] && legends[0].firstChild.nodeValue) {
+ if ( legends[0] ) {
+ legends[0].className = 'mainLegend';
+ }
+ if ( legends[0] && legends[0].firstChild.nodeValue ) {
sections[seci].text = legends[0].firstChild.nodeValue;
} else {
sections[seci].text = '# ' + seci;
}
sections[seci].secid = children[i].id;
seci++;
- if (sections.length != 1) {
+ if ( sections.length != 1 ) {
children[i].style.display = 'none';
} else {
var selectedid = children[i].id;
}
}
}
- var toc = document.createElement('ul');
+ var toc = document.createElement( 'ul' );
toc.id = 'preftoc';
toc.selectedid = selectedid;
- for (i = 0; i < sections.length; i++) {
- var li = document.createElement('li');
- if (i === 0) {
+ for ( i = 0; i < sections.length; i++ ) {
+ var li = document.createElement( 'li' );
+ if ( i === 0 ) {
li.className = 'selected';
}
- var a = document.createElement('a');
+ var a = document.createElement( 'a' );
a.href = '#' + sections[i].secid;
a.onmousedown = a.onclick = uncoversection;
- a.appendChild(document.createTextNode(sections[i].text));
+ a.appendChild( document.createTextNode( sections[i].text ) );
a.secid = sections[i].secid;
- li.appendChild(a);
- toc.appendChild(li);
+ li.appendChild( a );
+ toc.appendChild( li );
}
- prefform.parentNode.insertBefore(toc, prefform.parentNode.childNodes[0]);
- document.getElementById('prefsubmit').id = 'prefcontrol';
+ prefform.parentNode.insertBefore( toc, prefform.parentNode.childNodes[0] );
+ document.getElementById( 'prefsubmit' ).id = 'prefcontrol';
}
function uncoversection() {
var oldsecid = this.parentNode.parentNode.selectedid;
- var newsec = document.getElementById(this.secid);
- if (oldsecid != this.secid) {
- var ul = document.getElementById('preftoc');
- document.getElementById(oldsecid).style.display = 'none';
+ var newsec = document.getElementById( this.secid );
+ if ( oldsecid != this.secid ) {
+ var ul = document.getElementById( 'preftoc' );
+ document.getElementById( oldsecid ).style.display = 'none';
newsec.style.display = 'block';
ul.selectedid = this.secid;
- var lis = ul.getElementsByTagName('li');
- for (var i = 0; i< lis.length; i++) {
+ var lis = ul.getElementsByTagName( 'li' );
+ for ( var i = 0; i< lis.length; i++ ) {
lis[i].className = '';
}
this.parentNode.className = 'selected';
@@ -77,25 +78,29 @@ function uncoversection() {
// Timezone stuff
// tz in format [+-]HHMM
-function checkTimezone(tz, msg) {
+function checkTimezone( 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 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]);
+ document.write( junk[0] + 'UTC' + tzString + junk[1] );
}
}
-function unhidetzbutton() {
- var tzb = document.getElementById('guesstimezonebutton');
- if (tzb) {
- tzb.style.display = 'inline';
+function timezoneSetup() {
+ var tzSelect = document.getElementById( 'mw-input-timecorrection' );
+ var tzTextbox = document.getElementById( 'mw-input-timecorrection-other' );
+
+ if ( tzSelect && tzTextbox ) {
+ addHandler( tzSelect, 'change', function( e ) { updateTimezoneSelection( false ); } );
+ addHandler( tzTextbox, 'blur', function( e ) { updateTimezoneSelection( true ); } );
}
- updateTimezoneSelection(false);
+
+ updateTimezoneSelection( false );
}
// in [-]HH:MM format...
@@ -105,60 +110,108 @@ function fetchTimezone() {
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;
+ 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;
}
-function guessTimezone(box) {
- document.getElementsByName("wpHourDiff")[0].value = fetchTimezone();
- updateTimezoneSelection(true);
+function guessTimezone() {
+ var textbox = document.getElementById( 'mw-input-timecorrection-other' );
+ var selector = document.getElementById( 'mw-input-timecorrection' );
+
+ selector.value = 'other';
+ textbox.value = fetchTimezone();
+ textbox.disabled = false; // The changed handler doesn't trip, obviously.
+ updateTimezoneSelection( true );
}
-function updateTimezoneSelection(force_offset) {
- var wpTimeZone = document.getElementsByName("wpTimeZone")[0];
- var wpHourDiff = document.getElementsByName("wpHourDiff")[0];
- var wpLocalTime = document.getElementById("wpLocalTime");
- var wpServerTime = document.getElementsByName("wpServerTime")[0];
+function updateTimezoneSelection( force_offset ) {
+ var selector = document.getElementById( 'mw-input-timecorrection' );
+
+ if ( selector.value == 'guess' ) {
+ return guessTimezone();
+ }
+
+ var textbox = document.getElementById( 'mw-input-timecorrection-other' );
+ var localtimeHolder = document.getElementById( 'wpLocalTime' );
+ var servertime = document.getElementsByName( 'wpServerTime' )[0].value;
var minDiff = 0;
- if (force_offset) wpTimeZone.selectedIndex = 1;
- if (wpTimeZone.selectedIndex == 1) {
- wpHourDiff.disabled = false;
- var diffArr = wpHourDiff.value.split(':');
- if (diffArr.length == 1) {
- minDiff = parseInt(diffArr[0], 10) * 60;
+ // 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 {
- minDiff = Math.abs(parseInt(diffArr[0], 10))*60 + parseInt(diffArr[1], 10);
- if (parseInt(diffArr[0], 10) < 0) minDiff = -minDiff;
+ // 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 {
- wpHourDiff.disabled = true;
- var diffArr = wpTimeZone.options[wpTimeZone.selectedIndex].value.split('|');
- minDiff = parseInt(diffArr[1], 10);
+ // 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;
}
- if (isNaN(minDiff)) minDiff = 0;
- var localTime = parseInt(wpServerTime.value, 10) + minDiff;
- while (localTime < 0) localTime += 1440;
- while (localTime >= 1440) localTime -= 1440;
- var hour = String(Math.floor(localTime/60));
- if (hour.length<2) hour = '0'+hour;
+ // 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(wpLocalTime, hour+':'+min);
+ if ( min.length < 2 ) {
+ min = '0' + min;
+ }
+ changeText( localtimeHolder, hour + ':' + min );
- if (wpTimeZone.selectedIndex != 1) {
- hour = String(Math.abs(Math.floor(minDiff/60)));
- if (hour.length<2) hour = '0'+hour;
- if (minDiff < 0) hour = '-'+hour;
+ // 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;
- wpHourDiff.value = hour+':'+min;
+ if ( min.length < 2 ) {
+ min = '0' + min;
+ }
+ textbox.value = hour + ':' + min;
}
}
-hookEvent("load", unhidetzbutton);
-hookEvent("load", tabbedprefs);
+addOnloadHook( timezoneSetup );
+addOnloadHook( tabbedprefs );
diff --git a/skins/common/preview.js b/skins/common/preview.js
index faf611f0..db5633d0 100644
--- a/skins/common/preview.js
+++ b/skins/common/preview.js
@@ -1,175 +1,53 @@
/**
* Live preview script for MediaWiki
- *
- * 2007-04-25 – Nikerabbit:
- * Worked around text cutoff in mozilla-based browsers
- * Support for categories
*/
+function doLivePreview( e ) {
+ e.preventDefault();
+ var previewText = $j('#wpTextbox1').val();
-lpIdPreview = 'wikiPreview';
-lpIdCategories = 'catlinks';
-lpIdDiff = 'wikiDiff';
-
-/*
- * Returns XMLHttpRequest based on browser support or null
- */
-function openXMLHttpRequest() {
- if( window.XMLHttpRequest ) {
- return new XMLHttpRequest();
- } else if( window.ActiveXObject && navigator.platform != 'MacPPC' ) {
- // IE/Mac has an ActiveXObject but it doesn't work.
- return new ActiveXObject("Microsoft.XMLHTTP");
- } else {
- return null;
- }
-}
-
-/**
- * Returns true if could open the request,
- * false otherwise (eg no browser support).
- */
-function lpDoPreview(text, postUrl) {
- lpRequest = openXMLHttpRequest();
- if( !lpRequest ) return false;
-
- lpRequest.onreadystatechange = lpStatusUpdate;
- lpRequest.open("POST", postUrl, true);
-
- var postData = 'wpTextbox1=' + encodeURIComponent(text);
- lpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- lpRequest.send(postData);
- return true;
-}
-
-function lpStatusUpdate() {
-
- /* We are at some stage of loading */
- if (lpRequest.readyState > 0 && lpRequest.readyState < 4) {
- notify(i18n(wgLivepreviewMessageLoading));
- }
-
- /* Not loaded yet */
- if(lpRequest.readyState != 4) {
- return;
- }
-
- /* We got response, bug it not what we wanted */
- if( lpRequest.status != 200 ) {
- var keys = new Array();
- keys[0] = lpRequest.status;
- keys[1] = lpRequest.statusText;
- window.alert(i18n(wgLivepreviewMessageError, keys));
- lpShowNormalPreview();
- return;
- }
-
- /* All good */
- dismissNotify(i18n(wgLivepreviewMessageReady), 750);
+ var editToken = $j( '[name="wpEditToken"]' ).attr( 'value' );
+ var editTime = $j( '[name="wpEdittime"]' ).attr( 'value' );
+ var startTime = $j( '[name="wpStarttime"]' ).attr( 'value' );
+ var postData = { 'action' : 'submit', 'wpTextbox1' : previewText, 'wpPreview' : true,
+ 'wpEditToken' : editToken, 'wpEdittime': editTime, 'wpStarttime': startTime, 'title' : wgPageName };
- var XMLObject = lpRequest.responseXML.documentElement;
-
-
- /* Work around Firefox (Gecko?) limitation where it shows only the first 4096
- * bytes of data. Ref: http://www.thescripts.com/forum/thread482760.html
- */
- XMLObject.normalize();
-
- var previewElement = XMLObject.getElementsByTagName('preview')[0];
- var categoryElement = XMLObject.getElementsByTagName('category')[0];
+ // Hide active diff, used templates, old preview if shown
+ var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats',
+ '#catlinks'];
+ var copySelector = copyElements.join(',');
- /* Hide the active diff if it exists */
- var diff = document.getElementById(lpIdDiff);
- if ( diff ) { diff.style.display = 'none'; }
-
- /* Inject preview */
- var previewContainer = document.getElementById( lpIdPreview );
- if ( previewContainer && previewElement ) {
- previewContainer.innerHTML = previewElement.firstChild.data;
- previewContainer.style.display = 'block';
- } else {
- /* Should never happen */
- window.alert(i18n(wgLivepreviewMessageFailed));
- lpShowNormalPreview();
- return;
- }
-
-
- /* Inject categories */
- var categoryContainer = document.getElementById( lpIdCategories );
- if ( categoryElement && categoryElement.firstChild ) {
- if ( categoryContainer ) {
- categoryContainer.innerHTML = categoryElement.firstChild.data;
- /* May be hidden */
- categoryContainer.style.display = 'block';
- } else {
- /* Just dump them somewhere */
- /* previewContainer.innerHTML += categoryElement.firstChild.data;*/
- }
- } else {
- /* Nothing to show, hide old data */
- if ( categoryContainer ) {
- categoryContainer.style.display = 'none';
- }
- }
-
-}
-
-function lpShowNormalPreview() {
- 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. Supports only one notify at a time.
- */
-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);
+ $j.each( copyElements, function(k,v) { $j(v).fadeOut('fast'); } );
+
+ // Display a loading graphic
+ var loadSpinner = $j('<div class="mw-ajax-loader"/>');
+ $j('#wikiPreview').before( loadSpinner );
+
+ var page = $j('<div/>');
+ page.load( wgScript+'?action=submit '+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
+ // with the content of the loaded page
+ var copyContent = page.find( copyElements[i] ).contents();
+ $j(copyElements[i]).empty().append( copyContent );
+ var newClasses = page.find( copyElements[i] ).attr('class');
+ $j(copyElements[i]).attr( 'class', newClasses );
+ }
+
+ $j.each( copyElements, function(k,v) {
+ // Don't belligerently show elements that are supposed to be hidden
+ $j(v).fadeIn( 'fast', function() { $j(this).css('display', ''); } );
+ } );
+
+ loadSpinner.remove();
+ } );
}
-
-
-/* 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
+$j(document).ready( function() {
+ $j('#wpPreview').click( doLivePreview );
+} );
diff --git a/skins/common/protect.js b/skins/common/protect.js
index d9650c82..e037f08a 100644
--- a/skins/common/protect.js
+++ b/skins/common/protect.js
@@ -22,7 +22,7 @@ var ProtectionForm = {
var boxbody = box.getElementsByTagName('tbody')[0]
var row = document.createElement( 'tr' );
- boxbody.insertBefore( row, boxbody.firstChild );
+ boxbody.insertBefore( row, boxbody.firstChild.nextSibling );
this.existingMatch = opts.existingMatch;
diff --git a/skins/common/search.js b/skins/common/search.js
new file mode 100644
index 00000000..ff114291
--- /dev/null
+++ b/skins/common/search.js
@@ -0,0 +1,50 @@
+// JS specific to Special:Search
+
+// change the search link to what user entered
+function mwSearchHeaderClick( 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.href.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;
+}
+
+function mwToggleSearchCheckboxes( 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 bb08c648..674d3626 100644
--- a/skins/common/shared.css
+++ b/skins/common/shared.css
@@ -3,8 +3,22 @@
* 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.
*/
-.mw-plusminus-null { color: #aaa; }
+/* Colored watchlist and recent changes numbers */
+.mw-plusminus-pos { color: #006400; } /* dark green */
+.mw-plusminus-neg { color: #8b0000; } /* dark red */
+.mw-plusminus-null { color: #aaa; } /* gray */
+
+/* Comment and username portions of RC entries */
+span.comment {
+ font-style: italic;
+}
+
+span.changedby {
+ font-size: 95%;
+}
+
+/* Math */
.texvc { direction: ltr; unicode-bidi: embed; }
img.tex { vertical-align: middle; }
span.texhtml { font-family: serif; }
@@ -32,16 +46,13 @@ div#mw-js-message {
/**
* File histories
*/
-table.filehistory {
- border:1px solid #ccc;
- border-collapse:collapse;
+h2#filehistory {
+ clear: both;
}
table.filehistory th,
table.filehistory td {
- padding: 0 0.2em 0 0.2em;
vertical-align:top;
- border:1px solid #ccc;
}
table.filehistory th {
text-align: left;
@@ -65,6 +76,23 @@ li span.deleted, span.history-deleted {
}
/**
+ * Patrol stuff
+ */
+.not-patrolled {
+ background-color: #ffa;
+}
+
+.unpatrolled {
+ font-weight: bold;
+ color: red;
+}
+
+div.patrollink {
+ font-size: 75%;
+ text-align: right;
+}
+
+/**
* Forms
*/
body.ltr td.mw-label { text-align: right; }
@@ -75,8 +103,12 @@ body.rtl td.mw-input { text-align: right; }
body.rtl td.mw-submit { text-align: right; }
td.mw-label { vertical-align: top; }
+.prefsection td.mw-label { width: 20%; }
+.prefsection table { width: 100%; }
td.mw-submit { white-space: nowrap; }
+table.mw-htmlform-nolabel td.mw-label { width: 0 !important; }
+
/**
* Image captions
*/
@@ -94,25 +126,151 @@ body.ltr .magnify { 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-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;
+}
+
.mw-search-results li {
padding-bottom: 1em;
list-style: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;
+}
+.rtl .mw-search-formheader div.search-types {
+ float: right;
+}
+.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;
+}
+.rtl fieldset#mw-searchoptions h4 {
+ float: right;
+}
+fieldset#mw-searchoptions div#mw-search-togglebox {
+ float: right;
+}
+.rtl fieldset#mw-searchoptions div#mw-search-togglebox {
+ float: left;
+}
+
+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;
+}
+.rtl fieldset#mw-searchoptions table td {
+ padding-left: 1em;
+ padding-right: 0;
+}
+body.rtl fieldset#mw-searchoptions table {
+ margin-right: 0;
+ margin-left: 3em;
+ float: right;
+}
+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%;
@@ -127,6 +285,10 @@ div#mw-search-interwiki {
margin-top: 2ex;
}
+.rtl div#mw-search-interwiki {
+ float: left;
+}
+
div#mw-search-interwiki li {
font-size: 95%;
}
@@ -136,14 +298,38 @@ div#mw-search-interwiki li {
font-size: 90%;
}
+.rtl .mw-search-interwiki-more {
+ float: left;
+}
+
+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;
+}
+
+.rtl .mw-search-interwiki-project {
+ text-align: right;
+}
+
span.searchalttitle {
font-size: 95%;
}
div.searchdidyoumean {
font-size: 127%;
- margin-bottom: 1ex;
- margin-top: 1ex;
+ margin-top: 0.8em;
/* Note that this color won't affect the link, as desired. */
color: #c00;
}
@@ -156,14 +342,28 @@ div.searchdidyoumean em {
font-weight: bold;
}
-div.searchresults {
- border:1px solid darkblue;
- padding-top: 10px;
- padding-bottom: 10px;
- padding-left: 20px;
- padding-right: 20px;
+table#mw-search-top-table {
+ background-color: transparent;
}
+
+/*
+ * Advanced PowerSearch box
+ */
+
+td#mw-search-togglebox {
+ text-align: right;
+}
+
+table#mw-search-powertable {
+ width:100%;
+}
+
+form#powersearch {
+ clear: both;
+}
+
+
/*
* UserRights stuff
*/
@@ -175,48 +375,47 @@ table.mw-userrights-groups * td,table.mw-userrights-groups * th {
padding-right: 1.5em;
}
-/*
+/*
* OpenSearch ajax suggestions
*/
.os-suggest {
- overflow: auto;
- overflow-x: hidden;
+ overflow: auto;
+ overflow-x: hidden;
position: absolute;
top: 0px;
left: 0px;
width: 0px;
- background-color: white;
+ background-color: white;
background-color: Window;
border-style: solid;
border-color: #AAAAAA;
border-width: 1px;
- z-index:99;
- visibility:hidden;
- font-size:95%;
+ z-index:99;
+ font-size:95%;
}
table.os-suggest-results {
font-size: 95%;
- cursor: pointer;
+ cursor: pointer;
border: 0;
border-collapse: collapse;
width: 100%;
}
-td.os-suggest-result, td.os-suggest-result-hl {
+.os-suggest-result, .os-suggest-result-hl {
white-space: nowrap;
- background-color: white;
+ background-color: white;
background-color: Window;
color: black;
color: WindowText;
padding: 2px;
}
-td.os-suggest-result-hl,
-td.os-suggest-result-hl-webkit {
- background-color: #4C59A6;
+.os-suggest-result-hl,
+.os-suggest-result-hl-webkit {
+ background-color: #4C59A6;
color: white;
}
-td.os-suggest-result-hl {
+.os-suggest-result-hl {
/* System colors are misimplemented in Safari 3.0 and earlier,
making highlighted text illegible... */
background-color: Highlight;
@@ -224,7 +423,7 @@ td.os-suggest-result-hl {
}
.os-suggest-toggle {
- position: relative;
+ position: relative;
left: 1ex;
font-size: 65%;
}
@@ -250,30 +449,23 @@ td.os-suggest-result-hl {
border: 1px dashed #aaa;
}
-/*
- * Special:ListGroupRights styling
- * Special:Statistics styling
- * Special:Tags styling
-*/
+/** Generic minor/bot/newpage styling */
+.newpage, .minor, .bot {
+ font-weight: bold;
+}
-table.mw-listgrouprights-table,
-table.mw-statistics-table,
-table.mw-tags-table {
- border: 1px solid #ccc;
- border-collapse: collapse;
+/* 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; }
-table.mw-listgrouprights-table td, table.mw-listgrouprights-table th,
-table.mw-statistics-table td, table.mw-statistics-table th,
-table.mw-tags-table td, table.mw-tags-table th {
- padding: 0.5em 0.2em 0.5em 0.2em;
- border: 1px solid #ccc;
-}
-
+/* Special:Statistics styling */
td.mw-statistics-numbers {
text-align: right;
}
@@ -300,6 +492,26 @@ td#mw-emailuser-sender, td#mw-emailuser-recipient {
font-weight: bold;
}
+/* Special:Allpages styling */
+table.allpageslist {
+ background-color: transparent;
+}
+table.mw-allpages-table-form, table.mw-allpages-table-chunk {
+ background-color: transparent;
+ 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 {
@@ -323,6 +535,7 @@ div.mw-warning-with-logexcerpt {
padding: 3px;
margin-bottom: 3px;
border: 2px solid #2F6FAB;
+ clear: both;
}
div.mw-warning-with-logexcerpt ul li {
font-size: 90%;
@@ -331,8 +544,16 @@ div.mw-warning-with-logexcerpt ul li {
/* (show/hide) revision deletion links */
span.mw-revdelundel-link,
strong.mw-revdelundel-link {
- font-family: monospace;
- font-size: smaller;
+ font-size: 90%;
+}
+span.mw-revdelundel-hidden,
+input.mw-revdelundel-hidden {
+ visibility: hidden;
+}
+
+td.mw-revdel-checkbox, th.mw-revdel-checkbox {
+ padding-right: 10px;
+ text-align: center;
}
/* feed links */
@@ -340,3 +561,271 @@ a.feedlink {
background: url("images/feed-icon.png") center left no-repeat;
padding-left: 16px;
}
+
+/* Plainlinks - this can be used to switch
+ * off special external link styling */
+.plainlinks a {
+ background: none !important;
+ padding: 0 !important;
+}
+
+/* wikitable class for skinning normal tables */
+table.wikitable {
+ margin: 1em 1em 1em 0;
+ background: #f9f9f9;
+ border: 1px #aaa solid;
+ border-collapse: collapse;
+}
+.wikitable th, .wikitable td {
+ border: 1px #aaa solid;
+ padding: 0.2em;
+}
+.wikitable th {
+ background: #f2f2f2;
+ text-align: center;
+}
+.wikitable caption {
+ font-weight: bold;
+}
+
+/* hide initially collapsed collapsable tables */
+table.collapsed tr.collapsable {
+ display: none;
+}
+
+/* success and error messages */
+.success {
+ color: green;
+ font-size: larger;
+}
+.error {
+ color: red;
+ font-size: larger;
+}
+.errorbox, .successbox {
+ font-size: larger;
+ border: 2px solid;
+ padding: .5em 1em;
+ float: left;
+ margin-bottom: 2em;
+ color: #000;
+}
+.errorbox {
+ border-color: red;
+ background-color: #fff2f2;
+}
+.successbox {
+ border-color: green;
+ background-color: #dfd;
+}
+.errorbox h2, .successbox h2 {
+ font-size: 1em;
+ font-weight: bold;
+ display: inline;
+ margin: 0 .5em 0 0;
+ border: none;
+}
+
+.visualClear {
+ clear: both;
+}
+
+#mw_trackbacks {
+ border: solid 1px #bbbbff;
+ background-color: #eeeeff;
+ padding: 0.2em;
+}
+
+/*
+ Table pager (e.g. Special:Imagelist)
+ - remove underlines from the navigation link
+ - collapse borders
+ - set the borders to outsets (similar to Special:Allmessages)
+ - remove line wrapping for all td and th, set background color
+ - restore line wrapping for the last two table cells (description and size)
+*/
+.TablePager { min-width: 80%; }
+.TablePager_nav a { text-decoration: none; }
+.TablePager { border-collapse: collapse; }
+.TablePager, .TablePager td, .TablePager th {
+ border: 1px solid #aaaaaa;
+ padding: 0 0.15em 0 0.15em;
+}
+.TablePager th { background-color: #eeeeff }
+.TablePager td { background-color: #ffffff }
+.TablePager tr:hover td { background-color: #eeeeff }
+
+.imagelist td, .imagelist th { white-space: nowrap }
+.imagelist .TablePager_col_links { background-color: #eeeeff }
+.imagelist .TablePager_col_img_description { white-space: normal }
+.imagelist th.TablePager_sort { 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;
+ border: 1px solid #aaaaaa;
+ background-color: #f9f9f9;
+ padding: 5px;
+ font-size: 95%;
+ margin-bottom: 0.5em;
+ margin-left: 0;
+ margin-right: 0;
+}
+
+#filetoc li {
+ display: inline;
+ list-style-type: none;
+ padding-right: 2em;
+}
+
+/* Classes for EXIF data display */
+table.mw_metadata {
+ font-size: 0.8em;
+ margin-left: 0.5em;
+ margin-bottom: 0.5em;
+ width: 300px;
+}
+
+table.mw_metadata caption {
+ font-weight: bold;
+}
+
+table.mw_metadata th {
+ font-weight: normal;
+}
+
+table.mw_metadata td {
+ padding: 0.1em;
+}
+
+table.mw_metadata {
+ border: none;
+ border-collapse: collapse;
+}
+
+table.mw_metadata td, table.mw_metadata th {
+ text-align: center;
+ border: 1px solid #aaaaaa;
+ padding-left: 0.1em;
+ padding-right: 0.1em;
+}
+
+table.mw_metadata th {
+ background-color: #f9f9f9;
+}
+
+table.mw_metadata td {
+ background-color: #fcfcfc;
+}
+
+/* Galleries */
+table.gallery {
+ border: 1px solid #ccc;
+ margin: 2px;
+ padding: 2px;
+ background-color: white;
+}
+
+table.gallery tr {
+ vertical-align: top;
+}
+
+table.gallery td {
+ vertical-align: top;
+ background-color: #f9f9f9;
+ border: solid 2px white;
+}
+table.gallery caption {
+ font-weight: bold;
+}
+
+div.gallerybox {
+ margin: 2px;
+}
+
+div.gallerybox div.thumb {
+ text-align: center;
+ border: 1px solid #ccc;
+ margin: 2px;
+}
+
+div.gallerytext {
+ overflow: hidden;
+ font-size: 94%;
+ padding: 2px 4px;
+}
+
+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;
+ background-image: url(images/remove.png);
+ background-position: center center;
+ background-repeat: no-repeat;
+}
+
+.mw-ajax-addcategory {
+ padding-left: 20px;
+ background-image: url(images/add.png);
+ background-position: left center;
+ background-repeat: no-repeat;
+}
+
+.mw-ajax-loader {
+ background-image: url(images/ajax-loader.gif);
+ background-position: center center;
+ background-repeat: no-repeat;
+ padding: 16px;
+ position: relative;
+ top: -16px;
+}
+
+.mw-small-spinner {
+ padding: 10px !important;
+ margin-right: 0.6em;
+ background-image: url(images/spinner.gif);
+ background-position: center center;
+ background-repeat: no-repeat;
+}
+
+/* Sort arrows added by SortableTables */
+a.sortheader {
+ margin: 0 0.3em;
+}
diff --git a/skins/common/sticky.js b/skins/common/sticky.js
deleted file mode 100644
index a4904c03..00000000
--- a/skins/common/sticky.js
+++ /dev/null
@@ -1,124 +0,0 @@
-// Make a layer that stays in the same place on screen when scrolling the browser window.
-// Version 1.2
-// See http://www.mark.ac/help for browser support.
-
-var mySticky;
-var theLayer;
-
-// Setup variables for sliding.
-// lastY and staticYOffset should match your CSS top definition.
-
-lastY=10;YOffset=0;staticYOffset=10;refreshMS=25;
-
-
-// Setup function that runs when the page loads.
- function setup(eID){
- bw=new checkBrowser;
- if(bw.ns4||bw.opera){MM_reloadPage(true);}
- var noFix=bw.ie4||bw.ns4||(bw.macie50)?true:false;
- if (window.attachEvent){fix_bind()}
- else if(noFix){
- if(bw.ns6){document.getElementById(eID).style.position="absolute";}
- if(bw.macie50){document.getElementById(eID).style.position="absolute";document.getElementById(eID).style.backgroundColor="#ccffcc";}
- if(bw.ns6&&YOffset==0){YOffset=-15}
- mySticky=new makeLayerObj(eID);
- layerSlide(eID)}
- else{
- mySticky=new makeLayerObj(eID);
- mySticky.css.position="fixed";}
-
- if(!mySticky){mySticky=new makeLayerObj(eID);}
- //mySticky.css.visibility="visible";
- }
-
-
-// -------------------------
-// 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++){
- fix_elements[i].style.left = parseInt(fix_elements[i].fix_left)+document.getElementsByTagName('html')[0].scrollLeft+document.getElementsByTagName('body')[0].scrollLeft+'px';
- fix_elements[i].style.top = parseInt(fix_elements[i].fix_top)+document.getElementsByTagName('html')[0].scrollTop+document.getElementsByTagName('body')[0].scrollTop+'px';
- }
- }
-
- function fix_bind(){
- var i;
- for (i=0; i < document.all.length; i++){
- if (document.all[i].currentStyle.position=='fixed'){
- document.all[i].fix_left = document.all[i].currentStyle.left;
- document.all[i].fix_top = document.all[i].currentStyle.top;
- document.all[i].style.position = 'absolute';
- fix_elements[fix_elements.length] = document.all[i];
- window.attachEvent('onscroll', fix_event);
- window.attachEvent('onresize', fix_event);
- }
- }
- }
-// -------------------------
-
-
-// -------------------------
-// DHTML menu sliding. Requires checkBrowser()
-// Based on source at http://www.simplythebest.net/
- function layerSlide(layerID) {
- if(bw.dhtml){
- if(!mySticky){mySticky=new makeLayerObj(layerID);}
- if (bw.ns) {winY = window.pageYOffset;}
- else if (bw.ie) {winY = document.body.scrollTop;}
- if (bw.ie||bw.ns) {
- if (winY!=lastY&&winY>YOffset-staticYOffset){smooth = .3 * (winY - lastY - YOffset + staticYOffset);}
- else if (YOffset-staticYOffset+lastY>YOffset-staticYOffset){smooth = .3 * (winY - lastY - (YOffset-(YOffset-winY)));}
- else{smooth=0}
- if(smooth > 0) {smooth = Math.ceil(smooth);}
- else{smooth = Math.floor(smooth);}
- if (bw.ie){mySticky.css.pixelTop+=smooth;}
- else if (bw.ns){mySticky.css.top=parseInt(mySticky.css.top)+smooth;}
- lastY = lastY+smooth;
- top.window.status=new Date()
- setTimeout('layerSlide("'+layerID+'")', refreshMS)}}}
-// -------------------------
-
-// Netscape 4.x browser resize fix
- function MM_reloadPage(init) {
- if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
- document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; top.onresize=MM_reloadPage; }}
- else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) {location.reload();}}
-
-// Create browser-independent layer and browser objects
- function makeLayerObj(eID){
- if(document.getElementById){this.css=document.getElementById(eID).style}
- else if(document.layers){this.css=document.layers[eID];}
- else if(document.all){this.css=document.all[eID].style;}
- return this
- }
-
- function checkBrowser(){
- this.ver=navigator.appVersion;
- this.name=navigator.appName;
- this.mac=(navigator.platform.toLowerCase().indexOf('mac')>-1)?true:false;
- this.opera=(navigator.userAgent.toLowerCase().indexOf('opera')>-1)?true:false;
- this.dom=document.getElementById?true:false;
- this.ns=(this.name=='Netscape');
- this.ie4=(document.all && !this.dom)?true:false;
- this.ie=(this.name =='Microsoft Internet Explorer'&&!this.opera)?true:false;
- this.ie5=(this.ie && (navigator.userAgent.indexOf("MSIE 5")!=-1))?true:false;
- this.macie50=(this.mac&&this.ie5&&(navigator.userAgent.indexOf("MSIE 5.0")!=-1))?true:false
- this.ns4=(this.ns && parseInt(this.ver) == 4)?true:false;
- this.ns6=((this.name=="Netscape")&&(parseInt(this.ver)==5))?true:false
- 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";
- }
diff --git a/skins/common/upload.js b/skins/common/upload.js
index d1cf4b3e..f40f62e6 100644
--- a/skins/common/upload.js
+++ b/skins/common/upload.js
@@ -11,9 +11,19 @@ function licenseSelectorCheck() {
wgUploadLicenseObj.fetchPreview( selection );
}
-function licenseSelectorFixup() {
- // for MSIE/Mac; non-breaking spaces cause the <option> not to render
- // but, for some reason, setting the text to itself works
+function wgUploadSetup() {
+ // Disable URL box if the URL copy upload source type is not selected
+ var e = document.getElementById( 'wpSourceTypeURL' );
+ if( e ) {
+ if( !e.checked ) {
+ var ein = document.getElementById( 'wpUploadFileURL' );
+ if(ein)
+ ein.setAttribute( 'disabled', 'disabled' );
+ }
+ }
+
+ // For MSIE/Mac: non-breaking spaces cause the <option> not to render.
+ // But for some reason, setting the text to itself works
var selector = document.getElementById("wpLicense");
if (selector) {
var ua = navigator.userAgent;
@@ -24,6 +34,96 @@ function licenseSelectorFixup() {
}
}
}
+
+ // 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 ) {
+ // Insert an event handler that fetches upload warnings when wpDestFile
+ // has been changed
+ document.getElementById( 'wpDestFile' ).onchange = function ( e ) {
+ wgUploadWarningObj.checkNow(this.value);
+ };
+ // Insert a row where the warnings will be displayed just below the
+ // wpDestFile row
+ var optionsTable = document.getElementById( 'mw-htmlform-description' ).tBodies[0];
+ var row = optionsTable.insertRow( 1 );
+ var td = document.createElement( 'td' );
+ td.id = 'wpDestFile-warning';
+ td.colSpan = 2;
+
+ row.appendChild( td );
+ }
+
+ if ( wgAjaxLicensePreview ) {
+ // License selector check
+ document.getElementById( 'wpLicense' ).onchange = licenseSelectorCheck;
+
+ // License selector table row
+ var wpLicense = document.getElementById( 'wpLicense' );
+ var wpLicenseRow = wpLicense.parentNode.parentNode;
+ var wpLicenseTbody = wpLicenseRow.parentNode;
+
+ var row = document.createElement( 'tr' );
+ var td = document.createElement( 'td' );
+ row.appendChild( td );
+ td = document.createElement( 'td' );
+ td.id = 'mw-license-preview';
+ row.appendChild( td );
+
+ wpLicenseTbody.insertBefore( row, wpLicenseRow.nextSibling );
+ }
+
+
+ // fillDestFile setup
+ for ( var i = 0; i < wgUploadSourceIds.length; i++ )
+ document.getElementById( wgUploadSourceIds[i] ).onchange = function (e) {
+ fillDestFilename( this.id );
+ };
+}
+
+/**
+ * Iterate over all upload source fields and disable all except the selected one.
+ *
+ * @param enabledId The id of the selected radio button
+ * @return emptiness
+ */
+function toggleUploadInputs() {
+ // 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;
+ }
+ }
}
var wgUploadWarningObj = {
@@ -43,7 +143,7 @@ var wgUploadWarningObj = {
this.nameToCheck = destFile.value ;
- // Clear timer
+ // Clear timer
if ( this.timeoutID ) {
window.clearTimeout( this.timeoutID );
}
@@ -66,17 +166,17 @@ var wgUploadWarningObj = {
this.nameToCheck = fname;
this.timeout();
},
-
+
'timeout' : function() {
if ( !wgAjaxUploadDestCheck || !sajax_init_object() ) return;
injectSpinner( document.getElementById( 'wpDestFile' ), 'destcheck' );
- // Get variables into local scope so that they will be preserved for the
- // anonymous callback. fileName is copied so that multiple overlapping
+ // Get variables into local scope so that they will be preserved for the
+ // anonymous callback. fileName is copied so that multiple overlapping
// ajax requests can be supported.
var obj = this;
var fileName = this.nameToCheck;
- sajax_do_call( 'UploadForm::ajaxGetExistsWarning', [this.nameToCheck],
+ sajax_do_call( 'SpecialUpload::ajaxGetExistsWarning', [this.nameToCheck],
function (result) {
obj.processResult(result, fileName)
}
@@ -91,18 +191,19 @@ var wgUploadWarningObj = {
'setWarning' : function (warning) {
var warningElt = document.getElementById( 'wpDestFile-warning' );
- var ackElt = document.getElementById( 'wpDestFileWarningAck' );
- this.setInnerHTML(warningElt, warning);
+ var ackElt = document.getElementsByName( 'wpDestFileWarningAck' );
- // Set a value in the form indicating that the warning is acknowledged and
+ this.setInnerHTML(warningElt, warning);
+
+ // Set a value in the form indicating that the warning is acknowledged and
// doesn't need to be redisplayed post-upload
if ( warning == '' || warning == '&nbsp;' ) {
- ackElt.value = '';
+ ackElt[0].value = '';
} else {
- ackElt.value = '1';
+ ackElt[0].value = '1';
}
- },
+ },
'setInnerHTML' : function (element, text) {
// Check for no change to avoid flicker in IE 7
if (element.innerHTML != text) {
@@ -118,6 +219,13 @@ function fillDestFilename(id) {
if (!document.getElementById) {
return;
}
+ // Remove any previously flagged errors
+ var e = document.getElementById( 'mw-upload-permitted' );
+ if( e ) e.className = '';
+
+ var e = document.getElementById( 'mw-upload-prohibited' );
+ if( e ) e.className = '';
+
var path = document.getElementById(id).value;
// Find trailing part
var slash = path.lastIndexOf('/');
@@ -131,7 +239,40 @@ function fillDestFilename(id) {
fname = path.substring(backslash+1, 10000);
}
+ // Clear the filename if it does not have a valid extension.
+ // URLs are less likely to have a useful extension, so don't include them in the
+ // extension check.
+ if( wgFileExtensions && id != 'wpUploadFileURL' ) {
+ var found = false;
+ if( fname.lastIndexOf( '.' ) != -1 ) {
+ var ext = fname.substr( fname.lastIndexOf( '.' ) + 1 );
+ for( var i = 0; i < wgFileExtensions.length; i++ ) {
+ if( wgFileExtensions[i].toLowerCase() == ext.toLowerCase() ) {
+ found = true;
+ break;
+ }
+ }
+ }
+ if( !found ) {
+ // Not a valid extension
+ // Clear the upload and set mw-upload-permitted to error
+ document.getElementById(id).value = '';
+ var e = document.getElementById( 'mw-upload-permitted' );
+ if( e ) e.className = 'error';
+
+ var e = document.getElementById( 'mw-upload-prohibited' );
+ if( e ) e.className = 'error';
+
+ // Clear wpDestFile as well
+ var e = document.getElementById( 'wpDestFile' )
+ if( e ) e.value = '';
+
+ return false;
+ }
+ }
+
// Capitalise first letter and replace spaces by underscores
+ // FIXME: $wgCapitalizedNamespaces
fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
// Output result
@@ -154,11 +295,11 @@ function toggleFilenameFiller() {
}
var wgUploadLicenseObj = {
-
+
'responseCache' : { '' : '' },
'fetchPreview': function( license ) {
- if( !wgAjaxLicensePreview || !sajax_init_object() ) return;
+ if( !wgAjaxLicensePreview ) return;
for (cached in this.responseCache) {
if (cached == license) {
this.showPreview( this.responseCache[license] );
@@ -166,17 +307,29 @@ var wgUploadLicenseObj = {
}
}
injectSpinner( document.getElementById( 'wpLicense' ), 'license' );
- sajax_do_call( 'UploadForm::ajaxGetLicensePreview', [license],
- function( result ) {
- wgUploadLicenseObj.processResult( result, license );
- }
- );
+
+ var title = document.getElementById('wpDestFile').value;
+ if ( !title ) title = 'File:Sample.jpg';
+
+ var url = wgScriptPath + '/api' + wgScriptExtension
+ + '?action=parse&text={{' + encodeURIComponent( license ) + '}}'
+ + '&title=' + encodeURIComponent( title )
+ + '&prop=text&pst&format=json';
+
+ var req = sajax_init_object();
+ req.onreadystatechange = function() {
+ if ( req.readyState == 4 && req.status == 200 )
+ wgUploadLicenseObj.processResult( eval( '(' + req.responseText + ')' ), license );
+ };
+ req.open( 'GET', url, true );
+ req.send( '' );
},
'processResult' : function( result, license ) {
removeSpinner( 'license' );
- this.showPreview( result.responseText );
- this.responseCache[license] = result.responseText;
+ this.responseCache[license] = result['parse']['text']['*'];
+ this.showPreview( this.responseCache[license] );
+
},
'showPreview' : function( preview ) {
@@ -184,7 +337,7 @@ var wgUploadLicenseObj = {
if( previewPanel.innerHTML != preview )
previewPanel.innerHTML = preview;
}
-
+
}
-addOnloadHook( licenseSelectorFixup ); \ No newline at end of file
+addOnloadHook( wgUploadSetup );
diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js
index 82fe033e..acdd7281 100644
--- a/skins/common/wikibits.js
+++ b/skins/common/wikibits.js
@@ -12,7 +12,7 @@ if (webkit_match) {
}
// For accesskeys; note that FF3+ is included here!
var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
-var is_ff2_ = /firefox\/2/.test( clientPC );
+var ff2_bugs = /firefox\/2/.test( clientPC );
// These aren't used here, but some custom scripts rely on them
var is_ff2_win = is_ff2 && clientPC.indexOf('windows') != -1;
var is_ff2_x11 = is_ff2 && clientPC.indexOf('x11') != -1;
@@ -20,7 +20,18 @@ if (clientPC.indexOf('opera') != -1) {
var is_opera = true;
var is_opera_preseven = window.opera && !document.childNodes;
var is_opera_seven = window.opera && document.childNodes;
- var is_opera_95 = /opera\/(9.[5-9]|[1-9][0-9])/.test( clientPC );
+ var is_opera_95 = /opera\/(9\.[5-9]|[1-9][0-9])/.test( clientPC );
+ var opera6_bugs = is_opera_preseven;
+ var opera7_bugs = is_opera_seven && !is_opera_95;
+ var opera95_bugs = /opera\/(9\.5)/.test( clientPC );
+}
+// As recommended by <http://msdn.microsoft.com/en-us/library/ms537509.aspx>,
+// avoiding false positives from moronic extensions that append to the IE UA
+// string (bug 23171)
+var ie6_bugs = false;
+if ( /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) != null
+&& parseFloat( RegExp.$1 ) <= 6.0 ) {
+ ie6_bugs = true;
}
// Global external objects used by this script.
@@ -33,170 +44,187 @@ if (!window.onloadFuncts) {
var onloadFuncts = [];
}
-function addOnloadHook(hookFunct) {
+function addOnloadHook( hookFunct ) {
// Allows add-on scripts to add onload functions
- if(!doneOnloadHook) {
+ if( !doneOnloadHook ) {
onloadFuncts[onloadFuncts.length] = hookFunct;
} else {
hookFunct(); // bug in MSIE script loading
}
}
-function hookEvent(hookName, hookFunct) {
- addHandler(window, hookName, hookFunct);
+function hookEvent( hookName, hookFunct ) {
+ addHandler( window, hookName, hookFunct );
}
-function importScript(page) {
+function importScript( page ) {
+ // TODO: might want to introduce a utility function to match wfUrlencode() in PHP
var uri = wgScript + '?title=' +
- encodeURIComponent(page.replace(/ /g,'_')).replace('%2F','/').replace('%3A',':') +
+ encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') +
'&action=raw&ctype=text/javascript';
- return importScriptURI(uri);
+ return importScriptURI( uri );
}
-
+
var loadedScripts = {}; // included-scripts tracker
-function importScriptURI(url) {
- if (loadedScripts[url]) {
+function importScriptURI( url ) {
+ if ( loadedScripts[url] ) {
return null;
}
loadedScripts[url] = true;
- var s = document.createElement('script');
- s.setAttribute('src',url);
- s.setAttribute('type','text/javascript');
- document.getElementsByTagName('head')[0].appendChild(s);
+ var s = document.createElement( 'script' );
+ s.setAttribute( 'src', url );
+ s.setAttribute( 'type', 'text/javascript' );
+ document.getElementsByTagName('head')[0].appendChild( s );
return s;
}
-
-function importStylesheet(page) {
- return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g,'_')));
+
+function importStylesheet( page ) {
+ return importStylesheetURI( wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent( page.replace(/ /g,'_') ) );
}
-
-function importStylesheetURI(url) {
- return document.createStyleSheet ? document.createStyleSheet(url) : appendCSS('@import "' + url + '";');
+
+function importStylesheetURI( url, media ) {
+ var l = document.createElement( 'link' );
+ l.type = 'text/css';
+ l.rel = 'stylesheet';
+ l.href = url;
+ if( media ) {
+ l.media = media;
+ }
+ document.getElementsByTagName('head')[0].appendChild( l );
+ return l;
}
-
-function appendCSS(text) {
- var s = document.createElement('style');
+
+function appendCSS( text ) {
+ var s = document.createElement( 'style' );
s.type = 'text/css';
s.rel = 'stylesheet';
- if (s.styleSheet) s.styleSheet.cssText = text //IE
- else s.appendChild(document.createTextNode(text + '')) //Safari sometimes borks on null
- document.getElementsByTagName('head')[0].appendChild(s);
+ if ( s.styleSheet ) {
+ s.styleSheet.cssText = text; // IE
+ } else {
+ s.appendChild( document.createTextNode( text + '' ) ); // Safari sometimes borks on null
+ }
+ document.getElementsByTagName('head')[0].appendChild( s );
return s;
}
-// special stylesheet links
-if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {
- if (is_opera_preseven) {
- importStylesheetURI(stylepath+'/'+skin+'/Opera6Fixes.css');
- } else if (is_opera_seven && !is_opera_95) {
- importStylesheetURI(stylepath+'/'+skin+'/Opera7Fixes.css');
- } else if (is_opera_95) {
- importStylesheetURI(stylepath+'/'+skin+'/Opera9Fixes.css');
- } else if (is_ff2_) {
- importStylesheetURI(stylepath+'/'+skin+'/FF2Fixes.css');
+// Special stylesheet links for Monobook only (see bug 14717)
+if ( typeof stylepath != 'undefined' && skin == 'monobook' ) {
+ if ( opera6_bugs ) {
+ importStylesheetURI( stylepath + '/' + skin + '/Opera6Fixes.css' );
+ } else if ( opera7_bugs ) {
+ importStylesheetURI( stylepath + '/' + skin + '/Opera7Fixes.css' );
+ } else if ( opera95_bugs ) {
+ importStylesheetURI( stylepath + '/' + skin + '/Opera9Fixes.css' );
+ } else if ( ff2_bugs ) {
+ importStylesheetURI( stylepath + '/' + skin + '/FF2Fixes.css' );
}
}
-if (wgBreakFrames) {
+
+if ( wgBreakFrames ) {
// Un-trap us from framesets
- if (window.top != window) {
+ if ( window.top != window ) {
window.top.location = window.location;
}
}
function showTocToggle() {
- if (document.createTextNode) {
+ if ( document.createTextNode ) {
// Uses DOM calls to avoid document.write + XHTML issues
- var linkHolder = document.getElementById('toctitle');
- if (!linkHolder) {
+ 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');
+ var outerSpan = document.createElement( 'span' );
outerSpan.className = 'toctoggle';
- var toggleLink = document.createElement('a');
+ var toggleLink = document.createElement( 'a' );
toggleLink.id = 'togglelink';
toggleLink.className = 'internal';
toggleLink.href = 'javascript:toggleToc()';
- toggleLink.appendChild(document.createTextNode(tocHideText));
+ toggleLink.appendChild( document.createTextNode( tocHideText ) );
- outerSpan.appendChild(document.createTextNode('['));
- outerSpan.appendChild(toggleLink);
- outerSpan.appendChild(document.createTextNode(']'));
+ outerSpan.appendChild( document.createTextNode( '[' ) );
+ outerSpan.appendChild( toggleLink );
+ outerSpan.appendChild( document.createTextNode( ']' ) );
- linkHolder.appendChild(document.createTextNode(' '));
- linkHolder.appendChild(outerSpan);
+ linkHolder.appendChild( document.createTextNode( ' ' ) );
+ linkHolder.appendChild( outerSpan );
- var cookiePos = document.cookie.indexOf("hidetoc=");
- if (cookiePos > -1 && document.cookie.charAt(cookiePos + 8) == 1) {
+ var cookiePos = document.cookie.indexOf( "hidetoc=" );
+ if ( cookiePos > -1 && document.cookie.charAt( cookiePos + 8 ) == 1 ) {
toggleToc();
}
}
}
-function changeText(el, newText) {
+function changeText( el, newText ) {
// Safari work around
- if (el.innerText) {
+ if ( el.innerText ) {
el.innerText = newText;
- } else if (el.firstChild && el.firstChild.nodeValue) {
+ } else if ( el.firstChild && el.firstChild.nodeValue ) {
el.firstChild.nodeValue = newText;
}
}
function toggleToc() {
+ var tocmain = document.getElementById( 'toc' );
var toc = document.getElementById('toc').getElementsByTagName('ul')[0];
- var toggleLink = document.getElementById('togglelink');
+ var toggleLink = document.getElementById( 'togglelink' );
- if (toc && toggleLink && toc.style.display == 'none') {
- changeText(toggleLink, tocHideText);
+ if ( toc && toggleLink && toc.style.display == 'none' ) {
+ changeText( toggleLink, tocHideText );
toc.style.display = 'block';
document.cookie = "hidetoc=0";
+ tocmain.className = 'toc';
} else {
- changeText(toggleLink, tocShowText);
+ changeText( toggleLink, tocShowText );
toc.style.display = 'none';
document.cookie = "hidetoc=1";
+ tocmain.className = 'toc tochidden';
}
}
var mwEditButtons = [];
var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js
-function escapeQuotes(text) {
- var re = new RegExp("'","g");
- text = text.replace(re,"\\'");
- re = new RegExp("\\n","g");
- text = text.replace(re,"\\n");
- return escapeQuotesHTML(text);
-}
-
-function escapeQuotesHTML(text) {
- var re = new RegExp('&',"g");
- text = text.replace(re,"&amp;");
- re = new RegExp('"',"g");
- text = text.replace(re,"&quot;");
- re = new RegExp('<',"g");
- text = text.replace(re,"&lt;");
- re = new RegExp('>',"g");
- text = text.replace(re,"&gt;");
- return text;
+function escapeQuotes( text ) {
+ var re = new RegExp( "'", "g" );
+ text = text.replace( re, "\\'" );
+ re = new RegExp( "\\n", "g" );
+ text = text.replace( re, "\\n" );
+ return escapeQuotesHTML( text );
}
+function escapeQuotesHTML( text ) {
+ var re = new RegExp( '&', "g" );
+ text = text.replace( re, "&amp;" );
+ re = new RegExp( '"', "g" );
+ text = text.replace( re, "&quot;" );
+ re = new RegExp( '<', "g" );
+ text = text.replace( re, "&lt;" );
+ re = new RegExp( '>', "g" );
+ text = text.replace( re, "&gt;" );
+ return text;
+}
/**
* Set the accesskey prefix based on browser detection.
*/
var tooltipAccessKeyPrefix = 'alt-';
-if (is_opera) {
+if ( is_opera ) {
tooltipAccessKeyPrefix = 'shift-esc-';
-} else if (!is_safari_win && is_safari && webkit_version > 526) {
+} else if ( !is_safari_win && is_safari && webkit_version > 526 ) {
tooltipAccessKeyPrefix = 'ctrl-alt-';
-} else if (!is_safari_win && (is_safari
+} else if ( !is_safari_win && ( is_safari
|| clientPC.indexOf('mac') != -1
- || clientPC.indexOf('konqueror') != -1 )) {
+ || clientPC.indexOf('konqueror') != -1 ) ) {
tooltipAccessKeyPrefix = 'ctrl-';
-} else if (is_ff2) {
+} else if ( is_ff2 ) {
tooltipAccessKeyPrefix = 'alt-shift-';
}
var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
@@ -211,23 +239,32 @@ var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
*/
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") );
+ // Rather than scan all links on the whole page, we can just scan these
+ // containers which contain the relevant links. This is really just an
+ // optimization technique.
+ var linkContainers = [
+ 'column-one', // Monobook and Modern
+ 'mw-head', 'mw-panel', 'p-logo' // Vector
+ ];
+ for ( var i in linkContainers ) {
+ var linkContainer = document.getElementById( linkContainers[i] );
+ if ( linkContainer ) {
+ updateTooltipAccessKeys( linkContainer.getElementsByTagName( 'a' ) );
+ }
+ }
// these are rare enough that no such optimization is needed
- updateTooltipAccessKeys( document.getElementsByTagName("input") );
- updateTooltipAccessKeys( document.getElementsByTagName("label") );
+ updateTooltipAccessKeys( document.getElementsByTagName( 'input' ) );
+ updateTooltipAccessKeys( document.getElementsByTagName( 'label' ) );
return;
}
for ( var i = 0; i < nodeList.length; i++ ) {
var element = nodeList[i];
- var tip = element.getAttribute("title");
- if ( tip && tooltipAccessKeyRegexp.exec(tip) ) {
+ var tip = element.getAttribute( 'title' );
+ if ( tip && tooltipAccessKeyRegexp.exec( tip ) ) {
tip = tip.replace(tooltipAccessKeyRegexp,
- "["+tooltipAccessKeyPrefix+"$5]");
- element.setAttribute("title", tip );
+ '[' + tooltipAccessKeyPrefix + "$5]");
+ element.setAttribute( 'title', tip );
}
}
}
@@ -260,54 +297,75 @@ function updateTooltipAccessKeys( nodeList ) {
*
* @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 ) );
+function addPortletLink( portlet, href, text, id, tooltip, accesskey, nextnode ) {
+ var root = document.getElementById( portlet );
+ if ( !root ) {
+ return null;
+ }
+ var node = root.getElementsByTagName( 'ul' )[0];
+ if ( !node ) {
+ return null;
+ }
+
+ // unhide portlet if it was hidden before
+ root.className = root.className.replace( /(^| )emptyPortlet( |$)/, "$2" );
+
+ var span = document.createElement( 'span' );
+ span.appendChild( document.createTextNode( text ) );
+
+ var link = document.createElement( 'a' );
+ link.appendChild( span );
link.href = href;
- var item = document.createElement( "li" );
+ var item = document.createElement( 'li' );
item.appendChild( link );
- if ( id ) item.id = id;
+ if ( id ) {
+ item.id = id;
+ }
if ( accesskey ) {
- link.setAttribute( "accesskey", accesskey );
- tooltip += " ["+accesskey+"]";
+ link.setAttribute( 'accesskey', accesskey );
+ tooltip += ' [' + accesskey + ']';
}
if ( tooltip ) {
- link.setAttribute( "title", tooltip );
+ link.setAttribute( 'title', tooltip );
}
if ( accesskey && tooltip ) {
updateTooltipAccessKeys( new Array( link ) );
}
- if ( nextnode && nextnode.parentNode == node )
+ if ( nextnode && nextnode.parentNode == node ) {
node.insertBefore( item, nextnode );
- else
+ } else {
node.appendChild( item ); // IE compatibility (?)
+ }
return item;
}
-function getInnerText(el) {
- if (typeof el == "string") return el;
- if (typeof el == "undefined") { return el };
- if (el.textContent) return el.textContent; // not needed but it is faster
- if (el.innerText) return el.innerText; // IE doesn't have textContent
- var str = "";
+function getInnerText( el ) {
+ if ( typeof el == 'string' ) {
+ return el;
+ }
+ if ( typeof el == 'undefined' ) {
+ return el;
+ }
+ if ( el.textContent ) {
+ return el.textContent; // not needed but it is faster
+ }
+ if ( el.innerText ) {
+ return el.innerText; // IE doesn't have textContent
+ }
+ 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]);
+ 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
+ case 3: // TEXT_NODE
str += cs[i].nodeValue;
break;
}
@@ -315,63 +373,9 @@ function getInnerText(el) {
return str;
}
-
-/**
- * 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
- */
+/* Dummy for deprecated function */
+window.ta = [];
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 = [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) {
- var a = null;
- var ak = '';
- // Are we putting accesskey in it
- if (ta[id][0].length > 0) {
- // Is this object a object? If not assume it's the next child.
-
- if (n.nodeName.toLowerCase() == "a") {
- a = n;
- } else {
- a = n.childNodes[0];
- }
- // Don't add an accesskey for the watch tab if the watch
- // checkbox is also available.
- if (a && ((id != 'ca-watch' && id != 'ca-unwatch') || !watchCheckboxExists)) {
- a.accessKey = ta[id][0];
- ak = ' ['+tooltipAccessKeyPrefix+ta[id][0]+']';
- }
- } else {
- // We don't care what type the object is when assigning tooltip
- a = n;
- ak = '';
- }
-
- if (a) {
- a.title = ta[id][1]+ak;
- }
- }
- }
}
var checkboxes;
@@ -380,21 +384,25 @@ var lastCheckbox;
function setupCheckboxShiftClick() {
checkboxes = [];
lastCheckbox = null;
- var inputs = document.getElementsByTagName('input');
- addCheckboxClickHandlers(inputs);
+ var inputs = document.getElementsByTagName( 'input' );
+ addCheckboxClickHandlers( inputs );
}
-function addCheckboxClickHandlers(inputs, start) {
- if ( !start) start = 0;
+function addCheckboxClickHandlers( inputs, start ) {
+ if ( !start ) {
+ start = 0;
+ }
var finish = start + 250;
- if ( finish > inputs.length )
+ if ( finish > inputs.length ) {
finish = inputs.length;
+ }
for ( var i = start; i < finish; i++ ) {
var cb = inputs[i];
- if ( !cb.type || cb.type.toLowerCase() != 'checkbox' )
+ if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) {
continue;
+ }
var end = checkboxes.length;
checkboxes[end] = cb;
cb.index = end;
@@ -402,14 +410,14 @@ function addCheckboxClickHandlers(inputs, start) {
}
if ( finish < inputs.length ) {
- setTimeout( function () {
- addCheckboxClickHandlers(inputs, finish);
+ setTimeout( function() {
+ addCheckboxClickHandlers( inputs, finish );
}, 200 );
}
}
-function checkboxClickHandler(e) {
- if (typeof e == 'undefined') {
+function checkboxClickHandler( e ) {
+ if ( typeof e == 'undefined' ) {
e = window.event;
}
if ( !e.shiftKey || lastCheckbox === null ) {
@@ -425,28 +433,16 @@ function checkboxClickHandler(e) {
start = lastCheckbox;
finish = this.index - 1;
}
- for (var i = start; i <= finish; ++i ) {
+ for ( var i = start; i <= finish; ++i ) {
checkboxes[i].checked = endState;
+ if( i > start && typeof checkboxes[i].onchange == 'function' ) {
+ checkboxes[i].onchange(); // fire triggers
+ }
}
lastCheckbox = this.index;
return true;
}
-function toggle_element_activation(ida,idb) {
- if (!document.getElementById) {
- return;
- }
- document.getElementById(ida).disabled=true;
- document.getElementById(idb).disabled=false;
-}
-
-function toggle_element_check(ida,idb) {
- if (!document.getElementById) {
- return;
- }
- document.getElementById(ida).checked=true;
- document.getElementById(idb).checked=false;
-}
/*
Written by Jonathan Snook, http://www.snook.ca/jonathan
@@ -454,68 +450,71 @@ function toggle_element_check(ida,idb) {
Author says "The credit comment is all it takes, no license. Go crazy with it!:-)"
From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
*/
-function getElementsByClassName(oElm, strTagName, oClassNames){
+function getElementsByClassName( oElm, strTagName, oClassNames ) {
var arrReturnElements = new Array();
- if ( typeof( oElm.getElementsByClassName ) == "function" ) {
+ if ( typeof( oElm.getElementsByClassName ) == 'function' ) {
/* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
var arrNativeReturn = oElm.getElementsByClassName( oClassNames );
- if ( strTagName == "*" )
+ if ( strTagName == '*' ) {
return arrNativeReturn;
- for ( var h=0; h < arrNativeReturn.length; h++ ) {
- if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() )
+ }
+ for ( var h = 0; h < arrNativeReturn.length; h++ ) {
+ if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() ) {
arrReturnElements[arrReturnElements.length] = arrNativeReturn[h];
+ }
}
return arrReturnElements;
}
- var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
+ var arrElements = ( strTagName == '*' && oElm.all ) ? oElm.all : oElm.getElementsByTagName( strTagName );
var arrRegExpClassNames = new Array();
- if(typeof oClassNames == "object"){
- for(var i=0; i<oClassNames.length; i++){
+ if( typeof oClassNames == 'object' ) {
+ for( var i = 0; i < oClassNames.length; i++ ) {
arrRegExpClassNames[arrRegExpClassNames.length] =
new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)");
}
- }
- else{
+ } else {
arrRegExpClassNames[arrRegExpClassNames.length] =
new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)");
}
var oElement;
var bMatchesAll;
- for(var j=0; j<arrElements.length; j++){
+ for( var j = 0; j < arrElements.length; j++ ) {
oElement = arrElements[j];
bMatchesAll = true;
- for(var k=0; k<arrRegExpClassNames.length; k++){
- if(!arrRegExpClassNames[k].test(oElement.className)){
+ for( var k = 0; k < arrRegExpClassNames.length; k++ ) {
+ if( !arrRegExpClassNames[k].test( oElement.className ) ) {
bMatchesAll = false;
break;
}
}
- if(bMatchesAll){
+ if( bMatchesAll ) {
arrReturnElements[arrReturnElements.length] = oElement;
}
}
- return (arrReturnElements)
+ return ( arrReturnElements );
}
-function redirectToFragment(fragment) {
+function redirectToFragment( fragment ) {
var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
- if (match) {
- var webKitVersion = parseInt(match[1]);
- if (webKitVersion < 420) {
+ if ( match ) {
+ var webKitVersion = parseInt( match[1] );
+ if ( webKitVersion < 420 ) {
// Released Safari w/ WebKit 418.9.1 messes up horribly
// Nightlies of 420+ are ok
return;
}
}
- if (is_gecko) {
+ if ( is_gecko ) {
// Mozilla needs to wait until after load, otherwise the window doesn't scroll
- addOnloadHook(function () {
- if (window.location.hash == "")
+ addOnloadHook(function() {
+ if ( window.location.hash == '' ) {
window.location.hash = fragment;
+ }
});
} else {
- if (window.location.hash == "")
+ if ( window.location.hash == '' ) {
window.location.hash = fragment;
+ }
}
}
@@ -530,11 +529,11 @@ function redirectToFragment(fragment) {
* @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_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 = false;
var ts_number_transform_table = null;
var ts_number_regex = null;
@@ -542,33 +541,34 @@ var ts_number_regex = null;
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);
+ 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]);
+ ts_makeSortable( tables[ti] );
}
}
-function ts_makeSortable(table) {
+function ts_makeSortable( table ) {
var firstRow;
- if (table.rows && table.rows.length > 0) {
- if (table.tHead && table.tHead.rows.length > 0) {
+ 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;
+ 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++) {
+ for ( var i = 0; i < firstRow.cells.length; i++ ) {
var cell = firstRow.cells[i];
- if ((" "+cell.className+" ").indexOf(" unsortable ") == -1) {
- cell.innerHTML += '&nbsp;&nbsp;'
- + '<a href="#" class="sortheader" '
+ if ( (' ' + cell.className + ' ').indexOf(' unsortable ') == -1 ) {
+ cell.innerHTML += '<a href="#" class="sortheader" '
+ 'onclick="ts_resortTable(this);return false;">'
+ '<span class="sortarrow">'
+ '<img src="'
@@ -577,16 +577,16 @@ function ts_makeSortable(table) {
+ '" alt="&darr;"/></span></a>';
}
}
- if (ts_alternate_row_colors) {
- ts_alternate(table);
+ if ( ts_alternate_row_colors ) {
+ ts_alternate( table );
}
}
-function ts_getInnerText(el) {
+function ts_getInnerText( el ) {
return getInnerText( el );
}
-function ts_resortTable(lnk) {
+function ts_resortTable( lnk ) {
// get the span
var span = lnk.getElementsByTagName('span')[0];
@@ -595,104 +595,118 @@ function ts_resortTable(lnk) {
var column = td.cellIndex;
var table = tr.parentNode;
- while (table && !(table.tagName && table.tagName.toLowerCase() == 'table'))
+ while ( table && !( table.tagName && table.tagName.toLowerCase() == 'table' ) ) {
table = table.parentNode;
- if (!table) return;
+ }
+ if ( !table ) {
+ return;
+ }
- if (table.rows.length <= 1) return;
+ if ( table.rows.length <= 1 ) {
+ return;
+ }
// Generate the number transform table if it's not done already
- if (ts_number_transform_table == null) {
+ 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 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) {
+ 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;
+ 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)) {
+ 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)) {
+ } 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)) {
+ } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d$/.test( itm ) ) {
preprocessor = ts_dateToSortKey;
- // pound dollar euro yen currency cents
- } else if (/(^[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/.test(itm)) {
+ // (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)) {
+ } else if ( ts_number_regex.test( itm ) ) {
preprocessor = ts_parseFloat;
}
- var reverse = (span.getAttribute("sortdir") == 'down');
+ var reverse = ( span.getAttribute( 'sortdir' ) == 'down' );
var newRows = new Array();
var staticRows = new Array();
- for (var j = rowStart; j < table.rows.length; j++) {
+ 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]);
- var oldIndex = (reverse ? -j : j);
- var preprocessed = preprocessor( keyText );
+ 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[newRows.length] = new Array( row, preprocessed, oldIndex );
+ } else {
+ staticRows[staticRows.length] = new Array( row, false, j-rowStart );
+ }
}
- newRows.sort(sortfn);
+ newRows.sort( sortfn );
var arrowHTML;
- if (reverse) {
- arrowHTML = '<img src="'+ ts_image_path + ts_image_down + '" alt="&darr;"/>';
+ if ( reverse ) {
+ arrowHTML = '<img src="' + ts_image_path + ts_image_down + '" alt="&darr;"/>';
newRows.reverse();
- span.setAttribute('sortdir','up');
+ span.setAttribute( 'sortdir', 'up' );
} else {
- arrowHTML = '<img src="'+ ts_image_path + ts_image_up + '" alt="&uarr;"/>';
- span.setAttribute('sortdir','down');
+ arrowHTML = '<img src="' + ts_image_path + ts_image_up + '" alt="&uarr;"/>';
+ span.setAttribute( 'sortdir', 'down' );
}
- for (var i = 0; i < staticRows.length; i++) {
+ for ( var i = 0; i < staticRows.length; i++ ) {
var row = staticRows[i];
- newRows.splice(row[2], 0, row);
+ 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]);
+ 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]);
+ 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="&darr;"/>';
+ 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="&darr;"/>';
}
span.innerHTML = arrowHTML;
- if (ts_alternate_row_colors) {
- ts_alternate(table);
+ if ( ts_alternate_row_colors ) {
+ ts_alternate( table );
}
}
function ts_initTransformTable() {
- if ( typeof wgSeparatorTransformTable == "undefined"
+ if ( typeof wgSeparatorTransformTable == 'undefined'
|| ( wgSeparatorTransformTable[0] == '' && wgDigitTransformTable[2] == '' ) )
{
digitClass = "[0-9,.]";
@@ -703,13 +717,13 @@ function ts_initTransformTable() {
// Separators
ascii = wgSeparatorTransformTable[0].split("\t");
localised = wgSeparatorTransformTable[1].split("\t");
- for ( var i = 0; i < ascii.length; i++ ) {
+ 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++ ) {
+ for ( var i = 0; i < ascii.length; i++ ) {
ts_number_transform_table[localised[i]] = ascii[i];
}
@@ -718,11 +732,11 @@ function ts_initTransformTable() {
maxDigitLength = 1;
for ( var digit in ts_number_transform_table ) {
// Escape regex metacharacters
- digits.push(
+ digits.push(
digit.replace( /[\\\\$\*\+\?\.\(\)\|\{\}\[\]\-]/,
function( s ) { return '\\' + s; } )
);
- if (digit.length > maxDigitLength) {
+ if ( digit.length > maxDigitLength ) {
maxDigitLength = digit.length;
}
}
@@ -737,9 +751,9 @@ function ts_initTransformTable() {
// if percents and regular numbers aren't being mixed.
ts_number_regex = new RegExp(
"^(" +
- "[+-]?[0-9][0-9,]*(\\.[0-9,]*)?(E[+-]?[0-9][0-9,]*)?" + // Fortran-style scientific
+ "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific
"|" +
- "[+-]?" + digitClass + "+%?" + // Generic localised
+ "[-+\u2212]?" + digitClass + "+%?" + // Generic localised
")$", "i"
);
}
@@ -748,57 +762,81 @@ function ts_toLowerCase( s ) {
return s.toLowerCase();
}
-function ts_dateToSortKey(date) {
+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);
+ 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);
+ 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;
+ } 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);
+ 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 yr + date.substr( 0, 2 ) + date.substr( 3, 2 );
}
}
- return "00000000";
+ return '00000000';
}
function ts_parseFloat( s ) {
if ( !s ) {
return 0;
}
- if (ts_number_transform_table != false) {
+ 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) {
+ if ( c in ts_number_transform_table ) {
newNum += ts_number_transform_table[c];
} else {
newNum += c;
@@ -806,37 +844,37 @@ function ts_parseFloat( s ) {
}
s = newNum;
}
-
- num = parseFloat(s.replace(/,/g, ""));
- return (isNaN(num) ? 0 : num);
+ num = parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') );
+ return ( isNaN( num ) ? -Infinity : num );
}
function ts_currencyToSortKey( s ) {
- return ts_parseFloat(s.replace(/[^0-9.,]/g,''));
+ return ts_parseFloat(s.replace(/[^-\u22120-9.,]/g,''));
}
-function ts_sort_generic(a, b) {
+function ts_sort_generic( a, b ) {
return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2];
}
-function ts_alternate(table) {
+function ts_alternate( table ) {
// Take object table and get all it's tbodies.
- var tableBodies = table.getElementsByTagName("tbody");
+ var tableBodies = table.getElementsByTagName( 'tbody' );
// Loop through these tbodies
- for (var i = 0; i < tableBodies.length; i++) {
+ for ( var i = 0; i < tableBodies.length; i++ ) {
// Take the tbody, and get all it's rows
- var tableRows = tableBodies[i].getElementsByTagName("tr");
+ 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++) {
+ 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] + " ";
+ 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");
+ tableRows[j].className = newClassName + ( j % 2 == 0 ? 'even' : 'odd' );
}
}
}
@@ -844,8 +882,8 @@ function ts_alternate(table) {
/*
* 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.
@@ -872,7 +910,7 @@ function jsMsg( message, className ) {
messageDiv,
document.getElementById( 'content' ).firstChild
);
- } else if ( document.getElementById('content')
+ } else if ( document.getElementById( 'content' )
&& document.getElementById( 'article' ) ) {
// Non-Monobook but still recognizable (old-style)
document.getElementById( 'article').insertBefore(
@@ -887,15 +925,15 @@ function jsMsg( message, className ) {
messageDiv.setAttribute( 'id', 'mw-js-message' );
messageDiv.style.display = 'block';
if( className ) {
- messageDiv.setAttribute( 'class', 'mw-js-message-'+className );
+ messageDiv.setAttribute( 'class', 'mw-js-message-' + className );
}
-
- if (typeof message === 'object') {
- while (messageDiv.hasChildNodes()) // Remove old content
- messageDiv.removeChild(messageDiv.firstChild);
- messageDiv.appendChild (message); // Append new content
- }
- else {
+
+ if ( typeof message === 'object' ) {
+ while ( messageDiv.hasChildNodes() ) { // Remove old content
+ messageDiv.removeChild( messageDiv.firstChild );
+ }
+ messageDiv.appendChild( message ); // Append new content
+ } else {
messageDiv.innerHTML = message;
}
return true;
@@ -908,10 +946,10 @@ function jsMsg( message, className ) {
* @param id Identifier string (for use with removeSpinner(), below)
*/
function injectSpinner( element, id ) {
- var spinner = document.createElement( "img" );
- spinner.id = "mw-spinner-" + id;
- spinner.src = stylepath + "/common/images/spinner.gif";
- spinner.alt = spinner.title = "...";
+ var spinner = document.createElement( 'img' );
+ spinner.id = 'mw-spinner-' + id;
+ spinner.src = stylepath + '/common/images/spinner.gif';
+ spinner.alt = spinner.title = '...';
if( element.nextSibling ) {
element.parentNode.insertBefore( spinner, element.nextSibling );
} else {
@@ -925,7 +963,7 @@ function injectSpinner( element, id ) {
* @param id Identifier string
*/
function removeSpinner( id ) {
- var spinner = document.getElementById( "mw-spinner-" + id );
+ var spinner = document.getElementById( 'mw-spinner-' + id );
if( spinner ) {
spinner.parentNode.removeChild( spinner );
}
@@ -933,7 +971,7 @@ function removeSpinner( id ) {
function runOnloadHook() {
// don't run anything below this for non-dom browsers
- if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName)) {
+ if ( doneOnloadHook || !( document.getElementById && document.getElementsByTagName ) ) {
return;
}
@@ -942,12 +980,11 @@ function runOnloadHook() {
doneOnloadHook = true;
updateTooltipAccessKeys( null );
- akeytt( null );
setupCheckboxShiftClick();
sortables_init();
// Run any added-on functions
- for (var i = 0; i < onloadFuncts.length; i++) {
+ for ( var i = 0; i < onloadFuncts.length; i++ ) {
onloadFuncts[i]();
}
}
@@ -991,6 +1028,15 @@ function removeHandler( element, remove, handler ) {
element.detachEvent( 'on' + remove, handler );
}
}
-//note: all skins should call runOnloadHook() at the end of html output,
+// note: all skins should call runOnloadHook() at the end of html output,
// so the below should be redundant. It's there just in case.
-hookEvent("load", runOnloadHook);
+hookEvent( 'load', runOnloadHook );
+
+if ( ie6_bugs ) {
+ importScriptURI( stylepath + '/common/IEFixes.js' );
+}
+
+// For future use.
+mw = {};
+
+
diff --git a/skins/disabled/MonoBook.tpl b/skins/disabled/MonoBook.tpl
deleted file mode 100644
index 58bc4f5c..00000000
--- a/skins/disabled/MonoBook.tpl
+++ /dev/null
@@ -1,200 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang}" lang="{lang}" dir="{dir}">
-<head>
- <meta http-equiv="Content-Type" content="{~ mimetype}; charset={~ charset}" />
- {headlinks}
- {headscripts}
- <title>{pagetitle}</title>
- <style type="text/css" media="screen, projection">/*<![CDATA[*/ @import "{~ stylepath}/{~ stylename}/main.css?5"; /*]]>*/</style>
- <link rel="stylesheet" type="text/css" {if notprintable {media="print"}} href="{~ stylepath}/common/commonPrint.css" />
- <!--[if lt IE 5.5000]><style type="text/css">@import "{~ stylepath}/{~ stylename}/IE50Fixes.css";</style><![endif]-->
- <!--[if IE 5.5000]><style type="text/css">@import "{~ stylepath}/{~ stylename}/IE55Fixes.css";</style><![endif]-->
- <!--[if IE 6]><style type="text/css">@import "{~ stylepath}/{~ stylename}/IE60Fixes.css";</style><![endif]-->
- <!--[if IE 7]><style type="text/css">@import "{~ stylepath}/{~ stylename}/IE70Fixes.css?1";</style><![endif]-->
- <!--[if lt IE 7]><script type="{jsmimetype}" src="{~ stylepath}/common/IEFixes.js"></script>
- <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <script type="{jsmimetype}">var skin = '{~ skinname}';var stylepath = '{~ stylepath}';</script>
- <script type="{jsmimetype}" src="{~ stylepath}/common/wikibits.js"><!-- wikibits js --></script>
- {if jsvarurl {<script type="{jsmimetype}" src="{jsvarurl}"><!-- site js --></script>}}
- {if pagecss {<style type="text/css">{pagecss}</style>}}
- {usercss}
- {sitecss}
- {gencss}
- {if userjs {<script type="{jsmimetype}" src="{userjs}"></script>}}
- {if userjsprev {<script type="{jsmimetype}">{userjsprev}</script>}}
- {trackbackhtml}
-</head>
-<body {if body_ondblclick {ondblclick="{body_ondblclick}"}} {if body_onload {onload="{body_onload}" }} class="{~ nsclass} {~ dir}">
-<div id="globalWrapper">
- <div id="column-content">
- <div id="content">
- <a name="top" id="top"></a>
- {if sitenotice {<div id="siteNotice">{sitenotice}</div> }}
- <h1 class="firstHeading">{title}</h1>
- <div id="bodyContent">
- <h3 id="siteSub">{msg {tagline}}</h3>
- <div id="contentSub">{subtitle}</div>
- {if undelete {<div id="contentSub2"><span class="subpages">{undelete}</span></div> }}
- {if newtalk {<div class="usermessage">{newtalk}</div> }}
- {if showjumplinks {
- <div id="jump-to-nav">{msg {jumpto}} <a href="#column-one">{msg {jumptonavigation}}</a>,
- <a href="#searchInput">{msg {jumptosearch}}</a></div>
- }}
- <!-- start content -->
- {bodytext}
- {if catlinks {<div id="catlinks">{catlinks}</div> }}
- <!-- end content -->
- <div class="visualClear"></div>
- </div>
- </div>
- </div>
- <div id="column-one">
- <div id="p-cactions" class="portlet">
- <h5>{msg {views}}</h5>
- <ul>
- {if is_special {
- <li id="ca-article" class="selected"><a href="{request_url}">{msg {specialpage}}</a></li>
- } {
- <li id="ca-{nskey}" {selecttab {subject} subject_newclass}><a href="{subject_url}">{msg nskey}</a></li>
- <li id="ca-talk" {selecttab {talk} talk_newclass}><a href="{talk_url}">{msg {talk}}</a></li>
- {if can_edit {
- {if is_talk {
- <li id="ca-edit" {selecttab {edit} {istalk}}><a href="{edit_url}">{msg {edit}}</a></li>
- <li id="ca-addsection" {selecttab {addsection}}><a href="{localurl {action=edit&section=new}}">{msg {addsection}}</a></li>
- } {
- <li id="ca-edit" {selecttab {edit}}><a href="{edit_url}">{msg {edit}}</a></li>
- }}
- } {
- <li id="ca-viewsource" {selecttab {edit}}><a href="{edit_url}">{msg {viewsource}}</a></li>
- }}
-
- {if article_exists {
- <li id="ca-history" {selecttab {history}}><a href="{localurl {action=history}}">{msg {history_short}}</a></li>
- {if {{ is_allowed {protect} }} {
- {if is_ns_mediawiki {} {
- {if is_protected {
- <li id="ca-protect" {selecttab {protect}}><a href="{localurl {action=unprotect}}">{msg {unprotect}}</a></li>
- } {
- <li id="ca-protect" {selecttab {protect}}><a href="{localurl {action=protect}}">{msg {protect}}</a></li>
- }}
- }}
- }}
-
- {if {{ is_allowed {delete} }} {
- <li id="ca-delete" {selecttab {delete}}><a href="{localurl {action=delete}}">{msg {delete}}</a></li>
- }}
- {if {{ is_allowed {move} }} {
- {if can_move {
- <li id="ca-move" {selecttab {move}}><a href="{move_url}">{msg {move}}</a></li>
- }}
- }}
- {if is_loggedin {
- {if is_watching {
- <li id="ca-unwatch" {selecttab {watch}}><a href="{localurl {action=unwatch}}">{msg {unwatch}}</a></li>
- } {
- <li id="ca-watch" {selecttab {watch}}><a href="{localurl {action=watch}}">{msg {watch}}</a></li>
- }}
- }}
- }}
- }}
- {extratabs {<li id="ca-$id" $class><a href="$href">$text</a></li>}}
- </ul>
- </div>
- <div class="portlet" id="p-personal">
- <h5>{msg {personaltools}}</h5>
- <div class="pBody">
- <ul>
- {personal_urls { <li id="pt-$key" $classactive ><a href="$href" $class>$text</a></li> }}
- </ul>
- </div>
- </div>
- <div class="portlet" id="p-logo">
- <a style="background-image: url({~ logopath});" href="{mainpage}" title="{msg {mainpage}}"></a>
- </div>
- <script type="{jsmimetype}"> if (window.isMSIE55) fixalpha(); </script>
- {sidebar {
- <div class='portlet' id="p-$bar">
- <h5>$barname</h5>
- <div class='pBody'>
- <ul>
- } {
- </ul>
- </div>
- </div>
- } {<li id="$id" $classactive><a href="$href">$text</a></li>
- }
- }
-
- <div id="p-search" class="portlet">
- <h5><label for="searchInput">{msg {search}}</label></h5>
- <div id="searchBody" class="pBody">
- <form action="{searchaction}" id="searchform"><div>
- <input id="searchInput" name="search" type="text" {
- }{if {{fallbackmsg {accesskey-search} {} }} {accesskey="{fallbackmsg {accesskey-search} {} }"}}{
- }{if search { value="{search}"}} />
- <input type='submit' name="go" class="searchButton" id="searchGoButton" value="{msg {go}}" />&nbsp;
- <input type='submit' name="fulltext" class="searchButton" value="{msg {search}}" />
- </div></form>
- </div>
- </div>
- <div class="portlet" id="p-tb">
- <h5>{msg {toolbox}}</h5>
- <div class="pBody">
- <ul>
- {if notspecialpage {<li id="t-whatlinkshere"><a href="{nav_whatlinkshere}">{msg {whatlinkshere}}</a></li> }}
- {if article_exists {<li id="t-recentchangeslinked"><a href="{nav_recentchangeslinked}">{msg {recentchangeslinked}}</a></li> }}
- {if nav_trackbacklink {<li id="t-trackbacklink"><a href="{nav_trackbacklink}">{msg {trackbacklink}}</a></li>}}
- {if feeds
- {<li id="feedlinks">{feeds {<span id="feed-$key"><a href="$href">$text</a>&nbsp;</span>}}
- </li>}}
- {if is_userpage {
- <li id="t-contributions"><a href="{nav_contributions}">{msg {contributions}}</a></li>
- {if {{is_allowed {block}}} {<li id="t-blockip"><a href="{nav_blockip}">{msg {blockip}}</a></li>}}
- {if is_loggedin {<li id="t-emailuser"><a href="{nav_emailuser}">{msg {emailuser}}</a></li>}}
- }}
- {if nav_upload {<li id="t-upload"><a href="{nav_upload}">{msg {upload}}</a></li>}}
- {if nav_specialpages {<li id="t-specialpages"><a href="{nav_specialpages}">{msg {specialpages}}</a></li>}}
- {if nav_print {<li id="t-print"><a href="{nav_print}">{msg {printableversion}}</a></li>}}
- {if nav_permalink {<li id="t-permalink"><a href="{nav_permalink}">{msg {permalink}}</a></li>}}
- {if is_permalink {<li id="t-ispermalink">{msg {permalink}}</li>}}
-
- {toolboxend}
- </ul>
- </div>
- </div>
- {language_urls {
- <div id="p-lang" class="portlet">
- <h5>{msg {otherlanguages}}</h5>
- <div class="pBody">
- <ul>
- $body
- </ul>
- </div>
- </div>
- } {
- <li class="$class"><a href="$href">$text</a></li>
- }}
- </div><!-- end of the left (by default at least) column -->
- <div class="visualClear"></div>
- <div id="footer">
- {if poweredbyico { <div id="f-poweredbyico">{poweredbyico}</div> }}
- {if copyrightico { <div id="f-copyrightico">{copyrightico}</div> }}
-
- <ul id="f-list">
- {if lastmod { <li id="lastmod">{lastmod}</li> }}
- {if viewcount { <li id="viewcount">{viewcount}</li> }}
- {if numberofwatchingusers { <li id="numberofwatchingusers">{numberofwatchingusers}</li> }}
- {if credits { <li id="credits">{credits}</li> }}
- {if is_currentview { <li id="copyright">{normalcopyright}</li> }}
- {if usehistorycopyright { <li id="copyright">{historycopyright}</li> }}
- {if privacy { <li id="privacy">{privacy}</li> }}
- {if about { <li id="about">{about}</li> }}
- {if disclaimer { <li id="disclaimer">{disclaimer}</li> }}
- {if tagline { <li id="tagline">{tagline}</li> }}
- </ul>
- </div>
- <script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script>
-</div>
-{reporttime}
-{if {} { vim: set syn=html ts=2 : }}
-</body></html>
diff --git a/skins/disabled/MonoBookCBT.php b/skins/disabled/MonoBookCBT.php
deleted file mode 100644
index 0d693a86..00000000
--- a/skins/disabled/MonoBookCBT.php
+++ /dev/null
@@ -1,1389 +0,0 @@
-<?php
-
-if ( !defined( 'MEDIAWIKI' ) ) {
- die( "This file is part of MediaWiki, it is not a valid entry point\n" );
-}
-
-require_once( 'includes/cbt/CBTProcessor.php' );
-require_once( 'includes/cbt/CBTCompiler.php' );
-require_once( 'includes/SkinTemplate.php' );
-
-/**
- * MonoBook clone using the new dependency-tracking template processor.
- * EXPERIMENTAL - use only for testing and profiling at this stage.
- *
- * See includes/cbt/README for an explanation.
- *
- * The main thing that's missing is cache invalidation, on change of:
- * * messages
- * * user preferences
- * * source template
- * * source code and configuration files
- *
- * The other thing is that lots of dependencies that are declared in the callbacks
- * are not intelligently handled. There's some room for improvement there.
- *
- * The class is derived from SkinTemplate, but that's only temporary. Eventually
- * it'll be derived from Skin, and I've avoided using SkinTemplate functions as
- * much as possible. In fact, the only SkinTemplate dependencies I know of at the
- * moment are the functions to generate the gen=css and gen=js files.
- *
- */
-class SkinMonoBookCBT extends SkinTemplate {
- var $mOut, $mTitle;
- var $mStyleName = 'monobook';
- var $mCompiling = false;
- var $mFunctionCache = array();
-
- /******************************************************
- * General functions *
- ******************************************************/
-
- /** Execute the template and write out the result */
- function outputPage( &$out ) {
- echo $this->execute( $out );
- }
-
- function execute( &$out ) {
- global $wgTitle, $wgStyleDirectory, $wgParserCacheType;
- $fname = 'SkinMonoBookCBT::execute';
- wfProfileIn( $fname );
- wfProfileIn( "$fname-setup" );
- Skin::initPage( $out );
-
- $this->mOut =& $out;
- $this->mTitle =& $wgTitle;
-
- $sourceFile = "$wgStyleDirectory/MonoBook.tpl";
-
- wfProfileOut( "$fname-setup" );
-
- if ( $wgParserCacheType == CACHE_NONE ) {
- $template = file_get_contents( $sourceFile );
- $text = $this->executeTemplate( $template );
- } else {
- $compiled = $this->getCompiledTemplate( $sourceFile );
-
- wfProfileIn( "$fname-eval" );
- $text = eval( $compiled );
- wfProfileOut( "$fname-eval" );
- }
- wfProfileOut( $fname );
- return $text;
- }
-
- function getCompiledTemplate( $sourceFile ) {
- global $wgDBname, $wgMemc, $wgRequest, $wgUser, $parserMemc;
- $fname = 'SkinMonoBookCBT::getCompiledTemplate';
-
- $expiry = 3600;
-
- // Sandbox template execution
- if ( $this->mCompiling ) {
- return;
- }
-
- wfProfileIn( $fname );
-
- // Is the request an ordinary page view?
- if ( $wgRequest->wasPosted() ||
- count( array_diff( array_keys( $_GET ), array( 'title', 'useskin', 'recompile' ) ) ) != 0 )
- {
- $type = 'nonview';
- } else {
- $type = 'view';
- }
-
- // Per-user compiled template
- // Put all logged-out users on the same cache key
- $cacheKey = "$wgDBname:monobookcbt:$type:" . $wgUser->getId();
-
- $recompile = $wgRequest->getVal( 'recompile' );
- if ( $recompile == 'user' ) {
- $recompileUser = true;
- $recompileGeneric = false;
- } elseif ( $recompile ) {
- $recompileUser = true;
- $recompileGeneric = true;
- } else {
- $recompileUser = false;
- $recompileGeneric = false;
- }
-
- if ( !$recompileUser ) {
- $php = $parserMemc->get( $cacheKey );
- }
- if ( $recompileUser || !$php ) {
- if ( $wgUser->isLoggedIn() ) {
- // Perform staged compilation
- // First compile a generic template for all logged-in users
- $genericKey = "$wgDBname:monobookcbt:$type:loggedin";
- if ( !$recompileGeneric ) {
- $template = $parserMemc->get( $genericKey );
- }
- if ( $recompileGeneric || !$template ) {
- $template = file_get_contents( $sourceFile );
- $ignore = array( 'loggedin', '!loggedin dynamic' );
- if ( $type == 'view' ) {
- $ignore[] = 'nonview dynamic';
- }
- $template = $this->compileTemplate( $template, $ignore );
- $parserMemc->set( $genericKey, $template, $expiry );
- }
- } else {
- $template = file_get_contents( $sourceFile );
- }
-
- $ignore = array( 'lang', 'loggedin', 'user' );
- if ( $wgUser->isLoggedIn() ) {
- $ignore[] = '!loggedin dynamic';
- } else {
- $ignore[] = 'loggedin dynamic';
- }
- if ( $type == 'view' ) {
- $ignore[] = 'nonview dynamic';
- }
- $compiled = $this->compileTemplate( $template, $ignore );
-
- // Reduce whitespace
- // This is done here instead of in CBTProcessor because we can be
- // more sure it is safe here.
- $compiled = preg_replace( '/^[ \t]+/m', '', $compiled );
- $compiled = preg_replace( '/[\r\n]+/', "\n", $compiled );
-
- // Compile to PHP
- $compiler = new CBTCompiler( $compiled );
- $ret = $compiler->compile();
- if ( $ret !== true ) {
- echo $ret;
- wfErrorExit();
- }
- $php = $compiler->generatePHP( '$this' );
-
- $parserMemc->set( $cacheKey, $php, $expiry );
- }
- wfProfileOut( $fname );
- return $php;
- }
-
- function compileTemplate( $template, $ignore ) {
- $tp = new CBTProcessor( $template, $this, $ignore );
- $tp->mFunctionCache = $this->mFunctionCache;
-
- $this->mCompiling = true;
- $compiled = $tp->compile();
- $this->mCompiling = false;
-
- if ( $tp->getLastError() ) {
- // If there was a compile error, don't save the template
- // Instead just print the error and exit
- echo $compiled;
- wfErrorExit();
- }
- $this->mFunctionCache = $tp->mFunctionCache;
- return $compiled;
- }
-
- function executeTemplate( $template ) {
- $fname = 'SkinMonoBookCBT::executeTemplate';
- wfProfileIn( $fname );
- $tp = new CBTProcessor( $template, $this );
- $tp->mFunctionCache = $this->mFunctionCache;
-
- $this->mCompiling = true;
- $text = $tp->execute();
- $this->mCompiling = false;
-
- $this->mFunctionCache = $tp->mFunctionCache;
- wfProfileOut( $fname );
- return $text;
- }
-
- /******************************************************
- * Callbacks *
- ******************************************************/
-
- function lang() { return $GLOBALS['wgContLanguageCode']; }
-
- function dir() {
- global $wgContLang;
- return $wgContLang->isRTL() ? 'rtl' : 'ltr';
- }
-
- function mimetype() { return $GLOBALS['wgMimeType']; }
- function charset() { return $GLOBALS['wgOutputEncoding']; }
- function headlinks() {
- return cbt_value( $this->mOut->getHeadLinks(), 'dynamic' );
- }
- function headscripts() {
- return cbt_value( $this->mOut->getScript(), 'dynamic' );
- }
-
- function pagetitle() {
- return cbt_value( $this->mOut->getHTMLTitle(), array( 'title', 'lang' ) );
- }
-
- function stylepath() { return $GLOBALS['wgStylePath']; }
- function stylename() { return $this->mStyleName; }
-
- function notprintable() {
- global $wgRequest;
- return cbt_value( !$wgRequest->getBool( 'printable' ), 'nonview dynamic' );
- }
-
- function jsmimetype() { return $GLOBALS['wgJsMimeType']; }
-
- function jsvarurl() {
- global $wgUseSiteJs, $wgUser;
- if ( !$wgUseSiteJs ) return '';
-
- if ( $wgUser->isLoggedIn() ) {
- $url = self::makeUrl( '-','action=raw&smaxage=0&gen=js' );
- } else {
- $url = self::makeUrl( '-','action=raw&gen=js' );
- }
- return cbt_value( $url, 'loggedin' );
- }
-
- function pagecss() {
- global $wgHooks;
-
- $out = false;
- wfRunHooks( 'SkinTemplateSetupPageCss', array( &$out ) );
-
- // Unknown dependencies
- return cbt_value( $out, 'dynamic' );
- }
-
- function usercss() {
- if ( $this->isCssPreview() ) {
- global $wgRequest;
- $usercss = $this->makeStylesheetCdata( $wgRequest->getText('wpTextbox1') );
- } else {
- $usercss = $this->makeStylesheetLink( self::makeUrl($this->getUserPageText() .
- '/'.$this->mStyleName.'.css', 'action=raw&ctype=text/css' ) );
- }
-
- // Dynamic when not an ordinary page view, also depends on the username
- return cbt_value( $usercss, array( 'nonview dynamic', 'user' ) );
- }
-
- function sitecss() {
- global $wgUseSiteCss;
- if ( !$wgUseSiteCss ) {
- return '';
- }
-
- global $wgSquidMaxage, $wgContLang, $wgStylePath;
-
- $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
-
- $sitecss = '';
- if ( $wgContLang->isRTL() ) {
- $sitecss .= $this->makeStylesheetLink( $wgStylePath . '/' . $this->mStyleName . '/rtl.css' ) . "\n";
- }
-
- $sitecss .= $this->makeStylesheetLink( self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) ) . "\n";
- $sitecss .= $this->makeStylesheetLink( self::makeNSUrl( ucfirst( $this->mStyleName ) . '.css', $query, NS_MEDIAWIKI ) ) . "\n";
-
- // No deps
- return $sitecss;
- }
-
- function gencss() {
- global $wgUseSiteCss;
- if ( !$wgUseSiteCss ) return '';
-
- global $wgSquidMaxage, $wgUser, $wgAllowUserCss;
- if ( $this->isCssPreview() ) {
- $siteargs = '&smaxage=0&maxage=0';
- } else {
- $siteargs = '&maxage=' . $wgSquidMaxage;
- }
- if ( $wgAllowUserCss && $wgUser->isLoggedIn() ) {
- $siteargs .= '&ts={user_touched}';
- $isTemplate = true;
- } else {
- $isTemplate = false;
- }
-
- $link = $this->makeStylesheetLink( self::makeUrl('-','action=raw&gen=css' . $siteargs) ) . "\n";
-
- if ( $wgAllowUserCss ) {
- $deps = 'loggedin';
- } else {
- $deps = array();
- }
- return cbt_value( $link, $deps, $isTemplate );
- }
-
- function user_touched() {
- global $wgUser;
- return cbt_value( $wgUser->mTouched, 'dynamic' );
- }
-
- function userjs() {
- global $wgAllowUserJs, $wgJsMimeType;
- if ( !$wgAllowUserJs ) return '';
-
- if ( $this->isJsPreview() ) {
- $url = '';
- } else {
- $url = self::makeUrl($this->getUserPageText().'/'.$this->mStyleName.'.js', 'action=raw&ctype='.$wgJsMimeType.'&dontcountme=s');
- }
- return cbt_value( $url, array( 'nonview dynamic', 'user' ) );
- }
-
- function userjsprev() {
- global $wgAllowUserJs, $wgRequest;
- if ( !$wgAllowUserJs ) return '';
- if ( $this->isJsPreview() ) {
- $js = '/*<![CDATA[*/ ' . $wgRequest->getText('wpTextbox1') . ' /*]]>*/';
- } else {
- $js = '';
- }
- return cbt_value( $js, array( 'nonview dynamic' ) );
- }
-
- function trackbackhtml() {
- global $wgUseTrackbacks;
- if ( !$wgUseTrackbacks ) return '';
-
- if ( $this->mOut->isArticleRelated() ) {
- $tb = $this->mTitle->trackbackRDF();
- } else {
- $tb = '';
- }
- return cbt_value( $tb, 'dynamic' );
- }
-
- function body_ondblclick() {
- global $wgUser;
- if( $this->isEditable() && $wgUser->getOption("editondblclick") ) {
- $js = 'document.location = "' . $this->getEditUrl() .'";';
- } else {
- $js = '';
- }
-
- if ( User::getDefaultOption('editondblclick') ) {
- return cbt_value( $js, 'user', 'title' );
- } else {
- // Optimise away for logged-out users
- return cbt_value( $js, 'loggedin dynamic' );
- }
- }
-
- function body_onload() {
- global $wgUser;
- if ( $this->isEditable() && $wgUser->getOption( 'editsectiononrightclick' ) ) {
- $js = 'setupRightClickEdit()';
- } else {
- $js = '';
- }
- return cbt_value( $js, 'loggedin dynamic' );
- }
-
- function nsclass() {
- return cbt_value( 'ns-' . $this->mTitle->getNamespace(), 'title' );
- }
-
- function sitenotice() {
- // Perhaps this could be given special dependencies using our knowledge of what
- // wfGetSiteNotice() depends on.
- return cbt_value( wfGetSiteNotice(), 'dynamic' );
- }
-
- function title() {
- return cbt_value( $this->mOut->getPageTitle(), array( 'title', 'lang' ) );
- }
-
- function title_urlform() {
- return cbt_value( $this->getThisTitleUrlForm(), 'title' );
- }
-
- function title_userurl() {
- return cbt_value( urlencode( $this->mTitle->getDBkey() ), 'title' );
- }
-
- function subtitle() {
- $subpagestr = $this->subPageSubtitle();
- if ( !empty( $subpagestr ) ) {
- $s = '<span class="subpages">'.$subpagestr.'</span>'.$this->mOut->getSubtitle();
- } else {
- $s = $this->mOut->getSubtitle();
- }
- return cbt_value( $s, array( 'title', 'nonview dynamic' ) );
- }
-
- function undelete() {
- return cbt_value( $this->getUndeleteLink(), array( 'title', 'lang' ) );
- }
-
- function newtalk() {
- global $wgUser, $wgDBname;
- $newtalks = $wgUser->getNewMessageLinks();
-
- if (count($newtalks) == 1 && $newtalks[0]["wiki"] === $wgDBname) {
- $usertitle = $this->getUserPageTitle();
- $usertalktitle = $usertitle->getTalkPage();
- if( !$usertalktitle->equals( $this->mTitle ) ) {
- $ntl = wfMsg( 'youhavenewmessages',
- $this->makeKnownLinkObj(
- $usertalktitle,
- wfMsgHtml( 'newmessageslink' ),
- 'redirect=no'
- ),
- $this->makeKnownLinkObj(
- $usertalktitle,
- wfMsgHtml( 'newmessagesdifflink' ),
- 'diff=cur'
- )
- );
- # Disable Cache
- $this->mOut->setSquidMaxage(0);
- }
- } else if (count($newtalks)) {
- $sep = str_replace("_", " ", wfMsgHtml("newtalkseparator"));
- $msgs = array();
- foreach ($newtalks as $newtalk) {
- $msgs[] = wfElement("a",
- array('href' => $newtalk["link"]), $newtalk["wiki"]);
- }
- $parts = implode($sep, $msgs);
- $ntl = wfMsgHtml('youhavenewmessagesmulti', $parts);
- $this->mOut->setSquidMaxage(0);
- } else {
- $ntl = '';
- }
- return cbt_value( $ntl, 'dynamic' );
- }
-
- function showjumplinks() {
- global $wgUser;
- return cbt_value( $wgUser->getOption( 'showjumplinks' ) ? 'true' : '', 'user' );
- }
-
- function bodytext() {
- return cbt_value( $this->mOut->getHTML(), 'dynamic' );
- }
-
- function catlinks() {
- if ( !isset( $this->mCatlinks ) ) {
- $this->mCatlinks = $this->getCategories();
- }
- return cbt_value( $this->mCatlinks, 'dynamic' );
- }
-
- function extratabs( $itemTemplate ) {
- global $wgContLang, $wgDisableLangConversion;
-
- $etpl = cbt_escape( $itemTemplate );
-
- /* show links to different language variants */
- $variants = $wgContLang->getVariants();
- $s = '';
- if ( !$wgDisableLangConversion && count( $wgContLang->getVariants() ) > 1 ) {
- $vcount=0;
- foreach ( $variants as $code ) {
- $name = $wgContLang->getVariantname( $code );
- if ( $name == 'disable' ) {
- continue;
- }
- $code = cbt_escape( $code );
- $name = cbt_escape( $name );
- $s .= "{ca_variant {{$code}} {{$name}} {{$vcount}} {{$etpl}}}\n";
- $vcount ++;
- }
- }
- return cbt_value( $s, array(), true );
- }
-
- function is_special() { return cbt_value( $this->mTitle->getNamespace() == NS_SPECIAL, 'title' ); }
- 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' ); }
-
- function request_url() {
- global $wgRequest;
- return cbt_value( $wgRequest->getRequestURL(), 'dynamic' );
- }
-
- function subject_url() {
- $title = $this->getSubjectPage();
- if ( $title->exists() ) {
- $url = $title->getLocalUrl();
- } else {
- $url = $title->getLocalUrl( 'action=edit' );
- }
- return cbt_value( $url, 'title' );
- }
-
- function talk_url() {
- $title = $this->getTalkPage();
- if ( $title->exists() ) {
- $url = $title->getLocalUrl();
- } else {
- $url = $title->getLocalUrl( 'action=edit' );
- }
- return cbt_value( $url, 'title' );
- }
-
- function edit_url() {
- return cbt_value( $this->getEditUrl(), array( 'title', 'nonview dynamic' ) );
- }
-
- function move_url() {
- return cbt_value( $this->makeSpecialParamUrl( 'Movepage' ), array(), true );
- }
-
- function localurl( $query ) {
- return cbt_value( $this->mTitle->getLocalURL( $query ), 'title' );
- }
-
- function selecttab( $tab, $extraclass = '' ) {
- if ( !isset( $this->mSelectedTab ) ) {
- $prevent_active_tabs = false ;
- wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this , &$preventActiveTabs ) );
-
- $actionTabs = array(
- 'edit' => 'edit',
- 'submit' => 'edit',
- 'history' => 'history',
- 'protect' => 'protect',
- 'unprotect' => 'protect',
- 'delete' => 'delete',
- 'watch' => 'watch',
- 'unwatch' => 'watch',
- );
- if ( $preventActiveTabs ) {
- $this->mSelectedTab = false;
- } else {
- $action = $this->getAction();
- $section = $this->getSection();
-
- if ( isset( $actionTabs[$action] ) ) {
- $this->mSelectedTab = $actionTabs[$action];
-
- if ( $this->mSelectedTab == 'edit' && $section == 'new' ) {
- $this->mSelectedTab = 'addsection';
- }
- } elseif ( $this->mTitle->isTalkPage() ) {
- $this->mSelectedTab = 'talk';
- } else {
- $this->mSelectedTab = 'subject';
- }
- }
- }
- if ( $extraclass ) {
- if ( $this->mSelectedTab == $tab ) {
- $s = 'class="selected ' . htmlspecialchars( $extraclass ) . '"';
- } else {
- $s = 'class="' . htmlspecialchars( $extraclass ) . '"';
- }
- } else {
- if ( $this->mSelectedTab == $tab ) {
- $s = 'class="selected"';
- } else {
- $s = '';
- }
- }
- return cbt_value( $s, array( 'nonview dynamic', 'title' ) );
- }
-
- function subject_newclass() {
- $title = $this->getSubjectPage();
- $class = $title->exists() ? '' : 'new';
- return cbt_value( $class, 'dynamic' );
- }
-
- function talk_newclass() {
- $title = $this->getTalkPage();
- $class = $title->exists() ? '' : 'new';
- return cbt_value( $class, 'dynamic' );
- }
-
- function ca_variant( $code, $name, $index, $template ) {
- global $wgContLang;
- $selected = ($code == $wgContLang->getPreferredVariant());
- $action = $this->getAction();
- $actstr = '';
- if( $action )
- $actstr = 'action=' . $action . '&';
- $s = strtr( $template, array(
- '$id' => htmlspecialchars( 'varlang-' . $index ),
- '$class' => $selected ? 'class="selected"' : '',
- '$text' => $name,
- '$href' => htmlspecialchars( $this->mTitle->getLocalUrl( $actstr . 'variant=' . $code ) )
- ));
- return cbt_value( $s, 'dynamic' );
- }
-
- function is_watching() {
- return cbt_value( (string)$this->mTitle->userIsWatching(), array( 'dynamic' ) );
- }
-
-
- function personal_urls( $itemTemplate ) {
- global $wgShowIPinHeader, $wgContLang;
-
- # Split this function up into many small functions, to obtain the
- # best specificity in the dependencies of each one. The template below
- # has no dependencies, so its generation, and any static subfunctions,
- # can be optimised away.
- $etpl = cbt_escape( $itemTemplate );
- $s = "
- {userpage {{$etpl}}}
- {mytalk {{$etpl}}}
- {preferences {{$etpl}}}
- {watchlist {{$etpl}}}
- {mycontris {{$etpl}}}
- {logout {{$etpl}}}
- ";
-
- if ( $wgShowIPinHeader ) {
- $s .= "
- {anonuserpage {{$etpl}}}
- {anontalk {{$etpl}}}
- {anonlogin {{$etpl}}}
- ";
- } else {
- $s .= "{login {{$etpl}}}\n";
- }
- // No dependencies
- return cbt_value( $s, array(), true /*this is a template*/ );
- }
-
- function userpage( $itemTemplate ) {
- global $wgUser;
- if ( $this->isLoggedIn() ) {
- $userPage = $this->getUserPageTitle();
- $s = $this->makeTemplateLink( $itemTemplate, 'userpage', $userPage, $wgUser->getName() );
- } else {
- $s = '';
- }
- return cbt_value( $s, 'user' );
- }
-
- function mytalk( $itemTemplate ) {
- global $wgUser;
- if ( $this->isLoggedIn() ) {
- $userPage = $this->getUserPageTitle();
- $talkPage = $userPage->getTalkPage();
- $s = $this->makeTemplateLink( $itemTemplate, 'mytalk', $talkPage, wfMsg('mytalk') );
- } else {
- $s = '';
- }
- return cbt_value( $s, 'user' );
- }
-
- function preferences( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = $this->makeSpecialTemplateLink( $itemTemplate, 'preferences',
- 'Preferences', wfMsg( 'preferences' ) );
- } else {
- $s = '';
- }
- return cbt_value( $s, array( 'loggedin', 'lang' ) );
- }
-
- function watchlist( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = $this->makeSpecialTemplateLink( $itemTemplate, 'watchlist',
- 'Watchlist', wfMsg( 'watchlist' ) );
- } else {
- $s = '';
- }
- return cbt_value( $s, array( 'loggedin', 'lang' ) );
- }
-
- function mycontris( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- global $wgUser;
- $s = $this->makeSpecialTemplateLink( $itemTemplate, 'mycontris',
- "Contributions/" . $wgUser->getTitleKey(), wfMsg('mycontris') );
- } else {
- $s = '';
- }
- return cbt_value( $s, 'user' );
- }
-
- function logout( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = $this->makeSpecialTemplateLink( $itemTemplate, 'logout',
- 'Userlogout', wfMsg( 'userlogout' ),
- $this->mTitle->getNamespace() === NS_SPECIAL && $this->mTitle->getText() === 'Preferences'
- ? '' : "returnto=" . $this->mTitle->getPrefixedURL() );
- } else {
- $s = '';
- }
- return cbt_value( $s, 'loggedin dynamic' );
- }
-
- function anonuserpage( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = '';
- } else {
- global $wgUser;
- $userPage = $this->getUserPageTitle();
- $s = $this->makeTemplateLink( $itemTemplate, 'userpage', $userPage, $wgUser->getName() );
- }
- return cbt_value( $s, '!loggedin dynamic' );
- }
-
- function anontalk( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = '';
- } else {
- $userPage = $this->getUserPageTitle();
- $talkPage = $userPage->getTalkPage();
- $s = $this->makeTemplateLink( $itemTemplate, 'mytalk', $talkPage, wfMsg('anontalk') );
- }
- return cbt_value( $s, '!loggedin dynamic' );
- }
-
- function anonlogin( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = '';
- } else {
- $s = $this->makeSpecialTemplateLink( $itemTemplate, 'anonlogin', 'Userlogin',
- wfMsg( 'userlogin' ), 'returnto=' . urlencode( $this->getThisPDBK() ) );
- }
- return cbt_value( $s, '!loggedin dynamic' );
- }
-
- function login( $itemTemplate ) {
- if ( $this->isLoggedIn() ) {
- $s = '';
- } else {
- $s = $this->makeSpecialTemplateLink( $itemTemplate, 'login', 'Userlogin',
- wfMsg( 'userlogin' ), 'returnto=' . urlencode( $this->getThisPDBK() ) );
- }
- return cbt_value( $s, '!loggedin dynamic' );
- }
-
- function logopath() { return $GLOBALS['wgLogo']; }
- function mainpage() { return self::makeMainPageUrl(); }
-
- function sidebar( $startSection, $endSection, $innerTpl ) {
- $s = '';
- $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
- $firstSection = true;
- foreach ($lines as $line) {
- if (strpos($line, '*') !== 0)
- continue;
- if (strpos($line, '**') !== 0) {
- $bar = trim($line, '* ');
- $name = wfMsg( $bar );
- if (wfEmptyMsg($bar, $name)) {
- $name = $bar;
- }
- if ( $firstSection ) {
- $firstSection = false;
- } else {
- $s .= $endSection;
- }
- $s .= strtr( $startSection,
- array(
- '$bar' => htmlspecialchars( $bar ),
- '$barname' => $name
- ) );
- } else {
- if (strpos($line, '|') !== false) { // sanity check
- $line = explode( '|' , trim($line, '* '), 2 );
- $link = wfMsgForContent( $line[0] );
- if ($link == '-')
- continue;
- if (wfEmptyMsg($line[1], $text = wfMsg($line[1])))
- $text = $line[1];
- if (wfEmptyMsg($line[0], $link))
- $link = $line[0];
- $href = self::makeInternalOrExternalUrl( $link );
-
- $s .= strtr( $innerTpl,
- array(
- '$text' => htmlspecialchars( $text ),
- '$href' => htmlspecialchars( $href ),
- '$id' => htmlspecialchars( 'n-' . strtr($line[1], ' ', '-') ),
- '$classactive' => ''
- ) );
- } else { continue; }
- }
- }
- if ( !$firstSection ) {
- $s .= $endSection;
- }
-
- // Depends on user language only
- return cbt_value( $s, 'lang' );
- }
-
- function searchaction() {
- // Static link
- return $this->getSearchLink();
- }
-
- function search() {
- global $wgRequest;
- return cbt_value( trim( $this->getSearch() ), 'special dynamic' );
- }
-
- function notspecialpage() {
- return cbt_value( $this->mTitle->getNamespace() != NS_SPECIAL, 'special' );
- }
-
- function nav_whatlinkshere() {
- return cbt_value( $this->makeSpecialParamUrl('Whatlinkshere' ), array(), true );
- }
-
- function article_exists() {
- return cbt_value( (string)($this->mTitle->getArticleId() !== 0), 'title' );
- }
-
- function nav_recentchangeslinked() {
- return cbt_value( $this->makeSpecialParamUrl('Recentchangeslinked' ), array(), true );
- }
-
- function feeds( $itemTemplate = '' ) {
- if ( !$this->mOut->isSyndicated() ) {
- $feeds = '';
- } elseif ( $itemTemplate == '' ) {
- // boolean only required
- $feeds = 'true';
- } else {
- $feeds = '';
- global $wgFeedClasses, $wgRequest;
- foreach( $wgFeedClasses as $format => $class ) {
- $feeds .= strtr( $itemTemplate,
- array(
- '$key' => htmlspecialchars( $format ),
- '$text' => $format,
- '$href' => $wgRequest->appendQuery( "feed=$format" )
- ) );
- }
- }
- return cbt_value( $feeds, 'special dynamic' );
- }
-
- function is_userpage() {
- list( $id, $ip ) = $this->getUserPageIdIp();
- return cbt_value( (string)($id || $ip), 'title' );
- }
-
- function is_ns_mediawiki() {
- return cbt_value( (string)$this->mTitle->getNamespace() == NS_MEDIAWIKI, 'title' );
- }
-
- function is_loggedin() {
- global $wgUser;
- return cbt_value( (string)($wgUser->isLoggedIn()), 'loggedin' );
- }
-
- function nav_contributions() {
- $url = $this->makeSpecialParamUrl( 'Contributions', '', '{title_userurl}' );
- return cbt_value( $url, array(), true );
- }
-
- function is_allowed( $right ) {
- global $wgUser;
- return cbt_value( (string)$wgUser->isAllowed( $right ), 'user' );
- }
-
- function nav_blockip() {
- $url = $this->makeSpecialParamUrl( 'Blockip', '', '{title_userurl}' );
- return cbt_value( $url, array(), true );
- }
-
- function nav_emailuser() {
- global $wgEnableEmail, $wgEnableUserEmail, $wgUser;
- if ( !$wgEnableEmail || !$wgEnableUserEmail ) return '';
-
- $url = $this->makeSpecialParamUrl( 'Emailuser', '', '{title_userurl}' );
- return cbt_value( $url, array(), true );
- }
-
- function nav_upload() {
- global $wgEnableUploads, $wgUploadNavigationUrl;
- if ( !$wgEnableUploads ) {
- return '';
- } elseif ( $wgUploadNavigationUrl ) {
- return $wgUploadNavigationUrl;
- } else {
- return self::makeSpecialUrl('Upload');
- }
- }
-
- function nav_specialpages() {
- return self::makeSpecialUrl('Specialpages');
- }
-
- function nav_print() {
- global $wgRequest, $wgArticle;
- $action = $this->getAction();
- $url = '';
- if( $this->mTitle->getNamespace() !== NS_SPECIAL
- && ($action == '' || $action == 'view' || $action == 'purge' ) )
- {
- $revid = $wgArticle->getLatest();
- if ( $revid != 0 ) {
- $url = $wgRequest->appendQuery( 'printable=yes' );
- }
- }
- return cbt_value( $url, array( 'nonview dynamic', 'title' ) );
- }
-
- function nav_permalink() {
- $url = (string)$this->getPermalink();
- return cbt_value( $url, 'dynamic' );
- }
-
- function nav_trackbacklink() {
- global $wgUseTrackbacks;
- if ( !$wgUseTrackbacks ) return '';
-
- return cbt_value( $this->mTitle->trackbackURL(), 'title' );
- }
-
- function is_permalink() {
- return cbt_value( (string)($this->getPermalink() === false), 'nonview dynamic' );
- }
-
- function toolboxend() {
- // This is where the MonoBookTemplateToolboxEnd hook went in the old skin
- return '';
- }
-
- function language_urls( $outer, $inner ) {
- global $wgHideInterlanguageLinks, $wgOut, $wgContLang;
- if ( $wgHideInterlanguageLinks ) return '';
-
- $links = $wgOut->getLanguageLinks();
- $s = '';
- if ( count( $links ) ) {
- foreach( $links as $l ) {
- $tmp = explode( ':', $l, 2 );
- $nt = Title::newFromText( $l );
- $s .= strtr( $inner,
- array(
- '$class' => htmlspecialchars( 'interwiki-' . $tmp[0] ),
- '$href' => htmlspecialchars( $nt->getFullURL() ),
- '$text' => ($wgContLang->getLanguageName( $nt->getInterwiki() ) != ''?
- $wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ),
- )
- );
- }
- $s = str_replace( '$body', $s, $outer );
- }
- return cbt_value( $s, 'dynamic' );
- }
-
- function poweredbyico() { return $this->getPoweredBy(); }
- function copyrightico() { return $this->getCopyrightIcon(); }
-
- function lastmod() {
- global $wgMaxCredits;
- if ( $wgMaxCredits ) return '';
-
- if ( !isset( $this->mLastmod ) ) {
- if ( $this->isCurrentArticleView() ) {
- $this->mLastmod = $this->lastModified();
- } else {
- $this->mLastmod = '';
- }
- }
- return cbt_value( $this->mLastmod, 'dynamic' );
- }
-
- function viewcount() {
- global $wgDisableCounters;
- if ( $wgDisableCounters ) return '';
-
- global $wgLang, $wgArticle;
- if ( is_object( $wgArticle ) ) {
- $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
- if ( $viewcount ) {
- $viewcount = wfMsg( "viewcount", $viewcount );
- } else {
- $viewcount = '';
- }
- } else {
- $viewcount = '';
- }
- return cbt_value( $viewcount, 'dynamic' );
- }
-
- function numberofwatchingusers() {
- global $wgPageShowWatchingUsers;
- if ( !$wgPageShowWatchingUsers ) return '';
-
- $dbr = wfGetDB( DB_SLAVE );
- extract( $dbr->tableNames( 'watchlist' ) );
- $sql = "SELECT COUNT(*) AS n FROM $watchlist
- WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBkey()) .
- "' AND wl_namespace=" . $this->mTitle->getNamespace() ;
- $res = $dbr->query( $sql, 'SkinTemplate::outputPage');
- $row = $dbr->fetchObject( $res );
- $num = $row->n;
- if ($num > 0) {
- $s = wfMsg('number_of_watching_users_pageview', $num);
- } else {
- $s = '';
- }
- return cbt_value( $s, 'dynamic' );
- }
-
- function credits() {
- global $wgMaxCredits;
- if ( !$wgMaxCredits ) return '';
-
- if ( $this->isCurrentArticleView() ) {
- require_once("Credits.php");
- global $wgArticle, $wgShowCreditsIfMax;
- $credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
- } else {
- $credits = '';
- }
- return cbt_value( $credits, 'view dynamic' );
- }
-
- function normalcopyright() {
- return $this->getCopyright( 'normal' );
- }
-
- function historycopyright() {
- return $this->getCopyright( 'history' );
- }
-
- function is_currentview() {
- global $wgRequest;
- return cbt_value( (string)$this->isCurrentArticleView(), 'view' );
- }
-
- function usehistorycopyright() {
- global $wgRequest;
- if ( wfMsgForContent( 'history_copyright' ) == '-' ) return '';
-
- $oldid = $this->getOldId();
- $diff = $this->getDiff();
- $use = (string)(!is_null( $oldid ) && is_null( $diff ));
- return cbt_value( $use, 'nonview dynamic' );
- }
-
- function privacy() {
- return cbt_value( $this->privacyLink(), 'lang' );
- }
- function about() {
- return cbt_value( $this->aboutLink(), 'lang' );
- }
- function disclaimer() {
- return cbt_value( $this->disclaimerLink(), 'lang' );
- }
- function tagline() {
- # A reference to this tag existed in the old MonoBook.php, but the
- # template data wasn't set anywhere
- return '';
- }
- function reporttime() {
- return cbt_value( $this->mOut->reportTime(), 'dynamic' );
- }
-
- function msg( $name ) {
- return cbt_value( wfMsg( $name ), 'lang' );
- }
-
- function fallbackmsg( $name, $fallback ) {
- $text = wfMsg( $name );
- if ( wfEmptyMsg( $name, $text ) ) {
- $text = $fallback;
- }
- return cbt_value( $text, 'lang' );
- }
-
- /******************************************************
- * Utility functions *
- ******************************************************/
-
- /** Return true if this request is a valid, secure CSS preview */
- function isCssPreview() {
- if ( !isset( $this->mCssPreview ) ) {
- global $wgRequest, $wgAllowUserCss, $wgUser;
- $this->mCssPreview =
- $wgAllowUserCss &&
- $wgUser->isLoggedIn() &&
- $this->mTitle->isCssSubpage() &&
- $this->userCanPreview( $this->getAction() );
- }
- return $this->mCssPreview;
- }
-
- /** Return true if this request is a valid, secure JS preview */
- function isJsPreview() {
- if ( !isset( $this->mJsPreview ) ) {
- global $wgRequest, $wgAllowUserJs, $wgUser;
- $this->mJsPreview =
- $wgAllowUserJs &&
- $wgUser->isLoggedIn() &&
- $this->mTitle->isJsSubpage() &&
- $this->userCanPreview( $this->getAction() );
- }
- return $this->mJsPreview;
- }
-
- /** Get the title of the $wgUser's user page */
- function getUserPageTitle() {
- if ( !isset( $this->mUserPageTitle ) ) {
- global $wgUser;
- $this->mUserPageTitle = $wgUser->getUserPage();
- }
- return $this->mUserPageTitle;
- }
-
- /** Get the text of the user page title */
- function getUserPageText() {
- if ( !isset( $this->mUserPageText ) ) {
- $userPage = $this->getUserPageTitle();
- $this->mUserPageText = $userPage->getPrefixedText();
- }
- return $this->mUserPageText;
- }
-
- /** Make an HTML element for a stylesheet link */
- function makeStylesheetLink( $url ) {
- return '<link rel="stylesheet" type="text/css" href="' . htmlspecialchars( $url ) . "\"/>";
- }
-
- /** Make an XHTML element for inline CSS */
- function makeStylesheetCdata( $style ) {
- return "<style type=\"text/css\"> /*<![CDATA[*/ {$style} /*]]>*/ </style>";
- }
-
- /** Get the edit URL for this page */
- function getEditUrl() {
- if ( !isset( $this->mEditUrl ) ) {
- $this->mEditUrl = $this->mTitle->getLocalUrl( $this->editUrlOptions() );
- }
- return $this->mEditUrl;
- }
-
- /** Get the prefixed DB key for this page */
- function getThisPDBK() {
- if ( !isset( $this->mThisPDBK ) ) {
- $this->mThisPDBK = $this->mTitle->getPrefixedDbKey();
- }
- return $this->mThisPDBK;
- }
-
- function getThisTitleUrlForm() {
- if ( !isset( $this->mThisTitleUrlForm ) ) {
- $this->mThisTitleUrlForm = $this->mTitle->getPrefixedURL();
- }
- return $this->mThisTitleUrlForm;
- }
-
- /**
- * If the current page is a user page, get the user's ID and IP. Otherwise return array(0,false)
- */
- function getUserPageIdIp() {
- if ( !isset( $this->mUserPageId ) ) {
- if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
- $this->mUserPageId = User::idFromName($this->mTitle->getText());
- $this->mUserPageIp = User::isIP($this->mTitle->getText());
- } else {
- $this->mUserPageId = 0;
- $this->mUserPageIp = false;
- }
- }
- return array( $this->mUserPageId, $this->mUserPageIp );
- }
-
- /**
- * Returns a permalink URL, or false if the current page is already a
- * permalink, or blank if a permalink shouldn't be displayed
- */
- function getPermalink() {
- if ( !isset( $this->mPermalink ) ) {
- global $wgRequest, $wgArticle;
- $action = $this->getAction();
- $oldid = $this->getOldId();
- $url = '';
- if( $this->mTitle->getNamespace() !== NS_SPECIAL
- && $this->mTitle->getArticleId() != 0
- && ($action == '' || $action == 'view' || $action == 'purge' ) )
- {
- if ( !$oldid ) {
- $revid = $wgArticle->getLatest();
- $url = $this->mTitle->getLocalURL( "oldid=$revid" );
- } else {
- $url = false;
- }
- } else {
- $url = '';
- }
- }
- return $url;
- }
-
- /**
- * Returns true if the current page is an article, not a special page,
- * and we are viewing a revision, not a diff
- */
- function isArticleView() {
- global $wgOut, $wgArticle, $wgRequest;
- if ( !isset( $this->mIsArticleView ) ) {
- $oldid = $this->getOldId();
- $diff = $this->getDiff();
- $this->mIsArticleView = $wgOut->isArticle() and
- (!is_null( $oldid ) or is_null( $diff )) and 0 != $wgArticle->getID();
- }
- return $this->mIsArticleView;
- }
-
- function isCurrentArticleView() {
- if ( !isset( $this->mIsCurrentArticleView ) ) {
- global $wgOut, $wgArticle, $wgRequest;
- $oldid = $this->getOldId();
- $this->mIsCurrentArticleView = $wgOut->isArticle() && is_null( $oldid ) && 0 != $wgArticle->getID();
- }
- return $this->mIsCurrentArticleView;
- }
-
-
- /**
- * Return true if the current page is editable; if edit section on right
- * click should be enabled.
- */
- function isEditable() {
- global $wgRequest;
- $action = $this->getAction();
- return ($this->mTitle->getNamespace() != NS_SPECIAL and !($action == 'edit' or $action == 'submit'));
- }
-
- /** Return true if the user is logged in */
- function isLoggedIn() {
- global $wgUser;
- return $wgUser->isLoggedIn();
- }
-
- /** Get the local URL of the current page */
- function getPageUrl() {
- if ( !isset( $this->mPageUrl ) ) {
- $this->mPageUrl = $this->mTitle->getLocalURL();
- }
- return $this->mPa