keithjgrant / omnibear

A Micropub browser extension
MIT License
36 stars 8 forks source link

Edit Support When Viewing Authenticated Site #70

Open grantcodes opened 6 years ago

grantcodes commented 6 years ago

I don't know why I didn't think about doing this yet but omnibear is able to tell when you are viewing your own website, so you should totally be able to click on one of your own posts and delete or edit it

grantcodes commented 6 years ago

I managed to add delete support to a personal build really easily, editing will be much more difficult.

You can see the delete changes here: https://github.com/grantcodes/omnibear/commit/edc2013442dfc602500311493af2a92755bdd36e

I've not submitted a pull request because I had code formatting turned on and changed a whole load of junk, but I can tidy it up and make a pull request. It would just need a svg icon matching the other two

keithjgrant commented 6 years ago

Yeah, I’d love to get editing working, but the question of formatting is tricky. Do we convert to markdown or leave as raw HTML? (or something else?) I have a feeling this would need to vary based on a particular site’s use case.

grantcodes commented 6 years ago

I didn't even think about that issue.

In a basic case it could always just support replacing properties, with no need to pull the existing microformats from the site.

Actually now that I am thinking about it, it would absolutely be possible to use contenteditable in an extension to edit microformats posts inline since they are html. That would be a game changer actually! I may need to look into that...

sknebel commented 6 years ago

For formatting, why not pull the editable content from the micropub endpoint instead of using the parsed version from the page?

keithjgrant commented 6 years ago

Ooh, I didn’t realize you could fetch the HTML content from a micropub endpoint. That’s handy. Of course, editing HTML is trickier business than, say, markdown. But it should be do-able.