summaryrefslogtreecommitdiff
path: root/template/search_files.st
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-07-21 05:07:23 -0400
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-07-21 05:07:23 -0400
commita53c4a0141e9aa6f39ecb25f26fe17fdb1bd7249 (patch)
tree2d6e9f33689409d47dec5ad9889c175cb9a6a3bf /template/search_files.st
parent0f24f0a4186e2ce298ec9a4a1ce74c4566c6d5c8 (diff)
timb: fixed seperate page search
Diffstat (limited to 'template/search_files.st')
-rw-r--r--template/search_files.st19
1 files changed, 7 insertions, 12 deletions
diff --git a/template/search_files.st b/template/search_files.st
index b226ebf..9759f07 100644
--- a/template/search_files.st
+++ b/template/search_files.st
@@ -23,7 +23,9 @@
var term = ""
var imagesPerPage = 25;
var images = []
-
+
+ var Search = {};
+
function addScript(term){
jQuery("#search-script").remove()
jQuery("head").append("<scr"+"ipt src='/cmd/ghettosearch/"+term+"' id='search-script'></sc"+"ript>")
@@ -37,7 +39,7 @@
jQuery("#message").html(x)
}
- function searchError(error){
+ Search.searchError = function(error){
setContent("")
setMessage(error)
}
@@ -61,7 +63,7 @@
setContent(contentString)
}
- function searchResult(results){
+ Search.searchResult = function(results){
images = []
var alreadyGot = {}
if(results === null || results.length == 0) {
@@ -112,15 +114,8 @@
}
}
- // only search every 800ms while someone is typing
- function keyHandler(){
- if (keyHandler.timeout) clearTimeout(keyHandler.timeout);
- keyHandler.timeout = setTimeout(doSearch, 800)
- }
-
- jQuery("#search-query").keyup(keyHandler)
-
+ jQuery("#search-query").keydown(ifEnter(doSearch))
</script>
-</html> \ No newline at end of file
+</html>