From 8f416baead93a48e5799e44b8bd2e2c4859f4e04 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 14 Sep 2007 13:18:58 +0200 Subject: auf Version 1.11 aktualisiert; Login-Bug behoben --- skins/ArchLinux.deps.php | 3 +- skins/ArchLinux.php | 13 +- skins/Chick.deps.php | 4 +- skins/Chick.php | 2 +- skins/CologneBlue.php | 2 +- skins/MonoBook.deps.php | 4 +- skins/MonoBook.php | 11 +- skins/MySkin.deps.php | 4 +- skins/MySkin.php | 2 +- skins/Nostalgia.php | 2 +- skins/Simple.deps.php | 4 +- skins/Simple.php | 2 +- skins/Standard.php | 6 +- skins/archlinux/Opera95Fixes.css | 10 + skins/archlinux/main.css | 641 +++++++++++++++++++-------------------- skins/archlinux/rtl.css | 12 +- skins/chick/main.css | 39 +-- skins/common/ajax.js | 21 +- skins/common/ajaxwatch.js | 99 +++--- skins/common/block.js | 16 +- skins/common/cologneblue.css | 13 +- skins/common/commonPrint.css | 3 + skins/common/common_rtl.css | 9 +- skins/common/diff.css | 74 +++++ skins/common/diff.js | 20 ++ skins/common/images/spinner.gif | Bin 0 -> 2285 bytes skins/common/oldshared.css | 465 ++++++++++++++++++++++++++++ skins/common/protect.js | 172 ++++++----- skins/common/shared.css | 48 +++ skins/common/upload.js | 175 ++++++++++- skins/common/wikibits.js | 292 ++++++++++++------ skins/disabled/HTMLDump.php | 2 +- skins/disabled/MonoBook.tpl | 2 +- skins/disabled/MonoBookCBT.php | 2 +- skins/monobook/Opera95Fixes.css | 10 + skins/monobook/main.css | 637 ++++++++++++++++++-------------------- skins/monobook/rtl.css | 8 + skins/monobook/user.gif | Bin 932 -> 923 bytes skins/simple/main.css | 28 +- 39 files changed, 1860 insertions(+), 997 deletions(-) create mode 100644 skins/archlinux/Opera95Fixes.css create mode 100644 skins/common/diff.css create mode 100644 skins/common/diff.js create mode 100644 skins/common/images/spinner.gif create mode 100644 skins/common/oldshared.css create mode 100644 skins/common/shared.css create mode 100644 skins/monobook/Opera95Fixes.css (limited to 'skins') diff --git a/skins/ArchLinux.deps.php b/skins/ArchLinux.deps.php index afc41392..e36d7f48 100644 --- a/skins/ArchLinux.deps.php +++ b/skins/ArchLinux.deps.php @@ -8,5 +8,4 @@ if ( ! defined( 'MEDIAWIKI' ) ) die( 1 ); -require_once('includes/SkinTemplate.php'); -?> \ No newline at end of file +require_once( dirname( dirname( __FILE__ ) ) . '/includes/SkinTemplate.php'); diff --git a/skins/ArchLinux.php b/skins/ArchLinux.php index dcf57fd7..2b6bda72 100644 --- a/skins/ArchLinux.php +++ b/skins/ArchLinux.php @@ -13,9 +13,6 @@ if( !defined( 'MEDIAWIKI' ) ) die( -1 ); -/** */ -require_once('includes/SkinTemplate.php'); - /** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document @@ -51,7 +48,7 @@ class ArchLinuxTemplate extends QuickTemplate { wfSuppressWarnings(); ?> -data['xhtmlnamespaces'] as $tag => $ns) { ?>xmlns:xml:lang="text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> @@ -59,9 +56,11 @@ class ArchLinuxTemplate extends QuickTemplate { html('headlinks') ?> archlinux.de :: <?php $this->text('pagetitle') ?> - + data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css?" /> - @@ -241,7 +240,7 @@ class ArchLinuxTemplate extends QuickTemplate { data['nav_urls'][$special]) { ?>
  • html('headlinks') ?> <?php $this->text('pagetitle') ?> - + data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css?" /> - @@ -203,7 +202,7 @@ class MonoBookTemplate extends QuickTemplate {
  • data['nav_urls'][$special]) { ?>
  • \n"; @@ -299,4 +299,4 @@ class SkinStandard extends Skin { } -?> + diff --git a/skins/archlinux/Opera95Fixes.css b/skins/archlinux/Opera95Fixes.css new file mode 100644 index 00000000..6048c66c --- /dev/null +++ b/skins/archlinux/Opera95Fixes.css @@ -0,0 +1,10 @@ +/** + * One tweak for Opera 9.5 carried over from Opera 7. This seems to be exactly + * the same rule as is used for #bodyContent a.external normally, why do we + * need it? Someone should compare with and without and remove this file en- + * tirely if appropriate. + */ +#bodyContent a.external { + background: url(external.png) center right no-repeat; + padding-right: 13px; +} diff --git a/skins/archlinux/main.css b/skins/archlinux/main.css index 7eabb56a..a50f93a3 100644 --- a/skins/archlinux/main.css +++ b/skins/archlinux/main.css @@ -8,32 +8,23 @@ ** Michael Zeltner and Geir Bækholt) ** All you guys rock :) */ -/** - * Stylesheet for screen/projection. All rules not marked media-specific are - * shared with handheld.css and should be updated in tandem. The rules can't - * be in the same file because old browsers like IE5 won't obey @media rules. - * - * Rules that are screen/projection-specific are marked with commented-out - * @media rules and indentation. - */ -/* @media screen, projection { */ - #column-content { - width: 100%; - float: right; - margin: 0 0 .6em -12.2em; - padding: 0; - } - #content { - margin: 3px 0 0 12.2em; - padding: 0 1em 1.5em 1em; - position: relative; - z-index: 2; - } - #column-one { - padding-top: 3px; - } -/* } */ +#column-content { + width: 100%; + float: right; + margin: 0 0 .6em -12.2em; + padding: 0; +} +#content { + margin: 3px 0 0 12.2em; + padding: 0 1em 1.5em 1em; + position: relative; + z-index: 2; +} +#column-one { + padding-top: 3px; +} + #content { background: white; color: black; @@ -107,12 +98,11 @@ img { border: none; vertical-align: middle; } -/* @media screen, projection { */ - p { - margin: .4em 0 .5em 0; - line-height: 1.5em; - } -/* } */ + +p { + margin: .4em 0 .5em 0; + line-height: 1.5em; +} p img { margin: 0; @@ -152,12 +142,6 @@ h5 .editsection { font-weight: normal; } h6 { font-size: 80%; } h6 .editsection { font-size: 125%; font-weight: normal; } -.editsection { - float: right; - margin-left: 5px; -} - - ul { line-height: 1.5em; list-style-type: square; @@ -249,15 +233,12 @@ pre { ** the main content area */ -/* @media screen, projection { */ - #siteSub { - display: none; - } - #jump-to-nav { - display: none; - } -/* } */ - +#siteSub { + display: none; +} +#jump-to-nav { + display: none; +} #contentSub, #contentSub2 { font-size: 84%; @@ -506,15 +487,12 @@ div.tleft { border-width: .5em 1.4em .8em 0; } +img.thumbborder { + border: 1px solid #dddddd; +} + .hiddenStructure { display: none; - speak: none; -} -img.tex { - vertical-align: middle; -} -span.texhtml { - font-family: serif; } /* @@ -593,30 +571,6 @@ div.townBox dl dd { border: 1px dashed #aaa; } -/* -** Diff rendering -*/ -table.diff, td.diff-otitle, td.diff-ntitle { - background-color: white; -} -td.diff-addedline { - background: #cfc; - font-size: smaller; -} -td.diff-deletedline { - background: #ffa; - font-size: smaller; -} -td.diff-context { - background: #eee; - font-size: smaller; -} -.diffchange { - color: red; - font-weight: bold; - text-decoration: none; -} - /* ** keep the whitespace in front of the ^=, hides rule from konqueror ** this is css3, the validator doesn't like it when validating as css2 @@ -763,45 +717,42 @@ special external link styling */ /* ** Logo properties */ -/* @media screen, projection { */ - #p-logo { - top: 0; - left: 0; - position: absolute; /*needed to use z-index */ - z-index: 3; - height: 155px; - width: 12em; - overflow: visible; - } - #p-logo h5 { - display: none; - } - #p-logo a, - #p-logo a:hover { - display: block; - height: 155px; - width: 12.2em; - background-repeat: no-repeat; - background-position: 35% 50% !important; - text-decoration: none; - } -/* } */ +#p-logo { + top: 0; + left: 0; + position: absolute; /*needed to use z-index */ + z-index: 3; + height: 155px; + width: 12em; + overflow: visible; +} +#p-logo h5 { + display: none; +} +#p-logo a, +#p-logo a:hover { + display: block; + height: 155px; + width: 12.2em; + background-repeat: no-repeat; + background-position: 35% 50% !important; + text-decoration: none; +} + /* ** the navigation portlet */ -/* @media screen, projection { */ - #p-navigation { - position: relative; - z-index: 3; - } - #p-navigation a { - display: block; - } - #p-navigation li.active a, #p-navigation li.active a:hover { - display: inline; - } -/* } */ +#p-navigation { + position: relative; + z-index: 3; +} +#p-navigation a { + display: block; +} +#p-navigation li.active a, #p-navigation li.active a:hover { + display: inline; +} #p-navigation .pBody { padding-right: 0; @@ -816,12 +767,10 @@ special external link styling */ /* ** Search portlet */ -/* @media screen, projection { */ - #p-search { - position: relative; - z-index: 3; - } -/* } */ +#p-search { + position: relative; + z-index: 3; +} input.searchButton { margin-top: 1px; @@ -848,82 +797,81 @@ input.searchButton { /* ** the personal toolbar */ -/* @media screen, projection { */ - #p-personal { - position: absolute; - left: 0; - top: 80px; - z-index: 0; - } - #p-personal { - width: 100%; - white-space: nowrap; - padding: 0; - margin: 0; - border: none; - background: none; - overflow: visible; - line-height: 1.2em; - } - #p-personal h5 { - display: none; - } - #p-personal .portlet, - #p-personal .pBody { - z-index: 0; - padding: 0; - margin: 0; - border: none; - overflow: visible; - background: none; - } +#p-personal { + position: absolute; + left: 0; + top: 80px; + z-index: 0; +} +#p-personal { + width: 100%; + white-space: nowrap; + padding: 0; + margin: 0; + border: none; + background: none; + overflow: visible; + line-height: 1.2em; +} +#p-personal h5 { + display: none; +} +#p-personal .portlet, +#p-personal .pBody { + z-index: 0; + padding: 0; + margin: 0; + border: none; + overflow: visible; + background: none; +} /* this is the ul contained in the portlet */ - #p-personal ul { - border: none; - line-height: 1.4em; - color: #2f6fab; - padding: 0 2em 0 3em; - margin: 0; - text-align: right; - list-style: none; - z-index: 0; - background: none; - cursor: default; - } - #p-personal li { - z-index: 0; - border: none; - padding: 0; - display: inline; - color: #2f6fab; - margin-left: 1em; - line-height: 1.2em; - background: none; - } - #p-personal li a { - text-decoration: none; - color: #005896; - padding-bottom: .2em; - background: none; - } - #p-personal li a:hover { - background-color: white; - padding-bottom: .2em; - text-decoration: none; - } - #p-personal li.active a:hover { - background-color: transparent; - } - /* the icon in front of the user name, single quotes - in bg url to hide it from iemac */ - li#pt-userpage, - li#pt-anonuserpage, - li#pt-login { - background: url(user.gif) top left no-repeat; - padding-left: 20px; - text-transform: none; - } -/* } */ +#p-personal ul { + border: none; + line-height: 1.4em; + color: #2f6fab; + padding: 0 2em 0 3em; + margin: 0; + text-align: right; + list-style: none; + z-index: 0; + background: none; + cursor: default; +} +#p-personal li { + z-index: 0; + border: none; + padding: 0; + display: inline; + color: #2f6fab; + margin-left: 1em; + line-height: 1.2em; + background: none; +} +#p-personal li a { + text-decoration: none; + color: #005896; + padding-bottom: .2em; + background: none; +} +#p-personal li a:hover { + background-color: white; + padding-bottom: .2em; + text-decoration: none; +} +#p-personal li.active a:hover { + background-color: transparent; +} +/* the icon in front of the user name, single quotes +in bg url to hide it from iemac */ +li#pt-userpage, +li#pt-anonuserpage, +li#pt-login { + background: url(user.gif) top left no-repeat; + padding-left: 20px; + text-transform: none; +} + #p-personal ul { text-transform: lowercase; } @@ -933,91 +881,90 @@ input.searchButton { /* ** the page-related actions- page/talk, edit etc */ -/* @media screen, projection { */ - #p-cactions { - position: absolute; - top: 137px; - left: 14.5em; - margin: 0; - white-space: nowrap; - width: 76%; - line-height: 1.1em; - overflow: visible; - background: none; - border-collapse: collapse; - padding-left: 1em; - list-style: none; - font-size: 95%; - } - #p-cactions ul { - list-style: none; - } - #p-cactions li { - display: inline; - border: 1px solid #aaa; - border-bottom: none; - padding: 0 0 .1em 0; - margin: 0 .3em 0 0; - overflow: visible; - background: white; - } - #p-cactions li.selected { - border-color: #fabd23; - padding: 0 0 .2em 0; - font-weight: bold; - } - #p-cactions li a { - background-color: #fbfbfb; - color: #002bb8; - border: none; - padding: 0 .8em .3em; - position: relative; - z-index: 0; - margin: 0; - text-decoration: none; - } - #p-cactions li.selected a { - z-index: 3; - padding: 0 1em .2em!important; - background-color: white; - } - #p-cactions .new a { - color: #ba0000; - } - #p-cactions li a:hover { - z-index: 3; - text-decoration: none; - background-color: white; - } - #p-cactions h5 { - display: none; - } - #p-cactions li.istalk { - margin-right: 0; - } - #p-cactions li.istalk a { - padding-right: .5em; - } - #p-cactions #ca-addsection a { - padding-left: .4em; - padding-right: .4em; - } - /* offsets to distinguish the tab groups */ - li#ca-talk { - margin-right: 1.6em; - } - li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print { - margin-left: 1.6em; - } - #p-cactions .pBody { - font-size: 1em; - background-color: transparent; - color: inherit; - border-collapse: inherit; - border: 0; - padding: 0; - } -/* } */ +#p-cactions { + position: absolute; + top: 137px; + left: 14.5em; + margin: 0; + white-space: nowrap; + width: 76%; + line-height: 1.1em; + overflow: visible; + background: none; + border-collapse: collapse; + padding-left: 1em; + list-style: none; + font-size: 95%; +} +#p-cactions ul { + list-style: none; +} +#p-cactions li { + display: inline; + border: 1px solid #aaa; + border-bottom: none; + padding: 0 0 .1em 0; + margin: 0 .3em 0 0; + overflow: visible; + background: white; +} +#p-cactions li.selected { + border-color: #fabd23; + padding: 0 0 .2em 0; + font-weight: bold; +} +#p-cactions li a { + background-color: #fbfbfb; + color: #002bb8; + border: none; + padding: 0 .8em .3em; + position: relative; + z-index: 0; + margin: 0; + text-decoration: none; +} +#p-cactions li.selected a { + z-index: 3; + padding: 0 1em .2em!important; + background-color: white; +} +#p-cactions .new a { + color: #ba0000; +} +#p-cactions li a:hover { + z-index: 3; + text-decoration: none; + background-color: white; +} +#p-cactions h5 { + display: none; +} +#p-cactions li.istalk { + margin-right: 0; +} +#p-cactions li.istalk a { + padding-right: .5em; +} +#p-cactions #ca-addsection a { + padding-left: .4em; + padding-right: .4em; +} +/* offsets to distinguish the tab groups */ +li#ca-talk { + margin-right: 1.6em; +} +li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print { + margin-left: 1.6em; +} +#p-cactions .pBody { + font-size: 1em; + background-color: transparent; + color: inherit; + border-collapse: inherit; + border: 0; + padding: 0; +} + #p-cactions .hiddenStructure { display: none; } @@ -1028,14 +975,11 @@ input.searchButton { /* ** the remaining portlets */ -/* @media screen, projection { */ - #p-tbx, - #p-lang { - position: relative; - z-index: 3; - } -/* } */ - +#p-tbx, +#p-lang { + position: relative; + z-index: 3; +} /* TODO: #t-iscite is only used by the Cite extension, come up with some @@ -1085,21 +1029,20 @@ input.searchButton { #preftoc li { background-color: #f0f0f0; color: #000; } -/* @media screen, projection { */ - #preftoc li { - margin: 1px -2px 1px 2px; - float: left; - padding: 2px 0 3px 0; - border: 1px solid #fff; - border-right-color: #716f64; - border-bottom: 0; - position: relative; - white-space: nowrap; - list-style-type: none; - list-style-image: none; - z-index: 3; - } -/* } */ + +#preftoc li { + margin: 1px -2px 1px 2px; + float: left; + padding: 2px 0 3px 0; + border: 1px solid #fff; + border-right-color: #716f64; + border-bottom: 0; + position: relative; + white-space: nowrap; + list-style-type: none; + list-style-image: none; + z-index: 3; +} #preftoc li.selected { font-weight: bold; @@ -1153,19 +1096,17 @@ input.searchButton { .prefsection table, .prefsection legend { background-color: #F9F9F9; } -/* @media screen, projection { */ - .mainLegend { - display: none; - } -/* } */ + +.mainLegend { + display: none; +} div.prefsectiontip { - font-size: 95%; - margin-top: 0; - background-color: #FFC1C1; - padding: .2em .7em; - clear: both; + font-size: x-small; + padding: .2em 2em; + color: #666; } + .btnSavePrefs { font-weight: bold; padding-left: .3em; @@ -1202,10 +1143,10 @@ div#userlogin form#userlogin2 h2 { padding-top: 0; } -div#userlogin .captcha { +div#userlogin .captcha, +div#userloginForm .captcha { border: 1px solid #bbb; padding: 1.5em 2em; - width: 400px; background-color: white; } @@ -1228,29 +1169,27 @@ div#userlogin .captcha { font-weight: bold; } -/* @media screen, projection { */ - /* - ** IE/Mac fixes, hope to find a validating way to move this - ** to a separate stylesheet. This would work but doesn't validate: - ** @import("IEMacFixes.css"); - */ - /* tabs: border on the a, not the div */ - * > html #p-cactions li { border: none; } - * > html #p-cactions li a { - border: 1px solid #aaa; - border-bottom: none; - } - * > html #p-cactions li.selected a { border-color: #fabd23; } - /* footer icons need a fixed width */ - * > html #f-poweredbyico, - * > html #f-copyrightico { width: 88px; } - * > html #bodyContent, - * > html #bodyContent pre { - overflow-x: auto; - width: 100%; - padding-bottom: 25px; - } -/* } */ +/* +** IE/Mac fixes, hope to find a validating way to move this +** to a separate stylesheet. This would work but doesn't validate: +** @import("IEMacFixes.css"); +*/ +/* tabs: border on the a, not the div */ +* > html #p-cactions li { border: none; } +* > html #p-cactions li a { + border: 1px solid #aaa; + border-bottom: none; +} +* > html #p-cactions li.selected a { border-color: #fabd23; } +/* footer icons need a fixed width */ +* > html #f-poweredbyico, +* > html #f-copyrightico { width: 88px; } +* > html #bodyContent, +* > html #bodyContent pre { + overflow-x: auto; + width: 100%; + padding-bottom: 25px; +} /* more IE fixes */ @@ -1347,6 +1286,7 @@ div.gallerybox div.thumb { } div.gallerytext { + overflow: hidden; font-size: 94%; padding: 2px 4px; } @@ -1614,7 +1554,7 @@ tr.sv-space td { display: none; } */ .TablePager_nav a { text-decoration: none; } .TablePager { border-collapse: collapse; } -.TablePager, .TablePager td, .TablePager th { +.TablePager, .TablePager td, .TablePager th { border: 1px solid #aaaaaa; padding: 0 0.15em 0 0.15em; } @@ -1632,3 +1572,30 @@ tr.sv-space td { display: none; } .mw-summary-preview { margin: 0.1em 0; } + +/* Friendlier slave lag warnings */ +div.mw-lag-warn-normal, +div.mw-lag-warn-high { + padding: 3px; + text-align: center; + margin: 3px auto; +} +div.mw-lag-warn-normal { + border: 1px solid #FFCC66; + background-color: #FFFFCC; +} +div.mw-lag-warn-high { + font-weight: bold; + border: 2px solid #FF0033; + background-color: #FFCCCC; +} + +/* Recreating-deleted-page warning and log entries */ +div#mw-recreate-deleted-warn { + padding: 3px; + margin-bottom: 3px; + border: 2px solid #2F6FAB; +} +div#mw-recreate-deleted-warn ul li { + font-size: 90%; +} \ No newline at end of file diff --git a/skins/archlinux/rtl.css b/skins/archlinux/rtl.css index ce87855d..e84f2b9c 100644 --- a/skins/archlinux/rtl.css +++ b/skins/archlinux/rtl.css @@ -170,8 +170,8 @@ li#ca-watch { margin-right: 13.6em; border-left: 0; border-right: 1px solid #fabd23; -} -* html #column-content { +} +* html #column-content { float: none; margin-left: 0; margin-right: 0; @@ -219,3 +219,11 @@ input#wpSave, input#wpDiff { p.mw-ipb-conveniencelinks { float: left; } + +.toggle { + margin-left: 0em; + margin-right: 2em; +} +table.filehistory th { + text-align: right; +} \ No newline at end of file diff --git a/skins/chick/main.css b/skins/chick/main.css index 26d4f925..876f3c7d 100644 --- a/skins/chick/main.css +++ b/skins/chick/main.css @@ -52,8 +52,6 @@ h1, h2, h3, h4, h5, h6 { } .editsection { font-weight: normal; - float: right; - margin-left: 5px; } h1 { font-size: 188%; } h1 .editsection { font-size: 53.2%; } @@ -321,12 +319,13 @@ div.tleft { margin-right:0.5em; border-width: 0.5em 1.4em 0.8em 0; } +img.thumbborder { + border: 1px solid #dddddd; +} .hiddenStructure { display: none; } -img.tex { vertical-align: middle; } -span.texhtml { font-family: serif; } /* ** classes for special content elements like town boxes @@ -397,25 +396,6 @@ div.townBox dl dd { background-color:#f9f9f9; border:1px dashed #aaaaaa; } -/* -** Diff rendering -*/ -table.diff { background:white; } -td.diff-otitle { background:#ffffff; } -td.diff-ntitle { background:#ffffff; } -td.diff-addedline { - background:#ccffcc; - font-size: smaller; -} -td.diff-deletedline { - background:#ffffaa; - font-size: smaller; -} -td.diff-context { - background:#eeeeee; - font-size: smaller; -} -.diffchange { color: red; text-decoration: none; } a.external { color: #3366bb; } @@ -475,6 +455,7 @@ div.gallerybox div.thumb { } div.gallerytext { + overflow: hidden; font-size: 94%; padding: 2px 4px; } @@ -485,11 +466,7 @@ div.gallerytext { .templatesUsed { margin-top: 1.5em; } -/** - * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. - * When the day comes, it can be moved to a *real* common.css. - */ -.mw-plusminus-null { color: #aaa; } -.texvc { direction: ltr; unicode-bidi: embed; } -/* Stop floats from intruding into edit area in previews */ -#toolbar, #wpTextbox1 { clear: both; } \ No newline at end of file +/* Recreating-deleted-page warning and log entries */ +div#mw-recreate-deleted-warn ul li { + font-size: 95%; +} diff --git a/skins/common/ajax.js b/skins/common/ajax.js index d90bea09..854d7a00 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -39,16 +39,21 @@ function sajax_init_object() { sajax_debug("sajax_init_object() called..") var A; try { - A=new ActiveXObject("Msxml2.XMLHTTP"); + // Try the new style before ActiveX so we don't + // unnecessarily trigger warnings in IE 7 when + // set to prompt about ActiveX usage + A = new XMLHttpRequest(); } catch (e) { try { - A=new ActiveXObject("Microsoft.XMLHTTP"); - } catch (oc) { - A=null; + A=new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + A=new ActiveXObject("Microsoft.XMLHTTP"); + } catch (oc) { + A=null; + } } } - if(!A && typeof XMLHttpRequest != "undefined") - A = new XMLHttpRequest(); if (!A) sajax_debug("Could not create connection object."); @@ -75,7 +80,9 @@ function sajax_do_call(func_name, args, target) { var i, x, n; var uri; var post_data; - uri = wgServer + wgScriptPath + "/index.php?action=ajax"; + uri = wgServer + + ((wgScript == null) ? (wgScriptPath + "/index.php") : wgScript) + + "?action=ajax"; if (sajax_request_type == "GET") { if (uri.indexOf("?") == -1) uri = uri + "?rs=" + encodeURIComponent(func_name); diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js index 16e4fdc4..b30e4ffd 100644 --- a/skins/common/ajaxwatch.js +++ b/skins/common/ajaxwatch.js @@ -2,10 +2,10 @@ // * ajax.js: /*extern sajax_init_object, sajax_do_call */ // * wikibits.js: - /*extern changeText, akeytt, hookEvent */ + /*extern changeText, akeytt, hookEvent, jsMsg */ // These should have been initialized in the generated js -/*extern wgAjaxWatch, wgArticleId */ +/*extern wgAjaxWatch, wgPageName */ if(typeof wgAjaxWatch === "undefined" || !wgAjaxWatch) { var wgAjaxWatch = { @@ -20,32 +20,60 @@ wgAjaxWatch.supported = true; // supported on current page and by browser wgAjaxWatch.watching = false; // currently watching page wgAjaxWatch.inprogress = false; // ajax request in progress wgAjaxWatch.timeoutID = null; // see wgAjaxWatch.ajaxCall -wgAjaxWatch.watchLink1 = null; // "watch"/"unwatch" link -wgAjaxWatch.watchLink2 = null; // second one, for (some?) non-Monobook-based -wgAjaxWatch.oldHref = null; // url for action=watch/action=unwatch +wgAjaxWatch.watchLinks = []; // "watch"/"unwatch" links wgAjaxWatch.setLinkText = function(newText) { - changeText(wgAjaxWatch.watchLink1, newText); - if (wgAjaxWatch.watchLink2) { - changeText(wgAjaxWatch.watchLink2, newText); + for (i = 0; i < wgAjaxWatch.watchLinks.length; i++) { + changeText(wgAjaxWatch.watchLinks[i], newText); } }; wgAjaxWatch.setLinkID = function(newId) { - wgAjaxWatch.watchLink1.id = newId; + // We can only set the first one + wgAjaxWatch.watchLinks[0].setAttribute( 'id', newId ); akeytt(newId); // update tooltips for Monobook }; +wgAjaxWatch.setHref = function( string ) { + for( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) { + if( string == 'watch' ) { + wgAjaxWatch.watchLinks[i].href = wgAjaxWatch.watchLinks[i].href + .replace( /&action=unwatch/, '&action=watch' ); + } else if( string == 'unwatch' ) { + wgAjaxWatch.watchLinks[i].href = wgAjaxWatch.watchLinks[i].href + .replace( /&action=watch/, '&action=unwatch' ); + } + } +} + wgAjaxWatch.ajaxCall = function() { - if(!wgAjaxWatch.supported || wgAjaxWatch.inprogress) { - return; + if(!wgAjaxWatch.supported) { + return true; + } else if (wgAjaxWatch.inprogress) { + return false; } + if(!wfSupportsAjax()) { + // Lazy initialization so we don't toss up + // ActiveX warnings on initial page load + // for IE 6 users with security settings. + wgAjaxWatch.supported = false; + return true; + } + wgAjaxWatch.inprogress = true; - wgAjaxWatch.setLinkText(wgAjaxWatch.watching ? wgAjaxWatch.unwatchingMsg : wgAjaxWatch.watchingMsg); - sajax_do_call("wfAjaxWatch", [wgArticleId, (wgAjaxWatch.watching ? "u" : "w")], wgAjaxWatch.processResult); + wgAjaxWatch.setLinkText( wgAjaxWatch.watching + ? wgAjaxWatch.unwatchingMsg : wgAjaxWatch.watchingMsg); + sajax_do_call( + "wfAjaxWatch", + [wgPageName, (wgAjaxWatch.watching ? "u" : "w")], + wgAjaxWatch.processResult + ); // if the request isn't done in 10 seconds, allow user to try again - wgAjaxWatch.timeoutID = window.setTimeout(function() { wgAjaxWatch.inprogress = false; }, 10000); - return; + wgAjaxWatch.timeoutID = window.setTimeout( + function() { wgAjaxWatch.inprogress = false; }, + 10000 + ); + return false; }; wgAjaxWatch.processResult = function(request) { @@ -53,20 +81,22 @@ wgAjaxWatch.processResult = function(request) { return; } var response = request.responseText; - if(response == "") { - window.location.href = wgAjaxWatch.oldHref; - return; - } else if(response == "") { + if( response.match(/^/) ) { wgAjaxWatch.watching = true; wgAjaxWatch.setLinkText(wgAjaxWatch.unwatchMsg); wgAjaxWatch.setLinkID("ca-unwatch"); - wgAjaxWatch.oldHref = wgAjaxWatch.oldHref.replace(/action=watch/, "action=unwatch"); - } else if(response == "") { + wgAjaxWatch.setHref( 'unwatch' ); + } else if( response.match(/^/) ) { wgAjaxWatch.watching = false; wgAjaxWatch.setLinkText(wgAjaxWatch.watchMsg); wgAjaxWatch.setLinkID("ca-watch"); - wgAjaxWatch.oldHref = wgAjaxWatch.oldHref.replace(/action=unwatch/, "action=watch"); + wgAjaxWatch.setHref( 'watch' ); + } else { + // Either we got a error code or it just plain broke. + window.location.href = wgAjaxWatch.watchLinks[0].href; + return; } + jsMsg( response.substr(4), 'watch' ); wgAjaxWatch.inprogress = false; if(wgAjaxWatch.timeoutID) { window.clearTimeout(wgAjaxWatch.timeoutID); @@ -75,6 +105,8 @@ 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) { @@ -96,20 +128,19 @@ wgAjaxWatch.onLoad = function() { } } - if(!wfSupportsAjax()) { - wgAjaxWatch.supported = false; - return; - } - // The id can be either for the parent (Monobook-based) or the element // itself (non-Monobook) - wgAjaxWatch.watchLink1 = el1.tagName.toLowerCase() == "a" ? el1 : el1.firstChild; - wgAjaxWatch.watchLink2 = el2 ? el2 : null; + wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a" + ? el1 : el1.firstChild ); - wgAjaxWatch.oldHref = wgAjaxWatch.watchLink1.getAttribute("href"); - wgAjaxWatch.watchLink1.setAttribute("href", "javascript:wgAjaxWatch.ajaxCall()"); - if (wgAjaxWatch.watchLink2) { - wgAjaxWatch.watchLink2.setAttribute("href", "javascript:wgAjaxWatch.ajaxCall()"); + if( el2 ) { + wgAjaxWatch.watchLinks.push( el2 ); + } + + // I couldn't get for (watchLink in wgAjaxWatch.watchLinks) to work, if + // you can be my guest. + for( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) { + wgAjaxWatch.watchLinks[i].onclick = wgAjaxWatch.ajaxCall; } return; }; @@ -124,4 +155,4 @@ function wfSupportsAjax() { var supportsAjax = request ? true : false; delete request; return supportsAjax; -} \ No newline at end of file +} diff --git a/skins/common/block.js b/skins/common/block.js index c9c02446..430c1d54 100644 --- a/skins/common/block.js +++ b/skins/common/block.js @@ -22,26 +22,32 @@ function considerChangingExpiryFocus() { function updateBlockOptions() { if (!document.getElementById) return; - + var target = document.getElementById('mw-bi-target'); if (!target) return; - + var addy = target.value; var isEmpty = addy.match(/^\s*$/); var isIp = addy.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|:(:[0-9A-Fa-f]{1,4}){1,7}|[0-9A-Fa-f]{1,4}(:{1,2}[0-9A-Fa-f]{1,4}|::$){1,7})(\/\d+)?$/); - + /* var anonymousCheck = document.getElementById('wpAnonOnly'); anonymousCheck.disabled = !isIp && !isEmpty; - + var autoblockCheck = document.getElementById('wpEnableAutoblock'); autoblockCheck.disabled = isIp && !isEmpty; + + var emailblockCheck = document.getElementById('wpEmailBan'); + emailblockCheck.disabled = isIp && !isEmpty; */ var anonymousRow = document.getElementById('wpAnonOnlyRow'); anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : ''; - + var autoblockRow = document.getElementById('wpEnableAutoblockRow'); autoblockRow.style.display = isIp && !isEmpty ? 'none' : ''; + + var emailblockRow = document.getElementById('wpEnableEmailBan'); + emailblockRow.style.display = isIp && !isEmpty ? 'none' : ''; } diff --git a/skins/common/cologneblue.css b/skins/common/cologneblue.css index 5b6e5bca..547585ef 100644 --- a/skins/common/cologneblue.css +++ b/skins/common/cologneblue.css @@ -93,4 +93,15 @@ a.stub, #quickbar a.stub { color:#772233; text-decoration:none; } a.new, #quickbar a.new { color: #CC2200; } h2, h3, h4, h5, h6 { margin-bottom: 0; } small { font-size: 75%; } -input.mw-searchInput { width: 106px; } \ No newline at end of file +input.mw-searchInput { width: 106px; } + +/* Recreating-deleted-page warning and log entries */ +div#mw-recreate-deleted-warn { + padding: 3px; + margin-top: 3px; + margin-bottom: 3px; + border: 1px solid #6688AA; +} +div#mw-recreate-deleted-warn ul li { + font-size: 90%; +} \ No newline at end of file diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 4fddafaa..a7d49e36 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -73,6 +73,9 @@ div.tleft { margin-right:0.5em; border-width: 0.5em 1.4em 0.8em 0; } +img.thumbborder { + border: 1px solid #dddddd; +} /* table standards */ table.rimage { diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css index 0c08de55..d26acc13 100644 --- a/skins/common/common_rtl.css +++ b/skins/common/common_rtl.css @@ -1,5 +1,7 @@ -/* This CSS file is called from absolutely every wiki that's RTL: unlike - * common.css, it's actually common to all skins. */ +/* + * This file contains CSS settings common to RTL wikis use the old + * pre-Monobook skins Wikistandard, Nostalgia and CologneBlue + */ /* js pref toc */ #preftoc { float: right; } @@ -30,3 +32,6 @@ div.tleft, div.floatleft { p.mw-ipb-conveniencelinks { float: left; } +table.filehistory th { + text-align: right; +} diff --git a/skins/common/diff.css b/skins/common/diff.css new file mode 100644 index 00000000..6a1f23b5 --- /dev/null +++ b/skins/common/diff.css @@ -0,0 +1,74 @@ +/* +** Diff rendering +*/ +table.diff, td.diff-otitle, td.diff-ntitle { + background-color: white; +} +td.diff-otitle, +td.diff-ntitle { + text-align: center; +} +td.diff-marker { + text-align: right; +} +.rtl td.diff-marker { + text-align: left; +} +td.diff-lineno { + font-weight: bold; +} +td.diff-addedline { + background: #cfc; + font-size: smaller; +} +td.diff-deletedline { + background: #ffa; + font-size: smaller; +} +td.diff-context { + background: #eee; + font-size: smaller; +} +.diffchange { + color: red; + font-weight: bold; + text-decoration: none; +} + +table.diff { + border: none; + width: 98%; + border-spacing: 4px; + + /* Fixed layout is required to ensure that cells containing long URLs + don't widen in Safari, Internet Explorer, or iCab */ + table-layout: fixed; +} +table.diff td { + padding: 0; +} +table.diff col.diff-marker { + width: 2%; +} +table.diff col.diff-content { + width: 48%; +} +table.diff td div { + /* Force-wrap very long lines such as URLs or page-widening char strings. + CSS 3 draft..., but Gecko doesn't support it yet: + https://bugzilla.mozilla.org/show_bug.cgi?id=99457 */ + word-wrap: break-word; + + /* As fallback, scrollbars will be added for very wide cells + instead of text overflowing or widening */ + overflow: auto; + + /* The above rule breaks on very old versions of Mozilla due + to a bug which collapses the table cells to a single line. + + In Mozilla 1.1 and below with JavaScript enabled, the rule + will be overridden with this by diff.js; wide cell contents + then spill horizontally without widening the rest of the + table: */ + /* overflow: visible; */ +} diff --git a/skins/common/diff.js b/skins/common/diff.js new file mode 100644 index 00000000..e80a895c --- /dev/null +++ b/skins/common/diff.js @@ -0,0 +1,20 @@ +/* +Workaround for overflow bug in Mozilla 1.1 and earlier, where scrolling +
    s in cells collapse their height to a single line. + +Known to be fixed in 1.2.1 (Gecko 20021130), but the CSS hacks I've tried +with overflow-x disable the scrolling all the way until Mozilla 1.8 / FF 1.5 +and break Opera as well. + +So... we check for reaaaally old Gecko and hack in an alternate rule to let +the wide cells spill instead of scrolling them. Not ideal as it won't work +if JS is disabled, of course. +*/ + +if (navigator && navigator.product == "Gecko" && navigator.productSub < "20021130") { + var sheets = document.styleSheets; + var lastSheet = sheets[sheets.length-1]; + lastSheet.insertRule( + "table.diff td div { overflow: visible; }", + lastSheet.cssRules.length); +} \ No newline at end of file diff --git a/skins/common/images/spinner.gif b/skins/common/images/spinner.gif new file mode 100644 index 00000000..57d749b0 Binary files /dev/null and b/skins/common/images/spinner.gif differ diff --git a/skins/common/oldshared.css b/skins/common/oldshared.css new file mode 100644 index 00000000..27d93a03 --- /dev/null +++ b/skins/common/oldshared.css @@ -0,0 +1,465 @@ +/* + * oldshared.css + * This file contains CSS settings common to Wikistandard, Nostalgia and + * CologneBlue, the old pre-Monobook skins + */ + +/* For clarity, explicitly state some recommendations from to make sure the editsection links scale right */ + +h1 { font-size: 2em; } +h2 { font-size: 1.5em; } +h3 { font-size: 1.17em; } +h5 { font-size: .83em; } +h6 { font-size: .75em; } +h1, h2, h3, h4, h5, h6 { font-weight: bolder } + +/* Now the custom parts */ + +/* Make edit sections (which are inside h# tags) normal-sized */ +.editsection { + font-weight: normal; +} +h1 .editsection { font-size: 50% } +h2 .editsection { font-size: 66.7% } +h3 .editsection { font-size: 85.5% } +h5 .editsection { font-size: 120% } +h6 .editsection { font-size: 133% } + +#footer { clear: both } +/* images */ +div.floatright { float: right; clear: right; margin: 0 0 1em 1em; } +div.floatright p { font-style: italic; } +div.floatleft { float: left; clear: left; margin: 0.3em 0.5em 0.5em 0; } +div.floatleft p { font-style: italic; } + + +/* Print-specific things to hide */ +.printfooter { + display: none; +} + +/* table standards */ +table.rimage { + float:right; + margin-left:1em; + margin-bottom:1em; + text-align:center; + font-size:smaller; +} + +/* thumbnails */ +div.thumb { + margin-bottom: .5em; + border-style: solid; + border-color: white; + width: auto; +} +div.thumbinner { + border: 1px solid #ccc; + padding: 3px !important; + background-color: #f9f9f9; + font-size: 94%; + text-align: center; + overflow: hidden; +} +html .thumbimage { + border: 1px solid #ccc; +} +html .thumbcaption { + border: none; + text-align: left; + line-height: 1.4em; + padding: 3px !important; + font-size: 94%; +} +div.magnify { + float: right; + border: none !important; + background: none !important; +} +div.magnify a, div.magnify img { + display: block; + border: none !important; + background: none !important; +} +div.tright { + clear: right; + float: right; + border-width: .5em 0 .8em 1.4em; +} +div.tleft { + float: left; + clear: left; + margin-right: .5em; + border-width: .5em 1.4em .8em 0; +} +img.thumbborder { + border: 1px solid #dddddd; +} + +/* Page history styling */ +/* the auto-generated edit comments */ +.autocomment { color: #4b4b4b; } +#pagehistory span.user { + margin-left: 1.4em; + margin-right: 0.4em; +} +#pagehistory span.minor { font-weight: bold; } +#pagehistory li { border: 1px solid White; } +#pagehistory li.selected { + background-color:#f9f9f9; + border:1px dashed #aaaaaa; +} + +img { border: none; } + +#toc, +.toc { + border: 1px solid #bba; + background-color: #f7f8ff; + padding: 5px; + font-size: 95%; + text-align: center; +} +#toc h2, +.toc h2 { + display: inline; + border: none; + padding: 0; + font-size: 100%; + font-weight: bold; +} +#toc ul, +.toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding-left: 0; + text-align: left; +} +#toc ul ul, +.toc ul ul { + margin: 0 0 0 2em; +} +#toc .toctoggle, +.toc .toctoggle { + font-size: 94%; +} + + +.error { + color: red; + font-size: larger; +} + +/* preference page with js-genrated toc */ +#preftoc { + float: left; + margin: 1em 1em 1em 1em; + width: 13em; +} +#preftoc li { border: 1px solid White; } +#preftoc li.selected { + background-color:#f9f9f9; + border:1px dashed #aaaaaa; +} +#preftoc a, +#preftoc a:active { + display: block; + color: #005189; +} +#prefcontrol { + clear: left; + float: left; + margin-top: 1em; +} +div.prefsectiontip { + font-size: 94%; + margin-top: 0.4em; + color: #666; +} +fieldset.prefsection { margin-top: 1em } +fieldset.operaprefsection { margin-left: 15em } + +/* emulate center */ +.center { + width: 100%; + text-align: center; +} +*.center * { + margin-left: auto; + margin-right: auto; +} +/* small for tables and similar */ +.small, .small * { font-size: 94%; } +table.small { font-size: 100% } + +div.townBox { + position:relative; + float:right; + background:White; + margin-left:1em; + border: 1px solid gray; + padding:0.3em; + width: 200px; + overflow: hidden; + clear: right; +} +div.townBox dl { + padding: 0; + margin: 0 0 0.3em 0; + font-size: 96%; +} +div.townBox dl dt { + background: none; + margin: 0.4em 0 0 0; +} +div.townBox dl dd { + margin: 0.1em 0 0 1.1em; + background-color: #f3f3f3; +} +/* use this instead of #toc for page content */ +.toccolours { + border:1px solid #aaaaaa; + background-color:#f9f9f9; + padding:5px; + font-size: 95%; +} +#siteNotice { + border:1px solid #aaaaaa; + padding-left: 0.5em; + padding-right: 0.5em; +} +.redirectText { + font-size:150%; + margin:5px; +} +.searchmatch { + color: red; + font-weight: bold; +} +.sharedUploadNotice { + font-style: italic; +} +span.unpatrolled { + font-weight:bold; + color:red; +} + +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; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + overflow: hidden; + font-size: 94%; + padding: 2px 4px; +} + +span.comment { + font-style: italic; +} + +span.changedby { + font-size: 95%; +} + +.previewnote { + text-align: center; + color: #cc0000; +} +.editExternally { + border-style:solid; + border-width:1px; + border-color:gray; + background: #ffffff; + padding:3px; + margin-top:0.5em; + float:left; + font-size:small; + text-align:center; +} +.editExternallyHelp { + font-style:italic; + color:gray; +} + +li span.deleted { + text-decoration: line-through; + color: #888; + font-style: italic; +} + +/* Classes for EXIF data display */ +table.mw_metadata { + margin-left: 0.5em; +} + +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 { + border: 1px solid #aaaaaa; + padding-left: 4px; + padding-right: 4px; +} +table.mw_metadata th { + background-color: #f9f9f9; +} +table.mw_metadata td { + background-color: #fcfcfc; +} +table.mw_metadata td.spacer { + background: inherit; + border-top: none; + border-bottom: none; +} +table.collapsed tr.collapsable { + display: none; +} + +.visualClear { + clear: both; +} + +#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; +} + +#jump-to-nav { + 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; + margin: 1em; + -moz-border-radius: 6px; + background: #f0f0f0; +} + +div.multipageimagenavbox div.thumb { + border: none; + margin-left: 2em; + margin-right: 2em; +} + +div.multipageimagenavbox hr { + margin: 6px; +} + +table.multipageimage td { + text-align: center; +} + +/* + 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_nav a { text-decoration: none; } +.TablePager { border-collapse: collapse; } +.TablePager, .TablePager td, .TablePager th { + border: 0.15em solid #777777; + 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: 1em; } + +/* Convenience links on Special:Ipblocklist */ +p.mw-ipb-conveniencelinks { + font-size: 90%; + float: right; +} + +/* Recreating-deleted-page warning and log entries */ +div#mw-recreate-deleted-warn ul li { + font-size: 95%; +} + + +.MediaTransformError { + border: thin solid #777; + background-color: #ccc; + padding: 0.1em; +} +.MediaTransformError td { + text-align: center; + vertical-align: middle; + font-size: 90%; +} diff --git a/skins/common/protect.js b/skins/common/protect.js index d8d1aa1c..b3eec3bd 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -1,89 +1,94 @@ -function protectInitialize(tableId, labelText) { - if (document.createTextNode) { - var box = document.getElementById(tableId); - if (!box) - return false; - - var tbody = box.getElementsByTagName('tbody')[0]; - var row = document.createElement('tr'); - tbody.appendChild(row); - - row.appendChild(document.createElement('td')); - var col2 = document.createElement('td'); - row.appendChild(col2); - - var check = document.createElement('input'); - check.id = "mwProtectUnchained"; - check.type = "checkbox"; - check.onclick = protectChainUpdate; - col2.appendChild(check); - - var space = document.createTextNode(" "); - col2.appendChild(space); - - var label = document.createElement('label'); - label.setAttribute("for", "mwProtectUnchained"); - label.appendChild(document.createTextNode(labelText)); - col2.appendChild(label); - - if (protectAllMatch()) { - check.checked = false; - protectEnable(false); - } else { - check.checked = true; - protectEnable(true); - } +/** + * Set up the protection chaining interface (i.e. "unlock move permissions" checkbox) + * on the protection form + * + * @param String tableId Identifier of the table containing UI bits + * @param String labelText Text to use for the checkbox label + */ +function protectInitialize( tableId, labelText ) { + if( !( document.createTextNode && document.getElementById && document.getElementsByTagName ) ) + return false; - allowCascade(); - - return true; - } - return false; + var box = document.getElementById( tableId ); + if( !box ) + return false; + + var tbody = box.getElementsByTagName( 'tbody' )[0]; + var row = document.createElement( 'tr' ); + tbody.appendChild( row ); + + row.appendChild( document.createElement( 'td' ) ); + var col = document.createElement( 'td' ); + row.appendChild( col ); + + var check = document.createElement( 'input' ); + check.id = 'mwProtectUnchained'; + check.type = 'checkbox'; + col.appendChild( check ); + addClickHandler( check, protectChainUpdate ); + + col.appendChild( document.createTextNode( ' ' ) ); + var label = document.createElement( 'label' ); + label.setAttribute( 'for', 'mwProtectUnchained' ); + label.appendChild( document.createTextNode( labelText ) ); + col.appendChild( label ); + + check.checked = !protectAllMatch(); + protectEnable( check.checked ); + + allowCascade(); + + return true; } function allowCascade() { - var pr_types = document.getElementsByTagName("select"); - for (var i = 0; i < pr_types.length; i++) { - if (pr_types[i].id.match(/^mwProtect-level-/)) { - var selected_level = pr_types[i].getElementsByTagName("option")[pr_types[i].selectedIndex].value; - if ( !isCascadeableLevel(selected_level) ) { - document.getElementById('mwProtect-cascade').checked=false; - document.getElementById('mwProtect-cascade').disabled=true; + var lists = protectSelectors(); + for( var i = 0; i < lists.length; i++ ) { + if( lists[i].selectedIndex > -1 ) { + var items = lists[i].getElementsByTagName( 'option' ); + var selected = items[ lists[i].selectedIndex ].value; + if( wgCascadeableLevels.indexOf( selected ) == -1 ) { + document.getElementById( 'mwProtect-cascade' ).checked = false; + document.getElementById( 'mwProtect-cascade' ).disabled = true; return false; } } } - document.getElementById('mwProtect-cascade').disabled=false; + document.getElementById( 'mwProtect-cascade' ).disabled = false; return true; } -function isCascadeableLevel( level ) { - for (var k = 0; k < wgCascadeableLevels.length; k++) { - if ( wgCascadeableLevels[k] == level ) { - return true; - } - } - return false; -} - +/** + * When protection levels are locked together, update the rest + * when one action's level changes + * + * @param Element source Level selector that changed + */ function protectLevelsUpdate(source) { - if (!protectUnchained()) { - protectUpdateAll(source.selectedIndex); - } + if( !protectUnchained() ) + protectUpdateAll( source.selectedIndex ); allowCascade(); } +/** + * Update chain status and enable/disable various bits of the UI + * when the user changes the "unlock move permissions" checkbox + */ function protectChainUpdate() { - if (protectUnchained()) { - protectEnable(true); + if( protectUnchained() ) { + protectEnable( true ); } else { protectChain(); - protectEnable(false); + protectEnable( false ); } allowCascade(); } - +/** + * Are all actions protected at the same level? + * + * @return boolean + */ function protectAllMatch() { var values = new Array(); protectForSelectors(function(set) { @@ -97,17 +102,22 @@ function protectAllMatch() { return true; } +/** + * Is protection chaining on or off? + * + * @return bool + */ function protectUnchained() { - var unchain = document.getElementById("mwProtectUnchained"); - if (!unchain) { - alert("This shouldn't happen"); - return false; - } - return unchain.checked; + var unchain = document.getElementById( 'mwProtectUnchained' ); + return unchain + ? unchain.checked + : true; // No control, so we need to let the user set both levels } +/** + * Find the highest-protected action and set all others to that level + */ function protectChain() { - // Find the highest-protected action and bump them all to this level var maxIndex = -1; protectForSelectors(function(set) { if (set.selectedIndex > maxIndex) { @@ -117,6 +127,11 @@ function protectChain() { protectUpdateAll(maxIndex); } +/** + * Protect all actions at the specified level + * + * @param int index Protection level + */ function protectUpdateAll(index) { protectForSelectors(function(set) { if (set.selectedIndex != index) { @@ -125,6 +140,11 @@ function protectUpdateAll(index) { }); } +/** + * Apply a callback to each protection selector + * + * @param callable func Callback function + */ function protectForSelectors(func) { var selectors = protectSelectors(); for (var i = 0; i < selectors.length; i++) { @@ -132,6 +152,11 @@ function protectForSelectors(func) { } } +/** + * Get a list of all protection selectors on the page + * + * @return Array + */ function protectSelectors() { var all = document.getElementsByTagName("select"); var ours = new Array(); @@ -144,6 +169,11 @@ function protectSelectors() { return ours; } +/** + * Enable/disable protection selectors + * + * @param boolean val Enable? + */ function protectEnable(val) { // fixme var first = true; diff --git a/skins/common/shared.css b/skins/common/shared.css new file mode 100644 index 00000000..f6d63ab8 --- /dev/null +++ b/skins/common/shared.css @@ -0,0 +1,48 @@ +/** + * CSS in this file is used by *all* skins (that have any CSS at all). Be + * careful what you put in here, since what looks good in one skin may not in + * another, but don't ignore the poor non-Monobook users either. + */ +.mw-plusminus-null { color: #aaa; } + +.texvc { direction: ltr; unicode-bidi: embed; } +img.tex { vertical-align: middle; } +span.texhtml { font-family: serif; } + +/* Stop floats from intruding into edit area in previews */ +#toolbar, #wpTextbox1 { clear: both; } + +div#mw-js-message { + margin: 1em 5%; + padding: 0.5em 2.5%; + border: solid 1px #ddd; + background-color: #fcfcfc; +} + +/* Edit section links */ +.editsection { + float: right; + margin-left: 5px; +} + +/** + * File histories + */ +table.filehistory { + border:1px solid #ccc; + border-collapse:collapse; +} + +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; +} +table.filehistory td.mw-imagepage-filesize, +table.filehistory th.mw-imagepage-filesize { + white-space:nowrap; +} diff --git a/skins/common/upload.js b/skins/common/upload.js index 160fbf27..7cbfc9aa 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -1,23 +1,176 @@ function licenseSelectorCheck() { - var selector = document.getElementById("wpLicense"); - if (selector.selectedIndex > 0 && - selector.options[selector.selectedIndex].value == "" ) { - // Browser is broken, doesn't respect disabled attribute on