https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114136
Revision: 114136
Author: jdlrobson
Date: 2012-03-19 13:19:55 +0000 (Mon, 19 Mar 2012)
Log Message:
-----------
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?\194?\167 revealing of references 200ms
allowing us to experiment with correct values
Modified Paths:
--------------
trunk/extensions/MobileFrontend/javascripts/references.js
Modified: trunk/extensions/MobileFrontend/javascripts/references.js
===================================================================
--- trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19
13:06:19 UTC (rev 114135)
+++ trunk/extensions/MobileFrontend/javascripts/references.js 2012-03-19
13:19:55 UTC (rev 114136)
@@ -1,7 +1,10 @@
if( typeof jQuery !== 'undefined' ) {
MobileFrontend.references = (function($) {
- var calculatePosition;
+ var calculatePosition, hashtest, options = {};
+ hashtest =
window.location.hash.substr(1).match(/refspeed:([0-9]*)/);
+ options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 )
: 500;
+
function collect() {
var references = {};
$( 'ol.references li' ).each(function(i, el) {
@@ -29,7 +32,7 @@
function init() {
$( '<div id="mf-references"><div></div></div>'
).hide().appendTo( document.body );
var close = function() {
- $( '#mf-references' ).fadeOut( 500 );
+ $( '#mf-references' ).fadeOut(
options.animationSpeed );
};
$( '<button>close</button>' ).click( close ).appendTo(
'#mf-references' );
$( '.mw-cite-backlink a' ).click( close );
@@ -48,7 +51,7 @@
attr( 'href', href
).appendTo('<div />').parent().html();
}
$( '#mf-references div' ).html( html );
- $( '#mf-references' ).fadeIn( 1000 );
+ $( '#mf-references' ).fadeIn(
options.animationSpeed );
} else {
close();
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs