cyberweb 0.12.35 → 0.13.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +220 -124
- data/bin/cyberweb_sanitize +1 -1
- data/bin/images_from_this_webpage +1 -1
- data/doc/README.gen +209 -98
- data/doc/configuration/configuration.md +7 -4
- data/doc/todo/todo_for_the_cyberweb_project.md +123 -133
- data/examples/html/underlined_text_example/underlined_text_example.html +40 -0
- data/examples/misc/table_example.rb +19 -17
- data/examples/objectified/objectified_caesar_cipher.cgi +73 -0
- data/images/cyberweb_theme.png +0 -0
- data/lib/cyberweb/REST/constants.rb +1 -1
- data/lib/cyberweb/base/base.rb +19 -27
- data/lib/cyberweb/base_module/base_module/base_module.rb +31 -16
- data/lib/cyberweb/base_module/colours/colours.rb +0 -8
- data/lib/cyberweb/cascading_style_sheets/margin.css +4 -0
- data/lib/cyberweb/cascading_style_sheets/misc.css +15 -0
- data/lib/cyberweb/cgi/cookie.rb +160 -156
- data/lib/cyberweb/cgi/core.rb +7 -7
- data/lib/cyberweb/cgi/query_extension.rb +1 -1
- data/lib/cyberweb/cgi/session/memory_store.rb +1 -1
- data/lib/cyberweb/cgi/session/pstore.rb +2 -2
- data/lib/cyberweb/cgi/session.rb +1 -1
- data/lib/cyberweb/cgi/util.rb +4 -1
- data/lib/cyberweb/cmd/cmd.rb +12 -10
- data/lib/cyberweb/coloured_tags/coloured_tags.rb +1 -1
- data/lib/cyberweb/colours/colour_chart.rb +1 -2
- data/lib/cyberweb/colours/colours.rb +1 -1
- data/lib/cyberweb/commandline/commandline_interface.rb +1 -1
- data/lib/cyberweb/configuration/load_the_configuration.rb +3 -1
- data/lib/cyberweb/constants/http_status_codes.rb +4 -1
- data/lib/cyberweb/constants/misc.rb +8 -6
- data/lib/cyberweb/constants/registered_html_tags.rb +6 -5
- data/lib/cyberweb/constants/user_x.rb +7 -0
- data/lib/cyberweb/css_manager/css_manager.rb +5 -2
- data/lib/cyberweb/encoding/encoding.rb +1 -1
- data/lib/cyberweb/erb/test.rhtml +7 -2
- data/lib/cyberweb/experimental/html_template_powered_by_rack.rb +3 -1
- data/lib/cyberweb/foto_gallery/foto_gallery.rb +3 -0
- data/lib/cyberweb/generator/cgi.rb +1 -1
- data/lib/cyberweb/html_template/html_template.rb +262 -253
- data/lib/cyberweb/images/images.rb +2 -2
- data/lib/cyberweb/images/remove_this_substring_from_all_images.rb +5 -1
- data/lib/cyberweb/images/standard_images/standard_images.html +3 -4
- data/lib/cyberweb/information/README.md +2 -2
- data/lib/cyberweb/information/information.cgi +1 -1
- data/lib/cyberweb/javascript/dragula_collection.rb +4 -1
- data/lib/cyberweb/javascript/javascript_magic.rb +2 -2
- data/lib/cyberweb/javascript/on_click_change_opacity.rb +2 -1
- data/lib/cyberweb/javascript/popup.rb +8 -1
- data/lib/cyberweb/javascript/snoweffect.rb +5 -1
- data/lib/cyberweb/javascript_code/custom_functions.js +50 -32
- data/lib/cyberweb/objectified/html_tags/README.md +7 -9
- data/lib/cyberweb/objectified/html_tags/a.rb +62 -3
- data/lib/cyberweb/objectified/html_tags/abbr.rb +33 -3
- data/lib/cyberweb/objectified/html_tags/audio.rb +33 -3
- data/lib/cyberweb/objectified/html_tags/base.rb +661 -588
- data/lib/cyberweb/objectified/html_tags/blockquote.rb +33 -3
- data/lib/cyberweb/objectified/html_tags/body.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/button.rb +75 -5
- data/lib/cyberweb/objectified/html_tags/canvas.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/cite.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/div.rb +70 -7
- data/lib/cyberweb/objectified/html_tags/embed.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/fieldset.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/figure.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/form.rb +78 -3
- data/lib/cyberweb/objectified/html_tags/h1.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/h2.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/h3.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/h4.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/h5.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/h6.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/head.rb +34 -1
- data/lib/cyberweb/objectified/html_tags/i.rb +112 -0
- data/lib/cyberweb/objectified/html_tags/img.rb +65 -18
- data/lib/cyberweb/objectified/html_tags/input.rb +86 -2
- data/lib/cyberweb/objectified/html_tags/label.rb +103 -0
- data/lib/cyberweb/objectified/html_tags/legend.rb +129 -0
- data/lib/cyberweb/objectified/html_tags/li.rb +111 -0
- data/lib/cyberweb/objectified/html_tags/map.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/meta.rb +13 -2
- data/lib/cyberweb/objectified/html_tags/nav.rb +111 -0
- data/lib/cyberweb/objectified/html_tags/object.rb +33 -3
- data/lib/cyberweb/objectified/html_tags/ol.rb +127 -0
- data/lib/cyberweb/objectified/html_tags/p.rb +33 -3
- data/lib/cyberweb/objectified/html_tags/pre.rb +41 -4
- data/lib/cyberweb/objectified/html_tags/progress.rb +43 -3
- data/lib/cyberweb/objectified/html_tags/section.rb +116 -0
- data/lib/cyberweb/objectified/html_tags/select.rb +34 -1
- data/lib/cyberweb/objectified/html_tags/span.rb +64 -5
- data/lib/cyberweb/objectified/html_tags/style.rb +9 -2
- data/lib/cyberweb/objectified/html_tags/table.rb +137 -3
- data/lib/cyberweb/objectified/html_tags/td.rb +135 -0
- data/lib/cyberweb/objectified/html_tags/textarea.rb +37 -3
- data/lib/cyberweb/objectified/html_tags/th.rb +114 -0
- data/lib/cyberweb/objectified/html_tags/thead.rb +114 -0
- data/lib/cyberweb/objectified/html_tags/title.rb +10 -2
- data/lib/cyberweb/objectified/html_tags/tr.rb +110 -0
- data/lib/cyberweb/objectified/html_tags/ul.rb +45 -4
- data/lib/cyberweb/objectified/shorter_helper_methods/shorter_helper_methods.rb +67 -46
- data/lib/cyberweb/oop.rb +9 -0
- data/lib/cyberweb/predefined_and_freeform_methods/hash_registered_extra_tags.rb +2 -0
- data/lib/cyberweb/predefined_and_freeform_methods/header.rb +4 -1
- data/lib/cyberweb/project/project.rb +0 -4
- data/lib/cyberweb/requires/remove_html.rb +1 -1
- data/lib/cyberweb/requires/require_the_cyberweb_project.rb +1 -9
- data/lib/cyberweb/route_handler/module/route_handler_module.rb +2 -1
- data/lib/cyberweb/standalone_classes/all_css_classes.rb +5 -2
- data/lib/cyberweb/standalone_classes/calculator.rb +3 -1
- data/lib/cyberweb/toplevel_methods/audio.rb +3 -1
- data/lib/cyberweb/toplevel_methods/csv.rb +1 -1
- data/lib/cyberweb/toplevel_methods/frames.rb +11 -3
- data/lib/cyberweb/toplevel_methods/greek_letters/greek_letters.rb +3 -0
- data/lib/cyberweb/toplevel_methods/hfin.rb +5 -1
- data/lib/cyberweb/toplevel_methods/html_tags/README.md +8 -7
- data/lib/cyberweb/toplevel_methods/html_tags/html_tags.rb +4211 -2827
- data/lib/cyberweb/toplevel_methods/html_tags/table.rb +1202 -0
- data/lib/cyberweb/toplevel_methods/javascript.rb +9 -1
- data/lib/cyberweb/toplevel_methods/jquery.rb +1 -1
- data/lib/cyberweb/toplevel_methods/{log_directory.rb → log_directory_and_logging.rb} +36 -1
- data/lib/cyberweb/toplevel_methods/params.rb +11 -11
- data/lib/cyberweb/toplevel_methods/random.rb +4 -3
- data/lib/cyberweb/toplevel_methods/registered_ids.rb +3 -0
- data/lib/cyberweb/toplevel_methods/return_head_start.rb +1 -3
- data/lib/cyberweb/toplevel_methods/return_html_start.rb +1 -3
- data/lib/cyberweb/toplevel_methods/sanitize_url.rb +2 -1
- data/lib/cyberweb/toplevel_methods/server_base_directory.rb +0 -1
- data/lib/cyberweb/toplevel_methods/textile.rb +2 -1
- data/lib/cyberweb/toplevel_methods/{misc.rb → toplevel_methods.rb} +1446 -807
- data/lib/cyberweb/toplevel_methods/video.rb +21 -3
- data/lib/cyberweb/toplevel_methods/write_what_into.rb +2 -2
- data/lib/cyberweb/utility_scripts/autogenerate_drop_shadow_rules/autogenerate_drop_shadow_rules.rb +2 -4
- data/lib/cyberweb/utility_scripts/booklet/booklet.rb +0 -4
- data/lib/cyberweb/utility_scripts/download_all_images_from_this_website.rb +1 -1
- data/lib/cyberweb/utility_scripts/{download_balloon_css.rb → download_balloon_css/download_balloon_css.rb} +1 -1
- data/lib/cyberweb/utility_scripts/images_to_html/images_to_html.rb +3 -0
- data/lib/cyberweb/utility_scripts/obtain_files_and_directories_from_this_path/obtain_files_and_directories_from_this_path.rb +183 -71
- data/lib/cyberweb/utility_scripts/pdf_to_html/pdf_to_html.rb +160 -65
- data/lib/cyberweb/version/version.rb +2 -2
- data/lib/cyberweb/web_images/map_symbol_to_image_location.rb +13 -2
- data/lib/cyberweb/web_object/web_object.rb +62 -20
- data/lib/cyberweb/web_scraper/scrape_this_url.rb +3 -1
- data/lib/cyberweb/webmin/biology_server.cgi +1 -1
- data/lib/cyberweb/webmin/calculator.cgi +1 -1
- data/lib/cyberweb/webmin/colour_chart.cgi +1 -1
- data/lib/cyberweb/webmin/comments.cgi +2 -2
- data/lib/cyberweb/webmin/constants.rb +1 -1
- data/lib/cyberweb/webmin/dictionary.cgi +2 -2
- data/lib/cyberweb/webmin/simple_forum/index.cgi +2 -2
- data/lib/cyberweb/webmin/sys_info.cgi +3 -3
- data/lib/cyberweb/webmin/webforum.cgi +1 -1
- data/lib/cyberweb/yaml/registered_html_tags.yml +3 -1
- data/test/simple_tests/testing_return_dataset_without_any_comments.rb +1 -1
- metadata +23 -57
- data/lib/cyberweb/html_tags/README.md +0 -3
- data/lib/cyberweb/html_tags/a.rb +0 -67
- data/lib/cyberweb/html_tags/accesskey.rb +0 -25
- data/lib/cyberweb/html_tags/blockquote.rb +0 -56
- data/lib/cyberweb/html_tags/body.rb +0 -14
- data/lib/cyberweb/html_tags/br.rb +0 -19
- data/lib/cyberweb/html_tags/button.rb +0 -150
- data/lib/cyberweb/html_tags/canvas.rb +0 -59
- data/lib/cyberweb/html_tags/chtml.rb +0 -14
- data/lib/cyberweb/html_tags/div.rb +0 -170
- data/lib/cyberweb/html_tags/fieldset.rb +0 -69
- data/lib/cyberweb/html_tags/figure.rb +0 -72
- data/lib/cyberweb/html_tags/form.rb +0 -203
- data/lib/cyberweb/html_tags/h1.rb +0 -77
- data/lib/cyberweb/html_tags/h2.rb +0 -81
- data/lib/cyberweb/html_tags/h3.rb +0 -60
- data/lib/cyberweb/html_tags/h4.rb +0 -66
- data/lib/cyberweb/html_tags/h5.rb +0 -64
- data/lib/cyberweb/html_tags/h6.rb +0 -60
- data/lib/cyberweb/html_tags/hr.rb +0 -22
- data/lib/cyberweb/html_tags/html_tags.rb +0 -267
- data/lib/cyberweb/html_tags/i.rb +0 -52
- data/lib/cyberweb/html_tags/img.rb +0 -294
- data/lib/cyberweb/html_tags/input.rb +0 -354
- data/lib/cyberweb/html_tags/label.rb +0 -65
- data/lib/cyberweb/html_tags/legend.rb +0 -56
- data/lib/cyberweb/html_tags/li.rb +0 -67
- data/lib/cyberweb/html_tags/map.rb +0 -38
- data/lib/cyberweb/html_tags/nav.rb +0 -63
- data/lib/cyberweb/html_tags/object.rb +0 -57
- data/lib/cyberweb/html_tags/ol.rb +0 -57
- data/lib/cyberweb/html_tags/option.rb +0 -64
- data/lib/cyberweb/html_tags/p.rb +0 -88
- data/lib/cyberweb/html_tags/pre.rb +0 -162
- data/lib/cyberweb/html_tags/section.rb +0 -33
- data/lib/cyberweb/html_tags/select.rb +0 -104
- data/lib/cyberweb/html_tags/span.rb +0 -344
- data/lib/cyberweb/html_tags/strong.rb +0 -42
- data/lib/cyberweb/html_tags/table.rb +0 -284
- data/lib/cyberweb/html_tags/tbody.rb +0 -26
- data/lib/cyberweb/html_tags/td.rb +0 -212
- data/lib/cyberweb/html_tags/textarea.rb +0 -173
- data/lib/cyberweb/html_tags/th.rb +0 -70
- data/lib/cyberweb/html_tags/thead.rb +0 -41
- data/lib/cyberweb/html_tags/tr.rb +0 -99
- data/lib/cyberweb/html_tags/ul.rb +0 -51
- data/lib/cyberweb/requires/require_html_tags_files.rb +0 -23
- data/lib/cyberweb/toplevel_methods/logging.rb +0 -42
- data/lib/cyberweb/web_base/web_base.rb +0 -33
@@ -14,6 +14,32 @@ module Objectified::HtmlTags
|
|
14
14
|
|
15
15
|
class Blockquote < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Blockquote
|
16
16
|
|
17
|
+
# ========================================================================= #
|
18
|
+
# === @css_class
|
19
|
+
# ========================================================================= #
|
20
|
+
@css_class = nil
|
21
|
+
|
22
|
+
# ========================================================================= #
|
23
|
+
# === Cyberweb::Objectified::HtmlTags::Blockquote.reset_css_class
|
24
|
+
# ========================================================================= #
|
25
|
+
def self.reset_css_class
|
26
|
+
@css_class = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
# ========================================================================= #
|
30
|
+
# === Cyberweb::Objectified::HtmlTags::Blockquote.set_css_class
|
31
|
+
# ========================================================================= #
|
32
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
33
|
+
@css_class = i
|
34
|
+
end
|
35
|
+
|
36
|
+
# ========================================================================= #
|
37
|
+
# === Cyberweb::Objectified::HtmlTags::Blockquote.css_class?
|
38
|
+
# ========================================================================= #
|
39
|
+
def self.css_class?
|
40
|
+
@css_class
|
41
|
+
end
|
42
|
+
|
17
43
|
# ========================================================================= #
|
18
44
|
# === initialize
|
19
45
|
#
|
@@ -24,11 +50,11 @@ class Blockquote < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objecti
|
|
24
50
|
# ========================================================================= #
|
25
51
|
def initialize(
|
26
52
|
use_this_text = '',
|
27
|
-
optional_css_class =
|
53
|
+
optional_css_class = Blockquote.css_class?,
|
28
54
|
optional_id = nil,
|
29
55
|
optional_css_style = nil
|
30
56
|
)
|
31
|
-
|
57
|
+
try_to_register_this_tag(self)
|
32
58
|
reset
|
33
59
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
34
60
|
set_content(use_this_text)
|
@@ -76,7 +102,11 @@ class Blockquote < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objecti
|
|
76
102
|
return raw_result?
|
77
103
|
end
|
78
104
|
|
79
|
-
end; end
|
105
|
+
end; end
|
106
|
+
|
107
|
+
Blockquote = ::Cyberweb::Objectified::HtmlTags::Blockquote
|
108
|
+
|
109
|
+
end
|
80
110
|
|
81
111
|
# =========================================================================== #
|
82
112
|
# Testing the <blockquote> tag next:
|
@@ -14,6 +14,39 @@ module Objectified::HtmlTags
|
|
14
14
|
|
15
15
|
class Body < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Body
|
16
16
|
|
17
|
+
# ========================================================================= #
|
18
|
+
# === @css_class
|
19
|
+
# ========================================================================= #
|
20
|
+
@css_class = nil
|
21
|
+
|
22
|
+
# ========================================================================= #
|
23
|
+
# === Cyberweb::Objectified::HtmlTags::Body.reset_css_class
|
24
|
+
# ========================================================================= #
|
25
|
+
def self.reset_css_class
|
26
|
+
@css_class = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
# ========================================================================= #
|
30
|
+
# === Cyberweb::Objectified::HtmlTags::Body.clear
|
31
|
+
# ========================================================================= #
|
32
|
+
def self.clear
|
33
|
+
Body.set_css_class('')
|
34
|
+
end
|
35
|
+
|
36
|
+
# ========================================================================= #
|
37
|
+
# === Cyberweb::Objectified::HtmlTags::Body.set_css_class
|
38
|
+
# ========================================================================= #
|
39
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
40
|
+
@css_class = i
|
41
|
+
end
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# === Cyberweb::Objectified::HtmlTags::Body.css_class?
|
45
|
+
# ========================================================================= #
|
46
|
+
def self.css_class?
|
47
|
+
@css_class
|
48
|
+
end
|
49
|
+
|
17
50
|
# ========================================================================= #
|
18
51
|
# === initialize
|
19
52
|
#
|
@@ -24,12 +57,12 @@ class Body < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
|
|
24
57
|
# ========================================================================= #
|
25
58
|
def initialize(
|
26
59
|
use_this_text = '',
|
27
|
-
optional_css_class =
|
60
|
+
optional_css_class = Body.css_class?,
|
28
61
|
optional_id = nil,
|
29
62
|
optional_css_style = nil,
|
30
63
|
&block
|
31
64
|
)
|
32
|
-
|
65
|
+
try_to_register_this_tag(self)
|
33
66
|
reset
|
34
67
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
35
68
|
if block_given?
|
@@ -113,7 +146,14 @@ class Body < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
|
|
113
146
|
return raw_result?
|
114
147
|
end
|
115
148
|
|
116
|
-
end; end
|
149
|
+
end; end
|
150
|
+
|
151
|
+
# =========================================================================== #
|
152
|
+
# === Cyberweb::Objectified::HtmlTags::Body
|
153
|
+
# =========================================================================== #
|
154
|
+
Body = ::Cyberweb::Objectified::HtmlTags::Body
|
155
|
+
|
156
|
+
end
|
117
157
|
|
118
158
|
# =========================================================================== #
|
119
159
|
# Testing the <body> tag next:
|
@@ -17,25 +17,85 @@ module Objectified::HtmlTags
|
|
17
17
|
|
18
18
|
class Button < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Button
|
19
19
|
|
20
|
+
# ========================================================================= #
|
21
|
+
# === @css_class
|
22
|
+
# ========================================================================= #
|
23
|
+
@css_class = nil
|
24
|
+
|
25
|
+
# ========================================================================= #
|
26
|
+
# === Cyberweb::Objectified::HtmlTags::Button.reset_css_class
|
27
|
+
# ========================================================================= #
|
28
|
+
def self.reset_css_class
|
29
|
+
@css_class = nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# ========================================================================= #
|
33
|
+
# === Cyberweb::Objectified::HtmlTags::Button.clear
|
34
|
+
# ========================================================================= #
|
35
|
+
def self.clear
|
36
|
+
Button.set_css_class('')
|
37
|
+
end
|
38
|
+
|
39
|
+
# ========================================================================= #
|
40
|
+
# === Cyberweb::Objectified::HtmlTags::Button.set_css_class
|
41
|
+
# ========================================================================= #
|
42
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
43
|
+
@css_class = i
|
44
|
+
end
|
45
|
+
|
46
|
+
# ========================================================================= #
|
47
|
+
# === Cyberweb::Objectified::HtmlTags::Button.css_class?
|
48
|
+
# ========================================================================= #
|
49
|
+
def self.css_class?
|
50
|
+
@css_class
|
51
|
+
end
|
52
|
+
|
20
53
|
# ========================================================================= #
|
21
54
|
# === initialize
|
22
55
|
#
|
23
56
|
# Usage example:
|
24
57
|
#
|
25
58
|
# Cyberweb::Objectified::HtmlTags::Button.new(i)
|
59
|
+
# Cyberweb::Objectified::HtmlTags::Button.new('Click me', id: 'test_button')
|
26
60
|
#
|
27
61
|
# ========================================================================= #
|
28
62
|
def initialize(
|
29
63
|
use_this_text = '',
|
30
|
-
optional_css_class =
|
64
|
+
optional_css_class = Button.css_class?,
|
31
65
|
optional_id = nil,
|
32
66
|
optional_css_style = nil
|
33
67
|
)
|
34
|
-
|
68
|
+
try_to_register_this_tag(self)
|
35
69
|
reset
|
36
70
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
37
71
|
set_content(use_this_text)
|
38
|
-
|
72
|
+
if optional_css_class
|
73
|
+
# ===================================================================== #
|
74
|
+
# === Handle Hashes next
|
75
|
+
# ===================================================================== #
|
76
|
+
if optional_css_class.is_a?(Hash)
|
77
|
+
_ = optional_css_class # Shorter key.
|
78
|
+
# =================================================================== #
|
79
|
+
# === :id
|
80
|
+
# =================================================================== #
|
81
|
+
if _.has_key? :id
|
82
|
+
optional_id = _.delete(:id)
|
83
|
+
end
|
84
|
+
# =================================================================== #
|
85
|
+
# === :css_style
|
86
|
+
# =================================================================== #
|
87
|
+
if _.has_key? :css_style
|
88
|
+
optional_css_style = _.delete(:css_style)
|
89
|
+
end
|
90
|
+
if _.empty?
|
91
|
+
optional_css_class = Button.css_class?
|
92
|
+
end
|
93
|
+
end
|
94
|
+
# ===================================================================== #
|
95
|
+
# Handle Hashes as well:
|
96
|
+
# ===================================================================== #
|
97
|
+
set_CSS_class(optional_css_class)
|
98
|
+
end
|
39
99
|
set_id(optional_id) if optional_id
|
40
100
|
set_CSS_style(optional_css_style) if optional_css_style
|
41
101
|
end
|
@@ -86,7 +146,13 @@ class Button < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified
|
|
86
146
|
(@internal_hash[:on_clicked].is_a?(String) or
|
87
147
|
@internal_hash[:on_clicked].is_a?(Symbol)
|
88
148
|
)
|
89
|
-
|
149
|
+
append_this = ' onclick="'+@internal_hash[:on_clicked].to_s.dup+'('
|
150
|
+
if @internal_hash[:arguments_to_the_on_clicked_function] and
|
151
|
+
!@internal_hash[:arguments_to_the_on_clicked_function].empty?
|
152
|
+
append_this << @internal_hash[:arguments_to_the_on_clicked_function].join
|
153
|
+
end
|
154
|
+
append_this << ')"'
|
155
|
+
append_onto_the_result append_this
|
90
156
|
end
|
91
157
|
append_onto_the_result ">\n"
|
92
158
|
append_onto_the_result content?.to_s
|
@@ -94,7 +160,11 @@ class Button < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified
|
|
94
160
|
return raw_result?
|
95
161
|
end
|
96
162
|
|
97
|
-
end; end
|
163
|
+
end; end
|
164
|
+
|
165
|
+
Button = ::Cyberweb::Objectified::HtmlTags::Button
|
166
|
+
|
167
|
+
end
|
98
168
|
|
99
169
|
# =========================================================================== #
|
100
170
|
# Testing the <button> tag next:
|
@@ -14,6 +14,39 @@ module Objectified::HtmlTags
|
|
14
14
|
|
15
15
|
class Canvas < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Canvas
|
16
16
|
|
17
|
+
# ========================================================================= #
|
18
|
+
# === @css_class
|
19
|
+
# ========================================================================= #
|
20
|
+
@css_class = nil
|
21
|
+
|
22
|
+
# ========================================================================= #
|
23
|
+
# === Cyberweb::Objectified::HtmlTags::Canvas.reset_css_class
|
24
|
+
# ========================================================================= #
|
25
|
+
def self.reset_css_class
|
26
|
+
@css_class = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
# ========================================================================= #
|
30
|
+
# === Cyberweb::Objectified::HtmlTags::Canvas.clear
|
31
|
+
# ========================================================================= #
|
32
|
+
def self.clear
|
33
|
+
Canvas.set_css_class('')
|
34
|
+
end
|
35
|
+
|
36
|
+
# ========================================================================= #
|
37
|
+
# === Cyberweb::Objectified::HtmlTags::Canvas.set_css_class
|
38
|
+
# ========================================================================= #
|
39
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
40
|
+
@css_class = i
|
41
|
+
end
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# === Cyberweb::Objectified::HtmlTags::Canvas.css_class?
|
45
|
+
# ========================================================================= #
|
46
|
+
def self.css_class?
|
47
|
+
@css_class
|
48
|
+
end
|
49
|
+
|
17
50
|
# ========================================================================= #
|
18
51
|
# === initialize
|
19
52
|
#
|
@@ -24,11 +57,11 @@ class Canvas < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified
|
|
24
57
|
# ========================================================================= #
|
25
58
|
def initialize(
|
26
59
|
use_this_text = '',
|
27
|
-
optional_css_class =
|
60
|
+
optional_css_class = Canvas.css_class?,
|
28
61
|
optional_id = nil,
|
29
62
|
optional_css_style = nil
|
30
63
|
)
|
31
|
-
|
64
|
+
try_to_register_this_tag(self)
|
32
65
|
reset
|
33
66
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
34
67
|
set_content(use_this_text)
|
@@ -125,7 +158,14 @@ context.fillRect('+fill_colour?+');
|
|
125
158
|
return raw_result?
|
126
159
|
end
|
127
160
|
|
128
|
-
end; end
|
161
|
+
end; end
|
162
|
+
|
163
|
+
# =========================================================================== #
|
164
|
+
# === Cyberweb::Objectified::HtmlTags::Canvas
|
165
|
+
# =========================================================================== #
|
166
|
+
Canvas = ::Cyberweb::Objectified::HtmlTags::Canvas
|
167
|
+
|
168
|
+
end
|
129
169
|
|
130
170
|
# =========================================================================== #
|
131
171
|
# Testing the <canvas> tag next:
|
@@ -14,6 +14,39 @@ module Objectified::HtmlTags
|
|
14
14
|
|
15
15
|
class Cite < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Cite
|
16
16
|
|
17
|
+
# ========================================================================= #
|
18
|
+
# === @css_class
|
19
|
+
# ========================================================================= #
|
20
|
+
@css_class = nil
|
21
|
+
|
22
|
+
# ========================================================================= #
|
23
|
+
# === Cyberweb::Objectified::HtmlTags::Cite.reset_css_class
|
24
|
+
# ========================================================================= #
|
25
|
+
def self.reset_css_class
|
26
|
+
@css_class = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
# ========================================================================= #
|
30
|
+
# === Cyberweb::Objectified::HtmlTags::Cite.clear
|
31
|
+
# ========================================================================= #
|
32
|
+
def self.clear
|
33
|
+
Cite.set_css_class('')
|
34
|
+
end
|
35
|
+
|
36
|
+
# ========================================================================= #
|
37
|
+
# === Cyberweb::Objectified::HtmlTags::Cite.set_css_class
|
38
|
+
# ========================================================================= #
|
39
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
40
|
+
@css_class = i
|
41
|
+
end
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# === Cyberweb::Objectified::HtmlTags::Cite.css_class?
|
45
|
+
# ========================================================================= #
|
46
|
+
def self.css_class?
|
47
|
+
@css_class
|
48
|
+
end
|
49
|
+
|
17
50
|
# ========================================================================= #
|
18
51
|
# === initialize
|
19
52
|
#
|
@@ -24,11 +57,11 @@ class Cite < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
|
|
24
57
|
# ========================================================================= #
|
25
58
|
def initialize(
|
26
59
|
use_this_text = '',
|
27
|
-
optional_css_class =
|
60
|
+
optional_css_class = Cite.css_class?,
|
28
61
|
optional_id = nil,
|
29
62
|
optional_css_style = nil
|
30
63
|
)
|
31
|
-
|
64
|
+
try_to_register_this_tag(self)
|
32
65
|
reset
|
33
66
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
34
67
|
set_content(use_this_text)
|
@@ -58,7 +91,14 @@ class Cite < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::
|
|
58
91
|
return raw_result?
|
59
92
|
end
|
60
93
|
|
61
|
-
end; end
|
94
|
+
end; end
|
95
|
+
|
96
|
+
# =========================================================================== #
|
97
|
+
# === Cyberweb::Objectified::HtmlTags::Cite
|
98
|
+
# =========================================================================== #
|
99
|
+
Cite = ::Cyberweb::Objectified::HtmlTags::Cite
|
100
|
+
|
101
|
+
end
|
62
102
|
|
63
103
|
# =========================================================================== #
|
64
104
|
# Testing the <cite> tag next:
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# === Cyberweb::Objectified::HtmlTags::Div
|
6
6
|
# =========================================================================== #
|
7
7
|
# require 'cyberweb/objectified/html_tags/div.rb'
|
8
|
-
# Cyberweb::Objectified::HtmlTags::Div.new
|
8
|
+
# Cyberweb::Objectified::HtmlTags::Div.new
|
9
9
|
# =========================================================================== #
|
10
10
|
require 'cyberweb/objectified/html_tags/base.rb'
|
11
11
|
|
@@ -15,6 +15,48 @@ module Objectified::HtmlTags
|
|
15
15
|
|
16
16
|
class Div < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Div
|
17
17
|
|
18
|
+
# ========================================================================= #
|
19
|
+
# === @css_class
|
20
|
+
# ========================================================================= #
|
21
|
+
@css_class = nil
|
22
|
+
|
23
|
+
# ========================================================================= #
|
24
|
+
# === Cyberweb::Objectified::HtmlTags::Div.reset_css_class
|
25
|
+
# ========================================================================= #
|
26
|
+
def self.reset_css_class
|
27
|
+
@css_class = nil
|
28
|
+
end
|
29
|
+
|
30
|
+
# ========================================================================= #
|
31
|
+
# === Cyberweb::Objectified::HtmlTags::Div.clear
|
32
|
+
# ========================================================================= #
|
33
|
+
def self.clear
|
34
|
+
Div.set_css_class('')
|
35
|
+
end
|
36
|
+
|
37
|
+
# ========================================================================= #
|
38
|
+
# === Cyberweb::Objectified::HtmlTags::Div.set_css_class
|
39
|
+
#
|
40
|
+
# Usage example for setting to a default CSS class to use in
|
41
|
+
# <div> tags goes like so:
|
42
|
+
#
|
43
|
+
# Cyberweb::Objectified::HtmlTags::Div.set_css_class 'red'
|
44
|
+
# Cyberweb::Div.set_css_class 'red'
|
45
|
+
#
|
46
|
+
# This will then have set a new default for all <div> tags, as they
|
47
|
+
# will be red from this point on.
|
48
|
+
# ========================================================================= #
|
49
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
50
|
+
@css_class = i
|
51
|
+
end
|
52
|
+
|
53
|
+
# ========================================================================= #
|
54
|
+
# === Cyberweb::Objectified::HtmlTags::Div.css_class?
|
55
|
+
# ========================================================================= #
|
56
|
+
def self.css_class?
|
57
|
+
@css_class
|
58
|
+
end
|
59
|
+
|
18
60
|
# ========================================================================= #
|
19
61
|
# === initialize
|
20
62
|
#
|
@@ -25,12 +67,12 @@ class Div < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::H
|
|
25
67
|
# ========================================================================= #
|
26
68
|
def initialize(
|
27
69
|
use_this_text = '',
|
28
|
-
optional_css_class =
|
70
|
+
optional_css_class = Div.css_class?,
|
29
71
|
optional_id = nil,
|
30
72
|
optional_css_style = nil,
|
31
73
|
&block
|
32
74
|
)
|
33
|
-
|
75
|
+
try_to_register_this_tag(self)
|
34
76
|
reset
|
35
77
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
36
78
|
set_content(use_this_text)
|
@@ -169,16 +211,34 @@ class Div < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::H
|
|
169
211
|
|
170
212
|
end
|
171
213
|
|
214
|
+
# =========================================================================== #
|
215
|
+
# === Cyberweb::Objectified::HtmlTags::Window
|
216
|
+
# =========================================================================== #
|
172
217
|
Window = Div # Add an "alias" here.
|
218
|
+
|
219
|
+
# =========================================================================== #
|
220
|
+
# === Cyberweb::Objectified::HtmlTags::Hbox
|
221
|
+
# =========================================================================== #
|
173
222
|
Hbox = Div # And another "alias" there.
|
174
223
|
|
175
|
-
end
|
224
|
+
end
|
176
225
|
|
177
226
|
# =========================================================================== #
|
178
|
-
#
|
227
|
+
# === Cyberweb::Objectified::HtmlTags::Div
|
228
|
+
# =========================================================================== #
|
229
|
+
Div = ::Cyberweb::Objectified::HtmlTags::Div
|
230
|
+
|
231
|
+
Window = Div # Add an "alias" here.
|
232
|
+
Hbox = Div # And another "alias" there.
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
# =========================================================================== #
|
237
|
+
# Testing the <div> tag next:
|
179
238
|
# =========================================================================== #
|
180
239
|
if __FILE__ == $PROGRAM_NAME
|
181
240
|
alias e puts
|
241
|
+
require 'colours'
|
182
242
|
_ = Cyberweb::Objectified::HtmlTags::Div.new(
|
183
243
|
'This is the content for the div-tag.'
|
184
244
|
)
|
@@ -199,8 +259,11 @@ if __FILE__ == $PROGRAM_NAME
|
|
199
259
|
_.css_style = 'font-size: 3em'
|
200
260
|
_.horizontal_separator
|
201
261
|
e _
|
202
|
-
e 'And now testing Hbox:'
|
262
|
+
e 'And now testing Hbox:' # Test Hbox next:
|
203
263
|
e
|
204
264
|
_ = Cyberweb::Objectified::HtmlTags::Hbox.new('hey there')
|
205
|
-
e _.minimal
|
265
|
+
e ::Colours.royalblue(_.minimal)
|
266
|
+
e
|
267
|
+
_ = Cyberweb::Hbox.new('hey there')
|
268
|
+
e ::Colours.tomato(_.minimal)
|
206
269
|
end
|
@@ -24,6 +24,39 @@ module Objectified::HtmlTags
|
|
24
24
|
|
25
25
|
class Embed < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Embed
|
26
26
|
|
27
|
+
# ========================================================================= #
|
28
|
+
# === @css_class
|
29
|
+
# ========================================================================= #
|
30
|
+
@css_class = nil
|
31
|
+
|
32
|
+
# ========================================================================= #
|
33
|
+
# === Cyberweb::Objectified::HtmlTags::Embed.reset_css_class
|
34
|
+
# ========================================================================= #
|
35
|
+
def self.reset_css_class
|
36
|
+
@css_class = nil
|
37
|
+
end
|
38
|
+
|
39
|
+
# ========================================================================= #
|
40
|
+
# === Cyberweb::Objectified::HtmlTags::Embed.clear
|
41
|
+
# ========================================================================= #
|
42
|
+
def self.clear
|
43
|
+
Embed.set_css_class('')
|
44
|
+
end
|
45
|
+
|
46
|
+
# ========================================================================= #
|
47
|
+
# === Cyberweb::Objectified::HtmlTags::Embed.set_css_class
|
48
|
+
# ========================================================================= #
|
49
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
50
|
+
@css_class = i
|
51
|
+
end
|
52
|
+
|
53
|
+
# ========================================================================= #
|
54
|
+
# === Cyberweb::Objectified::HtmlTags::Embed.css_class?
|
55
|
+
# ========================================================================= #
|
56
|
+
def self.css_class?
|
57
|
+
@css_class
|
58
|
+
end
|
59
|
+
|
27
60
|
# ========================================================================= #
|
28
61
|
# === initialize
|
29
62
|
#
|
@@ -34,11 +67,11 @@ class Embed < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
|
|
34
67
|
# ========================================================================= #
|
35
68
|
def initialize(
|
36
69
|
use_this_text = '',
|
37
|
-
optional_css_class =
|
70
|
+
optional_css_class = Embed.css_class?,
|
38
71
|
optional_id = nil,
|
39
72
|
optional_css_style = nil
|
40
73
|
)
|
41
|
-
|
74
|
+
try_to_register_this_tag(self)
|
42
75
|
reset
|
43
76
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
44
77
|
set_content(use_this_text)
|
@@ -96,7 +129,14 @@ class Embed < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified:
|
|
96
129
|
return raw_result?
|
97
130
|
end
|
98
131
|
|
99
|
-
end; end
|
132
|
+
end; end
|
133
|
+
|
134
|
+
# =========================================================================== #
|
135
|
+
# === Cyberweb::Objectified::HtmlTags::Embed
|
136
|
+
# =========================================================================== #
|
137
|
+
Embed = ::Cyberweb::Objectified::HtmlTags::Embed
|
138
|
+
|
139
|
+
end
|
100
140
|
|
101
141
|
# =========================================================================== #
|
102
142
|
# Testing the <embed> tag next:
|
@@ -17,6 +17,39 @@ module Objectified::HtmlTags
|
|
17
17
|
|
18
18
|
class Fieldset < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectified::HtmlTags::Fieldset
|
19
19
|
|
20
|
+
# ========================================================================= #
|
21
|
+
# === @css_class
|
22
|
+
# ========================================================================= #
|
23
|
+
@css_class = nil
|
24
|
+
|
25
|
+
# ========================================================================= #
|
26
|
+
# === Cyberweb::Objectified::HtmlTags::Fieldset.reset_css_class
|
27
|
+
# ========================================================================= #
|
28
|
+
def self.reset_css_class
|
29
|
+
@css_class = nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# ========================================================================= #
|
33
|
+
# === Cyberweb::Objectified::HtmlTags::Fieldset.clear
|
34
|
+
# ========================================================================= #
|
35
|
+
def self.clear
|
36
|
+
Fieldset.set_css_class('')
|
37
|
+
end
|
38
|
+
|
39
|
+
# ========================================================================= #
|
40
|
+
# === Cyberweb::Objectified::HtmlTags::Fieldset.set_css_class
|
41
|
+
# ========================================================================= #
|
42
|
+
def self.set_css_class(i = DEFAULT_CSS_CLASS)
|
43
|
+
@css_class = i
|
44
|
+
end
|
45
|
+
|
46
|
+
# ========================================================================= #
|
47
|
+
# === Cyberweb::Objectified::HtmlTags::Fieldset.css_class?
|
48
|
+
# ========================================================================= #
|
49
|
+
def self.css_class?
|
50
|
+
@css_class
|
51
|
+
end
|
52
|
+
|
20
53
|
# ========================================================================= #
|
21
54
|
# === initialize
|
22
55
|
#
|
@@ -27,11 +60,11 @@ class Fieldset < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectifi
|
|
27
60
|
# ========================================================================= #
|
28
61
|
def initialize(
|
29
62
|
use_this_text = '',
|
30
|
-
optional_css_class =
|
63
|
+
optional_css_class = Fieldset.css_class?,
|
31
64
|
optional_id = nil,
|
32
65
|
optional_css_style = nil
|
33
66
|
)
|
34
|
-
|
67
|
+
try_to_register_this_tag(self)
|
35
68
|
reset
|
36
69
|
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
|
37
70
|
set_content(use_this_text)
|
@@ -69,7 +102,14 @@ class Fieldset < Cyberweb::Objectified::HtmlTags::Base # === Cyberweb::Objectifi
|
|
69
102
|
return raw_result?
|
70
103
|
end
|
71
104
|
|
72
|
-
end; end
|
105
|
+
end; end
|
106
|
+
|
107
|
+
# =========================================================================== #
|
108
|
+
# === Cyberweb::Objectified::HtmlTags::Fieldset
|
109
|
+
# =========================================================================== #
|
110
|
+
Fieldset = ::Cyberweb::Objectified::HtmlTags::Fieldset
|
111
|
+
|
112
|
+
end
|
73
113
|
|
74
114
|
# =========================================================================== #
|
75
115
|
# Testing the <fieldset> tag next:
|