Skip to content

Commit

Permalink
build for last PR, update some things
Browse files Browse the repository at this point in the history
  • Loading branch information
inorganik committed Mar 2, 2017
1 parent d401e5f commit d2759f9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
2 changes: 0 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Jamie Perkins

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Despite its name, CountUp can count in either direction, depending on the `start

CountUp.js supports all browsers.

##[Try the demo](http://inorganik.github.io/countUp.js)
## [Try the demo](http://inorganik.github.io/countUp.js)

## Installation

Expand All @@ -18,12 +18,13 @@ If you are using Angular, you can use the included Angular module. Use the count

## Angular 2 directive
An identical Angular 2 version of the directive compatible with version ^2.0.0 is also provided.
Simply import the module from `dist/` into your application module's `imports` array.
Simply import the module from `dist/` into your application module's `imports` array. See example below.

See example below.
## jQuery
A jQuery version is also included in case you like dollar signs.

## WordPress plugin
If you want a quick and easy way to use this on your WordPress site, try this plugin by [@4DMedia](https://twitter.com/4dMedia): [https://wordpress.org/plugins/countup-js/](https://wordpress.org/plugins/countup-js/)
Add CountUp to your WordPress site with this plugin: [https://wordpress.org/plugins/countup-js/](https://wordpress.org/plugins/countup-js/)

## Usage:
Params:
Expand Down Expand Up @@ -95,9 +96,7 @@ With [angular-scroll-spy](http://inorganik.github.io/angular-scroll-spy/):

#### Angular 2

The directive is compatible with Angular version ^2.0.0.

Make sure `countUp.js` is loaded as a global dependency during bootstrapping.
The directive is compatible with Angular version ^2.0.0. Make sure `countUp.js` is loaded as a global dependency during bootstrapping.

Note the value for the `options` parameter is passed directly to the directive attribute selector.

Expand Down Expand Up @@ -166,7 +165,7 @@ demo.start();

Before you make a pull request, please be sure to follow these super simple instructions:

1. Do your work on the `countUp.js` and/or `angular-countUp.js` files in the root directory.
1. Do your work on the `countUp.js` and/or other files in the root directory.
2. In Terminal, `cd` to the `countUp.js` directory.
3. Run `npm install`, which installs gulp and its dependencies.
4. Run `gulp`, which copies and minifies the .js files to the `dist` folder.
10 changes: 5 additions & 5 deletions countUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
decimal : '.', // character to use as a decimal
easingFn: null, // optional custom easing closure function, default is Robert Penner's easeOutExpo
formattingFn: null, // optional custom formatting function, default is self.formatNumber below
prefix: '',
suffix: ''
prefix: '', // optional text before the result
suffix: '' // optional text after the result
};
// extend default options with passed options object
if (typeof options === 'object' && options != null) {
if (options && typeof options === 'object') {
for (var key in self.options) {
if (options.hasOwnProperty(key)) {
self.options[key] = options[key];
Expand All @@ -63,6 +63,8 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
}
if (self.options.separator === '') { self.options.useGrouping = false; }

self.version = function () { return '1.8.2'; };

self.d = (typeof target === 'string') ? document.getElementById(target) : target;
self.startVal = Number(startVal);
self.endVal = Number(endVal);
Expand Down Expand Up @@ -95,8 +97,6 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
self.easingFn = self.options.easingFn ? self.options.easingFn : self.easeOutExpo;
self.formattingFn = self.options.formattingFn ? self.options.formattingFn : self.formatNumber;

self.version = function () { return '1.8.1'; };

// Print value to target
self.printValue = function(value) {
var result = self.formattingFn(value);
Expand Down
10 changes: 5 additions & 5 deletions dist/countUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
decimal : '.', // character to use as a decimal
easingFn: null, // optional custom easing closure function, default is Robert Penner's easeOutExpo
formattingFn: null, // optional custom formatting function, default is self.formatNumber below
prefix: '',
suffix: ''
prefix: '', // optional text before the result
suffix: '' // optional text after the result
};
// extend default options with passed options object
if (typeof options === 'object' && options != null) {
if (options && typeof options === 'object') {
for (var key in self.options) {
if (options.hasOwnProperty(key)) {
self.options[key] = options[key];
Expand All @@ -74,6 +74,8 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
}
if (self.options.separator === '') { self.options.useGrouping = false; }

self.version = function () { return '1.8.2'; };

self.d = (typeof target === 'string') ? document.getElementById(target) : target;
self.startVal = Number(startVal);
self.endVal = Number(endVal);
Expand Down Expand Up @@ -106,8 +108,6 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
self.easingFn = self.options.easingFn ? self.options.easingFn : self.easeOutExpo;
self.formattingFn = self.options.formattingFn ? self.options.formattingFn : self.formatNumber;

self.version = function () { return '1.8.1'; };

// Print value to target
self.printValue = function(value) {
var result = self.formattingFn(value);
Expand Down
2 changes: 1 addition & 1 deletion dist/countUp.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "countup.js",
"description": "Animates a numerical value by counting to it",
"version": "1.8.1",
"licenses": "MIT",
"version": "1.8.2",
"license": "MIT",
"main": "./dist/countUp.min.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit d2759f9

Please sign in to comment.