cyberweb 0.12.35 → 0.13.12
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 +383 -311
- 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 +184 -72
- data/lib/cyberweb/utility_scripts/pdf_to_html/pdf_to_html.rb +161 -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 +65 -67
- 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
@@ -12,8 +12,8 @@ module Cyberweb
|
|
12
12
|
# ========================================================================= #
|
13
13
|
# Constants specific to Video things go into this file as well.
|
14
14
|
# ========================================================================= #
|
15
|
-
DEFAULT_VIDEO_WIDTH = '
|
16
|
-
DEFAULT_VIDEO_HEIGHT = '
|
15
|
+
DEFAULT_VIDEO_WIDTH = '480'
|
16
|
+
DEFAULT_VIDEO_HEIGHT = '340'
|
17
17
|
|
18
18
|
# ========================================================================= #
|
19
19
|
# === Cyberweb.youtube (youtube tag)
|
@@ -414,6 +414,24 @@ EOF
|
|
414
414
|
ee _
|
415
415
|
end
|
416
416
|
|
417
|
+
# ========================================================================= #
|
418
|
+
# === Cyberweb.is_a_video_file?
|
419
|
+
#
|
420
|
+
# This method can be used to determine whether xyz is a video file or
|
421
|
+
# whether it is not.
|
422
|
+
#
|
423
|
+
# Usage example:
|
424
|
+
#
|
425
|
+
# Cyberweb.is_a_video_file?('/tmp/foobar.avi')
|
426
|
+
#
|
427
|
+
# ========================================================================= #
|
428
|
+
def self.is_a_video_file?(
|
429
|
+
this_file = 'foobar.mp4'
|
430
|
+
)
|
431
|
+
array = %w( .avi .mp4 .mkv .webm )
|
432
|
+
array.include? File.extname(this_file)
|
433
|
+
end
|
434
|
+
|
417
435
|
# ========================================================================= #
|
418
436
|
# === imdb (imdb tag)
|
419
437
|
#
|
@@ -423,7 +441,7 @@ EOF
|
|
423
441
|
title,
|
424
442
|
where_precisely
|
425
443
|
)
|
426
|
-
base_url = '
|
444
|
+
base_url = 'https://www.imdb.com/title/'
|
427
445
|
string_link(
|
428
446
|
base_url+where_precisely,
|
429
447
|
title
|
@@ -20,8 +20,8 @@ module Cyberweb
|
|
20
20
|
file.write(what) # Write the new file here.
|
21
21
|
}
|
22
22
|
rescue Errno::EACCES => error # Need to rescue permission errors.
|
23
|
-
puts 'When trying to use Cyberweb.write_what_into()
|
24
|
-
'access-error occurred:'
|
23
|
+
puts 'When trying to use the method Cyberweb.write_what_into() '\
|
24
|
+
'an access-error occurred:'
|
25
25
|
pp error
|
26
26
|
pp `whoami` # This line will only work on linux-like systems.
|
27
27
|
exit
|
data/lib/cyberweb/utility_scripts/autogenerate_drop_shadow_rules/autogenerate_drop_shadow_rules.rb
CHANGED
@@ -7,16 +7,14 @@
|
|
7
7
|
# This class is only useful on my home system really. It will generate
|
8
8
|
# all drop-shadow CSS rules that are part of the cyberweb framework.
|
9
9
|
# =========================================================================== #
|
10
|
-
# require 'cyberweb/utility_scripts/
|
10
|
+
# require 'cyberweb/utility_scripts/autogenerate_drop_shadow_rules/autogenerate_drop_shadow_rules.rb'
|
11
11
|
# webpage = Cyberweb::AutogenerateDropShadowRules.new
|
12
12
|
# ============================================================================ #
|
13
13
|
require 'cyberweb/base/base.rb'
|
14
14
|
|
15
15
|
module Cyberweb
|
16
16
|
|
17
|
-
class AutogenerateDropShadowRules < ::Cyberweb::Base
|
18
|
-
|
19
|
-
require 'cyberweb/utility_scripts/images_to_html/misc.rb'
|
17
|
+
class AutogenerateDropShadowRules < ::Cyberweb::Base # === Cyberweb::AutogenerateDropShadowRules
|
20
18
|
|
21
19
|
# ========================================================================= #
|
22
20
|
# === initialize
|
@@ -19,10 +19,6 @@ module Cyberweb
|
|
19
19
|
|
20
20
|
class Booklet < Base # === Cyberweb::Booklet
|
21
21
|
|
22
|
-
alias e puts
|
23
|
-
|
24
|
-
require 'cyberweb/requires/require_the_html_template.rb'
|
25
|
-
|
26
22
|
# ========================================================================= #
|
27
23
|
# === initialize
|
28
24
|
# ========================================================================= #
|
@@ -12,7 +12,7 @@ module Cyberweb
|
|
12
12
|
|
13
13
|
class DownloadAllImagesFromThisWebsite < Base # === Cyberweb::DownloadAllImagesFromThisWebsite
|
14
14
|
|
15
|
-
require 'cyberweb/toplevel_methods/
|
15
|
+
require 'cyberweb/toplevel_methods/toplevel_methods.rb'
|
16
16
|
require 'cyberweb/toplevel_methods/sort_this_array_by_time.rb'
|
17
17
|
|
18
18
|
require 'uri'
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# Cyberweb::DownloadBalloonCss.new
|
12
12
|
#
|
13
13
|
# =========================================================================== #
|
14
|
-
# require 'cyberweb/utility_scripts/download_balloon_css.rb'
|
14
|
+
# require 'cyberweb/utility_scripts/download_balloon_css/download_balloon_css.rb'
|
15
15
|
# =========================================================================== #
|
16
16
|
require 'cyberweb/base/base.rb'
|
17
17
|
|
@@ -264,6 +264,9 @@ class ImagesToHtml < ::Cyberweb::ObtainFilesAndDirectoriesFromThisPath # === Cyb
|
|
264
264
|
'</b> <b>kb</b>'.dup
|
265
265
|
end
|
266
266
|
if display_width_and_height_of_the_image?
|
267
|
+
# ============================================================= #
|
268
|
+
# Add the width and height of the image next:
|
269
|
+
# ============================================================= #
|
267
270
|
filesize_string << ', <b>'+width_of_the_image+'x'+
|
268
271
|
height_of_the_image.to_s+'px</b>'
|
269
272
|
end
|
@@ -211,10 +211,6 @@ a:hover {
|
|
211
211
|
# ======================================================================= #
|
212
212
|
@internal_hash[:show_year_in_the_header] = true
|
213
213
|
# ======================================================================= #
|
214
|
-
# === :be_verbose
|
215
|
-
# ======================================================================= #
|
216
|
-
@internal_hash[:be_verbose] = BE_VERBOSE
|
217
|
-
# ======================================================================= #
|
218
214
|
# === :sort_how
|
219
215
|
#
|
220
216
|
# The next variable determines if, and how, we should sort on the
|
@@ -247,6 +243,13 @@ a:hover {
|
|
247
243
|
# ======================================================================= #
|
248
244
|
@internal_hash[:content_of_the_HTML_page] = ''.dup
|
249
245
|
# ======================================================================= #
|
246
|
+
# === :add_date_in_the_lower_part_of_the_webpage
|
247
|
+
#
|
248
|
+
# Add dates in the lower part of the webpage, if the following
|
249
|
+
# variable is set to true. It will be false initially.
|
250
|
+
# ======================================================================= #
|
251
|
+
@internal_hash[:add_date_in_the_lower_part_of_the_webpage] = false
|
252
|
+
# ======================================================================= #
|
250
253
|
# === :files
|
251
254
|
#
|
252
255
|
# This Array will contain all the different files that were found
|
@@ -278,12 +281,6 @@ a:hover {
|
|
278
281
|
# ======================================================================= #
|
279
282
|
@internal_hash[:make_use_of_a_go_down_one_level_link] = true
|
280
283
|
# ======================================================================= #
|
281
|
-
# === :use_HTML_table_layout
|
282
|
-
#
|
283
|
-
# This variable will be true if we make use of a HTML table layout.
|
284
|
-
# ======================================================================= #
|
285
|
-
@internal_hash[:use_HTML_table_layout] = false
|
286
|
-
# ======================================================================= #
|
287
284
|
# === :use_jquery
|
288
285
|
#
|
289
286
|
# This boolean variable will determine whether this class will use
|
@@ -323,6 +320,9 @@ a:hover {
|
|
323
320
|
do_not_include_subdirectories
|
324
321
|
# ======================================================================= #
|
325
322
|
# === :add_hyperlinks_to_subdirectories
|
323
|
+
#
|
324
|
+
# This will determine the most bottom div - the one that may show
|
325
|
+
# various hyperlinks to the subdirectories in the working directory.
|
326
326
|
# ======================================================================= #
|
327
327
|
@internal_hash[:add_hyperlinks_to_subdirectories] = false
|
328
328
|
# ======================================================================= #
|
@@ -334,6 +334,20 @@ a:hover {
|
|
334
334
|
# ======================================================================= #
|
335
335
|
@internal_hash[:use_german] = true
|
336
336
|
# ======================================================================= #
|
337
|
+
# === :be_verbose
|
338
|
+
# ======================================================================= #
|
339
|
+
@internal_hash[:be_verbose] = BE_VERBOSE
|
340
|
+
# ======================================================================= #
|
341
|
+
# === :use_HTML_table_layout
|
342
|
+
#
|
343
|
+
# This variable will be true if we make use of a HTML table layout.
|
344
|
+
#
|
345
|
+
# This is currently used by pdf_to_html.rb, showing various .pdf files,
|
346
|
+
# as well as by images_to_html.rb, so we have to keep that in mind -
|
347
|
+
# it will do different things for each individual .rb file there.
|
348
|
+
# ======================================================================= #
|
349
|
+
@internal_hash[:use_HTML_table_layout] = false
|
350
|
+
# ======================================================================= #
|
337
351
|
# === :save_into_this_local_file
|
338
352
|
# ======================================================================= #
|
339
353
|
set_save_into_this_local_file(
|
@@ -431,6 +445,26 @@ a:hover {
|
|
431
445
|
alias save_file do_store_the_content # === save_file
|
432
446
|
alias append_everything do_store_the_content # === append_everything
|
433
447
|
|
448
|
+
# ========================================================================= #
|
449
|
+
# === add_date_in_the_lower_part_of_the_webpage?
|
450
|
+
# ========================================================================= #
|
451
|
+
def add_date_in_the_lower_part_of_the_webpage?
|
452
|
+
@internal_hash[:add_date_in_the_lower_part_of_the_webpage]
|
453
|
+
end
|
454
|
+
|
455
|
+
# ========================================================================= #
|
456
|
+
# === return_the_pretty_name_of_the_webpage
|
457
|
+
#
|
458
|
+
# This method will return the pretty name of the webpage.
|
459
|
+
# ========================================================================= #
|
460
|
+
def return_the_pretty_name_of_the_webpage
|
461
|
+
_ = File.basename(save_into_this_local_file?).
|
462
|
+
delete_suffix('.html').
|
463
|
+
tr('_',' ')
|
464
|
+
_ = _.split(' ').map(&:capitalize).join(' ').strip if _.include?(' ')
|
465
|
+
return _
|
466
|
+
end
|
467
|
+
|
434
468
|
# ========================================================================= #
|
435
469
|
# === filter_for_these_files (filter tag)
|
436
470
|
#
|
@@ -463,7 +497,7 @@ a:hover {
|
|
463
497
|
# =================================================================== #
|
464
498
|
when :multimedia_files
|
465
499
|
begin
|
466
|
-
require 'multimedia_paradise/toplevel_methods/
|
500
|
+
require 'multimedia_paradise/toplevel_methods/is_audio_file_is_video_file_is_image_file_is_multimedia_file.rb'
|
467
501
|
::MultimediaParadise.is_a_multimedia_file?(entry)
|
468
502
|
rescue LoadError; end
|
469
503
|
# =================================================================== #
|
@@ -538,15 +572,20 @@ a:hover {
|
|
538
572
|
else
|
539
573
|
case i # case tag
|
540
574
|
# ===================================================================== #
|
541
|
-
# === cweb --
|
542
|
-
#
|
543
|
-
|
544
|
-
|
545
|
-
#
|
546
|
-
#
|
575
|
+
# === cweb --add-date-in-the-lower-part
|
576
|
+
#
|
577
|
+
# This will also add additional information in the lower part of
|
578
|
+
# the generated webpage, specifically showing the time range
|
579
|
+
# if possible, the years. Example: (2021 to 2024)
|
580
|
+
#
|
581
|
+
# Usage example:
|
582
|
+
#
|
583
|
+
# pdf1 --add-date-in-the-lower-part
|
584
|
+
#
|
547
585
|
# ===================================================================== #
|
548
|
-
when /^-?-?
|
549
|
-
|
586
|
+
when /^-?-?add(-|_)?date(-|_)?in(-|_)?the(-|_)?lower(-|_)?part$/i,
|
587
|
+
/^-?-?lower(-|_)?part$/i
|
588
|
+
@internal_hash[:add_date_in_the_lower_part_of_the_webpage] = true
|
550
589
|
# ===================================================================== #
|
551
590
|
# === cweb --add-hyperlinks-to-subdirectories
|
552
591
|
#
|
@@ -558,6 +597,25 @@ a:hover {
|
|
558
597
|
/^-?-?bottom$/i # === cweb --bottom
|
559
598
|
@internal_hash[:add_hyperlinks_to_subdirectories] = true
|
560
599
|
# ===================================================================== #
|
600
|
+
# === cweb --tablelayout
|
601
|
+
# ===================================================================== #
|
602
|
+
when /^-?-?tablelayout$/i,
|
603
|
+
/^-?-?table$/i,
|
604
|
+
/^-?-?html(-|_)?tables?$/i, # === cweb --html-table
|
605
|
+
/^-?-?use(-|_)?HTML(-|_)?tables?$/i, # === cweb --use-HTML-table
|
606
|
+
/^-?-?use(-|_)?HTML$/i
|
607
|
+
do_use_HTML_table_layout
|
608
|
+
# ===================================================================== #
|
609
|
+
# === cweb --do-not-include-subdirectories
|
610
|
+
# ===================================================================== #
|
611
|
+
when /^-?-?do(-|_)?not(-|_)?include(-|_)?subdirectories$/i
|
612
|
+
do_not_include_subdirectories
|
613
|
+
# ===================================================================== #
|
614
|
+
# === cweb --traverse
|
615
|
+
# ===================================================================== #
|
616
|
+
when /^-?-?traverse$/i
|
617
|
+
@internal_hash[:do_traverse_into_subdirectories] = true
|
618
|
+
# ===================================================================== #
|
561
619
|
# === --do-include-subdirectories
|
562
620
|
#
|
563
621
|
# This option allows the use to include all files in all subdirectories
|
@@ -605,15 +663,6 @@ a:hover {
|
|
605
663
|
/^-?-?no(-|_)?special(-|_)?size$/i
|
606
664
|
@internal_hash[:use_no_size_value] = true
|
607
665
|
# ===================================================================== #
|
608
|
-
# === cweb --tablelayout
|
609
|
-
# ===================================================================== #
|
610
|
-
when /^-?-?tablelayout$/i,
|
611
|
-
/^-?-?table$/i,
|
612
|
-
/^-?-?html(-|_)?tables?$/i, # === cweb --html-table
|
613
|
-
/^-?-?use(-|_)?HTML(-|_)?tables?$/i,
|
614
|
-
/^-?-?use(-|_)?HTML$/i
|
615
|
-
do_use_HTML_table_layout
|
616
|
-
# ===================================================================== #
|
617
666
|
# === cweb --videos
|
618
667
|
#
|
619
668
|
# This entry point allows us to work on video-files only. If that
|
@@ -814,13 +863,6 @@ a:hover {
|
|
814
863
|
@internal_hash[:use_jquery]
|
815
864
|
end
|
816
865
|
|
817
|
-
# ========================================================================= #
|
818
|
-
# === do_use_HTML_table_layout
|
819
|
-
# ========================================================================= #
|
820
|
-
def do_use_HTML_table_layout
|
821
|
-
@internal_hash[:use_HTML_table_layout] = true
|
822
|
-
end
|
823
|
-
|
824
866
|
# ========================================================================= #
|
825
867
|
# === make_use_of_a_go_down_one_level_link?
|
826
868
|
#
|
@@ -890,15 +932,6 @@ a:hover {
|
|
890
932
|
e
|
891
933
|
end
|
892
934
|
|
893
|
-
# ========================================================================= #
|
894
|
-
# === use_HTML_table_layout?
|
895
|
-
# ========================================================================= #
|
896
|
-
def use_HTML_table_layout?
|
897
|
-
@internal_hash[:use_HTML_table_layout]
|
898
|
-
end; alias use_html_table_layout? use_HTML_table_layout? # === use_html_table_layout?
|
899
|
-
alias use_html_table? use_HTML_table_layout? # === use_html_table?
|
900
|
-
alias use_HTML_table? use_HTML_table_layout? # === use_HTML_table?
|
901
|
-
|
902
935
|
# ========================================================================= #
|
903
936
|
# === add (add tag)
|
904
937
|
#
|
@@ -1100,6 +1133,15 @@ a:hover {
|
|
1100
1133
|
'<span style="color: gold; '+optional_css_style+'">'+i.to_s+'</span>'
|
1101
1134
|
end
|
1102
1135
|
|
1136
|
+
# ========================================================================= #
|
1137
|
+
# === olivedrab
|
1138
|
+
# ========================================================================= #
|
1139
|
+
def olivedrab(
|
1140
|
+
i, optional_css_style = ''
|
1141
|
+
)
|
1142
|
+
'<span style="color: olivedrab; '+optional_css_style+'">'+i.to_s+'</span>'
|
1143
|
+
end
|
1144
|
+
|
1103
1145
|
# ========================================================================= #
|
1104
1146
|
# === mediumorchid
|
1105
1147
|
# ========================================================================= #
|
@@ -1110,21 +1152,21 @@ a:hover {
|
|
1110
1152
|
end
|
1111
1153
|
|
1112
1154
|
# ========================================================================= #
|
1113
|
-
# ===
|
1155
|
+
# === paleturquoise
|
1114
1156
|
# ========================================================================= #
|
1115
|
-
def
|
1157
|
+
def paleturquoise(
|
1116
1158
|
i, optional_css_style = ''
|
1117
1159
|
)
|
1118
|
-
'<span style="color:
|
1160
|
+
'<span style="color: paleturquoise; '+optional_css_style+'">'+i.to_s+'</span>'
|
1119
1161
|
end
|
1120
1162
|
|
1121
1163
|
# ========================================================================= #
|
1122
|
-
# ===
|
1164
|
+
# === mediumseagreen
|
1123
1165
|
# ========================================================================= #
|
1124
|
-
def
|
1166
|
+
def mediumseagreen(
|
1125
1167
|
i, optional_css_style = ''
|
1126
1168
|
)
|
1127
|
-
'<span style="color:
|
1169
|
+
'<span style="color: mediumseagreen; '+optional_css_style+'">'+i.to_s+'</span>'
|
1128
1170
|
end
|
1129
1171
|
|
1130
1172
|
# ========================================================================= #
|
@@ -1183,7 +1225,37 @@ a:hover {
|
|
1183
1225
|
end
|
1184
1226
|
|
1185
1227
|
# ========================================================================= #
|
1186
|
-
# ===
|
1228
|
+
# === colour_for_pdf_files
|
1229
|
+
# ========================================================================= #
|
1230
|
+
def colour_for_pdf_files(i)
|
1231
|
+
mediumorchid(i)
|
1232
|
+
end
|
1233
|
+
|
1234
|
+
# ========================================================================= #
|
1235
|
+
# === do_not_use_HTML_table_layout
|
1236
|
+
# ========================================================================= #
|
1237
|
+
def do_not_use_HTML_table_layout
|
1238
|
+
@internal_hash[:use_HTML_table_layout] = false
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
# ========================================================================= #
|
1242
|
+
# === do_use_HTML_table_layout
|
1243
|
+
# ========================================================================= #
|
1244
|
+
def do_use_HTML_table_layout
|
1245
|
+
@internal_hash[:use_HTML_table_layout] = true
|
1246
|
+
end
|
1247
|
+
|
1248
|
+
# ========================================================================= #
|
1249
|
+
# === use_HTML_table_layout?
|
1250
|
+
# ========================================================================= #
|
1251
|
+
def use_HTML_table_layout?
|
1252
|
+
@internal_hash[:use_HTML_table_layout]
|
1253
|
+
end; alias use_html_table_layout? use_HTML_table_layout? # === use_html_table_layout?
|
1254
|
+
alias use_html_table? use_HTML_table_layout? # === use_html_table?
|
1255
|
+
alias use_HTML_table? use_HTML_table_layout? # === use_HTML_table?
|
1256
|
+
|
1257
|
+
# ========================================================================= #
|
1258
|
+
# === add_the_footer_with_hyperlinks (footer tag, bottom tag)
|
1187
1259
|
#
|
1188
1260
|
# This method will add the footer, which by default is not used - the
|
1189
1261
|
# user has to provide a commandline argument such as --footer to make
|
@@ -1208,6 +1280,7 @@ a:hover {
|
|
1208
1280
|
all_subdirectories = :default,
|
1209
1281
|
show_how_many_pdf_files_are_in_that_subdirectory = false
|
1210
1282
|
)
|
1283
|
+
add_date_in_the_lower_part_of_the_webpage = add_date_in_the_lower_part_of_the_webpage?
|
1211
1284
|
case show_how_many_pdf_files_are_in_that_subdirectory
|
1212
1285
|
# ======================================================================= #
|
1213
1286
|
# === :count_the_pdf_files
|
@@ -1258,45 +1331,84 @@ a:hover {
|
|
1258
1331
|
# in that subdirectory.
|
1259
1332
|
# =============================================================== #
|
1260
1333
|
use_this_description = use_this_description.dup if use_this_description.frozen?
|
1261
|
-
|
1334
|
+
# ================================================================= #
|
1335
|
+
# Shorten the content if it exceeds a certain threshold:
|
1336
|
+
# ================================================================= #
|
1337
|
+
use_this_threshold_value = 80
|
1338
|
+
if use_this_description.size > use_this_threshold_value
|
1339
|
+
use_this_description = use_this_description[0 .. use_this_threshold_value]+' [...]'
|
1340
|
+
end
|
1341
|
+
n_pdf_files = Dir["#{File.dirname(this_html_file)}/*.pdf"]
|
1262
1342
|
if use_german? # Currently we only do this if this class uses german.
|
1263
|
-
case n_pdf_files
|
1343
|
+
case n_pdf_files.size # Query how many .pdf files we have.
|
1264
1344
|
when 1
|
1265
1345
|
use_this_description << colour_for_pdf_files(
|
1266
|
-
' ('+n_pdf_files.size.to_s+' .pdf Datei)'
|
1346
|
+
' ('+n_pdf_files.size.to_s+' .pdf Datei)' # Nur eine Datei.
|
1267
1347
|
)
|
1268
1348
|
else
|
1269
1349
|
use_this_description << colour_for_pdf_files(
|
1270
|
-
' ('+n_pdf_files.size.to_s+' .pdf Dateien)'
|
1350
|
+
' ('+n_pdf_files.size.to_s+' .pdf Dateien)' # Mehrere Dateien.
|
1271
1351
|
)
|
1272
1352
|
end
|
1273
1353
|
end
|
1354
|
+
# =============================================================== #
|
1355
|
+
# Next, add the date-range, if this is enabled through the commandline.
|
1356
|
+
# =============================================================== #
|
1357
|
+
if add_date_in_the_lower_part_of_the_webpage
|
1358
|
+
# ============================================================= #
|
1359
|
+
# Next we must get the starting_year and the ending_year. We
|
1360
|
+
# can do so by first getting an Array of all files in the
|
1361
|
+
# subdirectory first.
|
1362
|
+
# ============================================================= #
|
1363
|
+
dirname_is = File.dirname(this_html_file)
|
1364
|
+
files_in_that_directory = Dir["#{dirname_is}/*"].select {|entry|
|
1365
|
+
is_a_file?(entry)
|
1366
|
+
}
|
1367
|
+
array = Cyberweb.return_time_range_based_on_this_array(files_in_that_directory)
|
1368
|
+
starting_year = array.first.to_s
|
1369
|
+
ending_year = array.last.to_s
|
1370
|
+
years_description = ''.dup
|
1371
|
+
if (ending_year.to_i > starting_year.to_i) or # Then we have two entries.
|
1372
|
+
(starting_year.to_i > ending_year.to_i)
|
1373
|
+
years_description = ' (years: '+starting_year+' - '+ending_year+')'
|
1374
|
+
years_description = ' (Jahre: '+starting_year+' - '+ending_year+')' if use_german?
|
1375
|
+
else # else we have only one year.
|
1376
|
+
years_description = ' (year: '+starting_year+')'
|
1377
|
+
years_description = ' (Jahr: '+starting_year+')' if use_german?
|
1378
|
+
end
|
1379
|
+
use_this_description << olivedrab(
|
1380
|
+
years_description
|
1381
|
+
)
|
1382
|
+
end
|
1274
1383
|
end
|
1384
|
+
# ================================================================= #
|
1385
|
+
# Next add the href tag:
|
1386
|
+
# ================================================================= #
|
1275
1387
|
_ << HtmlTags.a(
|
1276
1388
|
this_html_file,
|
1277
|
-
css_class: '
|
1389
|
+
css_class: 'marl1_5em BOLD',
|
1278
1390
|
description: use_this_description
|
1279
1391
|
)
|
1280
1392
|
_ << "<br>\n"
|
1281
1393
|
end
|
1282
1394
|
}
|
1283
1395
|
end
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1396
|
+
unless _.nil? or _.empty?
|
1397
|
+
# ===================================================================== #
|
1398
|
+
# Build the <div> tag next:
|
1399
|
+
# ===================================================================== #
|
1400
|
+
div_tag_to_use = HtmlTags.div(
|
1401
|
+
_, 'common_border',
|
1402
|
+
'div_footer_id', # The id.
|
1403
|
+
'border: 4px dotted lightgreen;
|
1404
|
+
border-radius: 18px;
|
1405
|
+
margin: 1.6em;
|
1406
|
+
padding: 15px;
|
1407
|
+
font-size: 1.1em;
|
1408
|
+
'
|
1409
|
+
)
|
1410
|
+
addnl(div_tag_to_use)
|
1411
|
+
end
|
1300
1412
|
end
|
1301
1413
|
|
1302
1414
|
# ========================================================================= #
|