• Stars
    star
    513
  • Rank 86,178 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Slim progress bars for Ajax'y applications. Inspired by Google, YouTube, and Medium for the Rails Asset Pipeline (and some turbolinks/pjax/angular love)

nprogress-rails Gem Version Dependency Status Stories in Ready

This is basically a ruby gem for asset pipeline which includes the version 0.2.0 of the awesome rstacruz' nprogress library.

Installation

Add this line to your application's Gemfile:

gem 'nprogress-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nprogress-rails

Usage

You basically have to add the requires to the application.js file:

//= require nprogress
//= require nprogress-turbolinks

The nprogress-turbolinks is required only if you use turbolinks. Using pjax rather than turbolinks? Simply require nprogress-pjax instead. Want it also for simple jQuery AJAX calls? Just require nprogress-ajax. Otherwise, you will have to deal with show/hide the progress by your own.

Also, into your application.css.scss file:

*= require nprogress
*= require nprogress-bootstrap
*= require nprogress-turbolinks5

The nprogress-bootstrap is required if you use bootstrap and have a fixed toolbar or anything else. tl;dr: if the console shows no errors, but the progress doesn't appear, try this.

The nprogress-turbolinks5 is required if you use turbolinks 5 and does not want the default turbolinks progress to show up.

Angular.js support

You can try the Angular.js support with something like this (again, in application.js file):

//= require nprogress
//= require nprogress-angular

angular.module('myApp', [ 'nprogress-rails' ]);

This should make all requests made with $http show/hide the NProgress bar.

Customization

You can use any of the configurations described in the readme with this lib. I just recommend you to do so ASAP, for example, just after the nprogress-rails require:

//= require nprogress

NProgress.configure({
  showSpinner: false,
  ease: 'ease',
  speed: 500
});

Since the v0.1.2.3 release, you can also change the color of the progressbar using SASS:

$nprogress-color: #f1f1f1;
$nprogress-height: 10px;
$nprogress-zindex: 10100;

@import 'nprogress';
@import 'nprogress-bootstrap';

Ajax - jQuery or Prototype

nprogress-ajax automatically triggers the NProgress bar when an Ajax request is started (the 'ajaxStart' event), and finishes it when the Ajax request completes (the 'ajaxStop' event). This works for any Ajax events triggered using jQuery.

If you're using Prototype, you can include the nprogress-ajax-prototype javascript file instead, which works for Ajax requests started from Prototype (the 'onCreate' and 'onComplete' events, to be exact).

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Repositories

1

up

Clean and beautiful bootstrap based layout for Jekyll.
HTML
142
star
2

jvm

Never manually change your JAVA_HOME again
Shell
82
star
3

macOS

How I setup a new Mac
Ruby
73
star
4

spin

A very simple spinner for cli Go apps
Go
69
star
5

zsh-open-pr

Open pull requests from the command line.
Shell
65
star
6

watchub

Be notified of people who followed/unfollowed you and starred/unstarred your repositories
Go
54
star
7

gravekeeper

Informs users that a repo is not maintained anymore.
Go
47
star
8

machine

Machine setup, powered by Ansible
Shell
47
star
9

zsh-git-sync

A zsh plugin to sync git repositories and clean them up.
Shell
44
star
10

example

Golang cli application example
Go
40
star
11

shell-ci-build

A submodule to lint your shell projects with shellcheck in travis.ci builds
Shell
39
star
12

turbolinks_transitions

Easily add an awesome fade effect to turbolinks page changes.
Ruby
39
star
13

railscasts-downloader

A script to download railscasts videos to watch them later
Shell
38
star
14

ports

Easily see what's happening on your computer's ports
Shell
34
star
15

java-best-practices

A practical guide through all sort of nonsense things people should not do while coding Java
JavaScript
30
star
16

is-shit

Is this shit?
JavaScript
27
star
17

github-vacations

Automagically ignore all notifications related to work when you are on vacations
Go
21
star
18

zsh-pg

A ZSH plugin with utility functions to work with PostgreSQL.
Shell
18
star
19

gohome

Easily get cache and config folders for your app according to each OS spec
Go
18
star
20

shellstyle

WIP: A guide to write good, clean and compatible shell script code.
17
star
21

maskedinput-rails

Gemified jquery.maskedinput plugin.
Ruby
17
star
22

go-web-api-example

WIP: a Go web API example
Go
17
star
23

gssh

quickly ssh into gcloud instances
Shell
17
star
24

shcheck

easily bind shellcheck and shfmt to your CI, so your shellscripts can be checked.
Go
16
star
25

bandep

enforce banned dependency imports in Go code
Go
15
star
26

leaderz

an example for a blog a post
Go
14
star
27

git-add-remote

ZSH plugin to easily add the upstream remote to your git fork.
Shell
14
star
28

jProtractor

An angular/protractor implementation for Java Selenium API
HTML
13
star
29

zsh-mkc

zsh mkdir && cd
Shell
13
star
30

repo-watcher

[INACTIVE] โญ Watch repositories star counts
Shell
12
star
31

tablewriter

A very simple table using lipgloss and text/tabwriter.
Go
12
star
32

guice-junit-test-runner

Just a simple Guice JUnit test runner
Java
11
star
33

rails-bootstrap-toggle-buttons

unofficial bootstrap toggle buttons for the rails asset pipeline (> 3.1)
Ruby
11
star
34

selenium-grid-on-docker-example

Example code for my blog post:
Shell
11
star
35

route53-cleaner

[WIP] Suggests records that could be deleted from your AWS Route53 hosted zones
Go
11
star
36

shellcheck-docker

Generating an updated shellcheck binary for ubuntu from a Docker container
Dockerfile
10
star
37

maskmoney-rails

jQuery.maskMoney plugin for rails asset pipeline
Ruby
10
star
38

alelogo

An unofficial Alelo API implementation to get Card's balances
Go
9
star
39

netlify-shortener-sh

netlify-shortener in plain shell
Shell
8
star
40

persistence-base

A base persistence project with Maven, Eclipse-Link, Apache B-Val, Guice and Guice-Persist.
Java
8
star
41

goreleaser-docker-manifest-actions-example

Example usage of @goreleaser docker_manifests within GitHub Actions
Dockerfile
8
star
42

small-go-app-container-example

Go
8
star
43

it

An opinionated Integration Tests Framework for Golang
Go
8
star
44

helm-charts

My helm charts
Mustache
7
star
45

alelobot

A Telegram bot to get Alelo card's balance
Go
7
star
46

go-idioms

A collection of idiomatic Go functions to deal with common boilerplate.
Go
7
star
47

victorops-notifier

An unofficial VictorOps desktop notifier for macOS
Go
7
star
48

twatcher

Automagically download torrent files to ~/Downloads ๐Ÿ’ฃ
Go
7
star
49

danfe-server

Brazilian DANFE generator "as a Service" (because buzzwords)
Ruby
7
star
50

vscode-prometheus-language

Syntax highlight for Prometheus' .rules and .rules.yml files on VSCode
7
star
51

nats-streaming-server-ha-playground

sample project showing a clustered nats-streaming-server
Go
6
star
52

FRaaS

Fake RT as a Service
JavaScript
6
star
53

thanos-playground

just testing thanos with docker-compose to understand how it works :)
Shell
5
star
54

nuofx

Export @NuBank NuConta statements as an OFX file
Python
5
star
55

chosen-sass-bootstrap-rails

Just a Gemified version of chosen-sass-bootstrap, by @joeylomanto.
Ruby
5
star
56

kube-dash

Simple kubernetes dashboard for sandbox environments
Go
5
star
57

ansible-role-eclipse

Ansible role that installs and configures Eclipse IDE
Shell
5
star
58

docker-alpine-go

Docker image based on alpine 3.2 with Go 1.4.2 inside
4
star
59

hugo-apex-theme

a hugo theme based on https://github.com/apex/static
CSS
4
star
60

docker-alpine-oraclejdk7-mvn

Alpine Linux Docker images with Oracle JDK 7 and Maven 3.2.5 (~328MB)
4
star
61

zsh-git-fetch-merge

git fetch && git merge in a breeze
Shell
4
star
62

flink-async-http-example

Example usage of Flink's RichAsyncFunction to do HTTP requests.
Java
4
star
63

modular-build

Modular build scripts relying on GNU Make.
Shell
4
star
64

displayer

A damn simple image slideshow displayer.
Ruby
3
star
65

am-i-working

Log working activity based on /etc/resolv.conf domain
Go
3
star
66

java-docker-cgroups

Testing the jre 1.8.0_141 on docker limiting resources with cgroups
Java
3
star
67

vimfiles

My ~/.vim and ~/.vimrc.
Vim Script
3
star
68

ocjp-resources

3
star
69

go-victorops

Unofficial VictorOps API for Golang
Go
3
star
70

github-integrator

Binds GitHub's PullRequests comments to shell executions
Java
3
star
71

todo-clean-architecture

Trying to apply the Clean Architecture concept in something "real". The goal is to build an entire app. WIP
Java
3
star
72

cepinator

Brazilian zip codes (CEP) microservice
Go
3
star
73

goreleaser-podman-actions-example

Example usage of @goreleaser docker_manifests within GitHub Actions and Podman
Dockerfile
3
star
74

ajaxspin

A simple ruby gem that provides a out-of-the-box AJAX loading spin indicator for ruby-based web applications.
Ruby
2
star
75

bootstrap-daterangepicker-rails

A simple gem to date range picker for twitter bootstrap
Ruby
2
star
76

gorel-keyless

Dockerfile
2
star
77

docker-alpine-oraclejdk7

Alpine Linux Docker images with Oracle JDK 7 (~318MB)
2
star
78

coverage-maven-plugin

A maven plugin that will blame on pull requests pointing out chunks of code with low code coverage.
Java
2
star
79

icons

icons for tmux
Rust
2
star
80

trello-workout

I use Trello to manage my Gym workout and I tired to move cards. Deal with it.
Ruby
2
star
81

git-gc

A simple bash script to reduce your local repos' size
Shell
2
star
82

ansible-role-java-dev

Ansible role to install JDK 8, Maven and Gradle.
2
star
83

junit-slowest-tests

A couple of bash scripts to find the 50 slowest JUnit tests in a Maven project
Shell
1
star
84

spotify-api

A work-in-progress attempt of an object oriented Spotify Web API Wrapper, influenced by jcabi-github
Java
1
star
85

monorepo

Go
1
star
86

sc-niozip

A very simple API to zip/unzip files using java.nio
Scala
1
star
87

fish-gcp-machines

Simple utility to quickly print the vCPU and Memory of a given GCP instance type
Shell
1
star
88

elixir-playground

Just me playing and learning some Elixir.
Elixir
1
star
89

grave

Test repo for https://github.com/caarlos0/gravekeeper
1
star
90

lila

A very simple permission management API for Java.
Java
1
star
91

oop-clock

OOP-ish implementation of the Clock Angle Problem
Java
1
star
92

casa-robot

Java
1
star
93

nodejs-playground

Learning node.js and playing around with some samples...
JavaScript
1
star
94

docker-logrotate-example

Dockerfile
1
star
95

meditec

Aplicaรงรฃo de exemplo para o Minucurso no III Meditec: "Produtividade no Desenvolvimento WEB com GWT"
Java
1
star
96

fish-git-sync

A fish plugin to sync git repositories and clean them up.
Shell
1
star
97

tippecanoe-pkgs

Tippecanoe unofficial linux packages, RPM and Deb.
Dockerfile
1
star
98

wifilog

Go
1
star
99

lila-aop

A simple AOP Guice module to provide simple aspects to validate permissions using Lila
Java
1
star
100

spotify-duplicate-finder

Helps you find and remove repeated music from your Spotify playlists
Ruby
1
star