nprogress
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -5,3 +5,3 @@ { | ||
"description": "slim progress bar", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"keywords": [ | ||
@@ -13,3 +13,3 @@ "progress", | ||
"license": "MIT", | ||
"main": "nprogress.js", | ||
"main": ["nprogress.js", "nprogress.css"], | ||
"scripts": [ | ||
@@ -16,0 +16,0 @@ "nprogress.js" |
@@ -5,3 +5,3 @@ { | ||
"description": "slim progress bar", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"keywords": ["progress","bar","spinner"], | ||
@@ -8,0 +8,0 @@ "dependencies": { |
@@ -1,15 +0,12 @@ | ||
v0.1.6 -- unreleased | ||
-------------------- | ||
## v0.1.6 - June 25, 2014 | ||
To do: | ||
* Add support for specifying a different parent container. (#86, #14, #33, #39, @jonjaques) | ||
* Fix Require.js support. (#64, #75, #85) | ||
* Fix component support. (#84) | ||
* Fix Require.js support? (#64) | ||
## v0.1.5 - June 21, 2014 | ||
v0.1.5 -- June 21, 2014 | ||
----------------------- | ||
* Release properly to the npm registry. (#82) | ||
v0.1.4 -- June 21, 2014 | ||
----------------------- | ||
## v0.1.4 - June 21, 2014 | ||
@@ -25,4 +22,3 @@ * Bower: don't download package.json. Fixes browserify + jquery problem. (#65, @amelon) | ||
v0.1.3 -- March 26, 2014 | ||
------------------------ | ||
## v0.1.3 - March 26, 2014 | ||
@@ -32,4 +28,3 @@ * Remove jQuery dependency. (#28, #7, #17, @rurjur) | ||
v0.1.2 -- August 21, 2013 | ||
------------------------- | ||
## v0.1.2 - August 21, 2013 | ||
@@ -41,4 +36,3 @@ Minor update for proper [Bower] and [Component] support. | ||
v0.1.1 -- August 21, 2013 | ||
------------------------- | ||
## v0.1.1 - August 21, 2013 | ||
@@ -48,17 +42,13 @@ Minor fixes. | ||
* Removed the busy cursor that occurs when loading. | ||
* Added support for IE7 to IE9. (#3, [Mark Bao]) | ||
* Added support for IE7 to IE9. (#3, @markbao) | ||
* Implement `trickleRate` and `trickleSpeed` options. | ||
* Implement the `showSpinner` option to allow removing the spinner. (#5, #9, | ||
[Rahul C S]) | ||
* Implement the `showSpinner` option to allow removing the spinner. (#5, #9, @rahulcs) | ||
* Registered as a Component in Component.io. | ||
* Updated the Readme with better Turbolinks instructions. (#8) | ||
v0.1.0 -- August 20, 2013 | ||
------------------------- | ||
## v0.1.0 - August 20, 2013 | ||
Initial release. | ||
[Rahul C S]: https://github.com/rahulcs | ||
[Mark Bao]: https://github.com/markbao | ||
[Bower]: http://bower.io | ||
[Component]: http://component.io |
@@ -1,18 +0,18 @@ | ||
/*! NProgress (c) 2013, Rico Sta. Cruz | ||
* http://ricostacruz.com/nprogress */ | ||
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress | ||
* @license MIT */ | ||
;(function(factory) { | ||
;(function(root, factory) { | ||
if (typeof module !== 'undefined' && module.exports) { | ||
if (typeof define === 'function' && define.amd) { | ||
define(factory); | ||
} else if (typeof exports === 'object') { | ||
module.exports = factory(); | ||
} else if (typeof define === 'function' && define.amd) { | ||
define(factory); | ||
} else { | ||
this.NProgress = factory(); | ||
root.NProgress = factory(); | ||
} | ||
})(function() { | ||
})(this, function() { | ||
var NProgress = {}; | ||
NProgress.version = '0.1.5'; | ||
NProgress.version = '0.1.6'; | ||
@@ -30,2 +30,3 @@ var Settings = NProgress.settings = { | ||
spinnerSelector: '[role="spinner"]', | ||
parent: 'body', | ||
template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' | ||
@@ -230,2 +231,3 @@ }; | ||
perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), | ||
parent = document.querySelector(Settings.parent), | ||
spinner; | ||
@@ -243,3 +245,7 @@ | ||
document.body.appendChild(progress); | ||
if (parent != document.body) { | ||
addClass(parent, 'nprogress-custom-parent'); | ||
} | ||
parent.appendChild(progress); | ||
return progress; | ||
@@ -254,2 +260,3 @@ }; | ||
removeClass(document.documentElement, 'nprogress-busy'); | ||
removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent') | ||
var progress = document.getElementById('nprogress'); | ||
@@ -256,0 +263,0 @@ progress && removeElement(progress); |
@@ -5,3 +5,3 @@ { | ||
"description": "Simple slim progress bars", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -7,3 +7,2 @@ NProgress | ||
[![Status](https://api.travis-ci.org/rstacruz/nprogress.svg?branch=master)](http://travis-ci.org/rstacruz/nprogress) | ||
@@ -13,8 +12,16 @@ Installation | ||
Add [nprogress.js] and [nprogress.css] to your project. | ||
```html | ||
<script src='nprogress.js'></script> | ||
<link rel='stylesheet' href='nprogress.css'/> | ||
``` | ||
NProgress is available via [bower] and [npm]. | ||
$ bower install --save nprogress | ||
$ npm install --save nprogress | ||
$ npm install --save nprogress | ||
Add [nprogress.js] and [nprogress.css] to your project. | ||
[bower]: http://bower.io/search/?q=nprogress | ||
[npm]: https://www.npmjs.org/package/nprogress | ||
@@ -89,3 +96,4 @@ Basic usage | ||
Change the minimum percentage using `minimum`. | ||
#### `minimum` | ||
Changes the minimum percentage used upon starting. (default: `0.08`) | ||
@@ -96,4 +104,6 @@ ~~~ js | ||
#### `template` | ||
You can change the markup using `template`. To keep the progress | ||
bar working, keep an element with `role='bar'` in there. | ||
bar working, keep an element with `role='bar'` in there. See the [default template] | ||
for reference. | ||
@@ -106,4 +116,5 @@ ~~~ js | ||
Adjust animation settings using `ease` (a CSS easing string) and `speed` (in | ||
ms). | ||
#### `ease` and `speed` | ||
Adjust animation settings using *ease* (a CSS easing string) | ||
and *speed* (in ms). (default: `ease` and `200`) | ||
@@ -114,3 +125,4 @@ ~~~ js | ||
Want to turn off trickling? Set `trickle` to `false`. | ||
#### `trickle` | ||
Turn of the automatic incrementing behavior by setting this to `false`. (default: `true`) | ||
@@ -121,4 +133,5 @@ ~~~ js | ||
You can adjust the `trickleRate` (how much to increase per trickle) and | ||
`trickleSpeed` (how often to trickle, in ms). | ||
#### `trickleRate` and `trickleSpeed` | ||
You can adjust the *trickleRate* (how much to increase per trickle) and | ||
*trickleSpeed* (how often to trickle, in ms). | ||
@@ -129,3 +142,4 @@ ~~~ js | ||
Want to turn off loading spinner? Set `showSpinner` to `false`. | ||
#### `showSpinner` | ||
Turn off loading spinner by setting it to false. (default: `true`) | ||
@@ -136,2 +150,9 @@ ~~~ js | ||
#### `parent` | ||
specify this to change the parent container. (default: `body`) | ||
~~~ js | ||
NProgress.configure({ parent: '#container' }); | ||
~~~ | ||
Customization | ||
@@ -149,24 +170,36 @@ ------------- | ||
* [New UI Pattern: Website Loading | ||
Bars](http://www.usabilitypost.com/2013/08/19/new-ui-pattern-website-loading-bars/) (usabilitypost.com) | ||
* [New UI Pattern: Website Loading Bars](http://www.usabilitypost.com/2013/08/19/new-ui-pattern-website-loading-bars/) (usabilitypost.com) | ||
Acknowledgements | ||
---------------- | ||
Support | ||
------- | ||
© 2013, Rico Sta. Cruz. Released under the [MIT License](License.md). | ||
__Bugs and requests__: submit them through the project's issues tracker.<br> | ||
[![Issues](http://img.shields.io/github/issues/rstacruz/nprogress.svg)]( https://github.com/rstacruz/nprogress/issues ) | ||
**NProgress** is authored and maintained by [Rico Sta. Cruz][rsc] with help from | ||
its [contributors][c] | ||
__Questions__: ask them at StackOverflow with the tag *nprogress*.<br> | ||
[![StackOverflow](http://img.shields.io/badge/stackoverflow-nprogress-brightgreen.svg)]( http://stackoverflow.com/questions/tagged/nprogress ) | ||
* [My website](http://ricostacruz.com) (ricostacruz.com) | ||
* [Github](http://github.com/rstacruz) (@rstacruz) | ||
* [Twitter](http://twitter.com/rstacruz) (@rstacruz) | ||
__Chat__: join us at gitter.im.<br> | ||
[![Chat](http://img.shields.io/badge/gitter-rstacruz / nprogress-brightgreen.svg)]( https://gitter.im/rstacruz/nprogress ) | ||
[rsc]: http://ricostacruz.com | ||
[c]: http://github.com/rstacruz/nprogress/contributors | ||
[default template]: | ||
https://github.com/rstacruz/nprogress/blob/master/nprogress.js#L31 | ||
[Turbolinks]: https://github.com/rails/turbolinks | ||
[nprogress.js]: http://ricostacruz.com/nprogress/nprogress.js | ||
[nprogress.css]: http://ricostacruz.com/nprogress/nprogress.css | ||
[bower]: http://bower.io/search/?q=nprogress | ||
[npm]: https://www.npmjs.org/package/nprogress | ||
Thanks | ||
------ | ||
**NProgress** © 2013-2014, Rico Sta. Cruz. Released under the [MIT License].<br> | ||
Authored and maintained by Rico Sta. Cruz with help from [contributors]. | ||
> [ricostacruz.com](http://ricostacruz.com) · | ||
> GitHub [@rstacruz](https://github.com/rstacruz) · | ||
> Twitter [@rstacruz](https://twitter.com/rstacruz) | ||
[MIT License]: http://mit-license.org/ | ||
[contributors]: http://github.com/rstacruz/jsfuse/contributors | ||
[![Status](https://api.travis-ci.org/rstacruz/nprogress.svg?branch=master)](http://travis-ci.org/rstacruz/nprogress) | ||
[![npm version](https://img.shields.io/npm/v/nprogress.png)](https://npmjs.org/package/nprogress "View this project on npm") |
@@ -1,2 +0,1 @@ | ||
// Deps | ||
global.chai = require('chai'); | ||
@@ -7,9 +6,4 @@ global.assert = chai.assert; | ||
var fs = require('fs'); | ||
var multisuite = require('./support/multisuite'); | ||
var scripts = { | ||
'jq-1.7': fs.readFileSync('vendor/jquery-1.7.js'), | ||
'jq-1.8': fs.readFileSync('vendor/jquery-1.8.js'), | ||
'jq-1.9': fs.readFileSync('vendor/jquery-1.9.js'), | ||
'jq-1.10': fs.readFileSync('vendor/jquery-1.10.js'), | ||
'jq-2.0': fs.readFileSync('vendor/jquery-2.0.js'), | ||
@@ -19,3 +13,3 @@ 'nprogress': fs.readFileSync('nprogress.js') | ||
function myEnv(jq) { | ||
function myEnv() { | ||
var jsdom = require('jsdom'); | ||
@@ -25,3 +19,3 @@ return function(done) { | ||
html: '<!doctype html><html><head></head><body></body></html>', | ||
src: [ scripts[jq], scripts.nprogress ], | ||
src: [ scripts['jq-2.0'], scripts.nprogress ], | ||
done: function(errors, window) { | ||
@@ -39,7 +33,3 @@ window.console = console; | ||
if (process.env.fast) { | ||
before(myEnv('jq-1.10')); | ||
global.testSuite = describe; | ||
} else { | ||
global.testSuite = multisuite(['jq-1.8', 'jq-1.9', 'jq-1.10', 'jq-2.0'], myEnv); | ||
} | ||
before(myEnv()); | ||
global.testSuite = describe; |
@@ -74,2 +74,10 @@ (function() { | ||
}); | ||
it('must be attached to specified parent', function() { | ||
var test = $('<div>', {id: 'test'}).appendTo('body'); | ||
NProgress.configure({parent: '#test'}); | ||
NProgress.start(); | ||
assert.isTrue($("#nprogress").parent().is(test)); | ||
assert.isTrue($(NProgress.settings.parent).hasClass("nprogress-custom-parent")); | ||
}); | ||
}); | ||
@@ -95,2 +103,15 @@ | ||
describe('.remove()', function() { | ||
it('should be removed from the parent', function() { | ||
NProgress.set(1); | ||
NProgress.remove(); | ||
var parent = $(NProgress.settings.parent); | ||
assert.isFalse(parent.hasClass('nprogress-custom-parent')); | ||
assert.equal(parent.find('#nprogress').length, 0); | ||
}); | ||
}); | ||
// ---- | ||
describe('.inc()', function() { | ||
@@ -97,0 +118,0 @@ it('should render', function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
196
1
36636
18
831