summaryrefslogtreecommitdiffstats
path: root/htdocs/js/autocomplete.js
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-08-21 09:38:06 +0800
committerJeremy Kerr <jk@ozlabs.org>2008-08-21 09:38:06 +0800
commitc561ebe710d6e6a43aa4afc6c2036a215378ce87 (patch)
tree7d4a56233ef53a0457646c47895ac5c6e7a65d31 /htdocs/js/autocomplete.js
downloadpatchwork-c561ebe710d6e6a43aa4afc6c2036a215378ce87.tar.bz2
patchwork-c561ebe710d6e6a43aa4afc6c2036a215378ce87.tar.xz
Inital commit
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'htdocs/js/autocomplete.js')
-rw-r--r--htdocs/js/autocomplete.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/htdocs/js/autocomplete.js b/htdocs/js/autocomplete.js
new file mode 100644
index 0000000..115ffba
--- /dev/null
+++ b/htdocs/js/autocomplete.js
@@ -0,0 +1,43 @@
+
+
+function ac_keyup(input)
+{
+ input.autocomplete.keyup();
+}
+
+function AutoComplete(input)
+{
+ this.input = input;
+ this.div = null;
+ this.last_value = '';
+
+ input.autocomplete = this;
+
+ this.hide = function()
+ {
+ if (this.div) {
+ this.div.style.display = 'none';
+ this.div = null;
+ }
+
+ }
+
+ this.show = function()
+ {
+ if (!this.div) {
+ this.div =
+
+ this.keyup = function()
+ {
+ value = input.value;
+
+ if (value == this.last_value)
+ return;
+
+ if (value.length < 3) {
+ this.hide();
+ }
+
+
+}
+