2.0.3 • Published 8 years ago

badger.js v2.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Badger

Libraries.io for GitHub

GitHub issues

GitHub license

A library for displaying a list of "badges" with the dependency info of a project, similar to Google Chrome's chrome://credits page.


Table of Contents =================

What is it? ==========

A library for displaying a list of "badges" with the dependency info of a project, similar to Google Chrome's chrome://credits page.

Installation ============

NPM

npm install badger.js

Usage =====

Include badger.css in the head of your project:

<link rel="stylesheet" href="badger.css">

And badger.js in the head or body:

<script src="badger.js"></script>

In the HTML where you want the badges displayed place an element with class badger-container, like so:

<divclass="badger-container"></div>

And use something like this to create the badges:

<script type="text/javascript"><!--
  function addBadgeData() {
    var badges = [
      /*
       * Each badge must have a name, home, and license property.
       * These will be used with the Badger.js template to create
       *   the badges for your project.
       */
      {
        name: "Badger",
        home: "https://github.com/l3laze/Badger",
        license: "https://github.com/l3laze/Badger/blob/master/LICENSE.md"
      },
      w3css = {
        name: "W3.CSS",
        home: "https://www.w3schools.com",
        license: ""
      },
      {
        name: "Font-Awesome",
        home: "http://fontawesome.io/",
        license: "http://fontawesome.io/license/"
      }
    ],
    badgerContainer = document.getElementsByClassName( "badger-container" )[ 0 ];
    for( var b in badges ) {
      badgerContainer.appendChild( craftBadge( badges[ b ]));
    }
  }

  window.addEventListener( "DOMContentLoaded", addBadgeData );
--></script>

Change Log ==========

  • 2.0.3
    • FIX: Changed padding- to margin- for the icon links.
  • 2.0.2
    • FIX: Template will no longer generate a link for an empty license property.
  • 2.0.1

    • Initial release.

    Contact

    l3l_aze (Tom Shaver) GitHub e-mail

    Distributed under the MIT license. See LICENSE for more information.

    https://github.com/l3laze/Badger.js

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago