2002-07-12 00:59:03 +04:00
|
|
|
// Error url MUST be formatted like this:
|
|
|
|
// chrome://neterror.xhtml?e=error&u=url&d=desc
|
|
|
|
|
|
|
|
function getErrorCode()
|
|
|
|
{
|
|
|
|
url = document.location.href;
|
|
|
|
error = url.search(/e\=/);
|
|
|
|
duffUrl = url.search(/\&u\=/);
|
2003-12-04 00:41:37 +03:00
|
|
|
return decodeURIComponent(url.slice(error + 2, duffUrl));
|
2002-07-12 00:59:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
function getDuffUrl()
|
|
|
|
{
|
|
|
|
url = document.location.href;
|
|
|
|
duffUrl = url.search(/u\=/);
|
|
|
|
desc = url.search(/\&d\=/);
|
2003-12-04 00:41:37 +03:00
|
|
|
return decodeURIComponent(url.slice(duffUrl + 2, desc));
|
2002-07-12 00:59:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
function getDescription()
|
|
|
|
{
|
|
|
|
url = document.location.href;
|
|
|
|
desc = url.search(/d\=/);
|
2003-12-04 00:41:37 +03:00
|
|
|
return decodeURIComponent(url.slice(desc + 2));
|
2002-07-12 00:59:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
function retryThis()
|
|
|
|
{
|
|
|
|
var duffUrl = getDuffUrl();
|
|
|
|
document.location.href = duffUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
function fillIn()
|
|
|
|
{
|
|
|
|
var err = getErrorCode();
|
|
|
|
var duffUrl = getDuffUrl();
|
|
|
|
var i;
|
|
|
|
|
|
|
|
// Fill in the title
|
2003-01-09 21:17:04 +03:00
|
|
|
var et = document.getElementById("et_" + err);
|
|
|
|
if (et) {
|
|
|
|
et.className = "et_visible";
|
|
|
|
}
|
2002-07-12 00:59:03 +04:00
|
|
|
|
|
|
|
|
|
|
|
// for (i = 0; i < t.childNodes.length; i++)
|
|
|
|
// {
|
|
|
|
// var n = t.childNodes.item(i);
|
|
|
|
// if (n.nodeType == Node.TEXT_NODE)
|
|
|
|
// {
|
|
|
|
// n.nodeValue = titleText;
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Fill in the short description
|
|
|
|
var sd = document.getElementById("shortDesc");
|
|
|
|
for (i = 0; i < sd.childNodes.length; i++)
|
|
|
|
{
|
|
|
|
var n = sd.childNodes.item(i);
|
|
|
|
if (n.nodeType == Node.TEXT_NODE)
|
|
|
|
{
|
|
|
|
n.nodeValue = getDescription();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Long description
|
2003-01-09 21:17:04 +03:00
|
|
|
var ld = document.getElementById("ld_" + err);
|
|
|
|
if (ld) {
|
|
|
|
ld.className = "ld_visible";
|
|
|
|
}
|
2002-07-12 00:59:03 +04:00
|
|
|
}
|