| Japanese |


Let's make the button which the Skin is changed to.
(With the extra of the Sidebar switching button :-)




To simplify it. Change the only
chrome/packages/core/navigator/content/navigator.xul


 
 
First,
Of the 250th line neighborhood 


    In the front of 

        <box class="box-toolbar-group" flex="1">
        
    Paste the following code. 
        
        <button class="button-toolbar-1 top" id="sidebar-button" 
                crop="right" observes="canSidebar" 
                onclick="SidebarShowHide()" value="sidebar" 
                tooltiptext="sidebar"/>
 
        <button class="button-toolbar-1 top" id="sidebar-button" 
                crop="right" observes="canSkin" 
                onclick="swtSkin()" value="skin" 
                tooltiptext="skin"/>
         
          
Next,
Of the 69th line neighborhood 

     In the front of 
    
         <!-- UI services -->
         
     Paste the following code. 
    
         <script language="javascript">

         /*
          * swtSkin testing 
          */

         try {
           var chromeRegistry = Components.classes["component://netscape/chrome/chrome-registry"].getService();
           if ( chromeRegistry )
             chromeRegistry = chromeRegistry.QueryInterface( Components.interfaces.nsIChromeRegistry );
         } catch(e) {
         }
         function changeSkin(skinName){

           chromeRegistry.selectSkin( skinName, true ); 
           chromeRegistry.refreshSkins();

         }  
         function swtSkin(){
  
           if(window.skin_flg)changeSkin('modern/1.0')
           else               changeSkin('classic/1.0')

           window.skin_flg = !window.skin_flg;
         }

         </script>
         
        
        for download (navigator.xul)/M17 2000062210
        It is changed to the name of /navigator.xul 
        The name of original navigator.xul, is changed to navigatorold.xul, it is good, too .
        


          
Incidentally,

        
     If you want to switch the Sidebar by onKyepress...
        
     In the front of 
    
        <!-- keys are appended from the overlay -->
         
     Paste the following code. 
        
        <keyset id="myKey1">
          <key id="sidebar" key="b" control="true"
               onkeypress="SidebarShowHide()" />
        </keyset>

        You can swich the sidebsr onKyepress [ Ctrl + b ] .
        by the way  key="s" is [ Ctrl + s ] .

        
Thanx for chrome/packages/core/communicator/pref/pref-themes.js
Toshirou Takahashi tato@fureai.or.jp
MDSProject(Mozilla's DOM Sample Project)
NewGameWeb