Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 2768 Bytes
1 | function register_onload(func) { |
2 | Event.observe(window, 'load', func, false); |
3 | } |
4 | |
5 | function show_dates_as_local_time() { |
6 | var spans = document.getElementsByTagName('span'); |
7 | for (var i=0; i<spans.length; i++) { |
8 | if (spans[i].className.match(/\btypo_date\b/i)) { |
9 | spans[i].innerHTML = get_local_time_for_date(spans[i].title); |
10 | } |
11 | } |
12 | } |
13 | |
14 | function get_local_time_for_date(time) { |
15 | system_date = new Date(time); |
16 | user_date = new Date(); |
17 | delta_minutes = Math.floor((user_date - system_date) / (60 * 1000)); |
18 | if (Math.abs(delta_minutes) <= (8*7*24*60)) { // eight weeks... I'm lazy to count days for longer than that |
19 | distance = distance_of_time_in_words(delta_minutes); |
20 | if (delta_minutes < 0) { |
21 | return distance + ' from now'; |
22 | } else { |
23 | return distance + ' ago'; |
24 | } |
25 | } else { |
26 | return 'on ' + system_date.toLocaleDateString(); |
27 | } |
28 | } |
29 | |
30 | // a vague copy of rails' inbuilt function, |
31 | // but a bit more friendly with the hours. |
32 | function distance_of_time_in_words(minutes) { |
33 | if (minutes.isNaN) return ""; |
34 | minutes = Math.abs(minutes); |
35 | if (minutes < 1) return ('less than a minute'); |
36 | if (minutes < 50) return (minutes + ' minute' + (minutes == 1 ? '' : 's')); |
37 | if (minutes < 90) return ('about one hour'); |
38 | if (minutes < 1080) return (Math.round(minutes / 60) + ' hours'); |
39 | if (minutes < 1440) return ('one day'); |
40 | if (minutes < 2880) return ('about one day'); |
41 | else return (Math.round(minutes / 1440) + ' days') |
42 | } |
43 | |
44 | function commentAdded(request) { |
45 | Element.cleanWhitespace('commentList'); |
46 | new Effect.BlindDown($('commentList').lastChild); |
47 | if ($('dummy_comment')) { Element.remove('dummy_comment'); } |
48 | $('commentform').elements[3].value = ''; |
49 | $('commentform').elements[3].focus(); |
50 | } |
51 | |
52 | function failure(request) { |
53 | $('errors').innerHTML = request.responseText; |
54 | new Effect.Highlight('errors'); |
55 | } |
56 | |
57 | function loading() { |
58 | $('form-submit-button').disabled = true; |
59 | Element.show('comment_loading'); |
60 | new Element.hide('preview'); |
61 | } |
62 | |
63 | function complete(request) { |
64 | Element.hide('comment_loading'); |
65 | Element.show('commentform'); |
66 | $('form-submit-button').disabled = false; |
67 | |
68 | if (request.status == 200) { commentAdded() }; |
69 | } |
70 | |
71 | register_onload(function() { |
72 | if ($('commentform')) { |
73 | var _author = getCookie('author'); |
74 | var _url = getCookie('url'); |
75 | |
76 | if(_author != null) { $('commentform').elements['comment[author]'].value = _author } |
77 | if(_url != null) { $('commentform').elements['comment[url]'].value = _url } |
78 | |
79 | if ($('commentform').elements['comment[url]'].value != '' |
80 | || $('commentform').elements['comment[email]'].value != '') { |
81 | Element.show('guest_url'); Element.show('guest_email'); |
82 | } |
83 | } |
84 | }) |
85 | register_onload(function() { if ($('q')) {$('q').setAttribute('autocomplete', 'off');} }) |