Changeset 7743 for platform/tdiary/util
- Timestamp:
- 03/10/08 06:14:04 (9 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/util/tdiarysearch/search.rb (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/util/tdiarysearch/search.rb
r4633 r7743 26 26 # 27 27 28 def unindent(str , n)29 str.gsub(/^ {0,#{n}}/, '')30 end 31 32 HEADER = unindent (<<-'EOS', 2)28 def unindent(str) 29 str.gsub(/^#{str[/\A(?:\t+| +)/]}/, '') 30 end 31 32 HEADER = unindent <<'EOS' 33 33 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 34 <html lang="ja -JP">34 <html lang="ja"> 35 35 <head> 36 <meta http-equiv="Content-Type" content="text/html; charset= euc-jp">37 <meta http-equiv="Content-Language" content="ja -JP">36 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 37 <meta http-equiv="Content-Language" content="ja"> 38 38 <meta name="robots" content="noindex"> 39 39 <link rel="stylesheet" href="theme/base.css" type="text/css" media="all"> … … 44 44 EOS 45 45 46 FOOTER = unindent (<<'EOS', 2)46 FOOTER = unindent <<'EOS' 47 47 </body> 48 48 </html> 49 49 EOS 50 50 51 SEARCH_FORM = unindent (<<"EOS", 2)51 SEARCH_FORM = unindent <<"EOS" 52 52 <form method="post" action="#{File.basename(__FILE__)}"> 53 53 <input type="text" name="q" size="20" value="<%= patterns.map {|re| escape(re.source) }.join(' ') %>"> … … 61 61 EOS 62 62 63 SEARCH_PAGE = unindent (<<-"EOS", 2)63 SEARCH_PAGE = unindent <<"EOS" 64 64 <h1>tDiary Search</h1> 65 65 #{SEARCH_FORM} … … 68 68 TOO_MANY_HITS = 50 69 69 70 SEARCH_RESULT = unindent (<<-"EOS", 2)70 SEARCH_RESULT = unindent <<"EOS" 71 71 <h1>tDiary Search: Search Result</h1> 72 72 #{SEARCH_FORM} … … 95 95 EOS 96 96 97 SEARCH_ERROR = unindent (<<"EOS", 2)97 SEARCH_ERROR = unindent <<"EOS" 98 98 #{SEARCH_FORM} 99 99 <%= escape(reason) %>. 100 100 EOS 101 101 102 HISTORY = unindent (<<"EOS", 2)102 HISTORY = unindent <<"EOS" 103 103 <h1>tDiary Search: Search History</h1> 104 104 #{SEARCH_FORM} … … 134 134 135 135 def main 136 $KCODE = ' EUC'136 $KCODE = 'u' 137 137 cgi = CGI.new 138 138 @config = TDiary::Config.new(cgi) … … 182 182 print cgi.header('status' => '200 OK', 183 183 'type' => 'text/html', 184 'charset' => ' euc-jp',184 'charset' => 'utf-8', 185 185 'Content-Length' => html.length.to_s, 186 186 'Cache-Control' => 'no-cache', … … 388 388 389 389 def tdiary2text(html) 390 apply_tdiary_plugins(html).gsub(%r[< .*?>]em, '').slice(/\A.{0,120}/me)390 apply_tdiary_plugins(html).gsub(%r[<[^>]*>]em, '').slice(/\A.{0,120}/me) 391 391 end 392 392 … … 433 433 434 434 def urlencode(str) 435 str.gsub(/[^\w \-]/n) {|ch| sprintf('%%%02x', ch[0]) }435 str.gsub(/[^\w-]/n) {|ch| sprintf('%%%02x', ch[0]) } 436 436 end 437 437
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)