cosmocode / dokuwiki-plugin-imgpaste

Add images to DokuWiki pages by simply pasting them. Only modern browsers supported
https://www.dokuwiki.org/plugin:imgpaste
10 stars 10 forks source link

Insert relative media references if possible #36

Closed annda closed 1 month ago

splitbrain commented 1 month ago

Well, I guess this works, but I am a bit surprised that you implemented it in PHP. Couldn't you continue to return an absolute ID in the AJAX call and pass it to LinkWizard.createRelativeLink in the JavaScript that handles the returned data?

annda commented 1 month ago

I could use the Javascript function as soon as it is merged into core and available in the next release, or leave this PR hanging here until the next release.

Which way do you prefer?

splitbrain commented 1 month ago

I think I would prefer a simple check for the existence of the LinkWizard class. When available use the method, if not use the absolute ID.

annda commented 1 month ago

I have removed the PHP implementation and we just call the LinkWizard function if it is available.