Make option buttons on addresshelper interstitial larger and contain their own descriptions. Place the button to proceed without adding on one side, place the button to save and continue on the other. Remove redundant save-and-continues.

This commit is contained in:
idk
2021-04-19 17:42:07 -04:00
parent 0546ef4fa4
commit 3192a5e67b
3 changed files with 55 additions and 18 deletions

View File

@@ -1453,38 +1453,39 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
"</td></tr>\n</table>\n" + "<hr>\n" +
// FIXME if there is a query remaining it is lost
"<form method=\"GET\" action=\"" + targetRequest + "\">\n" +
"<h4>" + _t("Continue to {0} without saving", idn) + "</h4>\n<p>" +
"<form method=\"GET\" action=\"" + targetRequest + "\" class=\"hostaddform\">\n" +
"<div class=\"formaction hostaddaction\"><button type=\"submit\" class=\"go hostadd\">" +
"<h4>" + _t("Continue to {0} without saving", destination) + "</h4>\n<p>" +
_t("You can browse to the site without saving it to the address book. The address will be remembered until you restart your I2P router.") +
"</p>\n<div class=\"formaction\"><button type=\"submit\" class=\"go\">" + _t("Continue without saving") + "</button></div>" + "\n</form>\n" +
"</p>\n</button></div>" + "\n</form>\n" +
"<form method=\"GET\" action=\"http://" + LOCAL_SERVER + "/add\">\n" +
"<form method=\"GET\" action=\"http://" + LOCAL_SERVER + "/add\" class=\"hostaddform\">\n" +
"<input type=\"hidden\" name=\"host\" value=\"" + destination + "\">\n" +
"<input type=\"hidden\" name=\"dest\" value=\"" + ahelperKey + "\">\n" +
"<input type=\"hidden\" name=\"nonce\" value=\"" + _proxyNonce + "\">\n" +
"<input type=\"hidden\" name=\"nonce\" value=\"" + _proxyNonce + "\">\n");
"<h4>" + _t("Save {0} to router address book and continue to website", idn) + "</h4>\n<p>" +
_t("This address will be saved to your Router address book where your subscription-based addresses are stored."));
if(_context.namingService().getName().equals("BlockfileNamingService")) {
out.write(" " + _t("If you want to keep track of sites you have added manually, add to your Local or Private address book instead."));
}
// FIXME wasn't escaped
String label = _t("Save & continue").replace("&", "&amp;");
out.write("</p>\n<div class=\"formaction\"><button type=\"submit\" class=\"accept\" name=\"router\" value=\"router\">" +
label + "</button></div>\n");
out.write("<div class=\"formaction hostaddaction\"><button type=\"submit\" class=\"accept hostadd\" name=\"router\" value=\"router\">" +
"<h4>" + _t("Save {0} to router address book and continue to website", idn) + "</h4>\n<p>" +
_t("This address will be saved to your Router address book where your subscription-based addresses are stored."));
if(_context.namingService().getName().equals("BlockfileNamingService")) {
out.write(" " + _t("If you want to keep track of sites you have added manually, add to your Local or Private address book instead."));
}
out.write("</p>\n</button></div>\n");
if(_context.namingService().getName().equals("BlockfileNamingService")) {
// only blockfile supports multiple books
out.write("<h4>" + _t("Save {0} to local address book and continue to website", idn) + "</h4>\n<p>" +
out.write("<div class=\"formaction hostaddaction\"><button type=\"submit\" class=\"accept hostadd\" name=\"local\" value=\"local\">" +
"<h4>" + _t("Save {0} to local address book and continue to website", idn) + "</h4>\n<p>" +
_t("This address will be saved to your Local address book. Select this option for addresses you wish to keep separate from the main router address book, but don't mind publishing.") +
"</p>\n<div class=\"formaction\"><button type=\"submit\" class=\"accept\" name=\"local\" value=\"local\">" +
label + "</button></div>\n");
"</p>\n</button></div>\n");
out.write("<h4>" + _t("Save {0} to private address book and continue to website", idn) + "</h4>\n<p>" +
out.write("<div class=\"formaction hostaddaction\"><button type=\"submit\" class=\"accept hostadd\" name=\"private\" value=\"private\">" +
"<h4>" + _t("Save {0} to private address book and continue to website", idn) + "</h4>\n<p>" +
_t("This address will be saved to your Private address book, ensuring it is never published.") +
"</p>\n<div class=\"formaction\"><button type=\"submit\" class=\"accept\" name=\"private\" value=\"private\">" +
label + "</button></div>\n");
"</p>\n</button></div>\n");
}
// Firefox (and others?) don't send referer to meta refresh target, which is

View File

@@ -263,6 +263,24 @@ div.warning {
padding: 0;
}
.hostaddform {
display: inline-table;
width: 48%;
}
.hostadd {
height: 130px;
width: 100%;
}
.hostaddaction {
background: transparent !important;
border: none !important;
padding-bottom: 15px !important;
padding-top: 0px !important;
}
/* end proxy errors */
/* sidebar */

View File

@@ -1176,6 +1176,24 @@ p:empty + .sb_notice {
box-shadow: none;
}
.hostaddform {
display: inline-table;
width: 48%;
}
.hostadd {
height: 130px;
width: 100%;
background: #fafaff !important;
}
.hostaddaction {
background: transparent !important;
border: none !important;
padding-bottom: 15px !important;
padding-top: 0px !important;
}
/* end proxy error messages */
/* console error messages */