diff --git a/README.md b/README.md index c388250..4a0b4bb 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,25 @@ #angular-growl-2 Growl like notifications for angularJS projects, using bootstrap alert classes, originally developed by Marco Rinck +##Features + +![Standard bootstrap 2.x styles](doc/screenshot.jpg) + +* growl like notifications like in MacOS X +* using standard bootstrap classes (alert, alert-info, alert-error, alert-success) +* global or per message configuration of a timeout when message will be automatically closed +* automatic translation of messages if [angular-translate](https://github.com/PascalPrecht/angular-translate) filter is +present, you only have to provide keys as messages, angular-translate will translate them +* pre-defined $http-Interceptor to automatically handle $http responses for server-sent messages +* automatic CSS animations when adding/closing notifications (only when using >= angularJS 1.2) +* < 1 kB after GZIP +* Allows for HTML content inside the alert + ##Installation -You can install angular-growl with bower: +You can install angular-growl-2 with bower: -> bower install angular-growl +> bower install angular-growl-2 Alternatively you can download the files in the [build folder](build/) manually and include them in your project. @@ -36,19 +50,6 @@ Finally, you have to include the directive somewhere in your HTML like this: ```` -##Features - -![Standard bootstrap 2.x styles](doc/screenshot.jpg) - -* growl like notifications like in MacOS X -* using standard bootstrap classes (alert, alert-info, alert-error, alert-success) -* global or per message configuration of a timeout when message will be automatically closed -* automatic translation of messages if [angular-translate](https://github.com/PascalPrecht/angular-translate) filter is -present, you only have to provide keys as messages, angular-translate will translate them -* pre-defined $http-Interceptor to automatically handle $http responses for server-sent messages -* automatic CSS animations when adding/closing notifications (only when using >= angularJS 1.2) -* < 1 kB after GZIP - ##Usage Just let angular inject the growl Factory into your code and call the 4 functions that the factory provides accordingly: diff --git a/bower.json b/bower.json index e7bb2c3..066e919 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,15 @@ { - "author": "Marco Rinck", - "name": "angular-growl", + "author": [ + "Marco Rinck", + "Jan Stevens" + ], + "name": "angular-growl-2", "description": "growl like notifications for angularJS projects, using bootstrap alert classes", "version": "0.5.0", - "homepage": "https://github.com/marcorinck/angular-growl", + "homepage": "http://janstevens.github.io/angular-growl-2", "repository": { "type": "git", - "url": "https://github.com/marcorinck/angular-growl" + "url": "https://github.com/JanStevens/angular-growl-2" }, "license": "MIT", "main": ["./build/angular-growl.js", "./build/angular-growl.min.css"], diff --git a/build/angular-growl.js b/build/angular-growl.js index 27b7022..0d37f0a 100644 --- a/build/angular-growl.js +++ b/build/angular-growl.js @@ -1,7 +1,7 @@ /** - * angular-growl - v0.5.0 - 2014-03-18 - * https://github.com/marcorinck/angular-growl - * Copyright (c) 2014 Marco Rinck; Licensed MIT + * angular-growl-2 - v0.5.0 - 2014-03-18 + * http://janstevens.github.io/angular-growl-2 + * Copyright (c) 2014 Marco Rinck,Jan Stevens; Licensed MIT */ angular.module('angular-growl', []); angular.module('angular-growl').directive('growl', [ diff --git a/build/angular-growl.min.css b/build/angular-growl.min.css index b586211..24e5a8d 100644 --- a/build/angular-growl.min.css +++ b/build/angular-growl.min.css @@ -1,7 +1,7 @@ /** - * angular-growl - v0.5.0 - 2014-03-18 - * https://github.com/marcorinck/angular-growl - * Copyright (c) 2014 Marco Rinck; Licensed MIT + * angular-growl-2 - v0.5.0 - 2014-03-18 + * http://janstevens.github.io/angular-growl-2 + * Copyright (c) 2014 Marco Rinck,Jan Stevens; Licensed MIT */ .growl{position:fixed;top:10px;right:10px;float:right;width:250px;z-index:9999}.growl-item.ng-enter,.growl-item.ng-leave{-webkit-transition:.5s linear all;-moz-transition:.5s linear all;-o-transition:.5s linear all;transition:.5s linear all}.growl-item.ng-enter,.growl-item.ng-leave.ng-leave-active{opacity:0}.growl-item.ng-leave,.growl-item.ng-enter.ng-enter-active{opacity:1} \ No newline at end of file diff --git a/build/angular-growl.min.js b/build/angular-growl.min.js index 53a1046..1cebc51 100644 --- a/build/angular-growl.min.js +++ b/build/angular-growl.min.js @@ -1,6 +1,6 @@ /** - * angular-growl - v0.5.0 - 2014-03-18 - * https://github.com/marcorinck/angular-growl - * Copyright (c) 2014 Marco Rinck; Licensed MIT + * angular-growl-2 - v0.5.0 - 2014-03-18 + * http://janstevens.github.io/angular-growl-2 + * Copyright (c) 2014 Marco Rinck,Jan Stevens; Licensed MIT */ angular.module("angular-growl",[]),angular.module("angular-growl").directive("growl",["$rootScope","$sce",function(a,b){"use strict";return{restrict:"A",template:'
',replace:!1,scope:!0,controller:["$scope","$timeout","growl",function(c,d,e){function f(a){a.enableHtml&&(a.text=b.trustAsHtml(a.text)),c.messages.push(a),a.ttl&&-1!==a.ttl&&d(function(){c.deleteMessage(a)},a.ttl)}var g=e.onlyUnique();c.messages=[],a.$on("growlMessage",function(a,b){var d;g?(angular.forEach(c.messages,function(a){b.text===a.text&&b.severity===a.severity&&(d=!0)}),d||f(b)):f(b)}),c.deleteMessage=function(a){var b=c.messages.indexOf(a);b>-1&&c.messages.splice(b,1)},c.computeClasses=function(a){return{"alert-success":"success"===a.severity,"alert-error":"error"===a.severity,"alert-danger":"error"===a.severity,"alert-info":"info"===a.severity,"alert-warning":"warn"===a.severity}}}]}}]),angular.module("angular-growl").provider("growl",function(){"use strict";var a=null,b=!1,c="messages",d="text",e="severity",f=!0,g=!1;this.globalTimeToLive=function(b){a=b},this.globalEnableHtml=function(a){b=a},this.globalDisableCloseButton=function(a){g=a},this.messagesKey=function(a){c=a},this.messageTextKey=function(a){d=a},this.messageSeverityKey=function(a){e=a},this.onlyUniqueMessages=function(a){f=a},this.serverMessagesInterceptor=["$q","growl",function(a,b){function d(a){a.data[c]&&a.data[c].length>0&&b.addServerMessages(a.data[c])}function e(a){return d(a),a}function f(b){return d(b),a.reject(b)}return function(a){return a.then(e,f)}}],this.$get=["$rootScope","$filter",function(c,h){function i(a){q&&(a.text=q(a.text)),c.$broadcast("growlMessage",a)}function j(c,d,e){var f,h=d||{};f={text:c,severity:e,ttl:h.ttl||a,enableHtml:h.enableHtml||b,disableCloseButton:h.disableCloseButton||g},i(f)}function k(a,b){j(a,b,"warn")}function l(a,b){j(a,b,"error")}function m(a,b){j(a,b,"info")}function n(a,b){j(a,b,"success")}function o(a){var b,c,f,g;for(g=a.length,b=0;g>b;b++)if(c=a[b],c[d]){if(c[e])switch(c[e]){case"warn":f="warn";break;case"success":f="success";break;case"info":f="info";break;case"error":f="error"}else f="error";j(c[d],void 0,f)}}function p(){return f}var q;try{q=h("translate")}catch(r){}return{warning:k,error:l,info:m,success:n,addServerMessages:o,onlyUnique:p}}]}); \ No newline at end of file diff --git a/package.json b/package.json index de1bf9e..5882ca9 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "angular-growl", - "version": "0.4.0", + "version": "0.5.0", "description": "growl like notifications for angularJS projects, using bootstrap alert classes", "repository": { "type": "git", - "url": "https://github.com/marcorinck/angular-growl" + "url": "https://github.com/JanStevens/angular-growl-2" }, "author": { "name": "Marco Rinck",