added bootstrap
This commit is contained in:
parent
9a0cf914d9
commit
ca9af627a5
|
@ -34,6 +34,7 @@
|
||||||
<!-- Fav Icon -->
|
<!-- Fav Icon -->
|
||||||
<link href="/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
|
<link href="/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.min.css">
|
||||||
<!--Bower CSS dependencies-->
|
<!--Bower CSS dependencies-->
|
||||||
{% for bowerCssFile in bowerCssFiles %}
|
{% for bowerCssFile in bowerCssFiles %}
|
||||||
<link rel="stylesheet" href="{{bowerCssFile}}">
|
<link rel="stylesheet" href="{{bowerCssFile}}">
|
||||||
|
@ -53,7 +54,7 @@
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body ng-cloak ng-app="medform">
|
<body ng-cloak>
|
||||||
<header data-ng-include="'/modules/core/views/header.client.view.html'"></header>
|
<header data-ng-include="'/modules/core/views/header.client.view.html'"></header>
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<!-- <section class="container"> -->
|
<!-- <section class="container"> -->
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
{% for jsFile in jsFiles %}
|
{% for jsFile in jsFiles %}
|
||||||
<script type="text/javascript" src="{{jsFile}}"></script>
|
<script type="text/javascript" src="{{jsFile}}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<!-- end Application CSS dependencies-->
|
<!-- end Application Javascript dependencies-->
|
||||||
|
|
||||||
{% if process.env.NODE_ENV === 'development' %}
|
{% if process.env.NODE_ENV === 'development' %}
|
||||||
<!--Livereload script rendered -->
|
<!--Livereload script rendered -->
|
||||||
|
|
11
package.json
11
package.json
|
@ -1,9 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "medforms",
|
"name": "Medform",
|
||||||
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
|
"description": "PDF generated form builder",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
|
"homepage": "https://github.com/whitef0x0/medform",
|
||||||
|
"authors": [
|
||||||
|
"David Baldwynn <polydaic@gmail.com>"
|
||||||
|
],
|
||||||
"private": true,
|
"private": true,
|
||||||
"author": "https://github.com/whitef0x0/medforms/graphs/contributors",
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/whitef0x0/medforms.git"
|
"url": "https://github.com/whitef0x0/medforms.git"
|
||||||
|
|
|
@ -1,94 +0,0 @@
|
||||||
{
|
|
||||||
"name": "medforms",
|
|
||||||
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"private": true,
|
|
||||||
"author": "https://github.com/whitef0x0/medforms/graphs/contributors",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/whitef0x0/medforms.git"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "~0.10.28",
|
|
||||||
"npm": "~1.4.28"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"start": "grunt",
|
|
||||||
"test": "grunt test",
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"postinstall": "bower install --config.interactive=false; grunt"
|
|
||||||
=======
|
|
||||||
"postinstall": "bower install --config.interactive=false; grunt build"
|
|
||||||
>>>>>>> 4f7777515c74761ed4266b8787fd3d071329071c
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"multer": "~0.1.8",
|
|
||||||
"async": "~0.9.0",
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
"load-grunt-tasks": "~1.0.0",
|
|
||||||
>>>>>>> 4f7777515c74761ed4266b8787fd3d071329071c
|
|
||||||
"pdffiller": "whitef0x0/pdffiller",
|
|
||||||
"body-parser": "~1.9.0",
|
|
||||||
"bower": "~1.3.8",
|
|
||||||
"chalk": "~1.0.0",
|
|
||||||
"compression": "~1.2.0",
|
|
||||||
"connect-flash": "~0.1.1",
|
|
||||||
"connect-mongo": "~0.4.1",
|
|
||||||
"consolidate": "~0.10.0",
|
|
||||||
"cookie-parser": "~1.3.2",
|
|
||||||
"express": "~4.10.1",
|
|
||||||
"express-session": "~1.9.1",
|
|
||||||
"forever": "~0.11.0",
|
|
||||||
"fs-extra": "~0.18.3",
|
|
||||||
"glob": "~4.0.5",
|
|
||||||
"grunt": "~0.4.1",
|
|
||||||
"grunt-cli": "~0.1.13",
|
|
||||||
"helmet": "~0.5.0",
|
|
||||||
"lodash": "~2.4.1",
|
|
||||||
"main-bower-files": "~2.8.2",
|
|
||||||
"method-override": "~2.3.0",
|
|
||||||
"mongoose": "~3.8.8",
|
|
||||||
"morgan": "~1.4.1",
|
|
||||||
"nodemailer": "~1.3.0",
|
|
||||||
"passport": "~0.2.0",
|
|
||||||
"passport-facebook": "~1.0.2",
|
|
||||||
"passport-github": "~0.1.5",
|
|
||||||
"passport-google-oauth": "~0.1.5",
|
|
||||||
"passport-linkedin": "~0.1.3",
|
|
||||||
"passport-local": "~1.0.0",
|
|
||||||
"passport-twitter": "~1.0.2",
|
|
||||||
"satelize": "~0.1.1",
|
|
||||||
"swig": "~1.4.1",
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"then-fs": "~2.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"multer": "~0.1.8",
|
|
||||||
=======
|
|
||||||
"then-fs": "~2.0.0",
|
|
||||||
>>>>>>> 4f7777515c74761ed4266b8787fd3d071329071c
|
|
||||||
"mocha": ">=1.20.0",
|
|
||||||
"grunt-concurrent": "~1.0.0",
|
|
||||||
"grunt-contrib-csslint": "~0.3.1",
|
|
||||||
"grunt-contrib-cssmin": "~0.10.0",
|
|
||||||
"grunt-contrib-jshint": "~0.10.0",
|
|
||||||
"grunt-contrib-uglify": "~0.6.0",
|
|
||||||
"grunt-contrib-watch": "~0.6.1",
|
|
||||||
"grunt-env": "~0.4.1",
|
|
||||||
"grunt-karma": "~0.9.0",
|
|
||||||
"grunt-mocha-test": "~0.12.1",
|
|
||||||
"grunt-newer": "~1.1.1",
|
|
||||||
"grunt-ng-annotate": "~0.4.0",
|
|
||||||
"grunt-node-inspector": "~0.1.3",
|
|
||||||
"grunt-nodemon": "~0.3.0",
|
|
||||||
"karma": "~0.12.0",
|
|
||||||
"karma-chrome-launcher": "~0.1.2",
|
|
||||||
"karma-coverage": "~0.2.0",
|
|
||||||
"karma-firefox-launcher": "~0.1.3",
|
|
||||||
"karma-jasmine": "~0.2.1",
|
|
||||||
"karma-phantomjs-launcher": "~0.1.2",
|
|
||||||
"should": "~4.1.0",
|
|
||||||
"supertest": "~0.14.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-animate",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"main": "./angular-animate.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.2.28"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/angular/bower-angular-animate",
|
|
||||||
"_release": "1.2.28",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.2.28",
|
|
||||||
"commit": "a42cca9915517f26d639471b5f622dc086161fe0"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/angular/bower-angular-animate.git",
|
|
||||||
"_target": "~1.2",
|
|
||||||
"_originalSource": "angular-animate"
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
# packaged angular-animate
|
|
||||||
|
|
||||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
|
||||||
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate).
|
|
||||||
Please file issues and pull requests against that repo.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
You can install this package either with `npm` or with `bower`.
|
|
||||||
|
|
||||||
### npm
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install angular-animate
|
|
||||||
```
|
|
||||||
|
|
||||||
Add a `<script>` to your `index.html`:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="/node_modules/angular-animate/angular-animate.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `ngAnimate` as a dependency for your app:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('myApp', ['ngAnimate']);
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that this package is not in CommonJS format, so doing `require('angular-animate')` will
|
|
||||||
return `undefined`.
|
|
||||||
|
|
||||||
### bower
|
|
||||||
|
|
||||||
```shell
|
|
||||||
bower install angular-animate
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add a `<script>` to your `index.html`:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="/bower_components/angular-animate/angular-animate.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `ngAnimate` as a dependency for your app:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('myApp', ['ngAnimate']);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
Documentation is available on the
|
|
||||||
[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate).
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
1702
public/lib/angular-animate/angular-animate.js
vendored
1702
public/lib/angular-animate/angular-animate.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
AngularJS v1.2.28
|
|
||||||
(c) 2010-2014 Google, Inc. http://angularjs.org
|
|
||||||
License: MIT
|
|
||||||
*/
|
|
||||||
(function(G,d,P){'use strict';d.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){return function(H,z,e){e=e.ngAnimateChildren;d.isString(e)&&0===e.length?z.data("$$ngAnimateChildren",!0):H.$watch(e,function(d){z.data("$$ngAnimateChildren",!!d)})}}).factory("$$animateReflow",["$$rAF","$document",function(d,z){return function(e){return d(function(){e()})}}]).config(["$provide","$animateProvider",function(H,z){function e(d){for(var e=0;e<d.length;e++){var g=d[e];if(g.nodeType==ba)return g}}
|
|
||||||
function E(g){return d.element(e(g))}var q=d.noop,w=d.forEach,Q=z.$$selectors,ba=1,g="$$ngAnimateState",ga="$$ngAnimateChildren",I="ng-animate",h={running:!0};H.decorator("$animate",["$delegate","$injector","$sniffer","$rootElement","$$asyncCallback","$rootScope","$document",function(y,G,aa,J,K,k,P){function R(a){var b=a.data(g)||{};b.running=!0;a.data(g,b)}function ha(a){if(a){var b=[],c={};a=a.substr(1).split(".");(aa.transitions||aa.animations)&&b.push(G.get(Q[""]));for(var f=0;f<a.length;f++){var d=
|
|
||||||
a[f],e=Q[d];e&&!c[d]&&(b.push(G.get(e)),c[d]=!0)}return b}}function M(a,b,c){function f(a,b){var c=a[b],d=a["before"+b.charAt(0).toUpperCase()+b.substr(1)];if(c||d)return"leave"==b&&(d=c,c=null),S.push({event:b,fn:c}),n.push({event:b,fn:d}),!0}function e(b,d,f){var g=[];w(b,function(a){a.fn&&g.push(a)});var r=0;w(g,function(b,e){var C=function(){a:{if(d){(d[e]||q)();if(++r<g.length)break a;d=null}f()}};switch(b.event){case "setClass":d.push(b.fn(a,l,A,C));break;case "addClass":d.push(b.fn(a,l||c,
|
|
||||||
C));break;case "removeClass":d.push(b.fn(a,A||c,C));break;default:d.push(b.fn(a,C))}});d&&0===d.length&&f()}var g=a[0];if(g){var p="setClass"==b,h=p||"addClass"==b||"removeClass"==b,l,A;d.isArray(c)&&(l=c[0],A=c[1],c=l+" "+A);var k=a.attr("class")+" "+c;if(U(k)){var t=q,v=[],n=[],x=q,u=[],S=[],k=(" "+k).replace(/\s+/g,".");w(ha(k),function(a){!f(a,b)&&p&&(f(a,"addClass"),f(a,"removeClass"))});return{node:g,event:b,className:c,isClassBased:h,isSetClassOperation:p,before:function(a){t=a;e(n,v,function(){t=
|
|
||||||
q;a()})},after:function(a){x=a;e(S,u,function(){x=q;a()})},cancel:function(){v&&(w(v,function(a){(a||q)(!0)}),t(!0));u&&(w(u,function(a){(a||q)(!0)}),x(!0))}}}}}function F(a,b,c,f,e,m,p){function k(d){var e="$animate:"+d;x&&(x[e]&&0<x[e].length)&&K(function(){c.triggerHandler(e,{event:a,className:b})})}function l(){k("before")}function A(){k("after")}function q(){k("close");p&&K(function(){p()})}function t(){t.hasBeenRun||(t.hasBeenRun=!0,m())}function v(){if(!v.hasBeenRun){v.hasBeenRun=!0;var e=
|
|
||||||
c.data(g);e&&(n&&n.isClassBased?B(c,b):(K(function(){var e=c.data(g)||{};s==e.index&&B(c,b,a)}),c.data(g,e)));q()}}var n=M(c,a,b);if(n){b=n.className;var x=d.element._data(n.node),x=x&&x.events;f||(f=e?e.parent():c.parent());var u=c.data(g)||{};e=u.active||{};var h=u.totalActive||0,C=u.last,D;n.isClassBased&&(D=u.running||u.disabled||C&&!C.isClassBased);if(D||N(c,f))t(),l(),A(),v();else{f=!1;if(0<h){D=[];if(n.isClassBased)"setClass"==C.event?(D.push(C),B(c,b)):e[b]&&(y=e[b],y.event==a?f=!0:(D.push(y),
|
|
||||||
B(c,b)));else if("leave"==a&&e["ng-leave"])f=!0;else{for(var y in e)D.push(e[y]),B(c,y);e={};h=0}0<D.length&&w(D,function(a){a.cancel()})}!n.isClassBased||(n.isSetClassOperation||f)||(f="addClass"==a==c.hasClass(b));if(f)t(),l(),A(),q();else{if("leave"==a)c.one("$destroy",function(a){a=d.element(this);var b=a.data(g);b&&(b=b.active["ng-leave"])&&(b.cancel(),B(a,"ng-leave"))});c.addClass(I);var s=O++;h++;e[b]=n;c.data(g,{last:n,active:e,index:s,totalActive:h});l();n.before(function(e){var d=c.data(g);
|
|
||||||
e=e||!d||!d.active[b]||n.isClassBased&&d.active[b].event!=a;t();!0===e?v():(A(),n.after(v))})}}}else t(),l(),A(),v()}function V(a){if(a=e(a))a=d.isFunction(a.getElementsByClassName)?a.getElementsByClassName(I):a.querySelectorAll("."+I),w(a,function(a){a=d.element(a);(a=a.data(g))&&a.active&&w(a.active,function(a){a.cancel()})})}function B(a,b){if(e(a)==e(J))h.disabled||(h.running=!1,h.structural=!1);else if(b){var c=a.data(g)||{},d=!0===b;!d&&(c.active&&c.active[b])&&(c.totalActive--,delete c.active[b]);
|
|
||||||
if(d||!c.totalActive)a.removeClass(I),a.removeData(g)}}function N(a,b){if(h.disabled)return!0;if(e(a)==e(J))return h.running;var c,f,k;do{if(0===b.length)break;var m=e(b)==e(J),p=m?h:b.data(g)||{};if(p.disabled)return!0;m&&(k=!0);!1!==c&&(m=b.data(ga),d.isDefined(m)&&(c=m));f=f||p.running||p.last&&!p.last.isClassBased}while(b=b.parent());return!k||!c&&f}var O=0;J.data(g,h);k.$$postDigest(function(){k.$$postDigest(function(){h.running=!1})});var W=z.classNameFilter(),U=W?function(a){return W.test(a)}:
|
|
||||||
function(){return!0};return{enter:function(a,b,c,e){a=d.element(a);b=b&&d.element(b);c=c&&d.element(c);R(a);y.enter(a,b,c);k.$$postDigest(function(){a=E(a);F("enter","ng-enter",a,b,c,q,e)})},leave:function(a,b){a=d.element(a);V(a);R(a);k.$$postDigest(function(){F("leave","ng-leave",E(a),null,null,function(){y.leave(a)},b)})},move:function(a,b,c,e){a=d.element(a);b=b&&d.element(b);c=c&&d.element(c);V(a);R(a);y.move(a,b,c);k.$$postDigest(function(){a=E(a);F("move","ng-move",a,b,c,q,e)})},addClass:function(a,
|
|
||||||
b,c){a=d.element(a);a=E(a);F("addClass",b,a,null,null,function(){y.addClass(a,b)},c)},removeClass:function(a,b,c){a=d.element(a);a=E(a);F("removeClass",b,a,null,null,function(){y.removeClass(a,b)},c)},setClass:function(a,b,c,e){a=d.element(a);a=E(a);F("setClass",[b,c],a,null,null,function(){y.setClass(a,b,c)},e)},enabled:function(a,b){switch(arguments.length){case 2:if(a)B(b);else{var c=b.data(g)||{};c.disabled=!0;b.data(g,c)}break;case 1:h.disabled=!a;break;default:a=!h.disabled}return!!a}}}]);z.register("",
|
|
||||||
["$window","$sniffer","$timeout","$$animateReflow",function(g,h,z,J){function K(){L||(L=J(function(){T=[];L=null;s={}}))}function k(a,X){L&&L();T.push(X);L=J(function(){w(T,function(a){a()});T=[];L=null;s={}})}function E(a,X){var b=e(a);a=d.element(b);Y.push(a);b=Date.now()+X;b<=fa||(z.cancel(ea),fa=b,ea=z(function(){R(Y);Y=[]},X,!1))}function R(a){w(a,function(a){(a=a.data(u))&&(a.closeAnimationFn||q)()})}function I(a,b){var c=b?s[b]:null;if(!c){var e=0,d=0,f=0,k=0,h,Z,$,m;w(a,function(a){if(a.nodeType==
|
|
||||||
ba){a=g.getComputedStyle(a)||{};$=a[p+Q];e=Math.max(M($),e);m=a[p+t];h=a[p+v];d=Math.max(M(h),d);Z=a[l+v];k=Math.max(M(Z),k);var b=M(a[l+Q]);0<b&&(b*=parseInt(a[l+n],10)||1);f=Math.max(b,f)}});c={total:0,transitionPropertyStyle:m,transitionDurationStyle:$,transitionDelayStyle:h,transitionDelay:d,transitionDuration:e,animationDelayStyle:Z,animationDelay:k,animationDuration:f};b&&(s[b]=c)}return c}function M(a){var b=0;a=d.isString(a)?a.split(/\s*,\s*/):[];w(a,function(a){b=Math.max(parseFloat(a)||
|
|
||||||
0,b)});return b}function F(a){var b=a.parent(),c=b.data(x);c||(b.data(x,++da),c=da);return c+"-"+e(a).getAttribute("class")}function V(a,b,c,d){var f=F(b),g=f+" "+c,k=s[g]?++s[g].total:0,h={};if(0<k){var m=c+"-stagger",h=f+" "+m;(f=!s[h])&&b.addClass(m);h=I(b,h);f&&b.removeClass(m)}d=d||function(a){return a()};b.addClass(c);var m=b.data(u)||{},n=d(function(){return I(b,g)});d=n.transitionDuration;f=n.animationDuration;if(0===d&&0===f)return b.removeClass(c),!1;b.data(u,{running:m.running||0,itemIndex:k,
|
|
||||||
stagger:h,timings:n,closeAnimationFn:q});a=0<m.running||"setClass"==a;0<d&&B(b,c,a);0<f&&(0<h.animationDelay&&0===h.animationDuration)&&(e(b).style[l]="none 0s");return!0}function B(a,b,c){"ng-enter"!=b&&("ng-move"!=b&&"ng-leave"!=b)&&c?a.addClass(S):e(a).style[p+t]="none"}function N(a,b){var c=p+t,d=e(a);d.style[c]&&0<d.style[c].length&&(d.style[c]="");a.removeClass(S)}function O(a){var b=l;a=e(a);a.style[b]&&0<a.style[b].length&&(a.style[b]="")}function W(a,b,c,d){function g(a){b.off(z,h);b.removeClass(n);
|
|
||||||
f(b,c);a=e(b);for(var d in s)a.style.removeProperty(s[d])}function h(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||b.timeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(C));Math.max(a-y,0)>=x&&b>=t&&d()}var k=e(b);a=b.data(u);if(-1!=k.getAttribute("class").indexOf(c)&&a){var n="";w(c.split(" "),function(a,b){n+=(0<b?" ":"")+a+"-active"});var p=a.stagger,l=a.timings,q=a.itemIndex,t=Math.max(l.transitionDuration,l.animationDuration),v=Math.max(l.transitionDelay,l.animationDelay),
|
|
||||||
x=v*ca,y=Date.now(),z=A+" "+H,r="",s=[];if(0<l.transitionDuration){var B=l.transitionPropertyStyle;-1==B.indexOf("all")&&(r+=m+"transition-property: "+B+";",r+=m+"transition-duration: "+l.transitionDurationStyle+";",s.push(m+"transition-property"),s.push(m+"transition-duration"))}0<q&&(0<p.transitionDelay&&0===p.transitionDuration&&(r+=m+"transition-delay: "+U(l.transitionDelayStyle,p.transitionDelay,q)+"; ",s.push(m+"transition-delay")),0<p.animationDelay&&0===p.animationDuration&&(r+=m+"animation-delay: "+
|
|
||||||
U(l.animationDelayStyle,p.animationDelay,q)+"; ",s.push(m+"animation-delay")));0<s.length&&(l=k.getAttribute("style")||"",k.setAttribute("style",l+"; "+r));b.on(z,h);b.addClass(n);a.closeAnimationFn=function(){g();d()};k=(q*(Math.max(p.animationDelay,p.transitionDelay)||0)+(v+t)*D)*ca;a.running++;E(b,k);return g}d()}function U(a,b,c){var d="";w(a.split(","),function(a,e){d+=(0<e?",":"")+(c*b+parseInt(a,10))+"s"});return d}function a(a,b,c,d){if(V(a,b,c,d))return function(a){a&&f(b,c)}}function b(a,
|
|
||||||
b,c,d){if(b.data(u))return W(a,b,c,d);f(b,c);d()}function c(c,d,e,f){var g=a(c,d,e);if(g){var h=g;k(d,function(){N(d,e);O(d);h=b(c,d,e,f)});return function(a){(h||q)(a)}}K();f()}function f(a,b){a.removeClass(b);var c=a.data(u);c&&(c.running&&c.running--,c.running&&0!==c.running||a.removeData(u))}function r(a,b){var c="";a=d.isArray(a)?a:a.split(/\s+/);w(a,function(a,d){a&&0<a.length&&(c+=(0<d?" ":"")+a+b)});return c}var m="",p,H,l,A;G.ontransitionend===P&&G.onwebkittransitionend!==P?(m="-webkit-",
|
|
||||||
p="WebkitTransition",H="webkitTransitionEnd transitionend"):(p="transition",H="transitionend");G.onanimationend===P&&G.onwebkitanimationend!==P?(m="-webkit-",l="WebkitAnimation",A="webkitAnimationEnd animationend"):(l="animation",A="animationend");var Q="Duration",t="Property",v="Delay",n="IterationCount",x="$$ngAnimateKey",u="$$ngAnimateCSS3Data",S="ng-animate-block-transitions",C=3,D=1.5,ca=1E3,s={},da=0,T=[],L,ea=null,fa=0,Y=[];return{enter:function(a,b){return c("enter",a,"ng-enter",b)},leave:function(a,
|
|
||||||
b){return c("leave",a,"ng-leave",b)},move:function(a,b){return c("move",a,"ng-move",b)},beforeSetClass:function(b,c,d,e){var f=r(d,"-remove")+" "+r(c,"-add"),g=a("setClass",b,f,function(a){var e=b.attr("class");b.removeClass(d);b.addClass(c);a=a();b.attr("class",e);return a});if(g)return k(b,function(){N(b,f);O(b);e()}),g;K();e()},beforeAddClass:function(b,c,d){var e=a("addClass",b,r(c,"-add"),function(a){b.addClass(c);a=a();b.removeClass(c);return a});if(e)return k(b,function(){N(b,c);O(b);d()}),
|
|
||||||
e;K();d()},setClass:function(a,c,d,e){d=r(d,"-remove");c=r(c,"-add");return b("setClass",a,d+" "+c,e)},addClass:function(a,c,d){return b("addClass",a,r(c,"-add"),d)},beforeRemoveClass:function(b,c,d){var e=a("removeClass",b,r(c,"-remove"),function(a){var d=b.attr("class");b.removeClass(c);a=a();b.attr("class",d);return a});if(e)return k(b,function(){N(b,c);O(b);d()}),e;d()},removeClass:function(a,c,d){return b("removeClass",a,r(c,"-remove"),d)}}}])}])})(window,window.angular);
|
|
||||||
//# sourceMappingURL=angular-animate.min.js.map
|
|
File diff suppressed because one or more lines are too long
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-animate",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"main": "./angular-animate.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.2.28"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-animate",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"description": "AngularJS module for animations",
|
|
||||||
"main": "angular-animate.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/angular/angular.js.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"framework",
|
|
||||||
"browser",
|
|
||||||
"animation",
|
|
||||||
"client-side"
|
|
||||||
],
|
|
||||||
"author": "Angular Core Team <angular-core+npm@google.com>",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/angular/angular.js/issues"
|
|
||||||
},
|
|
||||||
"homepage": "http://angularjs.org"
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
"author": {
|
|
||||||
"name": "https://github.com/angular-ui/bootstrap/graphs/contributors"
|
|
||||||
},
|
|
||||||
"name": "angular-bootstrap",
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"angular-ui",
|
|
||||||
"bootstrap"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"ignore": [],
|
|
||||||
"description": "Native AngularJS (Angular) directives for Bootstrap.",
|
|
||||||
"version": "0.12.1",
|
|
||||||
"main": [
|
|
||||||
"./ui-bootstrap-tpls.js"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": ">=1 <1.3.0"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/angular-ui/bootstrap-bower",
|
|
||||||
"_release": "0.12.1",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "0.12.1",
|
|
||||||
"commit": "ab14fbaaf3d592f8e76018f0666c5af6f68ebaa3"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/angular-ui/bootstrap-bower.git",
|
|
||||||
"_target": "~0.12.0",
|
|
||||||
"_originalSource": "angular-bootstrap"
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"author": {
|
|
||||||
"name": "https://github.com/angular-ui/bootstrap/graphs/contributors"
|
|
||||||
},
|
|
||||||
"name": "angular-bootstrap",
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"angular-ui",
|
|
||||||
"bootstrap"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"ignore": [],
|
|
||||||
"description": "Native AngularJS (Angular) directives for Bootstrap.",
|
|
||||||
"version": "0.12.1",
|
|
||||||
"main": ["./ui-bootstrap-tpls.js"],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": ">=1 <1.3.0"
|
|
||||||
}
|
|
||||||
}
|
|
4211
public/lib/angular-bootstrap/ui-bootstrap-tpls.js
vendored
4211
public/lib/angular-bootstrap/ui-bootstrap-tpls.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
3900
public/lib/angular-bootstrap/ui-bootstrap.js
vendored
3900
public/lib/angular-bootstrap/ui-bootstrap.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-cookies",
|
|
||||||
"version": "1.4.0",
|
|
||||||
"main": "./angular-cookies.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.4.0"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/angular/bower-angular-cookies",
|
|
||||||
"_release": "1.4.0",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.4.0",
|
|
||||||
"commit": "9ec982254197161e1c39cce899c9c97e6d033010"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/angular/bower-angular-cookies.git",
|
|
||||||
"_target": "~1.4.0",
|
|
||||||
"_originalSource": "angular-cookies"
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
# packaged angular-cookies
|
|
||||||
|
|
||||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
|
||||||
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies).
|
|
||||||
Please file issues and pull requests against that repo.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
You can install this package either with `npm` or with `bower`.
|
|
||||||
|
|
||||||
### npm
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install angular-cookies
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `ngCookies` as a dependency for your app:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('myApp', [require('angular-cookies')]);
|
|
||||||
```
|
|
||||||
|
|
||||||
### bower
|
|
||||||
|
|
||||||
```shell
|
|
||||||
bower install angular-cookies
|
|
||||||
```
|
|
||||||
|
|
||||||
Add a `<script>` to your `index.html`:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `ngCookies` as a dependency for your app:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('myApp', ['ngCookies']);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
Documentation is available on the
|
|
||||||
[AngularJS docs site](http://docs.angularjs.org/api/ngCookies).
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
320
public/lib/angular-cookies/angular-cookies.js
vendored
320
public/lib/angular-cookies/angular-cookies.js
vendored
|
@ -1,320 +0,0 @@
|
||||||
/**
|
|
||||||
* @license AngularJS v1.4.0
|
|
||||||
* (c) 2010-2015 Google, Inc. http://angularjs.org
|
|
||||||
* License: MIT
|
|
||||||
*/
|
|
||||||
(function(window, angular, undefined) {'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc module
|
|
||||||
* @name ngCookies
|
|
||||||
* @description
|
|
||||||
*
|
|
||||||
* # ngCookies
|
|
||||||
*
|
|
||||||
* The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <div doc-module-components="ngCookies"></div>
|
|
||||||
*
|
|
||||||
* See {@link ngCookies.$cookies `$cookies`} and
|
|
||||||
* {@link ngCookies.$cookieStore `$cookieStore`} for usage.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
angular.module('ngCookies', ['ng']).
|
|
||||||
/**
|
|
||||||
* @ngdoc provider
|
|
||||||
* @name $cookiesProvider
|
|
||||||
* @description
|
|
||||||
* Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.
|
|
||||||
* */
|
|
||||||
provider('$cookies', [function $CookiesProvider() {
|
|
||||||
/**
|
|
||||||
* @ngdoc property
|
|
||||||
* @name $cookiesProvider#defaults
|
|
||||||
* @description
|
|
||||||
*
|
|
||||||
* Object containing default options to pass when setting cookies.
|
|
||||||
*
|
|
||||||
* The object may have following properties:
|
|
||||||
*
|
|
||||||
* - **path** - `{string}` - The cookie will be available only for this path and its
|
|
||||||
* sub-paths. By default, this would be the URL that appears in your base tag.
|
|
||||||
* - **domain** - `{string}` - The cookie will be available only for this domain and
|
|
||||||
* its sub-domains. For obvious security reasons the user agent will not accept the
|
|
||||||
* cookie if the current domain is not a sub domain or equals to the requested domain.
|
|
||||||
* - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT"
|
|
||||||
* or a Date object indicating the exact date/time this cookie will expire.
|
|
||||||
* - **secure** - `{boolean}` - The cookie will be available only in secured connection.
|
|
||||||
*
|
|
||||||
* Note: by default the address that appears in your <base> tag will be used as path.
|
|
||||||
* This is import so that cookies will be visible for all routes in case html5mode is enabled
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
var defaults = this.defaults = {};
|
|
||||||
|
|
||||||
function calcOptions(options) {
|
|
||||||
return options ? angular.extend({}, defaults, options) : defaults;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc service
|
|
||||||
* @name $cookies
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Provides read/write access to browser's cookies.
|
|
||||||
*
|
|
||||||
* BREAKING CHANGE: `$cookies` no longer exposes properties that represent the
|
|
||||||
* current browser cookie values. Now you must use the get/put/remove/etc. methods
|
|
||||||
* as described below.
|
|
||||||
*
|
|
||||||
* Requires the {@link ngCookies `ngCookies`} module to be installed.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* angular.module('cookiesExample', ['ngCookies'])
|
|
||||||
* .controller('ExampleController', ['$cookies', function($cookies) {
|
|
||||||
* // Retrieving a cookie
|
|
||||||
* var favoriteCookie = $cookies.get('myFavorite');
|
|
||||||
* // Setting a cookie
|
|
||||||
* $cookies.put('myFavorite', 'oatmeal');
|
|
||||||
* }]);
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {
|
|
||||||
return {
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookies#get
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Returns the value of given cookie key
|
|
||||||
*
|
|
||||||
* @param {string} key Id to use for lookup.
|
|
||||||
* @returns {string} Raw cookie value.
|
|
||||||
*/
|
|
||||||
get: function(key) {
|
|
||||||
return $$cookieReader()[key];
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookies#getObject
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Returns the deserialized value of given cookie key
|
|
||||||
*
|
|
||||||
* @param {string} key Id to use for lookup.
|
|
||||||
* @returns {Object} Deserialized cookie value.
|
|
||||||
*/
|
|
||||||
getObject: function(key) {
|
|
||||||
var value = this.get(key);
|
|
||||||
return value ? angular.fromJson(value) : value;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookies#getAll
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Returns a key value object with all the cookies
|
|
||||||
*
|
|
||||||
* @returns {Object} All cookies
|
|
||||||
*/
|
|
||||||
getAll: function() {
|
|
||||||
return $$cookieReader();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookies#put
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Sets a value for given cookie key
|
|
||||||
*
|
|
||||||
* @param {string} key Id for the `value`.
|
|
||||||
* @param {string} value Raw value to be stored.
|
|
||||||
* @param {Object=} options Options object.
|
|
||||||
* See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
|
|
||||||
*/
|
|
||||||
put: function(key, value, options) {
|
|
||||||
$$cookieWriter(key, value, calcOptions(options));
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookies#putObject
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Serializes and sets a value for given cookie key
|
|
||||||
*
|
|
||||||
* @param {string} key Id for the `value`.
|
|
||||||
* @param {Object} value Value to be stored.
|
|
||||||
* @param {Object=} options Options object.
|
|
||||||
* See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
|
|
||||||
*/
|
|
||||||
putObject: function(key, value, options) {
|
|
||||||
this.put(key, angular.toJson(value), options);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookies#remove
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Remove given cookie
|
|
||||||
*
|
|
||||||
* @param {string} key Id of the key-value pair to delete.
|
|
||||||
* @param {Object=} options Options object.
|
|
||||||
* See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
|
|
||||||
*/
|
|
||||||
remove: function(key, options) {
|
|
||||||
$$cookieWriter(key, undefined, calcOptions(options));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
}]);
|
|
||||||
|
|
||||||
angular.module('ngCookies').
|
|
||||||
/**
|
|
||||||
* @ngdoc service
|
|
||||||
* @name $cookieStore
|
|
||||||
* @deprecated
|
|
||||||
* @requires $cookies
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Provides a key-value (string-object) storage, that is backed by session cookies.
|
|
||||||
* Objects put or retrieved from this storage are automatically serialized or
|
|
||||||
* deserialized by angular's toJson/fromJson.
|
|
||||||
*
|
|
||||||
* Requires the {@link ngCookies `ngCookies`} module to be installed.
|
|
||||||
*
|
|
||||||
* <div class="alert alert-danger">
|
|
||||||
* **Note:** The $cookieStore service is deprecated.
|
|
||||||
* Please use the {@link ngCookies.$cookies `$cookies`} service instead.
|
|
||||||
* </div>
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* angular.module('cookieStoreExample', ['ngCookies'])
|
|
||||||
* .controller('ExampleController', ['$cookieStore', function($cookieStore) {
|
|
||||||
* // Put cookie
|
|
||||||
* $cookieStore.put('myFavorite','oatmeal');
|
|
||||||
* // Get cookie
|
|
||||||
* var favoriteCookie = $cookieStore.get('myFavorite');
|
|
||||||
* // Removing a cookie
|
|
||||||
* $cookieStore.remove('myFavorite');
|
|
||||||
* }]);
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
factory('$cookieStore', ['$cookies', function($cookies) {
|
|
||||||
|
|
||||||
return {
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookieStore#get
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Returns the value of given cookie key
|
|
||||||
*
|
|
||||||
* @param {string} key Id to use for lookup.
|
|
||||||
* @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.
|
|
||||||
*/
|
|
||||||
get: function(key) {
|
|
||||||
return $cookies.getObject(key);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookieStore#put
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Sets a value for given cookie key
|
|
||||||
*
|
|
||||||
* @param {string} key Id for the `value`.
|
|
||||||
* @param {Object} value Value to be stored.
|
|
||||||
*/
|
|
||||||
put: function(key, value) {
|
|
||||||
$cookies.putObject(key, value);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc method
|
|
||||||
* @name $cookieStore#remove
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Remove given cookie
|
|
||||||
*
|
|
||||||
* @param {string} key Id of the key-value pair to delete.
|
|
||||||
*/
|
|
||||||
remove: function(key) {
|
|
||||||
$cookies.remove(key);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name $$cookieWriter
|
|
||||||
* @requires $document
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* This is a private service for writing cookies
|
|
||||||
*
|
|
||||||
* @param {string} name Cookie name
|
|
||||||
* @param {string=} value Cookie value (if undefined, cookie will be deleted)
|
|
||||||
* @param {Object=} options Object with options that need to be stored for the cookie.
|
|
||||||
*/
|
|
||||||
function $$CookieWriter($document, $log, $browser) {
|
|
||||||
var cookiePath = $browser.baseHref();
|
|
||||||
var rawDocument = $document[0];
|
|
||||||
|
|
||||||
function buildCookieString(name, value, options) {
|
|
||||||
var path, expires;
|
|
||||||
options = options || {};
|
|
||||||
expires = options.expires;
|
|
||||||
path = angular.isDefined(options.path) ? options.path : cookiePath;
|
|
||||||
if (value === undefined) {
|
|
||||||
expires = 'Thu, 01 Jan 1970 00:00:00 GMT';
|
|
||||||
value = '';
|
|
||||||
}
|
|
||||||
if (angular.isString(expires)) {
|
|
||||||
expires = new Date(expires);
|
|
||||||
}
|
|
||||||
|
|
||||||
var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);
|
|
||||||
str += path ? ';path=' + path : '';
|
|
||||||
str += options.domain ? ';domain=' + options.domain : '';
|
|
||||||
str += expires ? ';expires=' + expires.toUTCString() : '';
|
|
||||||
str += options.secure ? ';secure' : '';
|
|
||||||
|
|
||||||
// per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:
|
|
||||||
// - 300 cookies
|
|
||||||
// - 20 cookies per unique domain
|
|
||||||
// - 4096 bytes per cookie
|
|
||||||
var cookieLength = str.length + 1;
|
|
||||||
if (cookieLength > 4096) {
|
|
||||||
$log.warn("Cookie '" + name +
|
|
||||||
"' possibly not set or overflowed because it was too large (" +
|
|
||||||
cookieLength + " > 4096 bytes)!");
|
|
||||||
}
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
return function(name, value, options) {
|
|
||||||
rawDocument.cookie = buildCookieString(name, value, options);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
$$CookieWriter.$inject = ['$document', '$log', '$browser'];
|
|
||||||
|
|
||||||
angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() {
|
|
||||||
this.$get = $$CookieWriter;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
})(window, window.angular);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/*
|
|
||||||
AngularJS v1.4.0
|
|
||||||
(c) 2010-2015 Google, Inc. http://angularjs.org
|
|
||||||
License: MIT
|
|
||||||
*/
|
|
||||||
(function(p,g,l){'use strict';function m(b,a,f){var c=f.baseHref(),k=b[0];return function(b,d,e){var f,h;e=e||{};h=e.expires;f=g.isDefined(e.path)?e.path:c;d===l&&(h="Thu, 01 Jan 1970 00:00:00 GMT",d="");g.isString(h)&&(h=new Date(h));d=encodeURIComponent(b)+"="+encodeURIComponent(d);d=d+(f?";path="+f:"")+(e.domain?";domain="+e.domain:"");d+=h?";expires="+h.toUTCString():"";d+=e.secure?";secure":"";e=d.length+1;4096<e&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
|
|
||||||
e+" > 4096 bytes)!");k.cookie=d}}g.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,f){return{get:function(c){return a()[c]},getObject:function(c){return(c=this.get(c))?g.fromJson(c):c},getAll:function(){return a()},put:function(c,a,n){f(c,a,n?g.extend({},b,n):b)},putObject:function(c,b,a){this.put(c,g.toJson(b),a)},remove:function(a,k){f(a,l,k?g.extend({},b,k):b)}}}]}]);g.module("ngCookies").factory("$cookieStore",
|
|
||||||
["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,f){b.putObject(a,f)},remove:function(a){b.remove(a)}}}]);m.$inject=["$document","$log","$browser"];g.module("ngCookies").provider("$$cookieWriter",function(){this.$get=m})})(window,window.angular);
|
|
||||||
//# sourceMappingURL=angular-cookies.min.js.map
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"version":3,
|
|
||||||
"file":"angular-cookies.min.js",
|
|
||||||
"lineCount":8,
|
|
||||||
"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAyQtCC,QAASA,EAAc,CAACC,CAAD,CAAYC,CAAZ,CAAkBC,CAAlB,CAA4B,CACjD,IAAIC,EAAaD,CAAAE,SAAA,EAAjB,CACIC,EAAcL,CAAA,CAAU,CAAV,CAmClB,OAAO,SAAQ,CAACM,CAAD,CAAOC,CAAP,CAAcC,CAAd,CAAuB,CAjCW,IAC3CC,CAD2C,CACrCC,CACVF,EAAA,CAgCoDA,CAhCpD,EAAqB,EACrBE,EAAA,CAAUF,CAAAE,QACVD,EAAA,CAAOZ,CAAAc,UAAA,CAAkBH,CAAAC,KAAlB,CAAA,CAAkCD,CAAAC,KAAlC,CAAiDN,CACpDI,EAAJ,GAAcT,CAAd,GACEY,CACA,CADU,+BACV,CAAAH,CAAA,CAAQ,EAFV,CAIIV,EAAAe,SAAA,CAAiBF,CAAjB,CAAJ,GACEA,CADF,CACY,IAAIG,IAAJ,CAASH,CAAT,CADZ,CAIII,EAAAA,CAAMC,kBAAA,CAqB6BT,CArB7B,CAANQ,CAAiC,GAAjCA,CAAuCC,kBAAA,CAAmBR,CAAnB,CAE3CO,EAAA,CADAA,CACA,EADOL,CAAA,CAAO,QAAP,CAAkBA,CAAlB,CAAyB,EAChC,GAAOD,CAAAQ,OAAA,CAAiB,UAAjB,CAA8BR,CAAAQ,OAA9B,CAA+C,EAAtD,CACAF,EAAA,EAAOJ,CAAA,CAAU,WAAV,CAAwBA,CAAAO,YAAA,EAAxB,CAAgD,EACvDH,EAAA,EAAON,CAAAU,OAAA,CAAiB,SAAjB,CAA6B,EAMhCC,EAAAA,CAAeL,CAAAM,OAAfD,CAA4B,CACb,KAAnB,CAAIA,CAAJ,EACElB,CAAAoB,KAAA,CAAU,UAAV,CASqCf,CATrC,CACE,6DADF;AAEEa,CAFF,CAEiB,iBAFjB,CASFd,EAAAiB,OAAA,CAJOR,CAG6B,CArCW,CAtPnDjB,CAAA0B,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,SAAA,CAOY,UAPZ,CAOwB,CAACC,QAAyB,EAAG,CAuBjD,IAAIC,EAAW,IAAAA,SAAXA,CAA2B,EA+B/B,KAAAC,KAAA,CAAY,CAAC,gBAAD,CAAmB,gBAAnB,CAAqC,QAAQ,CAACC,CAAD,CAAiBC,CAAjB,CAAiC,CACxF,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOH,EAAA,EAAA,CAAiBG,CAAjB,CADU,CAXd,CAyBLC,UAAWA,QAAQ,CAACD,CAAD,CAAM,CAEvB,MAAO,CADHxB,CACG,CADK,IAAAuB,IAAA,CAASC,CAAT,CACL,EAAQlC,CAAAoC,SAAA,CAAiB1B,CAAjB,CAAR,CAAkCA,CAFlB,CAzBpB,CAuCL2B,OAAQA,QAAQ,EAAG,CACjB,MAAON,EAAA,EADU,CAvCd,CAuDLO,IAAKA,QAAQ,CAACJ,CAAD,CAAMxB,CAAN,CAAaC,CAAb,CAAsB,CACjCqB,CAAA,CAAeE,CAAf,CAAoBxB,CAApB,CAAuCC,CArFpC,CAAUX,CAAAuC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAqF0BlB,CArF1B,CAAV,CAAkDkB,CAqFrD,CADiC,CAvD9B,CAuELW,UAAWA,QAAQ,CAACN,CAAD,CAAMxB,CAAN,CAAaC,CAAb,CAAsB,CACvC,IAAA2B,IAAA,CAASJ,CAAT,CAAclC,CAAAyC,OAAA,CAAe/B,CAAf,CAAd,CAAqCC,CAArC,CADuC,CAvEpC,CAsFL+B,OAAQA,QAAQ,CAACR,CAAD,CAAMvB,CAAN,CAAe,CAC7BqB,CAAA,CAAeE,CAAf,CAAoBjC,CAApB,CAA2CU,CApHxC,CAAUX,CAAAuC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAoH8BlB,CApH9B,CAAV,CAAkDkB,CAoHrD,CAD6B,CAtF1B,CADiF,CAA9E,CAtDqC,CAA7B,CAPxB,CA2JA7B,EAAA0B,OAAA,CAAe,WAAf,CAAAiB,QAAA,CAiCS,cAjCT;AAiCyB,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CAErD,MAAO,CAWLX,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOU,EAAAT,UAAA,CAAmBD,CAAnB,CADU,CAXd,CAyBLI,IAAKA,QAAQ,CAACJ,CAAD,CAAMxB,CAAN,CAAa,CACxBkC,CAAAJ,UAAA,CAAmBN,CAAnB,CAAwBxB,CAAxB,CADwB,CAzBrB,CAsCLgC,OAAQA,QAAQ,CAACR,CAAD,CAAM,CACpBU,CAAAF,OAAA,CAAgBR,CAAhB,CADoB,CAtCjB,CAF8C,CAAhC,CAjCzB,CAqIAhC,EAAA2C,QAAA,CAAyB,CAAC,WAAD,CAAc,MAAd,CAAsB,UAAtB,CAEzB7C,EAAA0B,OAAA,CAAe,WAAf,CAAAC,SAAA,CAAqC,gBAArC,CAAuDmB,QAA+B,EAAG,CACvF,IAAAhB,KAAA,CAAY5B,CAD2E,CAAzF,CArTsC,CAArC,CAAD,CA0TGH,MA1TH,CA0TWA,MAAAC,QA1TX;",
|
|
||||||
"sources":["angular-cookies.js"],
|
|
||||||
"names":["window","angular","undefined","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","factory","$cookies","$inject","$$CookieWriterProvider"]
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-cookies",
|
|
||||||
"version": "1.4.0",
|
|
||||||
"main": "./angular-cookies.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.4.0"
|
|
||||||
}
|
|
||||||
}
|
|
2
public/lib/angular-cookies/index.js
vendored
2
public/lib/angular-cookies/index.js
vendored
|
@ -1,2 +0,0 @@
|
||||||
require('./angular-cookies');
|
|
||||||
module.exports = 'ngCookies';
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-cookies",
|
|
||||||
"version": "1.4.0",
|
|
||||||
"description": "AngularJS module for cookies",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/angular/angular.js.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"framework",
|
|
||||||
"browser",
|
|
||||||
"cookies",
|
|
||||||
"client-side"
|
|
||||||
],
|
|
||||||
"author": "Angular Core Team <angular-core+npm@google.com>",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/angular/angular.js/issues"
|
|
||||||
},
|
|
||||||
"homepage": "http://angularjs.org"
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-mocks",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"main": "./angular-mocks.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.2.28"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/angular/bower-angular-mocks",
|
|
||||||
"_release": "1.2.28",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.2.28",
|
|
||||||
"commit": "6bb9b6fd3fdb2eba0f64dc615fa55c5f0050af75"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/angular/bower-angular-mocks.git",
|
|
||||||
"_target": "~1.2",
|
|
||||||
"_originalSource": "angular-mocks"
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
# packaged angular-mocks
|
|
||||||
|
|
||||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
|
||||||
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngMock).
|
|
||||||
Please file issues and pull requests against that repo.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
You can install this package either with `npm` or with `bower`.
|
|
||||||
|
|
||||||
### npm
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install angular-mocks
|
|
||||||
```
|
|
||||||
|
|
||||||
The mocks are then available at `node_modules/angular-mocks/angular-mocks.js`.
|
|
||||||
|
|
||||||
Note that this package is not in CommonJS format, so doing `require('angular-mocks')` will
|
|
||||||
return `undefined`.
|
|
||||||
|
|
||||||
### bower
|
|
||||||
|
|
||||||
```shell
|
|
||||||
bower install angular-mocks
|
|
||||||
```
|
|
||||||
|
|
||||||
The mocks are then available at `bower_components/angular-mocks/angular-mocks.js`.
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
Documentation is available on the
|
|
||||||
[AngularJS docs site](https://docs.angularjs.org/guide/unit-testing).
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
2193
public/lib/angular-mocks/angular-mocks.js
vendored
2193
public/lib/angular-mocks/angular-mocks.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-mocks",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"main": "./angular-mocks.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.2.28"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-mocks",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"description": "AngularJS mocks for testing",
|
|
||||||
"main": "angular-mocks.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/angular/angular.js.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"framework",
|
|
||||||
"browser",
|
|
||||||
"mocks",
|
|
||||||
"testing",
|
|
||||||
"client-side"
|
|
||||||
],
|
|
||||||
"author": "Angular Core Team <angular-core+npm@google.com>",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/angular/angular.js/issues"
|
|
||||||
},
|
|
||||||
"homepage": "http://angularjs.org"
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-permission",
|
|
||||||
"version": "0.3.0",
|
|
||||||
"authors": [
|
|
||||||
"Rafael Vidaurre <narzerus@gmail.com>"
|
|
||||||
],
|
|
||||||
"description": "Route permission and access control as simple as it can get",
|
|
||||||
"main": "dist/angular-permission.js",
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"permissions",
|
|
||||||
"roles",
|
|
||||||
"route"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"homepage": "http://www.rafaelvidaurre.com",
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"node_modules",
|
|
||||||
"bower_components",
|
|
||||||
"test",
|
|
||||||
"tests",
|
|
||||||
"src"
|
|
||||||
],
|
|
||||||
"directory": "/",
|
|
||||||
"devDependencies": {
|
|
||||||
"angular": "*",
|
|
||||||
"angular-mocks": "*"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"angular-ui-router": "~0.2.11"
|
|
||||||
},
|
|
||||||
"_release": "0.3.0",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v0.3.0",
|
|
||||||
"commit": "1f540701738fdaaaaef1f097d62f8995b2826694"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/Narzerus/angular-permission.git",
|
|
||||||
"_target": "~0.3.0",
|
|
||||||
"_originalSource": "angular-permission",
|
|
||||||
"_direct": true
|
|
||||||
}
|
|
89
public/lib/angular-permission/Gruntfile.js
vendored
89
public/lib/angular-permission/Gruntfile.js
vendored
|
@ -1,89 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
|
||||||
// Load grunt tasks automatically
|
|
||||||
require('load-grunt-tasks')(grunt);
|
|
||||||
|
|
||||||
// Time how long tasks take. Can help when optimizing build times
|
|
||||||
require('time-grunt')(grunt);
|
|
||||||
|
|
||||||
// Configurable paths for the application
|
|
||||||
var appConfig = {
|
|
||||||
app: require('./bower.json').appPath || '',
|
|
||||||
dist: 'dist'
|
|
||||||
};
|
|
||||||
|
|
||||||
// Project configuration.
|
|
||||||
grunt.initConfig({
|
|
||||||
pkg: grunt.file.readJSON('bower.json'),
|
|
||||||
appConfig: appConfig,
|
|
||||||
meta: {
|
|
||||||
banner: '/**\n' +
|
|
||||||
' * <%= pkg.name %>\n' +
|
|
||||||
' * <%= pkg.description %>\n' +
|
|
||||||
' * @version v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
|
||||||
' * @link <%= pkg.homepage %>\n' +
|
|
||||||
' * @author <%= pkg.authors.join(", ") %>\n' +
|
|
||||||
' * @license MIT License, http://www.opensource.org/licenses/MIT\n' +
|
|
||||||
' */\n'
|
|
||||||
},
|
|
||||||
clean: {
|
|
||||||
dist: {
|
|
||||||
files: [{
|
|
||||||
dot: true,
|
|
||||||
src: [
|
|
||||||
'.tmp',
|
|
||||||
'<%= appConfig.dist %>/**/*',
|
|
||||||
'!<%= appConfig.dist %>/.git*'
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
bower: {
|
|
||||||
files: ['bower.json']
|
|
||||||
},
|
|
||||||
js: {
|
|
||||||
files: ['<%= appConfig.app %>/src/**/*.js','!<%= appConfig.app %>/src/**/*.test.js'],
|
|
||||||
tasks: ['newer:jshint:all'],
|
|
||||||
},
|
|
||||||
jsTest: {
|
|
||||||
files: ['<%= appConfig.app %>/src/**/*.test.js'],
|
|
||||||
tasks: ['newer:jshint:test', 'karma']
|
|
||||||
},
|
|
||||||
gruntfile: {
|
|
||||||
files: ['Gruntfile.js']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
concat: {
|
|
||||||
options: {
|
|
||||||
banner: '<%= meta.banner %>\n'
|
|
||||||
},
|
|
||||||
dist: {
|
|
||||||
files: {
|
|
||||||
'dist/<%= pkg.name %>.js': [
|
|
||||||
'src/**/*.mdl.js',
|
|
||||||
'src/**/*.svc.js'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
karma: {
|
|
||||||
unit: {
|
|
||||||
configFile: 'test/karma.conf.js',
|
|
||||||
singleRun: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
grunt.registerTask('default', ['watch']);
|
|
||||||
grunt.registerTask('build', [
|
|
||||||
'karma',
|
|
||||||
'clean:dist',
|
|
||||||
'concat'
|
|
||||||
]);
|
|
||||||
grunt.registerTask('test', [
|
|
||||||
'karma'
|
|
||||||
]);
|
|
||||||
|
|
||||||
};
|
|
|
@ -1,21 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2015 Rafael Vidaurre
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
|
@ -1,193 +0,0 @@
|
||||||
![alt tag](https://travis-ci.org/Narzerus/angular-permission.svg?branch=master)
|
|
||||||
|
|
||||||
Permission
|
|
||||||
==========
|
|
||||||
*Role and permission based authentication on routes as simple as it can get.*
|
|
||||||
|
|
||||||
- Requires you to use [ui-router](https://github.com/angular-ui/ui-router) as your router module.
|
|
||||||
|
|
||||||
Permission is the gatekeeper for your routes
|
|
||||||
--------------------------------------------
|
|
||||||
Permission helps you gain control of your routes, by using simple concepts for you to decide who can access them.
|
|
||||||
I've seen plenty of big fat tutorials on access control implementations, and they can be quite overwhelming. So I bring you a simple, powerful, straightforward solution.
|
|
||||||
|
|
||||||
Important
|
|
||||||
---------
|
|
||||||
Please remember this project is very new, I wouldn't recommend yet using this in a big project just yet as, like any new project, might drastically change over time.
|
|
||||||
|
|
||||||
Install via bower
|
|
||||||
-----------------
|
|
||||||
```
|
|
||||||
bower install angular-permission --save
|
|
||||||
```
|
|
||||||
|
|
||||||
Include to your dependencies
|
|
||||||
----------------------------
|
|
||||||
```javascript
|
|
||||||
angular.module('yourModule', [..., 'permission']);
|
|
||||||
```
|
|
||||||
|
|
||||||
Setting route permissions/roles
|
|
||||||
-------------------------------
|
|
||||||
This is how simple Permission makes it for you to define a route which requires authorization.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
|
|
||||||
// We define a route via ui-router's $stateProvider
|
|
||||||
$stateProvider
|
|
||||||
.state('staffpanel', {
|
|
||||||
url: '...',
|
|
||||||
data: {
|
|
||||||
permissions: {
|
|
||||||
only: ['admin', 'moderator']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
You can either set an `only` or an `except` array.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Let's prevent anonymous users from looking at a dashboard
|
|
||||||
$stateProvider
|
|
||||||
.state('dashboard', {
|
|
||||||
url: '...',
|
|
||||||
data: {
|
|
||||||
permissions: {
|
|
||||||
except: ['anonymous']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
Another thing you can do is set a redirect url to which unauthorized sessions will go to.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
$stateProvider
|
|
||||||
.state('dashboard', {
|
|
||||||
url: '...',
|
|
||||||
data: {
|
|
||||||
permissions: {
|
|
||||||
except: ['anonymous'],
|
|
||||||
redirectTo: 'login'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
Defining roles
|
|
||||||
--------------------------
|
|
||||||
So, how do yo tell Permission what does 'anonymous', 'admin' or 'foo' mean and how to know if the current user belongs
|
|
||||||
to those definitions?
|
|
||||||
|
|
||||||
Well, Permission allows you to define different 'roles' along with the logic that determines if the current
|
|
||||||
session belongs to them.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Let's imagine we have a User service which has information about the current user in the session
|
|
||||||
// and is undefined if no session is active
|
|
||||||
//
|
|
||||||
// We will define the following roles:
|
|
||||||
// anonymous: When there is not user currenly logged in
|
|
||||||
// normal: A user with isAdmin = false
|
|
||||||
// admin: A user with isAdmin = true
|
|
||||||
|
|
||||||
angular.module('fooModule', ['permission', 'user'])
|
|
||||||
.run(function (Permission, User) {
|
|
||||||
// Define anonymous role
|
|
||||||
Permission.defineRole('anonymous', function (stateParams) {
|
|
||||||
// If the returned value is *truthy* then the user has the role, otherwise they don't
|
|
||||||
if (!User) {
|
|
||||||
return true; // Is anonymous
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
Sometimes you will need to call some a back-end api or some other asyncronous task to define the role
|
|
||||||
For that you can use promises
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('barModule', ['permission', 'user'])
|
|
||||||
.run(function (Permission, User, $q) {
|
|
||||||
Permission
|
|
||||||
// Define user role calling back-end
|
|
||||||
.defineRole('user', function (stateParams) {
|
|
||||||
// This time we will return a promise
|
|
||||||
// If the promise *resolves* then the user has the role, if it *rejects* (you guessed it)
|
|
||||||
|
|
||||||
// Let's assume this returns a promise that resolves or rejects if session is active
|
|
||||||
return User.checkSession();
|
|
||||||
})
|
|
||||||
// A different example for admin
|
|
||||||
.defineRole('admin', function (stateParams) {
|
|
||||||
var deferred = $q.defer();
|
|
||||||
|
|
||||||
User.getAccessLevel().then(function (data) {
|
|
||||||
if (data.accessLevel === 'admin') {
|
|
||||||
deferred.resolve();
|
|
||||||
} else {
|
|
||||||
deferred.reject();
|
|
||||||
}
|
|
||||||
}, function () {
|
|
||||||
// Error with request
|
|
||||||
deferred.reject();
|
|
||||||
});
|
|
||||||
|
|
||||||
return deferred.promise;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
```
|
|
||||||
As you can see, Permission is useful wether you want a role-based access control or a permission-based one, as
|
|
||||||
it allows you to define this behaviour however you want to.
|
|
||||||
|
|
||||||
Events
|
|
||||||
------
|
|
||||||
- **$stateChangePermissionStart**: This event is broadcasted before perform authorize.
|
|
||||||
|
|
||||||
- **$stateChangePermissionAccepted**: This event is broadcasted when one of the permissions has been accepted and the state changes successfully.
|
|
||||||
|
|
||||||
- **$stateChangePermissionDenied**: This event is broadcasted when the access to the target state is not granted (no permissions found on the `only` array or at least one permission found on the `except` array). This is when the state stays the same or is changed based on the `redirectTo` option.
|
|
||||||
|
|
||||||
|
|
||||||
Caveats
|
|
||||||
=======
|
|
||||||
Because of a bug in ui-router, when using `$urlStateProvider.otherwise` we get an **infinite digest** loop error.
|
|
||||||
A workaround was found by [@shaoibmerchant](https://github.com/shoaibmerchant) and it goes like this:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Normal usage (creates INFDG error)
|
|
||||||
$urlRouterProvider.otherwise('/somestate');
|
|
||||||
|
|
||||||
// Instead
|
|
||||||
$urlRouterProvider.otherwise( function($injector) {
|
|
||||||
var $state = $injector.get("$state");
|
|
||||||
$state.go('/somestate');
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
TODOS:
|
|
||||||
-----
|
|
||||||
Help fill this list with your feature requests
|
|
||||||
- More powerful redirection to allow passing state parameters and other useful stuff ui-router provides. Ideas anyone?
|
|
||||||
- Inheritance (example: 'admin' inherits from 'user')
|
|
||||||
- Role validation caching?
|
|
||||||
|
|
||||||
Contributing
|
|
||||||
============
|
|
||||||
This project is still in diapers and I would love your feedback / help in making this a great module
|
|
||||||
for angular developers to use.
|
|
||||||
|
|
||||||
The correct way to contribute is:
|
|
||||||
1. Create a branch from the `development` branch
|
|
||||||
2. Implement your new feature
|
|
||||||
3. Submit a pull request to be merged in the `development` branch
|
|
||||||
4. Remember to run `grunt build` before your last commit
|
|
||||||
|
|
||||||
Author
|
|
||||||
======
|
|
||||||
- Rafael Vidaurre
|
|
||||||
- @narzerus
|
|
||||||
- I'm a full-stack developer currenly working as CTO and Co-Founder at [Finciero](http://www.finciero.com)
|
|
|
@ -1,33 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-permission",
|
|
||||||
"version": "0.3.0",
|
|
||||||
"authors": [
|
|
||||||
"Rafael Vidaurre <narzerus@gmail.com>"
|
|
||||||
],
|
|
||||||
"description": "Route permission and access control as simple as it can get",
|
|
||||||
"main": "dist/angular-permission.js",
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"permissions",
|
|
||||||
"roles",
|
|
||||||
"route"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"homepage": "http://www.rafaelvidaurre.com",
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"node_modules",
|
|
||||||
"bower_components",
|
|
||||||
"test",
|
|
||||||
"tests",
|
|
||||||
"src"
|
|
||||||
],
|
|
||||||
"directory": "/",
|
|
||||||
"devDependencies": {
|
|
||||||
"angular": "*",
|
|
||||||
"angular-mocks": "*"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"angular-ui-router": "~0.2.11"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,232 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-permission
|
|
||||||
* Route permission and access control as simple as it can get
|
|
||||||
* @version v0.3.0 - 2015-06-15
|
|
||||||
* @link http://www.rafaelvidaurre.com
|
|
||||||
* @author Rafael Vidaurre <narzerus@gmail.com>
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('permission', ['ui.router'])
|
|
||||||
.run(['$rootScope', 'Permission', '$state', '$q',
|
|
||||||
function ($rootScope, Permission, $state, $q) {
|
|
||||||
$rootScope.$on('$stateChangeStart',
|
|
||||||
function (event, toState, toParams, fromState, fromParams) {
|
|
||||||
if (toState.$$finishAuthorize) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there are permissions set then prevent default and attempt to authorize
|
|
||||||
var permissions;
|
|
||||||
if (toState.data && toState.data.permissions) {
|
|
||||||
permissions = toState.data.permissions;
|
|
||||||
} else if (toState.permissions) {
|
|
||||||
/**
|
|
||||||
* This way of defining permissions will be depracated in v1. Should use
|
|
||||||
* `data` key instead
|
|
||||||
*/
|
|
||||||
console.log('Deprecation Warning: permissions should be set inside the `data` key ');
|
|
||||||
console.log('Setting permissions for a state outside `data` will be depracated in' +
|
|
||||||
' version 1');
|
|
||||||
permissions = toState.permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (permissions) {
|
|
||||||
event.preventDefault();
|
|
||||||
toState = angular.extend({'$$finishAuthorize': true}, toState);
|
|
||||||
|
|
||||||
if ($rootScope.$broadcast('$stateChangePermissionStart', toState, toParams).defaultPrevented) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Permission.authorize(permissions, toParams).then(function () {
|
|
||||||
// If authorized, use call state.go without triggering the event.
|
|
||||||
// Then trigger $stateChangeSuccess manually to resume the rest of the process
|
|
||||||
// Note: This is a pseudo-hacky fix which should be fixed in future ui-router versions
|
|
||||||
if (!$rootScope.$broadcast('$stateChangeStart', toState, toParams, fromState, fromParams).defaultPrevented) {
|
|
||||||
$rootScope.$broadcast('$stateChangePermissionAccepted', toState, toParams);
|
|
||||||
|
|
||||||
$state.go(toState.name, toParams, {notify: false}).then(function() {
|
|
||||||
$rootScope
|
|
||||||
.$broadcast('$stateChangeSuccess', toState, toParams, fromState, fromParams);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, function () {
|
|
||||||
if (!$rootScope.$broadcast('$stateChangeStart', toState, toParams, fromState, fromParams).defaultPrevented) {
|
|
||||||
$rootScope.$broadcast('$stateChangePermissionDenied', toState, toParams);
|
|
||||||
|
|
||||||
var redirectTo = permissions.redirectTo;
|
|
||||||
var result;
|
|
||||||
|
|
||||||
if (angular.isFunction(redirectTo)) {
|
|
||||||
redirectTo = redirectTo();
|
|
||||||
|
|
||||||
$q.when(redirectTo).then(function (newState) {
|
|
||||||
if (newState) {
|
|
||||||
$state.go(newState, toParams);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (redirectTo) {
|
|
||||||
$state.go(redirectTo, toParams);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}]);
|
|
||||||
}());
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('permission')
|
|
||||||
.provider('Permission', function () {
|
|
||||||
var roleValidationConfig = {};
|
|
||||||
var validateRoleDefinitionParams = function (roleName, validationFunction) {
|
|
||||||
if (!angular.isString(roleName)) {
|
|
||||||
throw new Error('Role name must be a string');
|
|
||||||
}
|
|
||||||
if (!angular.isFunction(validationFunction)) {
|
|
||||||
throw new Error('Validation function not provided correctly');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.defineRole = function (roleName, validationFunction) {
|
|
||||||
/**
|
|
||||||
This method is only available in config-time, and cannot access services, as they are
|
|
||||||
not yet injected anywere which makes this kinda useless.
|
|
||||||
Should remove if we cannot find a use for it.
|
|
||||||
**/
|
|
||||||
validateRoleDefinitionParams(roleName, validationFunction);
|
|
||||||
roleValidationConfig[roleName] = validationFunction;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ['$q', function ($q) {
|
|
||||||
var Permission = {
|
|
||||||
_promiseify: function (value) {
|
|
||||||
/**
|
|
||||||
Converts a value into a promise, if the value is truthy it resolves it, otherwise
|
|
||||||
it rejects it
|
|
||||||
**/
|
|
||||||
if (value && angular.isFunction(value.then)) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
var deferred = $q.defer();
|
|
||||||
if (value) {
|
|
||||||
deferred.resolve();
|
|
||||||
} else {
|
|
||||||
deferred.reject();
|
|
||||||
}
|
|
||||||
return deferred.promise;
|
|
||||||
},
|
|
||||||
_validateRoleMap: function (roleMap) {
|
|
||||||
if (typeof(roleMap) !== 'object' || roleMap instanceof Array) {
|
|
||||||
throw new Error('Role map has to be an object');
|
|
||||||
}
|
|
||||||
if (roleMap.only === undefined && roleMap.except === undefined) {
|
|
||||||
throw new Error('Either "only" or "except" keys must me defined');
|
|
||||||
}
|
|
||||||
if (roleMap.only) {
|
|
||||||
if (!(roleMap.only instanceof Array)) {
|
|
||||||
throw new Error('Array of roles expected');
|
|
||||||
}
|
|
||||||
} else if (roleMap.except) {
|
|
||||||
if (!(roleMap.except instanceof Array)) {
|
|
||||||
throw new Error('Array of roles expected');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_findMatchingRole: function (rolesArray, toParams) {
|
|
||||||
var roles = angular.copy(rolesArray);
|
|
||||||
var deferred = $q.defer();
|
|
||||||
var currentRole = roles.shift();
|
|
||||||
|
|
||||||
// If no roles left to validate reject promise
|
|
||||||
if (!currentRole) {
|
|
||||||
deferred.reject();
|
|
||||||
return deferred.promise;
|
|
||||||
}
|
|
||||||
// Validate role definition exists
|
|
||||||
if (!angular.isFunction(Permission.roleValidations[currentRole])) {
|
|
||||||
throw new Error('undefined role or invalid role validation');
|
|
||||||
}
|
|
||||||
|
|
||||||
var validatingRole = Permission.roleValidations[currentRole](toParams);
|
|
||||||
validatingRole = Permission._promiseify(validatingRole);
|
|
||||||
|
|
||||||
validatingRole.then(function () {
|
|
||||||
deferred.resolve();
|
|
||||||
}, function () {
|
|
||||||
Permission._findMatchingRole(roles, toParams).then(function () {
|
|
||||||
deferred.resolve();
|
|
||||||
}, function () {
|
|
||||||
deferred.reject();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return deferred.promise;
|
|
||||||
},
|
|
||||||
defineRole: function (roleName, validationFunction) {
|
|
||||||
/**
|
|
||||||
Service-available version of defineRole, the callback passed here lives in the
|
|
||||||
scope where it is defined and therefore can interact with other modules
|
|
||||||
**/
|
|
||||||
validateRoleDefinitionParams(roleName, validationFunction);
|
|
||||||
roleValidationConfig[roleName] = validationFunction;
|
|
||||||
|
|
||||||
return Permission;
|
|
||||||
},
|
|
||||||
resolveIfMatch: function (rolesArray, toParams) {
|
|
||||||
var roles = angular.copy(rolesArray);
|
|
||||||
var deferred = $q.defer();
|
|
||||||
Permission._findMatchingRole(roles, toParams).then(function () {
|
|
||||||
// Found role match
|
|
||||||
deferred.resolve();
|
|
||||||
}, function () {
|
|
||||||
// No match
|
|
||||||
deferred.reject();
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
},
|
|
||||||
rejectIfMatch: function (roles, toParams) {
|
|
||||||
var deferred = $q.defer();
|
|
||||||
Permission._findMatchingRole(roles, toParams).then(function () {
|
|
||||||
// Role found
|
|
||||||
deferred.reject();
|
|
||||||
}, function () {
|
|
||||||
// Role not found
|
|
||||||
deferred.resolve();
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
},
|
|
||||||
roleValidations: roleValidationConfig,
|
|
||||||
authorize: function (roleMap, toParams) {
|
|
||||||
// Validate input
|
|
||||||
Permission._validateRoleMap(roleMap);
|
|
||||||
|
|
||||||
var authorizing;
|
|
||||||
|
|
||||||
if (roleMap.only) {
|
|
||||||
authorizing = Permission.resolveIfMatch(roleMap.only, toParams);
|
|
||||||
} else {
|
|
||||||
authorizing = Permission.rejectIfMatch(roleMap.except, toParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
return authorizing;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return Permission;
|
|
||||||
}];
|
|
||||||
});
|
|
||||||
|
|
||||||
}());
|
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
|
||||||
"grunt": "^0.4.5",
|
|
||||||
"grunt-contrib-clean": "^0.5.0",
|
|
||||||
"grunt-contrib-concat": "^0.4.0",
|
|
||||||
"grunt-contrib-connect": "^0.7.1",
|
|
||||||
"grunt-contrib-copy": "^0.5.0",
|
|
||||||
"grunt-contrib-jshint": "^0.10.0",
|
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
|
||||||
"grunt-filerev": "^0.2.1",
|
|
||||||
"grunt-karma": "^0.8.3",
|
|
||||||
"grunt-newer": "^0.7.0",
|
|
||||||
"karma": "^0.12.17",
|
|
||||||
"karma-jasmine": "^0.1.5",
|
|
||||||
"karma-phantomjs-launcher": "^0.1.4",
|
|
||||||
"load-grunt-tasks": "^0.4.0",
|
|
||||||
"time-grunt": "^0.3.1"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "grunt karma:unit"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-raven",
|
|
||||||
"version": "0.5.11",
|
|
||||||
"main": "angular-raven.js",
|
|
||||||
"keywords": [
|
|
||||||
"Patrick",
|
|
||||||
"PatrickJS",
|
|
||||||
"gdi2290",
|
|
||||||
"angular",
|
|
||||||
"angularjs",
|
|
||||||
"angular.js",
|
|
||||||
"$exceptionHandler",
|
|
||||||
"raven",
|
|
||||||
"ravenjs",
|
|
||||||
"raven.js",
|
|
||||||
"sentry.js",
|
|
||||||
"sentry",
|
|
||||||
"sentryjs",
|
|
||||||
"error",
|
|
||||||
"errorhandler"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Patrick Stapleton",
|
|
||||||
"email": "github@gdi2290.com",
|
|
||||||
"url": "www.gdi2290.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"*.yml",
|
|
||||||
"*.xml",
|
|
||||||
"node_modules",
|
|
||||||
"bower_components",
|
|
||||||
"test",
|
|
||||||
"tests"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "*",
|
|
||||||
"raven-js": "*"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/gdi2290/angular-raven",
|
|
||||||
"_release": "0.5.11",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v0.5.11",
|
|
||||||
"commit": "4b02d3d1c84aceeac6a673c40ad68487881f7151"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/gdi2290/angular-raven.git",
|
|
||||||
"_target": "~0.5.11",
|
|
||||||
"_originalSource": "angular-raven",
|
|
||||||
"_direct": true
|
|
||||||
}
|
|
49
public/lib/angular-raven/Gruntfile.js
vendored
49
public/lib/angular-raven/Gruntfile.js
vendored
|
@ -1,49 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = function (grunt) {
|
|
||||||
|
|
||||||
require('load-grunt-tasks')(grunt);
|
|
||||||
require('time-grunt')(grunt);
|
|
||||||
|
|
||||||
// Project configuration.
|
|
||||||
grunt.initConfig({
|
|
||||||
nodeunit: {
|
|
||||||
files: ['test/**/*_test.js']
|
|
||||||
},
|
|
||||||
jshint: {
|
|
||||||
options: {
|
|
||||||
jshintrc: '.jshintrc'
|
|
||||||
},
|
|
||||||
gruntfile: {
|
|
||||||
src: 'Gruntfile.js'
|
|
||||||
},
|
|
||||||
lib: {
|
|
||||||
src: ['angular-raven.js']
|
|
||||||
},
|
|
||||||
test: {
|
|
||||||
src: ['test/**/*.js']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
gruntfile: {
|
|
||||||
files: '<%= jshint.gruntfile.src %>',
|
|
||||||
tasks: ['jshint:gruntfile']
|
|
||||||
},
|
|
||||||
lib: {
|
|
||||||
files: '<%= jshint.lib.src %>',
|
|
||||||
tasks: ['jshint:lib', 'nodeunit']
|
|
||||||
},
|
|
||||||
test: {
|
|
||||||
files: '<%= jshint.test.src %>',
|
|
||||||
tasks: ['jshint:test', 'nodeunit']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Default task.
|
|
||||||
grunt.registerTask('default', [
|
|
||||||
'jshint',
|
|
||||||
'nodeunit'
|
|
||||||
]);
|
|
||||||
|
|
||||||
};
|
|
|
@ -1,21 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014-2015 Patrick Stapleton, gdi2290, PatrickJS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
|
@ -1,96 +0,0 @@
|
||||||
# angular-raven [![Build Status](https://travis-ci.org/gdi2290/angular-raven.png?branch=master)](https://travis-ci.org/gdi2290/angular-raven)
|
|
||||||
A Raven.js / Sentry wrapper for Angular.js
|
|
||||||
|
|
||||||
#How do I add this to my project?
|
|
||||||
|
|
||||||
You can download angular-raven by:
|
|
||||||
|
|
||||||
* (prefered) Using bower and running `bower install angular-raven --save`
|
|
||||||
* Using npm and running `npm install angular-raven --save`
|
|
||||||
* Downloading it manually by clicking [here to download development unminified version](https://raw.github.com/gdi2290/angular-raven/master/angular-raven.js)
|
|
||||||
|
|
||||||
|
|
||||||
````html
|
|
||||||
<body ng-app="YOUR_APP" ng-controller="MainCtrl">
|
|
||||||
<a href="#error" ng-click="logError()">Log Error</a>
|
|
||||||
</body>
|
|
||||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/raven.js/1.0.8/raven.min.js"></script>
|
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
|
|
||||||
<script>
|
|
||||||
Raven.config('YOUR_PUBLIC_DSN', {
|
|
||||||
// Raven settings
|
|
||||||
})
|
|
||||||
.setUser({
|
|
||||||
"id": "SERVER_RENDERED_ID",
|
|
||||||
"email": "SERVER_RENDERED_EMAIL"
|
|
||||||
})
|
|
||||||
.install()
|
|
||||||
</script>
|
|
||||||
<script src="app/bower_components/angular-raven/angular-raven.js"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
angular.module('YOUR_APP', [
|
|
||||||
'ngRaven',
|
|
||||||
'controllers'
|
|
||||||
])
|
|
||||||
.config(function($ravenProvider) {
|
|
||||||
// There is a development flag to log errors rather than sending it to Sentry
|
|
||||||
$ravenProvider.development(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
angular.module('controllers', [])
|
|
||||||
.controller('MainCtrl', function($scope, $raven) {
|
|
||||||
$scope.logError = function() {
|
|
||||||
$raven.captureMessage('Error');
|
|
||||||
};
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
````
|
|
||||||
|
|
||||||
Initializing Raven.js outside of Angular allows Raven to track errors when Angular wasn't able to bootstrap correctly.
|
|
||||||
|
|
||||||
|
|
||||||
The community has compiled a list of common ignore rules for common things, like Facebook, Chrome extensions, etc.
|
|
||||||
```javascript
|
|
||||||
Raven.config('YOUR_PUBLIC_DSN', {
|
|
||||||
logger: 'javascript',
|
|
||||||
ignoreErrors: [
|
|
||||||
// Random plugins/extensions
|
|
||||||
'top.GLOBALS',
|
|
||||||
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html
|
|
||||||
'originalCreateNotification',
|
|
||||||
'canvas.contentDocument',
|
|
||||||
'MyApp_RemoveAllHighlights',
|
|
||||||
'http://tt.epicplay.com',
|
|
||||||
'Can\'t find variable: ZiteReader',
|
|
||||||
'jigsaw is not defined',
|
|
||||||
'ComboSearch is not defined',
|
|
||||||
'http://loading.retry.widdit.com/',
|
|
||||||
'atomicFindClose',
|
|
||||||
// Facebook borked
|
|
||||||
'fb_xd_fragment',
|
|
||||||
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to reduce this. (thanks @acdha)
|
|
||||||
// See http://stackoverflow.com/questions/4113268/how-to-stop-javascript-injection-from-vodafone-proxy
|
|
||||||
'bmi_SafeAddOnload',
|
|
||||||
'EBCallBackMessageReceived',
|
|
||||||
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
|
|
||||||
'conduitPage'
|
|
||||||
],
|
|
||||||
ignoreUrls: [
|
|
||||||
// Facebook flakiness
|
|
||||||
/graph\.facebook\.com/i,
|
|
||||||
// Facebook blocked
|
|
||||||
/connect\.facebook\.net\/en_US\/all\.js/i,
|
|
||||||
// Woopra flakiness
|
|
||||||
/eatdifferent\.com\.woopra-ns\.com/i,
|
|
||||||
/static\.woopra\.com\/js\/woopra\.js/i,
|
|
||||||
// Chrome extensions
|
|
||||||
/extensions\//i,
|
|
||||||
/^chrome:\/\//i,
|
|
||||||
// Other plugins
|
|
||||||
/127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
|
|
||||||
/webappstoolbarba\.texthelp\.com\//i,
|
|
||||||
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i
|
|
||||||
]
|
|
||||||
}).install();
|
|
142
public/lib/angular-raven/angular-raven.js
vendored
142
public/lib/angular-raven/angular-raven.js
vendored
|
@ -1,142 +0,0 @@
|
||||||
(function(global, angular, undefined) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var _development = null;
|
|
||||||
|
|
||||||
function $RavenProvider() {
|
|
||||||
|
|
||||||
this.development = function(config) {
|
|
||||||
_development = config || _development;
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ['$window', '$log', function($window, $log) {
|
|
||||||
var service = {
|
|
||||||
VERSION: ($window.Raven) ? $window.Raven.VERSION : 'development',
|
|
||||||
TraceKit: ($window.Raven) ? $window.Raven.TraceKit : 'development',
|
|
||||||
captureException: function captureException(exception, cause) {
|
|
||||||
if (!_development) {
|
|
||||||
$window.Raven.captureException(exception, cause);
|
|
||||||
} else {
|
|
||||||
$log.error('Raven: Exception ', exception, cause);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
captureMessage: function captureMessage(message, data) {
|
|
||||||
if (!_development) {
|
|
||||||
$window.Raven.captureMessage(message, data);
|
|
||||||
} else {
|
|
||||||
$log.error('Raven: Message ', message, data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setUser: function setUser(user) {
|
|
||||||
if (_development) {
|
|
||||||
$log.info('Raven: User ', user);
|
|
||||||
} else {
|
|
||||||
if ($window.Raven.setUser) {
|
|
||||||
$window.Raven.setUser(user);
|
|
||||||
} else if ($window.Raven.setUserContext) {
|
|
||||||
$window.Raven.setUserContext(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setUserContext: function setUserContext(user) {
|
|
||||||
if (_development) {
|
|
||||||
$log.info('Raven: User ', user);
|
|
||||||
} else {
|
|
||||||
if ($window.Raven.setUserContext) {
|
|
||||||
$window.Raven.setUserContext(user);
|
|
||||||
} else if ($window.Raven.setUser) {
|
|
||||||
$window.Raven.setUser(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lastException: function lastException() {
|
|
||||||
if (_development) {
|
|
||||||
$log.error('Raven: Last Exception');
|
|
||||||
} else {
|
|
||||||
$window.Raven.lastException();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
context: function context(options, func, args) {
|
|
||||||
var RavenService = this;
|
|
||||||
|
|
||||||
if (angular.isFunction(options)) {
|
|
||||||
args = func || [];
|
|
||||||
func = options;
|
|
||||||
options = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return RavenService.wrap(options, func).apply(RavenService, args);
|
|
||||||
},
|
|
||||||
wrap: function wrap(options, func) {
|
|
||||||
var RavenService = this;
|
|
||||||
|
|
||||||
if (angular.isUndefined(func) && !angular.isFunction(options)) {
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (angular.isFunction(options)) {
|
|
||||||
func = options;
|
|
||||||
options = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!angular.isFunction(func)) {
|
|
||||||
return func;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (func.__raven__) {
|
|
||||||
return func;
|
|
||||||
}
|
|
||||||
|
|
||||||
function wrapped() {
|
|
||||||
var args = [], i = arguments.length;
|
|
||||||
while(i--) args[i] = RavenService.wrap(options, arguments[i]);
|
|
||||||
try {
|
|
||||||
return func.apply(this, args);
|
|
||||||
} catch(e) {
|
|
||||||
RavenService.captureException(e, options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var property in func) {
|
|
||||||
if (func.hasOwnProperty(property)) {
|
|
||||||
wrapped[property] = func[property];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wrapped.__raven__ = true;
|
|
||||||
return wrapped;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
return service;
|
|
||||||
}]; // end $get
|
|
||||||
} // end provider
|
|
||||||
|
|
||||||
function $ExceptionHandlerDecorator($delegate, Raven) {
|
|
||||||
function $ExceptionHandler(exception, cause) {
|
|
||||||
if (exception instanceof Error) {
|
|
||||||
Raven.captureException(exception, cause);
|
|
||||||
} else {
|
|
||||||
Raven.captureMessage(exception, {
|
|
||||||
exception: exception,
|
|
||||||
cause: cause
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$delegate(exception, cause);
|
|
||||||
}
|
|
||||||
return $ExceptionHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
angular.module('ngRaven', [])
|
|
||||||
.provider('$raven', $RavenProvider)
|
|
||||||
.provider('Raven', $RavenProvider)
|
|
||||||
.config(['$provide', function($provide) {
|
|
||||||
$provide.decorator('$exceptionHandler', ['$delegate', '$raven', $ExceptionHandlerDecorator]);
|
|
||||||
}]);
|
|
||||||
|
|
||||||
|
|
||||||
angular.module('angular-raven', ['ngRaven']);
|
|
||||||
|
|
||||||
}(this, angular));
|
|
|
@ -1 +0,0 @@
|
||||||
!function(e,n,t){"use strict";function r(){this.development=function(e){return o=e||o,this},this.$get=["$window","$log",function(e,r){var a={VERSION:e.Raven?e.Raven.VERSION:"development",TraceKit:e.Raven?e.Raven.TraceKit:"development",captureException:function(n,t){o?r.error("Raven: Exception ",n,t):e.Raven.captureException(n,t)},captureMessage:function(n,t){o?r.error("Raven: Message ",n,t):e.Raven.captureMessage(n,t)},setUser:function(n){o?r.info("Raven: User ",n):e.Raven.setUser?e.Raven.setUser(n):e.Raven.setUserContext&&e.Raven.setUserContext(n)},setUserContext:function(n){o?r.info("Raven: User ",n):e.Raven.setUserContext?e.Raven.setUserContext(n):e.Raven.setUser&&e.Raven.setUser(n)},lastException:function(){o?r.error("Raven: Last Exception"):e.Raven.lastException()},context:function(e,r,a){var o=this;return n.isFunction(e)&&(a=r||[],r=e,e=t),o.wrap(e,r).apply(o,a)},wrap:function(e,r){function a(){for(var n=[],t=arguments.length;t--;)n[t]=o.wrap(e,arguments[t]);try{return r.apply(this,n)}catch(a){o.captureException(a,e)}}var o=this;if(n.isUndefined(r)&&!n.isFunction(e))return e;if(n.isFunction(e)&&(r=e,e=t),!n.isFunction(r))return r;if(r.__raven__)return r;for(var i in r)r.hasOwnProperty(i)&&(a[i]=r[i]);return a.__raven__=!0,a}};return a}]}function a(e,n){function t(t,r){t instanceof Error?n.captureException(t,r):n.captureMessage(t,{exception:t,cause:r}),e(t,r)}return t}var o=null;n.module("ngRaven",[]).provider("$raven",r).provider("Raven",r).config(["$provide",function(e){e.decorator("$exceptionHandler",["$delegate","$raven",a])}]),n.module("angular-raven",["ngRaven"])}(this,angular);
|
|
|
@ -1,42 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-raven",
|
|
||||||
"version": "0.5.11",
|
|
||||||
"main": "angular-raven.js",
|
|
||||||
"keywords": [
|
|
||||||
"Patrick",
|
|
||||||
"PatrickJS",
|
|
||||||
"gdi2290",
|
|
||||||
"angular",
|
|
||||||
"angularjs",
|
|
||||||
"angular.js",
|
|
||||||
"$exceptionHandler",
|
|
||||||
"raven",
|
|
||||||
"ravenjs",
|
|
||||||
"raven.js",
|
|
||||||
"sentry.js",
|
|
||||||
"sentry",
|
|
||||||
"sentryjs",
|
|
||||||
"error",
|
|
||||||
"errorhandler"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Patrick Stapleton",
|
|
||||||
"email": "github@gdi2290.com",
|
|
||||||
"url": "www.gdi2290.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"*.yml",
|
|
||||||
"*.xml",
|
|
||||||
"node_modules",
|
|
||||||
"bower_components",
|
|
||||||
"test",
|
|
||||||
"tests"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "*",
|
|
||||||
"raven-js": "*"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Raven.js for Angular.js</title>
|
|
||||||
<script src="https://cdn.ravenjs.com/1.1.16/raven.min.js"></script>
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.12/angular.min.js"></script>
|
|
||||||
<script src="../angular-raven.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body ng-app="APP">
|
|
||||||
<section ng-controller="MainCtrl">
|
|
||||||
<form ng-submit="throwError(message)">
|
|
||||||
<label>
|
|
||||||
Error:
|
|
||||||
<input type="text" ng-model="message" autofocus required>
|
|
||||||
</label>
|
|
||||||
<button>Submit Error</button>
|
|
||||||
</form>
|
|
||||||
<ul>
|
|
||||||
<li ng-repeat="err in listErrors | reverse track by $index">
|
|
||||||
<pre>{{ err.stack }}</pre>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
Raven.config('http://50dbe04cd1224d439e9c49bf1d0464df@localhost:8000/1').install();
|
|
||||||
|
|
||||||
angular.module('APP', ['ngRaven'])
|
|
||||||
.config(function($ravenProvider) {
|
|
||||||
$ravenProvider.development(true);
|
|
||||||
})
|
|
||||||
.controller('MainCtrl', function($scope) {
|
|
||||||
$scope.listErrors = [];
|
|
||||||
|
|
||||||
$scope.throwError = function(message) {
|
|
||||||
if (!message) { return; }
|
|
||||||
var err = new Error(message);
|
|
||||||
|
|
||||||
$scope.listErrors.push(err);
|
|
||||||
$scope.message = '';
|
|
||||||
|
|
||||||
throw err;
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
|
||||||
.filter('reverse', function() {
|
|
||||||
return function(items) {
|
|
||||||
return items.slice().reverse();
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,51 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-raven",
|
|
||||||
"version": "0.5.11",
|
|
||||||
"main": "angular-raven.js",
|
|
||||||
"description": "A Raven.js / Sentry wrapper for Angular.js",
|
|
||||||
"homepage": "https://github.com/gdi2290/angular-raven",
|
|
||||||
"bugs": "https://github.com/gdi2290/angular-raven/issues",
|
|
||||||
"author": {
|
|
||||||
"name": "Patrick Stapleton",
|
|
||||||
"email": "github@gdi2290.com",
|
|
||||||
"url": "www.gdi2290.com"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"Patrick",
|
|
||||||
"PatrickJS",
|
|
||||||
"gdi2290",
|
|
||||||
"angular",
|
|
||||||
"angularjs",
|
|
||||||
"angular.js",
|
|
||||||
"$exceptionHandler",
|
|
||||||
"raven",
|
|
||||||
"ravenjs",
|
|
||||||
"raven.js",
|
|
||||||
"sentry.js",
|
|
||||||
"sentry",
|
|
||||||
"sentryjs",
|
|
||||||
"error",
|
|
||||||
"errorhandler"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git@github.com:gdi2290/angular-raven.git"
|
|
||||||
},
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "MIT"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "*",
|
|
||||||
"raven": "*"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"grunt": "~0.4.1",
|
|
||||||
"load-grunt-tasks": "~0.1.0",
|
|
||||||
"time-grunt": "~0.1.0",
|
|
||||||
"grunt-contrib-jshint": "~0.6.0",
|
|
||||||
"grunt-contrib-nodeunit": "~0.2.0",
|
|
||||||
"grunt-contrib-watch": "~0.5.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-resource",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"main": "./angular-resource.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.2.28"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/angular/bower-angular-resource",
|
|
||||||
"_release": "1.2.28",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.2.28",
|
|
||||||
"commit": "5b3ad241288adb3d28a68c3f45405f82e736532d"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/angular/bower-angular-resource.git",
|
|
||||||
"_target": "~1.2",
|
|
||||||
"_originalSource": "angular-resource"
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
# packaged angular-resource
|
|
||||||
|
|
||||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
|
||||||
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngResource).
|
|
||||||
Please file issues and pull requests against that repo.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
You can install this package either with `npm` or with `bower`.
|
|
||||||
|
|
||||||
### npm
|
|
||||||
|
|
||||||
```shell
|
|
||||||
npm install angular-resource
|
|
||||||
```
|
|
||||||
|
|
||||||
Add a `<script>` to your `index.html`:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="/node_modules/angular-resource/angular-resource.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `ngResource` as a dependency for your app:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('myApp', ['ngResource']);
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that this package is not in CommonJS format, so doing `require('angular-resource')` will
|
|
||||||
return `undefined`.
|
|
||||||
|
|
||||||
### bower
|
|
||||||
|
|
||||||
```shell
|
|
||||||
bower install angular-resource
|
|
||||||
```
|
|
||||||
|
|
||||||
Add a `<script>` to your `index.html`:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script src="/bower_components/angular-resource/angular-resource.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add `ngResource` as a dependency for your app:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
angular.module('myApp', ['ngResource']);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
Documentation is available on the
|
|
||||||
[AngularJS docs site](http://docs.angularjs.org/api/ngResource).
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
627
public/lib/angular-resource/angular-resource.js
vendored
627
public/lib/angular-resource/angular-resource.js
vendored
|
@ -1,627 +0,0 @@
|
||||||
/**
|
|
||||||
* @license AngularJS v1.2.28
|
|
||||||
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
|
||||||
* License: MIT
|
|
||||||
*/
|
|
||||||
(function(window, angular, undefined) {'use strict';
|
|
||||||
|
|
||||||
var $resourceMinErr = angular.$$minErr('$resource');
|
|
||||||
|
|
||||||
// Helper functions and regex to lookup a dotted path on an object
|
|
||||||
// stopping at undefined/null. The path must be composed of ASCII
|
|
||||||
// identifiers (just like $parse)
|
|
||||||
var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;
|
|
||||||
|
|
||||||
function isValidDottedPath(path) {
|
|
||||||
return (path != null && path !== '' && path !== 'hasOwnProperty' &&
|
|
||||||
MEMBER_NAME_REGEX.test('.' + path));
|
|
||||||
}
|
|
||||||
|
|
||||||
function lookupDottedPath(obj, path) {
|
|
||||||
if (!isValidDottedPath(path)) {
|
|
||||||
throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
|
|
||||||
}
|
|
||||||
var keys = path.split('.');
|
|
||||||
for (var i = 0, ii = keys.length; i < ii && obj !== undefined; i++) {
|
|
||||||
var key = keys[i];
|
|
||||||
obj = (obj !== null) ? obj[key] : undefined;
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a shallow copy of an object and clear other fields from the destination
|
|
||||||
*/
|
|
||||||
function shallowClearAndCopy(src, dst) {
|
|
||||||
dst = dst || {};
|
|
||||||
|
|
||||||
angular.forEach(dst, function(value, key){
|
|
||||||
delete dst[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
for (var key in src) {
|
|
||||||
if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
|
|
||||||
dst[key] = src[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return dst;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc module
|
|
||||||
* @name ngResource
|
|
||||||
* @description
|
|
||||||
*
|
|
||||||
* # ngResource
|
|
||||||
*
|
|
||||||
* The `ngResource` module provides interaction support with RESTful services
|
|
||||||
* via the $resource service.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <div doc-module-components="ngResource"></div>
|
|
||||||
*
|
|
||||||
* See {@link ngResource.$resource `$resource`} for usage.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc service
|
|
||||||
* @name $resource
|
|
||||||
* @requires $http
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* A factory which creates a resource object that lets you interact with
|
|
||||||
* [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
|
|
||||||
*
|
|
||||||
* The returned resource object has action methods which provide high-level behaviors without
|
|
||||||
* the need to interact with the low level {@link ng.$http $http} service.
|
|
||||||
*
|
|
||||||
* Requires the {@link ngResource `ngResource`} module to be installed.
|
|
||||||
*
|
|
||||||
* @param {string} url A parametrized URL template with parameters prefixed by `:` as in
|
|
||||||
* `/user/:username`. If you are using a URL with a port number (e.g.
|
|
||||||
* `http://example.com:8080/api`), it will be respected.
|
|
||||||
*
|
|
||||||
* If you are using a url with a suffix, just add the suffix, like this:
|
|
||||||
* `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
|
|
||||||
* or even `$resource('http://example.com/resource/:resource_id.:format')`
|
|
||||||
* If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
|
|
||||||
* collapsed down to a single `.`. If you need this sequence to appear and not collapse then you
|
|
||||||
* can escape it with `/\.`.
|
|
||||||
*
|
|
||||||
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
|
|
||||||
* `actions` methods. If any of the parameter value is a function, it will be executed every time
|
|
||||||
* when a param value needs to be obtained for a request (unless the param was overridden).
|
|
||||||
*
|
|
||||||
* Each key value in the parameter object is first bound to url template if present and then any
|
|
||||||
* excess keys are appended to the url search query after the `?`.
|
|
||||||
*
|
|
||||||
* Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
|
|
||||||
* URL `/path/greet?salutation=Hello`.
|
|
||||||
*
|
|
||||||
* If the parameter value is prefixed with `@` then the value for that parameter will be extracted
|
|
||||||
* from the corresponding property on the `data` object (provided when calling an action method). For
|
|
||||||
* example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of `someParam`
|
|
||||||
* will be `data.someProp`.
|
|
||||||
*
|
|
||||||
* @param {Object.<Object>=} actions Hash with declaration of custom action that should extend
|
|
||||||
* the default set of resource actions. The declaration should be created in the format of {@link
|
|
||||||
* ng.$http#usage_parameters $http.config}:
|
|
||||||
*
|
|
||||||
* {action1: {method:?, params:?, isArray:?, headers:?, ...},
|
|
||||||
* action2: {method:?, params:?, isArray:?, headers:?, ...},
|
|
||||||
* ...}
|
|
||||||
*
|
|
||||||
* Where:
|
|
||||||
*
|
|
||||||
* - **`action`** – {string} – The name of action. This name becomes the name of the method on
|
|
||||||
* your resource object.
|
|
||||||
* - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
|
|
||||||
* `DELETE`, `JSONP`, etc).
|
|
||||||
* - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
|
|
||||||
* the parameter value is a function, it will be executed every time when a param value needs to
|
|
||||||
* be obtained for a request (unless the param was overridden).
|
|
||||||
* - **`url`** – {string} – action specific `url` override. The url templating is supported just
|
|
||||||
* like for the resource-level urls.
|
|
||||||
* - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
|
|
||||||
* see `returns` section.
|
|
||||||
* - **`transformRequest`** –
|
|
||||||
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
|
|
||||||
* transform function or an array of such functions. The transform function takes the http
|
|
||||||
* request body and headers and returns its transformed (typically serialized) version.
|
|
||||||
* By default, transformRequest will contain one function that checks if the request data is
|
|
||||||
* an object and serializes to using `angular.toJson`. To prevent this behavior, set
|
|
||||||
* `transformRequest` to an empty array: `transformRequest: []`
|
|
||||||
* - **`transformResponse`** –
|
|
||||||
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
|
|
||||||
* transform function or an array of such functions. The transform function takes the http
|
|
||||||
* response body and headers and returns its transformed (typically deserialized) version.
|
|
||||||
* By default, transformResponse will contain one function that checks if the response looks like
|
|
||||||
* a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set
|
|
||||||
* `transformResponse` to an empty array: `transformResponse: []`
|
|
||||||
* - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
|
|
||||||
* GET request, otherwise if a cache instance built with
|
|
||||||
* {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
|
|
||||||
* caching.
|
|
||||||
* - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
|
|
||||||
* should abort the request when resolved.
|
|
||||||
* - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
|
|
||||||
* XHR object. See
|
|
||||||
* [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
|
|
||||||
* for more information.
|
|
||||||
* - **`responseType`** - `{string}` - see
|
|
||||||
* [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
|
|
||||||
* - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
|
|
||||||
* `response` and `responseError`. Both `response` and `responseError` interceptors get called
|
|
||||||
* with `http response` object. See {@link ng.$http $http interceptors}.
|
|
||||||
*
|
|
||||||
* @returns {Object} A resource "class" object with methods for the default set of resource actions
|
|
||||||
* optionally extended with custom `actions`. The default set contains these actions:
|
|
||||||
* ```js
|
|
||||||
* { 'get': {method:'GET'},
|
|
||||||
* 'save': {method:'POST'},
|
|
||||||
* 'query': {method:'GET', isArray:true},
|
|
||||||
* 'remove': {method:'DELETE'},
|
|
||||||
* 'delete': {method:'DELETE'} };
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Calling these methods invoke an {@link ng.$http} with the specified http method,
|
|
||||||
* destination and parameters. When the data is returned from the server then the object is an
|
|
||||||
* instance of the resource class. The actions `save`, `remove` and `delete` are available on it
|
|
||||||
* as methods with the `$` prefix. This allows you to easily perform CRUD operations (create,
|
|
||||||
* read, update, delete) on server-side data like this:
|
|
||||||
* ```js
|
|
||||||
* var User = $resource('/user/:userId', {userId:'@id'});
|
|
||||||
* var user = User.get({userId:123}, function() {
|
|
||||||
* user.abc = true;
|
|
||||||
* user.$save();
|
|
||||||
* });
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* It is important to realize that invoking a $resource object method immediately returns an
|
|
||||||
* empty reference (object or array depending on `isArray`). Once the data is returned from the
|
|
||||||
* server the existing reference is populated with the actual data. This is a useful trick since
|
|
||||||
* usually the resource is assigned to a model which is then rendered by the view. Having an empty
|
|
||||||
* object results in no rendering, once the data arrives from the server then the object is
|
|
||||||
* populated with the data and the view automatically re-renders itself showing the new data. This
|
|
||||||
* means that in most cases one never has to write a callback function for the action methods.
|
|
||||||
*
|
|
||||||
* The action methods on the class object or instance object can be invoked with the following
|
|
||||||
* parameters:
|
|
||||||
*
|
|
||||||
* - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])`
|
|
||||||
* - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])`
|
|
||||||
* - non-GET instance actions: `instance.$action([parameters], [success], [error])`
|
|
||||||
*
|
|
||||||
* Success callback is called with (value, responseHeaders) arguments. Error callback is called
|
|
||||||
* with (httpResponse) argument.
|
|
||||||
*
|
|
||||||
* Class actions return empty instance (with additional properties below).
|
|
||||||
* Instance actions return promise of the action.
|
|
||||||
*
|
|
||||||
* The Resource instances and collection have these additional properties:
|
|
||||||
*
|
|
||||||
* - `$promise`: the {@link ng.$q promise} of the original server interaction that created this
|
|
||||||
* instance or collection.
|
|
||||||
*
|
|
||||||
* On success, the promise is resolved with the same resource instance or collection object,
|
|
||||||
* updated with data from server. This makes it easy to use in
|
|
||||||
* {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
|
|
||||||
* rendering until the resource(s) are loaded.
|
|
||||||
*
|
|
||||||
* On failure, the promise is resolved with the {@link ng.$http http response} object, without
|
|
||||||
* the `resource` property.
|
|
||||||
*
|
|
||||||
* If an interceptor object was provided, the promise will instead be resolved with the value
|
|
||||||
* returned by the interceptor.
|
|
||||||
*
|
|
||||||
* - `$resolved`: `true` after first server interaction is completed (either with success or
|
|
||||||
* rejection), `false` before that. Knowing if the Resource has been resolved is useful in
|
|
||||||
* data-binding.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* # Credit card resource
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
// Define CreditCard class
|
|
||||||
var CreditCard = $resource('/user/:userId/card/:cardId',
|
|
||||||
{userId:123, cardId:'@id'}, {
|
|
||||||
charge: {method:'POST', params:{charge:true}}
|
|
||||||
});
|
|
||||||
|
|
||||||
// We can retrieve a collection from the server
|
|
||||||
var cards = CreditCard.query(function() {
|
|
||||||
// GET: /user/123/card
|
|
||||||
// server returns: [ {id:456, number:'1234', name:'Smith'} ];
|
|
||||||
|
|
||||||
var card = cards[0];
|
|
||||||
// each item is an instance of CreditCard
|
|
||||||
expect(card instanceof CreditCard).toEqual(true);
|
|
||||||
card.name = "J. Smith";
|
|
||||||
// non GET methods are mapped onto the instances
|
|
||||||
card.$save();
|
|
||||||
// POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
|
|
||||||
// server returns: {id:456, number:'1234', name: 'J. Smith'};
|
|
||||||
|
|
||||||
// our custom method is mapped as well.
|
|
||||||
card.$charge({amount:9.99});
|
|
||||||
// POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
|
|
||||||
});
|
|
||||||
|
|
||||||
// we can create an instance as well
|
|
||||||
var newCard = new CreditCard({number:'0123'});
|
|
||||||
newCard.name = "Mike Smith";
|
|
||||||
newCard.$save();
|
|
||||||
// POST: /user/123/card {number:'0123', name:'Mike Smith'}
|
|
||||||
// server returns: {id:789, number:'0123', name: 'Mike Smith'};
|
|
||||||
expect(newCard.id).toEqual(789);
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* The object returned from this function execution is a resource "class" which has "static" method
|
|
||||||
* for each action in the definition.
|
|
||||||
*
|
|
||||||
* Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and
|
|
||||||
* `headers`.
|
|
||||||
* When the data is returned from the server then the object is an instance of the resource type and
|
|
||||||
* all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
|
|
||||||
* operations (create, read, update, delete) on server-side data.
|
|
||||||
|
|
||||||
```js
|
|
||||||
var User = $resource('/user/:userId', {userId:'@id'});
|
|
||||||
User.get({userId:123}, function(user) {
|
|
||||||
user.abc = true;
|
|
||||||
user.$save();
|
|
||||||
});
|
|
||||||
```
|
|
||||||
*
|
|
||||||
* It's worth noting that the success callback for `get`, `query` and other methods gets passed
|
|
||||||
* in the response that came from the server as well as $http header getter function, so one
|
|
||||||
* could rewrite the above example and get access to http headers as:
|
|
||||||
*
|
|
||||||
```js
|
|
||||||
var User = $resource('/user/:userId', {userId:'@id'});
|
|
||||||
User.get({userId:123}, function(u, getResponseHeaders){
|
|
||||||
u.abc = true;
|
|
||||||
u.$save(function(u, putResponseHeaders) {
|
|
||||||
//u => saved user object
|
|
||||||
//putResponseHeaders => $http header getter
|
|
||||||
});
|
|
||||||
});
|
|
||||||
```
|
|
||||||
*
|
|
||||||
* You can also access the raw `$http` promise via the `$promise` property on the object returned
|
|
||||||
*
|
|
||||||
```
|
|
||||||
var User = $resource('/user/:userId', {userId:'@id'});
|
|
||||||
User.get({userId:123})
|
|
||||||
.$promise.then(function(user) {
|
|
||||||
$scope.user = user;
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
* # Creating a custom 'PUT' request
|
|
||||||
* In this example we create a custom method on our resource to make a PUT request
|
|
||||||
* ```js
|
|
||||||
* var app = angular.module('app', ['ngResource', 'ngRoute']);
|
|
||||||
*
|
|
||||||
* // Some APIs expect a PUT request in the format URL/object/ID
|
|
||||||
* // Here we are creating an 'update' method
|
|
||||||
* app.factory('Notes', ['$resource', function($resource) {
|
|
||||||
* return $resource('/notes/:id', null,
|
|
||||||
* {
|
|
||||||
* 'update': { method:'PUT' }
|
|
||||||
* });
|
|
||||||
* }]);
|
|
||||||
*
|
|
||||||
* // In our controller we get the ID from the URL using ngRoute and $routeParams
|
|
||||||
* // We pass in $routeParams and our Notes factory along with $scope
|
|
||||||
* app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
|
|
||||||
function($scope, $routeParams, Notes) {
|
|
||||||
* // First get a note object from the factory
|
|
||||||
* var note = Notes.get({ id:$routeParams.id });
|
|
||||||
* $id = note.id;
|
|
||||||
*
|
|
||||||
* // Now call update passing in the ID first then the object you are updating
|
|
||||||
* Notes.update({ id:$id }, note);
|
|
||||||
*
|
|
||||||
* // This will PUT /notes/ID with the note object in the request payload
|
|
||||||
* }]);
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
angular.module('ngResource', ['ng']).
|
|
||||||
factory('$resource', ['$http', '$q', function($http, $q) {
|
|
||||||
|
|
||||||
var DEFAULT_ACTIONS = {
|
|
||||||
'get': {method:'GET'},
|
|
||||||
'save': {method:'POST'},
|
|
||||||
'query': {method:'GET', isArray:true},
|
|
||||||
'remove': {method:'DELETE'},
|
|
||||||
'delete': {method:'DELETE'}
|
|
||||||
};
|
|
||||||
var noop = angular.noop,
|
|
||||||
forEach = angular.forEach,
|
|
||||||
extend = angular.extend,
|
|
||||||
copy = angular.copy,
|
|
||||||
isFunction = angular.isFunction;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
|
|
||||||
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
|
|
||||||
* segments:
|
|
||||||
* segment = *pchar
|
|
||||||
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
||||||
* pct-encoded = "%" HEXDIG HEXDIG
|
|
||||||
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
||||||
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
|
||||||
* / "*" / "+" / "," / ";" / "="
|
|
||||||
*/
|
|
||||||
function encodeUriSegment(val) {
|
|
||||||
return encodeUriQuery(val, true).
|
|
||||||
replace(/%26/gi, '&').
|
|
||||||
replace(/%3D/gi, '=').
|
|
||||||
replace(/%2B/gi, '+');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is intended for encoding *key* or *value* parts of query component. We need a
|
|
||||||
* custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
|
|
||||||
* have to be encoded per http://tools.ietf.org/html/rfc3986:
|
|
||||||
* query = *( pchar / "/" / "?" )
|
|
||||||
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
||||||
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
||||||
* pct-encoded = "%" HEXDIG HEXDIG
|
|
||||||
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
|
||||||
* / "*" / "+" / "," / ";" / "="
|
|
||||||
*/
|
|
||||||
function encodeUriQuery(val, pctEncodeSpaces) {
|
|
||||||
return encodeURIComponent(val).
|
|
||||||
replace(/%40/gi, '@').
|
|
||||||
replace(/%3A/gi, ':').
|
|
||||||
replace(/%24/g, '$').
|
|
||||||
replace(/%2C/gi, ',').
|
|
||||||
replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
|
|
||||||
}
|
|
||||||
|
|
||||||
function Route(template, defaults) {
|
|
||||||
this.template = template;
|
|
||||||
this.defaults = defaults || {};
|
|
||||||
this.urlParams = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
Route.prototype = {
|
|
||||||
setUrlParams: function(config, params, actionUrl) {
|
|
||||||
var self = this,
|
|
||||||
url = actionUrl || self.template,
|
|
||||||
val,
|
|
||||||
encodedVal;
|
|
||||||
|
|
||||||
var urlParams = self.urlParams = {};
|
|
||||||
forEach(url.split(/\W/), function(param){
|
|
||||||
if (param === 'hasOwnProperty') {
|
|
||||||
throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
|
|
||||||
}
|
|
||||||
if (!(new RegExp("^\\d+$").test(param)) && param &&
|
|
||||||
(new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
|
|
||||||
urlParams[param] = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
url = url.replace(/\\:/g, ':');
|
|
||||||
|
|
||||||
params = params || {};
|
|
||||||
forEach(self.urlParams, function(_, urlParam){
|
|
||||||
val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
|
|
||||||
if (angular.isDefined(val) && val !== null) {
|
|
||||||
encodedVal = encodeUriSegment(val);
|
|
||||||
url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
|
|
||||||
return encodedVal + p1;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
|
|
||||||
leadingSlashes, tail) {
|
|
||||||
if (tail.charAt(0) == '/') {
|
|
||||||
return tail;
|
|
||||||
} else {
|
|
||||||
return leadingSlashes + tail;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// strip trailing slashes and set the url
|
|
||||||
url = url.replace(/\/+$/, '') || '/';
|
|
||||||
// then replace collapse `/.` if found in the last URL path segment before the query
|
|
||||||
// E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
|
|
||||||
url = url.replace(/\/\.(?=\w+($|\?))/, '.');
|
|
||||||
// replace escaped `/\.` with `/.`
|
|
||||||
config.url = url.replace(/\/\\\./, '/.');
|
|
||||||
|
|
||||||
|
|
||||||
// set params - delegate param encoding to $http
|
|
||||||
forEach(params, function(value, key){
|
|
||||||
if (!self.urlParams[key]) {
|
|
||||||
config.params = config.params || {};
|
|
||||||
config.params[key] = value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
function resourceFactory(url, paramDefaults, actions) {
|
|
||||||
var route = new Route(url);
|
|
||||||
|
|
||||||
actions = extend({}, DEFAULT_ACTIONS, actions);
|
|
||||||
|
|
||||||
function extractParams(data, actionParams){
|
|
||||||
var ids = {};
|
|
||||||
actionParams = extend({}, paramDefaults, actionParams);
|
|
||||||
forEach(actionParams, function(value, key){
|
|
||||||
if (isFunction(value)) { value = value(); }
|
|
||||||
ids[key] = value && value.charAt && value.charAt(0) == '@' ?
|
|
||||||
lookupDottedPath(data, value.substr(1)) : value;
|
|
||||||
});
|
|
||||||
return ids;
|
|
||||||
}
|
|
||||||
|
|
||||||
function defaultResponseInterceptor(response) {
|
|
||||||
return response.resource;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Resource(value){
|
|
||||||
shallowClearAndCopy(value || {}, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
forEach(actions, function(action, name) {
|
|
||||||
var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
|
|
||||||
|
|
||||||
Resource[name] = function(a1, a2, a3, a4) {
|
|
||||||
var params = {}, data, success, error;
|
|
||||||
|
|
||||||
/* jshint -W086 */ /* (purposefully fall through case statements) */
|
|
||||||
switch(arguments.length) {
|
|
||||||
case 4:
|
|
||||||
error = a4;
|
|
||||||
success = a3;
|
|
||||||
//fallthrough
|
|
||||||
case 3:
|
|
||||||
case 2:
|
|
||||||
if (isFunction(a2)) {
|
|
||||||
if (isFunction(a1)) {
|
|
||||||
success = a1;
|
|
||||||
error = a2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
success = a2;
|
|
||||||
error = a3;
|
|
||||||
//fallthrough
|
|
||||||
} else {
|
|
||||||
params = a1;
|
|
||||||
data = a2;
|
|
||||||
success = a3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
if (isFunction(a1)) success = a1;
|
|
||||||
else if (hasBody) data = a1;
|
|
||||||
else params = a1;
|
|
||||||
break;
|
|
||||||
case 0: break;
|
|
||||||
default:
|
|
||||||
throw $resourceMinErr('badargs',
|
|
||||||
"Expected up to 4 arguments [params, data, success, error], got {0} arguments",
|
|
||||||
arguments.length);
|
|
||||||
}
|
|
||||||
/* jshint +W086 */ /* (purposefully fall through case statements) */
|
|
||||||
|
|
||||||
var isInstanceCall = this instanceof Resource;
|
|
||||||
var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
|
|
||||||
var httpConfig = {};
|
|
||||||
var responseInterceptor = action.interceptor && action.interceptor.response ||
|
|
||||||
defaultResponseInterceptor;
|
|
||||||
var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
|
|
||||||
undefined;
|
|
||||||
|
|
||||||
forEach(action, function(value, key) {
|
|
||||||
if (key != 'params' && key != 'isArray' && key != 'interceptor') {
|
|
||||||
httpConfig[key] = copy(value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (hasBody) httpConfig.data = data;
|
|
||||||
route.setUrlParams(httpConfig,
|
|
||||||
extend({}, extractParams(data, action.params || {}), params),
|
|
||||||
action.url);
|
|
||||||
|
|
||||||
var promise = $http(httpConfig).then(function (response) {
|
|
||||||
var data = response.data,
|
|
||||||
promise = value.$promise;
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
// Need to convert action.isArray to boolean in case it is undefined
|
|
||||||
// jshint -W018
|
|
||||||
if (angular.isArray(data) !== (!!action.isArray)) {
|
|
||||||
throw $resourceMinErr('badcfg',
|
|
||||||
'Error in resource configuration. Expected ' +
|
|
||||||
'response to contain an {0} but got an {1}',
|
|
||||||
action.isArray ? 'array' : 'object',
|
|
||||||
angular.isArray(data) ? 'array' : 'object');
|
|
||||||
}
|
|
||||||
// jshint +W018
|
|
||||||
if (action.isArray) {
|
|
||||||
value.length = 0;
|
|
||||||
forEach(data, function (item) {
|
|
||||||
if (typeof item === "object") {
|
|
||||||
value.push(new Resource(item));
|
|
||||||
} else {
|
|
||||||
// Valid JSON values may be string literals, and these should not be converted
|
|
||||||
// into objects. These items will not have access to the Resource prototype
|
|
||||||
// methods, but unfortunately there
|
|
||||||
value.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
shallowClearAndCopy(data, value);
|
|
||||||
value.$promise = promise;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
value.$resolved = true;
|
|
||||||
|
|
||||||
response.resource = value;
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}, function(response) {
|
|
||||||
value.$resolved = true;
|
|
||||||
|
|
||||||
(error||noop)(response);
|
|
||||||
|
|
||||||
return $q.reject(response);
|
|
||||||
});
|
|
||||||
|
|
||||||
promise = promise.then(
|
|
||||||
function(response) {
|
|
||||||
var value = responseInterceptor(response);
|
|
||||||
(success||noop)(value, response.headers);
|
|
||||||
return value;
|
|
||||||
},
|
|
||||||
responseErrorInterceptor);
|
|
||||||
|
|
||||||
if (!isInstanceCall) {
|
|
||||||
// we are creating instance / collection
|
|
||||||
// - set the initial promise
|
|
||||||
// - return the instance / collection
|
|
||||||
value.$promise = promise;
|
|
||||||
value.$resolved = false;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// instance call
|
|
||||||
return promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Resource.prototype['$' + name] = function(params, success, error) {
|
|
||||||
if (isFunction(params)) {
|
|
||||||
error = success; success = params; params = {};
|
|
||||||
}
|
|
||||||
var result = Resource[name].call(this, params, this, success, error);
|
|
||||||
return result.$promise || result;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
Resource.bind = function(additionalParamDefaults){
|
|
||||||
return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
|
|
||||||
};
|
|
||||||
|
|
||||||
return Resource;
|
|
||||||
}
|
|
||||||
|
|
||||||
return resourceFactory;
|
|
||||||
}]);
|
|
||||||
|
|
||||||
|
|
||||||
})(window, window.angular);
|
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
AngularJS v1.2.28
|
|
||||||
(c) 2010-2014 Google, Inc. http://angularjs.org
|
|
||||||
License: MIT
|
|
||||||
*/
|
|
||||||
(function(H,a,A){'use strict';function D(p,g){g=g||{};a.forEach(g,function(a,c){delete g[c]});for(var c in p)!p.hasOwnProperty(c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(g[c]=p[c]);return g}var v=a.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;a.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(p,g){function c(a,c){this.template=a;this.defaults=c||{};this.urlParams={}}function t(n,w,l){function r(h,d){var e={};d=x({},w,d);s(d,function(b,d){u(b)&&(b=b());var k;if(b&&
|
|
||||||
b.charAt&&"@"==b.charAt(0)){k=h;var a=b.substr(1);if(null==a||""===a||"hasOwnProperty"===a||!C.test("."+a))throw v("badmember",a);for(var a=a.split("."),f=0,c=a.length;f<c&&k!==A;f++){var g=a[f];k=null!==k?k[g]:A}}else k=b;e[d]=k});return e}function e(a){return a.resource}function f(a){D(a||{},this)}var F=new c(n);l=x({},B,l);s(l,function(h,d){var c=/^(POST|PUT|PATCH)$/i.test(h.method);f[d]=function(b,d,k,w){var q={},n,l,y;switch(arguments.length){case 4:y=w,l=k;case 3:case 2:if(u(d)){if(u(b)){l=
|
|
||||||
b;y=d;break}l=d;y=k}else{q=b;n=d;l=k;break}case 1:u(b)?l=b:c?n=b:q=b;break;case 0:break;default:throw v("badargs",arguments.length);}var t=this instanceof f,m=t?n:h.isArray?[]:new f(n),z={},B=h.interceptor&&h.interceptor.response||e,C=h.interceptor&&h.interceptor.responseError||A;s(h,function(a,b){"params"!=b&&("isArray"!=b&&"interceptor"!=b)&&(z[b]=G(a))});c&&(z.data=n);F.setUrlParams(z,x({},r(n,h.params||{}),q),h.url);q=p(z).then(function(b){var d=b.data,k=m.$promise;if(d){if(a.isArray(d)!==!!h.isArray)throw v("badcfg",
|
|
||||||
h.isArray?"array":"object",a.isArray(d)?"array":"object");h.isArray?(m.length=0,s(d,function(b){"object"===typeof b?m.push(new f(b)):m.push(b)})):(D(d,m),m.$promise=k)}m.$resolved=!0;b.resource=m;return b},function(b){m.$resolved=!0;(y||E)(b);return g.reject(b)});q=q.then(function(b){var a=B(b);(l||E)(a,b.headers);return a},C);return t?q:(m.$promise=q,m.$resolved=!1,m)};f.prototype["$"+d]=function(b,a,k){u(b)&&(k=a,a=b,b={});b=f[d].call(this,b,this,a,k);return b.$promise||b}});f.bind=function(a){return t(n,
|
|
||||||
x({},w,a),l)};return f}var B={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},E=a.noop,s=a.forEach,x=a.extend,G=a.copy,u=a.isFunction;c.prototype={setUrlParams:function(c,g,l){var r=this,e=l||r.template,f,p,h=r.urlParams={};s(e.split(/\W/),function(a){if("hasOwnProperty"===a)throw v("badname");!/^\d+$/.test(a)&&(a&&RegExp("(^|[^\\\\]):"+a+"(\\W|$)").test(e))&&(h[a]=!0)});e=e.replace(/\\:/g,":");g=g||{};s(r.urlParams,function(d,
|
|
||||||
c){f=g.hasOwnProperty(c)?g[c]:r.defaults[c];a.isDefined(f)&&null!==f?(p=encodeURIComponent(f).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),e=e.replace(RegExp(":"+c+"(\\W|$)","g"),function(a,c){return p+c})):e=e.replace(RegExp("(/?):"+c+"(\\W|$)","g"),function(a,c,d){return"/"==d.charAt(0)?d:c+d})});e=e.replace(/\/+$/,"")||"/";e=e.replace(/\/\.(?=\w+($|\?))/,".");c.url=e.replace(/\/\\\./,
|
|
||||||
"/.");s(g,function(a,e){r.urlParams[e]||(c.params=c.params||{},c.params[e]=a)})}};return t}])})(window,window.angular);
|
|
||||||
//# sourceMappingURL=angular-resource.min.js.map
|
|
File diff suppressed because one or more lines are too long
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-resource",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"main": "./angular-resource.js",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.2.28"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-resource",
|
|
||||||
"version": "1.2.28",
|
|
||||||
"description": "AngularJS module for interacting with RESTful server-side data sources",
|
|
||||||
"main": "angular-resource.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/angular/angular.js.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"framework",
|
|
||||||
"browser",
|
|
||||||
"rest",
|
|
||||||
"client-side"
|
|
||||||
],
|
|
||||||
"author": "Angular Core Team <angular-core+npm@google.com>",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/angular/angular.js/issues"
|
|
||||||
},
|
|
||||||
"homepage": "http://angularjs.org"
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-strap",
|
|
||||||
"description": "AngularStrap - AngularJS directives for Bootstrap",
|
|
||||||
"version": "2.2.1",
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"bootstrap"
|
|
||||||
],
|
|
||||||
"homepage": "http://mgcrea.github.io/angular-strap",
|
|
||||||
"bugs": "https://github.com/mgcrea/angular-strap/issues",
|
|
||||||
"author": {
|
|
||||||
"name": "Olivier Louvignes",
|
|
||||||
"email": "olivier@mg-crea.com",
|
|
||||||
"url": "https://github.com/mgcrea"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/mgcrea/angular-strap.git"
|
|
||||||
},
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/mgcrea/angular-strap/blob/master/LICENSE.md"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"main": [
|
|
||||||
"dist/angular-strap.js",
|
|
||||||
"dist/angular-strap.tpl.js"
|
|
||||||
],
|
|
||||||
"ignore": [
|
|
||||||
"docs",
|
|
||||||
"test",
|
|
||||||
"CONTRIBUTING.md"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "^1.2.21"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"angular-animate": "^1.2.21",
|
|
||||||
"angular-i18n": "^1.2.21",
|
|
||||||
"angular-mocks": "^1.2.21",
|
|
||||||
"angular-motion": "^0.3.3",
|
|
||||||
"angular-route": "^1.2.21",
|
|
||||||
"angular-sanitize": "^1.2.21",
|
|
||||||
"angular-scenario": "^1.2.21",
|
|
||||||
"bootstrap": "^3.2.0",
|
|
||||||
"bootstrap-additions": "^0.2.3",
|
|
||||||
"fastclick": "^1.0.3",
|
|
||||||
"font-awesome": "^4.1.0",
|
|
||||||
"highlightjs": "^8.0.0",
|
|
||||||
"jquery": "^2.1.1"
|
|
||||||
},
|
|
||||||
"_release": "2.2.1",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v2.2.1",
|
|
||||||
"commit": "206fd5b73dc012b8886fc4a2b8e4a62389d3af45"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/mgcrea/angular-strap.git",
|
|
||||||
"_target": "~2.2.1",
|
|
||||||
"_originalSource": "angular-strap",
|
|
||||||
"_direct": true
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"directory": "bower_components"
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
# EditorConfig helps developers define and maintain consistent
|
|
||||||
# coding styles between different editors and IDEs
|
|
||||||
# editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
|
|
||||||
[*]
|
|
||||||
|
|
||||||
# Change these settings to your own preference
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
# We recommend you to keep these unchanged
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
1
public/lib/angular-strap/.gitattributes
vendored
1
public/lib/angular-strap/.gitattributes
vendored
|
@ -1 +0,0 @@
|
||||||
* text=auto
|
|
14
public/lib/angular-strap/.gitignore
vendored
14
public/lib/angular-strap/.gitignore
vendored
|
@ -1,14 +0,0 @@
|
||||||
.dev/
|
|
||||||
.tmp/
|
|
||||||
.DS_Store
|
|
||||||
.idea
|
|
||||||
*.sublime-project
|
|
||||||
*.sublime-workspace
|
|
||||||
bower_components/
|
|
||||||
node_modules/
|
|
||||||
/pages/
|
|
||||||
/docs/1.0
|
|
||||||
/test/coverage/
|
|
||||||
!.gitignore
|
|
||||||
!dist/
|
|
||||||
*.nupkg
|
|
|
@ -1,28 +0,0 @@
|
||||||
{
|
|
||||||
"node": true,
|
|
||||||
"browser": true,
|
|
||||||
"devel": false,
|
|
||||||
"esnext": true,
|
|
||||||
"bitwise": true,
|
|
||||||
"camelcase": true,
|
|
||||||
"curly": false,
|
|
||||||
"eqeqeq": true,
|
|
||||||
"immed": true,
|
|
||||||
"indent": 2,
|
|
||||||
"latedef": false,
|
|
||||||
"newcap": true,
|
|
||||||
"noarg": true,
|
|
||||||
"quotmark": "single",
|
|
||||||
"regexp": true,
|
|
||||||
"undef": true,
|
|
||||||
"unused": false,
|
|
||||||
"strict": true,
|
|
||||||
"trailing": true,
|
|
||||||
"smarttabs": true,
|
|
||||||
"boss": false,
|
|
||||||
"eqnull": false,
|
|
||||||
"expr": true,
|
|
||||||
"globals": {
|
|
||||||
"angular": false
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
language: node_js
|
|
||||||
sudo: false
|
|
||||||
node_js:
|
|
||||||
- "0.10"
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- SAUCE_USERNAME=mgcrea
|
|
||||||
- SAUCE_ACCESS_KEY=ad4bb656-dfad-4a10-8c10-0a0d8b5a1ead
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- export DISPLAY=:99.0
|
|
||||||
- export PHANTOMJS_BIN=/usr/local/phantomjs/bin/phantomjs
|
|
||||||
- export CHROME_BIN=chromium-browser
|
|
||||||
- sh -e /etc/init.d/xvfb start
|
|
||||||
- sleep 3 # give xvfb some time to start
|
|
||||||
- npm install -gq bower codeclimate-test-reporter # coveralls
|
|
||||||
- bower install --dev --config.interactive=0
|
|
||||||
- gulp --version
|
|
||||||
- bower --version
|
|
||||||
- date --rfc-2822
|
|
||||||
|
|
||||||
script:
|
|
||||||
- gulp karma:travis~1.2.0
|
|
||||||
- gulp jshint karma:travis
|
|
||||||
|
|
||||||
after_script:
|
|
||||||
- cat test/coverage/*/lcov.info | codeclimate
|
|
||||||
|
|
||||||
addons:
|
|
||||||
code_climate:
|
|
||||||
repo_token: b5ed978a0e88f95b003a668583ae70815e18cd71019d526023b5e9c7703ec076
|
|
|
@ -1,21 +0,0 @@
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2012-2014 Olivier Louvignes http://olouv.com
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
|
@ -1,112 +0,0 @@
|
||||||
# [AngularStrap](http://mgcrea.github.io/angular-strap)
|
|
||||||
|
|
||||||
[![Build Status](http://img.shields.io/travis/mgcrea/angular-strap/master.svg?style=flat)](http://travis-ci.org/mgcrea/angular-strap) [![devDependency Status](http://img.shields.io/david/dev/mgcrea/angular-strap.svg?style=flat)](https://david-dm.org/mgcrea/angular-strap#info=devDependencies) [![Coverage Status](http://img.shields.io/codeclimate/coverage/github/mgcrea/angular-strap.svg?style=flat)](https://codeclimate.com/github/mgcrea/angular-strap) [![Climate Status](https://img.shields.io/codeclimate/github/mgcrea/angular-strap.svg?style=flat)](https://codeclimate.com/github/mgcrea/angular-strap) [![Tips](http://img.shields.io/gratipay/mgcrea.svg?style=flat)](https://gratipay.com/mgcrea)
|
|
||||||
|
|
||||||
[![Banner](http://mgcrea.github.io/angular-strap/images/snippet.png)](http://mgcrea.github.io/angular-strap)
|
|
||||||
|
|
||||||
AngularStrap is a set of native directives that enables seamless integration of [Bootstrap 3.0+](https://github.com/twbs/bootstrap) into your [AngularJS 1.2+](https://github.com/angular/angular.js) app.
|
|
||||||
|
|
||||||
- With no external dependency except the [Bootstrap CSS Styles](https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css), AngularStrap is lighter and faster than ever as it does leverage the power of ngAnimate from AngularJS 1.2+!
|
|
||||||
|
|
||||||
- If you don't want to use `ngAnimate`, you will have to include a tiny [ngAnimate mock](https://github.com/mgcrea/angular-strap/wiki/ngAnimate-mock).
|
|
||||||
|
|
||||||
## Documentation and examples
|
|
||||||
|
|
||||||
+ Check the [documentation](http://mgcrea.github.io/angular-strap) and [changelog](https://github.com/mgcrea/angular-strap/releases).
|
|
||||||
|
|
||||||
## Communication
|
|
||||||
|
|
||||||
- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/angular-strap). (Tag 'angular-strap')
|
|
||||||
- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/angular-strap).
|
|
||||||
- If you **found a bug**, open an issue.
|
|
||||||
- If you **have a feature request**, open an issue.
|
|
||||||
- If you **want to contribute**, submit a pull request.
|
|
||||||
|
|
||||||
## Quick start
|
|
||||||
|
|
||||||
+ Install AngularStrap with [Bower](https://github.com/bower/bower).
|
|
||||||
|
|
||||||
>
|
|
||||||
```bash
|
|
||||||
$ bower install angular-strap --save
|
|
||||||
```
|
|
||||||
|
|
||||||
+ Include the required libraries is your `index.html`:
|
|
||||||
|
|
||||||
>
|
|
||||||
``` html
|
|
||||||
<script src="bower_components/angular/angular.js"></script>
|
|
||||||
<script src="bower_components/angular-animate/angular-animate.js"></script>
|
|
||||||
<script src="bower_components/angular-strap/dist/angular-strap.min.js"></script>
|
|
||||||
<script src="bower_components/angular-strap/dist/angular-strap.tpl.min.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
+ Inject the `mgcrea.ngStrap` module into your app:
|
|
||||||
|
|
||||||
>
|
|
||||||
``` js
|
|
||||||
angular.module('myApp', ['ngAnimate', 'mgcrea.ngStrap']);
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Developers
|
|
||||||
|
|
||||||
Clone the repo, `git clone git://github.com/mgcrea/angular-strap.git`, [download the latest release](https://github.com/mgcrea/angular-strap/zipball/master) or install with bower `bower install angular-strap --save`.
|
|
||||||
|
|
||||||
AngularStrap is tested with `karma` against the latest stable release of AngularJS.
|
|
||||||
|
|
||||||
>
|
|
||||||
$ npm install
|
|
||||||
$ bower install
|
|
||||||
$ gulp test
|
|
||||||
|
|
||||||
You can build the latest version using `gulp`.
|
|
||||||
|
|
||||||
>
|
|
||||||
$ gulp build
|
|
||||||
|
|
||||||
You can quickly hack around (the docs) with:
|
|
||||||
|
|
||||||
>
|
|
||||||
$ gulp serve
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Please submit all pull requests the against master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests. Thanks!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Authors
|
|
||||||
|
|
||||||
**Olivier Louvignes**
|
|
||||||
|
|
||||||
+ http://olouv.com
|
|
||||||
+ http://github.com/mgcrea
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Copyright and license
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2012 – 2014 Olivier Louvignes
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
|
|
||||||
<metadata>
|
|
||||||
<id>angular-strap</id>
|
|
||||||
<version>2.1.6</version>
|
|
||||||
<authors>Olivier Louvignes and contributors</authors>
|
|
||||||
<owners>mgcrea</owners>
|
|
||||||
<licenseUrl>https://raw.github.com/mgcrea/angular-strap/master/LICENSE.md</licenseUrl>
|
|
||||||
<projectUrl>https://github.com/mgcrea/angular-strap</projectUrl>
|
|
||||||
<iconUrl>https://raw.githubusercontent.com/mgcrea/angular-strap/gh-pages/images/snippet-logo.png</iconUrl>
|
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
|
||||||
<description>AngularStrap - AngularJS directives for Bootstrap</description>
|
|
||||||
<copyright>Copyright Olivier Louvignes 2014</copyright>
|
|
||||||
<tags>angular bootstrap</tags>
|
|
||||||
<dependencies>
|
|
||||||
<dependency id="bootstrap" version="[3.0.0, 4.0.0)" />
|
|
||||||
<dependency id="AngularJS.Core" version="[1.2.0, 2.0.0)" />
|
|
||||||
</dependencies>
|
|
||||||
</metadata>
|
|
||||||
<files>
|
|
||||||
<file src="dist\*.*" target="content\Scripts" />
|
|
||||||
</files>
|
|
||||||
</package>
|
|
|
@ -1,53 +0,0 @@
|
||||||
{
|
|
||||||
"name": "angular-strap",
|
|
||||||
"description": "AngularStrap - AngularJS directives for Bootstrap",
|
|
||||||
"version": "2.2.1",
|
|
||||||
"keywords": [
|
|
||||||
"angular",
|
|
||||||
"bootstrap"
|
|
||||||
],
|
|
||||||
"homepage": "http://mgcrea.github.io/angular-strap",
|
|
||||||
"bugs": "https://github.com/mgcrea/angular-strap/issues",
|
|
||||||
"author": {
|
|
||||||
"name": "Olivier Louvignes",
|
|
||||||
"email": "olivier@mg-crea.com",
|
|
||||||
"url": "https://github.com/mgcrea"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/mgcrea/angular-strap.git"
|
|
||||||
},
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/mgcrea/angular-strap/blob/master/LICENSE.md"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"main": [
|
|
||||||
"dist/angular-strap.js",
|
|
||||||
"dist/angular-strap.tpl.js"
|
|
||||||
],
|
|
||||||
"ignore": [
|
|
||||||
"docs",
|
|
||||||
"test",
|
|
||||||
"CONTRIBUTING.md"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "^1.2.21"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"angular-animate": "^1.2.21",
|
|
||||||
"angular-i18n": "^1.2.21",
|
|
||||||
"angular-mocks": "^1.2.21",
|
|
||||||
"angular-motion": "^0.3.3",
|
|
||||||
"angular-route": "^1.2.21",
|
|
||||||
"angular-sanitize": "^1.2.21",
|
|
||||||
"angular-scenario": "^1.2.21",
|
|
||||||
"bootstrap": "^3.2.0",
|
|
||||||
"bootstrap-additions": "^0.2.3",
|
|
||||||
"fastclick": "^1.0.3",
|
|
||||||
"font-awesome": "^4.1.0",
|
|
||||||
"highlightjs": "^8.0.0",
|
|
||||||
"jquery": "^2.1.1"
|
|
||||||
}
|
|
||||||
}
|
|
5315
public/lib/angular-strap/dist/angular-strap.js
vendored
5315
public/lib/angular-strap/dist/angular-strap.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -1,89 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
(function(window, document, undefined) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// Source: aside.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.aside').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('aside/aside.tpl.html', '<div class="aside" tabindex="-1" role="dialog"><div class="aside-dialog"><div class="aside-content"><div class="aside-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">×</button><h4 class="aside-title" ng-bind="title"></h4></div><div class="aside-body" ng-bind="content"></div><div class="aside-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: alert.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.alert').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('alert/alert.tpl.html', '<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">×</button> <strong ng-bind="title"></strong> <span ng-bind-html="content"></span></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: datepicker.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.datepicker').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('datepicker/datepicker.tpl.html', '<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px"><table style="table-layout: fixed; height: 100%; width: 100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)"><i class="{{$iconLeft}}"></i></button></th><th colspan="{{ rows[0].length - 2 }}"><button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()"><strong style="text-transform: capitalize" ng-bind="title"></strong></button></th><th><button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)"><i class="{{$iconRight}}"></i></button></th></tr><tr ng-show="showLabels" ng-bind-html="labels"></tr></thead><tbody><tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%"><td class="text-center" ng-repeat="(j, el) in row"><button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date)" ng-disabled="el.disabled"><span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span></button></td></tr></tbody></table></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: dropdown.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.dropdown').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('dropdown/dropdown.tpl.html', '<ul tabindex="-1" class="dropdown-menu" role="menu"><li role="presentation" ng-class="{divider: item.divider}" ng-repeat="item in content"><a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a> <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a></li></ul>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: modal.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.modal').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('modal/modal.tpl.html', '<div class="modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header" ng-show="title"><button type="button" class="close" aria-label="Close" ng-click="$hide()"><span aria-hidden="true">×</span></button><h4 class="modal-title" ng-bind="title"></h4></div><div class="modal-body" ng-bind="content"></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: popover.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.popover').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('popover/popover.tpl.html', '<div class="popover"><div class="arrow"></div><h3 class="popover-title" ng-bind="title" ng-show="title"></h3><div class="popover-content" ng-bind="content"></div></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: select.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.select').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('select/select.tpl.html', '<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select"><li ng-if="$showAllNoneButtons"><div class="btn-group" style="margin-bottom: 5px; margin-left: 5px"><button type="button" class="btn btn-default btn-xs" ng-click="$selectAll()">{{$allText}}</button> <button type="button" class="btn btn-default btn-xs" ng-click="$selectNone()">{{$noneText}}</button></div></li><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}"><a style="cursor: default" role="menuitem" tabindex="-1" ng-click="$select($index, $event)"><i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i> <span ng-bind="match.label"></span></a></li></ul>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: tab.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.tab').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('tab/tab.tpl.html', '<ul class="nav" ng-class="$navClass" role="tablist"><li role="presentation" ng-repeat="$pane in $panes track by $index" ng-class="[ $index == $panes.$active ? $activeClass : \'\', $pane.disabled ? \'disabled\' : \'\' ]"><a role="tab" data-toggle="tab" ng-click="!$pane.disabled && $setActive($index)" data-index="{{ $index }}" ng-bind-html="$pane.title" aria-controls="$pane.title"></a></li></ul><div ng-transclude class="tab-content"></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: timepicker.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.timepicker').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('timepicker/timepicker.tpl.html', '<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto"><table height="100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)"><i class="{{ $iconUp }}"></i></button></th><th> </th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)"><i class="{{ $iconUp }}"></i></button></th></tr></thead><tbody><tr ng-repeat="(i, row) in rows"><td class="text-center"><button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled"><span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled"><span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span></button></td><td ng-if="showAM"> </td><td ng-if="showAM"><button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button> <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button></td></tr></tbody><tfoot><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)"><i class="{{ $iconDown }}"></i></button></th><th> </th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)"><i class="{{ $iconDown }}"></i></button></th></tr></tfoot></table></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: typeahead.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.typeahead').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('typeahead/typeahead.tpl.html', '<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select"><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a></li></ul>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// Source: tooltip.tpl.js
|
|
||||||
angular.module('mgcrea.ngStrap.tooltip').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('tooltip/tooltip.tpl.html', '<div class="tooltip in" ng-show="title"><div class="tooltip-arrow"></div><div class="tooltip-inner" ng-bind="title"></div></div>');
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
|
|
||||||
})(window, document);
|
|
File diff suppressed because one or more lines are too long
265
public/lib/angular-strap/dist/modules/affix.js
vendored
265
public/lib/angular-strap/dist/modules/affix.js
vendored
|
@ -1,265 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.affix', ['mgcrea.ngStrap.helpers.dimensions', 'mgcrea.ngStrap.helpers.debounce'])
|
|
||||||
|
|
||||||
.provider('$affix', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
offsetTop: 'auto',
|
|
||||||
inlineStyles: true
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ["$window", "debounce", "dimensions", function($window, debounce, dimensions) {
|
|
||||||
|
|
||||||
var bodyEl = angular.element($window.document.body);
|
|
||||||
var windowEl = angular.element($window);
|
|
||||||
|
|
||||||
function AffixFactory(element, config) {
|
|
||||||
|
|
||||||
var $affix = {};
|
|
||||||
|
|
||||||
// Common vars
|
|
||||||
var options = angular.extend({}, defaults, config);
|
|
||||||
var targetEl = options.target;
|
|
||||||
|
|
||||||
// Initial private vars
|
|
||||||
var reset = 'affix affix-top affix-bottom',
|
|
||||||
setWidth = false,
|
|
||||||
initialAffixTop = 0,
|
|
||||||
initialOffsetTop = 0,
|
|
||||||
offsetTop = 0,
|
|
||||||
offsetBottom = 0,
|
|
||||||
affixed = null,
|
|
||||||
unpin = null;
|
|
||||||
|
|
||||||
var parent = element.parent();
|
|
||||||
// Options: custom parent
|
|
||||||
if (options.offsetParent) {
|
|
||||||
if (options.offsetParent.match(/^\d+$/)) {
|
|
||||||
for (var i = 0; i < (options.offsetParent * 1) - 1; i++) {
|
|
||||||
parent = parent.parent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parent = angular.element(options.offsetParent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$affix.init = function() {
|
|
||||||
|
|
||||||
this.$parseOffsets();
|
|
||||||
initialOffsetTop = dimensions.offset(element[0]).top + initialAffixTop;
|
|
||||||
setWidth = !element[0].style.width;
|
|
||||||
|
|
||||||
// Bind events
|
|
||||||
targetEl.on('scroll', this.checkPosition);
|
|
||||||
targetEl.on('click', this.checkPositionWithEventLoop);
|
|
||||||
windowEl.on('resize', this.$debouncedOnResize);
|
|
||||||
|
|
||||||
// Both of these checkPosition() calls are necessary for the case where
|
|
||||||
// the user hits refresh after scrolling to the bottom of the page.
|
|
||||||
this.checkPosition();
|
|
||||||
this.checkPositionWithEventLoop();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$affix.destroy = function() {
|
|
||||||
|
|
||||||
// Unbind events
|
|
||||||
targetEl.off('scroll', this.checkPosition);
|
|
||||||
targetEl.off('click', this.checkPositionWithEventLoop);
|
|
||||||
windowEl.off('resize', this.$debouncedOnResize);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$affix.checkPositionWithEventLoop = function() {
|
|
||||||
|
|
||||||
// IE 9 throws an error if we use 'this' instead of '$affix'
|
|
||||||
// in this setTimeout call
|
|
||||||
setTimeout($affix.checkPosition, 1);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$affix.checkPosition = function() {
|
|
||||||
// if (!this.$element.is(':visible')) return
|
|
||||||
|
|
||||||
var scrollTop = getScrollTop();
|
|
||||||
var position = dimensions.offset(element[0]);
|
|
||||||
var elementHeight = dimensions.height(element[0]);
|
|
||||||
|
|
||||||
// Get required affix class according to position
|
|
||||||
var affix = getRequiredAffixClass(unpin, position, elementHeight);
|
|
||||||
|
|
||||||
// Did affix status changed this last check?
|
|
||||||
if(affixed === affix) return;
|
|
||||||
affixed = affix;
|
|
||||||
|
|
||||||
// Add proper affix class
|
|
||||||
element.removeClass(reset).addClass('affix' + ((affix !== 'middle') ? '-' + affix : ''));
|
|
||||||
|
|
||||||
if(affix === 'top') {
|
|
||||||
unpin = null;
|
|
||||||
if(setWidth) {
|
|
||||||
element.css('width', '');
|
|
||||||
}
|
|
||||||
if (options.inlineStyles) {
|
|
||||||
element.css('position', (options.offsetParent) ? '' : 'relative');
|
|
||||||
element.css('top', '');
|
|
||||||
}
|
|
||||||
} else if(affix === 'bottom') {
|
|
||||||
if (options.offsetUnpin) {
|
|
||||||
unpin = -(options.offsetUnpin * 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Calculate unpin threshold when affixed to bottom.
|
|
||||||
// Hopefully the browser scrolls pixel by pixel.
|
|
||||||
unpin = position.top - scrollTop;
|
|
||||||
}
|
|
||||||
if(setWidth) {
|
|
||||||
element.css('width', '');
|
|
||||||
}
|
|
||||||
if (options.inlineStyles) {
|
|
||||||
element.css('position', (options.offsetParent) ? '' : 'relative');
|
|
||||||
element.css('top', (options.offsetParent) ? '' : ((bodyEl[0].offsetHeight - offsetBottom - elementHeight - initialOffsetTop) + 'px'));
|
|
||||||
}
|
|
||||||
} else { // affix === 'middle'
|
|
||||||
unpin = null;
|
|
||||||
if(setWidth) {
|
|
||||||
element.css('width', element[0].offsetWidth + 'px');
|
|
||||||
}
|
|
||||||
if (options.inlineStyles) {
|
|
||||||
element.css('position', 'fixed');
|
|
||||||
element.css('top', initialAffixTop + 'px');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$affix.$onResize = function() {
|
|
||||||
$affix.$parseOffsets();
|
|
||||||
$affix.checkPosition();
|
|
||||||
};
|
|
||||||
$affix.$debouncedOnResize = debounce($affix.$onResize, 50);
|
|
||||||
|
|
||||||
$affix.$parseOffsets = function() {
|
|
||||||
var initialPosition = element.css('position');
|
|
||||||
// Reset position to calculate correct offsetTop
|
|
||||||
if (options.inlineStyles){
|
|
||||||
element.css('position', (options.offsetParent) ? '' : 'relative');
|
|
||||||
}
|
|
||||||
|
|
||||||
if(options.offsetTop) {
|
|
||||||
if(options.offsetTop === 'auto') {
|
|
||||||
options.offsetTop = '+0';
|
|
||||||
}
|
|
||||||
if(options.offsetTop.match(/^[-+]\d+$/)) {
|
|
||||||
initialAffixTop = - options.offsetTop * 1;
|
|
||||||
if(options.offsetParent) {
|
|
||||||
offsetTop = dimensions.offset(parent[0]).top + (options.offsetTop * 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
offsetTop = dimensions.offset(element[0]).top - dimensions.css(element[0], 'marginTop', true) + (options.offsetTop * 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
offsetTop = options.offsetTop * 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(options.offsetBottom) {
|
|
||||||
if(options.offsetParent && options.offsetBottom.match(/^[-+]\d+$/)) {
|
|
||||||
// add 1 pixel due to rounding problems...
|
|
||||||
offsetBottom = getScrollHeight() - (dimensions.offset(parent[0]).top + dimensions.height(parent[0])) + (options.offsetBottom * 1) + 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
offsetBottom = options.offsetBottom * 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bring back the element's position after calculations
|
|
||||||
if (options.inlineStyles){
|
|
||||||
element.css('position', initialPosition);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Private methods
|
|
||||||
|
|
||||||
function getRequiredAffixClass(unpin, position, elementHeight) {
|
|
||||||
|
|
||||||
var scrollTop = getScrollTop();
|
|
||||||
var scrollHeight = getScrollHeight();
|
|
||||||
|
|
||||||
if(scrollTop <= offsetTop) {
|
|
||||||
return 'top';
|
|
||||||
} else if(unpin !== null && (scrollTop + unpin <= position.top)) {
|
|
||||||
return 'middle';
|
|
||||||
} else if(offsetBottom !== null && (position.top + elementHeight + initialAffixTop >= scrollHeight - offsetBottom)) {
|
|
||||||
return 'bottom';
|
|
||||||
} else {
|
|
||||||
return 'middle';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getScrollTop() {
|
|
||||||
return targetEl[0] === $window ? $window.pageYOffset : targetEl[0].scrollTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getScrollHeight() {
|
|
||||||
return targetEl[0] === $window ? $window.document.body.scrollHeight : targetEl[0].scrollHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
$affix.init();
|
|
||||||
return $affix;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return AffixFactory;
|
|
||||||
|
|
||||||
}];
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsAffix', ["$affix", "$window", function($affix, $window) {
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'EAC',
|
|
||||||
require: '^?bsAffixTarget',
|
|
||||||
link: function postLink(scope, element, attr, affixTarget) {
|
|
||||||
|
|
||||||
var options = {scope: scope, target: affixTarget ? affixTarget.$element : angular.element($window)};
|
|
||||||
angular.forEach(['offsetTop', 'offsetBottom', 'offsetParent', 'offsetUnpin', 'inlineStyles'], function(key) {
|
|
||||||
if(angular.isDefined(attr[key])) {
|
|
||||||
var option = attr[key];
|
|
||||||
if (/true/i.test(option)) option = true;
|
|
||||||
if (/false/i.test(option)) option = false;
|
|
||||||
options[key] = option;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var affix = $affix(element, options);
|
|
||||||
scope.$on('$destroy', function() {
|
|
||||||
affix && affix.destroy();
|
|
||||||
options = null;
|
|
||||||
affix = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}])
|
|
||||||
|
|
||||||
.directive('bsAffixTarget', function() {
|
|
||||||
return {
|
|
||||||
controller: ["$element", function($element) {
|
|
||||||
this.$element = $element;
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
});
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.affix",["mgcrea.ngStrap.helpers.dimensions","mgcrea.ngStrap.helpers.debounce"]).provider("$affix",function(){var t=this.defaults={offsetTop:"auto",inlineStyles:!0};this.$get=["$window","debounce","dimensions",function(e,o,n){function i(i,r){function c(t,e,o){var n=a(),i=l();return P>=n?"top":null!==t&&n+t<=e.top?"middle":null!==$&&e.top+o+g>=i-$?"bottom":"middle"}function a(){return h[0]===e?e.pageYOffset:h[0].scrollTop}function l(){return h[0]===e?e.document.body.scrollHeight:h[0].scrollHeight}var u={},p=angular.extend({},t,r),h=p.target,d="affix affix-top affix-bottom",m=!1,g=0,v=0,P=0,$=0,x=null,T=null,b=i.parent();if(p.offsetParent)if(p.offsetParent.match(/^\d+$/))for(var k=0;k<1*p.offsetParent-1;k++)b=b.parent();else b=angular.element(p.offsetParent);return u.init=function(){this.$parseOffsets(),v=n.offset(i[0]).top+g,m=!i[0].style.width,h.on("scroll",this.checkPosition),h.on("click",this.checkPositionWithEventLoop),f.on("resize",this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},u.destroy=function(){h.off("scroll",this.checkPosition),h.off("click",this.checkPositionWithEventLoop),f.off("resize",this.$debouncedOnResize)},u.checkPositionWithEventLoop=function(){setTimeout(u.checkPosition,1)},u.checkPosition=function(){var t=a(),e=n.offset(i[0]),o=n.height(i[0]),f=c(T,e,o);x!==f&&(x=f,i.removeClass(d).addClass("affix"+("middle"!==f?"-"+f:"")),"top"===f?(T=null,m&&i.css("width",""),p.inlineStyles&&(i.css("position",p.offsetParent?"":"relative"),i.css("top",""))):"bottom"===f?(T=p.offsetUnpin?-(1*p.offsetUnpin):e.top-t,m&&i.css("width",""),p.inlineStyles&&(i.css("position",p.offsetParent?"":"relative"),i.css("top",p.offsetParent?"":s[0].offsetHeight-$-o-v+"px"))):(T=null,m&&i.css("width",i[0].offsetWidth+"px"),p.inlineStyles&&(i.css("position","fixed"),i.css("top",g+"px"))))},u.$onResize=function(){u.$parseOffsets(),u.checkPosition()},u.$debouncedOnResize=o(u.$onResize,50),u.$parseOffsets=function(){var t=i.css("position");p.inlineStyles&&i.css("position",p.offsetParent?"":"relative"),p.offsetTop&&("auto"===p.offsetTop&&(p.offsetTop="+0"),p.offsetTop.match(/^[-+]\d+$/)?(g=1*-p.offsetTop,P=p.offsetParent?n.offset(b[0]).top+1*p.offsetTop:n.offset(i[0]).top-n.css(i[0],"marginTop",!0)+1*p.offsetTop):P=1*p.offsetTop),p.offsetBottom&&($=p.offsetParent&&p.offsetBottom.match(/^[-+]\d+$/)?l()-(n.offset(b[0]).top+n.height(b[0]))+1*p.offsetBottom+1:1*p.offsetBottom),p.inlineStyles&&i.css("position",t)},u.init(),u}var s=angular.element(e.document.body),f=angular.element(e);return i}]}).directive("bsAffix",["$affix","$window",function(t,e){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(o,n,i,s){var f={scope:o,target:s?s.$element:angular.element(e)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin","inlineStyles"],function(t){if(angular.isDefined(i[t])){var e=i[t];/true/i.test(e)&&(e=!0),/false/i.test(e)&&(e=!1),f[t]=e}});var r=t(n,f);o.$on("$destroy",function(){r&&r.destroy(),f=null,r=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function(t){this.$element=t}]}});
|
|
||||||
//# sourceMappingURL=affix.min.js.map
|
|
File diff suppressed because one or more lines are too long
126
public/lib/angular-strap/dist/modules/alert.js
vendored
126
public/lib/angular-strap/dist/modules/alert.js
vendored
|
@ -1,126 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// @BUG: following snippet won't compile correctly
|
|
||||||
// @TODO: submit issue to core
|
|
||||||
// '<span ng-if="title"><strong ng-bind="title"></strong> </span><span ng-bind-html="content"></span>' +
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])
|
|
||||||
|
|
||||||
.provider('$alert', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
animation: 'am-fade',
|
|
||||||
prefixClass: 'alert',
|
|
||||||
prefixEvent: 'alert',
|
|
||||||
placement: null,
|
|
||||||
template: 'alert/alert.tpl.html',
|
|
||||||
container: false,
|
|
||||||
element: null,
|
|
||||||
backdrop: false,
|
|
||||||
keyboard: true,
|
|
||||||
show: true,
|
|
||||||
// Specific options
|
|
||||||
duration: false,
|
|
||||||
type: false,
|
|
||||||
dismissable: true
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ["$modal", "$timeout", function($modal, $timeout) {
|
|
||||||
|
|
||||||
function AlertFactory(config) {
|
|
||||||
|
|
||||||
var $alert = {};
|
|
||||||
|
|
||||||
// Common vars
|
|
||||||
var options = angular.extend({}, defaults, config);
|
|
||||||
|
|
||||||
$alert = $modal(options);
|
|
||||||
|
|
||||||
// Support scope as string options [/*title, content, */ type, dismissable]
|
|
||||||
$alert.$scope.dismissable = !!options.dismissable;
|
|
||||||
if(options.type) {
|
|
||||||
$alert.$scope.type = options.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Support auto-close duration
|
|
||||||
var show = $alert.show;
|
|
||||||
if(options.duration) {
|
|
||||||
$alert.show = function() {
|
|
||||||
show();
|
|
||||||
$timeout(function() {
|
|
||||||
$alert.hide();
|
|
||||||
}, options.duration * 1000);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return $alert;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return AlertFactory;
|
|
||||||
|
|
||||||
}];
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsAlert', ["$window", "$sce", "$alert", function($window, $sce, $alert) {
|
|
||||||
|
|
||||||
var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'EAC',
|
|
||||||
scope: true,
|
|
||||||
link: function postLink(scope, element, attr, transclusion) {
|
|
||||||
|
|
||||||
// Directive options
|
|
||||||
var options = {scope: scope, element: element, show: false};
|
|
||||||
angular.forEach(['template', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function(key) {
|
|
||||||
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
// overwrite inherited title value when no value specified
|
|
||||||
// fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11
|
|
||||||
if (!scope.hasOwnProperty('title')){
|
|
||||||
scope.title = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Support scope as data-attrs
|
|
||||||
angular.forEach(['title', 'content', 'type'], function(key) {
|
|
||||||
attr[key] && attr.$observe(key, function(newValue, oldValue) {
|
|
||||||
scope[key] = $sce.trustAsHtml(newValue);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Support scope as an object
|
|
||||||
attr.bsAlert && scope.$watch(attr.bsAlert, function(newValue, oldValue) {
|
|
||||||
if(angular.isObject(newValue)) {
|
|
||||||
angular.extend(scope, newValue);
|
|
||||||
} else {
|
|
||||||
scope.content = newValue;
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
// Initialize alert
|
|
||||||
var alert = $alert(options);
|
|
||||||
|
|
||||||
// Trigger
|
|
||||||
element.on(attr.trigger || 'click', alert.toggle);
|
|
||||||
|
|
||||||
// Garbage collection
|
|
||||||
scope.$on('$destroy', function() {
|
|
||||||
if (alert) alert.destroy();
|
|
||||||
options = null;
|
|
||||||
alert = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var t=this.defaults={animation:"am-fade",prefixClass:"alert",prefixEvent:"alert",placement:null,template:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function(e,n){function a(a){var r={},i=angular.extend({},t,a);r=e(i),r.$scope.dismissable=!!i.dismissable,i.type&&(r.$scope.type=i.type);var l=r.show;return i.duration&&(r.show=function(){l(),n(function(){r.hide()},1e3*i.duration)}),r}return a}]}).directive("bsAlert",["$window","$sce","$alert",function(t,e,n){t.requestAnimationFrame||t.setTimeout;return{restrict:"EAC",scope:!0,link:function(t,a,r){var i={scope:t,element:a,show:!1};angular.forEach(["template","placement","keyboard","html","container","animation","duration","dismissable"],function(t){angular.isDefined(r[t])&&(i[t]=r[t])}),t.hasOwnProperty("title")||(t.title=""),angular.forEach(["title","content","type"],function(n){r[n]&&r.$observe(n,function(a){t[n]=e.trustAsHtml(a)})}),r.bsAlert&&t.$watch(r.bsAlert,function(e){angular.isObject(e)?angular.extend(t,e):t.content=e},!0);var l=n(i);a.on(r.trigger||"click",l.toggle),t.$on("$destroy",function(){l&&l.destroy(),i=null,l=null})}}}]);
|
|
||||||
//# sourceMappingURL=alert.min.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"sources":["alert/alert.js"],"names":[],"mappings":"AAAA;;;;;;AAMA,QAAQ,OAAO,wBAAwB,CAAC;;GAErC,SAAS,UAAU,WAAW;;IAE7B,IAAI,WAAW,KAAK,WAAW;MAC7B,WAAW;MACX,aAAa;MACb,aAAa;MACb,WAAW;MACX,UAAU;MACV,WAAW;MACX,SAAS;MACT,UAAU;MACV,UAAU;MACV,MAAM;;MAEN,UAAU;MACV,MAAM;MACN,aAAa;;;IAGf,KAAK,8BAAO,SAAS,QAAQ,UAAU;;MAErC,SAAS,aAAa,QAAQ;;QAE5B,IAAI,SAAS;;;QAGb,IAAI,UAAU,QAAQ,OAAO,IAAI,UAAU;;QAE3C,SAAS,OAAO;;;QAGhB,OAAO,OAAO,cAAc,CAAC,CAAC,QAAQ;QACtC,GAAG,QAAQ,MAAM;UACf,OAAO,OAAO,OAAO,QAAQ;;;;QAI/B,IAAI,OAAO,OAAO;QAClB,GAAG,QAAQ,UAAU;UACnB,OAAO,OAAO,WAAW;YACvB;YACA,SAAS,WAAW;cAClB,OAAO;eACN,QAAQ,WAAW;;;;QAI1B,OAAO;;;;MAIT,OAAO;;;;;;GAMV,UAAU,yCAAW,SAAS,SAAS,MAAM,QAAQ;;IAEpD,IAAI,wBAAwB,QAAQ,yBAAyB,QAAQ;;IAErE,OAAO;MACL,UAAU;MACV,OAAO;MACP,MAAM,SAAS,SAAS,OAAO,SAAS,MAAM,cAAc;;;QAG1D,IAAI,UAAU,CAAC,OAAO,OAAO,SAAS,SAAS,MAAM;QACrD,QAAQ,QAAQ,CAAC,YAAY,aAAa,YAAY,QAAQ,aAAa,aAAa,YAAY,gBAAgB,SAAS,KAAK;UAChI,GAAG,QAAQ,UAAU,KAAK,OAAO,QAAQ,OAAO,KAAK;;;;;QAKvD,IAAI,CAAC,MAAM,eAAe,SAAS;UACjC,MAAM,QAAQ;;;;QAIhB,QAAQ,QAAQ,CAAC,SAAS,WAAW,SAAS,SAAS,KAAK;UAC1D,KAAK,QAAQ,KAAK,SAAS,KAAK,SAAS,UAAU,UAAU;YAC3D,MAAM,OAAO,KAAK,YAAY;;;;;QAKlC,KAAK,WAAW,MAAM,OAAO,KAAK,SAAS,SAAS,UAAU,UAAU;UACtE,GAAG,QAAQ,SAAS,WAAW;YAC7B,QAAQ,OAAO,OAAO;iBACjB;YACL,MAAM,UAAU;;WAEjB;;;QAGH,IAAI,QAAQ,OAAO;;;QAGnB,QAAQ,GAAG,KAAK,WAAW,SAAS,MAAM;;;QAG1C,MAAM,IAAI,YAAY,WAAW;UAC/B,IAAI,OAAO,MAAM;UACjB,UAAU;UACV,QAAQ;;;;;;;AAOlB","file":"alert.min.js","sourcesContent":["'use strict';\n\n// @BUG: following snippet won't compile correctly\n// @TODO: submit issue to core\n// '<span ng-if=\"title\"><strong ng-bind=\"title\"></strong> </span><span ng-bind-html=\"content\"></span>' +\n\nangular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])\n\n .provider('$alert', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'alert',\n prefixEvent: 'alert',\n placement: null,\n template: 'alert/alert.tpl.html',\n container: false,\n element: null,\n backdrop: false,\n keyboard: true,\n show: true,\n // Specific options\n duration: false,\n type: false,\n dismissable: true\n };\n\n this.$get = function($modal, $timeout) {\n\n function AlertFactory(config) {\n\n var $alert = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $alert = $modal(options);\n\n // Support scope as string options [/*title, content, */ type, dismissable]\n $alert.$scope.dismissable = !!options.dismissable;\n if(options.type) {\n $alert.$scope.type = options.type;\n }\n\n // Support auto-close duration\n var show = $alert.show;\n if(options.duration) {\n $alert.show = function() {\n show();\n $timeout(function() {\n $alert.hide();\n }, options.duration * 1000);\n };\n }\n\n return $alert;\n\n }\n\n return AlertFactory;\n\n };\n\n })\n\n .directive('bsAlert', function($window, $sce, $alert) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // overwrite inherited title value when no value specified\n // fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11\n if (!scope.hasOwnProperty('title')){\n scope.title = '';\n }\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content', 'type'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsAlert && scope.$watch(attr.bsAlert, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize alert\n var alert = $alert(options);\n\n // Trigger\n element.on(attr.trigger || 'click', alert.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (alert) alert.destroy();\n options = null;\n alert = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
|
|
|
@ -1,14 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.alert').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('alert/alert.tpl.html', '<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">×</button> <strong ng-bind="title"></strong> <span ng-bind-html="content"></span></div>');
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,8 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(t){t.put("alert/alert.tpl.html",'<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">×</button> <strong ng-bind="title"></strong> <span ng-bind-html="content"></span></div>')}]);
|
|
96
public/lib/angular-strap/dist/modules/aside.js
vendored
96
public/lib/angular-strap/dist/modules/aside.js
vendored
|
@ -1,96 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])
|
|
||||||
|
|
||||||
.provider('$aside', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
animation: 'am-fade-and-slide-right',
|
|
||||||
prefixClass: 'aside',
|
|
||||||
prefixEvent: 'aside',
|
|
||||||
placement: 'right',
|
|
||||||
template: 'aside/aside.tpl.html',
|
|
||||||
contentTemplate: false,
|
|
||||||
container: false,
|
|
||||||
element: null,
|
|
||||||
backdrop: true,
|
|
||||||
keyboard: true,
|
|
||||||
html: false,
|
|
||||||
show: true
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ["$modal", function($modal) {
|
|
||||||
|
|
||||||
function AsideFactory(config) {
|
|
||||||
|
|
||||||
var $aside = {};
|
|
||||||
|
|
||||||
// Common vars
|
|
||||||
var options = angular.extend({}, defaults, config);
|
|
||||||
|
|
||||||
$aside = $modal(options);
|
|
||||||
|
|
||||||
return $aside;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return AsideFactory;
|
|
||||||
|
|
||||||
}];
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsAside', ["$window", "$sce", "$aside", function($window, $sce, $aside) {
|
|
||||||
|
|
||||||
var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'EAC',
|
|
||||||
scope: true,
|
|
||||||
link: function postLink(scope, element, attr, transclusion) {
|
|
||||||
// Directive options
|
|
||||||
var options = {scope: scope, element: element, show: false};
|
|
||||||
angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {
|
|
||||||
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Support scope as data-attrs
|
|
||||||
angular.forEach(['title', 'content'], function(key) {
|
|
||||||
attr[key] && attr.$observe(key, function(newValue, oldValue) {
|
|
||||||
scope[key] = $sce.trustAsHtml(newValue);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Support scope as an object
|
|
||||||
attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {
|
|
||||||
if(angular.isObject(newValue)) {
|
|
||||||
angular.extend(scope, newValue);
|
|
||||||
} else {
|
|
||||||
scope.content = newValue;
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
// Initialize aside
|
|
||||||
var aside = $aside(options);
|
|
||||||
|
|
||||||
// Trigger
|
|
||||||
element.on(attr.trigger || 'click', aside.toggle);
|
|
||||||
|
|
||||||
// Garbage collection
|
|
||||||
scope.$on('$destroy', function() {
|
|
||||||
if (aside) aside.destroy();
|
|
||||||
options = null;
|
|
||||||
aside = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var e=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",prefixEvent:"aside",placement:"right",template:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function(t){function n(n){var a={},i=angular.extend({},e,n);return a=t(i)}return n}]}).directive("bsAside",["$window","$sce","$aside",function(e,t,n){e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,a,i){var r={scope:e,element:a,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(e){angular.isDefined(i[e])&&(r[e]=i[e])}),angular.forEach(["title","content"],function(n){i[n]&&i.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),i.bsAside&&e.$watch(i.bsAside,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var o=n(r);a.on(i.trigger||"click",o.toggle),e.$on("$destroy",function(){o&&o.destroy(),r=null,o=null})}}}]);
|
|
||||||
//# sourceMappingURL=aside.min.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"sources":["aside/aside.js"],"names":[],"mappings":"AAAA;;AAEA,QAAQ,OAAO,wBAAwB,CAAC;;GAErC,SAAS,UAAU,WAAW;;IAE7B,IAAI,WAAW,KAAK,WAAW;MAC7B,WAAW;MACX,aAAa;MACb,aAAa;MACb,WAAW;MACX,UAAU;MACV,iBAAiB;MACjB,WAAW;MACX,SAAS;MACT,UAAU;MACV,UAAU;MACV,MAAM;MACN,MAAM;;;IAGR,KAAK,kBAAO,SAAS,QAAQ;;MAE3B,SAAS,aAAa,QAAQ;;QAE5B,IAAI,SAAS;;;QAGb,IAAI,UAAU,QAAQ,OAAO,IAAI,UAAU;;QAE3C,SAAS,OAAO;;QAEhB,OAAO;;;;MAIT,OAAO;;;;;;GAMV,UAAU,yCAAW,SAAS,SAAS,MAAM,QAAQ;;IAEpD,IAAI,wBAAwB,QAAQ,yBAAyB,QAAQ;;IAErE,OAAO;MACL,UAAU;MACV,OAAO;MACP,MAAM,SAAS,SAAS,OAAO,SAAS,MAAM,cAAc;;QAE1D,IAAI,UAAU,CAAC,OAAO,OAAO,SAAS,SAAS,MAAM;QACrD,QAAQ,QAAQ,CAAC,YAAY,mBAAmB,aAAa,YAAY,YAAY,QAAQ,aAAa,cAAc,SAAS,KAAK;UACpI,GAAG,QAAQ,UAAU,KAAK,OAAO,QAAQ,OAAO,KAAK;;;;QAIvD,QAAQ,QAAQ,CAAC,SAAS,YAAY,SAAS,KAAK;UAClD,KAAK,QAAQ,KAAK,SAAS,KAAK,SAAS,UAAU,UAAU;YAC3D,MAAM,OAAO,KAAK,YAAY;;;;;QAKlC,KAAK,WAAW,MAAM,OAAO,KAAK,SAAS,SAAS,UAAU,UAAU;UACtE,GAAG,QAAQ,SAAS,WAAW;YAC7B,QAAQ,OAAO,OAAO;iBACjB;YACL,MAAM,UAAU;;WAEjB;;;QAGH,IAAI,QAAQ,OAAO;;;QAGnB,QAAQ,GAAG,KAAK,WAAW,SAAS,MAAM;;;QAG1C,MAAM,IAAI,YAAY,WAAW;UAC/B,IAAI,OAAO,MAAM;UACjB,UAAU;UACV,QAAQ;;;;;;;AAOlB","file":"aside.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])\n\n .provider('$aside', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade-and-slide-right',\n prefixClass: 'aside',\n prefixEvent: 'aside',\n placement: 'right',\n template: 'aside/aside.tpl.html',\n contentTemplate: false,\n container: false,\n element: null,\n backdrop: true,\n keyboard: true,\n html: false,\n show: true\n };\n\n this.$get = function($modal) {\n\n function AsideFactory(config) {\n\n var $aside = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $aside = $modal(options);\n\n return $aside;\n\n }\n\n return AsideFactory;\n\n };\n\n })\n\n .directive('bsAside', function($window, $sce, $aside) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize aside\n var aside = $aside(options);\n\n // Trigger\n element.on(attr.trigger || 'click', aside.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (aside) aside.destroy();\n options = null;\n aside = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
|
|
|
@ -1,14 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.aside').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('aside/aside.tpl.html', '<div class="aside" tabindex="-1" role="dialog"><div class="aside-dialog"><div class="aside-content"><div class="aside-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">×</button><h4 class="aside-title" ng-bind="title"></h4></div><div class="aside-body" ng-bind="content"></div><div class="aside-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>');
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,8 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function(t){t.put("aside/aside.tpl.html",'<div class="aside" tabindex="-1" role="dialog"><div class="aside-dialog"><div class="aside-content"><div class="aside-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">×</button><h4 class="aside-title" ng-bind="title"></h4></div><div class="aside-body" ng-bind="content"></div><div class="aside-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]);
|
|
181
public/lib/angular-strap/dist/modules/button.js
vendored
181
public/lib/angular-strap/dist/modules/button.js
vendored
|
@ -1,181 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.button', [])
|
|
||||||
|
|
||||||
.provider('$button', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
activeClass:'active',
|
|
||||||
toggleEvent:'click'
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = function() {
|
|
||||||
return {defaults: defaults};
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsCheckboxGroup', function() {
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
require: 'ngModel',
|
|
||||||
compile: function postLink(element, attr) {
|
|
||||||
element.attr('data-toggle', 'buttons');
|
|
||||||
element.removeAttr('ng-model');
|
|
||||||
var children = element[0].querySelectorAll('input[type="checkbox"]');
|
|
||||||
angular.forEach(children, function(child) {
|
|
||||||
var childEl = angular.element(child);
|
|
||||||
childEl.attr('bs-checkbox', '');
|
|
||||||
childEl.attr('ng-model', attr.ngModel + '.' + childEl.attr('value'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsCheckbox', ["$button", "$$rAF", function($button, $$rAF) {
|
|
||||||
|
|
||||||
var defaults = $button.defaults;
|
|
||||||
var constantValueRegExp = /^(true|false|\d+)$/;
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
require: 'ngModel',
|
|
||||||
link: function postLink(scope, element, attr, controller) {
|
|
||||||
|
|
||||||
var options = defaults;
|
|
||||||
|
|
||||||
// Support label > input[type="checkbox"]
|
|
||||||
var isInput = element[0].nodeName === 'INPUT';
|
|
||||||
var activeElement = isInput ? element.parent() : element;
|
|
||||||
|
|
||||||
var trueValue = angular.isDefined(attr.trueValue) ? attr.trueValue : true;
|
|
||||||
if(constantValueRegExp.test(attr.trueValue)) {
|
|
||||||
trueValue = scope.$eval(attr.trueValue);
|
|
||||||
}
|
|
||||||
var falseValue = angular.isDefined(attr.falseValue) ? attr.falseValue : false;
|
|
||||||
if(constantValueRegExp.test(attr.falseValue)) {
|
|
||||||
falseValue = scope.$eval(attr.falseValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse exotic values
|
|
||||||
var hasExoticValues = typeof trueValue !== 'boolean' || typeof falseValue !== 'boolean';
|
|
||||||
if(hasExoticValues) {
|
|
||||||
controller.$parsers.push(function(viewValue) {
|
|
||||||
// console.warn('$parser', element.attr('ng-model'), 'viewValue', viewValue);
|
|
||||||
return viewValue ? trueValue : falseValue;
|
|
||||||
});
|
|
||||||
// modelValue -> $formatters -> viewValue
|
|
||||||
controller.$formatters.push(function(modelValue) {
|
|
||||||
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
|
|
||||||
return angular.equals(modelValue, trueValue);
|
|
||||||
});
|
|
||||||
// Fix rendering for exotic values
|
|
||||||
scope.$watch(attr.ngModel, function(newValue, oldValue) {
|
|
||||||
controller.$render();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// model -> view
|
|
||||||
controller.$render = function () {
|
|
||||||
// console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
|
|
||||||
var isActive = angular.equals(controller.$modelValue, trueValue);
|
|
||||||
$$rAF(function() {
|
|
||||||
if(isInput) element[0].checked = isActive;
|
|
||||||
activeElement.toggleClass(options.activeClass, isActive);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// view -> model
|
|
||||||
element.bind(options.toggleEvent, function() {
|
|
||||||
scope.$apply(function () {
|
|
||||||
// console.warn('!click', element.attr('ng-model'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);
|
|
||||||
if(!isInput) {
|
|
||||||
controller.$setViewValue(!activeElement.hasClass('active'));
|
|
||||||
}
|
|
||||||
if(!hasExoticValues) {
|
|
||||||
controller.$render();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}])
|
|
||||||
|
|
||||||
.directive('bsRadioGroup', function() {
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
require: 'ngModel',
|
|
||||||
compile: function postLink(element, attr) {
|
|
||||||
element.attr('data-toggle', 'buttons');
|
|
||||||
element.removeAttr('ng-model');
|
|
||||||
var children = element[0].querySelectorAll('input[type="radio"]');
|
|
||||||
angular.forEach(children, function(child) {
|
|
||||||
angular.element(child).attr('bs-radio', '');
|
|
||||||
angular.element(child).attr('ng-model', attr.ngModel);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsRadio', ["$button", "$$rAF", function($button, $$rAF) {
|
|
||||||
|
|
||||||
var defaults = $button.defaults;
|
|
||||||
var constantValueRegExp = /^(true|false|\d+)$/;
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
require: 'ngModel',
|
|
||||||
link: function postLink(scope, element, attr, controller) {
|
|
||||||
|
|
||||||
var options = defaults;
|
|
||||||
|
|
||||||
// Support `label > input[type="radio"]` markup
|
|
||||||
var isInput = element[0].nodeName === 'INPUT';
|
|
||||||
var activeElement = isInput ? element.parent() : element;
|
|
||||||
|
|
||||||
var value;
|
|
||||||
attr.$observe('value', function(v) {
|
|
||||||
value = constantValueRegExp.test(v) ? scope.$eval(v) : v;
|
|
||||||
controller.$render();
|
|
||||||
});
|
|
||||||
|
|
||||||
// model -> view
|
|
||||||
controller.$render = function () {
|
|
||||||
// console.warn('$render', element.attr('value'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
|
|
||||||
var isActive = angular.equals(controller.$modelValue, value);
|
|
||||||
$$rAF(function() {
|
|
||||||
if(isInput) element[0].checked = isActive;
|
|
||||||
activeElement.toggleClass(options.activeClass, isActive);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// view -> model
|
|
||||||
element.bind(options.toggleEvent, function() {
|
|
||||||
scope.$apply(function () {
|
|
||||||
// console.warn('!click', element.attr('value'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);
|
|
||||||
controller.$setViewValue(value);
|
|
||||||
controller.$render();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var e=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:e}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var n=e[0].querySelectorAll('input[type="checkbox"]');angular.forEach(n,function(e){var n=angular.element(e);n.attr("bs-checkbox",""),n.attr("ng-model",t.ngModel+"."+n.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(e,t){var n=e.defaults,r=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,a,u,l){var o=n,i="INPUT"===a[0].nodeName,c=i?a.parent():a,s=angular.isDefined(u.trueValue)?u.trueValue:!0;r.test(u.trueValue)&&(s=e.$eval(u.trueValue));var d=angular.isDefined(u.falseValue)?u.falseValue:!1;r.test(u.falseValue)&&(d=e.$eval(u.falseValue));var f="boolean"!=typeof s||"boolean"!=typeof d;f&&(l.$parsers.push(function(e){return e?s:d}),l.$formatters.push(function(e){return angular.equals(e,s)}),e.$watch(u.ngModel,function(){l.$render()})),l.$render=function(){var e=angular.equals(l.$modelValue,s);t(function(){i&&(a[0].checked=e),c.toggleClass(o.activeClass,e)})},a.bind(o.toggleEvent,function(){e.$apply(function(){i||l.$setViewValue(!c.hasClass("active")),f||l.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var n=e[0].querySelectorAll('input[type="radio"]');angular.forEach(n,function(e){angular.element(e).attr("bs-radio",""),angular.element(e).attr("ng-model",t.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(e,t){var n=e.defaults,r=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,a,u,l){var o,i=n,c="INPUT"===a[0].nodeName,s=c?a.parent():a;u.$observe("value",function(t){o=r.test(t)?e.$eval(t):t,l.$render()}),l.$render=function(){var e=angular.equals(l.$modelValue,o);t(function(){c&&(a[0].checked=e),s.toggleClass(i.activeClass,e)})},a.bind(i.toggleEvent,function(){e.$apply(function(){l.$setViewValue(o),l.$render()})})}}}]);
|
|
||||||
//# sourceMappingURL=button.min.js.map
|
|
File diff suppressed because one or more lines are too long
273
public/lib/angular-strap/dist/modules/collapse.js
vendored
273
public/lib/angular-strap/dist/modules/collapse.js
vendored
|
@ -1,273 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.collapse', [])
|
|
||||||
|
|
||||||
.provider('$collapse', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
animation: 'am-collapse',
|
|
||||||
disallowToggle: false,
|
|
||||||
activeClass: 'in',
|
|
||||||
startCollapsed: false,
|
|
||||||
allowMultiple: false
|
|
||||||
};
|
|
||||||
|
|
||||||
var controller = this.controller = function($scope, $element, $attrs) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
// Attributes options
|
|
||||||
self.$options = angular.copy(defaults);
|
|
||||||
angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed', 'allowMultiple'], function (key) {
|
|
||||||
if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
self.$toggles = [];
|
|
||||||
self.$targets = [];
|
|
||||||
|
|
||||||
self.$viewChangeListeners = [];
|
|
||||||
|
|
||||||
self.$registerToggle = function(element) {
|
|
||||||
self.$toggles.push(element);
|
|
||||||
};
|
|
||||||
self.$registerTarget = function(element) {
|
|
||||||
self.$targets.push(element);
|
|
||||||
};
|
|
||||||
|
|
||||||
self.$unregisterToggle = function(element) {
|
|
||||||
var index = self.$toggles.indexOf(element);
|
|
||||||
// remove toggle from $toggles array
|
|
||||||
self.$toggles.splice(index, 1);
|
|
||||||
};
|
|
||||||
self.$unregisterTarget = function(element) {
|
|
||||||
var index = self.$targets.indexOf(element);
|
|
||||||
|
|
||||||
// remove element from $targets array
|
|
||||||
self.$targets.splice(index, 1);
|
|
||||||
|
|
||||||
if (self.$options.allowMultiple) {
|
|
||||||
// remove target index from $active array values
|
|
||||||
deactivateItem(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix active item indexes
|
|
||||||
fixActiveItemIndexes(index);
|
|
||||||
|
|
||||||
self.$viewChangeListeners.forEach(function(fn) {
|
|
||||||
fn();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// use array to store all the currently open panels
|
|
||||||
self.$targets.$active = !self.$options.startCollapsed ? [0] : [];
|
|
||||||
self.$setActive = $scope.$setActive = function(value) {
|
|
||||||
if(angular.isArray(value)) {
|
|
||||||
self.$targets.$active = angular.copy(value);
|
|
||||||
}
|
|
||||||
else if(!self.$options.disallowToggle) {
|
|
||||||
// toogle element active status
|
|
||||||
isActive(value) ? deactivateItem(value) : activateItem(value);
|
|
||||||
} else {
|
|
||||||
activateItem(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.$viewChangeListeners.forEach(function(fn) {
|
|
||||||
fn();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
self.$activeIndexes = function() {
|
|
||||||
return self.$options.allowMultiple ? self.$targets.$active :
|
|
||||||
self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
function fixActiveItemIndexes(index) {
|
|
||||||
// item with index was removed, so we
|
|
||||||
// need to adjust other items index values
|
|
||||||
var activeIndexes = self.$targets.$active;
|
|
||||||
for(var i = 0; i < activeIndexes.length; i++) {
|
|
||||||
if (index < activeIndexes[i]) {
|
|
||||||
activeIndexes[i] = activeIndexes[i] - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// the last item is active, so we need to
|
|
||||||
// adjust its index
|
|
||||||
if (activeIndexes[i] === self.$targets.length) {
|
|
||||||
activeIndexes[i] = self.$targets.length - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isActive(value) {
|
|
||||||
var activeItems = self.$targets.$active;
|
|
||||||
return activeItems.indexOf(value) === -1 ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function deactivateItem(value) {
|
|
||||||
var index = self.$targets.$active.indexOf(value);
|
|
||||||
if (index !== -1) {
|
|
||||||
self.$targets.$active.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function activateItem(value) {
|
|
||||||
if (!self.$options.allowMultiple) {
|
|
||||||
// remove current selected item
|
|
||||||
self.$targets.$active.splice(0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self.$targets.$active.indexOf(value) === -1) {
|
|
||||||
self.$targets.$active.push(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = function() {
|
|
||||||
var $collapse = {};
|
|
||||||
$collapse.defaults = defaults;
|
|
||||||
$collapse.controller = controller;
|
|
||||||
return $collapse;
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsCollapse', ["$window", "$animate", "$collapse", function($window, $animate, $collapse) {
|
|
||||||
|
|
||||||
var defaults = $collapse.defaults;
|
|
||||||
|
|
||||||
return {
|
|
||||||
require: ['?ngModel', 'bsCollapse'],
|
|
||||||
controller: ['$scope', '$element', '$attrs', $collapse.controller],
|
|
||||||
link: function postLink(scope, element, attrs, controllers) {
|
|
||||||
|
|
||||||
var ngModelCtrl = controllers[0];
|
|
||||||
var bsCollapseCtrl = controllers[1];
|
|
||||||
|
|
||||||
if(ngModelCtrl) {
|
|
||||||
|
|
||||||
// Update the modelValue following
|
|
||||||
bsCollapseCtrl.$viewChangeListeners.push(function() {
|
|
||||||
ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes());
|
|
||||||
});
|
|
||||||
|
|
||||||
// modelValue -> $formatters -> viewValue
|
|
||||||
ngModelCtrl.$formatters.push(function(modelValue) {
|
|
||||||
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
|
|
||||||
if (angular.isArray(modelValue)) {
|
|
||||||
// model value is an array, so just replace
|
|
||||||
// the active items directly
|
|
||||||
bsCollapseCtrl.$setActive(modelValue);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var activeIndexes = bsCollapseCtrl.$activeIndexes();
|
|
||||||
|
|
||||||
if (angular.isArray(activeIndexes)) {
|
|
||||||
// we have an array of selected indexes
|
|
||||||
if (activeIndexes.indexOf(modelValue * 1) === -1) {
|
|
||||||
// item with modelValue index is not active
|
|
||||||
bsCollapseCtrl.$setActive(modelValue * 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (activeIndexes !== modelValue * 1) {
|
|
||||||
bsCollapseCtrl.$setActive(modelValue * 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return modelValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}])
|
|
||||||
|
|
||||||
.directive('bsCollapseToggle', function() {
|
|
||||||
|
|
||||||
return {
|
|
||||||
require: ['^?ngModel', '^bsCollapse'],
|
|
||||||
link: function postLink(scope, element, attrs, controllers) {
|
|
||||||
|
|
||||||
var ngModelCtrl = controllers[0];
|
|
||||||
var bsCollapseCtrl = controllers[1];
|
|
||||||
|
|
||||||
// Add base attr
|
|
||||||
element.attr('data-toggle', 'collapse');
|
|
||||||
|
|
||||||
// Push pane to parent bsCollapse controller
|
|
||||||
bsCollapseCtrl.$registerToggle(element);
|
|
||||||
|
|
||||||
// remove toggle from collapse controller when toggle is destroyed
|
|
||||||
scope.$on('$destroy', function() {
|
|
||||||
bsCollapseCtrl.$unregisterToggle(element);
|
|
||||||
});
|
|
||||||
|
|
||||||
element.on('click', function() {
|
|
||||||
var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);
|
|
||||||
bsCollapseCtrl.$setActive(index * 1);
|
|
||||||
scope.$apply();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsCollapseTarget', ["$animate", function($animate) {
|
|
||||||
|
|
||||||
return {
|
|
||||||
require: ['^?ngModel', '^bsCollapse'],
|
|
||||||
// scope: true,
|
|
||||||
link: function postLink(scope, element, attrs, controllers) {
|
|
||||||
|
|
||||||
var ngModelCtrl = controllers[0];
|
|
||||||
var bsCollapseCtrl = controllers[1];
|
|
||||||
|
|
||||||
// Add base class
|
|
||||||
element.addClass('collapse');
|
|
||||||
|
|
||||||
// Add animation class
|
|
||||||
if(bsCollapseCtrl.$options.animation) {
|
|
||||||
element.addClass(bsCollapseCtrl.$options.animation);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Push pane to parent bsCollapse controller
|
|
||||||
bsCollapseCtrl.$registerTarget(element);
|
|
||||||
|
|
||||||
// remove pane target from collapse controller when target is destroyed
|
|
||||||
scope.$on('$destroy', function() {
|
|
||||||
bsCollapseCtrl.$unregisterTarget(element);
|
|
||||||
});
|
|
||||||
|
|
||||||
function render() {
|
|
||||||
var index = bsCollapseCtrl.$targets.indexOf(element);
|
|
||||||
var active = bsCollapseCtrl.$activeIndexes();
|
|
||||||
var action = 'removeClass';
|
|
||||||
if (angular.isArray(active)) {
|
|
||||||
if (active.indexOf(index) !== -1) {
|
|
||||||
action = 'addClass';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (index === active) {
|
|
||||||
action = 'addClass';
|
|
||||||
}
|
|
||||||
|
|
||||||
$animate[action](element, bsCollapseCtrl.$options.activeClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
bsCollapseCtrl.$viewChangeListeners.push(function() {
|
|
||||||
render();
|
|
||||||
});
|
|
||||||
render();
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var e=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1,allowMultiple:!1},t=this.controller=function(t,a,n){function i(e){for(var t=o.$targets.$active,a=0;a<t.length;a++)e<t[a]&&(t[a]=t[a]-1),t[a]===o.$targets.length&&(t[a]=o.$targets.length-1)}function s(e){var t=o.$targets.$active;return-1===t.indexOf(e)?!1:!0}function r(e){var t=o.$targets.$active.indexOf(e);-1!==t&&o.$targets.$active.splice(t,1)}function l(e){o.$options.allowMultiple||o.$targets.$active.splice(0,1),-1===o.$targets.$active.indexOf(e)&&o.$targets.$active.push(e)}var o=this;o.$options=angular.copy(e),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed","allowMultiple"],function(e){angular.isDefined(n[e])&&(o.$options[e]=n[e])}),o.$toggles=[],o.$targets=[],o.$viewChangeListeners=[],o.$registerToggle=function(e){o.$toggles.push(e)},o.$registerTarget=function(e){o.$targets.push(e)},o.$unregisterToggle=function(e){var t=o.$toggles.indexOf(e);o.$toggles.splice(t,1)},o.$unregisterTarget=function(e){var t=o.$targets.indexOf(e);o.$targets.splice(t,1),o.$options.allowMultiple&&r(e),i(t),o.$viewChangeListeners.forEach(function(e){e()})},o.$targets.$active=o.$options.startCollapsed?[]:[0],o.$setActive=t.$setActive=function(e){angular.isArray(e)?o.$targets.$active=angular.copy(e):o.$options.disallowToggle?l(e):s(e)?r(e):l(e),o.$viewChangeListeners.forEach(function(e){e()})},o.$activeIndexes=function(){return o.$options.allowMultiple?o.$targets.$active:1===o.$targets.$active.length?o.$targets.$active[0]:-1}};this.$get=function(){var a={};return a.defaults=e,a.controller=t,a}}).directive("bsCollapse",["$window","$animate","$collapse",function(e,t,a){a.defaults;return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",a.controller],link:function(e,t,a,n){var i=n[0],s=n[1];i&&(s.$viewChangeListeners.push(function(){i.$setViewValue(s.$activeIndexes())}),i.$formatters.push(function(e){if(angular.isArray(e))s.$setActive(e);else{var t=s.$activeIndexes();angular.isArray(t)?-1===t.indexOf(1*e)&&s.$setActive(1*e):t!==1*e&&s.$setActive(1*e)}return e}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(e,t,a,n){var i=(n[0],n[1]);t.attr("data-toggle","collapse"),i.$registerToggle(t),e.$on("$destroy",function(){i.$unregisterToggle(t)}),t.on("click",function(){var n=a.bsCollapseToggle||i.$toggles.indexOf(t);i.$setActive(1*n),e.$apply()})}}}).directive("bsCollapseTarget",["$animate",function(e){return{require:["^?ngModel","^bsCollapse"],link:function(t,a,n,i){function s(){var t=r.$targets.indexOf(a),n=r.$activeIndexes(),i="removeClass";angular.isArray(n)?-1!==n.indexOf(t)&&(i="addClass"):t===n&&(i="addClass"),e[i](a,r.$options.activeClass)}var r=(i[0],i[1]);a.addClass("collapse"),r.$options.animation&&a.addClass(r.$options.animation),r.$registerTarget(a),t.$on("$destroy",function(){r.$unregisterTarget(a)}),r.$viewChangeListeners.push(function(){s()}),s()}}}]);
|
|
||||||
//# sourceMappingURL=collapse.min.js.map
|
|
File diff suppressed because one or more lines are too long
|
@ -1,61 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.helpers.dateFormatter', [])
|
|
||||||
|
|
||||||
.service('$dateFormatter', ["$locale", "dateFilter", function($locale, dateFilter) {
|
|
||||||
|
|
||||||
// The unused `lang` arguments are on purpose. The default implementation does not
|
|
||||||
// use them and it always uses the locale loaded into the `$locale` service.
|
|
||||||
// Custom implementations might use it, thus allowing different directives to
|
|
||||||
// have different languages.
|
|
||||||
|
|
||||||
this.getDefaultLocale = function() {
|
|
||||||
return $locale.id;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Format is either a data format name, e.g. "shortTime" or "fullDate", or a date format
|
|
||||||
// Return either the corresponding date format or the given date format.
|
|
||||||
this.getDatetimeFormat = function(format, lang) {
|
|
||||||
return $locale.DATETIME_FORMATS[format] || format;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.weekdaysShort = function(lang) {
|
|
||||||
return $locale.DATETIME_FORMATS.SHORTDAY;
|
|
||||||
};
|
|
||||||
|
|
||||||
function splitTimeFormat(format) {
|
|
||||||
return /(h+)([:\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// h:mm a => h
|
|
||||||
this.hoursFormat = function(timeFormat) {
|
|
||||||
return splitTimeFormat(timeFormat)[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
// h:mm a => mm
|
|
||||||
this.minutesFormat = function(timeFormat) {
|
|
||||||
return splitTimeFormat(timeFormat)[2];
|
|
||||||
};
|
|
||||||
|
|
||||||
// h:mm a => :
|
|
||||||
this.timeSeparator = function(timeFormat) {
|
|
||||||
return splitTimeFormat(timeFormat)[1];
|
|
||||||
};
|
|
||||||
|
|
||||||
// h:mm a => true, H.mm => false
|
|
||||||
this.showAM = function(timeFormat) {
|
|
||||||
return !!splitTimeFormat(timeFormat)[3];
|
|
||||||
};
|
|
||||||
|
|
||||||
this.formatDate = function(date, format, lang, timezone){
|
|
||||||
return dateFilter(date, format, timezone);
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function(t,e){function r(t){return/(h+)([:\.])?(m+)[ ]?(a?)/i.exec(t).slice(1)}this.getDefaultLocale=function(){return t.id},this.getDatetimeFormat=function(e){return t.DATETIME_FORMATS[e]||e},this.weekdaysShort=function(){return t.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(t){return r(t)[0]},this.minutesFormat=function(t){return r(t)[2]},this.timeSeparator=function(t){return r(t)[1]},this.showAM=function(t){return!!r(t)[3]},this.formatDate=function(t,r,n,i){return e(t,r,i)}}]);
|
|
||||||
//# sourceMappingURL=date-formatter.min.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"sources":["helpers/date-formatter.js"],"names":[],"mappings":"AAAA;;AAEA,QAAQ,OAAO,wCAAwC;;GAEpD,QAAQ,4CAAkB,SAAS,SAAS,YAAY;;;;;;;IAOvD,KAAK,mBAAmB,WAAW;MACjC,OAAO,QAAQ;;;;;IAKjB,KAAK,oBAAoB,SAAS,QAAQ,MAAM;MAC9C,OAAO,QAAQ,iBAAiB,WAAW;;;IAG7C,KAAK,gBAAgB,SAAS,MAAM;MAClC,OAAO,QAAQ,iBAAiB;;;IAGlC,SAAS,gBAAgB,QAAQ;MAC/B,OAAO,4BAA4B,KAAK,QAAQ,MAAM;;;;IAIxD,KAAK,cAAc,SAAS,YAAY;MACtC,OAAO,gBAAgB,YAAY;;;;IAIrC,KAAK,gBAAgB,SAAS,YAAY;MACxC,OAAO,gBAAgB,YAAY;;;;IAIrC,KAAK,gBAAgB,SAAS,YAAY;MACxC,OAAO,gBAAgB,YAAY;;;;IAIrC,KAAK,SAAS,SAAS,YAAY;MACjC,OAAO,CAAC,CAAC,gBAAgB,YAAY;;;IAGvC,KAAK,aAAa,SAAS,MAAM,QAAQ,MAAM,SAAS;MACtD,OAAO,WAAW,MAAM,QAAQ;;;;AAItC","file":"date-formatter.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dateFormatter', [])\n\n .service('$dateFormatter', function($locale, dateFilter) {\n\n // The unused `lang` arguments are on purpose. The default implementation does not\n // use them and it always uses the locale loaded into the `$locale` service.\n // Custom implementations might use it, thus allowing different directives to\n // have different languages.\n\n this.getDefaultLocale = function() {\n return $locale.id;\n };\n\n // Format is either a data format name, e.g. \"shortTime\" or \"fullDate\", or a date format\n // Return either the corresponding date format or the given date format.\n this.getDatetimeFormat = function(format, lang) {\n return $locale.DATETIME_FORMATS[format] || format;\n };\n\n this.weekdaysShort = function(lang) {\n return $locale.DATETIME_FORMATS.SHORTDAY;\n };\n\n function splitTimeFormat(format) {\n return /(h+)([:\\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);\n }\n\n // h:mm a => h\n this.hoursFormat = function(timeFormat) {\n return splitTimeFormat(timeFormat)[0];\n };\n\n // h:mm a => mm\n this.minutesFormat = function(timeFormat) {\n return splitTimeFormat(timeFormat)[2];\n };\n\n // h:mm a => :\n this.timeSeparator = function(timeFormat) {\n return splitTimeFormat(timeFormat)[1];\n };\n\n // h:mm a => true, H.mm => false\n this.showAM = function(timeFormat) {\n return !!splitTimeFormat(timeFormat)[3];\n };\n\n this.formatDate = function(date, format, lang, timezone){\n return dateFilter(date, format, timezone);\n };\n\n });\n"],"sourceRoot":"/source/"}
|
|
291
public/lib/angular-strap/dist/modules/date-parser.js
vendored
291
public/lib/angular-strap/dist/modules/date-parser.js
vendored
|
@ -1,291 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.helpers.dateParser', [])
|
|
||||||
|
|
||||||
.provider('$dateParser', ["$localeProvider", function($localeProvider) {
|
|
||||||
|
|
||||||
// define a custom ParseDate object to use instead of native Date
|
|
||||||
// to avoid date values wrapping when setting date component values
|
|
||||||
function ParseDate() {
|
|
||||||
this.year = 1970;
|
|
||||||
this.month = 0;
|
|
||||||
this.day = 1;
|
|
||||||
this.hours = 0;
|
|
||||||
this.minutes = 0;
|
|
||||||
this.seconds = 0;
|
|
||||||
this.milliseconds = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ParseDate.prototype.setMilliseconds = function(value) { this.milliseconds = value; };
|
|
||||||
ParseDate.prototype.setSeconds = function(value) { this.seconds = value; };
|
|
||||||
ParseDate.prototype.setMinutes = function(value) { this.minutes = value; };
|
|
||||||
ParseDate.prototype.setHours = function(value) { this.hours = value; };
|
|
||||||
ParseDate.prototype.getHours = function() { return this.hours; };
|
|
||||||
ParseDate.prototype.setDate = function(value) { this.day = value; };
|
|
||||||
ParseDate.prototype.setMonth = function(value) { this.month = value; };
|
|
||||||
ParseDate.prototype.setFullYear = function(value) { this.year = value; };
|
|
||||||
ParseDate.prototype.fromDate = function(value) {
|
|
||||||
this.year = value.getFullYear();
|
|
||||||
this.month = value.getMonth();
|
|
||||||
this.day = value.getDate();
|
|
||||||
this.hours = value.getHours();
|
|
||||||
this.minutes = value.getMinutes();
|
|
||||||
this.seconds = value.getSeconds();
|
|
||||||
this.milliseconds = value.getMilliseconds();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
ParseDate.prototype.toDate = function() {
|
|
||||||
return new Date(this.year, this.month, this.day, this.hours, this.minutes, this.seconds, this.milliseconds);
|
|
||||||
};
|
|
||||||
|
|
||||||
var proto = ParseDate.prototype;
|
|
||||||
|
|
||||||
function noop() {
|
|
||||||
}
|
|
||||||
|
|
||||||
function isNumeric(n) {
|
|
||||||
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
function indexOfCaseInsensitive(array, value) {
|
|
||||||
var len = array.length, str=value.toString().toLowerCase();
|
|
||||||
for (var i=0; i<len; i++) {
|
|
||||||
if (array[i].toLowerCase() === str) { return i; }
|
|
||||||
}
|
|
||||||
return -1; // Return -1 per the "Array.indexOf()" method.
|
|
||||||
}
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
format: 'shortDate',
|
|
||||||
strict: false
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ["$locale", "dateFilter", function($locale, dateFilter) {
|
|
||||||
|
|
||||||
var DateParserFactory = function(config) {
|
|
||||||
|
|
||||||
var options = angular.extend({}, defaults, config);
|
|
||||||
|
|
||||||
var $dateParser = {};
|
|
||||||
|
|
||||||
var regExpMap = {
|
|
||||||
'sss' : '[0-9]{3}',
|
|
||||||
'ss' : '[0-5][0-9]',
|
|
||||||
's' : options.strict ? '[1-5]?[0-9]' : '[0-9]|[0-5][0-9]',
|
|
||||||
'mm' : '[0-5][0-9]',
|
|
||||||
'm' : options.strict ? '[1-5]?[0-9]' : '[0-9]|[0-5][0-9]',
|
|
||||||
'HH' : '[01][0-9]|2[0-3]',
|
|
||||||
'H' : options.strict ? '1?[0-9]|2[0-3]' : '[01]?[0-9]|2[0-3]',
|
|
||||||
'hh' : '[0][1-9]|[1][012]',
|
|
||||||
'h' : options.strict ? '[1-9]|1[012]' : '0?[1-9]|1[012]',
|
|
||||||
'a' : 'AM|PM',
|
|
||||||
'EEEE' : $locale.DATETIME_FORMATS.DAY.join('|'),
|
|
||||||
'EEE' : $locale.DATETIME_FORMATS.SHORTDAY.join('|'),
|
|
||||||
'dd' : '0[1-9]|[12][0-9]|3[01]',
|
|
||||||
'd' : options.strict ? '[1-9]|[1-2][0-9]|3[01]' : '0?[1-9]|[1-2][0-9]|3[01]',
|
|
||||||
'MMMM' : $locale.DATETIME_FORMATS.MONTH.join('|'),
|
|
||||||
'MMM' : $locale.DATETIME_FORMATS.SHORTMONTH.join('|'),
|
|
||||||
'MM' : '0[1-9]|1[012]',
|
|
||||||
'M' : options.strict ? '[1-9]|1[012]' : '0?[1-9]|1[012]',
|
|
||||||
'yyyy' : '[1]{1}[0-9]{3}|[2]{1}[0-9]{3}',
|
|
||||||
'yy' : '[0-9]{2}',
|
|
||||||
'y' : options.strict ? '-?(0|[1-9][0-9]{0,3})' : '-?0*[0-9]{1,4}',
|
|
||||||
};
|
|
||||||
|
|
||||||
var setFnMap = {
|
|
||||||
'sss' : proto.setMilliseconds,
|
|
||||||
'ss' : proto.setSeconds,
|
|
||||||
's' : proto.setSeconds,
|
|
||||||
'mm' : proto.setMinutes,
|
|
||||||
'm' : proto.setMinutes,
|
|
||||||
'HH' : proto.setHours,
|
|
||||||
'H' : proto.setHours,
|
|
||||||
'hh' : proto.setHours,
|
|
||||||
'h' : proto.setHours,
|
|
||||||
'EEEE' : noop,
|
|
||||||
'EEE' : noop,
|
|
||||||
'dd' : proto.setDate,
|
|
||||||
'd' : proto.setDate,
|
|
||||||
'a' : function(value) { var hours = this.getHours() % 12; return this.setHours(value.match(/pm/i) ? hours + 12 : hours); },
|
|
||||||
'MMMM' : function(value) { return this.setMonth(indexOfCaseInsensitive($locale.DATETIME_FORMATS.MONTH, value)); },
|
|
||||||
'MMM' : function(value) { return this.setMonth(indexOfCaseInsensitive($locale.DATETIME_FORMATS.SHORTMONTH, value)); },
|
|
||||||
'MM' : function(value) { return this.setMonth(1 * value - 1); },
|
|
||||||
'M' : function(value) { return this.setMonth(1 * value - 1); },
|
|
||||||
'yyyy' : proto.setFullYear,
|
|
||||||
'yy' : function(value) { return this.setFullYear(2000 + 1 * value); },
|
|
||||||
'y' : proto.setFullYear
|
|
||||||
};
|
|
||||||
|
|
||||||
var regex, setMap;
|
|
||||||
|
|
||||||
$dateParser.init = function() {
|
|
||||||
$dateParser.$format = $locale.DATETIME_FORMATS[options.format] || options.format;
|
|
||||||
regex = regExpForFormat($dateParser.$format);
|
|
||||||
setMap = setMapForFormat($dateParser.$format);
|
|
||||||
};
|
|
||||||
|
|
||||||
$dateParser.isValid = function(date) {
|
|
||||||
if(angular.isDate(date)) return !isNaN(date.getTime());
|
|
||||||
return regex.test(date);
|
|
||||||
};
|
|
||||||
|
|
||||||
$dateParser.parse = function(value, baseDate, format, timezone) {
|
|
||||||
// check for date format special names
|
|
||||||
if(format) format = $locale.DATETIME_FORMATS[format] || format;
|
|
||||||
if(angular.isDate(value)) value = dateFilter(value, format || $dateParser.$format, timezone);
|
|
||||||
var formatRegex = format ? regExpForFormat(format) : regex;
|
|
||||||
var formatSetMap = format ? setMapForFormat(format) : setMap;
|
|
||||||
var matches = formatRegex.exec(value);
|
|
||||||
if(!matches) return false;
|
|
||||||
// use custom ParseDate object to set parsed values
|
|
||||||
var date = baseDate && !isNaN(baseDate.getTime()) ? new ParseDate().fromDate(baseDate) : new ParseDate().fromDate(new Date(1970, 0, 1, 0));
|
|
||||||
for(var i = 0; i < matches.length - 1; i++) {
|
|
||||||
formatSetMap[i] && formatSetMap[i].call(date, matches[i+1]);
|
|
||||||
}
|
|
||||||
// convert back to native Date object
|
|
||||||
var newDate = date.toDate();
|
|
||||||
|
|
||||||
// check new native Date object for day values overflow
|
|
||||||
if (parseInt(date.day, 10) !== newDate.getDate()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return newDate;
|
|
||||||
};
|
|
||||||
|
|
||||||
$dateParser.getDateForAttribute = function(key, value) {
|
|
||||||
var date;
|
|
||||||
|
|
||||||
if(value === 'today') {
|
|
||||||
var today = new Date();
|
|
||||||
date = new Date(today.getFullYear(), today.getMonth(), today.getDate() + (key === 'maxDate' ? 1 : 0), 0, 0, 0, (key === 'minDate' ? 0 : -1));
|
|
||||||
} else if(angular.isString(value) && value.match(/^".+"$/)) { // Support {{ dateObj }}
|
|
||||||
date = new Date(value.substr(1, value.length - 2));
|
|
||||||
} else if(isNumeric(value)) {
|
|
||||||
date = new Date(parseInt(value, 10));
|
|
||||||
} else if (angular.isString(value) && 0 === value.length) { // Reset date
|
|
||||||
date = key === 'minDate' ? -Infinity : +Infinity;
|
|
||||||
} else {
|
|
||||||
date = new Date(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return date;
|
|
||||||
};
|
|
||||||
|
|
||||||
$dateParser.getTimeForAttribute = function(key, value) {
|
|
||||||
var time;
|
|
||||||
|
|
||||||
if(value === 'now') {
|
|
||||||
time = new Date().setFullYear(1970, 0, 1);
|
|
||||||
} else if(angular.isString(value) && value.match(/^".+"$/)) {
|
|
||||||
time = new Date(value.substr(1, value.length - 2)).setFullYear(1970, 0, 1);
|
|
||||||
} else if(isNumeric(value)) {
|
|
||||||
time = new Date(parseInt(value, 10)).setFullYear(1970, 0, 1);
|
|
||||||
} else if (angular.isString(value) && 0 === value.length) { // Reset time
|
|
||||||
time = key === 'minTime' ? -Infinity : +Infinity;
|
|
||||||
} else {
|
|
||||||
time = $dateParser.parse(value, new Date(1970, 0, 1, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return time;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Handle switch to/from daylight saving.
|
|
||||||
* Hours may be non-zero on daylight saving cut-over:
|
|
||||||
* > 12 when midnight changeover, but then cannot generate
|
|
||||||
* midnight datetime, so jump to 1AM, otherwise reset.
|
|
||||||
* @param date (Date) the date to check
|
|
||||||
* @return (Date) the corrected date
|
|
||||||
*
|
|
||||||
* __ copied from jquery ui datepicker __
|
|
||||||
*/
|
|
||||||
$dateParser.daylightSavingAdjust = function(date) {
|
|
||||||
if (!date) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
|
|
||||||
return date;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Correct the date for timezone offset.
|
|
||||||
* @param date (Date) the date to adjust
|
|
||||||
* @param timezone (string) the timezone to adjust for
|
|
||||||
* @param undo (boolean) to add or subtract timezone offset
|
|
||||||
* @return (Date) the corrected date
|
|
||||||
*/
|
|
||||||
$dateParser.timezoneOffsetAdjust = function(date, timezone, undo) {
|
|
||||||
if (!date) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// Right now, only 'UTC' is supported.
|
|
||||||
if (timezone && timezone === 'UTC') {
|
|
||||||
date = new Date(date.getTime());
|
|
||||||
date.setMinutes(date.getMinutes() + (undo?-1:1)*date.getTimezoneOffset());
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Private functions
|
|
||||||
|
|
||||||
function setMapForFormat(format) {
|
|
||||||
var keys = Object.keys(setFnMap), i;
|
|
||||||
var map = [], sortedMap = [];
|
|
||||||
// Map to setFn
|
|
||||||
var clonedFormat = format;
|
|
||||||
for(i = 0; i < keys.length; i++) {
|
|
||||||
if(format.split(keys[i]).length > 1) {
|
|
||||||
var index = clonedFormat.search(keys[i]);
|
|
||||||
format = format.split(keys[i]).join('');
|
|
||||||
if(setFnMap[keys[i]]) {
|
|
||||||
map[index] = setFnMap[keys[i]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Sort result map
|
|
||||||
angular.forEach(map, function(v) {
|
|
||||||
// conditional required since angular.forEach broke around v1.2.21
|
|
||||||
// related pr: https://github.com/angular/angular.js/pull/8525
|
|
||||||
if(v) sortedMap.push(v);
|
|
||||||
});
|
|
||||||
return sortedMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
function escapeReservedSymbols(text) {
|
|
||||||
return text.replace(/\//g, '[\\/]').replace('/-/g', '[-]').replace(/\./g, '[.]').replace(/\\s/g, '[\\s]');
|
|
||||||
}
|
|
||||||
|
|
||||||
function regExpForFormat(format) {
|
|
||||||
var keys = Object.keys(regExpMap), i;
|
|
||||||
|
|
||||||
var re = format;
|
|
||||||
// Abstract replaces to avoid collisions
|
|
||||||
for(i = 0; i < keys.length; i++) {
|
|
||||||
re = re.split(keys[i]).join('${' + i + '}');
|
|
||||||
}
|
|
||||||
// Replace abstracted values
|
|
||||||
for(i = 0; i < keys.length; i++) {
|
|
||||||
re = re.split('${' + i + '}').join('(' + regExpMap[keys[i]] + ')');
|
|
||||||
}
|
|
||||||
format = escapeReservedSymbols(format);
|
|
||||||
|
|
||||||
return new RegExp('^' + re + '$', ['i']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$dateParser.init();
|
|
||||||
return $dateParser;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
return DateParserFactory;
|
|
||||||
|
|
||||||
}];
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.helpers.dateParser",[]).provider("$dateParser",["$localeProvider",function(){function t(){this.year=1970,this.month=0,this.day=1,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0}function e(){}function n(t){return!isNaN(parseFloat(t))&&isFinite(t)}function s(t,e){for(var n=t.length,s=e.toString().toLowerCase(),r=0;n>r;r++)if(t[r].toLowerCase()===s)return r;return-1}t.prototype.setMilliseconds=function(t){this.milliseconds=t},t.prototype.setSeconds=function(t){this.seconds=t},t.prototype.setMinutes=function(t){this.minutes=t},t.prototype.setHours=function(t){this.hours=t},t.prototype.getHours=function(){return this.hours},t.prototype.setDate=function(t){this.day=t},t.prototype.setMonth=function(t){this.month=t},t.prototype.setFullYear=function(t){this.year=t},t.prototype.fromDate=function(t){return this.year=t.getFullYear(),this.month=t.getMonth(),this.day=t.getDate(),this.hours=t.getHours(),this.minutes=t.getMinutes(),this.seconds=t.getSeconds(),this.milliseconds=t.getMilliseconds(),this},t.prototype.toDate=function(){return new Date(this.year,this.month,this.day,this.hours,this.minutes,this.seconds,this.milliseconds)};var r=t.prototype,i=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale","dateFilter",function(o,a){var u=function(u){function h(t){var e,n=Object.keys(d),s=[],r=[],i=t;for(e=0;e<n.length;e++)if(t.split(n[e]).length>1){var o=i.search(n[e]);t=t.split(n[e]).join(""),d[n[e]]&&(s[o]=d[n[e]])}return angular.forEach(s,function(t){t&&r.push(t)}),r}function l(t){return t.replace(/\//g,"[\\/]").replace("/-/g","[-]").replace(/\./g,"[.]").replace(/\\s/g,"[\\s]")}function c(t){var e,n=Object.keys(p),s=t;for(e=0;e<n.length;e++)s=s.split(n[e]).join("${"+e+"}");for(e=0;e<n.length;e++)s=s.split("${"+e+"}").join("("+p[n[e]]+")");return t=l(t),new RegExp("^"+s+"$",["i"])}var f,M,g=angular.extend({},i,u),m={},p={sss:"[0-9]{3}",ss:"[0-5][0-9]",s:g.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",mm:"[0-5][0-9]",m:g.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",HH:"[01][0-9]|2[0-3]",H:g.strict?"1?[0-9]|2[0-3]":"[01]?[0-9]|2[0-3]",hh:"[0][1-9]|[1][012]",h:g.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",a:"AM|PM",EEEE:o.DATETIME_FORMATS.DAY.join("|"),EEE:o.DATETIME_FORMATS.SHORTDAY.join("|"),dd:"0[1-9]|[12][0-9]|3[01]",d:g.strict?"[1-9]|[1-2][0-9]|3[01]":"0?[1-9]|[1-2][0-9]|3[01]",MMMM:o.DATETIME_FORMATS.MONTH.join("|"),MMM:o.DATETIME_FORMATS.SHORTMONTH.join("|"),MM:"0[1-9]|1[012]",M:g.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",yyyy:"[1]{1}[0-9]{3}|[2]{1}[0-9]{3}",yy:"[0-9]{2}",y:g.strict?"-?(0|[1-9][0-9]{0,3})":"-?0*[0-9]{1,4}"},d={sss:r.setMilliseconds,ss:r.setSeconds,s:r.setSeconds,mm:r.setMinutes,m:r.setMinutes,HH:r.setHours,H:r.setHours,hh:r.setHours,h:r.setHours,EEEE:e,EEE:e,dd:r.setDate,d:r.setDate,a:function(t){var e=this.getHours()%12;return this.setHours(t.match(/pm/i)?e+12:e)},MMMM:function(t){return this.setMonth(s(o.DATETIME_FORMATS.MONTH,t))},MMM:function(t){return this.setMonth(s(o.DATETIME_FORMATS.SHORTMONTH,t))},MM:function(t){return this.setMonth(1*t-1)},M:function(t){return this.setMonth(1*t-1)},yyyy:r.setFullYear,yy:function(t){return this.setFullYear(2e3+1*t)},y:r.setFullYear};return m.init=function(){m.$format=o.DATETIME_FORMATS[g.format]||g.format,f=c(m.$format),M=h(m.$format)},m.isValid=function(t){return angular.isDate(t)?!isNaN(t.getTime()):f.test(t)},m.parse=function(e,n,s,r){s&&(s=o.DATETIME_FORMATS[s]||s),angular.isDate(e)&&(e=a(e,s||m.$format,r));var i=s?c(s):f,u=s?h(s):M,l=i.exec(e);if(!l)return!1;for(var g=(new t).fromDate(n&&!isNaN(n.getTime())?n:new Date(1970,0,1,0)),p=0;p<l.length-1;p++)u[p]&&u[p].call(g,l[p+1]);var d=g.toDate();return parseInt(g.day,10)!==d.getDate()?!1:d},m.getDateForAttribute=function(t,e){var s;if("today"===e){var r=new Date;s=new Date(r.getFullYear(),r.getMonth(),r.getDate()+("maxDate"===t?1:0),0,0,0,"minDate"===t?0:-1)}else s=angular.isString(e)&&e.match(/^".+"$/)?new Date(e.substr(1,e.length-2)):n(e)?new Date(parseInt(e,10)):angular.isString(e)&&0===e.length?"minDate"===t?-1/0:+1/0:new Date(e);return s},m.getTimeForAttribute=function(t,e){var s;return s="now"===e?(new Date).setFullYear(1970,0,1):angular.isString(e)&&e.match(/^".+"$/)?new Date(e.substr(1,e.length-2)).setFullYear(1970,0,1):n(e)?new Date(parseInt(e,10)).setFullYear(1970,0,1):angular.isString(e)&&0===e.length?"minTime"===t?-1/0:+1/0:m.parse(e,new Date(1970,0,1,0))},m.daylightSavingAdjust=function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},m.timezoneOffsetAdjust=function(t,e,n){return t?(e&&"UTC"===e&&(t=new Date(t.getTime()),t.setMinutes(t.getMinutes()+(n?-1:1)*t.getTimezoneOffset())),t):null},m.init(),m};return u}]}]);
|
|
||||||
//# sourceMappingURL=date-parser.min.js.map
|
|
File diff suppressed because one or more lines are too long
645
public/lib/angular-strap/dist/modules/datepicker.js
vendored
645
public/lib/angular-strap/dist/modules/datepicker.js
vendored
|
@ -1,645 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.datepicker', [
|
|
||||||
'mgcrea.ngStrap.helpers.dateParser',
|
|
||||||
'mgcrea.ngStrap.helpers.dateFormatter',
|
|
||||||
'mgcrea.ngStrap.tooltip'])
|
|
||||||
|
|
||||||
.provider('$datepicker', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
animation: 'am-fade',
|
|
||||||
prefixClass: 'datepicker',
|
|
||||||
placement: 'bottom-left',
|
|
||||||
template: 'datepicker/datepicker.tpl.html',
|
|
||||||
trigger: 'focus',
|
|
||||||
container: false,
|
|
||||||
keyboard: true,
|
|
||||||
html: false,
|
|
||||||
delay: 0,
|
|
||||||
// lang: $locale.id,
|
|
||||||
useNative: false,
|
|
||||||
dateType: 'date',
|
|
||||||
dateFormat: 'shortDate',
|
|
||||||
timezone: null,
|
|
||||||
modelDateFormat: null,
|
|
||||||
dayFormat: 'dd',
|
|
||||||
monthFormat: 'MMM',
|
|
||||||
yearFormat: 'yyyy',
|
|
||||||
monthTitleFormat: 'MMMM yyyy',
|
|
||||||
yearTitleFormat: 'yyyy',
|
|
||||||
strictFormat: false,
|
|
||||||
autoclose: false,
|
|
||||||
minDate: -Infinity,
|
|
||||||
maxDate: +Infinity,
|
|
||||||
startView: 0,
|
|
||||||
minView: 0,
|
|
||||||
startWeek: 0,
|
|
||||||
daysOfWeekDisabled: '',
|
|
||||||
iconLeft: 'glyphicon glyphicon-chevron-left',
|
|
||||||
iconRight: 'glyphicon glyphicon-chevron-right'
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$get = ["$window", "$document", "$rootScope", "$sce", "$dateFormatter", "datepickerViews", "$tooltip", "$timeout", function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {
|
|
||||||
|
|
||||||
var bodyEl = angular.element($window.document.body);
|
|
||||||
var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
|
|
||||||
var isTouch = ('createTouch' in $window.document) && isNative;
|
|
||||||
if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();
|
|
||||||
|
|
||||||
function DatepickerFactory(element, controller, config) {
|
|
||||||
|
|
||||||
var $datepicker = $tooltip(element, angular.extend({}, defaults, config));
|
|
||||||
var parentScope = config.scope;
|
|
||||||
var options = $datepicker.$options;
|
|
||||||
var scope = $datepicker.$scope;
|
|
||||||
if(options.startView) options.startView -= options.minView;
|
|
||||||
|
|
||||||
// View vars
|
|
||||||
|
|
||||||
var pickerViews = datepickerViews($datepicker);
|
|
||||||
$datepicker.$views = pickerViews.views;
|
|
||||||
var viewDate = pickerViews.viewDate;
|
|
||||||
scope.$mode = options.startView;
|
|
||||||
scope.$iconLeft = options.iconLeft;
|
|
||||||
scope.$iconRight = options.iconRight;
|
|
||||||
var $picker = $datepicker.$views[scope.$mode];
|
|
||||||
|
|
||||||
// Scope methods
|
|
||||||
|
|
||||||
scope.$select = function(date) {
|
|
||||||
$datepicker.select(date);
|
|
||||||
};
|
|
||||||
scope.$selectPane = function(value) {
|
|
||||||
$datepicker.$selectPane(value);
|
|
||||||
};
|
|
||||||
scope.$toggleMode = function() {
|
|
||||||
$datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Public methods
|
|
||||||
|
|
||||||
$datepicker.update = function(date) {
|
|
||||||
// console.warn('$datepicker.update() newValue=%o', date);
|
|
||||||
if(angular.isDate(date) && !isNaN(date.getTime())) {
|
|
||||||
$datepicker.$date = date;
|
|
||||||
$picker.update.call($picker, date);
|
|
||||||
}
|
|
||||||
// Build only if pristine
|
|
||||||
$datepicker.$build(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.updateDisabledDates = function(dateRanges) {
|
|
||||||
options.disabledDateRanges = dateRanges;
|
|
||||||
for(var i = 0, l = scope.rows.length; i < l; i++) {
|
|
||||||
angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.select = function(date, keep) {
|
|
||||||
// console.warn('$datepicker.select', date, scope.$mode);
|
|
||||||
if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);
|
|
||||||
if(!scope.$mode || keep) {
|
|
||||||
controller.$setViewValue(angular.copy(date));
|
|
||||||
controller.$render();
|
|
||||||
if(options.autoclose && !keep) {
|
|
||||||
$timeout(function() { $datepicker.hide(true); });
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});
|
|
||||||
$datepicker.setMode(scope.$mode - 1);
|
|
||||||
$datepicker.$build();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.setMode = function(mode) {
|
|
||||||
// console.warn('$datepicker.setMode', mode);
|
|
||||||
scope.$mode = mode;
|
|
||||||
$picker = $datepicker.$views[scope.$mode];
|
|
||||||
$datepicker.$build();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Protected methods
|
|
||||||
|
|
||||||
$datepicker.$build = function(pristine) {
|
|
||||||
// console.warn('$datepicker.$build() viewDate=%o', viewDate);
|
|
||||||
if(pristine === true && $picker.built) return;
|
|
||||||
if(pristine === false && !$picker.built) return;
|
|
||||||
$picker.build.call($picker);
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.$updateSelected = function() {
|
|
||||||
for(var i = 0, l = scope.rows.length; i < l; i++) {
|
|
||||||
angular.forEach(scope.rows[i], updateSelected);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.$isSelected = function(date) {
|
|
||||||
return $picker.isSelected(date);
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.$setDisabledEl = function(el) {
|
|
||||||
el.disabled = $picker.isDisabled(el.date);
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.$selectPane = function(value) {
|
|
||||||
var steps = $picker.steps;
|
|
||||||
// set targetDate to first day of month to avoid problems with
|
|
||||||
// date values rollover. This assumes the viewDate does not
|
|
||||||
// depend on the day of the month
|
|
||||||
var targetDate = new Date(Date.UTC(viewDate.year + ((steps.year || 0) * value), viewDate.month + ((steps.month || 0) * value), 1));
|
|
||||||
angular.extend(viewDate, {year: targetDate.getUTCFullYear(), month: targetDate.getUTCMonth(), date: targetDate.getUTCDate()});
|
|
||||||
$datepicker.$build();
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.$onMouseDown = function(evt) {
|
|
||||||
// Prevent blur on mousedown on .dropdown-menu
|
|
||||||
evt.preventDefault();
|
|
||||||
evt.stopPropagation();
|
|
||||||
// Emulate click for mobile devices
|
|
||||||
if(isTouch) {
|
|
||||||
var targetEl = angular.element(evt.target);
|
|
||||||
if(targetEl[0].nodeName.toLowerCase() !== 'button') {
|
|
||||||
targetEl = targetEl.parent();
|
|
||||||
}
|
|
||||||
targetEl.triggerHandler('click');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$datepicker.$onKeyDown = function(evt) {
|
|
||||||
if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;
|
|
||||||
evt.preventDefault();
|
|
||||||
evt.stopPropagation();
|
|
||||||
|
|
||||||
if(evt.keyCode === 13) {
|
|
||||||
if(!scope.$mode) {
|
|
||||||
return $datepicker.hide(true);
|
|
||||||
} else {
|
|
||||||
return scope.$apply(function() { $datepicker.setMode(scope.$mode - 1); });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Navigate with keyboard
|
|
||||||
$picker.onKeyDown(evt);
|
|
||||||
parentScope.$digest();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Private
|
|
||||||
|
|
||||||
function updateSelected(el) {
|
|
||||||
el.selected = $datepicker.$isSelected(el.date);
|
|
||||||
}
|
|
||||||
|
|
||||||
function focusElement() {
|
|
||||||
element[0].focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overrides
|
|
||||||
|
|
||||||
var _init = $datepicker.init;
|
|
||||||
$datepicker.init = function() {
|
|
||||||
if(isNative && options.useNative) {
|
|
||||||
element.prop('type', 'date');
|
|
||||||
element.css('-webkit-appearance', 'textfield');
|
|
||||||
return;
|
|
||||||
} else if(isTouch) {
|
|
||||||
element.prop('type', 'text');
|
|
||||||
element.attr('readonly', 'true');
|
|
||||||
element.on('click', focusElement);
|
|
||||||
}
|
|
||||||
_init();
|
|
||||||
};
|
|
||||||
|
|
||||||
var _destroy = $datepicker.destroy;
|
|
||||||
$datepicker.destroy = function() {
|
|
||||||
if(isNative && options.useNative) {
|
|
||||||
element.off('click', focusElement);
|
|
||||||
}
|
|
||||||
_destroy();
|
|
||||||
};
|
|
||||||
|
|
||||||
var _show = $datepicker.show;
|
|
||||||
$datepicker.show = function() {
|
|
||||||
_show();
|
|
||||||
// use timeout to hookup the events to prevent
|
|
||||||
// event bubbling from being processed imediately.
|
|
||||||
$timeout(function() {
|
|
||||||
// if $datepicker is no longer showing, don't setup events
|
|
||||||
if(!$datepicker.$isShown) return;
|
|
||||||
$datepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);
|
|
||||||
if(options.keyboard) {
|
|
||||||
element.on('keydown', $datepicker.$onKeyDown);
|
|
||||||
}
|
|
||||||
}, 0, false);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _hide = $datepicker.hide;
|
|
||||||
$datepicker.hide = function(blur) {
|
|
||||||
if(!$datepicker.$isShown) return;
|
|
||||||
$datepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);
|
|
||||||
if(options.keyboard) {
|
|
||||||
element.off('keydown', $datepicker.$onKeyDown);
|
|
||||||
}
|
|
||||||
_hide(blur);
|
|
||||||
};
|
|
||||||
|
|
||||||
return $datepicker;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DatepickerFactory.defaults = defaults;
|
|
||||||
return DatepickerFactory;
|
|
||||||
|
|
||||||
}];
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
.directive('bsDatepicker', ["$window", "$parse", "$q", "$dateFormatter", "$dateParser", "$datepicker", function($window, $parse, $q, $dateFormatter, $dateParser, $datepicker) {
|
|
||||||
|
|
||||||
var defaults = $datepicker.defaults;
|
|
||||||
var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
|
|
||||||
|
|
||||||
return {
|
|
||||||
restrict: 'EAC',
|
|
||||||
require: 'ngModel',
|
|
||||||
link: function postLink(scope, element, attr, controller) {
|
|
||||||
|
|
||||||
// Directive options
|
|
||||||
var options = {scope: scope, controller: controller};
|
|
||||||
angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'dateType', 'dateFormat', 'timezone', 'modelDateFormat', 'dayFormat', 'strictFormat', 'startWeek', 'startDate', 'useNative', 'lang', 'startView', 'minView', 'iconLeft', 'iconRight', 'daysOfWeekDisabled', 'id'], function(key) {
|
|
||||||
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Visibility binding support
|
|
||||||
attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
|
|
||||||
if(!datepicker || !angular.isDefined(newValue)) return;
|
|
||||||
if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(datepicker),?/i);
|
|
||||||
newValue === true ? datepicker.show() : datepicker.hide();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Initialize datepicker
|
|
||||||
var datepicker = $datepicker(element, controller, options);
|
|
||||||
options = datepicker.$options;
|
|
||||||
// Set expected iOS format
|
|
||||||
if(isNative && options.useNative) options.dateFormat = 'yyyy-MM-dd';
|
|
||||||
|
|
||||||
var lang = options.lang;
|
|
||||||
|
|
||||||
var formatDate = function(date, format) {
|
|
||||||
return $dateFormatter.formatDate(date, format, lang);
|
|
||||||
};
|
|
||||||
|
|
||||||
var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});
|
|
||||||
|
|
||||||
// Observe attributes for changes
|
|
||||||
angular.forEach(['minDate', 'maxDate'], function(key) {
|
|
||||||
// console.warn('attr.$observe(%s)', key, attr[key]);
|
|
||||||
angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {
|
|
||||||
// console.warn('attr.$observe(%s)=%o', key, newValue);
|
|
||||||
datepicker.$options[key] = dateParser.getDateForAttribute(key, newValue);
|
|
||||||
// Build only if dirty
|
|
||||||
!isNaN(datepicker.$options[key]) && datepicker.$build(false);
|
|
||||||
validateAgainstMinMaxDate(controller.$dateValue);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Watch model for changes
|
|
||||||
scope.$watch(attr.ngModel, function(newValue, oldValue) {
|
|
||||||
datepicker.update(controller.$dateValue);
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
// Normalize undefined/null/empty array,
|
|
||||||
// so that we don't treat changing from undefined->null as a change.
|
|
||||||
function normalizeDateRanges(ranges) {
|
|
||||||
if (!ranges || !ranges.length) return null;
|
|
||||||
return ranges;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (angular.isDefined(attr.disabledDates)) {
|
|
||||||
scope.$watch(attr.disabledDates, function(disabledRanges, previousValue) {
|
|
||||||
disabledRanges = normalizeDateRanges(disabledRanges);
|
|
||||||
previousValue = normalizeDateRanges(previousValue);
|
|
||||||
|
|
||||||
if (disabledRanges) {
|
|
||||||
datepicker.updateDisabledDates(disabledRanges);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateAgainstMinMaxDate(parsedDate) {
|
|
||||||
if (!angular.isDate(parsedDate)) return;
|
|
||||||
var isMinValid = isNaN(datepicker.$options.minDate) || parsedDate.getTime() >= datepicker.$options.minDate;
|
|
||||||
var isMaxValid = isNaN(datepicker.$options.maxDate) || parsedDate.getTime() <= datepicker.$options.maxDate;
|
|
||||||
var isValid = isMinValid && isMaxValid;
|
|
||||||
controller.$setValidity('date', isValid);
|
|
||||||
controller.$setValidity('min', isMinValid);
|
|
||||||
controller.$setValidity('max', isMaxValid);
|
|
||||||
// Only update the model when we have a valid date
|
|
||||||
if(isValid) controller.$dateValue = parsedDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
// viewValue -> $parsers -> modelValue
|
|
||||||
controller.$parsers.unshift(function(viewValue) {
|
|
||||||
// console.warn('$parser("%s"): viewValue=%o', element.attr('ng-model'), viewValue);
|
|
||||||
var date;
|
|
||||||
// Null values should correctly reset the model value & validity
|
|
||||||
if(!viewValue) {
|
|
||||||
controller.$setValidity('date', true);
|
|
||||||
// BREAKING CHANGE:
|
|
||||||
// return null (not undefined) when input value is empty, so angularjs 1.3
|
|
||||||
// ngModelController can go ahead and run validators, like ngRequired
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var parsedDate = dateParser.parse(viewValue, controller.$dateValue);
|
|
||||||
if(!parsedDate || isNaN(parsedDate.getTime())) {
|
|
||||||
controller.$setValidity('date', false);
|
|
||||||
// return undefined, causes ngModelController to
|
|
||||||
// invalidate model value
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
validateAgainstMinMaxDate(parsedDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(options.dateType === 'string') {
|
|
||||||
date = dateParser.timezoneOffsetAdjust(parsedDate, options.timezone, true);
|
|
||||||
return formatDate(date, options.modelDateFormat || options.dateFormat);
|
|
||||||
}
|
|
||||||
date = dateParser.timezoneOffsetAdjust(controller.$dateValue, options.timezone, true);
|
|
||||||
if(options.dateType === 'number') {
|
|
||||||
return date.getTime();
|
|
||||||
} else if(options.dateType === 'unix') {
|
|
||||||
return date.getTime() / 1000;
|
|
||||||
} else if(options.dateType === 'iso') {
|
|
||||||
return date.toISOString();
|
|
||||||
} else {
|
|
||||||
return new Date(date);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// modelValue -> $formatters -> viewValue
|
|
||||||
controller.$formatters.push(function(modelValue) {
|
|
||||||
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
|
|
||||||
var date;
|
|
||||||
if(angular.isUndefined(modelValue) || modelValue === null) {
|
|
||||||
date = NaN;
|
|
||||||
} else if(angular.isDate(modelValue)) {
|
|
||||||
date = modelValue;
|
|
||||||
} else if(options.dateType === 'string') {
|
|
||||||
date = dateParser.parse(modelValue, null, options.modelDateFormat);
|
|
||||||
} else if(options.dateType === 'unix') {
|
|
||||||
date = new Date(modelValue * 1000);
|
|
||||||
} else {
|
|
||||||
date = new Date(modelValue);
|
|
||||||
}
|
|
||||||
// Setup default value?
|
|
||||||
// if(isNaN(date.getTime())) {
|
|
||||||
// var today = new Date();
|
|
||||||
// date = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);
|
|
||||||
// }
|
|
||||||
controller.$dateValue = dateParser.timezoneOffsetAdjust(date, options.timezone);
|
|
||||||
return getDateFormattedString();
|
|
||||||
});
|
|
||||||
|
|
||||||
// viewValue -> element
|
|
||||||
controller.$render = function() {
|
|
||||||
// console.warn('$render("%s"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);
|
|
||||||
element.val(getDateFormattedString());
|
|
||||||
};
|
|
||||||
|
|
||||||
function getDateFormattedString() {
|
|
||||||
return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.dateFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Garbage collection
|
|
||||||
scope.$on('$destroy', function() {
|
|
||||||
if(datepicker) datepicker.destroy();
|
|
||||||
options = null;
|
|
||||||
datepicker = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}])
|
|
||||||
|
|
||||||
.provider('datepickerViews', function() {
|
|
||||||
|
|
||||||
var defaults = this.defaults = {
|
|
||||||
dayFormat: 'dd',
|
|
||||||
daySplit: 7
|
|
||||||
};
|
|
||||||
|
|
||||||
// Split array into smaller arrays
|
|
||||||
function split(arr, size) {
|
|
||||||
var arrays = [];
|
|
||||||
while(arr.length > 0) {
|
|
||||||
arrays.push(arr.splice(0, size));
|
|
||||||
}
|
|
||||||
return arrays;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modulus operator
|
|
||||||
function mod(n, m) {
|
|
||||||
return ((n % m) + m) % m;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$get = ["$dateFormatter", "$dateParser", "$sce", function($dateFormatter, $dateParser, $sce) {
|
|
||||||
|
|
||||||
return function(picker) {
|
|
||||||
|
|
||||||
var scope = picker.$scope;
|
|
||||||
var options = picker.$options;
|
|
||||||
|
|
||||||
var lang = options.lang;
|
|
||||||
var formatDate = function(date, format) {
|
|
||||||
return $dateFormatter.formatDate(date, format, lang);
|
|
||||||
};
|
|
||||||
var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});
|
|
||||||
|
|
||||||
var weekDaysMin = $dateFormatter.weekdaysShort(lang);
|
|
||||||
var weekDaysLabels = weekDaysMin.slice(options.startWeek).concat(weekDaysMin.slice(0, options.startWeek));
|
|
||||||
var weekDaysLabelsHtml = $sce.trustAsHtml('<th class="dow text-center">' + weekDaysLabels.join('</th><th class="dow text-center">') + '</th>');
|
|
||||||
|
|
||||||
var startDate = picker.$date || (options.startDate ? dateParser.getDateForAttribute('startDate', options.startDate) : new Date());
|
|
||||||
var viewDate = {year: startDate.getFullYear(), month: startDate.getMonth(), date: startDate.getDate()};
|
|
||||||
|
|
||||||
var views = [{
|
|
||||||
format: options.dayFormat,
|
|
||||||
split: 7,
|
|
||||||
steps: { month: 1 },
|
|
||||||
update: function(date, force) {
|
|
||||||
if(!this.built || force || date.getFullYear() !== viewDate.year || date.getMonth() !== viewDate.month) {
|
|
||||||
angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});
|
|
||||||
picker.$build();
|
|
||||||
} else if(date.getDate() !== viewDate.date) {
|
|
||||||
viewDate.date = picker.$date.getDate();
|
|
||||||
picker.$updateSelected();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
build: function() {
|
|
||||||
var firstDayOfMonth = new Date(viewDate.year, viewDate.month, 1), firstDayOfMonthOffset = firstDayOfMonth.getTimezoneOffset();
|
|
||||||
var firstDate = new Date(+firstDayOfMonth - mod(firstDayOfMonth.getDay() - options.startWeek, 7) * 864e5), firstDateOffset = firstDate.getTimezoneOffset();
|
|
||||||
var today = dateParser.timezoneOffsetAdjust(new Date(), options.timezone).toDateString();
|
|
||||||
// Handle daylight time switch
|
|
||||||
if(firstDateOffset !== firstDayOfMonthOffset) firstDate = new Date(+firstDate + (firstDateOffset - firstDayOfMonthOffset) * 60e3);
|
|
||||||
var days = [], day;
|
|
||||||
for(var i = 0; i < 42; i++) { // < 7 * 6
|
|
||||||
day = dateParser.daylightSavingAdjust(new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate() + i));
|
|
||||||
days.push({date: day, isToday: day.toDateString() === today, label: formatDate(day, this.format), selected: picker.$date && this.isSelected(day), muted: day.getMonth() !== viewDate.month, disabled: this.isDisabled(day)});
|
|
||||||
}
|
|
||||||
scope.title = formatDate(firstDayOfMonth, options.monthTitleFormat);
|
|
||||||
scope.showLabels = true;
|
|
||||||
scope.labels = weekDaysLabelsHtml;
|
|
||||||
scope.rows = split(days, this.split);
|
|
||||||
this.built = true;
|
|
||||||
},
|
|
||||||
isSelected: function(date) {
|
|
||||||
return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth() && date.getDate() === picker.$date.getDate();
|
|
||||||
},
|
|
||||||
isDisabled: function(date) {
|
|
||||||
var time = date.getTime();
|
|
||||||
|
|
||||||
// Disabled because of min/max date.
|
|
||||||
if (time < options.minDate || time > options.maxDate) return true;
|
|
||||||
|
|
||||||
// Disabled due to being a disabled day of the week
|
|
||||||
if (options.daysOfWeekDisabled.indexOf(date.getDay()) !== -1) return true;
|
|
||||||
|
|
||||||
// Disabled because of disabled date range.
|
|
||||||
if (options.disabledDateRanges) {
|
|
||||||
for (var i = 0; i < options.disabledDateRanges.length; i++) {
|
|
||||||
if (time >= options.disabledDateRanges[i].start && time <= options.disabledDateRanges[i].end) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
onKeyDown: function(evt) {
|
|
||||||
if (!picker.$date) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var actualTime = picker.$date.getTime();
|
|
||||||
var newDate;
|
|
||||||
|
|
||||||
if(evt.keyCode === 37) newDate = new Date(actualTime - 1 * 864e5);
|
|
||||||
else if(evt.keyCode === 38) newDate = new Date(actualTime - 7 * 864e5);
|
|
||||||
else if(evt.keyCode === 39) newDate = new Date(actualTime + 1 * 864e5);
|
|
||||||
else if(evt.keyCode === 40) newDate = new Date(actualTime + 7 * 864e5);
|
|
||||||
|
|
||||||
if (!this.isDisabled(newDate)) picker.select(newDate, true);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
name: 'month',
|
|
||||||
format: options.monthFormat,
|
|
||||||
split: 4,
|
|
||||||
steps: { year: 1 },
|
|
||||||
update: function(date, force) {
|
|
||||||
if(!this.built || date.getFullYear() !== viewDate.year) {
|
|
||||||
angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});
|
|
||||||
picker.$build();
|
|
||||||
} else if(date.getMonth() !== viewDate.month) {
|
|
||||||
angular.extend(viewDate, {month: picker.$date.getMonth(), date: picker.$date.getDate()});
|
|
||||||
picker.$updateSelected();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
build: function() {
|
|
||||||
var firstMonth = new Date(viewDate.year, 0, 1);
|
|
||||||
var months = [], month;
|
|
||||||
for (var i = 0; i < 12; i++) {
|
|
||||||
month = new Date(viewDate.year, i, 1);
|
|
||||||
months.push({date: month, label: formatDate(month, this.format), selected: picker.$isSelected(month), disabled: this.isDisabled(month)});
|
|
||||||
}
|
|
||||||
scope.title = formatDate(month, options.yearTitleFormat);
|
|
||||||
scope.showLabels = false;
|
|
||||||
scope.rows = split(months, this.split);
|
|
||||||
this.built = true;
|
|
||||||
},
|
|
||||||
isSelected: function(date) {
|
|
||||||
return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth();
|
|
||||||
},
|
|
||||||
isDisabled: function(date) {
|
|
||||||
var lastDate = +new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
||||||
return lastDate < options.minDate || date.getTime() > options.maxDate;
|
|
||||||
},
|
|
||||||
onKeyDown: function(evt) {
|
|
||||||
if (!picker.$date) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var actualMonth = picker.$date.getMonth();
|
|
||||||
var newDate = new Date(picker.$date);
|
|
||||||
|
|
||||||
if(evt.keyCode === 37) newDate.setMonth(actualMonth - 1);
|
|
||||||
else if(evt.keyCode === 38) newDate.setMonth(actualMonth - 4);
|
|
||||||
else if(evt.keyCode === 39) newDate.setMonth(actualMonth + 1);
|
|
||||||
else if(evt.keyCode === 40) newDate.setMonth(actualMonth + 4);
|
|
||||||
|
|
||||||
if (!this.isDisabled(newDate)) picker.select(newDate, true);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
name: 'year',
|
|
||||||
format: options.yearFormat,
|
|
||||||
split: 4,
|
|
||||||
steps: { year: 12 },
|
|
||||||
update: function(date, force) {
|
|
||||||
if(!this.built || force || parseInt(date.getFullYear()/20, 10) !== parseInt(viewDate.year/20, 10)) {
|
|
||||||
angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});
|
|
||||||
picker.$build();
|
|
||||||
} else if(date.getFullYear() !== viewDate.year) {
|
|
||||||
angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});
|
|
||||||
picker.$updateSelected();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
build: function() {
|
|
||||||
var firstYear = viewDate.year - viewDate.year % (this.split * 3);
|
|
||||||
var years = [], year;
|
|
||||||
for (var i = 0; i < 12; i++) {
|
|
||||||
year = new Date(firstYear + i, 0, 1);
|
|
||||||
years.push({date: year, label: formatDate(year, this.format), selected: picker.$isSelected(year), disabled: this.isDisabled(year)});
|
|
||||||
}
|
|
||||||
scope.title = years[0].label + '-' + years[years.length - 1].label;
|
|
||||||
scope.showLabels = false;
|
|
||||||
scope.rows = split(years, this.split);
|
|
||||||
this.built = true;
|
|
||||||
},
|
|
||||||
isSelected: function(date) {
|
|
||||||
return picker.$date && date.getFullYear() === picker.$date.getFullYear();
|
|
||||||
},
|
|
||||||
isDisabled: function(date) {
|
|
||||||
var lastDate = +new Date(date.getFullYear() + 1, 0, 0);
|
|
||||||
return lastDate < options.minDate || date.getTime() > options.maxDate;
|
|
||||||
},
|
|
||||||
onKeyDown: function(evt) {
|
|
||||||
if (!picker.$date) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var actualYear = picker.$date.getFullYear(),
|
|
||||||
newDate = new Date(picker.$date);
|
|
||||||
|
|
||||||
if(evt.keyCode === 37) newDate.setYear(actualYear - 1);
|
|
||||||
else if(evt.keyCode === 38) newDate.setYear(actualYear - 4);
|
|
||||||
else if(evt.keyCode === 39) newDate.setYear(actualYear + 1);
|
|
||||||
else if(evt.keyCode === 40) newDate.setYear(actualYear + 4);
|
|
||||||
|
|
||||||
if (!this.isDisabled(newDate)) picker.select(newDate, true);
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
|
|
||||||
return {
|
|
||||||
views: options.minView ? Array.prototype.slice.call(views, options.minView) : views,
|
|
||||||
viewDate: viewDate
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}];
|
|
||||||
|
|
||||||
});
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,14 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.datepicker').run(['$templateCache', function($templateCache) {
|
|
||||||
|
|
||||||
$templateCache.put('datepicker/datepicker.tpl.html', '<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px"><table style="table-layout: fixed; height: 100%; width: 100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)"><i class="{{$iconLeft}}"></i></button></th><th colspan="{{ rows[0].length - 2 }}"><button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()"><strong style="text-transform: capitalize" ng-bind="title"></strong></button></th><th><button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)"><i class="{{$iconRight}}"></i></button></th></tr><tr ng-show="showLabels" ng-bind-html="labels"></tr></thead><tbody><tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%"><td class="text-center" ng-repeat="(j, el) in row"><button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date)" ng-disabled="el.disabled"><span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span></button></td></tr></tbody></table></div>');
|
|
||||||
|
|
||||||
}]);
|
|
|
@ -1,8 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function(t){t.put("datepicker/datepicker.tpl.html",'<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px"><table style="table-layout: fixed; height: 100%; width: 100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)"><i class="{{$iconLeft}}"></i></button></th><th colspan="{{ rows[0].length - 2 }}"><button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()"><strong style="text-transform: capitalize" ng-bind="title"></strong></button></th><th><button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)"><i class="{{$iconRight}}"></i></button></th></tr><tr ng-show="showLabels" ng-bind-html="labels"></tr></thead><tbody><tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%"><td class="text-center" ng-repeat="(j, el) in row"><button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date)" ng-disabled="el.disabled"><span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span></button></td></tr></tbody></table></div>')}]);
|
|
|
@ -1,62 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
angular.module('mgcrea.ngStrap.helpers.debounce', [])
|
|
||||||
|
|
||||||
// @source jashkenas/underscore
|
|
||||||
// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L693
|
|
||||||
.factory('debounce', ["$timeout", function($timeout) {
|
|
||||||
return function(func, wait, immediate) {
|
|
||||||
var timeout = null;
|
|
||||||
return function() {
|
|
||||||
var context = this,
|
|
||||||
args = arguments,
|
|
||||||
callNow = immediate && !timeout;
|
|
||||||
if(timeout) {
|
|
||||||
$timeout.cancel(timeout);
|
|
||||||
}
|
|
||||||
timeout = $timeout(function later() {
|
|
||||||
timeout = null;
|
|
||||||
if(!immediate) {
|
|
||||||
func.apply(context, args);
|
|
||||||
}
|
|
||||||
}, wait, false);
|
|
||||||
if(callNow) {
|
|
||||||
func.apply(context, args);
|
|
||||||
}
|
|
||||||
return timeout;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}])
|
|
||||||
|
|
||||||
|
|
||||||
// @source jashkenas/underscore
|
|
||||||
// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L661
|
|
||||||
.factory('throttle', ["$timeout", function($timeout) {
|
|
||||||
return function(func, wait, options) {
|
|
||||||
var timeout = null;
|
|
||||||
options || (options = {});
|
|
||||||
return function() {
|
|
||||||
var context = this,
|
|
||||||
args = arguments;
|
|
||||||
if(!timeout) {
|
|
||||||
if(options.leading !== false) {
|
|
||||||
func.apply(context, args);
|
|
||||||
}
|
|
||||||
timeout = $timeout(function later() {
|
|
||||||
timeout = null;
|
|
||||||
if(options.trailing !== false) {
|
|
||||||
func.apply(context, args);
|
|
||||||
}
|
|
||||||
}, wait, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}]);
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
/**
|
|
||||||
* angular-strap
|
|
||||||
* @version v2.2.1 - 2015-03-10
|
|
||||||
* @link http://mgcrea.github.io/angular-strap
|
|
||||||
* @author Olivier Louvignes (olivier@mg-crea.com)
|
|
||||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
"use strict";angular.module("mgcrea.ngStrap.helpers.debounce",[]).factory("debounce",["$timeout",function(n){return function(t,u,r){var e=null;return function(){var a=this,l=arguments,c=r&&!e;return e&&n.cancel(e),e=n(function(){e=null,r||t.apply(a,l)},u,!1),c&&t.apply(a,l),e}}}]).factory("throttle",["$timeout",function(n){return function(t,u,r){var e=null;return r||(r={}),function(){var a=this,l=arguments;e||(r.leading!==!1&&t.apply(a,l),e=n(function(){e=null,r.trailing!==!1&&t.apply(a,l)},u,!1))}}}]);
|
|
||||||
//# sourceMappingURL=debounce.min.js.map
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue