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
@@ -11,11 +11,11 @@ module Cyberweb
11
11
 
12
12
  require 'yaml'
13
13
  require 'cyberweb/toplevel_methods/is_an_image.rb'
14
- require 'cyberweb/images/path_to_images.rb'
15
14
  require 'cyberweb/images/embed_this_image.rb'
15
+ require 'cyberweb/images/path_to_images.rb'
16
+ require 'cyberweb/images/remove_this_substring_from_all_images.rb'
16
17
  require 'cyberweb/images/string_image.rb'
17
18
  require 'cyberweb/images/standalone_drag_and_drop_this_image.rb'
18
- require 'cyberweb/images/remove_this_substring_from_all_images.rb'
19
19
 
20
20
  end
21
21
 
@@ -6,7 +6,8 @@
6
6
  # =========================================================================== #
7
7
  module Cyberweb
8
8
 
9
- require 'cyberweb/constants/constants.rb'
9
+ require 'cyberweb/constants/misc.rb'
10
+
10
11
  # ========================================================================= #
11
12
  # === Cyberweb.remove_this_substring_from_all_images
12
13
  #
@@ -30,6 +31,9 @@ module Cyberweb
30
31
  look_for_this_component = HOME_X_DATA
31
32
  end
32
33
  case replace_it_with_that_string
34
+ # ===================================================================== #
35
+ # === :default
36
+ # ===================================================================== #
33
37
  when :default
34
38
  replace_it_with_that_string = '../'
35
39
  end
@@ -7,14 +7,13 @@ standard_images</title>
7
7
 
8
8
  <style>
9
9
 
10
- a:link { text-decoration: none; color: gold; }
11
- a:hover { text-decoration: none; color: lightblue; }
10
+ a:link { text-decoration: none; color: gold; }
11
+ a:hover { text-decoration: none; color: lightblue; }
12
12
 
13
13
  </style>
14
14
 
15
15
  </head>
16
- <body style="
17
- background-color: black; color: white; font-size: 1.3em;">
16
+ <body style="background-color: black; color: white; font-size: 1.3em;">
18
17
 
19
18
  <!-- Adding support for jquery next: -->
20
19
 
@@ -1,2 +1,2 @@
1
- This directory will show one .cgi file (and perhaps a sinatra
2
- file) that just shows information to the user.
1
+ This directory will show one .cgi file (and perhaps a sinatra file)
2
+ that just shows information to the user.
@@ -15,7 +15,7 @@ body_css_class 'mar0px s2px padt2px VERDANAs'
15
15
  body_css_style 'background-color: #d3d2d1;'
16
16
  default_font_size_and_hyperlinks
17
17
 
18
- doc_smaller_width('mar0px pad0px s0_8em') {
18
+ smaller_width('mar0px pad0px s0_8em') {
19
19
  h1 title?,
20
20
  'mart1px marb0_5em'
21
21
  p_default_le {
@@ -41,7 +41,10 @@ module Cyberweb
41
41
  #
42
42
  # Name ought to be changed lateron.
43
43
  # ========================================================================= #
44
- def dragula_one_two_three(id_left, id_right)
44
+ def dragula_one_two_three(
45
+ id_left,
46
+ id_right
47
+ )
45
48
  return_javascript_code(
46
49
  "dragula([document.getElementById(#{id_left}), document.getElementById(#{id_right})], {
47
50
  moves: function (el, container, handle) {
@@ -8,9 +8,9 @@
8
8
  # Javascript to valid Javascript. It is currently in use in the file
9
9
  # web_foundation.rb.
10
10
  # =========================================================================== #
11
- module Cyberweb # === Cyberweb::JavascriptMagic
11
+ module Cyberweb
12
12
 
13
- class JavascriptMagic
13
+ class JavascriptMagic # === Cyberweb::JavascriptMagic
14
14
 
15
15
  alias e puts
16
16
 
@@ -68,7 +68,8 @@ $(document).ready(function(){
68
68
  # === return_on_click_change_opacity
69
69
  # ========================================================================= #
70
70
  def return_on_click_change_opacity(
71
- a = 'pic', b = '0.92'
71
+ a = 'pic',
72
+ b = '0.92'
72
73
  )
73
74
  Cyberweb.return_on_click_change_opacity(a, b)
74
75
  end; alias string_highlight return_on_click_change_opacity # === string_highlight
@@ -5,7 +5,14 @@
5
5
  # require 'cyberweb/javascript/popup.rb'
6
6
  # =========================================================================== #
7
7
  module Cyberweb
8
-
8
+
9
+ # ========================================================================= #
10
+ # === Cyberweb.alert
11
+ # ========================================================================= #
12
+ def self.alert(i = '')
13
+ 'window.alert("'+i+'");'
14
+ end
15
+
9
16
  # ========================================================================= #
10
17
  # === alert
11
18
  #
@@ -64,11 +64,15 @@ window.onload = function(){
64
64
  update();
65
65
  }
66
66
 
67
+ // === update()
68
+ //
67
69
  // Function to move the snowflakes
68
70
  // angle will be an ongoing incremental flag. Sin and Cos
69
71
  // functions will be applied to it to create vertical and
70
72
  // horizontal movements of the flakes
71
- var angle = 0;
73
+
74
+ var angle = 0
75
+
72
76
  function update()
73
77
  {
74
78
  angle += 0.01;
@@ -57,13 +57,6 @@ function euro_nach_schilling()
57
57
  document.euroformular.schilling.value = s;
58
58
  }
59
59
 
60
- /*
61
- * === e()
62
- */
63
- function e(i) {
64
- console.log(i)
65
- }
66
-
67
60
  /*
68
61
  * === alphabet()
69
62
  */
@@ -288,31 +281,6 @@ function array_includes(this_array, key_string) {
288
281
  return this_array.includes(key_string);
289
282
  }
290
283
 
291
- /*
292
- * === pp()
293
- *
294
- * pretty_print "implementation", inspired by ruby.
295
- *
296
- * This uses the so called "spread operator" in JavaScript.
297
- *
298
- * The spread (...) syntax works on iterables, such as
299
- * an Array or a String - also known as splat in ruby
300
- * or varargs in Java. It allows us to pass in zero
301
- * or more arguments to a function call.
302
- *
303
- *
304
- * Usage example:
305
- *
306
- * pp(['abc','def','ghi'])
307
- *
308
- */
309
- function pp(i) {
310
- console.log(...i);
311
- }
312
- function pp_log(i) {
313
- console.log(...i);
314
- }
315
-
316
284
  /*
317
285
  * append_this_to_that_array()
318
286
  */
@@ -696,3 +664,53 @@ function return_n_files_in_this_subdirectory(this_subdirectory) {
696
664
  return n_files
697
665
  });
698
666
  }
667
+
668
+ /*
669
+ * === pp()
670
+ *
671
+ * pretty_print "implementation", inspired by ruby.
672
+ *
673
+ * This uses the so called "spread operator" in JavaScript.
674
+ *
675
+ * The spread (...) syntax works on iterables, such as
676
+ * an Array or a String - also known as splat in ruby
677
+ * or varargs in Java. It allows us to pass in zero
678
+ * or more arguments to a function call.
679
+ *
680
+ *
681
+ * Usage example:
682
+ *
683
+ * pp(['abc','def','ghi'])
684
+ *
685
+ */
686
+ function pp(i) {
687
+ console.log(...i);
688
+ }; function pp_log(i) { console.log(...i); } /* An "alias" to the above, sort of. */
689
+
690
+ /*
691
+ * === e()
692
+ */
693
+ function e(i) {
694
+ console.log(i)
695
+ }
696
+
697
+ /*
698
+ * === console_table()
699
+ */
700
+ function console_table(i) {
701
+ console.table(i);
702
+ }
703
+
704
+ /*
705
+ * === current_date()
706
+ */
707
+ function current_date() {
708
+ return new Date();
709
+ }
710
+
711
+ /*
712
+ * === current_month()
713
+ */
714
+ function current_month() {
715
+ return current_date().getMonth()
716
+ }
@@ -2,13 +2,11 @@
2
2
 
3
3
  Span.new('Hey there')
4
4
 
5
- We want to operate on the OOP level here and assume
6
- that HTML tags can be used like this - in an object
7
- orientated manner.
5
+ We want to operate on the OOP level here and assume that HTML
6
+ tags can be used like this - in an object-oriented manner.
8
7
 
9
- Note that this will also include non-html tags, so this
10
- is a slight misnomer ultimately. Still, the misnomer
11
- will be kept, so that we can also make use of abstractions
12
- such as a hbox (horizontal box, which may be like a div
13
- tag), or vbox (vertical box, which may also be like a
14
- div tag).
8
+ Note that this will also include non-html tags, so this is a
9
+ slight misnomer ultimately. Still, the misnomer will be kept,
10
+ so that we can also make use of abstractions such as a hbox
11
+ (horizontal box, which may be like a div tag), or vbox (vertical
12
+ box, which may also be like a div tag).
@@ -14,6 +14,58 @@ module Objectified::HtmlTags
14
14
 
15
15
  class A < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::A
16
16
 
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::A.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::A.clear
31
+ # ========================================================================= #
32
+ def self.clear
33
+ A.set_css_class('')
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === Cyberweb::Objectified::HtmlTags::A.set_css_class
38
+ #
39
+ # Using this method will modify the default css_class for class
40
+ # A (which means to be applicable to all <a> tags) - at the least
41
+ # when objectified HTML tags are used.
42
+ #
43
+ # Usage example for setting to a default CSS class to use in
44
+ # <a> tags goes like so:
45
+ #
46
+ # Cyberweb::Objectified::HtmlTags::A.set_css_class 'tomato'
47
+ # A.set_css_class 'tomato'
48
+ #
49
+ # This will then have set a new default for all <a> tags,
50
+ # as they will be in the colour red from this point on.
51
+ #
52
+ # To test it, try:
53
+ #
54
+ # Cyberweb::Objectified::HtmlTags::A.css_class?
55
+ # Cyberweb::A.css_class?
56
+ #
57
+ # ========================================================================= #
58
+ def self.set_css_class(i = DEFAULT_CSS_CLASS)
59
+ @css_class = i
60
+ end
61
+
62
+ # ========================================================================= #
63
+ # === Cyberweb::Objectified::HtmlTags::A.css_class?
64
+ # ========================================================================= #
65
+ def self.css_class?
66
+ @css_class
67
+ end
68
+
17
69
  # ========================================================================= #
18
70
  # === initialize
19
71
  #
@@ -24,11 +76,11 @@ class A < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::Htm
24
76
  # ========================================================================= #
25
77
  def initialize(
26
78
  use_this_text = '',
27
- optional_css_class = nil,
79
+ optional_css_class = A.css_class?,
28
80
  optional_id = nil,
29
81
  optional_css_style = nil
30
82
  )
31
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
83
+ try_to_register_this_tag(self)
32
84
  reset
33
85
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
34
86
  set_content(use_this_text)
@@ -60,7 +112,14 @@ class A < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::Htm
60
112
  return raw_result?
61
113
  end
62
114
 
63
- end; end; end
115
+ end; end
116
+
117
+ # =========================================================================== #
118
+ # === Cyberweb::Objectified::HtmlTags::A
119
+ # =========================================================================== #
120
+ A = ::Cyberweb::Objectified::HtmlTags::A
121
+
122
+ end
64
123
 
65
124
  # =========================================================================== #
66
125
  # Testing the <a> tag next:
@@ -22,6 +22,32 @@ module Objectified::HtmlTags
22
22
 
23
23
  class Abbr < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Abbr
24
24
 
25
+ # ========================================================================= #
26
+ # === @css_class
27
+ # ========================================================================= #
28
+ @css_class = nil
29
+
30
+ # ========================================================================= #
31
+ # === Cyberweb::Objectified::HtmlTags::Abbr.reset_css_class
32
+ # ========================================================================= #
33
+ def self.reset_css_class
34
+ @css_class = nil
35
+ end
36
+
37
+ # ========================================================================= #
38
+ # === Cyberweb::Objectified::HtmlTags::Abbr.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::Abbr.css_class?
46
+ # ========================================================================= #
47
+ def self.css_class?
48
+ @css_class
49
+ end
50
+
25
51
  # ========================================================================= #
26
52
  # === initialize
27
53
  #
@@ -33,11 +59,11 @@ class Abbr < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
33
59
  def initialize(
34
60
  use_this_text = '',
35
61
  use_this_as_title = '',
36
- optional_css_class = nil,
62
+ optional_css_class = Abbr.css_class?,
37
63
  optional_id = nil,
38
64
  optional_css_style = nil
39
65
  )
40
- Cyberweb::Objectified::HtmlTags.try_to_register_this_tag(self)
66
+ try_to_register_this_tag(self)
41
67
  reset
42
68
  use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
43
69
  set_content(use_this_text)
@@ -71,7 +97,11 @@ class Abbr < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
71
97
  return raw_result?
72
98
  end
73
99
 
74
- end; end; end
100
+ end; end
101
+
102
+ Abbr = ::Cyberweb::Objectified::HtmlTags::Abbr
103
+
104
+ end
75
105
 
76
106
  # =========================================================================== #
77
107
  # Testing the <abbr> tag next:
@@ -14,6 +14,32 @@ module Objectified::HtmlTags
14
14
 
15
15
  class Audio < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Audio
16
16
 
17
+ # ========================================================================= #
18
+ # === @css_class
19
+ # ========================================================================= #
20
+ @css_class = nil
21
+
22
+ # ========================================================================= #
23
+ # === Cyberweb::Objectified::HtmlTags::Audio.reset_css_class
24
+ # ========================================================================= #
25
+ def self.reset_css_class
26
+ @css_class = nil
27
+ end
28
+
29
+ # ========================================================================= #
30
+ # === Cyberweb::Objectified::HtmlTags::Audio.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::Audio.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 Audio < 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 = Audio.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)
@@ -62,7 +88,11 @@ class Audio < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
62
88
  return raw_result?
63
89
  end
64
90
 
65
- end; end; end
91
+ end; end
92
+
93
+ Audio = ::Cyberweb::Objectified::HtmlTags::Audio
94
+
95
+ end
66
96
 
67
97
  # =========================================================================== #
68
98
  # Testing the <audio> tag next: