r25483 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25482‎ | r25483 | r25484 >
Date:15:57, 4 September 2007
Author:tstarling
Status:old
Tags:
Comment:
Pretty boxes make for happy Brion.
Modified paths:
  • /trunk/extensions/OggHandler/OggPlayer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggPlayer.js
@@ -29,7 +29,9 @@
3030 // Save still image HTML
3131 if ( !(params.id in this.savedThumbs) ) {
3232 var thumb = document.createDocumentFragment();
33 - thumb.appendChild( elt.cloneNode( true ) );
 33+ for ( i = 0; i < elt.childNodes.length; i++ ) {
 34+ thumb.appendChild( elt.childNodes.item( i ).cloneNode( true ) );
 35+ }
3436 this.savedThumbs[params.id] = thumb;
3537 }
3638
@@ -52,7 +54,11 @@
5355 }
5456 }
5557
56 - if ( !player || !this.clientSupports[player] ) {
 58+ if ( !this.clientSupports[player] ) {
 59+ player = false;
 60+ }
 61+
 62+ if ( !player ) {
5763 for ( var i = 0; i < this.players.length; i++ ) {
5864 if ( this.clientSupports[this.players[i]] ) {
5965 player = this.players[i];
@@ -62,7 +68,6 @@
6369 }
6470
6571 elt.innerHTML = '';
66 -
6772 switch ( player ) {
6873 case 'videoElement':
6974 this.embedVideoElement( elt, params );
@@ -83,15 +88,20 @@
8489 this.embedQuicktimePlugin( elt, params );
8590 break;
8691 case 'thumbnail':
 92+ default:
8793 if ( params.id in this.savedThumbs ) {
8894 elt.appendChild( this.savedThumbs[params.id].cloneNode( true ) );
8995 } else {
9096 elt.appendChild( document.createTextNode( 'Missing saved thumbnail for ' + params.id ) );
9197 }
92 - break;
93 - default:
94 - elt.innerHTML = '<div>' + this.msg['ogg-no-player'] + '</div>';
95 - player = 'none';
 98+ if ( player != 'thumbnail' ) {
 99+ var div = document.createElement( 'div' );
 100+ div.className = 'ogg-player-options';
 101+ div.style.cssText = 'width: ' + ( params.width - 10 ) + 'px;';
 102+ div.innerHTML = this.msg['ogg-no-player'];
 103+ elt.appendChild( div );
 104+ player = 'none';
 105+ }
96106 }
97107 if ( player != 'thumbnail' ) {
98108 var optionsBox = this.makeOptionsBox( player, params );
@@ -137,7 +147,6 @@
138148 }
139149
140150 // Mozilla plugins
141 -
142151
143152 if(navigator.mimeTypes && navigator.mimeTypes.length > 0) {
144153 for ( var i = 0; i < navigator.mimeTypes.length; i++) {

Status & tagging log