Index: trunk/phase3/skins/Standard.php |
— | — | @@ -59,23 +59,6 @@ |
60 | 60 | return $s; |
61 | 61 | } |
62 | 62 | |
63 | | - /** |
64 | | - * |
65 | | - */ |
66 | | - function getBodyOptions() { |
67 | | - $a = parent::getBodyOptions(); |
68 | | - |
69 | | - if ( 3 == $this->qbSetting() ) { # Floating left |
70 | | - $qb = "setup(\"quickbar\")"; |
71 | | - if( $a['onload'] ) { |
72 | | - $a['onload'] .= ";$qb"; |
73 | | - } else { |
74 | | - $a['onload'] = $qb; |
75 | | - } |
76 | | - } |
77 | | - return $a; |
78 | | - } |
79 | | - |
80 | 63 | function doAfterContent() { |
81 | 64 | global $wgContLang, $wgLang; |
82 | 65 | wfProfileIn( __METHOD__ ); |
Index: trunk/phase3/skins/common/sticky.js |
— | — | @@ -31,7 +31,9 @@ |
32 | 32 | //mySticky.css.visibility="visible"; |
33 | 33 | } |
34 | 34 | |
| 35 | +hookEvent( 'load', function() { setup( 'quickbar' ); } ); |
35 | 36 | |
| 37 | + |
36 | 38 | // ------------------------- |
37 | 39 | // emulate css 'position: fixed' in IE5+ Win |
38 | 40 | // code by aclover@1value.com |
Index: trunk/phase3/skins/common/oldshared.css |
— | — | @@ -374,3 +374,10 @@ |
375 | 375 | form#specialpages { |
376 | 376 | display: inline; |
377 | 377 | } |
| 378 | + |
| 379 | +body { |
| 380 | + background-color: #ffffec; |
| 381 | +} |
| 382 | +body.ns-0 { |
| 383 | + background-color: white; |
| 384 | +} |
Index: trunk/phase3/skins/Vector.php |
— | — | @@ -448,7 +448,6 @@ |
449 | 449 | // Output HTML Page |
450 | 450 | $this->html( 'headelement' ); |
451 | 451 | ?> |
452 | | - <body<?php if ( $this->data['body_ondblclick'] ): ?> ondblclick="<?php $this->text( 'body_ondblclick' ) ?>"<?php endif; ?> class="mediawiki <?php $this->text( 'dir' ) ?> <?php $this->text( 'pageclass' ) ?> <?php $this->text( 'skinnameclass' ) ?>" dir="<?php $this->text( 'dir' ) ?>"> |
453 | 452 | <div id="page-base" class="noprint"></div> |
454 | 453 | <div id="head-base" class="noprint"></div> |
455 | 454 | <!-- content --> |
Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -69,9 +69,7 @@ |
70 | 70 | wfSuppressWarnings(); |
71 | 71 | |
72 | 72 | $this->html( 'headelement' ); |
73 | | -?><body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?> |
74 | | - class="mediawiki <?php $this->text('dir'); $this->text('capitalizeallnouns') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>"> |
75 | | - <div id="globalWrapper"> |
| 73 | +?> <div id="globalWrapper"> |
76 | 74 | <div id="column-content"> |
77 | 75 | <div id="content" <?php $this->html("specialpageattributes") ?>> |
78 | 76 | <a id="top"></a> |
Index: trunk/phase3/skins/Modern.php |
— | — | @@ -62,8 +62,7 @@ |
63 | 63 | wfSuppressWarnings(); |
64 | 64 | |
65 | 65 | $this->html( 'headelement' ); |
66 | | -?><body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?> |
67 | | - class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>"> |
| 66 | +?> |
68 | 67 | |
69 | 68 | <!-- heading --> |
70 | 69 | <div id="mw_header"><h1 id="firstHeading"><?php $this->html('title') ?></h1></div> |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1604,6 +1604,7 @@ |
1605 | 1605 | global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; |
1606 | 1606 | global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; |
1607 | 1607 | global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgHtml5, $wgWellFormedXml; |
| 1608 | + global $wgUser, $wgRequest, $wgLang; |
1608 | 1609 | |
1609 | 1610 | $this->addMeta( "http:Content-Type", "$wgMimeType; charset={$wgOutputEncoding}" ); |
1610 | 1611 | if ( $sk->commonPrintStylesheet() ) { |
— | — | @@ -1665,6 +1666,38 @@ |
1666 | 1667 | $ret .= $this->getTitle()->trackbackRDF(); |
1667 | 1668 | |
1668 | 1669 | $ret .= "</head>\n"; |
| 1670 | + |
| 1671 | + $bodyAttrs = array(); |
| 1672 | + |
| 1673 | + # Crazy edit-on-double-click stuff |
| 1674 | + $action = $wgRequest->getVal( 'action', 'view' ); |
| 1675 | + |
| 1676 | + if ( $this->mTitle->getNamespace() != NS_SPECIAL |
| 1677 | + && !in_array( $action, array( 'edit', 'submit' ) ) |
| 1678 | + && $wgUser->getOption( 'editondblclick' ) ) { |
| 1679 | + $bodyAttrs['ondblclick'] = "document.location = '" . Xml::escapeJsString( $this->mTitle->getEditURL() ) . "'"; |
| 1680 | + } |
| 1681 | + |
| 1682 | + # Class bloat |
| 1683 | + $bodyAttrs['class'] = "mediawiki $dir"; |
| 1684 | + |
| 1685 | + if ( $wgLang->capitalizeAllNouns() ) { |
| 1686 | + # A <body> class is probably not the best way to do this . . . |
| 1687 | + $bodyAttrs['class'] .= ' capitalize-all-nouns'; |
| 1688 | + } |
| 1689 | + $bodyAttrs['class'] .= ' ns-' . $this->mTitle->getNamespace(); |
| 1690 | + if ( $this->mTitle->getNamespace() == NS_SPECIAL ) { |
| 1691 | + $bodyAttrs['class'] .= ' ns-special'; |
| 1692 | + } elseif ( $this->mTitle->isTalkPage() ) { |
| 1693 | + $bodyAttrs['class'] .= ' ns-talk'; |
| 1694 | + } else { |
| 1695 | + $bodyAttrs['class'] .= ' ns-subject'; |
| 1696 | + } |
| 1697 | + $bodyAttrs['class'] .= ' ' . Sanitizer::escapeClass( 'page-' . $this->mTitle->getPrefixedText() ); |
| 1698 | + $bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $wgUser->getSkin()->getSkinName() ); |
| 1699 | + |
| 1700 | + $ret .= Html::openElement( 'body', $bodyAttrs ) . "\n"; |
| 1701 | + |
1669 | 1702 | return $ret; |
1670 | 1703 | } |
1671 | 1704 | |
Index: trunk/phase3/includes/Html.php |
— | — | @@ -106,6 +106,37 @@ |
107 | 107 | * @return string Raw HTML |
108 | 108 | */ |
109 | 109 | public static function rawElement( $element, $attribs = array(), $contents = '' ) { |
| 110 | + global $wgWellFormedXml; |
| 111 | + $start = self::openElement( $element, $attribs ); |
| 112 | + if ( in_array( $element, self::$voidElements ) ) { |
| 113 | + if ( $wgWellFormedXml ) { |
| 114 | + # Silly XML. |
| 115 | + return substr( $start, 0, -1 ) . ' />'; |
| 116 | + } |
| 117 | + return $start; |
| 118 | + } else { |
| 119 | + return "$start$contents</$element>"; |
| 120 | + } |
| 121 | + } |
| 122 | + |
| 123 | + /** |
| 124 | + * Identical to rawElement(), but HTML-escapes $contents (like |
| 125 | + * Xml::element()). |
| 126 | + */ |
| 127 | + public static function element( $element, $attribs = array(), $contents = '' ) { |
| 128 | + return self::rawElement( $element, $attribs, strtr( $contents, array( |
| 129 | + # There's no point in escaping quotes, >, etc. in the contents of |
| 130 | + # elements. |
| 131 | + '&' => '&', |
| 132 | + '<' => '<' |
| 133 | + ) ) ); |
| 134 | + } |
| 135 | + |
| 136 | + /** |
| 137 | + * Identical to rawElement(), but has no third parameter and omits the end |
| 138 | + * tag (and the self-closing / in XML mode for empty elements). |
| 139 | + */ |
| 140 | + public static function openElement( $element, $attribs = array() ) { |
110 | 141 | global $wgHtml5, $wgWellFormedXml; |
111 | 142 | $attribs = (array)$attribs; |
112 | 143 | # This is not required in HTML5, but let's do it anyway, for |
— | — | @@ -155,32 +186,11 @@ |
156 | 187 | } |
157 | 188 | } |
158 | 189 | |
159 | | - $start = "<$element" . self::expandAttributes( |
160 | | - self::dropDefaults( $element, $attribs ) ); |
161 | | - if ( in_array( $element, self::$voidElements ) ) { |
162 | | - if ( $wgWellFormedXml ) { |
163 | | - return "$start />"; |
164 | | - } |
165 | | - return "$start>"; |
166 | | - } else { |
167 | | - return "$start>$contents</$element>"; |
168 | | - } |
| 190 | + return "<$element" . self::expandAttributes( |
| 191 | + self::dropDefaults( $element, $attribs ) ) . '>'; |
169 | 192 | } |
170 | 193 | |
171 | 194 | /** |
172 | | - * Identical to rawElement(), but HTML-escapes $contents (like |
173 | | - * Xml::element()). |
174 | | - */ |
175 | | - public static function element( $element, $attribs = array(), $contents = '' ) { |
176 | | - return self::rawElement( $element, $attribs, strtr( $contents, array( |
177 | | - # There's no point in escaping quotes, >, etc. in the contents of |
178 | | - # elements. |
179 | | - '&' => '&', |
180 | | - '<' => '<' |
181 | | - ) ) ); |
182 | | - } |
183 | | - |
184 | | - /** |
185 | 195 | * Given an element name and an associative array of element attributes, |
186 | 196 | * return an array that is functionally identical to the input array, but |
187 | 197 | * possibly smaller. In particular, attributes might be stripped if they |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -485,13 +485,6 @@ |
486 | 486 | $content_actions = $this->buildContentActionUrls(); |
487 | 487 | $tpl->setRef( 'content_actions', $content_actions ); |
488 | 488 | |
489 | | - // XXX: attach this from javascript, same with section editing |
490 | | - if( $this->iseditable && $wgUser->getOption( 'editondblclick' ) ){ |
491 | | - $encEditUrl = Xml::escapeJsString( $this->mTitle->getLocalUrl( $this->editUrlOptions() ) ); |
492 | | - $tpl->set( 'body_ondblclick', 'document.location = "' . $encEditUrl . '";' ); |
493 | | - } else { |
494 | | - $tpl->set( 'body_ondblclick', false ); |
495 | | - } |
496 | 489 | $tpl->set( 'sidebar', $this->buildSidebar() ); |
497 | 490 | $tpl->set( 'nav_urls', $this->buildNavUrls() ); |
498 | 491 | |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -303,12 +303,6 @@ |
304 | 304 | |
305 | 305 | $out->out( $out->headElement( $this ) ); |
306 | 306 | |
307 | | - $out->out( "\n<body" ); |
308 | | - $ops = $this->getBodyOptions(); |
309 | | - foreach ( $ops as $name => $val ) { |
310 | | - $out->out( " $name='$val'" ); |
311 | | - } |
312 | | - $out->out( ">\n" ); |
313 | 307 | if ( $wgDebugComments ) { |
314 | 308 | $out->out( "<!-- Wiki debugging output:\n" . |
315 | 309 | $out->mDebugtext . "-->\n" ); |
— | — | @@ -657,29 +651,6 @@ |
658 | 652 | $out->addStyle( 'common/common_rtl.css', '', '', 'rtl' ); |
659 | 653 | } |
660 | 654 | |
661 | | - function getBodyOptions() { |
662 | | - global $wgUser, $wgOut, $wgRequest, $wgContLang; |
663 | | - |
664 | | - extract( $wgRequest->getValues( 'oldid', 'redirect', 'diff' ) ); |
665 | | - |
666 | | - if ( 0 != $this->mTitle->getNamespace() ) { |
667 | | - $a = array( 'bgcolor' => '#ffffec' ); |
668 | | - } |
669 | | - else $a = array( 'bgcolor' => '#FFFFFF' ); |
670 | | - if( $wgOut->isArticle() && $wgUser->getOption( 'editondblclick' ) && |
671 | | - $this->mTitle->quickUserCan( 'edit' ) ) { |
672 | | - $s = $this->mTitle->getFullURL( $this->editUrlOptions() ); |
673 | | - $s = 'document.location = "' .Xml::escapeJsString( $s ) .'";'; |
674 | | - $a += array( 'ondblclick' => $s ); |
675 | | - } |
676 | | - $a['class'] = |
677 | | - 'mediawiki' . |
678 | | - ' '.( $wgContLang->getDir() ). |
679 | | - ' '.$this->getPageClasses( $this->mTitle ) . |
680 | | - ' skin-'. Sanitizer::escapeClass( $this->getSkinName() ); |
681 | | - return $a; |
682 | | - } |
683 | | - |
684 | 655 | function getPageClasses( $title ) { |
685 | 656 | $numeric = 'ns-'.$title->getNamespace(); |
686 | 657 | if( $title->getNamespace() == NS_SPECIAL ) { |