r114136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114135‎ | r114136 | r114137 >
Date:13:19, 19 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
allow experimentation with animation speed

as requested by tfinc we can now pass speed values via the hash
e.g. #refspeed:200
makes the speed of the§ revealing of references 200ms
allowing us to experiment with correct values
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/references.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/references.js
@@ -1,7 +1,10 @@
22 if( typeof jQuery !== 'undefined' ) {
33 MobileFrontend.references = (function($) {
4 - var calculatePosition;
 4+ var calculatePosition, hashtest, options = {};
55
 6+ hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/);
 7+ options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500;
 8+
69 function collect() {
710 var references = {};
811 $( 'ol.references li' ).each(function(i, el) {
@@ -29,7 +32,7 @@
3033 function init() {
3134 $( '<div id="mf-references"><div></div></div>' ).hide().appendTo( document.body );
3235 var close = function() {
33 - $( '#mf-references' ).fadeOut( 500 );
 36+ $( '#mf-references' ).fadeOut( options.animationSpeed );
3437 };
3538 $( '<button>close</button>' ).click( close ).appendTo( '#mf-references' );
3639 $( '.mw-cite-backlink a' ).click( close );
@@ -48,7 +51,7 @@
4952 attr( 'href', href ).appendTo('<div />').parent().html();
5053 }
5154 $( '#mf-references div' ).html( html );
52 - $( '#mf-references' ).fadeIn( 1000 );
 55+ $( '#mf-references' ).fadeIn( options.animationSpeed );
5356 } else {
5457 close();
5558 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r114206MFT r114134, r114136, r114144, r114145, r114150, r114152, r114157awjrichards22:26, 19 March 2012

Status & tagging log