r104522 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104521‎ | r104522 | r104523 >
Date:00:47, 29 November 2011
Author:dale
Status:ok
Tags:
Comment:
consistent use of sourceIndex ( instead of sourceId )
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
@@ -1570,7 +1570,7 @@
15711571 .text( gM( 'mwe-embedplayer-choose_player' ) )
15721572 );
15731573
1574 - $.each( embedPlayer.mediaElement.getPlayableSources(), function( sourceId, source ) {
 1574+ $.each( embedPlayer.mediaElement.getPlayableSources(), function( sourceIndex, source ) {
15751575
15761576 var isPlayable = (typeof mw.EmbedTypes.getMediaPlayers().defaultPlayer( source.getMIMEType() ) == 'object' );
15771577 var isSelected = ( source.getSrc() == embedPlayer.mediaElement.selectedSource.getSrc() );
@@ -1609,15 +1609,15 @@
16101610 $playerLine = $( '<a />')
16111611 .attr({
16121612 'href' : '#',
1613 - 'id' : 'sc_' + sourceId + '_' + supportingPlayers[i].id
 1613+ 'id' : 'sc_' + sourceIndex + '_' + supportingPlayers[i].id
16141614 })
16151615 .addClass( 'ui-corner-all')
16161616 .text( supportingPlayers[i].getName() )
16171617 .click( function() {
16181618 var iparts = $( this ).attr( 'id' ).replace(/sc_/ , '' ).split( '_' );
1619 - var sourceId = iparts[0];
 1619+ var sourceIndex = iparts[0];
16201620 var player_id = iparts[1];
1621 - mw.log( 'source id: ' + sourceId + ' player id: ' + player_id );
 1621+ mw.log( 'source index: ' + sourceIndex + ' player id: ' + player_id );
16221622
16231623 embedPlayer.controlBuilder.closeMenuOverlay();
16241624
@@ -1626,12 +1626,12 @@
16271627 _this.restoreWindowPlayer();
16281628 }
16291629
1630 - embedPlayer.mediaElement.setSourceByIndex( sourceId );
 1630+ embedPlayer.mediaElement.setSourceByIndex( sourceIndex );
16311631 var playableSources = embedPlayer.mediaElement.getPlayableSources();
16321632
16331633 mw.EmbedTypes.getMediaPlayers().setPlayerPreference(
16341634 player_id,
1635 - playableSources[ sourceId ].getMIMEType()
 1635+ playableSources[ sourceIndex ].getMIMEType()
16361636 );
16371637
16381638 // Issue a stop

Status & tagging log