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
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # http://localhost/programming/ruby/src/cyberweb/lib/cyberweb/webmin/simple_forum/index.cgi
6
+ # =========================================================================== #
7
+ require 'cyberweb/autoinclude'
8
+ require 'cyberweb/cybersprawl/simple_forum/simple_forum.rb'
9
+
10
+ english('A simple web-forum') {
11
+ created_on '22.10.2022' # Saturday.
12
+ autoextend
13
+ ruby_favicon
14
+ template1
15
+ body_css_class 'mar0px s2px padt2px VERDANAs'
16
+ body_css_style 'background-color: #d3d2d1;'
17
+ font_size 'def'
18
+
19
+ doc('mar0px pad0px s0_6em') {
20
+ h1 dot(106, 'marr8px')+
21
+ title?,
22
+ 'mart1px marb0_5em'
23
+ @simple_forum = Cyberweb::Cybersprawl::SimpleForum.new
24
+ h3 'Available Topics:'
25
+ p_default {
26
+ @simple_forum.available_topics?.each {|this_topic|
27
+ e this_topic
28
+ }
29
+ }
30
+ }}
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Cyberweb::Cybersprawl::SimpleForum
6
+ #
7
+ # Usage example:
8
+ #
9
+ # Cyberweb::Cybersprawl::SimpleForum.new(ARGV)
10
+ #
11
+ # =========================================================================== #
12
+ # require 'cyberweb/cybersprawl/simple_forum/simple_forum.rb'
13
+ # =========================================================================== #
14
+ require 'cyberweb/base/base.rb'
15
+
16
+ module Cyberweb
17
+
18
+ module Cybersprawl
19
+
20
+ class SimpleForum < Base # === Cyberweb::Cybersprawl::SimpleForum
21
+
22
+ # ========================================================================= #
23
+ # === initialize
24
+ # ========================================================================= #
25
+ def initialize(
26
+ commandline_arguments = nil,
27
+ run_already = true
28
+ )
29
+ reset
30
+ set_commandline_arguments(
31
+ commandline_arguments
32
+ )
33
+ run if run_already
34
+ end
35
+
36
+ # ========================================================================= #
37
+ # === reset (reset tag)
38
+ # ========================================================================= #
39
+ def reset
40
+ super()
41
+ infer_the_namespace
42
+ create_the_internal_hash
43
+ # ======================================================================= #
44
+ # === :available_topics
45
+ # ======================================================================= #
46
+ @internal_hash[:available_topics] = []
47
+ # ======================================================================= #
48
+ # === :current_id
49
+ #
50
+ # This is the ID of the message that is to be stored.
51
+ # ======================================================================= #
52
+ @internal_hash[:current_id] = 1
53
+ set_be_verbose
54
+ end
55
+
56
+ # ========================================================================= #
57
+ # === current_id?
58
+ # ========================================================================= #
59
+ def current_id?
60
+ @internal_hash[:current_id]
61
+ end
62
+
63
+ # ========================================================================= #
64
+ # === available_topics?
65
+ # ========================================================================= #
66
+ def available_topics?
67
+ @internal_hash[:available_topics]
68
+ end
69
+
70
+ # ========================================================================= #
71
+ # === run (run tag)
72
+ # ========================================================================= #
73
+ def run
74
+ end
75
+
76
+ # ========================================================================= #
77
+ # === store_note
78
+ #
79
+ # This is the method that can be used to store content into a local
80
+ # .yml file.
81
+ # ========================================================================= #
82
+ def store_note(
83
+ what = "Hello world!\n",
84
+ into = current_id?
85
+ )
86
+ into = into.to_s.dup
87
+ unless into.end_with? '.yml'
88
+ into << '.yml'
89
+ end
90
+ # ======================================================================= #
91
+ # The next clause will automatically increment.
92
+ # ======================================================================= #
93
+ if File.exist? into
94
+ loop {
95
+ into = increment_by_one(into)
96
+ break unless File.exist? into
97
+ }
98
+ end
99
+ if be_verbose?
100
+ puts 'Storing into the file `'+sfile(into)+'`.'
101
+ end
102
+ author = :user_123
103
+ hash = {
104
+ author: author,
105
+ content: what
106
+ }
107
+ write_what_into(
108
+ YAML.dump(hash),
109
+ into
110
+ )
111
+ end
112
+
113
+ # ========================================================================= #
114
+ # === increment_by_one
115
+ # ========================================================================= #
116
+ def increment_by_one(i)
117
+ i =~ /(\d{1,2})/
118
+ old_number = $1.to_s.dup.to_i
119
+ return (old_number.to_i + 1).to_s+'.yml'
120
+ end
121
+
122
+ # ========================================================================= #
123
+ # === Cyberweb::Cybersprawl::SimpleForum[]
124
+ # ========================================================================= #
125
+ def self.[](i = ARGV)
126
+ new(i)
127
+ end
128
+
129
+ end; end; end
130
+
131
+ if __FILE__ == $PROGRAM_NAME
132
+ simple_forum = Cyberweb::Cybersprawl::SimpleForum.new(ARGV)
133
+ simple_forum.store_note
134
+ end # simpleforum
@@ -11,12 +11,15 @@
11
11
  204: No Content
12
12
  205: Reset Content
13
13
  206: Partial Content
14
+ 207: Multi-Status # WebDAV; RFC 4918
14
15
  300: Multiple Choices
15
16
  301: Moved Permanently
16
17
  302: Moved Temporarily
17
18
  303: See Other
18
19
  304: Not Modified
19
20
  305: Use Proxy
21
+ 306: Switch Proxy # No longer used.
22
+ 307: Temporary Redirect # since HTTP/1.1
20
23
  400: Bad Request
21
24
  401: Unauthorized
22
25
  402: Payment Required
@@ -25,4 +25,9 @@
25
25
  # - select_all.js
26
26
  # - my_jsgraphics
27
27
  #
28
- # =========================================================================== #
28
+ # =========================================================================== #
29
+
30
+ # =========================================================================== #
31
+ # The following file was added to the cyberweb project as of 18.10.2022
32
+ # =========================================================================== #
33
+ - copy_to_the_clipboard.js
@@ -6,10 +6,29 @@ require 'cyberweb/requires/require_the_html_template.rb'
6
6
 
7
7
  alias e puts
8
8
 
9
- html_template = Cyberweb::HtmlTemplate[
9
+ html_template_object = Cyberweb::HtmlTemplate[
10
10
  title: 'The weather/temperature in Vienna',
11
11
  body: HtmlTags.p('Hey there','','','font-size:1.8em'),
12
12
  use_jquery: true
13
- ].to_s
13
+ ]
14
14
 
15
- e html_template
15
+ html_template = html_template_object.to_s
16
+ e html_template
17
+ e '-'*80
18
+ e
19
+ e 'Now testing some methods on the html_template object:'
20
+ e
21
+ e 'Do we use jquery?'
22
+ e
23
+ e ' '+html_template_object.use_jquery?.to_s
24
+ e
25
+ e 'Now we will try to disable jquery.'
26
+ e
27
+ html_template_object.disable_jquery
28
+ e 'Do we use jquery?'
29
+ e
30
+ e ' '+html_template_object.use_jquery?.to_s
31
+ e
32
+ e '^^^ this must now be false'
33
+ e
34
+ e '-'*80
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # http://localhost/programming/ruby/src/cyberweb/test/simple_tests/testing_the_javascript_component.cgi
6
+ # =========================================================================== #
7
+ require 'cyberweb/autoinclude'
8
+ require 'hardware_information'
9
+
10
+ english('Testing the <select> tag (via dropdown)') {
11
+ template1 ''
12
+ no_jquery
13
+ doc('mar2px pad2px') {
14
+ h2 hescape('Testing the JavaScript components'),'mart1px'
15
+ if false
16
+ create_copy_to_clipboard_button(
17
+ 'Hello world!', # use_this_value
18
+ 'clipboard_button', # use_this_id
19
+ true, # true for "yes, hide the input field
20
+ '😼', # This is the text that will be shown on the button.
21
+ 'bblack2 pad8px' # CSS rules for the button.
22
+ )
23
+ end
24
+ fancy_spacer
25
+ ee return_copy_to_clipboard_button(
26
+ 'bluefish '+HardwareInformation::PurchasedHardware.file_computer_hardware?, # use_this_value
27
+ 'clipboard_button', # use_this_id
28
+ true, # true for "yes, hide the input field
29
+ '😼', # This is the text that will be shown on the button.
30
+ 'bblack2 pad8px' # CSS rules for the button.
31
+ )
32
+ }}
@@ -9,7 +9,7 @@
9
9
  require 'cyberweb/autoinclude'
10
10
 
11
11
  english('Testing the <select> tag (via dropdown)') {
12
- css_style '
12
+ template1 '
13
13
  select {
14
14
  border: 1px dotted darkblue;
15
15
  padding: 25px;
@@ -28,4 +28,10 @@ doc('mar2px pad2px') {
28
28
  dropdown( %w( a b c ) ) {{ selected: 3 }}
29
29
  dropdown( %w( BMW Mercedes Audi ) ) {{ selected: 23 }}
30
30
  }
31
+ ee ' <input type="text" value="XXX" id="foobar">
32
+ <button onclick="copy_to_the_clipboard(\'foobar\')">Copy text</button>'
33
+
34
+ h2 ::Cyberweb.project_yaml_directory?+'js_files_to_load.yml'
35
+ pre File.exist?(::Cyberweb.project_yaml_directory?+'js_files_to_load.yml').to_s
36
+
31
37
  }}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyberweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.225
4
+ version: 0.6.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert A. Heiler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-17 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colours
@@ -129,6 +129,7 @@ files:
129
129
  - examples/advanced/animated_css_example/animated_css_example.html
130
130
  - examples/advanced/animated_submarine/animated_submarine.html
131
131
  - examples/advanced/animated_windmill/animated_windmill.html
132
+ - examples/advanced/cursor_example/cursor_example.cgi
132
133
  - examples/advanced/delayed_update_of_the_body_via_javascript.cgi
133
134
  - examples/advanced/draw_circle/draw_circle.cgi
134
135
  - examples/advanced/drop_shadow_examples.cgi
@@ -180,6 +181,7 @@ files:
180
181
  - examples/css/daily_coffee/daily_coffee.html
181
182
  - examples/css/different_colour_on_selected_text/different_colour_on_selected_text.html
182
183
  - examples/css/differentially_glowing_text_example/differentially_glowing_text_example.html
184
+ - examples/css/examples_with_borders/examples_with_borders.html
183
185
  - examples/css/fade_in_and_fade_out_effect.html
184
186
  - examples/css/flying_birds_example/flying_birds_example.html
185
187
  - examples/css/folding_cards_example/folding_cards_example.html
@@ -283,6 +285,7 @@ files:
283
285
  - examples/javascript_and_jquery/arrays/arrays_example_in_javascript.html
284
286
  - examples/javascript_and_jquery/autocomplete_on_an_input_field/autocomplete_on_an_input_field.html
285
287
  - examples/javascript_and_jquery/change_the_background_colour_dynamically/change_the_background_colour_dynamically.html
288
+ - examples/javascript_and_jquery/copy_to_the_clipboard_example/copy_to_the_clipboard_example.html
286
289
  - examples/javascript_and_jquery/delay_example/delay_example.html
287
290
  - examples/javascript_and_jquery/drag_support/drag_support.html
288
291
  - examples/javascript_and_jquery/jquery_bubbling_header/bubbling_header.html
@@ -425,7 +428,6 @@ files:
425
428
  - lib/cyberweb/erb/test.rhtml
426
429
  - lib/cyberweb/erb/test_template.erb
427
430
  - lib/cyberweb/evaluate_from_the_same_named_file_then_serve.rb
428
- - lib/cyberweb/favicon/favicon.rb
429
431
  - lib/cyberweb/forum/README.md
430
432
  - lib/cyberweb/foto_gallery/foto_gallery.rb
431
433
  - lib/cyberweb/generator/README.md
@@ -524,6 +526,7 @@ files:
524
526
  - lib/cyberweb/javascript/snoweffect.rb
525
527
  - lib/cyberweb/javascript_code/README.md
526
528
  - lib/cyberweb/javascript_code/chmod_displayer.js
529
+ - lib/cyberweb/javascript_code/copy_to_the_clipboard.js
527
530
  - lib/cyberweb/javascript_code/custom_functions.js
528
531
  - lib/cyberweb/javascript_code/disable_right_click.js
529
532
  - lib/cyberweb/javascript_code/games/snake.js
@@ -541,6 +544,9 @@ files:
541
544
  - lib/cyberweb/javascript_code/simulate_a_dice.js
542
545
  - lib/cyberweb/javascript_code/sleep.js
543
546
  - lib/cyberweb/javascript_code/to_celsius.js
547
+ - lib/cyberweb/jquery_module/jquery_module.rb
548
+ - lib/cyberweb/modules/css_style.rb
549
+ - lib/cyberweb/modules/favicon.rb
544
550
  - lib/cyberweb/mouse/README.md
545
551
  - lib/cyberweb/mouse/libxdo.rb
546
552
  - lib/cyberweb/mouse/mouse.rb
@@ -797,6 +803,8 @@ files:
797
803
  - lib/cyberweb/webmin/comments_data
798
804
  - lib/cyberweb/webmin/constants.rb
799
805
  - lib/cyberweb/webmin/dictionary.cgi
806
+ - lib/cyberweb/webmin/simple_forum/index.cgi
807
+ - lib/cyberweb/webmin/simple_forum/simple_forum.rb
800
808
  - lib/cyberweb/webmin/sys_info.cgi
801
809
  - lib/cyberweb/webmin/webforum.cgi
802
810
  - lib/cyberweb/webmin/webmin.cgi
@@ -867,6 +875,7 @@ files:
867
875
  - test/simple_tests/testing_the_headers_tag.cgi
868
876
  - test/simple_tests/testing_the_html_colours.cgi
869
877
  - test/simple_tests/testing_the_info_box.cgi
878
+ - test/simple_tests/testing_the_javascript_component.cgi
870
879
  - test/simple_tests/testing_the_li_tag.cgi
871
880
  - test/simple_tests/testing_the_s2_method.rb
872
881
  - test/simple_tests/testing_the_select_tag.cgi
@@ -915,7 +924,7 @@ post_install_message: |2+
915
924
 
916
925
  For more information, have a look at:
917
926
 
918
- https://www.rubydoc.info/gems/cyberweb/0.5.225
927
+ https://www.rubydoc.info/gems/cyberweb/0.6.17
919
928
 
920
929
  rdoc_options: []
921
930
  require_paths: