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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1c53fd000f39b26a7d41d88ee96f5334966bd3c459e9d3d7a56bdca7aa6b7d9
4
- data.tar.gz: 7e2bdd540cddec8df14a6e757085d57161a72c4c4ae2a632630924da754ecdfd
3
+ metadata.gz: 3b6dd07d01ef265aaf6670ff5ee915e37d8d907b88c1b626cd5b9c42d56518cf
4
+ data.tar.gz: 1c55ff143677e816df7239936ef804f467c86cc4f5fb07d79170275e24cec709
5
5
  SHA512:
6
- metadata.gz: b930dff63b5b8ac9b1bab12a1bbaf8af205d0b736fd511a1bda8a96c89f8739b437bfe754fa191c6724743979051acf3cecdba4a7318d587a8420091f20e9021
7
- data.tar.gz: '0332896062b5769f59d769429795b72ee6b6913f15adea2a395d86e7ba2a7822f15518cfc4a8e5f14d08d0900ab098bd2ffdd42a6c0dd286daf79767baa8e8f6'
6
+ metadata.gz: 4878604ad9243fd1c75cd65b75bdd02e0873d1de2d73e8ceeb7c5363d8b9fe124cb88e7915c5fc3a1e303ff6977d511e9aaf50550f326b8d4bfcd35460e78987
7
+ data.tar.gz: d4fd10cddf1c13fc27591bef08a4b9d502117110a81eb136b5bdc7ba6345a1b38872eb08a45894defb9568f8bdfd87f875ed90e01e4e8da5bf70c6acb993d780
data/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
  [![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
3
3
  [![Gem Version](https://badge.fury.io/rb/cyberweb.svg)](https://badge.fury.io/rb/cyberweb)
4
4
 
5
- This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">07.01.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">04:30:42</span> o'clock.
5
+ This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">28.02.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">08:49:34</span> o'clock.
6
6
 
7
- <img src="https://i.imgur.com/HY5BcVj.png" style="margin-left: 1.2em">
7
+ <img src="https://i.imgur.com/r7tRkFl.png" style="margin-left: 1.2em">
8
8
 
9
- ## Introducing the Cyberweb project
9
+ ## Introduction to the Cyberweb project
10
10
 
11
11
  The <b>cyberweb project</b> allows the user to make use of ruby to tap
12
12
  into web-related functionality in general.
@@ -2603,100 +2603,6 @@ If you want to use comments in a CSS file, use something like this:
2603
2603
 
2604
2604
  /* This is a CSS comment. */
2605
2605
 
2606
- ## JavaScript comments
2607
-
2608
- The simplest way to use comments in JavaScript, in my opinion, is
2609
- via:
2610
-
2611
- /* This is a comment */
2612
-
2613
- ## JavaScript loops
2614
-
2615
- To do a loop in "modern" JavaScript, try:
2616
-
2617
- for (let i = 0; i < 5; ++i) {
2618
- /* do stuff here */
2619
- }
2620
-
2621
- The index variable <b>i</b> will remain completely local to the
2622
- block, and not appear outside of it.
2623
-
2624
- Note that JavaScript also allows you to use a .forEach loop instead,
2625
- which no longer requires of you to use an index-counter.
2626
-
2627
- There are a few variations possible for the .forEach() loop.
2628
-
2629
- A somewhat verbose variant is the following one:
2630
-
2631
- array.forEach(
2632
- function(entry) {
2633
- document.write(
2634
- "<img style=\"margin: 2px; margin-bottom: 5px\" src=\""+entry.replace(/^(\/home\/x\/data\/images\/fotos\/)/,"")+
2635
- "\"><br>\n"
2636
- )
2637
- document.write('<br>')
2638
- }
2639
- );
2640
-
2641
- Here we can easily use multiple lines.
2642
-
2643
- A shorter variant exists via the => arrow.
2644
-
2645
- Example for this:
2646
-
2647
- array.forEach(entry => console.log(entry));
2648
-
2649
- So this is basically like <b>pp</b> in ruby.
2650
-
2651
- ## Checking for specific keys pressed, via JavaScript
2652
-
2653
- You can obtain an event, and then call the method .code on it, such as via:
2654
-
2655
- if (e.code === 'ArrowLeft') { # For the left-arrow key.
2656
- }
2657
- if (e.code === 'ArrowRight') { # For the right-arrow key.
2658
- }
2659
-
2660
- ## Symbols in JavaScript
2661
-
2662
- To define a symbol in JavaScript, use Symbol() such as in:
2663
-
2664
- let symbol1 = Symbol("mysymbol1")
2665
-
2666
- ## String concatenation in JavaScript
2667
-
2668
- The simplest way to concatenate two Strings in JavaScript
2669
- is by using the <b>+</b> operator.
2670
-
2671
- Example for this:
2672
-
2673
- foobar = "foo" + "bar"
2674
-
2675
- You can append to an existing String via the <b>+=</b> operator.
2676
-
2677
- Example for this:
2678
-
2679
- foobar = "foo"
2680
- foobar += "bar"
2681
-
2682
- You can also use the method .concat(), such as in:
2683
-
2684
- foo = "foo"
2685
- foobar = foo.concat("bar")
2686
-
2687
- ## Obtaining user input in JavaScript
2688
-
2689
- The following code example shows how to obtain user input via JavScript:
2690
-
2691
- var x, y;
2692
- x = prompt("Gib mal eine Zahl ein","")
2693
- y = prompt("Gib mir noch eine Zahl","")
2694
- alert(Number(x)+Number(y)
2695
-
2696
- So the primary way to obtain user through JavaScript goes via
2697
- <b>window.prompt</b>. The second argument to that method
2698
- specifies the default value of the input-field.
2699
-
2700
2606
  ## CSS font-face property (in CSS3)
2701
2607
 
2702
2608
  Via the <b>@font-face</b> property it is possible to make use of
@@ -4269,6 +4175,168 @@ also use onclick="call_function_here()", but one advantage of using
4269
4175
  event listeners is that we can be more flexible, and even remove
4270
4176
  events again.
4271
4177
 
4178
+ ### JavaScript comments
4179
+
4180
+ The simplest way to use comments in JavaScript, in my opinion, is
4181
+ via:
4182
+
4183
+ /* This is a comment */
4184
+
4185
+ ### JavaScript loops
4186
+
4187
+ To do a loop in "modern" JavaScript, try:
4188
+
4189
+ for (let i = 0; i < 5; ++i) {
4190
+ /* do stuff here */
4191
+ }
4192
+
4193
+ The index variable <b>i</b> will remain completely local to the
4194
+ block, and not appear outside of it.
4195
+
4196
+ Note that JavaScript also allows you to use a .forEach loop instead,
4197
+ which no longer requires of you to use an index-counter.
4198
+
4199
+ There are a few variations possible for the .forEach() loop.
4200
+
4201
+ A somewhat verbose variant is the following one:
4202
+
4203
+ array.forEach(
4204
+ function(entry) {
4205
+ document.write(
4206
+ "<img style=\"margin: 2px; margin-bottom: 5px\" src=\""+entry.replace(/^(\/home\/x\/data\/images\/fotos\/)/,"")+
4207
+ "\"><br>\n"
4208
+ )
4209
+ document.write('<br>')
4210
+ }
4211
+ );
4212
+
4213
+ Here we can easily use multiple lines.
4214
+
4215
+ A shorter variant exists via the => arrow.
4216
+
4217
+ Example for this:
4218
+
4219
+ array.forEach(entry => console.log(entry));
4220
+
4221
+ So this is basically like <b>pp</b> in ruby.
4222
+
4223
+ ### Checking for specific keys pressed, via JavaScript
4224
+
4225
+ You can obtain an event, and then call the method .code on it, such as via:
4226
+
4227
+ if (e.code === 'ArrowLeft') { # For the left-arrow key.
4228
+ }
4229
+ if (e.code === 'ArrowRight') { # For the right-arrow key.
4230
+ }
4231
+
4232
+ ### Converting Strings to Numbers in JavaScript
4233
+
4234
+ To convert a String such as "5" to the Integer 5, use:
4235
+
4236
+ x = "5"
4237
+ parseInt(x)
4238
+
4239
+ To convert a String such as "5.15" to the Float 5.15, use:
4240
+
4241
+ x = "5.15"
4242
+ parseFloat(x)
4243
+
4244
+ Numbers can be converted to a String via the method
4245
+ <b>toString()</b>.
4246
+
4247
+ You can then also use the comparison operator, aka <b>===</b>:
4248
+
4249
+ a = parseInt("3");
4250
+ b = parseInt("5");
4251
+ a === b
4252
+
4253
+ ### Setting a default value to a variable in JavaScript
4254
+
4255
+ let foobar = object.method1 || 'Default Value here'
4256
+
4257
+ ### Using the switch statement in JavaScript
4258
+
4259
+ Usage example:
4260
+
4261
+ switch(expression){
4262
+ case x:
4263
+ /* code to run when expression === x */
4264
+ break;
4265
+ case y:
4266
+ /* code to run when expression === y */
4267
+ break;
4268
+ default:
4269
+ /* code to run if nothing else matches expression */
4270
+ }
4271
+
4272
+ ### Symbols in JavaScript
4273
+
4274
+ To define a symbol in JavaScript, use Symbol() such as in:
4275
+
4276
+ let symbol1 = Symbol("mysymbol1")
4277
+
4278
+ ### String concatenation in JavaScript
4279
+
4280
+ The simplest way to concatenate two Strings in JavaScript
4281
+ is by using the <b>+</b> operator.
4282
+
4283
+ Example for this:
4284
+
4285
+ foobar = "foo" + "bar"
4286
+
4287
+ You can append to an existing String via the <b>+=</b> operator.
4288
+
4289
+ Example for this:
4290
+
4291
+ foobar = "foo"
4292
+ foobar += "bar"
4293
+
4294
+ You can also use the method .concat(), such as in:
4295
+
4296
+ foo = "foo"
4297
+ foobar = foo.concat("bar")
4298
+
4299
+ ### Obtaining user input in JavaScript
4300
+
4301
+ The following code example shows how to obtain user input via JavScript:
4302
+
4303
+ var x, y;
4304
+ x = prompt("Gib mal eine Zahl ein","")
4305
+ y = prompt("Gib mir noch eine Zahl","")
4306
+ alert(Number(x)+Number(y)
4307
+
4308
+ So the primary way to obtain user through JavaScript goes via
4309
+ <b>window.prompt</b>. The second argument to that method
4310
+ specifies the default value of the input-field.
4311
+
4312
+ ### Creating an Array in JavaScript
4313
+
4314
+ The easiest way is the following:
4315
+
4316
+ const array = ['red','green','blue'] # This is also called the Array literal notation.
4317
+
4318
+ Note that at the least two additional ways exist in JavaScript
4319
+ to create an Array.
4320
+
4321
+ You can use:
4322
+
4323
+ The Array() constructor, aka:
4324
+
4325
+ new Array();
4326
+
4327
+ and
4328
+
4329
+ <b>Functions</b> that <b>return arrays</b>, such as <b>split()</b>.
4330
+
4331
+ Note that you can, of course, also pass in elements into the
4332
+ Array when you create it via <b>new</b>. The following example
4333
+ shows this:
4334
+
4335
+ const array = new Array('January','February','March')
4336
+
4337
+ Personally I prefer the [] variant, as Ruby also uses it
4338
+ and I have become so used to it.
4339
+
4272
4340
  ### Appending and Prepending onto a JavaScript Array
4273
4341
 
4274
4342
  The method .push() can be used to add content, via an append-operation, onto an array.
@@ -4280,6 +4348,16 @@ If you wish to add elements onto the beginning of an Array, use
4280
4348
 
4281
4349
  new_array.unshift("foobar"); /* Adds "foobar" to the beginning of the Array */
4282
4350
 
4351
+ ## Splitting a String into an Array, in JavaScript
4352
+
4353
+ You can use the .split() method on a String, to split it up into an
4354
+ Array.
4355
+
4356
+ Example for this:
4357
+
4358
+ let x = 'Foo, Bar, Bla'
4359
+ const splitted = x.split(',')
4360
+
4283
4361
  ### Simplified for-loop in JavaScript
4284
4362
 
4285
4363
  You can iterate over an Array in JavaScript via:
@@ -6198,7 +6276,8 @@ optionally also all subdirectories). This was added in November
6198
6276
 
6199
6277
  ## Automatic clipboard button
6200
6278
 
6201
- class Cyberweb::HtmlTemplate has a method called .return_copy_to_clipboard_button().
6279
+ <b>class Cyberweb::HtmlTemplate</b> has a method called
6280
+ <b>.return_copy_to_clipboard_button()</b>.
6202
6281
 
6203
6282
  This method can be used to insert a button into a webpage. When the user
6204
6283
  clicks that button a certain text will be inserted into the clipboard,
@@ -6245,6 +6324,34 @@ a local .html file).
6245
6324
  Unfortunately I broke it in November 2023. Will have to fix it,
6246
6325
  and probably rewrite it, anyway.
6247
6326
 
6327
+ ## module WebBase
6328
+
6329
+ module WebBase was created before the project html_tags was started,
6330
+ and before objectified-html-tags were added. So in some ways this
6331
+ was a legacy-module.
6332
+
6333
+ In January 2024, the old code from <b>module WebBase</b> was integrated
6334
+ into the objectified HTML tags component. Then the old WebBase namespace
6335
+ was removed.
6336
+
6337
+ Note that as part of the rewrite, each individual class that is
6338
+ part of the module Cyberweb::Objectified::HtmlTags, will
6339
+ contain a toplevel instance variable called @css_class. This
6340
+ derived from the old code in WebBase, where we could specify
6341
+ a default CSS class to be used - which is now defined under
6342
+ @css_class. This can be accessed by the toplevel method
6343
+ .css_class?. (Should you discover a class that does not have
6344
+ this, consider it a bug; it will be added once reported.)
6345
+
6346
+ The old functionality in module WebBase, in where we could set
6347
+ a default CSS class, has been retained API-wise. Example for
6348
+ how to use this:
6349
+
6350
+ Cyberweb::Span.set_css_class 'padl5em green'
6351
+
6352
+ Keep in mind that internally this will delegate towards the
6353
+ <b>Objectified namespace</b>.
6354
+
6248
6355
  ## Useful quotes when designing websites and web-apps
6249
6356
 
6250
6357
  The following subsection collects a few <b>interesting statements</b> - kind
@@ -6312,7 +6419,11 @@ the current location that the user has or uses on that website</i>.“
6312
6419
  „<i>Ideally a website should convey the big picture, and make it clear what the
6313
6420
  site is about</i>.“
6314
6421
 
6315
- „<i>The web as a dynamic computing environment</i>.“
6422
+ „<i>The web can be considered a dynamic computing environment</i>.“
6423
+
6424
+ „<i>Good design is easier to change than bad design</i>.“
6425
+
6426
+ „<i>Build documentation in - don't bolt it on</i>.“
6316
6427
 
6317
6428
  „<i>If possible consider to use visual identifiers on the whole web-application at
6318
6429
  hand, to give visitors the right idea about this being a cohesive and integrated
@@ -6401,29 +6512,14 @@ gem owner eventually:
6401
6512
  see
6402
6513
  https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
6403
6514
 
6404
- Mandatory 2FA will eventually be extended to all rubygems.org developers and
6405
- maintainers. As I can not use 2FA, for reasons I will skip explaining here,
6406
- this means that my projects will eventually be removed, as I no longer
6407
- have any control over my projects hosted on rubygems.org (because I
6408
- can not use 2FA).
6409
-
6410
- At that point, I no longer have any control what is done to my projects
6411
- since whoever is controlling the gems ecosystem took away our control
6412
- here. I am not sure at which point ruby became corporate-controlled -
6413
- that was not the case several years ago, so something has
6414
- changed.
6415
-
6416
- Ruby also only allows 2FA users to participate on the issue tracker these
6417
- days:
6418
-
6419
- https://bugs.ruby-lang.org/issues/18800
6420
-
6421
- But this has been reverted some months ago, so it is no longer applicable.
6422
- Suffice to say that I do not think that we should only be allowed to
6423
- interact on the world wide web when some 'authority' authenticated us,
6424
- such as via mandatory 2FA, so I hope this won't come back again.
6425
-
6426
- Fighting spam is a noble goal, but when it also means you lock out
6427
- real human people then this is definitely NOT a good situation
6428
- to be had.
6515
+ However had, that has been reverted again, so I decided to shorten
6516
+ this paragraph. Mandatory 2FA may exclude users who do not have a
6517
+ smartphone device or other means to 'identify'. I do not feel it is
6518
+ a fair assumption by others to be made that non-identified people may
6519
+ not contribute code, which is why I reject it. Mandatory 2FA would mean
6520
+ an end to all my projects on rubygems.org, so let's hope it will never
6521
+ happen. (Keep in mind that I refer to mandatory 2FA; I have no qualms
6522
+ for people who use 2FA on their own, but this carrot-and-stick strategy
6523
+ by those who control the rubygems infrastructure is a very bad one to
6524
+ pursue.
6429
6525
 
@@ -2,7 +2,7 @@
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
- require 'cyberweb/toplevel_methods/misc.rb'
5
+ require 'cyberweb/toplevel_methods/toplevel_methods.rb'
6
6
  require 'save_file'
7
7
 
8
8
  what = Cyberweb.sanitizer(ARGV)
@@ -4,7 +4,7 @@
4
4
  # =========================================================================== #
5
5
  # images_from_this_webpage
6
6
  # =========================================================================== #
7
- require 'cyberweb/toplevel_methods/misc.rb'
7
+ require 'cyberweb/toplevel_methods/toplevel_methods.rb'
8
8
 
9
9
  Cyberweb.return_all_images_from_this_webpage(ARGV, true).each {|this_remote_image|
10
10
  puts this_remote_image