changeset 1634:2161d292e1af

move IE hacks to msie.css and include it if IE
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 22 Oct 2006 03:28:33 +0200
parents c62b1d1961da
children a41c60e53ddd
files MoinMoin/theme/__init__.py docs/CHANGES wiki/htdocs/classic/css/common.css wiki/htdocs/classic/css/msie.css wiki/htdocs/classic/css/screen.css wiki/htdocs/modern/css/common.css wiki/htdocs/modern/css/msie.css wiki/htdocs/modern/css/screen.css wiki/htdocs/rightsidebar/css/common.css wiki/htdocs/rightsidebar/css/msie.css wiki/htdocs/rightsidebar/css/screen.css
diffstat 11 files changed, 180 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Sun Oct 22 00:31:27 2006 +0200
+++ b/MoinMoin/theme/__init__.py	Sun Oct 22 03:28:33 2006 +0200
@@ -617,7 +617,7 @@
             html.append(link % (self.stylesheetsCharset, media, csshref))
 
 
-        # tribute to the most sucking browser...
+        # tribute to the most sucking browser: MS IE6
         if self.cfg.hacks.get('ie7', False) and self.request.action != 'edit':
             # using FCKeditor and IE7 at the same time makes nices crashes in IE
             html.append("""
@@ -627,6 +627,14 @@
 <![endif]-->
 """ % prefix)
 
+        csshref = '%s/%s/css/msie.css' % (prefix, self.name)
+        html.append("""
+<!-- css only for MSIE browsers -->
+<!--[if IE]>
+   %s
+<![endif]-->
+""" % link % (self.stylesheetsCharset, 'all', csshref))
+
         # Add user css url (assuming that user css uses same charset)
         if usercss and usercss.lower() != "none":
             html.append(link % (self.stylesheetsCharset, 'all', usercss))
--- a/docs/CHANGES	Sun Oct 22 00:31:27 2006 +0200
+++ b/docs/CHANGES	Sun Oct 22 03:28:33 2006 +0200
@@ -368,6 +368,12 @@
     * Made the irssi parser more tolerant (Thanks to "TheAnarcat").
     * Changed the rst parser to be compatible to the new docutils interface
       for directives.
+    * We moved the IE hacks to theme/css/msie.css that gets included after all
+      other css files (but before the user css file) using a conditional
+      comment with "if IE", so it gets only loaded for MSIE (no matter which
+      version). The file has some standard css inside (evaluated on all MSIE
+      versions) and some * html hacks that only IE < 7 will read.
+      HINT: if you use custom themes, you want to update them in the same way.
 
 
 
--- a/wiki/htdocs/classic/css/common.css	Sun Oct 22 00:31:27 2006 +0200
+++ b/wiki/htdocs/classic/css/common.css	Sun Oct 22 03:28:33 2006 +0200
@@ -24,21 +24,6 @@
 a.badinterwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
 a.interwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
 
-/* IE sucks */
-* html a.www { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.http { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.https { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.file { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
-* html a.ftp { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
-* html a.nntp { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
-* html a.news { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
-* html a.telnet { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
-* html a.irc { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
-* html a.mailto { padding-left: 14px; background: url(../img/moin-email.png) left center no-repeat; }
-* html a.attachment { padding-left: 14px; background: url(../img/moin-attach.png) left center no-repeat; }
-* html a.badinterwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
-* html a.interwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
-
 /* Headings */
 
 h1, h2, h3, h4, h5, h6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/htdocs/classic/css/msie.css	Sun Oct 22 03:28:33 2006 +0200
@@ -0,0 +1,55 @@
+/*  msie.css - MoinMoin MS Internet explorer bug workarounds */
+
+/* IE6 and IE7 both suck with :before */
+a.www { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.http { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.https { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.file { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
+a.ftp { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
+a.nntp { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
+a.news { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
+a.telnet { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
+a.irc { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
+a.mailto { padding-left: 14px; background: url(../img/moin-email.png) left center no-repeat; }
+a.attachment { padding-left: 14px; background: url(../img/moin-attach.png) left center no-repeat; }
+a.badinterwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
+a.interwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
+
+#pagetrail li, #pagelocation li {
+    border-left: 1px solid #AAA;
+    padding: 0 0.3em;
+}
+
+/*
+This could maybe avoid screen jumping in IE with IE7 hack.
+
+It works (or rather: should work) like this:
+First, IE sees the a.interwiki definition only as it doesn't understand neither
+* > a.interwiki, nor a.interwiki:before. We use a.interwiki to reserve some
+space for the icon inserted later.
+Later, the IE7 hack kicks in and then IE also understands those 2 other css lines.
+The * > a.interwiki line now removes the space we previously reserved and the
+:before inserts the icon.
+
+a.interwiki {margin-left: 25px; padding-top: 25px; padding-bottom: 25px;}
+* > a.interwiki {margin-left: 0px; padding-top: 25px; padding-bottom: 25px;}
+a.interwiki:before {content: url(../img/moin-inter.png);}
+
+Problem:
+While margin-left seems to work, margin-/padding-top/bottom doesnt.
+After getting it to work, this has to be fine-tuned to avoid screen jumping.
+*/
+
+/* Some * html hacks for IE6 and below only (IE7 ignores * html) */
+
+/* Spans for line-anchors - needed for IE6 where omitting the "display: none" triggers rendering bugs. */
+* html span.anchor { display: none; }
+
+/* IE6 has a bug with rendering of float elements. We workaround this bug by
+ * assigning those elements a height attribute because we currently don't know
+ * a better solution. This results in IE calculating the correct height of the
+ * characters and displaying them correctly. We don't know any negative side
+ * effects of this workaround:
+ */
+* html div#page, * html div#header { height: 0.001%; }
+
--- a/wiki/htdocs/classic/css/screen.css	Sun Oct 22 00:31:27 2006 +0200
+++ b/wiki/htdocs/classic/css/screen.css	Sun Oct 22 03:28:33 2006 +0200
@@ -172,11 +172,6 @@
     content: "";
 }
 
-* html #pagetrail li, * html #pagelocation li { /* for broken IE */
-    border-left: 1px solid #AAA;
-    padding: 0 0.3em;
-}
-
 #pagelocation li:after {
     content: "/ ";
 }
@@ -400,16 +395,3 @@
 	font-weight: bold;
 }
 
-/* Spans for line-anchors - uses * html hack so that the rule only applies to
- * IE (where omitting the "display: none" triggers rendering bugs).
- */
-* html span.anchor { display: none; }
-
-/* IE6 has a bug with rendering of float elements. We workaround this bug by
- * assigning those elements a height attribute because we currently don't know
- * a better solution. This results in IE calculating the correct height of the
- * characters and displaying them correctly. We don't know any negative side
- * effects of this workaround:
- */
-* html div#page, * html div#header { height: 0.001%; }
-
--- a/wiki/htdocs/modern/css/common.css	Sun Oct 22 00:31:27 2006 +0200
+++ b/wiki/htdocs/modern/css/common.css	Sun Oct 22 03:28:33 2006 +0200
@@ -36,41 +36,6 @@
 a.badinterwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
 a.interwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
 
-/* IE sucks */
-* html a.www { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.http { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.https { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.file { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
-* html a.ftp { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
-* html a.nntp { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
-* html a.news { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
-* html a.telnet { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
-* html a.irc { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
-* html a.mailto { padding-left: 14px; background: url(../img/moin-email.png) left center no-repeat; }
-* html a.attachment { padding-left: 14px; background: url(../img/moin-attach.png) left center no-repeat; }
-* html a.badinterwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
-* html a.interwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
-
-/*
-This could maybe avoid screen jumping in IE with IE7 hack.
-
-It works (or rather: should work) like this:
-First, IE sees the a.interwiki definition only as it doesn't understand neither
-* > a.interwiki, nor a.interwiki:before. We use a.interwiki to reserve some
-space for the icon inserted later.
-Later, the IE7 hack kicks in and then IE also understands those 2 other css lines.
-The * > a.interwiki line now removes the space we previously reserved and the
-:before inserts the icon.
-
-a.interwiki {margin-left: 25px; padding-top: 25px; padding-bottom: 25px;}
-* > a.interwiki {margin-left: 0px; padding-top: 25px; padding-bottom: 25px;}
-a.interwiki:before {content: url(../img/moin-inter.png);}
-
-Problem:
-While margin-left seems to work, margin-/padding-top/bottom doesnt.
-After getting it to work, this has to be fine-tuned to avoid screen jumping.
-*/
-
 li p {
 	margin: .25em 0;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/htdocs/modern/css/msie.css	Sun Oct 22 03:28:33 2006 +0200
@@ -0,0 +1,55 @@
+/*  msie.css - MoinMoin MS Internet explorer bug workarounds */
+
+/* IE6 and IE7 both suck with :before */
+a.www { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.http { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.https { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.file { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
+a.ftp { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
+a.nntp { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
+a.news { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
+a.telnet { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
+a.irc { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
+a.mailto { padding-left: 14px; background: url(../img/moin-email.png) left center no-repeat; }
+a.attachment { padding-left: 14px; background: url(../img/moin-attach.png) left center no-repeat; }
+a.badinterwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
+a.interwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
+
+#pagetrail li, #pagelocation li {
+    border-left: 1px solid #AAA;
+    padding: 0 0.3em;
+}
+
+/*
+This could maybe avoid screen jumping in IE with IE7 hack.
+
+It works (or rather: should work) like this:
+First, IE sees the a.interwiki definition only as it doesn't understand neither
+* > a.interwiki, nor a.interwiki:before. We use a.interwiki to reserve some
+space for the icon inserted later.
+Later, the IE7 hack kicks in and then IE also understands those 2 other css lines.
+The * > a.interwiki line now removes the space we previously reserved and the
+:before inserts the icon.
+
+a.interwiki {margin-left: 25px; padding-top: 25px; padding-bottom: 25px;}
+* > a.interwiki {margin-left: 0px; padding-top: 25px; padding-bottom: 25px;}
+a.interwiki:before {content: url(../img/moin-inter.png);}
+
+Problem:
+While margin-left seems to work, margin-/padding-top/bottom doesnt.
+After getting it to work, this has to be fine-tuned to avoid screen jumping.
+*/
+
+/* Some * html hacks for IE6 and below only (IE7 ignores * html) */
+
+/* Spans for line-anchors - needed for IE6 where omitting the "display: none" triggers rendering bugs. */
+* html span.anchor { display: none; }
+
+/* IE6 has a bug with rendering of float elements. We workaround this bug by
+ * assigning those elements a height attribute because we currently don't know
+ * a better solution. This results in IE calculating the correct height of the
+ * characters and displaying them correctly. We don't know any negative side
+ * effects of this workaround:
+ */
+* html div#page, * html div#header { height: 0.001%; }
+
--- a/wiki/htdocs/modern/css/screen.css	Sun Oct 22 00:31:27 2006 +0200
+++ b/wiki/htdocs/modern/css/screen.css	Sun Oct 22 03:28:33 2006 +0200
@@ -185,11 +185,6 @@
     content: "";
 }
 
-* html #pagetrail li, * html #pagelocation li { /* for broken IE */
-    border-left: 1px solid #AAA;
-    padding: 0 0.3em;
-}
-
 #pagelocation li:after {
     content: "/ ";
 }
@@ -463,16 +458,3 @@
 }
         
 
-/* Spans for line-anchors - uses * html hack so that the rule only applies to
- * IE (where omitting the "display: none" triggers rendering bugs).
- */
-* html span.anchor { display: none; }
-
-/* IE6 has a bug with rendering of float elements. We workaround this bug by
- * assigning those elements a height attribute because we currently don't know
- * a better solution. This results in IE calculating the correct height of the
- * characters and displaying them correctly. We don't know any negative side
- * effects of this workaround:
- */
-* html div#page, * html div#header { height: 0.001%; }
-
--- a/wiki/htdocs/rightsidebar/css/common.css	Sun Oct 22 00:31:27 2006 +0200
+++ b/wiki/htdocs/rightsidebar/css/common.css	Sun Oct 22 03:28:33 2006 +0200
@@ -33,21 +33,6 @@
 a.badinterwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
 a.interwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
 
-/* IE sucks */
-* html a.www { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.http { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.https { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
-* html a.file { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
-* html a.ftp { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
-* html a.nntp { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
-* html a.news { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
-* html a.telnet { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
-* html a.irc { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
-* html a.mailto { padding-left: 14px; background: url(../img/moin-email.png) left center no-repeat; }
-* html a.attachment { padding-left: 14px; background: url(../img/moin-attach.png) left center no-repeat; }
-* html a.badinterwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
-* html a.interwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
-
 
 /* Headings */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/htdocs/rightsidebar/css/msie.css	Sun Oct 22 03:28:33 2006 +0200
@@ -0,0 +1,55 @@
+/*  msie.css - MoinMoin MS Internet explorer bug workarounds */
+
+/* IE6 and IE7 both suck with :before */
+a.www { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.http { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.https { padding-left: 14px; background: url(../img/moin-www.png) left center no-repeat; }
+a.file { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
+a.ftp { padding-left: 14px; background: url(../img/moin-ftp.png) left center no-repeat; }
+a.nntp { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
+a.news { padding-left: 14px; background: url(../img/moin-news.png) left center no-repeat; }
+a.telnet { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
+a.irc { padding-left: 14px; background: url(../img/moin-telnet.png) left center no-repeat; }
+a.mailto { padding-left: 14px; background: url(../img/moin-email.png) left center no-repeat; }
+a.attachment { padding-left: 14px; background: url(../img/moin-attach.png) left center no-repeat; }
+a.badinterwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
+a.interwiki { padding-left: 14px; background: url(../img/moin-inter.png) left center no-repeat; }
+
+#pagetrail li, #pagelocation li {
+    border-left: 1px solid #AAA;
+    padding: 0 0.3em;
+}
+
+/*
+This could maybe avoid screen jumping in IE with IE7 hack.
+
+It works (or rather: should work) like this:
+First, IE sees the a.interwiki definition only as it doesn't understand neither
+* > a.interwiki, nor a.interwiki:before. We use a.interwiki to reserve some
+space for the icon inserted later.
+Later, the IE7 hack kicks in and then IE also understands those 2 other css lines.
+The * > a.interwiki line now removes the space we previously reserved and the
+:before inserts the icon.
+
+a.interwiki {margin-left: 25px; padding-top: 25px; padding-bottom: 25px;}
+* > a.interwiki {margin-left: 0px; padding-top: 25px; padding-bottom: 25px;}
+a.interwiki:before {content: url(../img/moin-inter.png);}
+
+Problem:
+While margin-left seems to work, margin-/padding-top/bottom doesnt.
+After getting it to work, this has to be fine-tuned to avoid screen jumping.
+*/
+
+/* Some * html hacks for IE6 and below only (IE7 ignores * html) */
+
+/* Spans for line-anchors - needed for IE6 where omitting the "display: none" triggers rendering bugs. */
+* html span.anchor { display: none; }
+
+/* IE6 has a bug with rendering of float elements. We workaround this bug by
+ * assigning those elements a height attribute because we currently don't know
+ * a better solution. This results in IE calculating the correct height of the
+ * characters and displaying them correctly. We don't know any negative side
+ * effects of this workaround:
+ */
+* html div#page, * html div#header { height: 0.001%; }
+
--- a/wiki/htdocs/rightsidebar/css/screen.css	Sun Oct 22 00:31:27 2006 +0200
+++ b/wiki/htdocs/rightsidebar/css/screen.css	Sun Oct 22 03:28:33 2006 +0200
@@ -216,11 +216,6 @@
     content: "";
 }
 
-* html #pagetrail li, * html #pagelocation li { /* for broken IE */
-    border-left: 1px solid #AAA;
-    padding: 0 0.3em;
-}
-
 #pagelocation li:after {
     content: "/ ";
 }
@@ -352,16 +347,3 @@
 	font-weight: bold;
 }
 
-/* Spans for line-anchors - uses * html hack so that the rule only applies to
- * IE (where omitting the "display: none" triggers rendering bugs).
- */
-* html span.anchor { display: none; }
-
-/* IE6 has a bug with rendering of float elements. We workaround this bug by
- * assigning those elements a height attribute because we currently don't know
- * a better solution. This results in IE calculating the correct height of the
- * characters and displaying them correctly. We don't know any negative side
- * effects of this workaround:
- */
-* html div#page, * html div#header { height: 0.001%; }
-