Index: trunk/extensions/WebFonts/resources/ext.webfonts.js |
— | — | @@ -108,7 +108,8 @@ |
109 | 109 | fontFormats = [], |
110 | 110 | version = fontconfig.version || "0.0", |
111 | 111 | versionSuffix = "?version=" + version + '&20111213', |
112 | | - styleString = "@font-face { font-family: '"+fontFamily+"';\n", |
| 112 | + styleString = "<style type='text/css'>" |
| 113 | + + "@font-face { font-family: '"+fontFamily+"';\n", |
113 | 114 | ua = navigator.userAgent; |
114 | 115 | |
115 | 116 | if ( fontconfig.eot !== undefined ) { |
— | — | @@ -139,7 +140,10 @@ |
140 | 141 | styleString += fontFormats.join() + ";\n"; |
141 | 142 | styleString += "\tfont-weight: normal;}"; |
142 | 143 | |
143 | | - mw.util.addCSS( styleString ); |
| 144 | + styleString += "\n</style>\n"; |
| 145 | + // inject the css to the head of the page. |
| 146 | + // mw.util.addCSS wont work with fontface, and crashes IE. |
| 147 | + $( styleString ).appendTo( 'head' ); |
144 | 148 | }, |
145 | 149 | |
146 | 150 | /** |
— | — | @@ -414,4 +418,4 @@ |
415 | 419 | } |
416 | 420 | }; |
417 | 421 | |
418 | | -})( jQuery, mediaWiki ); |
\ No newline at end of file |
| 422 | +})( jQuery, mediaWiki ); |