]> err.no Git - scalable-opengroupware.org/commitdiff
work in progress
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 12 Oct 2004 12:38:09 +0000 (12:38 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 12 Oct 2004 12:38:09 +0000 (12:38 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@384 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/English.lproj/default.strings
SOGo/UI/Mailer/UIxMailToSelection.m
SOGo/UI/Mailer/UIxMailToSelection.wox
SOGo/UI/Mailer/Version

index 2490be34fef5949f75118a0840eaa4b3237b9806..c627f105071bd680e49c8bc3ec8ede6ba8f487c8 100644 (file)
@@ -1,5 +1,11 @@
 2004-10-12  Marcus Mueller  <znek@mulle-kybernetik.com>
 
+        * v0.9.33
+
+        * UIxMailToSelection.[wox|m]: updated
+
+        * English.lproj/default.strings: new localizable strings
+
         * v0.9.32
 
         * UIxMailEditor.wox: changed API for UIxMailToSelection
index 7e03676ead4fe2526c40114b980373d78038fb93..318ac1e6d8ccdce1846b09743fcbc62aad249386 100644 (file)
@@ -1,8 +1,9 @@
 /* this file is in ISO-8859-1 format! */
 
-"From"      = "From";
-"Subject"   = "Subject";
+"From"          = "From";
+"Subject"       = "Subject";
+"Add address"   = "Add address";
 
-"TO"        = "To";
-"CC"        = "Cc";
-"BCC"       = "Bcc";
+"TO"            = "To";
+"CC"            = "Cc";
+"BCC"           = "Bcc";
index 275df8ce08d34b18949334dea0fabf05ada35d8c..e10f290b98a1187a270485bb4d48b9c656406df3 100644 (file)
     
     [self debugWithFormat:@"Note: will take values ..."];
     
+    NSLog(@"formValues: %@", [_rq formValues]);
+
     tmp = [self getAddressesOfType:@"to"
                     fromFormValues:[_rq formValuesForKey:@"to"]];
     [self setTo:tmp];
 
 - (NSString *)jsCode {
     static NSString *script = \
+    @"var currentIndex = 0;\n"
+    @"\n"
+    @"function hasAddress(email) {\n"
+    @"  var e = document.getElementById(email);\n"
+    @"  if(e)\n"
+    @"    return true;\n"
+    @"  return false;\n"
+    @"}\n"
+    @"\n"
+    @"function rememberAddress(email) {\n"
+    @"  var list, e;\n"
+    @"  \n"
+    @"  list = document.getElementById(\"addr_addresses\");\n"
+    @"  e = document.createElement(\"span\");\n"
+    @"  e.id = email;\n"
+    @"  list.appendChild(e);\n"
+    @"}\n"
+    @"\n"
     @"function addAddress(type, cn, dn, email, uid, sn) {\n"
-    @"}\n";
+    @"  var shouldAddRow, s;\n"
+    @"  \n"
+    @"  shouldAddRow = true;\n"
+    @"  s = cn + \" <\" + email + \">\";\n"
+    @"\n"
+    @"  if(this.hasAddress(email))\n"
+    @"    return;\n"
+    @"\n"
+    @"  this.rememberAddress(email);\n"
+    @"\n"
+    @"  var e = document.getElementById(\"addr_0\");\n"
+    @"  if(e.value == '') {\n"
+    @"    e.value = s;\n"
+    @"    shouldAddRow = false;\n"
+    @"  }\n"
+    @"  if(shouldAddRow) {\n"
+    @"    this.fancyAddRow(false, s);\n"
+    @"  }\n"
+    @"}\n"
+    @"\n"
+    @"function fancyAddRow(shouldEdit, text) {\n"
+    @"  var table = document.getElementById(\"addr_table\").childNodes[1];\n"
+    @"  var lastChild = document.getElementById(\"addr_lastentry\");\n"
+    @"  var proto, row, select, input;\n"
+    @"\n"
+    @"  currentIndex++;\n"
+    @"\n"
+    @"  proto = document.getElementById(\"addr_proto\");\n"
+    @"  row = proto.cloneNode(true);\n"
+    @"  row.id = \"\";\n"
+    @"\n"
+    @"  select = row.childNodes[1].childNodes[1];\n"
+    @"  select.name = \"popup_\" + currentIndex;\n"
+    @"  input = row.childNodes[3].childNodes[1];\n"
+    @"  input.name = \"addr_\" + currentIndex;\n"
+    @"  input.id = \"addr_\" + currentIndex;\n"
+    @"  input.value = text;\n"
+    @"\n"
+    @"  table.insertBefore(row, lastChild);\n"
+    @"  if(shouldEdit) {\n"
+    @"    input.focus();\n"
+    @"    input.select();\n"
+    @"  }\n"
+    @"}\n"
+    @"\n";
     return script;
 }
 
index b67abbd816b78536917562d969d928c8051ca444..15a0906f63d2c91aead3a22b8902b07cd2263c5c 100644 (file)
   <script language="JavaScript">
     <var:string value="jsCode" const:escapeHTML="NO" />
   </script>
-  <table>
-    <!-- TODO: make repetition -->
-    <!-- TODO: form field needs to have an index -->
-    <tr>
+  <table id="addr_table">
+    <tr id="addr_proto">
       <td width="20%">
-        <!-- var:popup? -->
-        <select name="totype_00" style="width: 100%;">
+        <select id="popup_0" name="popup_0" style="width: 100%;">
           <option value="to" ><var:string label:value="TO" />:</option>
           <option value="cc" ><var:string label:value="CC" />:</option>
           <option value="bcc"><var:string label:value="BCC" />:</option>
         </select>
       </td>
       <td width="80%">
-        <input name="email_00" type="text" style="width: 100%;"/>
-      </td>
-    </tr>
-    <tr id="to_lastentry">
-      <td width="20%">
-        <var:entity const:name="nbsp" />
-      </td>
-      <td width="80%">
-        <a href="#" ><var:string label:value="new" /></a>
+        <input id="addr_0" name="addr_0" type="text" style="width: 100%;"/>
       </td>
     </tr>
+    <tr id="addr_lastentry">
+        <td width="20%">
+          <var:entity const:name="nbsp" />
+        </td>
+        <td width="80%">
+          <a href="javascript:fancyAddRow(true,'');"
+          ><var:string label:value="Add address" /></a>
+        </td>
+      </tr>
   </table>
+  <span id="addr_addresses" style="visibility: hidden;">
+  </span>
 </span>
\ No newline at end of file
index 97a71362c3bf0ddb41e2363c8153f42f36284c9c..a416fb2da5b737d088c2e68031da10b3fd57ee26 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=32
+SUBMINOR_VERSION:=33