r62943 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62942‎ | r62943 | r62944 >
Date:01:50, 25 February 2010
Author:dale
Status:deferred
Tags:
Comment:
* fixed the some hover issues
* fixed layout size of controls
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js
@@ -67,12 +67,9 @@
6868 'top' : '0px'
6969 } );
7070
71 - if( ctrlObj.checkOverlayControls() ){
72 - // Set to overlayheight - ( control bar height + 2 for borders )
73 - $menuOverlay.css( 'bottom', ctrlObj.getHeight() + 2 );
74 - }else{
75 - $menuOverlay.css( 'bottom', 0 );
76 - }
 71+
 72+ $menuOverlay.css( 'bottom', ctrlObj.getHeight() + 2 );
 73+
7774
7875 // Setup menu offset ( if player height < getOverlayHeight )
7976 // This displays the menu outside of the player on small embeds
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js
@@ -37,6 +37,7 @@
3838
3939 // Default supported menu items is merged with skin menu items
4040 supportedMenuItems: {
 41+ // Player Select
4142 'playerSelect' : true,
4243
4344 // Download the file menu
@@ -113,7 +114,7 @@
114115 } else {
115116 // Add some space to interface for the control bar ( if not overlaying controls )
116117 embedPlayer.$interface.css( {
117 - 'height' : parseInt( embedPlayer.height ) + parseInt( this.height )
 118+ 'height' : parseInt( embedPlayer.height ) + parseInt( this.height ) +2
118119 } );
119120 // update the control bar display to "block"
120121 $controlBar.css('display', 'block')
@@ -158,8 +159,7 @@
159160 if( mw.getConfig( 'kalturaAttribution' ) ){
160161 this.supportedComponets[ 'kalturaAttribution' ] = true;
161162 }
162 -
163 -
 163+
164164 // Output components
165165 for ( var component_id in this.components ) {
166166
@@ -185,7 +185,6 @@
186186 $controlBar.append(
187187 _this.getComponent( component_id )
188188 );
189 -
190189 this.available_width -= this.components[ component_id ].w;
191190 } else {
192191 mw.log( 'Not enough space for control component:' + component_id );
@@ -241,7 +240,7 @@
242241 var textSize = ( $j( window ).width() / 8 ) + 20;
243242 if( textSize < 95 ) textSize = 95;
244243 if( textSize > 250 ) textSize = 250;
245 - mw.log(' win size is: ' + $j( window ).width() + ' ts: ' + textSize );
 244+ //mw.log(' win size is: ' + $j( window ).width() + ' ts: ' + textSize );
246245 return {
247246 'font-size' : textSize + '%'
248247 }
@@ -281,7 +280,7 @@
282281 }
283282 this.fullscreenMode = true;
284283
285 - // Add the fullscreen black overlay:
 284+ // Add the css fixed fullscreen black overlay:
286285 $j( '<div />' )
287286 .addClass( 'mw-fullscreen-overlay' )
288287 // Set some arbitrary high z-index
@@ -290,17 +289,14 @@
291290 .hide()
292291 .fadeIn("slow");
293292
294 - // Set the video player margins to "auto" for centered resize
295 - /*$j( embedPlayer ).css( {
296 - 'margin' : 'auto'
297 - } );*/
298293
 294+
299295 // Change the interface to absolute positioned:
300296 this.windowPositionStyle = $interface.css( 'position' );
301297 this.windowZindex = $interface.css( 'z-index' );
302298
303299 $interface.css( {
304 - 'position' : 'absolute',
 300+ 'position' : 'fixed',
305301 'z-index' : mw.getConfig( 'fullScreenIndex' )
306302 } );
307303
@@ -318,8 +314,8 @@
319315 $interface.animate( {
320316 'top' : topOffset,
321317 'left' : leftOffset,
322 - 'width' : '100%',
323 - 'height' : '100%'
 318+ 'width' : $j( window ).width(),
 319+ 'height' : $j( window ).height()
324320 } )
325321
326322 // Set the player height width:
@@ -341,16 +337,15 @@
342338 _this.mouseMovedFlag = true;
343339 });
344340 // Check every 2 seconds reset flag status:
345 - function checkMovedMouse(){
346 - mw.log("checkMovedMouse::" + _this.mouseMovedFlag );
 341+ function checkMovedMouse(){
347342 if( _this.fullscreenMode ){
348343 if( _this.mouseMovedFlag ){
349344 _this.mouseMovedFlag = false;
350345 _this.showControlBar();
351 - // once we move the mouse keep displayed for 5 seconds
352 - setTimeout(checkMovedMouse, 5000);
 346+ // Once we move the mouse keep displayed for 4 seconds
 347+ setTimeout(checkMovedMouse, 4000);
353348 }else{
354 - // Check for mouse movment every 250ms
 349+ // Check for mouse movement every 250ms
355350 _this.hideControlBar();
356351 setTimeout(checkMovedMouse, 250 );
357352 }
@@ -358,10 +353,17 @@
359354 };
360355 checkMovedMouse();
361356
 357+ // Bind Scroll position update
362358
363 -
364359 // Bind resize resize window to resize window
365360 $j( window ).resize( function() {
 361+ // UPdate interface container:
 362+ $interface.css( {
 363+ 'top' : '0px',
 364+ 'left' : '0px',
 365+ 'width' : $j( window ).width(),
 366+ 'height' : $j( window ).height()
 367+ } )
366368 // Update player size
367369 $j( embedPlayer ).css( _this.getFullscreenPlayerCss() );
368370
@@ -465,8 +467,13 @@
466468 if( _this.checkOverlayControls() ) {
467469 // Add a special absolute overlay for hover ( to keep menu displayed
468470 $j( embedPlayer.$interface ).hover(
469 - function(){
470 - _this.showControlBar()
 471+ function(){
 472+ // Show controls with a set timeout ( avoid fade in fade out on short mouse over )
 473+ setTimeout( function() {
 474+ if( mouseIn ){
 475+ _this.showControlBar()
 476+ }
 477+ }, 250 );
471478 mouseIn = true;
472479 },
473480 function(){
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js
@@ -375,7 +375,7 @@
376376 * Local method for can play through
377377 * fired when done video can play through without re-buffering
378378 */
379 - oncanplaythrough : function() {
 379+ oncanplaythrough: function() {
380380 mw.log('f:oncanplaythrough');
381381 this.getPlayerElement();
382382 if ( ! this.paused )

Status & tagging log