GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 8bc4a886 authored by Kathleen Brade's avatar Kathleen Brade

Bug 29197: Remove use of overlays (ESR68 compatibility).

Use the window.MozXULElement.parseXULToFragment() function to
parse shared XUL.
parent a5ea1ace
......@@ -9,9 +9,7 @@
<?xml-stylesheet href="chrome://torlauncher/skin/network-settings.css"
type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<?xul-overlay href="chrome://torlauncher/content/network-settings-overlay.xul"?>
<!DOCTYPE wizard SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<wizard id="TorLauncherLocalePicker"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
......
<?xml version="1.0"?>
<!--
- Copyright (c) 2018, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<overlay id="TorNetworkSettingsOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
// Copyright (c) 2019, The Tor Project, Inc.
// See LICENSE for licensing information.
//
// vim: set sw=2 sts=2 ts=8 et syntax=javascript:
var proxySettings = `
<vbox id="proxySettings">
<hbox align="center">
<checkbox id="useProxy" groupboxID="proxySpecificSettings"
......@@ -73,20 +66,16 @@
</grid>
</groupbox>
</vbox>
`;
<vbox id="proxyHelpContent">
var proxyHelpContent = `
<vbox id="proxyHelpContent" hidden="true">
<hbox align="middle"><label>&torsettings.proxyHelpTitle;</label></hbox>
<description>&torsettings.proxyHelp1;</description>
</vbox>
`;
<groupbox id="firewallSpecificSettings">
<hbox align="center">
<label value="&torsettings.firewall.allowedPorts;"
control="firewallAllowedPorts"/>
<textbox id="firewallAllowedPorts" value="80,443"/>
</hbox>
</groupbox>
var bridgeSettings = `
<vbox id="bridgeSettings">
<checkbox id="useBridges" groupboxID="bridgeSpecificSettings"
label="&torsettings.useBridges.checkbox;"
......@@ -139,13 +128,17 @@
</vbox>
</groupbox>
</vbox>
`;
<vbox id="bridgeHelpContent">
var bridgeHelpContent = `
<vbox id="bridgeHelpContent" hidden="true">
<hbox align="middle"><label>&torsettings.bridgeHelpTitle;</label></hbox>
<description>&torsettings.bridgeHelp1;</description>
<description>&torsettings.bridgeHelp2;</description>
</vbox>
`;
var progressContent = `
<vbox id="progressContent">
<hbox class="tbb-header" pack="center">
<image class="tbb-logo"/>
......@@ -159,7 +152,9 @@
value="&torsettings.reconfigTor;"/>
</vbox>
</vbox>
`;
var restartContent = `
<vbox id="restartContent">
<hbox pack="center">
<description id="restartPanelMessage" flex="1"/>
......@@ -170,7 +165,9 @@
oncommand="onRestartTor()"/>
</hbox>
</vbox>
`;
var bridgeDBRequestOverlayContent = `
<vbox id="bridgeDBRequestOverlayContent" align="center">
<vbox>
<label id="bridgeDBPrompt"/>
......@@ -200,7 +197,9 @@
</hbox>
</vbox>
</vbox>
`;
var errorOverlayContent = `
<vbox id="errorOverlayContent">
<hbox pack="center">
<description errorElemId="message" flex="1"/>
......@@ -211,10 +210,11 @@
oncommand="onDismissErrorOverlay()"/>
</hbox>
</vbox>
`;
var copyLogFeedbackPanel = `
<panel id="copyLogFeedbackPanel" type="arrow" fade="slow"
onclick="closeCopyLogFeedbackPanel()">
<description flex="1"/>
</panel>
</overlay>
`;
<?xml version="1.0"?>
<!--
- Copyright (c) 2018, The Tor Project, Inc.
- Copyright (c) 2019, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
......@@ -9,9 +9,7 @@
<?xml-stylesheet href="chrome://torlauncher/skin/network-settings.css"
type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<?xul-overlay href="chrome://torlauncher/content/network-settings-overlay.xul"?>
<!DOCTYPE wizard SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<wizard id="TorNetworkSettings"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
......@@ -127,8 +125,8 @@
<wizardpage class="help" pageid="helpPanel" next="notUsed"
onpageadvanced="closeHelp(); return false;">
<vbox id="bridgeHelpContent" hidden="true"/>
<vbox id="proxyHelpContent" hidden="true"/>
<vbox id="bridgeHelpContent"/>
<vbox id="proxyHelpContent"/>
</wizardpage>
<hbox pack="start">
......
......@@ -10,6 +10,7 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TorLauncherUtil",
"resource://torlauncher/modules/tl-util.jsm");
......@@ -116,6 +117,8 @@ var gBridgeDBRequestEventListeners = [];
function initDialogCommon()
{
loadSharedXUL();
gObsService = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
......@@ -158,6 +161,39 @@ function initDialogCommon()
}
function loadSharedXUL()
{
let ctxt = {};
Services.scriptloader.loadSubScript(
"chrome://torlauncher/content/network-settings-shared.js", ctxt);
let elementIDs =
[
"proxySettings",
"proxyHelpContent",
"bridgeSettings",
"bridgeHelpContent",
"progressContent",
"restartContent",
"bridgeDBRequestOverlayContent",
"errorOverlayContent",
"copyLogFeedbackPanel",
];
let entityURLs = ["chrome://torlauncher/locale/network-settings.dtd"];
elementIDs.forEach(aID =>
{
let node = document.getElementById(aID);
if (node)
{
let xulStr = ctxt[aID];
let frag = window.MozXULElement.parseXULToFragment(xulStr, entityURLs);
node.parentNode.replaceChild(frag, node);
}
});
}
function resizeDialogToFitContent()
{
// Resize this window to fit content. sizeToContent() alone will not do
......
<?xml version="1.0"?>
<!--
- Copyright (c) 2018, The Tor Project, Inc.
- Copyright (c) 2019, The Tor Project, Inc.
- See LICENSE for licensing information.
- vim: set sw=2 sts=2 ts=8 et syntax=xml:
-->
......@@ -9,9 +9,7 @@
<?xml-stylesheet href="chrome://torlauncher/skin/network-settings.css"
type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<?xul-overlay href="chrome://torlauncher/content/network-settings-overlay.xul"?>
<!DOCTYPE dialog SYSTEM "chrome://torlauncher/locale/network-settings.dtd">
<dialog id="TorNetworkSettings"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
......@@ -41,7 +39,13 @@
groupboxID="firewallSpecificSettings"
label="&torsettings.firewall.checkbox;"
oncommand="toggleElemUI(this)"/>
<groupbox id="firewallSpecificSettings"/>
<groupbox id="firewallSpecificSettings">
<hbox align="center">
<label value="&torsettings.firewall.allowedPorts;"
control="firewallAllowedPorts"/>
<textbox id="firewallAllowedPorts" value="80,443"/>
</hbox>
</groupbox>
</vbox>
</vbox>
......@@ -60,8 +64,8 @@
</vbox>
<vbox id="helpPanel" class="help">
<vbox id="bridgeHelpContent" hidden="true"/>
<vbox id="proxyHelpContent" hidden="true"/>
<vbox id="bridgeHelpContent"/>
<vbox id="proxyHelpContent"/>
</vbox>
<vbox id="restartPanel" class="messagePanel" pack="center">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment