]> err.no Git - scalable-opengroupware.org/commitdiff
added automagic search submits
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 16 Feb 2005 20:30:54 +0000 (20:30 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 16 Feb 2005 20:30:54 +0000 (20:30 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@574 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/UIxMailFilterPanel.wox
SOGo/UI/Mailer/UIxMailListView.wox
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/mailer.js
SOGo/UI/MailerContacts/ChangeLog
SOGo/UI/MailerContacts/UIxMailContactList.wox
SOGo/UI/MailerContacts/Version

index c65c0885dcd70a98eabe36d3f6d5f3c3e2405e6c..f590d146d67a4cabd9605f2e3a373d1a01356da5 100644 (file)
@@ -1,5 +1,7 @@
 2005-02-16  Helge Hess  <helge.hess@opengroupware.org>
 
+       * added automatic search field posting (v0.9.115)
+
        * mailer.js: fixed a row highlighting bug (v0.9.114)
 
        * product.plist: fixed compose button in mail viewer (v0.9.113)
index f2a52f43dbe76fb41e2006c29fca4e6f7e70d2c6..709c418e0f6d6546082abb9ec5da364a2bc82810 100644 (file)
     </td>
     <td class="titlecell" style="width: 80%; padding-right: 1px;">
       <input name="searchtext" type="text" var:value="searchText" 
-             style="width: 100%;" />
+             style="width: 100%;"
+             autocomplete="off"
+             onkeypress="ml_searchFieldKeyPressed(this)"
+             onfocus="ml_activateSearchField(this, 500)" 
+             onblur="ml_deactivateSearchField(this)" />
     </td>
   </tr>
 </table>
index efb46889c83a34da137a0ba2f1e8dfd3be7371c7..567a6ccae69e61b10ff8eaa7d0e60a8557396fad 100644 (file)
       </span>
     </div>
   </div>
+
+  <script language="JavaScript">
+    document.pageform.searchtext.focus();
+  </script>
 </var:component>
index 6e59c920f8e5bf20530feb690db3868970c9b689..b12a61247a80269a7a6951798adfdbb11957c013 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=114
+SUBMINOR_VERSION:=115
 
 # v0.9.100 requires libNGMime        v4.5.213
 # v0.9.99  requires libNGMime        v4.5.212
index 9385227f91128aae43e1fa5bb27882bc5fc01bc6..99c682b60d40b8978e0682186daee02dc5a18f3f 100644 (file)
@@ -358,3 +358,64 @@ function ml_lowlight(sender) {
   else
     sender.className = "tableview";
 }
+
+
+/* search field */
+
+var didStop      = false;
+var field        = null;
+var firstValue   = "";
+var isRegistered = false;
+var lastKeyPress = null;
+var submitAfterMS = 500;
+
+function ml_reloadSearchIfFieldChanged() {
+  if (field) {
+    if (field.value != firstValue) {
+      // TODO: we should just reload the tableview, not the whole page
+      document.pageform.submit();
+    }
+  }
+}
+
+function ml_timeoutCallback() {
+  if (didStop) {
+    didStop = false;
+    return;
+  }
+  
+  var now = new Date().getTime();
+  if ((now - lastKeyPress) < submitAfterMS) {
+    setTimeout("ml_timeoutCallback()", 10);
+    isRegistered = true;
+    return;
+  }
+  
+  ml_reloadSearchIfFieldChanged();
+  isRegistered = false;
+}
+
+function ml_activateSearchField(sender, _submitTimeout) {
+  didStop    = false;
+  field      = sender;
+  firstValue = field.value;
+  submitAfterMS = _submitTimeout;
+  return true;
+}
+function ml_deactivateSearchField(sender) {
+  didStop    = true;
+  field      = null;
+  firstValue = "";
+  return true;
+}
+
+function ml_searchFieldKeyPressed(sender) {
+  lastKeyPress = new Date().getTime();
+
+  if (isRegistered)
+    return;
+  
+  setTimeout("ml_timeoutCallback()", 10);
+  isRegistered = true;
+  return true;
+}
index f2b137b28551a89c55a255b4e9de0a73f31c8957..5ed733d125d4669a303c8d1590a55b6e3d5eb24d 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-16  Helge Hess  <helge.hess@opengroupware.org>
+
+       * added automatic search submit (v0.9.4)
+
 2005-02-15  Helge Hess  <helge.hess@opengroupware.org>
 
        * UIxMailContactEditor.m: added object title (v0.9.3)
index bf1a1f681131d3dc6e728fca90f618439d7cd01a..a6844e50959d104f619be63fdac8b8e1a47b752f 100644 (file)
       <td class="titlecell" style="width: 95%; padding-right: 1px;">
         <input type="text" name="search" class="searchfield" 
                var:value="searchText"
-               style="width: 100%;" />
+               style="width: 100%;"
+               autocomplete="off"
+               onkeypress="ml_searchFieldKeyPressed(this)"
+               onfocus="ml_activateSearchField(this, 500)" 
+               onblur="ml_deactivateSearchField(this)" />
       </td>
     </tr>
   </table>
       </table>
     </div>
   </div>
+
+  <script language="JavaScript">
+    document.pageform.search.focus();
+  </script>
 </var:component>
index 81d0f5a4cff3edc3be75e404954d4eed90c1bd38..9d93031b2c14602d3af70ada8fe43b6eda356ce9 100644 (file)
@@ -1,3 +1,3 @@
 # version file
 
-SUBMINOR_VERSION:=3
+SUBMINOR_VERSION:=4