Index: trunk/phase3/skins/common/ajaxwatch.js |
— | — | @@ -21,11 +21,26 @@ |
22 | 22 | wgAjaxWatch.inprogress = false; // ajax request in progress |
23 | 23 | wgAjaxWatch.timeoutID = null; // see wgAjaxWatch.ajaxCall |
24 | 24 | wgAjaxWatch.watchLinks = []; // "watch"/"unwatch" links |
| 25 | +wgAjaxWatch.iconMode = false; // new icon driven functionality |
| 26 | +wgAjaxWatch.imgBasePath = ""; // base img path derived from icons on load |
25 | 27 | |
26 | 28 | wgAjaxWatch.setLinkText = function(newText) { |
27 | | - for (i = 0; i < wgAjaxWatch.watchLinks.length; i++) { |
28 | | - changeText(wgAjaxWatch.watchLinks[i], newText); |
29 | | - } |
| 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].firstChild.src = wgAjaxWatch.imgBasePath+"/skins/common/images/spinner.gif"; |
| 34 | + }else if(newText==wgAjaxWatch.watchMsg){ |
| 35 | + wgAjaxWatch.watchLinks[i].firstChild.src = wgAjaxWatch.imgBasePath+"/skins/vector/images/watch_off.gif"; |
| 36 | + }else if(newText==wgAjaxWatch.unwatchMsg){ |
| 37 | + wgAjaxWatch.watchLinks[i].firstChild.src = wgAjaxWatch.imgBasePath+"/skins/vector/images/watch_on.gif"; |
| 38 | + } |
| 39 | + } |
| 40 | + }else{ |
| 41 | + for (i = 0; i < wgAjaxWatch.watchLinks.length; i++) { |
| 42 | + changeText(wgAjaxWatch.watchLinks[i], newText); |
| 43 | + } |
| 44 | + } |
30 | 45 | }; |
31 | 46 | |
32 | 47 | wgAjaxWatch.setLinkID = function(newId) { |
— | — | @@ -112,6 +127,7 @@ |
113 | 128 | wgAjaxWatch.onLoad = function() { |
114 | 129 | // This document structure hardcoding sucks. We should make a class and |
115 | 130 | // toss all this out the window. |
| 131 | + |
116 | 132 | var el1 = document.getElementById("ca-unwatch"); |
117 | 133 | var el2 = null; |
118 | 134 | if (!el1) { |
— | — | @@ -132,7 +148,24 @@ |
133 | 149 | return; |
134 | 150 | } |
135 | 151 | } |
| 152 | + |
| 153 | + // If we're using the icon, add rollover affects |
| 154 | + try{ |
| 155 | + if(el1.firstChild.firstChild.tagName.match(/img/i)){ |
| 156 | + wgAjaxWatch.iconMode = true; |
| 157 | + wgAjaxWatch.imgBasePath = el1.firstChild.firstChild.src.replace(/\/skins\/vector\/images\/watch_(off|on).gif/, ""); |
| 158 | + el1.firstChild.onmouseover = function(e){ |
| 159 | + this.firstChild.src = (wgAjaxWatch.watching ? this.firstChild.src.replace(/_on/, "_off") : this.firstChild.src.replace(/_off/, "_on")); |
| 160 | + } |
| 161 | + el1.firstChild.onmouseout = function(e){ |
| 162 | + this.firstChild.src = (wgAjaxWatch.watching ? this.firstChild.src.replace(/_off/, "_on") : this.firstChild.src.replace(/_on/, "_off")); |
| 163 | + } |
| 164 | + } |
| 165 | + }catch(e){ |
| 166 | + // not using the icon |
| 167 | + } |
136 | 168 | |
| 169 | + |
137 | 170 | // The id can be either for the parent (Monobook-based) or the element |
138 | 171 | // itself (non-Monobook) |
139 | 172 | wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a" |
Index: trunk/phase3/skins/Vector.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | * @private |
61 | 61 | */ |
62 | 62 | function buildNavigationUrls() { |
63 | | - global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle; |
| 63 | + global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath; |
64 | 64 | global $wgDisableLangConversion; |
65 | 65 | |
66 | 66 | wfProfileIn( __METHOD__ ); |
— | — | @@ -285,21 +285,23 @@ |
286 | 286 | if( $this->loggedin ) { |
287 | 287 | // Checks if the user is watching this page |
288 | 288 | if( !$this->mTitle->userIsWatching() ) { |
289 | | - // Adds watch action link |
290 | | - $links['actions']['watch'] = array( |
| 289 | + // Adds watch view link |
| 290 | + $links['views']['watch'] = array( |
291 | 291 | 'class' => |
292 | 292 | ( $action == 'watch' or $action == 'unwatch' ) ? |
293 | 293 | 'selected' : false, |
294 | 294 | 'text' => wfMsg( 'watch' ), |
| 295 | + 'img' => "{$wgStylePath}/vector/images/watch_off.gif", |
295 | 296 | 'href' => $this->mTitle->getLocalUrl( 'action=watch' ) |
296 | 297 | ); |
297 | 298 | } else { |
298 | | - // Adds unwatch action link |
299 | | - $links['actions']['unwatch'] = array( |
| 299 | + // Adds unwatch view link |
| 300 | + $links['views']['unwatch'] = array( |
300 | 301 | 'class' => |
301 | 302 | ($action == 'unwatch' or $action == 'watch') ? |
302 | 303 | 'selected' : false, |
303 | 304 | 'text' => wfMsg( 'unwatch' ), |
| 305 | + 'img' => "{$wgStylePath}/vector/images/watch_on.gif", |
304 | 306 | 'href' => $this->mTitle->getLocalUrl( 'action=unwatch' ) |
305 | 307 | ); |
306 | 308 | } |
— | — | @@ -722,7 +724,7 @@ |
723 | 725 | <h5><?php $this->msg('views') ?></h5> |
724 | 726 | <ul <?php $this->html('userlangattributes') ?>> |
725 | 727 | <?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> |
| 728 | + <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> |
727 | 729 | <?php endforeach; ?> |
728 | 730 | </ul> |
729 | 731 | </div> |
Index: trunk/phase3/skins/vector/images/watch_off.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/skins/vector/images/watch_off.gif |
___________________________________________________________________ |
Name: svn:mime-type |
730 | 732 | + application/octet-stream |
Index: trunk/phase3/skins/vector/images/watch_on.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/skins/vector/images/watch_on.gif |
___________________________________________________________________ |
Name: svn:mime-type |
731 | 733 | + application/octet-stream |
Index: trunk/phase3/skins/vector/main-ltr.css |
— | — | @@ -1042,6 +1042,7 @@ |
1043 | 1043 | position: relative; |
1044 | 1044 | width: 100%; |
1045 | 1045 | } |
| 1046 | + |
1046 | 1047 | #mw-js-message { |
1047 | 1048 | font-size: 0.8em; |
1048 | 1049 | } |
— | — | @@ -1049,3 +1050,52 @@ |
1050 | 1051 | line-height: 1.5em; |
1051 | 1052 | } |
1052 | 1053 | |
| 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 | + |
| 1085 | +/* Watch/Unwatch Icon Styling */ |
| 1086 | +#ca-unwatch, |
| 1087 | +#ca-watch{ |
| 1088 | + background-image:none; |
| 1089 | + background-color:#ffffff; |
| 1090 | +} |
| 1091 | +#ca-unwatch a, |
| 1092 | +#ca-watch a{ |
| 1093 | + outline:none; |
| 1094 | +} |
| 1095 | +#ca-unwatch a img, |
| 1096 | +#ca-watch a img{ |
| 1097 | + padding-top:1.35em; |
| 1098 | + display:block; |
| 1099 | + font-size:0.8em; |
| 1100 | + max-height:14px; |
| 1101 | + max-width:14px; |
| 1102 | +} |
\ No newline at end of file |