r81410 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81409‎ | r81410 | r81411 >
Date:20:10, 2 February 2011
Author:dale
Status:deferred
Tags:
Comment:
sync with kaltura ad parsing and close ad overlay button fix
Modified paths:
  • /branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/resourceloader/ResourceLoaderFileModule.php (modified) (history)
  • /branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/AdSupport/mw.AdTimeline.js (modified) (history)
  • /branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/AdSupport/mw.VastAdParser.js (modified) (history)
  • /branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/MediaWikiSupport/resources/MediaWikiSupportPlayer.js (modified) (history)
  • /branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/TimedText.loader.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/resourceloader/ResourceLoaderFileModule.php
@@ -214,15 +214,20 @@
215215 self::tryForKey( $this->skinScripts, $context->getSkin(), 'default' )
216216 );
217217 if ( $context->getDebug() ) {
218 - $files = array_merge( $files, $this->debugScripts );
 218+ $files = array_merge( $files, $this->debugScripts );
219219 if ( $this->debugRaw ) {
220 - $script = '';
 220+ // temporary hack to load raw script files in right order
 221+ $script = 'var rawScriptSet = [';
 222+ $coma = '';
221223 foreach ( $files as $file ) {
222224 $path = $wgServer . $this->getRemotePath( $file );
223 - $script .= "\n\t" . Xml::encodeJsCall( 'mediaWiki.loader.load', array( $path ) );
 225+ $script .= $coma . array( $path ) ;
 226+ $coma=',';
224227 }
 228+ $script .='];';
 229+ $script = 'rawScriptSet, function(na, path){ $.getScript} '
225230 return $script;
226 - }
 231+ }
227232 }
228233 return $this->readScriptFiles( $files );
229234 }
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/AdSupport/mw.AdTimeline.js
@@ -432,6 +432,20 @@
433433 .css( layout )
434434 .html( nonLinearConf.html )
435435 .fadeIn('fast')
 436+ .append(
 437+ // Add a absolute positioned close button:
 438+ $('<span />')
 439+ .css({
 440+ 'top' : 0,
 441+ 'right' : 0,
 442+ 'position': 'absolute',
 443+ 'cursor' : 'pointer'
 444+ })
 445+ .addClass("ui-icon ui-icon-closethick")
 446+ .click(function(){
 447+ $(this).parent().fadeOut('fast')
 448+ })
 449+ );
436450
437451
438452 // Bind control bar display hide / show
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/AdSupport/mw.VastAdParser.js
@@ -118,6 +118,21 @@
119119 }
120120 });
121121
 122+ // Check for attribute based static resource:
 123+ if( $( resourceNode ).attr('creativeType') && $( resourceNode ).attr('resourceType') == 'static' ){
 124+ var link = _this.getURLFromNode ( $( resourceNode ).find('NonLinearClickThrough') );
 125+ resourceObj.$html = $j('<a />')
 126+ .attr({
 127+ 'href' : link
 128+ }).append(
 129+ $( '<img/>').attr({
 130+ 'src': _this.getURLFromNode ( resourceNode ),
 131+ 'width' : resourceObj['width'],
 132+ 'height' : resourceObj['height']
 133+ })
 134+ );
 135+ };
 136+
122137 // Check for companion type:
123138 if( $( resourceNode ).find( 'StaticResource' ).length ) {
124139 if( $( resourceNode ).find( 'StaticResource' ).attr('creativeType') ) {
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/MediaWikiSupport/resources/MediaWikiSupportPlayer.js
@@ -147,7 +147,13 @@
148148 /**
149149 * Issues a request to populate the credits box
150150 */
 151+ var $creditsCache = false;
151152 function getCredits( $target, callback ){
 153+ if( ! $creditsCache ){
 154+ $target.html( $creditsCache );
 155+ callback( true );
 156+ return;
 157+ }
152158 // Setup shortcuts:
153159 var apiUrl = mw.getApiProviderURL( apiProvider );
154160 var fileTitle = 'File:' + unescape( apiTitleKey).replace(/File:|Image:/, '');
@@ -165,10 +171,9 @@
166172 var imageProps = data.query.pages[i];
167173 // Check properties for "missing"
168174 if( imageProps.imageinfo && imageProps.imageinfo[0] && imageProps.imageinfo[0].descriptionurl ){
 175+ $creditsCache = doCreditLine( imageProps.imageinfo[0].descriptionurl );
169176 // Found page
170 - $target.html(
171 - doCreditLine( imageProps.imageinfo[0].descriptionurl )
172 - );
 177+ $target.html($creditsCache);
173178 callback( true );
174179 return ;
175180 }
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/TimedText/TimedText.loader.js
@@ -42,19 +42,20 @@
4343 if( mw.getConfig( 'TimedText.ShowInterface' ) == 'always' ) {
4444 return true;
4545 }
46 - // Check for timed text sources or api
47 - if (
48 - (
49 - $( embedPlayer ).attr('apititlekey')
50 - ||
51 - $( embedPlayer ).attr('apiTitleKey' )
52 - )
53 - ||
54 - ( embedPlayer.mediaElement && embedPlayer.mediaElement.textSourceExists() )
55 - ||
56 - $( embedPlayer ).find( 'track' ).length != 0
57 - ) {
 46+ // Do a module check for timed Text support
 47+ var supportsTimedText = false;
 48+ $( embedPlayer ).trigger('SupportsTimedText', function( moduleSupportsTimedText) {
 49+ if( moduleSupportsTimedText ){
 50+ supportsTimedText = true;
 51+ }
 52+ });
 53+
 54+ if( supportsTimedText ){
5855 return true;
 56+ }
 57+ // Check for standard 'track' attribute:
 58+ if ( $( embedPlayer ).find( 'track' ).length != 0 ) {
 59+ return true;
5960 } else {
6061 return false;
6162 }

Status & tagging log