Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [ '**' ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
# checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build package
run: npm run build

- name: Run tests
run: npm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
components
.vscode
.vscode
dist
7 changes: 0 additions & 7 deletions .npmignore

This file was deleted.

4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

File renamed without changes.
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Testing

```sh
npm install
npm test
```

Try in the browser by serving index.html from a server
```sh
# Example with python
python3 -m http.server 8000
```


## Releasing

```sh
npm test
bump *.json nprogress.js # bump version numbers
git release 0.1.1 # release to github
npm publish # release to npm
git push origin master:gh-pages # update the site
```
25 changes: 0 additions & 25 deletions Notes.md

This file was deleted.

104 changes: 29 additions & 75 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,56 @@
NProgress
=========

[![Status](https://api.travis-ci.org/RamyRais/multi-nprogress.svg?branch=master)](https://travis-ci.org/RamyRais/multi-nprogress)
[![npm version](https://img.shields.io/npm/v/multi-nprogress.png)](https://npmjs.org/package/multi-nprogress "View this project on npm")
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/multi-nprogress/badge?style=rounded)](https://www.jsdelivr.com/package/npm/multi-nprogress)

> Minimalist progress bar
Slim progress bars for Ajax applications. Inspired by Google, YouTube, and
Medium.
Slim progress bars for frontend applications.

Installation
------------
## Installation

Add [nprogress.js] and [nprogress.css] to your project.
### version 1.0.0 and above
NProgress is an ES6 module available via [npm].

$ npm install --save nprogress

**Manual:** Download the files and add [nprogress.js] and [nprogress.css] to your project.

```html
<script src='nprogress.js'></script>
<link rel='stylesheet' href='nprogress.css'/>
<script type="module">
// Import the ES module
import NProgressModule from './nprogress.js';
</script>
```

NProgress is available via [npm].
### version 0.x.x
NProgress is an UMD module available via [npm].

$ npm install --save nprogress

Also available via [unpkg] CDN:
**Manual:** Download the files and add [nprogress.js] and [nprogress.css] to your project.

```html
<script src='nprogress.js'></script>
<link rel='stylesheet' href='nprogress.css'/>
```

- https://unpkg.com/multi-nprogress@0.3.3/nprogress.js
- https://unpkg.com/multi-nprogress@0.3.3/nprogress.css

Basic usage
-----------
you should instantiate the progress bar
~~~ js
## Basic usage
you should instantiate the progress bar from default import
```js
var nprogress = NProgress();
~~~
```

then Simply call `start()` and `done()` to control the progress bar.

~~~ js
```js
nprogress.start();
nprogress.done();
~~~

### Turbolinks (version 5+)
Ensure you're using Turbolinks 5+, and use
this: (explained [here](https://github.com/rstacruz/nprogress/issues/8#issuecomment-239107109))

~~~ js
$(document).on('turbolinks:click', function() {
nprogress.start();
});
$(document).on('turbolinks:render', function() {
nprogress.done();
nprogress.remove();
});
~~~

### Turbolinks (version 3 and below)
Ensure you're using Turbolinks 1.3.0+, and use
this: (explained [here](https://github.com/rstacruz/nprogress/issues/8#issuecomment-23010560))

~~~ js
$(document).on('page:fetch', function() { nprogress.start(); });
$(document).on('page:change', function() { nprogress.done(); });
$(document).on('page:restore', function() { nprogress.remove(); });
~~~

### Pjax
Try this: (explained [here](https://github.com/rstacruz/nprogress/issues/22#issuecomment-36540472))

~~~ js
$(document).on('pjax:start', function() { nprogress.start(); });
$(document).on('pjax:end', function() { nprogress.done(); });
~~~

Ideas
-----

* Add progress to your Ajax calls! Bind it to the jQuery `ajaxStart` and
`ajaxStop` events.
```

* Make a fancy loading bar even without Turbolinks/Pjax! Bind it to
`$(document).ready` and `$(window).load`.

Advanced usage
--------------
Expand Down Expand Up @@ -182,7 +150,7 @@ var elt = document.getElementById('#container')
nprogress.configure({ parent: elt });
~~~

Also this is useful when you want to have multi progress bar in your page you need to give different parent for each
When you want to have multi progress bar in your page you need to give different parent for each
~~~ js
var nprogress1 = NProgress();
var nprogress2 = NProgress();
Expand All @@ -199,10 +167,6 @@ and replace occurrences of `#29d`.
The included CSS file is pretty minimal... in fact, feel free to scrap it and
make your own!

Resources
---------

* [New UI Pattern: Website Loading Bars](http://www.usabilitypost.com/2013/08/19/new-ui-pattern-website-loading-bars/) (usabilitypost.com)

Support
-------
Expand All @@ -211,20 +175,11 @@ __Bugs and requests__: submit them through the project's issues tracker.<br>
[![Issues](http://img.shields.io/github/issues/RamyRais/multi-nprogress.svg)]( https://github.com/RamyRais/multi-nprogress/issues )


Thanks
------
**multi-nprogress** © 2018 Ramy Rais. Released under the [MIT License].<br>

Authored and maintained by Rico Sta. Cruz with help from [contributors].



Spacial Thanks
License
------
**multi-nprogress** is based on [**NProgress**](https://github.com/rstacruz/nprogress) by [Rico Sta. Cruz.](http://ricostacruz.com) <br>
This is a fork from [**NProgress**](https://github.com/rstacruz/nprogress) Released under the [MIT License].<br>


> GitHub [@RamyRais](https://github.com/RamyRais)

<!--
LINKS
Expand All @@ -233,5 +188,4 @@ LINKS
[nprogress.css]: https://github.com/RamyRais/multi-nprogress/blob/master/nprogress.css

[MIT License]: http://mit-license.org/
[contributors]: http://github.com/RamyRais/multi-nprogress/contributors
[npm]: https://www.npmjs.com/package/multi-nprogress
27 changes: 0 additions & 27 deletions bower.json

This file was deleted.

19 changes: 0 additions & 19 deletions component.json

This file was deleted.

9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,700,400italic' rel='stylesheet' type='text/css'>

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src='nprogress.js'></script>
</head>

<body style='display: none'>
Expand Down Expand Up @@ -59,7 +58,6 @@ <h1>NProgress<i>.js</i></h1>
Download
v<span class='version'></span>
</a>
<p class='brief'>Perfect for Turbolinks, Pjax, and other Ajax-heavy apps.</p>
<p class='brief'>This library is based on <a href="https://github.com/rstacruz/nprogress">nprogress</a> of rstacruz</p>
</div>
<div class='hr-rule'></div>
Expand All @@ -71,9 +69,12 @@ <h1>NProgress<i>.js</i></h1>
</div>
</div>

<script>
<script type="module">
// Import the ES module
import NProgressModule from './src/nprogress.js';

$('body').show();
var progressBar = NProgress();
var progressBar = NProgressModule();
$('.version').text(progressBar.version);
progressBar.start();
setTimeout(function() { progressBar.done(); $('.fade').removeClass('out'); }, 1000);
Expand Down
Loading