Class: Cyberweb::HtmlTemplate
- Inherits:
-
Base
- Object
- Base
- Cyberweb::HtmlTemplate
show all
- Defined in:
- lib/cyberweb/html_template/html_template.rb
Overview
Constant Summary
Constants inherited
from Base
Base::HOME_DIRECTORY_OF_THE_USER_X, Base::NAMESPACE
Class Method Summary
collapse
Instance Method Summary
collapse
-
#a(i = '', option_hash = {}) ⇒ Object
(also: #link, #link_to, #alink, #remote_link)
# === a (a tag, link tag).
-
#add_content_type_html ⇒ Object
# === add_content_type_html ========================================================================= #.
-
#add_html_comment(i = '') ⇒ Object
(also: #ehtml_comment, #html_comment)
-
#add_javascript_file(i, optional_use_this_onload_function = nil) ⇒ Object
# === add_javascript_file.
-
#add_omega_symbol ⇒ Object
# === add_omega_symbol ========================================================================= #.
-
#add_omega_symbol_semantics ⇒ Object
# === add_omega_symbol_semantics ========================================================================= #.
-
#add_relevant_meta_entries(honour_checks = true) ⇒ Object
(also: #add_the_meta_tags, #add_the_meta_collection)
-
#add_svg_table(i = 'fancy_table') ⇒ Object
# === add_svg_table ========================================================================= #.
-
#add_the_content_from_the_default_js_files ⇒ Object
# === add_the_content_from_the_default_js_files.
-
#add_this_div(optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '') ⇒ Object
# === add_this_div.
-
#add_this_remote_css_page(i) ⇒ Object
(also: #css_remote_url, #external_stylesheet, #remote_css, #add_remote_css_page, #css_file=, #add_css_file, #css_file, #external_style_sheet)
# === add_this_remote_css_page.
-
#add_unicode_charset ⇒ Object
# === add_unicode_charset ========================================================================= #.
-
#additional_CSS_rules_to_use? ⇒ Boolean
(also: #main_CSS_rules?)
# === additional_CSS_rules_to_use? ========================================================================= #.
-
#advanced_handle_these_calls_for_english ⇒ Object
# === advanced_handle_these_calls_for_english.
-
#advanced_handle_these_calls_for_german ⇒ Object
# === advanced_handle_these_calls_for_german ========================================================================= #.
-
#already_served? ⇒ Boolean
(also: #already_served, #served?)
# === already_served?.
-
#alt_text_or_no_alt_text(i) ⇒ Object
# === alt_text_or_no_alt_text ========================================================================= #.
-
#angstrom? ⇒ Boolean
(also: #angstrom)
# === angstrom? ========================================================================= #.
-
#append_after_the_closing_body_tag(i) ⇒ Object
# === append_after_the_closing_body_tag.
-
#append_newline ⇒ Object
# === append_newline ========================================================================= #.
-
#append_onto_the_body_content(i, append_a_newline = false) ⇒ Object
(also: #append_onto_the_body_tag, #addl)
# === append_onto_the_body_content.
-
#append_onto_the_body_css_class(i) ⇒ Object
(also: #append_onto_the_default_body_CSS_class)
# === append_onto_the_body_css_class.
-
#append_onto_the_js_files_to_load(i) ⇒ Object
(also: #javascript_src, #load_this_external_javascript_file)
# === append_onto_the_js_files_to_load.
-
#append_onto_the_main_CSS_rules(i) ⇒ Object
(also: #css_class, #add_to_css, #add_to_CSS, #add_to_main_CSS, #add_onto_the_CSS_rules, #css_style, #css_style=, #append_CSS, #append_CSS_style, #main_css_class, #main_css_style, #main_css, #main_style, #css_main_style, #css_classes, #c_style=, #c_class=, #general_css=, #css=, #c1=, #c1, #css_template=, #css_main, #css_main_class, #css_code, #inline_css, #append_to_css_style, #add_css_style, #append_onto_CSS, #append_onto_the_CSS_rules, #append_to_CSS, #append_these_CSS_rules, #append_onto_the_CSS_style, #add_this_css_style, #add_to_CSS_rules, #estyle)
# === append_onto_the_main_CSS_rules.
-
#append_onto_the_main_javascript_variable(i) ⇒ Object
# === append_onto_the_main_javascript_variable ========================================================================= #.
-
#append_path_to_dragula_js_file ⇒ Object
# === append_path_to_dragula_js_file ========================================================================= #.
-
#append_raw(i = "\n") ⇒ Object
(also: #_, #add_to_main_string, #append, #add)
# === append_raw (add tag).
-
#append_this_css(i) ⇒ Object
# === append_this_css ========================================================================= #.
-
#append_this_to_the_body_css(i) ⇒ Object
(also: #append_to_body_css_style)
# === append_this_to_the_body_css ========================================================================= #.
-
#append_this_to_the_meta_collection(i) ⇒ Object
-
#append_to_cmd(i) ⇒ Object
# === append_to_cmd ========================================================================= #.
-
#append_to_cmd1(i = '') ⇒ Object
(also: #append_cmd1)
# === append_to_cmd1.
-
#append_to_cmd2(i = '') ⇒ Object
# === append_to_cmd2 ========================================================================= #.
-
#append_to_cmd3(i = '') ⇒ Object
# === append_to_cmd3 ========================================================================= #.
-
#append_to_cmd4(i = '') ⇒ Object
# === append_to_cmd4 ========================================================================= #.
-
#append_to_cmd5(i = '') ⇒ Object
# === append_to_cmd5 ========================================================================= #.
-
#area(shape = :rect, coords = '92,39,104,140', href_to_use = '') ⇒ Object
# === area.
-
#arrow_right?(i = '', optional_css_class = '') ⇒ Boolean
(also: #arrow_right, #rarrow, #rarrow?, #string_rarrow?, #string_rarrow)
# === arrow_right?.
-
#audio(url = '', optional_autoplay = false) ⇒ Object
# === audio.
-
#background_image=(i = '/blaaa/foo.png', name_of_img_dir = name_of_img_dir?, , path_to_images = Cyberweb.path_to_images?) ⇒ Object
(also: #body_background_image, #background_image)
# === background_image=.
-
#background_scroll ⇒ Object
-
#black_background ⇒ Object
# === black_background ========================================================================= #.
-
#black_white ⇒ Object
# === black_white ========================================================================= #.
-
#blockquote(i = '', optional_css_class = '') ⇒ Object
# === blockquote.
-
#body_addnl(i = '', &block) ⇒ Object
(also: #append_to_body, #append_onto_the_body_with_newline, #append_onto_the_body_tag_nl, #append_onto_the_body_content_nl, #append_onto_the_body_nl, #append_onto_the_body_content_newline, #add_to_body_tag_nl, #addlnl, #addnl)
# === body_addnl.
-
#body_content? ⇒ Boolean
(also: #body?, #body_string?)
# === body_content? ========================================================================= #.
-
#body_css_class? ⇒ Boolean
# === body_css_class? ========================================================================= #.
-
#body_css_style? ⇒ Boolean
# === body_css_style? ========================================================================= #.
-
#body_javascript=(this_javascript = '') ⇒ Object
(also: #onload=, #onload, #body_onload=, #body_javascript)
# === body_javascript=.
-
#body_javascript? ⇒ Boolean
# === body_javascript? ========================================================================= #.
-
#bold(i = '', optional_css_class = '', optional_the_id = '') ⇒ Object
(also: #b)
# === bold.
-
#boldbr(i, optional_css_class = '', optional_the_id = '') ⇒ Object
(also: #bbr, #ebold)
# === boldbr ========================================================================= #.
-
#br ⇒ Object
(also: #nbr)
# === br (br tag) ========================================================================= #.
-
#brbr ⇒ Object
# === brbr.
-
#build_up_the_result ⇒ Object
(also: #create_the_main_string)
# === build_up_the_result (main tag).
-
#button(optional_text = '', optional_css_class = '', &block) ⇒ Object
-
#call(env = nil) ⇒ Object
# === call (call tag).
-
#cbody ⇒ Object
# === cbody ========================================================================= #.
-
#cdiv ⇒ Object
# === cdiv ========================================================================= #.
-
#cdl ⇒ Object
# === cdl ========================================================================= #.
-
#cfieldset ⇒ Object
# === cfieldset ========================================================================= #.
-
#cform ⇒ Object
-
#cframeset ⇒ Object
# === cframeset ========================================================================= #.
-
#check_this_css_class_for_select_rules(optional_css_class) ⇒ Object
# === check_this_css_class_for_select_rules ========================================================================= #.
-
#chtml ⇒ Object
# === chtml ========================================================================= #.
-
#circle(hash = { height: 150, colour: :yellow, radius: :quarter_default_width, stroke_width: 10 }) ⇒ Object
# === circle ========================================================================= #.
-
#clabel ⇒ Object
# === clabel ========================================================================= #.
-
#clear_left ⇒ Object
# === clear_left ========================================================================= #.
-
#clear_the_main_string ⇒ Object
(also: #reset_the_main_string, #reset_main_string, #reset_result)
# === clear_the_main_string.
-
#clegend ⇒ Object
# === clegend ========================================================================= #.
-
#cli ⇒ Object
# === cli ========================================================================= #.
-
#close(i) ⇒ Object
(also: #c)
# === close (close tag).
-
#close_a ⇒ Object
(also: #ca)
# === close_a ========================================================================= #.
-
#close_html ⇒ Object
# === close_html ========================================================================= #.
-
#cmap ⇒ Object
# === cmap ========================================================================= #.
-
#cmd1(content = '', css_rules_to_use = Cyberweb.cmd1_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
(also: #cmd, #rc1, #command)
# === cmd1 (cmd tag) ========================================================================= #.
-
#cmd1? ⇒ Boolean
(also: #cmd?, #command1?)
# === cmd1?.
-
#cmd1_is(i) ⇒ Object
(also: #cmd_is, #set_cmd1)
# === cmd1_is ========================================================================= #.
-
#cmd2(content = '', css_rules_to_use = Cyberweb.cmd2_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
(also: #rc2, #command2)
# === cmd2 ========================================================================= #.
-
#cmd2_is(i) ⇒ Object
(also: #set_cmd2)
# === cmd2_is ========================================================================= #.
-
#cmd3(content = '', css_rules_to_use = Cyberweb.cmd3_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
(also: #rc3, #command3)
# === cmd3 ========================================================================= #.
-
#cmd3_is(i) ⇒ Object
(also: #set_cmd3)
# === cmd3_is ========================================================================= #.
-
#cmd4(content = '', css_rules_to_use = Cyberweb.cmd4_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
(also: #rc4, #command4)
# === cmd4 ========================================================================= #.
-
#cmd4_is(i) ⇒ Object
(also: #set_cmd4)
# === cmd4_is ========================================================================= #.
-
#cmd5(content = '', css_rules_to_use = Cyberweb.cmd5_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
(also: #rc5, #command5)
# === cmd5 ========================================================================= #.
-
#cmd5_is(i) ⇒ Object
(also: #set_cmd5)
# === cmd5_is ========================================================================= #.
-
#cmd_pre(i) ⇒ Object
(also: #pre_cmd)
# === cmd_pre ========================================================================= #.
-
#cmdbold(i = '') ⇒ Object
# === cmdbold ========================================================================= #.
-
#cobject ⇒ Object
# === cobject ========================================================================= #.
-
#col_cmd(i = '', optional_id = '') ⇒ Object
(also: #col)
# === col_cmd ========================================================================= #.
-
#colour_chart ⇒ Object
# === colour_chart ========================================================================= #.
-
#colour_gradient_left_to_right(colour1 = :steelblue, colour2 = :darkgreen, css_name_that_will_be_returned = '.gradient1') ⇒ Object
(also: #colour_gradient)
# === colour_gradient_left_to_right.
-
#colour_gradient_right_to_left(colour1 = :steelblue, colour2 = :darkgreen, css_name_that_will_be_returned = '.gradient1') ⇒ Object
# === colour_gradient_right_to_left.
-
#complex_handle_this_language(i = language? ) ⇒ Object
# === complex_handle_this_language ========================================================================= #.
-
#consider_appending_when_the_webpage_was_originally_created ⇒ Object
# === consider_appending_when_the_webpage_was_originally_created ========================================================================= #.
-
#consider_returning_the_css_style ⇒ Object
# === consider_returning_the_css_style.
-
#counter_eight(i) ⇒ Object
(also: #c_eight)
# === counter_eight ========================================================================= #.
-
#counter_five(i) ⇒ Object
(also: #c_five)
# === counter_five ========================================================================= #.
-
#counter_four(i) ⇒ Object
(also: #c_four)
# === counter_four ========================================================================= #.
-
#counter_nine(i) ⇒ Object
(also: #c_nine)
# === counter_nine ========================================================================= #.
-
#counter_one(i) ⇒ Object
(also: #c_one)
# === counter_one ========================================================================= #.
-
#counter_seven(i) ⇒ Object
(also: #c_seven)
# === counter_seven ========================================================================= #.
-
#counter_six(i) ⇒ Object
(also: #c_six)
# === counter_six ========================================================================= #.
-
#counter_ten(i) ⇒ Object
(also: #c_ten)
# === counter_ten ========================================================================= #.
-
#counter_three(i) ⇒ Object
(also: #c_three)
# === counter_three ========================================================================= #.
-
#counter_two(i) ⇒ Object
(also: #c_two)
# === counter_two ========================================================================= #.
-
#cp ⇒ Object
# === cp ========================================================================= #.
-
#cpre ⇒ Object
# === cpre ========================================================================= #.
-
#created_when(i = '20.08.2021') ⇒ Object
(also: #created_on, #set_created_on)
# === created_when.
-
#cselect ⇒ Object
# === cselect ========================================================================= #.
-
#css_class_or_no_class(i = '') ⇒ Object
# === css_class_or_no_class ========================================================================= #.
-
#css_classes? ⇒ Boolean
# === css_classes? ========================================================================= #.
-
#css_for_cmd1(i = '') ⇒ Object
(also: #css_for_cmd)
# === css_for_cmd1 ========================================================================= #.
-
#css_for_cmd2(i = '') ⇒ Object
# === css_for_cmd2 ========================================================================= #.
-
#css_for_cmd3(i = '') ⇒ Object
# === css_for_cmd3 ========================================================================= #.
-
#css_for_cmd4(i = '') ⇒ Object
# === css_for_cmd4 ========================================================================= #.
-
#css_for_cmd5(i = '') ⇒ Object
# === css_for_cmd5 ========================================================================= #.
-
#css_rule_for_this_background_image(i = :parchment2) ⇒ Object
# === css_rule_for_this_background_image.
-
#css_style_or_no_style(i = '') ⇒ Object
# === css_style_or_no_style ========================================================================= #.
-
#css_template1 ⇒ Object
# === css_template1.
-
#ctable ⇒ Object
# === ctable ========================================================================= #.
-
#ctd ⇒ Object
# === ctd ========================================================================= #.
-
#ctdctr ⇒ Object
# === ctdctr ========================================================================= #.
-
#ctdtd ⇒ Object
# === ctdtd ========================================================================= #.
-
#ctextarea ⇒ Object
# === ctextarea ========================================================================= #.
-
#ctr ⇒ Object
# === ctr ========================================================================= #.
-
#cul ⇒ Object
# === cul ========================================================================= #.
-
#current_height? ⇒ Boolean
# === current_height?.
-
#current_ruby_version? ⇒ Boolean
# === current_ruby_version?.
-
#cursor(i = :wait) ⇒ Object
# === cursor ========================================================================= #.
-
#date_today ⇒ Object
# === date_today ========================================================================= #.
-
#default_font_size ⇒ Object
(also: #use_default_font_size_as_specified_in_the_project_settings)
# === default_font_size ========================================================================= #.
-
#default_font_size_and_hyperlinks ⇒ Object
(also: #default_font_size_and_hyperlink)
# === default_font_size_and_hyperlinks ========================================================================= #.
-
#default_hyperlink_behaviour ⇒ Object
# === default_hyperlink_behaviour.
-
#default_hyperlinks_template1(i = '') ⇒ Object
(also: #default_hyperlinks_template, #hyperlinks_template1, #hyperlinks_template, #hyperlink_template1, #default_css_template, #default_template1, #default_template)
# === default_hyperlinks_template1 ========================================================================= #.
-
#details(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '', &block) ⇒ Object
# === details.
-
#disable_body_tag ⇒ Object
# === disable_body_tag.
-
#display_this_file(this_file, optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
(also: #read_and_display_this_file, #read_and_display, #read_file_content, #embed_this_file, #show_this_file, #display_file)
# === display_this_file.
-
#display_this_file_without_comments(this_file, optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
-
#div(optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '', &block) ⇒ Object
# === div (div tag).
-
#dnd_favicon ⇒ Object
# === dnd_favicon ========================================================================= #.
-
#do_not_use_jquery ⇒ Object
# === do_not_use_jquery ========================================================================= #.
-
#do_not_use_local_CSS_files ⇒ Object
(also: #do_not_use_the_internal_CSS_files)
# === do_not_use_the_internal_CSS_files ========================================================================= #.
-
#do_serve ⇒ Object
(also: #eserve, #erender, #print_the_result, #display, #report, #serve_again, #serve_webpage, #serve, #serv, #ser, #start)
# === do_serve (display tag, report tag, render tag, serve tag, main serve).
-
#do_shall_we_use_jquery ⇒ Object
(also: #do_use_jquery, #append_jquery_string)
# === do_shall_we_use_jquery.
-
#do_show_the_lines ⇒ Object
# === do_show_the_lines ========================================================================= #.
-
#do_use_local_CSS_files ⇒ Object
# === do_use_local_CSS_files.
-
#do_use_utf_charset ⇒ Object
# === do_use_utf_charset ========================================================================= #.
-
#document_ready(i = '$("p").text("Hello World!");') ⇒ Object
# === document_ready.
-
#document_write(i) ⇒ Object
(also: #dwrite)
# === document_write.
-
#dropdown_box(i) ⇒ Object
(also: #www_dropdown_box, #html_dropdown_box)
# === dropdown_box ========================================================================= #.
-
#e(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', show_the_lines = show_the_lines?, , &block) ⇒ Object
(also: #ebr, #sbr)
# === e (e tag).
-
#earrow(i = '', optional_css_class = '') ⇒ Object
# === earrow ========================================================================= #.
-
#edot(i = 108, optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
# === edot ========================================================================= #.
-
#ee(i = '') ⇒ Object
# === ee (ee tag).
-
#ee_nl(i = '') ⇒ Object
(also: #eenl)
# === ee_nl ========================================================================= #.
-
#eearrow(i = '', optional_css_class = '') ⇒ Object
# === eearrow ========================================================================= #.
-
#ejavascript(i = '') ⇒ Object
(also: #javascript, #embed_javascript, #embed_this_javascript, #ejavascript_code, #add_this_javascript_code, #custom_javascript_code, #javascript_code, #escript, #script)
# === ejavascript.
-
#embed_youtube_video(src = 'gexazLr6pSY', width = '640', height = '385') ⇒ Object
(also: #eyv, #youtube, #youtube_links, #youtube_link, #youtube_video, #embed_video_file, #embed_video, #embed_youtube_link)
# === embed_youtube_video.
-
#enable_namespace ⇒ Object
(also: #autoextend)
# === enable_namespace.
-
#encoding_to_use? ⇒ Boolean
(also: #main_encoding?, #use_which_encoding?)
# === encoding_to_use? ========================================================================= #.
-
#english_html_comment ⇒ Object
-
#english_unicode_and_english_html_comment ⇒ Object
-
#english_unicode_and_jquery ⇒ Object
# === english_unicode_and_jquery ========================================================================= #.
-
#escape_html(i) ⇒ Object
(also: #htmlsanitize, #return_htmlentities, #return_htmlsanitized, #html_ready, #html_escape, #htitties)
# === escape_html.
-
#external_javascript_file(i) ⇒ Object
(also: #external_script, #javascript_file)
# === external_javascript_file ========================================================================= #.
-
#favicon_scanner ⇒ Object
(also: #scanner_favicon)
# === favicon_scanner ========================================================================= #.
-
#fetch_css_classes(i = CSS_DIRECTORY) ⇒ Object
# === fetch_css_classes.
-
#files_from(from = return_pwd, include_subdirectories = false) ⇒ Object
# === files_from.
-
#font_family=(i = 'sans-serif') ⇒ Object
# === font_family.
-
#frameset(i, &block) ⇒ Object
# === frameset.
-
#german_trinity ⇒ Object
(also: #use_unicode_german_and_jquery, #trinity_german, #trinity)
# === german_trinity.
-
#german_unicode ⇒ Object
# === german_unicode (german unicode tag, german_unicode tag).
-
#german_unicode_and_german_html_comment ⇒ Object
-
#german_unicode_and_jquery ⇒ Object
(also: #german_unicode_jquery, #use_jquery_german_and_unicode)
# === german_unicode_and_jquery.
-
#get_all_files_from(this_directory = return_pwd) ⇒ Object
# === get_all_files_from ========================================================================= #.
-
#get_images(from_this_dir = return_pwd) ⇒ Object
(also: #get_images_from, #return_all_images_from)
# === get_images.
-
#gleichgewicht ⇒ Object
(also: #chem_gleichgewicht)
# === gleichgewicht ========================================================================= #.
-
#glossar_table(*use_this_dataset, &block) ⇒ Object
(also: #glossar, #table_for_glossar)
# === glossar_table.
-
#handle_these_calls(&block) ⇒ Object
# === handle_these_calls ========================================================================= #.
-
#hide_scrollbars ⇒ Object
(also: #disable_scrollbars)
-
#hr(optional_css_class = '') ⇒ Object
# === hr (hr tag).
-
#hr_stars ⇒ Object
(also: #star_spacer, #fancy_stars, #pretty_spacer, #pretty_stars, #pretty_star, #pretty_hsep, #pretty_separator)
# === hr_stars.
-
#hsep ⇒ Object
# === hsep ========================================================================= #.
-
#hspacer(optional_css_class = nil) ⇒ Object
# === hspacer.
-
#html_title?(i = web_title? ) ⇒ Boolean
# === html_title?.
-
#htmlescape(i) ⇒ Object
(also: #htmlentities, #hescape, #htmltitties)
# === htmlescape ========================================================================= #.
-
#id_or_no_id(i = '', optional_url = nil) ⇒ Object
# === id_or_no_id.
-
#in_file(this_file) ⇒ Object
# === in_file ========================================================================= #.
-
#in_ruby(i, make_newline = true) ⇒ Object
# === in_ruby.
-
#initialize(commandline_arguments = ARGV, run_already = true, &block) ⇒ HtmlTemplate
constructor
# === initialize ========================================================================= #.
-
#inject_this_onto_that(this, that) ⇒ Object
# === inject_this_onto_that.
-
#input(type = :submit, default_value = '', css_class = Input.to_s, name_to_use = '', css_style = '', accesskey = '', my_javascript = '', id = nil, hash = {}, &block) ⇒ Object
-
#is_a_sinatra_application ⇒ Object
(also: #enable_sinatra_application, #is_a_rack_application)
# === is_a_sinatra_application.
-
#is_a_sinatra_application? ⇒ Boolean
(also: #uses_sinatra?, #are_we_using_sinatra?, #is_sinatra?)
# === is_a_sinatra_application?.
-
#is_localhost? ⇒ Boolean
# === is_localhost? ========================================================================= #.
-
#italic(content = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
(also: #i)
# === italic (italic tag).
-
#javascript_code? ⇒ Boolean
(also: #javascript?)
# === javascript_code?.
-
#javascript_file=(i) ⇒ Object
(also: #link_in_javascript, #load_javascript)
# === javascript_file=.
-
#javascript_script=(i) ⇒ Object
(also: #javascript_in_head_tag, #addnl_javascript_code)
# === javascript_script=.
-
#jquery(i = '+') ⇒ Object
# === jquery.
-
#jquery_version? ⇒ Boolean
(also: #this_jquery_version)
# === jquery_version?.
-
#label(i) ⇒ Object
# === label (label tag).
-
#language(which_language = nil) ⇒ Object
(also: #set_language)
# === language.
-
#language? ⇒ Boolean
# === language?.
-
#larger_font_size ⇒ Object
# === larger_font_size.
-
#larger_font_size_and_hyperlinks ⇒ Object
# === larger_font_size_and_hyperlinks ========================================================================= #.
-
#left_to_right_gradient(first_colour = :steelblue, second_colour = :lightgreen) ⇒ Object
(also: #gradient_left_to_right, #left_to_right)
# === left_to_right_gradient.
-
#legend(content = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
# === legend ========================================================================= #.
-
#less_than_or_equal ⇒ Object
(also: #kleiner_gleich)
# === less_than_or_equal ========================================================================= #.
-
#linear_gradient_background(degree_to_use = (0..180).to_a.sample.to_s+'deg', colour1 = random_colour, colour2 = random_colour, colour3 = random_colour) ⇒ Object
# === linear_gradient_background.
-
#linux_favicon ⇒ Object
# === linux_favicon ========================================================================= #.
-
#map_symbol_to_image_location(i) ⇒ Object
# === map_symbol_to_image_location ========================================================================= #.
-
#markdown(i = '') ⇒ Object
(also: #markdown_display_this_file, #read_and_display_markdown, #show_md, #display_markdown)
# === markdown ========================================================================= #.
-
#mars1em(i = '') ⇒ Object
# === mars1em ========================================================================= #.
-
#mars2em(i = '', optional_css_class = '') ⇒ Object
# === mars2em ========================================================================= #.
-
#mathml(optional_css_class = '') ⇒ Object
(also: #mathml_start)
# === Cyberweb.mathml.
-
#meta_content? ⇒ Boolean
(also: #meta_collection?)
# === meta_content? ========================================================================= #.
-
#n_steps_to_the_base_directory? ⇒ Boolean
(also: #n_times_to_the_base_dir?)
# === n_steps_to_the_base_directory? ========================================================================= #.
-
#n_total_lines? ⇒ Boolean
(also: #n_total_lines, #n_lines?)
# === n_total_lines?.
-
#normal_hyperlinks ⇒ Object
(also: #default_hyperlinks, #default_hyperlink)
# === normal_hyperlinks.
-
#on_click_change_opacity(use_this_id = 'pic', which_opacity_value_to_use = '0.92') ⇒ Object
(also: #on_click_highlight, #highlight_tag, #highlight)
# === on_click_change_opacity ========================================================================= #.
-
#on_click_make_darker(this_id, opacity = '0.90') ⇒ Object
# === on_click_make_darker ========================================================================= #.
-
#on_hover_colour(i) ⇒ Object
# === on_hover_colour.
-
#onload_or_no_onload(i = body_javascript? ) ⇒ Object
# === onload_or_no_onload ========================================================================= #.
-
#ordered_list(array = %w( cat dog parrot deer horse )) ⇒ Object
# === ordered_list.
-
#original_input(type = :submit, default_value = '', css_class = Input.to_s, name_to_use = '', css_style = '', accesskey = '', my_javascript = '', id = nil, hash = {}, &block) ⇒ Object
-
#p(optional_css_class = '', the_id = '', optional_css_style = '', &block) ⇒ Object
# === p (p tag).
-
#page_css_classes ⇒ Object
# === return_css_style.
-
#parse_table(*args) ⇒ Object
# === parse_table ========================================================================= #.
-
#parse_this_hash(hash) ⇒ Object
# === parse_this_hash (parse tag).
-
#path? ⇒ Boolean
(also: #fixed_path, #converted_path, #converted_path?)
# === path?.
-
#path_to_this_background_image(i = :parchment1) ⇒ Object
# === path_to_this_background_image.
-
#pi? ⇒ Boolean
# === pi? ========================================================================= #.
-
#prepend_before_the_body_tag(i) ⇒ Object
# === prepend_before_the_body_tag.
-
#prepend_doc_type ⇒ Object
# === prepend_doc_type ========================================================================= #.
-
#pull_in(i) ⇒ Object
# === pull_in ========================================================================= #.
-
#pull_in_the_jquery_module ⇒ Object
# === pull_in_the_jquery_module ========================================================================= #.
-
#quote(text, css_class = '', the_id = '', css_style = '') ⇒ Object
# === quote ========================================================================= #.
-
#random_background_image_from(this_directory = Dir.pwd) ⇒ Object
# === random_background_image_from ========================================================================= #.
-
#random_favicon ⇒ Object
# === random_favicon.
-
#raw_favicon_string? ⇒ Boolean
(also: #raw_favicon?, #use_favicon?)
# === raw_favicon_string? ========================================================================= #.
-
#raw_font_size? ⇒ Boolean
(also: #current_font_size?)
# === raw_font_size? ========================================================================= #.
-
#readonly_input(i = nil) ⇒ Object
-
#red(i = '') ⇒ Object
# === red ========================================================================= #.
-
#redirect_to(this_url = 'http://www.w3schools.com') ⇒ Object
# === redirect_to.
-
#render ⇒ Object
(also: #internal_render, #generate_the_main_string, #rebuild_the_main_string, #rebuild_the_HTML_string, #rebuild_main_string, #build_up_the_html_string, #primary_render)
# === render (internal_render tag).
-
#repeat(which_tag = '<br>', how_many_times = '12') ⇒ Object
# === repeat ========================================================================= #.
-
#request_uri? ⇒ Boolean
# === request_uri? ========================================================================= #.
-
#reset ⇒ Object
# === reset (reset tag) ========================================================================= #.
-
#reset_the_body_content ⇒ Object
# === reset_the_body_content ========================================================================= #.
-
#reset_the_result ⇒ Object
# === reset_the_result ========================================================================= #.
-
#result? ⇒ Boolean
(also: #to_html, #main_string?, #string?, #string_that_is_to_be_served?, #html_string?, #to_s)
# === result?.
-
#return_accesskey(accesskey = '') ⇒ Object
# === return_accesskeys ========================================================================= #.
-
#return_assumed_javascript ⇒ Object
# === return_assumed_javascript.
-
#return_copy_to_clipboard_button(use_this_value = 'XXX', use_this_id = 'clipboard_button', hide_the_input_field = false, text_shown_on_the_button = 'Copy text', css_rules_for_the_button = '') ⇒ Object
-
#return_css_for_tetris ⇒ Object
# === return_css_for_tetris.
-
#return_css_style ⇒ Object
# === return_css_style.
-
#return_default_javascript ⇒ Object
# === return_default_javascript ========================================================================= #.
-
#return_favicon_string(i = raw_favicon_string? ) ⇒ Object
(also: #favicon_string?, #favicon_path, #favicon?, #favicon_path?)
# === return_favicon_string.
-
#return_gradient(i) ⇒ Object
(also: #gradient, #gradients)
# === return_gradient (gradient tag).
-
#return_html_comment(i) ⇒ Object
-
#return_html_to_head_start ⇒ Object
# === return_html_to_head_start.
-
#return_javascript(i) ⇒ Object
# === return_javascript.
-
#return_omega_symbol ⇒ Object
(also: #omega_symbol, #omega)
# === return_omega_symbol.
-
#return_omega_symbol_semantics ⇒ Object
# === return_omega_symbol_semantics.
-
#return_stars(n_stars = 1, optional_css_class = '') ⇒ Object
# === return_stars ========================================================================= #.
-
#return_the_body_content ⇒ Object
# === return_the_body_content.
-
#return_the_body_string(optional_css_class = , optional_the_id = , optional_css_style = , optional_body_javascript = body_javascript? ) ⇒ Object
(also: #return_the_body_tag, #return_body_tag, #string_body_start, #start_the_body_tag)
# === return_the_body_string.
-
#return_the_css_classes(css_classes = css_classes? ) ⇒ Object
# === return_the_css_classes.
-
#return_the_CSS_rules_from_the_local_CSS_files(i = Cyberweb::ARRAY_LOCAL_CSS_FILES) ⇒ Object
# === return_the_CSS_rules_from_the_local_CSS_files.
-
#return_the_doctype(optional_language = language? ) ⇒ Object
(also: #return_doctype)
# === return_the_doctype ========================================================================= #.
-
#return_the_id(the_id = '') ⇒ Object
(also: #turn_into_html_id)
# === return_the_id ========================================================================= #.
-
#return_the_jquery_string ⇒ Object
# === return_the_jquery_string ========================================================================= #.
-
#return_this_css_style ⇒ Object
# === return_css_style.
-
#return_this_default_javascript_file(i) ⇒ Object
# === return_this_default_javascript_file.
-
#rpg_favicon ⇒ Object
# === rpg_favicon ========================================================================= #.
-
#ruby_favicon ⇒ Object
# === ruby_favicon ========================================================================= #.
-
#run ⇒ Object
# === run (run tag) ========================================================================= #.
-
#s2(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
(also: #espan, #span)
# === s2 (s2 tag).
-
#science_favicon ⇒ Object
# === science_favicon ========================================================================= #.
-
#sclose(i) ⇒ Object
# === sclose ========================================================================= #.
-
#set_additional_CSS_rules_to_use(i) ⇒ Object
(also: #set_css_style)
# === set_additional_CSS_rules_to_use ========================================================================= #.
-
#set_background(colour = 'black') ⇒ Object
(also: #background_colour, #background_color, #background_color=, #background_colour=, #background)
# === set_background.
-
#set_body_content(i) ⇒ Object
# === set_body_content ========================================================================= #.
-
#set_body_css_class(i = '') ⇒ Object
(also: #body_css_class, #body_css_class=, #body_css_classes, #body_css=, #bcc=, #bcc, #main_body=, #main_body, #body=, #body, #b1=, #b1)
# === set_body_css_class.
-
#set_body_css_style(i) ⇒ Object
(also: #body_css, #body_css_style, #body_css_style=, #body_style=, #body_style, #bcs=, #bcs, #css1=, #css1)
# === set_body_css_style.
-
#set_body_id(i = '') ⇒ Object
(also: #body_id, #body_id=, #id=, #id)
# === set_body_id (id tag).
-
#set_encoding_to_use(i = :default) ⇒ Object
(also: #charset)
# === set_encoding_to_use.
-
#set_favicon(i = 'RPG/RPG_FAVICON.png') ⇒ Object
(also: #favicon=, #favicon, #fav=, #fav, #f=, #f, #set_favicon_string, #print_favicon)
# === set_favicon.
-
#set_font_size(this_font_size = 'default') ⇒ Object
(also: #font_size=, #font_size, #use_this_font_size)
# === set_font_size.
-
#set_n_total_lines(i = result? ) ⇒ Object
# === set_n_total_lines ========================================================================= #.
-
#set_raw_font_size(i) ⇒ Object
# === set_raw_font_size ========================================================================= #.
-
#set_result(i = '') ⇒ Object
(also: #set_main_string, #set_string, #set_string_that_is_to_be_served)
# === set_result.
-
#set_shall_we_use_jquery(i) ⇒ Object
# === set_shall_we_use_jquery ========================================================================= #.
-
#set_title(i) ⇒ Object
# === set_title ========================================================================= #.
-
#set_use_these_css_classes(i) ⇒ Object
# === set_use_these_css_classes ========================================================================= #.
-
#set_web_title(i = filename? ) ⇒ Object
(also: #set_use_this_title, #t, #t=, #title=)
# === set_web_title (title tag).
-
#shall_we_add_the_meta_content? ⇒ Boolean
# === shall_we_add_the_meta_content? ========================================================================= #.
-
#shall_we_use_jquery? ⇒ Boolean
(also: #use_jquery?)
# === shall_we_use_jquery? ========================================================================= #.
-
#show_pdf(i) ⇒ Object
# === show_pdf ========================================================================= #.
-
#show_the_lines? ⇒ Boolean
# === show_the_lines? ========================================================================= #.
-
#show_this_svg(i) ⇒ Object
# === show_this_svg ========================================================================= #.
-
#sin_file(i, css_class = 'orange BO') ⇒ Object
# === sin_file ========================================================================= #.
-
#sitelibdir? ⇒ Boolean
# === sitelibdir?.
-
#sitemap_favicon ⇒ Object
# === sitemap_favicon ========================================================================= #.
-
#slight_indent(i = '', optional_css_class = '') ⇒ Object
(also: #slight_ind, #sind)
# === slight_indent ========================================================================= #.
-
#spacer(i = :middle, optional_css_class = '') ⇒ Object
(also: #trenner, #spalter, #space, #spacer_center, #beautiful_spacer, #fancy_spacer, #fancy_separator)
# === spacer (spacer tag) ========================================================================= #.
-
#string_bold(i = '', optional_css_class = '', optional_the_id = '') ⇒ Object
(also: #stringbold)
# === string_bold ========================================================================= #.
-
#string_link(i = '', option_hash = {}, &block) ⇒ Object
(also: #string_a, #string_href, #string_remote_link, #slink, #remote_hyperlink)
# === string_link.
-
#string_s2(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
(also: #string_s, #string_span, #string_espan, #return_span, #sspan)
# === string_s2.
-
#string_table11_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === string_table11_with_heading ========================================================================= #.
-
#string_table2(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === string_table2.
-
#string_table2_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === string_table2_with_heading ========================================================================= #.
-
#string_table3(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
# === string_table3.
-
#string_table4(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === string_table4 ========================================================================= #.
-
#string_table5(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === string_table5 ========================================================================= #.
-
#string_table5_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === string_table5_with_heading ========================================================================= #.
-
#string_table6(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === string_table6 ========================================================================= #.
-
#string_table7(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === string_table7 ========================================================================= #.
-
#string_table8(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === string_table8 ========================================================================= #.
-
#string_table9(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === string_table9 ========================================================================= #.
-
#string_tag(which_tag = 'span', css_class = '', the_id = '', css_style = '', javascript_code = '', &block) ⇒ Object
(also: #stag, #make_tag, #string_stag)
# === string_tag ========================================================================= #.
-
#string_textarea(default_content = '', css_class = '', the_id = '', css_style = '', n_cols = 25, n_rows = 8, javascript = '', name = '', &block) ⇒ Object
# === string_textarea ========================================================================= #.
-
#svg_link(i) ⇒ Object
# === svg_link ========================================================================= #.
-
#table(optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
# === table ========================================================================= #.
-
#table11_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === table11_with_heading ========================================================================= #.
-
#table12_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === table12_with_heading ========================================================================= #.
-
#table2(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
# === table2 (table2 tag).
-
#table2_from_this_file(optional_css_class = '', optional_the_id = '', optional_css_style = '', this_file = 'games_timeline.md', &block) ⇒ Object
# === table2_from_this_file.
-
#table2_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === table2_with_heading ========================================================================= #.
-
#table3(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
# === table3 ========================================================================= #.
-
#table4(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === table4 ========================================================================= #.
-
#table5(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
# === table5 ========================================================================= #.
-
#table5_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === table5_with_heading ========================================================================= #.
-
#table6(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
# === table6 ========================================================================= #.
-
#table7(css_class = '', id = '', css_style = '', *content) ⇒ Object
# === table7 ========================================================================= #.
-
#table8(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === table8 ========================================================================= #.
-
#table9(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
# === table9 ========================================================================= #.
-
#table_clear ⇒ Object
# === table_clear ========================================================================= #.
-
#table_padding=(i = 10) ⇒ Object
# === table_padding= ========================================================================= #.
-
#table_parse(*i) ⇒ Object
# === table_parse ========================================================================= #.
-
#table_set_css_class(i = 'marl2em') ⇒ Object
# === table_set_css_class ========================================================================= #.
-
#tag(this_tag, optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '') ⇒ Object
# === tag ========================================================================= #.
-
#td(content = '', optional_css_class = '', optional_the_id = '') ⇒ Object
# === td.
-
#td_row(array) ⇒ Object
# === td_row.
-
#template1(i) ⇒ Object
# === template1 ========================================================================= #.
-
#textarea(default_content = '', css_class = '', the_id = '', css_style = '', n_cols = 25, n_rows = 8, javascript = '', name = '', &block) ⇒ Object
(also: #textview, #add_write_area, #add_textfield)
# === textarea.
-
#th(optional_input = '') ⇒ Object
# === th.
-
#thead ⇒ Object
# === thead ========================================================================= #.
-
#thick_hr ⇒ Object
# === thick_hr ========================================================================= #.
-
#to_binary(i) ⇒ Object
# === to_binary ========================================================================= #.
-
#tr ⇒ Object
# === tr.
-
#trtd(optional_input = '', optional_css_class = '', &block) ⇒ Object
# === trtd.
-
#unicode_plus_minus ⇒ Object
# === unicode_plus_minus ========================================================================= #.
-
#upcase_the_title ⇒ Object
# === upcase_the_title ========================================================================= #.
-
#use_body_tag? ⇒ Boolean
# === use_body_tag? ========================================================================= #.
-
#use_english ⇒ Object
(also: #do_use_english)
# === use_english ========================================================================= #.
-
#use_german ⇒ Object
# === use_german.
-
#use_iso_encoding ⇒ Object
# === use_iso_encoding.
-
#use_local_CSS_files? ⇒ Boolean
(also: #use_the_internal_CSS_files?, #use_internal_css_files?)
# === use_local_CSS_files? ========================================================================= #.
-
#use_monospace_font(use_this_font = '"Lucida Console", Monaco, monospace') ⇒ Object
(also: #monospace_font)
# === use_monospace_font.
-
#wasserstoff ⇒ Object
# === wasserstoff ========================================================================= #.
-
#we_have_not_yet_served_the_web_content ⇒ Object
# === we_have_not_yet_served_the_web_content ========================================================================= #.
-
#we_have_now_already_served_the_web_content ⇒ Object
# === we_have_now_already_served_the_web_content ========================================================================= #.
-
#web_title? ⇒ Boolean
(also: #title?)
# === web_title?.
-
#white_font ⇒ Object
# === white_font ========================================================================= #.
-
#wings_favicon ⇒ Object
# === wings_favicon ========================================================================= #.
-
#wlan_favicon ⇒ Object
(also: #favicon_wlan)
# === wlan_favicon ========================================================================= #.
Methods inherited from Base
#be_verbose, #be_verbose?, #cascading_style_sheets_directory?, #cd, #commandline_mode?, #copyright?, #css_comment, #delete_directory, #do_toggle, #echo_raw, #filename?, #full_path_to_image_directory?, #html_colours?, #html_image, #img_dir?, #infer_the_namespace, #initialize_the_configuration, #is_a_file?, #is_a_video_file?, #is_an_image_file?, #is_on_roebe?, #last_tag_used?, #last_tag_used_first_element?, #last_tag_used_id?, #mkdir, #mode?, #namespace?, #open_in_browser, #opne, #opnn, #remove_comments_from_this_string_but_preserve_CSS_rules, #remove_html, #return_all_directories, #return_date, #return_program_name, #return_pwd, #ruby_header?, #server_base_directory?, #set_commandline_mode, #set_last_tag_used, #update_the_image_directory, #use_this_relative_directory_for_custom_images?, #www_mode?
#copy_this_file, #cpr, #delete_file, #filename_without_extension?, #read_file_via_utf8_encoding
Methods included from BaseModule
#attach_these_constants, #base_dir?, #beautiful_url, #cd, #create_the_internal_hash, #doctype?, #ensure_main_encoding, #esystem, #html_templates, #initialize_the_config_if_the_config_hash_is_empty, #internal_hash?, #log_dir?, #no_http, #random_alphabet_characters, #rds, #remove_comments_from_this_string, #remove_numbers, #require_the_html_templates, #require_these, #return_file_size_in_kb_of, #ruby_sitelib_dir?, #sanitize_this_id, #server_base_directory?, #string_remote_image, #today?, #try_to_require_rack, #try_to_require_the_open_gem, #write_what_into
#content_type_is_html, #content_type_is_jpeg, #content_type_is_json, #content_type_is_plain_text
#append_to_the_commandline_arguments, #commandline_arguments?, #first_argument?, #parse_these_commandline_arguments, #second_argument?, #set_commandline_arguments
#all_html_colours, #lightgreen, #rev, #sdir, #sfancy, #sfile, #simp, #steelblue, #tomato
Constructor Details
#initialize(commandline_arguments = ARGV, run_already = true, &block) ⇒ HtmlTemplate
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/cyberweb/html_template/html_template.rb', line 67
def initialize(
commandline_arguments = ARGV,
run_already = true,
&block
)
reset
set_commandline_arguments(
commandline_arguments
)
if commandline_arguments.is_a? String
set_body_content(commandline_arguments)
elsif commandline_arguments.is_a? Array
set_body_content(commandline_arguments.join(' ').strip)
elsif commandline_arguments.is_a? Hash
parse_this_hash(commandline_arguments)
end
if block_given?
yielded = yield
if yielded.is_a? Symbol
send(yielded)
else
parse_this_hash(yielded)
end
end
run if run_already
end
|
Class Method Details
.[](i = ARGV, &block) ⇒ Object
#
Cyberweb::HtmlTemplate[]
#
6998
6999
7000
7001
7002
7003
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6998
def self.[](
i = ARGV,
&block
)
new(i, &block)
end
|
Instance Method Details
#a(i = '', option_hash = {}) ⇒ Object
Also known as:
link, link_to, alink, remote_link
#
a (a tag, link tag)
This method essentially refers to the <a> tag.
If the first input argument is a Symbol then we will tap into BeautifulUrl,via Cyberweb.beautiful_url().
#
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3281
def a(
i = '',
option_hash = {}
)
if i.is_a? Symbol
i = beautiful_url(i)
if option_hash.is_a? String
option_hash = { content: option_hash }
end
end
if show_the_lines?
@internal_hash[:counter_for_show_the_lines] += 1
ee '<b class="darkblue">'+
@internal_hash[:counter_for_show_the_lines].to_s+')</b> '
end
if i.start_with?(Cyberweb.base_directory?)
i = i.dup if i.frozen?
i.sub!(
/^#{Cyberweb.base_directory?}/,
Cyberweb.convert_n_relative_slashes_to_relative_directory
)
end
add_to_body_tag_nl(
string_link(i, option_hash)
)
end
|
#add_content_type_html ⇒ Object
#
add_content_type_html
#
1369
1370
1371
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1369
def add_content_type_html
add :content_type_plain
end
|
#
This method will add the given input as HTML comment into the web-object at hand.
For instance, this method will add something like “foobar” as “<!– foobar –>n” precisely.
For now this will only append a HTML comment onto the <body> tag. In the future we may want to change this to allow a HTML comment anywhere on a .html page, but I am not certain this is that important really.
#
428
429
430
431
432
433
434
|
# File 'lib/cyberweb/html_template/html_template.rb', line 428
def (
i = ''
)
append_onto_the_body_content_nl(
(i)
)
end
|
#add_javascript_file(i, optional_use_this_onload_function = nil) ⇒ Object
#
add_javascript_file
This will show the javascript-file as-is. It can only be used for javascript code that is bundled within the cyberweb project, as-is.
In August 2023 the above restriction has been lessened. It is now also possible to pass a remote URL into this method.
#
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1228
def add_javascript_file(
i,
optional_use_this_onload_function = nil
)
if i.is_a? Symbol
case i
when :simple_calculator
i = File.absolute_path(
project_base_dir?+'javascript_code/simple_calculator.js'
)
end
if i and File.exist?(i)
i = File.read(i)
end
end
opening_tag = '<script'.dup
if i and i.is_a?(String) and i.start_with?('http')
opening_tag << ' src="'+i+'"'
i = '' end
if optional_use_this_onload_function
opening_tag << ' onload="'+optional_use_this_onload_function.to_s+'"'
end
opening_tag << ">\n"
append_onto_the_body_tag_nl(
opening_tag+
i.to_s+
"</script>\n"
)
end
|
#add_omega_symbol ⇒ Object
2805
2806
2807
2808
2809
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2805
def add_omega_symbol
append_onto_the_body_tag_nl(
return_omega_symbol
)
end
|
#add_omega_symbol_semantics ⇒ Object
#
add_omega_symbol_semantics
#
3798
3799
3800
3801
3802
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3798
def add_omega_symbol_semantics
append_onto_the_body_tag_nl(
return_omega_symbol_semantics
)
end
|
#
This will instantly append onto @_.
#
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1378
def add_relevant_meta_entries(
honour_checks = true
)
case honour_checks
when :ignore_checks
honour_checks = false
end
if honour_checks and use_unicode?
add_unicode_charset
else
add_unicode_charset
end
end
|
#add_svg_table(i = 'fancy_table') ⇒ Object
4633
4634
4635
4636
4637
4638
4639
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4633
def add_svg_table(
i = 'fancy_table'
)
append_onto_the_body_tag_nl(
Cyberweb.return_svg_table(i)
)
end
|
#add_the_content_from_the_default_js_files ⇒ Object
#
add_the_content_from_the_default_js_files
This method will add the content of all local javascript files that we wish to add onto the HtmlTemplate at hand.
#
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6385
def add_the_content_from_the_default_js_files
if @internal_hash[:javascript_code].nil? @internal_hash[:javascript_code] = ''.dup
end
@internal_hash[:js_files_to_load].each {|this_file|
target_file = "#{Cyberweb.project_directory?}javascript_code/#{this_file}"
if File.exist? target_file
@internal_hash[:javascript_code] << "#{File.read(target_file, encoding: 'UTF-8')}#{N}"
end
}
end
|
#add_this_div(optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '') ⇒ Object
#
add_this_div
This method will call append_onto_the_body_nl(), so it is just syntactic sugar really.
#
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
# File 'lib/cyberweb/html_template/html_template.rb', line 810
def add_this_div(
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
optional_javascript = ''
)
if optional_css_class.include? '#'
optional_css_class = check_this_css_class_for_select_rules(optional_css_class)
end
append_onto_the_body_nl(
Cyberweb.string_div(
optional_css_class,
optional_the_id,
optional_css_style,
optional_javascript
)
)
end
|
#add_this_remote_css_page(i) ⇒ Object
Also known as:
css_remote_url, external_stylesheet, remote_css, add_remote_css_page, css_file=, add_css_file, css_file, external_style_sheet
#
add_this_remote_css_page
Use this method in order to include a remote css file.
The argument to this method should be the remote URL for the .css file that you wish to access.
Please use use this method solely for remote URLs.
Specific Usage Example:
css_remote_url 'https://www.playgroundblues.com/media/stylesheets/screen.css'
#
6352
6353
6354
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6352
def add_this_remote_css_page(i)
@internal_hash[:link_in_these_remote_CSS_files] << i
end
|
#add_unicode_charset ⇒ Object
3435
3436
3437
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3435
def add_unicode_charset
append_this_to_the_meta_collection('<meta charset="UTF-8">')
end
|
#additional_CSS_rules_to_use? ⇒ Boolean
Also known as:
main_CSS_rules?
#
additional_CSS_rules_to_use?
#
1874
1875
1876
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1874
def additional_CSS_rules_to_use?
@internal_hash[:additional_CSS_rules_to_use]
end
|
#advanced_handle_these_calls_for_english ⇒ Object
#
advanced_handle_these_calls_for_english
Note that the alias english() does not work here.
#
1460
1461
1462
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1460
def advanced_handle_these_calls_for_english
complex_handle_this_language(:english)
end
|
#advanced_handle_these_calls_for_german ⇒ Object
#
advanced_handle_these_calls_for_german
#
1451
1452
1453
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1451
def advanced_handle_these_calls_for_german
complex_handle_this_language(:german)
end
|
#already_served? ⇒ Boolean
Also known as:
already_served, served?
#
already_served?
Whether we already did serve the webpage or not.
#
2346
2347
2348
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2346
def already_served?
@internal_hash[:already_served]
end
|
#alt_text_or_no_alt_text(i) ⇒ Object
#
alt_text_or_no_alt_text
#
3683
3684
3685
3686
3687
3688
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3683
def alt_text_or_no_alt_text(i)
unless i.to_s.empty?
i = " alt=\"#{i}\""
end
return i
end
|
#angstrom? ⇒ Boolean
Also known as:
angstrom
3143
3144
3145
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3143
def angstrom?
'Å'
end
|
#append_after_the_closing_body_tag(i) ⇒ Object
#
append_after_the_closing_body_tag
This method can be used to append content after the closing </body> tag.
#
6803
6804
6805
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6803
def append_after_the_closing_body_tag(i)
@internal_hash[:append_after_the_closing_body_tag] << i
end
|
#append_newline ⇒ Object
1501
1502
1503
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1501
def append_newline
body_addnl('') end
|
#append_onto_the_body_content(i, append_a_newline = false) ⇒ Object
Also known as:
append_onto_the_body_tag, addl
#
append_onto_the_body_content
This method will append onto the variable @internal_hash.
The second argument determines whether a newline will be appended or not.
#
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1661
def append_onto_the_body_content(
i,
append_a_newline = false
)
case append_a_newline
when :use_a_newline
append_a_newline = true
end
case i
when :br
i = '<br>'
end
if append_a_newline
i = i.to_s unless i.is_a?(String)
i = i.dup if i.frozen?
i << "\n"
end
@internal_hash[:body_content] << "#{i}"
end
|
#append_onto_the_body_css_class(i) ⇒ Object
Also known as:
append_onto_the_default_body_CSS_class
#
append_onto_the_body_css_class
This helper-method can be used to append onto the <body> CSS class.
#
2188
2189
2190
2191
2192
2193
2194
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2188
def append_onto_the_body_css_class(i)
if @internal_hash[:body_css_class].frozen?
@internal_hash[:body_css_class] = @internal_hash[:body_css_class].dup
end
@internal_hash[:body_css_class] << " #{i}"
@internal_hash[:body_css_class].strip!
end
|
#append_onto_the_js_files_to_load(i) ⇒ Object
Also known as:
javascript_src, load_this_external_javascript_file
#
append_onto_the_js_files_to_load
This method accepts a path to a .js file and adds it onto the Cyberweb instance.
If it is a .js file that is distributed by the cyberweb gem then you only have to provide its name, not the full path. This is mostly a convenience feature.
#
1942
1943
1944
1945
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1942
def append_onto_the_js_files_to_load(i)
@internal_hash[:js_files_to_load] << i
@internal_hash[:js_files_to_load].flatten!
end
|
#append_onto_the_main_CSS_rules(i) ⇒ Object
Also known as:
css_class, add_to_css, add_to_CSS, add_to_main_CSS, add_onto_the_CSS_rules, css_style, css_style=, append_CSS, append_CSS_style, main_css_class, main_css_style, main_css, main_style, css_main_style, css_classes, c_style=, c_class=, general_css=, css=, c1=, c1, css_template=, css_main, css_main_class, css_code, inline_css, append_to_css_style, add_css_style, append_onto_CSS, append_onto_the_CSS_rules, append_to_CSS, append_these_CSS_rules, append_onto_the_CSS_style, add_this_css_style, add_to_CSS_rules, estyle
#
append_onto_the_main_CSS_rules
This method can be used to add custom CSS rules for the given webpage at hand. In other words: it can be used to define a CSS style for the given web object.
If the last four characters of the provided argument to this method end with ‘.css’ then this method will try to read the file specified therein. (In this case we assume that it must be a .css file that was passed into this method.)
Symbols are treated in a special way, as far as this method here is concerned. For instance, :template1, :template2 and so forth are valid arguments to this method. Alternatively, you can pass in a String, or embed the template-variants via a format such as ‘#TEMPLATE1#’, which will be substituted with whatever :template1 would normally return normally.
This allows us to use APIs such as:
append_onto_the_main_CSS_rules(:template1)
.css_style = :template1
#
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6887
def append_onto_the_main_CSS_rules(i)
if i.is_a? Symbol
case i
when :default,
:template,
:template1,
:css_template1
i = ("Generated via `append_onto_the_main_CSS_rules(:#{i})` on #{today?}")+
TEMPLATE1 when :template2
i = ("Generated via `append_onto_the_main_CSS_rules(:#{i})` on #{today?}")+
TEMPLATE2
when :code
i = ("Generated via `append_onto_the_main_CSS_rules(:#{i})` on #{today?}")+
CODE_TEMPLATE
when :template_ruby_regex
i = ("Generated via `append_onto_the_main_CSS_rules(:#{i})` on #{today?}")+
TEMPLATE_RUBY_REGEX
end
end
if @internal_hash[:additional_CSS_rules_to_use].frozen?
@internal_hash[:additional_CSS_rules_to_use] = @internal_hash[:additional_CSS_rules_to_use].dup
end
if i.include?('#TEMPLATE1') or i.include?('#READ_FILE')
i = i.dup if i.frozen?
i.gsub!(/#TEMPLATE1/, TEMPLATE1) if i.include?('#TEMPLATE1')
if i.include?('#READ_FILE')
target = i.strip.sub(/#READ_FILE /,'')
target = File.absolute_path(target)
file_content = File.read(target)
i.prepend(file_content)
end
end
if i and i.end_with?('.css') and use_the_internal_CSS_files? i = readlines(i).join('') if File.exist?(i)
end
@internal_hash[:additional_CSS_rules_to_use] << i
end
|
#append_onto_the_main_javascript_variable(i) ⇒ Object
#
append_onto_the_main_javascript_variable
#
1107
1108
1109
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1107
def append_onto_the_main_javascript_variable(i)
@internal_hash[:javascript_code] << i
end
|
#append_path_to_dragula_js_file ⇒ Object
#
append_path_to_dragula_js_file
#
1951
1952
1953
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1951
def append_path_to_dragula_js_file
append_onto_the_js_files_to_load('dragula.js')
end
|
#append_raw(i = "\n") ⇒ Object
Also known as:
_, add_to_main_string, append, add
#
append_raw (add tag)
This is the general append-method for whenever we seek to append onto the main String, stored under :result, of this class.
Since as of August 2023 this method is no longer that important; it is kept mostly for legacy reasons now.
#
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4240
def append_raw(i = "\n")
case i
when :newline,
:use_a_newline
i = NL
when :body
i = return_body_tag(optional_css_class).dup
when :content_type_plain
i = Cyberweb::CONTENT_TYPE_PLAIN
end
if i
if i.is_a? Symbol
i = "<#{i}>".dup elsif i.is_a? Numeric
i = i.to_s.dup
elsif i.respond_to?(:is_an_objectified_html_tag?) and
i.is_an_objectified_html_tag?
i = i.string?
end
if i.is_a?(String) and i.frozen?
i = i.dup
end
end
if i.nil?
i = ''.dup
end
@internal_hash[:result] << i
end
|
#append_this_to_the_body_css(i) ⇒ Object
Also known as:
append_to_body_css_style
#
append_this_to_the_body_css
#
5361
5362
5363
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5361
def append_this_to_the_body_css(i)
@internal_hash[:body_css_style] << i.to_s
end
|
5233
5234
5235
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5233
def append_this_to_the_meta_collection(i)
@internal_hash[:meta_content] << "#{i}\n"
end
|
#append_to_cmd1(i = '') ⇒ Object
Also known as:
append_cmd1
#
append_to_cmd1
This method will append to cmd1, by wrapping over a toplevel-method.
#
#append_to_cmd2(i = '') ⇒ Object
#append_to_cmd3(i = '') ⇒ Object
#append_to_cmd4(i = '') ⇒ Object
#append_to_cmd5(i = '') ⇒ Object
#area(shape = :rect, coords = '92,39,104,140', href_to_use = '') ⇒ Object
#
area
This does an area on an image. DO NOT FORGET TO USE usemap IN YOUR IMAGE!
The coords for rect are:
left, top, right, bottom
(Die Ecke oben links: x1, y1, und die Ecke unten rechts: x2, y2) for circ they are: centerx,centery,radius for poly they are: x1,y1,x2,y2,..,xn,yn
Usage Examples:
area :rect, '242'
#
3602
3603
3604
3605
3606
3607
3608
3609
3610
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3602
def area(
shape = :rect,
coords = '92,39,104,140',
href_to_use = ''
)
append_onto_the_body_tag_nl(
'<area shape="'+shape.to_s+'" coords="'+coords+'" href="'+href_to_use+'"/>'
)
end
|
#arrow_right?(i = '', optional_css_class = '') ⇒ Boolean
Also known as:
arrow_right, rarrow, rarrow?, string_rarrow?, string_rarrow
#
arrow_right?
This method basically returns a right arrow, that is, the Unicode String ‘→’.
Since as of April 2023, this method has two modus operandi:
(1) the default variant is to just return a right arrow. This
will be the case when no argument is passed to the method.
(2) if an input argument was given, then right_arrow will be
combined via the method e(), thus achieving output onto
the webpage at hand.
#
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4397
def arrow_right?(
i = '',
optional_css_class = ''
)
_ = Cyberweb.right_arrow
if i.empty?
return _
else
e("#{_}#{i}", optional_css_class)
end
end
|
#audio(url = '', optional_autoplay = false) ⇒ Object
#
audio
This method essentially creates an “audio” tag, for playing an audio file.
#
5880
5881
5882
5883
5884
5885
5886
5887
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5880
def audio(
url = '',
optional_autoplay = false
)
append_onto_the_body_nl(
Cyberweb.audio(url, optional_autoplay)
)
end
|
#background_image=(i = '/blaaa/foo.png', name_of_img_dir = name_of_img_dir?,
, path_to_images = Cyberweb.path_to_images?) ⇒ Object
Also known as:
body_background_image, background_image
#
background_image=
Consistently use this method if you wish to set the background image for a webpage.
body {background-image: url("../IMG/");}'
Since as of December 2011, if you pass an argument such as ‘NJOY/#RAND’ then we use this as instruction to fetch a random entry from this directory.
Usage examples:
w.background_image = 'NJOY/#RAND'
w.background_image = 'https://www.w3schools.com/cssref/paper.gif'
#
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
|
# File 'lib/cyberweb/html_template/html_template.rb', line 571
def background_image=(
i = '/blaaa/foo.png',
name_of_img_dir = name_of_img_dir?,
path_to_images = Cyberweb.path_to_images?
)
if i.start_with? 'http'
_ = i.dup
else
_ = "#{name_of_img_dir}/".dup if i.to_s.downcase.include? '#rand' first_part = i.split('#').first
_ << first_part
_ << get_files_from(path_to_images).sample.to_s
else
case i
when :random
_ << Dir[path_to_images+'NJOY/*'].sample.
sub(/\/home\/x\/data\/images\//, '')
else
_ << i
end
end
end
if i.start_with? 'http'
background_img = "background-image: url(#{_});" else
background_img = "background-image: url(#{path_to_images}#{_});".dup background_img << "\nbackground-repeat: no-repeat;"
end
result = <<-EOF
body {
#{background_img}
}
EOF
add_this_css_style(result)
end
|
4696
4697
4698
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4696
def background_scroll
set_background :scroll
end
|
#black_background ⇒ Object
3381
3382
3383
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3381
def black_background
set_background(:black)
end
|
#black_white ⇒ Object
3373
3374
3375
3376
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3373
def black_white
black_background
white_font
end
|
#blockquote(i = '', optional_css_class = '') ⇒ Object
#
blockquote
For documentation about this HTML tag, have a look at:
https://www.w3schools.com/tags/tag_blockquote.asp
#
3522
3523
3524
3525
3526
3527
3528
3529
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3522
def blockquote(
i = '',
optional_css_class = ''
)
append_onto_the_body_nl(
'<blockquote class="'+optional_css_class.to_s+'">'+i+'</blockquote>'
)
end
|
#body_addnl(i = '', &block) ⇒ Object
Also known as:
append_to_body, append_onto_the_body_with_newline, append_onto_the_body_tag_nl, append_onto_the_body_content_nl, append_onto_the_body_nl, append_onto_the_body_content_newline, add_to_body_tag_nl, addlnl, addnl
#
body_addnl
This method will append onto the body-content, while also making sure that there is a trailing newline added to the given input at hand.
This method will ultimately append onto @internal_hash.
#
1346
1347
1348
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1346
def body_addnl(i = '', &block)
append_onto_the_body_content(i, :use_a_newline, &block)
end
|
#body_content? ⇒ Boolean
Also known as:
body?, body_string?
5650
5651
5652
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5650
def body_content?
@internal_hash[:body_content]
end
|
#body_css_class? ⇒ Boolean
2008
2009
2010
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2008
def body_css_class?
@internal_hash[:body_css_class]
end
|
#body_css_style? ⇒ Boolean
4292
4293
4294
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4292
def body_css_style?
@internal_hash[:body_css_style]
end
|
#body_javascript=(this_javascript = '') ⇒ Object
Also known as:
onload=, onload, body_onload=, body_javascript
#
body_javascript=
This method sets the @body_javascript ivar. This variable will be used for making the <body> of a HTML page, at the least to JavaScript that is associated with the <body> tag. Normally this is not in use for most webpages though.
As of September 2011 it is required that the last character is a ‘;’. If this is not the case it will be appended.
Usage example:
w.body_onload = 'draginit()'
#
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5720
def body_javascript=(
this_javascript = ''
)
@internal_hash[:body_javascript] << this_javascript
if @internal_hash[:body_javascript] and @internal_hash[:body_javascript].end_with?(';')
else
if @internal_hash[:body_javascript].frozen?
@internal_hash[:body_javascript] = @internal_hash[:body_javascript].dup
end
@internal_hash[:body_javascript] << ';'
end
end
|
#body_javascript? ⇒ Boolean
5700
5701
5702
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5700
def body_javascript?
@internal_hash[:body_javascript]
end
|
#bold(i = '', optional_css_class = '', optional_the_id = '') ⇒ Object
Also known as:
b
#
bold
This method will “create” an equivalent to the bold-tag.
It must also keep backwards compatibility to invocations such as:
b 'Foobar:','yel'
#
3462
3463
3464
3465
3466
3467
3468
3469
3470
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3462
def bold(
i = '',
optional_css_class = '',
optional_the_id = ''
)
append_onto_the_body_tag_nl(
string_bold(i, optional_css_class, optional_the_id)
)
end
|
#boldbr(i, optional_css_class = '', optional_the_id = '') ⇒ Object
Also known as:
bbr, ebold
3495
3496
3497
3498
3499
3500
3501
3502
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3495
def boldbr(
i,
optional_css_class = '',
optional_the_id = ''
)
bold(i, optional_css_class, optional_the_id)
br
end
|
#br ⇒ Object
Also known as:
nbr
5575
5576
5577
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5575
def br
append_onto_the_body_tag_nl(:br)
end
|
#
brbr
This simply combines two calls to br().
#
3770
3771
3772
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3770
def brbr
br; br
end
|
#build_up_the_result ⇒ Object
Also known as:
create_the_main_string
#
build_up_the_result (main tag)
This method, called from within render(), will build up the full HTML string. This is the String that can be returned/served to a visitor of a website, or stored into a local .html file.
Everything will be appended onto the result-variable, called @internal_hash. This is ensured via the method call set_result().
This method is just about the most important method for class Cyberweb::WebObject too.
#
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6490
def build_up_the_result
case @internal_hash[:special_actions]
when :use_raw_body
set_result(body_content?.to_s)
else
_ = ''.dup
_ << return_the_doctype(language?)
_ << "<head>\n" _ << "#{html_title?}\n" if web_title?
if shall_we_add_the_meta_content?
_ << meta_content?
end
if shall_we_use_jquery?
_ << return_the_jquery_string
end
if use_favicon?
_ << '<link rel="icon" type="image/png" href="'+use_favicon?.to_s+'"/>'+"\n"
end
assumed_javascript = return_assumed_javascript
_ << "#{assumed_javascript}\n" unless assumed_javascript.empty?
@internal_hash[:link_in_these_remote_CSS_files].each {|this_remote_CSS_file|
_ << '<link rel="stylesheet" href="'+this_remote_CSS_file.to_s+'" type="text/css" media="screen">'+"\n"
}
_ << consider_returning_the_css_style _ << "</head>\n" _ << (
'The font size in use is: '+current_font_size?.to_s.rstrip
)
if use_body_tag?
_ << return_the_body_tag end
frame_string = @internal_hash[:frame_string]
_ << frame_string if frame_string and !frame_string.empty?
_ << return_the_body_content
_ << "</body>\n" _ << '</html>' prepend_this = @internal_hash[:prepend_before_the_body_tag]
unless prepend_this.empty?
_[0,0] = prepend_this
end
append_this = @internal_hash[:append_after_the_closing_body_tag]
unless append_this.empty?
_ << append_this
end
set_result(_) set_n_total_lines
end
end
|
#
This method will “generate” a HTML button. Since as of October 2022 this uses its own HTML element; before that input(:button) was in use.
The following example shows how this method could be used:
button {{
text: 'Hey there!'
}}
A slightly more advanced example is the following variant:
button {{
text: 'Hey there - with more css and a Hello World alert-box in javascript when clicked by the user!',
css_class: 'bblack1 darkgreen pad8px BOLD',
javascript_function: 'msg("Hello world!!!")'
}}
Here is another variant, by specifically responding to a click-event, to call a specific function:
button {{
text: 'Click here'
css_class: 'bblack1 pad8px'
on_click_event: :on_click_event_hello_world
}}
And yet another variant, similar to the one above:
button {{
text: 'Refresh this page',
css_class: 'bblack2 pad5px marl1em',
on_click: :reload_this_page
}}
And another variant, without a block:
button text: 'OK!',
css_class: 'glow_on_hover'
#
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6449
def button(
optional_text = '',
optional_css_class = '',
&block
)
_ = HtmlTags.button(
optional_text,
optional_css_class,
&block
)
append_onto_the_body_tag_nl(_)
end
|
#call(env = nil) ⇒ Object
#
call (call tag)
Rack expects an application to be an object with a .call() method accepting env (hash containing all the information about a request) and returning a 3-element tuple.
Note that Rack expects the body portion of the response array to respond to .each(), so bare strings have to be wrapped into an Array
The structure for this Array should be as follows:
[status_code, , body_array]
#
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3341
def call(
env = nil
)
internal_render
result = main_string?
[
200, {
'Content-Type' => 'text/html',
'Content-Length' => result.size },
[result] ]
end
|
3997
3998
3999
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3997
def cbody
close(:body)
end
|
4132
4133
4134
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4132
def cdiv
close(:div)
end
|
4095
4096
4097
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4095
def cdl
close(:dl)
end
|
#cfieldset ⇒ Object
4081
4082
4083
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4081
def cfieldset
close(:fieldset)
end
|
4074
4075
4076
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4074
def cform
close(:form)
end
|
#cframeset ⇒ Object
4004
4005
4006
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4004
def cframeset
close(:frameset)
end
|
#check_this_css_class_for_select_rules(optional_css_class) ⇒ Object
#
check_this_css_class_for_select_rules
#
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
|
# File 'lib/cyberweb/html_template/html_template.rb', line 779
def check_this_css_class_for_select_rules(
optional_css_class
)
if optional_css_class.include? 'ON_TEXT_SELECT'
regex_to_use = /#ON_TEXT_SELECT_COLOU?R_(.+)_BACKGROUND_COLOUR_(.+)/ optional_css_class =~ regex_to_use
colour = $1.to_s.dup.downcase
background_colour = $2.to_s.dup.downcase
optional_css_class = optional_css_class.dup optional_css_class.sub!(regex_to_use, "selection_colour_#{colour}_background_colour_#{background_colour}")
complete_css_rule = <<-EOF
.selection_colour_#{colour}_background_colour_#{background_colour}::selection {
background-color: #{colour};
color: #{background_colour};
}
EOF
append_onto_the_CSS_rules(complete_css_rule)
return optional_css_class
end
return optional_css_class
end
|
3981
3982
3983
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3981
def chtml
close(:html)
end
|
#circle(hash = {
height: 150,
colour: :yellow,
radius: :quarter_default_width,
stroke_width: 10
}) ⇒ Object
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3534
def circle(
hash = {
height: 150,
colour: :yellow,
radius: :quarter_default_width,
stroke_width: 10
}
)
_ = Cyberweb.circle(hash)
append_onto_the_body_tag_nl(_)
end
|
4125
4126
4127
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4125
def clabel
close(:label)
end
|
#clear_left ⇒ Object
3759
3760
3761
3762
3763
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3759
def clear_left
append_onto_the_body_tag_nl(
'<br style="clear: left;" />'
)
end
|
#clear_the_main_string ⇒ Object
Also known as:
reset_the_main_string, reset_main_string, reset_result
#
clear_the_main_string
The simple purpose of this method is to reset the main string variable.
#
4337
4338
4339
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4337
def clear_the_main_string
main_string?.clear end
|
4060
4061
4062
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4060
def clegend
close(:legend)
end
|
4018
4019
4020
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4018
def cli
close(:li)
end
|
#close(i) ⇒ Object
Also known as:
c
#
close (close tag)
The close() method will always call the other method called append_onto_the_body_nl(). It is thus a rather generic method, used by several other methods of this class.
#
3964
3965
3966
3967
3968
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3964
def close(i)
append_onto_the_body_nl(
sclose(i)
)
end
|
#close_a ⇒ Object
Also known as:
ca
4067
4068
4069
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4067
def close_a
close(:a)
end
|
#close_html ⇒ Object
3973
3974
3975
3976
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3973
def close_html
cbody
chtml
end
|
4032
4033
4034
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4032
def cmap
close(:map)
end
|
#cmd1(content = '', css_rules_to_use = Cyberweb.cmd1_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
cmd, rc1, command
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2968
def cmd1(
content = '',
css_rules_to_use = Cyberweb.cmd1_css_rules?,
optional_id = '',
optional_css_style = '',
&block
)
if block_given? and (yield == :no_break)
ee "#{Cyberweb.cmd1(content, css_rules_to_use, optional_id, optional_css_style)}"
else
ee "#{Cyberweb.cmd1(content, css_rules_to_use, optional_id, optional_css_style)}#{BR}\n"
end
end
|
#cmd1? ⇒ Boolean
Also known as:
cmd?, command1?
#
cmd1?
This method also has a constant as an “alias” to its value.
#
2928
2929
2930
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2928
def cmd1?
Cyberweb.cmd1?
end
|
#cmd1_is(i) ⇒ Object
Also known as:
cmd_is, set_cmd1
2219
2220
2221
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2219
def cmd1_is(i)
Cyberweb.cmd1 = i
end
|
#cmd2(content = '', css_rules_to_use = Cyberweb.cmd2_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
rc2, command2
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2987
def cmd2(
content = '',
css_rules_to_use = Cyberweb.cmd2_css_rules?,
optional_id = '',
optional_css_style = '',
&block
)
if block_given? and (yield == :no_break)
ee "#{Cyberweb.cmd2(content, css_rules_to_use, optional_id, optional_css_style)}"
else
ee "#{Cyberweb.cmd2(content, css_rules_to_use, optional_id, optional_css_style)}#{BR}\n"
end
end
|
#cmd2_is(i) ⇒ Object
Also known as:
set_cmd2
2227
2228
2229
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2227
def cmd2_is(i)
Cyberweb.cmd2 = i
end
|
#cmd3(content = '', css_rules_to_use = Cyberweb.cmd3_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
rc3, command3
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2871
def cmd3(
content = '',
css_rules_to_use = Cyberweb.cmd3_css_rules?,
optional_id = '',
optional_css_style = '',
&block
)
if block_given? and (yield == :no_break)
ee "#{Cyberweb.cmd3(content, css_rules_to_use, optional_id, optional_css_style)}"
else
ee "#{Cyberweb.cmd3(content, css_rules_to_use, optional_id, optional_css_style)}#{BR}\n"
end
end
|
#cmd3_is(i) ⇒ Object
Also known as:
set_cmd3
2234
2235
2236
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2234
def cmd3_is(i)
Cyberweb.cmd3 = i
end
|
#cmd4(content = '', css_rules_to_use = Cyberweb.cmd4_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
rc4, command4
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3102
def cmd4(
content = '',
css_rules_to_use = Cyberweb.cmd4_css_rules?,
optional_id = '',
optional_css_style = '',
&block
)
if block_given? and (yield == :no_break)
ee "#{Cyberweb.cmd4(content, css_rules_to_use, optional_id, optional_css_style)}"
else
ee "#{Cyberweb.cmd4(content, css_rules_to_use, optional_id, optional_css_style)}#{BR}\n"
end
end
|
#cmd4_is(i) ⇒ Object
Also known as:
set_cmd4
2241
2242
2243
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2241
def cmd4_is(i)
Cyberweb.cmd4 = i
end
|
#cmd5(content = '', css_rules_to_use = Cyberweb.cmd5_css_rules?, optional_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
rc5, command5
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3005
def cmd5(
content = '',
css_rules_to_use = Cyberweb.cmd5_css_rules?,
optional_id = '',
optional_css_style = '',
&block
)
if block_given? and (yield == :no_break)
ee "#{Cyberweb.cmd5(content, css_rules_to_use, optional_id, optional_css_style)}"
else
ee "#{Cyberweb.cmd5(content, css_rules_to_use, optional_id, optional_css_style)}#{BR}\n"
end
end
|
#cmd5_is(i) ⇒ Object
Also known as:
set_cmd5
2248
2249
2250
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2248
def cmd5_is(i)
Cyberweb.cmd5 = i
end
|
#cmd_pre(i) ⇒ Object
Also known as:
pre_cmd
3087
3088
3089
3090
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3087
def cmd_pre(i)
splitted = i.split(N)
splitted.each {|entry| cmd(entry) }
end
|
#cmdbold(i = '') ⇒ Object
3068
3069
3070
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3068
def cmdbold(i = '')
cmd(i, 'BOLD mars1em')
end
|
4025
4026
4027
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4025
def cobject
close(:object)
end
|
#col_cmd(i = '', optional_id = '') ⇒ Object
Also known as:
col
3075
3076
3077
3078
3079
3080
3081
3082
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3075
def col_cmd(
i = '',
optional_id = ''
)
ee(
i, Cyberweb.internal_hash?[:col_cmd], optional_id
)
end
|
#colour_gradient_left_to_right(colour1 = :steelblue, colour2 = :darkgreen, css_name_that_will_be_returned = '.gradient1') ⇒ Object
Also known as:
colour_gradient
#
colour_gradient_left_to_right
This method will “return” a CSS class, for a colour-gradient left to right.
#
5155
5156
5157
5158
5159
5160
5161
5162
5163
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5155
def colour_gradient_left_to_right(
colour1 = :steelblue,
colour2 = :darkgreen,
css_name_that_will_be_returned = '.gradient1'
)
return "#{css_name_that_will_be_returned} {
background: linear-gradient(to right, #{colour1}, #{colour2});
}"
end
|
#colour_gradient_right_to_left(colour1 = :steelblue, colour2 = :darkgreen, css_name_that_will_be_returned = '.gradient1') ⇒ Object
#
colour_gradient_right_to_left
This method will “return” a CSS class, for a colour-gradient left to right.
#
766
767
768
769
770
771
772
773
774
|
# File 'lib/cyberweb/html_template/html_template.rb', line 766
def colour_gradient_right_to_left(
colour1 = :steelblue,
colour2 = :darkgreen,
css_name_that_will_be_returned = '.gradient1'
)
return "#{css_name_that_will_be_returned} {
background: linear-gradient(to left, #{colour1}, #{colour2});
}"
end
|
#complex_handle_this_language(i = language?
) ⇒ Object
#
complex_handle_this_language
#
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1467
def complex_handle_this_language(
i = language?
)
case i
when :german
german_trinity
when :english
english_trinity
end
end
|
#consider_appending_when_the_webpage_was_originally_created ⇒ Object
#
consider_appending_when_the_webpage_was_originally_created
#
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2691
def consider_appending_when_the_webpage_was_originally_created
_ = @internal_hash[:additional_meta_collection]
if _ and !_.empty?
(
'This website was originally created on '+
_.scan(/content="(.+)"/).
flatten.first.to_s
)
end
end
|
#consider_returning_the_css_style ⇒ Object
#
consider_returning_the_css_style
This method will basically append the custom CSS rules onto the webpage.
#
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5749
def consider_returning_the_css_style
_ = ''.dup
if raw_font_size?
_ << "\nbody { \nfont-size: #{raw_font_size?};\n}\n\n"
end
special_CSS_classes_to_use = return_the_css_classes
if special_CSS_classes_to_use and !special_CSS_classes_to_use.empty?
_ << special_CSS_classes_to_use
else if use_local_CSS_files?
_ << return_the_CSS_rules_from_the_local_CSS_files
end
end
_ << "#{return_css_style}\n"
return "#{HtmlTags.style(_)}\n" end
|
#counter_eight(i) ⇒ Object
Also known as:
c_eight
4752
4753
4754
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4752
def counter_eight(i)
e "(8) #{i}"
end
|
#counter_five(i) ⇒ Object
Also known as:
c_five
4731
4732
4733
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4731
def counter_five(i)
e "(5) #{i}"
end
|
#counter_four(i) ⇒ Object
Also known as:
c_four
4724
4725
4726
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4724
def counter_four(i)
e "(4) #{i}"
end
|
#counter_nine(i) ⇒ Object
Also known as:
c_nine
4759
4760
4761
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4759
def counter_nine(i)
e "(9) #{i}"
end
|
#counter_one(i) ⇒ Object
Also known as:
c_one
4703
4704
4705
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4703
def counter_one(i)
e "(1) #{i}"
end
|
#counter_seven(i) ⇒ Object
Also known as:
c_seven
4745
4746
4747
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4745
def counter_seven(i)
e "(7) #{i}"
end
|
#counter_six(i) ⇒ Object
Also known as:
c_six
4738
4739
4740
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4738
def counter_six(i)
e "(6) #{i}"
end
|
#counter_ten(i) ⇒ Object
Also known as:
c_ten
4766
4767
4768
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4766
def counter_ten(i)
e "(10) #{i}"
end
|
#counter_three(i) ⇒ Object
Also known as:
c_three
4717
4718
4719
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4717
def counter_three(i)
e "(3) #{i}"
end
|
#counter_two(i) ⇒ Object
Also known as:
c_two
4710
4711
4712
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4710
def counter_two(i)
e "(2) #{i}"
end
|
4139
4140
4141
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4139
def cp
close(:p)
end
|
4053
4054
4055
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4053
def cpre
close(:pre)
end
|
#created_when(i = '20.08.2021') ⇒ Object
Also known as:
created_on, set_created_on
#
created_when
This method can be used to add a meta-tag to the web-object (web-page) at hand.
To read up more about that meta-tag, the following document is recommended:
https://dublincore.org/resources/userguide/publishing_metadata/#dcterms:created
Usage example for the method:
created_when('22.10.2021')
#
2761
2762
2763
2764
2765
2766
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2761
def created_when(
i = '20.08.2021'
)
@internal_hash[:additional_meta_collection] =
'<meta name="DCTERMS.created" content="'+i.to_s+'"/>'
end
|
4046
4047
4048
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4046
def cselect
close(:select)
end
|
#css_class_or_no_class(i = '') ⇒ Object
#
css_class_or_no_class
#
4306
4307
4308
4309
4310
4311
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4306
def css_class_or_no_class(i = '')
unless i.to_s.empty?
i = " class=\"#{i}\""
end
return i
end
|
#css_classes? ⇒ Boolean
1993
1994
1995
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1993
def css_classes?
@internal_hash[:use_only_these_CSS_classes]
end
|
#css_for_cmd1(i = '') ⇒ Object
Also known as:
css_for_cmd
3023
3024
3025
3026
3027
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3023
def css_for_cmd1(
i = ''
)
Cyberweb.css_for_cmd1 = i
end
|
#css_for_cmd2(i = '') ⇒ Object
3032
3033
3034
3035
3036
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3032
def css_for_cmd2(
i = ''
)
Cyberweb.css_for_cmd2 = i
end
|
#css_for_cmd3(i = '') ⇒ Object
3041
3042
3043
3044
3045
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3041
def css_for_cmd3(
i = ''
)
Cyberweb.css_for_cmd3 = i
end
|
#css_for_cmd4(i = '') ⇒ Object
3050
3051
3052
3053
3054
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3050
def css_for_cmd4(
i = ''
)
Cyberweb.css_for_cmd4 = i
end
|
#css_for_cmd5(i = '') ⇒ Object
3059
3060
3061
3062
3063
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3059
def css_for_cmd5(
i = ''
)
Cyberweb.css_for_cmd5 = i
end
|
#css_rule_for_this_background_image(i = :parchment2) ⇒ Object
#
css_rule_for_this_background_image
The following method was added in September 2023. The purpose of this method is to return the valic CSS rule for a background-image.
The method only allows working on local images - such images may be included in the cyberweb gem, to simplify handling some background images. The reason for this is that we currently use a hardcoded path in this method, that is the assumption that all such images will be kept in a local copy of the temp-subdirectory. See below for that hardcoded entry.
#
1063
1064
1065
1066
1067
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1063
def css_rule_for_this_background_image(
i = :parchment2
)
"background-image: url(\"#{converted_path?}Temp/cyberweb/images/#{File.basename(path_to_this_background_image(i))}\");"
end
|
#css_style_or_no_style(i = '') ⇒ Object
#
css_style_or_no_style
#
2727
2728
2729
2730
2731
2732
2733
2734
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2727
def css_style_or_no_style(
i = ''
)
unless i.to_s.empty?
i = " style=\"#{i}\""
end
return i
end
|
#css_template1 ⇒ Object
#
css_template1
Before this method was added in April 2022 I used to invoke the method css_style() via :template1 as the first argument. Using a single method instead, aka css_template1(), made more sense though.
#
3428
3429
3430
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3428
def css_template1
css_style :template1
end
|
4118
4119
4120
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4118
def ctable
close(:table)
end
|
4039
4040
4041
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4039
def ctd
close(:td)
end
|
3988
3989
3990
3991
3992
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3988
def ctdctr
append_onto_the_body_tag_nl(
'</td></tr>'
)
end
|
4109
4110
4111
4112
4113
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4109
def ctdtd
append_onto_the_body_tag_nl(
'</td><td>'
)
end
|
#ctextarea ⇒ Object
4146
4147
4148
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4146
def ctextarea
close(:textarea)
end
|
4102
4103
4104
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4102
def ctr
close(:tr)
end
|
4011
4012
4013
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4011
def cul
close(:ul)
end
|
#current_height? ⇒ Boolean
#
current_height?
This method uses JavaScript to return the current height of the monitor, in n px.
#
3836
3837
3838
3839
3840
3841
3842
3843
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3836
def current_height?
append_onto_the_body_tag_nl(
'<script>
var height = screen.height;
document.write(height)
</script>'
)
end
|
#current_ruby_version? ⇒ Boolean
#
current_ruby_version?
This will return the current ruby sitelib dir version.
Note that the method depends on another method called sitelibdir?().
#
5439
5440
5441
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5439
def current_ruby_version?
sitelibdir?.split('/').last
end
|
#cursor(i = :wait) ⇒ Object
2063
2064
2065
2066
2067
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2063
def cursor(
i = :wait
)
append_onto_the_body_css_class "cursor_#{i}"
end
|
#default_font_size ⇒ Object
Also known as:
use_default_font_size_as_specified_in_the_project_settings
6767
6768
6769
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6767
def default_font_size
font_size(:default_font_size)
end
|
#default_font_size_and_hyperlinks ⇒ Object
Also known as:
default_font_size_and_hyperlink
#
default_font_size_and_hyperlinks
#
6792
6793
6794
6795
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6792
def default_font_size_and_hyperlinks
default_font_size
default_hyperlinks
end
|
#default_hyperlink_behaviour ⇒ Object
#
default_hyperlink_behaviour
This method will add the default-hyperlink behaviour onto the main CSS rules.
#
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4319
def default_hyperlink_behaviour
append_onto_the_main_CSS_rules '
a,
a:link {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
'
end
|
#default_hyperlinks_template1(i = '') ⇒ Object
Also known as:
default_hyperlinks_template, hyperlinks_template1, hyperlinks_template, hyperlink_template1, default_css_template, default_template1, default_template
#
default_hyperlinks_template1
#
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6845
def default_hyperlinks_template1(i = '')
default_hyperlink_behaviour
if i
if use_local_CSS_files?
append_onto_the_main_CSS_rules(i)
else
template1(i)
end
end
end
|
#details(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '', &block) ⇒ Object
#
details
This will return a <details> tag.
#
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3617
def details(
i = '',
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
optional_javascript = '',
&block
)
append_onto_the_body_tag_nl(
return_details(
i,
optional_css_class,
optional_the_id,
optional_css_style,
optional_javascript,
&block
)
)
end
|
#disable_body_tag ⇒ Object
#
disable_body_tag
Use only this method to disable the <body> tag on display.
#
5132
5133
5134
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5132
def disable_body_tag
@internal_hash[:use_body_tag] = false
end
|
#display_this_file(this_file, optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
read_and_display_this_file, read_and_display, read_file_content, embed_this_file, show_this_file, display_file
#
display_this_file
This method can be used to “embed”, aka show, a locally existing file on a webpage.
This method must be able to respond to code such as this:
http://localhost/data/games/ultima/ultima_6/ultima6.cgi
Typical parameters may include this:
embed_this_file('lyxandras.md','','','font-size: 2em;')
display_this_file('/home/x/Temp/opened_files.yml','mar8px pad12px','','font-size: 2.5em;')
#
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
# File 'lib/cyberweb/html_template/html_template.rb', line 355
def display_this_file(
this_file,
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
&block
)
if this_file and File.exist?(this_file)
dataset = File.read(this_file)
dataset = ensure_main_encoding(dataset)
if block_given?
yielded = yield
case yielded
when :use_bold_dates
dataset = dataset.gsub(/(^\d{2}\.\d{2}\.\d{4}$)/,'<b>\1</b>')
when :use_bold_dates_and_larger_font
dataset = dataset.gsub(/(^\d{2}\.\d{2}\.\d{4}$)/,'<b class="larger">\1</b>')
when :strip_the_parts_after_a_comment
dataset = (dataset)
block = nil
end
end
pre(
dataset,
optional_css_class,
optional_the_id,
optional_css_style,
&block
)
else
e "No file exists at #{this_file}. The "\
"current working directory is: #{Dir.pwd}", 'crimson'
end
end
|
#
This method is similar to the method defined above; it will read in the dataset, before it will then remove all parts after ‘ #’ in a given line. Furthermore, any lines starting with ‘#’ will also be removed entirely.
#
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
# File 'lib/cyberweb/html_template/html_template.rb', line 324
def (
this_file,
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
&block
)
display_this_file(
this_file,
optional_css_class = '',
optional_the_id = '',
optional_css_style
) { :strip_the_parts_after_a_comment }
end
|
#div(optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '', &block) ⇒ Object
#
div (div tag)
Input to this method can be in this format:
div(id: 'drag_div_sitemap_table', css_style: 'z-index: 1') {
So the first argument to this method can be a Hash.
#
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
|
# File 'lib/cyberweb/html_template/html_template.rb', line 845
def div(
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
optional_javascript = '',
&block
)
if optional_css_class.is_a? Hash
if optional_css_class.has_key? :css_style
optional_css_style = optional_css_class.delete(:css_style)
end
if optional_css_class.has_key? :id
optional_the_id = optional_css_class.delete(:id)
end
if optional_css_class.has_key? :css_class
optional_css_class = optional_css_class.delete(:css_class)
elsif optional_css_class.has_key? :class
optional_css_class = optional_css_class.delete(:class)
end
if optional_css_class.is_a? Hash
optional_css_class = ''
end
end
add_this_div(
optional_css_class,
optional_the_id,
optional_css_style,
optional_javascript
)
if block_given?
yield
cdiv
end
end
|
#dnd_favicon ⇒ Object
5525
5526
5527
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5525
def dnd_favicon
favicon :dnd_favicon
end
|
#do_not_use_jquery ⇒ Object
2709
2710
2711
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2709
def do_not_use_jquery
@internal_hash[:shall_we_use_jquery] = false
end
|
#do_not_use_local_CSS_files ⇒ Object
Also known as:
do_not_use_the_internal_CSS_files
#
do_not_use_the_internal_CSS_files
#
5354
5355
5356
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5354
def do_not_use_local_CSS_files
@internal_hash[:use_local_CSS_files] = false
end
|
#do_serve ⇒ Object
Also known as:
eserve, erender, print_the_result, display, report, serve_again, serve_webpage, serve, serv, ser, start
#
do_serve (display tag, report tag, render tag, serve tag, main serve)
This method can be used to report (output) the content of the main string (stored in :result, in the primary Hash of this class).
This method always has to set the “already served the web content” variable to true, when called.
You may have to properly build up the main string before invoking this method.
This method will do the actual serving the webpage part.
It can only serve the value that is stored under result?. Since as of May 2023, the main String will be rebuilt whenever this method is called.
#
2458
2459
2460
2461
2462
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2458
def do_serve
render we_have_now_already_served_the_web_content print result?
end
|
#do_shall_we_use_jquery ⇒ Object
Also known as:
do_use_jquery, append_jquery_string
#
do_shall_we_use_jquery
This method will enable the use of jquery.
#
994
995
996
|
# File 'lib/cyberweb/html_template/html_template.rb', line 994
def do_shall_we_use_jquery
@internal_hash[:shall_we_use_jquery] = true
end
|
#do_show_the_lines ⇒ Object
3120
3121
3122
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3120
def do_show_the_lines
@internal_hash[:show_the_lines] = true
end
|
#do_use_local_CSS_files ⇒ Object
#
do_use_local_CSS_files
This method is specifically called by Cyberweb::WebObject.
#
5347
5348
5349
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5347
def do_use_local_CSS_files
@internal_hash[:use_local_CSS_files] = true
end
|
#do_use_utf_charset ⇒ Object
5324
5325
5326
5327
5328
5329
5330
5331
5332
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5324
def do_use_utf_charset
if @internal_hash[:meta_content].nil?
@internal_hash[:meta_content] = ''.dup
end
_ = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'+N
unless @internal_hash[:meta_content].include? _
@internal_hash[:meta_content] << _
end
end
|
#document_ready(i = '$("p").text("Hello World!");') ⇒ Object
#
document_ready
This is specifically for jquery-related javascript code.
#
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1960
def document_ready(
i = '$("p").text("Hello World!");'
)
content = <<-EOF
$(document).ready(function(){
#{i}
});
EOF
ejavascript(content)
end
|
#document_write(i) ⇒ Object
Also known as:
dwrite
#
document_write
This is a simple wrapper over JavaScript’s document.write() functionality.
#
3851
3852
3853
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3851
def document_write(i)
ejavascript 'document.write("'+i.to_s+'")'
end
|
#dropdown_box(i) ⇒ Object
Also known as:
www_dropdown_box, html_dropdown_box
#e(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', show_the_lines = show_the_lines?,
, &block) ⇒ Object
Also known as:
ebr, sbr
#
e (e tag)
This is essentially sbr(), which stands for “string span”, and “breakline”. It is like “puts” in regular ruby really, so a newline will be shown (registered onto the main string).
Note that the method must be able to respond to more than one argument too.
This method must be able to respond to the following code as well:
e('This text should now be editable.') { :editable }
#
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1706
def e(
i = '',
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
show_the_lines = show_the_lines?,
&block
)
_ = ''.dup
if optional_css_class.is_a? Hash
if optional_css_class.has_key? :id
optional_the_id = optional_css_class.delete(:id)
end
if optional_css_class.empty?
optional_css_class = ''
end
end
if optional_css_class and !optional_css_class.empty?
optional_css_class = optional_css_class.to_s if optional_css_class.is_a? Symbol
optional_css_class = optional_css_class.dup if optional_css_class.frozen?
optional_css_class.strip! if optional_css_class
end
if show_the_lines
@internal_hash[:counter_for_show_the_lines] += 1
i.prepend(
'<b class="darkblue">'+
@internal_hash[:counter_for_show_the_lines].to_s+
')</b> '
)
end
_ << string_s2(i, optional_css_class, optional_the_id, optional_css_style)
set_last_tag_used('span', optional_the_id)
if block_given?
yielded = yield
case yielded
when :editable
index = _.index('>')
_ = _.dup if _.frozen?
_[index,0] = ' contenteditable="true" spellcheck="false"'
end
end
sanitized_caller = ensure_main_encoding(caller())
method_name = Cyberweb.return_the_method_name_from_this_array(
sanitized_caller
)
case method_name
when /p_default_le$/
append_onto_the_body_tag_nl(
string_s2(
i,
("#{optional_css_class} l1em").strip,
optional_the_id,
optional_css_style
)
)
br when 'div_default'
append_onto_the_body_tag_nl(_.dup)
br when /p_default$/
append_onto_the_body_tag_nl(_.dup)
br when 'div_default_le'
append_onto_the_body_tag_nl(
string_s2(
i,
("#{optional_css_class} l1em").strip,
optional_the_id,
optional_css_style
)
)
br else
append_onto_the_body_tag_nl(_.dup)
br end
end
|
#earrow(i = '', optional_css_class = '') ⇒ Object
3485
3486
3487
3488
3489
3490
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3485
def earrow(
i = '',
optional_css_class = ''
)
e "→ #{i}", optional_css_class
end
|
#edot(i = 108, optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4987
def edot(
i = 108,
optional_css_class = '',
optional_the_id = '',
optional_css_style = ''
)
append_onto_the_body_tag_nl(
string_dot(i, optional_css_class, optional_the_id, optional_css_style)
)
end
|
#ee(i = '') ⇒ Object
#
ee (ee tag)
This is sort of like print(), so it will not add a newline by default. If you need a newline use ee_nl() or eenl().
#
1826
1827
1828
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1826
def ee(i = '')
append_onto_the_body_tag(i)
end
|
#ee_nl(i = '') ⇒ Object
Also known as:
eenl
1833
1834
1835
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1833
def ee_nl(i = '')
append_onto_the_body_tag_nl(i)
end
|
#eearrow(i = '', optional_css_class = '') ⇒ Object
3475
3476
3477
3478
3479
3480
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3475
def eearrow(
i = '',
optional_css_class = ''
)
ee string_span("→ #{i}", optional_css_class)
end
|
#ejavascript(i = '') ⇒ Object
Also known as:
javascript, embed_javascript, embed_this_javascript, ejavascript_code, add_this_javascript_code, custom_javascript_code, javascript_code, escript, script
#
ejavascript
The name of this method indicates “echo javascript”, mostly for historic/legacy reasons.
#
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1144
def ejavascript(
i = ''
)
if i.is_a? Symbol
case i
when :popup_open
i = '
function popup_open(name_of_the_id = "popup_element") {
var popup = document.getElementById(name_of_the_id);
popup.classList.toggle("show");
}
'
else
i = Cyberweb.map_symbol_to_javascript_file(i)
if i.is_a? String
i = File.read(project_base_dir?+i)
end
end
end
append_onto_the_body_tag_nl(
return_javascript(i)
)
end
|
#embed_youtube_video(src = 'gexazLr6pSY', width = '640', height = '385') ⇒ Object
Also known as:
eyv, youtube, youtube_links, youtube_link, youtube_video, embed_video_file, embed_video, embed_youtube_link
#
embed_youtube_video
This method will “embed” a youtube video into the local web-app.
Usage example:
embed_youtube_video 'https://www.youtube.com/watch?v=sAeMTsvGmoQ',
css_class: 'rounded_black2'
#
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2647
def embed_youtube_video(
src = 'gexazLr6pSY',
width = '640',
height = '385'
)
append_onto_the_body_tag_nl(
return_youtube_video(
src,
width,
height
)
)
end
|
#enable_namespace ⇒ Object
Also known as:
autoextend
#
enable_namespace
This simply includes the main Cyberweb “namespace”.
#
#encoding_to_use? ⇒ Boolean
Also known as:
main_encoding?, use_which_encoding?
5482
5483
5484
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5482
def encoding_to_use?
@internal_hash[:encoding_to_use]
end
|
1399
1400
1401
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1399
def
("\nThis website is making use of english.")
end
|
#
This is a slight misnomer, but we’ll keep it nonetheless.
#
1408
1409
1410
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1408
def english_unicode_and_english_html_comment
end
|
#english_unicode_and_jquery ⇒ Object
#
english_unicode_and_jquery
#
1302
1303
1304
1305
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1302
def english_unicode_and_jquery
do_use_jquery
english_trinity
end
|
#escape_html(i) ⇒ Object
Also known as:
htmlsanitize, return_htmlentities, return_htmlsanitized, html_ready, html_escape, htitties
#
escape_html
Simply delegate towards the class-method here.
#
5303
5304
5305
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5303
def escape_html(i)
htmlescape(i)
end
|
#external_javascript_file(i) ⇒ Object
Also known as:
external_script, javascript_file
#
external_javascript_file
#
1002
1003
1004
1005
1006
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1002
def external_javascript_file(i)
i = i.to_s
@internal_hash[:javascript_code] <<
N+load_this_external_javascript_file(i) end
|
#favicon_scanner ⇒ Object
Also known as:
scanner_favicon
5550
5551
5552
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5550
def favicon_scanner
favicon :scanner
end
|
#fetch_css_classes(i = CSS_DIRECTORY) ⇒ Object
#
fetch_css_classes
Use this method to find matching entries. Invoke it at the end after loading your web object. It will then return an array with your css class (which you can then inject).
Usage example:
w.fetch_css_classes
w.print_this_css(web_object.fetch_css_classes)
#
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1909
def fetch_css_classes(
i = CSS_DIRECTORY
)
array_collection = []
these_classes_exist = Cyberweb.found_these_css_classes
Dir.foreach(i) {|file|
next if File.directory?(file)
if File.exist? css_dir+'/'+file
_ = readlines(css_dir+'/'+file)
_.each {|line|
these_classes_exist.each { |entry|
array_collection << line if line.include? entry and line =~ /^\.#{entry} /
}
}
end
}
return array_collection
end
|
#files_from(from = return_pwd, include_subdirectories = false) ⇒ Object
#
files_from
This method will obtain all files from a given (sub)directory.
#
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1026
def files_from(
from = return_pwd,
include_subdirectories = false
)
case include_subdirectories
when :do_include_the_subdirectories
include_subdirectories = true
end
if from.frozen?
from = from.dup
end
unless from.end_with? '*'
from << '/' unless from.end_with? '/'
end
from << '*' unless from.end_with? '*'
if include_subdirectories
from << '*/**'
end
return Dir[from].reject {|entry| File.directory? entry }
end
|
#font_family=(i = 'sans-serif') ⇒ Object
#
font_family
Use this method to set a specific font family.
#
3551
3552
3553
3554
3555
3556
3557
3558
3559
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3551
def font_family=(
i = 'sans-serif'
)
append_onto_the_main_CSS_rules(
return_this_css_style(
"body { font-family: #{i}; }\n"
)
)
end
|
#frameset(i, &block) ⇒ Object
#
frameset
Shell out towards frameset().
#
#german_trinity ⇒ Object
Also known as:
use_unicode_german_and_jquery, trinity_german, trinity
#
german_trinity
This variant specifically does NOT force the use of jquery since as of May 2021. If you want to force jquery, use the method called german_unicode_and_jquery() instead.
Strictly speaking the word “trinity” is thus no longer correct, but for the time being it will be retained.
#
1441
1442
1443
1444
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1441
def german_trinity
german_unicode_and_german_html_comment
end
|
#german_unicode ⇒ Object
#
german_unicode (german unicode tag, german_unicode tag)
This method simply combines use_german() and use_unicode().
#
1294
1295
1296
1297
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1294
def german_unicode
use_german
use_unicode
end
|
1361
1362
1363
1364
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1361
def german_unicode_and_german_html_comment
german_unicode ("\nThis website is making use of german.")
end
|
#german_unicode_and_jquery ⇒ Object
Also known as:
german_unicode_jquery, use_jquery_german_and_unicode
#
german_unicode_and_jquery
This convenience method will enable german language layout for a webpage, jquery-drag-and-drop support, as well as declare that the page at hand uses unicode characters (and thus needs support for unicode).
#
1492
1493
1494
1495
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1492
def german_unicode_and_jquery
do_use_jquery
german_trinity
end
|
#get_all_files_from(this_directory = return_pwd) ⇒ Object
1840
1841
1842
1843
1844
1845
1846
1847
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1840
def get_all_files_from(
this_directory = return_pwd
)
all_files = Dir["#{this_directory}/**/**"].select {|entry|
File.file?(entry)
}.map {|inner_entry| inner_entry.squeeze('/') }
return all_files
end
|
#get_images(from_this_dir = return_pwd) ⇒ Object
Also known as:
get_images_from, return_all_images_from
#
get_images
This method will obtain all files from all subdirectories there as well.
#
3861
3862
3863
3864
3865
3866
3867
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3861
def get_images(
from_this_dir = return_pwd
)
Dir["#{from_this_dir}/**/**"].select {|entry|
Cyberweb.is_an_image?(entry)
}
end
|
#gleichgewicht ⇒ Object
Also known as:
chem_gleichgewicht
3136
3137
3138
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3136
def gleichgewicht
'⇌'
end
|
#glossar_table(*use_this_dataset, &block) ⇒ Object
Also known as:
glossar, table_for_glossar
#
glossar_table
This method can also be invoked via a block argument such as:
{{
css_class: 'mart1em'
}}
#
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4599
def glossar_table(
*use_this_dataset,
&block
)
use_this_dataset.flatten!
use_this_dataset.compact!
use_these_css_classes = 'pad0_5em pretty_table'
if block_given?
yielded = yield
if yielded.is_a? Hash
if yielded.has_key? :css_class
use_these_css_classes = use_these_css_classes.dup if use_these_css_classes.frozen?
use_these_css_classes << " #{yielded.delete(:css_class)}"
end
end
end
table2(use_these_css_classes,'glossar') {{
with_this_data: use_this_dataset
}}
end
|
#handle_these_calls(&block) ⇒ Object
3820
3821
3822
3823
3824
3825
3826
3827
3828
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3820
def handle_these_calls(&block)
if block_given?
instance_exec(&block)
end
end
|
#
This method can be used to hide the scrollbars, by using CSS.
I do not recommend to use it, but it exists mostly due to convenience - and perhaps the user may have a real use case for this, such as browser-kiosk mode, or something similar.
The idea I had when reading this description:
https://www.w3schools.com/howto/howto_css_hide_scrollbars.asp
#
3789
3790
3791
3792
3793
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3789
def hide_scrollbars
append_this_to_the_body_css '
overflow: hidden; /* Hide scrollbars */
'
end
|
#hr(optional_css_class = '') ⇒ Object
#
hr (hr tag)
Usage example:
hr('gold wid80')
#
3928
3929
3930
3931
3932
3933
3934
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3928
def hr(
optional_css_class = ''
)
append_onto_the_body_tag_nl(
"<hr#{css_class_or_no_class(optional_css_class)}>"
)
end
|
#hr_stars ⇒ Object
Also known as:
star_spacer, fancy_stars, pretty_spacer, pretty_stars, pretty_star, pretty_hsep, pretty_separator
#
hr_stars
This method call displays three stars in one row, if all goes well.
See this image for how this may look on the website:
https://i.imgur.com/moDx2f1.png
#
4780
4781
4782
4783
4784
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4780
def hr_stars
append_onto_the_body_tag_nl(
Cyberweb.return_pretty_stars
)
end
|
2798
2799
2800
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2798
def hsep
return '<hr>'
end
|
#hspacer(optional_css_class = nil) ⇒ Object
#
hspacer
Usage example:
hspacer css_class: 'marb1em'
#
4800
4801
4802
4803
4804
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4800
def hspacer(
optional_css_class = nil
)
spacer(:center, optional_css_class)
end
|
#html_title?(i = web_title?
) ⇒ Boolean
#
html_title?
This will return a proper <title> tag.
#
5669
5670
5671
5672
5673
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5669
def html_title?(
i = web_title?
)
HtmlTags.title(i.to_s) { :newline }
end
|
#htmlescape(i) ⇒ Object
Also known as:
htmlentities, hescape, htmltitties
5315
5316
5317
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5315
def htmlescape(i)
return Cyberweb.escape_html(i)
end
|
#id_or_no_id(i = '', optional_url = nil) ⇒ Object
#
id_or_no_id
The second argument is in particular used for draggable images.
#
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2828
def id_or_no_id(
i = '',
optional_url = nil
)
if i.is_a?(Hash) and i.has_key?(:id)
i = i.delete(:id)
end
unless i.to_s.empty?
case i
when :guess_draggable_id
i = 'drag_'+File.basename(optional_url).
gsub(File.extname(optional_url),'')
end
i = i.to_s
if i.start_with?('drag')
register_this_id(i)
end
i = " id=\"#{i}\""
end
return i
end
|
#in_file(this_file) ⇒ Object
4207
4208
4209
4210
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4207
def in_file(this_file)
e dot(102, 'marr6px')+this_file,
'orange BO'
end
|
#in_ruby(i, make_newline = true) ⇒ Object
#
in_ruby
This method can be used to quickly indicate how syntax should be shown in ruby. Note that this is currently hardcoded to german.
#
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3153
def in_ruby(
i,
make_newline = true
)
result = sg(:ruby,'marr8px')+
'<b>In Ruby wäre dies: </b>'+
string_s2(i,'darkblue BOLD')
result = result.dup
result.prepend('<br>') if make_newline
e result, 'italic darkgreen'
end
|
#inject_this_onto_that(this, that) ⇒ Object
#
inject_this_onto_that
This method has been added specifically for UniversalWidgets support.
It is highly experimental as of September 2021.
#
5183
5184
5185
5186
5187
5188
5189
5190
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5183
def inject_this_onto_that(
this,
that
)
position = that.to_s.index('</div>')
that[position,0] = this
return that
end
|
#
Note that some values are ignored for now.
#
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6243
def input(
type = :submit, default_value = '', css_class = Input.to_s, name_to_use = '', css_style = '', accesskey = '', my_javascript = '', id = nil, hash = {}, &block
)
append_onto_the_body_tag_nl(
HtmlTags.input(
type: type,
value: default_value,
css_class: css_class,
javascript: my_javascript
)
)
end
|
#is_a_sinatra_application ⇒ Object
Also known as:
enable_sinatra_application, is_a_rack_application
#
is_a_sinatra_application
Setter method to designate a given application as a sinatra-application.
#
5566
5567
5568
5569
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5566
def is_a_sinatra_application
@internal_hash[:is_a_sinatra_application] = true
do_use_base64_for_all_images end
|
#is_a_sinatra_application? ⇒ Boolean
Also known as:
uses_sinatra?, are_we_using_sinatra?, is_sinatra?
#
is_a_sinatra_application?
This method is necessary to support sinatra-applications as well.
#
2718
2719
2720
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2718
def is_a_sinatra_application?
@internal_hash[:is_a_sinatra_application]
end
|
#is_localhost? ⇒ Boolean
5209
5210
5211
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5209
def is_localhost?
return ('127.0.0.1' == Cyberweb::YOUR_IP)
end
|
#italic(content = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
Also known as:
i
#
italic (italic tag)
This method makes the content (the first argument) italic, that is the font-style is italic for that particular content.
#
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4156
def italic(
content = '',
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
&block
)
if optional_css_class.frozen?
optional_css_class = optional_css_class.dup
end
unless optional_css_class.include? ' italic'
optional_css_class << ' italic'
end
append_onto_the_body_tag_nl(
'<span'+
css_class_or_no_class(optional_css_class)+
id_or_no_id(optional_the_id)+
css_style_or_no_style(optional_css_style)+
'>'
)
append_onto_the_body_tag_nl(content)
if block_given?
yield
end
close :span
end
|
#javascript_code? ⇒ Boolean
Also known as:
javascript?
#
javascript_code?
Query-method over the javascript-code that is to be added onto the webpage at hand.
#
978
979
980
|
# File 'lib/cyberweb/html_template/html_template.rb', line 978
def javascript_code?
@internal_hash[:javascript_code]
end
|
#javascript_file=(i) ⇒ Object
Also known as:
link_in_javascript, load_javascript
#
javascript_file=
A wrapper towards cyberweb.rb and javascript_file() method.
Usage example:
w.javascript_file = :fader
#
1121
1122
1123
1124
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1121
def javascript_file=(i)
_ = "#{javascript_file(i.dup)}#{N}"
@internal_hash[:javascript_code] << _
end
|
#javascript_script=(i) ⇒ Object
Also known as:
javascript_in_head_tag, addnl_javascript_code
#
javascript_script=
This method assigns to the @javascript variable. We expect it to hold strings related to javascript-code.
#
3949
3950
3951
3952
3953
3954
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3949
def javascript_script=(i)
if @internal_hash[:javascript_code].frozen?
@internal_hash[:javascript_code] = @internal_hash[:javascript_code].dup
end
@internal_hash[:javascript_code] << return_javascript(i) end
|
#jquery(i = '+') ⇒ Object
#
jquery
An alias to enabling the use of jquery on a website, through the method call do_use_jquery().
#
1133
1134
1135
1136
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1133
def jquery(i = '+')
i = i.to_s do_use_jquery if i == '+'
end
|
#jquery_version? ⇒ Boolean
Also known as:
this_jquery_version
#
jquery_version?
This method will always return the latest jquery version to use.
It will query a toplevel method for this, rather than storing this internally.
#
#
label (label tag)
This may look like so:
<label for="male">Male</label><br>
#
5587
5588
5589
5590
5591
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5587
def label(i)
append_onto_the_body_content_newline(
"<label>#{i}</label>"
)
end
|
#language(which_language = nil) ⇒ Object
Also known as:
set_language
#
language
You can use this method to specify a certain language in order to use for the given web page. I tend to use this to remind myself in which language I shall write a web-page in, e. g. usually either in german, or more commonly these days, in english.
Invocation example:
language :english
#
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5606
def language(
which_language = nil
)
case which_language
when 'eng',
'e',
'en',
'default'
which_language = 'english'
when 'ger',
'g',
'ge',
'german',
'deutsch'
which_language = 'german'
end
@internal_hash[:language_to_use_for_this_webpage] = which_language.to_sym
end
|
#language? ⇒ Boolean
#
language?
Note that the default value is :english.
#
1427
1428
1429
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1427
def language?
@internal_hash[:language_to_use_for_this_webpage]
end
|
#larger_font_size ⇒ Object
#
larger_font_size
This is for using a larger font-size. The exact value is derived from the file named “project_configuration.yml”.
#
6777
6778
6779
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6777
def larger_font_size
font_size(:larger_font_size)
end
|
#larger_font_size_and_hyperlinks ⇒ Object
#
larger_font_size_and_hyperlinks
#
6784
6785
6786
6787
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6784
def larger_font_size_and_hyperlinks
larger_font_size
default_hyperlinks
end
|
#left_to_right_gradient(first_colour = :steelblue, second_colour = :lightgreen) ⇒ Object
Also known as:
gradient_left_to_right, left_to_right
#
left_to_right_gradient
This method is basically a wrapper over the CSS code for “background-image: linear-gradient(to bottom right …)
#
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
|
# File 'lib/cyberweb/html_template/html_template.rb', line 740
def left_to_right_gradient(
first_colour = :steelblue,
second_colour = :lightgreen
)
_ = "
.main_background_gradient {
background-image: linear-gradient(to bottom right, #{first_colour}, #{second_colour});
background-repeat: no-repeat;
background-attachment: fixed;
}\n"
add_to_CSS(_)
append_onto_the_default_body_CSS_class('main_background_gradient')
end
|
#legend(content = '', optional_css_class = '', optional_the_id = '', optional_css_style = '', &block) ⇒ Object
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3873
def legend(
content = '',
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
&block
)
append_onto_the_body_tag_nl(
'<legend'+
css_class_or_no_class(optional_css_class)+
id_or_no_id(optional_the_id)+
css_style_or_no_style(optional_css_style)+
'>'
)
append_onto_the_body_tag_nl(content)
if block_given?
yield
clegend
end
end
|
#less_than_or_equal ⇒ Object
Also known as:
kleiner_gleich
4872
4873
4874
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4872
def less_than_or_equal
'≤'
end
|
#linear_gradient_background(degree_to_use = (0..180).to_a.sample.to_s+'deg', colour1 = random_colour, colour2 = random_colour, colour3 = random_colour) ⇒ Object
#
linear_gradient_background
Usage examples:
linear_gradient_background(90, :steelblue, :darkgreen, :tomato)
linear_gradient_background(90, :steelblue, :darkgreen, :royalblue)
#
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
|
# File 'lib/cyberweb/html_template/html_template.rb', line 704
def linear_gradient_background(
degree_to_use = (0..180).to_a.sample.to_s+'deg',
colour1 = random_colour,
colour2 = random_colour,
colour3 = random_colour
)
degree_to_use = degree_to_use.to_s.dup
unless degree_to_use.end_with? 'deg'
degree_to_use << 'deg'
end
return 'background: linear-gradient('+
degree_to_use+', '+
colour1.to_s+', '+
colour2.to_s+', '+
colour3.to_s+
');'
end
|
#linux_favicon ⇒ Object
5497
5498
5499
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5497
def linux_favicon
favicon :linux_favicon
end
|
#map_symbol_to_image_location(i) ⇒ Object
#
map_symbol_to_image_location
#
#markdown(i = '') ⇒ Object
Also known as:
markdown_display_this_file, read_and_display_markdown, show_md, display_markdown
3911
3912
3913
3914
3915
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3911
def markdown(i = '')
append_onto_the_body_tag_nl(
Cyberweb.markdown(i)
)
end
|
#mars1em(i = '') ⇒ Object
2084
2085
2086
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2084
def mars1em(i = '')
e(i, 'mars1em')
end
|
#mars2em(i = '', optional_css_class = '') ⇒ Object
2072
2073
2074
2075
2076
2077
2078
2079
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2072
def mars2em(
i = '',
optional_css_class = ''
)
optional_css_class = optional_css_class.dup if optional_css_class.frozen?
optional_css_class << ' mars2em'
e(i, optional_css_class.squeeze(' '))
end
|
#mathml(optional_css_class = '') ⇒ Object
Also known as:
mathml_start
#
Cyberweb.mathml
This is a simplified way to use mathml in a webpage.
#
4912
4913
4914
4915
4916
4917
4918
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4912
def mathml(
optional_css_class = ''
)
append_onto_the_body_tag_nl(
Cyberweb.mathml(optional_css_class)
)
end
|
#meta_content? ⇒ Boolean
Also known as:
meta_collection?
6472
6473
6474
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6472
def meta_content?
@internal_hash[:meta_content]
end
|
#n_steps_to_the_base_directory? ⇒ Boolean
Also known as:
n_times_to_the_base_dir?
#
n_steps_to_the_base_directory?
#
5860
5861
5862
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5860
def n_steps_to_the_base_directory?
Cyberweb.n_slashes_towards_the_server_base_directory
end
|
#n_total_lines? ⇒ Boolean
Also known as:
n_total_lines, n_lines?
#
n_total_lines?
How many lines we will serve.
#
2365
2366
2367
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2365
def n_total_lines?
@internal_hash[:n_total_lines]
end
|
#normal_hyperlinks ⇒ Object
Also known as:
default_hyperlinks, default_hyperlink
#
normal_hyperlinks
This method assumingly sets the CSS rules towards “normal”, in regard to hyperlinks.
#
6369
6370
6371
6372
6373
6374
6375
6376
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6369
def normal_hyperlinks
append_to_CSS <<-EOF
a {
text-decoration: none;
}
EOF
end
|
#on_click_change_opacity(use_this_id = 'pic', which_opacity_value_to_use = '0.92') ⇒ Object
Also known as:
on_click_highlight, highlight_tag, highlight
#
on_click_change_opacity
#
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3730
def on_click_change_opacity(
use_this_id = 'pic',
which_opacity_value_to_use = '0.92'
)
append_onto_the_body_tag_nl(
Cyberweb.return_on_click_change_opacity(
use_this_id, which_opacity_value_to_use
)
)
end
|
#on_click_make_darker(this_id, opacity = '0.90') ⇒ Object
#on_hover_colour(i) ⇒ Object
#
on_hover_colour
This method can be used to quickly change the on-mouse-hover colour from HTML links.
#
2051
2052
2053
2054
2055
2056
2057
2058
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2051
def on_hover_colour(i)
append_onto_CSS(
"a:hover {
color: #{i};
}
"
)
end
|
#onload_or_no_onload(i = body_javascript?
) ⇒ Object
2814
2815
2816
2817
2818
2819
2820
2821
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2814
def onload_or_no_onload(
i = body_javascript?
)
unless i.to_s.empty?
i = " onload=\"#{i}\""
end
return i
end
|
#ordered_list(array = %w( cat dog parrot deer horse )) ⇒ Object
#
ordered_list
This method can be used to show an ordered list.
#
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4449
def ordered_list(
array = %w( cat dog parrot deer horse )
)
_ = "<ol>\n".dup
array.each {|this_entry|
_ << "<li>#{this_entry}</li>\n"
}
_ << "</ol>\n\n"
append_onto_the_body_tag_nl(_)
end
|
#
This variant should be merged with the replacement method.
HTML defines the following input-types:
<input type="text"> Displays a single-line text input field
<input type="radio"> Displays a radio button (for selecting one of many choices)
<input type="checkbox"> Displays a checkbox (for selecting zero or more of many choices)
<input type="submit"> Displays a submit button (for submitting the form)
<input type="button"> Displays a clickable button
A button would look like this:
button = input(:button)
A form may look like this:
input_submit css_class: 'bblack1'
#
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5911
def original_input(
type = :submit, default_value = '', css_class = Input.to_s, name_to_use = '', css_style = '', accesskey = '', my_javascript = '', id = nil, hash = {}, &block
)
case css_class
when :default
css_class = Input.to_s
end
_ = ''.dup
if type.is_a? Hash
if type.has_key? :id
id = type.delete(:id)
end
if type.empty?
type = :text
end
end
_ << '<input'
if block_given?
yielded = yield case yielded
when :select_on_click
my_javascript = :select_on_click
when :is_checked
_ << ' checked="checked"'
else
if yielded.is_a? Hash
if yielded.has_key? :css_class
css_class = yielded.delete(:css_class)
end
if yielded.has_key? :javascript_function
string = yielded.delete(:javascript_function).dup
if string.include? '(' splitted = string.split('(')
function_to_call = splitted.first.to_s
argument_to_use = splitted[1 .. -1].join('(').
delete('()').to_s.delete('"')
case function_to_call
when 'msg'
_ << ' onclick="window.alert(\''+argument_to_use+'\');"'
end
end
elsif yielded.has_key? :on_click_event
_ << ' onclick="'+yielded.delete(:on_click_event).to_s+'()"'
end
if yielded.has_key? :text
default_value = yielded.delete(:text)
end
end
end
end
if default_value.is_a? Hash
if default_value.has_key? :css_class
css_class = default_value.delete(:css_class)
end
if default_value.has_key? :accesskey
accesskey = default_value[:accesskey]
end
if default_value.has_key? :id
id = default_value[:id].to_s end
if default_value.has_key? :name
name_to_use = default_value.delete(:name)
end
if default_value.has_key? :text
default_value = default_value.delete(:text)
end
if default_value.is_a?(Hash) and default_value.empty?
default_value = 'Submit'
end
end
case type.to_sym when :radio
_ << ' type="radio"'
when :checkbox
_ << ' type="checkbox"'
when :datetime
_ << ' type="datetime-local"'
when :month
_ << ' type="month"'
when :week
_ << ' type="week"'
when :image,
:img,
:i
_ << ' type="image"'
when :button,
:b
_ << ' type="button"'
when :hidden,
:h
_ << ' type="hidden"'
when :submit,
:s
_ << ' type="submit"'
when :reset,
:r
_ << ' type="reset"'
when :text,
:field,
:default,
:t
_ << ' type="text"'
when :file,
:file_uploads,
:upload,
:file_dialogue,
:f,
:file_handle _ << ' type="file"'
id = 'input_file_upload' if id.nil?
else
_ = type.to_s+' was not found ...'+NL
end
if css_class.is_a? Symbol
case css_class when :select_on_click
css_class = Input.to_s
if my_javascript.empty? my_javascript = :select_on_click
end
else
if css_class.to_s.start_with? 'focus_with'
input_focus = Cyberweb::InputFocus.new(css_class)
add_css_style input_focus.string?
css_class = input_focus.css_class?.dup
unless Cyberweb::Input.to_s.empty?
css_class << N+Input.to_s.dup
end
end
end
end
_ = _.dup if _.frozen?
_ << css_class_or_no_class(css_class.to_s)
_ << css_style_or_no_style(css_style)
if name_to_use.is_a? Symbol case name_to_use
when :select_on_click
name_to_use = ''
if my_javascript.empty? my_javascript = :select_on_click
end
end
end
_ << return_the_name(name_to_use) unless name_to_use.to_s.empty?
_ << return_accesskey(accesskey)
if id
if id.is_a? String
_ << ' id="'+id.to_s+'"'
end
end
my_javascript = sanitize_javascript(my_javascript)
_ << " #{my_javascript}" unless my_javascript.empty?
if default_value.is_a? Hash
if default_value.has_key? :value
_ << ' value="'+default_value[:value].to_s+'"'
end
else
unless _.include?('value')
unless default_value.to_s.empty? _ << ' value="'+default_value.to_s+'"'
end
end
end
if hash.is_a? Hash
_ << ' size="'+hash[:size].to_s+'"' if hash[:size]
_ << ' maxlength="'+hash[:max_length].to_s+'"' if hash[:max_length]
end
_ << " />#{NL}"
append_onto_the_body_tag_nl(_)
end
|
#p(optional_css_class = '', the_id = '', optional_css_style = '', &block) ⇒ Object
#
p (p tag)
This method handles the creation of <p> tags ultimately.
#
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3193
def p(
optional_css_class = '',
the_id = '',
optional_css_style = '',
&block
)
if optional_css_class.is_a? Hash
if optional_css_class.has_key? :id
the_id = optional_css_class.delete(:id)
end
if optional_css_class.has_key? :css_style
optional_css_style = optional_css_class.delete(:css_style)
end
if optional_css_class.has_key? :css_class
optional_css_class = optional_css_class.delete(:css_class)
elsif optional_css_class.has_key? :class
optional_css_class = optional_css_class.delete(:class)
end
if optional_css_class.is_a?(Hash) and
optional_css_class.empty?
optional_css_class = ''
end
end
if optional_css_class.include? '#'
optional_css_class = check_this_css_class_for_select_rules(optional_css_class)
end
append_onto_the_body_with_newline(
'<p'+
css_class_or_no_class(optional_css_class)+
id_or_no_id(the_id.to_s)+
css_style_or_no_style(optional_css_style)+
'>'
)
if block_given?
yield
append_onto_the_body_with_newline('</p>')
end
end
|
#page_css_classes ⇒ Object
#
return_css_style
This method will simply return the <style>CONTENT_HERE</style> variant.
#
page_css_classes
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1988
def return_css_style(
i = main_CSS_rules?
)
if i.is_a? Hash
_ = ''.dup
i.each_pair {|key, value|
_ << "#{key} = #{value};"
}
i = _
end
return Cyberweb::CssStyle.style(i) end
|
#parse_table(*args) ⇒ Object
4507
4508
4509
4510
4511
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4507
def parse_table(*args)
append_onto_the_body_tag_nl(
Cyberweb.parse_table(args)
)
end
|
#parse_this_hash(hash) ⇒ Object
#
parse_this_hash (parse tag)
This method is very important, because it will parse the given Hash into constituent members.
#
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2480
def parse_this_hash(
hash
)
return unless hash.is_a?(Hash)
if hash.has_key? :css_style
append_these_CSS_rules(
hash.delete(:css_style)
)
elsif hash.has_key? :main_css
append_these_CSS_rules(hash.delete(:main_css))
elsif hash.has_key? :style
append_these_CSS_rules(hash.delete(:style))
elsif hash.has_key? :css_rules_to_use
append_these_CSS_rules(hash.delete(:css_rules_to_use))
end
if hash.has_key? :favicon
set_favicon(hash.delete(:favicon))
end
if hash.has_key? :title
set_use_this_title(hash.delete(:title))
end
if hash.has_key? :body_css_style
set_body_css_style(hash.delete(:body_css_style))
end
if hash.has_key? :body_css_class
set_body_css_class(hash.delete(:body_css_class))
end
if hash.has_key? :font_size
set_font_size(hash.delete(:font_size))
end
if hash.has_key? :body
set_body_content(hash.delete(:body))
elsif hash.has_key? :content
set_body_content(hash.delete(:content))
elsif hash.has_key? :body_content
set_body_content(hash.delete(:body_content))
end
if hash.has_key? :css_classes
@internal_hash[:use_only_these_CSS_classes] = hash.delete(:css_classes)
elsif hash.has_key? :use_these_css_classes
@internal_hash[:use_only_these_CSS_classes] = hash.delete(:use_these_css_classes)
elsif hash.has_key? :css_class
@internal_hash[:use_only_these_CSS_classes] = hash.delete(:css_class)
end
if hash.has_key? :javascript_code
@internal_hash[:javascript_code] = hash.delete(:javascript_code)
elsif hash.has_key? :javascript
@internal_hash[:javascript_code] = hash.delete(:javascript)
end
if hash.has_key? :use_jquery
set_shall_we_use_jquery(hash.delete(:use_jquery))
end
if hash.has_key? :special_actions
@internal_hash[:special_actions] = hash.delete(:special_actions)
end
end
|
#path? ⇒ Boolean
Also known as:
fixed_path, converted_path, converted_path?
#
path?
Reader method for the @fixed_path variable, which stores the relative path to our LOCALHOST.
#
1015
1016
1017
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1015
def path?
Cyberweb.converted_path
end
|
#path_to_this_background_image(i = :parchment1) ⇒ Object
#
path_to_this_background_image
Usage examples:
path_to_this_background_image(:parchment1)
path_to_this_background_image(:parchment2)
#
643
644
645
646
647
648
649
650
651
|
# File 'lib/cyberweb/html_template/html_template.rb', line 643
def path_to_this_background_image(
i = :parchment1
)
target = project_base_directory?+'images/background_images/'
possible_files = Dir[target+i.to_s+'*']
unless possible_files.empty?
return possible_files.first
end
end
|
#pi? ⇒ Boolean
5202
5203
5204
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5202
def pi?
PI
end
|
#prepend_before_the_body_tag(i) ⇒ Object
#
prepend_before_the_body_tag
This method can be used to prepend content before the body tag.
Note that this will always prepend onto the very first position, so it is guaranteed to prepend to the start of the result String.
#
6665
6666
6667
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6665
def prepend_before_the_body_tag(i)
@internal_hash[:prepend_before_the_body_tag][0,0] = i
end
|
#prepend_doc_type ⇒ Object
3127
3128
3129
3130
3131
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3127
def prepend_doc_type
@internal_hash[:result].prepend(
"#{default_doc_type?}\n"
)
end
|
#pull_in(i) ⇒ Object
6830
6831
6832
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6830
def pull_in(i)
Object.send(:include, i)
end
|
#pull_in_the_jquery_module ⇒ Object
#
pull_in_the_jquery_module
#
6837
6838
6839
6840
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6837
def pull_in_the_jquery_module
require 'cyberweb/jquery_module/jquery_module.rb'
extend(Cyberweb::JqueryModule)
end
|
#quote(text, css_class = '', the_id = '', css_style = '') ⇒ Object
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2255
def quote(
text,
css_class = '',
the_id = '',
css_style = ''
)
append_onto_the_body_tag_nl(
Cyberweb.quote(text, css_class, the_id, css_style)
)
end
|
#random_background_image_from(this_directory = Dir.pwd) ⇒ Object
#
random_background_image_from
#
656
657
658
659
660
661
662
663
664
|
# File 'lib/cyberweb/html_template/html_template.rb', line 656
def random_background_image_from(
this_directory = Dir.pwd
)
sample = Dir[rds(this_directory+'/*')].sample.dup
if sample.include? '/home/x/data/images'
sample.sub!(Regexp.new('/home/x/data/images/'), '')
end
relative_background_image(sample)
end
|
#random_favicon ⇒ Object
#
random_favicon
This method will be like set_favicon_string(), but we will randomly set to a specific favicon.
#
#raw_favicon_string? ⇒ Boolean
Also known as:
raw_favicon?, use_favicon?
2000
2001
2002
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2000
def raw_favicon_string?
@internal_hash[:favicon]
end
|
#raw_font_size? ⇒ Boolean
Also known as:
current_font_size?
6760
6761
6762
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6760
def raw_font_size?
@internal_hash[:font_size]
end
|
#
Usage example:
readonly_input id: 'result_for_circle_calculations'
#
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4928
def readonly_input(
i = nil
)
_ = '<input type="text"'.dup
if i and i.is_a? Hash
if i.has_key?(:id)
_ << ' id="'+i[:id].to_s+'"'
end
end
_ << ' readonly>'
append_onto_the_body_tag_nl(_)
end
|
#red(i = '') ⇒ Object
4478
4479
4480
4481
4482
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4478
def red(i = '')
append_onto_the_body_tag_nl(
string_s2(i, 'red')
)
end
|
#redirect_to(this_url = 'http://www.w3schools.com') ⇒ Object
#
redirect_to
The first argument to this method should be the URL to which we redirect visitors.
#
3810
3811
3812
3813
3814
3815
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3810
def redirect_to(
this_url = 'http://www.w3schools.com'
)
ejavascript 'window.location.replace("'+this_url.to_s+'");'
end
|
#render ⇒ Object
Also known as:
internal_render, generate_the_main_string, rebuild_the_main_string, rebuild_the_HTML_string, rebuild_main_string, build_up_the_html_string, primary_render
#
render (internal_render tag)
The render() method will build onto our :result variable. It will not modify other variables, such as via reset_the_body_content().
#
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2617
def render
reset_the_result we_have_not_yet_served_the_web_content
build_up_the_result
if respond_to?(:check_syntax_then_compress_the_main_string_then_remove_newlines)
check_syntax_then_compress_the_main_string_then_remove_newlines
end
end
|
#repeat(which_tag = '<br>', how_many_times = '12') ⇒ Object
1852
1853
1854
1855
1856
1857
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1852
def repeat(
which_tag = '<br>',
how_many_times = '12'
)
return which_tag * how_many_times.to_i
end
|
#request_uri? ⇒ Boolean
4299
4300
4301
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4299
def request_uri?
ENV['REQUEST_URI'].to_s
end
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
|
# File 'lib/cyberweb/html_template/html_template.rb', line 112
def reset
super()
infer_the_namespace
try_to_require_rack
pull_in_the_jquery_module reset_the_result
reset_the_body_content
@internal_hash[:js_files_to_load] = []
@internal_hash[:use_local_CSS_files] = false
@internal_hash[:additional_CSS_rules_to_use] = ''.dup
@internal_hash[:use_only_these_CSS_classes] = nil
@internal_hash[:favicon] = nil
@internal_hash[:n_total_lines] = 0
@internal_hash[:shall_we_use_jquery] = false @internal_hash[:body_css_class] = nil
@internal_hash[:body_id] = ''.dup
@internal_hash[:body_css_style] = ''.dup
@internal_hash[:relative_path] = nil
@internal_hash[:link_in_these_remote_CSS_files] = []
@internal_hash[:font_size] = '1.0em'
@internal_hash[:already_served] = false
@internal_hash[:use_unicode] = true
@internal_hash[:use_body_tag] = true
@internal_hash[:special_actions] = nil
@internal_hash[:prepend_before_the_body_tag] = ''.dup
@internal_hash[:append_after_the_closing_body_tag] = ''.dup
@internal_hash[:javascript_code] = nil
@internal_hash[:body_javascript] = ''.dup
this_file = "#{project_directory?}yaml/js_files_to_load.yml"
if File.exist? this_file
@internal_hash[:js_files_to_load] = YAML.load_file(this_file)
end
@internal_hash[:is_a_sinatra_application] = false
@internal_hash[:frame_string] = ''.dup
@internal_hash[:language_to_use_for_this_webpage] = :english
@internal_hash[:meta_content] = ''.dup
@internal_hash[:show_the_lines] = false
@internal_hash[:counter_for_show_the_lines] = 0
set_web_title(:default) if image_directory?.nil? or
image_directory?.empty?
load_the_configuration
update_the_image_directory
end
end
|
#reset_the_body_content ⇒ Object
#
reset_the_body_content
#
725
726
727
728
729
730
731
732
|
# File 'lib/cyberweb/html_template/html_template.rb', line 725
def reset_the_body_content
@internal_hash[:body_content] = ''.dup
end
|
#reset_the_result ⇒ Object
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2199
def reset_the_result
@internal_hash[:result] = ''.dup
end
|
#result? ⇒ Boolean
Also known as:
to_html, main_string?, string?, string_that_is_to_be_served?, html_string?, to_s
#
result?
This method will return the instance-variable that will be served by the HtmlTemplate (or WebObject) instance at hand.
It is the very string that will be shown to the visitor of a webpage in question, containing the full HTML code.
#
2677
2678
2679
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2677
def result?
@internal_hash[:result]
end
|
#return_accesskey(accesskey = '') ⇒ Object
#return_assumed_javascript ⇒ Object
#
return_assumed_javascript
This method will ultimately yield a <script> tag, denoting the use of javascript.
#
1271
1272
1273
1274
1275
1276
1277
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1271
def return_assumed_javascript
_ = ''.dup
if javascript_code?
_ << HtmlTags.script(javascript_code?)
end
return _
end
|
#
The signature for this method must be synced with the method called .create_copy_to_clipboard_button().
#
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3696
def return_copy_to_clipboard_button(
use_this_value = 'XXX',
use_this_id = 'clipboard_button',
hide_the_input_field = false,
text_shown_on_the_button = 'Copy text',
css_rules_for_the_button = ''
)
_ = ''.dup
use_this_id = use_this_id.to_s
if hide_the_input_field
_ << '<input type="hidden" value="'+use_this_value.to_s+'" id="'+use_this_id+'">'
else
_ << '<input type="text" value="'+use_this_value.to_s+'" id="'+use_this_id+'">'
end
id_for_the_button = 'button_id_for_the_'+use_this_id
_ << "\n"+'<button id="'+id_for_the_button.to_s+
'" class="'+css_rules_for_the_button.to_s+
'" onclick="copy_to_the_clipboard(\''+use_this_id+'\')">'+
text_shown_on_the_button.to_s+
'</button>'
return _
end
|
#return_css_for_tetris ⇒ Object
#
return_css_for_tetris
This is the CSS that will be returned when we want to enable the small tetris-game that is distributed with the cyberweb project.
#
#return_css_style ⇒ Object
#
return_css_style
This method will return the full CSS style for the web-page at hand.
#
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1976
def return_css_style(
i = main_CSS_rules?
)
if i.is_a? Hash
_ = ''.dup
i.each_pair {|key, value|
_ << "#{key} = #{value};"
}
i = _
end
return Cyberweb::CssStyle.style(i) end
|
#return_default_javascript ⇒ Object
#
return_default_javascript
#
#return_favicon_string(i = raw_favicon_string?
) ⇒ Object
Also known as:
favicon_string?, favicon_path, favicon?, favicon_path?
#
return_favicon_string
This will return the proper HTML variant for a favicon.
#
4348
4349
4350
4351
4352
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4348
def return_favicon_string(
i = raw_favicon_string?
)
'<link rel="icon" href="'+i.to_s+'">'+"\n"
end
|
#return_gradient(i) ⇒ Object
Also known as:
gradient, gradients
#
return_gradient (gradient tag)
This method will return the proper CSS rule for a gradient. It was added in August 2023.
#
908
909
910
911
|
# File 'lib/cyberweb/html_template/html_template.rb', line 908
def return_gradient(i)
sanitized = i.to_s.downcase.tr(' ','_')+'_effect'
return sanitized
end
|
549
550
551
|
# File 'lib/cyberweb/html_template/html_template.rb', line 549
def (i)
Cyberweb.(i)
end
|
#return_html_to_head_start ⇒ Object
#
return_html_to_head_start
This method will delegate to a toplevel method and ultimately return a String such as:
"Content-type: text/html\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n"
#
#return_javascript(i) ⇒ Object
#
return_javascript
This method would yield a String such as:
"\n<script>\n\nabc\n</script>\n"
#
#return_omega_symbol ⇒ Object
Also known as:
omega_symbol, omega
#
return_omega_symbol
This is for the greek symbol omega.
#
4226
4227
4228
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4226
def return_omega_symbol
return '"Omega"'
end
|
#return_omega_symbol_semantics ⇒ Object
#
return_omega_symbol_semantics
This will return the <math> tag.
#
3361
3362
3363
3364
3365
3366
3367
3368
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3361
def return_omega_symbol_semantics
return '<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow><mi>ω</mi></mrow>
<annotation encoding="application/x-tex">\omega</annotation>
</semantics>
</math>'
end
|
#return_stars(n_stars = 1, optional_css_class = '') ⇒ Object
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4416
def return_stars(
n_stars = 1,
optional_css_class = ''
)
case n_stars.to_s
when '1'
sg(:one_star, optional_css_class)
when '2'
sg(:two_stars, optional_css_class)
when '3'
sg(:three_stars, optional_css_class)
when '4'
sg(:four_stars, optional_css_class)
when '5'
sg(:five_stars, optional_css_class)
when '1x'
sg(:one_and_half_star, optional_css_class)
when '2x'
sg(:two_and_half_star, optional_css_class)
when '3x'
sg(:three_and_half_star, optional_css_class)
when '4x'
sg(:four_and_half_star, optional_css_class)
when '5x'
sg(:five_and_half_star, optional_css_class)
end
end
|
#return_the_body_content ⇒ Object
#
return_the_body_content
This method will simply return the body-content.
#
5116
5117
5118
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5116
def return_the_body_content
return @internal_hash[:body_content] end
|
#return_the_body_string(optional_css_class = , optional_the_id = , optional_css_style = , optional_body_javascript = body_javascript?
) ⇒ Object
Also known as:
return_the_body_tag, return_body_tag, string_body_start, start_the_body_tag
#
return_the_body_string
Note that this method will append a trailing newline.
#
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5680
def return_the_body_string(
optional_css_class = @internal_hash[:body_css_class],
optional_the_id = @internal_hash[:body_id],
optional_css_style = @internal_hash[:body_css_style],
optional_body_javascript = body_javascript?
)
return '<body'+
css_class_or_no_class(optional_css_class.to_s)+
id_or_no_id(optional_the_id.to_s)+
css_style_or_no_style(optional_css_style.to_s)+
onload_or_no_onload(optional_body_javascript.to_s)+
">\n" end
|
#return_the_css_classes(css_classes = css_classes?
) ⇒ Object
#
return_the_css_classes
This method will identify the correct CSS class that should be used by the HtmlTemplate. It works on the assumption that the user only wants to use as little CSS as possible, rather than ALL local css files.
In order for this to work, the class must have been defined in one of the default .css files. And these files have to be found by ruby as well - otherwise the method will not work properly.
#
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5249
def return_the_css_classes(
css_classes = css_classes?
)
if css_classes
css_classes = [css_classes].flatten.map {|entry|
entry = entry.split(' ') if entry.include? ' '
entry
}.flatten
_ = ''.dup
css_content = ''.dup
Dir["#{project_base_dir?}cascading_style_sheets/*.css"].each {|entry|
css_content << "#{File.read(entry, encoding: 'UTF-8')}#{N}"
}
css_classes.each {|this_css_class|
use_this_regex =
/(\.#{this_css_class}).+{(.+)}$/u css_content =~ use_this_regex
assumed_path = "#{project_base_directory?}"\
"cascading_style_sheets/"\
"#{this_css_class}.css"
if File.exist?(assumed_path)
_ << File.read(assumed_path)
else
if $2
_ << $1.to_s.ljust(15)+' { '+$2.to_s.lstrip.squeeze(' ')+' }'+N
end
end
}
if _.to_s.empty?
return ''
else return _
end
else
''
end
end
|
#return_the_CSS_rules_from_the_local_CSS_files(i = Cyberweb::ARRAY_LOCAL_CSS_FILES) ⇒ Object
#
return_the_CSS_rules_from_the_local_CSS_files
This method will simply return all local .css files.
The term “local” refers to the .css files that come distributed via the cyberweb gem by default.
Since as of November 2021 this can be controlled by the user, whether the .css files are added or whether they are not added.
#
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2311
def return_the_CSS_rules_from_the_local_CSS_files(
i = Cyberweb::ARRAY_LOCAL_CSS_FILES
)
css_rules = ''.dup
i.each {|this_CSS_file|
target = "#{PROJECT_CSS_DIRECTORY}#{this_CSS_file}"
if File.exist? target
css_rules << "#{File.read(target, encoding: use_which_encoding?)}\n" end
}
return css_rules
end
|
#return_the_doctype(optional_language = language?
) ⇒ Object
Also known as:
return_doctype
6400
6401
6402
6403
6404
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6400
def return_the_doctype(
optional_language = language?
)
doctype?(optional_language)
end
|
#return_the_id(the_id = '') ⇒ Object
Also known as:
turn_into_html_id
4668
4669
4670
4671
4672
4673
4674
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4668
def return_the_id(
the_id = ''
)
append_onto_the_body_tag_nl(
Cyberweb.return_the_id(the_id)
)
end
|
#return_the_jquery_string ⇒ Object
#
return_the_jquery_string
#
5102
5103
5104
5105
5106
5107
5108
5109
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5102
def return_the_jquery_string
return ("Adding support for jquery (version: #{jquery_version?}) next:")+
"\n"+
Cyberweb.return_jquery_string
end
|
#return_this_css_style ⇒ Object
#
return_css_style
This method will simply return the <style>CONTENT_HERE</style> variant.
#
return_this_css_style
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1987
def return_css_style(
i = main_CSS_rules?
)
if i.is_a? Hash
_ = ''.dup
i.each_pair {|key, value|
_ << "#{key} = #{value};"
}
i = _
end
return Cyberweb::CssStyle.style(i) end
|
#return_this_default_javascript_file(i) ⇒ Object
#
return_this_default_javascript_file
This method will ultimately return the path to a .js file that is distributed in the cyberweb project.
This method will not check whether the file exists, so you may have to do the checking by yourself, if you need it.
#
1210
1211
1212
1213
1214
1215
1216
1217
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1210
def return_this_default_javascript_file(i)
base_path = File.absolute_path("#{project_base_dir?}/javascript_code/")+'/'
unless i.end_with? '.js'
i = i.dup if i.frozen?
i << '.js'
end
return "#{base_path}#{i}"
end
|
#rpg_favicon ⇒ Object
5543
5544
5545
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5543
def rpg_favicon
favicon :rpg
end
|
#ruby_favicon ⇒ Object
5490
5491
5492
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5490
def ruby_favicon
favicon :ruby_favicon
end
|
6633
6634
6635
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6633
def run
do_use_utf_charset
end
|
#s2(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
Also known as:
espan, span
#
s2 (s2 tag)
This method ultimately adds a <span> tag at the position where it is called.
#
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3171
def s2(
i = '',
optional_css_class = '',
optional_the_id = '',
optional_css_style = ''
)
append_onto_the_body_tag_nl(
string_s2(
i.to_s,
optional_css_class,
optional_the_id,
optional_css_style
)
)
end
|
#science_favicon ⇒ Object
5518
5519
5520
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5518
def science_favicon
favicon :science_favicon
end
|
#sclose(i) ⇒ Object
4088
4089
4090
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4088
def sclose(i)
"</#{i}>"
end
|
#set_additional_CSS_rules_to_use(i) ⇒ Object
Also known as:
set_css_style
#
set_additional_CSS_rules_to_use
#
5405
5406
5407
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5405
def set_additional_CSS_rules_to_use(i)
@internal_hash[:additional_CSS_rules_to_use] = i
end
|
#set_background(colour = 'black') ⇒ Object
Also known as:
background_colour, background_color, background_color=, background_colour=, background
#
set_background
Use this to set a specific background colour.
Usage example:
w.background = 'black'
Hmm doesn’t seem to work … odd.
#
677
678
679
680
681
682
683
684
685
686
687
688
689
|
# File 'lib/cyberweb/html_template/html_template.rb', line 677
def set_background(
colour = 'black'
)
_ = 'body { '.dup
case colour when :scroll
_ << ' background-attachment: scroll; '
else
_ << "background-color: #{colour};" end
_ << ' }'
add_this_css_style(_)
end
|
#set_body_content(i) ⇒ Object
1862
1863
1864
1865
1866
1867
1868
1869
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1862
def set_body_content(i)
i = i.to_s unless i.is_a? String
i = i.dup if i.frozen?
unless i.end_with? "\n"
i << "\n" end
@internal_hash[:body_content] = i
end
|
#set_body_css_class(i = '') ⇒ Object
Also known as:
body_css_class, body_css_class=, body_css_classes, body_css=, bcc=, bcc, main_body=, main_body, body=, body, b1=, b1
#
set_body_css_class
This method can be used to designate a (or several) css_class(es) in the <body> tag of a webpage.
#
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2018
def set_body_css_class(
i = ''
)
case i
when :default
i = 'mar0px pad0px VERDANAs'
end
@internal_hash[:body_css_class] = i.to_s
end
|
#set_body_css_style(i) ⇒ Object
Also known as:
body_css, body_css_style, body_css_style=, body_style=, body_style, bcs=, bcs, css1=, css1
#
set_body_css_style
Use this to specify a css style for use in the <body> tag.
An example for this may be the following:
{ padding: 25em; }
#
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5453
def set_body_css_style(i)
if i
i = i.dup if i.frozen?
i.delete!("\n") if i.include? "\n"
end
@internal_hash[:body_css_style] = i
end
|
#set_body_id(i = '') ⇒ Object
Also known as:
body_id, body_id=, id=, id
#
set_body_id (id tag)
This method can be used to set the body_id attribute.
#
5414
5415
5416
5417
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5414
def set_body_id(i = '')
i = i.tr(' ','_') if i.include?(' ')
@internal_hash[:body_id] = i
end
|
#set_encoding_to_use(i = :default) ⇒ Object
Also known as:
charset
#
set_encoding_to_use
Set the specific encoding to use. In general, you may wish to use either UTF or ISO, I would guess.
#
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1313
def set_encoding_to_use(
i = :default
)
case i.to_sym when :utf,
:default,
1
i = 'UTF-8'
when :iso,
2
i = 'ISO-8859-1'
end
i = i.to_s
@internal_hash[:encoding_to_use] = i
end
|
#set_favicon(i = 'RPG/RPG_FAVICON.png') ⇒ Object
Also known as:
favicon=, favicon, fav=, fav, f=, f, set_favicon_string, print_favicon
#
set_favicon
This method will “enable” a favicon.
The first argument to this method should hold the (relative) path to our favicon icon.
You can also use a :symbol as first argument, which will be assumed to mean that we wish to use a certain webimage. This is mostly just useful on my home system, but in the future we may add more code support for flexibility in this regard, so that other users can integrate their own favicons more readily so.
Remember that the favicon comes between the <head> tag.
It may look like so:
<link rel="icon" type="image/png" href="/somewhere/myicon.png" />
#
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2421
def set_favicon(
i = 'RPG/RPG_FAVICON.png'
)
i = Cyberweb::Favicon.path_of?(i)
unless i.start_with? 'http' if respond_to? :return_path_to_the_images_directory
i = "#{return_path_to_the_images_directory}#{i}"
end
end
@internal_hash[:favicon] = i
end
|
#set_font_size(this_font_size = 'default') ⇒ Object
Also known as:
font_size=, font_size, use_this_font_size
#
set_font_size
Set the font size to use via this method.
Usage example for this:
w.font_size = '1.1em'
#
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6679
def set_font_size(
this_font_size = 'default'
)
this_font_size = this_font_size.to_s.strip
this_font_size.sub!(/FS/,'') if this_font_size.include? 'FS'
case this_font_size
when 'default',
'def',
:use_the_default_font_size,
/default_font_size$/
if @config
this_font_size = @config['default_font_size']
else if Cyberweb.configuration_object?.nil?
Cyberweb.initialize_the_configuration_object
end
this_font_size = Cyberweb.configuration_object?['default_font_size']
end
when 'larger',
'bigger',
/larger(_|-)font(_|-)size$/
this_font_size = '1.10em;'
if @config
this_font_size = @config['default_larger_font_size']
else if Cyberweb.configuration_object?.nil?
Cyberweb.initialize_the_configuration_object
end
this_font_size = Cyberweb.configuration_object?['default_larger_font_size']
end
when 'smaller'
this_font_size = @config['default_smaller_font_size']
end
this_font_size.gsub!(/_/,'.') if this_font_size.include? '_'
this_font_size = this_font_size.to_s.delete(' ')
set_raw_font_size(this_font_size)
append_onto_the_CSS_style(
"\nbody { font-size: #{this_font_size}; }\n"
)
end
|
#set_n_total_lines(i = result?
) ⇒ Object
2354
2355
2356
2357
2358
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2354
def set_n_total_lines(
i = result?
)
@internal_hash[:n_total_lines] = i.count(N) if i
end
|
#set_raw_font_size(i) ⇒ Object
6753
6754
6755
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6753
def set_raw_font_size(i)
@internal_hash[:font_size] = i.to_s
end
|
#set_result(i = '') ⇒ Object
Also known as:
set_main_string, set_string, set_string_that_is_to_be_served
#
set_result
This method will directly modify :result, without any further checking.
#
5640
5641
5642
5643
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5640
def set_result(i = '')
i = i.first if i.is_a? Array
@internal_hash[:result] = i
end
|
#set_shall_we_use_jquery(i) ⇒ Object
#
set_shall_we_use_jquery
#
985
986
987
|
# File 'lib/cyberweb/html_template/html_template.rb', line 985
def set_shall_we_use_jquery(i)
@internal_hash[:shall_we_use_jquery] = i
end
|
#set_title(i) ⇒ Object
4960
4961
4962
4963
4964
4965
4966
4967
4968
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4960
def set_title(i)
Cyberweb.set_title(i) end
|
#set_use_these_css_classes(i) ⇒ Object
#
set_use_these_css_classes
#
5123
5124
5125
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5123
def set_use_these_css_classes(i)
@internal_hash[:use_only_these_CSS_classes] = i
end
|
#set_web_title(i = filename?
) ⇒ Object
Also known as:
set_use_this_title, t, t=, title=
#
set_web_title (title tag)
This is the method that can be used to set the title of the given html document. Every HTML page may have a title entry.
For this method it is assumed that ONLY the new title is passed to this method - and nothing else.
This will also delegate onto set_title().
We will then set the complete @html_title and append the latter onto our @result instance variable.
Usage example for this method here goes like this:
w.title = 'foo'
w.title 'SELF'
#
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1525
def set_web_title(
i = filename?
)
if i.is_a? Symbol case i
when :filename_capitalized_no_extension,
:filename_capitalized_no_ext,
:filename_upcased,
:default,
:pretty
i = return_program_name.capitalize.
delete_suffix(File.extname($PROGRAM_NAME))
when :capitalize,
:capitalized,
:autotitle
_ = return_program_name
i = _.capitalize.sub(/#{File.extname(_)}$/,'')
when :assume_pretty_name
i = return_program_name.tr('_',' ').capitalize
when :upcase,
:upcased
i = 'SELF_UPCASED' when :filename_capitalized
i = return_program_name.capitalize
when :filename
i = return_program_name.
delete_suffix(File.extname($PROGRAM_NAME))
end
i = i.to_s unless i.is_a?(String)
end case i
when 'SELF NO EXT',
'SELF_NO_FILEEND',
'SELF_NO_END',
'SELF_BASENAME',
'SELF#NO_EXTENSION',
'SELF_NOEXT',
'SELF_NO_EXT',
/NO_EXT/
i = File.basename($PROGRAM_NAME).gsub(
File.extname($PROGRAM_NAME), ''
)
when /^self$/i,
'NAME',
'DEF'
i = File.basename($PROGRAM_NAME)
when 'SELF_UPCASED'
i = File.basename($PROGRAM_NAME).
sub(/#{File.extname($PROGRAM_NAME)}$/,'').
upcase
when 'use_default_file',
'markdown_file'
unless File.exist? i
if File.exist? 'TITLE.md'
i = File.read('TITLE.md').chomp
elsif File.exist? 'TITEL.md' i = File.read('TITEL.md').chomp.strip
i[0,1] = '' if i.start_with? '-'
end
end
end
ignored_file_extensions = %w( php html cgi ) if i and File.exist?(i.to_s) and File.file?(i.to_s) and
!ignored_file_extensions.include?(File.extname(i).delete('.'))
i = File.read(i).chomp
end
i = i.dup if i.is_a?(String) and i.frozen?
@internal_hash[:web_title] = i
set_title(i)
end
|
#shall_we_add_the_meta_content? ⇒ Boolean
#
shall_we_add_the_meta_content?
#
6465
6466
6467
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6465
def shall_we_add_the_meta_content?
!@internal_hash[:meta_content].to_s.empty?
end
|
#shall_we_use_jquery? ⇒ Boolean
Also known as:
use_jquery?
3321
3322
3323
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3321
def shall_we_use_jquery?
@internal_hash[:shall_we_use_jquery]
end
|
#show_pdf(i) ⇒ Object
5867
5868
5869
5870
5871
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5867
def show_pdf(i)
append_onto_the_body_tag_nl(
Cyberweb.embed_this_pdf(i)
)
end
|
#show_the_lines? ⇒ Boolean
5378
5379
5380
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5378
def show_the_lines?
@internal_hash[:show_the_lines]
end
|
#show_this_svg(i) ⇒ Object
3939
3940
3941
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3939
def show_this_svg(i)
append_onto_the_body_tag_nl(i)
end
|
#sin_file(i, css_class = 'orange BO') ⇒ Object
4215
4216
4217
4218
4219
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4215
def sin_file(
i, css_class = 'orange BO'
)
return string_s2(i, css_class)
end
|
#sitelibdir? ⇒ Boolean
#
sitelibdir?
This method will return a String such as “/usr/lib/ruby/site_ruby/3.2.0/”.
#
5428
5429
5430
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5428
def sitelibdir?
return RbConfig::CONFIG['sitelibdir'].to_s+'/'
end
|
#sitemap_favicon ⇒ Object
5511
5512
5513
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5511
def sitemap_favicon
favicon :sitemap_favicon
end
|
#slight_indent(i = '', optional_css_class = '') ⇒ Object
Also known as:
slight_ind, sind
5168
5169
5170
5171
5172
5173
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5168
def slight_indent(
i = '',
optional_css_class = ''
)
e i, "padl0_5em #{optional_css_class}"
end
|
#spacer(i = :middle, optional_css_class = '') ⇒ Object
Also known as:
trenner, spalter, space, spacer_center, beautiful_spacer, fancy_spacer, fancy_separator
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4809
def spacer(
i = :middle,
optional_css_class = ''
)
if optional_css_class and optional_css_class.is_a?(Hash)
_ = optional_css_class
if _.has_key? :css_class
optional_css_class = _.delete(:css_class)
end
end
case i
when :left
result = sg(
:spacer,
optional_css_class,
'',
'display: block;
margin-left: auto;
margin-right: auto;'.delete("\n").squeeze(' ')
)
when :middle,
:center,
:default
result = sg(
:spacer,
optional_css_class,
'',
'text-align: center;
display: block;
margin-left: auto;
margin-right: auto;'.delete("\n").squeeze(' ')
)
end
append_onto_the_body_tag_nl(
result
)
end
|
#string_bold(i = '', optional_css_class = '', optional_the_id = '') ⇒ Object
Also known as:
stringbold
3388
3389
3390
3391
3392
3393
3394
3395
3396
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3388
def string_bold(
i = '',
optional_css_class = '',
optional_the_id = ''
)
optional_css_class = optional_css_class.to_s.dup
optional_css_class << ' BOLD'
string_s2(i, optional_css_class.strip, optional_the_id)
end
|
#string_link(i = '', option_hash = {}, &block) ⇒ Object
Also known as:
string_a, string_href, string_remote_link, slink, remote_hyperlink
#
string_link
This method essentially creates a String representation of the HTML <a> tag.
Since as of April 2022 the method “slink” is now an alias to string_link; it used to be an alias towards “def a()”, but this was changed - the word string_link more logically may refer to slink as its intrinsic abbreviation.
#
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2120
def string_link(
i = '',
option_hash = {},
&block
)
if block_given?
yielded = yield
case yielded
when :pretty
option_hash[:remote_URL] = beautiful_url(i)
end
end
if i.is_a?(Symbol)
if i.start_with?('local_')
i = BeautifulUrl.(i)
else
i = beautiful_url(i)
if option_hash.is_a? String
option_hash = { content: option_hash }
end
end
end
if i.start_with? '/home/x'
i = i.dup
i.sub!(/\/home\/x\//, relative_path?)
end
return HtmlTags.a(
i,
option_hash
)
end
|
#string_s2(i = '', optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
Also known as:
string_s, string_span, string_espan, return_span, sspan
#
string_s2
This method ultimately returns a <span> tag.
#
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
|
# File 'lib/cyberweb/html_template/html_template.rb', line 919
def string_s2(
i = '',
optional_css_class = '',
optional_the_id = '',
optional_css_style = ''
)
if optional_css_class.is_a? Hash
if optional_css_class.has_key? :css_style
optional_css_style = optional_css_class[:css_style]
end
if optional_css_class.has_key? :id
optional_the_id = optional_css_class.delete(:id)
end
if optional_css_class.has_key? :css_class
optional_css_class = optional_css_class[:css_class]
end
if optional_css_class.is_a?(Hash) and
optional_css_class.empty?
optional_css_class = ''
end
end
return '<span'+
css_class_or_no_class(optional_css_class).to_s+
id_or_no_id(optional_the_id.to_s)+
css_style_or_no_style(optional_css_style)+
'>'+
i.to_s+
'</span>'
end
|
#string_table11_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
#
string_table11_with_heading
#
#string_table2(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
#
string_table2
This method will delegate towards Cyberweb.string_table2().
#
#string_table2_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
#
string_table2_with_heading
#
#string_table3(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
#
string_table3
We will delegate towards Cyberweb.string_table3 for the functionality here.
#
#string_table4(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4567
def string_table4(
css_class = '',
the_id = '',
css_style = '',
*content,
&block
)
Cyberweb.string_table4(
css_class,
the_id,
css_style,
content,
&block
)
end
|
#string_table5(css_class = '', id = '', css_style = '', *content) ⇒ Object
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5797
def string_table5(
css_class = '',
id = '',
css_style = '',
*content
)
Cyberweb.string_table5(
css_class,
id,
css_style,
content
)
end
|
#string_table5_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
#
string_table5_with_heading
#
#string_table6(css_class = '', id = '', css_style = '', *content) ⇒ Object
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4531
def string_table6(
css_class = '',
id = '',
css_style = '',
*content
)
Cyberweb.string_table6(
css_class,
id,
css_style,
content
)
end
|
#string_table7(css_class = '', id = '', css_style = '', *content) ⇒ Object
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4487
def string_table7(
css_class = '',
id = '',
css_style = '',
*content
)
Cyberweb.string_table7(
css_class, id, css_style, content
)
end
|
#string_table8(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5041
def string_table8(
css_class = '',
the_id = '',
css_style = '',
*content,
&block
)
Cyberweb.string_table8(
css_class,
the_id,
css_style,
content,
&block
)
end
|
#string_table9(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5022
def string_table9(
css_class = '',
the_id = '',
css_style = '',
*content,
&block
)
Cyberweb.string_table9(
css_class,
the_id,
css_style,
content,
&block
)
end
|
#string_tag(which_tag = 'span', css_class = '', the_id = '', css_style = '', javascript_code = '', &block) ⇒ Object
Also known as:
stag, make_tag, string_stag
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4879
def string_tag(
which_tag = 'span',
css_class = '',
the_id = '',
css_style = '',
javascript_code = '',
&block
)
return Cyberweb.string_tag(
which_tag,
css_class,
the_id,
css_style,
javascript_code,
&block
)
end
|
#string_textarea(default_content = '', css_class = '', the_id = '', css_style = '', n_cols = 25, n_rows = 8, javascript = '', name = '', &block) ⇒ Object
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6313
def string_textarea(
default_content = '', css_class = '', the_id = '', css_style = '', n_cols = 25, n_rows = 8, javascript = '', name = '', &block
)
return ::HtmlTags.textarea(
default_content,
css_class,
the_id,
css_style,
n_cols,
n_rows,
javascript,
name,
&block
)
end
|
#svg_link(i) ⇒ Object
5532
5533
5534
5535
5536
5537
5538
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5532
def svg_link(i)
if File.exist? i
append_onto_the_body_tag_nl(
File.read(i)
)
end
end
|
#table(optional_css_class = '', optional_the_id = '', optional_css_style = '') ⇒ Object
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4679
def table(
optional_css_class = '',
optional_the_id = '',
optional_css_style = ''
)
append_onto_the_body_nl(
'<table'+
css_class_or_no_class(optional_css_class)+
id_or_no_id(optional_the_id)+
css_style_or_no_style(optional_css_style)+
'>'
)
end
|
#table11_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
3897
3898
3899
3900
3901
3902
3903
3904
3905
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3897
def table11_with_heading(
css_class = '', id = '', css_style = '', *content
)
append_onto_the_body_tag_nl(
string_table11_with_heading(
css_class, id, css_style, content
)
)
end
|
#table12_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
3746
3747
3748
3749
3750
3751
3752
3753
3754
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3746
def table12_with_heading(
css_class = '', id = '', css_style = '', *content
)
append_onto_the_body_tag_nl(
string_table12_with_heading(
css_class, id, css_style, content
)
)
end
|
#table2(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
#
table2 (table2 tag)
This variant will yield a two-elements-per-row HTML table.
The last variable is the content; keep it even, if possible, e. g 2 elements or 4 or 6 and so forth.
#
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
# File 'lib/cyberweb/html_template/html_template.rb', line 466
def table2(
css_class = '',
id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table2(
css_class,
id,
css_style,
content.flatten,
&block
)
)
end
|
#table2_from_this_file(optional_css_class = '', optional_the_id = '', optional_css_style = '', this_file = 'games_timeline.md', &block) ⇒ Object
#
table2_from_this_file
This variant will read from an existing file, ideally a markdown file .md. One row in the HTML table corresponds to one line in the original markdown file.
Note that currently we will split on ‘:’ which is hardcoded; not sure whether this will change in the future or not.
#
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
# File 'lib/cyberweb/html_template/html_template.rb', line 494
def table2_from_this_file(
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
this_file = 'games_timeline.md',
&block
)
if File.exist? this_file
dataset = File.readlines(this_file, encoding: 'UTF-8').reject {|line|
line.start_with?('#') or line.strip.empty? }
splitted_dataset = dataset.map {|entry|
if entry.include? ':'
splitted = entry.split(':')
entry = [
splitted[0 .. -2].join(':'),
splitted[-1].strip
]
end
entry
}
dataset = splitted_dataset
table2(
optional_css_class,
optional_the_id,
optional_css_style,
*dataset,
&block
)
else
e '(line 5806) No file exists at '+this_file
end
end
|
#table2_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4548
def table2_with_heading(
css_class = '',
id = '',
css_style = '',
*content
)
append_onto_the_body_tag_nl(
string_table2_with_heading(
css_class,
id,
css_style,
content
)
)
end
|
#table3(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5839
def table3(
css_class = '',
id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table3(
css_class,
id,
css_style,
content,
&block
)
)
end
|
#table4(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5081
def table4(
css_class = '',
the_id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table4(
css_class,
the_id,
css_style,
content,
&block
)
)
end
|
#table5(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5776
def table5(
css_class = '',
id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table5(
css_class,
id,
css_style,
content,
&block
)
)
end
|
#table5_with_heading(css_class = '', id = '', css_style = '', *content) ⇒ Object
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5820
def table5_with_heading(
css_class = '',
id = '',
css_style = '',
*content
)
append_onto_the_body_tag_nl(
string_table5_with_heading(
css_class,
id,
css_style,
content
)
)
end
|
#table6(css_class = '', id = '', css_style = '', *content, &block) ⇒ Object
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2091
def table6(
css_class = '',
id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table6(
css_class,
id,
css_style,
content,
&block
)
)
end
|
#table7(css_class = '', id = '', css_style = '', *content) ⇒ Object
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4944
def table7(
css_class = '',
id = '',
css_style = '',
*content
)
append_onto_the_body_tag_nl(
string_table7(
css_class, id, css_style, content
)
)
end
|
#table8(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5060
def table8(
css_class = '',
the_id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table8(
css_class,
the_id,
css_style,
content,
&block
)
)
end
|
#table9(css_class = '', the_id = '', css_style = '', *content, &block) ⇒ Object
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5001
def table9(
css_class = '',
the_id = '',
css_style = '',
*content,
&block
)
append_onto_the_body_tag_nl(
string_table9(
css_class,
the_id,
css_style,
content,
&block
)
)
end
|
#table_clear ⇒ Object
2396
2397
2398
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2396
def table_clear
Cyberweb::Table.clear
end
|
#table_padding=(i = 10) ⇒ Object
2389
2390
2391
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2389
def table_padding=(i = 10)
Cyberweb::Table.padding = i
end
|
#table_parse(*i) ⇒ Object
3508
3509
3510
3511
3512
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3508
def table_parse(*i)
append_onto_the_body_tag_nl(
Cyberweb::Table.parse(i)
)
end
|
#table_set_css_class(i = 'marl2em') ⇒ Object
4659
4660
4661
4662
4663
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4659
def table_set_css_class(
i = 'marl2em'
)
Cyberweb::Table.set_css_class(i)
end
|
#tag(this_tag, optional_css_class = '', optional_the_id = '', optional_css_style = '', optional_javascript = '') ⇒ Object
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4186
def tag(
this_tag,
optional_css_class = '',
optional_the_id = '',
optional_css_style = '',
optional_javascript = ''
)
_ = '<'+this_tag.to_s+
css_class_or_no_class(optional_css_class)+
id_or_no_id(optional_the_id)+
css_style_or_no_style(optional_css_style).dup
if optional_javascript and !optional_javascript.empty?
_ << ' javascript="'+javascript+'"'
end
_ << '>'
append_onto_the_body_tag_nl(_)
end
|
#td(content = '', optional_css_class = '', optional_the_id = '') ⇒ Object
#
td
This method will ultimately yield a <td>CONTENT_HERE</td> String.
td(content, optional_css_class, optional_the_id)
#
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2274
def td(
content = '',
optional_css_class = '',
optional_the_id = ''
)
append_onto_the_body_tag_nl(
'<td'+
css_class_or_no_class(optional_css_class)+
id_or_no_id(optional_the_id)+
'>'
)
if block_given?
append_onto_the_body_tag_nl(yield)
else
append_onto_the_body_tag_nl(content)
end
ctd
end
|
#td_row(array) ⇒ Object
#
td_row
This method will create a <td>-row, that is, each Array member will be positioned into a <td></td> tag.
An example Array may be this one:
%w( 256 128 64 32 16 8 4 2 1 )
#
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3572
def td_row(
array
)
unless array.is_a? Array
raise ArgumentError,
'must provide a valid Array as input to this method'
end
array.each {|this_entry|
td(this_entry)
}
end
|
#template1(i) ⇒ Object
2861
2862
2863
2864
2865
2866
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2861
def template1(i)
append_onto_the_main_CSS_rules(:template1)
if i and !i.empty?
append_onto_the_main_CSS_rules(i)
end
end
|
#textarea(default_content = '', css_class = '', the_id = '', css_style = '', n_cols = 25, n_rows = 8, javascript = '', name = '', &block) ⇒ Object
Also known as:
textview, add_write_area, add_textfield
#
textarea
This method essentially creates a HTML <textarea> tag.
Usage example:
textarea('foobar','bblack1 pad1em','textarea_id')
This method also works via a block. Example for this:
add_textfield {{
width: 50,
height: 50
}}
#
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6282
def textarea(
default_content = '', css_class = '', the_id = '', css_style = '', n_cols = 25, n_rows = 8, javascript = '', name = '', &block
)
append_onto_the_body_tag_nl(
string_textarea(
default_content,
css_class,
the_id,
css_style,
n_cols,
n_rows,
javascript,
name,
&block
)
)
end
|
#th(optional_input = '') ⇒ Object
#
th
This method will yield the <th> tag, ultimately.
#
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6642
def th(
optional_input = ''
)
_ = '<th'.dup
case optional_input
when :left
_ << 'align="left"'
when :right
_ << 'align="right"'
end
_ << '>'
append_onto_the_body_tag(_)
end
|
5195
5196
5197
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5195
def thead
append_onto_the_body_tag('<thead>')
end
|
2296
2297
2298
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2296
def thick_hr
hr 'thick'
end
|
#to_binary(i) ⇒ Object
1884
1885
1886
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1884
def to_binary(i)
return Roebe::ToBinary.to(i)
end
|
#
tr
This method will create a <tr> tag.
#
3642
3643
3644
3645
3646
3647
3648
3649
3650
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3642
def tr
append_onto_the_body_tag_nl(
'<tr>'
)
if block_given?
yield
ctr
end
end
|
#trtd(optional_input = '', optional_css_class = '', &block) ⇒ Object
#
trtd
Usage for this method can be quite complex, as the following example may show:
trtd {
p('wid98'){
s2 '13.09.2003:','yel'
}
}
Thus, the method has to handle blocks as well.
#
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3666
def trtd(
optional_input = '',
optional_css_class = '',
&block
)
tr
td(optional_input, optional_css_class)
if block_given?
yield
ctd ctr end
end
|
#unicode_plus_minus ⇒ Object
4865
4866
4867
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4865
def unicode_plus_minus
UNICODE_PLUS_MINUS
end
|
#upcase_the_title ⇒ Object
4902
4903
4904
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4902
def upcase_the_title
set_web_title(:upcase)
end
|
#use_body_tag? ⇒ Boolean
5226
5227
5228
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5226
def use_body_tag?
@internal_hash[:use_body_tag]
end
|
#use_english ⇒ Object
Also known as:
do_use_english
4360
4361
4362
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4360
def use_english language :english
end
|
#use_german ⇒ Object
#
use_german
This is an easier shortcut to designate that the current webpage makes use of the german language as part of its content primarily.
#
1285
1286
1287
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1285
def use_german language :german
end
|
#use_iso_encoding ⇒ Object
#
use_iso_encoding
This uses the ISO Encoding for Europe.
#
5398
5399
5400
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5398
def use_iso_encoding
set_encoding_to_use :iso
end
|
#use_local_CSS_files? ⇒ Boolean
Also known as:
use_the_internal_CSS_files?, use_internal_css_files?
5337
5338
5339
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5337
def use_local_CSS_files?
@internal_hash[:use_local_CSS_files]
end
|
#use_monospace_font(use_this_font = '"Lucida Console", Monaco, monospace') ⇒ Object
Also known as:
monospace_font
#
use_monospace_font
By default this will use the “Lucida Console” font.
#
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2783
def use_monospace_font(
use_this_font = '"Lucida Console", Monaco, monospace'
)
use_this_font = use_this_font.dup if use_this_font.frozen?
use_this_font << ';' unless use_this_font.end_with? ';'
append_to_css_style '
body {
font-family: '+use_this_font+'
}
'
end
|
#wasserstoff ⇒ Object
4377
4378
4379
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4377
def wasserstoff
'H₂'
end
|
#we_have_not_yet_served_the_web_content ⇒ Object
#
we_have_not_yet_served_the_web_content
#
2337
2338
2339
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2337
def we_have_not_yet_served_the_web_content
@internal_hash[:already_served] = false
end
|
#we_have_now_already_served_the_web_content ⇒ Object
#
we_have_now_already_served_the_web_content
#
2330
2331
2332
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2330
def we_have_now_already_served_the_web_content
@internal_hash[:already_served] = true
end
|
#web_title? ⇒ Boolean
Also known as:
title?
#
web_title?
The query-method over the current title of the web-app at hand.
#
5660
5661
5662
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5660
def web_title?
@internal_hash[:web_title]
end
|
#white_font ⇒ Object
2772
2773
2774
2775
2776
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2772
def white_font
add_this_css_style(
'body { color: white; }'
)
end
|
#wings_favicon ⇒ Object
5557
5558
5559
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5557
def wings_favicon
set_favicon :wings
end
|
#wlan_favicon ⇒ Object
Also known as:
favicon_wlan
5504
5505
5506
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5504
def wlan_favicon
favicon :wlan_favicon
end
|