Page MenuHomePhabricator

flicker2.patch

Authored By
bzimport
Nov 21 2014, 6:55 PM
Size
2 KB
Referenced Files
None
Subscribers
None

flicker2.patch

Index: skins/common/IEFixes.js
===================================================================
RCS file: /cvsroot/wikipedia/phase3/skins/common/IEFixes.js,v
retrieving revision 1.1
diff -u -r1.1 IEFixes.js
--- skins/common/IEFixes.js 5 Sep 2004 03:33:24 -0000 1.1
+++ skins/common/IEFixes.js 6 Oct 2004 20:11:35 -0000
@@ -1,24 +1,40 @@
-// IE fix javascript
-var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
-if (rslt != null ) var version = Number(rslt[1]);
-else var version = 0;
+// IE fixes javascript
+
+var isMSIE55 = (window.showModalDialog && window.clipboardData && window.createPopup);
+var doneIETransform;
+
+if (document.attachEvent)
+ document.attachEvent('onreadystatechange', hookit);
-window.attachEvent("onload", hookit);
function hookit() {
- fixalpha();
- relativeforfloats();
+ if (!doneIETransform && document.getElementById && document.getElementById('bodyContent')) {
+ doneIETransform = true;
+ fixalpha();
+ relativeforfloats();
+ }
}
// png alpha transparency fixes
-function fixalpha(){
+function fixalpha() {
// bg
- if(version >= 5.5) {
- var logoa = document.getElementById('p-logo').firstChild;
+ if (isMSIE55) {
+ var plogo = document.getElementById('p-logo');
+ var logoa = plogo.getElementsByTagName('a')[0];
var bg = logoa.currentStyle.backgroundImage;
- if (bg.match(/\.png/i) != null){
- var mypng = bg.substring(5,bg.length-2);
- logoa.style.backgroundImage = "none";
- logoa.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='crop')";
+ var imageUrl = bg.substring(5, bg.length-2);
+
+ if (imageUrl.substr(imageUrl.length-4).toLowerCase() == '.png') {
+ var logospan = logoa.appendChild(document.createElement('span'));
+
+ logoa.style.backgroundImage = 'none';
+ logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+imageUrl+')';
+ logospan.style.height = '100%';
+ logospan.style.position = 'absolute';
+ logospan.style.width = '100%';
+ logospan.style.cursor = 'hand';
+ // Center image with hack for IE5.5
+ logospan.style.left = '50%';
+ logospan.style.setExpression('marginLeft', '"-" + (this.offsetWidth / 2) + "px"');
}
}
}

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1198
Default Alt Text
flicker2.patch (2 KB)

Event Timeline