-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular-notification.min.js
1 lines (1 loc) · 12.9 KB
/
angular-notification.min.js
1
angular.module("tellMeTemplate",["../template/angular-notification-template.html"]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}">\n <div ng-repeat="msg in messages" ng-click="hideMessage(msg)">\n <div class="y-notification-msg {{msg.level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{msg.title}}</div>\n <div class="y-notification-message">{{msg.message}}</div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("tellMeModule",["ngAnimate","tellMeTemplate"]).constant("$tellMeConstant",{defaultZIndex:9999,defaultPosition:"top-right",defaultSelfDestroyDuration:3500}).factory("$tellMe",["$timeout","$tellMeConstant",function(a,b){var c=[];return{getMessages:function(){return c},now:function(a){return this.createNotification(a.level,a.title,a.message)},createNotification:function(d,e,f){var g={level:d,title:e,message:f,created:Date.now()},h=a(function(){c.splice(c.indexOf(g),1)},b.defaultSelfDestroyDuration);return angular.extend(g,{timer:h}),c.push(g),g}}}]).directive("tellMe",["$timeout","$tellMeConstant","$tellMe",function(a,b,c){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"="},templateUrl:"../template/angular-notification-template.html",link:function(a,c){var d=angular.isDefined(a.zIndex)?a.zIndex:b.defaultZIndex;c.css("zIndex",d)},controller:function(a){a.messages=c.getMessages(),a.$on("clearTellMe",function(){a.messages.splice(0,a.messages.length)}),a.hideMessage=function(b){a.messages.splice(a.messages.indexOf(b),1)}}}}]),angular.module("tellMeTemplate",["../template/angular-notification-template.html"]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}">\n <div ng-repeat="msg in messages" ng-click="hideMessage(msg)">\n <div class="y-notification-msg {{msg.level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{msg.title}}</div>\n <div class="y-notification-message">{{msg.message}}</div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("tellMeModule",["ngAnimate","tellMeTemplate"]).constant("$tellMeConstant",{defaultZIndex:9999,defaultPosition:"top-right",defaultSelfDestroyDuration:3500}).factory("$tellMe",["$timeout","$tellMeConstant",function(a,b){var c=[];return{getMessages:function(){return c},now:function(a){return this.createNotification(a.level,a.title,a.message)},createNotification:function(d,e,f){var g={level:d,title:e,message:f,created:Date.now()},h=a(function(){c.splice(c.indexOf(g),1)},b.defaultSelfDestroyDuration);return angular.extend(g,{timer:h}),c.push(g),g}}}]).directive("tellMe",["$timeout","$tellMeConstant","$tellMe",function(a,b,c){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"="},templateUrl:"../template/angular-notification-template.html",link:function(a,c){var d=angular.isDefined(a.zIndex)?a.zIndex:b.defaultZIndex;c.css("zIndex",d)},controller:function(a){a.messages=c.getMessages(),a.$on("clearTellMe",function(){a.messages.splice(0,a.messages.length)}),a.hideMessage=function(b){a.messages.splice(a.messages.indexOf(b),1)}}}}]),angular.module("yNotificationTemplateModule",["../template/angular-notification-template.html"]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}">\n <div ng-repeat="msg in messages" ng-click="hideMessage(msg)">\n <div class="y-notification-msg {{msg.level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{msg.title}}</div>\n <div class="y-notification-message">{{msg.message}}</div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("yNotificationModule",["ngAnimate","yNotificationTemplateModule"]).constant("$tellMeConstant",{defaultZIndex:9999,defaultPosition:"top-right",defaultSelfDestroyDuration:3500}).factory("$tellMe",["$timeout","$tellMeConstant",function(a,b){var c=[];return{getMessages:function(){return c},now:function(a){return this.createNotification(a.level,a.title,a.message)},createNotification:function(d,e,f){var g={level:d,title:e,message:f,created:Date.now()},h=a(function(){c.splice(c.indexOf(g),1)},b.defaultSelfDestroyDuration);return angular.extend(g,{timer:h}),c.push(g),g}}}]).directive("tellMe",["$timeout","$tellMeConstant","$tellMe",function(a,b,c){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"="},templateUrl:"../template/angular-notification-template.html",link:function(a,c){var d=angular.isDefined(a.zIndex)?a.zIndex:b.defaultZIndex;c.css("zIndex",d)},controller:function(a){a.messages=c.getMessages(),a.$on("clearTellMe",function(){a.messages.splice(0,a.messages.length)}),a.hideMessage=function(b){a.messages.splice(a.messages.indexOf(b),1)}}}}]),angular.module("yNotificationTemplateModule",["../template/angular-notification-template.html"]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}">\n <div ng-repeat="msg in messages" ng-click="hideMessage(msg)">\n <div class="y-notification-msg {{msg.level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{msg.title}}</div>\n <div class="y-notification-message">{{msg.message}}</div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("yNotificationModule",["ngAnimate","yNotificationTemplateModule"]).constant("$tellMeConstant",{defaultZIndex:9999,defaultPosition:"top-right",defaultSelfDestroyDuration:3500}).factory("$tellMe",["$timeout","$tellMeConstant",function(a,b){var c=[];return{getMessages:function(){return c},now:function(a){return this.createNotification(a.level,a.title,a.message)},createNotification:function(d,e,f){var g={level:d,title:e,message:f,created:Date.now()},h=a(function(){c.splice(c.indexOf(g),1)},b.defaultSelfDestroyDuration);return angular.extend(g,{timer:h}),c.push(g),g}}}]).directive("tellMe",["$timeout","$tellMeConstant","$tellMe",function(a,b,c){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"="},templateUrl:"../template/angular-notification-template.html",link:function(a,c){var d=angular.isDefined(a.zIndex)?a.zIndex:b.defaultZIndex;c.css("zIndex",d)},controller:function(a){a.messages=c.getMessages(),a.$on("clearTellMe",function(){a.messages.splice(0,a.messages.length)}),a.hideMessage=function(b){a.messages.splice(a.messages.indexOf(b),1)}}}}]),angular.module("yNotificationTemplateModule",["../template/angular-notification-template.html"]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}">\n <div ng-repeat="msg in messages" ng-click="hideMessage(msg)">\n <div class="y-notification-msg {{msg.level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{msg.title}}</div>\n <div class="y-notification-message">{{msg.message}}</div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("yNotificationModule",["ngAnimate","yNotificationTemplateModule"]).constant("$tellMeConstant",{defaultZIndex:9999,defaultPosition:"top-right",defaultSelfDestroyDuration:3500}).factory("$tellMe",["$timeout","$tellMeConstant",function(a,b){var c=[];return{getMessages:function(){return c},now:function(a){return this.createNotification(a.level,a.title,a.message)},createNotification:function(d,e,f){var g={level:d,title:e,message:f,created:Date.now()},h=a(function(){c.splice(c.indexOf(g),1)},b.defaultSelfDestroyDuration);return angular.extend(g,{timer:h}),c.push(g),g}}}]).directive("tellMe",["$timeout","$tellMeConstant","$tellMe",function(a,b,c){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"="},templateUrl:"../template/angular-notification-template.html",link:function(a,c){var d=angular.isDefined(a.zIndex)?a.zIndex:b.defaultZIndex;c.css("zIndex",d)},controller:function(a){a.messages=c.getMessages(),a.$on("clearTellMe",function(){a.messages.splice(0,a.messages.length)}),a.hideMessage=function(b){a.messages.splice(a.messages.indexOf(b),1)}}}}]),angular.module("yNotificationTemplateModule",["../template/angular-notification-template.html"]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}">\n <div ng-repeat="msg in messages" ng-click="hideMessage(msg)">\n <div class="y-notification-msg {{msg.level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{msg.title}}</div>\n <div class="y-notification-message">{{msg.message}}</div>\n </div>\n </div>\n </div>\n</div>')}]),angular.module("yNotificationModule",["ngAnimate","yNotificationTemplateModule"]).constant("$tellMeConstant",{defaultZIndex:9999,defaultPosition:"top-right",defaultSelfDestroyDuration:3500}).factory("$tellMe",["$timeout","$tellMeConstant",function(a,b){var c=[];return{getMessages:function(){return c},now:function(a){return this.createNotification(a.level,a.title,a.message)},createNotification:function(d,e,f){var g={level:d,title:e,message:f,created:Date.now()},h=a(function(){c.splice(c.indexOf(g),1)},b.defaultSelfDestroyDuration);return angular.extend(g,{timer:h}),c.push(g),g}}}]).directive("tellMe",["$timeout","$tellMeConstant","$tellMe",function(a,b,c){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"="},templateUrl:"../template/angular-notification-template.html",link:function(a,c){var d=angular.isDefined(a.zIndex)?a.zIndex:b.defaultZIndex;c.css("zIndex",d)},controller:function(a){a.messages=c.getMessages(),a.$on("clearTellMe",function(){a.messages.splice(0,a.messages.length)}),a.hideMessage=function(b){a.messages.splice(a.messages.indexOf(b),1)}}}}]),angular.module("yNotificationTemplateModule",["../template/angular-notification-block-template.html","../template/angular-notification-template.html"]),angular.module("../template/angular-notification-block-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-block-template.html",'<div class="y-notification-msg {{level}}">\n <div class="y-notification-body" style="padding: 10px 20px;">\n <div class="y-notification-title">{{title}}</div>\n <div class="y-notification-message">{{message}}</div>\n </div>\n</div>')}]),angular.module("../template/angular-notification-template.html",[]).run(["$templateCache",function(a){a.put("../template/angular-notification-template.html",'<div class="y-notication {{position}}"></div>')}]),angular.module("yNotificationModule",["yNotificationTemplateModule"]).constant("ynotConst",{defaultZIndex:9999,defaultPosition:"top-right",defaultInterval:300,defaultSelfDestroyDuration:2e3,defaultDestroyAnimationDelay:700,"top-left":{top:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"bottom-right":{bottom:"20px",right:"20px"}}).directive("ynot",["$compile","$document","$timeout","ynotConst",function(a,b,c,d){return{restrict:"E",replace:!0,scope:{zIndex:"=",position:"=",messages:"=",interval:"=",selfDestroyDuration:"="},templateUrl:"../template/angular-notification-template.html",link:function(b,e){function f(a){var c=0,d=setInterval(function(){var e=b.messages[c++];c===b.messages.length&&(clearInterval(d),a()),g(e)},j)}function g(f){if(angular.isDefined(f)){var g=b.$new(!1);g.level=f.level,g.message=f.message;var h=a(l)(g);e.append(h),c(function(){g.destroyed=!0,c(function(){g.$destroy()},d.defaultDestroyAnimationDelay)},k)}}var h=angular.isDefined(b.zIndex)?b.zIndex:d.defaultZIndex,i=angular.isDefined(b.position)?b.position:d.defaultPosition,j=angular.isDefined(b.interval)?b.interval:d.defaultInterval,k=angular.isDefined(b.selfDestroyDuration)?b.selfDestroyDuration:d.defaultDestroyAnimationDelay;e.css("zIndex",h);var l="<ynot-block></ynot-block>";b.$watchCollection("messages",function(){angular.isDefined(b.messages)&&b.messages.length>0&&(e.css(d[i]),f(function(){b.messages=[]}))})}}}]).directive("ynotBlock",[function(){return{restrict:"E",replace:!0,templateUrl:"../template/angular-notification-block-template.html",link:function(a,b){a.destroyed=!1,a.$on("$destroy",function(){b.remove()}),a.$watch("destroyed",function(a){a&&b.addClass("fadeout")})}}}]);