зеркало из https://github.com/mozilla/pjs.git
Bug 302729 attachment 192114, netError.dtd entities can't be formatted prettily, r=cbiesinger, sr=darin
This commit is contained in:
Родитель
6e23b199ec
Коммит
9a0d5df21d
|
@ -37,6 +37,7 @@
|
|||
- Adam Lock <adamlock@netscape.com>
|
||||
- William R. Price <wrprice@alumni.rice.edu>
|
||||
- Henrik Skupin <mozilla@hskupin.info>
|
||||
- Jeff Walden <jwalden+code@mit.edu>
|
||||
-
|
||||
- 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
|
||||
|
@ -57,45 +58,6 @@
|
|||
<title>&loadError.label;</title>
|
||||
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
|
||||
|
||||
<!-- Include the localized error titles/descriptions -->
|
||||
<script type="application/x-javascript">
|
||||
var errorTitle = {
|
||||
generic: "&generic.title;",
|
||||
dnsNotFound: "&dnsNotFound.title;",
|
||||
fileNotFound: "&fileNotFound.title;",
|
||||
malformedURI: "&malformedURI.title;",
|
||||
protocolNotFound: "&protocolNotFound.title;",
|
||||
connectionFailure: "&connectionFailure.title;",
|
||||
netTimeout: "&netTimeout.title;",
|
||||
redirectLoop: "&redirectLoop.title;",
|
||||
unknownSocketType: "&unknownSocketType.title;",
|
||||
netReset: "&netReset.title;",
|
||||
netOffline: "&netOffline.title;",
|
||||
netInterrupt: "&netInterrupt.title;",
|
||||
deniedPortAccess: "&deniedPortAccess.title;",
|
||||
proxyResolveFailure: "&proxyResolveFailure.title;",
|
||||
proxyConnectFailure: "&proxyConnectFailure.title;"
|
||||
};
|
||||
|
||||
var errorDesc = {
|
||||
generic: "&generic.longDesc;",
|
||||
dnsNotFound: "&dnsNotFound.longDesc;",
|
||||
fileNotFound: "&fileNotFound.longDesc;",
|
||||
malformedURI: "&malformedURI.longDesc;",
|
||||
protocolNotFound: "&protocolNotFound.longDesc;",
|
||||
connectionFailure: "&connectionFailure.longDesc;",
|
||||
netTimeout: "&netTimeout.longDesc;",
|
||||
redirectLoop: "&redirectLoop.longDesc;",
|
||||
unknownSocketType: "&unknownSocketType.longDesc;",
|
||||
netReset: "&netReset.longDesc;",
|
||||
netOffline: "&netOffline.longDesc;",
|
||||
netInterrupt: "&netInterrupt.longDesc;",
|
||||
deniedPortAccess: "&deniedPortAccess.longDesc;",
|
||||
proxyResolveFailure: "&proxyResolveFailure.longDesc;",
|
||||
proxyConnectFailure: "&proxyConnectFailure.longDesc;"
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="application/x-javascript"><![CDATA[
|
||||
// Error url MUST be formatted like this:
|
||||
// moz-neterror:page?e=error&u=url&d=desc
|
||||
|
@ -134,22 +96,27 @@
|
|||
location.reload();
|
||||
}
|
||||
|
||||
function parseFakeTags(instr)
|
||||
{
|
||||
return instr.replace(/\[([^\]]+)\]/g, '<$1>');
|
||||
}
|
||||
|
||||
function initPage()
|
||||
{
|
||||
var err = getErrorCode();
|
||||
|
||||
// Map unknown error codes to generic
|
||||
if (!(err in errorDesc && err in errorTitle))
|
||||
err = "generic";
|
||||
// if it's an unknown error or there's no title or description
|
||||
// defined, get the generic message
|
||||
var errTitle = document.getElementById("et_" + err);
|
||||
var errDesc = document.getElementById("ed_" + err);
|
||||
if (!errTitle || !errDesc)
|
||||
{
|
||||
errTitle = document.getElementById("et_generic");
|
||||
errDesc = document.getElementById("ed_generic");
|
||||
}
|
||||
|
||||
var title = document.getElementById("errorTitleText");
|
||||
if (title)
|
||||
title.textContent = errorTitle[err];
|
||||
{
|
||||
title.parentNode.replaceChild(errTitle, title);
|
||||
// change id to the replaced child's id so styling works
|
||||
errTitle.id = "errorTitleText";
|
||||
}
|
||||
|
||||
var sd = document.getElementById("errorShortDescText");
|
||||
if (sd)
|
||||
|
@ -157,7 +124,15 @@
|
|||
|
||||
var ld = document.getElementById("errorLongDesc");
|
||||
if (ld)
|
||||
ld.innerHTML = parseFakeTags(errorDesc[err]);
|
||||
{
|
||||
ld.parentNode.replaceChild(errDesc, ld);
|
||||
// change id to the replaced child's id so styling works
|
||||
errDesc.id = "errorLongDesc";
|
||||
}
|
||||
|
||||
// remove undisplayed errors to avoid bug 39098
|
||||
var errContainer = document.getElementById("errorContainer");
|
||||
errContainer.parentNode.removeChild(errContainer);
|
||||
|
||||
// Focus the Try Again button. We can't just do this inline because of
|
||||
// bug 232004. We can't use onload (see comment below). Since the
|
||||
|
@ -174,6 +149,44 @@
|
|||
|
||||
<body dir="&locale.dir;">
|
||||
|
||||
<!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
|
||||
<div id="errorContainer">
|
||||
<div id="errorTitlesContainer">
|
||||
<h1 id="et_generic">&generic.title;</h1>
|
||||
<h1 id="et_dnsNotFound">&dnsNotFound.title;</h1>
|
||||
<h1 id="et_fileNotFound">&fileNotFound.title;</h1>
|
||||
<h1 id="et_malformedURI">&malformedURI.title;</h1>
|
||||
<h1 id="et_protocolNotFound">&protocolNotFound.title;</h1>
|
||||
<h1 id="et_connectionFailure">&connectionFailure.title;</h1>
|
||||
<h1 id="et_netTimeout">&netTimeout.title;</h1>
|
||||
<h1 id="et_redirectLoop">&redirectLoop.title;</h1>
|
||||
<h1 id="et_unknownSocketType">&unknownSocketType.title;</h1>
|
||||
<h1 id="et_netReset">&netReset.title;</h1>
|
||||
<h1 id="et_netOffline">&netOffline.title;</h1>
|
||||
<h1 id="et_netInterrupt">&netInterrupt.title;</h1>
|
||||
<h1 id="et_deniedPortAccess">&deniedPortAccess.title;</h1>
|
||||
<h1 id="et_proxyResolveFailure">&proxyResolveFailure.title;</h1>
|
||||
<h1 id="et_proxyConnectFailure">&proxyConnectFailure.title;</h1>
|
||||
</div>
|
||||
<div id="errorDescriptionsContainer">
|
||||
<div id="ed_generic">&generic.longDesc;</div>
|
||||
<div id="ed_dnsNotFound">&dnsNotFound.longDesc;</div>
|
||||
<div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
|
||||
<div id="ed_malformedURI">&malformedURI.longDesc;</div>
|
||||
<div id="ed_protocolNotFound">&protocolNotFound.longDesc;</div>
|
||||
<div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
|
||||
<div id="ed_netTimeout">&netTimeout.longDesc;</div>
|
||||
<div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
|
||||
<div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
|
||||
<div id="ed_netReset">&netReset.longDesc;</div>
|
||||
<div id="ed_netOffline">&netOffline.longDesc;</div>
|
||||
<div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
|
||||
<div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
|
||||
<div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc;</div>
|
||||
<div id="ed_proxyConnectFailure">&proxyConnectFailure.longDesc;</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PAGE CONTAINER (for styling purposes only) -->
|
||||
<div id="errorPageContainer">
|
||||
|
||||
|
|
|
@ -98,3 +98,7 @@ body[dir="rtl"] #brand {
|
|||
#brand > p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#errorContainer {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -98,3 +98,7 @@ body[dir="rtl"] #brand {
|
|||
#brand > p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#errorContainer {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -98,3 +98,7 @@ body[dir="rtl"] #brand {
|
|||
#brand > p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#errorContainer {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
/*
|
||||
* This defines the look-and-feel styling of the error pages.
|
||||
* (see: netError.xhtml)
|
||||
*
|
||||
* Original styling by William Price <bugzilla@mob.rice.edu>
|
||||
* Updated by: Steven Garrity <steven@silverorange.com>
|
||||
* Henrik Skupin <mozilla@hskupin.info>
|
||||
*/
|
||||
|
||||
html {
|
||||
background: -moz-Dialog;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0 1em;
|
||||
color: -moz-FieldText;
|
||||
font: message-box;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 .6em 0;
|
||||
border-bottom: 1px solid ThreeDLightShadow;
|
||||
font-size: 160%;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin: 0;
|
||||
-moz-margin-start: 1.5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul > li, ol > li {
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: square;
|
||||
}
|
||||
|
||||
#errorPageContainer {
|
||||
position: relative;
|
||||
min-width: 13em;
|
||||
max-width: 52em;
|
||||
margin: 4em auto;
|
||||
border: 1px solid ThreeDShadow;
|
||||
-moz-border-radius: 10px;
|
||||
padding: 3em;
|
||||
-moz-padding-start: 30px;
|
||||
background: url("chrome://global/skin/icons/warning-large.png") left 0 no-repeat -moz-Field;
|
||||
-moz-background-origin: content;
|
||||
}
|
||||
|
||||
body[dir="rtl"] #errorPageContainer {
|
||||
background-position: right 0;
|
||||
}
|
||||
|
||||
#errorTitle {
|
||||
-moz-margin-start: 80px;
|
||||
}
|
||||
|
||||
#errorLongContent {
|
||||
-moz-margin-start: 80px;
|
||||
}
|
||||
|
||||
#errorShortDesc > p {
|
||||
border-bottom: 1px solid ThreeDLightShadow;
|
||||
padding-bottom: 1em;
|
||||
font-size: 130%;
|
||||
}
|
||||
|
||||
#errorLongDesc {
|
||||
-moz-padding-end: 3em;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
#errorLongDesc > p {
|
||||
}
|
||||
|
||||
#errorTryAgain {
|
||||
margin-top: 2em;
|
||||
-moz-margin-start: 80px;
|
||||
}
|
||||
|
||||
#brand {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: -1.5em;
|
||||
-moz-margin-end: 10px;
|
||||
opacity: .4;
|
||||
}
|
||||
|
||||
body[dir="rtl"] #brand {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#brand > p {
|
||||
margin: 0;
|
||||
}
|
|
@ -98,3 +98,7 @@ body[dir="rtl"] #brand {
|
|||
#brand > p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#errorContainer {
|
||||
display: none;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче