Property definitions

nitc $ HInfoBox :: defaultinit
# A generic information container that can be used to decorate AST entities
class HInfoBox
	# The visitor used for contextualisation, if needed
	var visitor: HtmlightVisitor

	# A short title for the AST element
	var title: String

	# The primary link where the entity points
	# null if no link
	var href: nullable String = null

	# The content of the popuped infobox
	var content = new HTMLTag("div")

	# Append a new field in the popuped infobox
	fun new_field(title: String): HTMLTag
	do
		content.open("b").text(title)
		content.append(" ")
		var res = content.open("span")
		content.open("br")
		return res
	end

	# Append a new dropdown in the popuped content
	fun new_dropdown(title, text: String, text_is_html: nullable Bool): HTMLTag
	do
		content.add_raw_html """<div class="dropdown"> <a data-toggle="dropdown" href="#"><b>"""
		content.append(title)
		content.add_raw_html "</b> "
		if text_is_html == true then
			content.add_raw_html(text)
		else content.append(text)
		content.add_raw_html """<span class="caret"></span></a>"""
		var res = content.open("ul").add_class("dropdown-menu").attr("role", "menu").attr("aria-labelledby", "dLabel")
		content.add_raw_html "</div>"
		return res
	end
end
src/htmlight.nit:375,1--414,3