Mercurial > hg
comparison mercurial/templates/monoblue/map @ 15375:fe9d36a6853e stable
hgweb: fix dynamic date calculation not working under Safari
While Chrome, Firefox, and IE 6+ support the current date format being
passed to Date(), Safari doesn't:
> new Date('Mon Oct 24 13:58:01 2011 +0200')
Invalid Date
However, the rfc822date format--officially supported by
ECMAScript[1]--does work:
> new Date('Mon, 24 Oct 2011 13:58:01 +0200')
Mon Oct 24 2011 04:58:01 GMT-0700 (PDT)
This change replaces all instances of {date|date} in HTML with
{date|rfc822date}. For elements that only have the "age" class,
there's no outward change for users with JavaScript enabled. For
elements with both the "age" and "date" classes, the full date
displayed uses the new format.
Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 7.0.1.
[1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Thu, 27 Oct 2011 11:57:08 -0700 |
parents | d5a65e3ee6b1 |
children | f208a4e20018 |
comparison
equal
deleted
inserted
replaced
15374:6cb8b46ea90a | 15375:fe9d36a6853e |
---|---|
139 <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a> | 139 <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a> |
140 </dd>' | 140 </dd>' |
141 tags = tags.tmpl | 141 tags = tags.tmpl |
142 tagentry = ' | 142 tagentry = ' |
143 <tr class="parity{parity}"> | 143 <tr class="parity{parity}"> |
144 <td class="nowrap age">{date|date}</td> | 144 <td class="nowrap age">{date|rfc822date}</td> |
145 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a></td> | 145 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a></td> |
146 <td class="nowrap"> | 146 <td class="nowrap"> |
147 <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | | 147 <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | |
148 <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | | 148 <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | |
149 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> | 149 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
150 </td> | 150 </td> |
151 </tr>' | 151 </tr>' |
152 bookmarks = bookmarks.tmpl | 152 bookmarks = bookmarks.tmpl |
153 bookmarkentry = ' | 153 bookmarkentry = ' |
154 <tr class="parity{parity}"> | 154 <tr class="parity{parity}"> |
155 <td class="nowrap date">{date|date}</td> | 155 <td class="nowrap date">{date|rfc822date}</td> |
156 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{bookmark|escape}</a></td> | 156 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{bookmark|escape}</a></td> |
157 <td class="nowrap"> | 157 <td class="nowrap"> |
158 <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | | 158 <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | |
159 <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | | 159 <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | |
160 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> | 160 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
161 </td> | 161 </td> |
162 </tr>' | 162 </tr>' |
163 branches = branches.tmpl | 163 branches = branches.tmpl |
164 branchentry = ' | 164 branchentry = ' |
165 <tr class="parity{parity}"> | 165 <tr class="parity{parity}"> |
166 <td class="nowrap age">{date|date}</td> | 166 <td class="nowrap age">{date|rfc822date}</td> |
167 <td><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{node|short}</a></td> | 167 <td><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{node|short}</a></td> |
168 <td class="{status}">{branch|escape}</td> | 168 <td class="{status}">{branch|escape}</td> |
169 <td class="nowrap"> | 169 <td class="nowrap"> |
170 <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | | 170 <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | |
171 <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | | 171 <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | |
194 branchtag = '<span class="branchtag" title="{name}">{name}</span> ' | 194 branchtag = '<span class="branchtag" title="{name}">{name}</span> ' |
195 inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> ' | 195 inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> ' |
196 bookmarktag = '<span class="bookmarktag" title="{name}">{name}</span> ' | 196 bookmarktag = '<span class="bookmarktag" title="{name}">{name}</span> ' |
197 shortlogentry = ' | 197 shortlogentry = ' |
198 <tr class="parity{parity}"> | 198 <tr class="parity{parity}"> |
199 <td class="nowrap age">{date|date}</td> | 199 <td class="nowrap age">{date|rfc822date}</td> |
200 <td>{author|person}</td> | 200 <td>{author|person}</td> |
201 <td> | 201 <td> |
202 <a href="{url}rev/{node|short}{sessionvars%urlparameter}"> | 202 <a href="{url}rev/{node|short}{sessionvars%urlparameter}"> |
203 {desc|strip|firstline|escape|nonempty} | 203 {desc|strip|firstline|escape|nonempty} |
204 <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span> | 204 <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span> |
209 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> | 209 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
210 </td> | 210 </td> |
211 </tr>' | 211 </tr>' |
212 filelogentry = ' | 212 filelogentry = ' |
213 <tr class="parity{parity}"> | 213 <tr class="parity{parity}"> |
214 <td class="nowrap age">{date|date}</td> | 214 <td class="nowrap age">{date|rfc822date}</td> |
215 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td> | 215 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td> |
216 <td class="nowrap"> | 216 <td class="nowrap"> |
217 <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> | <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> | <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> | 217 <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> | <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> | <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
218 {rename%filelogrename} | 218 {rename%filelogrename} |
219 </td> | 219 </td> |
222 indexentry = ' | 222 indexentry = ' |
223 <tr class="parity{parity}"> | 223 <tr class="parity{parity}"> |
224 <td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td> | 224 <td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td> |
225 <td>{description}</td> | 225 <td>{description}</td> |
226 <td>{contact|obfuscate}</td> | 226 <td>{contact|obfuscate}</td> |
227 <td class="age">{lastchange|date}</td> | 227 <td class="age">{lastchange|rfc822date}</td> |
228 <td class="indexlinks">{archives%indexarchiveentry}</td> | 228 <td class="indexlinks">{archives%indexarchiveentry}</td> |
229 <td> | 229 <td> |
230 <div class="rss_logo"> | 230 <div class="rss_logo"> |
231 <a href="{url}rss-log">RSS</a> | 231 <a href="{url}rss-log">RSS</a> |
232 <a href="{url}atom-log">Atom</a> | 232 <a href="{url}atom-log">Atom</a> |