Class: SiSU_HTML_Format::HeadInformation

Inherits:
Object
  • Object
show all
Includes:
SiSU_Parts_HTML
Defined in:
lib/sisu/html_format.rb

Direct Known Subclasses

HeadSeg, HeadToc, Widget

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SiSU_Parts_HTML

#_url_path_image_base, #band1, #band2, #banner_band, #black, #blue_ink, #blue_tinge, #css, #grey, #grey_medium, #grey_pale, #home_button_only, #ico, #instrument_cover_band_scr, #instrument_cover_band_seg, #num, #num_css, #numless, #paragraph_font_small, #paragraph_font_tiny, #png_home, #png_home_button, #set_color, #set_face, #set_fonts, #set_size_endnote, #set_small, #set_tiny, #table1, #table2, #table_txt, #table_txt_r, #the_banner, #the_color, #the_font, #the_line_break, #the_margin, #the_nav, #the_png, #the_table_cellpad_box, #the_table_close, #the_url_decoration, #the_width, #txt_0, #txt_1, #txt_2, #txt_3, #txt_close, #txt_concordance, #txt_doc_link, #txt_homepage, #txt_manifest, #txt_open, #txt_toc_link, #white, #xml_close, #xml_open, #yellow_light

Methods included from SiSU_Parts_Generic

#footer_signature, #home, #home_txt, #i_choice, #i_home_button, #i_ico, #i_new, #rl_root, #root_http, #sisu, #sisu_txt, #sisudoc, #site, #the_icon, #the_text, #the_url, #txt_home, #txt_hp, #txt_hp_alias, #txt_signature, #urify, #url_close, #url_open

Constructor Details

#initialize(md) ⇒ HeadInformation

Returns a new instance of HeadInformation.



97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/sisu/html_format.rb', line 97

def initialize(md)
  @md=md
  # DublinCore 1 - title
  @bits=SiSU_Proj_HTML::Bits.new
  @per=SiSU_HTML_Persist::Persist.new
  @per.seg_name_x=SiSU_HTML::Seg.new.seg_name_x
  @per.seg_name_x_tracker=SiSU_HTML::Seg.new.seg_name_x_tracker
  @tocband_scroll,@tocband_segtoc=nil,nil
  @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet
  @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
  @index,@metalink='index','#metadata'
  @toc=@md.file.base_filename.html_segtoc
end

Instance Attribute Details

#mdObject (readonly)

Returns the value of attribute md.



96
97
98
# File 'lib/sisu/html_format.rb', line 96

def md
  @md
end

#rdfObject (readonly)

Returns the value of attribute rdf.



96
97
98
# File 'lib/sisu/html_format.rb', line 96

def rdf
  @rdf
end

Instance Method Details

#button_home(page = :seg) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/sisu/html_format.rb', line 170

def button_home(page=:seg)
  button=%{ <table summary="home button / home information" border="0" cellpadding="3" cellspacing="0">\n <tr><td align="left" bgcolor="#ffffff">\n}
  if @md.make.home_button_image.is_a?(Hash)
    image_path=if page==:manifest
      @md.file.output_path.manifest.rel_image
    elsif  page==:scroll
      @md.file.output_path.html_scroll.rel_image
    else
      @md.file.output_path.html_seg.rel_image
    end
    SiSU_Env::FileOp.new(@md)
    button +=%{   <p class="tiny_left"><a href="#{@md.make.home_button_image[:link]}" target="_top"><img border="0" src="#{image_path}/#{@md.make.home_button_image[:home_button]}"  width="#{@md.make.home_button_image[:w]}" height="#{@md.make.home_button_image[:h]}" alt="home icon --&gt;" /></a></p>\n}
  elsif @md.home_button_links.is_a?(Array)
    @md.home_button_links.each do |links|
      button +=%{  <p class="tiny_left"><a href="#{links[:url]}" target="_top">\n    #{links[:say]}\n  </a></p>\n}
    end
  end
  button +=%{ </td></tr>\n </table>}
  button
end

#doc_types(page = :seg) ⇒ Object

used in toc & seg_nav_band



157
158
159
160
161
162
163
164
165
166
# File 'lib/sisu/html_format.rb', line 157

def doc_types(page=:seg) #used in toc & seg_nav_band
  wgt=SiSU_HTML_Format::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=#{the_color.band2}>
  #{wgt.manifest(page)}
  #{wgt.search}
</tr></table>}
end

#dotObject



131
132
133
# File 'lib/sisu/html_format.rb', line 131

def dot
  dot_white
end

#dot_clearObject



125
126
127
# File 'lib/sisu/html_format.rb', line 125

def dot_clear
  'dot_clear.png'
end

#dot_nxtObject



152
153
154
# File 'lib/sisu/html_format.rb', line 152

def dot_nxt
  %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="&gt;" />}
end

#dot_preObject



149
150
151
# File 'lib/sisu/html_format.rb', line 149

def dot_pre
  %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="&lt;" />}
end

#dot_tocObject



146
147
148
# File 'lib/sisu/html_format.rb', line 146

def dot_toc
  %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="&#094;" />}
end

#dot_whiteObject



128
129
130
# File 'lib/sisu/html_format.rb', line 128

def dot_white
  'dot_white.png'
end

#html_closeObject

moved



190
191
192
193
# File 'lib/sisu/html_format.rb', line 190

def html_close #moved
%{</body>
</html>}
end

#iconObject



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/sisu/html_format.rb', line 115

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

#nextObject



119
120
121
# File 'lib/sisu/html_format.rb', line 119

def next
  'arrow_next_red.png'
end

#nxtObject



143
144
145
# File 'lib/sisu/html_format.rb', line 143

def nxt
  %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.next}" alt="next&nbsp;&gt;&gt;" />}
end

#png_navObject



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/sisu/html_format.rb', line 136

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="&lt;&lt;&nbsp;previous" />}
  end
  def nxt
    %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.next}" alt="next&nbsp;&gt;&gt;" />}
  end
  def dot_toc
    %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="&#094;" />}
  end
  def dot_pre
    %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="&lt;" />}
  end
  def dot_nxt
    %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon.dot}" alt="&gt;" />}
  end
  self
end

#preObject



140
141
142
# File 'lib/sisu/html_format.rb', line 140

def pre
  %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.previous}" alt="&lt;&lt;&nbsp;previous" />}
end

#previousObject



122
123
124
# File 'lib/sisu/html_format.rb', line 122

def previous
  'arrow_prev_red.png'
end

#tocObject



137
138
139
# File 'lib/sisu/html_format.rb', line 137

def toc
  %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon.up}" alt="toc" />}
end

#upObject



116
117
118
# File 'lib/sisu/html_format.rb', line 116

def up
  'arrow_up_red.png'
end

#url_path_image_sysObject



110
111
112
113
114
# File 'lib/sisu/html_format.rb', line 110

def url_path_image_sys
  (@o_str.dump_or_redirect?) \
  ? './image'
  : "#{Xx[:html_relative2]}_sisu/image_sys"
end