[haiku] Re: Requesting someone to make a simple javascript page for use with BeZilla builds.

  • From: <mathewblack@xxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Tue, 7 Jul 2009 23:40:53 +0100

Present!

<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en-US" xml:lang="en-US"> 
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="all" />
<title>Welcome to Haiku!</title>
<link rel="stylesheet" type="text/css" href="../Haiku-doc.css" />
<script type="text/javascript">
var xmlhttp;
var offLineWelcomePage = 
'file:///boot/system/documentation/welcome/welcome.html';
var onLineWelcomePage = 
'http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk/docs/welcome/welcome.html';

function redirect()
{

xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=state_Change;
try
{
        xmlhttp.open("GET",offLineWelcomePage);
        xmlhttp.send(null);
}
catch(err)
{

    window.location = onLineWelcomePage;
}
}

function state_Change()
{

if (xmlhttp.readyState==4)
{// 4 = "loaded"
        if (xmlhttp.status==200 ||xmlhttp.status==0)
        {// 200 = "OK"; loading from file:// so no http status set! hence 
status == 0.
                if(xmlhttp.responseText.length != 0)
                    window.location = offLineWelcomePage;
                else
                        window.location = onLineWelcomePage;
        }
        else
        {
                alert("Problem retrieving data:" + xmlhttp.statusText);
        }
}

}
</script>
</head>
<body onload="redirect()">
</body>
</html>


---- Matt Madia <mattmadia@xxxxxxxxx> wrote: 
> Currently BeZillaBrowser's default homepage is
> http://www.mozilla.org/projects/bonecho/ , which redirects to
> http://www.mozilla.com/en-US/firefox/firefox.html
> 
> On HaikuPorts, there is a ticket requesting to have this changed :
> http://ports.haiku-files.org/ticket/160
> 
> Ideally, the default homepage would be the Welcome package.
> However, I do not want to hardcode
> "file:///boot/system/documentation/welcome/welcome.html" as the
> homepage, as it is possible for the Welcome guide to be absent.
> 
> Would anyone be willing to make a very simple html file that can attempt to 
> load
> file:///boot/system/documentation/welcome/welcome.html
>  and upon failure, load
> http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk/docs/welcome/welcome.html
> (the second link is the Browse by HTTP version of Berlios, which i
> find to be an effective fall-back).
> 
> That html file could then be included with BeZillaBrowser|Suite and
> used as the default homepage.
> 
> any takers? :)
> 
> --mmadia
>

Other related posts: