cyberweb 0.12.35 → 0.13.12

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 +383 -311
  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 +184 -72
  139. data/lib/cyberweb/utility_scripts/pdf_to_html/pdf_to_html.rb +161 -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 +65 -67
  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,112 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Objectified::HtmlTags::I
6
+ # =========================================================================== #
7
+ # require 'cyberweb/objectified/html_tags/i.rb'
8
+ # =========================================================================== #
9
+ require 'cyberweb/objectified/html_tags/base.rb'
10
+
11
+ module Cyberweb
12
+
13
+ module Objectified::HtmlTags
14
+
15
+ class I < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::I
16
+
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::I.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::I.clear
31
+ # ========================================================================= #
32
+ def self.clear
33
+ I.set_css_class('')
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === Cyberweb::Objectified::HtmlTags::I.set_css_class
38
+ # ========================================================================= #
39
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
40
+ @css_class = i
41
+ end
42
+
43
+ # ========================================================================= #
44
+ # === Cyberweb::Objectified::HtmlTags::I.css_class?
45
+ # ========================================================================= #
46
+ def self.css_class?
47
+ @css_class
48
+ end
49
+
50
+ # ========================================================================= #
51
+ # === initialize
52
+ #
53
+ # Usage example:
54
+ #
55
+ # Cyberweb::Objectified::HtmlTags::I.new(i)
56
+ #
57
+ # ========================================================================= #
58
+ def initialize(
59
+ use_this_text = '',
60
+ optional_css_class = I.css_class?,
61
+ optional_id = nil,
62
+ optional_css_style = nil
63
+ )
64
+ try_to_register_this_tag(self)
65
+ reset
66
+ use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
67
+ set_content(use_this_text)
68
+ set_CSS_class(optional_css_class) if optional_css_class
69
+ set_id(optional_id) if optional_id
70
+ set_CSS_style(optional_css_style) if optional_css_style
71
+ end
72
+
73
+ # ========================================================================= #
74
+ # === reset
75
+ # ========================================================================= #
76
+ def reset
77
+ super()
78
+ end
79
+
80
+ # ========================================================================= #
81
+ # === rebuild_the_result
82
+ # ========================================================================= #
83
+ def rebuild_the_result
84
+ reset_the_result
85
+ consider_adding_the_pre_content
86
+ append_onto_the_result '<i'
87
+ batch_append_css_class_then_the_ID_and_then_the_css_style
88
+ append_onto_the_result ' href="'+content?.to_s+'">'
89
+ append_onto_the_result "\n"
90
+ append_onto_the_result content?.to_s
91
+ append_onto_the_result "\n"
92
+ append_onto_the_result '</i>'+"\n"
93
+ return raw_result?
94
+ end
95
+
96
+ end; end
97
+
98
+ # =========================================================================== #
99
+ # === Cyberweb::Objectified::HtmlTags::I
100
+ # =========================================================================== #
101
+ I = ::Cyberweb::Objectified::HtmlTags::I
102
+
103
+ end
104
+
105
+ # =========================================================================== #
106
+ # Testing the <a> tag next:
107
+ # =========================================================================== #
108
+ if __FILE__ == $PROGRAM_NAME
109
+ alias e puts
110
+ _ = Cyberweb::Objectified::HtmlTags::I.new('foobar/')
111
+ e _
112
+ end
@@ -5,6 +5,7 @@
5
5
  # === Cyberweb::Objectified::HtmlTags::Img
6
6
  # =========================================================================== #
7
7
  # require 'cyberweb/objectified/html_tags/img.rb'
8
+ # Cyberweb::Objectified::HtmlTags::Img.new
8
9
  # =========================================================================== #
9
10
  require 'cyberweb/objectified/html_tags/base.rb'
10
11
 
@@ -14,6 +15,39 @@ module Objectified::HtmlTags
14
15
 
15
16
  class Img < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Img
16
17
 
18
+ # ========================================================================= #
19
+ # === @css_class
20
+ # ========================================================================= #
21
+ @css_class = nil
22
+
23
+ # ========================================================================= #
24
+ # === Cyberweb::Objectified::HtmlTags::Img.reset_css_class
25
+ # ========================================================================= #
26
+ def self.reset_css_class
27
+ @css_class = nil
28
+ end
29
+
30
+ # ========================================================================= #
31
+ # === Cyberweb::Objectified::HtmlTags::Img.clear
32
+ # ========================================================================= #
33
+ def self.clear
34
+ Img.set_css_class('')
35
+ end
36
+
37
+ # ========================================================================= #
38
+ # === Cyberweb::Objectified::HtmlTags::Img.set_css_class
39
+ # ========================================================================= #
40
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
41
+ @css_class = i
42
+ end
43
+
44
+ # ========================================================================= #
45
+ # === Cyberweb::Objectified::HtmlTags::Img.css_class?
46
+ # ========================================================================= #
47
+ def self.css_class?
48
+ @css_class
49
+ end
50
+
17
51
  # ========================================================================= #
18
52
  # === initialize
19
53
  #
@@ -24,17 +58,21 @@ class Img < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::H
24
58
  # ========================================================================= #
25
59
  def initialize(
26
60
  use_this_text = '',
27
- optional_css_class = nil,
61
+ optional_css_class = Img.css_class?,
28
62
  optional_id = nil,
29
- optional_css_style = nil
63
+ optional_css_style = nil,
64
+ &block
30
65
  )
31
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
66
+ try_to_register_this_tag(self)
32
67
  reset
33
68
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
34
69
  set_content(use_this_text)
35
70
  set_CSS_class(optional_css_class) if optional_css_class
36
71
  set_id(optional_id) if optional_id
37
72
  set_CSS_style(optional_css_style) if optional_css_style
73
+ if block_given?
74
+ evaluate_this_block(&block)
75
+ end
38
76
  end
39
77
 
40
78
  # ========================================================================= #
@@ -48,6 +86,21 @@ class Img < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::H
48
86
  do_not_load_lazily
49
87
  end
50
88
 
89
+ # ========================================================================= #
90
+ # === do_download
91
+ #
92
+ # This will download the remote image.
93
+ # ========================================================================= #
94
+ def do_download
95
+ require 'cyberweb/toplevel_methods/toplevel_methods.rb'
96
+ use_this_URL = content?
97
+ if Cyberweb.log_dir?.nil?
98
+ Cyberweb.initialize_the_configuration
99
+ end
100
+ cd(::Cyberweb.log_dir?)
101
+ ::Cyberweb.download_webpage(use_this_URL)
102
+ end; alias download do_download # === download
103
+
51
104
  # ========================================================================= #
52
105
  # === on_mouse_over
53
106
  #
@@ -142,22 +195,16 @@ class Img < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::H
142
195
  return raw_result?
143
196
  end
144
197
 
145
- # ========================================================================= #
146
- # === do_download
147
- #
148
- # This will download the remote image.
149
- # ========================================================================= #
150
- def do_download
151
- require 'cyberweb/toplevel_methods/misc.rb'
152
- use_this_URL = content?
153
- if Cyberweb.log_dir?.nil?
154
- Cyberweb.initialize_the_configuration
155
- end
156
- cd(::Cyberweb.log_dir?)
157
- ::Cyberweb.download_webpage(use_this_URL)
158
- end; alias download do_download # === download
198
+ end
199
+
200
+ end
201
+
202
+ # =========================================================================== #
203
+ # === Cyberweb::Objectified::HtmlTags::Img
204
+ # =========================================================================== #
205
+ Img = ::Cyberweb::Objectified::HtmlTags::Img
159
206
 
160
- end; end; end
207
+ end
161
208
 
162
209
  # =========================================================================== #
163
210
  # Testing the <img> tag next:
@@ -14,6 +14,39 @@ module Objectified::HtmlTags
14
14
 
15
15
  class Input < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Input
16
16
 
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Input.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Input.clear
31
+ # ========================================================================= #
32
+ def self.clear
33
+ Input.set_css_class('')
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === Cyberweb::Objectified::HtmlTags::Input.set_css_class
38
+ # ========================================================================= #
39
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
40
+ @css_class = i
41
+ end
42
+
43
+ # ========================================================================= #
44
+ # === Cyberweb::Objectified::HtmlTags::Input.css_class?
45
+ # ========================================================================= #
46
+ def self.css_class?
47
+ @css_class
48
+ end
49
+
17
50
  # ========================================================================= #
18
51
  # === initialize
19
52
  #
@@ -24,12 +57,58 @@ class Input < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
24
57
  # ========================================================================= #
25
58
  def initialize(
26
59
  use_this_text = '',
27
- optional_css_class = nil,
60
+ optional_css_class = Input.css_class?,
28
61
  optional_id = nil,
29
62
  optional_css_style = nil
30
63
  )
31
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
64
+ try_to_register_this_tag(self)
32
65
  reset
66
+ if use_this_text.is_a? Hash
67
+ _ = use_this_text
68
+ # ===================================================================== #
69
+ # === :css_style
70
+ #
71
+ # This entry point should support Syntax such as:
72
+ #
73
+ # oop_entry(css_style: 'padding: 8px')
74
+ #
75
+ # ===================================================================== #
76
+ if _.has_key? :css_style
77
+ optional_css_style = _.delete(:css_style)
78
+ end
79
+ # ===================================================================== #
80
+ # === :id
81
+ # ===================================================================== #
82
+ if _.has_key? :id
83
+ optional_id = _.delete(:id)
84
+ end
85
+ if _.empty?
86
+ use_this_text = ''
87
+ end
88
+ end
89
+ if optional_css_class.is_a? Hash
90
+ _ = optional_css_class
91
+ # ===================================================================== #
92
+ # === :css_style
93
+ #
94
+ # This entry point should support Syntax such as:
95
+ #
96
+ # oop_entry(css_style: 'padding: 8px')
97
+ #
98
+ # ===================================================================== #
99
+ if _.has_key? :css_style
100
+ optional_css_style = _.delete(:css_style)
101
+ end
102
+ # ===================================================================== #
103
+ # === :id
104
+ # ===================================================================== #
105
+ if _.has_key? :id
106
+ optional_id = _.delete(:id)
107
+ end
108
+ if _.empty?
109
+ optional_css_class = ''
110
+ end
111
+ end
33
112
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
34
113
  set_content(use_this_text)
35
114
  set_CSS_class(optional_css_class) if optional_css_class
@@ -152,6 +231,11 @@ def self.create_entry(
152
231
  )
153
232
  end
154
233
 
234
+ # =========================================================================== #
235
+ # === Cyberweb::Objectified::HtmlTags::Input
236
+ # =========================================================================== #
237
+ Input = ::Cyberweb::Objectified::HtmlTags::Input
238
+
155
239
  end
156
240
 
157
241
  # =========================================================================== #
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Objectified::HtmlTags::Label
6
+ # =========================================================================== #
7
+ # require 'cyberweb/objectified/html_tags/label.rb'
8
+ # =========================================================================== #
9
+ require 'cyberweb/objectified/html_tags/base.rb'
10
+
11
+ module Cyberweb
12
+
13
+ module Objectified::HtmlTags
14
+
15
+ class Label < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Label
16
+
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Label.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Label.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::Label.css_class?
38
+ # ========================================================================= #
39
+ def self.css_class?
40
+ @css_class
41
+ end
42
+
43
+ # ========================================================================= #
44
+ # === initialize
45
+ #
46
+ # Usage example:
47
+ #
48
+ # Cyberweb::Objectified::HtmlTags::Label.new(i)
49
+ #
50
+ # ========================================================================= #
51
+ def initialize(
52
+ use_this_text = '',
53
+ optional_css_class = Label.css_class?,
54
+ optional_id = nil,
55
+ optional_css_style = nil
56
+ )
57
+ try_to_register_this_tag(self)
58
+ reset
59
+ use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
60
+ set_content(use_this_text)
61
+ set_CSS_class(optional_css_class) if optional_css_class
62
+ set_id(optional_id) if optional_id
63
+ set_CSS_style(optional_css_style) if optional_css_style
64
+ end
65
+
66
+ # ========================================================================= #
67
+ # === reset
68
+ # ========================================================================= #
69
+ def reset
70
+ super()
71
+ end
72
+
73
+ # ========================================================================= #
74
+ # === rebuild_the_result
75
+ # ========================================================================= #
76
+ def rebuild_the_result
77
+ reset_the_result
78
+ consider_adding_the_pre_content
79
+ append_onto_the_result '<label'
80
+ batch_append_css_class_then_the_ID_and_then_the_css_style
81
+ append_onto_the_result ">\n"
82
+ append_onto_the_result content?.to_s
83
+ append_onto_the_result "\n</label>\n"
84
+ return raw_result?
85
+ end
86
+
87
+ end; end
88
+
89
+ Label = ::Cyberweb::Objectified::HtmlTags::Label
90
+
91
+ end
92
+
93
+ # =========================================================================== #
94
+ # Testing the <p> tag next:
95
+ # =========================================================================== #
96
+ if __FILE__ == $PROGRAM_NAME
97
+ alias e puts
98
+ _ = Cyberweb::Objectified::HtmlTags::Label.new('xyz')
99
+ _.id = 'hover_transition'
100
+ _.css_class = 'rounded_border_8px wid100 bblack2'
101
+ _.css_style = 'font-size: 3em'
102
+ e _
103
+ end
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Objectified::HtmlTags::Legend
6
+ # =========================================================================== #
7
+ # require 'cyberweb/objectified/html_tags/legend.rb'
8
+ # =========================================================================== #
9
+ require 'cyberweb/objectified/html_tags/base.rb'
10
+
11
+ module Cyberweb
12
+
13
+ module Objectified::HtmlTags
14
+
15
+ class Legend < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Legend
16
+
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Legend.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Legend.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::Legend.css_class?
38
+ # ========================================================================= #
39
+ def self.css_class?
40
+ @css_class
41
+ end
42
+
43
+ # ========================================================================= #
44
+ # === initialize
45
+ #
46
+ # Usage example:
47
+ #
48
+ # Cyberweb::Objectified::HtmlTags::Legend.new(i)
49
+ #
50
+ # ========================================================================= #
51
+ def initialize(
52
+ use_this_text = '',
53
+ optional_css_class = Legend.css_class?,
54
+ optional_id = nil,
55
+ optional_css_style = nil
56
+ )
57
+ try_to_register_this_tag(self)
58
+ reset
59
+ use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
60
+ set_content(use_this_text)
61
+ set_CSS_class(optional_css_class) if optional_css_class
62
+ set_id(optional_id) if optional_id
63
+ set_CSS_style(optional_css_style) if optional_css_style
64
+ end
65
+
66
+ # ========================================================================= #
67
+ # === reset
68
+ # ========================================================================= #
69
+ def reset
70
+ super()
71
+ # ======================================================================= #
72
+ # === :img
73
+ # ======================================================================= #
74
+ @internal_hash[:img] = nil
75
+ # ======================================================================= #
76
+ # === :figcaption
77
+ # ======================================================================= #
78
+ @internal_hash[:figcaption] = nil
79
+ # ======================================================================= #
80
+ # === :data
81
+ # ======================================================================= #
82
+ @internal_hash[:data] = nil
83
+ end
84
+
85
+ # ========================================================================= #
86
+ # === data=
87
+ # ========================================================================= #
88
+ def data=(i)
89
+ @internal_hash[:data] = i
90
+ end
91
+
92
+ # ========================================================================= #
93
+ # === data
94
+ # ========================================================================= #
95
+ def data?
96
+ @internal_hash[:data]
97
+ end
98
+
99
+ # ========================================================================= #
100
+ # === rebuild_the_result
101
+ # ========================================================================= #
102
+ def rebuild_the_result
103
+ reset_the_result
104
+ consider_adding_the_pre_content
105
+ append_onto_the_result '<legend'
106
+ batch_append_css_class_then_the_ID_and_then_the_css_style
107
+ append_onto_the_result ">\n"
108
+ append_onto_the_result '</legend>'+"\n"
109
+ return raw_result?
110
+ end
111
+
112
+ end; end
113
+
114
+ Legend = ::Cyberweb::Objectified::HtmlTags::Legend
115
+
116
+ end
117
+
118
+ # =========================================================================== #
119
+ # Testing the <legend> tag next:
120
+ # =========================================================================== #
121
+ if __FILE__ == $PROGRAM_NAME
122
+ alias e puts
123
+ _ = Cyberweb::Objectified::HtmlTags::Legend.new(ARGV)
124
+ _.data = 'picture.jpg'
125
+ # _.id = 'test'
126
+ # _.css_class = 'rounded_border_8px wid100 bblack2'
127
+ # _.css_style = 'font-size: 3em'
128
+ e _
129
+ end
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Objectified::HtmlTags::Li
6
+ # =========================================================================== #
7
+ # require 'cyberweb/objectified/html_tags/li.rb'
8
+ # =========================================================================== #
9
+ require 'cyberweb/objectified/html_tags/base.rb'
10
+
11
+ module Cyberweb
12
+
13
+ module Objectified::HtmlTags
14
+
15
+ class Li < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Li
16
+
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Li.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Li.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::Li.css_class?
38
+ # ========================================================================= #
39
+ def self.css_class?
40
+ @css_class
41
+ end
42
+
43
+ # ========================================================================= #
44
+ # === initialize
45
+ #
46
+ # Usage example:
47
+ #
48
+ # Cyberweb::Objectified::HtmlTags::Li.new(i)
49
+ #
50
+ # ========================================================================= #
51
+ def initialize(
52
+ use_this_text = '',
53
+ optional_css_class = Li.css_class?,
54
+ optional_id = nil,
55
+ optional_css_style = nil
56
+ )
57
+ try_to_register_this_tag(self)
58
+ reset
59
+ set_content(use_this_text)
60
+ set_CSS_class(optional_css_class) if optional_css_class
61
+ set_id(optional_id) if optional_id
62
+ set_CSS_style(optional_css_style) if optional_css_style
63
+ end
64
+
65
+ # ========================================================================= #
66
+ # === reset
67
+ # ========================================================================= #
68
+ def reset
69
+ super()
70
+ end
71
+
72
+ # ========================================================================= #
73
+ # === rebuild_the_result
74
+ # ========================================================================= #
75
+ def rebuild_the_result
76
+ reset_the_result
77
+ consider_adding_the_pre_content
78
+ append_onto_the_result '<ul'
79
+ batch_append_css_class_then_the_ID_and_then_the_css_style
80
+ append_onto_the_result ">\n"
81
+ content?.each {|entry|
82
+ append_onto_the_result "<li>#{entry}</li>\n"
83
+ }
84
+ # ========================================================================= #
85
+ # Add the closing paren next:
86
+ # ========================================================================= #
87
+ append_onto_the_result "\n</ul>\n"
88
+ return raw_result?
89
+ end
90
+
91
+ end; end
92
+
93
+ # =========================================================================== #
94
+ # === Cyberweb::Objectified::HtmlTags::Li
95
+ # =========================================================================== #
96
+ Li = ::Cyberweb::Objectified::HtmlTags::Li
97
+
98
+ end
99
+
100
+ # =========================================================================== #
101
+ # Testing the <ul> tag next:
102
+ # =========================================================================== #
103
+ if __FILE__ == $PROGRAM_NAME
104
+ # ========================================================================= #
105
+ # The code that follows next ist mostly test-code:
106
+ # ========================================================================= #
107
+ alias e puts
108
+ e 'Round 1, testing ... '
109
+ _ = Cyberweb::Objectified::HtmlTags::Li.new('foobar')
110
+ e _
111
+ end