r79912 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79911‎ | r79912 | r79913 >
Date:19:36, 9 January 2011
Author:dale
Status:deferred
Tags:
Comment:
bumped mwEmbed release number
minor code cleanup
Modified paths:
  • /branches/MwEmbedStandAlone/modules/Sequencer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js
@@ -414,7 +414,7 @@
415415 }
416416 },
417417 /**
418 - * once browsers work better with seeks we can use this code:
 418+ * Do a seek and issue the callback once loaded
419419 */
420420 mediaBufferSeek: function ( smilElement, seekTime, callback ){
421421 var _this = this;
@@ -443,7 +443,9 @@
444444 mw.log("SmilBuffer::mediaBufferSeek: DONE for:" + assetId + ' time:' + media.currentTime );
445445
446446 // TODO Would be great if browsers supported a mode to "stop" loading once we reach a given time
447 -
 447+ // probably have to adapt something like:
 448+ // http://blog.pearce.org.nz/2010/11/how-to-stop-video-or-audio-element.html
 449+
448450 if( callback )
449451 callback();
450452 callback = null;
Index: branches/MwEmbedStandAlone/modules/Sequencer/loader.js
@@ -7,7 +7,13 @@
88
99 // Loader configuration options ( all runtime options are stored in mw.SequencerConfig.js )
1010 mw.setDefaultConfig({
11 - 'Sequencer.KalturaPlayerEditOverlay' : false
 11+
 12+ // Extends the embedPlayer sequencer clips to include attribution 'edit sequence' link on pause
 13+ 'Sequencer.KalturaPlayerEditOverlay' : false,
 14+
 15+ // If the sequencer should use swam transport urls for audio and video.
 16+ // this can be helpful for a large local cache.
 17+ 'Sequencer.UseSwamTransport' : false
1218 });
1319
1420
@@ -127,7 +133,7 @@
128134 classRequest.push('mw.style.SequencerRemote');
129135 }
130136 }
131 - })
 137+ });
132138
133139
134140 } )( window.mw );
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js
@@ -27,7 +27,7 @@
2828 timelineMode: 'clip',
2929
3030 // The smil track to use as the timeline when in clip mode
31 - // ( when in "time" mode we have a uniform pixle to time mapping )
 31+ // ( when in "time" mode we have a uniform pixel to time mapping )
3232 clipModeTrackIndex: 0,
3333
3434 // The base left side offset for the clickable timeline
@@ -167,7 +167,7 @@
168168 var smilClipDur = smil.getBody().getClipDuration( smilElement );
169169 var startOffset = $j( smilElement ).data('startOffset');
170170 if( playTime > startOffset && playTime < (startOffset + smilClipDur) ){
171 - // get the base pixle offset:
 171+ // get the base pixel offset:
172172 pixleOffset = _this.clickableTimelineBaseOffset + ( _this.timelineThumbLayout.totalWidth * clipInx ) ;
173173 // add relative time offset:
174174 pixleOffset += ( ( playTime - startOffset ) / smilClipDur ) * _this.timelineThumbLayout.totalWidth;
@@ -260,7 +260,7 @@
261261 $j('<div />')
262262 .css({
263263 'position' : 'absolute',
264 - 'top' : '10px',
 264+ 'top' : '0px',
265265 'height' : '100%',
266266 'width' : 2,
267267 'background-color' : '#AAF'
@@ -1006,7 +1006,7 @@
10071007 'opacity' : '.9',
10081008 'left': '0px',
10091009 'height': _this.timelineThumbLayout.height
1010 - })
 1010+ } )
10111011 .attr( 'src', smil.getAssetUrl( smilElement.attr('poster') ) )
10121012 .load( function(){
10131013 if( $thumbTarget.children().length == 0 ){
@@ -1017,7 +1017,7 @@
10181018 // Sometimes the load event does not fire. Force the fallback image after 5 seconds
10191019 setTimeout( function(){
10201020 if( $thumbTarget.children().length == 0 ){
1021 - mw.log( "SequencerTimeline::drawClipThumb: force image fallabck:: " + img.src);
 1021+ mw.log( "SequencerTimeline::drawClipThumb: timeout, force image fallabck:: " + img.src);
10221022 $thumbTarget.html( img );
10231023 if( callback ){
10241024 callback();
@@ -1031,7 +1031,7 @@
10321032 smil.getBuffer().bufferedSeekRelativeTime( smilElement, relativeTime, function(){
10331033 // Add the seek, Add to canvas and draw thumb request
10341034 smil.getLayout().drawSmilElementToTarget( smilElement, $thumbTarget, relativeTime, function(){
1035 - //mw.log("SequencerTimeline:: Done drawSmilElementToTarget " + $j( smilElement ).attr('id') + ' cb:' + callback);
 1035+ // mw.log("SequencerTimeline:: Done drawSmilElementToTarget " + $j( smilElement ).attr('id') + ' cb:' + callback);
10361036 // Run the callback and un-set it for the current closure
10371037 if( callback ){
10381038 callback();
@@ -1059,7 +1059,7 @@
10601060
10611061 if( $j( smilSequenceTrack).attr('tracktype') == 'audio' ){
10621062 $trackNameTitle.append(
1063 - $j('<span />').addClass( 'ui-icon ui-icon-volume-on'),
 1063+ $j('<span />').addClass( 'ui-icon ui-icon-volume-on' ),
10641064 $j('<span />').text( gM( 'mwe-sequencer-audio-track' ) )
10651065 );
10661066 } else {
@@ -1069,6 +1069,7 @@
10701070 $j('<span />').text( gM( 'mwe-sequencer-video-track' ) )
10711071 );
10721072 }
 1073+
10731074 // Set track name height
10741075 $trackNameContainer.css({
10751076 'height' : this.getSequenceTrackHeight( smilSequenceTrack )
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
@@ -79,12 +79,12 @@
8080 setTimeout(function(){
8181 $j( embedPlayer ).siblings( '.kalturaEditOverlay' ).fadeOut( 'fast' );
8282 embedPlayer.$interface.find('.k-menu').fadeIn('fast');
83 - }, 3500)
 83+ }, 3500);
8484
8585 // On end runs before interface bindings (give the dom 10ms to build out the menu )
8686 setTimeout(function(){
8787 $j( embedPlayer ).siblings( '.k-menu' ).hide();
88 - },10)
 88+ }, 10);
8989 });
9090 $j( embedPlayer ).bind( 'play', function(){
9191 $j( embedPlayer ).siblings( '.kalturaEditOverlay' ).fadeOut( 'fast' );
@@ -111,7 +111,7 @@
112112 if(! $j( '#' + embedPlayerId ).siblings( '.kalturaEditOverlay' ).length ){
113113
114114 var seqTitle = embedPlayer.apiTitleKey
115 - .replace( 'Sequence-', 'Sequence:')
 115+ .replace( 'Sequence-', 'Sequence:');
116116 // strip the extension
117117 seqTitle = seqTitle.substr(0, seqTitle.length -4 );
118118 // not ideal details page builder but 'should work' ::
@@ -199,7 +199,7 @@
200200
201201 $j( '#' + embedPlayerId ).siblings( '.kalturaEditOverlay' )
202202 .fadeIn('fast');
203 -}
 203+};
204204 mw.MediaWikiRemoteSequencer = function( options ) {
205205 return this.init( options );
206206 };
@@ -240,7 +240,7 @@
241241 .click(function(){
242242 _this.showEditor();
243243 return false;
244 - })
 244+ });
245245
246246 $j( this.target ).html(
247247 gM("mwe-sequencer-no-sequence-create",
@@ -257,7 +257,7 @@
258258 .click(function(){
259259 _this.showEditor();
260260 return false;
261 - })
 261+ });
262262
263263 _this.displayPlayerEmbed();
264264 }
@@ -271,7 +271,7 @@
272272 .click(function(){
273273 _this.showEditor();
274274 return false;
275 - })
 275+ });
276276 },
277277
278278 showEditUI: function(){
@@ -310,7 +310,7 @@
311311 displayPlayerEmbed: function(){
312312 var _this = this;
313313 // load the embedPlayer module:
314 - mw.load('EmbedPlayer', function(){
 314+ mw.load( 'EmbedPlayer', function(){
315315 // Check if the sequence has been flattened and is up to date:
316316 var request = {
317317 'action': 'query',
@@ -334,7 +334,7 @@
335335 )
336336 )
337337 .addClass( 'ui-state-highlight' )
338 - )
 338+ );
339339 } else {
340340 for( var pageId in data.query.pages) {
341341 var page = data.query.pages[ pageId ];
@@ -353,7 +353,7 @@
354354 }).css('cursor', 'pointer')
355355 )
356356 ).addClass( 'ui-state-highlight' )
357 - )
 357+ );
358358 }
359359 }
360360 if( page.imageinfo && page.imageinfo[0] ){
@@ -401,7 +401,7 @@
402402 $j( _this.target ).empty().append(
403403 $j('<div />')
404404 .addClass( 'sequencer-player')
405 - .css( {
 405+ .css({
406406 'float' : 'left',
407407 'width' : width
408408 })
@@ -441,7 +441,7 @@
442442 // Add a clear both to give content body height
443443 $j('<div />').css( { 'clear': 'both' } )
444444
445 - )
 445+ );
446446 // add cat links if set;
447447 if( _this.catLinks ){
448448 $j( _this.target ).append(
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r182';
 8+var mwRemoteVersion = 'r183';
99 var mwUseScriptLoader = true;
1010
1111 // Log the mwRemote version makes it easy to debug cache issues

Status & tagging log