Index: trunk/extensions/MobileFrontend/javascripts/references.js |
— | — | @@ -1,7 +1,10 @@ |
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 | + |
6 | 9 | function collect() { |
7 | 10 | var references = {}; |
8 | 11 | $( 'ol.references li' ).each(function(i, el) { |
— | — | @@ -29,7 +32,7 @@ |
30 | 33 | function init() { |
31 | 34 | $( '<div id="mf-references"><div></div></div>' ).hide().appendTo( document.body ); |
32 | 35 | var close = function() { |
33 | | - $( '#mf-references' ).fadeOut( 500 ); |
| 36 | + $( '#mf-references' ).fadeOut( options.animationSpeed ); |
34 | 37 | }; |
35 | 38 | $( '<button>close</button>' ).click( close ).appendTo( '#mf-references' ); |
36 | 39 | $( '.mw-cite-backlink a' ).click( close ); |
— | — | @@ -48,7 +51,7 @@ |
49 | 52 | attr( 'href', href ).appendTo('<div />').parent().html(); |
50 | 53 | } |
51 | 54 | $( '#mf-references div' ).html( html ); |
52 | | - $( '#mf-references' ).fadeIn( 1000 ); |
| 55 | + $( '#mf-references' ).fadeIn( options.animationSpeed ); |
53 | 56 | } else { |
54 | 57 | close(); |
55 | 58 | } |