r62904 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62903‎ | r62904 | r62905 >
Date:01:44, 24 February 2010
Author:dale
Status:deferred
Tags:
Comment:
* some menu style fixes
* removed extra dc_ container
* updated thumbnail logic
* added stubs for "fullscreen" support
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/javaEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.Sequencer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/jquery.menu/jquery.menu.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/common/common.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/kskin/EmbedPlayer.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/EmbedPlayer.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/selenium_tests/amw-all-providers.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html
@@ -9,10 +9,11 @@
1010 <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" />
1111 <link rel="stylesheet" href="../skins/mvpcf/EmbedPlayer.css" type="text/css" media="screen" />
1212 <link rel="stylesheet" href="../skins/kskin/EmbedPlayer.css" type="text/css" media="screen" />
 13+ <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
1314
14 - <script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script>
1515 -->
16 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 16+
 17+<script type="text/javascript" src="../jsScriptLoader.php?debug=true&class=mwEmbed"></script>
1718
1819 </head>
1920 <script type="text/javascript">
Index: branches/js2-work/phase3/js/mwEmbed/tests/selenium_tests/amw-all-providers.html
@@ -43,7 +43,7 @@
4444 </tr>
4545 <tr>
4646 <td>click</td>
47 - <td>//div[@id='rsd_media_filter']/div[2]</td>
 47+ <td>//div[@id='rsd_media_filter']/div</td>
4848 <td></td>
4949 </tr>
5050 <tr>
Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/EmbedPlayer.css
@@ -283,10 +283,6 @@
284284 margin: 6px 0;
285285 }
286286
287 -.k-menu-screens a {;
288 -
289 -}
290 -
291287 .k-menu-screens a img {
292288 border: none;
293289 }
Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js
@@ -53,18 +53,7 @@
5454 'timeDisplay': {
5555 'w':45
5656 },
57 -
58 - /**
59 - * The playhead html
60 - */
61 - /*'playHead': {
62 - 'w':0, // special case (takes up remaining space)
63 - 'o':function( ctrlObj ) {
64 - $j( '<div />' )
65 - .addClass( "play_head" )
66 - .css( "width", parseInt( ctrlObj.available_width - 10 ) + 'px' )
67 - }
68 - },*/
 57+
6958 'optionsMenu': {
7059 'w' : 0,
7160 'o' : function( ctrlObj ) {
@@ -111,15 +100,15 @@
112101
113102 var $menuScreens = $j( '<div />' )
114103 .addClass( 'k-menu-screens' )
115 - .css({
 104+ .css( {
116105 'width' : ( ctrlObj.getOverlayWidth() - 75 ),
117106 'height' : ( ctrlObj.getOverlayHeight() - ctrlObj.getControlBarHeight() )
118 - })
 107+ } )
119108 for ( var menuItem in ctrlObj.supportedMenuItems ) {
120 - $menuScreens.append(
 109+ $menuScreens.append(
121110 $j( '<div />' )
122111 .addClass( 'menu-screen menu-' + menuItem )
123 - );
 112+ );
124113 }
125114
126115 // Add the menuScreens to the menuOverlay
Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js
@@ -19,10 +19,10 @@
2020 // Parent css Class name
2121 playerClass : 'mv-player',
2222
23 - // Long string display of time value
 23+ // Long string display of time value
2424 longTimeDisp: true,
2525
26 - // If the options menu outside of player
 26+ // If the options menu outside of player
2727 external_options : true,
2828
2929 // Default volume layout is "vertical"
@@ -161,8 +161,56 @@
162162 }
163163 }
164164 },
165 -
 165+
166166 /**
 167+ * Do full-screen mode
 168+ */
 169+ toggleFullscreen: function(){
 170+ mw.log(" ctrlBuilder :: toggle full-screen ");
 171+
 172+ // Add the black overlay:
 173+ $j( '<div />' )
 174+ .addClass( 'mw-fullscreen-overlay' )
 175+ // Set some arbitrary high z-index
 176+ .css('z-index', '999998' )
 177+ .appendTo('body')
 178+ .hide()
 179+ .fadeIn("slow");
 180+
 181+ // Setup target height width based on window
 182+ if( fullWidth )
 183+ var fullWidth = $j(window).width() - 5 ;
 184+
 185+ // Animate video or poster to requested size:
 186+ $j( this.embedPlayer ).css( {
 187+ 'position' : 'relative',
 188+ 'z-index' : '999999'
 189+ } )
 190+ // Animate a zoom ( while keeping aspect )
 191+ .animate( {
 192+ 'top' : '0px',
 193+ 'left' : '0px',
 194+ 'width' : fullWidth,
 195+ 'height' : fullWidth * ( this.embedPlayer.height / this.embedPlayer.width )
 196+ } );
 197+
 198+
 199+ /*
 200+ -moz-transform:scale(1.97833) translate(-5px, 4px);
 201+ -moz-transform-origin:50.0852% 45.6621%;
 202+ left:0;
 203+ position:relative;
 204+ top:0;
 205+ */
 206+
 207+ // bind display control on mouse-move
 208+
 209+ // bind resize clip to reize window
 210+
 211+ // bind escape to restore clip resolution
 212+ },
 213+
 214+ /**
167215 * Get minimal width for interface overlay
168216 */
169217 getOverlayWidth: function( ) {
@@ -263,12 +311,12 @@
264312 var embedPlayer = this.embedPlayer;
265313 var _this = this;
266314
267 - $j( '#dc_' + embedPlayer.id ).hover(
 315+ $j( embedPlayer ).hover(
268316 function() {
269317 if ( $j( '#gnp_' + embedPlayer.id ).length == 0 ) {
270318 var toppos = ( embedPlayer.instanceOf == 'mvPlayList' ) ? 25 : 10;
271319
272 - $j( this ).append(
 320+ $j( this ).append(
273321 $j('<div />')
274322 .attr( {
275323 'id': "gnp_" + embedPlayer.id
@@ -284,7 +332,8 @@
285333 'right' : '10px'
286334 })
287335 .html( gM( 'mwe-for_best_experience' ) )
288 - );
 336+ )
 337+
289338 $target_warning = $j( '#gnp_' + embedPlayer.id );
290339
291340 $target_warning.append(
@@ -440,9 +489,9 @@
441490 gM( 'mwe-download' ),
442491 'disk',
443492 function( ) {
444 - ctrlObj.displayOverlay( gM('mwe-loading_txt' ) );
 493+ ctrlObj.displayOverlay( gM('mwe-loading_txt' ) );
445494 // Call show download with the target to be populated
446 - ctrlObj.showDownload(
 495+ ctrlObj.showDownload(
447496 ctrlObj.embedPlayer.$interface.find( '.overlay-content' )
448497 );
449498 }
@@ -469,10 +518,10 @@
470519 closeMenuOverlay: function(){
471520 var _this = this;
472521 var embedPlayer = this.embedPlayer;
473 - var $overlay = embedPlayer.$interface.find( '.overlay-win,.ui-widget-overlay' );
 522+ var $overlay = embedPlayer.$interface.find( '.overlay-win,.ui-widget-overlay,.ui-widget-shadow' );
474523
475524 $overlay.fadeOut( "slow", function() {
476 - $overlay.remove();
 525+ $overlay.remove();
477526 } );
478527 // Show the big play button:
479528 embedPlayer.$interface.find( '.play-btn-large' ).fadeIn( 'slow' );
@@ -498,7 +547,7 @@
499548 // Check if overlay window is already present:
500549 if ( embedPlayer.$interface.find( '.overlay-win' ).length != 0 ) {
501550 //Update the content
502 - embedPlayer.$interface.find( '.overlay-win' ).html(
 551+ embedPlayer.$interface.find( '.overlay-content' ).html(
503552 overlayContent
504553 );
505554 return ;
@@ -525,20 +574,21 @@
526575 .buttonHover()
527576 .click( function() {
528577 _this.closeMenuOverlay();
529 - } )
 578+ } );
530579
 580+ var overlayMenuCss = {
 581+ 'height' : 200,
 582+ 'width' : 250,
 583+ 'position' : 'absolute',
 584+ 'left' : '10px',
 585+ 'top': '15px',
 586+ 'overflow' : 'auto',
 587+ 'padding' : '4px',
 588+ 'z-index' : 2
 589+ };
531590 $overlayMenu = $j('<div />')
532591 .addClass( 'overlay-win ui-state-default ui-widget-header ui-corner-all' )
533 - .css({
534 - 'height' : 200,
535 - 'width' : 250,
536 - 'position' : 'absolute',
537 - 'left' : '10px',
538 - 'top': '15px',
539 - 'overflow' : 'auto',
540 - 'padding' : '4px',
541 - 'z-index' : 1
542 - })
 592+ .css( overlayMenuCss )
543593 .append(
544594 $closeButton,
545595 $j('<div />')
@@ -546,8 +596,20 @@
547597 .append( overlayContent )
548598 )
549599
 600+ // Clone the overlay menu css:
 601+ var shadowCss = jQuery.extend( true, {}, overlayMenuCss );
 602+ shadowCss['height' ] = 210;
 603+ shadowCss['width' ] = 260;
 604+ shadowCss[ 'z-index' ] = 1;
 605+ $overlayShadow = $j( '<div />' )
 606+ .addClass('ui-widget-shadow ui-corner-all')
 607+ .css( shadowCss );
 608+
550609 // Append the overlay menu to the player interface
551 - embedPlayer.$interface.prepend( $overlayMenu )
 610+ embedPlayer.$interface.prepend(
 611+ $overlayMenu,
 612+ $overlayShadow
 613+ )
552614 .find( '.overlay-win' )
553615 .fadeIn( "slow" );
554616
@@ -606,11 +668,7 @@
607669 ),
608670
609671 $j('<br />'),
610 -
611 - $j('<span />')
612 - .html(
613 - gM( 'mwe-read_before_embed' )
614 - ),
 672+ $j('<br />'),
615673
616674 $j('<button />')
617675 .addClass( 'ui-state-default ui-corner-all copycode' )
@@ -622,7 +680,8 @@
623681 CopiedTxt = document.selection.createRange();
624682 CopiedTxt.execCommand( "Copy" );
625683 }
626 - } )
 684+ } )
 685+
627686 );
628687 return $shareInterface;
629688 },
@@ -658,42 +717,61 @@
659718 // output the player select code:
660719 var supporting_players = mw.EmbedTypes.players.getMIMETypePlayers( source.getMIMEType() );
661720
662 - for ( var i = 0; i < supporting_players.length ; i++ ) {
663 - var $playerLink = $j( '<a />')
664 - .attr({
665 - 'href' : '#',
666 - 'rel' : 'sel_source',
667 - 'id' : 'sc_' + source_id + '_' + supporting_players[i].id
668 - })
669 - .text( supporting_players[i].getName() )
670 - .click( function() {
671 - var iparts = $j( this ).attr( 'id' ).replace(/sc_/ , '' ).split( '_' );
672 - var source_id = iparts[0];
673 - var default_player_id = iparts[1];
674 - mw.log( 'source id: ' + source_id + ' player id: ' + default_player_id );
675 -
676 - embedPlayer.ctrlBuilder.closeMenuOverlay();
677 - embedPlayer.mediaElement.selectSource( source_id );
678 -
679 - mw.EmbedTypes.players.setPlayerPreference(
680 - default_player_id,
681 - embedPlayer.mediaElement.sources[ source_id ].getMIMEType()
 721+ for ( var i = 0; i < supporting_players.length ; i++ ) {
 722+
 723+ // Add link to select the player if not already selected )
 724+ if( embedPlayer.selected_player.id == supporting_players[i].id && is_selected ) {
 725+ // Active player ( no link )
 726+ $playerLine = $j( '<span />' )
 727+ .text(
 728+ supporting_players[i].getName()
 729+ )
 730+ .addClass( 'ui-state-highlight ui-corner-all' );
 731+
 732+ } else {
 733+ // Non active player add link to select:
 734+ $playerLine = $j( '<a />')
 735+ .attr({
 736+ 'href' : '#',
 737+ 'rel' : 'sel_source',
 738+ 'id' : 'sc_' + source_id + '_' + supporting_players[i].id
 739+ })
 740+ .addClass( 'ui-corner-all')
 741+ .text( supporting_players[i].getName() )
 742+ .click( function() {
 743+ var iparts = $j( this ).attr( 'id' ).replace(/sc_/ , '' ).split( '_' );
 744+ var source_id = iparts[0];
 745+ var default_player_id = iparts[1];
 746+ mw.log( 'source id: ' + source_id + ' player id: ' + default_player_id );
 747+
 748+ embedPlayer.ctrlBuilder.closeMenuOverlay();
 749+ embedPlayer.mediaElement.selectSource( source_id );
 750+
 751+ mw.EmbedTypes.players.setPlayerPreference(
 752+ default_player_id,
 753+ embedPlayer.mediaElement.sources[ source_id ].getMIMEType()
 754+ );
 755+
 756+ // Issue a stop
 757+ embedPlayer.stop();
 758+
 759+ // Don't follow the # link:
 760+ return false;
 761+ } )
 762+ .hover(
 763+ function(){
 764+ $j( this ).addClass('ui-state-active')
 765+ },
 766+ function(){
 767+ $j( this ).removeClass('ui-state-active')
 768+ }
682769 );
683 -
684 - // Issue a stop
685 - embedPlayer.stop();
686 -
687 - // Don't follow the # link:
688 - return false;
689 - } );
 770+ }
690771
691 - if ( embedPlayer.selected_player.id == supporting_players[i].id && is_selected ) {
692 - $playerLink
693 - .addClass('active' );
694 - }
 772+ // Add the player line to the player list:
695773 $playerList.append(
696774 $j( '<li />' ).append(
697 - $playerLink
 775+ $playerLine
698776 )
699777 );
700778 }
@@ -835,54 +913,29 @@
836914 },
837915
838916 /**
839 - * The options for the player, includes player selection,
840 - * download, and share options
841 - */
842 - 'optionsMenu': {
843 - 'w' : 0,
844 - 'o' : function( ctrlObj ) {
845 - /*var o = '<div id="mv_vid_options_' + ctrlObj.embedPlayer.id + '" class="videoOptions">' +
846 - '<div class="videoOptionsTop"></div>' +
847 - '<div class="videoOptionsBox">' +
848 - '<div class="block">' +
849 - '<h6>Video Options</h6>' +
850 - '</div>' +
851 - '<div class="block">' +
852 - '<p class="short_match vo_selection"><a href="#"><span>' + gM( 'mwe-chose_player' ) + '</span></a></p>' +
853 - '<p class="short_match vo_download"><a href="#"><span>' + gM( 'mwe-download' ) + '</span></a></p>' +
854 - '<p class="short_match vo_showcode"><a href="#"><span>' + gM( 'mwe-share' ) + '</span></a></p>';
855 -
856 - // link to the stream page if we are not already there:
857 - if ( ( ctrlObj.embedPlayer.roe || ctrlObj.embedPlayer.linkback ) && typeof mv_stream_interface == 'undefined' )
858 - o += '<p class="short_match"><a href="javascript:$j(\'#' + ctrlObj.id + '\').get(0).doLinkBack()"><span><strong>Source Page</strong></span></a></p>';
859 -
860 - o += '</div>' +
861 - '</div><!--videoOptionsInner-->' +
862 - '<div class="videoOptionsBot"></div>' +
863 - '</div><!--videoOptions-->';
864 - return o;
865 - */
866 - }
867 - },
868 -
869 - /**
870917 * The kaltura attribution button
871918 */
872919 'kalturaAttribution' : {
873920 'w' : 28,
874921 'o' : function( ctrlObj ){
875 - return $j( '<div />' )
876 - .attr( 'title', gM( 'mwe-kaltura-platform-title' ) )
877 - .addClass( 'ui-state-default ui-corner-all ui-icon_link rButton' )
 922+ return $j('<a />')
 923+ .attr({
 924+ 'href': 'http://kaltura.com',
 925+ 'title' : gM( 'mwe-kaltura-platform-title' ),
 926+ 'target' : '_new'
 927+ })
 928+ .append(
 929+ $j( '<div />' )
 930+ .addClass( 'rButton' )
 931+ .css({
 932+ 'top' : '9px',
 933+ 'left' : '2px'
 934+ })
878935 .append(
879936 $j('<span />')
880937 .addClass( 'ui-icon kaltura-icon' )
881938 )
882 - .unbind()
883 - .buttonHover()
884 - .click( function( ) {
885 - window.location = 'http://kaltura.com';
886 - } );
 939+ )
887940 }
888941 },
889942
@@ -898,10 +951,17 @@
899952 .append(
900953 $j('<span />')
901954 .addClass( 'ui-icon ui-icon-wrench' )
902 - )
 955+ )
 956+ .buttonHover()
903957 // Options binding:
904958 .menu( {
905 - 'content' : ctrlObj.getOptionsMenu(),
 959+ 'content' : ctrlObj.getOptionsMenu(),
 960+ 'positionOpts': {
 961+ 'directionV' : 'up',
 962+ 'offsetY' : 32,
 963+ 'directionH' : 'left',
 964+ 'offsetX' : -28
 965+ }
906966 } );
907967 }
908968 },
@@ -965,7 +1025,19 @@
9661026 .buttonHover()
9671027 .click( function() {
9681028 ctrlObj.embedPlayer.showTextInterface();
 1029+ } )
 1030+ /*
 1031+ * menu:
 1032+ .menu( {
 1033+ 'content' : gM('mwe-loading_txt')
 1034+ 'positionOpts': {
 1035+ 'directionV' : 'up',
 1036+ 'offsetY' : 32,
 1037+ 'directionH' : 'left',
 1038+ 'offsetX' : -28
 1039+ }
9691040 } );
 1041+ */
9701042 }
9711043 },
9721044
Index: branches/js2-work/phase3/js/mwEmbed/skins/common/common.css
@@ -478,9 +478,21 @@
479479 margin-top: -6px !important;
480480 margin-left: 3px !important;
481481 }
482 -mw-buffer{
 482+.mw-buffer{
483483 width:0px;
484484 height:100%;
485485 z-index:1;
486486 top:0px;
 487+}
 488+
 489+.mw-fullscreen-overlay {
 490+ background: rgb(0, 0, 0) none repeat scroll 0% 0%;
 491+ position: fixed;
 492+ top: 0pt;
 493+ left: 0pt;
 494+ width: 100%;
 495+ height: 100%;
 496+ -moz-background-clip: border;
 497+ -moz-background-origin: padding;
 498+ -moz-background-inline-policy: continuous;
487499 }
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/EmbedPlayer.css
@@ -26,20 +26,7 @@
2727 .mv-player a:hover {color: #75a5e4; text-decoration: underline;}
2828 .mv-player img, .mv-player img a, .mv-player img a:hover {border: 0;}
2929
30 -.mv-player h1, .mv-player h2, .mv-player h3, .mv-player h4, .mv-player h5, .mv-player h6 {
31 - color:#222;
32 - font-family:arial,sans-serif;
33 - margin: 5px 0; padding: 0;
34 -}
35 -.mv-player h1 {font-size: 24px;}
36 -.mv-player h2 {font-size: 18px;}
37 -.mv-player h3 {font-size: 16px;}
38 -.mv-player h4 {font-size: 14px;}
39 -.mv-player h5 {font-size: 13px; text-align: center;}
40 -.mv-player h6 {font-size: 13px; color: #6c6c6c; padding: 10px 20px 0px 20px; text-transform: uppercase;}
4130
42 -
43 -
4431 .mv-player .video {
4532 display: block;
4633 position: relative;
@@ -168,29 +155,20 @@
169156 }
170157
171158
172 -.mv-player .videoOptionsComplete textarea {
 159+.mv-player .overlay-win textarea {
173160 background:none repeat scroll 0 0 transparent;
174161 border-color:#333 -moz-use-text-color -moz-use-text-color #333;
175162 border-style:solid none none solid;
176163 border-width:2px medium medium 2px;
177 - color:#CCCCCC;
 164+ color:#222;
178165 font:11px arial,sans-serif;
179166 height:15px;
180167 overflow:hidden;
181168 padding-left:2px;
182169 width:100%;
183170 }
184 -.mv-player .videoOptionsComplete .copycode {
185 - background:url("images/ksprite.png") no-repeat scroll 0 -81px #D4D4D4;
186 - border:1px solid #000000;
187 - color:#000000;
188 - float:right;
189 - height:24px;
190 - padding:0 5px 3px;
191 - width:84px;
192 - font-size:1em;
193 -}
194 -.mv-player .videoOptionsComplete div.ui-state-highlight {
 171+
 172+.mv-player .overlay-win div.ui-state-highlight {
195173 background:none repeat scroll 0 0 transparent;
196174 border-color:#554926;
197175 color:#FFE96E;
@@ -202,83 +180,20 @@
203181 font-weight:bold;
204182 }
205183
206 -.videoComplete{
207 - position: absolute;
208 - top:0px;
209 - left:0px;
210 - z-index: 10;
211 - font-size:16px;
212 - overflow: hidden;
213 - background:transparent url(images/transparent_bg.png) repeat scroll 0 0;
 184+.mv-player .overlay-win h2{
 185+ font-size: 115%;
214186 }
215 -.videoComplete .videoOptionsComplete {
216 - background:transparent url('images/player_video_options_bg.png') no-repeat scroll 0pt;
217 - color:#7A7A7A;
218 - font-size:10pt;
219 - height:158px;
220 - left:10%;
221 - overflow:auto;
222 - padding:19px;
223 - position:relative;
224 - top:16%;
225 - width:283px;
226 -}
227 -.videoComplete .videoOptionsComplete p { text-align: center; margin: 3px 0; padding: 0; }
228 -.videoComplete .videoOptionsComplete a {
229 - color: white;
230 -/* font-size: 22px;*/
231 - font-size:12px;
232 - text-decoration: underline;
233 -}
234 -.videoComplete .videoOptionsComplete a.active{
235 - color: #bbf;
236 -}
237 -.videoComplete .videoOptionsComplete a.email {
238 - font-size:16px;
239 - background: url(images/ico_mail.png) right 0px no-repeat;
240 - padding: 0 50px 0 0;
241 -}
242187
243 -.videoComplete div.embed_code textarea {
244 - margin: 8px 0 8px 0;
245 - padding: 3px;
246 - width: 258px;
247 - height: 54px;
248 - border: 1px solid #dadada;
249 - font-family: Arial;
250 - color: #777;
251 - font-size: 11px;
 188+.mv-player .overlay-win{
 189+ font-family : arial,sans-serif;
 190+ font-size : 85%;
252191 }
253 -.videoComplete div.embed_code button.copy_to_clipboard {
254 - background: #dddddd url(images/button_to_clipboard.png) 0 0 repeat-x;
255 - border: 1px solid #3b4552;
256 - text-align: center;
257 - padding: 2px 4px;
258 - margin: 0 0 6px 0;
259 - float: right;
260 - display: inline;
 192+.mv-player .overlay-win a{
 193+ text-decoration: none;
261194 }
262195
263 -
264 -/*Video options*/
265 -.videoOptions {
266 - display: none;
267 - width: 183px;
268 - overflow: hidden;
269 - position: absolute;
270 - z-index: 9999;
271 -/* margin: 0 0 0 230px;*/
 196+.mv-player .overlay-win ul{
 197+ padding-left: 15px;
272198 }
273 -*:first-child+html .videoOptions {margin-top: -20px;}
274 -.videoOptionsTop {
275 - width: 183px;
276 - height: 32px;
277 - position: relative;
278 - z-index: 3;
279 - background: url(images/player_options_top.png) 0 0 no-repeat;
280 -}
281199
282 - 'font-family' : 'arial,sans-serif',
283 - 'font-size' : '80%'
284200
285 -
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/jquery.menu/jquery.menu.js
@@ -45,7 +45,7 @@
4646 $.fn.menu = function( options ) {
4747 var caller = this;
4848 var options = options;
49 - if( ! caller.m ) {
 49+ if( ! caller.m ) {
5050 caller.m = new Menu(caller, options);
5151 allUIMenus.push( caller.m );
5252
@@ -75,8 +75,9 @@
7676 }
7777
7878 //Else process the request:
79 - if( options == 'show' )
 79+ if( options == 'show' ){
8080 caller.m.showMenu();
 81+ }
8182
8283 return this;
8384 };
@@ -89,10 +90,17 @@
9091
9192 var callerClassList = 'fg-menu-container ui-widget ui-widget-content ui-corner-all';
9293 if( options.targetMenuContainer ) {
93 - var container = $( options.targetMenuContainer ).addClass( callerClassList ).html( options.content );
 94+ var container = $( options.targetMenuContainer )
 95+ .addClass( callerClassList )
 96+ .html( options.content )
9497 }else{
9598 var container = $('<div>').addClass( callerClassList ).html( options.content );
9699 }
 100+ // some custom css:
 101+ container.css( {
 102+ 'left' : '0px',
 103+ 'z-index': 2
 104+ } );
97105
98106 this.menuOpen = false;
99107 this.menuExists = false;
@@ -529,7 +537,7 @@
530538 - detectH/V: detect the viewport horizontally / vertically
531539 - linkToFront: copy the menu link and place it on top of the menu (visual effect to make it look like it overlaps the object) */
532540
533 -Menu.prototype.setPosition = function(widget, caller, options) {
 541+Menu.prototype.setPosition = function(widget, caller, options) {
534542 var el = widget;
535543 var referrer = caller;
536544 var dims = {
@@ -542,7 +550,7 @@
543551 var xVal, yVal;
544552
545553 var helper = $( '<div class="positionHelper">' );
546 - // Hard code width heigh of button if unset ( crazy IE )
 554+ // Hard code width height of button if unset ( crazy IE )
547555 if( isNaN( dims.refW ) || isNaN( dims.refH ) ) {
548556 dims.refH = 16;
549557 dims.refW = 23;
@@ -555,10 +563,10 @@
556564 'height': dims.refH
557565 });
558566 el.wrap( helper );
559 -
 567+ xVal = yVal = 0;
560568 // get X pos
561569 switch(options.positionOpts.posX) {
562 - case 'left': xVal = 0;
 570+ case 'left': xVal = 0;
563571 break;
564572 case 'center': xVal = dims.refW / 2;
565573 break;
@@ -568,21 +576,20 @@
569577
570578 // get Y pos
571579 switch(options.positionOpts.posY) {
572 - case 'top': yVal = 0;
 580+ case 'top' : yVal = 0;
573581 break;
574 - case 'center': yVal = dims.refH / 2;
 582+ case 'center' : yVal = dims.refH / 2;
575583 break;
576 - case 'bottom': yVal = dims.refH;
 584+ case 'bottom' : yVal = dims.refH;
577585 break;
578 - };
579 -
 586+ };
580587 // add the offsets (zero by default)
581588 xVal += options.positionOpts.offsetX;
582589 yVal += options.positionOpts.offsetY;
583590
584591 // position the object vertically
585592 if (options.positionOpts.directionV == 'up') {
586 - el.css({ top: 'auto', bottom: yVal });
 593+ el.css( { top: 'auto', bottom: yVal } );
587594 if (options.positionOpts.detectV && !fitVertical(el)) {
588595 el.css({ bottom: 'auto', top: yVal });
589596 }
@@ -725,4 +732,4 @@
726733 return result;
727734 };
728735
729 -} )(jQuery);
\ No newline at end of file
 736+} )(jQuery);
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -210,7 +210,17 @@
211211 mw.log( "TimedText:bindMenu:" + target );
212212 _this.menuTarget = target;
213213 var $menuButton = this.embedPlayer.$interface.find( '.timed-text' );
214 -
 214+
 215+ var positionOpts = null;
 216+ if( this.embedPlayer.supports[ 'overlays' ] ){
 217+ var positionOpts = {
 218+ 'directionV' : 'up',
 219+ 'offsetY' : 32,
 220+ 'directionH' : 'left',
 221+ 'offsetX' : -28
 222+ };
 223+ }
 224+
215225 // Else bind and show the menu
216226 // We already have a loader in embedPlayer so the delay of
217227 // setupTextSources is already taken into account
@@ -219,8 +229,8 @@
220230 $menuButton.unbind().menu( {
221231 'content' : _this.getMainMenu(),
222232 'crumbDefaultText' : ' ',
223 - 'targetMenuContainer' : _this.menuTarget,
224233 'autoShow' : autoShow,
 234+ 'positionOpts' : positionOpts,
225235 'backLinkText' : gM( 'mwe-back-btn' )
226236 } );
227237 });
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js
@@ -396,7 +396,7 @@
397397 return $langMenu;
398398 },
399399 getLangMenuItem: function( langKey , source_icon) {
400 - return this.parentTimedText.getLi(
 400+ return $j.getLineItem(
401401 langKey + ' - ' + unescape( mw.languages[ langKey ] ),
402402 source_icon,
403403 function() {
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -1697,7 +1697,7 @@
16981698 };
16991699 mw.getJSON( mw.commons_api_url, request, function( data ) {
17001700 // empty the videos:
1701 - $j( '#dc_' + _this.id + ' .related_vids ul' ).html( ' ' );
 1701+ $j( '#' + _this.id + ' .related_vids ul' ).html( ' ' );
17021702
17031703 for ( var j in data.query.pages ) {
17041704 // Setup poster default:
@@ -1719,7 +1719,7 @@
17201720 ' <a title="' + title_str + '" target="_blank" ' +
17211721 'href="' + descriptionurl + '">' + title_str + '</a>' +
17221722 '</li>';
1723 - $j( '#dc_' + _this.id + ' .related_vids ul' ).append( liout ) ;
 1723+ $j( '#' + _this.id + ' .related_vids ul' ).append( liout ) ;
17241724 }
17251725 }
17261726 };
@@ -1762,21 +1762,24 @@
17631763 this.$interface.find( '.play-btn-large' ).hide();
17641764
17651765 // Add black background
1766 - $j( '#dc_' + this.id ).append( '<div id="black_back_' + this.id + '" ' +
1767 - 'style="z-index:-2;position:absolute;background:#000;' +
1768 - 'top:0px;left:0px;width:' + parseInt( this.width ) + 'px;' +
1769 - 'height:' + parseInt( this.height ) + 'px;">' +
1770 - '</div>' );
 1766+ $j( '#' + this.id ).append( '<div id="black_back_' + this.id + '" ' +
 1767+ 'style="z-index:-2;position:absolute;background:#000;' +
 1768+ 'top:0px;left:0px;width:' + parseInt( this.width ) + 'px;' +
 1769+ 'height:' + parseInt( this.height ) + 'px;">' +
 1770+ '</div>' );
17711771
17721772 if ( this.apiTitleKey ) {
1773 - $j( '#dc_' + this.id ).append(
1774 - '<div class="related_vids" >' +
1775 - '<h1>' + gM( 'mwe-related_videos' ) + '</h1>' +
1776 - '<ul>' +
1777 - '</ul>' +
1778 - '</div>' );
 1773+ $j( '#' + this.id ).append(
 1774+ $j( '<div />' )
 1775+ .addClass( 'related_vids' ),
 1776+
 1777+ $j('<h2 />' )
 1778+ .text( gM( 'mwe-related_videos' ) ),
 1779+
 1780+ $j('<ul />')
 1781+ );
17791782 $j( '#img_thumb_' + this.id ).fadeOut( "fast" );
1780 - $j( '#dc_' + _this.id + ' .related_vids ul' ).html( gM( 'mwe-loading_txt' ) );
 1783+ $j( '#' + _this.id + ' .related_vids ul' ).html( gM( 'mwe-loading_txt' ) );
17811784 this.getRelatedFromTitleKey();
17821785 } else {
17831786 this.showNearbyClips();
@@ -1790,13 +1793,20 @@
17911794 showNearbyClips: function() {
17921795 var _this = this;
17931796 // add the liks_info_div black back
1794 - $j( '#dc_' + this.id ).append( '<div id="liks_info_' + this.id + '" ' +
1795 - 'style="width:' + parseInt( parseInt( this.width ) / 2 ) + 'px;' +
1796 - 'height:' + parseInt( parseInt( this.height ) ) + 'px;' +
1797 - 'position:absolute;top:10px;overflow:auto' +
1798 - 'width: ' + parseInt( ( ( parseInt( this.width ) / 2 ) -15 ) ) + 'px;' +
1799 - 'left:' + parseInt( ( ( parseInt( this.width ) / 2 ) + 15 ) ) + 'px;">' +
1800 - '</div>'
 1797+ $j( this ).append(
 1798+ $j( '<div />' )
 1799+ .attr( {
 1800+ 'id' : 'liks_info_' + this.id
 1801+ })
 1802+ .css({
 1803+ 'width' : parseInt( parseInt( this.width ) / 2 ) + 'px',
 1804+ 'height' : parseInt( parseInt( this.height ) ) + 'px',
 1805+ 'position' : 'absolute',
 1806+ 'top' : '10px',
 1807+ 'overflow' : 'auto',
 1808+ 'width' : parseInt( ( ( parseInt( this.width ) / 2 ) -15 ) ) ,
 1809+ 'left' : parseInt( ( ( parseInt( this.width ) / 2 ) + 15 ) )
 1810+ })
18011811 );
18021812 // start animation (make thumb small in upper left add in div for "loading"
18031813 $j( '#img_thumb_' + this.id ).animate( {
@@ -1990,7 +2000,9 @@
19912001 var _this = this;
19922002 mw.log( 'f:showThumbnail' + this.thumbnail_disp );
19932003 this.ctrlBuilder.closeMenuOverlay();
1994 - $j( '#' + this.id ).html( this.getThumbnailHTML() );
 2004+ // update the thumbnail html:
 2005+ this.updateThumbnailHTML();
 2006+
19952007 this.paused = true;
19962008 this.thumbnail_disp = true;
19972009 // Make sure the ctrlBuilder bindings are up-to-date
@@ -2037,9 +2049,7 @@
20382050 this.$interface = $j(this).parent('.interface_wrap');
20392051
20402052 // Update Thumbnail for the "player"
2041 - $j( this ).html(
2042 - this.getThumbnailHTML()
2043 - )
 2053+ this.updateThumbnailHTML();
20442054
20452055 // Add controls if enabled:
20462056 if ( this.controls ) {
@@ -2110,7 +2120,7 @@
21112121 *
21122122 * @param {Object} options Options for rendred timeline thumb
21132123 */
2114 - renderTimelineThumbnail:function( options ) {
 2124+ renderTimelineThumbnail: function( options ) {
21152125 var my_thumb_src = this.mediaElement.getThumbnailURL();
21162126 // check if our thumbnail has a time attribute:
21172127 if ( my_thumb_src.indexOf( 't=' ) !== -1 ) {
@@ -2134,7 +2144,7 @@
21352145 * Update Thumb time with npt formated time
21362146 * @param {String} time NPT formated time to update thumbnail
21372147 */
2138 - updateThumbTimeNPT:function( time ) {
 2148+ updateThumbTimeNPT: function( time ) {
21392149 this.updateThumbTime( mw.npt2seconds( time ) - parseInt( this.startOffset ) );
21402150 },
21412151
@@ -2198,7 +2208,7 @@
21992209 if ( this.thumbnail_disp ) {
22002210 mw.log( 'set to thumb:' + src );
22012211 this.thumbnail_updating = true;
2202 - $j( '#dc_' + this.id ).append(
 2212+ $j( this ).append(
22032213 $j('<img />')
22042214 .attr({
22052215 'src' : src,
@@ -2239,46 +2249,32 @@
22402250 * playing, configuring the player, inline cmml display, HTML linkback,
22412251 * download, and embed code.
22422252 */
2243 - getThumbnailHTML : function () {
2244 - mw.log( 'embedPlayer:getThumbnailHTML::' + this.id );
 2253+ updateThumbnailHTML : function () {
 2254+ mw.log( 'embedPlayer:updateThumbnailHTML::' + this.id );
22452255 var thumb_html = '';
22462256 var class_atr = '';
22472257 var style_atr = '';
22482258 this.thumbnail = this.mediaElement.getThumbnailURL();
2249 -
 2259+
22502260 // put it all in the div container dc_id
2251 - $thumb = $j('<div />')
2252 - .attr({
2253 - 'id' : 'dc_' + this.id
2254 - })
2255 - .css({
2256 - 'position' : 'absolute',
2257 - 'overflow' : 'hidden',
2258 - 'top' : '0px',
2259 - 'left': '0px',
2260 - 'width' : this.getPlayerWidth() + 'px',
2261 - 'height' : this.getPlayerHeight() + 'px',
2262 - 'z-index' : '0'
2263 - })
2264 - .append(
 2261+ $j( this ).html(
22652262 $j( '<img />' )
22662263 .css({
22672264 'position' : 'relative',
2268 - 'width' : this.getPlayerWidth() + 'px',
2269 - 'height' : this.getPlayerHeight() + 'px'
 2265+ 'width' : '100%',
 2266+ 'height' : '100%'
22702267 })
22712268 .attr({
22722269 'id' : 'img_thumb_' + this.id,
22732270 'src' : this.thumbnail
22742271 })
2275 - );
 2272+ );
22762273
22772274 if ( this.controls == true ) {
2278 - $thumb.append(
 2275+ $j( this ).append(
22792276 this.ctrlBuilder.getComponent( 'playButtonLarge' )
22802277 );
2281 - }
2282 - return $thumb;
 2278+ }
22832279 },
22842280
22852281 /**
@@ -2351,7 +2347,6 @@
23522348 var _this = this;
23532349 mw.log('showTextInterface:');
23542350
2355 -
23562351 var $menu = $j( '#timedTextMenu_' + this.id );
23572352 //This may be unnessesary .. we just need to show a spiner somewhere
23582353 if ( $menu.length != 0 ) {
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/javaEmbed.js
@@ -179,21 +179,9 @@
180180 } else {
181181 this.playerElement = $j( '#' + this.pid ).get( 0 );
182182 }
183 - },
 183+ },
184184
185185 /**
186 - * Show the Thumbnail
187 - */
188 - showThumbnail:function() {
189 - // empty out player html (jquery with java applets does mix) :
190 - var pelm = document.getElementById( 'dc_' + this.id );
191 - if ( pelm ) {
192 - pelm.innerHTML = '';
193 - }
194 - this.parent_showThumbnail();
195 - },
196 -
197 - /**
198186 * Issue the doPlay request to the playerElement
199187 * calls parent_play to update interface
200188 */
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js
@@ -29,7 +29,7 @@
3030 supports: {
3131 'playHead' : true,
3232 'pause' : true,
33 - 'fullscreen' : false,
 33+ 'fullscreen' : true,
3434 'timeDisplay' : true,
3535 'volumeControl' : true,
3636
@@ -195,6 +195,7 @@
196196 _this.doSeekedCallback( position, callback );
197197 }
198198 },
 199+
199200 /**
200201 * Do the seek request with a callback
201202 *
@@ -282,6 +283,13 @@
283284 },
284285
285286 /**
 287+ * Fullscreen for "video" with control overlays:
 288+ */
 289+ fullscreen: function(){
 290+ this.ctrlBuilder.toggleFullscreen();
 291+ },
 292+
 293+ /**
286294 * Update Volume
287295 *
288296 * @param {Float} percentage Value between 0 and 1 to set audio volume
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.Sequencer.js
@@ -1651,9 +1651,8 @@
16521652 // override renderDisplay
16531653 renderDisplay:function() {
16541654 mw.log( 'mvSequence:renderDisplay' );
1655 - // setup layout for title and dc_ clip container
1656 - $j( this ).html( '<div id="dc_' + this.id + '" style="width:' + this.width + 'px;' +
1657 - 'height:' + ( this.height ) + 'px;position:relative;" />' );
 1655+ // Clear out the render:
 1656+ $j( this ).html( '' );
16581657
16591658 this.setupClipDisplay();
16601659 }
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -2768,3 +2768,7 @@
27692769 mwCheckBody();
27702770 }, 250);
27712771
 2772+// If window.jQuery is already avaliable set no conflict before setup
 2773+if( window.jQuery ){
 2774+ window['$j'] = jQuery.noConflict();
 2775+}
\ No newline at end of file

Status & tagging log