kms 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/kms/application.js +1 -0
  3. data/app/assets/javascripts/kms/application/controllers/assets_controller.coffee.erb +14 -4
  4. data/app/assets/javascripts/kms/application/controllers/pages_controller.coffee.erb +12 -2
  5. data/app/assets/javascripts/kms/application/controllers/snippets_controller.coffee.erb +13 -3
  6. data/app/assets/javascripts/kms/application/controllers/templates_controller.coffee.erb +13 -3
  7. data/app/assets/javascripts/kms/application/controllers/users_controller.coffee +5 -5
  8. data/app/assets/javascripts/kms/application/module.coffee +6 -2
  9. data/app/assets/javascripts/kms/application/routes.coffee.erb +10 -0
  10. data/app/assets/javascripts/templates/assets/edit.html.slim +2 -1
  11. data/app/assets/javascripts/templates/assets/form.html.slim +1 -1
  12. data/app/assets/javascripts/templates/pages/edit.html.slim +1 -0
  13. data/app/assets/javascripts/templates/shared/hotkey_notification.html.slim +6 -0
  14. data/app/assets/javascripts/templates/snippets/edit.html.slim +1 -0
  15. data/app/assets/javascripts/templates/templates/edit.html.slim +1 -0
  16. data/app/assets/javascripts/templates/users/edit.html.slim +5 -0
  17. data/app/assets/javascripts/templates/users/form.html.slim +3 -2
  18. data/app/assets/javascripts/templates/users/index.html.slim +2 -1
  19. data/app/assets/stylesheets/kms/custom.css.scss +10 -0
  20. data/app/controllers/kms/assets_controller.rb +6 -3
  21. data/app/controllers/kms/users_controller.rb +14 -0
  22. data/app/services/kms/resource_service.rb +3 -1
  23. data/app/views/layouts/kms/kms.html.erb +1 -1
  24. data/config/initializers/devise.rb +9 -0
  25. data/config/locales/en.yml +12 -0
  26. data/config/locales/ru.yml +12 -0
  27. data/config/routes.rb +1 -1
  28. data/lib/kms/engine.rb +1 -1
  29. data/lib/kms/version.rb +1 -1
  30. data/spec/controllers/kms/assets_controller_spec.rb +28 -10
  31. data/spec/controllers/kms/users_controller_spec.rb +23 -0
  32. data/spec/internal/config/routes.rb +1 -1
  33. data/spec/internal/log/test.log +0 -105823
  34. data/vendor/assets/bower.json +5 -4
  35. data/vendor/assets/bower_components/angular-cookies/angular-cookies.js +22 -18
  36. data/vendor/assets/bower_components/angular-cookies/angular-cookies.min.js +4 -4
  37. data/vendor/assets/bower_components/angular-cookies/angular-cookies.min.js.map +2 -2
  38. data/vendor/assets/bower_components/angular-cookies/bower.json +2 -2
  39. data/vendor/assets/bower_components/angular-cookies/package.json +1 -1
  40. data/vendor/assets/bower_components/angular-hotkeys/Gruntfile.js +118 -0
  41. data/vendor/assets/bower_components/angular-hotkeys/LICENSE +20 -0
  42. data/vendor/assets/bower_components/angular-hotkeys/README.md +248 -0
  43. data/vendor/assets/bower_components/angular-hotkeys/bower.json +19 -0
  44. data/vendor/assets/bower_components/angular-hotkeys/build/hotkeys.css +110 -0
  45. data/vendor/assets/bower_components/angular-hotkeys/build/hotkeys.js +1661 -0
  46. data/vendor/assets/bower_components/angular-hotkeys/build/hotkeys.min.css +1 -0
  47. data/vendor/assets/bower_components/angular-hotkeys/build/hotkeys.min.js +7 -0
  48. data/vendor/assets/bower_components/angular-hotkeys/package.json +45 -0
  49. data/vendor/assets/bower_components/angular-hotkeys/src/hotkeys.css +104 -0
  50. data/vendor/assets/bower_components/angular-hotkeys/src/hotkeys.js +633 -0
  51. data/vendor/assets/bower_components/angular-loading-bar/CHANGELOG.md +33 -0
  52. data/vendor/assets/bower_components/angular-loading-bar/CONTRIBUTING.md +17 -0
  53. data/vendor/assets/bower_components/angular-loading-bar/Gruntfile.js +9 -1
  54. data/vendor/assets/bower_components/angular-loading-bar/ISSUE_TEMPLATE.md +14 -0
  55. data/vendor/assets/bower_components/angular-loading-bar/PULL_REQUEST_TEMPLATE.md +13 -0
  56. data/vendor/assets/bower_components/angular-loading-bar/README.md +30 -3
  57. data/vendor/assets/bower_components/angular-loading-bar/bower.json +11 -6
  58. data/vendor/assets/bower_components/angular-loading-bar/build/loading-bar.css +5 -5
  59. data/vendor/assets/bower_components/angular-loading-bar/build/loading-bar.js +39 -12
  60. data/vendor/assets/bower_components/angular-loading-bar/build/loading-bar.min.css +1 -8
  61. data/vendor/assets/bower_components/angular-loading-bar/build/loading-bar.min.js +3 -3
  62. data/vendor/assets/bower_components/angular-loading-bar/index.js +2 -0
  63. data/vendor/assets/bower_components/angular-loading-bar/package.json +12 -15
  64. data/vendor/assets/bower_components/angular-loading-bar/src/loading-bar.css +3 -3
  65. data/vendor/assets/bower_components/angular-loading-bar/src/loading-bar.js +37 -10
  66. data/vendor/assets/bower_components/angular-sanitize/angular-sanitize.js +504 -386
  67. data/vendor/assets/bower_components/angular-sanitize/angular-sanitize.min.js +13 -12
  68. data/vendor/assets/bower_components/angular-sanitize/angular-sanitize.min.js.map +3 -3
  69. data/vendor/assets/bower_components/angular-sanitize/bower.json +2 -2
  70. data/vendor/assets/bower_components/angular-sanitize/package.json +1 -1
  71. data/vendor/assets/bower_components/angular-ui-router/CHANGELOG.md +1410 -0
  72. data/vendor/assets/bower_components/angular-ui-router/CONTRIBUTING.md +64 -16
  73. data/vendor/assets/bower_components/angular-ui-router/DOCS.md +48 -0
  74. data/vendor/assets/bower_components/angular-ui-router/ISSUE_TEMPLATE.md +53 -0
  75. data/vendor/assets/bower_components/angular-ui-router/LICENSE +1 -1
  76. data/vendor/assets/bower_components/angular-ui-router/README.md +24 -211
  77. data/vendor/assets/bower_components/angular-ui-router/artifacts.json +8 -0
  78. data/vendor/assets/bower_components/angular-ui-router/bower.json +1 -23
  79. data/vendor/assets/bower_components/angular-ui-router/karma.conf.js +105 -0
  80. data/vendor/assets/bower_components/angular-ui-router/release/angular-ui-router.js +9744 -3901
  81. data/vendor/assets/bower_components/angular-ui-router/release/angular-ui-router.js.map +192 -0
  82. data/vendor/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js +9 -4
  83. data/vendor/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js.map +1679 -0
  84. data/vendor/assets/bower_components/angular-ui-router/release/resolveService.js +83 -0
  85. data/vendor/assets/bower_components/angular-ui-router/release/resolveService.js.map +19 -0
  86. data/vendor/assets/bower_components/angular-ui-router/release/resolveService.min.js +8 -0
  87. data/vendor/assets/bower_components/angular-ui-router/release/resolveService.min.js.map +47 -0
  88. data/vendor/assets/bower_components/angular-ui-router/release/stateEvents.js +294 -0
  89. data/vendor/assets/bower_components/angular-ui-router/release/stateEvents.js.map +17 -0
  90. data/vendor/assets/bower_components/angular-ui-router/release/stateEvents.min.js +8 -0
  91. data/vendor/assets/bower_components/angular-ui-router/release/stateEvents.min.js.map +102 -0
  92. data/vendor/assets/bower_components/angular-ui-router/release/ui-router-angularjs.js +2014 -0
  93. data/vendor/assets/bower_components/angular-ui-router/release/ui-router-angularjs.js.map +70 -0
  94. data/vendor/assets/bower_components/angular-ui-router/release/ui-router-angularjs.min.js +9 -0
  95. data/vendor/assets/bower_components/angular-ui-router/release/ui-router-angularjs.min.js.map +541 -0
  96. data/vendor/assets/bower_components/angular-ui-router/rollup.config.js +116 -0
  97. data/vendor/assets/bower_components/angular-ui-router/tslint.json +60 -0
  98. data/vendor/assets/bower_components/angular-ui-router/yarn.lock +4146 -0
  99. data/vendor/assets/bower_components/angular-ui-tree/yarn.lock +4945 -0
  100. data/vendor/assets/bower_components/angular/angular.js +4019 -2449
  101. data/vendor/assets/bower_components/angular/angular.min.js +331 -319
  102. data/vendor/assets/bower_components/angular/angular.min.js.gzip +0 -0
  103. data/vendor/assets/bower_components/angular/angular.min.js.map +3 -3
  104. data/vendor/assets/bower_components/angular/bower.json +1 -1
  105. data/vendor/assets/bower_components/angular/package.json +1 -1
  106. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/LICENSE +21 -0
  107. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/README.md +14 -14
  108. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/bower.json +25 -12
  109. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/development_index.html +59 -52
  110. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/dist/angularjs-dropdown-multiselect.min.js +1 -1
  111. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/index.html +73 -0
  112. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/package.json +19 -7
  113. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/pages/javascripts/pages/home/ExampleCtrl.js +126 -3
  114. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/pages/javascripts/pages/home/home.html +1262 -852
  115. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/pages/stylesheets/stylesheet.css +10 -5
  116. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/src/angularjs-dropdown-multiselect.js +612 -287
  117. metadata +66 -169
  118. data/spec/internal/config/database.yml +0 -7
  119. data/spec/internal/public/uploads/kms/asset/file/1/avatar.jpg +0 -0
  120. data/spec/internal/public/uploads/kms/asset/file/2/avatar.jpg +0 -0
  121. data/spec/internal/public/uploads/kms/asset/file/2/style.css +0 -1
  122. data/spec/internal/public/uploads/kms/asset/file/3/style.css +0 -1
  123. data/spec/internal/public/uploads/kms/asset/file/4/style.css +0 -1
  124. data/spec/internal/public/uploads/tmp/1500976987-41025-0002-0883/style.css +0 -1
  125. data/spec/internal/public/uploads/tmp/1500977082-41195-0002-6495/style.css +0 -1
  126. data/spec/internal/public/uploads/tmp/1500977109-41364-0002-4518/style.css +0 -1
  127. data/spec/internal/public/uploads/tmp/1500977152-41405-0002-2345/style.css +0 -1
  128. data/spec/internal/public/uploads/tmp/1500977327-41694-0002-5448/style.css +0 -1
  129. data/spec/internal/public/uploads/tmp/1500977376-41732-0002-7916/style.css +0 -1
  130. data/spec/internal/public/uploads/tmp/1500977392-41759-0002-7593/style.css +0 -1
  131. data/spec/internal/public/uploads/tmp/1500977410-42259-0002-7527/style.css +0 -1
  132. data/spec/internal/public/uploads/tmp/1500977429-42306-0002-5937/style.css +0 -1
  133. data/spec/internal/public/uploads/tmp/1500977437-42324-0002-5880/style.css +0 -1
  134. data/spec/internal/public/uploads/tmp/1500983228-53594-0002-4559/style.css +0 -1
  135. data/spec/internal/public/uploads/tmp/1500983284-53632-0002-6590/style.css +0 -1
  136. data/spec/internal/public/uploads/tmp/1500983360-53784-0002-7289/style.css +0 -1
  137. data/spec/internal/public/uploads/tmp/1500983469-54321-0002-0386/avatar.jpg +0 -0
  138. data/spec/internal/public/uploads/tmp/1500983469-54321-0004-5691/style.css +0 -1
  139. data/spec/internal/public/uploads/tmp/1500983511-54352-0002-5720/avatar.jpg +0 -0
  140. data/spec/internal/public/uploads/tmp/1500983511-54352-0004-1399/style.css +0 -1
  141. data/spec/internal/public/uploads/tmp/1500983610-54507-0002-4280/avatar.jpg +0 -0
  142. data/spec/internal/public/uploads/tmp/1500983610-54507-0004-9758/style.css +0 -1
  143. data/spec/internal/public/uploads/tmp/1500984466-57012-0002-4146/avatar.jpg +0 -0
  144. data/spec/internal/public/uploads/tmp/1500984466-57012-0004-5895/style.css +0 -1
  145. data/spec/internal/public/uploads/tmp/1500984509-57158-0002-9657/avatar.jpg +0 -0
  146. data/spec/internal/public/uploads/tmp/1500984509-57158-0004-5003/style.css +0 -1
  147. data/spec/internal/public/uploads/tmp/1500984616-57697-0002-7201/avatar.jpg +0 -0
  148. data/spec/internal/public/uploads/tmp/1500984616-57697-0004-6255/style.css +0 -1
  149. data/spec/internal/public/uploads/tmp/1500985257-58947-0002-3629/avatar.jpg +0 -0
  150. data/spec/internal/public/uploads/tmp/1500985257-58947-0004-5338/style.css +0 -1
  151. data/spec/internal/public/uploads/tmp/1500985407-58947-0006-5929/style.css +0 -1
  152. data/spec/internal/public/uploads/tmp/1500985473-59264-0002-0397/avatar.jpg +0 -0
  153. data/spec/internal/public/uploads/tmp/1500985473-59264-0004-6493/style.css +0 -1
  154. data/spec/internal/public/uploads/tmp/1500985475-59264-0007-8674/style.css +0 -1
  155. data/spec/internal/public/uploads/tmp/1500985538-59468-0002-9206/avatar.jpg +0 -0
  156. data/spec/internal/public/uploads/tmp/1500985538-59468-0004-2586/style.css +0 -1
  157. data/spec/internal/public/uploads/tmp/1500985538-59468-0007-6200/style.css +0 -1
  158. data/spec/internal/public/uploads/tmp/1500988358-65877-0002-4528/avatar.jpg +0 -0
  159. data/spec/internal/public/uploads/tmp/1500988358-65877-0004-5904/style.css +0 -1
  160. data/spec/internal/public/uploads/tmp/1500988358-65877-0007-7320/style.css +0 -1
  161. data/spec/internal/public/uploads/tmp/1500988407-65916-0002-3138/avatar.jpg +0 -0
  162. data/spec/internal/public/uploads/tmp/1500988407-65916-0004-5400/style.css +0 -1
  163. data/spec/internal/public/uploads/tmp/1500988407-65916-0007-1655/style.css +0 -1
  164. data/spec/internal/public/uploads/tmp/1500988421-65950-0002-9415/avatar.jpg +0 -0
  165. data/spec/internal/public/uploads/tmp/1500988421-65950-0004-7130/style.css +0 -1
  166. data/spec/internal/public/uploads/tmp/1500988421-65950-0007-9886/style.css +0 -1
  167. data/spec/internal/public/uploads/tmp/1500988435-65981-0002-3228/avatar.jpg +0 -0
  168. data/spec/internal/public/uploads/tmp/1500988435-65981-0004-3682/style.css +0 -1
  169. data/spec/internal/public/uploads/tmp/1500988435-65981-0007-1582/style.css +0 -1
  170. data/spec/internal/public/uploads/tmp/1500988475-66122-0002-9516/avatar.jpg +0 -0
  171. data/spec/internal/public/uploads/tmp/1500988475-66122-0004-5634/style.css +0 -1
  172. data/spec/internal/public/uploads/tmp/1500988530-66122-0007-2272/style.css +0 -1
  173. data/spec/internal/public/uploads/tmp/1500988554-66315-0002-6262/avatar.jpg +0 -0
  174. data/spec/internal/public/uploads/tmp/1500988554-66315-0004-6099/style.css +0 -1
  175. data/spec/internal/public/uploads/tmp/1500988554-66315-0007-1632/style.css +0 -1
  176. data/spec/internal/public/uploads/tmp/1500991751-73722-0002-9937/avatar.jpg +0 -0
  177. data/spec/internal/public/uploads/tmp/1500991751-73722-0004-8034/style.css +0 -1
  178. data/spec/internal/public/uploads/tmp/1500991751-73722-0007-7763/style.css +0 -1
  179. data/spec/internal/public/uploads/tmp/1501233238-34385-0002-3210/avatar.jpg +0 -0
  180. data/spec/internal/public/uploads/tmp/1501233238-34385-0004-5881/style.css +0 -1
  181. data/spec/internal/public/uploads/tmp/1501233238-34385-0007-6280/style.css +0 -1
  182. data/spec/internal/tmp/cache/assets/test/sprockets/v3.0/1XyAFYlYI0pK7WAgjR4PgXV6BgU6huJSviWmHetdCRs.cache +0 -1
  183. data/vendor/assets/bower_components/angular-ui-router/api/angular-ui-router.d.ts +0 -126
  184. data/vendor/assets/bower_components/angular-ui-router/src/common.js +0 -292
  185. data/vendor/assets/bower_components/angular-ui-router/src/resolve.js +0 -252
  186. data/vendor/assets/bower_components/angular-ui-router/src/state.js +0 -1373
  187. data/vendor/assets/bower_components/angular-ui-router/src/stateDirectives.js +0 -268
  188. data/vendor/assets/bower_components/angular-ui-router/src/stateFilters.js +0 -39
  189. data/vendor/assets/bower_components/angular-ui-router/src/templateFactory.js +0 -110
  190. data/vendor/assets/bower_components/angular-ui-router/src/urlMatcherFactory.js +0 -1036
  191. data/vendor/assets/bower_components/angular-ui-router/src/urlRouter.js +0 -413
  192. data/vendor/assets/bower_components/angular-ui-router/src/view.js +0 -71
  193. data/vendor/assets/bower_components/angular-ui-router/src/viewDirective.js +0 -302
  194. data/vendor/assets/bower_components/angular-ui-router/src/viewScroll.js +0 -52
  195. data/vendor/assets/bower_components/angularjs-dropdown-multiselect/pages/index.html +0 -67
  196. data/vendor/assets/bower_components/bootstrap/Gemfile.lock +0 -43
@@ -1,5 +1,38 @@
1
1
  Changelog
2
2
  ==========
3
+ ## 0.9.0
4
+ - resolved issue with parentSelector when parent has no children
5
+ ([#244](https://github.com/chieffancypants/angular-loading-bar/pull/244))
6
+ ([#251](https://github.com/chieffancypants/angular-loading-bar/issues/251))
7
+ ([#239](https://github.com/chieffancypants/angular-loading-bar/issues/239))
8
+ ([#179](https://github.com/chieffancypants/angular-loading-bar/issues/179))
9
+ - added style property to package.json
10
+ ([#271](https://github.com/chieffancypants/angular-loading-bar/pull/271))
11
+ ([#231](https://github.com/chieffancypants/angular-loading-bar/pull/231))
12
+ - Removed duplicated property declaration in CSS
13
+ ([#226](https://github.com/chieffancypants/angular-loading-bar/pull/226))
14
+
15
+
16
+
17
+ ## 0.8.0
18
+ - auto incrementing is now configurable
19
+ ([#209](https://github.com/chieffancypants/angular-loading-bar/pull/209))
20
+ - removed `version` from bower.json
21
+ ([#207](https://github.com/chieffancypants/angular-loading-bar/pull/207))
22
+ - added support for webpack and browserify
23
+ ([#200](https://github.com/chieffancypants/angular-loading-bar/pull/200))
24
+ - spinner border radius 10px -> 50%
25
+ ([#184](https://github.com/chieffancypants/angular-loading-bar/issues/184))
26
+
27
+
28
+ ## 0.7.1
29
+ - Merge correct PR for broken interceptor detection ([#133](https://github.com/chieffancypants/angular-loading-bar/pull/133), [#50](https://github.com/chieffancypants/angular-loading-bar/pull/50))
30
+
31
+ ## 0.7.0
32
+ - Changes for animate.enter compatibility for 1.2 and 1.3 ([#170](https://github.com/chieffancypants/angular-loading-bar/pull/170))
33
+ - Detect errors with other interceptors ([#133](https://github.com/chieffancypants/angular-loading-bar/pull/133), [#50](https://github.com/chieffancypants/angular-loading-bar/pull/50))
34
+ - Provide more detail on response/responseError events ([#128](https://github.com/chieffancypants/angular-loading-bar/pull/128))
35
+ - Change angular dependency in bower ([#126](https://github.com/chieffancypants/angular-loading-bar/issues/126))
3
36
 
4
37
  ## 0.6.0
5
38
  - Customize progress bar template: ([#111](https://github.com/chieffancypants/angular-loading-bar/pull/111))
@@ -0,0 +1,17 @@
1
+ ### Submitting a PR
2
+ Excellent! You've chosen to help advance the project by either fixing a bug, or implementing a new feature. Before you put forth any work on a PR, please follow these steps:
3
+
4
+ 1. Ensure a similar PR has not already been opened or closed.
5
+ 1. Clearly define the intent of the PR. The more detail, the more likelihood of it getting merged.
6
+ 1. Is this a feature that would benefit the **majority** of users? This is a small library, and it intends to stay that way. If you do not believe most users of the project will benefit from your work, it should probably be added in your own application.
7
+ 1. Be sure to include test cases that cover all newly introduced code. This part is essential, as any PRs without tests will be closed.
8
+ 1. Link any [issues](https://github.com/chieffancypants/angular-loading-bar/issues) that are addressed by the PR.
9
+
10
+ ### Submitting a bug report
11
+ If you believe you've found a bug in the source code, and are unable to fix it yourself (by submitting a PR) please follow these steps:
12
+
13
+ 1. Ensure the bug has not already been reported by searching the [issues](https://github.com/chieffancypants/angular-loading-bar/issues)
14
+ 1. Submit a reduced test case that clearly demonstrates the bug. This means submitting a plunker or jsfiddle with the bare minimum of code necessary to reproduce the bug. Without this, your issue may be closed as invalid.
15
+ 1. Include any relevant browser information
16
+ 1. If you're unable to fix this bug yourself, but can point to why it is occuring, please send that information along (line# or commit)
17
+
@@ -51,6 +51,14 @@ module.exports = function(grunt) {
51
51
  dir: 'coverage/'
52
52
  }
53
53
  },
54
+ unit14: {
55
+ configFile: 'test/karma-angular-1.4.conf.js',
56
+ singleRun: true,
57
+ coverageReporter: {
58
+ type: 'text',
59
+ dir: 'coverage/'
60
+ }
61
+ },
54
62
  watch: {
55
63
  configFile: 'test/karma-angular-1.2.conf.js',
56
64
  singleRun: false,
@@ -87,7 +95,7 @@ module.exports = function(grunt) {
87
95
  grunt.loadNpmTasks('grunt-contrib-concat');
88
96
  grunt.loadNpmTasks('grunt-karma');
89
97
 
90
- grunt.registerTask('default', ['jshint', 'karma:unit', 'karma:unit13', 'uglify', 'cssmin', 'concat:build']);
98
+ grunt.registerTask('default', ['jshint', 'karma:unit', 'karma:unit13', 'karma:unit14', 'uglify', 'cssmin', 'concat:build']);
91
99
  grunt.registerTask('test', ['karma:watch']);
92
100
  grunt.registerTask('build', ['default']);
93
101
 
@@ -0,0 +1,14 @@
1
+ #### Description of bug:
2
+
3
+
4
+ #### Expected result:
5
+
6
+
7
+ #### Actual result:
8
+
9
+
10
+ #### Browsers affected:
11
+
12
+
13
+ #### URL of reduced test case:
14
+
@@ -0,0 +1,13 @@
1
+ #### Summary:
2
+
3
+ Provide a general description of the code changes in your pull
4
+ request. If bugs were fixed, please document the changes and why
5
+ they were introduced.
6
+
7
+ Please ensure that your PR contains test cases that cover all new
8
+ code and any changes to existing code. Without tests, your PR is
9
+ likely to be closed without merging.
10
+
11
+ #### Related issues:
12
+ Please review the [issues](https://github.com/chieffancypants/angular-loading-bar/issues)
13
+ page, and link any issues that are addressed or related to this PR.
@@ -18,7 +18,13 @@ This is mostly cool because you simply include it in your app, and it works. Th
18
18
  angular.module('myApp', ['angular-loading-bar', 'ngAnimate'])
19
19
  ```
20
20
 
21
- 2. include the supplied CSS file (or create your own).
21
+ 2. include the supplied JS and CSS file (or create your own CSS to override defaults).
22
+
23
+ ```html
24
+ <link rel='stylesheet' href='build/loading-bar.min.css' type='text/css' media='all' />
25
+ <script type='text/javascript' src='build/loading-bar.min.js'></script>
26
+ ```
27
+
22
28
  3. That's it -- you're done!
23
29
 
24
30
  #### via bower:
@@ -30,9 +36,14 @@ $ bower install angular-loading-bar
30
36
  $ npm install angular-loading-bar
31
37
  ```
32
38
 
39
+ #### via CDN:
40
+ ```html
41
+ <link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/angular-loading-bar/0.7.1/loading-bar.min.css' type='text/css' media='all' />
42
+ <script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/angular-loading-bar/0.7.1/loading-bar.min.js'></script>
43
+ ```
33
44
 
34
45
  ## Why I created this
35
- There are a couple projects similar to this out there, but none were ideal for me. All implementations I've seen require that you maintain state on behalf of the loading bar. In other words, you're setting the value of the loading/progress bar manually from potentially many different locations. This becomes complicated when you have a very large application with several services all making independant XHR requests. It becomes even more complicated if you want these services to be loosly coupled.
46
+ There are a couple projects similar to this out there, but none were ideal for me. All implementations I've seen require that you maintain state on behalf of the loading bar. In other words, you're setting the value of the loading/progress bar manually from potentially many different locations. This becomes complicated when you have a very large application with several services all making independent XHR requests. It becomes even more complicated if you want these services to be loosly coupled.
36
47
 
37
48
  Additionally, Angular was created as a highly testable framework, so it pains me to see Angular modules without tests. That is not the case here as this loading bar ships with 100% code coverage.
38
49
 
@@ -68,6 +79,16 @@ angular.module('myApp', ['angular-loading-bar'])
68
79
  }])
69
80
  ```
70
81
 
82
+ #### Customize the template:
83
+ If you'd like to replace the default HTML template you can configure it by providing inline HTML as a string:
84
+
85
+ ```js
86
+ angular.module('myApp', ['angular-loading-bar'])
87
+ .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
88
+ cfpLoadingBarProvider.spinnerTemplate = '<div><span class="fa fa-spinner">Loading...</div>';
89
+ }])
90
+ ```
91
+
71
92
  #### Latency Threshold
72
93
  By default, the loading bar will only display after it has been waiting for a response for over 100ms. This helps keep things feeling snappy, and avoids the annoyingness of showing a loading bar every few seconds on really chatty applications. This threshold is totally configurable:
73
94
 
@@ -82,11 +103,17 @@ angular.module('myApp', ['angular-loading-bar'])
82
103
  The loading bar can also be forced to ignore certain requests, for example, when long-polling or periodically sending debugging information back to the server.
83
104
 
84
105
  ```js
85
- // ignore particular $http requests:
106
+ // ignore a particular $http GET:
86
107
  $http.get('/status', {
87
108
  ignoreLoadingBar: true
88
109
  });
89
110
 
111
+ // ignore a particular $http POST. Note: POST and GET have different
112
+ // method signatures:
113
+ $http.post('/save', data, {
114
+ ignoreLoadingBar: true
115
+ });
116
+
90
117
  ```
91
118
 
92
119
 
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "angular-loading-bar",
3
- "version": "0.6.0",
4
3
  "main": [
5
4
  "build/loading-bar.js",
6
5
  "build/loading-bar.css"
@@ -12,15 +11,21 @@
12
11
  "test",
13
12
  "example"
14
13
  ],
14
+ "dependencies": {
15
+ "angular": "^1.2.9"
16
+ },
15
17
  "devDependencies": {
16
- "angular": "^1.2.9",
18
+ "angular": "~1.2.23",
17
19
  "angular-1.3": "angular#1.3",
18
- "angular-mocks": "^1.2.9",
20
+ "angular-1.4": "angular#1.4",
21
+ "angular-mocks": "~1.2.9",
19
22
  "angular-mocks-1.3": "angular-mocks#1.3",
20
- "angular-animate": "^1.2.9",
21
- "angular-animate-1.3": "angular-animate#1.3"
23
+ "angular-mocks-1.4": "angular-mocks#1.4",
24
+ "angular-animate": "~1.2.9",
25
+ "angular-animate-1.3": "angular-animate#1.3",
26
+ "angular-animate-1.4": "angular-animate#1.4"
22
27
  },
23
28
  "resolutions": {
24
- "angular": "1.2.23"
29
+ "angular": "~1.2.23"
25
30
  }
26
31
  }
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * angular-loading-bar v0.6.0
2
+ * angular-loading-bar v0.9.0
3
3
  * https://chieffancypants.github.io/angular-loading-bar
4
- * Copyright (c) 2014 Wes Cruver
4
+ * Copyright (c) 2016 Wes Cruver
5
5
  * License: MIT
6
6
  */
7
7
 
@@ -79,7 +79,7 @@
79
79
  border: solid 2px transparent;
80
80
  border-top-color: #29d;
81
81
  border-left-color: #29d;
82
- border-radius: 10px;
82
+ border-radius: 50%;
83
83
 
84
84
  -webkit-animation: loading-bar-spinner 400ms linear infinite;
85
85
  -moz-animation: loading-bar-spinner 400ms linear infinite;
@@ -105,6 +105,6 @@
105
105
  100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
106
106
  }
107
107
  @keyframes loading-bar-spinner {
108
- 0% { transform: rotate(0deg); transform: rotate(0deg); }
109
- 100% { transform: rotate(360deg); transform: rotate(360deg); }
108
+ 0% { transform: rotate(0deg); }
109
+ 100% { transform: rotate(360deg); }
110
110
  }
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * angular-loading-bar v0.6.0
2
+ * angular-loading-bar v0.9.0
3
3
  * https://chieffancypants.github.io/angular-loading-bar
4
- * Copyright (c) 2014 Wes Cruver
4
+ * Copyright (c) 2016 Wes Cruver
5
5
  * License: MIT
6
6
  */
7
7
  /*
@@ -32,7 +32,7 @@ angular.module('chieffancypants.loadingBar', ['cfp.loadingBarInterceptor']);
32
32
  angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
33
33
  .config(['$httpProvider', function ($httpProvider) {
34
34
 
35
- var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, cfpLoadingBar) {
35
+ var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, $log, cfpLoadingBar) {
36
36
 
37
37
  /**
38
38
  * The total number of requests made
@@ -113,9 +113,14 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
113
113
  },
114
114
 
115
115
  'response': function(response) {
116
+ if (!response || !response.config) {
117
+ $log.error('Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50');
118
+ return response;
119
+ }
120
+
116
121
  if (!response.config.ignoreLoadingBar && !isCached(response.config)) {
117
122
  reqsCompleted++;
118
- $rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url});
123
+ $rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response});
119
124
  if (reqsCompleted >= reqsTotal) {
120
125
  setComplete();
121
126
  } else {
@@ -126,9 +131,14 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
126
131
  },
127
132
 
128
133
  'responseError': function(rejection) {
134
+ if (!rejection || !rejection.config) {
135
+ $log.error('Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50');
136
+ return $q.reject(rejection);
137
+ }
138
+
129
139
  if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) {
130
140
  reqsCompleted++;
131
- $rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url});
141
+ $rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection});
132
142
  if (reqsCompleted >= reqsTotal) {
133
143
  setComplete();
134
144
  } else {
@@ -156,6 +166,7 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
156
166
  angular.module('cfp.loadingBar', [])
157
167
  .provider('cfpLoadingBar', function() {
158
168
 
169
+ this.autoIncrement = true;
159
170
  this.includeSpinner = true;
160
171
  this.includeBar = true;
161
172
  this.latencyThreshold = 100;
@@ -176,6 +187,7 @@ angular.module('cfp.loadingBar', [])
176
187
  started = false,
177
188
  status = 0;
178
189
 
190
+ var autoIncrement = this.autoIncrement;
179
191
  var includeSpinner = this.includeSpinner;
180
192
  var includeBar = this.includeBar;
181
193
  var startSize = this.startSize;
@@ -188,7 +200,6 @@ angular.module('cfp.loadingBar', [])
188
200
  $animate = $injector.get('$animate');
189
201
  }
190
202
 
191
- var $parent = $document.find($parentSelector).eq(0);
192
203
  $timeout.cancel(completeTimeout);
193
204
 
194
205
  // do not continually broadcast the started event:
@@ -196,15 +207,28 @@ angular.module('cfp.loadingBar', [])
196
207
  return;
197
208
  }
198
209
 
210
+ var document = $document[0];
211
+ var parent = document.querySelector ?
212
+ document.querySelector($parentSelector)
213
+ : $document.find($parentSelector)[0]
214
+ ;
215
+
216
+ if (! parent) {
217
+ parent = document.getElementsByTagName('body')[0];
218
+ }
219
+
220
+ var $parent = angular.element(parent);
221
+ var $after = parent.lastChild && angular.element(parent.lastChild);
222
+
199
223
  $rootScope.$broadcast('cfpLoadingBar:started');
200
224
  started = true;
201
225
 
202
226
  if (includeBar) {
203
- $animate.enter(loadingBarContainer, $parent);
227
+ $animate.enter(loadingBarContainer, $parent, $after);
204
228
  }
205
229
 
206
230
  if (includeSpinner) {
207
- $animate.enter(spinner, $parent);
231
+ $animate.enter(spinner, $parent, loadingBarContainer);
208
232
  }
209
233
 
210
234
  _set(startSize);
@@ -226,10 +250,12 @@ angular.module('cfp.loadingBar', [])
226
250
  // increment loadingbar to give the illusion that there is always
227
251
  // progress but make sure to cancel the previous timeouts so we don't
228
252
  // have multiple incs running at the same time.
229
- $timeout.cancel(incTimeout);
230
- incTimeout = $timeout(function() {
231
- _inc();
232
- }, 250);
253
+ if (autoIncrement) {
254
+ $timeout.cancel(incTimeout);
255
+ incTimeout = $timeout(function() {
256
+ _inc();
257
+ }, 250);
258
+ }
233
259
  }
234
260
 
235
261
  /**
@@ -302,6 +328,7 @@ angular.module('cfp.loadingBar', [])
302
328
  status : _status,
303
329
  inc : _inc,
304
330
  complete : _complete,
331
+ autoIncrement : this.autoIncrement,
305
332
  includeSpinner : this.includeSpinner,
306
333
  latencyThreshold : this.latencyThreshold,
307
334
  parentSelector : this.parentSelector,
@@ -1,8 +1 @@
1
- /*!
2
- * angular-loading-bar v0.6.0
3
- * https://chieffancypants.github.io/angular-loading-bar
4
- * Copyright (c) 2014 Wes Cruver
5
- * License: MIT
6
- */
7
-
8
- #loading-bar,#loading-bar-spinner{pointer-events:none;-webkit-pointer-events:none;-webkit-transition:350ms linear all;-moz-transition:350ms linear all;-o-transition:350ms linear all;transition:350ms linear all}#loading-bar.ng-enter,#loading-bar.ng-leave.ng-leave-active,#loading-bar-spinner.ng-enter,#loading-bar-spinner.ng-leave.ng-leave-active{opacity:0}#loading-bar.ng-enter.ng-enter-active,#loading-bar.ng-leave,#loading-bar-spinner.ng-enter.ng-enter-active,#loading-bar-spinner.ng-leave{opacity:1}#loading-bar .bar{-webkit-transition:width 350ms;-moz-transition:width 350ms;-o-transition:width 350ms;transition:width 350ms;background:#29d;position:fixed;z-index:10002;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}#loading-bar .peg{position:absolute;width:70px;right:0;top:0;height:2px;opacity:.45;-moz-box-shadow:#29d 1px 0 6px 1px;-ms-box-shadow:#29d 1px 0 6px 1px;-webkit-box-shadow:#29d 1px 0 6px 1px;box-shadow:#29d 1px 0 6px 1px;-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}#loading-bar-spinner{display:block;position:fixed;z-index:10002;top:10px;left:10px}#loading-bar-spinner .spinner-icon{width:14px;height:14px;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:10px;-webkit-animation:loading-bar-spinner 400ms linear infinite;-moz-animation:loading-bar-spinner 400ms linear infinite;-ms-animation:loading-bar-spinner 400ms linear infinite;-o-animation:loading-bar-spinner 400ms linear infinite;animation:loading-bar-spinner 400ms linear infinite}@-webkit-keyframes loading-bar-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes loading-bar-spinner{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes loading-bar-spinner{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes loading-bar-spinner{0%{-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0deg);transform:rotate(0deg)}100%{transform:rotate(360deg);transform:rotate(360deg)}}
1
+ #loading-bar,#loading-bar-spinner{pointer-events:none;-webkit-pointer-events:none;-webkit-transition:350ms linear all;-moz-transition:350ms linear all;-o-transition:350ms linear all;transition:350ms linear all}#loading-bar-spinner.ng-enter,#loading-bar-spinner.ng-leave.ng-leave-active,#loading-bar.ng-enter,#loading-bar.ng-leave.ng-leave-active{opacity:0}#loading-bar-spinner.ng-enter.ng-enter-active,#loading-bar-spinner.ng-leave,#loading-bar.ng-enter.ng-enter-active,#loading-bar.ng-leave{opacity:1}#loading-bar .bar{-webkit-transition:width 350ms;-moz-transition:width 350ms;-o-transition:width 350ms;transition:width 350ms;background:#29d;position:fixed;z-index:10002;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}#loading-bar .peg{position:absolute;width:70px;right:0;top:0;height:2px;opacity:.45;-moz-box-shadow:#29d 1px 0 6px 1px;-ms-box-shadow:#29d 1px 0 6px 1px;-webkit-box-shadow:#29d 1px 0 6px 1px;box-shadow:#29d 1px 0 6px 1px;-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}#loading-bar-spinner{display:block;position:fixed;z-index:10002;top:10px;left:10px}#loading-bar-spinner .spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:loading-bar-spinner 400ms linear infinite;-moz-animation:loading-bar-spinner 400ms linear infinite;-ms-animation:loading-bar-spinner 400ms linear infinite;-o-animation:loading-bar-spinner 400ms linear infinite;animation:loading-bar-spinner 400ms linear infinite}@-webkit-keyframes loading-bar-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes loading-bar-spinner{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes loading-bar-spinner{0%{-o-transform:rotate(0);transform:rotate(0)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes loading-bar-spinner{0%{-ms-transform:rotate(0);transform:rotate(0)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * angular-loading-bar v0.6.0
2
+ * angular-loading-bar v0.9.0
3
3
  * https://chieffancypants.github.io/angular-loading-bar
4
- * Copyright (c) 2014 Wes Cruver
4
+ * Copyright (c) 2016 Wes Cruver
5
5
  * License: MIT
6
6
  */
7
- !function(){"use strict";angular.module("angular-loading-bar",["cfp.loadingBarInterceptor"]),angular.module("chieffancypants.loadingBar",["cfp.loadingBarInterceptor"]),angular.module("cfp.loadingBarInterceptor",["cfp.loadingBar"]).config(["$httpProvider",function(a){var b=["$q","$cacheFactory","$timeout","$rootScope","cfpLoadingBar",function(b,c,d,e,f){function g(){d.cancel(i),f.complete(),k=0,j=0}function h(b){var d,e=c.get("$http"),f=a.defaults;!b.cache&&!f.cache||b.cache===!1||"GET"!==b.method&&"JSONP"!==b.method||(d=angular.isObject(b.cache)?b.cache:angular.isObject(f.cache)?f.cache:e);var g=void 0!==d?void 0!==d.get(b.url):!1;return void 0!==b.cached&&g!==b.cached?b.cached:(b.cached=g,g)}var i,j=0,k=0,l=f.latencyThreshold;return{request:function(a){return a.ignoreLoadingBar||h(a)||(e.$broadcast("cfpLoadingBar:loading",{url:a.url}),0===j&&(i=d(function(){f.start()},l)),j++,f.set(k/j)),a},response:function(a){return a.config.ignoreLoadingBar||h(a.config)||(k++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url}),k>=j?g():f.set(k/j)),a},responseError:function(a){return a.config.ignoreLoadingBar||h(a.config)||(k++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url}),k>=j?g():f.set(k/j)),b.reject(a)}}}];a.interceptors.push(b)}]),angular.module("cfp.loadingBar",[]).provider("cfpLoadingBar",function(){this.includeSpinner=!0,this.includeBar=!0,this.latencyThreshold=100,this.startSize=.02,this.parentSelector="body",this.spinnerTemplate='<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>',this.loadingBarTemplate='<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>',this.$get=["$injector","$document","$timeout","$rootScope",function(a,b,c,d){function e(){k||(k=a.get("$animate"));var e=b.find(n).eq(0);c.cancel(m),r||(d.$broadcast("cfpLoadingBar:started"),r=!0,u&&k.enter(o,e),t&&k.enter(q,e),f(v))}function f(a){if(r){var b=100*a+"%";p.css("width",b),s=a,c.cancel(l),l=c(function(){g()},250)}}function g(){if(!(h()>=1)){var a=0,b=h();a=b>=0&&.25>b?(3*Math.random()+3)/100:b>=.25&&.65>b?3*Math.random()/100:b>=.65&&.9>b?2*Math.random()/100:b>=.9&&.99>b?.005:0;var c=h()+a;f(c)}}function h(){return s}function i(){s=0,r=!1}function j(){k||(k=a.get("$animate")),d.$broadcast("cfpLoadingBar:completed"),f(1),c.cancel(m),m=c(function(){var a=k.leave(o,i);a&&a.then&&a.then(i),k.leave(q)},500)}var k,l,m,n=this.parentSelector,o=angular.element(this.loadingBarTemplate),p=o.find("div").eq(0),q=angular.element(this.spinnerTemplate),r=!1,s=0,t=this.includeSpinner,u=this.includeBar,v=this.startSize;return{start:e,set:f,status:h,inc:g,complete:j,includeSpinner:this.includeSpinner,latencyThreshold:this.latencyThreshold,parentSelector:this.parentSelector,startSize:this.startSize}}]})}();
7
+ !function(){"use strict";angular.module("angular-loading-bar",["cfp.loadingBarInterceptor"]),angular.module("chieffancypants.loadingBar",["cfp.loadingBarInterceptor"]),angular.module("cfp.loadingBarInterceptor",["cfp.loadingBar"]).config(["$httpProvider",function(a){var b=["$q","$cacheFactory","$timeout","$rootScope","$log","cfpLoadingBar",function(b,c,d,e,f,g){function h(){d.cancel(j),g.complete(),l=0,k=0}function i(b){var d,e=c.get("$http"),f=a.defaults;!b.cache&&!f.cache||b.cache===!1||"GET"!==b.method&&"JSONP"!==b.method||(d=angular.isObject(b.cache)?b.cache:angular.isObject(f.cache)?f.cache:e);var g=void 0!==d?void 0!==d.get(b.url):!1;return void 0!==b.cached&&g!==b.cached?b.cached:(b.cached=g,g)}var j,k=0,l=0,m=g.latencyThreshold;return{request:function(a){return a.ignoreLoadingBar||i(a)||(e.$broadcast("cfpLoadingBar:loading",{url:a.url}),0===k&&(j=d(function(){g.start()},m)),k++,g.set(l/k)),a},response:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),l>=k?h():g.set(l/k)),a):(f.error("Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),a)},responseError:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),l>=k?h():g.set(l/k)),b.reject(a)):(f.error("Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),b.reject(a))}}}];a.interceptors.push(b)}]),angular.module("cfp.loadingBar",[]).provider("cfpLoadingBar",function(){this.autoIncrement=!0,this.includeSpinner=!0,this.includeBar=!0,this.latencyThreshold=100,this.startSize=.02,this.parentSelector="body",this.spinnerTemplate='<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>',this.loadingBarTemplate='<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>',this.$get=["$injector","$document","$timeout","$rootScope",function(a,b,c,d){function e(){if(k||(k=a.get("$animate")),c.cancel(m),!r){var e=b[0],g=e.querySelector?e.querySelector(n):b.find(n)[0];g||(g=e.getElementsByTagName("body")[0]);var h=angular.element(g),i=g.lastChild&&angular.element(g.lastChild);d.$broadcast("cfpLoadingBar:started"),r=!0,v&&k.enter(o,h,i),u&&k.enter(q,h,o),f(w)}}function f(a){if(r){var b=100*a+"%";p.css("width",b),s=a,t&&(c.cancel(l),l=c(function(){g()},250))}}function g(){if(!(h()>=1)){var a=0,b=h();a=b>=0&&.25>b?(3*Math.random()+3)/100:b>=.25&&.65>b?3*Math.random()/100:b>=.65&&.9>b?2*Math.random()/100:b>=.9&&.99>b?.005:0;var c=h()+a;f(c)}}function h(){return s}function i(){s=0,r=!1}function j(){k||(k=a.get("$animate")),d.$broadcast("cfpLoadingBar:completed"),f(1),c.cancel(m),m=c(function(){var a=k.leave(o,i);a&&a.then&&a.then(i),k.leave(q)},500)}var k,l,m,n=this.parentSelector,o=angular.element(this.loadingBarTemplate),p=o.find("div").eq(0),q=angular.element(this.spinnerTemplate),r=!1,s=0,t=this.autoIncrement,u=this.includeSpinner,v=this.includeBar,w=this.startSize;return{start:e,set:f,status:h,inc:g,complete:j,autoIncrement:this.autoIncrement,includeSpinner:this.includeSpinner,latencyThreshold:this.latencyThreshold,parentSelector:this.parentSelector,startSize:this.startSize}}]})}();
@@ -0,0 +1,2 @@
1
+ require('./build/loading-bar');
2
+ module.exports = 'angular-loading-bar';
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "angular-loading-bar",
3
- "version": "0.6.0",
3
+ "version": "0.9.0",
4
4
  "description": "An automatic loading bar for AngularJS",
5
- "main": "src/loading-bar.js",
5
+ "main": "index.js",
6
+ "style": "build/loading-bar.css",
6
7
  "directories": {
7
8
  "example": "example",
8
9
  "test": "test"
@@ -26,20 +27,16 @@
26
27
  },
27
28
  "homepage": "https://chieffancypants.github.io/angular-loading-bar",
28
29
  "devDependencies": {
29
- "karma-script-launcher": "~0.1.0",
30
- "karma-chrome-launcher": "~0.1.0",
31
- "karma-firefox-launcher": "~0.1.0",
32
- "karma-html2js-preprocessor": "~0.1.0",
33
- "karma-jasmine": "~0.1.3",
34
- "karma-coffee-preprocessor": "~0.1.0",
35
- "karma-phantomjs-launcher": "~0.1.0",
36
- "karma": "~0.10.2",
37
- "karma-coverage": "~0.1.0",
30
+ "karma-jasmine": "^0.1.3",
31
+ "karma-coffee-preprocessor": "^0.2.0",
32
+ "karma-phantomjs-launcher": "^0.1.0",
33
+ "karma": "~0.12.0",
34
+ "karma-coverage": "^0.1.0",
38
35
  "grunt": "~0.4.1",
39
36
  "grunt-contrib-jshint": "~0.6.4",
40
- "grunt-contrib-uglify": "~0.2.4",
41
- "grunt-contrib-cssmin": "~0.6.1",
42
- "grunt-karma": "~0.6.2",
43
- "grunt-contrib-concat": "~0.3.0"
37
+ "grunt-contrib-uglify": "^0.9.1",
38
+ "grunt-contrib-cssmin": "~0.12.0",
39
+ "grunt-karma": "~0.11.0",
40
+ "grunt-contrib-concat": "^0.5.0"
44
41
  }
45
42
  }
@@ -73,7 +73,7 @@
73
73
  border: solid 2px transparent;
74
74
  border-top-color: #29d;
75
75
  border-left-color: #29d;
76
- border-radius: 10px;
76
+ border-radius: 50%;
77
77
 
78
78
  -webkit-animation: loading-bar-spinner 400ms linear infinite;
79
79
  -moz-animation: loading-bar-spinner 400ms linear infinite;
@@ -99,6 +99,6 @@
99
99
  100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
100
100
  }
101
101
  @keyframes loading-bar-spinner {
102
- 0% { transform: rotate(0deg); transform: rotate(0deg); }
103
- 100% { transform: rotate(360deg); transform: rotate(360deg); }
102
+ 0% { transform: rotate(0deg); }
103
+ 100% { transform: rotate(360deg); }
104
104
  }