npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@commission-on-post/post-cat-functionality-tool

v2.18.4

Published

Functionality Handler for POST CAT Tool

Downloads

1

Readme

Post_Cat_Functionality-Tool

Function library that appends event listeners and/or Mutation Observers for the Post CAT Tool

Table of Contents

Description

This is a npm package that exports a function that is used to attach event listeners to react components after they mount. This is used to supersede a needed parent child relation that is needed for functionality and allow you to have functionality at a sibling level. This was developed for the Commission on POST Learning Training Resources CAT Tool.

Back To Top

Technologies

  • HTML

Back To Top

How To Use

Installation

npm i post-cat-functionality-tool

Back To Top

Pre-Steps

In order to use this npm package there are a few pre-steps that need to be done first.

  1. Ensure that the component that you are attaching the event listener to as well as the component that the event listener will be affecting all have ids attached to them. This will allow the functionality selector to find the elements through the dom.
  2. If you have any video/audio content ensure that it is displayed using the azure media player and that it is wrapped in a div. The div must have an id attached to it and the video tag itself must have the same id with a "-vid" attached to it. This is because the different functionality will be attached to wither the div or the video depending on what type of event you want the functionality to trigger on. It might also be able to work on normal video tags that follow this format but this has not been tested.

Back To Top

Usage

After the pre-steps are done, this function is easy to call. Import the FunctionalitySelector method and the IFuncParams interface into your component. Then within the componentDidMount function of react, call the FunctionalitySelector with the appropriate parameters.

Example to toggle the visibility of a element when you click on the main element :

let compId = "example-1"

const funcInfo : IFuncParams[] = [
    {
        type: "click",
        func: "showHide",
        funcData: [{
            id: "example-2"
        }]
    }
]

componentDidMount() {
    FunctionalitySelector(compId, "Any Component type" funcinfo, true)
}

In order to see more examples and detailed information on what interfaces you should use for each function. Check out the wiki!

Back To Top