plugins: deprecated second parameter of HFS.onEvent

Massimo Melina committed Apr 13, 2023 at 10:51 UTC e37b5895a56fcb94f71256fe4f78574e310310c0
2 files changed +5 -4
dev-plugins.md
+3 -2
@@ -162,7 +162,7 @@ API at this level is done with frontend-events, that you can handle by calling
162 ```typescript
163 HFS.onEvent(eventName, callback)
164
165 -//type callback = (parameters: object, HFS: object) => any
165 +//type callback = (parameters: object) => any
166 ```
167
168 Parameters of your callback and meaning of returned value varies with the event name.
@@ -239,7 +239,8 @@ HFS will scan through them in inverted alphabetical order searching for a compat
239
240 - 8.1 (v0.44.0)
241 - entry.cantOpen
242 - - HFS.apiCall, reloadList, logout
242 + - HFS.apiCall, reloadList, logout, h, React, state, t, _, dialogLib
243 + - second parameter of onEvent is now deprecated
244 - 8 (v0.43.0)
245 - entry.name & .uri
246 - tools.dialogLib
plugins/download-counter/public/main.js
+2 -2
@@ -2,8 +2,8 @@
2 const config = HFS.getPluginConfig()
3
4 const inMenu = config.where === 'menu'
5 - HFS.onEvent('additionalEntryProps', ({ entry: { hits } }, { t }) =>
6 - hits && !inMenu && `<span class="download-counter" title="${t`download counter`}">${hits}</span>`)
5 + HFS.onEvent('additionalEntryProps', ({ entry: { hits } }) =>
6 + hits && !inMenu && `<span class="download-counter" title="${HFS.t`download counter`}">${hits}</span>`)
7
8 HFS.onEvent('fileMenu', ({ entry, props }) => {
9 if (inMenu && !entry.isFolder)