File: append-css.rb

package info (click to toggle)
tdiary 2.0.2%2B20060303-5
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 8,172 kB
  • ctags: 1,957
  • sloc: ruby: 23,926; lisp: 514; makefile: 87; sh: 71; sql: 32
file content (44 lines) | stat: -rw-r--r-- 946 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# append-css.rb: $Revision: 1.5 $
#
# Append CSS fragment via Preferences Page.
#
# Copyright (c) 2002 TADA Tadashi <sho@spc.gr.jp>
# Distributed under the GPL
#
add_header_proc do
	if @conf['append-css.css'] and @conf['append-css.css'].length > 0 then
		<<-HTML if @conf['append-css.css']
		<style type="text/css"><!--
		#{@conf['append-css.css']}
		--></style>
		HTML
	else
		''
	end
end

unless @resource_loaded then
	def append_css_label
		'CSSɲ'
	end

	def append_css_desc
		<<-HTML
		<h3>CSS</h3>
		<p>߻ꤷƤơޤˡ륷Ȥɲꤹ硢
		ʲCSSҤϤƤ</p>
		HTML
	end
end

add_conf_proc( 'append-css', append_css_label ) do
	if @mode == 'saveconf' then
		@conf['append-css.css'] = @cgi.params['append-css.css'][0]
	end

	<<-HTML
	#{append_css_desc}
	<p><textarea name="append-css.css" cols="70" rows="15">#{CGI::escapeHTML( @conf['append-css.css'].to_s )}</textarea></p>
	HTML
end