diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-11-18 17:18:08 +0400 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-11-18 17:18:08 +0400 |
commit | cb656c8321e71812809044c19525bf0b9a639b2c (patch) | |
tree | 68db8641d168fa0076a34d0c22778bd2c891df13 /core | |
parent | 477e3a8b87f9a3df3bfd6f4e457971f32a3e5fe8 (diff) |
backport search scrollto & filter to stable5
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 586d698f3a2..73711b3fbc5 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -666,11 +666,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{ @@ -808,6 +814,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 @@ -892,6 +905,15 @@ $.fn.selectRange = function(start, end) { }; /** + * check if an element exists. + * allows you to write if ($('#myid').exists()) to increase readability + * @link http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery + */ +jQuery.fn.exists = function(){ + return this.length > 0; +}; + +/** * Calls the server periodically every 15 mins to ensure that session doesnt * time out */ |