html :: BSComponent
Mainly used to factoryze CSS treatments. Can be used in the future to handle generic stuff like attributes or escaping.
TODO merge with html::HTMTag without init conflict?
HTMLTag requires the main init to pass a tagname, this was so much verbose here.
html :: BSComponent :: css_classes
CSS classes to add on this element.html :: BSComponent :: css_classes=
CSS classes to add on this element.html :: BSComponent :: defaultinit
html :: BSComponent :: render_css_classes
Renderself
css clases as a class
attribute.
html $ BSComponent :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
html :: BSComponent :: css_classes
CSS classes to add on this element.html :: BSComponent :: css_classes=
CSS classes to add on this element.core :: Writable :: defaultinit
template :: Template :: defaultinit
core :: Object :: defaultinit
html :: BSComponent :: defaultinit
template :: Template :: is_frozen=
Is the template allowing more modification (add
)
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).html :: BSComponent :: render_css_classes
Renderself
css clases as a class
attribute.
core :: Writable :: write_to_bytes
Likewrite_to
but return a new Bytes (may be quite large)
core :: Writable :: write_to_file
Likewrite_to
but take care of creating the file
core :: Writable :: write_to_string
Likewrite_to
but return a new String (may be quite large).
# Bootstrap component abstraction.
#
# Mainly used to factoryze CSS treatments.
# Can be used in the future to handle generic stuff like attributes or escaping.
#
# TODO merge with html::HTMTag without init conflict?
# HTMLTag requires the main init to pass a tagname,
# this was so much verbose here.
abstract class BSComponent
super Template
# CSS classes to add on this element.
var css_classes = new Array[String] is optional
# Render `self` css clases as a `class` attribute.
fun render_css_classes: String do
if css_classes.is_empty then return ""
return " class=\"{css_classes.join(" ")}\""
end
end
lib/html/bootstrap.nit:22,1--41,3