nprogress-rails 0.1.3.1 → 0.1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e835d33bd6cae627162c79cb68c07f0d883baa7
4
- data.tar.gz: 8cafa374c86de5cea8f47a28defe21e9806634a8
3
+ metadata.gz: 005266c9f8515ef2f35d53a105bc5d8f9b5894d6
4
+ data.tar.gz: 6bad57e6468ca128b9b3a3d12692ad34b85935d9
5
5
  SHA512:
6
- metadata.gz: fefa04715b218bca13f31cede920e6b5646d5b746edbcc0b0f2e1485bb296aa68ff7dc9fcbc52a6668183ee138e3487025378402c6aa0b7f12d7c7db568b0896
7
- data.tar.gz: 1816fcc91bbef8c8d6638b3ccffdc6feb3118287d0b5e5be971170e0b40f0cd832b7cdb9352ea3fd5f0f6ded980086e7fd81b957c756591c441eb4e7cb433b19
6
+ metadata.gz: 998073599de67692a99871e3af1c3b6d86b82798afa36320d75dc4aacd832a5b00dc4db9d291fe023be76bd7caf450cabafcf4fe2723fc1923e21322b2ab03ae
7
+ data.tar.gz: 932013e1bc9cbe92b49f9765adcaa4fa86306a00342ced4b8344fbd8c77d07e58a43051f0f5460ea97038fb99b90b0a9c711709c09e470dccdc6a6a2bf2460c1
data/README.md CHANGED
@@ -49,9 +49,29 @@ Also, into your `application.css.scss` file:
49
49
  ```
50
50
 
51
51
  The `nprogress-bootstrap` is required if you use bootstrap and have a fixed
52
- toolbar or anything else. tl;dr: if the console shows no erros, but the
52
+ toolbar or anything else. tl;dr: if the console shows no errors, but the
53
53
  progress doesn't appear, try this.
54
54
 
55
+ ### Angular.js support [experimental]
56
+
57
+ You can try the Angular.js support with this:
58
+
59
+ ```javascript
60
+ // ...
61
+ //= require nprogress
62
+ //= require nprogress-angular
63
+
64
+ var app = angular.module('myApp',[]).config([
65
+ '$httpProvider',
66
+ function($httpProvider) {
67
+ $httpProvider.interceptors.push(nprogressAngularInterceptor);
68
+ nprogressAngularInterceptor = undefined;
69
+ }
70
+ ]);
71
+ ```
72
+
73
+ This should make all requests made with `$http` show/hide the NProgress bar.
74
+
55
75
  ## Customization
56
76
 
57
77
  You can use any of the configurations described in the [readme](https://github.com/rstacruz/nprogress#configuration)
@@ -0,0 +1,20 @@
1
+ var nprogressAngularInterceptor = ['$q', function($q) {
2
+ return {
3
+ 'request': function(config) {
4
+ NProgress.start();
5
+ return config;
6
+ },
7
+ 'requestError': function(rejection) {
8
+ NProgress.done();
9
+ return $q.reject(rejection);
10
+ },
11
+ 'response': function(response) {
12
+ NProgress.done();
13
+ return response;
14
+ },
15
+ 'responseError': function(rejection) {
16
+ NProgress.done();
17
+ return $q.reject(rejection);
18
+ }
19
+ };
20
+ }];
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'nprogress-rails'
7
- spec.version = '0.1.3.1'
7
+ spec.version = '0.1.6.1'
8
8
  spec.authors = ['Carlos Alexandro Becker']
9
9
  spec.email = ['caarlos0@gmail.com']
10
- spec.description = %q{This is a gem for the rstacruz' nprogress implementation. It's based on version nprogress 0.1.2.}
10
+ spec.description = %q{This is a gem for the rstacruz' nprogress implementation. It's based on version nprogress 0.1.6.}
11
11
  spec.summary = %q{Slim progress bars for Ajax'y applications. Inspired by Google, YouTube, and Medium.}
12
12
  spec.homepage = 'https://github.com/caarlos0/nprogress-rails'
13
13
  spec.license = 'MIT'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nprogress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.1
4
+ version: 0.1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Alexandro Becker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-13 00:00:00.000000000 Z
11
+ date: 2014-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: This is a gem for the rstacruz' nprogress implementation. It's based
70
- on version nprogress 0.1.2.
70
+ on version nprogress 0.1.6.
71
71
  email:
72
72
  - caarlos0@gmail.com
73
73
  executables: []
@@ -80,6 +80,7 @@ files:
80
80
  - README.md
81
81
  - Rakefile
82
82
  - app/assets/javascripts/nprogress-ajax.js
83
+ - app/assets/javascripts/nprogress-angular.js
83
84
  - app/assets/javascripts/nprogress-pjax.js
84
85
  - app/assets/javascripts/nprogress-turbolinks.js
85
86
  - app/assets/javascripts/nprogress.js