diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-25 09:52:12 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-25 09:52:12 +0200 |
commit | db39fede97dc4d6b9a5caf739cb2c03b4dbdd21d (patch) | |
tree | 0d8c9f25deb067ce23e901c72f2af842e9002341 /core/js/js.js | |
parent | 843f15f3489856b518a30de4c803740844232209 (diff) | |
parent | 2d12e52769a30ba37d5760b1194f613bcc71035b (diff) | |
download | nextcloud-server-db39fede97dc4d6b9a5caf739cb2c03b4dbdd21d.tar.gz nextcloud-server-db39fede97dc4d6b9a5caf739cb2c03b4dbdd21d.zip |
Merge branch 'master' into appframework-master
Conflicts:
apps/files/lib/helper.php
apps/files_trashbin/lib/helper.php
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js index c09f80369f9..b7f7ff1ac15 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 @@ -906,7 +919,7 @@ OC.set=function(name, value) { * @param {type} start * @param {type} end */ -$.fn.selectRange = function(start, end) { +jQuery.fn.selectRange = function(start, end) { return this.each(function() { if (this.setSelectionRange) { this.focus(); @@ -922,6 +935,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 */ |