r57128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57127‎ | r57128 | r57129 >
Date:18:35, 30 September 2009
Author:catrope
Status:deferred
Tags:
Comment:
Re-add the revs reverted in r57125 to the usability branch
Modified paths:
  • /branches/usability/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/usability/phase3/skins/Vector.php (modified) (history)
  • /branches/usability/phase3/skins/common/ajaxwatch.js (modified) (history)
  • /branches/usability/phase3/skins/vector/images/watch-icon-loading.gif (added) (history)
  • /branches/usability/phase3/skins/vector/images/watch-icons.png (added) (history)
  • /branches/usability/phase3/skins/vector/main-ltr.css (modified) (history)
  • /branches/usability/phase3/skins/vector/main-rtl.css (modified) (history)

Diff [purge]

Index: branches/usability/phase3/skins/common/ajaxwatch.js
@@ -21,16 +21,29 @@
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
2527
26 -wgAjaxWatch.setLinkText = function(newText) {
27 - for (i = 0; i < wgAjaxWatch.watchLinks.length; i++) {
28 - changeText(wgAjaxWatch.watchLinks[i], newText);
 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+ }
2942 }
3043 };
3144
32 -wgAjaxWatch.setLinkID = function(newId) {
 45+wgAjaxWatch.setLinkID = function( newId ) {
3346 // We can only set the first one
34 - wgAjaxWatch.watchLinks[0].setAttribute( 'id', newId );
 47+ wgAjaxWatch.watchLinks[0].parentNode.setAttribute( 'id', newId );
3548 akeytt(newId); // update tooltips for Monobook
3649 };
3750
@@ -112,27 +125,33 @@
113126 wgAjaxWatch.onLoad = function() {
114127 // This document structure hardcoding sucks. We should make a class and
115128 // toss all this out the window.
 129+
116130 var el1 = document.getElementById("ca-unwatch");
117131 var el2 = null;
118 - if (!el1) {
 132+ if ( !el1 ) {
119133 el1 = document.getElementById("mw-unwatch-link1");
120134 el2 = document.getElementById("mw-unwatch-link2");
121135 }
122 - if(el1) {
 136+ if( el1 ) {
123137 wgAjaxWatch.watching = true;
124138 } else {
125139 wgAjaxWatch.watching = false;
126140 el1 = document.getElementById("ca-watch");
127 - if (!el1) {
 141+ if ( !el1 ) {
128142 el1 = document.getElementById("mw-watch-link1");
129143 el2 = document.getElementById("mw-watch-link2");
130144 }
131 - if(!el1) {
 145+ if( !el1 ) {
132146 wgAjaxWatch.supported = false;
133147 return;
134148 }
135149 }
136 -
 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+
137156 // The id can be either for the parent (Monobook-based) or the element
138157 // itself (non-Monobook)
139158 wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a"
Index: branches/usability/phase3/skins/Vector.php
@@ -59,8 +59,8 @@
6060 * @private
6161 */
6262 function buildNavigationUrls() {
63 - global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
64 - global $wgDisableLangConversion;
 63+ global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
 64+ global $wgDisableLangConversion, $wgVectorUseIconWatch;
6565
6666 wfProfileIn( __METHOD__ );
6767
@@ -271,7 +271,6 @@
272272 }
273273 }
274274 wfProfileOut( __METHOD__ . '-live' );
275 -
276275 /**
277276 * The following actions use messages which, if made particular to
278277 * the Vector skin, would break the Ajax code which makes this
@@ -282,29 +281,21 @@
283282 * the global versions.
284283 */
285284 // Checks if the user is logged in
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 - );
 285+ if ( $this->loggedin ) {
 286+ if ( $wgVectorUseIconWatch ) {
 287+ $class = 'icon ';
 288+ $place = 'views';
297289 } else {
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 - );
 290+ $class = '';
 291+ $place = 'actions';
306292 }
 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+ );
307299 }
308 -
309300 // This is instead of SkinTemplateTabs - which uses a flat array
310301 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
311302
@@ -722,7 +713,7 @@
723714 <h5><?php $this->msg('views') ?></h5>
724715 <ul <?php $this->html('userlangattributes') ?>>
725716 <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
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>
 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>
727718 <?php endforeach; ?>
728719 </ul>
729720 </div>
Index: branches/usability/phase3/skins/vector/images/watch-icons.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/usability/phase3/skins/vector/images/watch-icons.png
___________________________________________________________________
Name: svn:mime-type
730721 + application/octet-stream
Index: branches/usability/phase3/skins/vector/images/watch-icon-loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/usability/phase3/skins/vector/images/watch-icon-loading.gif
___________________________________________________________________
Name: svn:mime-type
731722 + application/octet-stream
Index: branches/usability/phase3/skins/vector/main-ltr.css
@@ -24,8 +24,9 @@
2525 font-size: 1em;
2626 }
2727 body {
28 - background-color: #f3f3f3;
2928 background-image: url(images/page-base.png);
 29+ background-color: #f9f9f9;
 30+ color: #000000;
3031 }
3132 /* Content */
3233 #content {
@@ -186,14 +187,14 @@
187188 div.vectorTabs li.selected a span,
188189 div.vectorTabs li.selected a:visited
189190 div.vectorTabs li.selected a:visited span {
190 - color: #333333;
 191+ color: #be5900;
191192 text-decoration: none;
192193 }
193194 div.vectorTabs li.new a,
194195 div.vectorTabs li.new a span,
195196 div.vectorTabs li.new a:visited,
196197 div.vectorTabs li.new a:visited span {
197 - color: #a55858;
 198+ color: #990000;
198199 }
199200 /* Variants and Actions */
200201 /* @noflip */
@@ -590,11 +591,11 @@
591592 /* Links */
592593 a {
593594 text-decoration: none;
594 - color: #0645ad;
 595+ color: #003cb3;
595596 background: none;
596597 }
597598 a:visited {
598 - color: #0b0080;
 599+ color: #004d99;
599600 }
600601 a:active {
601602 color: #faa700;
@@ -606,7 +607,7 @@
607608 color: #772233;
608609 }
609610 a.new, #p-personal a.new {
610 - color: #ba0000;
 611+ color: #990000;
611612 }
612613 a.new:visited, #p-personal a.new:visited {
613614 color: #a55858;
@@ -638,7 +639,7 @@
639640 margin: 0;
640641 padding-top: .5em;
641642 padding-bottom: .17em;
642 - border-bottom: 1px solid #aaa;
 643+ border-bottom: 1px solid #8d8d8d;
643644 width: auto;
644645 }
645646 h1 { font-size: 188%; }
@@ -765,8 +766,8 @@
766767 #toc,
767768 .toc,
768769 .mw-warning {
769 - border: 1px solid #aaa;
770 - background-color: #f9f9f9;
 770+ border: 1px solid #c0c0c0;
 771+ background-color: #f0f0f0;
771772 padding: 5px;
772773 font-size: 95%;
773774 }
@@ -826,15 +827,16 @@
827828 background-color: transparent;
828829 }
829830 div.thumbinner {
830 - border: 1px solid #ccc;
 831+ border: 1px solid #c0c0c0;
831832 padding: 3px !important;
832 - background-color: #f9f9f9;
 833+ background-color: #f0f0f0;
833834 font-size: 94%;
834835 text-align: center;
835836 overflow: hidden;
836837 }
837838 html .thumbimage {
838 - border: 1px solid #ccc;
 839+ border: 1px solid #c0c0c0;
 840+ background-color: #f0f0f0;
839841 }
840842 html .thumbcaption {
841843 border: none;
@@ -954,6 +956,7 @@
955957 line-height: 1.2em;
956958 font-size: 1.6em;
957959 padding-bottom: 0;
 960+ color:#005780;
958961 }
959962 #content a.external,
960963 #content a[href ^="gopher://"] {
@@ -1031,7 +1034,6 @@
10321035 padding-left: 15px !important;
10331036 text-transform: none;
10341037 }
1035 -
10361038 .toccolours {
10371039 border: 1px solid #aaa;
10381040 background-color: #f9f9f9;
@@ -1042,10 +1044,48 @@
10431045 position: relative;
10441046 width: 100%;
10451047 }
 1048+
10461049 #mw-js-message {
10471050 font-size: 0.8em;
10481051 }
10491052 div#bodyContent {
10501053 line-height: 1.5em;
10511054 }
1052 -
 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
Index: branches/usability/phase3/skins/vector/main-rtl.css
@@ -1042,6 +1042,7 @@
10431043 position: relative;
10441044 width: 100%;
10451045 }
 1046+
10461047 #mw-js-message {
10471048 font-size: 0.8em;
10481049 }
@@ -1049,4 +1050,71 @@
10501051 line-height: 1.5em;
10511052 }
10521053
1053 -
\ No newline at end of file
 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
Index: branches/usability/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 = '241';
 1610+$wgStyleVersion = '243';
16111611
16121612
16131613 # Server-side caching:
@@ -4096,13 +4096,20 @@
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+/**
41074114 * Preprocessor caching threshold
41084115 */
41094116 $wgPreprocessorCacheThreshold = 1000;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57125Revert r56924 (new watch icon and color changes for Vector) and followups r57...catrope17:58, 30 September 2009

Status & tagging log