Skip to content

use html5 history API instead of hash #101

Open
@therewasaguy

Description

@therewasaguy

we've been using hash to load sketches without refreshing the page like this:

http://p5ide.herokuapp.com/editor#?sketch=568d9514f60b940300d5f2fd

@antiboredom suggests we use HTML History API instead like this http://p5ide.herokuapp.com/editor/sketch/568d9514f60b940300d5f2fd

because

  1. the url looks nicer, and
  2. it may help with Upload "assets" (i.e. JSON, Images, Audio, Video, text files) #100, to loading files by relative paths in methods like loadJSON('data.json'). If we the server gets a request from http://p5ide.herokuapp.com/editor/sketch/568d9514f60b940300d5f2fd/assets/myimage.jpg we could see that the request is for that particular project, and return the image associated with that project that has that name.

To accomplish this, we can incorporate the vue-router module which we have not started using yet (it may not have been finished when the project began): http://vuejs.github.io/vue-router/en/api/properties.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions