POV-Ray : Newsgroups : povray.documentation.inbuilt : [win] css files in location other root dir Server Time
26 Apr 2024 14:10:32 EDT (-0400)
  [win] css files in location other root dir (Message 1 to 1 of 1)  
From: Pabs
Subject: [win] css files in location other root dir
Date: 27 Mar 2002 02:57:53
Message: <3CA17A01.25CF241D@NOzipSPAM.THANKtoYOU>
The little script below can be used to link to files external to a chm
using _relative_ paths & together with the document.createStyleSheet
function can be used to setup links to css files in the same dir as the
chm.
This will allow those who can't write to their root dir to use custom
styles.
However this means that JavaScript has to be on to use custom styles.

Just wondering what people think of the idea & whether or not anyone
uses the current root dir system.

It is used like so document.createStyleSheet(externlink('povray35.css'))

function externlink(file,changeloc) {
  var X, sl, ra, link, oldproto, newproto, path;
  ra = /:/;
  oldproto = location.href.substring(0,location.href.search(ra));
  if(oldproto=="mk"){
    //"mk:@MSITStore:"
    X=14;
    sl="\\";
    newproto="file:///";
  } else if(oldproto=="ms-its"){
    X=7;
    sl="\\";
    newproto="file:///";
  } else if(oldproto=="http"||oldproto=="file"){
    X=7;
    sl="/";
    newproto=oldproto+"://";
  }
  link = newproto + location.href.substring(X,
location.href.lastIndexOf(sl) + 1) + file;
  if(changeloc)
    location.href = link;
  return link;
}


<plug type=shameless>It is also used in docs for the new beta of frhed -
http://www.kibria.de/frhed.html</>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.