Skip to content

Commit d2759f9

Browse files
committed
build for last PR, update some things
1 parent d401e5f commit d2759f9

File tree

6 files changed

+20
-23
lines changed

6 files changed

+20
-23
lines changed

LICENSE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2016 Jamie Perkins
4-
53
Permission is hereby granted, free of charge, to any person obtaining a copy of
64
this software and associated documentation files (the "Software"), to deal in
75
the Software without restriction, including without limitation the rights to

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Despite its name, CountUp can count in either direction, depending on the `start
55

66
CountUp.js supports all browsers.
77

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

1010
## Installation
1111

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

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

23-
See example below.
23+
## jQuery
24+
A jQuery version is also included in case you like dollar signs.
2425

2526
## WordPress plugin
26-
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/)
27+
Add CountUp to your WordPress site with this plugin: [https://wordpress.org/plugins/countup-js/](https://wordpress.org/plugins/countup-js/)
2728

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

9697
#### Angular 2
9798

98-
The directive is compatible with Angular version ^2.0.0.
99-
100-
Make sure `countUp.js` is loaded as a global dependency during bootstrapping.
99+
The directive is compatible with Angular version ^2.0.0. Make sure `countUp.js` is loaded as a global dependency during bootstrapping.
101100

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

@@ -166,7 +165,7 @@ demo.start();
166165

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

169-
1. Do your work on the `countUp.js` and/or `angular-countUp.js` files in the root directory.
168+
1. Do your work on the `countUp.js` and/or other files in the root directory.
170169
2. In Terminal, `cd` to the `countUp.js` directory.
171170
3. Run `npm install`, which installs gulp and its dependencies.
172171
4. Run `gulp`, which copies and minifies the .js files to the `dist` folder.

countUp.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
5050
decimal : '.', // character to use as a decimal
5151
easingFn: null, // optional custom easing closure function, default is Robert Penner's easeOutExpo
5252
formattingFn: null, // optional custom formatting function, default is self.formatNumber below
53-
prefix: '',
54-
suffix: ''
53+
prefix: '', // optional text before the result
54+
suffix: '' // optional text after the result
5555
};
5656
// extend default options with passed options object
57-
if (typeof options === 'object' && options != null) {
57+
if (options && typeof options === 'object') {
5858
for (var key in self.options) {
5959
if (options.hasOwnProperty(key)) {
6060
self.options[key] = options[key];
@@ -63,6 +63,8 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
6363
}
6464
if (self.options.separator === '') { self.options.useGrouping = false; }
6565

66+
self.version = function () { return '1.8.2'; };
67+
6668
self.d = (typeof target === 'string') ? document.getElementById(target) : target;
6769
self.startVal = Number(startVal);
6870
self.endVal = Number(endVal);
@@ -95,8 +97,6 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
9597
self.easingFn = self.options.easingFn ? self.options.easingFn : self.easeOutExpo;
9698
self.formattingFn = self.options.formattingFn ? self.options.formattingFn : self.formatNumber;
9799

98-
self.version = function () { return '1.8.1'; };
99-
100100
// Print value to target
101101
self.printValue = function(value) {
102102
var result = self.formattingFn(value);

dist/countUp.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
6161
decimal : '.', // character to use as a decimal
6262
easingFn: null, // optional custom easing closure function, default is Robert Penner's easeOutExpo
6363
formattingFn: null, // optional custom formatting function, default is self.formatNumber below
64-
prefix: '',
65-
suffix: ''
64+
prefix: '', // optional text before the result
65+
suffix: '' // optional text after the result
6666
};
6767
// extend default options with passed options object
68-
if (typeof options === 'object' && options != null) {
68+
if (options && typeof options === 'object') {
6969
for (var key in self.options) {
7070
if (options.hasOwnProperty(key)) {
7171
self.options[key] = options[key];
@@ -74,6 +74,8 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
7474
}
7575
if (self.options.separator === '') { self.options.useGrouping = false; }
7676

77+
self.version = function () { return '1.8.2'; };
78+
7779
self.d = (typeof target === 'string') ? document.getElementById(target) : target;
7880
self.startVal = Number(startVal);
7981
self.endVal = Number(endVal);
@@ -106,8 +108,6 @@ var CountUp = function(target, startVal, endVal, decimals, duration, options) {
106108
self.easingFn = self.options.easingFn ? self.options.easingFn : self.easeOutExpo;
107109
self.formattingFn = self.options.formattingFn ? self.options.formattingFn : self.formatNumber;
108110

109-
self.version = function () { return '1.8.1'; };
110-
111111
// Print value to target
112112
self.printValue = function(value) {
113113
var result = self.formattingFn(value);

dist/countUp.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "countup.js",
33
"description": "Animates a numerical value by counting to it",
4-
"version": "1.8.1",
5-
"licenses": "MIT",
4+
"version": "1.8.2",
5+
"license": "MIT",
66
"main": "./dist/countUp.min.js",
77
"repository": {
88
"type": "git",

0 commit comments

Comments
 (0)