diff options
Diffstat (limited to 'lib/sisu/v3dv/html_format.rb')
-rw-r--r-- | lib/sisu/v3dv/html_format.rb | 116 |
1 files changed, 87 insertions, 29 deletions
diff --git a/lib/sisu/v3dv/html_format.rb b/lib/sisu/v3dv/html_format.rb index 29d1bfcb..d8b44760 100644 --- a/lib/sisu/v3dv/html_format.rb +++ b/lib/sisu/v3dv/html_format.rb @@ -96,6 +96,7 @@ module SiSU_HTML_Format end end class HeadInformation + require_relative 'css' # css.rb require_relative 'shared_xml' # shared_xml.rb include SiSU_Viz attr_reader :md,:rdf,:vz @@ -103,12 +104,61 @@ module SiSU_HTML_Format @md=md # DublinCore 1 - title @vz=SiSU_Env::GetInit.instance.skin - @css=SiSU_Env::CSS_Stylesheet.new(md) @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) - @toc,@index='toc','index' @metalink='#metadata' @tocband_scroll,@tocband_segtoc=nil,nil + @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet + @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure + @index='index' + @toc="#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}" + end + def url_path_image_sys + (@o_str.dump_or_redirect?) \ + ? './image' + : "#{Xx[:html_relative2]}_sisu/image_sys" + end + def icon + def up + 'arrow_up_red.png' + end + def next + 'arrow_next_red.png' + end + def previous + 'arrow_prev_red.png' + end + def dot_clear + 'dot_clear.png' + end + def dot_white + 'dot_white.png' + end + def dot + dot_white + end + self + end + def png_nav + def toc + %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.up}" alt="TOC" />} + end + def pre + %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.previous}" alt="<< previous" />} + end + def nxt + %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.next}" alt="next >>" />} + end + def dot_toc + %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="^" />} + end + def dot_pre + %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="<" />} + end + def dot_nxt + %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt=">" />} + end + self end def doc_types #used in toc & seg_nav_band scroll=seg='' @@ -154,8 +204,9 @@ module SiSU_HTML_Format super(md) @md=md @cf_defaults=SiSU_Env::InfoProcessingFlag.new - @env=SiSU_Env::InfoEnv.new(@md.fns) - @file=SiSU_Env::FileOp.new(@md) + @env=SiSU_Env::InfoEnv.new(md.fns) + @file=SiSU_Env::FileOp.new(md) + @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure end def home %{<td align="center" bgcolor=#{@vz.color_band2}> @@ -187,16 +238,19 @@ module SiSU_HTML_Format env.widget.search_form('sisusearch',nil,nil,true) end def manifest - manifest_lnk=if @file.output_dir_structure.by_language_code? \ - or @file.output_dir_structure.by_filetype? - "#{Xx[:html_relative1]}manifest/#{@file.base_filename.manifest}" - else @file.base_filename.manifest - end + if not @o_str.dump_or_redirect? + manifest_lnk=if @file.output_dir_structure.by_language_code? \ + or @file.output_dir_structure.by_filetype? + "#{Xx[:html_relative1]}manifest/#{@file.base_filename.manifest}" + else @file.base_filename.manifest + end %{<td align="center" bgcolor=#{@vz.color_band2}> <a href="#{manifest_lnk}" target="_top" #{@vz.js_manifest}> #{@vz.nav_txt_manifest} </a> </td>} + else '' + end end def pdf #retired 2.7.9 pdf=if @md.programs[:pdf] \ @@ -267,6 +321,7 @@ module SiSU_HTML_Format def initialize(md) super(md) @md=md + @o_str ||=SiSU_Env::OutputStructure.new(md).output_dir_structure end def scroll_head_navigation_band pdf=if @md.programs[:pdf] @@ -293,14 +348,14 @@ WOK </td> <td width="20%" align="right"> <a href="toc.html" target="_top" alt="->"> - #{@vz.png_nav_toc} + #{png_nav.toc} </a> #{@vz.table_close} <p />} end def seg_head_navigation_band(type='') firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="->"> - #{@vz.png_nav_nxt} + #{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%"> @@ -319,7 +374,7 @@ WOK @tocband_segtoc=make_scroll_seg_pdf end firstseg=%{<a href="#{@md.firstseg}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" alt="->"> - #{@vz.png_nav_nxt} + #{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%"> @@ -394,7 +449,7 @@ WOK </title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> #{rdf.metatag_html} -#{@css.html}#{@css.html_seg} +#{@stylesheet.css_head} </head> #{@vz.color_body} <a name="top" id="top"></a> @@ -529,12 +584,15 @@ WOK #{@vz.table_close}} end def manifest #check structure - manifest=manifest_link(@vz.nav_txt_manifest) - %{#{@vz.margin_txt_3} + if not @o_str.dump_or_redirect? + manifest=manifest_link(@vz.nav_txt_manifest) + %{#{@vz.margin_txt_3} #{@vz.paragraph_font_small} #{manifest} </font> #{@vz.table_close}} + else '' + end end def concordance #check structure concord=concordance_link(@vz.nav_txt_concordance) @@ -618,14 +676,14 @@ WOK end end class HeadSeg < HeadInformation - def initialize(md) #(md='') + def initialize(md) super(md) end def title_banner(title,subtitle,creator) end def dot_control_pre_next pre="#{@seg_name_html[@seg_name_html_tracker-1]}#{@md.lang_code_insert}#{Sfx[:html]}" - up="#{@toc}#{@md.lang_code_insert}#{Sfx[:html]}" + up=@toc nxt="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" if nxt=~/sisu_manifest\.html/ @file=SiSU_Env::FileOp.new(@md) if @md @@ -637,56 +695,56 @@ WOK %{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center"> <tr><td align="left"> <a href="#{pre}" target="_top" #{@vz.js_prev}> - #{@vz.png_nav_dot_pre} + #{png_nav.dot_pre} </a> </td> <td align="center"> <a href="#{up}" target="_top" #{@vz.js_toc}> - #{@vz.png_nav_dot_toc} + #{png_nav.dot_toc} </a> </td> <td align="right"> <a href="#{nxt}" target="_top" #{@vz.js_next}> - #{@vz.png_nav_dot_nxt} + #{png_nav.dot_nxt} </a> #{@vz.table_close}} end def dot_control_pre pre="#{@seg_name_html[@seg_name_html_tracker-2]}#{@md.lang_code_insert}#{Sfx[:html]}" - up="#{@toc}#{@md.lang_code_insert}#{Sfx[:html]}" + up=@toc nxt="#{@md.file.base_filename.html_segtoc}" %{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center"> <tr><td align="left"> <a href="#{pre}" target="_top" #{@vz.js_prev}> - #{@vz.png_nav_dot_pre} + #{png_nav.dot_pre} </a> </td> <td align="center"> <a href="#{up}" target="_top" #{@vz.js_toc}> - #{@vz.png_nav_dot_toc} + #{png_nav.dot_toc} </a> </td> <td align="right"> <a href="#{nxt}" target="_top" #{@vz.js_next}> - #{@vz.png_nav_dot_nxt} + #{png_nav.dot_nxt} </a> #{@vz.table_close}} end def toc_nav(f_pre=false,f_nxt=false,use=1) pre=nxt='' toc=%{<td align="center" bgcolor=#{@vz.color_band1}> - <a href="#{@toc}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" #{@vz.js_toc}> - #{@vz.png_nav_toc} + <a href="#{@toc}" target="_top" #{@vz.js_toc}> + #{png_nav.toc} </a> </td>} pre=%{<td align="center" bgcolor=#{@vz.color_band1}> <a href="#{@seg_name_html[@seg_name_html_tracker-use]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" #{@vz.js_prev}> - #{@vz.png_nav_pre} + #{png_nav.pre} </a> </td>} if f_pre==true nxt=%{<td align="center" bgcolor=#{@vz.color_band1}> <a href="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top" #{@vz.js_next}> - #{@vz.png_nav_nxt} + #{png_nav.nxt} </a> </td>} if f_nxt==true if nxt =~/sisu_manifest.html/ @@ -853,7 +911,7 @@ WOK </title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> #{rdf.metatag_html} -#{@css.html_seg} +#{@stylesheet.css_head_seg} </head> #{@vz.color_body} <a name="top" id="top"></a> |