@plasma-platform/plasma-banner-scripts
v1.0.55
Published
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Downloads
8
Readme
Table of Contents
- Main
- Initiators
- it
- it
- it
- it
- it
- it
- it
- it
- it
- getAll
- get
- data
- addClass
- attr
- prepend
- removeClass
- hasClass
- removeAttribute
- dispatch
- Initiators/FlipClock/Faces
- Initiators/FlipClock/Language
- Initiators/FlipClock
- Initiators/UI
- Initiators/Analytics
- Utils
Main
start project npm i && npm start
Initiators
Promotion
Parameters
args
Object arg only for FlipClock
Examples
const promotion = new Promotion();
Promotion#run
Run promotion banner
Examples
const promotion = new Promotion();
promotion.run();
it
Get
it
hasClass
it
addClass
it
removeClass
it
removeAttribute
it
attr
it
data
it
prepend
it
getAll
getAll
Get all elements by selector
Parameters
selector
string
Returns any
get
Get element by selector
Parameters
selector
Returns any
data
Get data attributes
Parameters
element
Returns {}
addClass
Add class
Parameters
element
classList
Returns any
attr
Attributes
Parameters
element
key
value
Returns any
prepend
Prepend
Parameters
parent
element
Returns any
removeClass
Parameters
element
classList
Returns any
hasClass
Parameters
element
className
Returns boolean
removeAttribute
Remove Attribute
Parameters
element
name
Returns any
dispatch
Dispatch Event
Parameters
options
Returns boolean
Initiators/FlipClock/Faces
FlipClock.js has a fully extendible API to create any clock face you need. More clock faces will be added over time, so be sure to fork the code and make a pull request if you want to see your clock face appear in the core library.
numberize
Formats any array of numbers into a valid array of numbers
Returns Array current time for Daily face
getPlasmaHourlyLabels
Generate array with translate labels for Hourly face
Returns Array translate labels for Hourly face
getPlasmaHourlyCounter
Generate array with current time for Hourly face
Returns Array current time for Hourly face
getPlasmaHourlyCounter
Generate array with current time for Daily face
Returns Array current time for Daily face
getPlasmaDailyLabels
Generate array with translate labels for Daily face
Returns Array translate labels for Daily face
DailyCounterFace
Transform default counter to Plasma standard counter with day counter
Type: Object
HourlyCounterFace
Transform default counter to Plasma standard counter without day counter
Type: Object
Initiators/FlipClock/Language
Ukraine
Object with lang variable for Ukraine
Type: Object
France
Object with lang variable for France
Type: Object
Poland
Object with lang variable for Poland
Type: Object
Initiators/FlipClock
FlipClockInitiator
Parameters
args
Object all arguments
Examples
const flipClock = new FlipClockInitiator({selector: '.Promotion__timer'});
FlipClockInitiator#addExtension
Private method for init extension
FlipClockInitiator#run
Run timer
Examples
const flipClock = new FlipClockInitiator({selector: '.Promotion__timer'});
flipClock.run();
Initiators/UI
UiBanner
Parameters
args
Object all arguments
Examples
const uiBanner = new UiBanner({});
UiBanner#run
run banner function
Parameters
tagManager
Object manager for dataLayer variable
Examples
const uiBanner = new UiBanner({});
uiBanner.run();
UiBanner#showBanner
show banner function
Examples
const uiBanner = new UiBanner({});
uiBanner.showBanner();
UiBanner#hideBanner
hide banner function
Examples
const uiBanner = new UiBanner({});
uiBanner.hideBanner();
UiPopup
Parameters
args
Object all arguments
Examples
const uiPopup = new UiPopup({});
UiPopup#run
run popup function
Parameters
Examples
const uiPopup = new UiPopup({});
uiPopup.run();
UiPopup#showBanner
show popup function
Examples
const uiPopup = new UiPopup({});
uiPopup.showPopup();
UiPopup#hideBanner
hide popup function
Parameters
outTarget
boolean object
Examples
const uiPopup = new UiPopup({});
uiPopup.hidePopup();
UiPopup#outTarget
outTarget popup click function
Parameters
event
Object jQuery Event
Examples
const uiPopup = new UiPopup({});
$(document).on('click', uiPopup.outTarget);
Initiators/Analytics
TagManager
Parameters
args
Object all arguments
Examples
const tagManager = new TagManager({});
TagManager#onClickBanner
Tag manager event click banner
Examples
const tagManager = new TagManager({});
tagManager.onClickBanner();
TagManager#onShowBanner
Tag manager event show banner
Examples
const tagManager = new TagManager({});
tagManager.onShowBanner();
Utils
Other instruments for normal working project
Parameters
Parameters
selector
string selector to main wrapper for promotion block
Examples
const params = parameters.parse('.Promotion');
Parameters#parse
Parse and return all params
Parameters
selector
string jQuery selector
Examples
const params = new Parameters();
params.parse('.Promotion');
Returns Object
Parameters#update
Parse and return all params
Parameters
data
Object new data
Examples
const params = new Parameters();
params.update({});
Returns Object
Parameters#prepareData
prepare data for all initiators
Parameters
data
Object row parameters
Returns Object data
Parameters#validate
prepare data for time
Parameters
data
Object row parameters
Returns Object validate data
Parameters#other
prepare data for other
Parameters
data
Object row parameters
Returns Object data
Parameters#lang
prepare data for lang
Parameters
data
Object row parameters
Returns Object data
Parameters#time
prepare data for time
Parameters
data
Object row parameters
Returns Object data
Parameters#flipClock
prepare data for flipClock
Parameters
data
Object row parameters
Returns Object final Data
Parameters#banner
prepare data for banner and popup
Parameters
data
Object row parameters
Returns Object final Data