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)
</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>
</span>
</div>
</div>
+
+ <script language="JavaScript">
+ document.pageform.searchtext.focus();
+ </script>
</var:component>
# version file
-SUBMINOR_VERSION:=114
+SUBMINOR_VERSION:=115
# v0.9.100 requires libNGMime v4.5.213
# v0.9.99 requires libNGMime v4.5.212
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;
+}
+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)
<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>
# version file
-SUBMINOR_VERSION:=3
+SUBMINOR_VERSION:=4