Bug 1009370 - Part 3: Cleanup aboutPrivateBrowsing.xhtml. r=Unfocused

This commit is contained in:
Birunthan Mohanathas 2014-08-26 07:11:11 -07:00
parent c512844c89
commit cd08f93eda
2 changed files with 29 additions and 55 deletions

View File

@ -15,6 +15,11 @@ body {
justify-content: center;
}
body.normal .showPrivate,
body.private .showNormal {
display: none;
}
#pageContainer {
min-width: 320px;
max-width: 512px;

View File

@ -20,17 +20,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="chrome://browser/content/aboutPrivateBrowsing.css" type="text/css" media="all"/>
<style type="text/css"><![CDATA[
body.normal .showPrivate,
body.private .showNormal {
display: none;
}
]]></style>
<script type="application/javascript;version=1.7"><![CDATA[
const Cc = Components.classes;
const Ci = Components.interfaces;
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
document.title = "]]>&aboutPrivateBrowsing.title.normal;<![CDATA[";
@ -64,12 +57,13 @@
}
// Set up the help link
let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
getService(Ci.nsIURLFormatter).
formatURLPref("app.support.baseURL");
let moreInfoLink = document.getElementById("moreInfoLink");
if (moreInfoLink)
moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");
let learnMoreURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Ci.nsIURLFormatter)
.formatURLPref("app.support.baseURL");
let learnMore = document.getElementById("learnMore");
if (learnMore) {
learnMore.setAttribute("href", learnMoreURL + "private-browsing");
}
}, false);
function openPrivateWindow() {
@ -78,52 +72,27 @@
]]></script>
</head>
<body dir="&locale.dir;"
class="private">
<!-- PAGE CONTAINER (for styling purposes only) -->
<body dir="&locale.dir;" class="private">
<div id="pageContainer">
<h1 class="titleText showPrivate">&aboutPrivateBrowsing.title;</h1>
<h1 class="titleText showNormal">&aboutPrivateBrowsing.title.normal;</h1>
<!-- Error Title -->
<div id="errorTitle">
<h1 class="titleText showPrivate">&aboutPrivateBrowsing.title;</h1>
<h1 class="titleText showNormal">&aboutPrivateBrowsing.title.normal;</h1>
</div>
<p class="showPrivate">&aboutPrivateBrowsing.subtitle;</p>
<p class="showNormal">&aboutPrivateBrowsing.subtitle.normal;</p>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<p>&aboutPrivateBrowsing.description;</p>
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" class="showPrivate">&aboutPrivateBrowsing.subtitle;</p>
<p id="errorShortDescTextNormal" class="showNormal">&aboutPrivateBrowsing.subtitle.normal;</p>
</div>
<p class="showNormal">&aboutPrivateBrowsing.notPrivate;</p>
<!-- Long Description -->
<div id="errorLongDesc">
<p id="errorLongDescText">&aboutPrivateBrowsing.description;</p>
</div>
<p class="showNormal">&aboutPrivateBrowsing.notPrivate;</p>
<!-- Start Private Browsing -->
<button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="startPrivateBrowsing" class="showNormal"
label="&privatebrowsingpage.openPrivateWindow.label;"
accesskey="&privatebrowsingpage.openPrivateWindow.accesskey;"
oncommand="openPrivateWindow();"/>
<!-- More Info -->
<div id="moreInfo" class="showPrivate">
<p id="moreInfoText">
&aboutPrivateBrowsing.moreInfo;
</p>
<p id="moreInfoLinkContainer">
<a id="moreInfoLink" target="_blank">&aboutPrivateBrowsing.learnMore;</a>
</p>
</div>
<button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="showNormal"
label="&privatebrowsingpage.openPrivateWindow.label;"
accesskey="&privatebrowsingpage.openPrivateWindow.accesskey;"
oncommand="openPrivateWindow();"/>
<div class="showPrivate">
<p>&aboutPrivateBrowsing.moreInfo;</p>
<p><a id="learnMore" target="_blank">&aboutPrivateBrowsing.learnMore;</a></p>
</div>
</div>
</body>
</html>