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.10"

Instance Method Summary collapse

Instance Method Details

#tree_htmlObject



23
24
25
# File 'lib/tree_html.rb', line 23

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

#tree_html_fullObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/tree_html.rb', line 27

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