Code Search for Developers
 
 
  

compose.html from AlphaMail at Krugle


Show compose.html syntax highlighted

% # vim: set syntax=mason: 
<%args>
$to => ''
$subject => ''
$new => 0
$message => ''
$spelling_checked => 0
</%args>
<& /mail/header.mhtml, message => $message, title => 'Compose', compose => 1,
   confirm_controls => 'Abort this compose?' &>
% if($user->getAttribute('javascript')) {
   <script type="text/javascript" language="JavaScript">
      <!--
      var collection = [ <% join(",\n", map { qq(") . mimewords_to_utf8($_) . qq(") } @addresses) %> ];

      function checkForm() {
         answer = true;
         if(typeof(siw) != "undefined")
            if(siw && typeof(siw.selectingSomething) != "undefined")
               if(siw.selectingSomething)
                  answer = false;
         return answer;
      }

      function addAttachment() {
         var fin = document.getElementById('fileInputNode');
         var linkNode = document.getElementById('attachmentLinkNode');

         linkNode.style.display = "none";
         fin.style.display = "block";

         return 1;
      }

      function dropAttachment(id) {
         var att = document.getElementById(id);
         var parent = att.parentNode;
         parent.removeChild(att);
      }
      // -->
   </script>
% } 
   <form method="post" action="<% $base %>/mail/process_compose.html" 
         id="header" name="compose_form"
         onSubmit="return checkForm()"
         enctype="multipart/form-data">
      <div class="controls">
         <!-- "Invisible" button used to prevent sends when a users hits enter
              in some browsers -->
         <input style="position: absolute; top: -40px; left:-40px; width: 0px; height: 0px;" name="noop" type="submit" value="">
         <input name="send" type="submit" value="Send Message">
         <input type="hidden" name="spelling_checked" value="<% $spelling_checked %>"> 
         <input type="submit" name="address" value="Use Address Book"> 
         <input type="submit" name="spellcheck" value="Check Spelling"> 
% if($drafts ne 'none') {
         <input type="submit" name="save" value="Save Draft"> 
% }
         <input type="submit" name="cancel" value="Cancel"> 
      </div>
      <table onkeydown="return suppressArrows(event)" class="composition_form">
         <tr>
            <td class="composition_field_label">
               <div class="composition_field_label">
                  To:
               </div>
            </td>
            <td>
               <div class="composition_input">
               <input autocomplete="off" type="text" class="wickEnabled" id="to" name="to" value="<% $composition->{to} |h %>">
               </div>
            </td>
         </tr><tr>
            <td class="composition_field_label">
               <div class="composition_field_label">
                  Cc:
               </div>
            </td>
            <td>
               <div class="composition_input">
                  <input autocomplete="off" type="text" class="wickEnabled" name="cc" value="<% $composition->{cc} |h %>">
               </div>
            </td>
         </tr><tr>
            <td class="composition_field_label">
               <div class="composition_field_label">
                  Bcc:
               </div>
            </td>
            <td>
               <div class="composition_input">
                  <input autocomplete="off" type="text" class="wickEnabled" name="bcc" value="<% $composition->{bcc} |h %>">
               </div>
            </td>
         </tr>
         <tr>
            <td class="composition_field_label">
               <div class="composition_field_label">
                  Subject:
               </div>
            </td>
            <td>
               <div class="composition_input">
                  <input class="addr_field" name="subject" value="<% $composition->getSubject() |h %>" type="text" size="80">
               </div>
            </td>
         </tr>
         <tr>
            <td></td>
            <td>
% if($composition->hasAttachments()) {
%    for(my $i =0; $i < @{$attachments}; $i++) {
%       if($user->getAttribute('javascript')) {
               <div id="attachment_<% $i %>">
                  <input type="hidden" name="attachment_<% $i %>" value="1">
                  <% mimewords_to_utf8($attachments->[$i]{filename}) |h %> 
                  (<% size_with_units($attachments->[$i]{size}) %>)
                  <a class="simlink" onclick="dropAttachment('<% "attachment_$i" %>');">remove</a>
                  <br>
               </div>
%       } else {
               <input type="checkbox" checked name="attachment_<% $i %>" value="1">
               <% mimewords_to_utf8($attachments->[$i]{filename}) |h %> 
               (<% size_with_units($attachments->[$i]{size}) %>) (uncheck and click update to remove)<br>
%       }
%    }
% }
               <div id="attachment_files">
% if($user->getAttribute('javascript')) {
                  <A id="attachmentLinkNode" class="simlink" onclick="addAttachment()">Attach a<% $composition->hasAttachments() ? "nother":"" %> file...</A>
                  <div id="fileInputNode">
                     <input onchange="setMessage('Uploading attachment...please wait') && document.compose_form.submit()" type="file" name="file">
                  </div>
                  <SCRIPT LANGUAGE="JavaScript">
                     <!--
                        document.getElementById('fileInputNode').style.display = "none";
                     // -->
                  </SCRIPT>
% } else {
                  <div id="fileInputNode">
                     <input type="file" name="file">
                  </div>
                  <input type="submit" name="add_another" value="Add another">
                  <input type="submit" name="update" value="Update">
% }
               </div>
            </td>
         </tr>
         <tr>
            <td colspan="2">
               <textarea onfocus="ie_cursorhack()" class="message_field" rows="20" cols="72" name="body" id="body"><% $composition->getBody |h %></textarea>
            </td>
         </tr>
      </table>
      <div class="controls">
         <input name="send" type="submit" value="Send Message">
         <input type="submit" name="address" value="Use Address Book"> 
         <input type="submit" name="spellcheck" value="Check Spelling"> 
% if($drafts ne 'none') {
         <input type="submit" name="save" value="Save Draft"> 
% }
         <input type="submit" name="cancel" value="Cancel"> 
      </div>
   </form>
   <script type="text/javascript" language="javascript">
      <!--
      // Put the cursor at the beginning of the composition
      var theBody = document.getElementById('body');
      var firstfld = document.getElementById('to');
      var posset = 0;
      theBody.selectionStart = 0;
      theBody.selectionEnd = 0;
      firstfld.focus();
      firstfld.select();

      function ie_cursorhack()
      {
         if(posset) return;
         posset = 1;

         if(theBody.createTextRange) { 
            var range = theBody.createTextRange();
            range.collapse(true);
            range.select();
         }
      }
      // -->
   </script>
   <script type="text/javascript" language="JavaScript" src="<% $base %>/static/wick.js"></script>
<& /mail/footer.mhtml &>
<%init>
my $user = Apache2::SiteControl->getCurrentUser($r);
if(!$user || !$user->isa('Apache2::SiteControl::User')) {
   $logger->error("Unable to find a user for the given session key. r, m:" . Dumper($r, $m));
   $m->redirect("/");
}
my $folder = $user->getAttribute('lastfolder') || 'inbox';
my $book = new AlphaMail::AddressBook($user->getUsername(), $user->getAttribute('mx'), $config);
my $addresses = $book->get_all->{addresses};
my $lists = $book->get_all->{lists};
my @addresses;
my $reply_address;
my $prefs = new AlphaMail::Preferences($user, 
                                   $user->getAttribute('mx'), $config);
my ($cc, $bcc);
my $attachments;
my $drafts = $prefs->get('drafts_folder', $config->get("default_drafts", 'none'));
my $composition = new AlphaMail::Message($user, $config);
if($new || $to || $subject) { # Incoming subject/to field. Force a new composition
   $composition->setBody('');
   $composition->setAddresses($to, '', '');
   $composition->setSubject($subject);
   $composition->save();
} else {
   $composition->load();
   $logger->debug($user->getUsername() . ": Loading composition");
   ($to, $cc, $bcc) = $composition->getAddresses();
   $subject = $composition->getSubject;
   $attachments = $composition->getAttachments;
} 

if($prefs->get('replyto') =~ m/\@/) {
   $reply_address = $prefs->get('replyto');
} else {
   $reply_address = $user->getUsername() . '@' . $user->getAttribute('mx');
}

for my $k (keys %$addresses) 
{
   push @addresses, $addresses->{$k}->format;
}

for my $k (keys %$lists) {
   push @addresses, $k;
}

map { s/"/\\"/g } @addresses;

</%init>
<%once>
use AlphaMail::MailTool qw(mimewords_to_utf8);
use AlphaMail::HTMLHelper qw(size_with_units);
use Encode;
our $logger = Log::Log4perl->get_logger('alphamail');
our $base = $config->get('base_uri');
</%once>




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  addressbook/
    edit.mhtml
    import.mhtml
    import_complete.html
    import_csv.html
    import_csv_save.html
    import_fname.html
    import_imho.html
    import_lname.html
    index.html
    lists.mhtml
    process_edit.html
    process_lists.html
    process_take.html
    take.html
  admin/
    autohandler
    guide.html
    index.html
    quotas.jpg
    show_stats.mhtml
    test.mhtml
  docs/
    faq/
      attach1.gif
      attach2.gif
      attach3.gif
      colors.gif
      dates1.gif
      drafts.gif
      filter.gif
      index.html
      notrash1.gif
      notrash2.gif
      notrash3.gif
      other.html
      sort.gif
      timeout.gif
    index.html
    new_features.html
  settings/
    add_filter.html
    altfolder_update.html
    altprefix_update.html
    edit_folders.html
    export.mhtml
    export_mail.html
    filters.mhtml
    folders.mhtml
    general.mhtml
    index.html
    share.mhtml
    sharing_agree.html
    signatures.mhtml
    update_folderlist.html
    update_general.html
    update_signatures.html
  viewers/
    excel.html
    html.html
    targz.html
    text.html
    word.html
    zip.html
  address_mail.html
  addresslist.html
  autohandler
  check_spelling.html
  compose.html
  feedback.html
  first_login.html
  fix_spelling.html
  folderlist.mhtml
  footer.mhtml
  get_attachment.html
  header.mhtml
  help.html
  index.html
  logout.html
  menu.mhtml
  other_folders.html
  process_compose.html
  process_first_login.html
  process_messages.html
  process_read_message.html
  process_search.html
  quota.html
  quota_graph.html
  raw.html
  read.html
  remove_attachment.html
  renew_session.html
  resume_compose.html
  sanitized.html
  share_options.html
  share_upload.html
  verify_password.html
  view_attachment.html