r68237 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68236‎ | r68237 | r68238 >
Date:20:34, 18 June 2010
Author:dale
Status:deferred
Tags:
Comment:
updated the thumbnail reference to update "poster"
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerHtml.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
@@ -110,10 +110,10 @@
111111 /**
112112 * Update the thumbnail html
113113 */
114 - updateThumbnailHTML: function() {
 114+ updatePosterHTML: function() {
115115 // If we have a "poster" use that;
116116 if( this.poster ){
117 - this.parent_updateThumbnailHTML();
 117+ this.parent_updatePosterHTML();
118118 return ;
119119 }
120120 // If no thumb could be found use the first frame of smil:
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
@@ -228,9 +228,7 @@
229229 $j( '.videonojs' ).remove();
230230
231231 // Detect supported players:
232 - mw.EmbedTypes.init();
233 -
234 - //mw.log(" run callback: " + callback );
 232+ mw.EmbedTypes.init();
235233
236234 // Run the callback with name of the module
237235 if( typeof callback == 'function' ) {
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -280,6 +280,11 @@
281281 $j( mw ).trigger( 'EmbedPlayerManagerReady' );
282282 }
283283
 284+ // If we have not detected player yet do that:
 285+ if( ! mw.EmbedTypes.players ){
 286+ mw.EmbedTypes.init();
 287+ }
 288+
284289 // Add the embedPlayer ready callback
285290 if( typeof callback == 'function' ){
286291 mw.playerManager.addCallback( callback );
@@ -1962,7 +1967,7 @@
19631968 this.controlBuilder.closeMenuOverlay();
19641969
19651970 // update the thumbnail html:
1966 - this.updateThumbnailHTML();
 1971+ this.updatePosterHTML();
19671972
19681973 this.paused = true;
19691974 this.thumbnail_disp = true;
@@ -2004,7 +2009,7 @@
20052010 this.$interface = $j( this ).parent( '.interface_wrap' );
20062011
20072012 // Update Thumbnail for the "player"
2008 - this.updateThumbnailHTML();
 2013+ this.updatePosterHTML();
20092014
20102015 // Add controls if enabled:
20112016 if ( this.controls ) {
@@ -2155,7 +2160,7 @@
21562161 }
21572162 );
21582163 if ( !this.thumbnail_updating ) {
2159 - this.updateThumbnail( this.last_thumb_url , false );
 2164+ this.updatePoster( this.last_thumb_url , false );
21602165 this.last_thumb_url = null;
21612166 }
21622167 }
@@ -2177,7 +2182,7 @@
21782183 * true switch happens instantly
21792184 * false / undefined animated cross fade
21802185 */
2181 - updateThumbnail : function( src, quick_switch ) {
 2186+ updatePosterSrc: function( src, quick_switch ) {
21822187 // make sure we don't go to the same url if we are not already updating:
21832188 if ( !this.thumbnail_updating && $j( '#img_thumb_' + this.id ).attr( 'src' ) == src )
21842189 return false;
@@ -2227,7 +2232,7 @@
22282233 if ( _this.last_thumb_url ) {
22292234 var src_url = _this.last_thumb_url;
22302235 _this.last_thumb_url = null;
2231 - _this.updateThumbnail( src_url );
 2236+ _this.updatePosterSrc( src_url );
22322237 }
22332238 } );
22342239 }
@@ -2239,8 +2244,8 @@
22402245 * playing, configuring the player, inline cmml display, HTML linkback,
22412246 * download, and embed code.
22422247 */
2243 - updateThumbnailHTML: function () {
2244 - mw.log( 'embedPlayer:updateThumbnailHTML::' + this.id );
 2248+ updatePosterHTML: function () {
 2249+ mw.log( 'embedPlayer:updatePosterHTML::' + this.id );
22452250 var thumb_html = '';
22462251 var class_atr = '';
22472252 var style_atr = '';
@@ -2255,7 +2260,7 @@
22562261 var posterSrc = ( this.poster ) ? this.poster :
22572262 mw.getConfig( 'imagesPath' ) + 'vid_default_thumb.jpg';
22582263
2259 - // Poster support is not very consistant in browsers
 2264+ // Poster support is not very consistent in browsers
22602265 // use a jpg poster image:
22612266 $j( this ).html(
22622267 $j( '<img />' )
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerHtml.js
@@ -232,7 +232,7 @@
233233 // mw.log('f:getThumbnailHTML: got thumb: '+out);
234234 return out;
235235 },
236 - updateThumbnailHTML: function(){
 236+ updatePosterHTML: function(){
237237 $j( this ).css( 'background', '#fff');
238238 $j( this ).html( this.getThumbnailHTML() );
239239 },
Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -1042,7 +1042,7 @@
10431043 * @param {Boolean} fresh A fresh check is issued.
10441044 */
10451045 // Stub feature apiUserNameCache to avoid multiple calls
1046 - // ( a more general api cache framework should be devloped )
 1046+ // ( a more general api framework should be developed )
10471047 var apiUserNameCache = {};
10481048 mw.getUserName = function( apiUrl, callback, fresh ){
10491049 if( typeof apiUrl == 'function' ){
@@ -1055,7 +1055,8 @@
10561056 if( mw.isLocalDomain( apiUrl ) ){
10571057 if( typeof wgUserName != 'undefined' && wgUserName !== null ) {
10581058 callback( wgUserName )
1059 - return ;
 1059+ // In case someone called this function without a callback
 1060+ return wgUserName;
10601061 }
10611062 }
10621063 if( ! fresh && apiUserNameCache[ apiUrl ] ) {

Status & tagging log