diff options
Diffstat (limited to 'lib/sisu/v2/html_format.rb')
-rw-r--r-- | lib/sisu/v2/html_format.rb | 175 |
1 files changed, 113 insertions, 62 deletions
diff --git a/lib/sisu/v2/html_format.rb b/lib/sisu/v2/html_format.rb index 66f9bc05..06d6d352 100644 --- a/lib/sisu/v2/html_format.rb +++ b/lib/sisu/v2/html_format.rb @@ -108,7 +108,17 @@ module SiSU_HTML_Format @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) @index='index' @metalink='#metadata' - @tocband_scroll,@tocband_segtoc=nil,nil + end + def doc_types #used in toc & seg_nav_band + scroll=seg='' + wgt=Widget.new(@md) + %{ +<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0"> +<tr> +<td align="center" bgcolor=#{@vz.color_band2}> + #{wgt.manifest} + #{wgt.search} +</tr></table>} end def rdf SiSU_XML_tags::RDF.new(md) @@ -145,13 +155,29 @@ module SiSU_HTML_Format @cf_defaults=SiSU_Env::Info_processing_flag.new end def home - '' + %{<td align="center" bgcolor=#{@vz.color_band2}> + <a href="../index.html" target="_top"> + #{@vz.nav_txt_homepage}</a> +</td> +} end def scroll(text) - '' + if @md.fns =~ /\.(?:-|ssm\.)?sst$/ + scroll=%{<td align="center" bgcolor=#{@vz.color_band2}> + <a href="#{@md.fn[:doc]}" target="_top" #{@vz.js_doc}> + #{text} + </a> +</td> +} + end end def seg(text) - '' + %{<td align="center" bgcolor="#99CC66"> + <a href="#{@md.fn[:toc]}" target="_top" #{@vz.js_doc}> + #{text} + </a> +</td> +} end def search env=SiSU_Env::Info_env.new(@md.fns,@md) @@ -164,20 +190,67 @@ module SiSU_HTML_Format </a> </td>} end - def pdf - '' + def pdf #retired 2.7.9 + pdf=if @md.programs[:pdf] \ + and @cf_defaults.cf_0 =~/p/ + %{ +<td align="center" bgcolor=#{@vz.color_band2}> + <a href="#{@md.fn[:pdf_p]}" target="_top" #{@vz.js_portrait}> + #{@vz.nav_txt_pdf_portrait} + </a> +</td> +<td align="center" bgcolor=#{@vz.color_band2}> + <a href="#{@md.fn[:pdf_l]}" target="_top" #{@vz.js_landscape}> + #{@vz.nav_txt_pdf_landscape} + </a> +</td> +} + else '' + end end - def txt - '' + def txt #retired 2.7.9 + txt=if @cf_defaults.cf_0 =~/[at]/ + %{ +<td valign=bottom bgcolor=#{@vz.color_band2}> + <a href="#{@md.fn[:plain]}" target="_top" #{@vz.js_plaintext}> + #{@vz.nav_txt_plaintext} + </a> +</td>} + else '' + end end - def epub - '' + def epub #retired 2.7.9 + epub=if @cf_defaults.cf_0 =~/e/ + %{ +<td align="center" bgcolor=#{@vz.color_band2}> + <a href="../epub/#{@md.fn[:epub]}" target="_top" #{@vz.js_epub}> + #{@vz.nav_txt_epub} + </a> +</td>} + else '' + end end - def odf - '' + def odf #retired 2.7.9 + odf=if @cf_defaults.cf_0 =~/o/ + %{ +<td align="center" bgcolor=#{@vz.color_band2}> + <a href="#{@md.fn[:odf]}" target="_top" #{@vz.js_odf}> + #{@vz.nav_txt_odf} + </a> +</td>} + else '' + end end - def concordance(text) - '' + def concordance(text) #retired 2.7.9 + if @md.concord_make \ + and @md.wc_words < 300000 #max word count for display of concordance here as would now be a large file + %{<td align="center" bgcolor=#{@vz.color_band2}> + <a href="#{@md.fn[:concordance]}" target="_top" #{@vz.js_concordance}> + #{text} + </a> + </td>} + else '' + end end end class XML @@ -186,7 +259,6 @@ module SiSU_HTML_Format def initialize(md) super(md) @md=md - @tocband_scroll,@tocband_segtoc=make_scroll,make_seg end def scroll_head_navigation_band pdf=if @md.programs[:pdf] @@ -207,16 +279,10 @@ WOK <p />} end def concordance_navigation_band(type='') - if type=~/pdf/ - @tocband_concordance=make_concordance - end %{<table summary="concordance navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> <tr><td width="20%"> #{@vz.banner_band} </td> -<td width="60%" align="center"> - #{@tocband_concordance} -</td> <td width="20%" align="right"> <a href="index.html" target="_top" alt="->"> #{@vz.png_nav_toc} @@ -225,6 +291,22 @@ WOK <p />} end def seg_head_navigation_band(type='') + firstseg=%{<a href="#{@md.fnl[:pre]}#{@md.firstseg}#{@md.fnl[:mid]}#{Sfx[:html]}#{@md.fnl[:post]}" target="_top" alt="->"> + #{@vz.png_nav_nxt} + </a>} if @md.firstseg =~/\S+/ + %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> +<tr><td width="20%"> + #{@vz.banner_band} +</td> +<td width="20%"> + #{doc_types} +</td> +<td width="5%" align="right"> + #{firstseg} +#{@vz.table_close} +<p />} + end + def seg_head_navigation_band_bottom(type='') #retired 2.7.9 if type=~/pdf/ @tocband_segtoc=make_scroll_seg_pdf end @@ -233,7 +315,7 @@ WOK </a>} if @md.firstseg =~/\S+/ %{<table summary="table of contents segment navigation band" id="toc" width="100%" bgcolor=#{@vz.color_band1}> <tr><td width="20%"> - #{@vz.banner_band} + </td> <td width="75%" align="center"> #{@tocband_segtoc} @@ -243,16 +325,20 @@ WOK #{@vz.table_close} <p />} end - def seg_head_navigation_band_bottom(type='') - '' - end def manifest_link(text) %{<font size=2> <a href="#{@md.fn[:manifest]}" target="_top" #{@vz.js_manifest}>#{text}</a> </font>} end - def concordance_link(text) - '' + def concordance_link(text) #retired 2.7.9 + if @md.concord_make + %{<font size=2> + <a href="#{@md.fn[:concordance]}" target="_top" #{@vz.js_concordance}> + #{text} + </a> + </font>} + else '' + end end def make_seg_scroll_pdf wgt=Widget.new(@md) @@ -467,11 +553,6 @@ WOK <table summary="toc segment tail" bgcolor=#{@vz.color_band1}> <tr><td width="20%"> #{@vz.banner_band} -</td> -<td width="60%"> - <center> - #{@tocband_segtoc} - </center> </td></tr> </table> <p> </p> @@ -636,36 +717,6 @@ WOK else '' end end - def doc_types #used in seg_nav_band ### - scroll=seg='' - wgt=Widget.new(@md) - x=if @md.concord_make - %{ -<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0"> -<tr> - #{wgt.seg(@vz.nav_txt_toc_link)} - #{wgt.scroll(@vz.nav_txt_doc_link)} - #{wgt.txt}#{wgt.epub}#{wgt.pdf}#{wgt.odf} -<td align="center" bgcolor=#{@vz.color_band2}> - #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -</tr></table>} - else - %{ -<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0"> -<tr> - #{wgt.seg(@vz.nav_txt_toc_link)} - #{wgt.scroll(@vz.nav_txt_doc_link)} - #{wgt.txt}#{wgt.epub}#{wgt.pdf}#{wgt.odf} -<td align="center" bgcolor=#{@vz.color_band2}> - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -</tr></table>} - end - end def navigation_table %{<table summary="navigation segment table" width=#{@vz.table_width_1} border="0" bgcolor="white" cellpadding="0"> <tr><th width="#{@@indent['leve_1']}" align="right"> |