Methods
addClass(el, className)
Include a class to a HTML Element if it doesn't have it yet
Parameters:
Name | Type | Description |
---|---|---|
el |
Object | |
className |
String |
- Source:
classroomsConflict()
- Source:
createAndAppendChild(parent, tag, attributes) → {object}
Create a HTML Element with attributes (e.g. class, innerHTML, style, etc.) and appends it to another element.
Parameters:
Name | Type | Description |
---|---|---|
parent |
object | |
tag |
String | |
attributes |
Array |
- Source:
Returns:
The child element just created
- Type
- object
createElementWithAttributes(tag, attributes)
Create a HTML Element with attributes (e.g. class, innerHTML, style, etc.)
Parameters:
Name | Type | Description |
---|---|---|
tag |
String | |
attributes |
Array |
- Source:
createHtmlElementTree(rootObj) → {HTML_Element}
Create a HTML Element Tree from a js object.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rootObj |
Properties
|
- Source:
Returns:
The root element
- Type
- HTML_Element
Example
param
var lectureInfoTreeObj = {
tag: 'div',
class: 'lecture-info',
children: [
{
tag: 'input',
type: 'checkbox',
id: 'lecture-info-' + labelCount,
name: 'lecture-info'
},
{
tag: 'div',
class: 'lecture-info-header',
children: [
{
tag: 'label',
htmlFor: 'lecture-info-' + labelCount,
children: [
{
tag: 'div',
class: 'lecture-info-code',
innerHTML: (lecture.code + ' -')
}
]
}
]
}
]
}
hasClass(el, className) → {boolean}
Verify if a HTML Element have a class
Parameters:
Name | Type | Description |
---|---|---|
el |
Object | |
className |
String |
- Source:
Returns:
- Type
- boolean
indexOfDay(day) → {Number}
Translates 3-characters words in numbers.
'seg' = 0, 'ter' = 1, ..., 'dom' = 6
'seg' = 0, 'ter' = 1, ..., 'dom' = 6
Parameters:
Name | Type | Description |
---|---|---|
day |
String |
- Source:
Returns:
- Type
- Number
removeClass(el, className)
Removes a class to a HTML Element if it exists
Parameters:
Name | Type | Description |
---|---|---|
el |
Object | |
className |
String |
- Source:
removeDuplicates(array) → {Array}
Creates a new array with unique elements from the array given.
Parameters:
Name | Type | Description |
---|---|---|
array |
Array |
- Source:
Returns:
- Type
- Array
schedulesConflict()
- Source:
timeInMinutes()
- Source:
toggleClass(el, className)
Toggle the existence of a class to a HTML Element
Parameters:
Name | Type | Description |
---|---|---|
el |
Object | |
className |
String |
- Source: