From 6be61200c529f7f61a89aac6158eb63026d7a44b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 15 Jun 2007 12:05:07 +0100 Subject: cgi search script fix, related to highlighting matches, changelog update, rest removal of hanging whitespace --- lib/sisu/v0/cgi_sql_common.rb | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v0/cgi_sql_common.rb') diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index 13f9c2a3..a71d5412 100644 --- a/lib/sisu/v0/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -111,6 +111,8 @@ module SiSU_CGI_sql @@limit,@@offset=1000,0 @base="#@hosturl_db/cgi-bin/#@version.cgi" @@canned_search_url=@base + @color_heading='#DDFFAA' + @color_match='#ffff48' class Form def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can='') search_note='' if checked_searched !~/\S/ @@ -658,7 +660,7 @@ module SiSU_CGI_sql end #metadata_found_body if c['tid'].to_i != oldtid.to_i - title=%{#{c['title']} by #{c['creator']} pdf portraitpdf landscape manifest ?
} if file_suffix=~/s/ #hmm watch file_suffix + title=%{#{c['title']} by #{c['creator']} pdf portraitpdf landscape manifest ?
} if file_suffix=~/s/ #hmm watch file_suffix if @text_search_flag; title='

'+title else title='
'+title end @@ -689,7 +691,13 @@ module SiSU_CGI_sql end else nil end - matched_para=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (c['body'].gsub(/(#@search_regx)/,'\1')) : c['body'] #check + matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=if c['body'] =~/\\1})) + end + matched + else c['body'] + end %{

ocn #{c['ocn']}:

#{matched_para}} elsif c['suffix'] =~/1/ #doc %{#{title}

ocn #{c['ocn']}:#{c['body']}} @@ -738,14 +746,21 @@ module SiSU_CGI_sql #metadata_found_endnotes if @text_search_flag if e['metadata_tid'].to_i != oldtid.to_i - title=%{


#{e['title']} by #{e['creator']} pdf portraitpdf landscape manifest ?
} if file_suffix=~/s/ + title=%{

#{e['title']} by #{e['creator']} pdf portraitpdf landscape manifest ?
} if file_suffix=~/s/ @counter_endn_doc+=1 oldtid=e['metadata_tid'].to_i else title = '' end if cgi['view']=~/text/ #% txt endnotes @counter_endn_ocn+=1 - matched_endnote=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) ? (e['body'].to_s.gsub(/(#@search_regx)/,'\1')) : e['body'] #check + matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=if e['body'] =~/\\1}) + #e['body'] + end + matched + else e['body'] + end output=%{#{title}
note
#{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} elsif cgi['view']=~/index/ #% idx endnotes @counter_endn_ocn+=1 -- cgit v1.2.3