cyberweb 0.7.9 → 0.8.17

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +242 -141
  3. data/cyberweb.gemspec +6 -6
  4. data/doc/README.gen +242 -142
  5. data/doc/todo/todo_for_the_cyberweb_project.md +13 -0
  6. data/examples/advanced/animated_colourful_border/animated_colourful_border.cgi +149 -0
  7. data/examples/advanced/no_right_click.cgi +1 -2
  8. data/examples/css/changing_border_colours_animation/changing_border_colours_animation.html +134 -0
  9. data/examples/css/editable_boxes_example/editable_boxes_example.html +75 -0
  10. data/examples/css/flexbox_example/flexbox_example.html +39 -0
  11. data/examples/css/keyboard_example/keyboard_example.html +238 -0
  12. data/examples/css/magic_card/magic_card.html +110 -0
  13. data/examples/css/overflow_example/overflow_example.html +125 -0
  14. data/examples/css/planet_example/planet_example.html +34 -0
  15. data/examples/css/progress_bar_examples/progress_bar_examples.html +316 -0
  16. data/examples/css/single_row_glow/single_row_glow.html +91 -0
  17. data/examples/css/slinky_animation/slinky_animation.html +292 -0
  18. data/examples/html/hbox_and_vbox_example.html +5 -5
  19. data/examples/javascript_and_jquery/all_in_one_example/all_in_one_example.cgi +38 -0
  20. data/lib/cyberweb/base/misc.rb +63 -25
  21. data/lib/cyberweb/cascading_style_sheets/border.css +61 -24
  22. data/lib/cyberweb/cascading_style_sheets/colours.css +2 -0
  23. data/lib/cyberweb/cascading_style_sheets/default.css +102 -89
  24. data/lib/cyberweb/cascading_style_sheets/glow_effects.css +36 -0
  25. data/lib/cyberweb/cascading_style_sheets/margin.css +11 -7
  26. data/lib/cyberweb/cascading_style_sheets/misc.css +7 -0
  27. data/lib/cyberweb/cascading_style_sheets/text_shadow.css +6 -1
  28. data/lib/cyberweb/generator/cgi.rb +9 -1
  29. data/lib/cyberweb/html_template/html_template.rb +7 -2
  30. data/lib/cyberweb/javascript_code/custom_functions.js +33 -2
  31. data/lib/cyberweb/javascript_code/math.js +0 -0
  32. data/lib/cyberweb/objectified/html_tags/progress.rb +8 -8
  33. data/lib/cyberweb/skeleton/README.md +2 -0
  34. data/lib/cyberweb/skeleton/html_keyboard.md +140 -0
  35. data/lib/cyberweb/toplevel_methods/is_an_image.rb +18 -0
  36. data/lib/cyberweb/toplevel_methods/listing.rb +2 -3
  37. data/lib/cyberweb/toplevel_methods/misc.rb +1 -57
  38. data/lib/cyberweb/toplevel_methods/registered_ids.rb +53 -37
  39. data/lib/cyberweb/toplevel_methods/sort_this_array_by_time.rb +65 -0
  40. data/lib/cyberweb/toplevel_methods/video.rb +32 -19
  41. data/lib/cyberweb/utility_scripts/images_to_html/images_to_html.rb +78 -49
  42. data/lib/cyberweb/utility_scripts/remove_this_image_from_that_webpage.rb +125 -0
  43. data/lib/cyberweb/version/version.rb +2 -2
  44. data/lib/cyberweb/web_images/map_symbol_to_image_location.rb +28 -8
  45. data/lib/cyberweb/web_object/effects.rb +19 -0
  46. data/lib/cyberweb/web_object/html_tags.rb +199 -196
  47. data/lib/cyberweb/web_object/images.rb +83 -26
  48. data/lib/cyberweb/web_object/misc.rb +1048 -529
  49. data/lib/cyberweb/web_object/reset.rb +47 -29
  50. data/lib/cyberweb/yaml/custom_tags.yml +2 -0
  51. metadata +52 -52
@@ -116,7 +116,9 @@ module WebImages
116
116
  :ausrufung,
117
117
  :ausruf,
118
118
  :anmerkung,
119
- :rufzeichen
119
+ :achtung,
120
+ :rufzeichen,
121
+ :information
120
122
  _ = "#{IMG_DIR}AUSRUFUNGSZEICHEN.png"
121
123
  # ======================================================================= #
122
124
  # === :ausrufungszeichen2
@@ -398,7 +400,9 @@ module WebImages
398
400
  # ======================================================================= #
399
401
  # === :dot6
400
402
  # ======================================================================= #
401
- when :dot6, :dot_06, :dot106
403
+ when :dot6,
404
+ :dot_06,
405
+ :dot106
402
406
  _ = "#{IMG_DIR}DOT_06.png"
403
407
  # ======================================================================= #
404
408
  # === :dot7
@@ -410,27 +414,37 @@ module WebImages
410
414
  # ======================================================================= #
411
415
  # === :dot8
412
416
  # ======================================================================= #
413
- when :dot8, :dot_08, :dot108
417
+ when :dot8,
418
+ :dot_08,
419
+ :dot108
414
420
  _ = "#{IMG_DIR}DOT_08.png"
415
421
  # ======================================================================= #
416
422
  # === :dot9
417
423
  # ======================================================================= #
418
- when :dot9, :dot_09, :dot109
424
+ when :dot9,
425
+ :dot_09,
426
+ :dot109
419
427
  _ = "#{IMG_DIR}DOT_09.png"
420
428
  # ======================================================================= #
421
429
  # === :dot10
422
430
  # ======================================================================= #
423
- when :dot10, :dot_10, :dot110
431
+ when :dot10,
432
+ :dot_10,
433
+ :dot110
424
434
  _ = "#{IMG_DIR}DOT_10.png"
425
435
  # ======================================================================= #
426
436
  # === :dot11
427
437
  # ======================================================================= #
428
- when :dot11, :dot_11, :dot111
438
+ when :dot11,
439
+ :dot_11,
440
+ :dot111
429
441
  _ = "#{IMG_DIR}DOT_11.png"
430
442
  # ======================================================================= #
431
443
  # === :dot12
432
444
  # ======================================================================= #
433
- when :dot12, :dot_12, :dot112
445
+ when :dot12,
446
+ :dot_12,
447
+ :dot112
434
448
  _ = "#{IMG_DIR}DOT_12.png"
435
449
  # when :dot13, :dot_13
436
450
  # _ = "#{IMG_DIR}DOT13.png"
@@ -969,7 +983,8 @@ module WebImages
969
983
  # ======================================================================= #
970
984
  # === :notepad
971
985
  # ======================================================================= #
972
- when :notepad, :notizblock
986
+ when :notepad,
987
+ :notizblock
973
988
  _ = "#{IMG_DIR}NOTEPAD.png"
974
989
  # ======================================================================= #
975
990
  # === :notiz
@@ -982,6 +997,11 @@ module WebImages
982
997
  when :obsolete
983
998
  _ = "#{IMG_DIR}OBSOLETE.png"
984
999
  # ======================================================================= #
1000
+ # === :outdated
1001
+ # ======================================================================= #
1002
+ when :outdated
1003
+ _ = "#{IMG_DIR}outdated.png"
1004
+ # ======================================================================= #
985
1005
  # === :pdf
986
1006
  # ======================================================================= #
987
1007
  when :pdf
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # This .rb file will include fancy effects, in particular CSS effects,
6
+ # such as an animated glow around an element.
7
+ # =========================================================================== #
8
+ # require 'cyberweb/web_object/effects.rb'
9
+ # =========================================================================== #
10
+ require 'cyberweb/base/base.rb'
11
+
12
+ module Cyberweb
13
+
14
+ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
15
+
16
+ def xyz
17
+ end
18
+
19
+ end; end
@@ -14,168 +14,6 @@ module Cyberweb
14
14
 
15
15
  class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
16
16
 
17
- # ========================================================================= #
18
- # === div (div tag)
19
- #
20
- # Input to this method can be in this format:
21
- #
22
- # div(id: 'drag_div_sitemap_table', css_style: 'z-index: 1') {
23
- #
24
- # So the first argument can be a Hash.
25
- # ========================================================================= #
26
- def div(
27
- optional_css_class = '',
28
- optional_the_id = '',
29
- optional_css_style = '',
30
- optional_javascript = '',
31
- &block
32
- )
33
- # ======================================================================= #
34
- # === Handle Hashes first
35
- # ======================================================================= #
36
- if optional_css_class.is_a? Hash
37
- # ===================================================================== #
38
- # === :css_style
39
- # ===================================================================== #
40
- if optional_css_class.has_key? :css_style
41
- optional_css_style = optional_css_class.delete(:css_style)
42
- end
43
- # ===================================================================== #
44
- # === :id
45
- # ===================================================================== #
46
- if optional_css_class.has_key? :id
47
- optional_the_id = optional_css_class.delete(:id)
48
- end
49
- # ===================================================================== #
50
- # === :css_class
51
- # ===================================================================== #
52
- if optional_css_class.has_key? :css_class
53
- optional_css_class = optional_css_class.delete(:css_class)
54
- # ===================================================================== #
55
- # === :class
56
- # ===================================================================== #
57
- elsif optional_css_class.has_key? :class
58
- optional_css_class = optional_css_class.delete(:class)
59
- end
60
- if optional_css_class.is_a? Hash
61
- optional_css_class = ''
62
- end
63
- end
64
- # ======================================================================= #
65
- # We need to delegate to a toplevel method, in order to create
66
- # the correct <div> tag.
67
- # ======================================================================= #
68
- add_this_div(
69
- optional_css_class,
70
- optional_the_id,
71
- optional_css_style,
72
- optional_javascript
73
- )
74
- # ======================================================================= #
75
- # === Handle blocks given to <div> next
76
- # ======================================================================= #
77
- if block_given?
78
- yield
79
- cdiv
80
- end
81
- end
82
-
83
- # ========================================================================= #
84
- # === pre (pre tag)
85
- #
86
- # This method will ultimately generate a <pre> tag.
87
- #
88
- # The alias called "numbered_table" may be subject to change. One day
89
- # it may be a new method that can then be used to number a list of
90
- # entries passed as String or Array. For now, though, as of October
91
- # 2022 it is just an alias.
92
- # ========================================================================= #
93
- def pre(
94
- i = '',
95
- optional_css_class = 'FS1_5em',
96
- optional_the_id = '',
97
- optional_css_style = '',
98
- optional_commands = nil,
99
- &block
100
- )
101
- if optional_commands
102
- case optional_commands
103
- # ===================================================================== #
104
- # === :remove_html
105
- # ===================================================================== #
106
- when :remove_html
107
- i = Cyberweb.remove_html(i)
108
- end
109
- end
110
- # ======================================================================= #
111
- # === Handle blocks next
112
- # ======================================================================= #
113
- if block_given?
114
- yielded = yield.to_s
115
- if yielded and !yielded.empty?
116
- i = i.to_s.dup
117
- i << yielded
118
- end
119
- end
120
- addn(
121
- '<pre'+
122
- css_class_or_no_class(optional_css_class)+
123
- id_or_no_id(optional_the_id)+
124
- css_style_or_no_style(optional_css_style)+
125
- '>'+
126
- i.to_s+
127
- '</pre>'
128
- )
129
- end; alias numbered_table pre # === numbered_table
130
-
131
- # ========================================================================= #
132
- # === button (button tag)
133
- #
134
- # This method will "generate" a HTML button. Since as of October 2022
135
- # this uses its own HTML element; before that input(:button) was in
136
- # use.
137
- #
138
- # The following example shows how this method could be used:
139
- #
140
- # button {{
141
- # text: 'Hey there!'
142
- # }}
143
- #
144
- # A slightly more advanced example is the following variant:
145
- #
146
- # button {{
147
- # text: 'Hey there - with more css and a Hello World alert-box in javascript when clicked by the user!',
148
- # css_class: 'bblack1 darkgreen pad8px BOLD',
149
- # javascript_function: 'msg("Hello world!!!")'
150
- # }}
151
- #
152
- # Here is another variant, by specifically responding to a click-event, to call a specific function:
153
- #
154
- # button {{
155
- # text: 'Click here'
156
- # css_class: 'bblack1 pad8px'
157
- # on_click_event: :on_click_event_hello_world
158
- # }}
159
- #
160
- # And another variant, without a block:
161
- #
162
- # button text: 'OK!',
163
- # css_class: 'glow_on_hover'
164
- #
165
- # ========================================================================= #
166
- def button(
167
- optional_text = '',
168
- optional_css_class = '',
169
- &block
170
- )
171
- _ = ::HtmlTags.button(
172
- optional_text,
173
- optional_css_class,
174
- &block
175
- )
176
- addnl(_)
177
- end
178
-
179
17
  require 'cyberweb/html_tags/input.rb'
180
18
  # ========================================================================= #
181
19
  # === input (input tag)
@@ -514,7 +352,201 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
514
352
  _ << ' size="'+hash[:size].to_s+'"' if hash[:size]
515
353
  _ << ' maxlength="'+hash[:max_length].to_s+'"' if hash[:max_length]
516
354
  end
517
- _ << ' />'+NL
355
+ _ << " />#{NL}"
356
+ addnl(_)
357
+ end
358
+
359
+ # ========================================================================= #
360
+ # === input_submit
361
+ #
362
+ # This is essentially a submit-button, in HTML.
363
+ #
364
+ # The first argument is the text that should be used for that button.
365
+ # ========================================================================= #
366
+ def input_submit(
367
+ default_value = '',
368
+ css_class = Input.to_s,
369
+ name_to_use = '',
370
+ css_style = '',
371
+ accesskey = '',
372
+ my_javascript = '',
373
+ id = nil,
374
+ hash = {},
375
+ &block
376
+ )
377
+ input(
378
+ :submit,
379
+ default_value,
380
+ css_class,
381
+ name_to_use,
382
+ css_style,
383
+ accesskey,
384
+ my_javascript,
385
+ id,
386
+ hash,
387
+ &block
388
+ )
389
+ end
390
+
391
+ # ========================================================================= #
392
+ # === div (div tag)
393
+ #
394
+ # Input to this method can be in this format:
395
+ #
396
+ # div(id: 'drag_div_sitemap_table', css_style: 'z-index: 1') {
397
+ #
398
+ # So the first argument can be a Hash.
399
+ # ========================================================================= #
400
+ def div(
401
+ optional_css_class = '',
402
+ optional_the_id = '',
403
+ optional_css_style = '',
404
+ optional_javascript = '',
405
+ &block
406
+ )
407
+ # ======================================================================= #
408
+ # === Handle Hashes first
409
+ # ======================================================================= #
410
+ if optional_css_class.is_a? Hash
411
+ # ===================================================================== #
412
+ # === :css_style
413
+ # ===================================================================== #
414
+ if optional_css_class.has_key? :css_style
415
+ optional_css_style = optional_css_class.delete(:css_style)
416
+ end
417
+ # ===================================================================== #
418
+ # === :id
419
+ # ===================================================================== #
420
+ if optional_css_class.has_key? :id
421
+ optional_the_id = optional_css_class.delete(:id)
422
+ end
423
+ # ===================================================================== #
424
+ # === :css_class
425
+ # ===================================================================== #
426
+ if optional_css_class.has_key? :css_class
427
+ optional_css_class = optional_css_class.delete(:css_class)
428
+ # ===================================================================== #
429
+ # === :class
430
+ # ===================================================================== #
431
+ elsif optional_css_class.has_key? :class
432
+ optional_css_class = optional_css_class.delete(:class)
433
+ end
434
+ if optional_css_class.is_a? Hash
435
+ optional_css_class = ''
436
+ end
437
+ end
438
+ # ======================================================================= #
439
+ # We need to delegate to a toplevel method, in order to create
440
+ # the correct <div> tag.
441
+ # ======================================================================= #
442
+ add_this_div(
443
+ optional_css_class,
444
+ optional_the_id,
445
+ optional_css_style,
446
+ optional_javascript
447
+ )
448
+ # ======================================================================= #
449
+ # === Handle blocks given to <div> next
450
+ # ======================================================================= #
451
+ if block_given?
452
+ yield
453
+ cdiv
454
+ end
455
+ end
456
+
457
+ # ========================================================================= #
458
+ # === pre (pre tag)
459
+ #
460
+ # This method will ultimately generate a <pre> tag.
461
+ #
462
+ # The alias called "numbered_table" may be subject to change. One day
463
+ # it may be a new method that can then be used to number a list of
464
+ # entries passed as String or Array. For now, though, as of October
465
+ # 2022 it is just an alias.
466
+ # ========================================================================= #
467
+ def pre(
468
+ i = '',
469
+ optional_css_class = 'FS1_5em',
470
+ optional_the_id = '',
471
+ optional_css_style = '',
472
+ optional_commands = nil,
473
+ &block
474
+ )
475
+ if optional_commands
476
+ case optional_commands
477
+ # ===================================================================== #
478
+ # === :remove_html
479
+ # ===================================================================== #
480
+ when :remove_html
481
+ i = Cyberweb.remove_html(i)
482
+ end
483
+ end
484
+ # ======================================================================= #
485
+ # === Handle blocks next
486
+ # ======================================================================= #
487
+ if block_given?
488
+ yielded = yield.to_s
489
+ if yielded and !yielded.empty?
490
+ i = i.to_s.dup
491
+ i << yielded
492
+ end
493
+ end
494
+ addn(
495
+ '<pre'+
496
+ css_class_or_no_class(optional_css_class)+
497
+ id_or_no_id(optional_the_id)+
498
+ css_style_or_no_style(optional_css_style)+
499
+ '>'+
500
+ i.to_s+
501
+ '</pre>'
502
+ )
503
+ end; alias numbered_table pre # === numbered_table
504
+
505
+ # ========================================================================= #
506
+ # === button (button tag)
507
+ #
508
+ # This method will "generate" a HTML button. Since as of October 2022
509
+ # this uses its own HTML element; before that input(:button) was in
510
+ # use.
511
+ #
512
+ # The following example shows how this method could be used:
513
+ #
514
+ # button {{
515
+ # text: 'Hey there!'
516
+ # }}
517
+ #
518
+ # A slightly more advanced example is the following variant:
519
+ #
520
+ # button {{
521
+ # text: 'Hey there - with more css and a Hello World alert-box in javascript when clicked by the user!',
522
+ # css_class: 'bblack1 darkgreen pad8px BOLD',
523
+ # javascript_function: 'msg("Hello world!!!")'
524
+ # }}
525
+ #
526
+ # Here is another variant, by specifically responding to a click-event, to call a specific function:
527
+ #
528
+ # button {{
529
+ # text: 'Click here'
530
+ # css_class: 'bblack1 pad8px'
531
+ # on_click_event: :on_click_event_hello_world
532
+ # }}
533
+ #
534
+ # And another variant, without a block:
535
+ #
536
+ # button text: 'OK!',
537
+ # css_class: 'glow_on_hover'
538
+ #
539
+ # ========================================================================= #
540
+ def button(
541
+ optional_text = '',
542
+ optional_css_class = '',
543
+ &block
544
+ )
545
+ _ = ::HtmlTags.button(
546
+ optional_text,
547
+ optional_css_class,
548
+ &block
549
+ )
518
550
  addnl(_)
519
551
  end
520
552
 
@@ -910,38 +942,6 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
910
942
  ee '<input type="text" id="'+work_on_this_id+'" name="'+work_on_this_id+'">'
911
943
  end
912
944
 
913
- # ========================================================================= #
914
- # === input_submit
915
- #
916
- # This is essentially a submit-button, in HTML.
917
- #
918
- # The first argument is the text that should be used for that button.
919
- # ========================================================================= #
920
- def input_submit(
921
- default_value = '',
922
- css_class = Input.to_s,
923
- name_to_use = '',
924
- css_style = '',
925
- accesskey = '',
926
- my_javascript = '',
927
- id = nil,
928
- hash = {},
929
- &block
930
- )
931
- input(
932
- :submit,
933
- default_value,
934
- css_class,
935
- name_to_use,
936
- css_style,
937
- accesskey,
938
- my_javascript,
939
- id,
940
- hash,
941
- &block
942
- )
943
- end
944
-
945
945
  # ========================================================================= #
946
946
  # === input_radio
947
947
  # ========================================================================= #
@@ -1015,7 +1015,10 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
1015
1015
  end
1016
1016
 
1017
1017
  # ========================================================================= #
1018
- # === h1
1018
+ # === h1 (h1 tag)
1019
+ #
1020
+ # The first argument to this method is the content that will be shown
1021
+ # via the generated <h1></h1> tag.
1019
1022
  # ========================================================================= #
1020
1023
  def h1(
1021
1024
  i = '',
@@ -14,11 +14,13 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
14
14
  # === simpler_string_image (sg tag)
15
15
  #
16
16
  # This method has been added in September 2020 to specifically work
17
- # around the problem that the older sg() has.
17
+ # around the problem that the older sg() method had.
18
18
  #
19
- # The return-value of this method MUST always be a String; it may never
20
- # use addnl() directly. The whole idea is to build up a <img> tag
21
- # through it; sg is short for string_image().
19
+ # The return-value of this method MUST always be a String; it may
20
+ # never call addnl() directly. The whole idea is to build up a <img>
21
+ # tag through it.
22
+ #
23
+ # Note that sg stands short for string_image().
22
24
  # ========================================================================= #
23
25
  def simpler_string_image(
24
26
  i = :random, # This is the path - or a Symbol denoting that a path should be used.
@@ -152,9 +154,17 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
152
154
  # ===================================================================== #
153
155
  case yielded
154
156
  # ===================================================================== #
157
+ # === :drag
158
+ # ===================================================================== #
159
+ when :drag
160
+ optional_the_id = 'drag_'+File.basename(i).downcase.
161
+ delete_suffix(
162
+ File.extname(i)
163
+ ).tr('.','_')
164
+ # ===================================================================== #
155
165
  # === :lazy_loading
156
166
  #
157
- # This will allow for lazy loading of an image.
167
+ # This entry point allows for the lazy loading of an image.
158
168
  #
159
169
  # The use case for this may look like so:
160
170
  #
@@ -172,13 +182,6 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
172
182
  i.prepend(relative_path?.dup)
173
183
  may_we_prepend_the_path = false
174
184
  # ===================================================================== #
175
- # === :draggable
176
- # ===================================================================== #
177
- when :drag
178
- optional_the_id = 'drag_'+File.basename(i).downcase.delete_suffix(
179
- File.extname(i)
180
- ).tr('.','_')
181
- # ===================================================================== #
182
185
  # === :draggable_attribute
183
186
  # ===================================================================== #
184
187
  when :draggable_attribute
@@ -196,8 +199,8 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
196
199
  # had, NOT the case if i begins with the substring 'http'.
197
200
  # ======================================================================= #
198
201
  if may_we_prepend_the_path and !i.start_with?('http')
199
- i = return_path_to_the_images_directory+
200
- i
202
+ i = "#{return_path_to_the_images_directory}"\
203
+ "#{i}"
201
204
  end
202
205
  # ======================================================================= #
203
206
  # Last but not least, we need to ensure that the ID is unique. If
@@ -221,20 +224,40 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
221
224
  alias sg simpler_string_image # === sg
222
225
 
223
226
  # ========================================================================= #
224
- # === images_css
227
+ # === sdimg
225
228
  #
226
- # This method allows the user to set the same CSS rules for all
227
- # images used on a given WebObject.
229
+ # This will return the string representation for a draggable
230
+ # image (as a string).
228
231
  # ========================================================================= #
229
- def images_css(i)
230
- @internal_hash[:global_CSS_rules_for_all_images] = i
231
- end
232
-
233
- # ========================================================================= #
234
- # === images_css_rules?
235
- # ========================================================================= #
236
- def images_css_rules?
237
- @internal_hash[:global_CSS_rules_for_all_images]
232
+ def sdimg(
233
+ url = '',
234
+ css_class = :empty_string_or_global_css_rules_for_images,
235
+ the_id = '',
236
+ css_style = '',
237
+ alt_text = '',
238
+ &block
239
+ )
240
+ if the_id and the_id.empty?
241
+ the_id = (
242
+ 'drag_'+
243
+ File.basename(url.to_s).
244
+ downcase.
245
+ delete_suffix(
246
+ File.extname(url.to_s)
247
+ )
248
+ ).tr('.','_')
249
+ end
250
+ if the_id and !the_id.empty? and !the_id.start_with?('drag_')
251
+ the_id = the_id.dup
252
+ the_id.prepend('drag_')
253
+ end
254
+ return simg(
255
+ url,
256
+ css_class,
257
+ the_id,
258
+ css_style,
259
+ alt_text
260
+ )
238
261
  end
239
262
 
240
263
  # ========================================================================= #
@@ -363,6 +386,40 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
363
386
  alias dimg draggable_image # === dimg
364
387
  alias dimage draggable_image # === dimage
365
388
 
389
+ # ========================================================================= #
390
+ # === dimgbr
391
+ #
392
+ # This method combines dimg() and br().
393
+ # ========================================================================= #
394
+ def dimgbr(
395
+ url = '',
396
+ css_class = '',
397
+ the_id = '',
398
+ css_style = '',
399
+ alt_text = '',
400
+ &block
401
+ )
402
+ dimg(url, css_class, the_id, css_style, alt_text, &block)
403
+ br
404
+ end
405
+
406
+ # ========================================================================= #
407
+ # === images_css
408
+ #
409
+ # This method allows the user to set the same CSS rules for all
410
+ # images used on a given WebObject.
411
+ # ========================================================================= #
412
+ def images_css(i)
413
+ @internal_hash[:global_CSS_rules_for_all_images] = i
414
+ end
415
+
416
+ # ========================================================================= #
417
+ # === images_css_rules?
418
+ # ========================================================================= #
419
+ def images_css_rules?
420
+ @internal_hash[:global_CSS_rules_for_all_images]
421
+ end
422
+
366
423
  # ========================================================================= #
367
424
  # === img_nbr
368
425
  #