summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-07-31 22:24:52 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-09-17 18:40:51 +0200
commitb40925ae1747ae44a52fb1f8dcf7645d022c6f13 (patch)
tree2f385e6b79de01305aa718c197fdc3c85e5ff4cd /core
parent9d18e16c77e8c2690dd23dd19ca1f8e1968161c8 (diff)
downloadnextcloud-server-b40925ae1747ae44a52fb1f8dcf7645d022c6f13.tar.gz
nextcloud-server-b40925ae1747ae44a52fb1f8dcf7645d022c6f13.zip
initial scrollto implementation:
use places/folder icon, move link construction to JS, only show icon on hover, use 'searchresult' as css class name, add filter/unfilter methods, highlight searched files in current filelist only filter when correct FileList is present
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index c09f80369f9..c23cf9eebd9 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -723,11 +723,17 @@ $(document).ready(function(){
}
}else if(event.keyCode===27){//esc
OC.search.hide();
+ if (FileList && typeof FileList.unfilter === 'function') { //TODO add hook system
+ FileList.unfilter();
+ }
}else{
var query=$('#searchbox').val();
if(OC.search.lastQuery!==query){
OC.search.lastQuery=query;
OC.search.currentResult=-1;
+ if (FileList && typeof FileList.filter === 'function') { //TODO add hook system
+ FileList.filter(query);
+ }
if(query.length>2){
OC.search(query);
}else{
@@ -840,6 +846,13 @@ function formatDate(date){
return $.datepicker.formatDate(datepickerFormatDate, date)+' '+date.getHours()+':'+((date.getMinutes()<10)?'0':'')+date.getMinutes();
}
+// taken from http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery
+function getURLParameter(name) {
+ return decodeURI(
+ (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1]
+ );
+}
+
/**
* takes an absolute timestamp and return a string with a human-friendly relative date
* @param int a Unix timestamp