1.18.10 • Published 7 years ago

@cnbritain/merlin-frontend-article-js v1.18.10

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

merlin-frontend-article-js

ArticleManager, Article

JS Documentation

Article

Kind: global class

new Article(el, options)

ParamTypeDescription
elHTMLElementThe article element
optionsObjectArticle options
options.analyticsObjectAnalytics configuration for the article
options.infiniteBooleanWhether the article came from infinite scroll
options.managerArticleManagerThe article manager that added the article
options.typeNumberThe article type based on ARTICLE_TYPES enum
options.simplereachObjectSimplereach configuration for promotions

article.bounds : Object

The bounds of the article element

Kind: instance property of Article
Access: public

article.el : HTMLElement

The article element

Kind: instance property of Article
Access: public

article.isInfinite : Boolean

Is the article from infinite scroll?

Kind: instance property of Article
Access: public

article.manager : ArticleManager

The article manager that added the article

Kind: instance property of Article
Access: public

article.initialiseAds()

Initialiases the ads

Kind: instance method of Article
Access: public

article.resize()

Calculates any new size changes

Kind: instance method of Article
Access: public

"focus"

When an article is the current focus on the screen

Kind: event emitted by Article

"blur"

When an article is the loses current focus on the screen

Kind: event emitted by Article

ArticleManager

Kind: global class

articleManager.articles : Array

List of articles that have been loaded

Kind: instance property of ArticleManager
Access: public

articleManager.addArticle(el, options) ⇒ Article

Adds an article to the list

Kind: instance method of ArticleManager
Emits: add
Access: public

ParamTypeDescription
elHTMLElementThe article element
optionsObjectOptions for the Article
options.infiniteBooleanHas the article come from infinite scroll?
options.typeNumberThe article type. Based on ARTICLE_TYPES
options.analyticsObjectAnalytics config for the article
options.simplereachObjectSimpleReach config for promotions

articleManager.disableInfiniteScroll()

Disables the infinite scroll

Kind: instance method of ArticleManager
Access: public

articleManager.enableInfiniteScroll()

Enables the infinite scroll

Kind: instance method of ArticleManager
Access: public

articleManager.resize(_start, _length)

Recalculates some measurements

Kind: instance method of ArticleManager
Access: public

ParamType
_startNumber
_lengthNumber

"add"

Adds an article to the list

Kind: event emitted by ArticleManager
Properties

NameDescription
articleThe added article

ArticleManager.ARTICLE_TYPES : Number

Article types enum

Kind: static property of ArticleManager

Gallery

Kind: global class

new Gallery(el, options)

ParamTypeDescription
elHTMLElementArticle Element 'a-main'
optionsObjectGallery options

gallery.galleryBounds : Object

The bounds of the gallery container

Kind: instance property of Gallery
Access: public

gallery.items : Array.HTMLElement

Items in the gallery - images and ads

Kind: instance property of Gallery
Access: public

gallery.images : Array.HTMLElement

Images in the gallery

Kind: instance property of Gallery
Access: public

gallery.navigation : GalleryImageNavigation

The gallery navigation arrows

Kind: instance property of Gallery
Access: public

gallery.thumbnails : HTMLElement

The gallery thumbnail images

Kind: instance property of Gallery
Access: public

gallery.section : HTMLElement

The gallery section images

Kind: instance property of Gallery
Access: public

gallery.resize()

Resize calculates new bounds

Kind: instance method of Gallery
Access: public

gallery.hideListView()

Hides list view and shows thumbnail view

Kind: instance method of Gallery
Access: public

gallery.showListView()

Shows list view and hides thumbnail view

Kind: instance method of Gallery
Access: public

gallery.toggleListView()

Toggles list and thumbnail views

Kind: instance method of Gallery
Access: public

"imagefocus"

Gallery image has gained focus

Kind: event emitted by Gallery

"imageblur"

Gallery image has blurred

Kind: event emitted by Gallery

Prerequisites:

  • Node.jsbrew install node
  • Grunt - npm install -g grunt-cli
  • Other prereqs? Python? Virtualenv?

Demo:

Install dependencies:

npm install

Build the things:

npm run sass
npm run js
npm run docs

Hint your JS

npm run jshint

Python the pythons:

npm run demo-install

Start the demo server:

python demo.py
1.18.10

7 years ago

1.18.9

7 years ago

1.18.8

7 years ago

2.0.0-1

8 years ago

2.0.0-0

8 years ago

1.18.7

8 years ago

1.18.6

8 years ago

1.18.5

8 years ago

1.18.4

8 years ago

1.18.3

8 years ago

1.18.2

8 years ago

1.18.1

8 years ago

1.18.0

8 years ago

1.17.2

8 years ago

1.17.1

8 years ago

1.17.0

8 years ago

1.16.0

8 years ago

1.15.1

8 years ago

1.15.0

8 years ago

1.14.5

8 years ago

1.14.4

8 years ago

1.14.3

8 years ago

1.14.2

8 years ago

1.14.0

8 years ago

1.13.1

8 years ago

1.13.0

8 years ago

1.12.0

8 years ago

1.11.0

8 years ago

1.10.0

8 years ago

1.9.0

8 years ago

1.8.0

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago