├── .gitignore ├── .jshintrc ├── Gruntfile.js ├── LICENSE ├── README.md ├── angular-notify.css ├── angular-notify.html ├── angular-notify.js ├── bower.json ├── bower_components └── angular │ ├── .bower.json │ ├── README.md │ ├── angular-csp.css │ ├── angular.js │ ├── angular.min.js │ ├── angular.min.js.gzip │ ├── angular.min.js.map │ ├── bower.json │ ├── index.js │ └── package.json ├── demo ├── demo.js ├── gh-fork-ribbon.css ├── gmail-template.html └── index.html ├── dist ├── angular-notify.css ├── angular-notify.js ├── angular-notify.min.css ├── angular-notify.min.js └── index.js ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | 16 | node_modules 17 | .DS_Store 18 | 19 | temp -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "boss": true, 11 | "eqnull": true, 12 | "browser": true, 13 | "smarttabs": true, 14 | "globals": { 15 | "jQuery": true, 16 | "angular": true, 17 | "console": true, 18 | "$": true, 19 | "_": true, 20 | "moment": true, 21 | "describe": true, 22 | "beforeEach": true, 23 | "module": true, 24 | "inject": true, 25 | "it": true, 26 | "expect": true 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (grunt) { 4 | 5 | require('load-grunt-tasks')(grunt); 6 | 7 | grunt.initConfig({ 8 | connect: { 9 | main: { 10 | options: { 11 | port: 9001 12 | } 13 | } 14 | }, 15 | watch: { 16 | main: { 17 | options: { 18 | livereload: true, 19 | livereloadOnError: false, 20 | spawn: false 21 | }, 22 | files: ['angular-notify.css','angular-notify.html','angular-notify.js','dist/**/*','demo/**/*'], 23 | tasks: ['jshint','build'] 24 | } 25 | }, 26 | jshint: { 27 | main: { 28 | options: { 29 | jshintrc: '.jshintrc' 30 | }, 31 | src: 'angular-notify.js' 32 | } 33 | }, 34 | jasmine: { 35 | unit: { 36 | src: [''], 37 | options: { 38 | specs: 'test/unit/*.js' 39 | } 40 | } 41 | }, 42 | copy: { 43 | main: { 44 | files: [ 45 | {src:'angular-notify.css',dest:'dist/'}, 46 | {src:'index.js',dest:'dist/'} 47 | ] 48 | } 49 | }, 50 | ngtemplates: { 51 | main: { 52 | options: { 53 | module:'cgNotify', 54 | base:'' 55 | }, 56 | src:'angular-notify.html', 57 | dest: 'temp/templates.js' 58 | } 59 | }, 60 | concat: { 61 | main: { 62 | src: ['angular-notify.js', 'temp/templates.js'], 63 | dest: 'dist/angular-notify.js' 64 | } 65 | }, 66 | uglify: { 67 | main: { 68 | files: [ 69 | {src:'dist/angular-notify.js',dest:'dist/angular-notify.min.js'} 70 | ] 71 | } 72 | }, 73 | cssmin: { 74 | main: { 75 | files: { 76 | 'dist/angular-notify.min.css': 'dist/angular-notify.css' 77 | } 78 | } 79 | } 80 | }); 81 | 82 | grunt.registerTask('serve', ['jshint','connect', 'watch']); 83 | grunt.registerTask('build',['ngtemplates','concat','uglify','copy','cssmin']); 84 | grunt.registerTask('test',['build','jasmine']); 85 | 86 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Chris Gross 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #angular-notify 2 | 3 | >A minimalistic (and extensible) notification service for Angular. 4 | 5 | [Live Demo](http://cgross.github.io/angular-notify/demo/) 6 | 7 | Supports IE 10, and recent versions of FF and Chrome. 8 | 9 | ## Getting Started 10 | 11 | Install with Bower, npm, or download the the files directly from the dist folder in the repo. 12 | 13 | ```bash 14 | bower install angular-notify --save 15 | npm install @cgross/angular-notify` 16 | ``` 17 | 18 | Add `dist/angular-notify.js` and `dist/angular-notify.css` to your index.html. 19 | 20 | Add `cgNotify` as a module dependency for your module. 21 | 22 | ```js 23 | angular.module('your_app', ['cgNotify']); 24 | ``` 25 | 26 | Then inject and use the `notify` service. 27 | 28 | ```js 29 | function myController($scope,notify){ // <-- Inject notify 30 | 31 | notify('Your notification message'); // <-- Call notify with your message 32 | 33 | notify({ message:'My message', templateUrl:'my_template.html'} ); 34 | 35 | } 36 | ``` 37 | 38 | ## Options 39 | 40 | 41 | ### notify(String|Object) 42 | 43 | The `notify` function can either be passed a string or an object. When passing an object, the object parameters can be: 44 | 45 | * `message` - Required. The message to show. 46 | * `duration` - Optional. The duration (in milliseconds) of message. A duration of 0 will prevent messages from closing automatically. 47 | * `templateUrl` - Optional. A custom template for the UI of the message. 48 | * `classes` - Optional. A list of custom CSS classes to apply to the message element. 49 | * `messageTemplate` - Optional. A string containing any valid Angular HTML which will be shown instead of the regular `message` text. The string must contain one root element like all valid Angular HTML templates (so wrap everything in a ``). 50 | * `scope` - Optional. A valid Angular scope object. The scope of the template will be created by calling `$new()` on this scope. 51 | * `position` - Optional. `center`, `left` and `right` are the only acceptable values. 52 | * `container` - Optional. Element that contains each notification. Defaults to `document.body`. 53 | 54 | This function will return an object with a `close()` method and a `message` property. 55 | 56 | ### notify.config(Object) 57 | 58 | Call `config` to set the default configuration options for angular-notify. The following options may be specified in the given object: 59 | 60 | * `duration` - The default duration (in milliseconds) of each message. A duration of 0 will prevent messages from closing automatically. 61 | * `startTop` - The Y pixel value where messages will be shown. 62 | * `verticalSpacing` - The number of pixels that should be reserved between messages vertically. 63 | * `templateUrl` - The default message template. 64 | * `position` - The default position of each message. `center`, `left` and `right` are the supported values. 65 | * `container` - The default element that contains each notification. Defaults to `document.body`. 66 | * `maximumOpen` - The maximum number of total notifications that can be visible at one time. Older notifications will be closed when the maximum is reached. 67 | 68 | ### notify.closeAll() 69 | 70 | Closes all currently open notifications. 71 | 72 | ## Providing Custom Templates 73 | 74 | Angular-notify comes with a very simplistic default notification template. You are encouraged to create your own template and style it appropriate to your application. Templates can also contain more advanced features like buttons or links. The message templates are full Angular partials that have a scope (and a controller if you use `ng-controller="YourCtrl"`). 75 | 76 | The scope for the partial will either be descended from `$rootScope` or the scope specified in the `notify({...})` options. The template scope will be augmented with a `$message` property, a `$classes` property, and a special `$close()` function that you may use to close the notification. 77 | 78 | The `messageTemplate` property is also included on the scope as `$messageTemplate`. To ensure your custom template works with the `messageTemplate` option, your template should hide the normal text if `$messageTemplate` contains a value, and should have an element with the `cg-notify-message-template` class. The element with the `cg-notify-message-template` class will have the compiled template appended to it automatically. 79 | 80 | 81 | ## Release History 82 | * v2.5.1 - 01/05/2017 83 | * Fixed for Angular 1.6 promise method changes. 84 | * Published to NPM. 85 | * v2.5.0 - 04/12/2015 86 | * New `duration` property per notification. 87 | * New `position` property per notification. 88 | * Fix for DOM elements not being removed. 89 | * New `maximumOpen` config option. 90 | * Bump Angular dependency to 1.3. 91 | * v2.0.2 - 09/06/2014 92 | * Default template redesigned with a Bootstrap look and feel. Default template now also includes a close button. 93 | * Default message location is now the top center. 94 | * Default message duration is now 10 seconds. 95 | * Default verticalSpacing is now 15px. 96 | * The `template` option was renamed to `templateUrl`. 97 | * New `messageTemplate` option added. 98 | * New `classes` option added. 99 | * Fixed an issue causing a message with multiple lines of text to be placed into the visible area too soon. 100 | * Fixed #4 (config() not correctly setting startTop) 101 | * v1.1.0 - 5/18/2014 - Added return value allowing for closing and updating of message. 102 | * v1.0.0 - 4/16/2014 - Significant refactoring. 103 | * JQuery is no longer a required dependency. 104 | * [Breaking Change] Configure the default template using `config()` now instead of the `cgNotifyTemplate` value. 105 | * [Breaking Change] The `verticalSpacing` parameter should no longer include the height of the notification element. 106 | * [Breaking Change] The `scope` options must now be a valid Angular scope. 107 | * [Breaking Change] The duration of the notifications is now based on a `duration` config property and does not rely on the delay attribute of the CSS transition. 108 | * Messages can now word wrap if you use a `max-width` css value. 109 | * The scope for templates now includes a `$close()` function. 110 | * New `notify.closeAll()` method. 111 | * v0.2.0 - Adding custom templates ability, fixed FF bug. 112 | * v0.1.0 - Initial release. 113 | -------------------------------------------------------------------------------- /angular-notify.css: -------------------------------------------------------------------------------- 1 | .cg-notify-message { 2 | position:fixed; 3 | top:0px; 4 | z-index: 9999; 5 | max-width:400px; 6 | text-align: center; 7 | 8 | background-color: #d9edf7; 9 | color: #31708f; 10 | padding: 15px; 11 | border: 1px solid #bce8f1; 12 | border-radius: 4px; 13 | 14 | -webkit-transition: top 0.5s ease-out,opacity 0.2s ease-out; 15 | -moz-transition: top 0.5s ease-out,opacity 0.2s ease-out; 16 | -o-transition: top 0.5s ease-out,opacity 0.2s ease-out; 17 | transition: top 0.5s ease-out,opacity 0.2s ease-out; 18 | 19 | visibility:hidden; 20 | 21 | -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); 22 | box-shadow: 0 6px 12px rgba(0,0,0,.175); 23 | } 24 | 25 | .cg-notify-message-center { 26 | left:50%; 27 | } 28 | 29 | .cg-notify-message-left { 30 | left:15px; 31 | } 32 | 33 | .cg-notify-message-right { 34 | right:15px; 35 | } 36 | 37 | .cg-notify-message a { 38 | font-weight:bold; 39 | color:inherit; 40 | } 41 | 42 | .cg-notify-message a:hover { 43 | color:inherit; 44 | } 45 | 46 | .cg-notify-close { 47 | -webkit-appearance: none; 48 | padding: 0; 49 | cursor: pointer; 50 | background: 0 0; 51 | border: 0; 52 | font-size: 21px; 53 | font-weight: 700; 54 | line-height: 1; 55 | color: #000; 56 | text-shadow: 0 1px 0 #fff; 57 | filter: alpha(opacity=20); 58 | opacity: .2; 59 | 60 | position: absolute; 61 | top: 0px; 62 | right: 3px; 63 | line-height: 15px; 64 | } 65 | 66 | .cg-notify-close:hover, .cg-notify-close:focus { 67 | color: #000; 68 | text-decoration: none; 69 | cursor: pointer; 70 | filter: alpha(opacity=50); 71 | opacity: .5; 72 | } 73 | 74 | .cg-notify-sr-only { 75 | position: absolute; 76 | width: 1px; 77 | height: 1px; 78 | padding: 0; 79 | margin: -1px; 80 | overflow: hidden; 81 | clip: rect(0,0,0,0); 82 | border: 0; 83 | } -------------------------------------------------------------------------------- /angular-notify.html: -------------------------------------------------------------------------------- 1 |
6 | 7 |
8 | {{$message}} 9 |
10 | 11 |
12 | 13 |
14 | 15 | 19 | 20 |
-------------------------------------------------------------------------------- /angular-notify.js: -------------------------------------------------------------------------------- 1 | angular.module('cgNotify', []).factory('notify',['$timeout','$http','$compile','$templateCache','$rootScope', 2 | function($timeout,$http,$compile,$templateCache,$rootScope){ 3 | 4 | var startTop = 10; 5 | var verticalSpacing = 15; 6 | var defaultDuration = 10000; 7 | var defaultTemplateUrl = 'angular-notify.html'; 8 | var position = 'center'; 9 | var container = document.body; 10 | var maximumOpen = 0; 11 | 12 | var messageElements = []; 13 | var openNotificationsScope = []; 14 | 15 | var notify = function(args){ 16 | 17 | if (typeof args !== 'object'){ 18 | args = {message:args}; 19 | } 20 | 21 | args.duration = args.duration ? args.duration : defaultDuration; 22 | args.templateUrl = args.templateUrl ? args.templateUrl : defaultTemplateUrl; 23 | args.container = args.container ? args.container : container; 24 | args.classes = args.classes ? args.classes : ''; 25 | 26 | var scope = args.scope ? args.scope.$new() : $rootScope.$new(); 27 | scope.$position = args.position ? args.position : position; 28 | scope.$message = args.message; 29 | scope.$classes = args.classes; 30 | scope.$messageTemplate = args.messageTemplate; 31 | 32 | if (maximumOpen > 0) { 33 | var numToClose = (openNotificationsScope.length + 1) - maximumOpen; 34 | for (var i = 0; i < numToClose; i++) { 35 | openNotificationsScope[i].$close(); 36 | } 37 | } 38 | 39 | $http.get(args.templateUrl,{cache: $templateCache}).then(function(template){ 40 | 41 | var templateElement = $compile(template.data)(scope); 42 | templateElement.bind('webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd', function(e){ 43 | if (e.propertyName === 'opacity' || e.currentTarget.style.opacity === 0 || 44 | (e.originalEvent && e.originalEvent.propertyName === 'opacity')){ 45 | 46 | templateElement.remove(); 47 | messageElements.splice(messageElements.indexOf(templateElement),1); 48 | openNotificationsScope.splice(openNotificationsScope.indexOf(scope),1); 49 | layoutMessages(); 50 | } 51 | }); 52 | 53 | if (args.messageTemplate){ 54 | var messageTemplateElement; 55 | for (var i = 0; i < templateElement.children().length; i ++){ 56 | if (angular.element(templateElement.children()[i]).hasClass('cg-notify-message-template')){ 57 | messageTemplateElement = angular.element(templateElement.children()[i]); 58 | break; 59 | } 60 | } 61 | if (messageTemplateElement){ 62 | messageTemplateElement.append($compile(args.messageTemplate)(scope)); 63 | } else { 64 | throw new Error('cgNotify could not find the .cg-notify-message-template element in '+args.templateUrl+'.'); 65 | } 66 | } 67 | 68 | angular.element(args.container).append(templateElement); 69 | messageElements.push(templateElement); 70 | 71 | if (scope.$position === 'center'){ 72 | $timeout(function(){ 73 | scope.$centerMargin = '-' + (templateElement[0].offsetWidth /2) + 'px'; 74 | }); 75 | } 76 | 77 | scope.$close = function(){ 78 | templateElement.css('opacity',0).attr('data-closing','true'); 79 | layoutMessages(); 80 | }; 81 | 82 | var layoutMessages = function(){ 83 | var j = 0; 84 | var currentY = startTop; 85 | for(var i = messageElements.length - 1; i >= 0; i --){ 86 | var shadowHeight = 10; 87 | var element = messageElements[i]; 88 | var height = element[0].offsetHeight; 89 | var top = currentY + height + shadowHeight; 90 | if (element.attr('data-closing')){ 91 | top += 20; 92 | } else { 93 | currentY += height + verticalSpacing; 94 | } 95 | element.css('top',top + 'px').css('margin-top','-' + (height+shadowHeight) + 'px').css('visibility','visible'); 96 | j ++; 97 | } 98 | }; 99 | 100 | $timeout(function(){ 101 | layoutMessages(); 102 | }); 103 | 104 | if (args.duration > 0){ 105 | $timeout(function(){ 106 | scope.$close(); 107 | },args.duration); 108 | } 109 | 110 | }, function(data) { 111 | throw new Error('Template specified for cgNotify ('+args.templateUrl+') could not be loaded. ' + data); 112 | }); 113 | 114 | var retVal = {}; 115 | 116 | retVal.close = function(){ 117 | if (scope.$close){ 118 | scope.$close(); 119 | } 120 | }; 121 | 122 | Object.defineProperty(retVal,'message',{ 123 | get: function(){ 124 | return scope.$message; 125 | }, 126 | set: function(val){ 127 | scope.$message = val; 128 | } 129 | }); 130 | 131 | openNotificationsScope.push(scope); 132 | 133 | return retVal; 134 | 135 | }; 136 | 137 | notify.config = function(args){ 138 | startTop = !angular.isUndefined(args.startTop) ? args.startTop : startTop; 139 | verticalSpacing = !angular.isUndefined(args.verticalSpacing) ? args.verticalSpacing : verticalSpacing; 140 | defaultDuration = !angular.isUndefined(args.duration) ? args.duration : defaultDuration; 141 | defaultTemplateUrl = args.templateUrl ? args.templateUrl : defaultTemplateUrl; 142 | position = !angular.isUndefined(args.position) ? args.position : position; 143 | container = args.container ? args.container : container; 144 | maximumOpen = args.maximumOpen ? args.maximumOpen : maximumOpen; 145 | }; 146 | 147 | notify.closeAll = function(){ 148 | for(var i = messageElements.length - 1; i >= 0; i --){ 149 | var element = messageElements[i]; 150 | element.css('opacity',0); 151 | } 152 | }; 153 | 154 | return notify; 155 | } 156 | ]); 157 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-notify", 3 | "main": [ 4 | "dist/angular-notify.js", 5 | "dist/angular-notify.css" 6 | ], 7 | "version": "2.5.1", 8 | "homepage": "https://github.com/cgross/angular-notify", 9 | "authors": [ 10 | "Chris Gross " 11 | ], 12 | "description": "A minimalistic notification service for Angular.", 13 | "keywords": [ 14 | "angular", 15 | "notify", 16 | "notifications" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "tests", 25 | "temp", 26 | "./angular-notify.css", 27 | "./angular-notify.html", 28 | "./angular-notify.js", 29 | "Gruntfile.js", 30 | "package.json", 31 | "demo" 32 | ], 33 | "dependencies": { 34 | "angular": ">=1.3" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bower_components/angular/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.3.15", 4 | "main": "./angular.js", 5 | "ignore": [], 6 | "dependencies": {}, 7 | "homepage": "https://github.com/angular/bower-angular", 8 | "_release": "1.3.15", 9 | "_resolution": { 10 | "type": "version", 11 | "tag": "v1.3.15", 12 | "commit": "ba7abcfa409ba852146e6ba206693cf7bac3e359" 13 | }, 14 | "_source": "git://github.com/angular/bower-angular.git", 15 | "_target": "~1.3", 16 | "_originalSource": "angular" 17 | } -------------------------------------------------------------------------------- /bower_components/angular/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular 15 | ``` 16 | 17 | Then add a ` 21 | ``` 22 | 23 | Or `require('angular')` from your code. 24 | 25 | ### bower 26 | 27 | ```shell 28 | bower install angular 29 | ``` 30 | 31 | Then add a ` 35 | ``` 36 | 37 | ## Documentation 38 | 39 | Documentation is available on the 40 | [AngularJS docs site](http://docs.angularjs.org/). 41 | 42 | ## License 43 | 44 | The MIT License 45 | 46 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | -------------------------------------------------------------------------------- /bower_components/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide:not(.ng-hide-animate) { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | -------------------------------------------------------------------------------- /bower_components/angular/angular.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(Q,W,t){'use strict';function R(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.3.15/"+(b?b+"/":"")+a;for(a=1;a").append(b).html();try{return b[0].nodeType===pb?z(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+z(b)})}catch(d){return z(c)}}function rc(b){try{return decodeURIComponent(b)}catch(a){}} 15 | function sc(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=rc(c[0]),y(d)&&(b=y(c[1])?rc(c[1]):!0,tc.call(a,d)?H(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Pb(b){var a=[];r(b,function(b,d){H(b)?r(b,function(b){a.push(Ea(d,!0)+(!0===b?"":"="+Ea(b,!0)))}):a.push(Ea(d,!0)+(!0===b?"":"="+Ea(b,!0)))});return a.length?a.join("&"):""}function qb(b){return Ea(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ea(b,a){return encodeURIComponent(b).replace(/%40/gi, 16 | "@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Id(b,a){var c,d,e=rb.length;b=A(b);for(d=0;d/,">"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=ab(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector", 18 | d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;Q&&e.test(Q.name)&&(c.debugInfoEnabled=!0,Q.name=Q.name.replace(e,""));if(Q&&!f.test(Q.name))return d();Q.name=Q.name.replace(f,"");ca.resumeBootstrap=function(b){r(b,function(b){a.push(b)});return d()};G(ca.resumeDeferredBootstrap)&&ca.resumeDeferredBootstrap()}function Kd(){Q.name="NG_ENABLE_DEBUG_INFO!"+Q.name;Q.location.reload()}function Ld(b){b=ca.element(b).injector();if(!b)throw Ja("test");return b.get("$$testability")} 19 | function vc(b,a){a=a||"_";return b.replace(Md,function(b,d){return(d?a:"")+b.toLowerCase()})}function Nd(){var b;wc||((ta=Q.jQuery)&&ta.fn.on?(A=ta,w(ta.fn,{scope:Ka.scope,isolateScope:Ka.isolateScope,controller:Ka.controller,injector:Ka.injector,inheritedData:Ka.inheritedData}),b=ta.cleanData,ta.cleanData=function(a){var c;if(Qb)Qb=!1;else for(var d=0,e;null!=(e=a[d]);d++)(c=ta._data(e,"events"))&&c.$destroy&&ta(e).triggerHandler("$destroy");b(a)}):A=T,ca.element=A,wc=!0)}function Rb(b,a,c){if(!b)throw Ja("areq", 20 | a||"?",c||"required");return b}function sb(b,a,c){c&&H(b)&&(b=b[b.length-1]);Rb(G(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function La(b,a){if("hasOwnProperty"===b)throw Ja("badname",a);}function xc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g")+d[2];for(d=d[0];d--;)c=c.lastChild;f=Ya(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)}); 27 | return e}function T(b){if(b instanceof T)return b;var a;C(b)&&(b=N(b),a=!0);if(!(this instanceof T)){if(a&&"<"!=b.charAt(0))throw Tb("nosel");return new T(b)}if(a){a=W;var c;b=(c=gf.exec(b))?[a.createElement(c[1])]:(c=Hc(b,a))?c.childNodes:[]}Ic(this,b)}function Ub(b){return b.cloneNode(!0)}function wb(b,a){a||xb(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d 4096 bytes)!"));else{if(p.cookie!==y)for(y=p.cookie,d=y.split("; "),fa={},f=0;fk&&this.remove(q.key),b},get:function(a){if(k
").parent()[0])});var f=S(a,b,a,c,d,e);D.$$addScopeClass(a); 50 | var g=null;return function(b,c,d){Rb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==va(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?A(Xb(g,A("
").append(a).html())):c?Ka.clone.call(a):a;if(h)for(var k in h)d.data("$"+k+"Controller",h[k].instance);D.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function S(a,b,c,d,e,f){function g(a, 51 | c,d,e){var f,k,l,q,p,s,M;if(m)for(M=Array(c.length),q=0;qK.priority)break;if(V=K.scope)K.templateUrl||(J(V)?(Na("new/isolated scope",P||F,K,w),P=K):Na("new/isolated scope",P,K,w)),F=F||K;da=K.name;!K.templateUrl&&K.controller&&(V=K.controller,S=S||{},Na("'"+da+"' controller",S[da],K,w),S[da]=K);if(V=K.transclude)ka=!0,K.$$tlb||(Na("transclusion",fa,K,w),fa=K),"element"==V?(E=!0,I=K.priority,V=w,w=e.$$element=A(W.createComment(" "+da+": "+ 61 | e[da]+" ")),d=w[0],T(g,Za.call(V,0),d),fb=D(V,f,I,k&&k.name,{nonTlbTranscludeDirective:fa})):(V=A(Ub(d)).contents(),w.empty(),fb=D(V,f));if(K.template)if(x=!0,Na("template",ma,K,w),ma=K,V=G(K.template)?K.template(w,e):K.template,V=Tc(V),K.replace){k=K;V=Sb.test(V)?Uc(Xb(K.templateNamespace,N(V))):[];d=V[0];if(1!=V.length||d.nodeType!==qa)throw la("tplrt",da,"");T(g,w,d);Q={$attr:{}};V=X(d,[],Q);var aa=a.splice(z+1,a.length-(z+1));P&&y(V);a=a.concat(V).concat(aa);R(e,Q);Q=a.length}else w.html(V);if(K.templateUrl)x= 62 | !0,Na("template",ma,K,w),ma=K,K.replace&&(k=K),B=of(a.splice(z,a.length-z),w,e,g,ka&&fb,l,p,{controllerDirectives:S,newIsolateScopeDirective:P,templateDirective:ma,nonTlbTranscludeDirective:fa}),Q=a.length;else if(K.compile)try{za=K.compile(w,e,fb),G(za)?s(null,za,Oa,U):za&&s(za.pre,za.post,Oa,U)}catch(pf){c(pf,wa(w))}K.terminal&&(B.terminal=!0,I=Math.max(I,K.priority))}B.scope=F&&!0===F.scope;B.transcludeOnThisElement=ka;B.elementTranscludeOnThisElement=E;B.templateOnThisElement=x;B.transclude=fb; 63 | m.hasElementTranscludeDirective=E;return B}function y(a){for(var b=0,c=a.length;bq.priority)&&-1!=q.restrict.indexOf(f)&&(k&&(q=Ob(q,{$$start:k,$$end:l})),b.push(q),h=q)}catch(M){c(M)}}return h}function x(b){if(d.hasOwnProperty(b))for(var c=a.get(b+"Directive"),e=0,f=c.length;e"+b+"";return c.childNodes[0].childNodes;default:return b}} 68 | function Q(a,b){if("srcdoc"==b)return Z.HTML;var c=va(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return Z.RESOURCE_URL}function Oa(a,c,d,e,f){var h=Q(a,e);f=g[e]||f;var k=b(d,!0,h,f);if(k){if("multiple"===e&&"select"===va(a))throw la("selmulti",wa(a));c.push({priority:100,compile:function(){return{pre:function(a,c,g){c=g.$$observers||(g.$$observers={});if(l.test(e))throw la("nodomevents");var m=g[e];m!==d&&(k=m&&b(m,!0,h,f),d=m);k&&(g[e]=k(a),(c[e]||(c[e]=[])).$$inter= 69 | !0,(g.$$observers&&g.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?g.$updateClass(a,b):g.$set(e,a)}))}}}})}}function T(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g=a)return b;for(;a--;)8===b[a].nodeType&&qf.call(b,a,1);return b}function Fe(){var b={},a=!1,c=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,c){La(a, 75 | "controller");J(a)?w(b,a):b[a]=c};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(d,e){function f(a,b,c,d){if(!a||!J(a.$scope))throw R("$controller")("noscp",d,b);a.$scope[b]=c}return function(g,h,l,k){var n,p,q;l=!0===l;k&&C(k)&&(q=k);if(C(g)){k=g.match(c);if(!k)throw rf("ctrlfmt",g);p=k[1];q=q||k[3];g=b.hasOwnProperty(p)?b[p]:xc(h.$scope,p,!0)||(a?xc(e,p,!0):t);sb(g,p,!0)}if(l)return l=(H(g)?g[g.length-1]:g).prototype,n=Object.create(l||null),q&&f(h,q,n,p||g.name),w(function(){d.invoke(g, 76 | n,h,p);return n},{instance:n,identifier:q});n=d.instantiate(g,h,p);q&&f(h,q,n,p||g.name);return n}}]}function Ge(){this.$get=["$window",function(b){return A(b.document)}]}function He(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Zb(b,a){if(C(b)){var c=b.replace(sf,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(Wc))||(d=(d=c.match(tf))&&uf[d[0]].test(c));d&&(b=qc(c))}}return b}function Xc(b){var a=ia(),c,d,e;if(!b)return a;r(b.split("\n"), 77 | function(b){e=b.indexOf(":");c=z(N(b.substr(0,e)));d=N(b.substr(e+1));c&&(a[c]=a[c]?a[c]+", "+d:d)});return a}function Yc(b){var a=J(b)?b:t;return function(c){a||(a=Xc(b));return c?(c=a[z(c)],void 0===c&&(c=null),c):a}}function Zc(b,a,c,d){if(G(d))return d(b,a,c);r(d,function(d){b=d(b,a,c)});return b}function Ke(){var b=this.defaults={transformResponse:[Zb],transformRequest:[function(a){return J(a)&&"[object File]"!==Ca.call(a)&&"[object Blob]"!==Ca.call(a)&&"[object FormData]"!==Ca.call(a)?$a(a): 78 | a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:sa($b),put:sa($b),patch:sa($b)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},a=!1;this.useApplyAsync=function(b){return y(b)?(a=!!b,this):a};var c=this.interceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(d,e,f,g,h,l){function k(a){function c(a){var b=w({},a);b.data=a.data?Zc(a.data,a.headers,a.status,e.transformResponse):a.data;a=a.status;return 200<=a&&300>a? 79 | b:h.reject(b)}function d(a){var b,c={};r(a,function(a,d){G(a)?(b=a(),null!=b&&(c[d]=b)):c[d]=a});return c}if(!ca.isObject(a))throw R("$http")("badreq",a);var e=w({method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse},a);e.headers=function(a){var c=b.headers,e=w({},a.headers),f,g,c=w({},c.common,c[z(a.method)]);a:for(f in c){a=z(f);for(g in e)if(z(g)===a)continue a;e[f]=c[f]}return d(e)}(a);e.method=ub(e.method);var f=[function(a){var d=a.headers,e=Zc(a.data,Yc(d), 80 | t,a.transformRequest);x(e)&&r(d,function(a,b){"content-type"===z(b)&&delete d[b]});x(a.withCredentials)&&!x(b.withCredentials)&&(a.withCredentials=b.withCredentials);return n(a,e).then(c,c)},t],g=h.when(e);for(r(u,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var k=f.shift(),g=g.then(a,k)}g.success=function(a){g.then(function(b){a(b.data,b.status,b.headers,e)});return g};g.error= 81 | function(a){g.then(null,function(b){a(b.data,b.status,b.headers,e)});return g};return g}function n(c,f){function l(b,c,d,e){function f(){m(c,b,d,e)}I&&(200<=b&&300>b?I.put(P,[b,c,Xc(d),e]):I.remove(P));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function m(a,b,d,e){b=Math.max(b,0);(200<=b&&300>b?L.resolve:L.reject)({data:a,status:b,headers:Yc(d),config:c,statusText:e})}function n(a){m(a.data,a.status,sa(a.headers()),a.statusText)}function u(){var a=k.pendingRequests.indexOf(c);-1!==a&&k.pendingRequests.splice(a, 82 | 1)}var L=h.defer(),B=L.promise,I,D,S=c.headers,P=p(c.url,c.params);k.pendingRequests.push(c);B.then(u,u);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(I=J(c.cache)?c.cache:J(b.cache)?b.cache:q);I&&(D=I.get(P),y(D)?D&&G(D.then)?D.then(n,n):H(D)?m(D[1],D[0],sa(D[2]),D[3]):m(D,200,{},"OK"):I.put(P,B));x(D)&&((D=$c(c.url)?e.cookies()[c.xsrfCookieName||b.xsrfCookieName]:t)&&(S[c.xsrfHeaderName||b.xsrfHeaderName]=D),d(c.method,P,f,l,S,c.timeout,c.withCredentials,c.responseType)); 83 | return B}function p(a,b){if(!b)return a;var c=[];Ed(b,function(a,b){null===a||x(a)||(H(a)||(a=[a]),r(a,function(a){J(a)&&(a=ga(a)?a.toISOString():$a(a));c.push(Ea(b)+"="+Ea(a))}))});0=l&&(s.resolve(q),p(M.$$intervalId),delete f[M.$$intervalId]);u||b.$apply()},h);f[M.$$intervalId]=s;return M}var f={};e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId), 91 | delete f[b.$$intervalId],!0):!1};return e}]}function Rd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), 92 | DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(b){return 1===b?"one":"other"}}}}function bc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=qb(b[a]); 93 | return b.join("/")}function ad(b,a){var c=Aa(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=aa(c.port)||xf[c.protocol]||null}function bd(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=sc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function ya(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ga(b){var a=b.indexOf("#"); 94 | return-1==a?b:b.substr(0,a)}function Fb(b){return b.replace(/(#.+)|#$/,"$1")}function cc(b){return b.substr(0,Ga(b).lastIndexOf("/")+1)}function dc(b,a){this.$$html5=!0;a=a||"";var c=cc(b);ad(b,this);this.$$parse=function(a){var b=ya(c,a);if(!C(b))throw Gb("ipthprfx",a,c);bd(b,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Pb(this.$$search),b=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=bc(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$parseLinkUrl= 95 | function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;(f=ya(b,d))!==t?(g=f,g=(f=ya(a,f))!==t?c+(ya("/",f)||f):b+g):(f=ya(c,d))!==t?g=c+f:c==d+"/"&&(g=c);g&&this.$$parse(g);return!!g}}function ec(b,a){var c=cc(b);ad(b,this);this.$$parse=function(d){d=ya(b,d)||ya(c,d);var e;"#"===d.charAt(0)?(e=ya(a,d),x(e)&&(e=d)):e=this.$$html5?d:"";bd(e,this);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()}; 96 | this.$$compose=function(){var c=Pb(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Ga(b)==Ga(a)?(this.$$parse(a),!0):!1}}function cd(b,a){this.$$html5=!0;ec.apply(this,arguments);var c=cc(b);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;b==Ga(d)?f=d:(g=ya(c,d))?f=b+a+g:c===d+"/"&&(f=c);f&&this.$$parse(f);return!!f};this.$$compose= 97 | function(){var c=Pb(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function Hb(b){return function(){return this[b]}}function dd(b,a){return function(c){if(x(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Me(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return y(a)?(b=a,this):b};this.html5Mode=function(b){return Wa(b)?(a.enabled=b,this):J(b)?(Wa(b.enabled)&&(a.enabled= 98 | b.enabled),Wa(b.requireBase)&&(a.requireBase=b.requireBase),Wa(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,n;n=d.baseHref();var p=d.url(),q;if(a.enabled){if(!n&&a.requireBase)throw Gb("nobase"); 99 | q=p.substring(0,p.indexOf("/",p.indexOf("//")+2))+(n||"/");n=e.history?dc:cd}else q=Ga(p),n=ec;k=new n(q,"#"+b);k.$$parseLinkUrl(p,p);k.$$state=d.state();var u=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=A(b.target);"a"!==va(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");J(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Aa(h.animVal).href); 100 | u.test(h)||!h||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(h,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});Fb(k.absUrl())!=Fb(p)&&d.url(k.absUrl(),!0);var s=!0;d.onUrlChange(function(a,b){c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,h(d,!1,e)):(s=!1,l(d,e)))});c.$$phase||c.$digest()}); 101 | c.$watch(function(){var a=Fb(d.url()),b=Fb(k.absUrl()),f=d.state(),g=k.$$replace,q=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(s||q)s=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(q&&h(b,g,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function Ne(){var b=!0,a=this;this.debugEnabled=function(a){return y(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof 102 | Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||E;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=[];r(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a, 103 | arguments)}}()}}]}function ua(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw na("isecfld",a);return b}function oa(b,a){if(b){if(b.constructor===b)throw na("isecfn",a);if(b.window===b)throw na("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw na("isecdom",a);if(b===Object)throw na("isecobj",a);}return b}function fc(b){return b.constant}function hb(b,a,c,d,e){oa(b,e);oa(a,e);c=c.split(".");for(var f, 104 | g=0;1h?ed(g[0],g[1],g[2],g[3],g[4],c,d):function(a,b){var e=0,f;do f=ed(g[e++],g[e++],g[e++],g[e++],g[e++],c,d)(a,b),b=t,a=f;while(e=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;fa)for(b in l++,f)e.hasOwnProperty(b)||(u--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,g,k=1r&&(M=4-r,O[M]||(O[M]=[]),O[M].push({msg:G(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:h}));else if(b=== 124 | d){n=!1;break a}}catch(A){g(A)}if(!(k=t.$$childHead||t!==this&&t.$$nextSibling))for(;t!==this&&!(k=t.$$nextSibling);)t=t.$parent}while(t=k);if((n||m.length)&&!r--)throw v.$$phase=null,c("infdig",a,O);}while(n||m.length);for(v.$$phase=null;F.length;)try{F.shift()()}catch(x){g(x)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(this!==v){for(var b in this.$$listenerCount)q(this,this.$$listenerCount[b],b);a.$$childHead==this&&(a.$$childHead= 125 | this.$$nextSibling);a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=E;this.$on=this.$watch=this.$watchGroup=function(){return E};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}}},$eval:function(a, 126 | b){return h(a)(this,b)},$evalAsync:function(a,b){v.$$phase||m.length||l.defer(function(){m.length&&v.$digest()});m.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){F.push(a)},$apply:function(a){try{return p("$apply"),this.$eval(a)}catch(b){g(b)}finally{v.$$phase=null;try{v.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&t.push(b);M()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]|| 127 | (d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,q(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=Ya([h],arguments,1),l,q;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(q=d.length;lQa)throw Ba("iequirks");var d=sa(pa);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs= 134 | d.getTrusted=function(a,b){return b},d.valueOf=ra);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;r(pa,function(a,b){var c=z(b);d[db("parse_as_"+c)]=function(b){return e(a,b)};d[db("get_trusted_"+c)]=function(b){return f(a,b)};d[db("trust_as_"+c)]=function(b){return g(a,b)}});return d}]}function Ue(){this.$get=["$window","$document",function(b,a){var c={},d=aa((/android (\d+)/.exec(z((b.navigator|| 135 | {}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,n=!1;if(l){for(var p in l)if(k=h.exec(p)){g=k[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||g+"Transition"in l);n=!!("animation"in l||g+"Animation"in l);!d||k&&n||(k=C(f.body.style.webkitTransition),n=C(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"=== 136 | a&&11>=Qa)return!1;if(x(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:bb(),vendorPrefix:g,transitions:k,animations:n,android:d}}]}function We(){this.$get=["$templateCache","$http","$q",function(b,a,c){function d(e,f){d.totalPendingRequests++;var g=a.defaults&&a.defaults.transformResponse;H(g)?g=g.filter(function(a){return a!==Zb}):g===Zb&&(g=null);return a.get(e,{cache:b,transformResponse:g})["finally"](function(){d.totalPendingRequests--}).then(function(a){return a.data}, 137 | function(a){if(!f)throw la("tpload",e);return c.reject(a)})}d.totalPendingRequests=0;return d}]}function Xe(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var d=ca.element(a).data("$binding");d&&r(d,function(d){c?(new RegExp("(^|\\s)"+gd(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,c){for(var g=["ng-","data-ng-","ng\\:"], 138 | h=0;hb;b=Math.abs(b);var g=b+"",h="",l=[],k=!1;if(-1!==g.indexOf("e")){var n=g.match(/([\d\.]+)e(-?)(\d+)/);n&&"-"==n[2]&&n[3]>e+1?b=0:(h=g,k=!0)}if(k)0b&&(h=b.toFixed(e),b=parseFloat(h));else{g=(g.split(od)[1]|| 144 | "").length;x(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var g=(""+b).split(od),k=g[0],g=g[1]||"",p=0,q=a.lgSize,u=a.gSize;if(k.length>=q+u)for(p=k.length-q,n=0;nb&&(d="-",b=-b);for(b=""+b;b.length-c)e+=c;0===e&&-12==c&&(e=12);return Ib(e,a,d)}}function Jb(b,a){return function(c,d){var e=c["get"+b](),f=ub(a?"SHORT"+b:b);return d[f][e]}}function pd(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function qd(b){return function(a){var c=pd(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+ 146 | (4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Ib(a,b)}}function ic(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function kd(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=aa(b[9]+b[10]),g=aa(b[9]+b[11]));h.call(a,aa(b[1]),aa(b[2])-1,aa(b[3]));f=aa(b[4]||0)-f;g=aa(b[5]||0)-g;h=aa(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; 147 | return function(c,e,f){var g="",h=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;C(c)&&(c=Kf.test(c)?aa(c):a(c));Y(c)&&(c=new Date(c));if(!ga(c))return c;for(;e;)(k=Lf.exec(e))?(h=Ya(h,k,1),e=h.pop()):(h.push(e),e=null);f&&"UTC"===f&&(c=new Date(c.getTime()),c.setMinutes(c.getMinutes()+c.getTimezoneOffset()));r(h,function(a){l=Mf[a];g+=l?l(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Ff(){return function(b,a){x(a)&&(a=2);return $a(b,a)}}function Gf(){return function(b, 148 | a){Y(b)&&(b=b.toString());return H(b)||C(b)?(a=Infinity===Math.abs(Number(a))?Number(a):aa(a))?0b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",n)}a.on("change",l);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)}}function Mb(b,a){return function(c,d){var e,f;if(ga(c))return c;if(C(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(Nf.test(c))return new Date(c);b.lastIndex= 155 | 0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(b,c){c=r}; 157 | g.$observe("min",function(a){r=q(a);h.$validate()})}if(y(g.max)||g.ngMax){var v;h.$validators.max=function(a){return!p(a)||x(v)||c(a)<=v};g.$observe("max",function(a){v=q(a);h.$validate()})}}}function td(b,a,c,d){(d.$$hasNativeValidators=J(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?t:b})}function ud(b,a,c,d,e){if(y(d)){b=b(d);if(!b.constant)throw R("ngModel")("constexpr",c,d);return b(a)}return e}function kc(b,a){b="ngClass"+b;return["$animate", 158 | function(c){function d(a,b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/,Sb=/<|&#?\w+;/,ef=/<([\w:]+)/,ff=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja={option:[1,'"],thead:[1,"","
"],col:[2,"", 164 | "
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ja.optgroup=ja.option;ja.tbody=ja.tfoot=ja.colgroup=ja.caption=ja.thead;ja.th=ja.td;var Ka=T.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===W.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),T(Q).on("load",a))},toString:function(){var b=[];r(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<= 165 | b?A(this[b]):A(this[this.length+b])},length:0,push:Pf,sort:[].sort,splice:[].splice},Eb={};r("multiple selected checked disabled readOnly required open".split(" "),function(b){Eb[z(b)]=b});var Oc={};r("input select option textarea button form details".split(" "),function(b){Oc[b]=!0});var Pc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};r({data:Vb,removeData:xb},function(b,a){T[a]=b});r({data:Vb,inheritedData:Db,scope:function(b){return A.data(b,"$scope")|| 166 | Db(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return A.data(b,"$isolateScope")||A.data(b,"$isolateScopeNoTemplate")},controller:Kc,injector:function(b){return Db(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ab,css:function(b,a,c){a=db(a);if(y(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=z(a);if(Eb[d])if(y(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||E).specified? 167 | d:t;else if(y(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?t:b},prop:function(b,a,c){if(y(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(x(b)){var d=a.nodeType;return d===qa||d===pb?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(x(a)){if(b.multiple&&"select"===va(b)){var c=[];r(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(x(a))return b.innerHTML; 168 | wb(b,!0);b.innerHTML=a},empty:Lc},function(b,a){T.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==Lc&&(2==b.length&&b!==Ab&&b!==Kc?a:d)===t){if(J(a)){for(e=0;e":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)}, 184 | "||":function(a,c,d,e){return d(a,c)||e(a,c)},"!":function(a,c,d){return!d(a,c)},"=":!0,"|":!0}),Zf={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},hc=function(a){this.options=a};hc.prototype={constructor:hc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=y(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw na("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index< 187 | this.text.length;){var d=z(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.indexa){a=this.tokens[a];var g=a.text;if(g===c||g===d||g===e||g=== 192 | f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},consume:function(a){if(0===this.tokens.length)throw na("ueoe",this.text);var c=this.expect(a);c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},unaryFn:function(a,c){var d=nb[a];return w(function(a,f){return d(a,f,c)},{constant:c.constant,inputs:[c]})},binaryFn:function(a,c,d,e){var f=nb[c];return w(function(c,e){return f(c,e,a,d)},{constant:a.constant&& 193 | d.constant,inputs:!e&&[a,d]})},identifier:function(){for(var a=this.consume().text;this.peek(".")&&this.peekAhead(1).identifier&&!this.peekAhead(2,"(");)a+=this.consume().text+this.consume().text;return zf(a,this.options,this.text)},constant:function(){var a=this.consume().value;return w(function(){return a},{constant:!0,literal:!0})},statements:function(){for(var a=[];;)if(0","<=",">=");)a=this.binaryFn(a,c.text, 197 | this.additive());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.text,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.text,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(ib.ZERO,a.text,this.unary()):(a=this.expect("!"))?this.unaryFn(a.text,this.unary()):this.primary()},fieldAccess:function(a){var c= 198 | this.identifier();return w(function(d,e,f){d=f||a(d,e);return null==d?t:c(d)},{assign:function(d,e,f){var g=a(d,f);g||a.assign(d,g={},f);return c.assign(g,e)}})},objectIndex:function(a){var c=this.text,d=this.expression();this.consume("]");return w(function(e,f){var g=a(e,f),h=d(e,f);ua(h,c);return g?oa(g[h],c):t},{assign:function(e,f,g){var h=ua(d(e,g),c),l=oa(a(e,g),c);l||a.assign(e,l={},g);return l[h]=f}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression()); 199 | while(this.expect(","))}this.consume(")");var e=this.text,f=d.length?[]:null;return function(g,h){var l=c?c(g,h):y(c)?t:g,k=a(g,h,l)||E;if(f)for(var n=d.length;n--;)f[n]=oa(d[n](g,h),e);oa(l,e);if(k){if(k.constructor===k)throw na("isecfn",e);if(k===Wf||k===Xf||k===Yf)throw na("isecff",e);}l=k.apply?k.apply(l,f):k(f[0],f[1],f[2],f[3],f[4]);f&&(f.length=0);return oa(l,e)}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(",")) 200 | }this.consume("]");return w(function(c,d){for(var e=[],f=0,g=a.length;fa.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Ib(Math[0=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},Lf=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/, 203 | Kf=/^\-?\d+$/;kd.$inject=["$locale"];var Hf=ea(z),If=ea(ub);md.$inject=["$parse"];var Td=ea({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f="[object SVGAnimatedString]"===Ca.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),vb={};r(Eb,function(a,c){if("multiple"!=a){var d=xa("ng-"+c);vb[d]=function(){return{restrict:"A",priority:100,link:function(a,f,g){a.$watch(g[d], 204 | function(a){g.$set(c,!!a)})}}}}});r(Pc,function(a,c){vb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(Of))){f.$set("ngPattern",new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});r(["src","srcset","href"],function(a){var c=xa("ng-"+a);vb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===Ca.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href", 205 | g=null);f.$observe(c,function(c){c?(f.$set(h,c),Qa&&g&&e.prop(g,f[h])):"href"===a&&f.$set(h,null)})}}}});var Kb={$addControl:E,$$renameControl:function(a,c){a.$name=c},$removeControl:E,$setValidity:E,$setDirty:E,$setPristine:E,$setSubmitted:E};rd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var yd=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:rd,compile:function(d,e){d.addClass(Ra).addClass(lb);var f=e.name?"name":a&&e.ngForm?"ngForm": 206 | !1;return{pre:function(a,d,e,k){if(!("action"in e)){var n=function(c){a.$apply(function(){k.$commitViewValue();k.$setSubmitted()});c.preventDefault()};d[0].addEventListener("submit",n,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",n,!1)},0,!1)})}var p=k.$$parentForm;f&&(hb(a,null,k.$name,k,k.$name),e.$observe(f,function(c){k.$name!==c&&(hb(a,null,k.$name,t,k.$name),p.$$renameControl(k,c),hb(a,null,k.$name,k,k.$name))}));d.on("$destroy",function(){p.$removeControl(k); 207 | f&&hb(a,null,e[f],t,k.$name);w(k,Kb)})}}}}}]},Ud=yd(),ge=yd(!0),Nf=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,$f=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,ag=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,bg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,zd=/^(\d{4})-(\d{2})-(\d{2})$/,Ad=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,lc=/^(\d{4})-W(\d\d)$/,Bd=/^(\d{4})-(\d\d)$/, 208 | Cd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Dd={text:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);jc(e)},date:kb("date",zd,Mb(zd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Ad,Mb(Ad,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Cd,Mb(Cd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",lc,function(a,c){if(ga(a))return a;if(C(a)){lc.lastIndex=0;var d=lc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,l=0,k=pd(e),f=7*(f-1);c&&(d=c.getHours(),g= 209 | c.getMinutes(),h=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,g,h,l)}}return NaN},"yyyy-Www"),month:kb("month",Bd,Mb(Bd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){td(a,c,d,e);jb(a,c,d,e,f,g);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:bg.test(a)?parseFloat(a):t});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!Y(a))throw Nb("numfmt",a);a=a.toString()}return a});if(y(d.min)||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)|| 210 | x(h)||a>=h};d.$observe("min",function(a){y(a)&&!Y(a)&&(a=parseFloat(a,10));h=Y(a)&&!isNaN(a)?a:t;e.$validate()})}if(y(d.max)||d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||x(l)||a<=l};d.$observe("max",function(a){y(a)&&!Y(a)&&(a=parseFloat(a,10));l=Y(a)&&!isNaN(a)?a:t;e.$validate()})}},url:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);jc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||$f.test(d)}},email:function(a,c,d,e,f,g){jb(a,c,d,e,f,g);jc(e); 211 | e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||ag.test(d)}},radio:function(a,c,d,e){x(d.name)&&c.attr("name",++ob);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,l){var k=ud(l,a,"ngTrueValue",d.ngTrueValue,!0),n=ud(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&& 212 | a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ha(a,k)});e.$parsers.push(function(a){return a?k:n})},hidden:E,button:E,submit:E,reset:E,file:E},zc=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,l){l[0]&&(Dd[z(h.type)]||Dd.text)(f,g,h,l[0],c,a,d,e)}}}}],cg=/^(true|false|\d+)$/,ye=function(){return{restrict:"A",priority:100,compile:function(a, 213 | c){return cg.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},Zd=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===t?"":a})}}}}],ae=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,g){d=a(f.attr(g.$attr.ngBindTemplate)); 214 | c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===t?"":a})}}}}],$d=["$sce","$parse","$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var g=c(f.ngBindHtml),h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],xe=ea({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}), 215 | be=kc("",!0),de=kc("Odd",0),ce=kc("Even",1),ee=Ia({compile:function(a,c){c.$set("ngCloak",t);a.removeClass("ng-cloak")}}),fe=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Ec={},dg={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=xa("ng-"+a);Ec[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h= 216 | d(g[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){h(c,{$event:d})};dg[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var ie=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,l,k;c.$watch(e.ngIf,function(c){c?l||g(function(c,f){l=f;c[c.length++]=W.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),h&&(k= 217 | tb(h.clone),a.leave(k).then(function(){k=null}),h=null))})}}}],je=["$templateRequest","$anchorScroll","$animate","$sce",function(a,c,d,e){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(f,g){var h=g.ngInclude||g.src,l=g.onload||"",k=g.autoscroll;return function(f,g,q,r,s){var t=0,v,m,F,w=function(){m&&(m.remove(),m=null);v&&(v.$destroy(),v=null);F&&(d.leave(F).then(function(){m=null}),m=F,F=null)};f.$watch(e.parseAsResourceUrl(h),function(e){var h= 218 | function(){!y(k)||k&&!f.$eval(k)||c()},m=++t;e?(a(e,!0).then(function(a){if(m===t){var c=f.$new();r.template=a;a=s(c,function(a){w();d.enter(a,null,g).then(h)});v=c;F=a;v.$emit("$includeContentLoaded",e);f.$eval(l)}},function(){m===t&&(w(),f.$emit("$includeContentError",e))}),f.$emit("$includeContentRequested",e)):(w(),r.template=null)})}}}}],Ae=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Hc(f.template, 219 | W).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ke=Ia({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),we=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?N(f):f;e.$parsers.push(function(a){if(!x(a)){var c=[];a&&r(a.split(h),function(a){a&&c.push(g?N(a):a)});return c}});e.$formatters.push(function(a){return H(a)? 220 | a.join(f):t});e.$isEmpty=function(a){return!a||!a.length}}}},lb="ng-valid",vd="ng-invalid",Ra="ng-pristine",Lb="ng-dirty",xd="ng-pending",Nb=new R("ngModel"),eg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,l,k,n){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=t;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0; 221 | this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=t;this.$name=n(d.name||"",!1)(a);var p=f(d.ngModel),q=p.assign,u=p,s=q,M=null,v,m=this;this.$$setOptions=function(a){if((m.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");u=function(a){var d=p(a);G(d)&&(d=c(a));return d};s=function(a,c){G(p(a))?g(a,{$$$p:m.$modelValue}):q(a,m.$modelValue)}}else if(!p.assign)throw Nb("nonassign",d.ngModel,wa(e)); 222 | };this.$render=E;this.$isEmpty=function(a){return x(a)||""===a||null===a||a!==a};var F=e.inheritedData("$formController")||Kb,w=0;sd({ctrl:this,$element:e,set:function(a,c){a[c]=!0},unset:function(a,c){delete a[c]},parentForm:F,$animate:g});this.$setPristine=function(){m.$dirty=!1;m.$pristine=!0;g.removeClass(e,Lb);g.addClass(e,Ra)};this.$setDirty=function(){m.$dirty=!0;m.$pristine=!1;g.removeClass(e,Ra);g.addClass(e,Lb);F.$setDirty()};this.$setUntouched=function(){m.$touched=!1;m.$untouched=!0;g.setClass(e, 223 | "ng-untouched","ng-touched")};this.$setTouched=function(){m.$touched=!0;m.$untouched=!1;g.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){h.cancel(M);m.$viewValue=m.$$lastCommittedViewValue;m.$render()};this.$validate=function(){if(!Y(m.$modelValue)||!isNaN(m.$modelValue)){var a=m.$$rawModelValue,c=m.$valid,d=m.$modelValue,e=m.$options&&m.$options.allowInvalid;m.$$runValidators(a,m.$$lastCommittedViewValue,function(f){e||c===f||(m.$modelValue=f?a:t,m.$modelValue!==d&&m.$$writeModelToScope())})}}; 224 | this.$$runValidators=function(a,c,d){function e(){var d=!0;r(m.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?!0:(r(m.$asyncValidators,function(a,c){g(c,null)}),!1)}function f(){var d=[],e=!0;r(m.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!G(k.then))throw Nb("$asyncValidators",k);g(h,t);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},E):h(!0)}function g(a,c){l===w&&m.$setValidity(a,c)}function h(a){l===w&&d(a)}w++;var l= 225 | w;(function(){var a=m.$$parserName||"parse";if(v===t)g(a,null);else return v||(r(m.$validators,function(a,c){g(c,null)}),r(m.$asyncValidators,function(a,c){g(c,null)})),g(a,v),v;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=m.$viewValue;h.cancel(M);if(m.$$lastCommittedViewValue!==a||""===a&&m.$$hasNativeValidators)m.$$lastCommittedViewValue=a,m.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=m.$$lastCommittedViewValue;if(v= 226 | x(c)?t:!0)for(var d=0;dz;)d=t.pop(),n(O,d.label,!1),d.element.remove()}for(;R.length> 245 | x;){l=R.pop();for(z=1;za&&q.removeOption(c)})}var v;if(!(v=s.match(d)))throw gg("iexp",s,wa(f));var C=c(v[2]||v[1]),x=v[4]||v[6],A=/ as /.test(v[0])&&v[1],B=A?c(A):null,G=v[5],J=c(v[3]||""),z=c(v[2]?v[1]:x),L=c(v[7]),I=v[8]?c(v[8]):null,Q={},R=[[{element:f,label:""}]],T={};w&&(a(w)(e),w.removeClass("ng-scope"),w.remove());f.empty();f.on("change",function(){e.$apply(function(){var a=L(e)||[],c;if(u)c=[],r(f.val(), 246 | function(d){d=I?Q[d]:d;c.push("?"===d?t:""===d?null:h(B?B:z,d,a[d]))});else{var d=I?Q[f.val()]:f.val();c="?"===d?t:""===d?null:h(B?B:z,d,a[d])}g.$setViewValue(c);p()})});g.$render=p;e.$watchCollection(L,l);e.$watchCollection(function(){var a=L(e),c;if(a&&H(a)){c=Array(a.length);for(var d=0,f=a.length;df||e.$isEmpty(c)||c.length<=f}}}}},Cc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=aa(a)||0;e.$validate()});e.$validators.minlength=function(a,c){return e.$isEmpty(c)||c.length>=f}}}}};Q.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(Nd(),Pd(ca),A(W).ready(function(){Jd(W,uc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend(''); 251 | //# sourceMappingURL=angular.min.js.map 252 | -------------------------------------------------------------------------------- /bower_components/angular/angular.min.js.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgross/angular-notify/d4eb2e9c2b0635c3251a9f9282dccdbe2e31e24d/bower_components/angular/angular.min.js.gzip -------------------------------------------------------------------------------- /bower_components/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.3.15", 4 | "main": "./angular.js", 5 | "ignore": [], 6 | "dependencies": { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular/index.js: -------------------------------------------------------------------------------- 1 | require('./angular'); 2 | module.exports = angular; 3 | -------------------------------------------------------------------------------- /bower_components/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.3.15", 4 | "description": "HTML enhanced for web apps", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "client-side" 18 | ], 19 | "author": "Angular Core Team ", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/angular/angular.js/issues" 23 | }, 24 | "homepage": "http://angularjs.org" 25 | } 26 | -------------------------------------------------------------------------------- /demo/demo.js: -------------------------------------------------------------------------------- 1 | angular.module('app', ['cgNotify']); 2 | 3 | angular.module('app').controller('DemoCtrl',function($scope,notify){ 4 | 5 | $scope.msg = 'Hello! This is a sample message!'; 6 | $scope.template = ''; 7 | 8 | $scope.positions = ['center', 'left', 'right']; 9 | $scope.position = $scope.positions[0]; 10 | 11 | $scope.duration = 10000; 12 | 13 | $scope.demo = function(){ 14 | notify({ 15 | message: $scope.msg, 16 | classes: $scope.classes, 17 | templateUrl: $scope.template, 18 | position: $scope.position, 19 | duration: $scope.duration 20 | }); 21 | }; 22 | 23 | $scope.closeAll = function(){ 24 | notify.closeAll(); 25 | }; 26 | 27 | $scope.demoMessageTemplate = function(){ 28 | 29 | var messageTemplate = 'This is an example using a dynamically rendered Angular template for the message text. '+ 30 | 'I can have hyperlinks with ng-click or any valid Angular enhanced html.'; 31 | 32 | notify({ 33 | messageTemplate: messageTemplate, 34 | classes: $scope.classes, 35 | scope:$scope, 36 | templateUrl: $scope.template, 37 | position: $scope.position, 38 | }); 39 | 40 | }; 41 | 42 | $scope.clickedLink = function(){ 43 | notify('You clicked a link!'); 44 | }; 45 | 46 | }); -------------------------------------------------------------------------------- /demo/gh-fork-ribbon.css: -------------------------------------------------------------------------------- 1 | /* Left will inherit from right (so we don't need to duplicate code) */ 2 | .github-fork-ribbon { 3 | /* The right and left classes determine the side we attach our banner to */ 4 | position: absolute; 5 | 6 | /* Add a bit of padding to give some substance outside the "stitching" */ 7 | padding: 2px 0; 8 | 9 | /* Set the base colour */ 10 | background-color: #a00; 11 | 12 | /* Set a gradient: transparent black at the top to almost-transparent black at the bottom */ 13 | background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15))); 14 | background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 15 | background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 16 | background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 17 | background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 18 | background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 19 | 20 | /* Add a drop shadow */ 21 | -webkit-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5); 22 | -moz-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5); 23 | box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5); 24 | 25 | z-index: 9999; 26 | pointer-events: auto; 27 | } 28 | 29 | .github-fork-ribbon a, 30 | .github-fork-ribbon a:hover { 31 | /* Set the font */ 32 | font: 700 13px "Helvetica Neue", Helvetica, Arial, sans-serif; 33 | color: #fff; 34 | 35 | /* Set the text properties */ 36 | text-decoration: none; 37 | text-shadow: 0 -1px rgba(0, 0, 0, 0.5); 38 | text-align: center; 39 | 40 | /* Set the geometry. If you fiddle with these you'll also need 41 | to tweak the top and right values in .github-fork-ribbon. */ 42 | width: 200px; 43 | line-height: 20px; 44 | 45 | /* Set the layout properties */ 46 | display: inline-block; 47 | padding: 2px 0; 48 | 49 | /* Add "stitching" effect */ 50 | border-width: 1px 0; 51 | border-style: dotted; 52 | border-color: #fff; 53 | border-color: rgba(255, 255, 255, 0.7); 54 | } 55 | 56 | .github-fork-ribbon-wrapper { 57 | width: 150px; 58 | height: 150px; 59 | position: absolute; 60 | overflow: hidden; 61 | top: 0; 62 | z-index: 9999; 63 | pointer-events: none; 64 | } 65 | 66 | .github-fork-ribbon-wrapper.fixed { 67 | position: fixed; 68 | } 69 | 70 | .github-fork-ribbon-wrapper.left { 71 | left: 0; 72 | } 73 | 74 | .github-fork-ribbon-wrapper.right { 75 | right: 0; 76 | } 77 | 78 | .github-fork-ribbon-wrapper.left-bottom { 79 | position: fixed; 80 | top: inherit; 81 | bottom: 0; 82 | left: 0; 83 | } 84 | 85 | .github-fork-ribbon-wrapper.right-bottom { 86 | position: fixed; 87 | top: inherit; 88 | bottom: 0; 89 | right: 0; 90 | } 91 | 92 | .github-fork-ribbon-wrapper.right .github-fork-ribbon { 93 | top: 42px; 94 | right: -43px; 95 | 96 | -webkit-transform: rotate(45deg); 97 | -moz-transform: rotate(45deg); 98 | -ms-transform: rotate(45deg); 99 | -o-transform: rotate(45deg); 100 | transform: rotate(45deg); 101 | } 102 | 103 | .github-fork-ribbon-wrapper.left .github-fork-ribbon { 104 | top: 42px; 105 | left: -43px; 106 | 107 | -webkit-transform: rotate(-45deg); 108 | -moz-transform: rotate(-45deg); 109 | -ms-transform: rotate(-45deg); 110 | -o-transform: rotate(-45deg); 111 | transform: rotate(-45deg); 112 | } 113 | 114 | 115 | .github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon { 116 | top: 80px; 117 | left: -43px; 118 | 119 | -webkit-transform: rotate(45deg); 120 | -moz-transform: rotate(45deg); 121 | -ms-transform: rotate(45deg); 122 | -o-transform: rotate(45deg); 123 | transform: rotate(45deg); 124 | } 125 | 126 | .github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon { 127 | top: 80px; 128 | right: -43px; 129 | 130 | -webkit-transform: rotate(-45deg); 131 | -moz-transform: rotate(-45deg); 132 | -ms-transform: rotate(-45deg); 133 | -o-transform: rotate(-45deg); 134 | transform: rotate(-45deg); 135 | } 136 | -------------------------------------------------------------------------------- /demo/gmail-template.html: -------------------------------------------------------------------------------- 1 |
6 | 7 | 8 | 22 | 23 |
24 | {{$message}} 25 |
26 | 27 |
28 | 29 |
30 | 31 |
-------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Angular Notify Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |
18 | Star on GitHub 19 |
20 |
21 | 22 |
23 | 24 |
25 |
26 |

angular-notify

27 |

Minimalistic and extensible notification service for Angular.

28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 | Demo Options 37 |
38 | 39 |
40 | 41 |
42 |
43 |
44 | 45 |
46 | 48 |
49 |
50 |
51 | 52 |
53 | 54 |
55 |
56 |
57 | 58 |
59 | 60 | Try Bootstrap alert classes like "alert-danger" or "alert-success". 61 |
62 |
63 |
64 | 65 |
66 | 70 |
71 |
72 |
73 |
74 | 75 | 76 |
77 |
78 |
79 | 80 |

81 |
82 | 83 |
84 | 85 |
86 | Advanced 87 |

You may provide full HTML content for you message using the messageTemplate option. The messageTemplate field may contain full HTML including any Angular tags or directives.

88 |

In this example, a hyperlink is included with an ng-click attribute. The scope option is used to pass the current controller scope where the ng-click's handler function is located.

89 |
90 |
91 | 92 |
93 |
94 |
95 | 96 |

97 |
98 | 99 | 100 |
101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /dist/angular-notify.css: -------------------------------------------------------------------------------- 1 | .cg-notify-message { 2 | position:fixed; 3 | top:0px; 4 | z-index: 9999; 5 | max-width:400px; 6 | text-align: center; 7 | 8 | background-color: #d9edf7; 9 | color: #31708f; 10 | padding: 15px; 11 | border: 1px solid #bce8f1; 12 | border-radius: 4px; 13 | 14 | -webkit-transition: top 0.5s ease-out,opacity 0.2s ease-out; 15 | -moz-transition: top 0.5s ease-out,opacity 0.2s ease-out; 16 | -o-transition: top 0.5s ease-out,opacity 0.2s ease-out; 17 | transition: top 0.5s ease-out,opacity 0.2s ease-out; 18 | 19 | visibility:hidden; 20 | 21 | -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); 22 | box-shadow: 0 6px 12px rgba(0,0,0,.175); 23 | } 24 | 25 | .cg-notify-message-center { 26 | left:50%; 27 | } 28 | 29 | .cg-notify-message-left { 30 | left:15px; 31 | } 32 | 33 | .cg-notify-message-right { 34 | right:15px; 35 | } 36 | 37 | .cg-notify-message a { 38 | font-weight:bold; 39 | color:inherit; 40 | } 41 | 42 | .cg-notify-message a:hover { 43 | color:inherit; 44 | } 45 | 46 | .cg-notify-close { 47 | -webkit-appearance: none; 48 | padding: 0; 49 | cursor: pointer; 50 | background: 0 0; 51 | border: 0; 52 | font-size: 21px; 53 | font-weight: 700; 54 | line-height: 1; 55 | color: #000; 56 | text-shadow: 0 1px 0 #fff; 57 | filter: alpha(opacity=20); 58 | opacity: .2; 59 | 60 | position: absolute; 61 | top: 0px; 62 | right: 3px; 63 | line-height: 15px; 64 | } 65 | 66 | .cg-notify-close:hover, .cg-notify-close:focus { 67 | color: #000; 68 | text-decoration: none; 69 | cursor: pointer; 70 | filter: alpha(opacity=50); 71 | opacity: .5; 72 | } 73 | 74 | .cg-notify-sr-only { 75 | position: absolute; 76 | width: 1px; 77 | height: 1px; 78 | padding: 0; 79 | margin: -1px; 80 | overflow: hidden; 81 | clip: rect(0,0,0,0); 82 | border: 0; 83 | } -------------------------------------------------------------------------------- /dist/angular-notify.js: -------------------------------------------------------------------------------- 1 | angular.module('cgNotify', []).factory('notify',['$timeout','$http','$compile','$templateCache','$rootScope', 2 | function($timeout,$http,$compile,$templateCache,$rootScope){ 3 | 4 | var startTop = 10; 5 | var verticalSpacing = 15; 6 | var defaultDuration = 10000; 7 | var defaultTemplateUrl = 'angular-notify.html'; 8 | var position = 'center'; 9 | var container = document.body; 10 | var maximumOpen = 0; 11 | 12 | var messageElements = []; 13 | var openNotificationsScope = []; 14 | 15 | var notify = function(args){ 16 | 17 | if (typeof args !== 'object'){ 18 | args = {message:args}; 19 | } 20 | 21 | args.duration = args.duration ? args.duration : defaultDuration; 22 | args.templateUrl = args.templateUrl ? args.templateUrl : defaultTemplateUrl; 23 | args.container = args.container ? args.container : container; 24 | args.classes = args.classes ? args.classes : ''; 25 | 26 | var scope = args.scope ? args.scope.$new() : $rootScope.$new(); 27 | scope.$position = args.position ? args.position : position; 28 | scope.$message = args.message; 29 | scope.$classes = args.classes; 30 | scope.$messageTemplate = args.messageTemplate; 31 | 32 | if (maximumOpen > 0) { 33 | var numToClose = (openNotificationsScope.length + 1) - maximumOpen; 34 | for (var i = 0; i < numToClose; i++) { 35 | openNotificationsScope[i].$close(); 36 | } 37 | } 38 | 39 | $http.get(args.templateUrl,{cache: $templateCache}).then(function(template){ 40 | 41 | var templateElement = $compile(template.data)(scope); 42 | templateElement.bind('webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd', function(e){ 43 | if (e.propertyName === 'opacity' || e.currentTarget.style.opacity === 0 || 44 | (e.originalEvent && e.originalEvent.propertyName === 'opacity')){ 45 | 46 | templateElement.remove(); 47 | messageElements.splice(messageElements.indexOf(templateElement),1); 48 | openNotificationsScope.splice(openNotificationsScope.indexOf(scope),1); 49 | layoutMessages(); 50 | } 51 | }); 52 | 53 | if (args.messageTemplate){ 54 | var messageTemplateElement; 55 | for (var i = 0; i < templateElement.children().length; i ++){ 56 | if (angular.element(templateElement.children()[i]).hasClass('cg-notify-message-template')){ 57 | messageTemplateElement = angular.element(templateElement.children()[i]); 58 | break; 59 | } 60 | } 61 | if (messageTemplateElement){ 62 | messageTemplateElement.append($compile(args.messageTemplate)(scope)); 63 | } else { 64 | throw new Error('cgNotify could not find the .cg-notify-message-template element in '+args.templateUrl+'.'); 65 | } 66 | } 67 | 68 | angular.element(args.container).append(templateElement); 69 | messageElements.push(templateElement); 70 | 71 | if (scope.$position === 'center'){ 72 | $timeout(function(){ 73 | scope.$centerMargin = '-' + (templateElement[0].offsetWidth /2) + 'px'; 74 | }); 75 | } 76 | 77 | scope.$close = function(){ 78 | templateElement.css('opacity',0).attr('data-closing','true'); 79 | layoutMessages(); 80 | }; 81 | 82 | var layoutMessages = function(){ 83 | var j = 0; 84 | var currentY = startTop; 85 | for(var i = messageElements.length - 1; i >= 0; i --){ 86 | var shadowHeight = 10; 87 | var element = messageElements[i]; 88 | var height = element[0].offsetHeight; 89 | var top = currentY + height + shadowHeight; 90 | if (element.attr('data-closing')){ 91 | top += 20; 92 | } else { 93 | currentY += height + verticalSpacing; 94 | } 95 | element.css('top',top + 'px').css('margin-top','-' + (height+shadowHeight) + 'px').css('visibility','visible'); 96 | j ++; 97 | } 98 | }; 99 | 100 | $timeout(function(){ 101 | layoutMessages(); 102 | }); 103 | 104 | if (args.duration > 0){ 105 | $timeout(function(){ 106 | scope.$close(); 107 | },args.duration); 108 | } 109 | 110 | }, function(data) { 111 | throw new Error('Template specified for cgNotify ('+args.templateUrl+') could not be loaded. ' + data); 112 | }); 113 | 114 | var retVal = {}; 115 | 116 | retVal.close = function(){ 117 | if (scope.$close){ 118 | scope.$close(); 119 | } 120 | }; 121 | 122 | Object.defineProperty(retVal,'message',{ 123 | get: function(){ 124 | return scope.$message; 125 | }, 126 | set: function(val){ 127 | scope.$message = val; 128 | } 129 | }); 130 | 131 | openNotificationsScope.push(scope); 132 | 133 | return retVal; 134 | 135 | }; 136 | 137 | notify.config = function(args){ 138 | startTop = !angular.isUndefined(args.startTop) ? args.startTop : startTop; 139 | verticalSpacing = !angular.isUndefined(args.verticalSpacing) ? args.verticalSpacing : verticalSpacing; 140 | defaultDuration = !angular.isUndefined(args.duration) ? args.duration : defaultDuration; 141 | defaultTemplateUrl = args.templateUrl ? args.templateUrl : defaultTemplateUrl; 142 | position = !angular.isUndefined(args.position) ? args.position : position; 143 | container = args.container ? args.container : container; 144 | maximumOpen = args.maximumOpen ? args.maximumOpen : maximumOpen; 145 | }; 146 | 147 | notify.closeAll = function(){ 148 | for(var i = messageElements.length - 1; i >= 0; i --){ 149 | var element = messageElements[i]; 150 | element.css('opacity',0); 151 | } 152 | }; 153 | 154 | return notify; 155 | } 156 | ]); 157 | 158 | angular.module('cgNotify').run(['$templateCache', function($templateCache) { 159 | 'use strict'; 160 | 161 | $templateCache.put('angular-notify.html', 162 | "
\n" + 167 | "\n" + 168 | "
\n" + 169 | " {{$message}}\n" + 170 | "
\n" + 171 | "\n" + 172 | "
\n" + 173 | " \n" + 174 | "
\n" + 175 | "\n" + 176 | " \n" + 180 | "\n" + 181 | "
" 182 | ); 183 | 184 | }]); 185 | -------------------------------------------------------------------------------- /dist/angular-notify.min.css: -------------------------------------------------------------------------------- 1 | .cg-notify-message{position:fixed;top:0;z-index:9999;max-width:400px;text-align:center;background-color:#d9edf7;color:#31708f;padding:15px;border:1px solid #bce8f1;border-radius:4px;-webkit-transition:top .5s ease-out,opacity .2s ease-out;-moz-transition:top .5s ease-out,opacity .2s ease-out;-o-transition:top .5s ease-out,opacity .2s ease-out;transition:top .5s ease-out,opacity .2s ease-out;visibility:hidden;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.cg-notify-message-center{left:50%}.cg-notify-message-left{left:15px}.cg-notify-message-right{right:15px}.cg-notify-message a{font-weight:700;color:inherit}.cg-notify-message a:hover{color:inherit}.cg-notify-close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0;font-size:21px;font-weight:700;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2;position:absolute;top:0;right:3px;line-height:15px}.cg-notify-close:focus,.cg-notify-close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}.cg-notify-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0} -------------------------------------------------------------------------------- /dist/angular-notify.min.js: -------------------------------------------------------------------------------- 1 | angular.module("cgNotify",[]).factory("notify",["$timeout","$http","$compile","$templateCache","$rootScope",function(a,b,c,d,e){var f=10,g=15,h=1e4,i="angular-notify.html",j="center",k=document.body,l=0,m=[],n=[],o=function(o){"object"!=typeof o&&(o={message:o}),o.duration=o.duration?o.duration:h,o.templateUrl=o.templateUrl?o.templateUrl:i,o.container=o.container?o.container:k,o.classes=o.classes?o.classes:"";var p=o.scope?o.scope.$new():e.$new();if(p.$position=o.position?o.position:j,p.$message=o.message,p.$classes=o.classes,p.$messageTemplate=o.messageTemplate,l>0)for(var q=n.length+1-l,r=0;q>r;r++)n[r].$close();b.get(o.templateUrl,{cache:d}).then(function(b){var d=c(b.data)(p);if(d.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd",function(a){("opacity"===a.propertyName||0===a.currentTarget.style.opacity||a.originalEvent&&"opacity"===a.originalEvent.propertyName)&&(d.remove(),m.splice(m.indexOf(d),1),n.splice(n.indexOf(p),1),i())}),o.messageTemplate){for(var e,h=0;h=0;c--){var d=10,e=m[c],h=e[0].offsetHeight,i=b+h+d;e.attr("data-closing")?i+=20:b+=h+g,e.css("top",i+"px").css("margin-top","-"+(h+d)+"px").css("visibility","visible"),a++}};a(function(){i()}),o.duration>0&&a(function(){p.$close()},o.duration)},function(a){throw new Error("Template specified for cgNotify ("+o.templateUrl+") could not be loaded. "+a)});var s={};return s.close=function(){p.$close&&p.$close()},Object.defineProperty(s,"message",{get:function(){return p.$message},set:function(a){p.$message=a}}),n.push(p),s};return o.config=function(a){f=angular.isUndefined(a.startTop)?f:a.startTop,g=angular.isUndefined(a.verticalSpacing)?g:a.verticalSpacing,h=angular.isUndefined(a.duration)?h:a.duration,i=a.templateUrl?a.templateUrl:i,j=angular.isUndefined(a.position)?j:a.position,k=a.container?a.container:k,l=a.maximumOpen?a.maximumOpen:l},o.closeAll=function(){for(var a=m.length-1;a>=0;a--){var b=m[a];b.css("opacity",0)}},o}]),angular.module("cgNotify").run(["$templateCache",function(a){"use strict";a.put("angular-notify.html","
\n\n
\n {{$message}}\n
\n\n"+'
\n \n
\n\n \n\n
')}]); -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-notify'); 2 | module.exports = 'cgNotify'; -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('./angular-notify'); 2 | module.exports = 'cgNotify'; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@cgross/angular-notify", 3 | "main":"dist/index.js", 4 | "version": "2.5.1", 5 | "description": "A minimalistic notification service for angular.", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/cgross/angular-notify.git" 9 | }, 10 | "devDependencies": { 11 | "grunt": "~0.4.4", 12 | "grunt-contrib-uglify": "~0.4.0", 13 | "grunt-contrib-jshint": "~0.10.0", 14 | "grunt-contrib-jasmine": "~0.6.3", 15 | "grunt-contrib-concat": "~0.4.0", 16 | "grunt-angular-templates": "~0.5.4", 17 | "grunt-contrib-connect": "~0.7.1", 18 | "grunt-contrib-watch": "~0.6.1", 19 | "load-grunt-tasks": "~0.4.0", 20 | "grunt-contrib-copy": "~0.5.0", 21 | "grunt-contrib-cssmin": "~0.9.0" 22 | } 23 | } 24 | --------------------------------------------------------------------------------