Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php |
— | — | @@ -14,8 +14,9 @@ |
15 | 15 | // Load noMediaWiki helper for quick cache result |
16 | 16 | $myScriptLoader = new jsScriptLoader(); |
17 | 17 | |
18 | | - if( $myScriptLoader->outputFromCache() ) |
| 18 | + if( $myScriptLoader->outputFromCache() ) { |
19 | 19 | exit(); |
| 20 | + } |
20 | 21 | |
21 | 22 | //Else load up all the config and do normal stand alone ScriptLoader process: |
22 | 23 | require_once( realpath( dirname( __FILE__ ) ) . '/includes/noMediaWikiConfig.php' ); |
— | — | @@ -99,6 +100,10 @@ |
100 | 101 | $this->jsout .= 'var mwScriptLoaderRequestKey = "' . htmlspecialchars( $this->requestKey ) . '";' . "\n"; |
101 | 102 | $this->jsout .= 'var mwLang = "' . htmlspecialchars( $this->langCode ) . '";' . "\n"; |
102 | 103 | |
| 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 | + |
103 | 108 | // Build the output |
104 | 109 | // Swap in the appropriate language per js_file |
105 | 110 | foreach ( $this->jsFileList as $classKey => $file_name ) { |
— | — | @@ -115,6 +120,8 @@ |
116 | 121 | $this->jsout .= jsClassLoader::getCombinedLoaderJs(); |
117 | 122 | // Output the current language class js |
118 | 123 | $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"; |
119 | 126 | } |
120 | 127 | } |
121 | 128 | |
— | — | @@ -128,6 +135,7 @@ |
129 | 136 | // Check if we should minify the whole thing: |
130 | 137 | if ( !$this->debug ) { |
131 | 138 | $this->jsout = self::getMinifiedJs( $this->jsout , $this->requestKey ); |
| 139 | + $this->jsout = $minificationTopJs . $this->jsout; |
132 | 140 | } |
133 | 141 | |
134 | 142 | // Save to the file cache |