W3C home > Mailing lists > Public > public-css-commits@w3.org > October 2011

csswg/css3-regions Overview.html,1.27,1.28 Overview.src.html,1.29,1.30 style-toggle.js,1.4,1.5

From: Vincent Hardy via cvs-syncmail <cvsmail@w3.org>
Date: Sat, 29 Oct 2011 01:02:30 +0000
To: public-css-commits@w3.org
Message-Id: <E1RJxJe-0000DN-IO@lionel-hutz.w3.org>
Update of /sources/public/csswg/css3-regions
In directory hutz:/tmp/cvs-serv811

Modified Files:
	Overview.html Overview.src.html style-toggle.js 
Log Message:
Made style toggle work on FF/WebKit/Opera

Index: style-toggle.js
===================================================================
RCS file: /sources/public/csswg/css3-regions/style-toggle.js,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- style-toggle.js	27 Oct 2011 01:43:23 -0000	1.4
+++ style-toggle.js	29 Oct 2011 01:02:28 -0000	1.5
@@ -2,16 +2,17 @@
     var defaultStyleText = 'default spec. style';
     var additionalStyleText = "additional spec. style";
     var toggle;
-
-
+    
     function toggleStyle() {
         var st = document.getElementById('st');
 
         if (st.hasAttribute('disabled') === true) {
             st.removeAttribute('disabled');
+            st.disabled = false;
             toggle.textContent = defaultStyleText;
         } else {
             st.setAttribute('disabled', 'true');
+            st.disabled = true;
             toggle.textContent = additionalStyleText;
         }
     }
@@ -21,10 +22,6 @@
         var divHead = document.getElementById('div-head');
         var defaultText = additionalStyleText;
         
-        if (st.hasAttribute('disabled') === false) {
-            defaultText = defaultStyleText;
-        }
-        
         toggle = document.createElement('a');
 
 		divHead.insertBefore(toggle, divHead.firstChild);

Index: Overview.html
===================================================================
RCS file: /sources/public/csswg/css3-regions/Overview.html,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- Overview.html	29 Oct 2011 00:23:06 -0000	1.27
+++ Overview.html	29 Oct 2011 01:02:28 -0000	1.28
@@ -9,11 +9,17 @@
   <link href=default.css rel=stylesheet type="text/css">
   <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
   type="text/css">
-  <link disabled href=alternate-spec-style.css id=st rel=stylesheet
-  title="additional spec styles" type="text/css">
+  <link disabled href=alternate-spec-style.css id=st
+  rel="alternate stylesheet" title="additional spec styles" type="text/css">
   <script src=style-toggle.js type="text/javascript"></script>
 
   <style type="text/css">
+  
+  /* Alternate stylesheet fonts are here because in some browsers (Opera 11.5) */
+  /* The fonts are not applied if only loaded from the alternate stylesheet    */
+  @import url(http://fonts.googleapis.com/css?family=Droid+Serif:700,400,400italic,700italic);
+  @import url(http://fonts.googleapis.com/css?family=Droid+Sans+Mono);
+
          a.toggle {
              position: fixed;
              top: 0.5em;

Index: Overview.src.html
===================================================================
RCS file: /sources/public/csswg/css3-regions/Overview.src.html,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- Overview.src.html	29 Oct 2011 00:23:06 -0000	1.29
+++ Overview.src.html	29 Oct 2011 01:02:28 -0000	1.30
@@ -8,12 +8,18 @@
   <link rel="stylesheet" type="text/css"
         href="http://www.w3.org/StyleSheets/TR/W3C-ED.css">
 
- <link id="st" href="alternate-spec-style.css" rel="stylesheet" 
+ <link id="st" href="alternate-spec-style.css" rel="alternate stylesheet" 
        type="text/css" disabled title="additional spec styles">
 
              <script type="text/javascript" src="style-toggle.js"></script>
 
        <style type="text/css">
+  
+  /* Alternate stylesheet fonts are here because in some browsers (Opera 11.5) */
+  /* The fonts are not applied if only loaded from the alternate stylesheet    */
+  @import url(http://fonts.googleapis.com/css?family=Droid+Serif:700,400,400italic,700italic);
+  @import url(http://fonts.googleapis.com/css?family=Droid+Sans+Mono);
+
          a.toggle {
              position: fixed;
              top: 0.5em;
Received on Saturday, 29 October 2011 01:02:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 29 October 2011 01:02:32 GMT