Libraries.Web.Page.WebPageHeader Documentation
The WebPageHeader class represents HTML's (Hypertext Markup Language) head tag which is a container class for any WebTags that belong in the web pages header. You can find more information about this tag at: The head attribute.
Example Code
use Libraries.Web.Page.all
class Main
action main
//make a web page
WebPage page
//add a TextArea
WebPageHeader header
page:SetWebPageHeader(header)
output page:Generate()
end
end
Inherits from: Libraries.Web.Page.WebGenerator, Libraries.Web.Page.AttributeAccepter, Libraries.Language.Object, Libraries.Web.Page.GlobalAttributeAccepter
Actions Documentation
Add(Libraries.Web.Page.HeaderLink value)
This action adds a link to a stylesheet to the header.
Parameters
- Libraries.Web.Page.HeaderLink: The header meta data.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.HeaderLink
WebPageHeader header
HeaderLink md
header:Add(md)
Add(Libraries.Web.Page.Attribute attribute)
This action adds an attribute to this object. If an attribute with the same name as
Parameters
- Libraries.Web.Page.Attribute: The attribute that will be stored.
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
Attribute attribute
attribute:SetName("src")
attribute:SetValue("http://www.google.com")
AttributeAccepter accept
accept:Add(attribute)
Add(Libraries.Web.Page.MetaData value)
This action adds MetaData to the header.
Parameters
- Libraries.Web.Page.MetaData: The header meta data.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.MetaData
WebPageHeader header
MetaData md
header:Add(md)
Add(Libraries.Web.Page.Script value)
This action adds a script to the header of a webpage.
Parameters
- Libraries.Web.Page.Script: The script to add to the header.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Script
WebPageHeader header
Script s
header:Add(s)
Add(Libraries.Web.Page.Base value)
This action adds Base to the header. There can only be one base on a page.
Parameters
- Libraries.Web.Page.Base: The header base data.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Base
WebPageHeader header
Base base
header:Add(base)
AddAttribute(text name, text value)
This action adds an attribute to this object. This action is a helper action, which essentially does the same thing as the Add(Attribute) action. If an attribute with the same name as
Parameters
- text name: The name of the attribute functions as a key. For example, in a link, we might have a "src" and an actual address, like google.com. In this case, the name would be equivalent to the src.
- text value: As an example of link, imagine we have a value of "src" and an actual address, like google.com. In this case, the value would be equivalent to google.com.
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
AddClassAttribute(text value)
Adds to the ClassAttribute attribute. Multiple class names can be listed in the passed text, separated by a space.
Parameters
- text value: The classes to be added to the element
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:AddClassAttribute("myClass")
AddIcon(text path)
This action adds a link to an icon in the header. This is sometimes referred to as a "favicon".
Parameters
- text path: The location of the stylesheet being added. The file extension must be .ico
Return
Libraries.Web.Page.HeaderLink: The generated link for any further manipulation
Example
use Libraries.Web.Page.WebPageHeader
WebPageHeader header
header:AddIcon("favicon.ico")
AddStylesheet(text path)
This action adds a link to a stylesheet in the header.
Parameters
- text path: The location of the stylesheet being added.
Return
Libraries.Web.Page.HeaderLink: The generated link for any further manipulation
Example
use Libraries.Web.Page.WebPageHeader
WebPageHeader header
header:AddStylesheet("style.css")
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Example
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
Example
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
Generate()
This action sets the text of the title in the header.
Return
text:
Example
use Libraries.Web.Page.WebPageHeader
WebPageHeader header
header:SetTitleHeaderValue("My Title")
GenerateAttributes()
This action returns a text description of all attributes stored.
Return
text:
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
text result = accept:GenerateAttributes()
GetAccessKey()
Returns the AccessKey attribute. Specifies a shortcut key for the web element.
Return
Libraries.Web.Page.Attribute: The current AccessKey attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetAccessKey()
GetAttribute(text name)
This action returns an attribute from this object's Attributes object. If no attribute exists for a given key, this action returns undefined.
Parameters
- text name
Return
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
//as we have not set any attribute, this would
//return undefined
Attribute attribute = accept:GetAttribute("src")
GetAttributeValue(text name)
This action returns an attribute from this object's Attributes object. If no attribute exists for a given key, this action returns undefined.
Parameters
- text name: The key value in this case is described in more detail in the documentation for this class's Add actions.
Return
text:
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
text value = accept:GetAttributeValue("src")
GetAttributes()
Returns a list of all attributes on the system.
Return
Libraries.Web.Page.Attributes: The attributes class contains all of the attributes that have been set for this object.
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attributes
AttributeAccepter accept
Attributes attributes = accept:GetAttributes()
GetClassAttribute()
Returns the ClassAttribute attribute.
Return
Libraries.Web.Page.Attribute: The current ClassAttribute attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetClassAttribute()
GetContentEditable()
Returns the ContentEditable attribute.
Return
Libraries.Web.Page.Attribute: The current ContentEditable attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetContentEditable()
GetContextMenu()
Returns the ContextMenu attribute.
Return
Libraries.Web.Page.Attribute: The current ContextMenu attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetContextMenu()
GetDraggable()
Returns the Draggable attribute.
Return
Libraries.Web.Page.Attribute: The current Draggable attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetDraggable()
GetDropZone()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetDropZone()
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
GetHidden()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetHidden()
GetIdentifier()
Returns the Identifier attribute.
Return
Libraries.Web.Page.Attribute: The current Identifier attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetIdentifier()
GetIterator()
This action returns an iterator of all attributes stored in this object.
Return
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
use Libraries.Containers.Iterator
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//output out all of the attributes
Iterator<Attribute> it = accept:GetIterator()
repeat while it:HasNext()
Attribute at = it:Next()
output at:Generate()
end
GetLanguage()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetLanguage()
GetNumberOfAttributes()
This action returns the number of attributes that are currently stored in this object.
Return
integer:
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
integer num = accept:GetNumberOfAttributes()
GetNumberOfMetaDataItems()
This action gets the number of meta data items in the header.
Return
integer: The number of meta data items in the header.
Example
use Libraries.Web.Page.WebPageHeader
WebPageHeader header
integer val = header:GetNumberOfMetaDataItems()
GetNumberOfScriptItems()
This action gets the number of script items in the header.
Return
integer: The number of script items in the header.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Script
WebPageHeader header
Script s
header:Add(s)
integer val = header:GetNumberOfScriptItems()
GetSpellcheck()
Returns the Spellcheck attribute.
Return
Libraries.Web.Page.Attribute: The current Spellcheck attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetSpellcheck()
GetStyle()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetStyle()
GetTabIndex()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetTabIndex()
GetTextDirection()
Returns the TextDirection attribute.
Return
Libraries.Web.Page.Attribute: The current TextDirection attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetTextDirection()
GetTitle()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetTitle()
GetTitleHeader()
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Title
WebPageHeader header
Title title
header:SetTitleHeader(title)
Title t = header:GetTitleHeader()
HasAttribute(text name)
This action returns whether or not an attribute exists for the key passed in as a parameter.
Parameters
- text name: The key value in this case is described in more detail in the documentation for this class's Add actions.
Return
boolean:
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
boolean exists = accept:HasAttribute("src")
Remove(Libraries.Web.Page.HeaderLink value)
This action removes the first instance of the links to stylesheets found in the meta list.
Parameters
- Libraries.Web.Page.HeaderLink: The meta data element.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.HeaderLink
WebPageHeader header
HeaderLink item
header:Remove(item)
Remove(Libraries.Web.Page.Script value)
This action removes the first instance of the script from the headers list of scripts.
Parameters
- Libraries.Web.Page.Script: The script to be removed from the header.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Script
WebPageHeader header
Script s
header:Add(s)
header:Remove(s)
Remove(Libraries.Web.Page.Base value)
This action removes the base data from the header.
Parameters
- Libraries.Web.Page.Base: The meta data element.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Base
WebPageHeader header
Base item
header:Remove(item)
Remove(Libraries.Web.Page.MetaData value)
This action removes the first instance of the meta data value found in the meta list.
Parameters
- Libraries.Web.Page.MetaData: The meta data element.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.MetaData
WebPageHeader header
MetaData item
header:Remove(item)
RemoveAttribute(text name)
This action removes an attribute with a particular key. If that attribute does not exist, then this action returns undefined.
Parameters
- text name: The name of the attribute that should be removed.
Return
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
accept:RemoveAttribute("src")
SetAccessKey(text value)
Sets the AccessKey attribute. Specifies a shortcut key for the web element.
Parameters
- text value: The current AccessKey.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetAccessKey("z")
SetClassAttribute(text value)
Sets the ClassAttribute attribute. Specifies a class name for the element.
Parameters
- text value: The current ClassAttribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetClassAttribute("myClass")
SetContentEditable(text value)
Sets the ContentEditable attribute. Specifies wether content in an element is editable.
Parameters
- text value: The current ContentEditable.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetContentEditable("true")
SetContextMenu(text value)
Sets the ContextMenu attribute. Specifies a context menu that contains the element.
Parameters
- text value: The current ContextMenu.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetContextMenu("parentmenu")
SetDraggable(boolean value)
Sets the Draggable attribute. Specifies wether an element is draggable or not.
Parameters
- boolean value: The current Draggable.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetDraggable(true)
SetDropZone(text value)
Sets the DropZone attribute. This element specifies what happens when an element is dropped on a web page. The three valid values are copy, move, and link.
Parameters
- text value: The current DropZone.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetDropZone("move")
SetHidden(boolean value)
Sets the AccessKey attribute. Specifies wether an element is hidden or not.
Parameters
- boolean value: To true to hide element and false to make it visible.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetHidden(false)
SetIdentifier(text value)
Sets the Identifier attribute. Specifies a unique name for the element.
Parameters
- text value: The current Identifier.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetIdentifier("myElement")
SetLanguage(text value)
Creates and sets an attribute for language. As these codes are esoteric in the standard on the web (HTML), we recommend using the LanguageCode class to help.
Parameters
- text value
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.LanguageCode
use Libraries.Web.Page.Link
LanguageCode code
//use any WebItem, in this case a link
Link link
link:SetLanguage(code:english)
SetSpellcheck(boolean value)
Sets the Spellcheck attribute. Specifies wether spellcheck is on or off.
Parameters
- boolean value: The current Spellcheck.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetSpellcheck(true)
SetStyle(text value)
Sets the Style attribute. Specifies inline css formatting for an element.
Parameters
- text value: The current Style.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetStyle("color:orange")
SetTabIndex(text value)
Sets the TabIndex attribute. Specifies a tab order for elements.
Parameters
- text value: The current TabIndex.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetTabIndex("0")
SetTextDirection(text value)
Sets the TextDirection attribute. Specifies a direction for the text to be written. For example, "ltr" is left-to-right.
Parameters
- text value: The current TextDirection.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetTextDirection("rtl")
SetTitle(text value)
Sets the Title attribute. Specifies title information for the web element.
Parameters
- text value: The current Title.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:SetTitle("MyTitle")
SetTitleHeader(Libraries.Web.Page.Title title)
This action sets the title for the header. This field is required.
Parameters
- Libraries.Web.Page.Title: The title.
Example
use Libraries.Web.Page.WebPageHeader
use Libraries.Web.Page.Title
WebPageHeader header
Title title
header:SetTitleHeader(title)
SetTitleHeaderValue(text value)
This action sets the text of the title in the header.
Parameters
- text value: The title text.
Example
use Libraries.Web.Page.WebPageHeader
WebPageHeader header
header:SetTitleHeaderValue("My Title")
On this page
Variables TableAction Documentation- Add(Libraries.Web.Page.HeaderLink value)
- Add(Libraries.Web.Page.Attribute attribute)
- Add(Libraries.Web.Page.MetaData value)
- Add(Libraries.Web.Page.Script value)
- Add(Libraries.Web.Page.Base value)
- AddAttribute(text name, text value)
- AddClassAttribute(text value)
- AddIcon(text path)
- AddStylesheet(text path)
- Compare(Libraries.Language.Object object)
- Equals(Libraries.Language.Object object)
- Generate()
- GenerateAttributes()
- GetAccessKey()
- GetAttribute(text name)
- GetAttributeValue(text name)
- GetAttributes()
- GetClassAttribute()
- GetContentEditable()
- GetContextMenu()
- GetDraggable()
- GetDropZone()
- GetHashCode()
- GetHidden()
- GetIdentifier()
- GetIterator()
- GetLanguage()
- GetNumberOfAttributes()
- GetNumberOfMetaDataItems()
- GetNumberOfScriptItems()
- GetSpellcheck()
- GetStyle()
- GetTabIndex()
- GetTextDirection()
- GetTitle()
- GetTitleHeader()
- HasAttribute(text name)
- Remove(Libraries.Web.Page.HeaderLink value)
- Remove(Libraries.Web.Page.Script value)
- Remove(Libraries.Web.Page.Base value)
- Remove(Libraries.Web.Page.MetaData value)
- RemoveAttribute(text name)
- SetAccessKey(text value)
- SetClassAttribute(text value)
- SetContentEditable(text value)
- SetContextMenu(text value)
- SetDraggable(boolean value)
- SetDropZone(text value)
- SetHidden(boolean value)
- SetIdentifier(text value)
- SetLanguage(text value)
- SetSpellcheck(boolean value)
- SetStyle(text value)
- SetTabIndex(text value)
- SetTextDirection(text value)
- SetTitle(text value)
- SetTitleHeader(Libraries.Web.Page.Title title)
- SetTitleHeaderValue(text value)