Index: branches/resourceloader/phase3/resources/mediawiki/legacy/mediawiki.legacy.IEFixes.js |
— | — | @@ -35,29 +35,29 @@ |
36 | 36 | /* Functions */ |
37 | 37 | |
38 | 38 | 'hookit': function() { |
39 | | - if ( !doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) { |
40 | | - doneIETransform = true; |
41 | | - relativeforfloats(); |
42 | | - fixalpha(); |
| 39 | + if ( !mw.legacy.doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) { |
| 40 | + mw.legacy.doneIETransform = true; |
| 41 | + mw.legacy.relativeforfloats(); |
| 42 | + mw.legacy.fixalpha(); |
43 | 43 | } |
44 | 44 | }, |
45 | 45 | /** |
46 | 46 | * Fixes PNG alpha transparency |
47 | 47 | */ |
48 | | - 'fixalpha': ( logoId ) { |
| 48 | + 'fixalpha': function( logoId ) { |
49 | 49 | // bg |
50 | | - if ( isMSIE55 && !doneIEAlphaFix ) { |
| 50 | + if ( mw.legacy.isMSIE55 && !mw.legacy.doneIEAlphaFix ) { |
51 | 51 | var plogo = document.getElementById( logoId || 'p-logo' ); |
52 | 52 | if ( !plogo ) { |
53 | 53 | return; |
54 | 54 | } |
55 | | - var logoa = plogo.getElementsByTagName('a')[0]; |
| 55 | + var logoa = plogo.getElementsByTagName( 'a' )[0]; |
56 | 56 | if ( !logoa ) { |
57 | 57 | return; |
58 | 58 | } |
59 | 59 | var bg = logoa.currentStyle.backgroundImage; |
60 | 60 | var imageUrl = bg.substring( 5, bg.length - 2 ); |
61 | | - doneIEAlphaFix = true; |
| 61 | + mw.legacy.doneIEAlphaFix = true; |
62 | 62 | if ( imageUrl.substr( imageUrl.length - 4 ).toLowerCase() == '.png' ) { |
63 | 63 | var logospan = logoa.appendChild( document.createElement( 'span' ) ); |
64 | 64 | logoa.style.backgroundImage = 'none'; |
— | — | @@ -92,8 +92,8 @@ |
93 | 93 | var tables = bc.getElementsByTagName( 'table' ); |
94 | 94 | var divs = bc.getElementsByTagName( 'div' ); |
95 | 95 | } |
96 | | - setrelative( tables ); |
97 | | - setrelative( divs ); |
| 96 | + mw.legacy.setrelative( tables ); |
| 97 | + mw.legacy.setrelative( divs ); |
98 | 98 | }, |
99 | 99 | 'setrelative': function ( nodes ) { |
100 | 100 | var i = 0; |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | } |
110 | 110 | }, |
111 | 111 | 'onbeforeprint': function() { |
112 | | - expandedURLs = []; |
| 112 | + mw.legacy.expandedURLs = []; |
113 | 113 | var contentEl = document.getElementById( 'content' ); |
114 | 114 | if ( contentEl ) { |
115 | 115 | var allLinks = contentEl.getElementsByTagName( 'a' ); |
— | — | @@ -118,15 +118,15 @@ |
119 | 119 | var expandedText = document.createTextNode( ' (' + allLinks[i].href + ')' ); |
120 | 120 | expandedLink.appendChild( expandedText ); |
121 | 121 | allLinks[i].parentNode.insertBefore( expandedLink, allLinks[i].nextSibling ); |
122 | | - expandedURLs[i] = expandedLink; |
| 122 | + mw.legacy.expandedURLs[i] = expandedLink; |
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
126 | 126 | }, |
127 | 127 | 'onafterprint': function() { |
128 | | - for ( var i = 0; i < expandedURLs.length; i++ ) { |
129 | | - if ( expandedURLs[i] ) { |
130 | | - expandedURLs[i].removeNode( true ); |
| 128 | + for ( var i = 0; i < mw.legacy.expandedURLs.length; i++ ) { |
| 129 | + if ( mw.legacy.expandedURLs[i] ) { |
| 130 | + mw.legacy.expandedURLs[i].removeNode( true ); |
131 | 131 | } |
132 | 132 | } |
133 | 133 | } |