miguelfreitas / twister-html

twister HTML + Javascript User Interface
MIT License
229 stars 138 forks source link

new location hash scheme #353

Open slr opened 8 years ago

slr commented 8 years ago

I want to change current one as part of https://github.com/miguelfreitas/twister-html/issues/338

first, no base name for index page: /home.html -> /

then following changes by example of @RealVegOs's alias: /#profile?user=vegos -> /#/@vegos /#mentions?user=vegos -> /#/@vegos/mentions /#followers?user=vegos -> /#/@vegos/followers /#following?user=vegos -> /#/@vegos/following /#conversation?post=vegos:post14080 -> /#/@vegos/14080

hashtags: /#hashtag?hashtag=letsfixeverythin -> /#/tag/letsfixeverythin

login, network stats/config, options: /login.html -> /#/login /network.html -> /#/network /options.html -> /#/options

etc.

are you OK with that?

miguelfreitas commented 8 years ago

No objections!

thinking aloud: do we need the "/" in front of everything? I remember an old issue where the guy wanted to host twister-html into a subdirectory. Would it cause problems?

slr commented 8 years ago

do we need the "/" in front of everything?

there's need to read address:port/ instead of front /. but I believe you ask about the first slash after anchor tag. I don't know if we need this. it's a nice visual delimiter for me.

I remember an old issue where the guy wanted to host twister-html into a subdirectory. Would it cause problems?

according to RFC3986:

The path is terminated by the first question mark ("?") or number sign ("#") character, or by the end of the URI.

so all the chars after # is "fragment" (or location hash in browsers terminology). we may find examples of fragments which are similar to ours in section 5.4.2. Abnormal Examples and read about them there:

all URI parsers should be capable of resolving them consistently.

homlett commented 8 years ago

I'm the guy. That will be fine I think. I'll give you a feedback if I encounter problems. And I'm agree that would be great to improve the location hash scheme.

miguelfreitas commented 8 years ago

thanks @homlett for paying attention :-)

slr commented 7 years ago

/login.html -> /#/login

https://github.com/miguelfreitas/twister-html/commit/b1646914cb9fcff7a26c21e8e28427675ef1253d

slr commented 5 years ago

/profile-edit.html -> /#/account

https://github.com/miguelfreitas/twister-html/commit/cecd428e5d458ec58cc7eb8af68fac4421b9d1ed