files-search.mjs 1.0 KB

12
  1. /*! third party licenses: dist/vendor.LICENSE.txt */
  2. import{bS as l,bT as a,bQ as r}from"./core-common.mjs";import{R as d}from"./chunks/index-D0hy_tCT.mjs";import{l as o}from"./chunks/logger-R_K4lHwR.mjs";import"./chunks/preload-helper-BG02UnR2.mjs";import"./chunks/index-PaKKd09k.mjs";import"./chunks/_plugin-vue2_normalizer-VrK6B12S-BQkexw0P.mjs";import"./chunks/index-CiG5J8j_.mjs";function n(){const e=window.OCA;e.UnifiedSearch&&(o.info("Initializing unified search plugin: folder search from files app"),e.UnifiedSearch.registerFilterAction({id:"files",appId:"files",label:l("files","In folder"),icon:a("files","app.svg"),callback:()=>{d("Pick plain text files").addMimeTypeFilter("httpd/unix-directory").allowDirectories(!0).addButton({label:"Pick",callback:t=>{o.info("Folder picked",{folder:t[0]});const i=t[0];r("nextcloud:unified-search:add-filter",{id:"files",payload:i,filterUpdateText:l("files","Search in folder: {folder}",{folder:i.basename}),filterParams:{path:i.path}})}}).build().pick()}}))}document.addEventListener("DOMContentLoaded",n);