dx: renamed props to details, for avoid confusion

Massimo Melina committed Apr 20, 2023 at 10:44 UTC 9b6d590710c3ab45250a05703516c6e3a06839a9
4 files changed +9 -8
dev-plugins.md
+3 -2
@@ -177,8 +177,8 @@ Some frontend-events can return Html, which can be expressed in several ways
177
178 This is a list of available frontend-events, with respective object parameter and output.
179
180 -- `additionalEntryProps`
181 - - you receive each entry of the list, and optionally produce HTML code that will be added in the `entry-props` container.
180 +- `additionalEntryDetails`
181 + - you receive each entry of the list, and optionally produce HTML code that will be added in the `entry-details` container.
182 - parameter `{ entry: Entry }`
183
184 The `Entry` type is an object with the following properties:
@@ -241,6 +241,7 @@ HFS will scan through them in inverted alphabetical order searching for a compat
241 - entry.cantOpen
242 - HFS.apiCall, reloadList, logout, h, React, state, t, _, dialogLib
243 - second parameter of onEvent is now deprecated
244 + - renamed: additionalEntryProps > additionalEntryDetails & entry-props > entry-details
245 - 8 (v0.43.0)
246 - entry.name & .uri
247 - tools.dialogLib
frontend/src/BrowseFiles.ts
+4 -4
@@ -219,7 +219,7 @@ const Entry = memo(({ entry, midnight, separator }: EntryProps) => {
219 ),
220 h(CustomCode, { name: 'afterEntryName', props: { entry } }),
221 h('div', { className: 'entry-panel' },
222 - h(EntryProps, { entry, midnight }),
222 + h(EntryDetails, { entry, midnight }),
223 (!menuOnLink || isFolder && mobile) && h('button', { className: 'file-menu-button', onClick: openFileMenu }, hIcon('menu')),
224 ),
225 h('div'),
@@ -281,14 +281,14 @@ const Entry = memo(({ entry, midnight, separator }: EntryProps) => {
281 }
282 })
283
284 -const EntryProps = memo(({ entry, midnight }: { entry: DirEntry, midnight: Date }) => {
284 +const EntryDetails = memo(({ entry, midnight }: { entry: DirEntry, midnight: Date }) => {
285 const { t: time, s } = entry
286 const today = time && time > midnight
287 const shortTs = isMobile()
288 const {t} = useI18N()
289 const dd = '2-digit'
290 - return h('div', { className: 'entry-props' },
291 - h(CustomCode, { name: 'additionalEntryProps', props: { entry } }),
290 + return h('div', { className: 'entry-props entry-details' }, // entry-props is legacy
291 + h(CustomCode, { name: 'additionalEntryDetails', props: { entry } }),
292 entry.p?.match(entry.isFolder ? /l/i : /r/i) && hIcon('password', { className: 'miss-perm', title: t(MISSING_PERM) }),
293 h(EntrySize, { s }),
294 time && h('span', {
frontend/src/index.scss
+1 -1
@@ -255,7 +255,7 @@ ul.dir {
255 @extend .icon-button;
256 margin: -3px 0 -3px 0.4em;
257 }
258 - & .entry-props {
258 + & .entry-details {
259 font-size: 90%;
260 margin-left: 4px;
261 font-variant-numeric: tabular-nums; /* trick to get stuff aligned */
plugins/download-counter/public/main.js
+1 -1
@@ -2,7 +2,7 @@
2 const config = HFS.getPluginConfig()
3
4 const inMenu = config.where === 'menu'
5 - HFS.onEvent('additionalEntryProps', ({ entry: { hits } }) =>
5 + HFS.onEvent('additionalEntryDetails', ({ entry: { hits } }) =>
6 hits && !inMenu && `<span class="download-counter" title="${HFS.t`download counter`}">${hits}</span>`)
7
8 HFS.onEvent('fileMenu', ({ entry, props }) => {