forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head 600cd73c4b46b7ba8c421149785f6245afa47487)
to branch 'i2p.i2p.str4d.ui' (head d5b54214bfe1bf5203f614600b916346a10f26dd)
This commit is contained in:
@@ -319,9 +319,9 @@ class Mail {
|
||||
shortSender = shortSender.substring(0, lt).trim();
|
||||
else if (lt < 0 && shortSender.contains("@"))
|
||||
shortSender = '<' + shortSender + '>'; // add missing <> (but thunderbird doesn't...)
|
||||
boolean trim = shortSender.length() > 40;
|
||||
boolean trim = shortSender.length() > 25;
|
||||
if (trim)
|
||||
shortSender = shortSender.substring( 0, 37 ).trim();
|
||||
shortSender = shortSender.substring( 0, 22 ).trim();
|
||||
shortSender = html.encode( shortSender );
|
||||
if (trim)
|
||||
shortSender += "…"; // must be after html encode
|
||||
@@ -344,9 +344,9 @@ class Mail {
|
||||
subject = line.substring( 8 ).trim();
|
||||
formattedSubject = subject;
|
||||
shortSubject = formattedSubject;
|
||||
boolean trim = formattedSubject.length() > 60;
|
||||
boolean trim = formattedSubject.length() > 65;
|
||||
if (trim)
|
||||
shortSubject = formattedSubject.substring( 0, 57 ).trim();
|
||||
shortSubject = formattedSubject.substring( 0, 62 ).trim();
|
||||
shortSubject = html.encode( shortSubject );
|
||||
if (trim)
|
||||
shortSubject += "…"; // must be after html encode
|
||||
|
||||
@@ -202,7 +202,7 @@ public class WebMail extends HttpServlet
|
||||
private static final String CONFIG_THEME = "theme";
|
||||
private static final String DEFAULT_THEME = "light";
|
||||
|
||||
private static final String spacer = " ";
|
||||
private static final String spacer = ""; /* this is best done with css */
|
||||
private static final String thSpacer = "<th> </th>\n";
|
||||
private static final String CONSOLE_BUNDLE_NAME = "net.i2p.router.web.messages";
|
||||
|
||||
@@ -664,7 +664,7 @@ public class WebMail extends HttpServlet
|
||||
}
|
||||
if( prepareAttachment ) {
|
||||
if( html ) {
|
||||
out.println( "<hr><p class=\"mailbody\">" );
|
||||
out.println( "<hr><div class=\"attached\">" );
|
||||
String type = mailPart.type;
|
||||
if (type != null && type.startsWith("image/")) {
|
||||
// we at least show images safely...
|
||||
@@ -685,7 +685,7 @@ public class WebMail extends HttpServlet
|
||||
mailPart.hashCode() + "\">" + _t("Download attachment {0}", ident) + "</a>" +
|
||||
" (" + _t("File is packed into a zipfile for security reasons.") + ')');
|
||||
}
|
||||
out.println( "</p>" );
|
||||
out.println( "</div>" );
|
||||
}
|
||||
else {
|
||||
out.println( _t("Attachment ({0}).", ident) );
|
||||
@@ -1811,10 +1811,10 @@ public class WebMail extends HttpServlet
|
||||
"<input type=\"hidden\" name=\"" + SUSI_NONCE + "\" value=\"" + nonce + "\">");
|
||||
|
||||
if( sessionObject.error != null && sessionObject.error.length() > 0 ) {
|
||||
out.println( "<p class=\"error\">" + quoteHTML(sessionObject.error).replace("\n", "<br>") + "</p>" );
|
||||
out.println( "<div class=\"notifications\"><p class=\"error\">" + quoteHTML(sessionObject.error).replace("\n", "<br>") + "</p></div>" );
|
||||
}
|
||||
if( sessionObject.info != null && sessionObject.info.length() > 0 ) {
|
||||
out.println( "<p class=\"info\"><b>" + quoteHTML(sessionObject.info).replace("\n", "<br>") + "</b></p>" );
|
||||
out.println( "<div class=\"notifications\"><p class=\"info\"><b>" + quoteHTML(sessionObject.info).replace("\n", "<br>") + "</b></p></div>" );
|
||||
}
|
||||
/*
|
||||
* now write body
|
||||
@@ -1835,7 +1835,7 @@ public class WebMail extends HttpServlet
|
||||
showConfig(out, sessionObject);
|
||||
|
||||
//out.println( "</form><div id=\"footer\"><hr><p class=\"footer\">susimail v0." + version +" " + ( RELEASE ? "release" : "development" ) + " © 2004-2005 <a href=\"mailto:susi23@mail.i2p\">susi</a></div></div></body>\n</html>");
|
||||
out.println( "</form><div class=\"footer\"><hr><p class=\"footer\">susimail © 2004-2005 susi</p></div></div></body>\n</html>");
|
||||
out.println( "</form><div class=\"footer\"><p class=\"footer\">susimail © 2004-2005 susi</p></div></div></body>\n</html>");
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
@@ -2170,7 +2170,7 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.subject = null;
|
||||
sessionObject.body = null;
|
||||
|
||||
out.println( "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
out.println( "<div id=\"composemail\"><table id=\"newmail\" cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _t("From") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_FROM + "\" value=\"" + quoteHTML(from) + "\" " + ( fixed ? "disabled" : "" ) +"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _t("To") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_TO + "\" value=\"" + quoteHTML(to) + "\"></td></tr>\n" +
|
||||
@@ -2178,11 +2178,9 @@ public class WebMail extends HttpServlet
|
||||
"<tr><td align=\"right\">" + _t("Bcc") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + quoteHTML(bcc) + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _t("Bcc to self") + ": </td><td align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"" + NEW_BCC_TO_SELF + "\" value=\"1\" " + (sessionObject.bccToSelf ? "checked" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _t("Subject") + ":</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + quoteHTML(subject) + "\"></td></tr>\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea>" +
|
||||
"<tr><td></td><td align=\"left\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea></td></tr>" +
|
||||
"<tr class=\"bottombuttons\"><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
|
||||
"<tr class=\"bottombuttons\"><td align=\"right\">" + _t("Add Attachment") + ":</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"></td></tr>" +
|
||||
// TODO disable/hide in JS if no file selected
|
||||
"<tr class=\"bottombuttons\"><td> </td><td align=\"left\">" + button(NEW_UPLOAD, _t("Add another attachment")) + "</td></tr>");
|
||||
"<tr class=\"bottombuttons\"><td align=\"right\">" + _t("Add Attachment") + ":</td><td id=\"addattach\" align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"> " + button(NEW_UPLOAD, _t("Add another attachment")) + "</td></tr>");
|
||||
|
||||
if( sessionObject.attachments != null && !sessionObject.attachments.isEmpty() ) {
|
||||
boolean wroteHeader = false;
|
||||
@@ -2193,14 +2191,14 @@ public class WebMail extends HttpServlet
|
||||
} else {
|
||||
out.println("<tr><td align=\"right\"> </td>");
|
||||
}
|
||||
out.println("<td align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"check" + attachment.hashCode() + "\" value=\"1\"> " + quoteHTML(attachment.getFileName()) + "</td></tr>");
|
||||
out.println("<td id=\"attachedfile\" align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"check" + attachment.hashCode() + "\" value=\"1\"> " + quoteHTML(attachment.getFileName()) + "</td></tr>");
|
||||
}
|
||||
// TODO disable in JS if none selected
|
||||
out.println("<tr class=\"bottombuttons\"><td> </td><td align=\"left\">" +
|
||||
out.println("<tr class=\"bottombuttons\"><td> </td><td align=\"left\" id=\"deleteattached\">" +
|
||||
button( DELETE_ATTACHMENT, _t("Delete selected attachments") ) +
|
||||
"</td></tr>");
|
||||
}
|
||||
out.println( "</table>" );
|
||||
out.println( "</table></div>" );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2214,7 +2212,7 @@ public class WebMail extends HttpServlet
|
||||
String pop3 = Config.getProperty( CONFIG_PORTS_POP3, "" + DEFAULT_POP3PORT );
|
||||
String smtp = Config.getProperty( CONFIG_PORTS_SMTP, "" + DEFAULT_SMTPPORT );
|
||||
|
||||
out.println( "<table cellspacing=\"3\" cellpadding=\"5\">\n" +
|
||||
out.println( "<div id=\"dologin\"><h1>" + _t("I2PMail Login") + "</h1><table cellspacing=\"3\" cellpadding=\"5\">\n" +
|
||||
// current postman hq length limits 16/12, new postman version 32/32
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _t("User") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + USER + "\" value=\"" + "\"> @mail.i2p</td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _t("Password") + "</td><td width=\"40%\" align=\"left\"><input type=\"password\" size=\"32\" name=\"pass\" value=\"" + "\"></td></tr>\n");
|
||||
@@ -2227,18 +2225,16 @@ public class WebMail extends HttpServlet
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _t("SMTP Port") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" style=\"text-align: right;\" size=\"5\" name=\"" + SMTP +"\" value=\"" + quoteHTML(smtp) + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n");
|
||||
}
|
||||
out.println(
|
||||
"<tr><td colspan=\"2\"> </td></tr>\n" +
|
||||
"<tr><td></td><td align=\"left\">" + button( LOGIN, _t("Login") ) + spacer +
|
||||
"<tr><td colspan=\"2\"><hr></td></tr>\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\">" + button( LOGIN, _t("Login") ) + spacer +
|
||||
button(OFFLINE, _t("Read Mail Offline") ) +
|
||||
//spacer +
|
||||
//" <input class=\"cancel\" type=\"reset\" value=\"" + _t("Reset") + "\">" +
|
||||
spacer +
|
||||
button(CONFIGURE, _t("Settings")) +
|
||||
"</td></tr>\n" +
|
||||
"<tr><td colspan=\"2\"> </td></tr>\n" +
|
||||
"<tr><td></td><td align=\"left\"><a href=\"http://hq.postman.i2p/?page_id=14\">" + _t("Learn about I2P mail") + "</a></td></tr>\n" +
|
||||
"<tr><td></td><td align=\"left\"><a href=\"http://hq.postman.i2p/?page_id=16\">" + _t("Create Account") + "</a></td></tr>\n" +
|
||||
"</table>");
|
||||
"<tr><td align=\"center\" colspan=\"2\"><hr><a href=\"http://hq.postman.i2p/?page_id=14\">" + _t("Learn about I2P mail") + "</a> | <a href=\"http://hq.postman.i2p/?page_id=16\">" + _t("Create Account") + "</a></td></tr>\n" +
|
||||
"</table></div>");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2269,8 +2265,7 @@ public class WebMail extends HttpServlet
|
||||
String curSort = sessionObject.folder.getCurrentSortBy();
|
||||
Folder.SortOrder curOrder = sessionObject.folder.getCurrentSortingDirection();
|
||||
out.println("<table id=\"mailbox\" cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
"<tr><td colspan=\"9\"><hr></td></tr>\n<tr>" +
|
||||
thSpacer +
|
||||
"<tr><td colspan=\"9\"><hr></td></tr>\n<tr><th title=\"" + _t("Mark for deletion") + "\"> </th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SENDER, _t("From"), sessionObject.imgPath, curSort, curOrder ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SUBJECT, _t("Subject"), sessionObject.imgPath, curSort, curOrder ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_DATE, _t("Date"), sessionObject.imgPath, curSort, curOrder ) +
|
||||
@@ -2330,8 +2325,8 @@ public class WebMail extends HttpServlet
|
||||
i++;
|
||||
}
|
||||
if (i == 0)
|
||||
out.println("<tr><td colspan=\"9\" align=\"center\"><i>" + _t("No messages") + "</i></td></tr>");
|
||||
out.println( "<tr class=\"bottombuttons\"><td colspan=\"9\"><hr></td></tr>");
|
||||
out.println("<tr><td colspan=\"9\" align=\"center\"><div id=\"emptymailbox\"><i>" + _t("No messages") + "</i></div></td></tr>");
|
||||
out.println( "<tr class=\"bottombuttons\"></tr>");
|
||||
if (sessionObject.folder.getPages() > 1 && i > 30) {
|
||||
// show the buttons again if page is big
|
||||
out.println("<tr class=\"bottombuttons\"><td colspan=\"9\" align=\"center\">");
|
||||
@@ -2373,16 +2368,18 @@ public class WebMail extends HttpServlet
|
||||
*/
|
||||
private static void showPageButtons(PrintWriter out, Folder<?> folder) {
|
||||
out.println(
|
||||
"<br>" +
|
||||
"<table id=\"pagenav\"><tr><td>" +
|
||||
( folder.isFirstPage() ?
|
||||
button2( FIRSTPAGE, _t("First") ) + " " + button2( PREVPAGE, _t("Previous") ) :
|
||||
button( FIRSTPAGE, _t("First") ) + " " + button( PREVPAGE, _t("Previous") ) ) +
|
||||
" " +
|
||||
"</td><td>" +
|
||||
_t("Page {0} of {1}", folder.getCurrentPage(), folder.getPages()) +
|
||||
" " +
|
||||
"</td><td>" +
|
||||
( folder.isLastPage() ?
|
||||
button2( NEXTPAGE, _t("Next") ) + " " + button2( LASTPAGE, _t("Last") ) :
|
||||
button( NEXTPAGE, _t("Next") ) + " " + button( LASTPAGE, _t("Last") ) )
|
||||
button( NEXTPAGE, _t("Next") ) + " " + button( LASTPAGE, _t("Last") ) ) +
|
||||
"</td></tr></table>"
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2415,36 +2412,38 @@ public class WebMail extends HttpServlet
|
||||
out.println(button2(DELETE, _t("Delete")));
|
||||
else
|
||||
out.println(button(DELETE, _t("Delete")));
|
||||
out.println(spacer + button(LOGOUT, _t("Logout") ));
|
||||
out.println("<br>" +
|
||||
out.println(button(LOGOUT, _t("Logout") ));
|
||||
out.println("<div id=\"messagenav\">" +
|
||||
( sessionObject.folder.isFirstElement( sessionObject.showUIDL ) ? button2( PREV, _t("Previous") ) : button( PREV, _t("Previous") ) ) + spacer +
|
||||
button( LIST, _t("Back to Folder") ) + spacer +
|
||||
( sessionObject.folder.isLastElement( sessionObject.showUIDL ) ? button2( NEXT, _t("Next") ) : button( NEXT, _t("Next") ) ));
|
||||
out.println("</div>");
|
||||
out.println("</div></div>");
|
||||
//if (Config.hasConfigFile())
|
||||
// out.println(button( RELOAD, _t("Reload Config") ) + spacer);
|
||||
out.println( "<div id=\"viewmail\"><table id=\"message_full\" cellspacing=\"0\" cellpadding=\"5\">\n");
|
||||
if( mail != null ) {
|
||||
out.println( "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
out.println("<tr><td colspan=\"2\"><table id=\"mailhead\">\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\" valign=\"top\">" + _t("From") +
|
||||
"<tr><td align=\"right\">" + _t("From") +
|
||||
":</td><td align=\"left\">" + quoteHTML( mail.sender ) + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\" valign=\"top\">" + _t("Subject") +
|
||||
"<tr><td align=\"right\">" + _t("Subject") +
|
||||
":</td><td align=\"left\">" + quoteHTML( mail.formattedSubject ) + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\" valign=\"top\">" + _t("Date") +
|
||||
"<tr><td align=\"right\">" + _t("Date") +
|
||||
":</td><td align=\"left\">" + mail.quotedDate + "</td></tr>\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>" );
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>" +
|
||||
"</table></td></tr>\n" );
|
||||
if( mail.hasPart()) {
|
||||
mail.setNew(false);
|
||||
showPart( out, mail.getPart(), 0, SHOW_HTML );
|
||||
}
|
||||
else {
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">" + _t("Could not fetch mail body.") + "</p></td></tr>" );
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">" + _t("Could not fetch mail body.") + "</p></td></tr>\n" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">" + _t("Could not fetch mail.") + "</p></td></tr>" );
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">" + _t("Could not fetch mail.") + "</p></td></tr>\n" );
|
||||
}
|
||||
out.println( "<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n</table>" );
|
||||
out.println( "</table></div>" );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2464,19 +2463,18 @@ public class WebMail extends HttpServlet
|
||||
"\" size=\"4\" value=\"" + sz + "\">" +
|
||||
" " +
|
||||
button( SETPAGESIZE, _t("Set") ) );
|
||||
out.println("<p>");
|
||||
out.println("</div>");
|
||||
out.println("<h3 id=\"config\">");
|
||||
out.print(_t("Advanced Configuration"));
|
||||
Properties config = Config.getProperties();
|
||||
out.print(":</p><textarea cols=\"80\" rows=\"" + Math.max(8, config.size() + 2) + "\" spellcheck=\"false\" name=\"" + CONFIG_TEXT + "\">");
|
||||
out.print("</h3><textarea cols=\"80\" rows=\"" + Math.max(8, config.size() + 2) + "\" spellcheck=\"false\" name=\"" + CONFIG_TEXT + "\">");
|
||||
for (Map.Entry<Object, Object> e : config.entrySet()) {
|
||||
out.print(quoteHTML(e.getKey().toString()));
|
||||
out.print('=');
|
||||
out.println(quoteHTML(e.getValue().toString()));
|
||||
}
|
||||
out.println("</textarea>");
|
||||
out.println("<div id=\"bottombuttons\">");
|
||||
out.println("<br>");
|
||||
out.println("<div id=\"prefsave\">");
|
||||
out.println(button(SAVE, _t("Save Configuration")));
|
||||
out.println(button(CANCEL, _t("Cancel")));
|
||||
if (sessionObject.folder != null)
|
||||
|
||||
Reference in New Issue
Block a user