Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cnbritain/merlin-frontend-article-js

Package Overview
Dependencies
Maintainers
4
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cnbritain/merlin-frontend-article-js

ArticleManager, Article

  • 1.18.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

merlin-frontend-article-js

ArticleManager, Article

JS Documentation

Article

Kind: global class

  • Article
    • new Article(el, options)
    • .bounds : Object
    • .el : HTMLElement
    • .isInfinite : Boolean
    • .manager : ArticleManager
    • .initialiseAds()
    • .resize()
    • "focus"
    • "blur"

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

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

FAQs

Package last updated on 30 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc