Huge News!Announcing our $40M Series B led by Abstract Ventures.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 4.1.1 to 4.1.2

9

angular-busy.js

@@ -46,3 +46,3 @@ angular.module('cgBusy',[]);

var then = promiseThing && (promiseThing.then || promiseThing.$then ||
(promiseThing.$promiseThing && promiseThing.$promiseThing.then));
(promiseThing.$promise && promiseThing.$promise.then));

@@ -62,3 +62,3 @@ return typeof then !== 'undefined';

var then = (promise.then || promise.$them);
var then = (promise.then || promise.$then);

@@ -144,3 +144,4 @@ then.call(promise,success,error);

backdrop: true,
message:'Please Wait...'
message:'Please Wait...',
wrapperClass: 'cg-busy cg-busy-animation'
};

@@ -222,3 +223,3 @@

var template = '<div class="cg-busy cg-busy-animation ng-hide" ng-show="$cgBusyIsActive()">' + indicatorTemplate + '</div>';
var template = '<div class="'+options.wrapperClass+' ng-hide" ng-show="$cgBusyIsActive()">' + indicatorTemplate + '</div>';
templateElement = $compile(template)(templateScope);

@@ -225,0 +226,0 @@

{
"name": "angular-busy",
"version": "4.1.1",
"version": "4.1.2",
"main": [

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

@@ -46,3 +46,3 @@ angular.module('cgBusy',[]);

var then = promiseThing && (promiseThing.then || promiseThing.$then ||
(promiseThing.$promiseThing && promiseThing.$promiseThing.then));
(promiseThing.$promise && promiseThing.$promise.then));

@@ -62,3 +62,3 @@ return typeof then !== 'undefined';

var then = (promise.then || promise.$them);
var then = (promise.then || promise.$then);

@@ -144,3 +144,4 @@ then.call(promise,success,error);

backdrop: true,
message:'Please Wait...'
message:'Please Wait...',
wrapperClass: 'cg-busy cg-busy-animation'
};

@@ -222,3 +223,3 @@

var template = '<div class="cg-busy cg-busy-animation ng-hide" ng-show="$cgBusyIsActive()">' + indicatorTemplate + '</div>';
var template = '<div class="'+options.wrapperClass+' ng-hide" ng-show="$cgBusyIsActive()">' + indicatorTemplate + '</div>';
templateElement = $compile(template)(templateScope);

@@ -250,25 +251,48 @@

$templateCache.put('angular-busy.html',
"<div class=\"cg-busy-default-wrapper\">\n" +
"<div class=\"cg-busy-default-wrapper\">\r" +
"\n" +
" <div class=\"cg-busy-default-sign\">\n" +
"\r" +
"\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" +
" <div class=\"cg-busy-default-sign\">\r" +
"\n" +
" <div class=\"cg-busy-default-text\">{{$message}}</div>\n" +
"\r" +
"\n" +
" </div>\n" +
" <div class=\"cg-busy-default-spinner\">\r" +
"\n" +
" <div class=\"bar1\"></div>\r" +
"\n" +
" <div class=\"bar2\"></div>\r" +
"\n" +
" <div class=\"bar3\"></div>\r" +
"\n" +
" <div class=\"bar4\"></div>\r" +
"\n" +
" <div class=\"bar5\"></div>\r" +
"\n" +
" <div class=\"bar6\"></div>\r" +
"\n" +
" <div class=\"bar7\"></div>\r" +
"\n" +
" <div class=\"bar8\"></div>\r" +
"\n" +
" <div class=\"bar9\"></div>\r" +
"\n" +
" <div class=\"bar10\"></div>\r" +
"\n" +
" <div class=\"bar11\"></div>\r" +
"\n" +
" <div class=\"bar12\"></div>\r" +
"\n" +
" </div>\r" +
"\n" +
"\r" +
"\n" +
" <div class=\"cg-busy-default-text\">{{$message}}</div>\r" +
"\n" +
"\r" +
"\n" +
" </div>\r" +
"\n" +
"\r" +
"\n" +
"</div>"

@@ -275,0 +299,0 @@ );

@@ -1,1 +0,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.$promiseThing&&a.$promiseThing.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.$them;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,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..."};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}).success(function(b){if(c.backdrop="undefined"==typeof c.backdrop?!0:c.backdrop,c.backdrop){var d='<div class="cg-busy cg-busy-backdrop cg-busy-backdrop-animation ng-hide" ng-show="$cgBusyIsActive()"></div>';k=a(d)(m),g.append(k)}var e='<div class="cg-busy cg-busy-animation ng-hide" ng-show="$cgBusyIsActive()">'+b+"</div>";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)}).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.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,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}).success(function(b){if(c.backdrop="undefined"==typeof c.backdrop?!0:c.backdrop,c.backdrop){var d='<div class="cg-busy cg-busy-backdrop cg-busy-backdrop-animation ng-hide" ng-show="$cgBusyIsActive()"></div>';k=a(d)(m),g.append(k)}var e='<div class="'+c.wrapperClass+' ng-hide" ng-show="$cgBusyIsActive()">'+b+"</div>";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)}).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">\r\n\r\n <div class="cg-busy-default-sign">\r\n\r\n <div class="cg-busy-default-spinner">\r\n <div class="bar1"></div>\r\n <div class="bar2"></div>\r\n <div class="bar3"></div>\r\n <div class="bar4"></div>\r\n <div class="bar5"></div>\r\n <div class="bar6"></div>\r\n <div class="bar7"></div>\r\n <div class="bar8"></div>\r\n <div class="bar9"></div>\r\n <div class="bar10"></div>\r\n <div class="bar11"></div>\r\n <div class="bar12"></div>\r\n </div>\r\n\r\n <div class="cg-busy-default-text">{{$message}}</div>\r\n\r\n </div>\r\n\r\n</div>')}]);
{
"name": "angular-busy",
"version": "4.1.1",
"version": "4.1.2",
"description": "",

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

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

* `minDuration` - Optional. The amount of time to keep the indicator showing even if the promise was resolved quicker. Defaults to 0. Specified in milliseconds.
* `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.

@@ -81,7 +82,8 @@ ## Providing Custom Templates

angular.module('your_app').value('cgBusyDefaults',{
message:'Loading Stuff',
backdrop: false,
templateUrl: 'my_custom_template.html',
delay: 300,
minDuration: 700
message:'Loading Stuff',
backdrop: false,
templateUrl: 'my_custom_template.html',
delay: 300,
minDuration: 700,
wrapperClass: 'my-class my-class2'
});

@@ -94,2 +96,3 @@ ```

## Release History
* v4.1.2 - Small bugs fixed, wrapperClass option added.
* v4.1.1 - Compatibility with Angular 1.3.

@@ -96,0 +99,0 @@ * v4.1.0

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc