Jump to content

No-JS fallback for time in quote header (Also affects API)


TSP

Recommended Posts

Posted

I discovered something while investigating an issue. 

When a post with a quote is submitted to the database it stores it like this: 
 

<blockquote class="ipsQuote" data-gramm="false" data-ipsquote="" data-ipsquote-contentapp="forums" data-ipsquote-contentclass="forums_Topic" data-ipsquote-contentcommentid="25160025" data-ipsquote-contentid="1840499" data-ipsquote-contenttype="forums" data-ipsquote-timestamp="1573983633" data-ipsquote-userid="58981" data-ipsquote-username="TSP">
        <div class="ipsQuote_citation">
                TSP skrev (Akkurat nå):
        </div>

        <div class="ipsQuote_contents ipsClearfix" data-gramm="false">
                <p>
                        Kult!
                </p>
        </div>
</blockquote>

<p>
        Du er kul!
</p>`

 

Note what's within ipsQuote_citation. ("Akkurat nå" == "Just now")

You store the relative time as it was in the users browser when they generated the quote. The string is for the same reason also stored according to their current language settings. 

On display in the community you fix this all up with Javascript by using the data-attributes. 

However, I would argue you should replace it on storage with a non-relative time, and also use the default language of the community for it.

Changing this could provide a better experience for people with javascript disabled and developers utilizing the REST API.

Posted

We really only aim to make the site "work" if javascript is enabled. Beyond that....if you disable javascript, you should be used to the internet not working 100% as well as it does with javascript. 😛 

  • 3 weeks later...
Posted

I think there's a difference between "working" in its reduced capacity state and storing and displaying relative data. This should be fixed as @TPS has kindly pointed out. What about search engine spiders? Screenreaders?

I think we can have a higher standard than that.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...