Class: Cyberweb::Objectified::HtmlTags::Head
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
#copy_this_file, #cpr, #delete_file, #filename_without_extension?, #read_file_via_utf8_encoding
Methods inherited from Base
#+, #add_css_rules, #add_this_to_javascript, #add_to_pre_content, #append_css_manager, #append_onto_the_css_class, #append_onto_the_result, #append_the_content, #append_this_to_the_css_style, #attach, #batch_append_css_class_then_the_ID_and_then_the_css_style, #bblack1, #bblack2, #bblack3, #bblack4, #bblack5, #bblack6, #center, #consider_adding_the_pre_content, #consider_adding_the_script_entry_from_the_internal_hash, #content?, #content_as_string, #css_class?, #css_manager, #css_style?, #display, #do_not_load_lazily, #ee, #enable_lazy_loading, #evaluate_this_block, #font=, #id?, #is_an_objectified_html_tag?, #is_draggable?, #lazy_loading?, #make_bold, #modify_the_css_style_based_on_the_alignment, #name=, #name?, #on_click_select, #on_clicked, #on_hover_colour, #on_hover_pulse_increase, #on_mouse_hover, #pad, #pad10px, #pad1px, #pad2px, #pad3px, #pad4px, #pad5px, #pad6px, #pad7px, #pad8px, #pad9px, #path_to_internal_javascript_file, #pre_content?, #raw_result?, #report, report, #report?, #reset_the_content, #reset_the_result, #return_appendable_content, #return_css_class, #return_css_style, #return_javascript, #script?, #set_content, #set_css_class, #set_css_style, #set_id, #set_is_draggable, #set_title, #set_width, #title?, #to_str, #try_to_register_this_tag, #use_this_on_click_function=, #very_light_yellowish_background, #width_height, #yellow_background
Methods included from BaseModule
#attach_these_constants, #base_dir?, #beautiful_url, #cd, #create_the_internal_hash, #doctype?, #ee, #ensure_main_encoding, #esystem, #html_templates, #initialize_the_config_if_the_config_hash_is_empty, #internal_hash?, #log_dir?, #no_http, #random_alphabet_characters, #rarrow?, #rds, #remove_comments_from_this_string, #remove_numbers, #require_the_html_templates, #require_these, #return_file_size_in_kb_of, #return_html_comment, #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(use_this_text = '') ⇒ Head
65
66
67
68
69
70
71
72
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 65
def initialize(
use_this_text = ''
)
try_to_register_this_tag(self)
reset
use_this_text = use_this_text.join(' ').strip if use_this_text.is_a? Array
set_content(use_this_text)
end
|
Class Method Details
39
40
41
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 39
def self.clear
Head.set_css_class('')
end
|
.css_class? ⇒ Boolean
53
54
55
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 53
def self.css_class?
@css_class
end
|
.reset_css_class ⇒ Object
32
33
34
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 32
def self.reset_css_class
@css_class = nil
end
|
.set_css_class(i = DEFAULT_CSS_CLASS) ⇒ Object
46
47
48
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 46
def self.set_css_class(i = DEFAULT_CSS_CLASS)
@css_class = i
end
|
Instance Method Details
#description(i = '') ⇒ Object
99
100
101
102
103
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 99
def description(i = '')
if i and !i.empty?
append_to_content '<meta name="description" content="'+i.to_s+'">'+"\n"
end
end
|
#pull_in_css_file(this_CSS_file = 'default.css') ⇒ Object
117
118
119
120
121
122
123
124
125
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 117
def pull_in_css_file(
this_CSS_file = 'default.css'
)
_ = project_base_directory?+
'cascading_style_sheets/'+
this_CSS_file
dataset = read_file_via_utf8_encoding(_)+"\n"
style(dataset)
end
|
#rebuild_the_result ⇒ Object
130
131
132
133
134
135
136
137
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 130
def rebuild_the_result
reset_the_result
consider_adding_the_pre_content
append_onto_the_result "<head>\n"
append_onto_the_result content?.to_s
append_onto_the_result "\n</head>\n"
return raw_result?
end
|
77
78
79
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 77
def reset
super()
end
|
91
92
93
94
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 91
def style(i)
require 'cyberweb/objectified/html_tags/style.rb'
append_to_content Cyberweb::Objectified::HtmlTags::Style.new(i)
end
|
108
109
110
111
112
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 108
def title(i)
content?.prepend(
"<title>#{i}</title>\n"
)
end
|
84
85
86
|
# File 'lib/cyberweb/objectified/html_tags/head.rb', line 84
def use_utf
append_to_content '<meta charset="UTF-8">'+"\n"
end
|