[Hiki-cvs 1484] [1029] fix incremental_search plugin

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 30日 (日) 23:46:47 JST


Revision: 1029
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1029
Author:   okkez
Date:     2009-08-30 23:46:47 +0900 (Sun, 30 Aug 2009)

Log Message:
-----------
fix incremental_search plugin

Modified Paths:
--------------
    hiki/branches/rack/misc/plugin/incremental_search.rb

Modified: hiki/branches/rack/misc/plugin/incremental_search.rb
===================================================================
--- hiki/branches/rack/misc/plugin/incremental_search.rb	2009-08-30 14:46:43 UTC (rev 1028)
+++ hiki/branches/rack/misc/plugin/incremental_search.rb	2009-08-30 14:46:47 UTC (rev 1029)
@@ -18,7 +18,7 @@
 
 def search
   as = Hiki::AjaxSearch.new( @cgi, @db, @conf )
-  @cgi.params['key'][0] ? as.search : as.form
+  @cgi.params['key'] ? as.search : as.form
 end
 
 module Hiki
@@ -76,7 +76,7 @@
     end
 
     def search
-      word = utf8_to_euc( @cgi.params['key'][0] )
+      word = utf8_to_euc( @cgi.params['key'] )
       r = ""
       unless word.empty? then
         total, l =****@db*****( word )
@@ -89,15 +89,13 @@
           r = "<ul>\n" + l.map{|i| "<li>#{i}</li>\n"}.join + "</ul>\n"
         end
       end
-      header = Hash::new
+      header = {}
       header['type'] = 'text/html'
       header['charset'] = 'EUC-JP'
       header['Content-Language'] =****@conf*****
       header['Pragma'] = 'no-cache'
       header['Cache-Control'] = 'no-cache'
-      print****@cgi*****( header )
-      print r
-      nil
+      ::Hiki::Response.new(r, 200, header)
     end
   end
 end




Hiki-cvs メーリングリストの案内
Back to archive index