Changeset b4a0ffd


Ignore:
Timestamp:
Apr 20, 2014 5:12:21 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
673c142
Parents:
3b2e5bd
Message:
  • SusiMail?:
    • Don't require an attachment to be "uploaded" to send it
    • Move delete attachment button, hide if no attachments
    • Icon for delete attachment button
    • Fix html error in bccToSelf input
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    r3b2e5bd rb4a0ffd  
    375375                buf.append("<input type=\"submit\" class=\"").append(name).append("\" name=\"")
    376376                   .append(name).append("\" value=\"").append(label).append('"');
    377                 if (name.equals(SEND) || name.equals(CANCEL) || name.equals(DELETE_ATTACHMENT))
     377                if (name.equals(SEND) || name.equals(CANCEL) || name.equals(DELETE_ATTACHMENT) || name.equals(NEW_UPLOAD))
    378378                        buf.append(" onclick=\"cancelPopup()\"");
    379379                buf.append('>');
     
    972972                }
    973973        }
     974
    974975        /**
    975976         * process buttons of compose message dialog
     977         * This must be called BEFORE processStateChangeButtons so we can add the attachment before SEND
     978         *
    976979         * @param sessionObject
    977980         * @param request
     
    979982        private static void processComposeButtons(SessionObject sessionObject, RequestWrapper request)
    980983        {
    981                 if( buttonPressed( request, NEW_UPLOAD ) ) {
    982                         String filename = request.getFilename( NEW_FILENAME );
     984                String filename = request.getFilename( NEW_FILENAME );
     985                // We handle an attachment whether sending or uploading
     986                if (filename != null &&
     987                    (buttonPressed(request, NEW_UPLOAD) || buttonPressed(request, SEND))) {
     988                        Debug.debug(Debug.DEBUG, "Got filename in compose form: " + filename);
    983989                        int i = filename.lastIndexOf( "/" );
    984990                        if( i != - 1 )
     
    13401346                        sessionObject.isMobile = isMobile;
    13411347                       
     1348                        // This must be called to add the attachment before
     1349                        // processStateChangeButtons() sends the message
     1350                        if( sessionObject.state == STATE_NEW )
     1351                                processComposeButtons( sessionObject, request );
     1352               
    13421353                        int oldState = sessionObject.state;
    13431354                        processStateChangeButtons( sessionObject, request );
     
    13821393                        }
    13831394                       
    1384                         if( sessionObject.state == STATE_NEW )
    1385                                 processComposeButtons( sessionObject, request );
    1386                
    13871395                        /*
    13881396                         * update folder content
     
    16861694        {
    16871695                out.println( button( SEND, _("Send") ) + spacer +
    1688                                 button( CANCEL, _("Cancel") ) + spacer +
    1689                                 (sessionObject.attachments != null && (!sessionObject.attachments.isEmpty()) ? button( DELETE_ATTACHMENT, _("Delete Attachment") ) : button2( DELETE_ATTACHMENT, _("Delete Attachment") ) ) + spacer);
     1696                                button( CANCEL, _("Cancel") ));
    16901697                //if (Config.hasConfigFile())
    16911698                //      out.println(button( RELOAD, _("Reload Config") ) + spacer);
     
    17161723                                "<tr><td align=\"right\">" + _("Cc:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + cc + "\"></td></tr>\n" +
    17171724                                "<tr><td align=\"right\">" + _("Bcc:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + bcc + "\"></td></tr>\n" +
    1718                                 "<tr><td align=\"right\">" + _("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" +
     1725                                "<tr><td align=\"right\">" + _("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" +
    17191726                                "<tr><td align=\"right\">" + _("Subject:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + subject + "\"></td></tr>\n" +
    17201727                                "<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>" +
    17211728                                "<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
    1722                                 "<tr><td align=\"right\">" + _("New Attachment:") + "</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\">" +
    1723                                 "<input type=\"submit\" name=\"" + NEW_UPLOAD + "\" value=\"" + _("Upload File") + "\" onclick=\"cancelPopup()\"></td></tr>" );
     1729                                "<tr><td align=\"right\">" + _("Add Attachment:") + "</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"></td></tr>" +
     1730                                // TODO disable/hide in JS if no file selected
     1731                                "<tr><td>&nbsp;</td><td align=\"left\">" + button(NEW_UPLOAD, _("Add another attachment")) + "</td></tr>");
    17241732               
    17251733                if( sessionObject.attachments != null && !sessionObject.attachments.isEmpty() ) {
     
    17341742                                out.println("<td align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"check" + attachment.hashCode() + "\" value=\"1\">&nbsp;" + attachment.getFileName() + "</td></tr>");
    17351743                        }
     1744                        // TODO disable in JS if none selected
     1745                        out.println("<tr><td>&nbsp;</td><td align=\"left\">" +
     1746                                    button( DELETE_ATTACHMENT, _("Delete selected attachments") ) +
     1747                                    "</td></tr>");
    17361748                }
    17371749                out.println( "</table>" );
  • installer/resources/themes/susimail/dark/susimail.css

    r3b2e5bd rb4a0ffd  
    231231input.send, input.setpagesize {
    232232     background: #000 url('/themes/console/images/accept.png') no-repeat 2px center;
     233     min-height: 22px;
     234}
     235
     236input[type=file], input.new_upload {
     237     background: #000 url('/themes/console/images/add.png') no-repeat 2px center;
    233238     min-height: 22px;
    234239}
  • installer/resources/themes/susimail/light/susimail.css

    r3b2e5bd rb4a0ffd  
    231231}
    232232
     233input[type=file], input.new_upload {
     234     background: #ddf url('/themes/console/images/add.png') no-repeat 4px center;
     235     padding: 2px 3px 2px 24px;
     236     min-height: 22px;
     237}
     238
    233239input[type=text], input[type=password] {
    234240     padding: 1px 4px;
Note: See TracChangeset for help on using the changeset viewer.