cyberweb 0.5.225 → 0.6.17

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +438 -238
  3. data/doc/README.gen +437 -237
  4. data/doc/todo/todo_for_the_cyberweb_project.md +6 -0
  5. data/examples/advanced/cursor_example/cursor_example.cgi +29 -0
  6. data/examples/advanced/draw_circle/draw_circle.cgi +13 -4
  7. data/examples/css/css_bubbles.html +8 -2
  8. data/examples/css/examples_with_borders/examples_with_borders.html +33 -0
  9. data/examples/javascript_and_jquery/copy_to_the_clipboard_example/copy_to_the_clipboard_example.html +80 -0
  10. data/images/cyberweb_theme.png +0 -0
  11. data/lib/cyberweb/base/misc.rb +67 -18
  12. data/lib/cyberweb/base_module/base_module.rb +66 -8
  13. data/lib/cyberweb/cascading_style_sheets/cursors.css +12 -5
  14. data/lib/cyberweb/cascading_style_sheets/default.css +20 -18
  15. data/lib/cyberweb/cascading_style_sheets/glow_effects.css +12 -6
  16. data/lib/cyberweb/cascading_style_sheets/misc.css +12 -1
  17. data/lib/cyberweb/generator/cgi.rb +3 -3
  18. data/lib/cyberweb/html_template/html_template.rb +172 -114
  19. data/lib/cyberweb/javascript/javascript.rb +34 -31
  20. data/lib/cyberweb/javascript_code/copy_to_the_clipboard.js +12 -0
  21. data/lib/cyberweb/jquery_module/jquery_module.rb +51 -0
  22. data/lib/cyberweb/modules/css_style.rb +27 -0
  23. data/lib/cyberweb/{favicon → modules}/favicon.rb +162 -33
  24. data/lib/cyberweb/requires/require_the_cyberweb_project.rb +6 -2
  25. data/lib/cyberweb/toplevel_methods/download_webpage.rb +16 -2
  26. data/lib/cyberweb/toplevel_methods/html_tables.rb +42 -30
  27. data/lib/cyberweb/toplevel_methods/log_directory.rb +11 -8
  28. data/lib/cyberweb/toplevel_methods/misc.rb +84 -47
  29. data/lib/cyberweb/toplevel_methods/path.rb +29 -8
  30. data/lib/cyberweb/toplevel_methods/temp_directory.rb +3 -1
  31. data/lib/cyberweb/version/version.rb +2 -2
  32. data/lib/cyberweb/web_images/map_symbol_to_image_location.rb +43 -7
  33. data/lib/cyberweb/web_object/favicon.rb +4 -106
  34. data/lib/cyberweb/web_object/html_tags.rb +133 -65
  35. data/lib/cyberweb/web_object/images.rb +20 -20
  36. data/lib/cyberweb/web_object/javascript_and_jquery.rb +39 -16
  37. data/lib/cyberweb/web_object/link.rb +18 -15
  38. data/lib/cyberweb/web_object/misc.rb +4158 -327
  39. data/lib/cyberweb/web_object/reset.rb +19 -15
  40. data/lib/cyberweb/web_object/run.rb +2 -0
  41. data/lib/cyberweb/web_object/web_object.rb +1 -3584
  42. data/lib/cyberweb/webmin/simple_forum/index.cgi +30 -0
  43. data/lib/cyberweb/webmin/simple_forum/simple_forum.rb +134 -0
  44. data/lib/cyberweb/yaml/http_status_codes.yml +3 -0
  45. data/lib/cyberweb/yaml/js_files_to_load.yml +6 -1
  46. data/test/html_template/html_template.rb +22 -3
  47. data/test/simple_tests/testing_the_javascript_component.cgi +32 -0
  48. data/test/simple_tests/testing_the_select_tag.cgi +7 -1
  49. metadata +13 -4
@@ -38,7 +38,9 @@ module Cyberweb
38
38
  # ======================================================================= #
39
39
  when :default
40
40
  if is_on_roebe?
41
- i = '/home/Temp/'
41
+ i = '/home/x/Temp/'
42
+ # i = '/home/Temp/'
43
+ # i = '/tmp/'
42
44
  else
43
45
  i = '/tmp/' # This should be the default for most Linux variants.
44
46
  end
@@ -9,12 +9,12 @@ module Cyberweb
9
9
  # ========================================================================= #
10
10
  # === VERSION
11
11
  # ========================================================================= #
12
- VERSION = '0.5.225'
12
+ VERSION = '0.6.17'
13
13
 
14
14
  # ========================================================================= #
15
15
  # === LAST_UPDATE
16
16
  # ========================================================================= #
17
- LAST_UPDATE = '17.10.2022'
17
+ LAST_UPDATE = '01.11.2022'
18
18
 
19
19
  # ========================================================================= #
20
20
  # === URL_TO_THE_DOCUMENTATION
@@ -819,7 +819,9 @@ module WebImages
819
819
  # ======================================================================= #
820
820
  when :maxerl
821
821
  _ = "#{IMG_DIR}MAXERL.png"
822
+ # ======================================================================= #
822
823
  # === :message_box_error
824
+ # ======================================================================= #
823
825
  when :message_box_error
824
826
  _ = "#{IMG_DIR}MESSAGE_BOX_ERROR.png"
825
827
  # ======================================================================= #
@@ -959,6 +961,9 @@ module WebImages
959
961
  # ======================================================================= #
960
962
  when :note_3, :note3, :noten_3, :noten3
961
963
  _ = 'AUDIO/NOTEN_03.png'
964
+ # ======================================================================= #
965
+ # === :note_4
966
+ # ======================================================================= #
962
967
  when :note_4, :note4, :noten_4, :noten4
963
968
  _ = 'AUDIO/NOTEN_04.png'
964
969
  # ======================================================================= #
@@ -1033,6 +1038,9 @@ module WebImages
1033
1038
  # ======================================================================= #
1034
1039
  when :pfeil8
1035
1040
  _ = "#{IMG_DIR}PFEIL8_OUT.png"
1041
+ # ======================================================================= #
1042
+ # === :pfeil9
1043
+ # ======================================================================= #
1036
1044
  when :pfeil9
1037
1045
  _ = "#{IMG_DIR}PFEIL9.png"
1038
1046
  when :pfeil10, :pfeil_rechts, :pfeilrechts
@@ -1405,8 +1413,14 @@ module WebImages
1405
1413
  # ======================================================================= #
1406
1414
  when :star_fancy
1407
1415
  _ = "#{IMG_DIR}STAR_FANCY.png"
1416
+ # ======================================================================= #
1417
+ # === :sword
1418
+ # ======================================================================= #
1408
1419
  when :sword
1409
1420
  _ = 'RPG/WEAPONS/SWORD03.png'
1421
+ # ======================================================================= #
1422
+ # === :in_progress
1423
+ # ======================================================================= #
1410
1424
  when :in_progress
1411
1425
  _ = "#{IMG_DIR}STATUS_IN_PROGRESS.png"
1412
1426
  # ======================================================================= #
@@ -1419,6 +1433,9 @@ module WebImages
1419
1433
  # ======================================================================= #
1420
1434
  when :one_and_half_star
1421
1435
  _ = "#{IMG_DIR}EVAL/1x_STAR.png"
1436
+ # ======================================================================= #
1437
+ # === :two_star
1438
+ # ======================================================================= #
1422
1439
  when :two_star, :two_stars
1423
1440
  _ = "#{IMG_DIR}EVAL/02_STAR.png"
1424
1441
  # ======================================================================= #
@@ -1426,12 +1443,24 @@ module WebImages
1426
1443
  # ======================================================================= #
1427
1444
  when :two_and_half_star
1428
1445
  _ = "#{IMG_DIR}EVAL/2x_STAR.png"
1446
+ # ======================================================================= #
1447
+ # === :three_star
1448
+ # ======================================================================= #
1429
1449
  when :three_star, :three_stars
1430
1450
  _ = "#{IMG_DIR}EVAL/03_STAR.png"
1451
+ # ======================================================================= #
1452
+ # === :three_and_half_star
1453
+ # ======================================================================= #
1431
1454
  when :three_and_half_star
1432
1455
  _ = "#{IMG_DIR}EVAL/3x_STAR.png"
1456
+ # ======================================================================= #
1457
+ # === :four_star
1458
+ # ======================================================================= #
1433
1459
  when :four_star, :four_stars
1434
1460
  _ = "#{IMG_DIR}EVAL/04_STAR.png"
1461
+ # ======================================================================= #
1462
+ # === :four_and_half_star
1463
+ # ======================================================================= #
1435
1464
  when :four_and_half_star
1436
1465
  _ = "#{IMG_DIR}EVAL/4x_STAR.png"
1437
1466
  when :five_star, :five_stars
@@ -1449,6 +1478,9 @@ module WebImages
1449
1478
  # ======================================================================= #
1450
1479
  when :teufelchen
1451
1480
  _ = "#{IMG_DIR}TEUFELCHEN.png"
1481
+ # ======================================================================= #
1482
+ # === :thinking_human
1483
+ # ======================================================================= #
1452
1484
  when :thinking_human
1453
1485
  _ = "#{IMG_DIR}THINKING_HUMAN.png"
1454
1486
  # ======================================================================= #
@@ -1533,6 +1565,9 @@ module WebImages
1533
1565
  # ======================================================================= #
1534
1566
  when :wings
1535
1567
  _ = "#{IMG_DIR}WINGS.png"
1568
+ # ======================================================================= #
1569
+ # === :word
1570
+ # ======================================================================= #
1536
1571
  when :word
1537
1572
  _ = "#{IMG_DIR}WORD.png"
1538
1573
  # ======================================================================= #
@@ -1707,11 +1742,12 @@ end
1707
1742
  end
1708
1743
 
1709
1744
  if __FILE__ == $PROGRAM_NAME
1710
- puts Cyberweb::WebImages.map_symbol_to_image_location(ARGV)
1711
- puts Cyberweb.get_webimage(:big_star) # -> /home/Programs/Ruby/2.7.1/lib/ruby/site_ruby/2.7.0/web_object/images/real/BIG_STAR.png
1712
- puts Cyberweb::WebImages.is_included?(:admin) # => true
1713
- puts Cyberweb::WebImages[:austria]
1714
- puts Cyberweb::WebImages.random
1715
- puts Cyberweb::WebImages.mapper(:phone)
1716
- puts Cyberweb::WebImages.mapper(:phone) { :prepend_the_image_base_directory }
1745
+ alias e puts
1746
+ e Cyberweb::WebImages.map_symbol_to_image_location(ARGV)
1747
+ e Cyberweb.get_webimage(:big_star) # -> /home/Programs/Ruby/2.7.1/lib/ruby/site_ruby/2.7.0/web_object/images/real/BIG_STAR.png
1748
+ e Cyberweb::WebImages.is_included?(:admin) # => true
1749
+ e Cyberweb::WebImages[:austria]
1750
+ e Cyberweb::WebImages.random
1751
+ e Cyberweb::WebImages.mapper(:phone)
1752
+ e Cyberweb::WebImages.mapper(:phone) { :prepend_the_image_base_directory }
1717
1753
  end
@@ -10,6 +10,8 @@ module Cyberweb
10
10
 
11
11
  class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
12
12
 
13
+ require 'cyberweb/modules/favicon.rb'
14
+
13
15
  # ========================================================================= #
14
16
  # === set_favicon
15
17
  #
@@ -34,112 +36,8 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
34
36
  def set_favicon(
35
37
  i = 'RPG/RPG_FAVICON.png'
36
38
  )
37
- if i.is_a? Symbol
38
- case i # case tag
39
- # ======================================================================= #
40
- # === :rpg_favicon
41
- # ======================================================================= #
42
- when :rpg_favicon,
43
- :rpg
44
- i = 'RPG/RPG_FAVICON.png'
45
- # ======================================================================= #
46
- # === :wlan_favicon
47
- # ======================================================================= #
48
- when :wlan_favicon,
49
- :wlan
50
- i = 'science/funk/WLAN_FAVICON.png'
51
- # ======================================================================= #
52
- # === :package
53
- # ======================================================================= #
54
- when :package
55
- i = 'STD/DOWNLOAD_PACKAGE.png'
56
- # ======================================================================= #
57
- # === :dnd_favicon
58
- # ======================================================================= #
59
- when :dnd_favicon,
60
- :dnd_favicons,
61
- :dnd
62
- i = 'RPG/DnD/DnD_FAVICON.png'
63
- # ======================================================================= #
64
- # === :ruby_favicon
65
- # ======================================================================= #
66
- when :ruby_favicon
67
- i = 'programming/ruby/RUBY_FAVICON.png'
68
- # ======================================================================= #
69
- # === :linux_favicon
70
- # ======================================================================= #
71
- when :linux_favicon
72
- i = 'linux/LINUX_FAVICON.png'
73
- # ======================================================================= #
74
- # === :sitemap_favicon
75
- # ======================================================================= #
76
- when :sitemap_favicon
77
- i = 'SITEMAP/SITEMAP_FAVICON.png'
78
- # ======================================================================= #
79
- # === :science_favicon
80
- # ======================================================================= #
81
- when :science_favicon
82
- i = 'science/SCIENCE_FAVICON.png'
83
- # ======================================================================= #
84
- # === :bioroebe_favicon
85
- # ======================================================================= #
86
- when :bioroebe_favicon
87
- i = 'bioroebe/images/BIOROEBE.png'
88
- # ======================================================================= #
89
- # === :dsa
90
- # ======================================================================= #
91
- when :dsa,
92
- :dsa_favicon
93
- i = 'RPG/DSA/DSA_FAVICON.png'
94
- # ======================================================================= #
95
- # === :shadowrun_favicon
96
- # ======================================================================= #
97
- when :shadowrun_favicon,
98
- :shadowrun
99
- i = 'RPG/SR/SHADOWRUN_FAVICON.png'
100
- # ======================================================================= #
101
- # === :default
102
- # ======================================================================= #
103
- when :default
104
- i = 'STD/ZITRONE.png'
105
- # ======================================================================= #
106
- # === :tai_favicon
107
- # ======================================================================= #
108
- when :tai_favicon
109
- i = 'RPG/SARLEM/OSTREICH/TAI/TAI_FAVICON.png'
110
- # ======================================================================= #
111
- # === :sarlem
112
- # ======================================================================= #
113
- when :sarlem,
114
- :sarlem_favicon
115
- i = 'RPG/SARLEM/SARLEM_FAVICON.png'
116
- # ======================================================================= #
117
- # === :random
118
- # ======================================================================= #
119
- when :random,
120
- :rand
121
- i = random_favicon
122
- # ======================================================================= #
123
- # === :inline
124
- #
125
- # Add support for "inline" favicons" which are ... no favicons really.
126
- #
127
- # URLs prefixed with the "data:" scheme allow content creators to
128
- # embed small files inline in documents.
129
- # ======================================================================= #
130
- when :inline,
131
- :minimal,
132
- :none
133
- i = "<link href=data:, rel=icon>#{NL}"
134
- else
135
- # ===================================================================== #
136
- # We assume this symbol to be part of WebImage. This will
137
- # handle input such as :big_star, for example.
138
- # ===================================================================== #
139
- i = ::Cyberweb.get_webimage(i)
140
- end
141
- end
142
- i = return_path_to_the_images_directory+i.to_s
39
+ i = ::Cyberweb::Favicon.path_of?(i)
40
+ i = "#{return_path_to_the_images_directory}#{i}"
143
41
  add_with_newline(
144
42
  return_favicon_string(i)
145
43
  )
@@ -14,6 +14,120 @@ 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
+
17
131
  # ========================================================================= #
18
132
  # === button (button tag)
19
133
  #
@@ -643,6 +757,25 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
643
757
  end
644
758
  end
645
759
 
760
+ # ========================================================================= #
761
+ # === add_this_div
762
+ # ========================================================================= #
763
+ def add_this_div(
764
+ optional_css_class = '',
765
+ optional_the_id = '',
766
+ optional_css_style = '',
767
+ optional_javascript = ''
768
+ )
769
+ addnl(
770
+ Cyberweb.string_div(
771
+ optional_css_class,
772
+ optional_the_id,
773
+ optional_css_style,
774
+ optional_javascript
775
+ )
776
+ )
777
+ end
778
+
646
779
  # ========================================================================= #
647
780
  # === ul (ul tag)
648
781
  #
@@ -1116,71 +1249,6 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
1116
1249
  add(_)
1117
1250
  end
1118
1251
 
1119
- # ========================================================================= #
1120
- # === div (div tag)
1121
- #
1122
- # Input to this method can be in this format:
1123
- #
1124
- # div(id: 'drag_div_sitemap_table', css_style: 'z-index: 1') {
1125
- #
1126
- # So the first argument can be a Hash.
1127
- # ========================================================================= #
1128
- def div(
1129
- optional_css_class = '',
1130
- optional_the_id = '',
1131
- optional_css_style = '',
1132
- optional_javascript = '',
1133
- &block
1134
- )
1135
- if optional_css_class.is_a? Hash
1136
- # ===================================================================== #
1137
- # === :css_style
1138
- # ===================================================================== #
1139
- if optional_css_class.has_key? :css_style
1140
- optional_css_style = optional_css_class.delete(:css_style)
1141
- end
1142
- # ===================================================================== #
1143
- # === :id
1144
- # ===================================================================== #
1145
- if optional_css_class.has_key? :id
1146
- optional_the_id = optional_css_class.delete(:id)
1147
- end
1148
- # ===================================================================== #
1149
- # === :css_class
1150
- # ===================================================================== #
1151
- if optional_css_class.has_key? :css_class
1152
- optional_css_class = optional_css_class.delete(:css_class)
1153
- # ===================================================================== #
1154
- # === :class
1155
- # ===================================================================== #
1156
- elsif optional_css_class.has_key? :class
1157
- optional_css_class = optional_css_class.delete(:class)
1158
- end
1159
- if optional_css_class.is_a? Hash
1160
- optional_css_class = ''
1161
- end
1162
- end
1163
- # ======================================================================= #
1164
- # We need to delegate to a toplevel method, in order to create
1165
- # the correct <div> tag.
1166
- # ======================================================================= #
1167
- addnl(
1168
- Cyberweb.string_div(
1169
- optional_css_class,
1170
- optional_the_id,
1171
- optional_css_style,
1172
- optional_javascript
1173
- )
1174
- )
1175
- # ======================================================================= #
1176
- # === Handle blocks given to <div> next
1177
- # ======================================================================= #
1178
- if block_given?
1179
- yield
1180
- cdiv
1181
- end
1182
- end
1183
-
1184
1252
  # ========================================================================= #
1185
1253
  # === li (li tag)
1186
1254
  #
@@ -10,26 +10,6 @@ module Cyberweb
10
10
 
11
11
  class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
12
12
 
13
- # ========================================================================= #
14
- # === return_path_to_the_images_directory
15
- # ========================================================================= #
16
- def return_path_to_the_images_directory(
17
- path_to_use = relative_path?
18
- )
19
- return "#{path_to_use}data/"\
20
- "#{return_name_of_the_images_directory}/"
21
- end
22
-
23
- # ========================================================================= #
24
- # === images_css
25
- #
26
- # This method allows the user to set the same CSS rules for all
27
- # images used on a given WebObject.
28
- # ========================================================================= #
29
- def images_css(i)
30
- @internal_hash[:global_CSS_rules_for_all_images] = i
31
- end
32
-
33
13
  # ========================================================================= #
34
14
  # === draggable_image
35
15
  #
@@ -71,6 +51,26 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
71
51
  alias dimg draggable_image # === dimg
72
52
  alias dimage draggable_image # === dimage
73
53
 
54
+ # ========================================================================= #
55
+ # === return_path_to_the_images_directory
56
+ # ========================================================================= #
57
+ def return_path_to_the_images_directory(
58
+ path_to_use = relative_path?
59
+ )
60
+ return "#{path_to_use}data/"\
61
+ "#{return_name_of_the_images_directory}/"
62
+ end
63
+
64
+ # ========================================================================= #
65
+ # === images_css
66
+ #
67
+ # This method allows the user to set the same CSS rules for all
68
+ # images used on a given WebObject.
69
+ # ========================================================================= #
70
+ def images_css(i)
71
+ @internal_hash[:global_CSS_rules_for_all_images] = i
72
+ end
73
+
74
74
  # ========================================================================= #
75
75
  # === img_nbr
76
76
  #
@@ -159,22 +159,6 @@ EOF
159
159
  alias report_use_jquery? do_we_use_jquery? # === report_use_jquery?
160
160
  alias jquery_is_used? do_we_use_jquery? # === jquery_is_used?
161
161
 
162
- # ========================================================================= #
163
- # === do_use_jquery
164
- #
165
- # Use this method to enable jquery support.
166
- #
167
- # I recommend to use this method, rather than use_jquery, but if
168
- # you want to be lazy, feel free to use either variant. I just
169
- # think that the explicit "do_" implies an action, which I
170
- # think is more logical.
171
- # ========================================================================= #
172
- def do_use_jquery
173
- @config['use_jquery'] = true # Do a batch-assignment here.
174
- end; alias use_jquery do_use_jquery # === use_jquery
175
- alias enable_drag do_use_jquery # === enable_drag
176
- alias enable_jquery do_use_jquery # === enable_jquery
177
-
178
162
  # ========================================================================= #
179
163
  # === jquery_resizable_via_the_mouse
180
164
  #
@@ -322,4 +306,43 @@ EOF
322
306
  )
323
307
  end
324
308
 
309
+ # ========================================================================= #
310
+ # === enable_drag_all_images
311
+ #
312
+ # We enable a configuration option through this method call here.
313
+ #
314
+ # Note that we will also automatically enable jquery in this case,
315
+ # as otherwise we could not drag the image in question around,
316
+ # which would sort of defeat the points of having this method
317
+ # in the first place - or it would require of you to manually
318
+ # enable jquery, which seems superfluous.
319
+ # ========================================================================= #
320
+ def enable_drag_all_images
321
+ do_use_jquery unless use_jquery?
322
+ @config['drag_all_images'] = true
323
+ end; alias drag_all_images enable_drag_all_images # === drag_all_images
324
+ alias drag_everything enable_drag_all_images # === drag_everything
325
+ alias do_drag_all_images enable_drag_all_images # === do_drag_all_image
326
+ alias do_enable_drag_all_images enable_drag_all_images # === do_enable_drag_all_image
327
+ alias drag_everything enable_drag_all_images # === drag_everything
328
+ alias all_images_will_be_draggable enable_drag_all_images # === all_images_will_be_draggable
329
+ alias enable_dragging enable_drag_all_images # === enable_dragging
330
+ alias enable_drag_and_drop enable_drag_all_images # === enable_drag_and_drop
331
+
332
+ # ========================================================================= #
333
+ # === do_use_jquery
334
+ #
335
+ # Use this method to enable jquery support.
336
+ #
337
+ # I recommend to use this method, rather than use_jquery, but if
338
+ # you want to be lazy, feel free to use either variant. I just
339
+ # think that the explicit "do_" implies an action, which I
340
+ # think is more logical.
341
+ # ========================================================================= #
342
+ def do_use_jquery
343
+ @config['use_jquery'] = true # Do a batch-assignment here.
344
+ end; alias use_jquery do_use_jquery # === use_jquery
345
+ alias enable_drag do_use_jquery # === enable_drag
346
+ alias enable_jquery do_use_jquery # === enable_jquery
347
+
325
348
  end; end
@@ -10,6 +10,24 @@ module Cyberweb
10
10
 
11
11
  class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
12
12
 
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
+
13
31
  # ========================================================================= #
14
32
  # === pretty_link
15
33
  #
@@ -117,21 +135,6 @@ class WebObject < ::Cyberweb::Base # === Cyberweb::WebObject
117
135
  br
118
136
  end; alias abr linkbr # === abr
119
137
 
120
- # ========================================================================= #
121
- # === self_abr
122
- #
123
- # This method is similar to abr(), but it will automatically use
124
- # content: :self as-is.
125
- # ========================================================================= #
126
- def self_abr(
127
- remote_url,
128
- optional_css_class = ''
129
- )
130
- abr remote_url,
131
- content: :self,
132
- css_class: optional_css_class
133
- end; alias abr_self self_abr # === abr_self
134
-
135
138
  # ========================================================================= #
136
139
  # === roebe_internal_link
137
140
  #