Skip to content

Feature/add zip download support#1

Open
ismism-learner wants to merge 3 commits into
mainfrom
feature/add-zip-download-support
Open

Feature/add zip download support#1
ismism-learner wants to merge 3 commits into
mainfrom
feature/add-zip-download-support

Conversation

@ismism-learner

Copy link
Copy Markdown
Owner

No description provided.

…UI generation for parameters with a "fieldName" of "select".

Previously, only "value" and "text" field types would generate a user-editable input box. This change updates the `_build_editor_ui` method to also create a text input field for any API parameter defined with `"fieldName": "select"`, allowing users to customize these values directly in the UI before running a request.
This commit refactors the core file discovery logic of the Tampermonkey script to robustly support `.zip` files alongside existing media types.

The previous implementation relied on a fragile DOM traversal (`findTimeStr`) that failed when the HTML structure for `.zip` files differed from that of images or videos.

The new implementation now:
- Identifies the common parent container (`.history-item`) for all downloadable files.
- Scans within each container to reliably associate the download trigger (`span.anticon-ellipsis`) with its corresponding timestamp (`div.history-create-time`).
- This makes the script resilient to minor structural variations between different file types.
- Removes the now-obsolete `findTimeStr` function and updates the script's initialization and core logic to use this more reliable method.
This commit completely refactors the script to correctly handle all identified use cases, including items with and without timestamps, multiple files per task, and varied HTML structures for the download trigger.

The final, correct logic is as follows:
1.  Identify all visual download indicators (`span.anticon-ellipsis`).
2.  For each indicator, find its closest clickable parent with the `.ant-dropdown-trigger` class. This is the true download element.
3.  From this trigger element, find the parent `.history-item` container to locate an optional, shared timestamp.
4.  A second pass populates a `timeStr` for every item, implementing a "look-behind" logic to fill in missing timestamps.
5.  The UI is updated to use this robust data, including the time-display fallback.

This implementation is resilient, correct, and fully addresses the complex requirements discovered through iterative user feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant