Constructor
new Formats(main)
Constructor of Formats class
| Name | Type | Description |
|---|---|---|
main |
Object | Instance of the main CpexPackage class |
Methods
create(params)
Creates custom format - controls when and how it should be rendered
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Parameters Properties
|
getInstance(params) → {Object}
Returns instance of the correct format
| Name | Type | Description |
|---|---|---|
params |
Object | Parameters for creating instance |
Instance of specific format
- Type:
- Object
isInterscroller(elementId, adUnit, width, height) → {boolean}
Checks if format is interscroller
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
adUnit |
string | Ad unit name |
width |
number | Width |
height |
number | Height |
True if interscroller
- Type:
- boolean
isNative(width, height, mediaType) → {boolean}
Checks if format is native
| Name | Type | Description |
|---|---|---|
width |
number | Width |
height |
number | Height |
mediaType |
string | Media type name |
True if native
- Type:
- boolean
isOutstream(elementId, adUnit, mediaType) → {boolean}
Checks if format is outstream
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
adUnit |
string | Ad unit name |
mediaType |
string | Media type |
True if outstream
- Type:
- boolean
isResponsive(elementId, adUnit) → {boolean}
Checks if format is responsive
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
adUnit |
string | Ad unit name |
True if responsive
- Type:
- boolean
isSkin(elementId, adUnit, width, height) → {boolean}
Checks if format is skin
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
adUnit |
string | Ad unit name |
width |
number | Width |
height |
number | Height |
True if skin
- Type:
- boolean
isSlideup(elementId, adUnit) → {boolean}
Checks if format is slideup
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
adUnit |
string | Ad unit name |
True if slideup
- Type:
- boolean
isVignette(elementId, adUnit) → {boolean}
Checks if format is vignette
| Name | Type | Description |
|---|---|---|
elementId |
string | Element ID |
adUnit |
string | Ad unit name |
True if vignette
- Type:
- boolean
match(params) → {string|boolean}
Determines format type based on parameters
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Parameters Properties
|
Format type or false
- Type:
-
string
|
boolean