- [client] only show date taken section on "image" or "video" post type,
since only they can possess date taken metadata
(`client/html/post_readonly_sidebar.tpl`)
- [client] added `date-fns` as dependency (it's much cleaner to format
dates this way)
- [client] added basic sidebar stuff in `html/post_readonly_sidebar.tpl`
- [client] updated `js/models/post.js` to reflect changes
- [client] added `formatUserFriendlyTime()` in `js/util/misc.js`
- [client] added `makeUserFriendlyTime()` in `js/util/views.js` in
conjunction with it
- [misc] ran post-commit; previous commits did not
Print all links through new uri.js component
Refactor the router to use more predictable parsing
Fix linking to entities with weird names (that contain slashes, + etc.)
In e464e69 I removed href='#' but I noticed that it broke some things.
Readding href serves two purposes:
- it makes links reachable with Tab key
- it makes links clickable with Enter key
The alternative to this approach was to introduce [tabindex] and [role]
attributes. But not only using tabindex=0 with <a/> is questionable,
it'd require adding a keyboard handler that'd intercept space and return
key presses and simulated link clicks. Since it's best to leave this
kind of thing to the native UI, I went with readding hrefs instead. I
believe that hash hrefs, even though being a common practice, are silly,
so I decided to settle down with empty hrefs.
As a bonus, I added a snippet that prevents middle mouse clicks from
opening such links/buttons in new tabs, which was the motivation for
e464e69.