r74335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74334‎ | r74335 | r74336 >
Date:00:11, 6 October 2010
Author:dale
Status:deferred
Tags:
Comment:
moved configuration option
minor code cleanup
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -2,7 +2,7 @@
33
44 mw.SmilLayout = function( $layout ){
55 return this.init( $layout );
6 -}
 6+};
77
88 mw.SmilLayout.prototype = {
99 // Stores the number of assets we are currently loading
@@ -126,7 +126,7 @@
127127 // should be merged with addTHumb!
128128 drawPlayerSmilElement: function( smilElement, $regionTarget ) {
129129 var _this = this;
130 - mw.log('SmilLayout:: drawPlayerSmilElement: ' )
 130+ mw.log('SmilLayout:: drawPlayerSmilElement: ' );
131131 var smilType = this.smil.getRefType( smilElement );
132132 switch( smilType ){
133133 // Static content can use drawSmilElementToTarget function:
@@ -521,6 +521,7 @@
522522 })
523523 });
524524 });
 525+
525526 // Switch any named font-size attribute to em
526527 $htmlLayout.find('[style]').each( function(inx, node){
527528 if( $j(node).css('font-size') ){
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.FirefoggGUI.js
@@ -96,7 +96,7 @@
9797
9898 mw.FirefoggGUI = function( iObj ) {
9999 return this.init( iObj );
100 -}
 100+};
101101 var default_mvAdvFirefogg_config = {
102102 // Config groups to include
103103 'config_groups': [ 'preset', 'range', 'quality', 'meta', 'advVideo', 'advAudio' ],
@@ -109,7 +109,7 @@
110110
111111 // The control container
112112 'target_control_container': false
113 -}
 113+};
114114
115115 mw.FirefoggGUI.prototype = {
116116 // The configuration group names
@@ -413,7 +413,7 @@
414414 case 'target_btn_save_local_file':
415415 var icon;
416416 if ( target == 'target_btn_save_local_file' ) {
417 - icon = 'ui-icon-video'
 417+ icon = 'ui-icon-video';
418418 } else {
419419 icon = 'ui-icon-folder-open';
420420 }
@@ -545,32 +545,6 @@
546546 return out;
547547 },
548548
549 - /**
550 - * Show a dialog box asking the user to select a source URL.
551 - * FIXME: half-written, doesn't work at all.
552 - */
553 - /*
554 - selectSourceUrl: function() {
555 - // FIXME: i18n
556 - var url = prompt( "Please enter the source media url you would like " +
557 - "to transcode from.", "http://" );
558 - if ( !url ) {
559 - return;
560 - }
561 -
562 - // update the mode:
563 - this.sourceMode = 'url';
564 - this.sourceUrl = url;
565 - this.clearSourceInfoCache();
566 - this.updateSourceFileUI();
567 - // update the input target
568 - $j( this.target_input_file_name )
569 - .unbind()
570 - .val( url )
571 - .removeAttr( 'readonly' );
572 - },
573 - */
574 -
575549 bindControls: function() {
576550 var _this = this;
577551 _this.basefogg_bindControls();
@@ -633,7 +607,7 @@
634608 function() {
635609 var configKey = _this.getClassId( this, 'help_' );
636610 if( !helpState[configKey] )
637 - $j( _this.selector + ' .helpRow_' + configKey ).hide( 'slow' )
 611+ $j( _this.selector + ' .helpRow_' + configKey ).hide( 'slow' );
638612 }
639613 );
640614
@@ -672,7 +646,7 @@
673647 $j( this ).val() )
674648 );
675649 _this.updatePresetSelection( 'custom' );
676 - })
 650+ });
677651 break;
678652 case 'date':
679653 $j( this.selector + ' ._' + configKey ).datepicker({
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
@@ -6,13 +6,14 @@
77 * Default player module configuration
88 */
99 ( function( mw ) {
10 - window['MW_EMBED_LIBRARY_PAGE'] = 'http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library';
1110
1211 mw.setDefaultConfig( {
1312 // If the player controls should be overlaid on top of the video ( if supported by playback method)
1413 // can be set to false per embed player via overlayControls attribute
1514 'EmbedPlayer.OverlayControls' : true,
1615
 16+ 'EmbedPlayer.LibraryPage': 'http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library',
 17+
1718 // A default apiProvider ( ie where to lookup subtitles, video properties etc )
1819 // NOTE: Each player instance can also specify a specific provider
1920 "EmbedPlayer.ApiProvider" : "local",
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
@@ -108,17 +108,17 @@
109109 // Setup the controlBar container
110110 var $controlBar = $j('<div />')
111111 .addClass( 'ui-state-default ui-widget-header ui-helper-clearfix control-bar' )
112 - .css( 'height', this.height )
 112+ .css( 'height', this.height );
113113
114114 $controlBar.css( {
115115 'position': 'absolute',
116116 'bottom' : '0px',
117117 'left' : '0px',
118118 'right' : '0px'
119 - } )
 119+ } );
120120 // Check for overlay controls:
121121 if( _this.checkOverlayControls() ) {
122 - $controlBar.hide()
 122+ $controlBar.hide();
123123 // Make sure the interface is correct height:
124124 embedPlayer.$interface.css( {
125125 'height' : parseInt( embedPlayer.height )
@@ -218,7 +218,7 @@
219219
220220 // Set target width
221221 var targetWidth = fullWidth;
222 - var targetHeight = targetWidth * ( embedPlayer.getHeight() / embedPlayer.getWidth() )
 222+ var targetHeight = targetWidth * ( embedPlayer.getHeight() / embedPlayer.getWidth() );
223223 // Check if it exceeds the height constraint:
224224 if( targetHeight > fullHeight ){
225225 targetHeight = fullHeight;
@@ -233,7 +233,7 @@
234234 'width' : targetWidth,
235235 'top' : offsetTop,
236236 'left': offsetLeft
237 - }
 237+ };
238238 },
239239
240240 /**
@@ -244,7 +244,7 @@
245245 return {
246246 'left' : ( ( pos.width - this.getComponentWidth( 'playButtonLarge' ) ) / 2 ),
247247 'top' : ( ( pos.height - this.getComponentHeight( 'playButtonLarge' ) ) / 2 )
248 - }
 248+ };
249249 },
250250
251251 /**
@@ -258,7 +258,7 @@
259259 //mw.log(' win size is: ' + $j( window ).width() + ' ts: ' + textSize );
260260 return {
261261 'font-size' : textSize + '%'
262 - }
 262+ };
263263 },
264264
265265 /**
@@ -379,7 +379,7 @@
380380
381381
382382 // Reposition play-btn-large ( this is unfortunately not easy to position with 'margin': 'auto'
383 - $interface.find('.play-btn-large').animate( _this.getFullscreenPlayButtonCss() )
 383+ $interface.find('.play-btn-large').animate( _this.getFullscreenPlayButtonCss() );
384384
385385 // Bind mouse move in interface to hide control bar
386386 _this.mouseMovedFlag = false;
@@ -414,7 +414,7 @@
415415 'left' : '0px',
416416 'width' : $j( window ).width(),
417417 'height' : $j( window ).height()
418 - } )
 418+ } );
419419 // Update player size
420420 $j( embedPlayer ).css( _this.getFullscreenPlayerCss() );
421421
@@ -494,7 +494,7 @@
495495 'left' : '0px',
496496 'width' : embedPlayer.getWidth(),
497497 'height' : embedPlayer.getHeight()
498 - })
 498+ });
499499 // Restore the play button
500500 $interface.find('.play-btn-large').animate( {
501501 'left' : ( ( embedPlayer.getPlayerWidth() - this.getComponentWidth( 'playButtonLarge' ) ) / 2 ),
@@ -746,7 +746,7 @@
747747 'padding' : '4px'
748748 })
749749 .html( warningMsg )
750 - )
 750+ );
751751
752752 $targetWarning = $j( '#warningOverlay_' + embedPlayer.id );
753753
@@ -779,7 +779,7 @@
780780 $targetWarning.append(
781781 $j('<span />')
782782 .text( gM( 'mwe-embedplayer-do_not_warn_again' ) )
783 - )
 783+ );
784784 }
785785 // Check the global config before showing the warning
786786 if ( mw.getConfig( preferenceId ) === true ){
@@ -850,7 +850,7 @@
851851 mw.log('change::update volume:' + percent);
852852 embedPlayer.setVolume( percent );
853853 }
854 - }
 854+ };
855855
856856 if ( this.volume_layout == 'vertical' ) {
857857 sliderConf[ 'orientation' ] = "vertical";
@@ -920,7 +920,7 @@
921921 ctrlObj.getPlayerSelect()
922922 );
923923 }
924 - )
 924+ );
925925 },
926926
927927 // Download the file menu
@@ -936,7 +936,7 @@
937937 );
938938 $j( ctrlObj.embedPlayer ).trigger( 'showDownloadEvent' );
939939 }
940 - )
 940+ );
941941 },
942942
943943 // Share the video menu
@@ -950,7 +950,7 @@
951951 );
952952 $j( ctrlObj.embedPlayer ).trigger( 'showShareEvent' );
953953 }
954 - )
 954+ );
955955 },
956956
957957 'aboutPlayerLibrary' : function( ctrlObj ){
@@ -963,7 +963,7 @@
964964 );
965965 $j( ctrlObj.embedPlayer ).trigger( 'aboutPlayerLibrary' );
966966 }
967 - )
 967+ );
968968 }
969969 },
970970
@@ -1064,7 +1064,7 @@
10651065 $j('<div />')
10661066 .addClass( 'overlay-content' )
10671067 .append( overlayContent )
1068 - )
 1068+ );
10691069
10701070 // Clone the overlay menu css:
10711071 var shadowCss = jQuery.extend( true, {}, overlayMenuCss );
@@ -1100,12 +1100,12 @@
11011101 .append(
11021102 gM('mwe-embedplayer-about-library-desc',
11031103 $j('<a />').attr({
1104 - 'href' : MW_EMBED_LIBRARY_PAGE,
 1104+ 'href' : mw.getConfig( 'EmbedPlayer.LibraryPage' ),
11051105 'target' : '_new'
11061106 })
11071107 )
11081108 )
1109 - )
 1109+ );
11101110 },
11111111 /**
11121112 * Get the "share" interface
@@ -1135,7 +1135,7 @@
11361136 gM( 'mwe-embedplayer-embed_site_or_blog' )
11371137 )
11381138 )
1139 - )
 1139+ );
11401140
11411141 $shareInterface.append(
11421142 $j( '<h2 />' )
@@ -1242,7 +1242,7 @@
12431243
12441244 // Close fullscreen if we are in fullscreen mode
12451245 if( _this.fullscreenMode ){
1246 - _this.restoreWindowPlayer()
 1246+ _this.restoreWindowPlayer();
12471247 }
12481248
12491249 embedPlayer.mediaElement.selectSource( sourceId );
@@ -1261,10 +1261,10 @@
12621262 } )
12631263 .hover(
12641264 function(){
1265 - $j( this ).addClass('ui-state-active')
 1265+ $j( this ).addClass('ui-state-active');
12661266 },
12671267 function(){
1268 - $j( this ).removeClass('ui-state-active')
 1268+ $j( this ).removeClass('ui-state-active');
12691269 }
12701270 );
12711271 }
@@ -1282,7 +1282,7 @@
12831283
12841284 } else {
12851285 // No player available:
1286 - $playerSelect.append( gM( 'mwe-embedplayer-no-player', source.getTitle() ) )
 1286+ $playerSelect.append( gM( 'mwe-embedplayer-no-player', source.getTitle() ) );
12871287 }
12881288 } );
12891289
@@ -1394,7 +1394,7 @@
13951395 $j('<h2 />')
13961396 .text( gM( 'mwe-embedplayer-download_full' ) ),
13971397 $mediaList
1398 - )
 1398+ );
13991399 }
14001400
14011401 if( $textList.find('li').length != 0 ) {
@@ -1402,7 +1402,7 @@
14031403 $j('<h2 />')
14041404 .html( gM( 'mwe-embedplayer-download_text' ) ),
14051405 $textList
1406 - )
 1406+ );
14071407 }
14081408 },
14091409
@@ -1430,7 +1430,7 @@
14311431 if ( this.components[ component_id ]
14321432 && this.components[ component_id ].h )
14331433 {
1434 - return this.components[ component_id ].h
 1434+ return this.components[ component_id ].h;
14351435 }
14361436 return false;
14371437 },
@@ -1444,7 +1444,7 @@
14451445 if ( this.components[ component_id ]
14461446 && this.components[ component_id ].w )
14471447 {
1448 - return this.components[ component_id ].w
 1448+ return this.components[ component_id ].w;
14491449 }
14501450 return false;
14511451 },
@@ -1497,7 +1497,7 @@
14981498 var $icon = $j('<span />')
14991499 .addClass( 'ui-icon' );
15001500 if( buttonConfig['class'] ){
1501 - $icon.addClass( buttonConfig['class'] )
 1501+ $icon.addClass( buttonConfig['class'] );
15021502 }
15031503 // Check for source ( by configuration convention this is a 16x16 image
15041504 if( buttonConfig.iconurl ){
@@ -1505,7 +1505,7 @@
15061506 $j('<img />')
15071507 .css({'width': '16px', 'height': '16px'})
15081508 .attr('src', buttonConfig.iconurl )
1509 - )
 1509+ );
15101510 }
15111511
15121512 return $j('<a />')
@@ -1524,7 +1524,7 @@
15251525 .append(
15261526 $icon
15271527 )
1528 - )
 1528+ );
15291529 }
15301530 },
15311531
@@ -1622,7 +1622,7 @@
16231623 .buttonHover()
16241624 .click( function() {
16251625 ctrlObj.showTextInterface();
1626 - } )
 1626+ } );
16271627 }
16281628 },
16291629
@@ -1681,7 +1681,7 @@
16821682 .addClass( "ui-widget time-disp" )
16831683 .append(
16841684 ctrlObj.embedPlayer.getTimeRange()
1685 - )
 1685+ );
16861686 }
16871687 },
16881688
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -186,9 +186,7 @@
187187 'target' : '#bodyContent',
188188 'catLinks' : catLinksHtml
189189 });
190 - window.mwSequencerRemote.drawUI();
191 -
192 - //setTimeout(function(){
 190+ window.mwSequencerRemote.drawUI();
193191 });
194192 }
195193

Status & tagging log