r66860 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66859‎ | r66860 | r66861 >
Date:01:07, 25 May 2010
Author:dale
Status:deferred
Tags:
Comment:
check for volume support before updating interface.
minor code clean up
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/javaEmbed.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/nativeEmbed.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)
  • /branches/MwEmbedStandAlone/skins/common/common.css (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/skins/common/common.css
@@ -85,7 +85,7 @@
8686 }
8787
8888 ui-widget-overlay{
89 - background: url("images/ui-bg_diagonals-thick_20_666666_40x40.png") repeat scroll 50% 50% #666666;
 89+ background: url('images/ui-bg_diagonals-thick_20_666666_40x40.png') repeat scroll 50% 50% #666666;
9090 opacity:0.5;
9191 }
9292
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -2648,14 +2648,18 @@
26492649 // Update the playerElement volume
26502650 this.setPlayerElementVolume( percent );
26512651
2652 - mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume);
 2652+ //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume);
26532653 },
26542654
26552655 /**
2656 - * Updates the interface volume
 2656+ * Updates the interface volume
 2657+ * TODO should move to ctrlBuilder
 2658+ * @param
26572659 */
26582660 setInterfaceVolume: function( percent ) {
2659 - this.$interface.find( '.volume-slider' ).slider( 'value', percent * 100 );
 2661+ if( this.supports[ 'volumeControl' ] ) {
 2662+ this.$interface.find( '.volume-slider' ).slider( 'value', percent * 100 );
 2663+ }
26602664 },
26612665
26622666 /**
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/javaEmbed.js
@@ -83,7 +83,7 @@
8484 */
8585
8686 // Start the monitor:
87 - this.monitor();
 87+ _this.monitor();
8888 },
8989
9090 /**
@@ -187,15 +187,20 @@
188188 /**
189189 * Update the playerElement instance with a pointer to the embed object
190190 */
191 - getPlayerElement:function() {
192 - //this.playerElement = $j( '#' + this.pid ).get( 0 );
193 - this.playerElement = document.applets[ 0 ];
 191+ getPlayerElement: function() {
 192+ if( !$j( '#' + this.pid ).length ) {
 193+ return false;
 194+ }
 195+ //mw.log( 'getPlayerElement::' + this.pid );
 196+ this.playerElement = $j( '#' + this.pid ).get( 0 );
 197+ //this.playerElement = document.applets[ 0 ];
194198 // NOTE we are currently not using the iframe embed method:
195199 //if ( $j.browser.mozilla ) {
196200 // this.playerElement = $j('#cframe_' + this.id).contents().find( '#' + this.pid );
197201 //} else {
198202 // this.playerElement = $j( '#' + this.pid ).get( 0 );
199203 //}
 204+ return this.playerElement;
200205 },
201206
202207 /**
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/nativeEmbed.js
@@ -68,8 +68,9 @@
6969
7070 $j( this ).html(
7171 _this.getNativePlayerHtml()
72 - )
73 - // directly run postEmbedJS ( if playerElement is not avaliable it will retry )
 72+ );
 73+
 74+ // Directly run postEmbedJS ( if playerElement is not available it will retry )
7475 _this.postEmbedJS();
7576 },
7677
@@ -190,6 +191,7 @@
191192
192193 /**
193194 * Do a native seek by updating the currentTime
 195+ * @param {float} percentage Percent to seek to of full time
194196 */
195197 doNativeSeek:function( percentage ) {
196198 var _this = this;
Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -1961,8 +1961,9 @@
19621962 // Set up mvEmbed utility jQuery bindings
19631963 mw.dojQueryBindings();
19641964
1965 - // Speical Hack for condtional jquery ui inclution ( once Usability extension
1966 - // registers the jquery.ui skin in mw.sytle this won't be needed:
 1965+
 1966+ // Special Hack for conditional jquery ui inclusion ( once Usability extension
 1967+ // registers the jquery.ui skin in mw.style this won't be needed:
19671968 if( mw.hasJQueryUiCss() ){
19681969 mw.style[ mw.getConfig( 'jQueryUISkin' ) ] = true;
19691970 }
@@ -1995,8 +1996,8 @@
19961997
19971998 /**
19981999 * Checks for jquery ui css by name jquery-ui-1.7.2.css
1999 - * NOTE: this is kind of a hack for usability jquery-ui
2000 - * in the future usability should register the class in mw.skin
 2000+ * NOTE: this is a hack for usability jquery-ui
 2001+ * in the future usability should register a class in mw.skin
20012002 *
20022003 * @return true if found, return false if not found
20032004 */
@@ -2004,7 +2005,7 @@
20052006 var hasUiCss = false;
20062007 // Load the jQuery ui skin if usability skin not set
20072008 $j( 'link' ).each( function( na, linkNode ){
2008 - if( $j( linkNode ).attr( 'href' ).indexOf('jquery-ui-1.7.2.css') != -1 ) {
 2009+ if( $j( linkNode ).attr( 'href' ).indexOf( 'jquery-ui-1.7.2.css' ) != -1 ) {
20092010 hasUiCss = true;
20102011 return false;
20112012 }
@@ -2250,7 +2251,7 @@
22512252 ' class="ui-state-default ui-corner-all ui-icon_link ' +
22522253 className + '"><span class="ui-icon ui-icon-' + iconId + '" ></span>' +
22532254 '<span class="btnText">' + msg + '</span></a>';
2254 - }
 2255+ };
22552256
22562257 // Shortcut to jQuery button ( should replace all btnHtml with button )
22572258 var mw_default_button_options = {
@@ -2265,7 +2266,8 @@
22662267
22672268 // The icon id that precceeds the button link:
22682269 'icon_id' : 'carat-1-n'
2269 - }
 2270+ };
 2271+
22702272 $.button = function( options ) {
22712273 var options = $j.extend( mw_default_button_options, options);
22722274
@@ -2288,7 +2290,7 @@
22892291 .text( options.text )
22902292 );
22912293 return $btn;
2292 - }
 2294+ };
22932295
22942296 // Shortcut to bind hover state
22952297 $.fn.buttonHover = function() {
@@ -2301,7 +2303,7 @@
23022304 }
23032305 )
23042306 return this;
2305 - }
 2307+ };
23062308
23072309 /**
23082310 * Resize a dialog to fit the window
@@ -2322,9 +2324,9 @@
23232325 'right':'0px',
23242326 'bottom':'0px'
23252327 } );
2326 - }
 2328+ };
23272329
2328 - } )( jQuery );
 2330+ } )( $j );
23292331 }
23302332
23312333 } )( window.mw );
@@ -2443,4 +2445,4 @@
24442446 if( dollarFlag ) {
24452447 window[ '$' ] = jQuery.noConflict();
24462448 }
2447 -}
\ No newline at end of file
 2449+}
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r125';
 8+var mwRemoteVersion = 'r126';
99 var mwUseScriptLoader = true;
1010
1111 // Log the mwRemote version ( will determine what version of js we get )
@@ -21,9 +21,10 @@
2222 mwReqParam[ p[0] ] = p[1];
2323 }
2424 }
 25+
2526
2627 // Use wikibits onLoad hook: ( since we don't have js2 / mw object loaded )
27 -addOnloadHook( function() {
 28+addOnloadHook( function() {
2829 doPageSpecificRewrite();
2930 } );
3031
@@ -355,8 +356,11 @@
356357 rurl += 'window.jQuery';
357358 coma = ',';
358359 }
359 - // Add Core mwEmbed lib:
360 - rurl += coma + 'mwEmbed';
 360+ // Add Core mwEmbed lib ( if not already defined )
 361+ if( typeof MW_EMBED_VERSION == 'undefined' ){
 362+ rurl += coma + 'mwEmbed';
 363+ coma = ',';
 364+ }
361365
362366 // Add requested classSet to scriptLoader request
363367 for( var i=0; i < classSet.length; i++ ){

Status & tagging log