cyberweb 0.12.35 → 0.13.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +220 -124
  3. data/bin/cyberweb_sanitize +1 -1
  4. data/bin/images_from_this_webpage +1 -1
  5. data/doc/README.gen +209 -98
  6. data/doc/configuration/configuration.md +7 -4
  7. data/doc/todo/todo_for_the_cyberweb_project.md +123 -133
  8. data/examples/html/underlined_text_example/underlined_text_example.html +40 -0
  9. data/examples/misc/table_example.rb +19 -17
  10. data/examples/objectified/objectified_caesar_cipher.cgi +73 -0
  11. data/images/cyberweb_theme.png +0 -0
  12. data/lib/cyberweb/REST/constants.rb +1 -1
  13. data/lib/cyberweb/base/base.rb +19 -27
  14. data/lib/cyberweb/base_module/base_module/base_module.rb +31 -16
  15. data/lib/cyberweb/base_module/colours/colours.rb +0 -8
  16. data/lib/cyberweb/cascading_style_sheets/margin.css +4 -0
  17. data/lib/cyberweb/cascading_style_sheets/misc.css +15 -0
  18. data/lib/cyberweb/cgi/cookie.rb +160 -156
  19. data/lib/cyberweb/cgi/core.rb +7 -7
  20. data/lib/cyberweb/cgi/query_extension.rb +1 -1
  21. data/lib/cyberweb/cgi/session/memory_store.rb +1 -1
  22. data/lib/cyberweb/cgi/session/pstore.rb +2 -2
  23. data/lib/cyberweb/cgi/session.rb +1 -1
  24. data/lib/cyberweb/cgi/util.rb +4 -1
  25. data/lib/cyberweb/cmd/cmd.rb +12 -10
  26. data/lib/cyberweb/coloured_tags/coloured_tags.rb +1 -1
  27. data/lib/cyberweb/colours/colour_chart.rb +1 -2
  28. data/lib/cyberweb/colours/colours.rb +1 -1
  29. data/lib/cyberweb/commandline/commandline_interface.rb +1 -1
  30. data/lib/cyberweb/configuration/load_the_configuration.rb +3 -1
  31. data/lib/cyberweb/constants/http_status_codes.rb +4 -1
  32. data/lib/cyberweb/constants/misc.rb +8 -6
  33. data/lib/cyberweb/constants/registered_html_tags.rb +6 -5
  34. data/lib/cyberweb/constants/user_x.rb +7 -0
  35. data/lib/cyberweb/css_manager/css_manager.rb +5 -2
  36. data/lib/cyberweb/encoding/encoding.rb +1 -1
  37. data/lib/cyberweb/erb/test.rhtml +7 -2
  38. data/lib/cyberweb/experimental/html_template_powered_by_rack.rb +3 -1
  39. data/lib/cyberweb/foto_gallery/foto_gallery.rb +3 -0
  40. data/lib/cyberweb/generator/cgi.rb +1 -1
  41. data/lib/cyberweb/html_template/html_template.rb +262 -253
  42. data/lib/cyberweb/images/images.rb +2 -2
  43. data/lib/cyberweb/images/remove_this_substring_from_all_images.rb +5 -1
  44. data/lib/cyberweb/images/standard_images/standard_images.html +3 -4
  45. data/lib/cyberweb/information/README.md +2 -2
  46. data/lib/cyberweb/information/information.cgi +1 -1
  47. data/lib/cyberweb/javascript/dragula_collection.rb +4 -1
  48. data/lib/cyberweb/javascript/javascript_magic.rb +2 -2
  49. data/lib/cyberweb/javascript/on_click_change_opacity.rb +2 -1
  50. data/lib/cyberweb/javascript/popup.rb +8 -1
  51. data/lib/cyberweb/javascript/snoweffect.rb +5 -1
  52. data/lib/cyberweb/javascript_code/custom_functions.js +50 -32
  53. data/lib/cyberweb/objectified/html_tags/README.md +7 -9
  54. data/lib/cyberweb/objectified/html_tags/a.rb +62 -3
  55. data/lib/cyberweb/objectified/html_tags/abbr.rb +33 -3
  56. data/lib/cyberweb/objectified/html_tags/audio.rb +33 -3
  57. data/lib/cyberweb/objectified/html_tags/base.rb +661 -588
  58. data/lib/cyberweb/objectified/html_tags/blockquote.rb +33 -3
  59. data/lib/cyberweb/objectified/html_tags/body.rb +43 -3
  60. data/lib/cyberweb/objectified/html_tags/button.rb +75 -5
  61. data/lib/cyberweb/objectified/html_tags/canvas.rb +43 -3
  62. data/lib/cyberweb/objectified/html_tags/cite.rb +43 -3
  63. data/lib/cyberweb/objectified/html_tags/div.rb +70 -7
  64. data/lib/cyberweb/objectified/html_tags/embed.rb +43 -3
  65. data/lib/cyberweb/objectified/html_tags/fieldset.rb +43 -3
  66. data/lib/cyberweb/objectified/html_tags/figure.rb +43 -3
  67. data/lib/cyberweb/objectified/html_tags/form.rb +78 -3
  68. data/lib/cyberweb/objectified/html_tags/h1.rb +43 -3
  69. data/lib/cyberweb/objectified/html_tags/h2.rb +43 -3
  70. data/lib/cyberweb/objectified/html_tags/h3.rb +43 -3
  71. data/lib/cyberweb/objectified/html_tags/h4.rb +43 -3
  72. data/lib/cyberweb/objectified/html_tags/h5.rb +43 -3
  73. data/lib/cyberweb/objectified/html_tags/h6.rb +43 -3
  74. data/lib/cyberweb/objectified/html_tags/head.rb +34 -1
  75. data/lib/cyberweb/objectified/html_tags/i.rb +112 -0
  76. data/lib/cyberweb/objectified/html_tags/img.rb +65 -18
  77. data/lib/cyberweb/objectified/html_tags/input.rb +86 -2
  78. data/lib/cyberweb/objectified/html_tags/label.rb +103 -0
  79. data/lib/cyberweb/objectified/html_tags/legend.rb +129 -0
  80. data/lib/cyberweb/objectified/html_tags/li.rb +111 -0
  81. data/lib/cyberweb/objectified/html_tags/map.rb +43 -3
  82. data/lib/cyberweb/objectified/html_tags/meta.rb +13 -2
  83. data/lib/cyberweb/objectified/html_tags/nav.rb +111 -0
  84. data/lib/cyberweb/objectified/html_tags/object.rb +33 -3
  85. data/lib/cyberweb/objectified/html_tags/ol.rb +127 -0
  86. data/lib/cyberweb/objectified/html_tags/p.rb +33 -3
  87. data/lib/cyberweb/objectified/html_tags/pre.rb +41 -4
  88. data/lib/cyberweb/objectified/html_tags/progress.rb +43 -3
  89. data/lib/cyberweb/objectified/html_tags/section.rb +116 -0
  90. data/lib/cyberweb/objectified/html_tags/select.rb +34 -1
  91. data/lib/cyberweb/objectified/html_tags/span.rb +64 -5
  92. data/lib/cyberweb/objectified/html_tags/style.rb +9 -2
  93. data/lib/cyberweb/objectified/html_tags/table.rb +137 -3
  94. data/lib/cyberweb/objectified/html_tags/td.rb +135 -0
  95. data/lib/cyberweb/objectified/html_tags/textarea.rb +37 -3
  96. data/lib/cyberweb/objectified/html_tags/th.rb +114 -0
  97. data/lib/cyberweb/objectified/html_tags/thead.rb +114 -0
  98. data/lib/cyberweb/objectified/html_tags/title.rb +10 -2
  99. data/lib/cyberweb/objectified/html_tags/tr.rb +110 -0
  100. data/lib/cyberweb/objectified/html_tags/ul.rb +45 -4
  101. data/lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb +67 -46
  102. data/lib/cyberweb/oop.rb +9 -0
  103. data/lib/cyberweb/predefined_and_freeform_methods/hash_registered_extra_tags.rb +2 -0
  104. data/lib/cyberweb/predefined_and_freeform_methods/header.rb +4 -1
  105. data/lib/cyberweb/project/project.rb +0 -4
  106. data/lib/cyberweb/requires/remove_html.rb +1 -1
  107. data/lib/cyberweb/requires/require_the_cyberweb_project.rb +1 -9
  108. data/lib/cyberweb/route_handler/module/route_handler_module.rb +2 -1
  109. data/lib/cyberweb/standalone_classes/all_css_classes.rb +5 -2
  110. data/lib/cyberweb/standalone_classes/calculator.rb +3 -1
  111. data/lib/cyberweb/toplevel_methods/audio.rb +3 -1
  112. data/lib/cyberweb/toplevel_methods/csv.rb +1 -1
  113. data/lib/cyberweb/toplevel_methods/frames.rb +11 -3
  114. data/lib/cyberweb/toplevel_methods/greek_letters/greek_letters.rb +3 -0
  115. data/lib/cyberweb/toplevel_methods/hfin.rb +5 -1
  116. data/lib/cyberweb/toplevel_methods/html_tags/README.md +8 -7
  117. data/lib/cyberweb/toplevel_methods/html_tags/html_tags.rb +4211 -2827
  118. data/lib/cyberweb/toplevel_methods/html_tags/table.rb +1202 -0
  119. data/lib/cyberweb/toplevel_methods/javascript.rb +9 -1
  120. data/lib/cyberweb/toplevel_methods/jquery.rb +1 -1
  121. data/lib/cyberweb/toplevel_methods/{log_directory.rb → log_directory_and_logging.rb} +36 -1
  122. data/lib/cyberweb/toplevel_methods/params.rb +11 -11
  123. data/lib/cyberweb/toplevel_methods/random.rb +4 -3
  124. data/lib/cyberweb/toplevel_methods/registered_ids.rb +3 -0
  125. data/lib/cyberweb/toplevel_methods/return_head_start.rb +1 -3
  126. data/lib/cyberweb/toplevel_methods/return_html_start.rb +1 -3
  127. data/lib/cyberweb/toplevel_methods/sanitize_url.rb +2 -1
  128. data/lib/cyberweb/toplevel_methods/server_base_directory.rb +0 -1
  129. data/lib/cyberweb/toplevel_methods/textile.rb +2 -1
  130. data/lib/cyberweb/toplevel_methods/{misc.rb → toplevel_methods.rb} +1446 -807
  131. data/lib/cyberweb/toplevel_methods/video.rb +21 -3
  132. data/lib/cyberweb/toplevel_methods/write_what_into.rb +2 -2
  133. data/lib/cyberweb/utility_scripts/autogenerate_drop_shadow_rules/autogenerate_drop_shadow_rules.rb +2 -4
  134. data/lib/cyberweb/utility_scripts/booklet/booklet.rb +0 -4
  135. data/lib/cyberweb/utility_scripts/download_all_images_from_this_website.rb +1 -1
  136. data/lib/cyberweb/utility_scripts/{download_balloon_css.rb → download_balloon_css/download_balloon_css.rb} +1 -1
  137. data/lib/cyberweb/utility_scripts/images_to_html/images_to_html.rb +3 -0
  138. data/lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb +183 -71
  139. data/lib/cyberweb/utility_scripts/pdf_to_html/pdf_to_html.rb +160 -65
  140. data/lib/cyberweb/version/version.rb +2 -2
  141. data/lib/cyberweb/web_images/map_symbol_to_image_location.rb +13 -2
  142. data/lib/cyberweb/web_object/web_object.rb +62 -20
  143. data/lib/cyberweb/web_scraper/scrape_this_url.rb +3 -1
  144. data/lib/cyberweb/webmin/biology_server.cgi +1 -1
  145. data/lib/cyberweb/webmin/calculator.cgi +1 -1
  146. data/lib/cyberweb/webmin/colour_chart.cgi +1 -1
  147. data/lib/cyberweb/webmin/comments.cgi +2 -2
  148. data/lib/cyberweb/webmin/constants.rb +1 -1
  149. data/lib/cyberweb/webmin/dictionary.cgi +2 -2
  150. data/lib/cyberweb/webmin/simple_forum/index.cgi +2 -2
  151. data/lib/cyberweb/webmin/sys_info.cgi +3 -3
  152. data/lib/cyberweb/webmin/webforum.cgi +1 -1
  153. data/lib/cyberweb/yaml/registered_html_tags.yml +3 -1
  154. data/test/simple_tests/testing_return_dataset_without_any_comments.rb +1 -1
  155. metadata +23 -57
  156. data/lib/cyberweb/html_tags/README.md +0 -3
  157. data/lib/cyberweb/html_tags/a.rb +0 -67
  158. data/lib/cyberweb/html_tags/accesskey.rb +0 -25
  159. data/lib/cyberweb/html_tags/blockquote.rb +0 -56
  160. data/lib/cyberweb/html_tags/body.rb +0 -14
  161. data/lib/cyberweb/html_tags/br.rb +0 -19
  162. data/lib/cyberweb/html_tags/button.rb +0 -150
  163. data/lib/cyberweb/html_tags/canvas.rb +0 -59
  164. data/lib/cyberweb/html_tags/chtml.rb +0 -14
  165. data/lib/cyberweb/html_tags/div.rb +0 -170
  166. data/lib/cyberweb/html_tags/fieldset.rb +0 -69
  167. data/lib/cyberweb/html_tags/figure.rb +0 -72
  168. data/lib/cyberweb/html_tags/form.rb +0 -203
  169. data/lib/cyberweb/html_tags/h1.rb +0 -77
  170. data/lib/cyberweb/html_tags/h2.rb +0 -81
  171. data/lib/cyberweb/html_tags/h3.rb +0 -60
  172. data/lib/cyberweb/html_tags/h4.rb +0 -66
  173. data/lib/cyberweb/html_tags/h5.rb +0 -64
  174. data/lib/cyberweb/html_tags/h6.rb +0 -60
  175. data/lib/cyberweb/html_tags/hr.rb +0 -22
  176. data/lib/cyberweb/html_tags/html_tags.rb +0 -267
  177. data/lib/cyberweb/html_tags/i.rb +0 -52
  178. data/lib/cyberweb/html_tags/img.rb +0 -294
  179. data/lib/cyberweb/html_tags/input.rb +0 -354
  180. data/lib/cyberweb/html_tags/label.rb +0 -65
  181. data/lib/cyberweb/html_tags/legend.rb +0 -56
  182. data/lib/cyberweb/html_tags/li.rb +0 -67
  183. data/lib/cyberweb/html_tags/map.rb +0 -38
  184. data/lib/cyberweb/html_tags/nav.rb +0 -63
  185. data/lib/cyberweb/html_tags/object.rb +0 -57
  186. data/lib/cyberweb/html_tags/ol.rb +0 -57
  187. data/lib/cyberweb/html_tags/option.rb +0 -64
  188. data/lib/cyberweb/html_tags/p.rb +0 -88
  189. data/lib/cyberweb/html_tags/pre.rb +0 -162
  190. data/lib/cyberweb/html_tags/section.rb +0 -33
  191. data/lib/cyberweb/html_tags/select.rb +0 -104
  192. data/lib/cyberweb/html_tags/span.rb +0 -344
  193. data/lib/cyberweb/html_tags/strong.rb +0 -42
  194. data/lib/cyberweb/html_tags/table.rb +0 -284
  195. data/lib/cyberweb/html_tags/tbody.rb +0 -26
  196. data/lib/cyberweb/html_tags/td.rb +0 -212
  197. data/lib/cyberweb/html_tags/textarea.rb +0 -173
  198. data/lib/cyberweb/html_tags/th.rb +0 -70
  199. data/lib/cyberweb/html_tags/thead.rb +0 -41
  200. data/lib/cyberweb/html_tags/tr.rb +0 -99
  201. data/lib/cyberweb/html_tags/ul.rb +0 -51
  202. data/lib/cyberweb/requires/require_html_tags_files.rb +0 -23
  203. data/lib/cyberweb/toplevel_methods/logging.rb +0 -42
  204. data/lib/cyberweb/web_base/web_base.rb +0 -33
@@ -0,0 +1,116 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Objectified::HtmlTags::Section
6
+ # =========================================================================== #
7
+ # require 'cyberweb/objectified/html_tags/section.rb'
8
+ # Cyberweb::Objectified::HtmlTags::Section.new
9
+ # =========================================================================== #
10
+ require 'cyberweb/objectified/html_tags/base.rb'
11
+
12
+ module Cyberweb
13
+
14
+ module Objectified::HtmlTags
15
+
16
+ class Section < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Section
17
+
18
+ # ========================================================================= #
19
+ # === @css_class
20
+ # ========================================================================= #
21
+ @css_class = nil
22
+
23
+ # ========================================================================= #
24
+ # === Cyberweb::Objectified::HtmlTags::Section.reset_css_class
25
+ # ========================================================================= #
26
+ def self.reset_css_class
27
+ @css_class = nil
28
+ end
29
+
30
+ # ========================================================================= #
31
+ # === Cyberweb::Objectified::HtmlTags::Section.set_css_class
32
+ # ========================================================================= #
33
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
34
+ @css_class = i
35
+ end
36
+
37
+ # ========================================================================= #
38
+ # === Cyberweb::Objectified::HtmlTags::Section.css_class?
39
+ # ========================================================================= #
40
+ def self.css_class?
41
+ @css_class
42
+ end
43
+
44
+ # ========================================================================= #
45
+ # === initialize
46
+ #
47
+ # Usage example:
48
+ #
49
+ # Cyberweb::Objectified::HtmlTags::Section.new(i)
50
+ #
51
+ # ========================================================================= #
52
+ def initialize(
53
+ use_this_text = '',
54
+ optional_css_class = Section.css_class?,
55
+ optional_id = nil,
56
+ optional_css_style = nil,
57
+ &block
58
+ )
59
+ try_to_register_this_tag(self)
60
+ reset
61
+ use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
62
+ set_content(use_this_text)
63
+ set_CSS_class(optional_css_class) if optional_css_class
64
+ set_id(optional_id) if optional_id
65
+ set_CSS_style(optional_css_style) if optional_css_style
66
+ if block_given?
67
+ evaluate_this_block(&block)
68
+ end
69
+ end
70
+
71
+ # ========================================================================= #
72
+ # === reset
73
+ # ========================================================================= #
74
+ def reset
75
+ super()
76
+ end
77
+
78
+ # ========================================================================= #
79
+ # === rebuild_the_result
80
+ # ========================================================================= #
81
+ def rebuild_the_result
82
+ reset_the_result
83
+ consider_adding_the_script_entry_from_the_internal_hash
84
+ consider_adding_the_pre_content
85
+ append_onto_the_result '<section'
86
+ batch_append_css_class_then_the_ID_and_then_the_css_style
87
+ append_onto_the_result ">\n"
88
+ content = content?
89
+ if content and !content.empty?
90
+ append_onto_the_result "#{content}\n"
91
+ end
92
+ append_onto_the_result "</section>\n"
93
+ return raw_result?
94
+ end
95
+
96
+ end
97
+
98
+ end
99
+
100
+ # =========================================================================== #
101
+ # === Cyberweb::Objectified::HtmlTags::Section
102
+ # =========================================================================== #
103
+ Section = ::Cyberweb::Objectified::HtmlTags::Section
104
+
105
+ end
106
+
107
+ # =========================================================================== #
108
+ # Testing the <section> tag next:
109
+ # =========================================================================== #
110
+ if __FILE__ == $PROGRAM_NAME
111
+ alias e puts
112
+ _ = Cyberweb::Objectified::HtmlTags::Section.new(
113
+ 'This is for a section-tag.'
114
+ )
115
+ e _
116
+ end
@@ -23,6 +23,39 @@ module Objectified::HtmlTags
23
23
 
24
24
  class Select < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Select
25
25
 
26
+ # ========================================================================= #
27
+ # === @css_class
28
+ # ========================================================================= #
29
+ @css_class = nil
30
+
31
+ # ========================================================================= #
32
+ # === Cyberweb::Objectified::HtmlTags::Select.reset_css_class
33
+ # ========================================================================= #
34
+ def self.reset_css_class
35
+ @css_class = nil
36
+ end
37
+
38
+ # ========================================================================= #
39
+ # === Cyberweb::Objectified::HtmlTags::Select.clear
40
+ # ========================================================================= #
41
+ def self.clear
42
+ Select.set_css_class('')
43
+ end
44
+
45
+ # ========================================================================= #
46
+ # === Cyberweb::Objectified::HtmlTags::Select.set_css_class
47
+ # ========================================================================= #
48
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
49
+ @css_class = i
50
+ end
51
+
52
+ # ========================================================================= #
53
+ # === Cyberweb::Objectified::HtmlTags::Select.css_class?
54
+ # ========================================================================= #
55
+ def self.css_class?
56
+ @css_class
57
+ end
58
+
26
59
  # ========================================================================= #
27
60
  # === initialize
28
61
  #
@@ -37,7 +70,7 @@ class Select < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified
37
70
  optional_id = nil,
38
71
  optional_css_style = nil
39
72
  )
40
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
73
+ try_to_register_this_tag(self)
41
74
  reset
42
75
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
43
76
  set_content(use_this_text)
@@ -14,6 +14,32 @@ module Objectified::HtmlTags
14
14
 
15
15
  class Span < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Span
16
16
 
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Span.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Span.set_css_class
31
+ # ========================================================================= #
32
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
33
+ @css_class = i
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === Cyberweb::Objectified::HtmlTags::Span.css_class?
38
+ # ========================================================================= #
39
+ def self.css_class?
40
+ @css_class
41
+ end
42
+
17
43
  # ========================================================================= #
18
44
  # === initialize
19
45
  #
@@ -24,11 +50,11 @@ class Span < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
24
50
  # ========================================================================= #
25
51
  def initialize(
26
52
  use_this_text = '',
27
- optional_css_class = nil,
53
+ optional_css_class = Span.css_class?,
28
54
  optional_id = nil,
29
55
  optional_css_style = nil
30
56
  )
31
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
57
+ try_to_register_this_tag(self)
32
58
  reset
33
59
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
34
60
  set_content(use_this_text)
@@ -48,8 +74,19 @@ class Span < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
48
74
  @internal_hash[:alignment] = nil
49
75
  end
50
76
 
77
+ # ========================================================================= #
78
+ # === hint?
79
+ #
80
+ # This will become e. g. <span title="My tip">text</span
81
+ # ========================================================================= #
82
+ def hint=(i)
83
+ @internal_hash[:hint] = i
84
+ end
85
+
51
86
  # ========================================================================= #
52
87
  # === align_to_the_left
88
+ #
89
+ # This method will align to the left.
53
90
  # ========================================================================= #
54
91
  def align_to_the_left
55
92
  @internal_hash[:alignment] = :left
@@ -65,6 +102,9 @@ class Span < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
65
102
  consider_adding_the_pre_content
66
103
  append_onto_the_result '<span'
67
104
  batch_append_css_class_then_the_ID_and_then_the_css_style
105
+ if @internal_hash[:hint]
106
+ append_onto_the_result ' title="'+@internal_hash[:hint].to_s+'"'
107
+ end
68
108
  append_onto_the_result ">\n"
69
109
  append_onto_the_result content?.to_s
70
110
  append_onto_the_result "\n</span>\n"
@@ -83,13 +123,32 @@ def left_aligned_label(text = '')
83
123
  end; alias left_aligned_text left_aligned_label # === left_aligned_text
84
124
  alias to_the_left left_aligned_label # === to_the_left
85
125
 
126
+ Span = ::Cyberweb::Objectified::HtmlTags::Span
127
+
86
128
  end
87
129
 
88
130
  # =========================================================================== #
89
131
  # Testing the <span> tag next:
90
132
  # =========================================================================== #
91
133
  if __FILE__ == $PROGRAM_NAME
92
- alias e puts
93
- e Cyberweb::Objectified::HtmlTags::Span.new('hey there')
94
- e Cyberweb::Objectified::HtmlTags::Span.new('hey there').align_to_the_left
134
+ require 'colours/colours_e_autoinclude.rb'
135
+ span = Cyberweb::Objectified::HtmlTags::Span.new('hey there')
136
+ e ::Colours.tomato(Cyberweb::Objectified::HtmlTags::Span.new('hey there'))
137
+ e
138
+ e ::Colours.tomato(Cyberweb::Objectified::HtmlTags::Span.new('hey there').align_to_the_left)
139
+ e
140
+ e ::Colours.royalblue(Cyberweb::Objectified::HtmlTags::Span.css_class?)
141
+ e
142
+ e span
143
+ e
144
+ e 'Setting to the new CSS classes "mars1em" and "BOLD" next:'
145
+ e
146
+ Cyberweb::Objectified::HtmlTags::Span.set_css_class('mars1em BOLD')
147
+ e
148
+ span = Cyberweb::Objectified::HtmlTags::Span.new('hey there')
149
+ e span
150
+ Cyberweb::Objectified::HtmlTags::Span.reset_css_class
151
+ Cyberweb::Span.set_css_class 'padl5em green'
152
+ span = Cyberweb::Span.new('hey there')
153
+ e ::Colours.lightgreen(span)
95
154
  end
@@ -25,7 +25,7 @@ class Style < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
25
25
  def initialize(
26
26
  use_this_text = ''
27
27
  )
28
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
28
+ try_to_register_this_tag(self)
29
29
  reset
30
30
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
31
31
  case use_this_text
@@ -79,7 +79,14 @@ class Style < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
79
79
  return raw_result?
80
80
  end
81
81
 
82
- end; end; end
82
+ end; end
83
+
84
+ # =========================================================================== #
85
+ # === Cyberweb::Objectified::HtmlTags::Style
86
+ # =========================================================================== #
87
+ Style = ::Cyberweb::Objectified::HtmlTags::Style
88
+
89
+ end
83
90
 
84
91
  # =========================================================================== #
85
92
  # Testing the <style> tag next:
@@ -18,6 +18,39 @@ module Objectified::HtmlTags
18
18
 
19
19
  class Table < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Table
20
20
 
21
+ # ========================================================================= #
22
+ # === @css_class
23
+ # ========================================================================= #
24
+ @css_class = nil
25
+
26
+ # ========================================================================= #
27
+ # === Cyberweb::Objectified::HtmlTags::Table.reset_css_class
28
+ # ========================================================================= #
29
+ def self.reset_css_class
30
+ @css_class = nil
31
+ end
32
+
33
+ # ========================================================================= #
34
+ # === Cyberweb::Objectified::HtmlTags::Table.clear
35
+ # ========================================================================= #
36
+ def self.clear
37
+ Table.set_css_class('')
38
+ end; self.instance_eval { alias reset clear } # === Cyberweb::Objectified::HtmlTags::Table.reset
39
+
40
+ # ========================================================================= #
41
+ # === Cyberweb::Objectified::HtmlTags::Table.set_css_class
42
+ # ========================================================================= #
43
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
44
+ @css_class = i
45
+ end
46
+
47
+ # ========================================================================= #
48
+ # === Cyberweb::Objectified::HtmlTags::Table.css_class?
49
+ # ========================================================================= #
50
+ def self.css_class?
51
+ @css_class
52
+ end
53
+
21
54
  # ========================================================================= #
22
55
  # === initialize
23
56
  #
@@ -28,11 +61,11 @@ class Table < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
28
61
  # ========================================================================= #
29
62
  def initialize(
30
63
  use_this_text = '',
31
- optional_css_class = nil,
64
+ optional_css_class = Table.css_class?,
32
65
  optional_id = nil,
33
66
  optional_css_style = nil
34
67
  )
35
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
68
+ try_to_register_this_tag(self)
36
69
  reset
37
70
  set_content(use_this_text) # This should be an Array really.
38
71
  set_CSS_class(optional_css_class) if optional_css_class
@@ -87,6 +120,7 @@ class Table < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
87
120
  def fill_with_this_array(i)
88
121
  set_content(i)
89
122
  end
123
+
90
124
  # ========================================================================= #
91
125
  # === alternate_backgrounds
92
126
  # ========================================================================= #
@@ -189,7 +223,107 @@ class Table < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
189
223
  return raw_result?
190
224
  end
191
225
 
192
- end; end; end
226
+ end; end
227
+
228
+ # =========================================================================== #
229
+ # === Cyberweb::Objectified::HtmlTags::Table
230
+ # =========================================================================== #
231
+ Table = ::Cyberweb::Objectified::HtmlTags::Table
232
+
233
+ # =========================================================================== #
234
+ # === Table.parse
235
+ # =========================================================================== #
236
+ def Table.parse(*i)
237
+ ::Cyberweb.parse_table(i)
238
+ end
239
+
240
+ # =========================================================================== #
241
+ # === Cyberweb::Table.padding=
242
+ #
243
+ # This is an alias towards "bspace", aka the "border-spacing" property.
244
+ # =========================================================================== #
245
+ def Table.padding=(i)
246
+ Table.set_css_class('bspace'+i.to_s)
247
+ end
248
+
249
+ # ======================================================================= #
250
+ # === Cyberweb::Table.return_alternate_backgrounds
251
+ #
252
+ # This table will use alternative backgrounds.
253
+ # ======================================================================= #
254
+ def Table.return_alternate_backgrounds(
255
+ array = [],
256
+ optional_css_class = '',
257
+ &block
258
+ )
259
+ _use_this_class_for_even_rows = 'dark_background'
260
+ _use_this_class_for_odd_rows = 'light_background'
261
+ # ===================================================================== #
262
+ # === Handle blocks next
263
+ # ===================================================================== #
264
+ if block_given?
265
+ yielded = yield
266
+ if array.empty? and !yielded.empty?
267
+ array = yielded
268
+ end
269
+ end
270
+ table = Cyberweb::Objectified::HtmlTags::Table.new(optional_css_class)
271
+ table.alternate_backgrounds(
272
+ array,
273
+ optional_css_class
274
+ )
275
+ # ========================================================================= #
276
+ # The old code in October 2021 was the following:
277
+ # _ = '<table'.dup
278
+ # _ << ::Cyberweb.return_css_class(optional_css_class)
279
+ # _ << '>'
280
+ # array.each_with_index {|entry, index|
281
+ # _ << "<tr>#{N}"
282
+ # case index % 2
283
+ # when 0
284
+ # _ << '<td class="'+use_this_class_for_even_rows+'">'+N
285
+ # when 1
286
+ # _ << '<td class="'+use_this_class_for_odd_rows+'">'+N
287
+ # end
288
+ # _ << entry+N
289
+ # _ << '</td>'+N
290
+ # _ << '</tr>'+N
291
+ # }
292
+ # _ << '</table>'+N
293
+ # return _
294
+ #
295
+ # It will be retained for a bit longer in the comment above.
296
+ # ========================================================================= #
297
+ return table.to_s
298
+ end
299
+
300
+ # =========================================================================== #
301
+ # === Cyberweb::Table.enable_padding
302
+ # =========================================================================== #
303
+ def Table.enable_padding # This is supposed to enable padding.
304
+ Table.set_css_class 'pad15px'
305
+ end
306
+
307
+ # =========================================================================== #
308
+ # === Cyberweb::Table.alternate_backgrounds
309
+ #
310
+ # Next, define the method Table.alternate_backgrounds().
311
+ #
312
+ # The first argument to this method must be an Array.
313
+ #
314
+ # Usage examples:
315
+ #
316
+ # Cyberweb::Table.alternate_backgrounds(%w( one two three four ), 'bblack1 pad0_5em')
317
+ # Table.alternate_backgrounds(%w( one two three four ), 'bblack1 pad0_5em')
318
+ #
319
+ # =========================================================================== #
320
+ def Table.alternate_backgrounds(
321
+ array, optional_css_class = ''
322
+ )
323
+ ee ::Cyberweb::Table.return_alternate_backgrounds(array, optional_css_class)
324
+ end
325
+
326
+ end
193
327
 
194
328
  # =========================================================================== #
195
329
  # Testing the <table> tag next:
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Objectified::HtmlTags::Td
6
+ # =========================================================================== #
7
+ # require 'cyberweb/objectified/html_tags/td.rb'
8
+ # x = Cyberweb::Objectified::HtmlTags::Td.new
9
+ # =========================================================================== #
10
+ require 'cyberweb/objectified/html_tags/base.rb'
11
+
12
+ module Cyberweb
13
+
14
+ module Objectified::HtmlTags
15
+
16
+ class Td < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Td
17
+
18
+ # ========================================================================= #
19
+ # === @css_class
20
+ # ========================================================================= #
21
+ @css_class = nil
22
+
23
+ # ========================================================================= #
24
+ # === Cyberweb::Objectified::HtmlTags::Td.reset_css_class
25
+ # ========================================================================= #
26
+ def self.reset_css_class
27
+ @css_class = nil
28
+ end
29
+
30
+ # ========================================================================= #
31
+ # === Cyberweb::Objectified::HtmlTags::Td.clear
32
+ # ========================================================================= #
33
+ def self.clear
34
+ Td.set_css_class('')
35
+ end; self.instance_eval { alias reset clear } # === Cyberweb::Objectified::HtmlTags::Td.reset
36
+
37
+ # ========================================================================= #
38
+ # === Cyberweb::Objectified::HtmlTags::Td.set_css_class
39
+ #
40
+ # To use class Td, do this:
41
+ #
42
+ # Td.set_css_class 'marl1em'
43
+ # Td.css_class?
44
+ #
45
+ # ========================================================================= #
46
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
47
+ @css_class = i
48
+ end
49
+
50
+ # ========================================================================= #
51
+ # === Cyberweb::Objectified::HtmlTags::Td.css_class?
52
+ # ========================================================================= #
53
+ def self.css_class?
54
+ @css_class
55
+ end
56
+
57
+ # ========================================================================= #
58
+ # === initialize
59
+ #
60
+ # Usage example:
61
+ #
62
+ # Cyberweb::Objectified::HtmlTags::Td.new(i)
63
+ #
64
+ # ========================================================================= #
65
+ def initialize(
66
+ use_this_text = '',
67
+ optional_css_class = Td.css_class?,
68
+ optional_id = nil,
69
+ optional_css_style = nil
70
+ )
71
+ try_to_register_this_tag(self)
72
+ reset
73
+ set_content(use_this_text) # This should be an Array really.
74
+ set_CSS_class(optional_css_class) if optional_css_class
75
+ set_id(optional_id) if optional_id
76
+ set_CSS_style(optional_css_style) if optional_css_style
77
+ end
78
+
79
+ # ========================================================================= #
80
+ # === reset
81
+ # ========================================================================= #
82
+ def reset
83
+ super()
84
+ end
85
+
86
+ # ========================================================================= #
87
+ # === rebuild_the_result
88
+ # ========================================================================= #
89
+ def rebuild_the_result
90
+ reset_the_result
91
+ consider_adding_the_pre_content
92
+ append_onto_the_result '<td'
93
+ batch_append_css_class_then_the_ID_and_then_the_css_style
94
+ append_onto_the_result ">\n"
95
+ append_the_content
96
+ append_onto_the_result "</td>\n"
97
+ return raw_result?
98
+ end
99
+
100
+ end; end
101
+
102
+ # =========================================================================== #
103
+ # === Cyberweb::Objectified::HtmlTags::Td
104
+ # =========================================================================== #
105
+ Td = ::Cyberweb::Objectified::HtmlTags::Td
106
+
107
+ # ============================================================================ #
108
+ # === Cyberweb::Td.padding=
109
+ #
110
+ # This is an alias towards "bspace", aka the "border-spacing" property.
111
+ # ============================================================================ #
112
+ def Td.padding=(i)
113
+ Td.set_css_class("bspace#{i}")
114
+ end
115
+
116
+ end
117
+
118
+ # =========================================================================== #
119
+ # Testing the <td> tag next:
120
+ # =========================================================================== #
121
+ if __FILE__ == $PROGRAM_NAME
122
+ # ========================================================================= #
123
+ # The code that follows next ist mostly test-code:
124
+ # ========================================================================= #
125
+ alias e puts
126
+ require 'colours/autoinclude'
127
+ e Colours.steelblue("Round 1, testing ... \n")
128
+ _ = Cyberweb::Objectified::HtmlTags::td.new('OK')
129
+ _.id = 'hover_transition'
130
+ _.css_class = 'rounded_border_8px wid100 bblack2'
131
+ _.css_style = 'font-size: 3.5em'
132
+ e
133
+ e _
134
+ e
135
+ end
@@ -14,6 +14,32 @@ module Objectified::HtmlTags
14
14
 
15
15
  class Textarea < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Textarea
16
16
 
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Textarea.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Textarea.set_css_class
31
+ # ========================================================================= #
32
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
33
+ @css_class = i
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === Cyberweb::Objectified::HtmlTags::Textarea.css_class?
38
+ # ========================================================================= #
39
+ def self.css_class?
40
+ @css_class
41
+ end
42
+
17
43
  # ========================================================================= #
18
44
  # === initialize
19
45
  #
@@ -24,11 +50,11 @@ class Textarea < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectifi
24
50
  # ========================================================================= #
25
51
  def initialize(
26
52
  use_this_text = '',
27
- optional_css_class = nil,
53
+ optional_css_class = Textarea.css_class?,
28
54
  optional_id = nil,
29
55
  optional_css_style = nil
30
56
  )
31
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
57
+ try_to_register_this_tag(self)
32
58
  reset
33
59
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
34
60
  set_content(use_this_text)
@@ -100,7 +126,11 @@ class Textarea < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectifi
100
126
  return raw_result?
101
127
  end
102
128
 
103
- end; end; end
129
+ end; end
130
+
131
+ Textarea = ::Cyberweb::Objectified::HtmlTags::Textarea
132
+
133
+ end
104
134
 
105
135
  # =========================================================================== #
106
136
  # Testing <textarea> tag next:
@@ -120,4 +150,8 @@ if __FILE__ == $PROGRAM_NAME
120
150
  _.rows = 6
121
151
  _.cols = 90
122
152
  e _
153
+ e
154
+ _ = Cyberweb::Textarea.new('default content')
155
+ _.id = 'ok_ID'
156
+ e _
123
157
  end