From 6b67da47e62fc481260fda97478a113e900b256b Mon Sep 17 00:00:00 2001 From: Art Deineka Date: Thu, 10 Dec 2015 15:53:47 +0000 Subject: [PATCH 1/2] added controller as syntax --- README.md | 5 +++-- src/dialogs-services.js | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3600fb1..507e323 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ app.controller("MyCtrl", function(dialogs){ ```dialogs.notify('Something Happened','Something happened at this point in the application that I wish to let you know about');``` -```dialogs.create('url/to/a/template','ctrlrToUse',{data: topass,anotherVar: 'value'},{});``` +```dialogs.create('url/to/a/template','ctrlrToUse',{data: topass,anotherVar: 'value'},{},'ctrl');``` ### API @@ -61,7 +61,7 @@ All Dialogs return a object with property `result` which is a promise `OK/Yes` r #### dialogs.create -```dialogs.create(url, ctrlr, data, opts)``` +```dialogs.create(url, ctrlr, data, opts, ctrlAs)``` | Name | Type | Description | |---|---|---| @@ -69,6 +69,7 @@ All Dialogs return a object with property `result` which is a promise `OK/Yes` r | ctrlr | `string` | Dialog Controller | | data | `object` | data available as a "data" service in the controller | | opts | `object` | Options for the dialog with the addition of `copy: false|true` which will copy the data instead of passing reference | +| ctrlAs | `string` | `controllerAs` reference #### IDialogOptions Properties diff --git a/src/dialogs-services.js b/src/dialogs-services.js index 5c1b7a5..f51f6a1 100644 --- a/src/dialogs-services.js +++ b/src/dialogs-services.js @@ -28,9 +28,9 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Backdrop - * + * * Sets the use of the modal backdrop. Either to have one or not and - * whether or not it responds to mouse clicks ('static' sets the + * whether or not it responds to mouse clicks ('static' sets the * backdrop to true and does not respond to mouse clicks). * * @param val mixed (true, false, 'static') @@ -42,7 +42,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use ESC Close - * + * * Sets the use of the ESC (escape) key to close modal windows. * * @param val boolean @@ -66,7 +66,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Copy - * + * * Determines the use of angular.copy when sending data to the modal controller. * * @param val boolean @@ -91,7 +91,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Set Size * - * Sets the modal size to use (sm,lg,md), requires Angular-ui-Bootstrap 0.11.0 and Bootstrap 3.1.0 + + * Sets the modal size to use (sm,lg,md), requires Angular-ui-Bootstrap 0.11.0 and Bootstrap 3.1.0 + * * @param val string (sm,lg,md) */ @@ -121,7 +121,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) this.$get = ['$uibModal',function ($uibModal){ - + return { /** * Error Dialog @@ -153,7 +153,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end error - + /** * Wait Dialog * @@ -186,7 +186,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end wait - + /** * Notify Dialog * @@ -217,7 +217,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end notify - + /** * Confirm Dialog * @@ -248,7 +248,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end confirm - + /** * Create Custom Dialog * @@ -257,13 +257,14 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) * @param data object * @param opts object */ - create : function(url,ctrlr,data,opts){ + create : function(url,ctrlr,data,opts,ctrlAs){ var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy; opts = _setOpts(opts); return $uibModal.open({ templateUrl : url, controller : ctrlr, + controllerAs : ctrlAs, keyboard : opts.kb, backdrop : opts.bd, backdropClass: opts.bdc, @@ -271,7 +272,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) size: opts.ws, animation: opts.anim, resolve : { - data : function() { + data : function() { if(copy) return angular.copy(data); else From aebf6be877517507ff9509b361d56e19a1077175 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Thu, 10 Dec 2015 11:03:42 -0600 Subject: [PATCH 2/2] Bumped the version --- bower.json | 2 +- dist/dialogs-default-translations.js | 2 +- dist/dialogs.js | 27 +++++++++++----------- dist/dialogs.min.js | 2 +- example/js/dialogs-default-translations.js | 2 +- example/js/dialogs.js | 27 +++++++++++----------- example/js/dialogs.min.js | 2 +- package.json | 2 +- src/dialogs-services.js | 2 +- src/dialogs.js | 25 ++++++++++---------- 10 files changed, 48 insertions(+), 45 deletions(-) diff --git a/bower.json b/bower.json index d365172..f13d9cd 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-dialog-service", "description": "A service to handle common dialog types in a web application. Built on top of Angular-Bootstrap's modal", - "version": "5.2.10", + "version": "5.2.11", "keywords": [ "angular", "dialog", diff --git a/dist/dialogs-default-translations.js b/dist/dialogs-default-translations.js index bbc894e..5399dfe 100644 --- a/dist/dialogs-default-translations.js +++ b/dist/dialogs-default-translations.js @@ -1,6 +1,6 @@ /** * angular-dialog-service - A service to handle common dialog types in a web application. Built on top of Angular-Bootstrap's modal - * @version v5.2.10 + * @version v5.2.11 * @author Michael Conroy, michael.e.conroy@gmail.com * @license MIT, http://www.opensource.org/licenses/MIT */ diff --git a/dist/dialogs.js b/dist/dialogs.js index f8d1697..f7c1f2e 100644 --- a/dist/dialogs.js +++ b/dist/dialogs.js @@ -1,6 +1,6 @@ /** * angular-dialog-service - A service to handle common dialog types in a web application. Built on top of Angular-Bootstrap's modal - * @version v5.2.10 + * @version v5.2.11 * @author Michael Conroy, michael.e.conroy@gmail.com * @license MIT, http://www.opensource.org/licenses/MIT */ @@ -212,9 +212,9 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Backdrop - * + * * Sets the use of the modal backdrop. Either to have one or not and - * whether or not it responds to mouse clicks ('static' sets the + * whether or not it responds to mouse clicks ('static' sets the * backdrop to true and does not respond to mouse clicks). * * @param val mixed (true, false, 'static') @@ -226,7 +226,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use ESC Close - * + * * Sets the use of the ESC (escape) key to close modal windows. * * @param val boolean @@ -250,7 +250,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Copy - * + * * Determines the use of angular.copy when sending data to the modal controller. * * @param val boolean @@ -275,7 +275,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Set Size * - * Sets the modal size to use (sm,lg,md), requires Angular-ui-Bootstrap 0.11.0 and Bootstrap 3.1.0 + + * Sets the modal size to use (sm,lg,md) * * @param val string (sm,lg,md) */ @@ -305,7 +305,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) this.$get = ['$uibModal',function ($uibModal){ - + return { /** * Error Dialog @@ -337,7 +337,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end error - + /** * Wait Dialog * @@ -370,7 +370,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end wait - + /** * Notify Dialog * @@ -401,7 +401,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end notify - + /** * Confirm Dialog * @@ -432,7 +432,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end confirm - + /** * Create Custom Dialog * @@ -441,13 +441,14 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) * @param data object * @param opts object */ - create : function(url,ctrlr,data,opts){ + create : function(url,ctrlr,data,opts,ctrlAs){ var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy; opts = _setOpts(opts); return $uibModal.open({ templateUrl : url, controller : ctrlr, + controllerAs : ctrlAs, keyboard : opts.kb, backdrop : opts.bd, backdropClass: opts.bdc, @@ -455,7 +456,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) size: opts.ws, animation: opts.anim, resolve : { - data : function() { + data : function() { if(copy) return angular.copy(data); else diff --git a/dist/dialogs.min.js b/dist/dialogs.min.js index f5d4657..2c1ee5f 100644 --- a/dist/dialogs.min.js +++ b/dist/dialogs.min.js @@ -1 +1 @@ -!function(){"use strict";var a=angular.module("translate.sub",[]);a.provider("$translate",[function(){var a=[],n="en-US";this.translations=function(e,s){angular.isDefined(e)&&angular.isDefined(s)&&(a[e]=angular.copy(s),n=e)},this.$get=[function(){return{instant:function(e){return angular.isDefined(e)&&angular.isDefined(a[n][e])?a[n][e]:""}}}]}]),a.filter("translate",["$translate",function(a){return function(n){return a.instant(n)}}]);var n;try{angular.module("pascalprecht.translate"),n=angular.module("dialogs.controllers",["ui.bootstrap.modal","pascalprecht.translate"])}catch(e){n=angular.module("dialogs.controllers",["ui.bootstrap.modal","translate.sub"])}n.controller("errorDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_ERROR"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_ERROR_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-warning":"glyphicon glyphicon-warning-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("waitDialogCtrl",["$scope","$uibModalInstance","$translate","$timeout","data",function(a,n,e,s,t){a.header=angular.isDefined(t.header)?t.header:e.instant("DIALOGS_PLEASE_WAIT_ELIPS"),a.msg=angular.isDefined(t.msg)?t.msg:e.instant("DIALOGS_PLEASE_WAIT_MSG"),a.progress=angular.isDefined(t.progress)?t.progress:100,a.icon=angular.isDefined(t.fa)&&angular.equals(t.fa,!0)?"fa fa-clock-o":"glyphicon glyphicon-time",a.$on("dialogs.wait.complete",function(){s(function(){n.close(),a.$destroy()})}),a.$on("dialogs.wait.message",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg}),a.$on("dialogs.wait.progress",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg,a.progress=angular.isDefined(e.progress)?e.progress:a.progress}),a.getProgress=function(){return{width:a.progress+"%"}}}]),n.controller("notifyDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_NOTIFICATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_NOTIFICATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-info":"glyphicon glyphicon-info-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("confirmDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_CONFIRMATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_CONFIRMATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-check":"glyphicon glyphicon-check",a.no=function(){n.dismiss("no")},a.yes=function(){n.close("yes")}}]),angular.module("dialogs.services",["ui.bootstrap.modal","dialogs.controllers"]).provider("dialogs",[function(){var a=!0,n=!0,e="dialogs-default",s="dialogs-backdrop-default",t=!0,o=null,l="lg",i=!1,r=!1,d=function(t){var o={};return t=t||{},o.kb=angular.isDefined(t.keyboard)?!!t.keyboard:n,o.bd=angular.isDefined(t.backdrop)?t.backdrop:a,o.bdc=angular.isDefined(t.backdropClass)?t.backdropClass:s,o.ws=!angular.isDefined(t.size)||"sm"!==t.size&&"lg"!==t.size&&"md"!==t.size?l:t.size,o.wc=angular.isDefined(t.windowClass)?t.windowClass:e,o.anim=angular.isDefined(t.animation)?!!t.animation:i,o};this.useBackdrop=function(n){angular.isDefined(n)&&(a=n)},this.useEscClose=function(a){angular.isDefined(a)&&(n=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.useClass=function(a){angular.isDefined(a)&&(e=a)},this.useCopy=function(a){angular.isDefined(a)&&(t=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.setWindowTmpl=function(a){angular.isDefined(a)&&(o=a)},this.setSize=function(a){angular.isDefined(a)&&(l=angular.equals(a,"sm")||angular.equals(a,"lg")||angular.equals(a,"md")?a:l)},this.useAnimation=function(){i=!0},this.useFontAwesome=function(){r=!0},this.$get=["$uibModal",function(a){return{error:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/error.html",controller:"errorDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:r}}}})},wait:function(n,e,s,t){return t=d(t),a.open({templateUrl:"/dialogs/wait.html",controller:"waitDialogCtrl",backdrop:t.bd,backdropClass:t.bdc,keyboard:t.kb,windowClass:t.wc,size:t.ws,animation:t.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),progress:angular.copy(s),fa:r}}}})},notify:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/notify.html",controller:"notifyDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:r}}}})},confirm:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/confirm.html",controller:"confirmDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:r}}}})},create:function(n,e,s,o){var l=o&&angular.isDefined(o.copy)?o.copy:t;return o=d(o),a.open({templateUrl:n,controller:e,keyboard:o.kb,backdrop:o.bd,backdropClass:o.bdc,windowClass:o.wc,size:o.ws,animation:o.anim,resolve:{data:function(){return l?angular.copy(s):s}}})}}}]}]),angular.module("dialogs.main",["dialogs.services","ngSanitize"]).config(["$translateProvider","dialogsProvider",function(a,n){try{angular.module("pascalprecht.translate")}catch(e){a.translations("en-US",{DIALOGS_ERROR:"Error",DIALOGS_ERROR_MSG:"An unknown error has occurred.",DIALOGS_CLOSE:"Close",DIALOGS_PLEASE_WAIT:"Please Wait",DIALOGS_PLEASE_WAIT_ELIPS:"Please Wait...",DIALOGS_PLEASE_WAIT_MSG:"Waiting on operation to complete.",DIALOGS_PERCENT_COMPLETE:"% Complete",DIALOGS_NOTIFICATION:"Notification",DIALOGS_NOTIFICATION_MSG:"Unknown application notification.",DIALOGS_CONFIRMATION:"Confirmation",DIALOGS_CONFIRMATION_MSG:"Confirmation required.",DIALOGS_OK:"OK",DIALOGS_YES:"Yes",DIALOGS_NO:"No"})}try{var s=document.styleSheets;a:for(var t=s.length-1;t>=0;t--){var o=null,l=null;if(!s[t].disabled){if(null!==s[t].href&&(o=s[t].href.match(/font\-*awesome/i)),angular.isArray(o)){n.useFontAwesome();break}l=s[t].cssRules;for(var i=l.length-1;i>=0;i--)if(".fa"==l[i].selectorText.toLowerCase()){n.useFontAwesome();break a}}}}catch(e){}}]).run(["$templateCache","$interpolate",function(a,n){var e=n.startSymbol(),s=n.endSymbol();a.put("/dialogs/error.html",'"),a.put("/dialogs/wait.html",'"),a.put("/dialogs/notify.html",'"),a.put("/dialogs/confirm.html",'")}])}(); \ No newline at end of file +!function(){"use strict";var a=angular.module("translate.sub",[]);a.provider("$translate",[function(){var a=[],n="en-US";this.translations=function(e,s){angular.isDefined(e)&&angular.isDefined(s)&&(a[e]=angular.copy(s),n=e)},this.$get=[function(){return{instant:function(e){return angular.isDefined(e)&&angular.isDefined(a[n][e])?a[n][e]:""}}}]}]),a.filter("translate",["$translate",function(a){return function(n){return a.instant(n)}}]);var n;try{angular.module("pascalprecht.translate"),n=angular.module("dialogs.controllers",["ui.bootstrap.modal","pascalprecht.translate"])}catch(e){n=angular.module("dialogs.controllers",["ui.bootstrap.modal","translate.sub"])}n.controller("errorDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_ERROR"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_ERROR_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-warning":"glyphicon glyphicon-warning-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("waitDialogCtrl",["$scope","$uibModalInstance","$translate","$timeout","data",function(a,n,e,s,o){a.header=angular.isDefined(o.header)?o.header:e.instant("DIALOGS_PLEASE_WAIT_ELIPS"),a.msg=angular.isDefined(o.msg)?o.msg:e.instant("DIALOGS_PLEASE_WAIT_MSG"),a.progress=angular.isDefined(o.progress)?o.progress:100,a.icon=angular.isDefined(o.fa)&&angular.equals(o.fa,!0)?"fa fa-clock-o":"glyphicon glyphicon-time",a.$on("dialogs.wait.complete",function(){s(function(){n.close(),a.$destroy()})}),a.$on("dialogs.wait.message",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg}),a.$on("dialogs.wait.progress",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg,a.progress=angular.isDefined(e.progress)?e.progress:a.progress}),a.getProgress=function(){return{width:a.progress+"%"}}}]),n.controller("notifyDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_NOTIFICATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_NOTIFICATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-info":"glyphicon glyphicon-info-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("confirmDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_CONFIRMATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_CONFIRMATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-check":"glyphicon glyphicon-check",a.no=function(){n.dismiss("no")},a.yes=function(){n.close("yes")}}]),angular.module("dialogs.services",["ui.bootstrap.modal","dialogs.controllers"]).provider("dialogs",[function(){var a=!0,n=!0,e="dialogs-default",s="dialogs-backdrop-default",o=!0,t=null,l="lg",r=!1,i=!1,d=function(o){var t={};return o=o||{},t.kb=angular.isDefined(o.keyboard)?!!o.keyboard:n,t.bd=angular.isDefined(o.backdrop)?o.backdrop:a,t.bdc=angular.isDefined(o.backdropClass)?o.backdropClass:s,t.ws=!angular.isDefined(o.size)||"sm"!==o.size&&"lg"!==o.size&&"md"!==o.size?l:o.size,t.wc=angular.isDefined(o.windowClass)?o.windowClass:e,t.anim=angular.isDefined(o.animation)?!!o.animation:r,t};this.useBackdrop=function(n){angular.isDefined(n)&&(a=n)},this.useEscClose=function(a){angular.isDefined(a)&&(n=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.useClass=function(a){angular.isDefined(a)&&(e=a)},this.useCopy=function(a){angular.isDefined(a)&&(o=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.setWindowTmpl=function(a){angular.isDefined(a)&&(t=a)},this.setSize=function(a){angular.isDefined(a)&&(l=angular.equals(a,"sm")||angular.equals(a,"lg")||angular.equals(a,"md")?a:l)},this.useAnimation=function(){r=!0},this.useFontAwesome=function(){i=!0},this.$get=["$uibModal",function(a){return{error:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/error.html",controller:"errorDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:i}}}})},wait:function(n,e,s,o){return o=d(o),a.open({templateUrl:"/dialogs/wait.html",controller:"waitDialogCtrl",backdrop:o.bd,backdropClass:o.bdc,keyboard:o.kb,windowClass:o.wc,size:o.ws,animation:o.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),progress:angular.copy(s),fa:i}}}})},notify:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/notify.html",controller:"notifyDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:i}}}})},confirm:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/confirm.html",controller:"confirmDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:i}}}})},create:function(n,e,s,t,l){var r=t&&angular.isDefined(t.copy)?t.copy:o;return t=d(t),a.open({templateUrl:n,controller:e,controllerAs:l,keyboard:t.kb,backdrop:t.bd,backdropClass:t.bdc,windowClass:t.wc,size:t.ws,animation:t.anim,resolve:{data:function(){return r?angular.copy(s):s}}})}}}]}]),angular.module("dialogs.main",["dialogs.services","ngSanitize"]).config(["$translateProvider","dialogsProvider",function(a,n){try{angular.module("pascalprecht.translate")}catch(e){a.translations("en-US",{DIALOGS_ERROR:"Error",DIALOGS_ERROR_MSG:"An unknown error has occurred.",DIALOGS_CLOSE:"Close",DIALOGS_PLEASE_WAIT:"Please Wait",DIALOGS_PLEASE_WAIT_ELIPS:"Please Wait...",DIALOGS_PLEASE_WAIT_MSG:"Waiting on operation to complete.",DIALOGS_PERCENT_COMPLETE:"% Complete",DIALOGS_NOTIFICATION:"Notification",DIALOGS_NOTIFICATION_MSG:"Unknown application notification.",DIALOGS_CONFIRMATION:"Confirmation",DIALOGS_CONFIRMATION_MSG:"Confirmation required.",DIALOGS_OK:"OK",DIALOGS_YES:"Yes",DIALOGS_NO:"No"})}try{var s=document.styleSheets;a:for(var o=s.length-1;o>=0;o--){var t=null,l=null;if(!s[o].disabled){if(null!==s[o].href&&(t=s[o].href.match(/font\-*awesome/i)),angular.isArray(t)){n.useFontAwesome();break}l=s[o].cssRules;for(var r=l.length-1;r>=0;r--)if(".fa"==l[r].selectorText.toLowerCase()){n.useFontAwesome();break a}}}}catch(e){}}]).run(["$templateCache","$interpolate",function(a,n){var e=n.startSymbol(),s=n.endSymbol();a.put("/dialogs/error.html",'"),a.put("/dialogs/wait.html",'"),a.put("/dialogs/notify.html",'"),a.put("/dialogs/confirm.html",'")}])}(); \ No newline at end of file diff --git a/example/js/dialogs-default-translations.js b/example/js/dialogs-default-translations.js index bbc894e..5399dfe 100644 --- a/example/js/dialogs-default-translations.js +++ b/example/js/dialogs-default-translations.js @@ -1,6 +1,6 @@ /** * angular-dialog-service - A service to handle common dialog types in a web application. Built on top of Angular-Bootstrap's modal - * @version v5.2.10 + * @version v5.2.11 * @author Michael Conroy, michael.e.conroy@gmail.com * @license MIT, http://www.opensource.org/licenses/MIT */ diff --git a/example/js/dialogs.js b/example/js/dialogs.js index f8d1697..f7c1f2e 100644 --- a/example/js/dialogs.js +++ b/example/js/dialogs.js @@ -1,6 +1,6 @@ /** * angular-dialog-service - A service to handle common dialog types in a web application. Built on top of Angular-Bootstrap's modal - * @version v5.2.10 + * @version v5.2.11 * @author Michael Conroy, michael.e.conroy@gmail.com * @license MIT, http://www.opensource.org/licenses/MIT */ @@ -212,9 +212,9 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Backdrop - * + * * Sets the use of the modal backdrop. Either to have one or not and - * whether or not it responds to mouse clicks ('static' sets the + * whether or not it responds to mouse clicks ('static' sets the * backdrop to true and does not respond to mouse clicks). * * @param val mixed (true, false, 'static') @@ -226,7 +226,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use ESC Close - * + * * Sets the use of the ESC (escape) key to close modal windows. * * @param val boolean @@ -250,7 +250,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Copy - * + * * Determines the use of angular.copy when sending data to the modal controller. * * @param val boolean @@ -275,7 +275,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Set Size * - * Sets the modal size to use (sm,lg,md), requires Angular-ui-Bootstrap 0.11.0 and Bootstrap 3.1.0 + + * Sets the modal size to use (sm,lg,md) * * @param val string (sm,lg,md) */ @@ -305,7 +305,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) this.$get = ['$uibModal',function ($uibModal){ - + return { /** * Error Dialog @@ -337,7 +337,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end error - + /** * Wait Dialog * @@ -370,7 +370,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end wait - + /** * Notify Dialog * @@ -401,7 +401,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end notify - + /** * Confirm Dialog * @@ -432,7 +432,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end confirm - + /** * Create Custom Dialog * @@ -441,13 +441,14 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) * @param data object * @param opts object */ - create : function(url,ctrlr,data,opts){ + create : function(url,ctrlr,data,opts,ctrlAs){ var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy; opts = _setOpts(opts); return $uibModal.open({ templateUrl : url, controller : ctrlr, + controllerAs : ctrlAs, keyboard : opts.kb, backdrop : opts.bd, backdropClass: opts.bdc, @@ -455,7 +456,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) size: opts.ws, animation: opts.anim, resolve : { - data : function() { + data : function() { if(copy) return angular.copy(data); else diff --git a/example/js/dialogs.min.js b/example/js/dialogs.min.js index f5d4657..2c1ee5f 100644 --- a/example/js/dialogs.min.js +++ b/example/js/dialogs.min.js @@ -1 +1 @@ -!function(){"use strict";var a=angular.module("translate.sub",[]);a.provider("$translate",[function(){var a=[],n="en-US";this.translations=function(e,s){angular.isDefined(e)&&angular.isDefined(s)&&(a[e]=angular.copy(s),n=e)},this.$get=[function(){return{instant:function(e){return angular.isDefined(e)&&angular.isDefined(a[n][e])?a[n][e]:""}}}]}]),a.filter("translate",["$translate",function(a){return function(n){return a.instant(n)}}]);var n;try{angular.module("pascalprecht.translate"),n=angular.module("dialogs.controllers",["ui.bootstrap.modal","pascalprecht.translate"])}catch(e){n=angular.module("dialogs.controllers",["ui.bootstrap.modal","translate.sub"])}n.controller("errorDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_ERROR"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_ERROR_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-warning":"glyphicon glyphicon-warning-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("waitDialogCtrl",["$scope","$uibModalInstance","$translate","$timeout","data",function(a,n,e,s,t){a.header=angular.isDefined(t.header)?t.header:e.instant("DIALOGS_PLEASE_WAIT_ELIPS"),a.msg=angular.isDefined(t.msg)?t.msg:e.instant("DIALOGS_PLEASE_WAIT_MSG"),a.progress=angular.isDefined(t.progress)?t.progress:100,a.icon=angular.isDefined(t.fa)&&angular.equals(t.fa,!0)?"fa fa-clock-o":"glyphicon glyphicon-time",a.$on("dialogs.wait.complete",function(){s(function(){n.close(),a.$destroy()})}),a.$on("dialogs.wait.message",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg}),a.$on("dialogs.wait.progress",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg,a.progress=angular.isDefined(e.progress)?e.progress:a.progress}),a.getProgress=function(){return{width:a.progress+"%"}}}]),n.controller("notifyDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_NOTIFICATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_NOTIFICATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-info":"glyphicon glyphicon-info-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("confirmDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_CONFIRMATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_CONFIRMATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-check":"glyphicon glyphicon-check",a.no=function(){n.dismiss("no")},a.yes=function(){n.close("yes")}}]),angular.module("dialogs.services",["ui.bootstrap.modal","dialogs.controllers"]).provider("dialogs",[function(){var a=!0,n=!0,e="dialogs-default",s="dialogs-backdrop-default",t=!0,o=null,l="lg",i=!1,r=!1,d=function(t){var o={};return t=t||{},o.kb=angular.isDefined(t.keyboard)?!!t.keyboard:n,o.bd=angular.isDefined(t.backdrop)?t.backdrop:a,o.bdc=angular.isDefined(t.backdropClass)?t.backdropClass:s,o.ws=!angular.isDefined(t.size)||"sm"!==t.size&&"lg"!==t.size&&"md"!==t.size?l:t.size,o.wc=angular.isDefined(t.windowClass)?t.windowClass:e,o.anim=angular.isDefined(t.animation)?!!t.animation:i,o};this.useBackdrop=function(n){angular.isDefined(n)&&(a=n)},this.useEscClose=function(a){angular.isDefined(a)&&(n=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.useClass=function(a){angular.isDefined(a)&&(e=a)},this.useCopy=function(a){angular.isDefined(a)&&(t=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.setWindowTmpl=function(a){angular.isDefined(a)&&(o=a)},this.setSize=function(a){angular.isDefined(a)&&(l=angular.equals(a,"sm")||angular.equals(a,"lg")||angular.equals(a,"md")?a:l)},this.useAnimation=function(){i=!0},this.useFontAwesome=function(){r=!0},this.$get=["$uibModal",function(a){return{error:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/error.html",controller:"errorDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:r}}}})},wait:function(n,e,s,t){return t=d(t),a.open({templateUrl:"/dialogs/wait.html",controller:"waitDialogCtrl",backdrop:t.bd,backdropClass:t.bdc,keyboard:t.kb,windowClass:t.wc,size:t.ws,animation:t.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),progress:angular.copy(s),fa:r}}}})},notify:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/notify.html",controller:"notifyDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:r}}}})},confirm:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/confirm.html",controller:"confirmDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:r}}}})},create:function(n,e,s,o){var l=o&&angular.isDefined(o.copy)?o.copy:t;return o=d(o),a.open({templateUrl:n,controller:e,keyboard:o.kb,backdrop:o.bd,backdropClass:o.bdc,windowClass:o.wc,size:o.ws,animation:o.anim,resolve:{data:function(){return l?angular.copy(s):s}}})}}}]}]),angular.module("dialogs.main",["dialogs.services","ngSanitize"]).config(["$translateProvider","dialogsProvider",function(a,n){try{angular.module("pascalprecht.translate")}catch(e){a.translations("en-US",{DIALOGS_ERROR:"Error",DIALOGS_ERROR_MSG:"An unknown error has occurred.",DIALOGS_CLOSE:"Close",DIALOGS_PLEASE_WAIT:"Please Wait",DIALOGS_PLEASE_WAIT_ELIPS:"Please Wait...",DIALOGS_PLEASE_WAIT_MSG:"Waiting on operation to complete.",DIALOGS_PERCENT_COMPLETE:"% Complete",DIALOGS_NOTIFICATION:"Notification",DIALOGS_NOTIFICATION_MSG:"Unknown application notification.",DIALOGS_CONFIRMATION:"Confirmation",DIALOGS_CONFIRMATION_MSG:"Confirmation required.",DIALOGS_OK:"OK",DIALOGS_YES:"Yes",DIALOGS_NO:"No"})}try{var s=document.styleSheets;a:for(var t=s.length-1;t>=0;t--){var o=null,l=null;if(!s[t].disabled){if(null!==s[t].href&&(o=s[t].href.match(/font\-*awesome/i)),angular.isArray(o)){n.useFontAwesome();break}l=s[t].cssRules;for(var i=l.length-1;i>=0;i--)if(".fa"==l[i].selectorText.toLowerCase()){n.useFontAwesome();break a}}}}catch(e){}}]).run(["$templateCache","$interpolate",function(a,n){var e=n.startSymbol(),s=n.endSymbol();a.put("/dialogs/error.html",'"),a.put("/dialogs/wait.html",'"),a.put("/dialogs/notify.html",'"),a.put("/dialogs/confirm.html",'")}])}(); \ No newline at end of file +!function(){"use strict";var a=angular.module("translate.sub",[]);a.provider("$translate",[function(){var a=[],n="en-US";this.translations=function(e,s){angular.isDefined(e)&&angular.isDefined(s)&&(a[e]=angular.copy(s),n=e)},this.$get=[function(){return{instant:function(e){return angular.isDefined(e)&&angular.isDefined(a[n][e])?a[n][e]:""}}}]}]),a.filter("translate",["$translate",function(a){return function(n){return a.instant(n)}}]);var n;try{angular.module("pascalprecht.translate"),n=angular.module("dialogs.controllers",["ui.bootstrap.modal","pascalprecht.translate"])}catch(e){n=angular.module("dialogs.controllers",["ui.bootstrap.modal","translate.sub"])}n.controller("errorDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_ERROR"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_ERROR_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-warning":"glyphicon glyphicon-warning-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("waitDialogCtrl",["$scope","$uibModalInstance","$translate","$timeout","data",function(a,n,e,s,o){a.header=angular.isDefined(o.header)?o.header:e.instant("DIALOGS_PLEASE_WAIT_ELIPS"),a.msg=angular.isDefined(o.msg)?o.msg:e.instant("DIALOGS_PLEASE_WAIT_MSG"),a.progress=angular.isDefined(o.progress)?o.progress:100,a.icon=angular.isDefined(o.fa)&&angular.equals(o.fa,!0)?"fa fa-clock-o":"glyphicon glyphicon-time",a.$on("dialogs.wait.complete",function(){s(function(){n.close(),a.$destroy()})}),a.$on("dialogs.wait.message",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg}),a.$on("dialogs.wait.progress",function(n,e){a.msg=angular.isDefined(e.msg)?e.msg:a.msg,a.progress=angular.isDefined(e.progress)?e.progress:a.progress}),a.getProgress=function(){return{width:a.progress+"%"}}}]),n.controller("notifyDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_NOTIFICATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_NOTIFICATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-info":"glyphicon glyphicon-info-sign",a.close=function(){n.close(),a.$destroy()}}]),n.controller("confirmDialogCtrl",["$scope","$uibModalInstance","$translate","data",function(a,n,e,s){a.header=angular.isDefined(s.header)?s.header:e.instant("DIALOGS_CONFIRMATION"),a.msg=angular.isDefined(s.msg)?s.msg:e.instant("DIALOGS_CONFIRMATION_MSG"),a.icon=angular.isDefined(s.fa)&&angular.equals(s.fa,!0)?"fa fa-check":"glyphicon glyphicon-check",a.no=function(){n.dismiss("no")},a.yes=function(){n.close("yes")}}]),angular.module("dialogs.services",["ui.bootstrap.modal","dialogs.controllers"]).provider("dialogs",[function(){var a=!0,n=!0,e="dialogs-default",s="dialogs-backdrop-default",o=!0,t=null,l="lg",r=!1,i=!1,d=function(o){var t={};return o=o||{},t.kb=angular.isDefined(o.keyboard)?!!o.keyboard:n,t.bd=angular.isDefined(o.backdrop)?o.backdrop:a,t.bdc=angular.isDefined(o.backdropClass)?o.backdropClass:s,t.ws=!angular.isDefined(o.size)||"sm"!==o.size&&"lg"!==o.size&&"md"!==o.size?l:o.size,t.wc=angular.isDefined(o.windowClass)?o.windowClass:e,t.anim=angular.isDefined(o.animation)?!!o.animation:r,t};this.useBackdrop=function(n){angular.isDefined(n)&&(a=n)},this.useEscClose=function(a){angular.isDefined(a)&&(n=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.useClass=function(a){angular.isDefined(a)&&(e=a)},this.useCopy=function(a){angular.isDefined(a)&&(o=angular.equals(a,0)||angular.equals(a,"false")||angular.equals(a,"no")||angular.equals(a,null)||angular.equals(a,!1)?!1:!0)},this.setWindowTmpl=function(a){angular.isDefined(a)&&(t=a)},this.setSize=function(a){angular.isDefined(a)&&(l=angular.equals(a,"sm")||angular.equals(a,"lg")||angular.equals(a,"md")?a:l)},this.useAnimation=function(){r=!0},this.useFontAwesome=function(){i=!0},this.$get=["$uibModal",function(a){return{error:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/error.html",controller:"errorDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:i}}}})},wait:function(n,e,s,o){return o=d(o),a.open({templateUrl:"/dialogs/wait.html",controller:"waitDialogCtrl",backdrop:o.bd,backdropClass:o.bdc,keyboard:o.kb,windowClass:o.wc,size:o.ws,animation:o.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),progress:angular.copy(s),fa:i}}}})},notify:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/notify.html",controller:"notifyDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:i}}}})},confirm:function(n,e,s){return s=d(s),a.open({templateUrl:"/dialogs/confirm.html",controller:"confirmDialogCtrl",backdrop:s.bd,backdropClass:s.bdc,keyboard:s.kb,windowClass:s.wc,size:s.ws,animation:s.anim,resolve:{data:function(){return{header:angular.copy(n),msg:angular.copy(e),fa:i}}}})},create:function(n,e,s,t,l){var r=t&&angular.isDefined(t.copy)?t.copy:o;return t=d(t),a.open({templateUrl:n,controller:e,controllerAs:l,keyboard:t.kb,backdrop:t.bd,backdropClass:t.bdc,windowClass:t.wc,size:t.ws,animation:t.anim,resolve:{data:function(){return r?angular.copy(s):s}}})}}}]}]),angular.module("dialogs.main",["dialogs.services","ngSanitize"]).config(["$translateProvider","dialogsProvider",function(a,n){try{angular.module("pascalprecht.translate")}catch(e){a.translations("en-US",{DIALOGS_ERROR:"Error",DIALOGS_ERROR_MSG:"An unknown error has occurred.",DIALOGS_CLOSE:"Close",DIALOGS_PLEASE_WAIT:"Please Wait",DIALOGS_PLEASE_WAIT_ELIPS:"Please Wait...",DIALOGS_PLEASE_WAIT_MSG:"Waiting on operation to complete.",DIALOGS_PERCENT_COMPLETE:"% Complete",DIALOGS_NOTIFICATION:"Notification",DIALOGS_NOTIFICATION_MSG:"Unknown application notification.",DIALOGS_CONFIRMATION:"Confirmation",DIALOGS_CONFIRMATION_MSG:"Confirmation required.",DIALOGS_OK:"OK",DIALOGS_YES:"Yes",DIALOGS_NO:"No"})}try{var s=document.styleSheets;a:for(var o=s.length-1;o>=0;o--){var t=null,l=null;if(!s[o].disabled){if(null!==s[o].href&&(t=s[o].href.match(/font\-*awesome/i)),angular.isArray(t)){n.useFontAwesome();break}l=s[o].cssRules;for(var r=l.length-1;r>=0;r--)if(".fa"==l[r].selectorText.toLowerCase()){n.useFontAwesome();break a}}}}catch(e){}}]).run(["$templateCache","$interpolate",function(a,n){var e=n.startSymbol(),s=n.endSymbol();a.put("/dialogs/error.html",'"),a.put("/dialogs/wait.html",'"),a.put("/dialogs/notify.html",'"),a.put("/dialogs/confirm.html",'")}])}(); \ No newline at end of file diff --git a/package.json b/package.json index cf0ecd5..cdd2b11 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "angular-dialog-service", "description": "A service to handle common dialog types in a web application. Built on top of Angular-Bootstrap's modal", - "version": "5.2.10", + "version": "5.2.11", "keywords": [ "angular", "dialog", diff --git a/src/dialogs-services.js b/src/dialogs-services.js index f51f6a1..2663fff 100644 --- a/src/dialogs-services.js +++ b/src/dialogs-services.js @@ -91,7 +91,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Set Size * - * Sets the modal size to use (sm,lg,md), requires Angular-ui-Bootstrap 0.11.0 and Bootstrap 3.1.0 + + * Sets the modal size to use (sm,lg,md) * * @param val string (sm,lg,md) */ diff --git a/src/dialogs.js b/src/dialogs.js index 1c1e9e2..b1b37fe 100644 --- a/src/dialogs.js +++ b/src/dialogs.js @@ -206,9 +206,9 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Backdrop - * + * * Sets the use of the modal backdrop. Either to have one or not and - * whether or not it responds to mouse clicks ('static' sets the + * whether or not it responds to mouse clicks ('static' sets the * backdrop to true and does not respond to mouse clicks). * * @param val mixed (true, false, 'static') @@ -220,7 +220,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use ESC Close - * + * * Sets the use of the ESC (escape) key to close modal windows. * * @param val boolean @@ -244,7 +244,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Use Copy - * + * * Determines the use of angular.copy when sending data to the modal controller. * * @param val boolean @@ -269,7 +269,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) /** * Set Size * - * Sets the modal size to use (sm,lg,md), requires Angular-ui-Bootstrap 0.11.0 and Bootstrap 3.1.0 + + * Sets the modal size to use (sm,lg,md) * * @param val string (sm,lg,md) */ @@ -299,7 +299,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) this.$get = ['$uibModal',function ($uibModal){ - + return { /** * Error Dialog @@ -331,7 +331,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end error - + /** * Wait Dialog * @@ -364,7 +364,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end wait - + /** * Notify Dialog * @@ -395,7 +395,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end notify - + /** * Confirm Dialog * @@ -426,7 +426,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) } }); // end modal.open }, // end confirm - + /** * Create Custom Dialog * @@ -435,13 +435,14 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) * @param data object * @param opts object */ - create : function(url,ctrlr,data,opts){ + create : function(url,ctrlr,data,opts,ctrlAs){ var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy; opts = _setOpts(opts); return $uibModal.open({ templateUrl : url, controller : ctrlr, + controllerAs : ctrlAs, keyboard : opts.kb, backdrop : opts.bd, backdropClass: opts.bdc, @@ -449,7 +450,7 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers']) size: opts.ws, animation: opts.anim, resolve : { - data : function() { + data : function() { if(copy) return angular.copy(data); else