├── .bowerrc ├── .gitignore ├── .jshintrc ├── .travis.yml ├── Gruntfile.js ├── LICENSE ├── README.md ├── angular-busy.css ├── angular-busy.html ├── angular-busy.js ├── bower.json ├── bower_components ├── angular-animate │ ├── .bower.json │ ├── README.md │ ├── angular-animate.js │ ├── angular-animate.min.js │ ├── angular-animate.min.js.map │ ├── bower.json │ └── package.json ├── angular-mocks │ ├── .bower.json │ ├── README.md │ ├── angular-mocks.js │ ├── bower.json │ └── package.json ├── angular │ ├── .bower.json │ ├── README.md │ ├── angular-csp.css │ ├── angular.js │ ├── angular.min.js │ ├── angular.min.js.gzip │ ├── angular.min.js.map │ ├── bower.json │ └── package.json └── jquery │ ├── .bower.json │ ├── MIT-LICENSE.txt │ ├── bower.json │ ├── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map │ └── src │ ├── ajax.js │ ├── ajax │ ├── jsonp.js │ ├── load.js │ ├── parseJSON.js │ ├── parseXML.js │ ├── script.js │ ├── var │ │ ├── nonce.js │ │ └── rquery.js │ └── xhr.js │ ├── attributes.js │ ├── attributes │ ├── attr.js │ ├── classes.js │ ├── prop.js │ ├── support.js │ └── val.js │ ├── callbacks.js │ ├── core.js │ ├── core │ ├── access.js │ ├── init.js │ ├── parseHTML.js │ ├── ready.js │ └── var │ │ └── rsingleTag.js │ ├── css.js │ ├── css │ ├── addGetHookIf.js │ ├── curCSS.js │ ├── defaultDisplay.js │ ├── hiddenVisibleSelectors.js │ ├── support.js │ ├── swap.js │ └── var │ │ ├── cssExpand.js │ │ ├── getStyles.js │ │ ├── isHidden.js │ │ ├── rmargin.js │ │ └── rnumnonpx.js │ ├── data.js │ ├── data │ ├── Data.js │ ├── accepts.js │ └── var │ │ ├── data_priv.js │ │ └── data_user.js │ ├── deferred.js │ ├── deprecated.js │ ├── dimensions.js │ ├── effects.js │ ├── effects │ ├── Tween.js │ └── animatedSelector.js │ ├── event.js │ ├── event │ ├── alias.js │ └── support.js │ ├── exports │ ├── amd.js │ └── global.js │ ├── intro.js │ ├── jquery.js │ ├── manipulation.js │ ├── manipulation │ ├── _evalUrl.js │ ├── support.js │ └── var │ │ └── rcheckableType.js │ ├── offset.js │ ├── outro.js │ ├── queue.js │ ├── queue │ └── delay.js │ ├── selector-native.js │ ├── selector-sizzle.js │ ├── selector.js │ ├── serialize.js │ ├── sizzle │ └── dist │ │ ├── sizzle.js │ │ ├── sizzle.min.js │ │ └── sizzle.min.map │ ├── traversing.js │ ├── traversing │ ├── findFilter.js │ └── var │ │ └── rneedsContext.js │ ├── var │ ├── arr.js │ ├── class2type.js │ ├── concat.js │ ├── hasOwn.js │ ├── indexOf.js │ ├── pnum.js │ ├── push.js │ ├── rnotwhite.js │ ├── slice.js │ ├── strundefined.js │ ├── support.js │ └── toString.js │ └── wrap.js ├── demo ├── custom-template.html ├── demo.js ├── finalfantasy.gif ├── gh-fork-ribbon.css └── index.html ├── dist ├── angular-busy.css ├── angular-busy.js ├── angular-busy.min.css ├── angular-busy.min.js └── index.js ├── index.js ├── package.json └── test └── spec.js /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | 16 | node_modules 17 | .DS_Store 18 | 19 | temp 20 | 21 | _SpecRunner.html 22 | 23 | .grunt -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "boss": true, 11 | "eqnull": true, 12 | "browser": true, 13 | "smarttabs": true, 14 | "globals": { 15 | "jQuery": true, 16 | "angular": true, 17 | "console": true, 18 | "$": true, 19 | "_": true, 20 | "moment": true, 21 | "describe": true, 22 | "beforeEach": true, 23 | "module": true, 24 | "inject": true, 25 | "it": true, 26 | "expect": true 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | before_script: 5 | - "npm install -g grunt-cli" -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (grunt) { 4 | 5 | require('load-grunt-tasks')(grunt); 6 | 7 | grunt.initConfig({ 8 | connect: { 9 | main: { 10 | options: { 11 | port: 9001 12 | } 13 | } 14 | }, 15 | watch: { 16 | main: { 17 | options: { 18 | livereload: true, 19 | livereloadOnError: false, 20 | spawn: false 21 | }, 22 | files: ['angular-busy.html','angular-busy.js','angular-busy.css','dist/**/*','demo/**/*'], 23 | tasks: ['jshint','build'] 24 | } 25 | }, 26 | jshint: { 27 | main: { 28 | options: { 29 | jshintrc: '.jshintrc' 30 | }, 31 | src: 'angular-busy.js' 32 | } 33 | }, 34 | jasmine: { 35 | unit: { 36 | src: ['./bower_components/jquery/dist/jquery.js','./bower_components/angular/angular.js','./bower_components/angular-animate/angular-animate.js','./bower_components/angular-mocks/angular-mocks.js','./dist/angular-busy.js','./demo/demo.js'], 37 | options: { 38 | specs: 'test/*.js' 39 | } 40 | } 41 | }, 42 | ngtemplates: { 43 | main: { 44 | options: { 45 | module:'cgBusy', 46 | base:'' 47 | }, 48 | src:'angular-busy.html', 49 | dest: 'temp/templates.js' 50 | } 51 | }, 52 | concat: { 53 | main: { 54 | src: ['angular-busy.js', 'temp/templates.js'], 55 | dest: 'dist/angular-busy.js' 56 | } 57 | }, 58 | copy: { 59 | main: { 60 | files: [ 61 | {src:'angular-busy.css',dest:'dist/'}, 62 | {src:'index.js',dest:'dist/'} 63 | ] 64 | } 65 | }, 66 | uglify: { 67 | main: { 68 | files: [ 69 | {src:'dist/angular-busy.js',dest:'dist/angular-busy.min.js'} 70 | ] 71 | } 72 | }, 73 | cssmin: { 74 | main: { 75 | files: { 76 | 'dist/angular-busy.min.css': 'dist/angular-busy.css' 77 | } 78 | } 79 | } 80 | }); 81 | 82 | grunt.registerTask('serve', ['jshint','connect', 'watch']); 83 | grunt.registerTask('build',['ngtemplates','concat','uglify','copy','cssmin']); 84 | grunt.registerTask('test',['build','jasmine']); 85 | 86 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Chris Gross 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular-busy [![Build Status](https://travis-ci.org/cgross/angular-busy.png?branch=master)](https://travis-ci.org/cgross/angular-busy) 2 | 3 | > Show busy/loading indicators on any $http or $resource request, or on any promise. 4 | 5 | ## Demo 6 | 7 | [Live Demo](http://cgross.github.io/angular-busy/demo) 8 | 9 | ## Getting Started 10 | 11 | Install with Bower, npm, yarn, or download the files directly from the dist folder in the repo. 12 | 13 | ```bash 14 | bower install angular-busy --save 15 | npm install @cgross/angular-busy 16 | ``` 17 | 18 | Add `dist/angular-busy.js` and `dist/angular-busy.css` to your index.html. 19 | 20 | Add `cgBusy` as a module dependency for your module. 21 | 22 | ```js 23 | angular.module('your_app', ['cgBusy']); 24 | ``` 25 | 26 | Add your promise to $scope and reference that in the `cg-busy` directive: 27 | 28 | ```js 29 | function MyCtrl($scope,$http,User) { 30 | 31 | //using $http 32 | $scope.myPromise = $http.get('...'); 33 | 34 | //if you have a User class based on $resource 35 | $scope.myPromise = User.$save(); 36 | 37 | } 38 | ``` 39 | 40 | ```html 41 | 42 |
43 | 44 | 45 |
46 | ``` 47 | 48 | ## Options 49 | 50 | The `cg-busy` directive expects either a promise or a configuration object. 51 | 52 | In other words. You may do this: 53 | 54 | ```html 55 |
56 | ``` 57 | 58 | or this: 59 | 60 | ```html 61 |
62 | ``` 63 | 64 | * `promise` - Required. The promise (or array of promises) that will cause the busy indicator to show. 65 | * `message` - Optional. Defaults to 'Please Wait...'. The message to show in the indicator. This value may be updated while the promise is active. The indicator will reflect the updated values as they're changed. 66 | * `backdrop` - Optional. Boolean, default is true. If true a faded backdrop will be shown behind the progress indicator. 67 | * `templateUrl` - Optional. If provided, the given template will be shown in place of the default progress indicatory template. 68 | * `delay` - Optional. The amount of time to wait until showing the indicator. Defaults to 0. Specified in milliseconds. 69 | * `minDuration` - Optional. The amount of time to keep the indicator showing even if the promise was resolved quicker. Defaults to 0. Specified in milliseconds. 70 | * `wrapperClass` - Optional. The name(s) of the CSS classes to be applied to the wrapper element of the busy sign/animation. Defaults to `cg-busy cg-busy-animation`. Typically only useful if you wish to apply different positioning to the animation. 71 | 72 | ## Providing Custom Templates 73 | 74 | The angular-busy indicator is a regular Angular template. The templates have access to the scope where `cg-busy` was declared so you may reference your local scope variables in your custom templates. Additionally, the scope is augmented with a `$message` field containing the indicator message text. 75 | 76 | ## Overriding Defaults 77 | 78 | The defaut values for `message`, `backdrop`, `templateUrl`, `delay`, and `minDuration` may all be overriden by overriding the `$injector` value for `cgBusyDefaults`, like so: 79 | 80 | ```js 81 | angular.module('your_app').value('cgBusyDefaults',{ 82 | message:'Loading Stuff', 83 | backdrop: false, 84 | templateUrl: 'my_custom_template.html', 85 | delay: 300, 86 | minDuration: 700, 87 | wrapperClass: 'my-class my-class2' 88 | }); 89 | ``` 90 | 91 | Only the values you'd like overriden need to be specified. 92 | 93 | 94 | ## Release History 95 | * v4.1.4 - Fixed deprecated Angular success promise methods for 1.6. Published to npm. 96 | * v4.1.3 - Fix for issue #45 and issue #49. 97 | * v4.1.2 - Small bugs fixed, wrapperClass option added. 98 | * v4.1.1 - Compatibility with Angular 1.3. 99 | * v4.1.0 100 | * Change to how `delay` and `minDuration` work together. If specified together, `minDuration` will only take effect if the promise was active through the delay. For example, if `delay`=200 and `minDuration`=500 and the actual promise only took 100ms, no indicator will be shown. If the delay threshold is reached, the indicator will show for `minDuration` ms rather than `minDuration` minus `delay` as it had been before. 101 | * Backdrop now fades in with no movement. Message still animates in from the top. 102 | * v4.0.4 - Added bower_components to bower ignore. 103 | * v4.0.3 - Now supports Q promises. 104 | * v4.0.2 - Fix for min duration only being used when delay also being set. 105 | * v4.0.0 - Big update 106 | * Dependency on angular-promise-tracker has been removed. We now track promises directly. 107 | * Message is now configurable. 108 | * The template options is now templateUrl. 109 | * The delay option has been added. 110 | * The minDuration option has been added. 111 | * Changing default template has been modified to be part of the new `cgBusyDefaults` value. 112 | * v3.0.2 - Reverting back to promise-tracker v1.5 due to changes in the api. 113 | * v3.0.1 - Fix for using cg-busy when a tracker has already been registered. 114 | * v3.0.0 - Support for new promise-tracker api. Fix for multiple cg-busy's on the same scope. 115 | * v2.2.0 - Support for multiple trackers per indicator. 116 | * v2.1.0 - Removed work-around for issues in Angular 1.2-rc's. 117 | * v2.0.0 - Moved to Angular 1.2.0-rc1. 118 | * v1.0.0 - Added Bower support. 119 | * v0.1.1 - Updated to Angular 1.1.5 animation syntax. 120 | * v0.1.0 - Initial release. 121 | -------------------------------------------------------------------------------- /angular-busy.css: -------------------------------------------------------------------------------- 1 | .cg-busy{ 2 | position:absolute; 3 | top:0px; 4 | left:0px; 5 | right:0px; 6 | bottom:0px; 7 | z-index:1001; 8 | } 9 | 10 | .cg-busy-animation.ng-hide-add, 11 | .cg-busy-animation.ng-hide-remove { 12 | -webkit-transition:all .3s ease; 13 | -moz-transition:all .3s ease; 14 | -o-transition:all .3s ease; 15 | transition:all .3s ease; 16 | display:block !important; 17 | } 18 | .cg-busy-animation.ng-hide-remove { 19 | opacity:0; 20 | -webkit-transform:translate(0px,-40px); 21 | -moz-transform:translate(0px,-40px); 22 | -ms-transform:translate(0px,-40px); 23 | -o-transform:translate(0px,-40px); 24 | transform:translate(0px,-40px); 25 | } 26 | .cg-busy-animation.ng-hide-remove.ng-hide-remove-active { 27 | opacity:1; 28 | -webkit-transform:translate(0px,0px); 29 | -moz-transform:translate(0px,0px); 30 | -ms-transform:translate(0px,0px); 31 | -o-transform:translate(0px,0px); 32 | transform:translate(0px,0px); 33 | } 34 | .cg-busy-animation.ng-hide-add { 35 | opacity:1; 36 | -webkit-transform:translate(0px,0px); 37 | -moz-transform:translate(0px,0px); 38 | -ms-transform:translate(0px,0px); 39 | -o-transform:translate(0px,0px); 40 | transform:translate(0px,0px); 41 | } 42 | .cg-busy-animation.ng-hide-add.ng-hide-add-active { 43 | opacity:0; 44 | -webkit-transform:translate(0px,-40px); 45 | -moz-transform:translate(0px,-40px); 46 | -ms-transform:translate(0px,-40px); 47 | -o-transform:translate(0px,-40px); 48 | transform:translate(0px,-40px); 49 | } 50 | 51 | .cg-busy-backdrop { 52 | background-color:white; 53 | opacity:.7; 54 | } 55 | 56 | .cg-busy-backdrop-animation.ng-hide-add, 57 | .cg-busy-backdrop-animation.ng-hide-remove { 58 | -webkit-transition:opacity .3s ease; 59 | -moz-transition:opacity .3s ease; 60 | -o-transition:opacity .3s ease; 61 | transition:opacity .3s ease; 62 | display:block !important; 63 | } 64 | 65 | .cg-busy-backdrop-animation.ng-hide { 66 | opacity:0; 67 | } 68 | 69 | /* All styles below are for the default template. */ 70 | 71 | .cg-busy-default-wrapper { 72 | text-align:center; 73 | } 74 | 75 | .cg-busy-default-sign{ 76 | display: inline-block; 77 | position:relative; 78 | z-index:1002; 79 | padding-bottom: 6px; 80 | color:#333333; 81 | text-shadow:0 1px 1px rgba(255, 255, 255, 0.75); 82 | background-color:#e9eeee; 83 | border:1px solid #dddddd; 84 | border-top-width:0; 85 | -webkit-border-radius:7px; 86 | -moz-border-radius:7px; 87 | border-radius:7px; 88 | border-top-left-radius:0; 89 | border-top-right-radius:0; 90 | -webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 91 | -moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 92 | box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 93 | } 94 | .cg-busy-default-text{ 95 | margin:13px 12px 6px 49px; 96 | font-size:16px; 97 | color:#555; 98 | text-align: left; 99 | max-width: 400px; 100 | } 101 | .cg-busy-default-spinner{ 102 | position:absolute; 103 | width:25px; 104 | height:25px; 105 | display:inline-block; 106 | top:12px; 107 | left:14px; 108 | } 109 | .cg-busy-default-spinner div{ 110 | width:12%; 111 | height:26%; 112 | background:#000; 113 | position:absolute; 114 | left:44.5%; 115 | top:37%; 116 | opacity:0; 117 | -webkit-animation:cg-busy-spinner-anim 1s linear infinite; 118 | -moz-animation:cg-busy-spinner-anim 1s linear infinite; 119 | -ms-animation:cg-busy-spinner-anim 1s linear infinite; 120 | -o-animation:cg-busy-spinner-anim 1s linear infinite; 121 | animation:cg-busy-spinner-anim 1s linear infinite; 122 | -webkit-border-radius:50px; 123 | -moz-border-radius:50px; 124 | border-radius:50px; 125 | -webkit-box-shadow:0 0 3px rgba(0,0,0,0.2); 126 | -moz-box-shadow:0 0 3px rgba(0,0,0,0.2); 127 | box-shadow:0 0 3px rgba(0,0,0,0.2); 128 | } 129 | .cg-busy-default-spinner div.bar1{ 130 | -webkit-transform:rotate(0deg) translate(0, -142%); 131 | -moz-transform:rotate(0deg) translate(0, -142%); 132 | -ms-transform:rotate(0deg) translate(0, -142%); 133 | -o-transform:rotate(0deg) translate(0, -142%); 134 | transform:rotate(0deg) translate(0, -142%); 135 | -webkit-animation-delay:0s; 136 | -moz-animation-delay:0s; 137 | -ms-animation-delay:0s; 138 | -o-animation-delay:0s; 139 | animation-delay:0s; 140 | } 141 | .cg-busy-default-spinner div.bar2{ 142 | -webkit-transform:rotate(30deg) translate(0, -142%); 143 | -moz-transform:rotate(30deg) translate(0, -142%); 144 | -ms-transform:rotate(30deg) translate(0, -142%); 145 | -o-transform:rotate(30deg) translate(0, -142%); 146 | transform:rotate(30deg) translate(0, -142%); 147 | -webkit-animation-delay:-0.9167s; 148 | -moz-animation-delay:-0.9167s; 149 | -ms-animation-delay:-0.9167s; 150 | -o-animation-delay:-0.9167s; 151 | animation-delay:-0.9167s; 152 | } 153 | .cg-busy-default-spinner div.bar3{ 154 | -webkit-transform:rotate(60deg) translate(0, -142%); 155 | -moz-transform:rotate(60deg) translate(0, -142%); 156 | -ms-transform:rotate(60deg) translate(0, -142%); 157 | -o-transform:rotate(60deg) translate(0, -142%); 158 | transform:rotate(60deg) translate(0, -142%); 159 | -webkit-animation-delay:-0.833s; 160 | -moz-animation-delay:-0.833s; 161 | -ms-animation-delay:-0.833s; 162 | -o-animation-delay:-0.833s; 163 | animation-delay:-0.833s; 164 | } 165 | .cg-busy-default-spinner div.bar4{ 166 | -webkit-transform:rotate(90deg) translate(0, -142%); 167 | -moz-transform:rotate(90deg) translate(0, -142%); 168 | -ms-transform:rotate(90deg) translate(0, -142%); 169 | -o-transform:rotate(90deg) translate(0, -142%); 170 | transform:rotate(90deg) translate(0, -142%); 171 | -webkit-animation-delay:-0.75s; 172 | -moz-animation-delay:-0.75s; 173 | -ms-animation-delay:-0.75s; 174 | -o-animation-delay:-0.75s; 175 | animation-delay:-0.75s; 176 | } 177 | .cg-busy-default-spinner div.bar5{ 178 | -webkit-transform:rotate(120deg) translate(0, -142%); 179 | -moz-transform:rotate(120deg) translate(0, -142%); 180 | -ms-transform:rotate(120deg) translate(0, -142%); 181 | -o-transform:rotate(120deg) translate(0, -142%); 182 | transform:rotate(120deg) translate(0, -142%); 183 | -webkit-animation-delay:-0.667s; 184 | -moz-animation-delay:-0.667s; 185 | -ms-animation-delay:-0.667s; 186 | -o-animation-delay:-0.667s; 187 | animation-delay:-0.667s; 188 | } 189 | .cg-busy-default-spinner div.bar6{ 190 | -webkit-transform:rotate(150deg) translate(0, -142%); 191 | -moz-transform:rotate(150deg) translate(0, -142%); 192 | -ms-transform:rotate(150deg) translate(0, -142%); 193 | -o-transform:rotate(150deg) translate(0, -142%); 194 | transform:rotate(150deg) translate(0, -142%); 195 | -webkit-animation-delay:-0.5833s; 196 | -moz-animation-delay:-0.5833s; 197 | -ms-animation-delay:-0.5833s; 198 | -o-animation-delay:-0.5833s; 199 | animation-delay:-0.5833s; 200 | } 201 | .cg-busy-default-spinner div.bar7{ 202 | -webkit-transform:rotate(180deg) translate(0, -142%); 203 | -moz-transform:rotate(180deg) translate(0, -142%); 204 | -ms-transform:rotate(180deg) translate(0, -142%); 205 | -o-transform:rotate(180deg) translate(0, -142%); 206 | transform:rotate(180deg) translate(0, -142%); 207 | -webkit-animation-delay:-0.5s; 208 | -moz-animation-delay:-0.5s; 209 | -ms-animation-delay:-0.5s; 210 | -o-animation-delay:-0.5s; 211 | animation-delay:-0.5s; 212 | } 213 | .cg-busy-default-spinner div.bar8{ 214 | -webkit-transform:rotate(210deg) translate(0, -142%); 215 | -moz-transform:rotate(210deg) translate(0, -142%); 216 | -ms-transform:rotate(210deg) translate(0, -142%); 217 | -o-transform:rotate(210deg) translate(0, -142%); 218 | transform:rotate(210deg) translate(0, -142%); 219 | -webkit-animation-delay:-0.41667s; 220 | -moz-animation-delay:-0.41667s; 221 | -ms-animation-delay:-0.41667s; 222 | -o-animation-delay:-0.41667s; 223 | animation-delay:-0.41667s; 224 | } 225 | .cg-busy-default-spinner div.bar9{ 226 | -webkit-transform:rotate(240deg) translate(0, -142%); 227 | -moz-transform:rotate(240deg) translate(0, -142%); 228 | -ms-transform:rotate(240deg) translate(0, -142%); 229 | -o-transform:rotate(240deg) translate(0, -142%); 230 | transform:rotate(240deg) translate(0, -142%); 231 | -webkit-animation-delay:-0.333s; 232 | -moz-animation-delay:-0.333s; 233 | -ms-animation-delay:-0.333s; 234 | -o-animation-delay:-0.333s; 235 | animation-delay:-0.333s; 236 | } 237 | .cg-busy-default-spinner div.bar10{ 238 | -webkit-transform:rotate(270deg) translate(0, -142%); 239 | -moz-transform:rotate(270deg) translate(0, -142%); 240 | -ms-transform:rotate(270deg) translate(0, -142%); 241 | -o-transform:rotate(270deg) translate(0, -142%); 242 | transform:rotate(270deg) translate(0, -142%); 243 | -webkit-animation-delay:-0.25s; 244 | -moz-animation-delay:-0.25s; 245 | -ms-animation-delay:-0.25s; 246 | -o-animation-delay:-0.25s; 247 | animation-delay:-0.25s; 248 | } 249 | .cg-busy-default-spinner div.bar11{ 250 | -webkit-transform:rotate(300deg) translate(0, -142%); 251 | -moz-transform:rotate(300deg) translate(0, -142%); 252 | -ms-transform:rotate(300deg) translate(0, -142%); 253 | -o-transform:rotate(300deg) translate(0, -142%); 254 | transform:rotate(300deg) translate(0, -142%); 255 | -webkit-animation-delay:-0.1667s; 256 | -moz-animation-delay:-0.1667s; 257 | -ms-animation-delay:-0.1667s; 258 | -o-animation-delay:-0.1667s; 259 | animation-delay:-0.1667s; 260 | } 261 | .cg-busy-default-spinner div.bar12{ 262 | -webkit-transform:rotate(330deg) translate(0, -142%); 263 | -moz-transform:rotate(330deg) translate(0, -142%); 264 | -ms-transform:rotate(330deg) translate(0, -142%); 265 | -o-transform:rotate(330deg) translate(0, -142%); 266 | transform:rotate(330deg) translate(0, -142%); 267 | -webkit-animation-delay:-0.0833s; 268 | -moz-animation-delay:-0.0833s; 269 | -ms-animation-delay:-0.0833s; 270 | -o-animation-delay:-0.0833s; 271 | animation-delay:-0.0833s; 272 | } 273 | 274 | @-webkit-keyframes cg-busy-spinner-anim{ 275 | from {opacity: 1;} 276 | to {opacity: 0.25;} 277 | } 278 | @-moz-keyframes cg-busy-spinner-anim{ 279 | from {opacity: 1;} 280 | to {opacity: 0.25;} 281 | } 282 | @keyframes cg-busy-spinner-anim{ 283 | from {opacity: 1;} 284 | to {opacity: 0.25;} 285 | } 286 | -------------------------------------------------------------------------------- /angular-busy.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 20 |
{{$message}}
21 | 22 |
23 | 24 |
-------------------------------------------------------------------------------- /angular-busy.js: -------------------------------------------------------------------------------- 1 | angular.module('cgBusy',[]); 2 | 3 | //loosely modeled after angular-promise-tracker 4 | angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout','$q',function($timeout,$q){ 5 | 6 | return function(){ 7 | 8 | var tracker = {}; 9 | tracker.promises = []; 10 | tracker.delayPromise = null; 11 | tracker.durationPromise = null; 12 | tracker.delayJustFinished = false; 13 | 14 | tracker.reset = function(options){ 15 | tracker.minDuration = options.minDuration; 16 | 17 | tracker.promises = []; 18 | angular.forEach(options.promises,function(p){ 19 | if (!p || p.$cgBusyFulfilled) { 20 | return; 21 | } 22 | addPromiseLikeThing(p); 23 | }); 24 | 25 | if (tracker.promises.length === 0) { 26 | //if we have no promises then dont do the delay or duration stuff 27 | return; 28 | } 29 | 30 | tracker.delayJustFinished = false; 31 | if (options.delay) { 32 | tracker.delayPromise = $timeout(function(){ 33 | tracker.delayPromise = null; 34 | tracker.delayJustFinished = true; 35 | },parseInt(options.delay,10)); 36 | } 37 | if (options.minDuration) { 38 | tracker.durationPromise = $timeout(function(){ 39 | tracker.durationPromise = null; 40 | },parseInt(options.minDuration,10) + (options.delay ? parseInt(options.delay,10) : 0)); 41 | } 42 | }; 43 | 44 | tracker.isPromise = function(promiseThing){ 45 | var then = promiseThing && (promiseThing.then || promiseThing.$then || 46 | (promiseThing.$promise && promiseThing.$promise.then)); 47 | 48 | return typeof then !== 'undefined'; 49 | }; 50 | 51 | tracker.callThen = function(promiseThing,success,error){ 52 | var promise; 53 | if (promiseThing.then || promiseThing.$then){ 54 | promise = promiseThing; 55 | } else if (promiseThing.$promise){ 56 | promise = promiseThing.$promise; 57 | } else if (promiseThing.denodeify){ 58 | promise = $q.when(promiseThing); 59 | } 60 | 61 | var then = (promise.then || promise.$then); 62 | 63 | then.call(promise,success,error); 64 | }; 65 | 66 | var addPromiseLikeThing = function(promise){ 67 | 68 | if (!tracker.isPromise(promise)) { 69 | throw new Error('cgBusy expects a promise (or something that has a .promise or .$promise'); 70 | } 71 | 72 | if (tracker.promises.indexOf(promise) !== -1){ 73 | return; 74 | } 75 | tracker.promises.push(promise); 76 | 77 | tracker.callThen(promise, function(){ 78 | promise.$cgBusyFulfilled = true; 79 | if (tracker.promises.indexOf(promise) === -1) { 80 | return; 81 | } 82 | tracker.promises.splice(tracker.promises.indexOf(promise),1); 83 | },function(){ 84 | promise.$cgBusyFulfilled = true; 85 | if (tracker.promises.indexOf(promise) === -1) { 86 | return; 87 | } 88 | tracker.promises.splice(tracker.promises.indexOf(promise),1); 89 | }); 90 | }; 91 | 92 | tracker.active = function(){ 93 | if (tracker.delayPromise){ 94 | return false; 95 | } 96 | 97 | if (!tracker.delayJustFinished){ 98 | if (tracker.durationPromise){ 99 | return true; 100 | } 101 | return tracker.promises.length > 0; 102 | } else { 103 | //if both delay and min duration are set, 104 | //we don't want to initiate the min duration if the 105 | //promise finished before the delay was complete 106 | tracker.delayJustFinished = false; 107 | if (tracker.promises.length === 0) { 108 | tracker.durationPromise = null; 109 | } 110 | return tracker.promises.length > 0; 111 | } 112 | }; 113 | 114 | return tracker; 115 | 116 | }; 117 | }]); 118 | 119 | angular.module('cgBusy').value('cgBusyDefaults',{}); 120 | 121 | angular.module('cgBusy').directive('cgBusy',['$compile','$templateCache','cgBusyDefaults','$http','_cgBusyTrackerFactory', 122 | function($compile,$templateCache,cgBusyDefaults,$http,_cgBusyTrackerFactory){ 123 | return { 124 | restrict: 'A', 125 | link: function(scope, element, attrs, fn) { 126 | 127 | //Apply position:relative to parent element if necessary 128 | var position = element.css('position'); 129 | if (position === 'static' || position === '' || typeof position === 'undefined'){ 130 | element.css('position','relative'); 131 | } 132 | 133 | var templateElement; 134 | var backdropElement; 135 | var currentTemplate; 136 | var templateScope; 137 | var backdrop; 138 | var tracker = _cgBusyTrackerFactory(); 139 | 140 | var defaults = { 141 | templateUrl: 'angular-busy.html', 142 | delay:0, 143 | minDuration:0, 144 | backdrop: true, 145 | message:'Please Wait...', 146 | wrapperClass: 'cg-busy cg-busy-animation' 147 | }; 148 | 149 | angular.extend(defaults,cgBusyDefaults); 150 | 151 | scope.$watchCollection(attrs.cgBusy,function(options){ 152 | 153 | if (!options) { 154 | options = {promise:null}; 155 | } 156 | 157 | if (angular.isString(options)) { 158 | throw new Error('Invalid value for cg-busy. cgBusy no longer accepts string ids to represent promises/trackers.'); 159 | } 160 | 161 | //is it an array (of promises) or one promise 162 | if (angular.isArray(options) || tracker.isPromise(options)) { 163 | options = {promise:options}; 164 | } 165 | 166 | options = angular.extend(angular.copy(defaults),options); 167 | 168 | if (!options.templateUrl){ 169 | options.templateUrl = defaults.templateUrl; 170 | } 171 | 172 | if (!angular.isArray(options.promise)){ 173 | options.promise = [options.promise]; 174 | } 175 | 176 | // options.promise = angular.isArray(options.promise) ? options.promise : [options.promise]; 177 | // options.message = options.message ? options.message : 'Please Wait...'; 178 | // options.template = options.template ? options.template : cgBusyTemplateName; 179 | // options.minDuration = options.minDuration ? options.minDuration : 0; 180 | // options.delay = options.delay ? options.delay : 0; 181 | 182 | if (!templateScope) { 183 | templateScope = scope.$new(); 184 | } 185 | 186 | templateScope.$message = options.message; 187 | 188 | if (!angular.equals(tracker.promises,options.promise)) { 189 | tracker.reset({ 190 | promises:options.promise, 191 | delay:options.delay, 192 | minDuration: options.minDuration 193 | }); 194 | } 195 | 196 | templateScope.$cgBusyIsActive = function() { 197 | return tracker.active(); 198 | }; 199 | 200 | 201 | if (!templateElement || currentTemplate !== options.templateUrl || backdrop !== options.backdrop) { 202 | 203 | if (templateElement) { 204 | templateElement.remove(); 205 | } 206 | if (backdropElement){ 207 | backdropElement.remove(); 208 | } 209 | 210 | currentTemplate = options.templateUrl; 211 | backdrop = options.backdrop; 212 | 213 | $http.get(currentTemplate,{cache: $templateCache}).then(function(indicatorTemplate){ 214 | 215 | options.backdrop = typeof options.backdrop === 'undefined' ? true : options.backdrop; 216 | 217 | if (options.backdrop){ 218 | var backdrop = '
'; 219 | backdropElement = $compile(backdrop)(templateScope); 220 | element.append(backdropElement); 221 | } 222 | 223 | var template = '
' + indicatorTemplate.data + '
'; 224 | templateElement = $compile(template)(templateScope); 225 | 226 | angular.element(templateElement.children()[0]) 227 | .css('position','absolute') 228 | .css('top',0) 229 | .css('left',0) 230 | .css('right',0) 231 | .css('bottom',0); 232 | element.append(templateElement); 233 | 234 | }, function(data){ 235 | throw new Error('Template specified for cgBusy ('+options.templateUrl+') could not be loaded. ' + data); 236 | }); 237 | } 238 | 239 | },true); 240 | } 241 | }; 242 | } 243 | ]); 244 | 245 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-busy", 3 | "version": "4.1.4", 4 | "main": [ 5 | "dist/angular-busy.js", 6 | "dist/angular-busy.css" 7 | ], 8 | "dependencies": { 9 | "angular": ">=1.3", 10 | "angular-animate": ">=1.3" 11 | }, 12 | "ignore": [ 13 | "**/.*", 14 | "node_modules", 15 | "bower_components", 16 | "components", 17 | "test", 18 | "temp", 19 | "demo", 20 | "lib", 21 | "./angular-busy.css", 22 | "./angular-busy.html", 23 | "./angular-busy.js", 24 | "Gruntfile.js", 25 | "package.json", 26 | "README.md" 27 | ], 28 | "devDependencies": { 29 | "angular-mocks": "~1.3", 30 | "jquery": "~2.1.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bower_components/angular-animate/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-animate", 3 | "version": "1.2.26", 4 | "main": "./angular-animate.js", 5 | "dependencies": { 6 | "angular": "1.2.26" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-animate", 9 | "_release": "1.2.26", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.2.26", 13 | "commit": "453c5ac3ad0beb28e8296655c2e4079b5e0f31da" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-animate.git", 16 | "_target": "~1.2", 17 | "_originalSource": "angular-animate" 18 | } -------------------------------------------------------------------------------- /bower_components/angular-animate/README.md: -------------------------------------------------------------------------------- 1 | # bower-angular-animate 2 | 3 | This repo is for distribution on `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | Install with `bower`: 10 | 11 | ```shell 12 | bower install angular-animate 13 | ``` 14 | 15 | Add a ` 19 | ``` 20 | 21 | And add `ngAnimate` as a dependency for your app: 22 | 23 | ```javascript 24 | angular.module('myApp', ['ngAnimate']); 25 | ``` 26 | 27 | ## Documentation 28 | 29 | Documentation is available on the 30 | [AngularJS docs site](http://docs.angularjs.org/api/ngAnimate). 31 | 32 | ## License 33 | 34 | The MIT License 35 | 36 | Copyright (c) 2010-2012 Google, Inc. http://angularjs.org 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy 39 | of this software and associated documentation files (the "Software"), to deal 40 | in the Software without restriction, including without limitation the rights 41 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 42 | copies of the Software, and to permit persons to whom the Software is 43 | furnished to do so, subject to the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be included in 46 | all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 54 | THE SOFTWARE. 55 | -------------------------------------------------------------------------------- /bower_components/angular-animate/angular-animate.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.26 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(F,e,O){'use strict';e.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){return function(G,s,g){g=g.ngAnimateChildren;e.isString(g)&&0===g.length?s.data("$$ngAnimateChildren",!0):G.$watch(g,function(e){s.data("$$ngAnimateChildren",!!e)})}}).factory("$$animateReflow",["$$rAF","$document",function(e,s){return function(g){return e(function(){g()})}}]).config(["$provide","$animateProvider",function(G,s){function g(e){for(var g=0;g=y&&b>=v&&e()}var h=g(b);a=b.data(q);if(-1!=h.getAttribute("class").indexOf(d)&&a){var m="";u(d.split(" "),function(a,b){m+=(0", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/angular/angular.js/issues" 24 | }, 25 | "homepage": "http://angularjs.org" 26 | } 27 | -------------------------------------------------------------------------------- /bower_components/angular-mocks/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-mocks", 3 | "version": "1.2.26", 4 | "main": "./angular-mocks.js", 5 | "dependencies": { 6 | "angular": "1.2.26" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-mocks", 9 | "_release": "1.2.26", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.2.26", 13 | "commit": "0eda339dd42aba2628586f39d4806bcfb57fd6f4" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-mocks.git", 16 | "_target": "~1.2", 17 | "_originalSource": "angular-mocks" 18 | } -------------------------------------------------------------------------------- /bower_components/angular-mocks/README.md: -------------------------------------------------------------------------------- 1 | # bower-angular-mocks 2 | 3 | This repo is for distribution on `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngMock). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | Install with `bower`: 10 | 11 | ```shell 12 | bower install angular-mocks 13 | ``` 14 | 15 | ## Documentation 16 | 17 | Documentation is available on the 18 | [AngularJS docs site](http://docs.angularjs.org/guide/dev_guide.unit-testing). 19 | 20 | ## License 21 | 22 | The MIT License 23 | 24 | Copyright (c) 2010-2012 Google, Inc. http://angularjs.org 25 | 26 | Permission is hereby granted, free of charge, to any person obtaining a copy 27 | of this software and associated documentation files (the "Software"), to deal 28 | in the Software without restriction, including without limitation the rights 29 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 30 | copies of the Software, and to permit persons to whom the Software is 31 | furnished to do so, subject to the following conditions: 32 | 33 | The above copyright notice and this permission notice shall be included in 34 | all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 37 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 38 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 39 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 40 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 41 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 42 | THE SOFTWARE. 43 | -------------------------------------------------------------------------------- /bower_components/angular-mocks/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-mocks", 3 | "version": "1.2.26", 4 | "main": "./angular-mocks.js", 5 | "dependencies": { 6 | "angular": "1.2.26" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular-mocks/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-mocks", 3 | "version": "", 4 | "description": "AngularJS mocks for testing", 5 | "main": "angular-mocks.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "mocks", 18 | "testing", 19 | "client-side" 20 | ], 21 | "author": "Angular Core Team ", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/angular/angular.js/issues" 25 | }, 26 | "homepage": "http://angularjs.org" 27 | } 28 | -------------------------------------------------------------------------------- /bower_components/angular/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.2.26", 4 | "main": "./angular.js", 5 | "dependencies": {}, 6 | "homepage": "https://github.com/angular/bower-angular", 7 | "_release": "1.2.26", 8 | "_resolution": { 9 | "type": "version", 10 | "tag": "v1.2.26", 11 | "commit": "7308d8d650b2b9948796035cbf6f3b175d45efe0" 12 | }, 13 | "_source": "git://github.com/angular/bower-angular.git", 14 | "_target": "~1.2", 15 | "_originalSource": "angular" 16 | } -------------------------------------------------------------------------------- /bower_components/angular/README.md: -------------------------------------------------------------------------------- 1 | # bower-angular 2 | 3 | This repo is for distribution on `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | Install with `bower`: 10 | 11 | ```shell 12 | bower install angular 13 | ``` 14 | 15 | Add a ` 19 | ``` 20 | 21 | ## Documentation 22 | 23 | Documentation is available on the 24 | [AngularJS docs site](http://docs.angularjs.org/). 25 | 26 | ## License 27 | 28 | The MIT License 29 | 30 | Copyright (c) 2010-2012 Google, Inc. http://angularjs.org 31 | 32 | Permission is hereby granted, free of charge, to any person obtaining a copy 33 | of this software and associated documentation files (the "Software"), to deal 34 | in the Software without restriction, including without limitation the rights 35 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 36 | copies of the Software, and to permit persons to whom the Software is 37 | furnished to do so, subject to the following conditions: 38 | 39 | The above copyright notice and this permission notice shall be included in 40 | all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 43 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 45 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 46 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 47 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 48 | THE SOFTWARE. 49 | -------------------------------------------------------------------------------- /bower_components/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-block-transitions { 16 | transition:0s all!important; 17 | -webkit-transition:0s all!important; 18 | } 19 | 20 | /* show the element during a show/hide animation when the 21 | * animation is ongoing, but the .ng-hide class is active */ 22 | .ng-hide-add-active, .ng-hide-remove { 23 | display: block!important; 24 | } 25 | -------------------------------------------------------------------------------- /bower_components/angular/angular.min.js.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgross/angular-busy/747c36fc6abff706ba720b6dc717360bb498dbf3/bower_components/angular/angular.min.js.gzip -------------------------------------------------------------------------------- /bower_components/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.2.26", 4 | "main": "./angular.js", 5 | "dependencies": { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /bower_components/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "", 4 | "description": "HTML enhanced for web apps", 5 | "main": "angular.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "client-side" 18 | ], 19 | "author": "Angular Core Team ", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/angular/angular.js/issues" 23 | }, 24 | "homepage": "http://angularjs.org" 25 | } 26 | -------------------------------------------------------------------------------- /bower_components/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.1", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "speed", 10 | "test", 11 | "*.md", 12 | "AUTHORS.txt", 13 | "Gruntfile.js", 14 | "package.json" 15 | ], 16 | "devDependencies": { 17 | "sizzle": "1.10.19", 18 | "requirejs": "2.1.10", 19 | "qunit": "1.14.0", 20 | "sinon": "1.8.1" 21 | }, 22 | "keywords": [ 23 | "jquery", 24 | "javascript", 25 | "library" 26 | ], 27 | "homepage": "https://github.com/jquery/jquery", 28 | "_release": "2.1.1", 29 | "_resolution": { 30 | "type": "version", 31 | "tag": "2.1.1", 32 | "commit": "4dec426aa2a6cbabb1b064319ba7c272d594a688" 33 | }, 34 | "_source": "git://github.com/jquery/jquery.git", 35 | "_target": "~2.1.0", 36 | "_originalSource": "jquery" 37 | } -------------------------------------------------------------------------------- /bower_components/jquery/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2014 jQuery Foundation and other contributors 2 | http://jquery.com/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bower_components/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.1", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "speed", 10 | "test", 11 | "*.md", 12 | "AUTHORS.txt", 13 | "Gruntfile.js", 14 | "package.json" 15 | ], 16 | "devDependencies": { 17 | "sizzle": "1.10.19", 18 | "requirejs": "2.1.10", 19 | "qunit": "1.14.0", 20 | "sinon": "1.8.1" 21 | }, 22 | "keywords": [ 23 | "jquery", 24 | "javascript", 25 | "library" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/jsonp.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "./var/nonce", 4 | "./var/rquery", 5 | "../ajax" 6 | ], function( jQuery, nonce, rquery ) { 7 | 8 | var oldCallbacks = [], 9 | rjsonp = /(=)\?(?=&|$)|\?\?/; 10 | 11 | // Default jsonp settings 12 | jQuery.ajaxSetup({ 13 | jsonp: "callback", 14 | jsonpCallback: function() { 15 | var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 16 | this[ callback ] = true; 17 | return callback; 18 | } 19 | }); 20 | 21 | // Detect, normalize options and install callbacks for jsonp requests 22 | jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 23 | 24 | var callbackName, overwritten, responseContainer, 25 | jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 26 | "url" : 27 | typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" 28 | ); 29 | 30 | // Handle iff the expected data type is "jsonp" or we have a parameter to set 31 | if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 32 | 33 | // Get callback name, remembering preexisting value associated with it 34 | callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 35 | s.jsonpCallback() : 36 | s.jsonpCallback; 37 | 38 | // Insert callback into url or form data 39 | if ( jsonProp ) { 40 | s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 41 | } else if ( s.jsonp !== false ) { 42 | s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 43 | } 44 | 45 | // Use data converter to retrieve json after script execution 46 | s.converters["script json"] = function() { 47 | if ( !responseContainer ) { 48 | jQuery.error( callbackName + " was not called" ); 49 | } 50 | return responseContainer[ 0 ]; 51 | }; 52 | 53 | // force json dataType 54 | s.dataTypes[ 0 ] = "json"; 55 | 56 | // Install callback 57 | overwritten = window[ callbackName ]; 58 | window[ callbackName ] = function() { 59 | responseContainer = arguments; 60 | }; 61 | 62 | // Clean-up function (fires after converters) 63 | jqXHR.always(function() { 64 | // Restore preexisting value 65 | window[ callbackName ] = overwritten; 66 | 67 | // Save back as free 68 | if ( s[ callbackName ] ) { 69 | // make sure that re-using the options doesn't screw things around 70 | s.jsonpCallback = originalSettings.jsonpCallback; 71 | 72 | // save the callback name for future use 73 | oldCallbacks.push( callbackName ); 74 | } 75 | 76 | // Call if it was a function and we have a response 77 | if ( responseContainer && jQuery.isFunction( overwritten ) ) { 78 | overwritten( responseContainer[ 0 ] ); 79 | } 80 | 81 | responseContainer = overwritten = undefined; 82 | }); 83 | 84 | // Delegate to script 85 | return "script"; 86 | } 87 | }); 88 | 89 | }); 90 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/load.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../core/parseHTML", 4 | "../ajax", 5 | "../traversing", 6 | "../manipulation", 7 | "../selector", 8 | // Optional event/alias dependency 9 | "../event/alias" 10 | ], function( jQuery ) { 11 | 12 | // Keep a copy of the old load method 13 | var _load = jQuery.fn.load; 14 | 15 | /** 16 | * Load a url into a page 17 | */ 18 | jQuery.fn.load = function( url, params, callback ) { 19 | if ( typeof url !== "string" && _load ) { 20 | return _load.apply( this, arguments ); 21 | } 22 | 23 | var selector, type, response, 24 | self = this, 25 | off = url.indexOf(" "); 26 | 27 | if ( off >= 0 ) { 28 | selector = jQuery.trim( url.slice( off ) ); 29 | url = url.slice( 0, off ); 30 | } 31 | 32 | // If it's a function 33 | if ( jQuery.isFunction( params ) ) { 34 | 35 | // We assume that it's the callback 36 | callback = params; 37 | params = undefined; 38 | 39 | // Otherwise, build a param string 40 | } else if ( params && typeof params === "object" ) { 41 | type = "POST"; 42 | } 43 | 44 | // If we have elements to modify, make the request 45 | if ( self.length > 0 ) { 46 | jQuery.ajax({ 47 | url: url, 48 | 49 | // if "type" variable is undefined, then "GET" method will be used 50 | type: type, 51 | dataType: "html", 52 | data: params 53 | }).done(function( responseText ) { 54 | 55 | // Save response for use in complete callback 56 | response = arguments; 57 | 58 | self.html( selector ? 59 | 60 | // If a selector was specified, locate the right elements in a dummy div 61 | // Exclude scripts to avoid IE 'Permission Denied' errors 62 | jQuery("
").append( jQuery.parseHTML( responseText ) ).find( selector ) : 63 | 64 | // Otherwise use the full result 65 | responseText ); 66 | 67 | }).complete( callback && function( jqXHR, status ) { 68 | self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); 69 | }); 70 | } 71 | 72 | return this; 73 | }; 74 | 75 | }); 76 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/parseJSON.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Support: Android 2.3 6 | // Workaround failure to string-cast null input 7 | jQuery.parseJSON = function( data ) { 8 | return JSON.parse( data + "" ); 9 | }; 10 | 11 | return jQuery.parseJSON; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Cross-browser xml parsing 6 | jQuery.parseXML = function( data ) { 7 | var xml, tmp; 8 | if ( !data || typeof data !== "string" ) { 9 | return null; 10 | } 11 | 12 | // Support: IE9 13 | try { 14 | tmp = new DOMParser(); 15 | xml = tmp.parseFromString( data, "text/xml" ); 16 | } catch ( e ) { 17 | xml = undefined; 18 | } 19 | 20 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 21 | jQuery.error( "Invalid XML: " + data ); 22 | } 23 | return xml; 24 | }; 25 | 26 | return jQuery.parseXML; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/script.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../ajax" 4 | ], function( jQuery ) { 5 | 6 | // Install script dataType 7 | jQuery.ajaxSetup({ 8 | accepts: { 9 | script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 10 | }, 11 | contents: { 12 | script: /(?:java|ecma)script/ 13 | }, 14 | converters: { 15 | "text script": function( text ) { 16 | jQuery.globalEval( text ); 17 | return text; 18 | } 19 | } 20 | }); 21 | 22 | // Handle cache's special case and crossDomain 23 | jQuery.ajaxPrefilter( "script", function( s ) { 24 | if ( s.cache === undefined ) { 25 | s.cache = false; 26 | } 27 | if ( s.crossDomain ) { 28 | s.type = "GET"; 29 | } 30 | }); 31 | 32 | // Bind script tag hack transport 33 | jQuery.ajaxTransport( "script", function( s ) { 34 | // This transport only deals with cross domain requests 35 | if ( s.crossDomain ) { 36 | var script, callback; 37 | return { 38 | send: function( _, complete ) { 39 | script = jQuery(" 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /dist/angular-busy.css: -------------------------------------------------------------------------------- 1 | .cg-busy{ 2 | position:absolute; 3 | top:0px; 4 | left:0px; 5 | right:0px; 6 | bottom:0px; 7 | z-index:1001; 8 | } 9 | 10 | .cg-busy-animation.ng-hide-add, 11 | .cg-busy-animation.ng-hide-remove { 12 | -webkit-transition:all .3s ease; 13 | -moz-transition:all .3s ease; 14 | -o-transition:all .3s ease; 15 | transition:all .3s ease; 16 | display:block !important; 17 | } 18 | .cg-busy-animation.ng-hide-remove { 19 | opacity:0; 20 | -webkit-transform:translate(0px,-40px); 21 | -moz-transform:translate(0px,-40px); 22 | -ms-transform:translate(0px,-40px); 23 | -o-transform:translate(0px,-40px); 24 | transform:translate(0px,-40px); 25 | } 26 | .cg-busy-animation.ng-hide-remove.ng-hide-remove-active { 27 | opacity:1; 28 | -webkit-transform:translate(0px,0px); 29 | -moz-transform:translate(0px,0px); 30 | -ms-transform:translate(0px,0px); 31 | -o-transform:translate(0px,0px); 32 | transform:translate(0px,0px); 33 | } 34 | .cg-busy-animation.ng-hide-add { 35 | opacity:1; 36 | -webkit-transform:translate(0px,0px); 37 | -moz-transform:translate(0px,0px); 38 | -ms-transform:translate(0px,0px); 39 | -o-transform:translate(0px,0px); 40 | transform:translate(0px,0px); 41 | } 42 | .cg-busy-animation.ng-hide-add.ng-hide-add-active { 43 | opacity:0; 44 | -webkit-transform:translate(0px,-40px); 45 | -moz-transform:translate(0px,-40px); 46 | -ms-transform:translate(0px,-40px); 47 | -o-transform:translate(0px,-40px); 48 | transform:translate(0px,-40px); 49 | } 50 | 51 | .cg-busy-backdrop { 52 | background-color:white; 53 | opacity:.7; 54 | } 55 | 56 | .cg-busy-backdrop-animation.ng-hide-add, 57 | .cg-busy-backdrop-animation.ng-hide-remove { 58 | -webkit-transition:opacity .3s ease; 59 | -moz-transition:opacity .3s ease; 60 | -o-transition:opacity .3s ease; 61 | transition:opacity .3s ease; 62 | display:block !important; 63 | } 64 | 65 | .cg-busy-backdrop-animation.ng-hide { 66 | opacity:0; 67 | } 68 | 69 | /* All styles below are for the default template. */ 70 | 71 | .cg-busy-default-wrapper { 72 | text-align:center; 73 | } 74 | 75 | .cg-busy-default-sign{ 76 | display: inline-block; 77 | position:relative; 78 | z-index:1002; 79 | padding-bottom: 6px; 80 | color:#333333; 81 | text-shadow:0 1px 1px rgba(255, 255, 255, 0.75); 82 | background-color:#e9eeee; 83 | border:1px solid #dddddd; 84 | border-top-width:0; 85 | -webkit-border-radius:7px; 86 | -moz-border-radius:7px; 87 | border-radius:7px; 88 | border-top-left-radius:0; 89 | border-top-right-radius:0; 90 | -webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 91 | -moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 92 | box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 93 | } 94 | .cg-busy-default-text{ 95 | margin:13px 12px 6px 49px; 96 | font-size:16px; 97 | color:#555; 98 | text-align: left; 99 | max-width: 400px; 100 | } 101 | .cg-busy-default-spinner{ 102 | position:absolute; 103 | width:25px; 104 | height:25px; 105 | display:inline-block; 106 | top:12px; 107 | left:14px; 108 | } 109 | .cg-busy-default-spinner div{ 110 | width:12%; 111 | height:26%; 112 | background:#000; 113 | position:absolute; 114 | left:44.5%; 115 | top:37%; 116 | opacity:0; 117 | -webkit-animation:cg-busy-spinner-anim 1s linear infinite; 118 | -moz-animation:cg-busy-spinner-anim 1s linear infinite; 119 | -ms-animation:cg-busy-spinner-anim 1s linear infinite; 120 | -o-animation:cg-busy-spinner-anim 1s linear infinite; 121 | animation:cg-busy-spinner-anim 1s linear infinite; 122 | -webkit-border-radius:50px; 123 | -moz-border-radius:50px; 124 | border-radius:50px; 125 | -webkit-box-shadow:0 0 3px rgba(0,0,0,0.2); 126 | -moz-box-shadow:0 0 3px rgba(0,0,0,0.2); 127 | box-shadow:0 0 3px rgba(0,0,0,0.2); 128 | } 129 | .cg-busy-default-spinner div.bar1{ 130 | -webkit-transform:rotate(0deg) translate(0, -142%); 131 | -moz-transform:rotate(0deg) translate(0, -142%); 132 | -ms-transform:rotate(0deg) translate(0, -142%); 133 | -o-transform:rotate(0deg) translate(0, -142%); 134 | transform:rotate(0deg) translate(0, -142%); 135 | -webkit-animation-delay:0s; 136 | -moz-animation-delay:0s; 137 | -ms-animation-delay:0s; 138 | -o-animation-delay:0s; 139 | animation-delay:0s; 140 | } 141 | .cg-busy-default-spinner div.bar2{ 142 | -webkit-transform:rotate(30deg) translate(0, -142%); 143 | -moz-transform:rotate(30deg) translate(0, -142%); 144 | -ms-transform:rotate(30deg) translate(0, -142%); 145 | -o-transform:rotate(30deg) translate(0, -142%); 146 | transform:rotate(30deg) translate(0, -142%); 147 | -webkit-animation-delay:-0.9167s; 148 | -moz-animation-delay:-0.9167s; 149 | -ms-animation-delay:-0.9167s; 150 | -o-animation-delay:-0.9167s; 151 | animation-delay:-0.9167s; 152 | } 153 | .cg-busy-default-spinner div.bar3{ 154 | -webkit-transform:rotate(60deg) translate(0, -142%); 155 | -moz-transform:rotate(60deg) translate(0, -142%); 156 | -ms-transform:rotate(60deg) translate(0, -142%); 157 | -o-transform:rotate(60deg) translate(0, -142%); 158 | transform:rotate(60deg) translate(0, -142%); 159 | -webkit-animation-delay:-0.833s; 160 | -moz-animation-delay:-0.833s; 161 | -ms-animation-delay:-0.833s; 162 | -o-animation-delay:-0.833s; 163 | animation-delay:-0.833s; 164 | } 165 | .cg-busy-default-spinner div.bar4{ 166 | -webkit-transform:rotate(90deg) translate(0, -142%); 167 | -moz-transform:rotate(90deg) translate(0, -142%); 168 | -ms-transform:rotate(90deg) translate(0, -142%); 169 | -o-transform:rotate(90deg) translate(0, -142%); 170 | transform:rotate(90deg) translate(0, -142%); 171 | -webkit-animation-delay:-0.75s; 172 | -moz-animation-delay:-0.75s; 173 | -ms-animation-delay:-0.75s; 174 | -o-animation-delay:-0.75s; 175 | animation-delay:-0.75s; 176 | } 177 | .cg-busy-default-spinner div.bar5{ 178 | -webkit-transform:rotate(120deg) translate(0, -142%); 179 | -moz-transform:rotate(120deg) translate(0, -142%); 180 | -ms-transform:rotate(120deg) translate(0, -142%); 181 | -o-transform:rotate(120deg) translate(0, -142%); 182 | transform:rotate(120deg) translate(0, -142%); 183 | -webkit-animation-delay:-0.667s; 184 | -moz-animation-delay:-0.667s; 185 | -ms-animation-delay:-0.667s; 186 | -o-animation-delay:-0.667s; 187 | animation-delay:-0.667s; 188 | } 189 | .cg-busy-default-spinner div.bar6{ 190 | -webkit-transform:rotate(150deg) translate(0, -142%); 191 | -moz-transform:rotate(150deg) translate(0, -142%); 192 | -ms-transform:rotate(150deg) translate(0, -142%); 193 | -o-transform:rotate(150deg) translate(0, -142%); 194 | transform:rotate(150deg) translate(0, -142%); 195 | -webkit-animation-delay:-0.5833s; 196 | -moz-animation-delay:-0.5833s; 197 | -ms-animation-delay:-0.5833s; 198 | -o-animation-delay:-0.5833s; 199 | animation-delay:-0.5833s; 200 | } 201 | .cg-busy-default-spinner div.bar7{ 202 | -webkit-transform:rotate(180deg) translate(0, -142%); 203 | -moz-transform:rotate(180deg) translate(0, -142%); 204 | -ms-transform:rotate(180deg) translate(0, -142%); 205 | -o-transform:rotate(180deg) translate(0, -142%); 206 | transform:rotate(180deg) translate(0, -142%); 207 | -webkit-animation-delay:-0.5s; 208 | -moz-animation-delay:-0.5s; 209 | -ms-animation-delay:-0.5s; 210 | -o-animation-delay:-0.5s; 211 | animation-delay:-0.5s; 212 | } 213 | .cg-busy-default-spinner div.bar8{ 214 | -webkit-transform:rotate(210deg) translate(0, -142%); 215 | -moz-transform:rotate(210deg) translate(0, -142%); 216 | -ms-transform:rotate(210deg) translate(0, -142%); 217 | -o-transform:rotate(210deg) translate(0, -142%); 218 | transform:rotate(210deg) translate(0, -142%); 219 | -webkit-animation-delay:-0.41667s; 220 | -moz-animation-delay:-0.41667s; 221 | -ms-animation-delay:-0.41667s; 222 | -o-animation-delay:-0.41667s; 223 | animation-delay:-0.41667s; 224 | } 225 | .cg-busy-default-spinner div.bar9{ 226 | -webkit-transform:rotate(240deg) translate(0, -142%); 227 | -moz-transform:rotate(240deg) translate(0, -142%); 228 | -ms-transform:rotate(240deg) translate(0, -142%); 229 | -o-transform:rotate(240deg) translate(0, -142%); 230 | transform:rotate(240deg) translate(0, -142%); 231 | -webkit-animation-delay:-0.333s; 232 | -moz-animation-delay:-0.333s; 233 | -ms-animation-delay:-0.333s; 234 | -o-animation-delay:-0.333s; 235 | animation-delay:-0.333s; 236 | } 237 | .cg-busy-default-spinner div.bar10{ 238 | -webkit-transform:rotate(270deg) translate(0, -142%); 239 | -moz-transform:rotate(270deg) translate(0, -142%); 240 | -ms-transform:rotate(270deg) translate(0, -142%); 241 | -o-transform:rotate(270deg) translate(0, -142%); 242 | transform:rotate(270deg) translate(0, -142%); 243 | -webkit-animation-delay:-0.25s; 244 | -moz-animation-delay:-0.25s; 245 | -ms-animation-delay:-0.25s; 246 | -o-animation-delay:-0.25s; 247 | animation-delay:-0.25s; 248 | } 249 | .cg-busy-default-spinner div.bar11{ 250 | -webkit-transform:rotate(300deg) translate(0, -142%); 251 | -moz-transform:rotate(300deg) translate(0, -142%); 252 | -ms-transform:rotate(300deg) translate(0, -142%); 253 | -o-transform:rotate(300deg) translate(0, -142%); 254 | transform:rotate(300deg) translate(0, -142%); 255 | -webkit-animation-delay:-0.1667s; 256 | -moz-animation-delay:-0.1667s; 257 | -ms-animation-delay:-0.1667s; 258 | -o-animation-delay:-0.1667s; 259 | animation-delay:-0.1667s; 260 | } 261 | .cg-busy-default-spinner div.bar12{ 262 | -webkit-transform:rotate(330deg) translate(0, -142%); 263 | -moz-transform:rotate(330deg) translate(0, -142%); 264 | -ms-transform:rotate(330deg) translate(0, -142%); 265 | -o-transform:rotate(330deg) translate(0, -142%); 266 | transform:rotate(330deg) translate(0, -142%); 267 | -webkit-animation-delay:-0.0833s; 268 | -moz-animation-delay:-0.0833s; 269 | -ms-animation-delay:-0.0833s; 270 | -o-animation-delay:-0.0833s; 271 | animation-delay:-0.0833s; 272 | } 273 | 274 | @-webkit-keyframes cg-busy-spinner-anim{ 275 | from {opacity: 1;} 276 | to {opacity: 0.25;} 277 | } 278 | @-moz-keyframes cg-busy-spinner-anim{ 279 | from {opacity: 1;} 280 | to {opacity: 0.25;} 281 | } 282 | @keyframes cg-busy-spinner-anim{ 283 | from {opacity: 1;} 284 | to {opacity: 0.25;} 285 | } 286 | -------------------------------------------------------------------------------- /dist/angular-busy.min.css: -------------------------------------------------------------------------------- 1 | .cg-busy{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1001}.cg-busy-animation.ng-hide-add,.cg-busy-animation.ng-hide-remove{-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease;display:block!important}.cg-busy-animation.ng-hide-remove{opacity:0;-webkit-transform:translate(0px,-40px);-moz-transform:translate(0px,-40px);-ms-transform:translate(0px,-40px);-o-transform:translate(0px,-40px);transform:translate(0px,-40px)}.cg-busy-animation.ng-hide-add,.cg-busy-animation.ng-hide-remove.ng-hide-remove-active{opacity:1;-webkit-transform:translate(0px,0);-moz-transform:translate(0px,0);-ms-transform:translate(0px,0);-o-transform:translate(0px,0);transform:translate(0px,0)}.cg-busy-animation.ng-hide-add.ng-hide-add-active{opacity:0;-webkit-transform:translate(0px,-40px);-moz-transform:translate(0px,-40px);-ms-transform:translate(0px,-40px);-o-transform:translate(0px,-40px);transform:translate(0px,-40px)}.cg-busy-backdrop{background-color:#fff;opacity:.7}.cg-busy-backdrop-animation.ng-hide-add,.cg-busy-backdrop-animation.ng-hide-remove{-webkit-transition:opacity .3s ease;-moz-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease;display:block!important}.cg-busy-backdrop-animation.ng-hide{opacity:0}.cg-busy-default-wrapper{text-align:center}.cg-busy-default-sign{display:inline-block;position:relative;z-index:1002;padding-bottom:6px;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#e9eeee;border:1px solid #ddd;border-top-width:0;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;border-top-left-radius:0;border-top-right-radius:0;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.cg-busy-default-text{margin:13px 12px 6px 49px;font-size:16px;color:#555;text-align:left;max-width:400px}.cg-busy-default-spinner{position:absolute;width:25px;height:25px;display:inline-block;top:12px;left:14px}.cg-busy-default-spinner div{width:12%;height:26%;background:#000;position:absolute;left:44.5%;top:37%;opacity:0;-webkit-animation:cg-busy-spinner-anim 1s linear infinite;-moz-animation:cg-busy-spinner-anim 1s linear infinite;-ms-animation:cg-busy-spinner-anim 1s linear infinite;-o-animation:cg-busy-spinner-anim 1s linear infinite;animation:cg-busy-spinner-anim 1s linear infinite;-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px;-webkit-box-shadow:0 0 3px rgba(0,0,0,.2);-moz-box-shadow:0 0 3px rgba(0,0,0,.2);box-shadow:0 0 3px rgba(0,0,0,.2)}.cg-busy-default-spinner div.bar1{-webkit-transform:rotate(0deg) translate(0,-142%);-moz-transform:rotate(0deg) translate(0,-142%);-ms-transform:rotate(0deg) translate(0,-142%);-o-transform:rotate(0deg) translate(0,-142%);transform:rotate(0deg) translate(0,-142%);-webkit-animation-delay:0s;-moz-animation-delay:0s;-ms-animation-delay:0s;-o-animation-delay:0s;animation-delay:0s}.cg-busy-default-spinner div.bar2{-webkit-transform:rotate(30deg) translate(0,-142%);-moz-transform:rotate(30deg) translate(0,-142%);-ms-transform:rotate(30deg) translate(0,-142%);-o-transform:rotate(30deg) translate(0,-142%);transform:rotate(30deg) translate(0,-142%);-webkit-animation-delay:-.9167s;-moz-animation-delay:-.9167s;-ms-animation-delay:-.9167s;-o-animation-delay:-.9167s;animation-delay:-.9167s}.cg-busy-default-spinner div.bar3{-webkit-transform:rotate(60deg) translate(0,-142%);-moz-transform:rotate(60deg) translate(0,-142%);-ms-transform:rotate(60deg) translate(0,-142%);-o-transform:rotate(60deg) translate(0,-142%);transform:rotate(60deg) translate(0,-142%);-webkit-animation-delay:-.833s;-moz-animation-delay:-.833s;-ms-animation-delay:-.833s;-o-animation-delay:-.833s;animation-delay:-.833s}.cg-busy-default-spinner div.bar4{-webkit-transform:rotate(90deg) translate(0,-142%);-moz-transform:rotate(90deg) translate(0,-142%);-ms-transform:rotate(90deg) translate(0,-142%);-o-transform:rotate(90deg) translate(0,-142%);transform:rotate(90deg) translate(0,-142%);-webkit-animation-delay:-.75s;-moz-animation-delay:-.75s;-ms-animation-delay:-.75s;-o-animation-delay:-.75s;animation-delay:-.75s}.cg-busy-default-spinner div.bar5{-webkit-transform:rotate(120deg) translate(0,-142%);-moz-transform:rotate(120deg) translate(0,-142%);-ms-transform:rotate(120deg) translate(0,-142%);-o-transform:rotate(120deg) translate(0,-142%);transform:rotate(120deg) translate(0,-142%);-webkit-animation-delay:-.667s;-moz-animation-delay:-.667s;-ms-animation-delay:-.667s;-o-animation-delay:-.667s;animation-delay:-.667s}.cg-busy-default-spinner div.bar6{-webkit-transform:rotate(150deg) translate(0,-142%);-moz-transform:rotate(150deg) translate(0,-142%);-ms-transform:rotate(150deg) translate(0,-142%);-o-transform:rotate(150deg) translate(0,-142%);transform:rotate(150deg) translate(0,-142%);-webkit-animation-delay:-.5833s;-moz-animation-delay:-.5833s;-ms-animation-delay:-.5833s;-o-animation-delay:-.5833s;animation-delay:-.5833s}.cg-busy-default-spinner div.bar7{-webkit-transform:rotate(180deg) translate(0,-142%);-moz-transform:rotate(180deg) translate(0,-142%);-ms-transform:rotate(180deg) translate(0,-142%);-o-transform:rotate(180deg) translate(0,-142%);transform:rotate(180deg) translate(0,-142%);-webkit-animation-delay:-.5s;-moz-animation-delay:-.5s;-ms-animation-delay:-.5s;-o-animation-delay:-.5s;animation-delay:-.5s}.cg-busy-default-spinner div.bar8{-webkit-transform:rotate(210deg) translate(0,-142%);-moz-transform:rotate(210deg) translate(0,-142%);-ms-transform:rotate(210deg) translate(0,-142%);-o-transform:rotate(210deg) translate(0,-142%);transform:rotate(210deg) translate(0,-142%);-webkit-animation-delay:-.41667s;-moz-animation-delay:-.41667s;-ms-animation-delay:-.41667s;-o-animation-delay:-.41667s;animation-delay:-.41667s}.cg-busy-default-spinner div.bar9{-webkit-transform:rotate(240deg) translate(0,-142%);-moz-transform:rotate(240deg) translate(0,-142%);-ms-transform:rotate(240deg) translate(0,-142%);-o-transform:rotate(240deg) translate(0,-142%);transform:rotate(240deg) translate(0,-142%);-webkit-animation-delay:-.333s;-moz-animation-delay:-.333s;-ms-animation-delay:-.333s;-o-animation-delay:-.333s;animation-delay:-.333s}.cg-busy-default-spinner div.bar10{-webkit-transform:rotate(270deg) translate(0,-142%);-moz-transform:rotate(270deg) translate(0,-142%);-ms-transform:rotate(270deg) translate(0,-142%);-o-transform:rotate(270deg) translate(0,-142%);transform:rotate(270deg) translate(0,-142%);-webkit-animation-delay:-.25s;-moz-animation-delay:-.25s;-ms-animation-delay:-.25s;-o-animation-delay:-.25s;animation-delay:-.25s}.cg-busy-default-spinner div.bar11{-webkit-transform:rotate(300deg) translate(0,-142%);-moz-transform:rotate(300deg) translate(0,-142%);-ms-transform:rotate(300deg) translate(0,-142%);-o-transform:rotate(300deg) translate(0,-142%);transform:rotate(300deg) translate(0,-142%);-webkit-animation-delay:-.1667s;-moz-animation-delay:-.1667s;-ms-animation-delay:-.1667s;-o-animation-delay:-.1667s;animation-delay:-.1667s}.cg-busy-default-spinner div.bar12{-webkit-transform:rotate(330deg) translate(0,-142%);-moz-transform:rotate(330deg) translate(0,-142%);-ms-transform:rotate(330deg) translate(0,-142%);-o-transform:rotate(330deg) translate(0,-142%);transform:rotate(330deg) translate(0,-142%);-webkit-animation-delay:-.0833s;-moz-animation-delay:-.0833s;-ms-animation-delay:-.0833s;-o-animation-delay:-.0833s;animation-delay:-.0833s}@-webkit-keyframes cg-busy-spinner-anim{from{opacity:1}to{opacity:.25}}@-moz-keyframes cg-busy-spinner-anim{from{opacity:1}to{opacity:.25}}@keyframes cg-busy-spinner-anim{from{opacity:1}to{opacity:.25}} -------------------------------------------------------------------------------- /dist/angular-busy.min.js: -------------------------------------------------------------------------------- 1 | angular.module("cgBusy",[]),angular.module("cgBusy").factory("_cgBusyTrackerFactory",["$timeout","$q",function(a,b){return function(){var c={};c.promises=[],c.delayPromise=null,c.durationPromise=null,c.delayJustFinished=!1,c.reset=function(b){c.minDuration=b.minDuration,c.promises=[],angular.forEach(b.promises,function(a){a&&!a.$cgBusyFulfilled&&d(a)}),0!==c.promises.length&&(c.delayJustFinished=!1,b.delay&&(c.delayPromise=a(function(){c.delayPromise=null,c.delayJustFinished=!0},parseInt(b.delay,10))),b.minDuration&&(c.durationPromise=a(function(){c.durationPromise=null},parseInt(b.minDuration,10)+(b.delay?parseInt(b.delay,10):0))))},c.isPromise=function(a){var b=a&&(a.then||a.$then||a.$promise&&a.$promise.then);return"undefined"!=typeof b},c.callThen=function(a,c,d){var e;a.then||a.$then?e=a:a.$promise?e=a.$promise:a.denodeify&&(e=b.when(a));var f=e.then||e.$then;f.call(e,c,d)};var d=function(a){if(!c.isPromise(a))throw new Error("cgBusy expects a promise (or something that has a .promise or .$promise");-1===c.promises.indexOf(a)&&(c.promises.push(a),c.callThen(a,function(){a.$cgBusyFulfilled=!0,-1!==c.promises.indexOf(a)&&c.promises.splice(c.promises.indexOf(a),1)},function(){a.$cgBusyFulfilled=!0,-1!==c.promises.indexOf(a)&&c.promises.splice(c.promises.indexOf(a),1)}))};return c.active=function(){return c.delayPromise?!1:c.delayJustFinished?(c.delayJustFinished=!1,0===c.promises.length&&(c.durationPromise=null),c.promises.length>0):c.durationPromise?!0:c.promises.length>0},c}}]),angular.module("cgBusy").value("cgBusyDefaults",{}),angular.module("cgBusy").directive("cgBusy",["$compile","$templateCache","cgBusyDefaults","$http","_cgBusyTrackerFactory",function(a,b,c,d,e){return{restrict:"A",link:function(f,g,h){var i=g.css("position");("static"===i||""===i||"undefined"==typeof i)&&g.css("position","relative");var j,k,l,m,n,o=e(),p={templateUrl:"angular-busy.html",delay:0,minDuration:0,backdrop:!0,message:"Please Wait...",wrapperClass:"cg-busy cg-busy-animation"};angular.extend(p,c),f.$watchCollection(h.cgBusy,function(c){if(c||(c={promise:null}),angular.isString(c))throw new Error("Invalid value for cg-busy. cgBusy no longer accepts string ids to represent promises/trackers.");(angular.isArray(c)||o.isPromise(c))&&(c={promise:c}),c=angular.extend(angular.copy(p),c),c.templateUrl||(c.templateUrl=p.templateUrl),angular.isArray(c.promise)||(c.promise=[c.promise]),m||(m=f.$new()),m.$message=c.message,angular.equals(o.promises,c.promise)||o.reset({promises:c.promise,delay:c.delay,minDuration:c.minDuration}),m.$cgBusyIsActive=function(){return o.active()},j&&l===c.templateUrl&&n===c.backdrop||(j&&j.remove(),k&&k.remove(),l=c.templateUrl,n=c.backdrop,d.get(l,{cache:b}).then(function(b){if(c.backdrop="undefined"==typeof c.backdrop?!0:c.backdrop,c.backdrop){var d='
';k=a(d)(m),g.append(k)}var e='
'+b.data+"
";j=a(e)(m),angular.element(j.children()[0]).css("position","absolute").css("top",0).css("left",0).css("right",0).css("bottom",0),g.append(j)},function(a){throw new Error("Template specified for cgBusy ("+c.templateUrl+") could not be loaded. "+a)}))},!0)}}}]),angular.module("cgBusy").run(["$templateCache",function(a){"use strict";a.put("angular-busy.html",'
\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
{{$message}}
\n\n
\n\n
')}]); -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-busy'); 2 | module.exports = 'cgBusy'; -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('./angular-busy'); 2 | module.exports = 'cgBusy'; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@cgross/angular-busy", 3 | "main": "dist/index.js", 4 | "version": "4.1.4", 5 | "description": "", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/cgross/angular-busy.git" 9 | }, 10 | "devDependencies": { 11 | "grunt": "~0.4.1", 12 | "grunt-contrib-connect": "~0.7.1", 13 | "grunt-contrib-watch": "~0.6.1", 14 | "grunt-contrib-jshint": "~0.10.0", 15 | "grunt-contrib-jasmine": "~0.6.3", 16 | "grunt-angular-templates": "~0.5.4", 17 | "grunt-contrib-concat": "~0.4.0", 18 | "grunt-contrib-copy": "~0.5.0", 19 | "grunt-contrib-uglify": "~0.4.0", 20 | "grunt-contrib-cssmin": "~0.9.0", 21 | "load-grunt-tasks": "~0.4.0" 22 | }, 23 | "scripts": { 24 | "test": "grunt test -v" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/spec.js: -------------------------------------------------------------------------------- 1 | describe('cgBusy', function() { 2 | 3 | beforeEach(module('app')); 4 | 5 | var scope,compile,q,httpBackend,timeout; 6 | 7 | beforeEach(inject(function($rootScope,$compile,$q,$httpBackend,$templateCache,$timeout) { 8 | scope = $rootScope.$new(); 9 | compile = $compile; 10 | q = $q; 11 | httpBackend = $httpBackend; 12 | timeout = $timeout; 13 | httpBackend.whenGET('test-custom-template.html').respond(function(method, url, data, headers){ 14 | 15 | return [[200],'
test-custom-template-contents
']; 16 | }); 17 | })); 18 | 19 | it('should show the overlay during promise', function() { 20 | 21 | this.element = compile('
')(scope); 22 | angular.element('body').append(this.element); 23 | 24 | this.testPromise = q.defer(); 25 | scope.my_promise = this.testPromise.promise; 26 | 27 | //httpBackend.flush(); 28 | 29 | scope.$apply(); 30 | 31 | expect(this.element.children().length).toBe(2); //ensure the elements are added 32 | 33 | expect(this.element.children().css('display')).toBe('block');//ensure its visible (promise is ongoing) 34 | 35 | this.testPromise.resolve(); 36 | scope.$apply(); 37 | 38 | expect(this.element.children().css('display')).toBe('none'); //ensure its now invisible as the promise is resolved 39 | }); 40 | 41 | it('should show the overlay during multiple promises', function() { 42 | 43 | this.element = compile('
')(scope); 44 | angular.element('body').append(this.element); 45 | 46 | this.testPromise = q.defer(); 47 | scope.my_promise = this.testPromise.promise; 48 | 49 | this.testPromise2 = q.defer(); 50 | scope.my_promise2 = this.testPromise2.promise; 51 | 52 | //httpBackend.flush(); 53 | 54 | scope.$apply(); 55 | 56 | expect(this.element.children().length).toBe(2); //ensure the elements are added 57 | 58 | expect(this.element.children().css('display')).toBe('block');//ensure its visible (promise is ongoing) 59 | 60 | this.testPromise.resolve(); 61 | scope.$apply(); 62 | 63 | expect(this.element.children().css('display')).toBe('block'); //ensure its still visible (promise is ongoing) 64 | 65 | this.testPromise2.resolve(); 66 | scope.$apply(); 67 | expect(this.element.children().css('display')).toBe('none'); //ensure its now invisible as the promise is resolved 68 | }); 69 | 70 | it('should load custom templates', function(){ 71 | 72 | this.element = compile('
')(scope); 73 | angular.element('body').append(this.element); 74 | 75 | httpBackend.flush(); 76 | 77 | scope.$apply(); 78 | 79 | expect(angular.element('#custom').html()).toBe('test-custom-template-contents'); 80 | 81 | }); 82 | 83 | it('should delay when delay provided.', function() { 84 | 85 | this.element = compile('
')(scope); 86 | angular.element('body').append(this.element); 87 | 88 | this.testPromise = q.defer(); 89 | scope.my_promise = this.testPromise.promise; 90 | 91 | scope.$apply(); 92 | 93 | expect(this.element.children().length).toBe(2); //ensure the elements are added 94 | 95 | expect(this.element.children().css('display')).toBe('none'); 96 | 97 | timeout.flush(200); 98 | expect(this.element.children().css('display')).toBe('none'); 99 | 100 | timeout.flush(301); 101 | expect(this.element.children().css('display')).toBe('block'); 102 | this.testPromise.resolve(); 103 | scope.$apply(); 104 | expect(this.element.children().css('display')).toBe('none'); 105 | 106 | }); 107 | 108 | it('should use minDuration correctly.', function() { 109 | 110 | this.element = compile('
')(scope); 111 | angular.element('body').append(this.element); 112 | 113 | this.testPromise = q.defer(); 114 | scope.my_promise = this.testPromise.promise; 115 | 116 | scope.$apply(); 117 | 118 | expect(this.element.children().length).toBe(2); //ensure the elements are added 119 | 120 | expect(this.element.children().css('display')).toBe('block'); 121 | 122 | timeout.flush(200); 123 | expect(this.element.children().css('display')).toBe('block'); 124 | 125 | this.testPromise.resolve(); 126 | timeout.flush(400); 127 | expect(this.element.children().css('display')).toBe('block'); 128 | 129 | timeout.flush(300); //900ms total 130 | expect(this.element.children().css('display')).toBe('block'); 131 | 132 | timeout.flush(101); //1001ms total 133 | expect(this.element.children().css('display')).toBe('none'); 134 | 135 | }); 136 | 137 | }); --------------------------------------------------------------------------------