r57125 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57124‎ | r57125 | r57126 >
Date:17:58, 30 September 2009
Author:catrope
Status:ok
Tags:
Comment:
Revert r56924 (new watch icon and color changes for Vector) and followups r57006, r57012, r57013, r57030, r57034, r57036, r57117: we don't want this in trunk right now, moving it to its own branch
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)
  • /trunk/phase3/skins/common/ajaxwatch.js (modified) (history)
  • /trunk/phase3/skins/vector/images/watch-icon-loading.gif (deleted) (history)
  • /trunk/phase3/skins/vector/images/watch-icons.png (deleted) (history)
  • /trunk/phase3/skins/vector/main-ltr.css (modified) (history)
  • /trunk/phase3/skins/vector/main-rtl.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/ajaxwatch.js
@@ -21,29 +21,16 @@
2222 wgAjaxWatch.inprogress = false; // ajax request in progress
2323 wgAjaxWatch.timeoutID = null; // see wgAjaxWatch.ajaxCall
2424 wgAjaxWatch.watchLinks = []; // "watch"/"unwatch" links
25 -wgAjaxWatch.iconMode = false; // new icon driven functionality
26 -wgAjaxWatch.imgBasePath = ""; // base img path derived from icons on load
2725
28 -wgAjaxWatch.setLinkText = function( newText ) {
29 - if( wgAjaxWatch.iconMode ) {
30 - for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
31 - wgAjaxWatch.watchLinks[i].firstChild.alt = newText;
32 - if ( newText == wgAjaxWatch.watchingMsg || newText == wgAjaxWatch.unwatchingMsg ) {
33 - wgAjaxWatch.watchLinks[i].className += ' loading';
34 - } else if ( newText == wgAjaxWatch.watchMsg || newText == wgAjaxWatch.unwatchMsg ) {
35 - wgAjaxWatch.watchLinks[i].className = wgAjaxWatch.watchLinks[i].className.replace( /loading/i, '' );
36 - }
37 - }
38 - } else {
39 - for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
40 - changeText( wgAjaxWatch.watchLinks[i], newText );
41 - }
 26+wgAjaxWatch.setLinkText = function(newText) {
 27+ for (i = 0; i < wgAjaxWatch.watchLinks.length; i++) {
 28+ changeText(wgAjaxWatch.watchLinks[i], newText);
4229 }
4330 };
4431
45 -wgAjaxWatch.setLinkID = function( newId ) {
 32+wgAjaxWatch.setLinkID = function(newId) {
4633 // We can only set the first one
47 - wgAjaxWatch.watchLinks[0].parentNode.setAttribute( 'id', newId );
 34+ wgAjaxWatch.watchLinks[0].setAttribute( 'id', newId );
4835 akeytt(newId); // update tooltips for Monobook
4936 };
5037
@@ -125,33 +112,27 @@
126113 wgAjaxWatch.onLoad = function() {
127114 // This document structure hardcoding sucks. We should make a class and
128115 // toss all this out the window.
129 -
130116 var el1 = document.getElementById("ca-unwatch");
131117 var el2 = null;
132 - if ( !el1 ) {
 118+ if (!el1) {
133119 el1 = document.getElementById("mw-unwatch-link1");
134120 el2 = document.getElementById("mw-unwatch-link2");
135121 }
136 - if( el1 ) {
 122+ if(el1) {
137123 wgAjaxWatch.watching = true;
138124 } else {
139125 wgAjaxWatch.watching = false;
140126 el1 = document.getElementById("ca-watch");
141 - if ( !el1 ) {
 127+ if (!el1) {
142128 el1 = document.getElementById("mw-watch-link1");
143129 el2 = document.getElementById("mw-watch-link2");
144130 }
145 - if( !el1 ) {
 131+ if(!el1) {
146132 wgAjaxWatch.supported = false;
147133 return;
148134 }
149135 }
150 -
151 - // Detect if the watch/unwatch feature is in icon mode
152 - if ( el1.className.match( /icon/i ) ) {
153 - wgAjaxWatch.iconMode = true;
154 - }
155 -
 136+
156137 // The id can be either for the parent (Monobook-based) or the element
157138 // itself (non-Monobook)
158139 wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a"
Index: trunk/phase3/skins/Vector.php
@@ -59,8 +59,8 @@
6060 * @private
6161 */
6262 function buildNavigationUrls() {
63 - global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
64 - global $wgDisableLangConversion, $wgVectorUseIconWatch;
 63+ global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
 64+ global $wgDisableLangConversion;
6565
6666 wfProfileIn( __METHOD__ );
6767
@@ -271,6 +271,7 @@
272272 }
273273 }
274274 wfProfileOut( __METHOD__ . '-live' );
 275+
275276 /**
276277 * The following actions use messages which, if made particular to
277278 * the Vector skin, would break the Ajax code which makes this
@@ -281,21 +282,29 @@
282283 * the global versions.
283284 */
284285 // Checks if the user is logged in
285 - if ( $this->loggedin ) {
286 - if ( $wgVectorUseIconWatch ) {
287 - $class = 'icon ';
288 - $place = 'views';
 286+ if( $this->loggedin ) {
 287+ // Checks if the user is watching this page
 288+ if( !$this->mTitle->userIsWatching() ) {
 289+ // Adds watch action link
 290+ $links['actions']['watch'] = array(
 291+ 'class' =>
 292+ ( $action == 'watch' or $action == 'unwatch' ) ?
 293+ 'selected' : false,
 294+ 'text' => wfMsg( 'watch' ),
 295+ 'href' => $this->mTitle->getLocalUrl( 'action=watch' )
 296+ );
289297 } else {
290 - $class = '';
291 - $place = 'actions';
 298+ // Adds unwatch action link
 299+ $links['actions']['unwatch'] = array(
 300+ 'class' =>
 301+ ($action == 'unwatch' or $action == 'watch') ?
 302+ 'selected' : false,
 303+ 'text' => wfMsg( 'unwatch' ),
 304+ 'href' => $this->mTitle->getLocalUrl( 'action=unwatch' )
 305+ );
292306 }
293 - $mode = $this->mTitle->userIsWatching() ? 'unwatch' : 'watch';
294 - $links[$place][$mode] = array(
295 - 'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ),
296 - 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
297 - 'href' => $this->mTitle->getLocalUrl( 'action=' . $mode )
298 - );
299307 }
 308+
300309 // This is instead of SkinTemplateTabs - which uses a flat array
301310 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
302311
@@ -713,7 +722,7 @@
714723 <h5><?php $this->msg('views') ?></h5>
715724 <ul <?php $this->html('userlangattributes') ?>>
716725 <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
717 - <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>
 726+ <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>
718727 <?php endforeach; ?>
719728 </ul>
720729 </div>
Index: trunk/phase3/skins/vector/images/watch-icons.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/phase3/skins/vector/images/watch-icon-loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/phase3/skins/vector/main-ltr.css
@@ -24,9 +24,8 @@
2525 font-size: 1em;
2626 }
2727 body {
 28+ background-color: #f3f3f3;
2829 background-image: url(images/page-base.png);
29 - background-color: #f9f9f9;
30 - color: #000000;
3130 }
3231 /* Content */
3332 #content {
@@ -187,14 +186,14 @@
188187 div.vectorTabs li.selected a span,
189188 div.vectorTabs li.selected a:visited
190189 div.vectorTabs li.selected a:visited span {
191 - color: #be5900;
 190+ color: #333333;
192191 text-decoration: none;
193192 }
194193 div.vectorTabs li.new a,
195194 div.vectorTabs li.new a span,
196195 div.vectorTabs li.new a:visited,
197196 div.vectorTabs li.new a:visited span {
198 - color: #990000;
 197+ color: #a55858;
199198 }
200199 /* Variants and Actions */
201200 /* @noflip */
@@ -591,11 +590,11 @@
592591 /* Links */
593592 a {
594593 text-decoration: none;
595 - color: #003cb3;
 594+ color: #0645ad;
596595 background: none;
597596 }
598597 a:visited {
599 - color: #004d99;
 598+ color: #0b0080;
600599 }
601600 a:active {
602601 color: #faa700;
@@ -607,7 +606,7 @@
608607 color: #772233;
609608 }
610609 a.new, #p-personal a.new {
611 - color: #990000;
 610+ color: #ba0000;
612611 }
613612 a.new:visited, #p-personal a.new:visited {
614613 color: #a55858;
@@ -639,7 +638,7 @@
640639 margin: 0;
641640 padding-top: .5em;
642641 padding-bottom: .17em;
643 - border-bottom: 1px solid #8d8d8d;
 642+ border-bottom: 1px solid #aaa;
644643 width: auto;
645644 }
646645 h1 { font-size: 188%; }
@@ -766,8 +765,8 @@
767766 #toc,
768767 .toc,
769768 .mw-warning {
770 - border: 1px solid #c0c0c0;
771 - background-color: #f0f0f0;
 769+ border: 1px solid #aaa;
 770+ background-color: #f9f9f9;
772771 padding: 5px;
773772 font-size: 95%;
774773 }
@@ -827,16 +826,15 @@
828827 background-color: transparent;
829828 }
830829 div.thumbinner {
831 - border: 1px solid #c0c0c0;
 830+ border: 1px solid #ccc;
832831 padding: 3px !important;
833 - background-color: #f0f0f0;
 832+ background-color: #f9f9f9;
834833 font-size: 94%;
835834 text-align: center;
836835 overflow: hidden;
837836 }
838837 html .thumbimage {
839 - border: 1px solid #c0c0c0;
840 - background-color: #f0f0f0;
 838+ border: 1px solid #ccc;
841839 }
842840 html .thumbcaption {
843841 border: none;
@@ -956,7 +954,6 @@
957955 line-height: 1.2em;
958956 font-size: 1.6em;
959957 padding-bottom: 0;
960 - color:#005780;
961958 }
962959 #content a.external,
963960 #content a[href ^="gopher://"] {
@@ -1034,6 +1031,7 @@
10351032 padding-left: 15px !important;
10361033 text-transform: none;
10371034 }
 1035+
10381036 .toccolours {
10391037 border: 1px solid #aaa;
10401038 background-color: #f9f9f9;
@@ -1044,48 +1042,10 @@
10451043 position: relative;
10461044 width: 100%;
10471045 }
1048 -
10491046 #mw-js-message {
10501047 font-size: 0.8em;
10511048 }
10521049 div#bodyContent {
10531050 line-height: 1.5em;
10541051 }
1055 -/* Watch/Unwatch Icon Styling */
1056 -#ca-unwatch.icon,
1057 -#ca-watch.icon {
1058 -}
1059 -#ca-unwatch.icon a,
1060 -#ca-watch.icon a {
1061 - margin: 0;
1062 - padding: 0;
1063 - outline: none;
1064 - display: block;
1065 - width: 26px;
1066 - height: 2.5em;
1067 -}
1068 -#ca-unwatch.icon a {
1069 - background-image: url(images/watch-icons.png);
1070 - background-position: -43px 60%;
1071 -}
1072 -#ca-watch.icon a {
1073 - background-image: url(images/watch-icons.png);
1074 - background-position: 5px 60%;
1075 -}
1076 -#ca-unwatch.icon a:hover {
1077 - background-image: url(images/watch-icons.png);
1078 - background-position: -67px 60%;
1079 -}
1080 -#ca-watch.icon a:hover {
1081 - background-image: url(images/watch-icons.png);
1082 - background-position: -19px 60%;
1083 -}
1084 -#ca-unwatch.icon a.loading,
1085 -#ca-watch.icon a.loading {
1086 - background-image: url(images/watch-icon-loading.gif);
1087 - background-position: center 60%;
1088 -}
1089 -#ca-unwatch.icon a span,
1090 -#ca-watch.icon a span {
1091 - display: none;
1092 -}
\ No newline at end of file
 1052+
Index: trunk/phase3/skins/vector/main-rtl.css
@@ -1042,7 +1042,6 @@
10431043 position: relative;
10441044 width: 100%;
10451045 }
1046 -
10471046 #mw-js-message {
10481047 font-size: 0.8em;
10491048 }
@@ -1050,71 +1049,4 @@
10511050 line-height: 1.5em;
10521051 }
10531052
1054 -
1055 -
1056 -/* Babaco color scheme */
1057 -/* Still working on this. Needs incorporated above once it's closer to final */
1058 -body {
1059 - background-color: #f9f9f9;
1060 - color: #000000;
1061 -}
1062 -a {
1063 - color: #003cb3;
1064 -}
1065 -a.new {
1066 - color: #990000;
1067 -}
1068 -
1069 -a:visited,
1070 -div.vectorTabs li.selected a:visited div.vectorTabs li.selected a:visited span {
1071 - color: #260e9c;
1072 -}
1073 -
1074 -html .thumbimage,
1075 -#toc, .toc, .mw-warning, div.thumbinner {
1076 - border-color: #c0c0c0;
1077 - background-color: #f0f0f0;
1078 -}
1079 -
1080 -h1, h2, h3, h4, h5, h6 {
1081 - border-color: #8d8d8d;
1082 -}
1083 -
1084 -/* Watch/Unwatch Icon Styling */
1085 -#ca-unwatch.icon,
1086 -#ca-watch.icon {
1087 -}
1088 -#ca-unwatch.icon a,
1089 -#ca-watch.icon a {
1090 - margin: 0;
1091 - padding: 0;
1092 - outline: none;
1093 - display: block;
1094 - width: 26px;
1095 - height: 2.5em;
1096 -}
1097 -#ca-unwatch.icon a {
1098 - background-image: url(images/watch-icons.png);
1099 - background-position: -43px 60%;
1100 -}
1101 -#ca-watch.icon a {
1102 - background-image: url(images/watch-icons.png);
1103 - background-position: 5px 60%;
1104 -}
1105 -#ca-unwatch.icon a:hover {
1106 - background-image: url(images/watch-icons.png);
1107 - background-position: -67px 60%;
1108 -}
1109 -#ca-watch.icon a:hover {
1110 - background-image: url(images/watch-icons.png);
1111 - background-position: -19px 60%;
1112 -}
1113 -#ca-unwatch.icon a.loading,
1114 -#ca-watch.icon a.loading {
1115 - background-image: url(images/watch-icon-loading.gif);
1116 - background-position: center 60%;
1117 -}
1118 -#ca-unwatch.icon a span,
1119 -#ca-watch.icon a span {
1120 - display: none;
1121 -}
\ No newline at end of file
 1053+
\ No newline at end of file
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1606,7 +1606,7 @@
16071607 * to ensure that client-side caches do not keep obsolete copies of global
16081608 * styles.
16091609 */
1610 -$wgStyleVersion = '243';
 1610+$wgStyleVersion = '241';
16111611
16121612
16131613 # Server-side caching:
@@ -4096,20 +4096,13 @@
40974097 $wgUseTwoButtonsSearchForm = true;
40984098
40994099 /**
4100 - * Search form behavior for Vector skin only
 4100+ * Search form behavior for Vector skin only
41014101 * true = use an icon search button
41024102 * false = use Go & Search buttons
41034103 */
41044104 $wgVectorUseSimpleSearch = false;
41054105
41064106 /**
4107 - * Watch and unwatch as an icon rather than a link for Vector skin only
4108 - * true = use an icon watch/unwatch button
4109 - * false = use watch/unwatch text link
4110 - */
4111 -$wgVectorUseIconWatch = false;
4112 -
4113 -/**
41144107 * Preprocessor caching threshold
41154108 */
41164109 $wgPreprocessorCacheThreshold = 1000;

Follow-up revisions

RevisionCommit summaryAuthorDate
r57128Re-add the revs reverted in r57125 to the usability branchcatrope18:35, 30 September 2009
r57130Put the watch icon part of the changes reverted in r57125 back in.catrope18:46, 30 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56924Moving watch/unwatch action out of the drop downadam18:04, 25 September 2009
r57006addressing feedback on the watch/unwatch javascript changes introduced in r56924adam02:45, 28 September 2009
r57012Fix for r56924: don't do any mouseover/mouseout effects while the spinner is ...catrope09:48, 28 September 2009
r57013Coding style cleanup for r56924; also copypaste main-ltr.css modifications to...catrope10:09, 28 September 2009
r57030Refactored the watch/unwatch icon for Vector....tparscal22:25, 28 September 2009
r57034Oops! The on/off states of the star icon were backwards!tparscal22:42, 28 September 2009
r57036Inc $wgStyleVersion to reflect changes in r57030 and r57034 (watch/unwatch ic...tparscal22:49, 28 September 2009
r57117Vector color changesadam16:59, 30 September 2009

Status & tagging log