plasma-banner-scripts

1.0.48 • Public • Published

Table of Contents

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

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

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

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

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

Examples

const uiPopup = new UiPopup({});
uiPopup.hidePopup();

UiPopup#outTarget

outTarget popup click function

Parameters

Examples

const uiPopup = new UiPopup({});
$(document).on('click', uiPopup.outTarget);

Initiators/Analytics

TagManager

Parameters

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

Examples

const params = new Parameters();
params.update({});

Returns Object

Parameters#prepareData

prepare data for all initiators

Parameters

Returns Object data

Parameters#validate

prepare data for time

Parameters

Returns Object validate data

Parameters#other

prepare data for other

Parameters

Returns Object data

Parameters#lang

prepare data for lang

Parameters

Returns Object data

Parameters#time

prepare data for time

Parameters

Returns Object data

Parameters#flipClock

prepare data for flipClock

Parameters

Returns Object final Data

Parameters#banner

prepare data for banner and popup

Parameters

Returns Object final Data

Readme

Keywords

Package Sidebar

Install

npm i plasma-banner-scripts

Weekly Downloads

5

Version

1.0.48

License

ISC

Unpacked Size

1.38 MB

Total Files

69

Last publish

Collaborators

  • shaggrath