diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v0/css.rb | 1 | ||||
-rw-r--r-- | lib/sisu/v0/dal_syntax.rb | 5 | ||||
-rw-r--r-- | lib/sisu/v0/help.rb | 11 | ||||
-rw-r--r-- | lib/sisu/v0/html_format.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v0/html_promo.rb | 52 | ||||
-rw-r--r-- | lib/sisu/v0/html_scroll.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v0/odf.rb | 9 | ||||
-rw-r--r-- | lib/sisu/v0/param.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v0/param_identify_markup.rb | 7 | ||||
-rw-r--r-- | lib/sisu/v0/sst_identify_markup.rb | 22 | ||||
-rw-r--r-- | lib/sisu/v0/sysenv.rb | 176 |
11 files changed, 193 insertions, 104 deletions
diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index df53f46a..d1e6832a 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -434,6 +434,7 @@ WOK } li { background: url(../image/bullet_red.png) no-repeat 0px 6px; + /* list-style-type: disc; */ padding-left: 20px; display: block; font-family: #{fonts}; diff --git a/lib/sisu/v0/dal_syntax.rb b/lib/sisu/v0/dal_syntax.rb index dfa7478d..703d9f1b 100644 --- a/lib/sisu/v0/dal_syntax.rb +++ b/lib/sisu/v0/dal_syntax.rb @@ -185,7 +185,7 @@ module Syntax # _2 <:i2> #indent paragraph 2 steps # _3 <:i3> #indent paragraph 3 steps # _4 <:i4> #indent paragraph 4 steps - # _* #bullet (list) + # _* #bullet (list) ● # _1* #bullet (list) indented # _1* #bullet (list) indented # # #numbered (list) level 1 @@ -209,6 +209,9 @@ module Syntax line=line_array.join(' ') line=line.strip end + line.gsub!(/^(1~\??) @title\s+(?:(by\s+)?(?:@creator|@author))\s*$/,"\\1 #{@md.title} - #{@md.subtitle},<br />\\2#{@md.dc_creator}") + line.gsub!(/^(1~\??) @title\s*$/,"\\1 #{@md.title} - #{@md.subtitle}") # + line.gsub!(/^([23]~\??) (?:(by\s+)?(?:@creator|@author))\s*$/,"\\1 \\2#{@md.dc_creator}") # line.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup line.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }http://www.jus.uio.no/sisu') #adjustment 2005w30 line.gsub!(/<!(\S+)!>/,'<:\1>') #escaped special character diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb index 4e7a60f9..e22808d1 100644 --- a/lib/sisu/v0/help.rb +++ b/lib/sisu/v0/help.rb @@ -1498,7 +1498,7 @@ WOK sisu-0.38 is provided with 0.38 markup samples sample marked up documents are provided in directory: - #{@cX.green}sisu-exampless/sample/document_samples_sisu_markup/#{@cX.off} + #{@cX.green}sisu-examples/sample/document_samples_sisu_markup/#{@cX.off} and online #{@cX.green}www.jus.uio.no/sisu#{@cX.off} WOK @@ -1710,7 +1710,7 @@ WOK Note on databases built By default, [unless otherwise specified] databases are built on a directory basis, from collections of documents within that directory. The name of the directory you choose to work from is used as the database name, - i.e. if you are working in a directory called #{@cX.blue}#{@env.path.home}/ebook#{@cX.off} the database #{@cX.blue}ebook#{@cX.off} is used. [otherwise a manual mapping for the collection is necessary] + i.e. if you are working in a directory called #{@cX.blue}#{@env.path.home}/ebook#{@cX.off} the database #{@cX.blue}SiSU_ebook#{@cX.off} is used. [otherwise a manual mapping for the collection is necessary] WOK help_search help_general @@ -1728,9 +1728,6 @@ WOK See the documentation for hyperestraier #{@cX.blue} http://hyperestraier.sourceforge.net/ - http://hyperestraier.sourceforge.net/intro-en.html - http://hyperestraier.sourceforge.net/uguide-en.html - http://hyperestraier.sourceforge.net/pguide-en.html file:///usr/share/doc/hyperestraier/index.html #{@cX.off} #{@cX.orange} @@ -1778,14 +1775,14 @@ WOK (ii) edit #{@cX.green}estseek.conf#{@cX.off}, with attention to the lines starting 'indexname:' and 'replace:': #{@cX.green} indexname: #{@env.path.webserv}/casket - replace: ^file://#{@env.path.webserv}{{!}}#{@env.url.webrick_base} + replace: ^file://#{@env.path.webserv}{{!}}#{@env.url.webserv_host_base} replace: /index\.html?${{!}}/ #{@cX.off} (C) to test using webrick, start webrick: #{@cX.green} sisu -W #{@cX.off} and try open the url: #{@cX.blue} - #{@env.url.webrick_base}/cgi-bin/estseek.cgi #{@cX.off} + #{@env.url.webserv_host_base}/cgi-bin/estseek.cgi #{@cX.off} WOK end diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index c568a509..29700e83 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -208,7 +208,7 @@ module SiSU_HTML_Format end def search env=SiSU_Env::Info_env.new(@md.fns,@md) - env.widget.search_form + env.widget.search_form('sisusearch',nil,nil,true) end def manifest %{<td align="center" bgcolor=#{@vz.color_band2}> diff --git a/lib/sisu/v0/html_promo.rb b/lib/sisu/v0/html_promo.rb index cc60f4c9..c4e18184 100644 --- a/lib/sisu/v0/html_promo.rb +++ b/lib/sisu/v0/html_promo.rb @@ -143,25 +143,35 @@ module SiSU_HTML_promo def blurb @prod['blurb'] ? %{<p class="pane_blurb">#{@prod['blurb']}</p>} : '' end - def search_form + def search_form_sisu(table=true) db=if @prod['db']=~/\S+/ @prod['db']=~/^SiSU_\S+/ ? @prod['db'] : "SiSU_#{@prod['db']}" - elsif defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - @rc['search']['db']=~/^SiSU_\S+/ ? @prod['search']['db'] : "SiSU_#{@prod['db']}" + elsif defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/ + @rc['search']['sisu']['db']=~/^SiSU_\S+/ ? @prod['search']['sisu']['db'] : "SiSU_#{@prod['db']}" else nil end - #target=@prod['target']=~/^\S+/ ? @prod['target'] : '_top' action=if @prod['action']=~/^http:\/\// @prod['action'] - elsif defined? @rc['search']['action'] and @rc['search']['action'] =~/^http:\/\// - @rc['search']['action'] + elsif defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/^http:\/\// + @rc['search']['sisu']['action'] else nil end form=if action and db - '<br />' + @env.widget.search_form(action,db) + '<br />' + @env.widget.search_form('sisusearch',action,db,table) else '' end end + def search_form_hyperestraier(table=true) + action=if defined? @rc['search']['hyperestraier']['action'] and @rc['search']['hyperestraier']['action'] =~/^http:\/\// + @rc['search']['hyperestraier']['action'] + else nil + end + form=if action + '<br />' + @env.widget.search_form('hyperestraier',action,'',table) + else '' + end + form + end def links if @prod['links'] #and @prod['links'] == Array links_a=[] @@ -268,10 +278,15 @@ WOK #{cell.links} WOK end - def output_form_search(type,id) + def output_form_search_sisu(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) - cell.search_form + cell.search_form_sisu(false) + end + def output_form_search_hyperestraier(type,id) + prod_id=id.gsub(/id_/,'') + cell=cell(@ad[:promo][type][id],prod_id) + cell.search_form_hyperestraier(false) end def output_form_book(type,id) prod_id=id.gsub(/id_/,'') @@ -329,7 +344,10 @@ WOK when /sponsor/ output_form_sponsor(type,id) when /search/ - output_form_search(type,id) + if id=~/hyperestraier/ + output_form_search_hyperestraier(type,id) + else output_form_search_sisu(type,id) + end when /book/ output_form_book(type,id) when /journal/ @@ -338,13 +356,13 @@ WOK output_form_conference(type,id) end end - def advert_extract_single(type,id) #extracts single item of type with id - #type === book,journal,conference,sponsor - id=id.to_s.gsub(/^(\d)/,'id_\1') - if defined? @ad[:promo][type][id] and @ad[:promo][type][id] - output_form_select(type,id) - end - end + #def advert_extract_single(type,id) #extracts single item of type with id + # #type === book,journal,conference,sponsor + # id=id.to_s.gsub(/^(\d)/,'id_\1') + # if defined? @ad[:promo][type][id] and @ad[:promo][type][id] + # output_form_select(type,id) + # end + #end def advert_extract_subject(category) #extracts products from category/subject list adverts=[] if defined? @ad[:promo_list][category] and @ad[:promo_list][category] diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb index 3739f660..b2cfb497 100644 --- a/lib/sisu/v0/html_scroll.rb +++ b/lib/sisu/v0/html_scroll.rb @@ -140,7 +140,6 @@ module SiSU_HTML_scroll format_seg=SiSU_HTML_Format_type::Format_seg.new(@md,one,two) para=format_seg.no_paranum end - #para=para.gsub(/ [2-6]~\S+ /,'') #and @md.cmd =~/[VM]/ #arbitrary, watch problematic as too general para='' if (para =~/<a name="n\d+">/ and para =~/^(?:\^~\d+\s|<!e[:_]\d+!>)/) # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though if para =~/<:center>/ #rules changed now a <p class="center" problems may arise 2005w11 ! one,two=/(.*)<:center>(.*)/.match(para).captures @@ -153,9 +152,6 @@ module SiSU_HTML_scroll unless @rcdc; @scr[:body] << para unless para =~/\A\s*\Z/ else @scr[:metadata] << para end - #unless meta; @scr[:body] << para unless para =~/\A\s*\Z/ - #else @scr[:metadata] << meta - #end end end @scr diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index f6d6d942..11d14bf2 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -465,16 +465,15 @@ module SiSU_ODF para=para_array.join(' ') para=para.strip end - para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.25cm" svg:height="0.25cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_red.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_red.png - #para.gsub!(/^_\*\s+/,'<text:span text:style-name="T6">·</text:span> ') #bullet + para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.22cm" svg:height="0.22cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_red.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_red.png + #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<text:span text:style-name="T6">●</text:span> ') #bullet + #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1● ') # bullet utf8, make smaller if used + #para.gsub!(/^_\*\s+/,'<text:span text:style-name="T6">●</text:span> ') #bullet para.gsub!(/^(<:i[1-9]>)\s+_\*\s+/,'\1 <text:span text:style-name="T6">·</text:span> ') #bullet - #para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.25cm" svg:height="0.25cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_red.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_red.png - #para.gsub!(/^(<:i[1-9]>)\s+_\*\s+/,'\1 <text:span text:style-name="T6">·</text:span> ') #bullet para.gsub!(/<br>/,'<br />') para.gsub!(/<:p[bn]>/,'<text:p text:style-name="P8"> </text:p>') para.gsub!(/©/,'©') #too arbitrary para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check - #para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down para.gsub!(/<b>(.+?)<\/b>/,'<text:span text:style-name="T1">\1</text:span>') para.gsub!(/<i>(.+?)<\/i>/,'<text:span text:style-name="T2">\1</text:span>') para.gsub!(/<u>(.+?)<\/u>/,'<text:span text:style-name="T3">\1</text:span>') diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index 186901a1..9462d8d2 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -199,10 +199,10 @@ module SiSU_Param fns_array=@data.dup skip unless fns_array # consider @markup_version=SiSU_Markup::Markup_identify.new(fns_array,@opt).markup_version? #% determine markup version - if fns_array[0] =~ /^(?:% )?(?:SiSU\s+[\d.]*|sisu-[\d.]+)$/ #check markup and markup version - if fns_array[0] =~ /^(?:% )?(?:SiSU\s+|sisu-)[\d.]+$/ #check markup and markup version - @markup_version_declared=fns_array[0].match(/^(?:% )?(?:SiSU\s+|sisu-)([\d.]+)$/)[1] - sm_a,sm_b,sm_c=fns_array[0].match(/^(?:% )?(?:SiSU\s+|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3] + if fns_array[0] =~ /^(?:% )?(?:SiSU\s+(?:master\s+)?[\d.]*|sisu-[\d.]+)$/ #check markup and markup version + if fns_array[0] =~ /^(?:% )?(?:SiSU\s+(?:master\s+)?|sisu-)[\d.]+$/ #check markup and markup version + @markup_version_declared=fns_array[0].match(/^(?:% )?(?:SiSU\s+(?:master\s+)?|sisu-)([\d.]+)$/)[1] + sm_a,sm_b,sm_c=fns_array[0].match(/^(?:% )?(?:SiSU\s+(?:master\s+)?|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3] sm_c ||=0 sv=if @cmd =~/[VMv]/; "SiSU version (#{@sisu_version[:version]})" else '' diff --git a/lib/sisu/v0/param_identify_markup.rb b/lib/sisu/v0/param_identify_markup.rb index 21e796e8..93c8bf79 100644 --- a/lib/sisu/v0/param_identify_markup.rb +++ b/lib/sisu/v0/param_identify_markup.rb @@ -71,8 +71,13 @@ module SiSU_Markup elsif @cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @version_declared=$1 end - @flag_38=false + @flag_57,@flag_38=false,false @cont.each_with_index do |y,i| + if @flag_57 or y =~/^:?A~\?? @title/ + @version_determined=0.57 + @flag_57=true + break + end if @flag_38 or y =~/^:?A~/ @version_determined=0.38 @flag_38=true diff --git a/lib/sisu/v0/sst_identify_markup.rb b/lib/sisu/v0/sst_identify_markup.rb index e7a3c9eb..19601c13 100644 --- a/lib/sisu/v0/sst_identify_markup.rb +++ b/lib/sisu/v0/sst_identify_markup.rb @@ -107,13 +107,19 @@ WOK elsif cont[0] =~ /^(?:%\s+)?SiSU\s+([0-9](?:\.[0-9]+){1,2})/ or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @declared_markup=$1 end - @flag_38=false + @flag_57,@flag_38=false,false cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ links=unless y =~/\{.+?\}\S+/; oldlinks=' (pre 0.20.4 header links)' else ' (post 0.20.4 header links)' end end + if @flag_57 or y =~/^:?A~\?? @title/ + version='0.57' + markup=Markup_inform.new(version,'0.57' + oldlinks,@declared_markup,@declared_type) + @flag_57=true + break + end if @flag_38 or (y =~/^:?A~/ and f =~/(?:\.sst|\.ssm|\.ssi)/) version='0.38' markup=Markup_inform.new(version,'0.38' + oldlinks,@declared_markup,@declared_type) @@ -196,6 +202,16 @@ WOK def initialize(opt) @opt=opt end + def sisu_0_57 + <<WOK + SiSU 0.57 is the same as 0.42 with the introduction of some a shortcut to use + the headers @title and @creator in the first heading [expanded using the + contents of the headers @title: and @author:] + + :A~ @title by @author + +WOK + end def sisu_0_42 <<WOK SiSU 0.42 is the same as 0.38 with the introduction of some additional endnote types, @@ -300,7 +316,9 @@ WOK tell=if @opt.mod.inspect =~/--query/ tell=case @opt.mod.inspect when /history/ - "#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}" + "#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}" + when /0.57/ + "#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.42/ "#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.38/ diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 9052ac91..0f6652b8 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -828,59 +828,85 @@ module SiSU_Env @flag end def search? - flag=if defined? @rc['search'] and - defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - flag=if promo?[:ad] - false - elsif defined? @vz.widget_search and @vz.widget_search == true - true - elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true - true - else - false + searches=['sisu','hyperestraier'] + flag=false + if defined? @rc['search'] + searches.each do |type| + flag=if defined? @rc['search'][type] and + defined? @rc['search'][type]['action'] and + @rc['search'][type]['flag']==true and + @rc['search'][type]['action'] =~/http:\/\// #and + #defined? @rc['search'][type]['db'] and @rc['search'][type]['db'] =~/\S+/ # and + flag=if promo?[:ad] + false + elsif defined? @vz.widget_search and @vz.widget_search == true + true + elsif defined? @rc['search'][type]['flag'] and @rc['search'][type]['flag'] == true + true + else false + end + else false + end end - else - false + else false end + #flag=true + flag end def search_fixed? - flag=if defined? @rc['search'] and - defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - flag=if promo?[:ad] - false - elsif defined? @vz.widget_search and @vz.widget_search == true - true - elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true - true - else - false + searches=['sisu','hyperestraier'] + flag=if defined? @rc['search'] + searches.each do |type| + if defined? @rc['search'][type] and + defined? @rc['search'][type]['action'] and @rc['search'][type]['action'] =~/http:\/\// and + defined? @rc['search'][type]['db'] and @rc['search'][type]['db'] =~/\S+/ # and + flag=if promo?[:ad] + false + elsif defined? @vz.widget_search and @vz.widget_search == true + true + elsif defined? @rc['search'][type]['flag'] and @rc['search'][type]['flag'] == true + true + else false + end + else false + end end - else - false + else false end end - def search_form(action=nil,db=nil) + def search_form(type='sisusearch',action=nil,db=nil,table=false) rc=SiSU_Env::Get_init.instance.yamlrc - create_form=if action and db and action =~/http:\/\// and db =~/\S+/ + create_form_hyperestraier=if defined? rc['search']['sisu']['flag'] and + rc['search']['sisu']['flag']==true and + action and action =~/http:\/\//; true + else false + end + create_form_sisu=if action and db and action =~/http:\/\// and db =~/\S+/ true elsif widget.search? - db=if rc['search']['db']=~/\S+/ - rc['search']['db']=~/^SiSU_\S+/ ? rc['search']['db'] : "SiSU_#{rc['search']['db']}" + db=if rc['search']['sisu']['flag']==true and + rc['search']['sisu']['db']=~/\S+/ + rc['search']['sisu']['db']=~/^SiSU_\S+/ ? rc['search']['sisu']['db'] : "SiSU_#{rc['search']['sisu']['db']}" else nil end - action=rc['search']['action'] + action=rc['search']['sisu']['action'] true else false end - if create_form - %{<td align="center" bgcolor="#ffffff"> + if table + table_open='<td align="center" bgcolor="#ffffff">' + table_close='</td>' + else + table_open='' + table_close='<br />' + end + form=if create_form_sisu and type=~/sisusearch/ and + defined? rc['search']['sisu'] + <<WOK <!-- SiSU Search --> +#{table_open} <a name="search"></a> -<form method="get" action="#{rc['search']['action']}" target="_top"> +<form method="get" action="#{rc['search']['sisu']['action']}" target="_top"> <font size="2"> <input type="text" name="s1" size="24" maxlength="255" /> <br /> @@ -891,23 +917,43 @@ module SiSU_Env <input type="radio" name="view" value="text" /> txt <input type="submit" name="ignore" value="search" /> <input type="checkbox" name="fns" value="#{@md.fnb}" /> -</font> -</form> +</font></form> +#{table_close} <!-- SiSU Search --> -</td> } +WOK + elsif create_form_hyperestraier and type=~/hyperestraier/ and + defined? rc['search']['hyperestraier'] + <<WOK +<!-- SiSU Search using Hyperestraier --> +#{table_open} +<a name="search"></a> +<form method="get" action="#{rc['search']['hyperestraier']['action']}" target="_top"> +<font size="2"> +<input type="text" name="phrase" value="" size="24" maxlength="255" /> +<br /> +<input type="submit" value="search" /> +<input type="hidden" name="enc" value="UTF-8" /> +<font size="2"> +<a href="#{rc['search']['hyperestraier']['action']}">hyperestraier search</a> +</font></form> +#{table_close} +<!-- SiSU Search using Hyperestraier --> +WOK else '' end + form end def search_form_static(action=nil,db=nil) rc=SiSU_Env::Get_init.instance.yamlrc - create_form=if action and db and action =~/http:\/\// and db =~/\S+/ + create_form=if rc['search']['sisu']['flag']==true and + action and db and action =~/http:\/\// and db =~/\S+/ true elsif widget.search_fixed? - db=if rc['search']['db']=~/\S+/ - rc['search']['db']=~/^SiSU_\S+/ ? rc['search']['db'] : "SiSU_#{rc['search']['db']}" + db=if rc['search']['sisu']['flag']==true and rc['search']['sisu']['db']=~/\S+/ + rc['search']['sisu']['db']=~/^SiSU_\S+/ ? rc['search']['sisu']['db'] : "SiSU_#{rc['search']['sisu']['db']}" else nil end - action=rc['search']['action'] + action=rc['search']['sisu']['action'] true else false end @@ -915,7 +961,7 @@ module SiSU_Env %{<td align="center" bgcolor="#ffffff"> <!-- SiSU Search --> <a name="search"></a> -<form method="get" action="#{rc['search']['action']}" target="_top"> +<form method="get" action="#{rc['search']['sisu']['action']}" target="_top"> <font size="2"> <input type="text" name="s1" size="24" maxlength="255" /> <br /> @@ -946,12 +992,13 @@ module SiSU_Env @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false } def search? flag=if defined? @rc['search'] and - defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ + defined? @rc['search']['sisu'] and + defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/http:\/\// and + defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/ + defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/ flag=if defined? @vz.widget_search and @vz.widget_search == true true - elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true + elsif defined? @rc['search']['sisu']['flag'] and @rc['search']['sisu']['flag'] == true true else false @@ -962,12 +1009,13 @@ module SiSU_Env end def search_fixed? flag=if defined? @rc['search'] and - defined? @rc['search']['action'] and @rc['search']['action'] =~/http:\/\// and - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ - defined? @rc['search']['db'] and @rc['search']['db'] =~/\S+/ + defined? @rc['search']['sisu'] and + defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/http:\/\// and + defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/ + defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/ flag=if defined? @vz.widget_search and @vz.widget_search == true true - elsif defined? @rc['search']['flag'] and @rc['search']['flag'] == true + elsif defined? @rc['search']['sisu']['flag'] and @rc['search']['sisu']['flag'] == true true else false @@ -978,21 +1026,23 @@ module SiSU_Env end def search_form(action=nil,db=nil) rc=SiSU_Env::Get_init.instance.yamlrc - create_form=if action and db and action =~/http:\/\// and db =~/\S+/ + create_form=if defined? rc['search']['sisu']['flag'] and + rc['search']['sisu']['flag']==true and + action and db and action =~/http:\/\// and db =~/\S+/ true - elsif widget_static.search? - db=if rc['search']['db']=~/\S+/ - rc['search']['db']=~/^SiSU_\S+/ ? rc['search']['db'] : "SiSU_#{rc['search']['db']}" + elsif widget_static.search? and rc['search']['sisu']['flag']==true + db=if rc['search']['sisu']['db']=~/\S+/ + rc['search']['sisu']['db']=~/^SiSU_\S+/ ? rc['search']['sisu']['db'] : "SiSU_#{rc['search']['sisu']['db']}" else nil end - action=rc['search']['action'] + action=rc['search']['sisu']['action'] true else false end if create_form and @fnb and @fnb=~/\S+/ %{<!-- SiSU Search --> <a name="search"></a> -<form method="get" action="#{rc['search']['action']}" target="_top"> +<form method="get" action="#{rc['search']['sisu']['action']}" target="_top"> <font size="2"> <input type="text" name="s1" size="24" maxlength="255" /> <br /> @@ -1007,7 +1057,7 @@ module SiSU_Env elsif create_form %{<!-- SiSU Search --> <a name="search"></a> -<form method="get" action="#{rc['search']['action']}" target="_top"> +<form method="get" action="#{rc['search']['sisu']['action']}" target="_top"> <font size="2"> <input type="text" name="s1" size="24" maxlength="255" /> <br /> @@ -1370,7 +1420,9 @@ module SiSU_Env "#{path.webserv}/#@stub_pwd".gsub(/#{path.webserv_dir}/,"#{url.hostname}/#@stub_pwd") elsif defined? @rc['webserv']['webrick_url'] and @rc['webserv']['webrick_url'] == false "file://#{path.webserv}/#@stub_pwd" - else "#{url.hostname}:#{webserv_port_cgi}/#@stub_pwd" + elsif webserv_port_cgi =~/\S+/ + "#{url.hostname}:#{webserv_port_cgi}/#@stub_pwd" + else "#{url.hostname}/#@stub_pwd" end end def webserv_base #web url for local webserv (localhost, or hostname) @@ -1394,8 +1446,8 @@ module SiSU_Env end end def sample_search_form_title - if defined? @rc['search']['title'] and @rc['search']['title'] =~/\S+/ - @rc['search']['title'] + if defined? @rc['search']['sisu']['title'] and @rc['search']['sisu']['title'] =~/\S+/ + @rc['search']['sisu']['title'] else %{SiSU search form (sample):} end end |