home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-mac-0.9.sea.hqx / mozilla-mac-0.9 / res / samples / skindemo.xul < prev    next >
Extensible Markup Language  |  2001-05-05  |  1KB  |  50 lines

  1. <?xml version="1.0"?> 
  2.  
  3.  
  4. <!DOCTYPE window> 
  5.  
  6. <window xmlns:html="http://www.w3.org/1999/xhtml"
  7.           xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  8.  
  9. <script>
  10. function applySkin(url)
  11. {
  12.    dump("Retrieving data source.\n");
  13.    var ds = document.rdf.GetDataSource("rdf:chrome");
  14.    
  15.    dump("Getting the source.\n");
  16.    var s = document.rdf.GetResource("chrome://navigator/skin/navigator.css");
  17.    
  18.    dump("Getting the property.\n");
  19.    var p = document.rdf.GetResource("http://chrome.mozilla.org/rdf#main");
  20.    
  21.    dump("Getting the original target.\n");
  22.    var originalTarget = ds.GetTarget(s, p, true);
  23.  
  24.    dump("Doing the unassert.\n");
  25.    ds.Unassert(s, p, originalTarget);
  26.  
  27.    dump("Getting the literal.\n");
  28.    var newTarget = document.rdf.GetLiteral(url);
  29.  
  30.    dump("Doing the assert.\n");
  31.    ds.Assert(s, p, newTarget, true);
  32.  
  33.    dump("Saving the chrome to disk.\n");
  34.    ds.Flush();
  35.  
  36.    dump("Done. Open a new window to see the chrome.\n");
  37. }
  38. </script>
  39.  
  40. <html:button onclick="applySkin('navigator-mozillazine0.css')">
  41.   Click to switch to MozillaZine skin.
  42. </html:button>
  43.  
  44. <html:button onclick="applySkin('navigator.css')">
  45.   Click to switch to default skin.
  46. </html:button>
  47.  
  48.  
  49. </window>
  50.