/infiscroll

An Infinite Scroll Helper that comes complete with ajax helpers, show on scroll and lazy loading of images using the Intersection Observer API.

Primary LanguageJavaScriptMIT LicenseMIT

Logo

npm (scoped) Build Status Coverage Status GitHub contributors License GitHub issues Chat on Gitter

About Infiscroll

Infiscroll is a class containing utility functions that enable you to:

  • Launch toasts with the help of Bootstrap:
  • Display form errors and toggle disabled state for buttons effortlessly, with help from jQuery.
  • Locale Specific Capitalization that is easily customizable.
  • JSON stringify and parse functions with quotes escaping.
  • Convert any valid datetime string to User's timezone from Server's timezone, with help from moment.
  • Perform Reveal on Scroll animations and Image Lazy Loading by just calling one function.
  • Process Ajax requests and handle Ajax Errors, built to work with laravel framework with minimal configuration.
  • Create Admin Pages with CRUD functionality, with help from DataTables.
  • Launch Infinite Scroll on a page with just one function call.

Note: Every infiscroll variable is overridable by passing your alternative in the constructor. The Infiscroll class is available on the global scope or in the window object for browsers.

Getting Started

Include the following in your html after JQuery, Bootstrap and DataTables CSS and JS files:

https://unpkg.com/@dopesky/infiscroll@2.0.0/dist/css/infiscroll.css

https://unpkg.com/@dopesky/infiscroll@2.0.0/dist/js/infiscroll.js

Note: The product is currently on Node Package Registry and GitHub Package Registry. Therefore, you can also install the whole project by running:

npm install @dopesky/infiscroll

You might need to also install the other dependencies (jQuery and Co.) too.

The full documentation with samples is available here.

Dependencies

Infiscroll requires the following additional libraries to work effectively:

  • JQuery - Crucial
  • DataTables - Semi Crucial (Only if you require crud functionality, or an easier way of creating dataTables)
  • Bootstrap >= v4.2 - Optional (If you will be using toasts in any way, including in ajax error handling. Most of the library's css is also built to work side by side with bootstrap).
  • Moment - Optional (If you will be working with time and need to convert server time to user time).

Issues

If your find any issues within the project raise them here and remember to label them accordingly to make it easier for me to address them. Also, before raising an issue ensure that no related issue already exists. Thanks :)

Contributing

Thank you for considering contributing to the Infiscroll helper/library! To contribute:

  • Fork your own copy of the project and make any changes/fixes you deem fit.
  • If you are proposing a new feature, please create a new feature branch with the name prefixed feature-
  • Ensure You write tests for your patches/features and make sure Your tests run successfully.
  • Document your changes in the docs folder of the project.
  • Make a pull request to the master repo and wait for feedback :)

A good place to start would be at the issues page. Ensure before raising a new issue that no related issue already exists.

Code of Conduct

In order to ensure that the Infiscroll community is welcoming to all, please review and abide by the Code of Conduct below:

  • Participants will be tolerant of opposing views.
  • Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
  • When interpreting the words and actions of others, participants should always assume good intentions.
  • Behavior that can be reasonably considered harassment will not be tolerated.

Security Vulnerabilities

If you discover a security vulnerability within Infiscroll, please send an e-mail to Kevin Mwenda via oboke69@gmail.com. All security vulnerabilities will be promptly addressed.

License

Infiscroll is open-sourced software licensed under the MIT license.