Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/library/WURFL/Handlers/Utils.php |
— | — | @@ -174,12 +174,12 @@ |
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
178 | | - * The nth($ordinal) occurance of $needle in $haystack or -1 if no match is found |
| 178 | + * The nth($ordinal) occurrence of $needle in $haystack or -1 if no match is found |
179 | 179 | * @param string $haystack |
180 | 180 | * @param string $needle |
181 | 181 | * @param int $ordinal |
182 | 182 | * @throws InvalidArgumentException |
183 | | - * @return int Char index of occurance |
| 183 | + * @return int Char index of occurrence |
184 | 184 | */ |
185 | 185 | public static function ordinalIndexOf($haystack, $needle, $ordinal) { |
186 | 186 | if (is_null ( $haystack ) || empty ( $haystack )) { |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
210 | | - * First occurance of a / character |
| 210 | + * First occurrence of a / character |
211 | 211 | * @param string $string Haystack |
212 | 212 | * @return int Char index |
213 | 213 | */ |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
220 | | - * Second occurance of a / character |
| 220 | + * Second occurrence of a / character |
221 | 221 | * @param string $string Haystack |
222 | 222 | * @return int Char index |
223 | 223 | */ |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | | - * First occurance of a space character |
| 232 | + * First occurrence of a space character |
233 | 233 | * @param string $string Haystack |
234 | 234 | * @return int Char index |
235 | 235 | */ |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
242 | | - * First occurance of a ; character or length |
| 242 | + * First occurrence of a ; character or length |
243 | 243 | * @param string $string Haystack |
244 | 244 | * @return int Char index |
245 | 245 | */ |
— | — | @@ -247,7 +247,7 @@ |
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
251 | | - * First occurance of $toMatch string or length |
| 251 | + * First occurrence of $toMatch string or length |
252 | 252 | * @param string $string Haystack |
253 | 253 | * @param string $toMatch Needle |
254 | 254 | * @return int Char index |
— | — | @@ -339,4 +339,4 @@ |
340 | 340 | public static function removeLocale($userAgent) { |
341 | 341 | return preg_replace ( self::LANGUAGE_PATTERN, "", $userAgent, 1 ); |
342 | 342 | } |
343 | | -} |
\ No newline at end of file |
| 343 | +} |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js |
— | — | @@ -1,7 +1,12 @@ |
2 | 2 | if( typeof jQuery !== 'undefined' ) { |
3 | 3 | MobileFrontend.references = (function($) { |
4 | | - var calculatePosition; |
| 4 | + var calculatePosition, hashtest, options = {}; |
5 | 5 | |
| 6 | + hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/); |
| 7 | + options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500; |
| 8 | + hashtest = window.location.hash.substr(1).match(/refanimation:([a-z]*)/); |
| 9 | + options.animation = hashtest ? hashtest[1] : null; |
| 10 | + |
6 | 11 | function collect() { |
7 | 12 | var references = {}; |
8 | 13 | $( 'ol.references li' ).each(function(i, el) { |
— | — | @@ -28,27 +33,51 @@ |
29 | 34 | |
30 | 35 | function init() { |
31 | 36 | $( '<div id="mf-references"><div></div></div>' ).hide().appendTo( document.body ); |
32 | | - var close = function( ev ) { |
33 | | - $( '#mf-references' ).fadeOut( 500 ); |
34 | | - }; |
| 37 | + var close = function() { |
| 38 | + var top; |
| 39 | + lastLink = null; |
| 40 | + if( options.animation === 'none' ) { |
| 41 | + $( '#mf-references' ).hide(); |
| 42 | + } else if( options.animation === 'slide' ){ |
| 43 | + top = window.innerHeight + window.pageYOffset; |
| 44 | + $( '#mf-references' ).show().animate( { top: top }, options.animationSpeed ); |
| 45 | + } else { |
| 46 | + $( '#mf-references' ).fadeOut( options.animationSpeed ); |
| 47 | + } |
| 48 | + }, lastLink; |
35 | 49 | $( '<button>close</button>' ).click( close ).appendTo( '#mf-references' ); |
36 | 50 | $( '.mw-cite-backlink a' ).click( close ); |
37 | 51 | |
38 | 52 | var data, html, href, references = collect(); |
39 | 53 | $( 'sup a' ).click( function(ev) { |
| 54 | + var top, oh; |
40 | 55 | href = $(this).attr( 'href' ); |
41 | 56 | data = href && href.charAt(0) === '#' ? |
42 | 57 | references[ href.substr( 1, href.length ) ] : null; |
43 | 58 | |
44 | | - if( data ) { |
45 | | - html = '<h3>[' + data.label + ']</h3>' + data.html; |
| 59 | + if( !$("#mf-references").is(":visible") || lastLink !== href) { |
| 60 | + lastLink = href; |
| 61 | + if( data ) { |
| 62 | + html = '<h3>[' + data.label + ']</h3>' + data.html; |
| 63 | + } else { |
| 64 | + html = $( '<a />' ).text( $(this).text() ). |
| 65 | + attr( 'href', href ).appendTo('<div />').parent().html(); |
| 66 | + } |
| 67 | + $( '#mf-references div' ).html( html ); |
| 68 | + calculatePosition(); |
| 69 | + if( options.animation === 'none' ) { |
| 70 | + $( '#mf-references' ).show(); |
| 71 | + } else if( options.animation === 'slide' ){ |
| 72 | + top = window.innerHeight + window.pageYOffset; |
| 73 | + oh = $( '#mf-references' ).outerHeight(); |
| 74 | + $( '#mf-references' ).show().css( { 'top': top } ). |
| 75 | + animate( { top: top - oh }, options.animationSpeed ); |
| 76 | + } else { |
| 77 | + $( '#mf-references' ).fadeIn( options.animationSpeed ); |
| 78 | + } |
46 | 79 | } else { |
47 | | - html = $( '<a />' ).text( $(this).text() ). |
48 | | - attr( 'href', href ).appendTo('<div />').parent().html(); |
| 80 | + close(); |
49 | 81 | } |
50 | | - $( '#mf-references div' ).html( html ); |
51 | | - $( '#mf-references' ).fadeIn( 1000 ); |
52 | | - calculatePosition(); |
53 | 82 | ev.preventDefault(); |
54 | 83 | }); |
55 | 84 | } |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css |
— | — | @@ -854,7 +854,7 @@ |
855 | 855 | left: 0; |
856 | 856 | right: 0; |
857 | 857 | background-color: #E4E4E4; |
858 | | - padding: 22px 34px; |
| 858 | + padding: 22px; |
859 | 859 | -webkit-box-shadow: 0px -20px 10px -16px #aaa; |
860 | 860 | -moz-box-shadow: 0px -20px 10px -16px #aaa; |
861 | 861 | -o-box-shadow: 0px -20px 10px -16px #aaa; |
— | — | @@ -866,8 +866,8 @@ |
867 | 867 | |
868 | 868 | #mf-references button { |
869 | 869 | top: 22px; |
870 | | - right: 16px; /* padding of mf-references - width 18 */ |
871 | | - width: 18px; |
| 870 | + right: 22px; /* padding of #content_wrapper */ |
| 871 | + width: 16px; |
872 | 872 | height: 12px; |
873 | 873 | background: url(images/close-button-beta.png) no-repeat scroll 0 0 transparent; |
874 | 874 | margin: 0; |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | $languageSelection = $this->data['buildLanguageSelection'] . '<br/>'; |
29 | 29 | $languageSelectionText = '<b>' . $this->data['messages']['mobile-frontend-language'] . ':</b><br/>'; |
30 | | - $languageSelectionDiv = '<div id="languageselection">' . $languageSelectionText . $languageSelection . '</div>'; |
| 30 | + $languageSelectionDiv = $languageSelectionText . $languageSelection; |
31 | 31 | |
32 | 32 | $searchWebkitHtml = <<<HTML |
33 | 33 | <div id='header'> |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend |
___________________________________________________________________ |
Modified: svn:mergeinfo |
34 | 34 | Merged /trunk/extensions/MobileFrontend:r114134,114136,114144-114145,114150,114152,114157 |