From aa08196c32894333b14570348446463385058c94 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sat, 30 Jul 2011 21:18:54 +0200 Subject: some interface work on instant search --- core/css/styles.css | 1 + core/js/js.js | 45 +++++++---------------------- search/css/results.css | 8 ++++++ search/js/result.js | 60 +++++++++++++++++++++++++++++++++++++++ search/templates/part.results.php | 15 ++++++++++ 5 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 search/css/results.css create mode 100644 search/js/result.js create mode 100644 search/templates/part.results.php diff --git a/core/css/styles.css b/core/css/styles.css index 400108c454d..05546541153 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -23,6 +23,7 @@ form input[type="submit"]:active { outline:0; } form input[type="button"], form input[type="text"] { font-size:0.9em; } fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; } legend { padding:0.5em; font-size:1.2em; } +.template{display:none;} div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; } diff --git a/core/js/js.js b/core/js/js.js index fbc014006b0..f85331db60a 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -54,6 +54,10 @@ OC={ }else{ $.getScript(path); } + }else{ + if(ready){ + ready(); + } } }, addStyle:function(app,style){ @@ -66,45 +70,16 @@ OC={ }, search:function(query){ if(query){ - OC.addStyle('search','results'); - $.getJSON(OC.filePath('search','ajax','search.php')+'?query='+encodeURIComponent(query), OC.search.showResults); + OC.addScript('search','result',function(){ + OC.addStyle('search','results'); + $.getJSON(OC.filePath('search','ajax','search.php')+'?query='+encodeURIComponent(query), OC.search.showResults); + }); } } } OC.addStyle.loaded=[]; OC.addScript.loaded=[]; -OC.search.catagorizeResults=function(results){ - var types={}; - for(var i=0;i