From d43865fb6a093625a77e8605d6fb00158546e1e4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 12 Aug 2008 23:37:42 -0400 Subject: html increased use of css; dal, middle layer, url representation, interim commit --- lib/sisu/v0/html.rb | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'lib/sisu/v0/html.rb') diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index 5b9639dd..5f0d0de9 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -106,7 +106,7 @@ module SiSU_HTML toc=SiSU_HTML::Source::Toc.new(data,@md).songsheet links_guide=SiSU_HTML::Source::Links_guide.new(data,@md).toc data=@tuned_file_array - scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(data,@md,toc,links_guide).in_common #watch + scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(@md,toc,links_guide).in_common #watch SiSU_HTML::Source::Seg.new(data,@md).songsheet data=@tuned_file_array scr=SiSU_HTML::Source::Scroll.new(data,@md).songsheet @@ -246,7 +246,7 @@ module SiSU_HTML end end class Toc [],:scr=>[] } + @@toc={ :seg=>[],:seg_mini=>[],:scr=>[] } @@seg_url='' @@dp,@@firstseg=nil,nil def initialize(data='',md=nil) @@ -255,12 +255,13 @@ module SiSU_HTML @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @pat_heading=/^(?:#{Mx[:lv_o]}[1-6]:\S*?#{Mx[:lv_c]}\s*)?(.*)#{Mx[:id_o]}~(\d+);(?:[hm]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ @pat_strip_heading_name=/(.+?)<\/a>/ - @tell=SiSU_Screen::Ansi.new(@md.cmd) + @tell=SiSU_Screen::Ansi.new(@md.cmd) if @md end def songsheet #extracts toc for scroll & seg SiSU_Screen::Ansi.new(@md.cmd,'Toc').txt_grey unless @md.cmd =~/q/ toc=nil @@firstseg=nil + @@toc={ :seg=>[],:seg_mini=>[],:scr=>[] } @data.each do |para| if para =~/^(?:#{Mx[:lv_o]}[1-6]:|4~!)/ para_toc=para.dup @@ -282,6 +283,7 @@ module SiSU_HTML if toc begin @@toc[:seg] << toc[:seg] if toc[:seg] + @@toc[:seg_mini] << toc[:seg_mini] if toc[:seg_mini] @@toc[:scr] << toc[:scr] if toc[:scr] rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error end @@ -291,6 +293,10 @@ module SiSU_HTML @md.firstseg=@@firstseg @@toc end + def minitoc + minitoc=@@toc[:seg_mini].to_s + '
' + minitoc + '
' + end protected def rss #sort all wrong, disabled but kept @@toc[:seg] <<< \\2
}) + if seg_link =~/(#{Mx[:id_o]}\~\d+;(?:\w|[0-6]:\d+);\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]})$/m + m=/#{$1}/m + seg_link.gsub!(m,'') + end @@seg_url=para[/^#{Mx[:lv_o]}4:(\S+?)#{Mx[:lv_c]}.+?$/,1] elsif para =~/\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+/ seg_link=para.gsub(/^\s*(#{@md.lv4}\s+)\s*(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/, @@ -443,6 +461,7 @@ WOK format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,seg_link) toc={} toc[:seg]=format_toc.lev4 + toc[:seg_mini]=format_toc.mini_lev4 if para =~/#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ m=/#{$1}/ para.gsub!(m,'') @@ -476,6 +495,7 @@ WOK } format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt) toc[:seg]=format_toc.lev5 + toc[:seg_mini]=format_toc.mini_lev5 title=%{#{p_num.goto}#{linkname}} end format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) @@ -504,6 +524,7 @@ WOK } format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,lnk_n_txt) toc[:seg]=format_toc.lev6 + toc[:seg_mini]=format_toc.mini_lev6 title=%{#{p_num.goto}#{linkname}} end format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) @@ -535,8 +556,8 @@ WOK end end class Scroll_head_and_segtoc < Toc - def initialize(data,md='',toc='',links_guide_toc='') - @data,@md,@toc,@links_guide_toc=data,md,toc,links_guide_toc + def initialize(md='',toc='',links_guide_toc='') + @md,@toc,@links_guide_toc=md,toc,links_guide_toc @vz=SiSU_Env::Get_init.instance.skin end def in_common -- cgit v1.2.3