Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Make image drag & drop mechanism pluggable #8662

Open
Leilei332 opened this issue Oct 4, 2024 · 1 comment
Open

[IDEA] Make image drag & drop mechanism pluggable #8662

Leilei332 opened this issue Oct 4, 2024 · 1 comment

Comments

@Leilei332
Copy link
Contributor

After #8486 was merged, the image & drop mechanism became hardcoded.

Although the mechanism was pluggable before, it still have problems like code duplication. So we need to update it to make it flexible enough to be customized.

Since the demand for pluggable image & drop mechanism isn't big at present, this is only a reminder for it. See the discussion in #8525.

@Leilei332
Copy link
Contributor Author

Leilei332 commented Nov 28, 2024

If we are going to pursue this at this time, we should also consider making sure the mechanism is flexible enough to support greater customizability within each mime type. Such as being able to support other user configurable syntaxes for wikitext. For example, in a tiddler tagged 'gallery' use the custom procedure 'gallery-image' and in other tiddlers use the procedure 'imagebox'.

@saqimtiaz I wonder whether this can be done by using parameters widget. For example in the original tiddler:

title: $:/core/ui/EditorToolbar/file-import
...


\procedure postImportActions()
...
\end

<$parameters import-actions=<<postImportActions>>>
...
</$parameters>

The actions can be overrided like this:

title: Example 1
condition: [tag[gallery-image]]

\procedure galleryActions()
...
\end

<$transclude $tiddler="$:/core/ui/EditorToolbar/file-import" import-actions=<<galleryActions>>/>

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

No branches or pull requests

1 participant