all ImportantMessage deliveries are now done through trailing.html
[citadel.git] / webcit / static / t / edit_message.html
index 08b67a43a6f6086f9669d900eb7b2da73260b396..c5cfbda9162df212981922a06e1289b710966a31 100644 (file)
@@ -1,30 +1,28 @@
 <?=("head")>
-<?=("important_msg")><?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
+<?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
 <?ROOMBANNER>
 <div id="content">
-<div class="fix_scrollbar_bug message "><form enctype="multipart/form-data" method="POST" accept-charset="UTF-8" action="post" name="enterform">
+
+<div id="attachments_form">
+    <div id="loading">
+      <p><img src="static/webcit_icons/throbber.gif" alt=""></p>
+      <p><?_("Loading")></p>
+    </div>
+</div>
+
+<div class="entmsg" id="entmsg"><form name="enterform" accept-charset="UTF-8" enctype="multipart/form-data" method="POST" action="post">
 <input type="hidden" name="postseq" value="<?DATE:NOW:NO>">
 <input type="hidden" name="return_to" value="<?BSTR("return_to")>">
 <input type="hidden" name="nonce" value="<?NONCE>">
 <input type="hidden" name="force_room" value="<?ROOMNAME("X")>">
 <input type="hidden" name="references" value="<?BSTR("references")>">
 <input type="hidden" name="page" value="<?BSTR("page")>">
+<input type="hidden" name="submit_action" value="">
 
-<p class="send_edit_msg">
-<?!("COND:SUBST", 1, "RCPTREQUIRED")><input type="submit" name="send_button" value="<?_("Send message")>"><?!("X", 1)>
-<??("COND:SUBST", 2, "RCPTREQUIRED")><input type="submit" name="send_button" value="<?_("Post message")>"><?!("X", 2)>
-&nbsp;
-<!-- temporarily disabled for 7.60
-  <input type="submit" name="save_button" value="<?_("Save to Drafts")>">
-&nbsp;
--->
-  <input type="submit" name="cancel_button" value="<?_("Cancel")>">
-</p>
-<img src="static/newmess3_24x.gif" class="imgedit">  <?DATE:NOW:STR>
 <table width="100%" class="edit_msg_table">
-<tr><th><label for="from_id" >  <i><?_("from")></i> </label></th><td colspan="2">
+<tr><th><label for="from_id"><i><?_("from")></i></label></th><td>
 
-<??("COND:SUBST", 4, "RCPTREQUIRED")>
+<??("COND:BSTR", 4, "__RCPTREQUIRED")>
 <select name="display_name" size=1 id="from_id">
 <?ITERATE("PREF:VALID:EMAIL:NAME", ="prefs_section_msg_handle_select")>
 <?!("COND:THISROOM:FLAG:QR", 3, #"QR_ANONOPT")>
@@ -33,7 +31,7 @@
 </select>
 <??("X", 4)>
 
-<?!("COND:SUBST", 5, "RCPTREQUIRED")>
+<?!("COND:BSTR", 5, "__RCPTREQUIRED")>
 <select name="display_name" size=1 id="from_id">
 <?ITERATE("PREF:VALID:EMAIL:NAME", ="prefs_section_msg_sender_name_select")>
 <?!("COND:THISROOM:FLAG:QR", 3, #"QR_ANONOPT")>
 
  <i><?_("in")></i> <?ROOMNAME></td></tr>
 
-<?!("COND:SUBST", 5, "RCPTREQUIRED")>
+<?!("COND:BSTR", 5, "__RCPTREQUIRED")>
 <tr>
   <th><label for="recp_id"> <?_("To:")></label></th>
   <td><input autocomplete="off" type="text" name="recp" id="recp_id" value="<?BSTR("recp", "H")>" size=45 maxlength=1000 />
      <div class="auto_complete" id="recp_name_choices"></div>
   </td>
-  <td rowspan="3" align="left" valign="top">
-    <a href="javascript:PopOpenAddressBook('recp_id|<?_("To:")>|cc_id|<?_("CC:")>|bcc_id|<?_("BCC:")>');" title="<?_("Contacts")>">
-       <img align=middle border=0 width=24 height=24 src="static/viewcontacts_24x.gif">&nbsp;<?_("Contacts")>
-    </a>
-  </td>
 </tr>
 <tr>
   <th><label for="cc_id"><?_("CC:")></label></th>
 <??("X", 5)>           
 <tr>
   <th><label for="subject_id" > 
-      <?!("COND:SUBST", 6, "SUBJREQUIRED")><?_("Subject:")><?!("X", 6)>
-      <??("COND:SUBST", 7, "SUBJREQUIRED")><?_("Subject (optional):")><??("X", 7)>
+      <?%("COND:BSTR", 6, "__SUBJREQUIRED", 0, _("Subject (optional):"), _("Subject:")>
   </label></th>
-  <td colspan="2">
+  <td>
     <input type="text" name="subject" id="subject_id" value="<?BSTR("subject", "H")>" size=45 maxlength=70>
   </td>
 </tr>
-<tr><td colspan="3">
-<input type="hidden" name="sig_inserted" value="yes">
-
-
+</td></tr>
+</table>
 
+<input type="hidden" name="sig_inserted" value="yes">
 
-<textarea name="msgtext" cols="80" rows="15">
+<textarea name="msgtext" id="msgtext" cols="80" rows="15">
 <?BSTR("msgtext", "X")><?!("COND:BSTR", 1, "fwdquote")>&lt;br /&gt;
   &lt;div align=center&gt;
     &lt;i&gt;
 <??("COND:BSTR", 4, "edit")><??("COND:BSTR", 5, "sig_inserted", "yes")><?!("COND:PREF", 6, "use_sig", "yes")>
 &lt;br&gt;&lt;p&gt;--&nbsp;&lt;br&gt;<?PREF:VALUE("signature","H")>
       &lt;/p&gt;
-<?!("X", 6)><??("X", 5)><?!("X", 4)><?!("COND:ROOM:TYPE_IS", 7, "VIEW_WIKI")><?MAIL:EDITWIKI("X")><?!("X", 7)>
+<?!("X", 6)><??("X", 5)><?!("X", 4)><?!("COND:ROOM:TYPE_IS", 7, #"VIEW_WIKI")><?MAIL:EDITWIKI("X")><?!("X", 7)>
 </textarea>
 
-
-
-
 <?=("richedit")>
 
-<div class="attachment buttons">
-<img src="static/diskette_24x.gif" class="imgedit" ><?_("Attachments:")>
-<select name="which_attachment" size=1>
-<?ITERATE("MSG:ATTACHNAMES", ="edit_message_section_attach_select")>
-</select>
-&nbsp;&nbsp;&nbsp;<?_("Attach file:")>
-<input name="attachfile" class="attachfile" size=16 type="file">
-&nbsp;&nbsp;<input type="submit" name="attach_button" value="<?_("Add")>">
-
-</div></td></tr></table></form>
-
+</form>
+
+<div style="display:none" id="submit-o-matic"><ul>
+<li>
+       <a href="javascript:submit_post('post');">
+               <img src="static/webcit_icons/essen/16x16/check.png" alt=""">
+               <span class="navbar_link">
+               <?!("COND:BSTR", 1, "__RCPTREQUIRED")><?_("Send message")><?!("X", 1)>
+               <??("COND:BSTR", 2, "__RCPTREQUIRED")><?_("Post message")><?!("X", 2)>
+               </span>
+       </a>
+</li>
+<li>
+       <a href="javascript:submit_post('draft');">
+               <img src="static/webcit_icons/essen/16x16/draft.png" alt=""">
+               <span class="navbar_link">
+               <?_("Save to Drafts")>
+               </span>
+       </a>
+</li>
+<li>
+       <a href="javascript:show_attachments_form();">
+               <img src="static/webcit_icons/essen/16x16/attachement.png" alt=""">
+               <span class="navbar_link">
+               <?_("Attachments:")>
+               <span id="num_attachments"><?MSG:NATTACH></span>
+               </span>
+       </a>
+</li>
+<li>
+       <a href="javascript:submit_post('cancel');">
+               <img src="static/webcit_icons/essen/16x16/abort.png" alt="">
+               <span class="navbar_link">
+               <?_("Cancel")>
+               </span>
+       </a>
+</li>
+<?!("COND:BSTR", 1, "__RCPTREQUIRED")><li>
+       <a href="javascript:PopOpenAddressBook('recp_id|<?_("To:")>|cc_id|<?_("CC:")>|bcc_id|<?_("BCC:")>');">
+               <img src="static/webcit_icons/essen/16x16/contact.png" alt=""">
+               <span class="navbar_link">
+               <?_("Contacts")>
+               </span>
+       </a>
+</li><?!("X", 1)>
+</div>
 <script type="text/javascript">        
- activate_entmsg_autocompleters();     
+
+       $("navbar").innerHTML = $("submit-o-matic").innerHTML;
+       <?!("COND:BSTR", 1, "__RCPTREQUIRED")>
+               activate_entmsg_autocompleters();
+       <?!("X", 1)>
+
+       function submit_post(which_action) {
+               document.enterform.submit_action.value = which_action;
+               document.enterform.submit();
+       }
+
+       function hide_attachments_form() {
+               $('attachments_form').style.display = 'none';
+               update_attachment_count();
+       }
+
+       function show_attachments_form() {
+               $('attachments_form').style.display = 'block';
+
+               p = 'template=edit_message_attachments_pane&r=' + CtdlRandomString();
+               new Ajax.Updater(
+                       'attachments_form',
+                       'do_template',
+                       {
+                               method: 'get',
+                               parameters: p,
+                               evalScripts: true
+                       }
+               );
+       }
+
+       function update_attachment_count() {
+               p = 'r=' + CtdlRandomString();
+               new Ajax.Updater(
+                       'num_attachments',
+                       'show_num_attachments',
+                       {
+                               method: 'get',
+                               parameters: p
+                       }
+               );
+       }
+
+       function remove_attachment(which_one) {
+               p = 'which_attachment=' + which_one + '&r=' + CtdlRandomString();
+               new Ajax.Updater(
+                       'gonna_upload_this',
+                       'remove_attachment',
+                       {
+                               method: 'get',
+                               parameters: p,
+                               onComplete: function(){
+                                       show_attachments_form();
+                                       update_attachment_count();
+                               }
+                       }
+               );
+       }
 
 </script>
 </div>