Methods
addAttributes(elem, attrs)
A function to append attributes on the HTML element
Parameters:
| Name | Type | Description |
|---|---|---|
elem |
* | HTML element in which attributes are applied |
attrs |
* | Object of attributes that applied HTML element |
- Source:
Example
addAttributes(heading,{class:"heading-container"})
camalize(str) → {String}
A function to make camel case to any string
Parameters:
| Name | Type | Description |
|---|---|---|
str |
String | String to be camalize |
- Source:
Returns:
camal case string
- Type
- String
createElementAndAppend({parentElem, elemTypeopt, attr, innerTextopt, innerHTMLopt, style})
A function to create HTML element and apply style as well as add the attributes
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
{parentElem |
* | HTML element in which new HTML element is appended | ||
elemType |
* |
<optional> |
"div" | Type of element to create |
attr |
* | attributes of the element | ||
innerText |
* |
<optional> |
Content of element | |
innerHTML |
* |
<optional> |
Content of element | |
style} |
* | Style of the element is to be added with valid css property |
- Source:
exportToJsonFile(jsonData, fileName)
A function that helps to export All Collected/prepated data
Parameters:
| Name | Type | Description |
|---|---|---|
jsonData |
Object | Data is to be exported |
fileName |
String | [n="data.json"] name of the download file |
- Source:
formatStyleToStore(style)
A funtion that takes inline style and convert to js Object style
Parameters:
| Name | Type | Description |
|---|---|---|
style |
Object | style of element (eg. slide1.style) |
- Source:
Returns:
Object that contains js formated style of element
Example
formatStyleToStore(slide1.style);
getUsernameFromEmail(email)
A function that returen user name
Parameters:
| Name | Type | Description |
|---|---|---|
email |
* | custom email made for this app |
- Source:
randomNumber(min, max) → {Number}
A function that generate random number between passed range
Parameters:
| Name | Type | Description |
|---|---|---|
min |
Number | Lower value of the range |
max |
Number | Upper value of the range |
- Source:
Returns:
random number between given number
- Type
- Number
removeUnnecessaryAttr(elem)
A function that remove the un
Parameters:
| Name | Type | Description |
|---|---|---|
elem |
* |
- Source:
styleElement()
A function to style a HTML element
key of object must be valid css property in js representation (eg.background-color to backgroundColor:"red")
Parameters:
| Type | Description |
|---|---|
- Source:
Example
styleElement(heading,{backgroundColor:"#AAA"})
updatePosition()
A function that helps to change the position of element by draging or resizing
Parameters:
| Type | Description |
|---|---|
- Source:
Example
dragAndDropElement(slide1Element1,slideData,"drag");