File: append-css.rb

package info (click to toggle)
hiki 0.8.7-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,796 kB
  • ctags: 1,736
  • sloc: ruby: 20,269; lisp: 926; sh: 269; makefile: 12
file content (29 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (5)
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
# append-css.rb: $Revision: 1.1 $
#
# 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'].empty?
    <<-HTML
    <style type="text/css"><!--
    #{CGI::escapeHTML( @conf['append-css.css'] )}
    --></style>
    HTML
  else
    ''
  end
end

add_conf_proc( 'append-css', append_css_label ) do
  if @mode == 'saveconf'
    @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