gecko-dev/docshell/resources/content/netError.xhtml

245 строки
7.2 KiB
HTML
Исходник Обычный вид История

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://global/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Adam Lock <adamlock@netscape.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&loadError.label;</title>
<style><![CDATA[
body {
font: message-box;
}
div.invisible {
display: none;
}
div.et_visible {
margin-top: 2em;
margin-bottom: 1em;
font-size: large;
text-align: start;
font-weight: bold;
color: #5D616E;
}
div#shortDesc {
width: 90%;
text-align: justify;
margin-left: 5%;
margin-right: 5%;
}
div#longDesc {
width: 90%;
text-align: justify;
margin-left: 5%;
margin-right: 5%;
}
div.ld_visible {
display: block;
background-color: #CEE0FF;
}
]]></style>
</head>
<body style="font: message-box;" dir="&locale.dir;">
<!-- ERROR TITLE -->
<div id="errorTitle">
<div id="et_malformedURI" class="invisible">
<p>&malformedURI.title;</p>
</div>
<div id="et_fileNotFound" class="invisible">
<p>&fileNotFound.title;</p>
</div>
<div id="et_dnsNotFound" class="invisible">
<p>&dnsNotFound.title;</p>
</div>
<div id="et_protocolNotFound" class="invisible">
<p>&protocolNotFound.title;</p>
</div>
<div id="et_connectionFailure" class="invisible">
<p>&connectionFailure.title;</p>
</div>
<div id="et_netTimeout" class="invisible">
<p>&netTimeout.title;</p>
</div>
<div id="et_redirectLoop" class="invisible">
<p>&redirectLoop.title;</p>
</div>
<div id="et_unknownSocketType" class="invisible">
<p>&unknownSocketType.title;</p>
</div>
<div id="et_netReset" class="invisible">
<p>&netReset.title;</p>
</div>
<div id="et_netOffline" class="invisible">
<p>&netOffline.title;</p>
</div>
</div>
<!-- SHORT DESCRIPTION -->
<div id="shortDesc">
<p id="sd"> </p>
</div>
<!-- LONG DESCRIPTION -->
<div id="longDesc">
<div id="ld_malformedURI" class="invisible">
<p>&malformedURI.longDesc;</p>
</div>
<div id="ld_fileNotFound" class="invisible">
<p>&fileNotFound.longDesc;</p>
</div>
<div id="ld_dnsNotFound" class="invisible">
<p>&dnsNotFound.longDesc;</p>
</div>
<div id="ld_protocolNotFound" class="invisible">
<p>&protocolNotFound.longDesc;</p>
</div>
<div id="ld_connectionFailure" class="invisible">
<p>&connectionFailure.longDesc;</p>
</div>
<div id="ld_netTimeout" class="invisible">
<p>&netTimeout.longDesc;</p>
</div>
<div id="ld_redirectLoop" class="invisible">
<p>&redirectLoop.longDesc;</p>
</div>
<div id="ld_unknownSocketType" class="invisible">
<p>&unknownSocketType.longDesc;</p>
</div>
<div id="ld_netReset" class="invisible">
<p>&netReset.longDesc;</p>
</div>
<div id="ld_netOffline" class="invisible">
<p>&netOffline.longDesc;</p>
</div>
</div>
<p><input type="button" value="&retry.label;" id="retry" onclick="retryThis();"/></p>
<script type="application/x-javascript"><![CDATA[
// Error url MUST be formatted like this:
// moz-neterror:page?e=error&u=url&d=desc
// Note that this file uses document.documentURI to get
// the URL (with the format from above). This is because
// document.location.href gets the current URI off the docshell,
// which is the URL displayed in the location bar, i.e.
// the URI that the user attempted to load.
function getErrorCode()
{
var url = document.documentURI;
var error = url.search(/e\=/);
var duffUrl = url.search(/\&u\=/);
return decodeURIComponent(url.slice(error + 2, duffUrl));
}
function getDuffUrl()
{
var url = document.documentURI;
var duffUrl = url.search(/u\=/);
var desc = url.search(/\&d\=/);
return decodeURIComponent(url.slice(duffUrl + 2, desc));
}
function getDescription()
{
var url = document.documentURI;
var desc = url.search(/d\=/);
return decodeURIComponent(url.slice(desc + 2));
}
function retryThis()
{
// Session history has the URL of the page that failed
// to load, not the one of the error page. So, just call
// reload(), which will also repost POST data correctly.
location.reload();
}
// Note: It is important to run this code inline, instead of using
// an onload handler. This is because error pages are loaded as
// LOAD_BACKGROUND, which means that onload handlers will not be executed.
var err = getErrorCode();
var duffUrl = getDuffUrl();
var i;
// Fill in the title
var et = document.getElementById("et_" + err);
if (et) {
et.className = "et_visible";
}
// 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
var ld = document.getElementById("ld_" + err);
if (ld) {
ld.className = "ld_visible";
}
]]></script>
</body>
</html>