r63612 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63611‎ | r63612 | r63613 >
Date:19:42, 11 March 2010
Author:dale
Status:deferred
Tags:
Comment:
added special IE comment tag to not be striped in output
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php
@@ -14,8 +14,9 @@
1515 // Load noMediaWiki helper for quick cache result
1616 $myScriptLoader = new jsScriptLoader();
1717
18 - if( $myScriptLoader->outputFromCache() )
 18+ if( $myScriptLoader->outputFromCache() ) {
1919 exit();
 20+ }
2021
2122 //Else load up all the config and do normal stand alone ScriptLoader process:
2223 require_once( realpath( dirname( __FILE__ ) ) . '/includes/noMediaWikiConfig.php' );
@@ -99,6 +100,10 @@
100101 $this->jsout .= 'var mwScriptLoaderRequestKey = "' . htmlspecialchars( $this->requestKey ) . '";' . "\n";
101102 $this->jsout .= 'var mwLang = "' . htmlspecialchars( $this->langCode ) . '";' . "\n";
102103
 104+ // Special prepend js var to be added to the top of minification output.
 105+ // useful for special comment tags in minification output
 106+ $minificationTopJs = '';
 107+
103108 // Build the output
104109 // Swap in the appropriate language per js_file
105110 foreach ( $this->jsFileList as $classKey => $file_name ) {
@@ -115,6 +120,8 @@
116121 $this->jsout .= jsClassLoader::getCombinedLoaderJs();
117122 // Output the current language class js
118123 $this->jsout .= jsClassLoader::getLanguageJs( $this->langCode );
 124+ // Output special IE comment tag to support special mwEmbed tags.
 125+ $minificationTopJs.='/*@cc_on\'video source itext playlist\'.replace(/\w+/g,function(n){document.createElement(n)})@*/'."\n";
119126 }
120127 }
121128
@@ -128,6 +135,7 @@
129136 // Check if we should minify the whole thing:
130137 if ( !$this->debug ) {
131138 $this->jsout = self::getMinifiedJs( $this->jsout , $this->requestKey );
 139+ $this->jsout = $minificationTopJs . $this->jsout;
132140 }
133141
134142 // Save to the file cache

Status & tagging log