Commit 61deb44d authored by Igor Oliveira's avatar Igor Oliveira Committed by Georg Koppen
Browse files

Bug 27111: Update about:tor desktop version to work on mobile

Update torbutton, aboutTor(markup and styling) to work on mobile.
parent 1503b5e1
......@@ -119,6 +119,9 @@ var AboutTorListener = {
else
body.removeAttribute("showmanual");
if (aData.mobile)
body.setAttribute("mobile", "yes");
// Setting body.initialized="yes" displays the body.
body.setAttribute("initialized", "yes");
},
......
......@@ -18,6 +18,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>&aboutTor.title;</title>
<link rel="stylesheet" type="text/css" media="all"
href="resource://torbutton-assets/aboutTor.css"/>
......@@ -73,6 +74,7 @@ window.addEventListener("pageshow", function() {
</script>
<div id="torstatus-version"/>
<div class="torcontent-container">
<img class="torcontent-logo" src="resource://torbutton-assets/torbrowser_mobile_logo.png"/>
<div id="torstatus" class="top">
<div id="torstatus-on-container" class="hideIfTorOff torstatus-container">
<div class="heading1">&aboutTor.ready.label;</div>
......
......@@ -238,6 +238,10 @@ function torbutton_donation_banner_countdown() {
}
}
function torbutton_is_mobile() {
return Services.appinfo.OS === "Android";
}
// Bug 1506 P2-P4: This code sets some version variables that are irrelevant.
// It does read out some important environment variables, though. It is
// called once per browser window.. This might belong in a component.
......@@ -408,11 +412,19 @@ function torbutton_init() {
torbutton_update_toolbutton();
torbutton_notify_if_update_needed();
createTorCircuitDisplay(m_tb_control_ipc_file, m_tb_control_host,
m_tb_control_port, m_tb_control_pass,
"extensions.torbutton.display_circuit");
try {
createTorCircuitDisplay(m_tb_control_ipc_file, m_tb_control_host,
m_tb_control_port, m_tb_control_pass,
"extensions.torbutton.display_circuit");
} catch(e) {
torbutton_log(4, "Error creating the tor circuit display " + e);
}
torbutton_init_user_manual_links();
try {
torbutton_init_user_manual_links();
} catch(e) {
torbutton_log(4, "Error loading the user manual " + e);
}
// Arrange for our about:tor content script to be loaded in each frame.
window.messageManager.loadFrameScript(
......@@ -449,6 +461,7 @@ var torbutton_abouttor_message_handler = {
// not working.
get chromeData() {
return {
mobile: torbutton_is_mobile(),
torOn: torbutton_tor_check_ok()
};
}
......@@ -1932,7 +1945,7 @@ function showSecurityPreferencesPanel(chromeWindow) {
}
function setupPreferencesForMobile() {
if (Services.appinfo.OS !== "Android") {
if (!torbutton_is_mobile()) {
return;
}
......
......@@ -199,6 +199,8 @@ body:not([showmanual]) .showForManual {
width: 100%;
max-width: 2200px; /* room for our 20 circles */
overflow: hidden;
position: absolute;
bottom: 0px;
}
.onion-pattern-row {
......@@ -395,3 +397,37 @@ body[show-donation-banner="true"] #onboarding-overlay-button {
transition: transform 0ms;
position: absolute;
}
/*
* Mobile specific css
*/
.torcontent-logo {
display: none;
}
body[mobile] #torstatus-version,
body[mobile] .searchbox,
body[mobile] .top .heading2,
body[mobile] #bottom {
display: none;
}
body[mobile] .top {
white-space: normal;
margin-top: 0px !important;
}
body[mobile] .torcontent-logo {
display: block;
margin-top: 20px;
width: 50%;
height: auto;
margin-left: auto;
margin-right: auto;
}
body[mobile] .top .heading1 {
font-size: 62px;
line-height: 1.1
}
Supports Markdown
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