newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

[Request] Image popup : pre-fill the URI to the media #36

Open Heraes-git opened 5 years ago

Heraes-git commented 5 years ago

In the context of HTML generation of images (<img>) and replacing of the native markdown syntax, the actual image manager looks like this :

2019-04-05_18h46m12s_sublime_text

Typing directly a media name doesn't work : we have to type the entire path to it.

Desired behavior

When opening the popup, several solutions could be feasible :

  1. The popup automatically fill the source field, with the page's URI as a prefix. The user could finish the job by typing a resource name.
  2. The popup propose to browse the actual page's medias, allowing the user to select a file.
  3. The user just type the name of the media, and the plugin will add the prefix during the generation of the src="" attribute.

And even, a last feature would be appreciated :

  1. The user can click'n'drag from the editor media library and dump it in the source field (wich isn't feasible for now, given that the popup send all the rest of the editor in background). Any of the n°1 or n°3 solution could terminate the job.
OndraX commented 4 years ago

Also looking for any sort of solution.

newbthenewbd commented 4 years ago

Actually, when the Insert button next to the media is clicked, the Source field should already be filled by the plugin, all the way since v1.1.0; if this does not work, there might be some sort of a browser compatibility issue behind it.

However, the soon-to-be next release of the plugin both deprecates the semi-absolute paths in favor of fully relative ones akin to these generated by Grav for Markdown, and makes dragging and dropping the media into the editor work correctly. Provided that this uses some new, complicated and unfortunately very hacky javascripts, and that there is thus a possibility of compatibility issues, I would love to receive feedback on the new implementation, installable as explained here.

Thanks!

Heraes-git commented 4 years ago

@newbthenewbd Hi, and sorry for the late answer. I've just installed your knew testing version, and it works ! :) You're the man !

newbthenewbd commented 4 years ago

Not at all late, or so I insist after taking over five months to answer the request... :upside_down_face: Should it randomly decide to somehow stop working within the (hopefully only) few days before a full-fledged release (or, worse yet, after that release is out), feel free and welcome to notify.

Thanks for the feedback!

nounours18200 commented 3 years ago

I use TinyMCE Editor Integration v1.2.7 provided with the latest version of GRAV , and it is still impossible to browse a directory in order to chose the image to be inserted. This a major pain and so a major request like Romarain said ! @Romarain and @newbthenewbd : you say that it works with a version issued in September 2019: how is it possible to get this "browse" function working ?

newbthenewbd commented 3 years ago

@nounours18200 Apologies for the late response. Indeed, to be clear, the latest version of the plugin does not have either an autocomplete feature or a file browser (that could browse the media of other pages or what have you) built in - which is the reason I've kept this feature request open.

However, in v1.3.0 it is possible to drag and drop the page's media into the editor, and, as in earlier versions, to click the Add button next to the media. These are the closest alternatives that we have right now in order to add the media comfortably.