New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-busy

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-busy - npm Package Compare versions

Comparing version

to
4.0.3

6

angular-busy.js
angular.module('cgBusy',[]);
//loosely modeled after angular-promise-tracker
angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout',function($timeout){
angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout','$q',function($timeout,$q){

@@ -45,2 +45,6 @@ return function(){

if (promise.denodeify) {
return $q.when(promise).then;
}
return then;

@@ -47,0 +51,0 @@ };

2

bower.json
{
"name": "angular-busy",
"version": "4.0.2",
"version": "4.0.3",
"main": [

@@ -5,0 +5,0 @@ "dist/angular-busy.js",

angular.module('cgBusy',[]);
//loosely modeled after angular-promise-tracker
angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout',function($timeout){
angular.module('cgBusy').factory('_cgBusyTrackerFactory',['$timeout','$q',function($timeout,$q){

@@ -45,2 +45,6 @@ return function(){

if (promise.denodeify) {
return $q.when(promise).then;
}
return then;

@@ -47,0 +51,0 @@ };

@@ -1,1 +0,1 @@

angular.module("cgBusy",[]),angular.module("cgBusy").factory("_cgBusyTrackerFactory",["$timeout",function(a){return function(){var b={};b.promises=[],b.delayPromise=null,b.durationPromise=null,b.reset=function(d){b.minDuration=d.minDuration,b.promises=[],angular.forEach(d.promises,function(a){a&&!a.$cgBusyFulfilled&&c(a)}),0!==b.promises.length&&(d.delay&&(b.delayPromise=a(function(){b.delayPromise=null},d.delay)),d.minDuration&&(b.durationPromise=a(function(){b.durationPromise=null},d.minDuration)))},b.getThen=function(a){var b=a&&(a.then||a.$then||a.$promise&&a.$promise.then);return b};var c=function(a){var c=b.getThen(a);if(!c)throw new Error("cgBusy expects a promise (or something that has a .promise or .$promise");-1===b.promises.indexOf(a)&&(b.promises.push(a),c(function(){a.$cgBusyFulfilled=!0,-1!==b.promises.indexOf(a)&&b.promises.splice(b.promises.indexOf(a),1)},function(){a.$cgBusyFulfilled=!0,-1!==b.promises.indexOf(a)&&b.promises.splice(b.promises.indexOf(a),1)}))};return b.active=function(){return b.delayPromise?!1:b.durationPromise?!0:b.promises.length>0},b}}]),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=e(),o={templateUrl:"angular-busy.html",delay:0,minDuration:0,backdrop:!0,message:"Please Wait..."};angular.extend(o,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)||n.getThen(c))&&(c={promise:c}),c=angular.extend(angular.copy(o),c),c.templateUrl||(c.templateUrl=o.templateUrl),angular.isArray(c.promise)||(c.promise=[c.promise]),l||(l=f.$new()),l.$message=c.message,angular.equals(n.promises,c.promise)||n.reset({promises:c.promise,delay:c.delay,minDuration:c.minDuration}),l.$cgBusyIsActive=function(){return n.active()},j&&k===c.templateUrl&&m===c.backdrop||(j&&j.remove(),k=c.templateUrl,m=c.backdrop,d.get(k,{cache:b}).success(function(b){c.backdrop="undefined"==typeof c.backdrop?!0:c.backdrop;var d=c.backdrop?'<div class="cg-busy cg-busy-backdrop"></div>':"",e='<div class="cg-busy cg-busy-animation ng-hide" ng-show="$cgBusyIsActive()">'+d+b+"</div>";j=a(e)(l),angular.element(j.children()[c.backdrop?1:0]).css("position","absolute").css("top",0).css("left",0).css("right",0).css("bottom",0),g.append(j)}).error(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",'<div class="cg-busy-default-wrapper">\n\n <div class="cg-busy-default-sign">\n\n <div class="cg-busy-default-spinner">\n <div class="bar1"></div>\n <div class="bar2"></div>\n <div class="bar3"></div>\n <div class="bar4"></div>\n <div class="bar5"></div>\n <div class="bar6"></div>\n <div class="bar7"></div>\n <div class="bar8"></div>\n <div class="bar9"></div>\n <div class="bar10"></div>\n <div class="bar11"></div>\n <div class="bar12"></div>\n </div>\n\n <div class="cg-busy-default-text">{{$message}}</div>\n\n </div>\n\n</div>')}]);
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.reset=function(b){c.minDuration=b.minDuration,c.promises=[],angular.forEach(b.promises,function(a){a&&!a.$cgBusyFulfilled&&d(a)}),0!==c.promises.length&&(b.delay&&(c.delayPromise=a(function(){c.delayPromise=null},b.delay)),b.minDuration&&(c.durationPromise=a(function(){c.durationPromise=null},b.minDuration)))},c.getThen=function(a){var c=a&&(a.then||a.$then||a.$promise&&a.$promise.then);return a.denodeify?b.when(a).then:c};var d=function(a){var b=c.getThen(a);if(!b)throw new Error("cgBusy expects a promise (or something that has a .promise or .$promise");-1===c.promises.indexOf(a)&&(c.promises.push(a),b(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.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=e(),o={templateUrl:"angular-busy.html",delay:0,minDuration:0,backdrop:!0,message:"Please Wait..."};angular.extend(o,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)||n.getThen(c))&&(c={promise:c}),c=angular.extend(angular.copy(o),c),c.templateUrl||(c.templateUrl=o.templateUrl),angular.isArray(c.promise)||(c.promise=[c.promise]),l||(l=f.$new()),l.$message=c.message,angular.equals(n.promises,c.promise)||n.reset({promises:c.promise,delay:c.delay,minDuration:c.minDuration}),l.$cgBusyIsActive=function(){return n.active()},j&&k===c.templateUrl&&m===c.backdrop||(j&&j.remove(),k=c.templateUrl,m=c.backdrop,d.get(k,{cache:b}).success(function(b){c.backdrop="undefined"==typeof c.backdrop?!0:c.backdrop;var d=c.backdrop?'<div class="cg-busy cg-busy-backdrop"></div>':"",e='<div class="cg-busy cg-busy-animation ng-hide" ng-show="$cgBusyIsActive()">'+d+b+"</div>";j=a(e)(l),angular.element(j.children()[c.backdrop?1:0]).css("position","absolute").css("top",0).css("left",0).css("right",0).css("bottom",0),g.append(j)}).error(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",'<div class="cg-busy-default-wrapper">\n\n <div class="cg-busy-default-sign">\n\n <div class="cg-busy-default-spinner">\n <div class="bar1"></div>\n <div class="bar2"></div>\n <div class="bar3"></div>\n <div class="bar4"></div>\n <div class="bar5"></div>\n <div class="bar6"></div>\n <div class="bar7"></div>\n <div class="bar8"></div>\n <div class="bar9"></div>\n <div class="bar10"></div>\n <div class="bar11"></div>\n <div class="bar12"></div>\n </div>\n\n <div class="cg-busy-default-text">{{$message}}</div>\n\n </div>\n\n</div>')}]);
{
"name": "angular-busy",
"version": "4.0.2",
"version": "4.0.3",
"description": "",

@@ -5,0 +5,0 @@ "repository": {

@@ -92,2 +92,3 @@ # angular-busy [![Build Status](https://travis-ci.org/cgross/angular-busy.png?branch=master)](https://travis-ci.org/cgross/angular-busy)

## Release History
* v4.0.3 - Now supports Q promises.
* v4.0.2 - Fix for min duration only being used when delay also being set.

@@ -94,0 +95,0 @@ * v4.0.0 - Big update