// v11 var includeWithinCurrentFolder = true; var hideAll = false; if (typeof window.qsearchDisabled == 'undefined') { window.qsearchDisabled = true; fixQuickSearch(); $('div.searchInputDiv').click(fixQuickSearch); $('div.quickSearchFilters').click(fixQuickSearch); } return false; function fixQuickSearch() { setTimeout(function() { let start = 1; // Is there at least one custom search? if ($('select[ng-model="currentCustomFilter"] option').length>1) { // select first if no thing is selected if (!$('select[ng-model="currentCustomFilter"]').val()) { $('select[ng-model="currentCustomFilter"] option:eq(1)').prop('selected', true); } hideAll = true; // Hide all and keep first basic search } else { hideAll = false; // Otherwise } if (hideAll) { start = 0; } else { // Make sure first basic search is selected if (!$('#basicSearchSearchTextQuickSearch').is(':checked')) { // otherwise select it // $('a[ng-if="searchType"]:eq(1)').parent().click(); $('#basicSearchSearchTextQuickSearch').click(); $('lf-basic-search').find('input[type="checkbox"]:first').parent().show(); } } // Within current folder if (includeWithinCurrentFolder) { $('lf-within-folder-search select').val("string:2").change(); // enitre repo $('lf-within-folder-search').hide(); } // Other basic search for(let i=start; i<=4; i++) { if ($('lf-basic-search').find('input[type="checkbox"]:eq('+i+')').is(':checked')) { $('lf-basic-search').find('input[type="checkbox"]:eq('+i+')').click(); // unselect } $('lf-basic-search').find('input[type="checkbox"]:eq('+i+')').parent().hide(); } // Date $('lf-date-search-quick select').val('string:Anytime').change(); $('lf-date-search-quick').hide(); // Template $('lf-field-template-search').hide(); // if (includeWithinCurrentFolder || hideAll) $('.quickSearchOptionMenu li.divider:first').hide(); // if (includeWithinCurrentFolder && hideAll) $('.quickSearchOptionMenu li.divider:eq(1)').hide(); }, 1000); }