aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-08-16 00:21:01 -0400
committerRalph Amissah <ralph@amissah.com>2008-08-16 00:21:01 -0400
commitafb83150d0b9876006bc100517b60be9e2fd0f56 (patch)
tree514cf1e31feacad9a7870b0479ce0f783a03e6e9 /lib
parenttexpdf, fix: image dimension match (for post 0.68.0 changed middle layer (diff)
html css and div related
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v0/css.rb9
-rw-r--r--lib/sisu/v0/html.rb7
-rw-r--r--lib/sisu/v0/html_format.rb78
-rw-r--r--lib/sisu/v0/html_scroll.rb1
-rw-r--r--lib/sisu/v0/html_segments.rb19
-rw-r--r--lib/sisu/v0/html_tune.rb1
6 files changed, 82 insertions, 33 deletions
diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb
index f4dfc15f..1eef5023 100644
--- a/lib/sisu/v0/css.rb
+++ b/lib/sisu/v0/css.rb
@@ -742,7 +742,7 @@ WOK
margin-bottom: 0px;
}
- div.substance {
+ div.substance, div.main_column {
width: 100%;
background-color: #ffffff;
}
@@ -804,6 +804,9 @@ WOK
padding-left: 0.5em;
color: #0000aa;
}
+ hr {
+ width: 90%;
+ }
span.currentlink {
text-decoration: none;
@@ -843,6 +846,10 @@ WOK
margin-left: 2em;
font-size: 85%;
}
+ h0.minitoc {
+ margin-left: 0em;
+ font-size: 90%;
+ }
h1.c, h2.c, h3.c, h4.c, h5.c, h6.c, p.c {
text-align: center
diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb
index e882627c..e57b5add 100644
--- a/lib/sisu/v0/html.rb
+++ b/lib/sisu/v0/html.rb
@@ -358,8 +358,8 @@ WOK
format_toc.lev0
else format_toc.lev1
end
- toc[:seg_mini]=if para =~/^#{Mx[:lv_o]}\d:meta^#{Mx[:lv_c]}\s*Document Information/
- format_toc.lev0
+ toc[:seg_mini]=if para =~/^#{Mx[:lv_o]}\d:meta#{Mx[:lv_c]}\s*Document Information/
+ format_toc.mini_lev0
else format_toc.mini_lev1
end
title=if para =~/(#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]})$/
@@ -582,6 +582,7 @@ WOK
prefix_b=SiSU_Tune::Clean_html.new(prefix_b).clean
end
@seg_toc_band=format_head_toc.seg_head_navigation_band('pdf') #bug, vary depending on type of doc !! examine
+ @seg_toc_band_bottom=format_head_toc.seg_head_navigation_band_bottom('pdf') #bug, vary depending on type of doc !! examine
@segtoc << @seg_toc_band
toc_shared << format_head_toc.scroll_head_title_banner_open
@segtoc << format_head_toc.seg_head_title_banner_open
@@ -627,7 +628,7 @@ WOK
@segtoc << prefix_b if @md.prefix_b
#Segtoc tail added here
@segtoc << "</p>\n" #bugfix sort later DEBUGNOW
- @segtoc << @seg_toc_band
+ @segtoc << @seg_toc_band_bottom
ads=SiSU_HTML_promo::Ad.new(@md)
@segtoc << format_head_toc.seg_navigation_tail << ads.div.close << ads.display << format_head_toc.html_close
@segtoc.flatten!.compact!
diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb
index 87988ec1..1ee409ab 100644
--- a/lib/sisu/v0/html_format.rb
+++ b/lib/sisu/v0/html_format.rb
@@ -335,6 +335,25 @@ WOK
#{@vz.table_close}
<p />}
end
+ def seg_head_navigation_band_bottom(type='')
+ if type=~/pdf/
+ @tocband_segtoc=make_scroll_seg_pdf
+ end
+ firstseg=%{<a href="#{@md.fnl[:pre]}#{@md.firstseg}#{@md.fnl[:mid]}#@sfx#{@md.fnl[:post]}" target="_top" alt="-&gt;">
+ #{@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%">
+ &nbsp;
+</td>
+<td width="60%" align="center">
+ #@tocband_segtoc
+</td>
+<td width="20%" align="right">
+ &nbsp;#{firstseg}&nbsp;
+#{@vz.table_close}
+<p />}
+ end
def manifest_link(text)
%{<font size=2>
<a href="#{@md.fn[:manifest]}" target="_top" #{@vz.js_manifest}>#{text}</a>
@@ -572,7 +591,9 @@ WOK
metadata
end
def seg_tail
- %{<p>&nbsp;<p>
+ %{
+<div class="main_column">
+<p>&nbsp;<p>
<table summary="toc segment tail" bgcolor=#{@vz.color_band1}>
<tr><td width="20%">
#{@vz.banner_band}
@@ -591,11 +612,15 @@ WOK
<a name="end" id="end"></a>
<a name="finish" id="finish"></a>
<a name="stop" id="stop"></a>
-<a name="credits"></a>}
+<a name="credits"></a>
+</div>
+}
end
def scroll_tail #debug
nav=scroll_head_navigation_band
- %{#{nav}
+ %{
+<div class="main_column">
+#{nav}
#{@vz.credits_splash}
#{@vz.credits_sisu}
<a name="bottom" id="bottom"></a>
@@ -604,11 +629,13 @@ WOK
<a name="finish" id="finish"></a>
<a name="stop" id="stop"></a>
<a name="credits"></a>
-</div></div>}
+</div>}
end
def seg_navigation_tail #this is a bug area, look up and "tidy"
#nav=scroll_head_navigation_band
- %{<p>&nbsp;</p>
+ %{
+<div class="main_column">
+<p>&nbsp;</p>
#{@vz.credits_splash}
#{@vz.credits_sisu}
<a name="bottom" id="bottom"></a>
@@ -616,7 +643,9 @@ WOK
<a name="end" id="end"></a>
<a name="finish" id="finish"></a>
<a name="stop" id="stop"></a>
-<a name="credits"></a>}
+<a name="credits"></a>
+</div>
+}
end
end
class Head_seg < Head_information
@@ -864,7 +893,9 @@ WOK
</center>}
end
def credit
- %{#{@vz.credits_splash}
+ %{
+<div class="main_column">
+#{@vz.credits_splash}
#{@vz.credits_sisu}
<a name="bottom" id="bottom"></a>
<a name="down" id="down"></a>
@@ -891,8 +922,7 @@ WOK
end
def navigation_band_bottom(segtocband,seg_table_top_control) #change name to navigaion_band_bannerless
%{
-<div class="substance">
-<p class="content">
+<div class="main_column">
<table summary="segment navigation band" bgcolor=#{@vz.color_band1} width="100%"><tr>
<td width="70%" align="center">
#{doc_types}
@@ -902,13 +932,24 @@ WOK
</td></tr>
</table>
#{seg_table_top_control}
-</p>
</div>
}
end
def endnote_mark
-%{<p class="center" id="endnotes">
-</p>} #revisit
+%{
+<p class="center" id="endnotes">
+ <hr class="endnote" />
+</p>}
+ end
+ def endnote_section_open
+%{
+<div class="endnote">
+}
+ end
+ def endnote_section_close
+%{
+</div>
+} #revisit
end
def head
%{#{doc_type}
@@ -1177,12 +1218,9 @@ WOK
end
def endnote_body
%{
-<div class="substance">
- <label class="ocn">&nbsp;</label>
- <p class="endnote">
+<p class="endnote">
#@one
- </p>
-</div>
+</p>
}
end
def header_normal
@@ -1279,30 +1317,24 @@ WOK
end
def endnote_body_seg_tail #FIX
%{
-<div class="endnote">
<p class="endnote">
#@one
</p>
-</div>
}
end
def endnote_body_seg_tail_indent
%{
-<div class="endnote">
<p class="endnote_indent">
#@one
</p>
-</div>
}
end
def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408
fn='doc' if fn.empty? #you may wish to reconsider, sends to 'doc' where no segment info
%{
-<div class="endnote">
<p class="endnote">
#@one#{@md.fnl[:pre]}#{fn}#{@md.fnl[:mid]}#{@md.sfx}#{@md.fnl[:post]}#@two#@three
</p>
-</div>
}
end
def title_header
diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb
index 8b1e041c..93e30494 100644
--- a/lib/sisu/v0/html_scroll.rb
+++ b/lib/sisu/v0/html_scroll.rb
@@ -97,6 +97,7 @@ module SiSU_HTML_scroll
and (para =~/^#{Mx[:lv_o]}:metadata#{Mx[:lv_c]}/ or para =~/^#{Mx[:lv_o]}1:meta#{Mx[:lv_c]}\s*Document Information/)
@rcdc=true
end
+ para.gsub!(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'<p><hr width=90% /></p>')
if para !~/(^#{Rx[:meta]}|#{Mx[:br_endnotes]}|#{Mx[:br_eof]})/
unless para =~/^#{Mx[:gr_o]}code#{Mx[:gr_c]}/; para.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ')
end
diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb
index c3617b24..c4d136b7 100644
--- a/lib/sisu/v0/html_segments.rb
+++ b/lib/sisu/v0/html_segments.rb
@@ -141,7 +141,9 @@ module SiSU_HTML_seg
end
end
if @@is4 == 1 \
- or para =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/
+ or para =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ \
+ or para =~/^#{Mx[:mk_o]}4:metadata#{Mx[:mk_c]}/
+ m=para[/^#{Mx[:lv_o]}4:(metadata)#{Mx[:lv_c]}/]; @@get_hash_fn=$1 if m
if newfile == 1 \
or para =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/
newfile=0
@@ -219,7 +221,11 @@ module SiSU_HTML_seg
if @@is1 == 1
@dc_creator=%{<b>#{@md.dc_creator}</b>\n} if @md.dc_creator.to_s =~/\S/
@@seg[:tocband_banner] << format_head_seg.navigation_band(@@segtocband,@@seg[:dot_nav])
- @@seg[:tocband_bannerless] << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav])
+ endnote_section_close=unless @@get_hash_fn =~/metadata/
+ format_head_seg.endnote_section_close
+ else ''
+ end
+ @@seg[:tocband_bannerless] << endnote_section_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav])
@@seg[:headers] << format_head_seg.seg_head_escript if SiSU_HTML_Format::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug
@@seg[:headers] << format_head_seg.title_banner(@md.title,@md.subtitle,@dc_creator).gsub(clean,'')
paranum=if @@header1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/]; $1
@@ -364,9 +370,12 @@ module SiSU_HTML_seg
end
def tail
format_head_seg=SiSU_HTML_Format::Head_seg.new(@md)
- if @md.flag_auto_endnotes
- @@seg[:tail] << format_head_seg.endnote_mark
- @@seg[:tail] << @@seg_endnotes[@@get_hash_fn] #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES|
+ if @md.flag_auto_endnotes and @@seg_endnotes[@@get_hash_fn]
+ @@seg[:tail] << format_head_seg.endnote_section_open
+ if @@seg_endnotes[@@get_hash_fn].flatten.length > 0
+ @@seg[:tail] << format_head_seg.endnote_mark
+ @@seg[:tail] << @@seg_endnotes[@@get_hash_fn].flatten #endnotes deposited at end of individual segments ||@|EXTRACTION OF ENDNOTES|
+ end
end
#@@seg[:tail] << '</div><table summary="whitespace"><tr><td>&nbsp;</td></tr></table>'
ads=SiSU_HTML_promo::Ad.new(@md)
diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb
index 9cc50b23..f06b8764 100644
--- a/lib/sisu/v0/html_tune.rb
+++ b/lib/sisu/v0/html_tune.rb
@@ -236,7 +236,6 @@ module SiSU_Tune
para.gsub!(/#{Mx[:mk_o]}#([a-zA-Z]+)#{Mx[:mk_c]}/,'&\1;')
para.gsub!(/#{Mx[:mk_o]}(#[0-9]+)#{Mx[:mk_c]}/,'&\1;')
para.gsub!(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,'<br />')
- para.gsub!(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'<p><hr width=90% /></p>') # else clean ''
para.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'<b>\1</b>')
para.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'<i>\1</i>')
para.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'<u>\1</u>')