Feature/add zip download support#1
Open
ismism-learner wants to merge 3 commits into
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.