Index: trunk/phase3/skins/common/ajaxwatch.js |
— | — | @@ -28,15 +28,10 @@ |
29 | 29 | if( wgAjaxWatch.iconMode ) { |
30 | 30 | for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) { |
31 | 31 | wgAjaxWatch.watchLinks[i].firstChild.alt = newText; |
32 | | - if( newText == wgAjaxWatch.watchingMsg || newText == wgAjaxWatch.unwatchingMsg ) { |
33 | | - wgAjaxWatch.watchLinks[i].firstChild.src = wgAjaxWatch.imgBasePath |
34 | | - + "/common/images/spinner.gif"; |
35 | | - } else if( newText==wgAjaxWatch.watchMsg ) { |
36 | | - wgAjaxWatch.watchLinks[i].firstChild.src = wgAjaxWatch.imgBasePath |
37 | | - + "/vector/images/watch_off.gif"; |
38 | | - } else if( newText==wgAjaxWatch.unwatchMsg ) { |
39 | | - wgAjaxWatch.watchLinks[i].firstChild.src = wgAjaxWatch.imgBasePath |
40 | | - + "/vector/images/watch_on.gif"; |
| 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, '' ); |
41 | 36 | } |
42 | 37 | } |
43 | 38 | } else { |
— | — | @@ -152,29 +147,11 @@ |
153 | 148 | } |
154 | 149 | } |
155 | 150 | |
156 | | - // If we're using the icon, add rollover affects |
157 | | - try { |
158 | | - if( el1.firstChild.firstChild.tagName.match( /img/i ) ) { |
159 | | - wgAjaxWatch.iconMode = true; |
160 | | - wgAjaxWatch.imgBasePath = el1.firstChild.firstChild.src |
161 | | - .replace( /\/vector\/images\/watch_(off|on).gif/, "" ); |
162 | | - el1.firstChild.onmouseover = function( e ) { |
163 | | - if ( !wgAjaxWatch.inprogress ) |
164 | | - this.firstChild.src = wgAjaxWatch.imgBasePath |
165 | | - + "/vector/images/watch_over.gif"; |
166 | | - } |
167 | | - el1.firstChild.onmouseout = function( e ) { |
168 | | - if ( !wgAjaxWatch.inprogress ) |
169 | | - this.firstChild.src = wgAjaxWatch.imgBasePath |
170 | | - + "/vector/images/watch_" + ( wgAjaxWatch.watching ? |
171 | | - "on.gif" : "off.gif" ); |
172 | | - } |
173 | | - } |
174 | | - } catch( e ) { |
175 | | - // not using the icon |
| 151 | + // Detect if the watch/unwatch feature is in icon mode |
| 152 | + if ( el1.className.match( /icon/i ) ) { |
| 153 | + wgAjaxWatch.iconMode = true; |
176 | 154 | } |
177 | | - |
178 | | - |
| 155 | + |
179 | 156 | // The id can be either for the parent (Monobook-based) or the element |
180 | 157 | // itself (non-Monobook) |
181 | 158 | wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a" |
Index: trunk/phase3/skins/Vector.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | */ |
62 | 62 | function buildNavigationUrls() { |
63 | 63 | global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath; |
64 | | - global $wgDisableLangConversion; |
| 64 | + global $wgDisableLangConversion, $wgVectorUseIconWatch; |
65 | 65 | |
66 | 66 | wfProfileIn( __METHOD__ ); |
67 | 67 | |
— | — | @@ -271,7 +271,6 @@ |
272 | 272 | } |
273 | 273 | } |
274 | 274 | wfProfileOut( __METHOD__ . '-live' ); |
275 | | - |
276 | 275 | /** |
277 | 276 | * The following actions use messages which, if made particular to |
278 | 277 | * the Vector skin, would break the Ajax code which makes this |
— | — | @@ -282,31 +281,21 @@ |
283 | 282 | * the global versions. |
284 | 283 | */ |
285 | 284 | // 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 view link |
290 | | - $links['views']['watch'] = array( |
291 | | - 'class' => |
292 | | - ( $action == 'watch' or $action == 'unwatch' ) ? |
293 | | - 'selected' : false, |
294 | | - 'text' => wfMsg( 'watch' ), |
295 | | - 'img' => "{$wgStylePath}/vector/images/watch_off.gif", |
296 | | - 'href' => $this->mTitle->getLocalUrl( 'action=watch' ) |
297 | | - ); |
| 285 | + if ( $this->loggedin ) { |
| 286 | + if ( $wgVectorUseIconWatch ) { |
| 287 | + $class = 'icon '; |
| 288 | + $place = 'views'; |
298 | 289 | } else { |
299 | | - // Adds unwatch view link |
300 | | - $links['views']['unwatch'] = array( |
301 | | - 'class' => |
302 | | - ($action == 'unwatch' or $action == 'watch') ? |
303 | | - 'selected' : false, |
304 | | - 'text' => wfMsg( 'unwatch' ), |
305 | | - 'img' => "{$wgStylePath}/vector/images/watch_on.gif", |
306 | | - 'href' => $this->mTitle->getLocalUrl( 'action=unwatch' ) |
307 | | - ); |
| 290 | + $class = ''; |
| 291 | + $place = 'actions'; |
308 | 292 | } |
| 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 | + ); |
309 | 299 | } |
310 | | - |
311 | 300 | // This is instead of SkinTemplateTabs - which uses a flat array |
312 | 301 | wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) ); |
313 | 302 | |
Index: trunk/phase3/skins/vector/images/watch_off.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: trunk/phase3/skins/vector/images/watch_over.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = 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 |
Index: trunk/phase3/skins/vector/images/watch-icons.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/skins/vector/images/watch-icons.png |
___________________________________________________________________ |
Name: svn:mime-type |
314 | 303 | + 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 |
Property changes on: trunk/phase3/skins/vector/images/watch-icon-loading.gif |
___________________________________________________________________ |
Name: svn:mime-type |
315 | 304 | + application/octet-stream |
Index: trunk/phase3/skins/vector/main-ltr.css |
— | — | @@ -1080,22 +1080,41 @@ |
1081 | 1081 | border-color: #8d8d8d; |
1082 | 1082 | } |
1083 | 1083 | |
1084 | | - |
1085 | 1084 | /* Watch/Unwatch Icon Styling */ |
1086 | | -#ca-unwatch, |
1087 | | -#ca-watch { |
1088 | | - background-image: none; |
1089 | | - background-color: #ffffff; |
| 1085 | +#ca-unwatch.icon, |
| 1086 | +#ca-watch.icon { |
1090 | 1087 | } |
1091 | | -#ca-unwatch a, |
1092 | | -#ca-watch a { |
| 1088 | +#ca-unwatch.icon a, |
| 1089 | +#ca-watch.icon a { |
| 1090 | + margin: 0; |
| 1091 | + padding: 0; |
1093 | 1092 | outline: none; |
| 1093 | + display: block; |
| 1094 | + width: 26px; |
| 1095 | + height: 2.5em; |
1094 | 1096 | } |
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; |
| 1097 | +#ca-unwatch.icon a { |
| 1098 | + background-image: url(images/watch-icons.png); |
| 1099 | + background-position: 5px 60%; |
| 1100 | +} |
| 1101 | +#ca-watch.icon a { |
| 1102 | + background-image: url(images/watch-icons.png); |
| 1103 | + background-position: -43px 60%; |
| 1104 | +} |
| 1105 | +#ca-unwatch.icon a:hover { |
| 1106 | + background-image: url(images/watch-icons.png); |
| 1107 | + background-position: -19px 60%; |
| 1108 | +} |
| 1109 | +#ca-watch.icon a:hover { |
| 1110 | + background-image: url(images/watch-icons.png); |
| 1111 | + background-position: -67px 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; |
1102 | 1121 | } |
\ No newline at end of file |
Index: trunk/phase3/skins/vector/main-rtl.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 | } |
— | — | @@ -1050,6 +1051,7 @@ |
1051 | 1052 | } |
1052 | 1053 | |
1053 | 1054 | |
| 1055 | + |
1054 | 1056 | /* Babaco color scheme */ |
1055 | 1057 | /* Still working on this. Needs incorporated above once it's closer to final */ |
1056 | 1058 | body { |
— | — | @@ -1078,22 +1080,41 @@ |
1079 | 1081 | border-color: #8d8d8d; |
1080 | 1082 | } |
1081 | 1083 | |
1082 | | - |
1083 | 1084 | /* Watch/Unwatch Icon Styling */ |
1084 | | -#ca-unwatch, |
1085 | | -#ca-watch { |
1086 | | - background-image: none; |
1087 | | - background-color: #ffffff; |
| 1085 | +#ca-unwatch.icon, |
| 1086 | +#ca-watch.icon { |
1088 | 1087 | } |
1089 | | -#ca-unwatch a, |
1090 | | -#ca-watch a { |
| 1088 | +#ca-unwatch.icon a, |
| 1089 | +#ca-watch.icon a { |
| 1090 | + margin: 0; |
| 1091 | + padding: 0; |
1091 | 1092 | outline: none; |
| 1093 | + display: block; |
| 1094 | + width: 26px; |
| 1095 | + height: 2.5em; |
1092 | 1096 | } |
1093 | | -#ca-unwatch a img, |
1094 | | -#ca-watch a img { |
1095 | | - padding-top: 1.35em; |
1096 | | - display: block; |
1097 | | - font-size: 0.8em; |
1098 | | - max-height: 14px; |
1099 | | - max-width: 14px; |
| 1097 | +#ca-unwatch.icon a { |
| 1098 | + background-image: url(images/watch-icons.png); |
| 1099 | + background-position: 5px 60%; |
| 1100 | +} |
| 1101 | +#ca-watch.icon a { |
| 1102 | + background-image: url(images/watch-icons.png); |
| 1103 | + background-position: -43px 60%; |
| 1104 | +} |
| 1105 | +#ca-unwatch.icon a:hover { |
| 1106 | + background-image: url(images/watch-icons.png); |
| 1107 | + background-position: -19px 60%; |
| 1108 | +} |
| 1109 | +#ca-watch.icon a:hover { |
| 1110 | + background-image: url(images/watch-icons.png); |
| 1111 | + background-position: -67px 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; |
1100 | 1121 | } |
\ No newline at end of file |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -4096,13 +4096,20 @@ |
4097 | 4097 | $wgUseTwoButtonsSearchForm = true; |
4098 | 4098 | |
4099 | 4099 | /** |
4100 | | - * Search form behavior for Vector skin only |
| 4100 | + * Search form behavior for Vector skin only |
4101 | 4101 | * true = use an icon search button |
4102 | 4102 | * false = use Go & Search buttons |
4103 | 4103 | */ |
4104 | 4104 | $wgVectorUseSimpleSearch = false; |
4105 | 4105 | |
4106 | 4106 | /** |
| 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 | +/** |
4107 | 4114 | * Preprocessor caching threshold |
4108 | 4115 | */ |
4109 | 4116 | $wgPreprocessorCacheThreshold = 1000; |