Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1299
flicker2.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 6:55 PM
2014-11-21 18:55:55 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
flicker2.patch
View Options
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
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1198
Default Alt Text
flicker2.patch (2 KB)
Attached To
Mode
T2634: Logo can flicker in IE
Attached
Detach File
Event Timeline
Log In to Comment