Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 1114 Bytes
1 | class ThemeController < ApplicationController |
2 | caches_page :stylesheets, :javascript, :images |
3 | |
4 | def stylesheets |
5 | render_theme_item(:stylesheets, params[:filename], 'text/css') |
6 | end |
7 | |
8 | def javascript |
9 | render_theme_item(:javascript, params[:filename], 'text/javascript') |
10 | end |
11 | |
12 | def images |
13 | render_theme_item(:images, params[:filename]) |
14 | end |
15 | |
16 | def error |
17 | render :nothing => true, :status => 404 |
18 | end |
19 | |
20 | def static_view_test |
21 | end |
22 | |
23 | private |
24 | |
25 | def render_theme_item(type, file, mime = mime_for(file)) |
26 | render :text => "Not Found", :status => 404 and return if file.split(%r{[\\/]}).include?("..") |
27 | send_file Theme.current_theme_path + "/#{type}/#{file}", :type => mime, :disposition => 'inline', :stream => false |
28 | end |
29 | |
30 | def mime_for(filename) |
31 | case filename.downcase |
32 | when /\.js$/ |
33 | 'text/javascript' |
34 | when /\.css$/ |
35 | 'text/css' |
36 | when /\.gif$/ |
37 | 'image/gif' |
38 | when /(\.jpg|\.jpeg)$/ |
39 | 'image/jpeg' |
40 | when /\.png$/ |
41 | 'image/png' |
42 | when /\.swf$/ |
43 | 'application/x-shockwave-flash' |
44 | else |
45 | 'application/binary' |
46 | end |
47 | end |
48 | |
49 | |
50 | end |
51 |