Skip to content

JavaScript to help plugins interact with the fragment part of the URL #1144

@simonw

Description

@simonw

Suggested by Markus Holtermann on Twitter, who is building https://github.com/MarkusH/datasette-chartjs

I've been looking at datasette-vega for how you persist chart settings between form submissions. I've adopted that for datasette-chartjs. Any thoughts on adding a public JS API to #datasette itself, that plugins can rely on?

I'm talking about functions like onFragmentChange, serialize, unserialize, ... That turn an object into a URL encoded string and put it into the location's hash. And also updating all links/forms automatically.

Essentially, a plugins could do something like document.datasette.setConfigValue('prefix', 'foo', 'bar') and .getConfigValue('prefix', 'foo'). And the functions would take care of updating document.location.hash, all (necessary) a.href and form.action

https://twitter.com/m_holtermann/status/1338183973311295492

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions