r25673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25672‎ | r25673 | r25674 >
Date:20:14, 8 September 2007
Author:tstarling
Status:old
Tags:
Comment:
Special case for Java detection on Opera.
Modified paths:
  • /trunk/extensions/OggHandler/OggHandler.php (modified) (history)
  • /trunk/extensions/OggHandler/OggPlayer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggHandler.php
@@ -17,7 +17,7 @@
1818 ini_get( 'include_path' ) );
1919
2020 // Bump this when updating OggPlayer.js to help update caches
21 -$wgOggScriptVersion = '3';
 21+$wgOggScriptVersion = '4';
2222
2323 $wgExtensionMessagesFiles['OggHandler'] = "$oggDir/OggHandler.i18n.php";
2424 $wgParserOutputHooks['OggHandler'] = array( 'OggHandler', 'outputHook' );
Index: trunk/extensions/OggHandler/OggPlayer.js
@@ -123,7 +123,15 @@
124124 // navigator.javaEnabled() only tells us about preferences, we need to
125125 // search navigator.mimeTypes to see if it's installed
126126 var javaEnabled = navigator.javaEnabled();
 127+ var uniqueMimesOnly = ( navigator.appName == 'Opera' );
 128+ var invisibleJava = ( navigator.appName == 'Opera' );
127129
 130+ // Opera will switch off javaEnabled in preferences if java can't be found.
 131+ // And it doesn't register an application/x-java-applet mime type like Mozilla does.
 132+ if ( invisibleJava && javaEnabled ) {
 133+ this.clientSupports['cortado'] = true;
 134+ }
 135+
128136 // ActiveX plugins
129137 // VLC
130138 if ( this.testActiveX( 'VideoLAN.VLCPlugin.2' ) ) {
@@ -171,13 +179,12 @@
172180 }
173181 continue;
174182 }
175 -
176183 if ( javaEnabled && type == 'application/x-java-applet' ) {
177184 this.clientSupports['cortado'] = true;
178185 continue;
179186 }
180 - // Hack for Opera
181 - if ( type == 'application/x-vlc-plugin' ) {
 187+ if ( uniqueMimesOnly && type == 'application/x-vlc-plugin' ) {
 188+ // Client does not define multiple mimeType entries for application/ogg
182189 this.clientSupports['vlc-mozilla'] = true;
183190 }
184191 }

Status & tagging log