r76745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76744‎ | r76745 | r76746 >
Date:00:11, 16 November 2010
Author:dale
Status:deferred
Tags:
Comment:
run resize binding after embedPlayer is ready
small js fix for merge config
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -98,7 +98,7 @@
9999 if ( value.constructor.toString().indexOf("Array") != -1 &&
100100 mwConfig[ name ].constructor.toString().indexOf("Array") != -1 ){
101101 // merge in the array
102 - mwConfig[ name ] = mwConfig[ name ].concat( value );
 102+ mwConfig[ name ] = $j.merge( mwConfig[ name ], value );
103103 } else {
104104 for( var i in value ){
105105 mwConfig[ name ][ i ] = value[ i ];
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
@@ -246,7 +246,7 @@
247247 }
248248
249249 var tagCheckObject = { 'hasTags' : false };
250 - $j( mw ).trigger( 'LoaderEmbedPlayerDocumentHasPlayerTags',
 250+ $j( mw ).trigger( 'LoaderEmbedPlayerCheckForPlayerTags',
251251 [ tagCheckObject ]);
252252
253253 return tagCheckObject.hasTags;
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r174';
 8+var mwRemoteVersion = 'r175';
99 var mwUseScriptLoader = true;
1010
1111 // Log the mwRemote version makes it easy to debug cache issues
@@ -496,6 +496,26 @@
497497 '</video>';
498498 }
499499
 500+ var checkForIframePlayerParam = function(){
 501+ // Add full window binding if embedplayer flag set:
 502+ if( mwReqParam['embedplayer'] == 'yes' ){
 503+ $j('#loadingPlayer').remove();
 504+ $j('body').css('overflow', 'hidden');
 505+ // Add a small timeout chrome runs things out of order sometimes
 506+ $j( '#mwe_' + vidId ).get(0).resizePlayer({
 507+ 'width' : $j(window).width(),
 508+ 'height' : $j(window).height()
 509+ });
 510+ $j(window).unbind().resize(function(){
 511+ $j( '#mwe_' + vidId ).get(0).resizePlayer({
 512+ 'width' : $j(window).width(),
 513+ 'height' : $j(window).height()
 514+ });
 515+ });
 516+ }
 517+ }
 518+
 519+
500520 // If the video is part of a "gallery box" use light-box linker instead
501521 if( $j( '#' + vidId ).parents( '.gallerybox,.filehistory' ).length ){
502522 $j( '#' + vidId ).after(
@@ -561,6 +581,7 @@
562582 embedPlayer.controlBuilder.hideControlBar();
563583 }, 4000 );
564584 }
 585+ checkForIframePlayerParam();
565586 });
566587 })
567588 )
@@ -569,27 +590,8 @@
570591 } else {
571592 // Set the video tag inner html remove extra player
572593 $j( '#' + vidId ).after( html_out ).remove();
573 - $j( '#mwe_' + vidId ).embedPlayer();
574 - }
575 -
576 - // Add full window binding if embedplayer flag set:
577 - if( mwReqParam['embedplayer'] == 'yes' ){
578 - $j('#loadingPlayer').remove();
579 - $j('body').css('overflow', 'hidden');
580 - // Add a small timeout chrome runs things out of order sometimes
581 - setTimeout( function(){
582 - $j( '#mwe_' + vidId ).get(0).resizePlayer({
583 - 'width' : $j(window).width(),
584 - 'height' : $j(window).height()
585 - });
586 - $j(window).unbind().resize(function(){
587 - $j( '#mwe_' + vidId ).get(0).resizePlayer({
588 - 'width' : $j(window).width(),
589 - 'height' : $j(window).height()
590 - });
591 - });
592 - }, 10);
593 - }
 594+ $j( '#mwe_' + vidId ).embedPlayer( checkForIframePlayerParam );
 595+ }
594596
595597 // Issue an async request to rewrite the next clip
596598 if ( vidIdList.length != 0 ) {

Status & tagging log