Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 3259 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["comment_body"].value = ''; |
49 | $('commentform').elements["comment_body"].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 | function popup(mylink, windowname) |
72 | { |
73 | if (! window.focus) return true; |
74 | var href; |
75 | window.open(mylink, windowname, 'width=400,height=500,scrollbars=yes'); |
76 | return false; |
77 | } |
78 | |
79 | // From http://www.shawnolson.net/scripts/public_smo_scripts.js |
80 | function check_all(checkbox) { |
81 | var form = checkbox.form, z = 0; |
82 | for(z=0; z<form.length;z++){ |
83 | if(form[z].type == 'checkbox' && form[z].name != 'checkall'){ |
84 | form[z].checked = checkbox.checked; |
85 | } |
86 | } |
87 | } |
88 | |
89 | register_onload(function() { |
90 | if ($('commentform')) { |
91 | var _author = getCookie('typoapp_author'); |
92 | var _url = getCookie('typoapp_url'); |
93 | |
94 | if(_author != null) { $('commentform').elements['comment[author]'].value = _author } |
95 | if(_url != null) { $('commentform').elements['comment[url]'].value = _url } |
96 | |
97 | if ($('commentform').elements['comment[url]'].value != '' |
98 | || $('commentform').elements['comment[email]'].value != '') { |
99 | Element.show('guest_url'); Element.show('guest_email'); |
100 | } |
101 | } |
102 | }) |
103 | register_onload(function() { if ($('q')) {$('q').setAttribute('autocomplete', 'off');} }) |