http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60526
Revision: 60526 Author: dale Date: 2009-12-31 18:57:32 +0000 (Thu, 31 Dec 2009) Log Message: ----------- * minor css fix * type check for unset var Modified Paths: -------------- branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.proxy.js branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/htmlEmbed.js branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js branches/js2-work/phase3/js/mwEmbed/mwEmbed.js branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css Modified: branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.proxy.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.proxy.js 2009-12-31 18:41:19 UTC (rev 60525) +++ branches/js2-work/phase3/js/mwEmbed/modules/ApiProxy/mw.proxy.js 2009-12-31 18:57:32 UTC (rev 60526) @@ -296,7 +296,7 @@ // Make sure we are logged in // (its a normal mediaWiki page so all site vars should be defined) - if ( !wgUserName ) { + if ( typeof wgUserName != 'undefined' && !wgUserName ) { mw.log( 'Error Not logged in' ); return false; } @@ -305,6 +305,7 @@ mw.log('Client frame: ' + clientRequest.clientFrame ); var clientDomain = mw.parseUri( clientRequest.clientFrame ).host ; + /** * HERE WE CHECK IF THE DOMAIN IS ALLOWED per the proxyConfig */ @@ -315,6 +316,7 @@ return doApiRequest( clientRequest ); } } + // Check master blacklist for ( var i in proxyConfig.master_blacklist ) { if ( clientDomain == proxyConfig.master_blacklist ) { Modified: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/htmlEmbed.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/htmlEmbed.js 2009-12-31 18:41:19 UTC (rev 60525) +++ branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/htmlEmbed.js 2009-12-31 18:57:32 UTC (rev 60526) @@ -257,10 +257,10 @@ if( this.pc.dur ){ this.duration = this.pc.dur; }else if( pcHtmlEmbedDefaults.dur ){ - this.duration =pcHtmlEmbedDefaults.dur ; + this.duration = pcHtmlEmbedDefaults.dur ; } } - return this.parent_getDuration(); + return this.duration; }, /** Modified: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js 2009-12-31 18:41:19 UTC (rev 60525) +++ branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js 2009-12-31 18:57:32 UTC (rev 60526) @@ -59,17 +59,11 @@ ] ]; + var addTimedTextReqFlag = false; - //If we should include the timedText interface - // ( we include it here to get everything at once) - var timedTextRequestSet = [ - '$j.fn.menu', - 'mw.TimedText' - ]; - // Merge in the timed text libs if( mw.getConfig( 'textInterface' ) == 'always' ) - $j.merge( dependencyRequest[0], timedTextRequestSet ); + addTimedTextReqFlag = true; $j( mw.getConfig( 'rewritePlayerTags' ) ).each( function(){ @@ -82,21 +76,28 @@ dependencyRequest[0].push( mw.valid_skins[n] + 'Config' ); } } - //Also add the text library to request set if any video elment has text sources: - if( $j( playerElement ).find( 'itext' ).length != 0 ){ - $j.merge( dependencyRequest[0], timedTextRequestSet ); - }else{ - $j( playerElement ).find( 'source' ).each(function(na, sourceElement){ - if( $j( sourceElement ).attr('type') == 'text/xml' && - $j( sourceElement ).attr('codec') == 'roe' - ){ - // Has a roe src - $j.merge( dependencyRequest[0], timedTextRequestSet ); - } - }); + //Also add the text library to request set if any video element has text sources: + if(!addTimedTextReqFlag){ + if( $j( playerElement ).find( 'itext' ).length != 0 ){ + addTimedTextReqFlag = true; + }else{ + $j( playerElement ).find( 'source' ).each(function(na, sourceElement){ + if( $j( sourceElement ).attr('type') == 'text/xml' && + $j( sourceElement ).attr('codec') == 'roe' + ){ + // Has a roe src + addTimedTextReqFlag = true; + } + }); + } } } ); - + + // Add timed text items if flag set. + if( addTimedTextReqFlag ){ + dependencyRequest[0].push( [ '$j.fn.menu', 'mw.TimedText' ] ); + } + // Add PNG fix if needed: if ( $j.browser.msie || $j.browser.version < 7 ){ dependencyRequest[0].push( '$j.fn.pngFix' ); Modified: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js 2009-12-31 18:41:19 UTC (rev 60525) +++ branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js 2009-12-31 18:57:32 UTC (rev 60526) @@ -1983,20 +1983,17 @@ //make sure we have interface_wrap if( $j( this ).parent('.interface_wrap').length == 0 ){ // Select "player" - $j( this ) - // Add interface control class: - .css({ - 'position': 'relative' - }) + $j( this ) .wrap( $j('<div>') .addClass('interface_wrap ' + this.ctrlBuilder.playerClass) .css({ 'width': parseInt( this.width ), - 'height': parseInt( this.height ) + 'height': parseInt( this.height ), + 'position': 'relative' }) ) - } + } //Set up local jQuery refrence to "interface_wrap" this.$interface = $j(this).parent('.interface_wrap'); Modified: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/mwEmbed.js 2009-12-31 18:41:19 UTC (rev 60525) +++ branches/js2-work/phase3/js/mwEmbed/mwEmbed.js 2009-12-31 18:57:32 UTC (rev 60526) @@ -1395,7 +1395,7 @@ // If no title is provided get a token for the user page: if ( typeof title != 'string' ) { - if( wgUserName ){ + if( typeof wgUserName != 'undefined' && wgUserName ){ title = 'User:' + wgUserName; }else{ // Try maintalk page: Modified: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css =================================================================== --- branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css 2009-12-31 18:41:19 UTC (rev 60525) +++ branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/styles.css 2009-12-31 18:57:32 UTC (rev 60526) @@ -548,6 +548,6 @@ border: thin solid black; } -.control_wrap{ +.interface_wrap{ position:relative; } \ No newline at end of file _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs