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:
- 1195 Bytes
1 | class ThemeController < ContentController |
2 | caches_page :stylesheets, :javascript, :images |
3 | session :off |
4 | |
5 | def stylesheets |
6 | render_theme_item(:stylesheets, params[:filename], 'text/css; charset=utf-8') |
7 | end |
8 | |
9 | def javascript |
10 | render_theme_item(:javascript, params[:filename], 'text/javascript; charset=utf-8') |
11 | end |
12 | |
13 | def images |
14 | render_theme_item(:images, params[:filename]) |
15 | end |
16 | |
17 | def error |
18 | render :nothing => true, :status => 404 |
19 | end |
20 | |
21 | def static_view_test |
22 | end |
23 | |
24 | private |
25 | |
26 | def render_theme_item(type, file, mime = nil) |
27 | mime ||= mime_for(file) |
28 | if file.split(%r{[\\/]}).include?("..") |
29 | render :text => "Not Found", :status => 404 |
30 | return |
31 | end |
32 | send_file(this_blog.current_theme.path + "/#{type}/#{file}", |
33 | :type => mime, :disposition => 'inline', :stream => false) |
34 | end |
35 | |
36 | def mime_for(filename) |
37 | case filename.downcase |
38 | when /\.js$/ |
39 | 'text/javascript' |
40 | when /\.css$/ |
41 | 'text/css' |
42 | when /\.gif$/ |
43 | 'image/gif' |
44 | when /(\.jpg|\.jpeg)$/ |
45 | 'image/jpeg' |
46 | when /\.png$/ |
47 | 'image/png' |
48 | when /\.swf$/ |
49 | 'application/x-shockwave-flash' |
50 | else |
51 | 'application/binary' |
52 | end |
53 | end |
54 | |
55 | |
56 | end |
57 |