r103566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103565‎ | r103566 | r103567 >
Date:03:22, 18 November 2011
Author:dale
Status:ok
Tags:
Comment:
fixed source switch ( was setting the attribute with the incorrect name )
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.MediaSource.js (modified) (history)
  • /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
@@ -1596,14 +1596,13 @@
15971597 // for each source with "native playback"
15981598 $sourceMenu = $('<ul />');
15991599
1600 - // local function to closure the source variable scope:
 1600+ // Local function to closure the "source" variable scope:
16011601 function addToSourceMenu( source ){
16021602 // Check if source is selected:
1603 - var icon =( source.getSrc() == embedPlayer.mediaElement.selectedSource.getSrc() ) ? 'bullet' : 'radio-on';
 1603+ var icon = ( source.getSrc() == embedPlayer.mediaElement.selectedSource.getSrc() ) ? 'bullet' : 'radio-on';
16041604 $sourceMenu.append(
16051605 $.getLineItem( source.shorttitle, icon, function(){
16061606 mw.log( 'PlayerControlBuilder::SwichSourceMenu: ' + source.getSrc() );
1607 -
16081607 // TODO this logic should be in mw.EmbedPlayer
16091608 embedPlayer.mediaElement.setSource( source );
16101609 if( ! _this.embedPlayer.isStopped() ){
@@ -1632,7 +1631,6 @@
16331632 }
16341633 }
16351634 });
1636 -
16371635 return $sourceMenu;
16381636 },
16391637
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.MediaSource.js
@@ -115,14 +115,14 @@
116116 var sourceAttr = mw.getConfig( 'EmbedPlayer.SourceAttributes' );
117117 $.each(sourceAttr, function(inx, attr){
118118 if ( $j( element ).attr( attr ) ) {
 119+ var attrName = attr;
119120 // strip data- from the attribute name
120121 if( attr.indexOf('data-') === 0){
121 - attr = attr.substr(5);
 122+ attrName = attr.substr(5);
122123 }
123 - _this[ attr ] = $j( element ).attr( attr );
 124+ _this[ attrName ] = $( element ).attr( attr );
124125 }
125126 });
126 -
127127 // Normalize "label" to "title" ( label is the actual spec so use that over title )
128128 if( this.label ){
129129 this.title = this.label;

Status & tagging log