forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyriaque Dupoirieux <Cyriaque.Dupoiri...@pcotech.fr>
Subject Re: dynamic theme switcher
Date Mon, 07 Nov 2005 08:46:41 GMT
Kevin a écrit :

>Sorry Thorsten I got side tracked by prototype.js :)
>
>I'm looking at using branding-theme-switcher.ft to switch <DEFANGED_link> css
>only. A corner image solution until corner image in  <!-- <DEFANGED_STYLE> css
are
>crawled. 
>
>On Fri, 2005-11-04 at 01:45 +0100, Thorsten Scherler wrote: 
>  
>
>>El mar, 01-11-2005 a las 18:32 +0000, Kevin escribió:
>>    
>>
>>>If two style sheets are needed to define the complete layout I
>>>think they both need to be rel="alternate stylesheet" and have the
>>>same title. If the idea is to have a common css "pelt.basic.css".
>>>This is made persistant with rel="stylesheet" and no title 
>>>      
>>>
>>How would the switch to the default.css (future common.css) work?
>>    
>>
>
>My thoughts are:
>
>branding-theme-switcher-profiler="false" needed a patch attached
>
>If branding-theme-switcher-defaultTheme="Pelt"
>In view file have (<forrest:css ...) entries like below:
>
>url="pelt.basic.css"
>  rel="stylesheet"
>(persistent | common - Is disabled=true allowed here?)
>
>url="pelt.screen.css"
>  rel="stylesheet" theme="Pelt"
>(preferred | default - Is disabled=true allowed here?)
>
>url="pelt.screen.css"
>  rel="alternate stylesheet" theme="Pelt-Default"
>(switchable back to default)
>
>url="pelt.forrest.css"
>  rel="alternate stylesheet" theme="Pelt-Forrest"
>(switchable)
>
>url="pelt.collabnet.css"
>  rel="alternate stylesheet" theme="Pelt-Collabnet"
>(switchable)
>
>url="default.css"
>  rel="alternate stylesheet" theme="default"
>url="leather-dev.css"
>  rel="alternate stylesheet" theme="default"
>(one switchable as both have same title)
>
>IMO default.css and leather-dev.css could be combined together as
>leather.screen.css (leather-dev.css turns off - "display: none;"
>Pelt specific layout/structure). Is it default.css or common.css or
>just another switchable?
>  
>
I agree that default is not a good name because it seems clear that this 
css has been writen for leather-dev.
But I don't think it's a good idea to merge default.css and 
leather-dev.css because the first one should be the one used by the 
leather theme. (The idea is to try to be close the 
http://www.csszengarden.com/ site) and the second one - as you said - is 
to disable the specificity of pelt theme which must not disturb the 
leather-dev theme...

Salutations,
Cyriaque,

>url="leather.screen.css"
>  rel="alternate stylesheet" theme="Leather-Default"
>(switchable)
>
>url="leather.hot.css"
>  rel="alternate stylesheet" theme="Leather-Hot"
>(switchable)
>
>etc.
>
>If branding-theme-switcher-defaultTheme="default"?
>Hmmm I'll look closer at the script to understand this if
>idea above is correct.
>
>I understand if branding-theme-switcher-profiler="true"
> <!-- <DEFANGED_STYLE> css with the same title as <DEFANGED_link> css will
have
>disabled set false IMO only when rel="alternate stylesheet"
>and disabled set true for other rel="alternate stylesheet".
>
>Is disabled=true allowed here? Was a comment next to
>persistent and preferred css above. Would all browsers
>allow it? The script works great just trying to understand.
>
>Kevin
>
>  
>
>>You did unset all rel="alternate stylesheet" via requesting a "" title
>>but not the rel="stylesheet". Would that not interfere with e.g.
>>default.css? 
>>
>>    
>>
>>>and then
>>>a  <!-- <DEFANGED_STYLE rel="alternate stylesheet" title="Pelt-Collabnet"
...>
>>>choice would be aggregated. 
>>>      
>>>
>> 
>>see above. If it is possible to have default.css working with
>>rel="stylesheet" approach I will happily apply it. ;-)
>>    
>>
>>------------------------------------------------------------------------
>>
>>--- cssStyleSwitcher.js.orig	2005-11-03 16:50:44.000000000 +0000
>>+++ cssStyleSwitcher.js	2005-11-04 17:59:02.815917976 +0000
>>@@ -20,7 +20,7 @@
>> *
>> * cssStyleSwitcher.js
>> */
>>-var THEME_SWITCHER_PROFILING=false;
>>+var THEME_SWITCHER_PROFILING="false";
>> var THEME_SWITCHER_DEFAULT_THEME="";
>> function switchTheme(title){
>>   var linkElements= document.getElementsByTagName("link"); // get all linked objects
>>@@ -37,7 +37,7 @@
>>     if (a.getAttribute("media") == "screen" ) {
>> /* theme profiling will only change a couple of stylesheets so we need to include
>>     the default theme on which the profiling is based on*/
>>-      if (THEME_SWITCHER_PROFILING){
>>+      if (THEME_SWITCHER_PROFILING != "false"){
>>         if(title.lastIndexOf(THEME_SWITCHER_DEFAULT_THEME)>-1){
>>           var profiled = (a.getAttribute("title") == THEME_SWITCHER_DEFAULT_THEME
|| a.getAttribute("title") == title)?true:false;
>>           a.disabled = (profiled)?false:true;
>>@@ -49,6 +49,7 @@
>>       }
>>     }
>>   }
>>+if (THEME_SWITCHER_PROFILING != "false"){
>>   var styleElements= document.getElementsByTagName("style");// get all inline style
objects
>>   for(var i = 0; i  <!-- <DEFANGED_STYLEElements.length; i++) {
>>     var a = styleElements[i];
>>@@ -63,18 +64,15 @@
>>     if (a.getAttribute("media") == "screen" ) {
>> /* theme profiling will only change a couple of stylesheets so we need to include
>>     the default theme on which the profiling is based on*/
>>-      if (THEME_SWITCHER_PROFILING){
>>         if(title.lastIndexOf(THEME_SWITCHER_DEFAULT_THEME)>-1){
>>           var profiled = (a.getAttribute("title") == THEME_SWITCHER_DEFAULT_THEME
|| a.getAttribute("title") == title)?true:false;
>>           a.disabled = (profiled)?false:true;
>>         }else{
>>           a.disabled = (a.getAttribute("title") == title)?false:true;
>>         }
>>-      }else{
>>-        a.disabled = (a.getAttribute("title") == title)?false:true;
>>-      }
>>     }
>>   }
>>+}
>>   createCookie("style", title, 365);
>> } // end method switchTheme(title)
>> /* change the active (preferred) stylesheet to the selected one and save it */
>>@@ -128,6 +126,7 @@
>>       }
>>     }
>>   }
>>+if (THEME_SWITCHER_PROFILING != "false"){
>>   var styleElements= document.getElementsByTagName("style");
>>   for(var i = 0; i  <!-- <DEFANGED_STYLEElements.length; i++) {
>>     var a = styleElements[i];
>>@@ -146,6 +145,7 @@
>>       }
>>     }
>>   }
>>+}
>>   return themes;
>> }
>> 
>>    
>>

Mime
View raw message