Module: TreeHtml

Defined in:
lib/tree_html.rb,
lib/tree_html/version.rb

Constant Summary collapse

NO_DATA_IN_A =
{}.freeze
NO_CHECKBOX =
"<label class='placeholder'></label>".freeze
BLANK =
''.freeze
NO_CUSTOM_JS =
[].freeze
Css =
File.read File.expand_path('../tree_html/tree_html.css', __FILE__)
Js =
Dir.glob("#{File.expand_path(__dir__)}/tree_html/*.js").map{|f| File.read f }.join(';')
VERSION =
"0.1.7"

Instance Method Summary collapse

Instance Method Details

#tree_htmlObject



12
13
14
# File 'lib/tree_html.rb', line 12

def tree_html
  "<ul class='tree-html'>#{li_for_tree_html}</ul>"
end

#tree_html_fullObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tree_html.rb', line 16

def tree_html_full
  "<!DOCTYPE HTML><html>"\
    "<head>"\
      "<meta charset='utf-8'/>"\
      "<style>#{Css + css_for_tree_html}</style>"\
      "#{custom_js head_js_for_tree_html}"\
    "</head>"\
    "<body>"\
      "#{tree_html}"\
      "<script>#{Js}</script>"\
      "#{custom_js body_js_for_tree_html}"\
    "</body>"\
  "</html>"
end