cyberweb 0.6.17 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cyberweb might be problematic. Click here for more details.

Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +299 -134
  3. data/bin/images_from_this_webpage +11 -0
  4. data/doc/README.gen +276 -107
  5. data/doc/todo/todo_for_the_cyberweb_project.md +90 -90
  6. data/examples/css/day_night_toggle/day_night_toggle.html +202 -0
  7. data/examples/css/fleeing_dinosaur_animation/fleeing_dinosaur_animation.html +420 -0
  8. data/examples/css/important_style/important_style.html +35 -0
  9. data/examples/html/custom_cursor.html +1 -1
  10. data/examples/javascript_and_jquery/misc/miscallenous_javascript_examples.html +25 -0
  11. data/examples/javascript_and_jquery/roll_a_die/roll_a_die.html +48 -0
  12. data/lib/cyberweb/base/misc.rb +7 -0
  13. data/lib/cyberweb/cascading_style_sheets/div.css +2 -2
  14. data/lib/cyberweb/cascading_style_sheets/drop_shadow.css +4 -0
  15. data/lib/cyberweb/cascading_style_sheets/fonts.css +42 -30
  16. data/lib/cyberweb/cascading_style_sheets/glow_effects.css +58 -0
  17. data/lib/cyberweb/cascading_style_sheets/margin.css +254 -248
  18. data/lib/cyberweb/cascading_style_sheets/tooltip.css +73 -0
  19. data/lib/cyberweb/generator/cgi.rb +2 -1
  20. data/lib/cyberweb/javascript_code/custom_functions.js +16 -16
  21. data/lib/cyberweb/javascript_code/math.js +18 -0
  22. data/lib/cyberweb/javascript_code/simulate_a_dice.js +13 -5
  23. data/lib/cyberweb/sinatra/custom_extensions.rb +2 -2
  24. data/lib/cyberweb/toplevel_methods/misc.rb +44 -0
  25. data/lib/cyberweb/utility_scripts/create_coloured_tags.rb +1 -5
  26. data/lib/cyberweb/utility_scripts/download_balloon_css.rb +1 -5
  27. data/lib/cyberweb/utility_scripts/fix_incorrect_links_to_locally_existing_images_in_this_file.rb +5 -33
  28. data/lib/cyberweb/utility_scripts/hyperlink_all_images_from.rb +1 -5
  29. data/lib/cyberweb/utility_scripts/obtain_css_rules.rb +169 -0
  30. data/lib/cyberweb/version/version.rb +2 -2
  31. data/lib/cyberweb/web_object/html_tags.rb +12 -1
  32. data/lib/cyberweb/web_object/images.rb +534 -178
  33. data/lib/cyberweb/web_object/javascript_and_jquery.rb +9 -9
  34. data/lib/cyberweb/web_object/link.rb +102 -67
  35. data/lib/cyberweb/web_object/misc.rb +320 -518
  36. data/lib/cyberweb/yaml/js_files_to_load.yml +3 -2
  37. data/lib/cyberweb/yaml/load_these_yaml_files_by_default.yml +1 -0
  38. data/test/complex_tests/testing_style_variants/show_coloured_boxes.cgi +2 -2
  39. data/test/javascript/testing_various_javascript_related_APIs.html +17 -0
  40. data/test/simple_tests/testing_dragging_an_image.cgi +2 -0
  41. data/test/simple_tests/testing_uniform_css_rules_for_all_images.cgi +25 -0
  42. metadata +15 -5
@@ -10,15 +10,6 @@ module Cyberweb
10
10
 
11
11
  class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
12
12
 
13
- # ========================================================================= #
14
- # === addnl_javascript_code
15
- # ========================================================================= #
16
- def addnl_javascript_code(i)
17
- addn(
18
- return_javascript(i)
19
- )
20
- end
21
-
22
13
  # ========================================================================= #
23
14
  # === ejavascript
24
15
  #
@@ -345,4 +336,13 @@ EOF
345
336
  alias enable_drag do_use_jquery # === enable_drag
346
337
  alias enable_jquery do_use_jquery # === enable_jquery
347
338
 
339
+ # ========================================================================= #
340
+ # === addnl_javascript_code
341
+ # ========================================================================= #
342
+ def addnl_javascript_code(i)
343
+ addn(
344
+ return_javascript(i)
345
+ )
346
+ end
347
+
348
348
  end; end
@@ -11,77 +11,37 @@ module Cyberweb
11
11
  class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
12
12
 
13
13
  # ========================================================================= #
14
- # === self_abr
15
- #
16
- # This method is similar to abr(), but it will automatically use
17
- # content: :self as-is.
18
- # ========================================================================= #
19
- def self_abr(
20
- remote_url,
21
- optional_hash = {}
22
- )
23
- if optional_hash.is_a? String
24
- optional_hash = {
25
- content: optional_hash
26
- }
27
- end
28
- abr(remote_url, optional_hash)
29
- end; alias abr_self self_abr # === abr_self
30
-
31
- # ========================================================================= #
32
- # === pretty_link
33
- #
34
- # This method will first pass the input into BeautifulUrl,
35
- # and then use the result given from BeautifulUrl as the
36
- # remote URL.
37
- #
38
- # The key idea here is that we can build up links towards
39
- # remote URLs, all handled by the BeautifulUrl namespace.
40
- #
41
- # One advantage of this approach is that we have to change
42
- # a remote URL only once, if it ever changes, so we do not
43
- # have to change all local links that may have outdated
44
- # entries as such.
45
- #
46
- # Invocation example:
47
- #
48
- # pretty_link('Jules Bordet')
49
- #
50
- # ========================================================================= #
51
- def pretty_link(i, optional_css_class = '')
52
- remote_URL = beautiful_URL(i)
53
- return string_a(remote_URL, content: i, css_class: optional_css_class)
54
- end
55
-
56
- # ========================================================================= #
57
- # === simple_link
14
+ # === a (a tag, link tag)
58
15
  #
59
- # A simplified wrapper around link().
60
- #
61
- # This is simpler since we only have to provide one URL; and optionally
62
- # a second argument denoting the css-class in use.
63
- #
64
- # Usage example:
65
- #
66
- # simple_link 'https://gamefaqs.gamespot.com/pc/565051-alone-in-the-dark-3/faqs/8459','mars2em'
16
+ # This method essentially refers to the <a> tag.
67
17
  #
18
+ # If the first input argument is a Symbol then we will tap into
19
+ # BeautifulUrl,via Cyberweb.beautiful_url().
68
20
  # ========================================================================= #
69
- def simple_link(
70
- link_hyperref,
71
- optional_css_class = '',
72
- make_newline = 1
73
- )
74
- link(
75
- link_hyperref,
76
- desc: link_hyperref,
77
- css_class: optional_css_class
21
+ def a(
22
+ i = '',
23
+ option_hash = {}
78
24
  )
79
- case make_newline
80
- when 1, true
81
- br
25
+ if i.is_a? Symbol
26
+ i = beautiful_url(i)
27
+ # ===================================================================== #
28
+ # Also check if the second argument is a String. In this case we
29
+ # must modify it. Example for input that fulfils this criterium:
30
+ #
31
+ # remote_link(:hydrogenase, 'Hydrogenase')+
32
+ #
33
+ # ===================================================================== #
34
+ if option_hash.is_a? String
35
+ option_hash = { content: option_hash }
36
+ end
82
37
  end
83
- end; alias si_link simple_link # === si_link
84
- alias hyperlink simple_link # === hyperlink
38
+ addn(
39
+ string_link(i, option_hash)
40
+ )
41
+ end; alias link a # === a
42
+ alias link_to a # === link_to
43
+ alias alink a # === alink
44
+ alias remote_link a # === remote_link
85
45
 
86
46
  # ========================================================================= #
87
47
  # === linkbr (abr tag)
@@ -158,13 +118,88 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
158
118
  # =================================================================== #
159
119
  if uses_sinatra?
160
120
  i = i.to_s
161
- i = File.basename(i.delete_suffix(File.extname(i)))
121
+ i = File.basename(
122
+ i.delete_suffix(File.extname(i))
123
+ )
162
124
  end
163
125
  end
164
126
  end
165
127
  abr(i, hash)
166
128
  end; alias roebe_local_link roebe_internal_link # === roebe_local_link
167
129
 
130
+ # ========================================================================= #
131
+ # === self_abr
132
+ #
133
+ # This method is similar to abr(), but it will automatically use
134
+ # content: :self as-is.
135
+ # ========================================================================= #
136
+ def self_abr(
137
+ remote_url,
138
+ optional_hash = {}
139
+ )
140
+ if optional_hash.is_a? String
141
+ optional_hash = {
142
+ content: optional_hash
143
+ }
144
+ end
145
+ abr(remote_url, optional_hash)
146
+ end; alias abr_self self_abr # === abr_self
147
+
148
+ # ========================================================================= #
149
+ # === pretty_link
150
+ #
151
+ # This method will first pass the input into BeautifulUrl,
152
+ # and then use the result given from BeautifulUrl as the
153
+ # remote URL.
154
+ #
155
+ # The key idea here is that we can build up links towards
156
+ # remote URLs, all handled by the BeautifulUrl namespace.
157
+ #
158
+ # One advantage of this approach is that we have to change
159
+ # a remote URL only once, if it ever changes, so we do not
160
+ # have to change all local links that may have outdated
161
+ # entries as such.
162
+ #
163
+ # Invocation example:
164
+ #
165
+ # pretty_link('Jules Bordet')
166
+ #
167
+ # ========================================================================= #
168
+ def pretty_link(i, optional_css_class = '')
169
+ remote_URL = beautiful_URL(i)
170
+ return string_a(remote_URL, content: i, css_class: optional_css_class)
171
+ end
172
+
173
+ # ========================================================================= #
174
+ # === simple_link
175
+ #
176
+ # A simplified wrapper around link().
177
+ #
178
+ # This is simpler since we only have to provide one URL; and optionally
179
+ # a second argument denoting the css-class in use.
180
+ #
181
+ # Usage example:
182
+ #
183
+ # simple_link 'https://gamefaqs.gamespot.com/pc/565051-alone-in-the-dark-3/faqs/8459','mars2em'
184
+ #
185
+ # ========================================================================= #
186
+ def simple_link(
187
+ link_hyperref,
188
+ optional_css_class = '',
189
+ make_newline = 1
190
+ )
191
+ link(
192
+ link_hyperref,
193
+ desc: link_hyperref,
194
+ css_class: optional_css_class
195
+ )
196
+ case make_newline
197
+ when 1, true
198
+ br
199
+ end
200
+ end; alias si_link simple_link # === si_link
201
+ alias hyperlink simple_link # === hyperlink
202
+
168
203
  # ========================================================================= #
169
204
  # === link_in_page
170
205
  #