From 1b6088de7e4ea36e39b2273f2d2113a61ba657fb Mon Sep 17 00:00:00 2001 From: Ramy Rais Date: Sat, 21 Jun 2025 21:41:48 +0200 Subject: [PATCH 1/9] Remove bower & jspm --- Notes.md | 35 ++++++++++++++--------------------- bower.json | 27 --------------------------- component.json | 19 ------------------- package.json | 26 +------------------------- 4 files changed, 15 insertions(+), 92 deletions(-) delete mode 100644 bower.json delete mode 100644 component.json diff --git a/Notes.md b/Notes.md index 3956c41..df84623 100644 --- a/Notes.md +++ b/Notes.md @@ -1,25 +1,18 @@ -Testing -------- +## Testing - $ npm install - $ npm test +```sh +npm install +npm test +``` -or try it out in the browser: +or try it out in the browser by opening `index.html` - $ open test/index.html +## Releasing -Testing component build ------------------------ - - $ component install - $ component build - $ open test/component.html - -Releasing ---------- - - $ npm test - $ bump *.json nprogress.js # bump version numbers - $ git release 0.1.1 # release to bower/github - $ npm publish # release to npm - $ git push origin master:gh-pages # update the site +```sh +npm test +bump *.json nprogress.js # bump version numbers +git release 0.1.1 # release to bower/github +npm publish # release to npm +git push origin master:gh-pages # update the site +``` diff --git a/bower.json b/bower.json deleted file mode 100644 index 1019eba..0000000 --- a/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "nprogress", - "repo": "rstacruz/nprogress", - "description": "slim progress bar", - "version": "0.3.5", - "keywords": [ - "progress", - "bar", - "spinner" - ], - "license": "MIT", - "main": ["nprogress.js", "nprogress.css"], - "scripts": [ - "nprogress.js" - ], - "styles": [ - "nprogress.css" - ], - "ignore": [ - "**/.*", - "node_modules", - "components", - "package.json", - "test", - "vendor" - ] -} diff --git a/component.json b/component.json deleted file mode 100644 index 698499c..0000000 --- a/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "nprogress", - "repo": "rstacruz/nprogress", - "description": "slim progress bar", - "version": "0.2.0", - "keywords": ["progress","bar","spinner"], - "development": { - "chaijs/chai": "*", - "visionmedia/mocha": "*" - }, - "license": "MIT", - "main": "nprogress.js", - "scripts": [ - "nprogress.js" - ], - "styles": [ - "nprogress.css" - ] -} diff --git a/package.json b/package.json index c4558bc..f5a7b45 100644 --- a/package.json +++ b/package.json @@ -25,29 +25,5 @@ "jsdom-global": "3.0.2", "mocha": "^7.1.2" }, - "dependencies": {}, - "jspm": { - "format": "global", - "shim": { - "nprogress": { - "deps": [ - "./nprogress.css!" - ] - } - }, - "dependencies": { - "css": "*" - } - }, - "spm": { - "main": "nprogress.js", - "output": [ - "nprogress.css" - ], - "ignore": [ - "support", - "test", - "vendor" - ] - } + "dependencies": {} } From 2467916e7ad70765271bacffef6a380c1b966033 Mon Sep 17 00:00:00 2001 From: Ramy Rais Date: Sat, 21 Jun 2025 21:42:31 +0200 Subject: [PATCH 2/9] Rename Note to contributing --- Notes.md => CONTRIBUTING.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Notes.md => CONTRIBUTING.md (100%) diff --git a/Notes.md b/CONTRIBUTING.md similarity index 100% rename from Notes.md rename to CONTRIBUTING.md From dcb75463bf40f639a9e422a35e11557d94187ddc Mon Sep 17 00:00:00 2001 From: Ramy Rais Date: Sat, 21 Jun 2025 21:46:26 +0200 Subject: [PATCH 3/9] change history file to changelog --- History.md => CHANGELOG.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename History.md => CHANGELOG.md (100%) diff --git a/History.md b/CHANGELOG.md similarity index 100% rename from History.md rename to CHANGELOG.md From 7755ed7411601251385842a652e0ae379b1d6f42 Mon Sep 17 00:00:00 2001 From: Ramy Rais Date: Sat, 21 Jun 2025 21:58:07 +0200 Subject: [PATCH 4/9] Remove travis and use github action --- .github/workflows/pipeline.yml | 30 ++++++++++++++++++++++++++++++ .travis.yml | 4 ---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pipeline.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..e2be9c5 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,30 @@ +name: Node.js 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: Run tests + run: npm test \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3c66e65..0000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: ["14.0.0"] -notifications: - email: false \ No newline at end of file From 03eb8a2ea9ab9b394936cd0046abc8080014c8d7 Mon Sep 17 00:00:00 2001 From: Ramy Rais Date: Sun, 6 Jul 2025 10:17:51 +0200 Subject: [PATCH 5/9] Update library to be ES6 module. --- CONTRIBUTING.md | 9 +- Readme.md | 104 +- index.html | 8 +- nprogress.js | 121 +- package-lock.json | 2877 ++++++++++++++++++++++----------------------- package.json | 14 +- test/test.js | 543 ++++----- 7 files changed, 1804 insertions(+), 1872 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df84623..62bb624 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,14 +5,19 @@ npm install npm test ``` -or try it out in the browser by opening `index.html` +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 bower/github +git release 0.1.1 # release to github npm publish # release to npm git push origin master:gh-pages # update the site ``` diff --git a/Readme.md b/Readme.md index ed21ca6..876348e 100644 --- a/Readme.md +++ b/Readme.md @@ -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 - + ``` -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 + + +``` -- 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 -------------- @@ -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(); @@ -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 ------- @@ -211,20 +175,11 @@ __Bugs and requests__: submit them through the project's issues tracker.
[![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].
- -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)
+This is a fork from [**NProgress**](https://github.com/rstacruz/nprogress) Released under the [MIT License].
-> GitHub [@RamyRais](https://github.com/RamyRais)