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 ⇒ 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 ========================================================================= #.
-
#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[]
#
6935
6936
6937
6938
6939
6940
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6935
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().
#
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
3314
3315
3316
3317
3318
3319
3320
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3288
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
2812
2813
2814
2815
2816
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2812
def add_omega_symbol
append_onto_the_body_tag_nl(
return_omega_symbol
)
end
|
#add_omega_symbol_semantics ⇒ Object
#
add_omega_symbol_semantics
#
3805
3806
3807
3808
3809
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3805
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
4640
4641
4642
4643
4644
4645
4646
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4640
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.
#
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6322
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'
#
6289
6290
6291
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6289
def add_this_remote_css_page(i)
@internal_hash[:link_in_these_remote_CSS_files] << i
end
|
#add_unicode_charset ⇒ Object
3442
3443
3444
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3442
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?
#
1881
1882
1883
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1881
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.
#
2353
2354
2355
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2353
def already_served?
@internal_hash[:already_served]
end
|
#alt_text_or_no_alt_text(i) ⇒ Object
#
alt_text_or_no_alt_text
#
3690
3691
3692
3693
3694
3695
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3690
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
3150
3151
3152
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3150
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.
#
6740
6741
6742
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6740
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.
#
2195
2196
2197
2198
2199
2200
2201
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2195
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.
#
1949
1950
1951
1952
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1949
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
#
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6824
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
#
1958
1959
1960
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1958
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.
#
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
4285
4286
4287
4288
4289
4290
4291
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4247
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
#
5298
5299
5300
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5298
def append_this_to_the_body_css(i)
@internal_hash[:body_css_style] << i.to_s
end
|
5170
5171
5172
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5170
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'
#
3609
3610
3611
3612
3613
3614
3615
3616
3617
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3609
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.
#
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4404
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.
#
5817
5818
5819
5820
5821
5822
5823
5824
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5817
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
|
4703
4704
4705
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4703
def background_scroll
set_background :scroll
end
|
#black_background ⇒ Object
3388
3389
3390
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3388
def black_background
set_background(:black)
end
|
#black_white ⇒ Object
3380
3381
3382
3383
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3380
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
#
3529
3530
3531
3532
3533
3534
3535
3536
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3529
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?
5587
5588
5589
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5587
def body_content?
@internal_hash[:body_content]
end
|
#body_css_class? ⇒ Boolean
2015
2016
2017
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2015
def body_css_class?
@internal_hash[:body_css_class]
end
|
#body_css_style? ⇒ Boolean
4299
4300
4301
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4299
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()'
#
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5657
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
5637
5638
5639
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5637
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'
#
3469
3470
3471
3472
3473
3474
3475
3476
3477
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3469
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
3502
3503
3504
3505
3506
3507
3508
3509
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3502
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
5512
5513
5514
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5512
def br
append_onto_the_body_tag_nl(:br)
end
|
#
brbr
This simply combines two calls to br().
#
3777
3778
3779
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3777
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.
#
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
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
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6427
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'
#
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6386
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]
#
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3348
def call(
env = nil
)
internal_render
result = main_string?
[
200, {
'Content-Type' => 'text/html',
'Content-Length' => result.size },
[result] ]
end
|
4004
4005
4006
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4004
def cbody
close(:body)
end
|
4139
4140
4141
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4139
def cdiv
close(:div)
end
|
4102
4103
4104
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4102
def cdl
close(:dl)
end
|
#cfieldset ⇒ Object
4088
4089
4090
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4088
def cfieldset
close(:fieldset)
end
|
4081
4082
4083
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4081
def cform
close(:form)
end
|
#cframeset ⇒ Object
4011
4012
4013
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4011
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
|
3988
3989
3990
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3988
def chtml
close(:html)
end
|
#circle(hash = {
height: 150,
colour: :yellow,
radius: :quarter_default_width,
stroke_width: 10
}) ⇒ Object
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3541
def circle(
hash = {
height: 150,
colour: :yellow,
radius: :quarter_default_width,
stroke_width: 10
}
)
_ = Cyberweb.circle(hash)
append_onto_the_body_tag_nl(_)
end
|
4132
4133
4134
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4132
def clabel
close(:label)
end
|
#clear_left ⇒ Object
3766
3767
3768
3769
3770
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3766
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.
#
4344
4345
4346
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4344
def clear_the_main_string
main_string?.clear end
|
4067
4068
4069
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4067
def clegend
close(:legend)
end
|
4025
4026
4027
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4025
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.
#
3971
3972
3973
3974
3975
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3971
def close(i)
append_onto_the_body_nl(
sclose(i)
)
end
|
#close_a ⇒ Object
Also known as:
ca
4074
4075
4076
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4074
def close_a
close(:a)
end
|
#close_html ⇒ Object
3980
3981
3982
3983
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3980
def close_html
cbody
chtml
end
|
4039
4040
4041
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4039
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
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2975
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.
#
2935
2936
2937
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2935
def cmd1?
Cyberweb.cmd1?
end
|
#cmd1_is(i) ⇒ Object
Also known as:
cmd_is, set_cmd1
2226
2227
2228
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2226
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
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2994
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
2234
2235
2236
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2234
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
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2878
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
2241
2242
2243
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2241
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
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3109
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
2248
2249
2250
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2248
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
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3012
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
2255
2256
2257
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2255
def cmd5_is(i)
Cyberweb.cmd5 = i
end
|
#cmd_pre(i) ⇒ Object
Also known as:
pre_cmd
3094
3095
3096
3097
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3094
def cmd_pre(i)
splitted = i.split(N)
splitted.each {|entry| cmd(entry) }
end
|
#cmdbold(i = '') ⇒ Object
3075
3076
3077
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3075
def cmdbold(i = '')
cmd(i, 'BOLD mars1em')
end
|
4032
4033
4034
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4032
def cobject
close(:object)
end
|
#col_cmd(i = '', optional_id = '') ⇒ Object
Also known as:
col
3082
3083
3084
3085
3086
3087
3088
3089
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3082
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.
#
5092
5093
5094
5095
5096
5097
5098
5099
5100
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5092
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
#
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2698
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.
#
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5686
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
4759
4760
4761
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4759
def counter_eight(i)
e "(8) #{i}"
end
|
#counter_five(i) ⇒ Object
Also known as:
c_five
4738
4739
4740
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4738
def counter_five(i)
e "(5) #{i}"
end
|
#counter_four(i) ⇒ Object
Also known as:
c_four
4731
4732
4733
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4731
def counter_four(i)
e "(4) #{i}"
end
|
#counter_nine(i) ⇒ Object
Also known as:
c_nine
4766
4767
4768
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4766
def counter_nine(i)
e "(9) #{i}"
end
|
#counter_one(i) ⇒ Object
Also known as:
c_one
4710
4711
4712
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4710
def counter_one(i)
e "(1) #{i}"
end
|
#counter_seven(i) ⇒ Object
Also known as:
c_seven
4752
4753
4754
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4752
def counter_seven(i)
e "(7) #{i}"
end
|
#counter_six(i) ⇒ Object
Also known as:
c_six
4745
4746
4747
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4745
def counter_six(i)
e "(6) #{i}"
end
|
#counter_ten(i) ⇒ Object
Also known as:
c_ten
4773
4774
4775
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4773
def counter_ten(i)
e "(10) #{i}"
end
|
#counter_three(i) ⇒ Object
Also known as:
c_three
4724
4725
4726
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4724
def counter_three(i)
e "(3) #{i}"
end
|
#counter_two(i) ⇒ Object
Also known as:
c_two
4717
4718
4719
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4717
def counter_two(i)
e "(2) #{i}"
end
|
4146
4147
4148
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4146
def cp
close(:p)
end
|
4060
4061
4062
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4060
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')
#
2768
2769
2770
2771
2772
2773
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2768
def created_when(
i = '20.08.2021'
)
@internal_hash[:additional_meta_collection] =
'<meta name="DCTERMS.created" content="'+i.to_s+'"/>'
end
|
4053
4054
4055
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4053
def cselect
close(:select)
end
|
#css_class_or_no_class(i = '') ⇒ Object
#
css_class_or_no_class
#
4313
4314
4315
4316
4317
4318
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4313
def css_class_or_no_class(i = '')
unless i.to_s.empty?
i = " class=\"#{i}\""
end
return i
end
|
#css_classes? ⇒ Boolean
2000
2001
2002
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2000
def css_classes?
@internal_hash[:use_only_these_CSS_classes]
end
|
#css_for_cmd1(i = '') ⇒ Object
Also known as:
css_for_cmd
3030
3031
3032
3033
3034
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3030
def css_for_cmd1(
i = ''
)
Cyberweb.css_for_cmd1 = i
end
|
#css_for_cmd2(i = '') ⇒ Object
3039
3040
3041
3042
3043
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3039
def css_for_cmd2(
i = ''
)
Cyberweb.css_for_cmd2 = i
end
|
#css_for_cmd3(i = '') ⇒ Object
3048
3049
3050
3051
3052
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3048
def css_for_cmd3(
i = ''
)
Cyberweb.css_for_cmd3 = i
end
|
#css_for_cmd4(i = '') ⇒ Object
3057
3058
3059
3060
3061
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3057
def css_for_cmd4(
i = ''
)
Cyberweb.css_for_cmd4 = i
end
|
#css_for_cmd5(i = '') ⇒ Object
3066
3067
3068
3069
3070
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3066
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
#
2734
2735
2736
2737
2738
2739
2740
2741
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2734
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.
#
3435
3436
3437
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3435
def css_template1
css_style :template1
end
|
4125
4126
4127
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4125
def ctable
close(:table)
end
|
4046
4047
4048
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4046
def ctd
close(:td)
end
|
3995
3996
3997
3998
3999
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3995
def ctdctr
append_onto_the_body_tag_nl(
'</td></tr>'
)
end
|
4116
4117
4118
4119
4120
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4116
def ctdtd
append_onto_the_body_tag_nl(
'</td><td>'
)
end
|
#ctextarea ⇒ Object
4153
4154
4155
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4153
def ctextarea
close(:textarea)
end
|
4109
4110
4111
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4109
def ctr
close(:tr)
end
|
4018
4019
4020
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4018
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.
#
3843
3844
3845
3846
3847
3848
3849
3850
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3843
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?().
#
5376
5377
5378
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5376
def current_ruby_version?
sitelibdir?.split('/').last
end
|
#cursor(i = :wait) ⇒ Object
2070
2071
2072
2073
2074
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2070
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
6704
6705
6706
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6704
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
#
6729
6730
6731
6732
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6729
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.
#
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4326
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
#
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6782
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.
#
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3624
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.
#
5069
5070
5071
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5069
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
5462
5463
5464
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5462
def dnd_favicon
favicon :dnd_favicon
end
|
#do_not_use_jquery ⇒ Object
2716
2717
2718
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2716
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
#
5291
5292
5293
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5291
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.
#
2465
2466
2467
2468
2469
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2465
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
3127
3128
3129
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3127
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.
#
5284
5285
5286
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5284
def do_use_local_CSS_files
@internal_hash[:use_local_CSS_files] = true
end
|
#do_use_utf_charset ⇒ Object
5261
5262
5263
5264
5265
5266
5267
5268
5269
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5261
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.
#
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1967
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.
#
3858
3859
3860
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3858
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
3492
3493
3494
3495
3496
3497
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3492
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
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4924
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
3482
3483
3484
3485
3486
3487
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3482
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'
#
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2654
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?
5419
5420
5421
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5419
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.
#
5240
5241
5242
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5240
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
5487
5488
5489
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5487
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)
#
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1916
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.
#
3558
3559
3560
3561
3562
3563
3564
3565
3566
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3558
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
1847
1848
1849
1850
1851
1852
1853
1854
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1847
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.
#
3868
3869
3870
3871
3872
3873
3874
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3868
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
3143
3144
3145
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3143
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'
}}
#
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4606
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
3827
3828
3829
3830
3831
3832
3833
3834
3835
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3827
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
#
3796
3797
3798
3799
3800
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3796
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')
#
3935
3936
3937
3938
3939
3940
3941
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3935
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
#
4787
4788
4789
4790
4791
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4787
def hr_stars
append_onto_the_body_tag_nl(
Cyberweb.return_pretty_stars
)
end
|
2805
2806
2807
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2805
def hsep
return '<hr>'
end
|
1840
1841
1842
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1840
def hspacer
spacer(:center)
end
|
#html_title?(i = web_title?
) ⇒ Boolean
#
html_title?
This will return a proper <title> tag.
#
5606
5607
5608
5609
5610
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5606
def html_title?(
i = web_title?
)
HtmlTags.title(i.to_s) { :newline }
end
|
#htmlescape(i) ⇒ Object
Also known as:
htmlentities, hescape, htmltitties
5252
5253
5254
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5252
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.
#
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2835
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
4214
4215
4216
4217
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4214
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.
#
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3160
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.
#
5120
5121
5122
5123
5124
5125
5126
5127
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5120
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.
#
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6180
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.
#
5503
5504
5505
5506
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5503
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.
#
2725
2726
2727
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2725
def is_a_sinatra_application?
@internal_hash[:is_a_sinatra_application]
end
|
#is_localhost? ⇒ Boolean
5146
5147
5148
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5146
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.
#
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4163
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.
#
3956
3957
3958
3959
3960
3961
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3956
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>
#
5524
5525
5526
5527
5528
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5524
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
#
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5543
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”.
#
6714
6715
6716
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6714
def larger_font_size
font_size(:larger_font_size)
end
|
#larger_font_size_and_hyperlinks ⇒ Object
#
larger_font_size_and_hyperlinks
#
6721
6722
6723
6724
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6721
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
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3880
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
4809
4810
4811
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4809
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
5434
5435
5436
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5434
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
3918
3919
3920
3921
3922
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3918
def markdown(i = '')
append_onto_the_body_tag_nl(
Cyberweb.markdown(i)
)
end
|
#mars1em(i = '') ⇒ Object
2091
2092
2093
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2091
def mars1em(i = '')
e(i, 'mars1em')
end
|
#mars2em(i = '', optional_css_class = '') ⇒ Object
2079
2080
2081
2082
2083
2084
2085
2086
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2079
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.
#
4849
4850
4851
4852
4853
4854
4855
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4849
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?
6409
6410
6411
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6409
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?
#
5797
5798
5799
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5797
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.
#
2372
2373
2374
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2372
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.
#
6306
6307
6308
6309
6310
6311
6312
6313
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6306
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
#
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3737
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.
#
2058
2059
2060
2061
2062
2063
2064
2065
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2058
def on_hover_colour(i)
append_onto_CSS(
"a:hover {
color: #{i};
}
"
)
end
|
#onload_or_no_onload(i = body_javascript?
) ⇒ Object
2821
2822
2823
2824
2825
2826
2827
2828
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2821
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.
#
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4456
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'
#
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
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
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5848
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.
#
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
3260
3261
3262
3263
3264
3265
3266
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3200
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
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1995
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
4514
4515
4516
4517
4518
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4514
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.
#
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
2610
2611
2612
2613
2614
2615
2616
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2487
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
5139
5140
5141
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5139
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.
#
6602
6603
6604
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6602
def prepend_before_the_body_tag(i)
@internal_hash[:prepend_before_the_body_tag][0,0] = i
end
|
#prepend_doc_type ⇒ Object
3134
3135
3136
3137
3138
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3134
def prepend_doc_type
@internal_hash[:result].prepend(
"#{default_doc_type?}\n"
)
end
|
#pull_in(i) ⇒ Object
6767
6768
6769
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6767
def pull_in(i)
Object.send(:include, i)
end
|
#pull_in_the_jquery_module ⇒ Object
#
pull_in_the_jquery_module
#
6774
6775
6776
6777
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6774
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
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2262
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?
2007
2008
2009
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2007
def raw_favicon_string?
@internal_hash[:favicon]
end
|
#raw_font_size? ⇒ Boolean
Also known as:
current_font_size?
6697
6698
6699
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6697
def raw_font_size?
@internal_hash[:font_size]
end
|
#
Usage example:
readonly_input id: 'result_for_circle_calculations'
#
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4865
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
4485
4486
4487
4488
4489
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4485
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.
#
3817
3818
3819
3820
3821
3822
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3817
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().
#
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2624
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
1859
1860
1861
1862
1863
1864
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1859
def repeat(
which_tag = '<br>',
how_many_times = '12'
)
return which_tag * how_many_times.to_i
end
|
#request_uri? ⇒ Boolean
4306
4307
4308
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4306
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
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2206
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.
#
2684
2685
2686
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2684
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().
#
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3703
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.
#
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1983
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.
#
4355
4356
4357
4358
4359
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4355
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.
#
4233
4234
4235
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4233
def return_omega_symbol
return '"Omega"'
end
|
#return_omega_symbol_semantics ⇒ Object
#
return_omega_symbol_semantics
This will return the <math> tag.
#
3368
3369
3370
3371
3372
3373
3374
3375
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3368
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
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4423
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.
#
5053
5054
5055
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5053
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.
#
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5617
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.
#
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5186
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.
#
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2318
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
6337
6338
6339
6340
6341
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6337
def return_the_doctype(
optional_language = language?
)
doctype?(optional_language)
end
|
#return_the_id(the_id = '') ⇒ Object
Also known as:
turn_into_html_id
4675
4676
4677
4678
4679
4680
4681
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4675
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
#
5039
5040
5041
5042
5043
5044
5045
5046
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5039
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
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1994
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
5480
5481
5482
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5480
def rpg_favicon
favicon :rpg
end
|
#ruby_favicon ⇒ Object
5427
5428
5429
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5427
def ruby_favicon
favicon :ruby_favicon
end
|
6570
6571
6572
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6570
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.
#
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3178
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
5455
5456
5457
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5455
def science_favicon
favicon :science_favicon
end
|
#sclose(i) ⇒ Object
4095
4096
4097
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4095
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
#
5342
5343
5344
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5342
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
1869
1870
1871
1872
1873
1874
1875
1876
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1869
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.
#
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2025
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; }
#
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5390
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.
#
5351
5352
5353
5354
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5351
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" />
#
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2428
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'
#
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6616
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
2361
2362
2363
2364
2365
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2361
def set_n_total_lines(
i = result?
)
@internal_hash[:n_total_lines] = i.count(N) if i
end
|
#set_raw_font_size(i) ⇒ Object
6690
6691
6692
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6690
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.
#
5577
5578
5579
5580
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5577
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
4897
4898
4899
4900
4901
4902
4903
4904
4905
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4897
def set_title(i)
Cyberweb.set_title(i) end
|
#set_use_these_css_classes(i) ⇒ Object
#
set_use_these_css_classes
#
5060
5061
5062
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5060
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?
#
6402
6403
6404
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6402
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?
3328
3329
3330
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3328
def shall_we_use_jquery?
@internal_hash[:shall_we_use_jquery]
end
|
#show_pdf(i) ⇒ Object
5804
5805
5806
5807
5808
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5804
def show_pdf(i)
append_onto_the_body_tag_nl(
Cyberweb.embed_this_pdf(i)
)
end
|
#show_the_lines? ⇒ Boolean
5315
5316
5317
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5315
def show_the_lines?
@internal_hash[:show_the_lines]
end
|
#show_this_svg(i) ⇒ Object
3946
3947
3948
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3946
def show_this_svg(i)
append_onto_the_body_tag_nl(i)
end
|
#sin_file(i, css_class = 'orange BO') ⇒ Object
4222
4223
4224
4225
4226
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4222
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/”.
#
5365
5366
5367
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5365
def sitelibdir?
return RbConfig::CONFIG['sitelibdir'].to_s+'/'
end
|
#sitemap_favicon ⇒ Object
5448
5449
5450
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5448
def sitemap_favicon
favicon :sitemap_favicon
end
|
#slight_indent(i = '', optional_css_class = '') ⇒ Object
Also known as:
slight_ind, sind
5105
5106
5107
5108
5109
5110
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5105
def slight_indent(
i = '',
optional_css_class = ''
)
e i, "padl0_5em #{optional_css_class}"
end
|
#string_bold(i = '', optional_css_class = '', optional_the_id = '') ⇒ Object
Also known as:
stringbold
3395
3396
3397
3398
3399
3400
3401
3402
3403
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3395
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.
#
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
2178
2179
2180
2181
2182
2183
2184
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2127
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
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4574
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
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5734
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
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4538
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
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4494
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
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4978
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
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4959
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
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4816
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
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6250
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
5469
5470
5471
5472
5473
5474
5475
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5469
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
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4686
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
3904
3905
3906
3907
3908
3909
3910
3911
3912
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3904
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
3753
3754
3755
3756
3757
3758
3759
3760
3761
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3753
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
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4555
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
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 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
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5018
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
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5713
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
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5757
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
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2098
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
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4881
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
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4997
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
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4938
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
2403
2404
2405
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2403
def table_clear
Cyberweb::Table.clear
end
|
#table_padding=(i = 10) ⇒ Object
2396
2397
2398
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2396
def table_padding=(i = 10)
Cyberweb::Table.padding = i
end
|
#table_parse(*i) ⇒ Object
3515
3516
3517
3518
3519
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3515
def table_parse(*i)
append_onto_the_body_tag_nl(
Cyberweb::Table.parse(i)
)
end
|
#table_set_css_class(i = 'marl2em') ⇒ Object
4666
4667
4668
4669
4670
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4666
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
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4193
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)
#
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2281
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 )
#
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3579
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
2868
2869
2870
2871
2872
2873
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2868
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
}}
#
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6219
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.
#
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
|
# File 'lib/cyberweb/html_template/html_template.rb', line 6579
def th(
optional_input = ''
)
_ = '<th'.dup
case optional_input
when :left
_ << 'align="left"'
when :right
_ << 'align="right"'
end
_ << '>'
append_onto_the_body_tag(_)
end
|
5132
5133
5134
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5132
def thead
append_onto_the_body_tag('<thead>')
end
|
2303
2304
2305
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2303
def thick_hr
hr 'thick'
end
|
#to_binary(i) ⇒ Object
1891
1892
1893
|
# File 'lib/cyberweb/html_template/html_template.rb', line 1891
def to_binary(i)
return Roebe::ToBinary.to(i)
end
|
#
tr
This method will create a <tr> tag.
#
3649
3650
3651
3652
3653
3654
3655
3656
3657
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3649
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.
#
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
|
# File 'lib/cyberweb/html_template/html_template.rb', line 3673
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
4802
4803
4804
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4802
def unicode_plus_minus
UNICODE_PLUS_MINUS
end
|
#upcase_the_title ⇒ Object
4839
4840
4841
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4839
def upcase_the_title
set_web_title(:upcase)
end
|
#use_body_tag? ⇒ Boolean
5163
5164
5165
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5163
def use_body_tag?
@internal_hash[:use_body_tag]
end
|
#use_english ⇒ Object
Also known as:
do_use_english
4367
4368
4369
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4367
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.
#
5335
5336
5337
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5335
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?
5274
5275
5276
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5274
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.
#
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2790
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
4384
4385
4386
|
# File 'lib/cyberweb/html_template/html_template.rb', line 4384
def wasserstoff
'H₂'
end
|
#we_have_not_yet_served_the_web_content ⇒ Object
#
we_have_not_yet_served_the_web_content
#
2344
2345
2346
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2344
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
#
2337
2338
2339
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2337
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.
#
5597
5598
5599
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5597
def web_title?
@internal_hash[:web_title]
end
|
#white_font ⇒ Object
2779
2780
2781
2782
2783
|
# File 'lib/cyberweb/html_template/html_template.rb', line 2779
def white_font
add_this_css_style(
'body { color: white; }'
)
end
|
#wings_favicon ⇒ Object
5494
5495
5496
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5494
def wings_favicon
set_favicon :wings
end
|
#wlan_favicon ⇒ Object
Also known as:
favicon_wlan
5441
5442
5443
|
# File 'lib/cyberweb/html_template/html_template.rb', line 5441
def wlan_favicon
favicon :wlan_favicon
end
|