Merge pull request #119 from nextcloud/compiled
Remove autogenerated files from repository, closes #118
This commit is contained in:
commit
8ec6d8f4a6
180 changed files with 9 additions and 75750 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -1,3 +1,12 @@
|
|||
######################
|
||||
## Files build by make
|
||||
######################
|
||||
/css/src/sprite.scss
|
||||
/css/style.scss
|
||||
/img/sprites.svg
|
||||
/js/public/
|
||||
/js/vendor/
|
||||
|
||||
#################
|
||||
## PhpStorm
|
||||
#################
|
||||
|
|
|
@ -1,142 +0,0 @@
|
|||
.icon {
|
||||
background: url("../img/sprites.svg") no-repeat;
|
||||
}
|
||||
|
||||
.icon-add {
|
||||
background-position: 20% 0;
|
||||
}
|
||||
|
||||
.icon-all {
|
||||
background-position: 80% 20%;
|
||||
}
|
||||
|
||||
.icon-alphabetically {
|
||||
background-position: 0 20%;
|
||||
}
|
||||
|
||||
.icon-calendar {
|
||||
background-position: 20% 20%;
|
||||
}
|
||||
|
||||
.icon-calendar-due {
|
||||
background-position: 40% 0;
|
||||
}
|
||||
|
||||
.icon-calendar-overdue {
|
||||
background-position: 40% 20%;
|
||||
}
|
||||
|
||||
.icon-checkmark {
|
||||
background-position: 0 40%;
|
||||
}
|
||||
|
||||
.icon-checkmark-color {
|
||||
background-position: 20% 40%;
|
||||
}
|
||||
|
||||
.icon-clock {
|
||||
background-position: 40% 40%;
|
||||
}
|
||||
|
||||
.icon-clock-due {
|
||||
background-position: 60% 0;
|
||||
}
|
||||
|
||||
.icon-clock-overdue {
|
||||
background-position: 60% 20%;
|
||||
}
|
||||
|
||||
.icon-close {
|
||||
background-position: 60% 40%;
|
||||
}
|
||||
|
||||
.icon-current {
|
||||
background-position: 0 60%;
|
||||
}
|
||||
|
||||
.icon-hide {
|
||||
background-position: 20% 60%;
|
||||
}
|
||||
|
||||
.icon-manual {
|
||||
background-position: 40% 60%;
|
||||
}
|
||||
|
||||
.icon-menu {
|
||||
background-position: 60% 60%;
|
||||
}
|
||||
|
||||
.icon-note {
|
||||
background-position: 80% 0;
|
||||
}
|
||||
|
||||
.icon-percent {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
.icon-percent-active {
|
||||
background-position: 80% 40%;
|
||||
}
|
||||
|
||||
.icon-random {
|
||||
background-position: 80% 60%;
|
||||
}
|
||||
|
||||
.icon-settings {
|
||||
background-position: 0 80%;
|
||||
}
|
||||
|
||||
.icon-sort-down {
|
||||
background-position: 20% 80%;
|
||||
}
|
||||
|
||||
.icon-sort-up {
|
||||
background-position: 40% 80%;
|
||||
}
|
||||
|
||||
.icon-subtasks-hidden,
|
||||
.icon-subtasks-hidden\:regular {
|
||||
background-position: 60% 80%;
|
||||
}
|
||||
|
||||
.icon-subtasks-hidden:hover,
|
||||
.icon-subtasks-hidden\:hover {
|
||||
background-position: 80% 80%;
|
||||
}
|
||||
|
||||
.icon-subtasks-visible {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
|
||||
.icon-tag {
|
||||
background-position: 100% 20%;
|
||||
}
|
||||
|
||||
.icon-tag-active {
|
||||
background-position: 100% 40%;
|
||||
}
|
||||
|
||||
.icon-task-star {
|
||||
background-position: 100% 60%;
|
||||
}
|
||||
|
||||
.icon-task-star-high {
|
||||
background-position: 100% 80%;
|
||||
}
|
||||
|
||||
.icon-task-star-low {
|
||||
background-position: 0 100%;
|
||||
}
|
||||
|
||||
.icon-task-star-medium {
|
||||
background-position: 20% 100%;
|
||||
}
|
||||
|
||||
.icon-toggle {
|
||||
background-position: 40% 100%;
|
||||
}
|
||||
|
||||
.icon-trash {
|
||||
background-position: 60% 100%;
|
||||
}
|
||||
|
1695
css/style.scss
1695
css/style.scss
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 13 KiB |
4
js/public/app.min.js
vendored
4
js/public/app.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
68
js/vendor/angular-animate/README.md
vendored
68
js/vendor/angular-animate/README.md
vendored
|
@ -1,68 +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
|
||||
```
|
||||
|
||||
Then add `ngAnimate` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', [require('angular-animate')]);
|
||||
```
|
||||
|
||||
### 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-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.
|
4147
js/vendor/angular-animate/angular-animate.js
vendored
4147
js/vendor/angular-animate/angular-animate.js
vendored
File diff suppressed because it is too large
Load diff
56
js/vendor/angular-animate/angular-animate.min.js
vendored
56
js/vendor/angular-animate/angular-animate.min.js
vendored
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
AngularJS v1.5.5
|
||||
(c) 2010-2016 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(S,q){'use strict';function Aa(a,b,c){if(!a)throw Ma("areq",b||"?",c||"required");return a}function Ba(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;ba(a)&&(a=a.join(" "));ba(b)&&(b=b.join(" "));return a+" "+b}function Na(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function X(a,b,c){var d="";a=ba(a)?a:a&&P(a)&&a.length?a.split(/\s+/):[];r(a,function(a,f){a&&0<a.length&&(d+=0<f?" ":"",d+=c?b+a:a+b)});return d}function Oa(a){if(a instanceof G)switch(a.length){case 0:return[];
|
||||
case 1:if(1===a[0].nodeType)return a;break;default:return G(ca(a))}if(1===a.nodeType)return G(a)}function ca(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1==c.nodeType)return c}}function Pa(a,b,c){r(b,function(b){a.addClass(b,c)})}function Qa(a,b,c){r(b,function(b){a.removeClass(b,c)})}function U(a){return function(b,c){c.addClass&&(Pa(a,b,c.addClass),c.addClass=null);c.removeClass&&(Qa(a,b,c.removeClass),c.removeClass=null)}}function pa(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
|
||||
Q;a.domOperation=function(){a.$$domOperationFired=!0;b();b=Q};a.$$prepared=!0}return a}function ga(a,b){Ca(a,b);Da(a,b)}function Ca(a,b){b.from&&(a.css(b.from),b.from=null)}function Da(a,b){b.to&&(a.css(b.to),b.to=null)}function V(a,b,c){var d=b.options||{};c=c.options||{};var e=(d.addClass||"")+" "+(c.addClass||""),f=(d.removeClass||"")+" "+(c.removeClass||"");a=Ra(a.attr("class"),e,f);c.preparationClasses&&(d.preparationClasses=Y(c.preparationClasses,d.preparationClasses),delete c.preparationClasses);
|
||||
e=d.domOperation!==Q?d.domOperation:null;Ea(d,c);e&&(d.domOperation=e);d.addClass=a.addClass?a.addClass:null;d.removeClass=a.removeClass?a.removeClass:null;b.addClass=d.addClass;b.removeClass=d.removeClass;return d}function Ra(a,b,c){function d(a){P(a)&&(a=a.split(" "));var b={};r(a,function(a){a.length&&(b[a]=!0)});return b}var e={};a=d(a);b=d(b);r(b,function(a,b){e[b]=1});c=d(c);r(c,function(a,b){e[b]=1===e[b]?null:-1});var f={addClass:"",removeClass:""};r(e,function(b,c){var d,e;1===b?(d="addClass",
|
||||
e=!a[c]):-1===b&&(d="removeClass",e=a[c]);e&&(f[d].length&&(f[d]+=" "),f[d]+=c)});return f}function D(a){return a instanceof q.element?a[0]:a}function Sa(a,b,c){var d="";b&&(d=X(b,"ng-",!0));c.addClass&&(d=Y(d,X(c.addClass,"-add")));c.removeClass&&(d=Y(d,X(c.removeClass,"-remove")));d.length&&(c.preparationClasses=d,a.addClass(d))}function qa(a,b){var c=b?"-"+b+"s":"";la(a,[ma,c]);return[ma,c]}function ta(a,b){var c=b?"paused":"",d=Z+"PlayState";la(a,[d,c]);return[d,c]}function la(a,b){a.style[b[0]]=
|
||||
b[1]}function Y(a,b){return a?b?a+" "+b:a:b}function Fa(a,b,c){var d=Object.create(null),e=a.getComputedStyle(b)||{};r(c,function(a,b){var c=e[a];if(c){var s=c.charAt(0);if("-"===s||"+"===s||0<=s)c=Ta(c);0===c&&(c=null);d[b]=c}});return d}function Ta(a){var b=0;a=a.split(/\s*,\s*/);r(a,function(a){"s"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function ua(a){return 0===a||null!=a}function Ga(a,b){var c=T,d=a+"s";b?c+="Duration":d+=" linear all";
|
||||
return[c,d]}function Ha(){var a=Object.create(null);return{flush:function(){a=Object.create(null)},count:function(b){return(b=a[b])?b.total:0},get:function(b){return(b=a[b])&&b.value},put:function(b,c){a[b]?a[b].total++:a[b]={total:1,value:c}}}}function Ia(a,b,c){r(c,function(c){a[c]=da(a[c])?a[c]:b.style.getPropertyValue(c)})}var Q=q.noop,Ja=q.copy,Ea=q.extend,G=q.element,r=q.forEach,ba=q.isArray,P=q.isString,va=q.isObject,C=q.isUndefined,da=q.isDefined,Ka=q.isFunction,wa=q.isElement,T,xa,Z,ya;C(S.ontransitionend)&&
|
||||
da(S.onwebkittransitionend)?(T="WebkitTransition",xa="webkitTransitionEnd transitionend"):(T="transition",xa="transitionend");C(S.onanimationend)&&da(S.onwebkitanimationend)?(Z="WebkitAnimation",ya="webkitAnimationEnd animationend"):(Z="animation",ya="animationend");var ra=Z+"Delay",za=Z+"Duration",ma=T+"Delay",La=T+"Duration",Ma=q.$$minErr("ng"),Ua={transitionDuration:La,transitionDelay:ma,transitionProperty:T+"Property",animationDuration:za,animationDelay:ra,animationIterationCount:Z+"IterationCount"},
|
||||
Va={transitionDuration:La,transitionDelay:ma,animationDuration:za,animationDelay:ra};q.module("ngAnimate",[]).directive("ngAnimateSwap",["$animate","$rootScope",function(a,b){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(b,d,e,f,z){var B,s;b.$watchCollection(e.ngAnimateSwap||e["for"],function(e){B&&a.leave(B);s&&(s.$destroy(),s=null);if(e||0===e)s=b.$new(),z(s,function(b){B=b;a.enter(b,null,d)})})}}}]).directive("ngAnimateChildren",["$interpolate",function(a){return{link:function(b,
|
||||
c,d){function e(a){c.data("$$ngAnimateChildren","on"===a||"true"===a)}var f=d.ngAnimateChildren;q.isString(f)&&0===f.length?c.data("$$ngAnimateChildren",!0):(e(a(f)(b)),d.$observe("ngAnimateChildren",e))}}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),z=0;z<b.length;z++)b[z]();e||a(function(){e||c()})}}var d,e;d=b.queue=[];b.waitUntilQuiet=function(b){e&&e();e=a(function(){e=null;b();c()})};return b}]).provider("$$animateQueue",
|
||||
["$animateProvider",function(a){function b(a){if(!a)return null;a=a.split(" ");var b=Object.create(null);r(a,function(a){b[a]=!0});return b}function c(a,c){if(a&&c){var d=b(c);return a.split(" ").some(function(a){return d[a]})}}function d(a,b,c,d){return f[a].some(function(a){return a(b,c,d)})}function e(a,b){var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var f=this.rules={skip:[],cancel:[],join:[]};f.join.push(function(a,b,c){return!b.structural&&e(b)});f.skip.push(function(a,
|
||||
b,c){return!b.structural&&!e(b)});f.skip.push(function(a,b,c){return"leave"==c.event&&b.structural});f.skip.push(function(a,b,c){return c.structural&&2===c.state&&!b.structural});f.cancel.push(function(a,b,c){return c.structural&&b.structural});f.cancel.push(function(a,b,c){return 2===c.state&&b.structural});f.cancel.push(function(a,b,d){if(d.structural)return!1;a=b.addClass;b=b.removeClass;var e=d.addClass;d=d.removeClass;return C(a)&&C(b)||C(e)&&C(d)?!1:c(a,d)||c(b,e)});this.$get=["$$rAF","$rootScope",
|
||||
"$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow",function(b,c,f,v,I,Wa,u,sa,w,x){function R(){var a=!1;return function(b){a?b():c.$$postDigest(function(){a=!0;b()})}}function J(a,b,c){var g=D(b),d=D(a),k=[];(a=h[c])&&r(a,function(a){ia.call(a.node,g)?k.push(a.callback):"leave"===c&&ia.call(a.node,d)&&k.push(a.callback)});return k}function k(a,b,c){var g=ca(b);return a.filter(function(a){return!(a.node===g&&(!c||a.callback===c))})}
|
||||
function p(a,k,h){function l(c,g,d,h){f(function(){var c=J(oa,a,g);c.length?b(function(){r(c,function(b){b(a,d,h)});"close"!==d||a[0].parentNode||N.off(a)}):"close"!==d||a[0].parentNode||N.off(a)});c.progress(g,d,h)}function A(b){var c=a,g=m;g.preparationClasses&&(c.removeClass(g.preparationClasses),g.preparationClasses=null);g.activeClasses&&(c.removeClass(g.activeClasses),g.activeClasses=null);F(a,m);ga(a,m);m.domOperation();p.complete(!b)}var m=Ja(h),x,oa;if(a=Oa(a))x=D(a),oa=a.parent();var m=
|
||||
pa(m),p=new u,f=R();ba(m.addClass)&&(m.addClass=m.addClass.join(" "));m.addClass&&!P(m.addClass)&&(m.addClass=null);ba(m.removeClass)&&(m.removeClass=m.removeClass.join(" "));m.removeClass&&!P(m.removeClass)&&(m.removeClass=null);m.from&&!va(m.from)&&(m.from=null);m.to&&!va(m.to)&&(m.to=null);if(!x)return A(),p;h=[x.className,m.addClass,m.removeClass].join(" ");if(!Xa(h))return A(),p;var s=0<=["enter","move","leave"].indexOf(k),t=v[0].hidden,w=!g||t||H.get(x);h=!w&&y.get(x)||{};var I=!!h.state;w||
|
||||
I&&1==h.state||(w=!K(a,oa,k));if(w)return t&&l(p,k,"start"),A(),t&&l(p,k,"close"),p;s&&L(a);t={structural:s,element:a,event:k,addClass:m.addClass,removeClass:m.removeClass,close:A,options:m,runner:p};if(I){if(d("skip",a,t,h)){if(2===h.state)return A(),p;V(a,h,t);return h.runner}if(d("cancel",a,t,h))if(2===h.state)h.runner.end();else if(h.structural)h.close();else return V(a,h,t),h.runner;else if(d("join",a,t,h))if(2===h.state)V(a,t,{});else return Sa(a,s?k:null,m),k=t.event=h.event,m=V(a,h,t),h.runner}else V(a,
|
||||
t,{});(I=t.structural)||(I="animate"===t.event&&0<Object.keys(t.options.to||{}).length||e(t));if(!I)return A(),O(a),p;var ia=(h.counter||0)+1;t.counter=ia;M(a,1,t);c.$$postDigest(function(){var b=y.get(x),c=!b,b=b||{},g=0<(a.parent()||[]).length&&("animate"===b.event||b.structural||e(b));if(c||b.counter!==ia||!g){c&&(F(a,m),ga(a,m));if(c||s&&b.event!==k)m.domOperation(),p.end();g||O(a)}else k=!b.structural&&e(b,!0)?"setClass":b.event,M(a,2),b=Wa(a,k,b.options),p.setHost(b),l(p,k,"start",{}),b.done(function(b){A(!b);
|
||||
(b=y.get(x))&&b.counter===ia&&O(D(a));l(p,k,"close",{})})});return p}function L(a){a=D(a).querySelectorAll("[data-ng-animate]");r(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate")),c=y.get(a);if(c)switch(b){case 2:c.runner.end();case 1:y.remove(a)}})}function O(a){a=D(a);a.removeAttribute("data-ng-animate");y.remove(a)}function l(a,b){return D(a)===D(b)}function K(a,b,c){c=G(v[0].body);var g=l(a,c)||"HTML"===a[0].nodeName,d=l(a,f),h=!1,k,e=H.get(D(a));(a=G.data(a[0],"$ngAnimatePin"))&&
|
||||
(b=a);for(b=D(b);b;){d||(d=l(b,f));if(1!==b.nodeType)break;a=y.get(b)||{};if(!h){var p=H.get(b);if(!0===p&&!1!==e){e=!0;break}else!1===p&&(e=!1);h=a.structural}if(C(k)||!0===k)a=G.data(b,"$$ngAnimateChildren"),da(a)&&(k=a);if(h&&!1===k)break;g||(g=l(b,c));if(g&&d)break;if(!d&&(a=G.data(b,"$ngAnimatePin"))){b=D(a);continue}b=b.parentNode}return(!h||k)&&!0!==e&&d&&g}function M(a,b,c){c=c||{};c.state=b;a=D(a);a.setAttribute("data-ng-animate",b);c=(b=y.get(a))?Ea(b,c):c;y.put(a,c)}var y=new I,H=new I,
|
||||
g=null,oa=c.$watch(function(){return 0===sa.totalPendingRequests},function(a){a&&(oa(),c.$$postDigest(function(){c.$$postDigest(function(){null===g&&(g=!0)})}))}),h={},A=a.classNameFilter(),Xa=A?function(a){return A.test(a)}:function(){return!0},F=U(w),ia=S.Node.prototype.contains||function(a){return this===a||!!(this.compareDocumentPosition(a)&16)},N={on:function(a,b,c){var g=ca(b);h[a]=h[a]||[];h[a].push({node:g,callback:c});G(b).on("$destroy",function(){y.get(g)||N.off(a,b,c)})},off:function(a,
|
||||
b,c){if(1!==arguments.length||q.isString(arguments[0])){var g=h[a];g&&(h[a]=1===arguments.length?null:k(g,b,c))}else for(g in b=arguments[0],h)h[g]=k(h[g],b)},pin:function(a,b){Aa(wa(a),"element","not an element");Aa(wa(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,g){c=c||{};c.domOperation=g;return p(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!g;else if(wa(a)){var d=D(a),h=H.get(d);1===c?b=!h:H.put(d,!b)}else b=g=!!a;return b}};return N}]}]).provider("$$animation",
|
||||
["$animateProvider",function(a){function b(a){return a.data("$$animationRunner")}var c=this.drivers=[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(a,e,f,z,B,s){function v(a){function b(a){if(a.processed)return a;a.processed=!0;var d=a.domNode,L=d.parentNode;e.put(d,a);for(var f;L;){if(f=e.get(L)){f.processed||(f=b(f));break}L=L.parentNode}(f||c).children.push(a);return a}var c={children:[]},d,e=new B;for(d=0;d<a.length;d++){var f=a[d];e.put(f.domNode,
|
||||
a[d]={domNode:f.domNode,fn:f.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);return function(a){var b=[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var e=0,f=[];for(d=0;d<c.length;d++){var x=c[d];0>=a&&(a=e,e=0,b.push(f),f=[]);f.push(x.fn);x.children.forEach(function(a){e++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var I=[],q=U(a);return function(u,B,w){function x(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];r(a,function(a){var c=
|
||||
a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function R(a){var b=[],c={};r(a,function(a,g){var d=D(a.element),e=0<=["enter","move"].indexOf(a.event),d=a.structural?x(d):[];if(d.length){var k=e?"to":"from";r(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][k]={animationID:g,element:G(a)}})}else b.push(a)});var d={},e={};r(c,function(c,h){var k=c.from,f=c.to;if(k&&f){var p=a[k.animationID],y=a[f.animationID],l=k.animationID.toString();if(!e[l]){var x=e[l]=
|
||||
{structural:!0,beforeStart:function(){p.beforeStart();y.beforeStart()},close:function(){p.close();y.close()},classes:J(p.classes,y.classes),from:p,to:y,anchors:[]};x.classes.length?b.push(x):(b.push(p),b.push(y))}e[l].anchors.push({out:k.element,"in":f.element})}else k=k?k.animationID:f.animationID,f=k.toString(),d[f]||(d[f]=!0,b.push(a[k]))});return b}function J(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var k=a[d];if("ng-"!==k.substring(0,3))for(var e=0;e<b.length;e++)if(k===
|
||||
b[e]){c.push(k);break}}return c.join(" ")}function k(a){for(var b=c.length-1;0<=b;b--){var d=c[b];if(f.has(d)&&(d=f.get(d)(a)))return d}}function p(a,c){a.from&&a.to?(b(a.from.element).setHost(c),b(a.to.element).setHost(c)):b(a.element).setHost(c)}function L(){var a=b(u);!a||"leave"===B&&w.$$domOperationFired||a.end()}function O(b){u.off("$destroy",L);u.removeData("$$animationRunner");q(u,w);ga(u,w);w.domOperation();y&&a.removeClass(u,y);u.removeClass("ng-animate");K.complete(!b)}w=pa(w);var l=0<=
|
||||
["enter","move","leave"].indexOf(B),K=new z({end:function(){O()},cancel:function(){O(!0)}});if(!c.length)return O(),K;u.data("$$animationRunner",K);var M=Ba(u.attr("class"),Ba(w.addClass,w.removeClass)),y=w.tempClasses;y&&(M+=" "+y,w.tempClasses=null);var H;l&&(H="ng-"+B+"-prepare",a.addClass(u,H));I.push({element:u,classes:M,event:B,structural:l,options:w,beforeStart:function(){u.addClass("ng-animate");y&&a.addClass(u,y);H&&(a.removeClass(u,H),H=null)},close:O});u.on("$destroy",L);if(1<I.length)return K;
|
||||
e.$$postDigest(function(){var a=[];r(I,function(c){b(c.element)?a.push(c):c.close()});I.length=0;var c=R(a),d=[];r(c,function(a){d.push({domNode:D(a.from?a.from.element:a.element),fn:function(){a.beforeStart();var c,d=a.close;if(b(a.anchors?a.from.element||a.to.element:a.element)){var g=k(a);g&&(c=g.start)}c?(c=c(),c.done(function(a){d(!a)}),p(a,c)):d()}})});s(v(d))});return K}}]}]).provider("$animateCss",["$animateProvider",function(a){var b=Ha(),c=Ha();this.$get=["$window","$$jqLite","$$AnimateRunner",
|
||||
"$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(a,e,f,z,B,s,v,I){function q(a,b){var c=a.parentNode;return(c.$$ngAnimateParentKey||(c.$$ngAnimateParentKey=++R))+"-"+a.getAttribute("class")+"-"+b}function u(k,f,x,s){var l;0<b.count(x)&&(l=c.get(x),l||(f=X(f,"-stagger"),e.addClass(k,f),l=Fa(a,k,s),l.animationDuration=Math.max(l.animationDuration,0),l.transitionDuration=Math.max(l.transitionDuration,0),e.removeClass(k,f),c.put(x,l)));return l||{}}function sa(a){J.push(a);
|
||||
v.waitUntilQuiet(function(){b.flush();c.flush();for(var a=B(),d=0;d<J.length;d++)J[d](a);J.length=0})}function w(c,e,f){e=b.get(f);e||(e=Fa(a,c,Ua),"infinite"===e.animationIterationCount&&(e.animationIterationCount=1));b.put(f,e);c=e;f=c.animationDelay;e=c.transitionDelay;c.maxDelay=f&&e?Math.max(f,e):f||e;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var x=U(e),R=0,J=[];return function(a,c){function d(){l()}function v(){l(!0)}function l(b){if(!(R||
|
||||
G&&N)){R=!0;N=!1;g.$$skipPreparationClasses||e.removeClass(a,fa);e.removeClass(a,da);ta(h,!1);qa(h,!1);r(A,function(a){h.style[a[0]]=""});x(a,g);ga(a,g);Object.keys(J).length&&r(J,function(a,b){a?h.style.setProperty(b,a):h.style.removeProperty(b)});if(g.onDone)g.onDone();ea&&ea.length&&a.off(ea.join(" "),y);var c=a.data("$$animateCss");c&&(z.cancel(c[0].timer),a.removeData("$$animateCss"));C&&C.complete(!b)}}function K(a){n.blockTransition&&qa(h,a);n.blockKeyframeAnimation&&ta(h,!!a)}function M(){C=
|
||||
new f({end:d,cancel:v});sa(Q);l();return{$$willAnimate:!1,start:function(){return C},end:d}}function y(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(3));Math.max(a-V,0)>=S&&b>=m&&(G=!0,l())}function H(){function b(){if(!R){K(!1);r(A,function(a){h.style[a[0]]=a[1]});x(a,g);e.addClass(a,da);if(n.recalculateTimingStyles){na=h.className+" "+fa;ja=q(h,na);E=w(h,na,ja);$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;if(0===m){l();return}n.hasTransitions=
|
||||
0<E.transitionDuration;n.hasAnimations=0<E.animationDuration}n.applyAnimationDelay&&($="boolean"!==typeof g.delay&&ua(g.delay)?parseFloat(g.delay):$,ha=Math.max($,0),E.animationDelay=$,aa=[ra,$+"s"],A.push(aa),h.style[aa[0]]=aa[1]);S=1E3*ha;U=1E3*m;if(g.easing){var d,f=g.easing;n.hasTransitions&&(d=T+"TimingFunction",A.push([d,f]),h.style[d]=f);n.hasAnimations&&(d=Z+"TimingFunction",A.push([d,f]),h.style[d]=f)}E.transitionDuration&&ea.push(xa);E.animationDuration&&ea.push(ya);V=Date.now();var H=S+
|
||||
1.5*U;d=V+H;var f=a.data("$$animateCss")||[],s=!0;if(f.length){var p=f[0];(s=d>p.expectedEndTime)?z.cancel(p.timer):f.push(l)}s&&(H=z(c,H,!1),f[0]={timer:H,expectedEndTime:d},f.push(l),a.data("$$animateCss",f));if(ea.length)a.on(ea.join(" "),y);g.to&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.to)),Da(a,g))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;d<b.length;d++)b[d]();a.removeData("$$animateCss")}}if(!R)if(h.parentNode){var d=function(a){if(G)N&&a&&(N=!1,l());else if(N=!a,E.animationDuration)if(a=
|
||||
ta(h,N),N)A.push(a);else{var b=A,c=b.indexOf(a);0<=a&&b.splice(c,1)}},f=0<ca&&(E.transitionDuration&&0===W.transitionDuration||E.animationDuration&&0===W.animationDuration)&&Math.max(W.animationDelay,W.transitionDelay);f?z(b,Math.floor(f*ca*1E3),!1):b();P.resume=function(){d(!0)};P.pause=function(){d(!1)}}else l()}var g=c||{};g.$$prepared||(g=pa(Ja(g)));var J={},h=D(a);if(!h||!h.parentNode||!I.enabled())return M();var A=[],B=a.attr("class"),F=Na(g),R,N,G,C,P,ha,S,m,U,V,ea=[];if(0===g.duration||!s.animations&&
|
||||
!s.transitions)return M();var ka=g.event&&ba(g.event)?g.event.join(" "):g.event,Y="",t="";ka&&g.structural?Y=X(ka,"ng-",!0):ka&&(Y=ka);g.addClass&&(t+=X(g.addClass,"-add"));g.removeClass&&(t.length&&(t+=" "),t+=X(g.removeClass,"-remove"));g.applyClassesEarly&&t.length&&x(a,g);var fa=[Y,t].join(" ").trim(),na=B+" "+fa,da=X(fa,"-active"),B=F.to&&0<Object.keys(F.to).length;if(!(0<(g.keyframeStyle||"").length||B||fa))return M();var ja,W;0<g.stagger?(F=parseFloat(g.stagger),W={transitionDelay:F,animationDelay:F,
|
||||
transitionDuration:0,animationDuration:0}):(ja=q(h,na),W=u(h,fa,ja,Va));g.$$skipPreparationClasses||e.addClass(a,fa);g.transitionStyle&&(F=[T,g.transitionStyle],la(h,F),A.push(F));0<=g.duration&&(F=0<h.style[T].length,F=Ga(g.duration,F),la(h,F),A.push(F));g.keyframeStyle&&(F=[Z,g.keyframeStyle],la(h,F),A.push(F));var ca=W?0<=g.staggerIndex?g.staggerIndex:b.count(ja):0;(ka=0===ca)&&!g.skipBlocking&&qa(h,9999);var E=w(h,na,ja),$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;var n={};n.hasTransitions=
|
||||
0<E.transitionDuration;n.hasAnimations=0<E.animationDuration;n.hasTransitionAll=n.hasTransitions&&"all"==E.transitionProperty;n.applyTransitionDuration=B&&(n.hasTransitions&&!n.hasTransitionAll||n.hasAnimations&&!n.hasTransitions);n.applyAnimationDuration=g.duration&&n.hasAnimations;n.applyTransitionDelay=ua(g.delay)&&(n.applyTransitionDuration||n.hasTransitions);n.applyAnimationDelay=ua(g.delay)&&n.hasAnimations;n.recalculateTimingStyles=0<t.length;if(n.applyTransitionDuration||n.applyAnimationDuration)m=
|
||||
g.duration?parseFloat(g.duration):m,n.applyTransitionDuration&&(n.hasTransitions=!0,E.transitionDuration=m,F=0<h.style[T+"Property"].length,A.push(Ga(m,F))),n.applyAnimationDuration&&(n.hasAnimations=!0,E.animationDuration=m,A.push([za,m+"s"]));if(0===m&&!n.recalculateTimingStyles)return M();if(null!=g.delay){var aa;"boolean"!==typeof g.delay&&(aa=parseFloat(g.delay),ha=Math.max(aa,0));n.applyTransitionDelay&&A.push([ma,aa+"s"]);n.applyAnimationDelay&&A.push([ra,aa+"s"])}null==g.duration&&0<E.transitionDuration&&
|
||||
(n.recalculateTimingStyles=n.recalculateTimingStyles||ka);S=1E3*ha;U=1E3*m;g.skipBlocking||(n.blockTransition=0<E.transitionDuration,n.blockKeyframeAnimation=0<E.animationDuration&&0<W.animationDelay&&0===W.animationDuration);g.from&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.from)),Ca(a,g));n.blockTransition||n.blockKeyframeAnimation?K(m):g.skipBlocking||qa(h,!1);return{$$willAnimate:!0,end:d,start:function(){if(!R)return P={end:d,cancel:v,resume:null,pause:null},C=new f(P),sa(H),C}}}}]}]).provider("$$animateCssDriver",
|
||||
["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,e,f,z,B){function s(a){return a.replace(/\bng-\S+\b/g,"")}function v(a,b){P(a)&&(a=a.split(" "));P(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function I(c,e,f){function k(a){var b={},c=D(a).getBoundingClientRect();r(["width","height","top","left"],function(a){var d=c[a];
|
||||
switch(a){case "top":d+=C.scrollTop;break;case "left":d+=C.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function p(){var c=s(f.attr("class")||""),d=v(c,l),c=v(l,c),d=a(z,{to:k(f),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?d:null}function B(){z.remove();e.removeClass("ng-animate-shim");f.removeClass("ng-animate-shim")}var z=G(D(e).cloneNode(!0)),l=s(z.attr("class")||"");e.addClass("ng-animate-shim");f.addClass("ng-animate-shim");z.addClass("ng-anchor");
|
||||
w.append(z);var K;c=function(){var c=a(z,{addClass:"ng-anchor-out",delay:!0,from:k(e)});return c.$$willAnimate?c:null}();if(!c&&(K=p(),!K))return B();var M=c||K;return{start:function(){function a(){c&&c.end()}var b,c=M.start();c.done(function(){c=null;if(!K&&(K=p()))return c=K.start(),c.done(function(){c=null;B();b.complete()}),c;B();b.complete()});return b=new d({end:a,cancel:a})}}}function q(a,b,c,e){var f=u(a,Q),s=u(b,Q),z=[];r(e,function(a){(a=I(c,a.out,a["in"]))&&z.push(a)});if(f||s||0!==z.length)return{start:function(){function a(){r(b,
|
||||
function(a){a.end()})}var b=[];f&&b.push(f.start());s&&b.push(s.start());r(z,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function u(c){var d=c.element,e=c.options||{};c.structural&&(e.event=c.event,e.structural=!0,e.applyClassesEarly=!0,"leave"===c.event&&(e.onDone=e.domOperation));e.preparationClasses&&(e.event=Y(e.event,e.preparationClasses));c=a(d,e);return c.$$willAnimate?c:null}if(!f.animations&&!f.transitions)return Q;var C=B[0].body;
|
||||
c=D(e);var w=G(c.parentNode&&11===c.parentNode.nodeType||C.contains(c)?c:C);U(z);return function(a){return a.from&&a.to?q(a.from,a.to,a.classes,a.anchors):u(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function e(c){c=ba(c)?c:c.split(" ");for(var d=[],e={},f=0;f<c.length;f++){var r=c[f],q=a.$$registeredAnimations[r];q&&!e[r]&&(d.push(b.get(q)),e[r]=!0)}return d}var f=U(d);return function(a,b,d,v){function q(){v.domOperation();
|
||||
f(a,v)}function D(a,b,d,e,g){switch(d){case "animate":b=[b,e.from,e.to,g];break;case "setClass":b=[b,x,G,g];break;case "addClass":b=[b,x,g];break;case "removeClass":b=[b,G,g];break;default:b=[b,g]}b.push(e);if(a=a.apply(a,b))if(Ka(a.start)&&(a=a.start()),a instanceof c)a.done(g);else if(Ka(a))return a;return Q}function u(a,b,d,e,g){var f=[];r(e,function(e){var k=e[g];k&&f.push(function(){var e,g,f=!1,h=function(a){f||(f=!0,(g||Q)(a),e.complete(!a))};e=new c({end:function(){h()},cancel:function(){h(!0)}});
|
||||
g=D(k,a,b,d,function(a){h(!1===a)});return e})});return f}function C(a,b,d,e,g){var f=u(a,b,d,e,g);if(0===f.length){var h,k;"beforeSetClass"===g?(h=u(a,"removeClass",d,e,"beforeRemoveClass"),k=u(a,"addClass",d,e,"beforeAddClass")):"setClass"===g&&(h=u(a,"removeClass",d,e,"removeClass"),k=u(a,"addClass",d,e,"addClass"));h&&(f=f.concat(h));k&&(f=f.concat(k))}if(0!==f.length)return function(a){var b=[];f.length&&r(f,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){r(b,function(b){a?
|
||||
b.cancel():b.end()})}}}var w=!1;3===arguments.length&&va(d)&&(v=d,d=null);v=pa(v);d||(d=a.attr("class")||"",v.addClass&&(d+=" "+v.addClass),v.removeClass&&(d+=" "+v.removeClass));var x=v.addClass,G=v.removeClass,J=e(d),k,p;if(J.length){var L,O;"leave"==b?(O="leave",L="afterLeave"):(O="before"+b.charAt(0).toUpperCase()+b.substr(1),L=b);"enter"!==b&&"move"!==b&&(k=C(a,b,v,J,O));p=C(a,b,v,J,L)}if(k||p){var l;return{$$willAnimate:!0,end:function(){l?l.end():(w=!0,q(),ga(a,v),l=new c,l.complete(!0));return l},
|
||||
start:function(){function b(c){w=!0;q();ga(a,v);l.complete(c)}if(l)return l;l=new c;var d,e=[];k&&e.push(function(a){d=k(a)});e.length?e.push(function(a){q();a(!0)}):q();p&&e.push(function(a){d=p(a)});l.setHost({end:function(){w||((d||Q)(void 0),b(void 0))},cancel:function(){w||((d||Q)(!0),b(!0))}});c.chain(e,b);return l}}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,
|
||||
c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),q=d(a.to);if(b||q)return{start:function(){function a(){return function(){r(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());q&&d.push(q.start());c.all(d,function(a){e.complete(a)});var e=new c({end:a(),cancel:a()});return e}}}else return d(a)}}]}])})(window,window.angular);
|
||||
//# sourceMappingURL=angular-animate.min.js.map
|
File diff suppressed because one or more lines are too long
10
js/vendor/angular-animate/bower.json
vendored
10
js/vendor/angular-animate/bower.json
vendored
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name": "angular-animate",
|
||||
"version": "1.5.5",
|
||||
"license": "MIT",
|
||||
"main": "./angular-animate.js",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"angular": "1.5.5"
|
||||
}
|
||||
}
|
2
js/vendor/angular-animate/index.js
vendored
2
js/vendor/angular-animate/index.js
vendored
|
@ -1,2 +0,0 @@
|
|||
require('./angular-animate');
|
||||
module.exports = 'ngAnimate';
|
26
js/vendor/angular-animate/package.json
vendored
26
js/vendor/angular-animate/package.json
vendored
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"name": "angular-animate",
|
||||
"version": "1.5.5",
|
||||
"description": "AngularJS module for animations",
|
||||
"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",
|
||||
"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"
|
||||
}
|
146
js/vendor/angular-drag-and-drop-lists/CHANGELOG.md
vendored
146
js/vendor/angular-drag-and-drop-lists/CHANGELOG.md
vendored
|
@ -1,146 +0,0 @@
|
|||
# 2.1.0 (2017-01-15)
|
||||
|
||||
## Changes
|
||||
|
||||
- **Custom callbacks with dnd-callback**: The new `dnd-callback` attribute allows for communication between the source and target scopes. For example, this can be used to access information about the object being dragged during dragover, or to transfer objects without serialization, which allows to use complex objects that contain functions references and prototypes. [Demo](https://jsfiddle.net/Ldxffyod/1/)
|
||||
- **Drop effects fixed and extended**: Most of the bugs around drop effect have been fixed. You can now use move, copy and link, or a combination of them. Drop effects can be restricted using `dnd-effect-allowed` on both the source and target element, and if there are multiple options, the user can choose one using modifier keys (Ctrl or Alt). See the [design document](https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Drop-Effects-Design) for more details. Drop effects don't work on IE9. They do work accross browser tabs if `dnd-external-sources` is activated, although the source restrictions are lost in Safari and IE.
|
||||
- **New dragleave handler**: Previously, the dragleave handler used a timeout to determine whether the placeholder needs to be removed from a `dnd-list`. The new implementation utilizes `document.elementFromPoint` to determine whether the mouse cursor is outside the target list.
|
||||
- **Remove dndDraggingSource without timeout**: Fixes problems with ngAnimate (#121).
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 55 (Mac, Ubuntu & Windows 7)
|
||||
- Firefox 50 (Ubuntu)
|
||||
- Safari 10 (MacOS)
|
||||
- Microsoft Edge 20 (Windows 10 emulator)
|
||||
- Internet Explorer 11 (Windows 7)
|
||||
- Internet Explorer 9 (Windows 7 emulator)
|
||||
|
||||
|
||||
# 2.0.0 (2016-12-25)
|
||||
|
||||
## Changes
|
||||
|
||||
There have been some major changes to how the directive works internally, although these changes should not affect users of the library.
|
||||
|
||||
- **Simpler placeholder positioning algorithm**: The logic for placeholder positiong is unchanged, i.e. the placeholder will be placed after an element if the mouse cursor is in the second half of the element it is hovering over, otherwise it is placed before it. However, the implementation of this algorithm was massively simplified by using `getBoundingClientRect`. As a result, developers are no longer required to have `position: relative` on the list and list item elements.
|
||||
- **New dataTransfer algorithm**: The directive now uses custom mime types in modern browsers, and falls back to using `Text` in non-standard comform browsers. As a result, dragged elements can no longer be dropped into arbitrary input fields. More details on how this works can be found in the [design document](https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design). **Breaking change:** As mime types are used, all dnd-type attributes are automatically converted to lower case.
|
||||
- **Internal test infrastructure**: The mocks used for drag and drop events in unit tests are now much nicer.
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 55 (Mac, Ubuntu & Windows 10)
|
||||
- Firefox 50 (Ubuntu)
|
||||
- Safari 10 (Mac)
|
||||
- Microsoft Edge 20 (Windows 10)
|
||||
- Internet Explorer 11 (Windows 10)
|
||||
- Internet Explorer 9 (Windows Vista)
|
||||
|
||||
|
||||
# 1.4.0 (2016-02-06)
|
||||
|
||||
## Features
|
||||
|
||||
- **dnd-handle directive**: This directive can be used in combination with `dnd-nodrag`, so that a `dnd-draggable` can only be dragged by using certain handle elements. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
- **dnd-drop can handle insertion**: The `dnd-drop` callback can now return true to signalize that it will take care of inserting the dropped element itself. `dnd-list` will then no longer insert any elements into the list, but will still call the `dnd-inserted` callback.
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- **Fix dnd-disable-if on dnd-draggable**: When you disabled a `dnd-draggable` with `dnd-disable-if`, the user was still able to trigger a drag of that element by selecting some text inside the element. (issue #159)
|
||||
- **dnd-list now handles the dragenter event**: According to the HTML5 standard dropzones need to handle the `dragenter` event, although there doesn't seem to be any browser that enforces this. (issue #118)
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 48 (Mac, Ubuntu & Windows 10)
|
||||
- Firefox 44 (Ubuntu)
|
||||
- Safari 9 (Mac)
|
||||
- Microsoft Edge 20 (Windows 10)
|
||||
- Internet Explorer 11 (Windows 10)
|
||||
- Internet Explorer 10 & 9 in compatibility mode (Windows 10)
|
||||
|
||||
# 1.3.0 (2015-08-20)
|
||||
|
||||
## Features
|
||||
|
||||
- **New callbacks**: `dnd-dragend`, `dnd-canceled` and `dnd-inserted`.
|
||||
- **Custom placeholder elements**: `dnd-list` elements can have custom elements by creating a child element with `dnd-placeholder` class. This is useful for cases where a simple `li` element is not sufficient.
|
||||
- **dnd-nodrag directive**: This directive can be used inside `dnd-draggable` to prevent dragging certain areas. This is useful for input elements inside the draggable or creating handle elements.
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- **Fix user selection inside dnd-draggable**: The `selectstart` event is no longer cancelled.
|
||||
- **Fix click handler compatibility**: Propagation of click events is now only stopped if the `dnd-selected` attribute is present.
|
||||
- **Fix IE9 glitch**: Double clicks in IE9 previously would trigger the `dnd-moved` callback, and therefore remove items accidentially. (issue #21)
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 43 (Win7)
|
||||
- Chrome 44 (Ubuntu)
|
||||
- Chrome 44 (Mac)
|
||||
- Firefox 40 (Win7)
|
||||
- Firefox 39 (Ubuntu)
|
||||
- Safari 8.0.8 (Mac)
|
||||
- Internet Explorer 11 (IE9 & 10 in compatibility mode)
|
||||
|
||||
# 1.2.0 (2014-11-30)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- **Fix glitches in Chrome**: When aborting a drag operation or dragging an element on itself, Chrome on Linux sometimes sends `move` as dropEffect instead of `none`. This lead to elements sometimes disappearing. Can be reproduced by dragging an element over itself and aborting with Esc key. (issue #14)
|
||||
- **Fix dnd-allowed-types in nested lists**: When a drop was not allowed due to the wrong element type, the event was correctly propagated to the parent list. Nevertheless, the drop was still executed, because the drop handler didn't check the type again. (issue #16)
|
||||
|
||||
## Features
|
||||
|
||||
- **New callbacks**: The `dnd-draggable` directive now has a new `dnd-dragstart` callback besides the existing `dnd-moved` and `dnd-copied`. The `dnd-list` directive got the callbacks `dnd-dragover` and `dnd-drag` added, which are also able to abort a drop. (issue #11)
|
||||
- **dnd-horizontal-list**: Lists can be marked as horizontal with this new attribute. The positioning algorithm then positions the placeholder left or right of other list items, instead of above or below. (issue #19)
|
||||
- **dnd-external-sources**: This attribute allows drag and drop accross browser windows. See documentation for details. (issue #9)
|
||||
- **pointer-events: none no longer required**: The dragover handler now traverses the DOM until it finds the list item node, therefore it's child elements no longer require the pointer-events: none style.
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 38 (Ubuntu)
|
||||
- Chrome 38 (Win7)
|
||||
- Chrome 39 (Mac)
|
||||
- Firefox 31 (Win7)
|
||||
- Firefox 33 (Ubuntu)
|
||||
- Safari 7.1 (Mac)
|
||||
- Internet Explorer 11 (IE9 & 10 in compatibility mode)
|
||||
|
||||
# 1.1.0 (2014-08-31)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- **jQuery compatibility**: jQuery wraps browser events in event.originalEvent
|
||||
|
||||
## Features
|
||||
|
||||
- **dnd-disable-if attribute**: allows to dynamically disable the drag and drop functionality
|
||||
- **dnd-type and dnd-allowed-types**: allows to restrict an item to specifc lists depending on it's type
|
||||
|
||||
## Tested browsers
|
||||
|
||||
- Chrome 34 (Ubuntu)
|
||||
- Chrome 37 (Mac)
|
||||
- Chrome 37 (Win7)
|
||||
- Firefox 28 (Win7)
|
||||
- Firefox 31 (Ubuntu)
|
||||
- Safari 7.0.6 (Mac)
|
||||
- Internet Explorer 11 (IE9 & 10 in compatibility mode)
|
||||
|
||||
# 1.0.0 (2014-04-11)
|
||||
|
||||
Initial release
|
||||
|
||||
# Release checklist
|
||||
|
||||
- Bump versions
|
||||
- bower.json
|
||||
- package.json
|
||||
- JS files
|
||||
- Minify and test (npm run-script minify, check semicolon at EOF)
|
||||
- Test different OS & browsers (npm start)
|
||||
- Update README and CHANGELOG
|
||||
- Merge to master
|
||||
- Tag release
|
||||
- Merge to gh-pages
|
||||
- Publish to npm
|
22
js/vendor/angular-drag-and-drop-lists/LICENSE
vendored
22
js/vendor/angular-drag-and-drop-lists/LICENSE
vendored
|
@ -1,22 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Marcel Juenemann <marcel@juenemann.cc>
|
||||
Copyright (c) 2014-2016 Google Inc.
|
||||
|
||||
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.
|
125
js/vendor/angular-drag-and-drop-lists/README.md
vendored
125
js/vendor/angular-drag-and-drop-lists/README.md
vendored
|
@ -1,125 +0,0 @@
|
|||
angular-drag-and-drop-lists
|
||||
===========================
|
||||
Angular directives that allow you to build sortable lists with the native HTML5 drag & drop API. The directives can also be nested to bring drag & drop to your WYSIWYG editor, your tree, or whatever fancy structure you are building.
|
||||
|
||||
## Demo
|
||||
* [Nested Lists](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested)
|
||||
* [Simple Lists](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple)
|
||||
* [Typed Lists](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* [Advanced Features](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* [Multiselection Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/multi)
|
||||
|
||||
|
||||
## Supported browsers
|
||||
|
||||
**Touch devices are not supported**, because they do not implement the HTML5 drag & drop standard. However, you can use a [shim](https://github.com/timruffles/ios-html5-drag-drop-shim) to make it work on touch devices as well.
|
||||
|
||||
Internet Explorer 8 or lower is *not supported*, but all modern browsers are (see changelog for list of tested browsers).
|
||||
|
||||
|
||||
## Download & Installation
|
||||
* Download `angular-drag-and-drop-lists.js` (or the minified version) and include it in your application. If you use bower or npm, just include the `angular-drag-and-drop-lists` package.
|
||||
* Add the `dndLists` module as a dependency to your angular app.
|
||||
|
||||
## dnd-draggable directive
|
||||
Use the dnd-draggable directive to make your element draggable
|
||||
|
||||
**Attributes**
|
||||
* `dnd-draggable` Required attribute. The value has to be an object that represents the data of the element. In case of a drag and drop operation the object will be serialized and unserialized on the receiving end.
|
||||
* `dnd-effect-allowed` Use this attribute to limit the operations that can be performed. Valid options are `move`, `copy` and `link`, as well as `all`, `copyMove`, `copyLink` and `linkMove`, while `move` is the default value. The semantics of these operations are up to you and have to be implemented using the callbacks described below. If you allow multiple options, the user can choose between them by using the modifier keys (OS specific). The cursor will be changed accordingly, expect for IE and Edge, where this is not supported. Note that the implementation of this attribute is very buggy in IE9. This attribute works together with `dnd-external-sources` except on Safari and IE, where the restriction will be lost when dragging accross browser tabs. [Design document](https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Drop-Effects-Design) [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-type` Use this attribute if you have different kinds of items in your application and you want to limit which items can be dropped into which lists. Combine with dnd-allowed-types on the dnd-list(s). This attribute must be a lower case string. Upper case characters can be used, but will be converted to lower case automatically. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-disable-if` You can use this attribute to dynamically disable the draggability of the element. This is useful if you have certain list items that you don't want to be draggable, or if you want to disable drag & drop completely without having two different code branches (e.g. only allow for admins). [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
|
||||
**Callbacks**
|
||||
* `dnd-dragstart` Callback that is invoked when the element was dragged. The original dragstart event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-moved` Callback that is invoked when the element was moved. Usually you will remove your element from the original list in this callback, since the directive is not doing that for you automatically. The original dragend event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-copied` Same as dnd-moved, just that it is called when the element was copied instead of moved. The original dragend event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-linked` Same as dnd-moved, just that it is called when the element was linked instead of moved. The original dragend event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-canceled` Callback that is invoked if the element was dragged, but the operation was canceled and the element was not dropped. The original dragend event will be provided in the local event variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-dragend` Callback that is invoked when the drag operation ended. Available local variables are `event` and `dropEffect`. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-selected` Callback that is invoked when the element was clicked but not dragged. The original click event will be provided in the local `event` variable. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested)
|
||||
* `dnd-callback` Custom callback that is passed to dropzone callbacks and can be used to communicate between source and target scopes. The dropzone can pass user defined variables to this callback. This can be used to transfer objects without serialization, see [Demo](https://jsfiddle.net/Ldxffyod/1/).
|
||||
|
||||
**CSS classes**
|
||||
* `dndDragging` This class will be added to the element while the element is being dragged. It will affect both the element you see while dragging and the source element that stays at it's position. Do not try to hide the source element with this class, because that will abort the drag operation.
|
||||
* `dndDraggingSource` This class will be added to the element after the drag operation was started, meaning it only affects the original element that is still at it's source position, and not the "element" that the user is dragging with his mouse pointer
|
||||
|
||||
## dnd-list directive
|
||||
|
||||
Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single li element as child with the ng-repeat directive. If you don't do that, we will not be able to position the dropped element correctly. If you want your list to be sortable, also add the dnd-draggable directive to your li element(s).
|
||||
|
||||
**Attributes**
|
||||
* `dnd-list` Required attribute. The value has to be the array in which the data of the dropped element should be inserted. The value can be blank if used with a custom dnd-drop handler that handles the insertion on its own.
|
||||
* `dnd-allowed-types` Optional array of allowed item types. When used, only items that had a matching dnd-type attribute will be dropable. Upper case characters will automatically be converted to lower case. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-effect-allowed` Optional string expression that limits the drop effects that can be performed on the list. See dnd-effect-allowed on dnd-draggable for more details on allowed options. The default value is `all`.
|
||||
* `dnd-disable-if` Optional boolean expression. When it evaluates to true, no dropping into the list is possible. Note that this also disables rearranging items inside the list. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
* `dnd-horizontal-list` Optional boolean expression. When it evaluates to true, the positioning algorithm will use the left and right halfs of the list items instead of the upper and lower halfs. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-external-sources` Optional boolean expression. When it evaluates to true, the list accepts drops from sources outside of the current browser tab, which allows to drag and drop accross different browser tabs. The only major browser for which this is currently not working is Microsoft Edge. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
|
||||
**Callbacks**
|
||||
* `dnd-dragover` Optional expression that is invoked when an element is dragged over the list. If the expression is set, but does not return true, the element is not allowed to be dropped. The following variables will be available:
|
||||
* `event` The original dragover event sent by the browser.
|
||||
* `index` The position in the list at which the element would be dropped.
|
||||
* `type` The `dnd-type` set on the dnd-draggable, or undefined if unset. Will be null for drops from external sources in IE and Edge, since we don't know the type in those cases.
|
||||
* `external` Whether the element was dragged from an external source. See `dnd-external-sources`.
|
||||
* `dropEffect` The dropEffect that is going to be performed, see dnd-effect-allowed.
|
||||
* `callback` If dnd-callback was set on the source element, this is a function reference to the callback. The callback can be invoked with custom variables like this: `callback({var1: value1, var2: value2})`. The callback will be executed on the scope of the source element. If dnd-external-sources was set and external is true, this callback will not be available.
|
||||
* [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
* `dnd-drop` Optional expression that is invoked when an element is dropped on the list. The same variables as for dnd-dragover will be available, with the exception that type is always known and therefore never null. There will also be an `item` variable, which is the transferred object. The return value determines the further handling of the drop:
|
||||
* `falsy` The drop will be canceled and the element won't be inserted.
|
||||
* `true` Signalises that the drop is allowed, but the dnd-drop callback will take care of inserting the element.
|
||||
* Otherwise: All other return values will be treated as the object to insert into the array. In most cases you simply want to return the `item` parameter, but there are no restrictions on what you can return.
|
||||
* `dnd-inserted` Optional expression that is invoked after a drop if the element was actually inserted into the list. The same local variables as for `dnd-drop` will be available. Note that for reorderings inside the same list the old element will still be in the list due to the fact that `dnd-moved` was not called yet. [Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced)
|
||||
|
||||
**CSS classes**
|
||||
* `dndPlaceholder` When an element is dragged over the list, a new placeholder child element will be added. This element is of type `li` and has the class `dndPlaceholder` set. Alternatively, you can define your own placeholder by creating a child element with `dndPlaceholder` class.
|
||||
* `dndDragover` This class will be added to the list while an element is being dragged over the list.
|
||||
|
||||
## dnd-nodrag directive
|
||||
|
||||
Use the `dnd-nodrag` attribute inside of `dnd-draggable` elements to prevent them from starting drag operations. This is especially useful if you want to use input elements inside of `dnd-draggable` elements or create specific handle elements.
|
||||
|
||||
**Note:** This directive does not work in Internet Explorer 9.
|
||||
|
||||
[Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
|
||||
## dnd-handle directive
|
||||
|
||||
Use the `dnd-handle` directive within a `dnd-nodrag` element in order to allow dragging of that element after all. Therefore, by combining `dnd-nodrag` and `dnd-handle` you can allow `dnd-draggable` elements to only be dragged via specific *handle* elements.
|
||||
|
||||
**Note:** Internet Explorer will show the handle element as drag image instead of the `dnd-draggable` element. You can work around this by styling the handle element differently when it is being dragged. Use the CSS selector `.dndDragging:not(.dndDraggingSource) [dnd-handle]` for that.
|
||||
|
||||
[Demo](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/types)
|
||||
|
||||
## Recommended CSS styles
|
||||
It is recommended that you apply the following CSS styles:
|
||||
|
||||
* If your application is about moving elements by drag and drop, it is recommended that you hide the source element while dragging, i.e. setting `display: none` on the `.dndDraggingSource` class.
|
||||
* If your application allows to drop elements into empty lists, you need to ensure that empty lists never have a height or width of zero, e.g. by setting a `min-width`.
|
||||
* You should style the `.dndPlaceholder` class accordingly.
|
||||
|
||||
**Note:** Previous versions of this directive required `postion: relative` on certain elements, but this is no longer required.
|
||||
|
||||
## Why another drag & drop library?
|
||||
There are tons of other drag & drop libraries out there, but none of them met my three requirements:
|
||||
|
||||
* **Angular:** If you use angular.js, you really don't want to throw a bunch of jQuery into your app. Instead you want to use libraries that were built the "angular way" and support **two-way data binding** to update your data model automatically.
|
||||
* **Nested lists:** If you want to build a **WYSIWYG editor** or have some fancy **tree structure**, the library has to support nested lists.
|
||||
* **HTML5 drag & drop:** Most drag & drop applications you'll find on the internet use pure JavaScript drag & drop. But with the arrival of HTML5 we can delegate most of the work to the browser. For example: If you want to show the user what they are currently dragging, you'll have to update the position of the element all the time and set it below the mouse pointer. In HTML5 the browser will do that for you! But you can not only save code lines, you can also offer a more **native user experience**: If you click on an element in a pure JavaScript drag & drop implementation, it will usually start the drag operation. But remember what happens when you click an icon on your desktop: The icon will be selected, not dragged! This is the native behaviour you can bring to your web application with HTML5.
|
||||
|
||||
If this doesn't fit your requirements, check out one of the other awesome drag & drop libraries:
|
||||
|
||||
* [angular-ui-tree](https://github.com/JimLiu/angular-ui-tree): Very similar to this library, but does not use the HTML5 API. Therefore you need to write some more markup to see what you are dragging and it will create another DOM node that you have to style. However, if you plan to support touch devices this is probably your best choice.
|
||||
* [angular-dragdrop](https://github.com/angular-dragdrop/angular-dragdrop): One of many libraries with the same name. This one uses the HTML5 API, but if you want to build (nested) sortable lists, you're on your own, because it does not calculate the correct element position for you.
|
||||
* [more...](https://www.google.de/search?q=angular+drag+and+drop)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2014 [Marcel Juenemann](mailto:marcel@juenemann.cc)
|
||||
|
||||
Copyright (c) 2014-2017 Google Inc.
|
||||
|
||||
This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.
|
||||
|
||||
[MIT License](https://raw.githubusercontent.com/marceljuenemann/angular-drag-and-drop-lists/master/LICENSE)
|
|
@ -1,650 +0,0 @@
|
|||
/**
|
||||
* angular-drag-and-drop-lists v2.1.0
|
||||
*
|
||||
* Copyright (c) 2014 Marcel Juenemann marcel@juenemann.cc
|
||||
* Copyright (c) 2014-2017 Google Inc.
|
||||
* https://github.com/marceljuenemann/angular-drag-and-drop-lists
|
||||
*
|
||||
* License: MIT
|
||||
*/
|
||||
(function(dndLists) {
|
||||
|
||||
// In standard-compliant browsers we use a custom mime type and also encode the dnd-type in it.
|
||||
// However, IE and Edge only support a limited number of mime types. The workarounds are described
|
||||
// in https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
|
||||
var MIME_TYPE = 'application/x-dnd';
|
||||
var EDGE_MIME_TYPE = 'application/json';
|
||||
var MSIE_MIME_TYPE = 'Text';
|
||||
|
||||
// All valid HTML5 drop effects, in the order in which we prefer to use them.
|
||||
var ALL_EFFECTS = ['move', 'copy', 'link'];
|
||||
|
||||
/**
|
||||
* Use the dnd-draggable attribute to make your element draggable
|
||||
*
|
||||
* Attributes:
|
||||
* - dnd-draggable Required attribute. The value has to be an object that represents the data
|
||||
* of the element. In case of a drag and drop operation the object will be
|
||||
* serialized and unserialized on the receiving end.
|
||||
* - dnd-effect-allowed Use this attribute to limit the operations that can be performed. Valid
|
||||
* options are "move", "copy" and "link", as well as "all", "copyMove",
|
||||
* "copyLink" and "linkMove". The semantics of these operations are up to you
|
||||
* and have to be implemented using the callbacks described below. If you
|
||||
* allow multiple options, the user can choose between them by using the
|
||||
* modifier keys (OS specific). The cursor will be changed accordingly,
|
||||
* expect for IE and Edge, where this is not supported.
|
||||
* - dnd-type Use this attribute if you have different kinds of items in your
|
||||
* application and you want to limit which items can be dropped into which
|
||||
* lists. Combine with dnd-allowed-types on the dnd-list(s). This attribute
|
||||
* must be a lower case string. Upper case characters can be used, but will
|
||||
* be converted to lower case automatically.
|
||||
* - dnd-disable-if You can use this attribute to dynamically disable the draggability of the
|
||||
* element. This is useful if you have certain list items that you don't want
|
||||
* to be draggable, or if you want to disable drag & drop completely without
|
||||
* having two different code branches (e.g. only allow for admins).
|
||||
*
|
||||
* Callbacks:
|
||||
* - dnd-dragstart Callback that is invoked when the element was dragged. The original
|
||||
* dragstart event will be provided in the local event variable.
|
||||
* - dnd-moved Callback that is invoked when the element was moved. Usually you will
|
||||
* remove your element from the original list in this callback, since the
|
||||
* directive is not doing that for you automatically. The original dragend
|
||||
* event will be provided in the local event variable.
|
||||
* - dnd-copied Same as dnd-moved, just that it is called when the element was copied
|
||||
* instead of moved, so you probably want to implement a different logic.
|
||||
* - dnd-linked Same as dnd-moved, just that it is called when the element was linked
|
||||
* instead of moved, so you probably want to implement a different logic.
|
||||
* - dnd-canceled Callback that is invoked if the element was dragged, but the operation was
|
||||
* canceled and the element was not dropped. The original dragend event will
|
||||
* be provided in the local event variable.
|
||||
* - dnd-dragend Callback that is invoked when the drag operation ended. Available local
|
||||
* variables are event and dropEffect.
|
||||
* - dnd-selected Callback that is invoked when the element was clicked but not dragged.
|
||||
* The original click event will be provided in the local event variable.
|
||||
* - dnd-callback Custom callback that is passed to dropzone callbacks and can be used to
|
||||
* communicate between source and target scopes. The dropzone can pass user
|
||||
* defined variables to this callback.
|
||||
*
|
||||
* CSS classes:
|
||||
* - dndDragging This class will be added to the element while the element is being
|
||||
* dragged. It will affect both the element you see while dragging and the
|
||||
* source element that stays at it's position. Do not try to hide the source
|
||||
* element with this class, because that will abort the drag operation.
|
||||
* - dndDraggingSource This class will be added to the element after the drag operation was
|
||||
* started, meaning it only affects the original element that is still at
|
||||
* it's source position, and not the "element" that the user is dragging with
|
||||
* his mouse pointer.
|
||||
*/
|
||||
dndLists.directive('dndDraggable', ['$parse', '$timeout', function($parse, $timeout) {
|
||||
return function(scope, element, attr) {
|
||||
// Set the HTML5 draggable attribute on the element.
|
||||
element.attr("draggable", "true");
|
||||
|
||||
// If the dnd-disable-if attribute is set, we have to watch that.
|
||||
if (attr.dndDisableIf) {
|
||||
scope.$watch(attr.dndDisableIf, function(disabled) {
|
||||
element.attr("draggable", !disabled);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* When the drag operation is started we have to prepare the dataTransfer object,
|
||||
* which is the primary way we communicate with the target element
|
||||
*/
|
||||
element.on('dragstart', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
// Check whether the element is draggable, since dragstart might be triggered on a child.
|
||||
if (element.attr('draggable') == 'false') return true;
|
||||
|
||||
// Initialize global state.
|
||||
dndState.isDragging = true;
|
||||
dndState.itemType = attr.dndType && scope.$eval(attr.dndType).toLowerCase();
|
||||
|
||||
// Set the allowed drop effects. See below for special IE handling.
|
||||
dndState.dropEffect = "none";
|
||||
dndState.effectAllowed = attr.dndEffectAllowed || ALL_EFFECTS[0];
|
||||
event.dataTransfer.effectAllowed = dndState.effectAllowed;
|
||||
|
||||
// Internet Explorer and Microsoft Edge don't support custom mime types, see design doc:
|
||||
// https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
|
||||
var item = scope.$eval(attr.dndDraggable);
|
||||
var mimeType = MIME_TYPE + (dndState.itemType ? ('-' + dndState.itemType) : '');
|
||||
try {
|
||||
event.dataTransfer.setData(mimeType, angular.toJson(item));
|
||||
} catch (e) {
|
||||
// Setting a custom MIME type did not work, we are probably in IE or Edge.
|
||||
var data = angular.toJson({item: item, type: dndState.itemType});
|
||||
try {
|
||||
event.dataTransfer.setData(EDGE_MIME_TYPE, data);
|
||||
} catch (e) {
|
||||
// We are in Internet Explorer and can only use the Text MIME type. Also note that IE
|
||||
// does not allow changing the cursor in the dragover event, therefore we have to choose
|
||||
// the one we want to display now by setting effectAllowed.
|
||||
var effectsAllowed = filterEffects(ALL_EFFECTS, dndState.effectAllowed);
|
||||
event.dataTransfer.effectAllowed = effectsAllowed[0];
|
||||
event.dataTransfer.setData(MSIE_MIME_TYPE, data);
|
||||
}
|
||||
}
|
||||
|
||||
// Add CSS classes. See documentation above.
|
||||
element.addClass("dndDragging");
|
||||
$timeout(function() { element.addClass("dndDraggingSource"); }, 0);
|
||||
|
||||
// Try setting a proper drag image if triggered on a dnd-handle (won't work in IE).
|
||||
if (event._dndHandle && event.dataTransfer.setDragImage) {
|
||||
event.dataTransfer.setDragImage(element[0], 0, 0);
|
||||
}
|
||||
|
||||
// Invoke dragstart callback and prepare extra callback for dropzone.
|
||||
$parse(attr.dndDragstart)(scope, {event: event});
|
||||
if (attr.dndCallback) {
|
||||
var callback = $parse(attr.dndCallback);
|
||||
dndState.callback = function(params) { return callback(scope, params || {}); };
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
/**
|
||||
* The dragend event is triggered when the element was dropped or when the drag
|
||||
* operation was aborted (e.g. hit escape button). Depending on the executed action
|
||||
* we will invoke the callbacks specified with the dnd-moved or dnd-copied attribute.
|
||||
*/
|
||||
element.on('dragend', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
// Invoke callbacks. Usually we would use event.dataTransfer.dropEffect to determine
|
||||
// the used effect, but Chrome has not implemented that field correctly. On Windows
|
||||
// it always sets it to 'none', while Chrome on Linux sometimes sets it to something
|
||||
// else when it's supposed to send 'none' (drag operation aborted).
|
||||
scope.$apply(function() {
|
||||
var dropEffect = dndState.dropEffect;
|
||||
var cb = {copy: 'dndCopied', link: 'dndLinked', move: 'dndMoved', none: 'dndCanceled'};
|
||||
$parse(attr[cb[dropEffect]])(scope, {event: event});
|
||||
$parse(attr.dndDragend)(scope, {event: event, dropEffect: dropEffect});
|
||||
});
|
||||
|
||||
// Clean up
|
||||
dndState.isDragging = false;
|
||||
dndState.callback = undefined;
|
||||
element.removeClass("dndDragging");
|
||||
element.removeClass("dndDraggingSource");
|
||||
event.stopPropagation();
|
||||
|
||||
// In IE9 it is possible that the timeout from dragstart triggers after the dragend handler.
|
||||
$timeout(function() { element.removeClass("dndDraggingSource"); }, 0);
|
||||
});
|
||||
|
||||
/**
|
||||
* When the element is clicked we invoke the callback function
|
||||
* specified with the dnd-selected attribute.
|
||||
*/
|
||||
element.on('click', function(event) {
|
||||
if (!attr.dndSelected) return;
|
||||
|
||||
event = event.originalEvent || event;
|
||||
scope.$apply(function() {
|
||||
$parse(attr.dndSelected)(scope, {event: event});
|
||||
});
|
||||
|
||||
// Prevent triggering dndSelected in parent elements.
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
/**
|
||||
* Workaround to make element draggable in IE9
|
||||
*/
|
||||
element.on('selectstart', function() {
|
||||
if (this.dragDrop) this.dragDrop();
|
||||
});
|
||||
};
|
||||
}]);
|
||||
|
||||
/**
|
||||
* Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single
|
||||
* li element as child with the ng-repeat directive. If you don't do that, we will not be able to
|
||||
* position the dropped element correctly. If you want your list to be sortable, also add the
|
||||
* dnd-draggable directive to your li element(s).
|
||||
*
|
||||
* Attributes:
|
||||
* - dnd-list Required attribute. The value has to be the array in which the data of
|
||||
* the dropped element should be inserted. The value can be blank if used
|
||||
* with a custom dnd-drop handler that always returns true.
|
||||
* - dnd-allowed-types Optional array of allowed item types. When used, only items that had a
|
||||
* matching dnd-type attribute will be dropable. Upper case characters will
|
||||
* automatically be converted to lower case.
|
||||
* - dnd-effect-allowed Optional string expression that limits the drop effects that can be
|
||||
* performed in the list. See dnd-effect-allowed on dnd-draggable for more
|
||||
* details on allowed options. The default value is all.
|
||||
* - dnd-disable-if Optional boolean expresssion. When it evaluates to true, no dropping
|
||||
* into the list is possible. Note that this also disables rearranging
|
||||
* items inside the list.
|
||||
* - dnd-horizontal-list Optional boolean expresssion. When it evaluates to true, the positioning
|
||||
* algorithm will use the left and right halfs of the list items instead of
|
||||
* the upper and lower halfs.
|
||||
* - dnd-external-sources Optional boolean expression. When it evaluates to true, the list accepts
|
||||
* drops from sources outside of the current browser tab. This allows to
|
||||
* drag and drop accross different browser tabs. The only major browser
|
||||
* that does not support this is currently Microsoft Edge.
|
||||
*
|
||||
* Callbacks:
|
||||
* - dnd-dragover Optional expression that is invoked when an element is dragged over the
|
||||
* list. If the expression is set, but does not return true, the element is
|
||||
* not allowed to be dropped. The following variables will be available:
|
||||
* - event: The original dragover event sent by the browser.
|
||||
* - index: The position in the list at which the element would be dropped.
|
||||
* - type: The dnd-type set on the dnd-draggable, or undefined if non was
|
||||
* set. Will be null for drops from external sources in IE and Edge,
|
||||
* since we don't know the type in those cases.
|
||||
* - dropEffect: One of move, copy or link, see dnd-effect-allowed.
|
||||
* - external: Whether the element was dragged from an external source.
|
||||
* - callback: If dnd-callback was set on the source element, this is a
|
||||
* function reference to the callback. The callback can be invoked with
|
||||
* custom variables like this: callback({var1: value1, var2: value2}).
|
||||
* The callback will be executed on the scope of the source element. If
|
||||
* dnd-external-sources was set and external is true, this callback will
|
||||
* not be available.
|
||||
* - dnd-drop Optional expression that is invoked when an element is dropped on the
|
||||
* list. The same variables as for dnd-dragover will be available, with the
|
||||
* exception that type is always known and therefore never null. There
|
||||
* will also be an item variable, which is the transferred object. The
|
||||
* return value determines the further handling of the drop:
|
||||
* - falsy: The drop will be canceled and the element won't be inserted.
|
||||
* - true: Signalises that the drop is allowed, but the dnd-drop
|
||||
* callback already took care of inserting the element.
|
||||
* - otherwise: All other return values will be treated as the object to
|
||||
* insert into the array. In most cases you want to simply return the
|
||||
* item parameter, but there are no restrictions on what you can return.
|
||||
* - dnd-inserted Optional expression that is invoked after a drop if the element was
|
||||
* actually inserted into the list. The same local variables as for
|
||||
* dnd-drop will be available. Note that for reorderings inside the same
|
||||
* list the old element will still be in the list due to the fact that
|
||||
* dnd-moved was not called yet.
|
||||
*
|
||||
* CSS classes:
|
||||
* - dndPlaceholder When an element is dragged over the list, a new placeholder child
|
||||
* element will be added. This element is of type li and has the class
|
||||
* dndPlaceholder set. Alternatively, you can define your own placeholder
|
||||
* by creating a child element with dndPlaceholder class.
|
||||
* - dndDragover Will be added to the list while an element is dragged over the list.
|
||||
*/
|
||||
dndLists.directive('dndList', ['$parse', function($parse) {
|
||||
return function(scope, element, attr) {
|
||||
// While an element is dragged over the list, this placeholder element is inserted
|
||||
// at the location where the element would be inserted after dropping.
|
||||
var placeholder = getPlaceholderElement();
|
||||
placeholder.remove();
|
||||
|
||||
var placeholderNode = placeholder[0];
|
||||
var listNode = element[0];
|
||||
var listSettings = {};
|
||||
|
||||
/**
|
||||
* The dragenter event is fired when a dragged element or text selection enters a valid drop
|
||||
* target. According to the spec, we either need to have a dropzone attribute or listen on
|
||||
* dragenter events and call preventDefault(). It should be noted though that no browser seems
|
||||
* to enforce this behaviour.
|
||||
*/
|
||||
element.on('dragenter', function (event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
// Calculate list properties, so that we don't have to repeat this on every dragover event.
|
||||
var types = attr.dndAllowedTypes && scope.$eval(attr.dndAllowedTypes);
|
||||
listSettings = {
|
||||
allowedTypes: angular.isArray(types) && types.join('|').toLowerCase().split('|'),
|
||||
disabled: attr.dndDisableIf && scope.$eval(attr.dndDisableIf),
|
||||
externalSources: attr.dndExternalSources && scope.$eval(attr.dndExternalSources),
|
||||
horizontal: attr.dndHorizontalList && scope.$eval(attr.dndHorizontalList)
|
||||
};
|
||||
|
||||
var mimeType = getMimeType(event.dataTransfer.types);
|
||||
if (!mimeType || !isDropAllowed(getItemType(mimeType))) return true;
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
/**
|
||||
* The dragover event is triggered "every few hundred milliseconds" while an element
|
||||
* is being dragged over our list, or over an child element.
|
||||
*/
|
||||
element.on('dragover', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
// Check whether the drop is allowed and determine mime type.
|
||||
var mimeType = getMimeType(event.dataTransfer.types);
|
||||
var itemType = getItemType(mimeType);
|
||||
if (!mimeType || !isDropAllowed(itemType)) return true;
|
||||
|
||||
// Make sure the placeholder is shown, which is especially important if the list is empty.
|
||||
if (placeholderNode.parentNode != listNode) {
|
||||
element.append(placeholder);
|
||||
}
|
||||
|
||||
if (event.target != listNode) {
|
||||
// Try to find the node direct directly below the list node.
|
||||
var listItemNode = event.target;
|
||||
while (listItemNode.parentNode != listNode && listItemNode.parentNode) {
|
||||
listItemNode = listItemNode.parentNode;
|
||||
}
|
||||
|
||||
if (listItemNode.parentNode == listNode && listItemNode != placeholderNode) {
|
||||
// If the mouse pointer is in the upper half of the list item element,
|
||||
// we position the placeholder before the list item, otherwise after it.
|
||||
var rect = listItemNode.getBoundingClientRect();
|
||||
if (listSettings.horizontal) {
|
||||
var isFirstHalf = event.clientX < rect.left + rect.width / 2;
|
||||
} else {
|
||||
var isFirstHalf = event.clientY < rect.top + rect.height / 2;
|
||||
}
|
||||
listNode.insertBefore(placeholderNode,
|
||||
isFirstHalf ? listItemNode : listItemNode.nextSibling);
|
||||
}
|
||||
}
|
||||
|
||||
// In IE we set a fake effectAllowed in dragstart to get the correct cursor, we therefore
|
||||
// ignore the effectAllowed passed in dataTransfer. We must also not access dataTransfer for
|
||||
// drops from external sources, as that throws an exception.
|
||||
var ignoreDataTransfer = mimeType == MSIE_MIME_TYPE;
|
||||
var dropEffect = getDropEffect(event, ignoreDataTransfer);
|
||||
if (dropEffect == 'none') return stopDragover();
|
||||
|
||||
// At this point we invoke the callback, which still can disallow the drop.
|
||||
// We can't do this earlier because we want to pass the index of the placeholder.
|
||||
if (attr.dndDragover && !invokeCallback(attr.dndDragover, event, dropEffect, itemType)) {
|
||||
return stopDragover();
|
||||
}
|
||||
|
||||
// Set dropEffect to modify the cursor shown by the browser, unless we're in IE, where this
|
||||
// is not supported. This must be done after preventDefault in Firefox.
|
||||
event.preventDefault();
|
||||
if (!ignoreDataTransfer) {
|
||||
event.dataTransfer.dropEffect = dropEffect;
|
||||
}
|
||||
|
||||
element.addClass("dndDragover");
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* When the element is dropped, we use the position of the placeholder element as the
|
||||
* position where we insert the transferred data. This assumes that the list has exactly
|
||||
* one child element per array element.
|
||||
*/
|
||||
element.on('drop', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
// Check whether the drop is allowed and determine mime type.
|
||||
var mimeType = getMimeType(event.dataTransfer.types);
|
||||
var itemType = getItemType(mimeType);
|
||||
if (!mimeType || !isDropAllowed(itemType)) return true;
|
||||
|
||||
// The default behavior in Firefox is to interpret the dropped element as URL and
|
||||
// forward to it. We want to prevent that even if our drop is aborted.
|
||||
event.preventDefault();
|
||||
|
||||
// Unserialize the data that was serialized in dragstart.
|
||||
try {
|
||||
var data = JSON.parse(event.dataTransfer.getData(mimeType));
|
||||
} catch(e) {
|
||||
return stopDragover();
|
||||
}
|
||||
|
||||
// Drops with invalid types from external sources might not have been filtered out yet.
|
||||
if (mimeType == MSIE_MIME_TYPE || mimeType == EDGE_MIME_TYPE) {
|
||||
itemType = data.type || undefined;
|
||||
data = data.item;
|
||||
if (!isDropAllowed(itemType)) return stopDragover();
|
||||
}
|
||||
|
||||
// Special handling for internal IE drops, see dragover handler.
|
||||
var ignoreDataTransfer = mimeType == MSIE_MIME_TYPE;
|
||||
var dropEffect = getDropEffect(event, ignoreDataTransfer);
|
||||
if (dropEffect == 'none') return stopDragover();
|
||||
|
||||
// Invoke the callback, which can transform the transferredObject and even abort the drop.
|
||||
var index = getPlaceholderIndex();
|
||||
if (attr.dndDrop) {
|
||||
data = invokeCallback(attr.dndDrop, event, dropEffect, itemType, index, data);
|
||||
if (!data) return stopDragover();
|
||||
}
|
||||
|
||||
// The drop is definitely going to happen now, store the dropEffect.
|
||||
dndState.dropEffect = dropEffect;
|
||||
if (!ignoreDataTransfer) {
|
||||
event.dataTransfer.dropEffect = dropEffect;
|
||||
}
|
||||
|
||||
// Insert the object into the array, unless dnd-drop took care of that (returned true).
|
||||
if (data !== true) {
|
||||
scope.$apply(function() {
|
||||
scope.$eval(attr.dndList).splice(index, 0, data);
|
||||
});
|
||||
}
|
||||
invokeCallback(attr.dndInserted, event, dropEffect, itemType, index, data);
|
||||
|
||||
// Clean up
|
||||
stopDragover();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* We have to remove the placeholder when the element is no longer dragged over our list. The
|
||||
* problem is that the dragleave event is not only fired when the element leaves our list,
|
||||
* but also when it leaves a child element. Therefore, we determine whether the mouse cursor
|
||||
* is still pointing to an element inside the list or not.
|
||||
*/
|
||||
element.on('dragleave', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
var newTarget = document.elementFromPoint(event.clientX, event.clientY);
|
||||
if (listNode.contains(newTarget) && !event._dndPhShown) {
|
||||
// Signalize to potential parent lists that a placeholder is already shown.
|
||||
event._dndPhShown = true;
|
||||
} else {
|
||||
stopDragover();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Given the types array from the DataTransfer object, returns the first valid mime type.
|
||||
* A type is valid if it starts with MIME_TYPE, or it equals MSIE_MIME_TYPE or EDGE_MIME_TYPE.
|
||||
*/
|
||||
function getMimeType(types) {
|
||||
if (!types) return MSIE_MIME_TYPE; // IE 9 workaround.
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
if (types[i] == MSIE_MIME_TYPE || types[i] == EDGE_MIME_TYPE ||
|
||||
types[i].substr(0, MIME_TYPE.length) == MIME_TYPE) {
|
||||
return types[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the type of the item from the dndState, or from the mime type for items from
|
||||
* external sources. Returns undefined if no item type was set and null if the item type could
|
||||
* not be determined.
|
||||
*/
|
||||
function getItemType(mimeType) {
|
||||
if (dndState.isDragging) return dndState.itemType || undefined;
|
||||
if (mimeType == MSIE_MIME_TYPE || mimeType == EDGE_MIME_TYPE) return null;
|
||||
return (mimeType && mimeType.substr(MIME_TYPE.length + 1)) || undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks various conditions that must be fulfilled for a drop to be allowed, including the
|
||||
* dnd-allowed-types attribute. If the item Type is unknown (null), the drop will be allowed.
|
||||
*/
|
||||
function isDropAllowed(itemType) {
|
||||
if (listSettings.disabled) return false;
|
||||
if (!listSettings.externalSources && !dndState.isDragging) return false;
|
||||
if (!listSettings.allowedTypes || itemType === null) return true;
|
||||
return itemType && listSettings.allowedTypes.indexOf(itemType) != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines which drop effect to use for the given event. In Internet Explorer we have to
|
||||
* ignore the effectAllowed field on dataTransfer, since we set a fake value in dragstart.
|
||||
* In those cases we rely on dndState to filter effects. Read the design doc for more details:
|
||||
* https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
|
||||
*/
|
||||
function getDropEffect(event, ignoreDataTransfer) {
|
||||
var effects = ALL_EFFECTS;
|
||||
if (!ignoreDataTransfer) {
|
||||
effects = filterEffects(effects, event.dataTransfer.effectAllowed);
|
||||
}
|
||||
if (dndState.isDragging) {
|
||||
effects = filterEffects(effects, dndState.effectAllowed);
|
||||
}
|
||||
if (attr.dndEffectAllowed) {
|
||||
effects = filterEffects(effects, attr.dndEffectAllowed);
|
||||
}
|
||||
// MacOS automatically filters dataTransfer.effectAllowed depending on the modifier keys,
|
||||
// therefore the following modifier keys will only affect other operating systems.
|
||||
if (!effects.length) {
|
||||
return 'none';
|
||||
} else if (event.ctrlKey && effects.indexOf('copy') != -1) {
|
||||
return 'copy';
|
||||
} else if (event.altKey && effects.indexOf('link') != -1) {
|
||||
return 'link';
|
||||
} else {
|
||||
return effects[0];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Small helper function that cleans up if we aborted a drop.
|
||||
*/
|
||||
function stopDragover() {
|
||||
placeholder.remove();
|
||||
element.removeClass("dndDragover");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes a callback with some interesting parameters and returns the callbacks return value.
|
||||
*/
|
||||
function invokeCallback(expression, event, dropEffect, itemType, index, item) {
|
||||
return $parse(expression)(scope, {
|
||||
callback: dndState.callback,
|
||||
dropEffect: dropEffect,
|
||||
event: event,
|
||||
external: !dndState.isDragging,
|
||||
index: index !== undefined ? index : getPlaceholderIndex(),
|
||||
item: item || undefined,
|
||||
type: itemType
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* We use the position of the placeholder node to determine at which position of the array the
|
||||
* object needs to be inserted
|
||||
*/
|
||||
function getPlaceholderIndex() {
|
||||
return Array.prototype.indexOf.call(listNode.children, placeholderNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find a child element that has the dndPlaceholder class set. If none was found, a
|
||||
* new li element is created.
|
||||
*/
|
||||
function getPlaceholderElement() {
|
||||
var placeholder;
|
||||
angular.forEach(element.children(), function(childNode) {
|
||||
var child = angular.element(childNode);
|
||||
if (child.hasClass('dndPlaceholder')) {
|
||||
placeholder = child;
|
||||
}
|
||||
});
|
||||
return placeholder || angular.element("<li class='dndPlaceholder'></li>");
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
/**
|
||||
* Use the dnd-nodrag attribute inside of dnd-draggable elements to prevent them from starting
|
||||
* drag operations. This is especially useful if you want to use input elements inside of
|
||||
* dnd-draggable elements or create specific handle elements. Note: This directive does not work
|
||||
* in Internet Explorer 9.
|
||||
*/
|
||||
dndLists.directive('dndNodrag', function() {
|
||||
return function(scope, element, attr) {
|
||||
// Set as draggable so that we can cancel the events explicitly
|
||||
element.attr("draggable", "true");
|
||||
|
||||
/**
|
||||
* Since the element is draggable, the browser's default operation is to drag it on dragstart.
|
||||
* We will prevent that and also stop the event from bubbling up.
|
||||
*/
|
||||
element.on('dragstart', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
|
||||
if (!event._dndHandle) {
|
||||
// If a child element already reacted to dragstart and set a dataTransfer object, we will
|
||||
// allow that. For example, this is the case for user selections inside of input elements.
|
||||
if (!(event.dataTransfer.types && event.dataTransfer.types.length)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Stop propagation of dragend events, otherwise dnd-moved might be triggered and the element
|
||||
* would be removed.
|
||||
*/
|
||||
element.on('dragend', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
if (!event._dndHandle) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Use the dnd-handle directive within a dnd-nodrag element in order to allow dragging with that
|
||||
* element after all. Therefore, by combining dnd-nodrag and dnd-handle you can allow
|
||||
* dnd-draggable elements to only be dragged via specific "handle" elements. Note that Internet
|
||||
* Explorer will show the handle element as drag image instead of the dnd-draggable element. You
|
||||
* can work around this by styling the handle element differently when it is being dragged. Use
|
||||
* the CSS selector .dndDragging:not(.dndDraggingSource) [dnd-handle] for that.
|
||||
*/
|
||||
dndLists.directive('dndHandle', function() {
|
||||
return function(scope, element, attr) {
|
||||
element.attr("draggable", "true");
|
||||
|
||||
element.on('dragstart dragend', function(event) {
|
||||
event = event.originalEvent || event;
|
||||
event._dndHandle = true;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Filters an array of drop effects using a HTML5 effectAllowed string.
|
||||
*/
|
||||
function filterEffects(effects, effectAllowed) {
|
||||
if (effectAllowed == 'all') return effects;
|
||||
return effects.filter(function(effect) {
|
||||
return effectAllowed.toLowerCase().indexOf(effect) != -1;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* For some features we need to maintain global state. This is done here, with these fields:
|
||||
* - callback: A callback function set at dragstart that is passed to internal dropzone handlers.
|
||||
* - dropEffect: Set in dragstart to "none" and to the actual value in the drop handler. We don't
|
||||
* rely on the dropEffect passed by the browser, since there are various bugs in Chrome and
|
||||
* Safari, and Internet Explorer defaults to copy if effectAllowed is copyMove.
|
||||
* - effectAllowed: Set in dragstart based on dnd-effect-allowed. This is needed for IE because
|
||||
* setting effectAllowed on dataTransfer might result in an undesired cursor.
|
||||
* - isDragging: True between dragstart and dragend. Falsy for drops from external sources.
|
||||
* - itemType: The item type of the dragged element set via dnd-type. This is needed because IE
|
||||
* and Edge don't support custom mime types that we can use to transfer this information.
|
||||
*/
|
||||
var dndState = {};
|
||||
|
||||
})(angular.module('dndLists', []));
|
|
@ -1,49 +0,0 @@
|
|||
/**
|
||||
* angular-drag-and-drop-lists v2.1.0
|
||||
*
|
||||
* Copyright (c) 2014 Marcel Juenemann marcel@juenemann.cc
|
||||
* Copyright (c) 2014-2017 Google Inc.
|
||||
* https://github.com/marceljuenemann/angular-drag-and-drop-lists
|
||||
*
|
||||
* License: MIT
|
||||
*/
|
||||
!function(e){function n(e,n){return"all"==n?e:e.filter(function(e){return-1!=n.toLowerCase().indexOf(e)})}var a="application/x-dnd",r="application/json",t="Text",d=["move","copy","link"]
|
||||
e.directive("dndDraggable",["$parse","$timeout",function(e,i){return function(l,f,c){f.attr("draggable","true"),c.dndDisableIf&&l.$watch(c.dndDisableIf,function(e){f.attr("draggable",!e)}),f.on("dragstart",function(s){if(s=s.originalEvent||s,"false"==f.attr("draggable"))return!0
|
||||
o.isDragging=!0,o.itemType=c.dndType&&l.$eval(c.dndType).toLowerCase(),o.dropEffect="none",o.effectAllowed=c.dndEffectAllowed||d[0],s.dataTransfer.effectAllowed=o.effectAllowed
|
||||
var g=l.$eval(c.dndDraggable),u=a+(o.itemType?"-"+o.itemType:"")
|
||||
try{s.dataTransfer.setData(u,angular.toJson(g))}catch(p){var v=angular.toJson({item:g,type:o.itemType})
|
||||
try{s.dataTransfer.setData(r,v)}catch(p){var D=n(d,o.effectAllowed)
|
||||
s.dataTransfer.effectAllowed=D[0],s.dataTransfer.setData(t,v)}}if(f.addClass("dndDragging"),i(function(){f.addClass("dndDraggingSource")},0),s._dndHandle&&s.dataTransfer.setDragImage&&s.dataTransfer.setDragImage(f[0],0,0),e(c.dndDragstart)(l,{event:s}),c.dndCallback){var y=e(c.dndCallback)
|
||||
o.callback=function(e){return y(l,e||{})}}s.stopPropagation()}),f.on("dragend",function(n){n=n.originalEvent||n,l.$apply(function(){var a=o.dropEffect,r={copy:"dndCopied",link:"dndLinked",move:"dndMoved",none:"dndCanceled"}
|
||||
e(c[r[a]])(l,{event:n}),e(c.dndDragend)(l,{event:n,dropEffect:a})}),o.isDragging=!1,o.callback=void 0,f.removeClass("dndDragging"),f.removeClass("dndDraggingSource"),n.stopPropagation(),i(function(){f.removeClass("dndDraggingSource")},0)}),f.on("click",function(n){c.dndSelected&&(n=n.originalEvent||n,l.$apply(function(){e(c.dndSelected)(l,{event:n})}),n.stopPropagation())}),f.on("selectstart",function(){this.dragDrop&&this.dragDrop()})}}]),e.directive("dndList",["$parse",function(e){return function(i,l,f){function c(e){if(!e)return t
|
||||
for(var n=0;n<e.length;n++)if(e[n]==t||e[n]==r||e[n].substr(0,a.length)==a)return e[n]
|
||||
return null}function s(e){return o.isDragging?o.itemType||void 0:e==t||e==r?null:e&&e.substr(a.length+1)||void 0}function g(e){return E.disabled?!1:E.externalSources||o.isDragging?E.allowedTypes&&null!==e?e&&-1!=E.allowedTypes.indexOf(e):!0:!1}function u(e,a){var r=d
|
||||
return a||(r=n(r,e.dataTransfer.effectAllowed)),o.isDragging&&(r=n(r,o.effectAllowed)),f.dndEffectAllowed&&(r=n(r,f.dndEffectAllowed)),r.length?e.ctrlKey&&-1!=r.indexOf("copy")?"copy":e.altKey&&-1!=r.indexOf("link")?"link":r[0]:"none"}function p(){return T.remove(),l.removeClass("dndDragover"),!0}function v(n,a,r,t,d,l){return e(n)(i,{callback:o.callback,dropEffect:r,event:a,external:!o.isDragging,index:void 0!==d?d:D(),item:l||void 0,type:t})}function D(){return Array.prototype.indexOf.call(m.children,h)}function y(){var e
|
||||
return angular.forEach(l.children(),function(n){var a=angular.element(n)
|
||||
a.hasClass("dndPlaceholder")&&(e=a)}),e||angular.element("<li class='dndPlaceholder'></li>")}var T=y()
|
||||
T.remove()
|
||||
var h=T[0],m=l[0],E={}
|
||||
l.on("dragenter",function(e){e=e.originalEvent||e
|
||||
var n=f.dndAllowedTypes&&i.$eval(f.dndAllowedTypes)
|
||||
E={allowedTypes:angular.isArray(n)&&n.join("|").toLowerCase().split("|"),disabled:f.dndDisableIf&&i.$eval(f.dndDisableIf),externalSources:f.dndExternalSources&&i.$eval(f.dndExternalSources),horizontal:f.dndHorizontalList&&i.$eval(f.dndHorizontalList)}
|
||||
var a=c(e.dataTransfer.types)
|
||||
return a&&g(s(a))?void e.preventDefault():!0}),l.on("dragover",function(e){e=e.originalEvent||e
|
||||
var n=c(e.dataTransfer.types),a=s(n)
|
||||
if(!n||!g(a))return!0
|
||||
if(h.parentNode!=m&&l.append(T),e.target!=m){for(var r=e.target;r.parentNode!=m&&r.parentNode;)r=r.parentNode
|
||||
if(r.parentNode==m&&r!=h){var d=r.getBoundingClientRect()
|
||||
if(E.horizontal)var o=e.clientX<d.left+d.width/2
|
||||
else var o=e.clientY<d.top+d.height/2
|
||||
m.insertBefore(h,o?r:r.nextSibling)}}var i=n==t,D=u(e,i)
|
||||
return"none"==D?p():f.dndDragover&&!v(f.dndDragover,e,D,a)?p():(e.preventDefault(),i||(e.dataTransfer.dropEffect=D),l.addClass("dndDragover"),e.stopPropagation(),!1)}),l.on("drop",function(e){e=e.originalEvent||e
|
||||
var n=c(e.dataTransfer.types),a=s(n)
|
||||
if(!n||!g(a))return!0
|
||||
e.preventDefault()
|
||||
try{var d=JSON.parse(e.dataTransfer.getData(n))}catch(l){return p()}if((n==t||n==r)&&(a=d.type||void 0,d=d.item,!g(a)))return p()
|
||||
var y=n==t,T=u(e,y)
|
||||
if("none"==T)return p()
|
||||
var h=D()
|
||||
return f.dndDrop&&(d=v(f.dndDrop,e,T,a,h,d),!d)?p():(o.dropEffect=T,y||(e.dataTransfer.dropEffect=T),d!==!0&&i.$apply(function(){i.$eval(f.dndList).splice(h,0,d)}),v(f.dndInserted,e,T,a,h,d),p(),e.stopPropagation(),!1)}),l.on("dragleave",function(e){e=e.originalEvent||e
|
||||
var n=document.elementFromPoint(e.clientX,e.clientY)
|
||||
m.contains(n)&&!e._dndPhShown?e._dndPhShown=!0:p()})}}]),e.directive("dndNodrag",function(){return function(e,n,a){n.attr("draggable","true"),n.on("dragstart",function(e){e=e.originalEvent||e,e._dndHandle||(e.dataTransfer.types&&e.dataTransfer.types.length||e.preventDefault(),e.stopPropagation())}),n.on("dragend",function(e){e=e.originalEvent||e,e._dndHandle||e.stopPropagation()})}}),e.directive("dndHandle",function(){return function(e,n,a){n.attr("draggable","true"),n.on("dragstart dragend",function(e){e=e.originalEvent||e,e._dndHandle=!0})}})
|
||||
var o={}}(angular.module("dndLists",[]));
|
30
js/vendor/angular-drag-and-drop-lists/bower.json
vendored
30
js/vendor/angular-drag-and-drop-lists/bower.json
vendored
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"name": "angular-drag-and-drop-lists",
|
||||
"main": "angular-drag-and-drop-lists.js",
|
||||
"version": "2.1.0",
|
||||
"homepage": "https://github.com/marceljuenemann/angular-drag-and-drop-lists",
|
||||
"authors": [
|
||||
"Marcel Juenemann <marcel@juenemann.cc>"
|
||||
],
|
||||
"description": "Angular directives for sorting nested lists using the HTML5 Drag & Drop API",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"drag",
|
||||
"drop",
|
||||
"dnd",
|
||||
"nested",
|
||||
"sortable",
|
||||
"lists",
|
||||
"html5"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"demo",
|
||||
"*.json",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<h1>Demo: Advanced Features</h1>
|
||||
|
||||
<ul>
|
||||
<li><strong>dnd-effect-allowed:</strong> This demo shows how to use dnd-effect-allowed to control which drop effects are allowed.
|
||||
If the source and target elements have no drop effect that is allowed on both, then a drop is not possible. If there are multiple
|
||||
possible drop effects, then the user can control the drop effect using modifier keys (Ctrl and Alt).</li>
|
||||
<li><strong>dnd-external-sources:</strong> Allows to drag and drop elements accross browser windows, which you can test in this
|
||||
example. The downside to this is that the lists will accept arbitrary text to be dropped. To prevent that, the dnd-drop callback
|
||||
verifies that the dropped element is of the desired format.</li>
|
||||
<li><strong>dnd-allowed-types in nested lists:</strong> We are using the dnd-allowed-types attribute to ensure that Containers
|
||||
only accept items, but not other containers.</li>
|
||||
<li><strong>dnd-horizontal-list:</strong> This attribute tells the positioning algorithm to drop incoming elements left or right
|
||||
of the existing elements, instead of above or below.</li>
|
||||
<li><strong>Callbacks:</strong> The directives offer various callbacks, which in this example will log the events to the console.
|
||||
Additionally, the callbacks on the dnd-list can prevent an element from being dropped. In this example <strong>you can't drop elements
|
||||
after the 10th position</strong>, because we are preventing that in the dnd-dragover callback.</li>
|
||||
</ul>
|
||||
|
||||
<div class="advancedDemo row">
|
||||
<div ng-repeat="containers in model" class="col-md-6">
|
||||
<div class="dropzone box box-yellow" ng-include="'advanced/advanced.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div view-source="advanced"></div>
|
||||
|
||||
<h2>Generated Model</h2>
|
||||
<pre>{{modelAsJson}}</pre>
|
|
@ -1,66 +0,0 @@
|
|||
/***************************** Dropzone Styling *****************************/
|
||||
|
||||
/**
|
||||
* The dnd-list should always have a min-height,
|
||||
* otherwise you can't drop to it once it's empty
|
||||
*/
|
||||
.advancedDemo .dropzone ul[dnd-list] {
|
||||
min-height: 42px;
|
||||
margin: 0px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.advancedDemo .dropzone li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduce opacity of elements during the drag operation. This allows the user
|
||||
* to see where he is dropping his element, even if the element is huge. The
|
||||
* .dndDragging class is automatically set during the drag operation.
|
||||
*/
|
||||
.advancedDemo .dropzone .dndDragging {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dndDraggingSource class will be applied to the source element of a drag
|
||||
* operation.
|
||||
*/
|
||||
.advancedDemo .dropzone .dndDraggingSource {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/**
|
||||
* An element with .dndPlaceholder class will be added as child of the dnd-list
|
||||
* while the user is dragging over it.
|
||||
*/
|
||||
.advancedDemo .dropzone .dndPlaceholder {
|
||||
background-color: #ddd !important;
|
||||
display: block;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
/***************************** Element type specific styles *****************************/
|
||||
|
||||
.advancedDemo .dropzone .itemlist {
|
||||
min-height: 120px !important;
|
||||
}
|
||||
|
||||
.advancedDemo .dropzone .itemlist > li {
|
||||
background-color: #337ab7;
|
||||
border: none;
|
||||
border-radius: .25em;
|
||||
color: #fff;
|
||||
float: left;
|
||||
font-weight: 700;
|
||||
height: 50px;
|
||||
margin: 5px;
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.advancedDemo .dropzone .container-element {
|
||||
margin: 10px;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
<h3>Dropzone {{$index + 1}}</h3>
|
||||
<ul dnd-list="containers"
|
||||
dnd-allowed-types="['container']"
|
||||
dnd-external-sources="true"
|
||||
dnd-dragover="dragoverCallback(index, external, type, callback)"
|
||||
dnd-drop="dropCallback(index, item, external, type)">
|
||||
<li ng-repeat="container in containers"
|
||||
dnd-draggable="container"
|
||||
dnd-type="'container'"
|
||||
dnd-effect-allowed="copyMove"
|
||||
dnd-moved="containers.splice($index, 1)"
|
||||
dnd-callback="container.items.length">
|
||||
<div class="container-element box box-blue">
|
||||
<h3>Container (effects allowed: {{container.effectAllowed}})</h3>
|
||||
<ul dnd-list="container.items"
|
||||
dnd-allowed-types="['item']"
|
||||
dnd-horizontal-list="true"
|
||||
dnd-external-sources="true"
|
||||
dnd-effect-allowed="{{container.effectAllowed}}"
|
||||
dnd-dragover="dragoverCallback(index, external, type)"
|
||||
dnd-drop="dropCallback(index, item, external, type)"
|
||||
dnd-inserted="logListEvent('inserted at', index, external, type)"
|
||||
class="itemlist">
|
||||
<li ng-repeat="item in container.items"
|
||||
dnd-draggable="item"
|
||||
dnd-type="'item'"
|
||||
dnd-effect-allowed="{{item.effectAllowed}}"
|
||||
dnd-dragstart="logEvent('Started to drag an item')"
|
||||
dnd-moved="container.items.splice($index, 1)"
|
||||
dnd-dragend="logEvent('Drag operation ended. Drop effect: ' + dropEffect)">
|
||||
{{item.label}}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,43 +0,0 @@
|
|||
angular.module("demo").controller("AdvancedDemoController", function($scope) {
|
||||
|
||||
$scope.dragoverCallback = function(index, external, type, callback) {
|
||||
$scope.logListEvent('dragged over', index, external, type);
|
||||
// Invoke callback to origin for container types.
|
||||
if (type == 'container' && !external) {
|
||||
console.log('Container being dragged contains ' + callback() + ' items');
|
||||
}
|
||||
return index < 10; // Disallow dropping in the third row.
|
||||
};
|
||||
|
||||
$scope.dropCallback = function(index, item, external, type) {
|
||||
$scope.logListEvent('dropped at', index, external, type);
|
||||
// Return false here to cancel drop. Return true if you insert the item yourself.
|
||||
return item;
|
||||
};
|
||||
|
||||
$scope.logEvent = function(message) {
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
$scope.logListEvent = function(action, index, external, type) {
|
||||
var message = external ? 'External ' : '';
|
||||
message += type + ' element was ' + action + ' position ' + index;
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
// Initialize model
|
||||
$scope.model = [[], []];
|
||||
var id = 10;
|
||||
angular.forEach(['all', 'move', 'copy', 'link', 'copyLink', 'copyMove'], function(effect, i) {
|
||||
var container = {items: [], effectAllowed: effect};
|
||||
for (var k = 0; k < 7; ++k) {
|
||||
container.items.push({label: effect + ' ' + id++, effectAllowed: effect});
|
||||
}
|
||||
$scope.model[i % $scope.model.length].push(container);
|
||||
});
|
||||
|
||||
$scope.$watch('model', function(model) {
|
||||
$scope.modelAsJson = angular.toJson(model, true);
|
||||
}, true);
|
||||
|
||||
});
|
|
@ -1,70 +0,0 @@
|
|||
body {
|
||||
padding-top: 70px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.box {
|
||||
margin-bottom: 20px;
|
||||
background-color: #fff;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
||||
}
|
||||
|
||||
.box > h3 {
|
||||
color: #333;
|
||||
border-color: #ddd;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-top-right-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
background-repeat: repeat-x;
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
padding: 10px 15px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.box-padding {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.box-padding > h3 {
|
||||
margin: -15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.box-grey {
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.box-grey > h3 {
|
||||
background-color: #f5f5f5;
|
||||
background-image: -webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);
|
||||
background-image: linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);
|
||||
}
|
||||
|
||||
.box-blue {
|
||||
border-color: #bce8f1;
|
||||
}
|
||||
|
||||
.box-blue > h3 {
|
||||
color: #31708f;
|
||||
background-color: #d9edf7;
|
||||
border-color: #bce8f1;
|
||||
background-image: -webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);
|
||||
background-image: linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);
|
||||
}
|
||||
|
||||
.box-yellow {
|
||||
border-color: #faebcc;
|
||||
}
|
||||
|
||||
.box-yellow > h3 {
|
||||
color: #8a6d3b;
|
||||
background-color: #fcf8e3;
|
||||
border-color: #faebcc;
|
||||
background-image: -webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);
|
||||
background-image: linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
angular.module("demo", ["ngRoute", "dndLists"])
|
||||
.config(function($routeProvider) {
|
||||
$routeProvider
|
||||
.when('/simple', {
|
||||
templateUrl: 'simple/simple-frame.html',
|
||||
controller: 'SimpleDemoController'
|
||||
})
|
||||
.when('/nested', {
|
||||
templateUrl: 'nested/nested-frame.html',
|
||||
controller: 'NestedListsDemoController'
|
||||
})
|
||||
.when('/types', {
|
||||
templateUrl: 'types/types-frame.html',
|
||||
controller: 'TypesDemoController'
|
||||
})
|
||||
.when('/advanced', {
|
||||
templateUrl: 'advanced/advanced-frame.html',
|
||||
controller: 'AdvancedDemoController'
|
||||
})
|
||||
.when('/multi', {
|
||||
templateUrl: 'multi/multi-frame.html',
|
||||
controller: 'MultiDemoController'
|
||||
})
|
||||
.otherwise({redirectTo: '/nested'});
|
||||
})
|
||||
|
||||
.directive('navigation', function($rootScope, $location) {
|
||||
return {
|
||||
template: '<li ng-repeat="option in options" ng-class="{active: isActive(option)}">' +
|
||||
' <a ng-href="{{option.href}}">{{option.label}}</a>' +
|
||||
'</li>',
|
||||
link: function (scope, element, attr) {
|
||||
scope.options = [
|
||||
{label: "Nested Containers", href: "#/nested"},
|
||||
{label: "Simple Demo", href: "#/simple"},
|
||||
{label: "Item Types", href: "#/types"},
|
||||
{label: "Advanced Demo", href: "#/advanced"},
|
||||
{label: "Multiselection", href: "#/multi"},
|
||||
{label: "Github", href: "https://github.com/marceljuenemann/angular-drag-and-drop-lists"}
|
||||
];
|
||||
|
||||
scope.isActive = function(option) {
|
||||
return option.href.indexOf(scope.location) === 1;
|
||||
};
|
||||
|
||||
$rootScope.$on("$locationChangeSuccess", function(event, next, current) {
|
||||
scope.location = $location.path();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 180 B |
|
@ -1,213 +0,0 @@
|
|||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre) > code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre) > code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.builtin {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string,
|
||||
.token.variable {
|
||||
color: #a67f59;
|
||||
background: hsla(0,0%,100%,.5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
|
||||
.token.regex,
|
||||
.token.important {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
pre[data-line] {
|
||||
position: relative;
|
||||
padding: 1em 0 1em 3em;
|
||||
}
|
||||
|
||||
.line-highlight {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: inherit 0;
|
||||
margin-top: 1em; /* Same as .prism’s padding-top */
|
||||
|
||||
background: hsla(24, 20%, 50%,.08);
|
||||
background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
|
||||
background: -webkit-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
|
||||
background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
|
||||
background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
line-height: inherit;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.line-highlight:before,
|
||||
.line-highlight[data-end]:after {
|
||||
content: attr(data-start);
|
||||
position: absolute;
|
||||
top: .4em;
|
||||
left: .6em;
|
||||
min-width: 1em;
|
||||
padding: 0 .5em;
|
||||
background-color: hsla(24, 20%, 50%,.4);
|
||||
color: hsl(24, 20%, 95%);
|
||||
font: bold 65%/1.5 sans-serif;
|
||||
text-align: center;
|
||||
vertical-align: .3em;
|
||||
border-radius: 999px;
|
||||
text-shadow: none;
|
||||
box-shadow: 0 1px white;
|
||||
}
|
||||
|
||||
.line-highlight[data-end]:after {
|
||||
content: attr(data-end);
|
||||
top: auto;
|
||||
bottom: .4em;
|
||||
}
|
||||
pre.line-numbers {
|
||||
position: relative;
|
||||
padding-left: 3.8em;
|
||||
counter-reset: linenumber;
|
||||
}
|
||||
|
||||
pre.line-numbers > code {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.line-numbers .line-numbers-rows {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: 0;
|
||||
font-size: 100%;
|
||||
left: -3.8em;
|
||||
width: 3em; /* works for line-numbers below 1000 lines */
|
||||
letter-spacing: -1px;
|
||||
border-right: 1px solid #999;
|
||||
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.line-numbers-rows > span {
|
||||
pointer-events: none;
|
||||
display: block;
|
||||
counter-increment: linenumber;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span:before {
|
||||
content: counter(linenumber);
|
||||
color: #999;
|
||||
display: block;
|
||||
padding-right: 0.8em;
|
||||
text-align: right;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
* MIT license http://www.opensource.org/licenses/mit-license.php/
|
||||
* @author Lea Verou http://lea.verou.me
|
||||
*/(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
|
||||
Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});;
|
||||
Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<|<)style[\w\W]*?(>|>)[\w\W]*?(<|<)\/style(>|>)/ig,inside:{tag:{pattern:/(<|<)style[\w\W]*?(>|>)|(<|<)\/style(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
|
||||
Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|(&){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};
|
||||
;
|
||||
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|get|set|new|with|typeof|try|throw|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<|<)script[\w\W]*?(>|>)[\w\W]*?(<|<)\/script(>|>)/ig,inside:{tag:{pattern:/(<|<)script[\w\W]*?(>|>)|(<|<)\/script(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
|
||||
(function(){if(!window.Prism){return}function $$(a,b){return Array.prototype.slice.call((b||document).querySelectorAll(a))}function hasClass(a,b){b=" "+b+" ";return(" "+a.className+" ").replace(/[\n\t]/g," ").indexOf(b)>-1}var h=crlf=/\r?\n|\r/g;function highlightLines(a,b,c){var d=b.replace(/\s+/g,'').split(','),offset=+a.getAttribute('data-line-offset')||0;var e=parseFloat(getComputedStyle(a).lineHeight);for(var i=0,range;range=d[i++];){range=range.split('-');var f=+range[0],end=+range[1]||f;var g=document.createElement('div');g.textContent=Array(end-f+2).join(' \r\n');g.className=(c||'')+' line-highlight';if(!hasClass(a,'line-numbers')){g.setAttribute('data-start',f);if(end>f){g.setAttribute('data-end',end)}}g.style.top=(f-offset-1)*e+'px';if(hasClass(a,'line-numbers')){a.appendChild(g)}else{(a.querySelector('code')||a).appendChild(g)}}}function applyHash(){var b=location.hash.slice(1);$$('.temporary.line-highlight').forEach(function(a){a.parentNode.removeChild(a)});var c=(b.match(/\.([\d,-]+)$/)||[,''])[1];if(!c||document.getElementById(b)){return}var d=b.slice(0,b.lastIndexOf('.')),pre=document.getElementById(d);if(!pre){return}if(!pre.hasAttribute('data-line')){pre.setAttribute('data-line','')}highlightLines(pre,c,'temporary ');document.querySelector('.temporary.line-highlight').scrollIntoView()}var j=0;Prism.hooks.add('after-highlight',function(b){var c=b.element.parentNode;var d=c&&c.getAttribute('data-line');if(!c||!d||!/pre/i.test(c.nodeName)){return}clearTimeout(j);$$('.line-highlight',c).forEach(function(a){a.parentNode.removeChild(a)});highlightLines(c,d);j=setTimeout(applyHash,1)});addEventListener('hashchange',applyHash)})();
|
||||
;
|
||||
Prism.hooks.add("after-highlight",function(e){var t=e.element.parentNode;if(!t||!/pre/i.test(t.nodeName)||t.className.indexOf("line-numbers")===-1){return}var n=1+e.code.split("\n").length;var r;lines=new Array(n);lines=lines.join("<span></span>");r=document.createElement("span");r.className="line-numbers-rows";r.innerHTML=lines;if(t.hasAttribute("data-start")){t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)}e.element.appendChild(r)})
|
||||
;
|
|
@ -1,17 +0,0 @@
|
|||
<h2>Source Code</h2>
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li ng-repeat="type in models.types"
|
||||
ng-click="models.activeTab = type.language"
|
||||
ng-class="{active: models.activeTab === type.language}">
|
||||
<a style="cursor:pointer;">{{type.label}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div ng-repeat="type in models.types"
|
||||
ng-class="{active: models.activeTab === type.language}"
|
||||
class="tab-pane" >
|
||||
<pre class="line-numbers" data-line="{{highlightLines[type.language]}}"><code class="language-{{type.language}}">{{type.source}}</code></pre>
|
||||
</div>
|
||||
</div>
|
|
@ -1,29 +0,0 @@
|
|||
angular.module("demo").directive('viewSource', function($http, $timeout) {
|
||||
return {
|
||||
scope: {
|
||||
demoName: "@viewSource",
|
||||
highlightLines: "="
|
||||
},
|
||||
templateUrl: 'framework/view-source.html',
|
||||
link: function (scope, element, attr) {
|
||||
|
||||
scope.models = {
|
||||
types: [
|
||||
{extension: "html", language: "markup", label: "Markup"},
|
||||
{extension: "css", language: "css", label: "CSS"},
|
||||
{extension: "js", language: "javascript", label: "Javascript"},
|
||||
],
|
||||
activeTab: "markup"
|
||||
};
|
||||
|
||||
angular.forEach(scope.models.types, function(type) {
|
||||
$http.get(scope.demoName + '/' + scope.demoName + '.' + type.extension)
|
||||
.success(function (data) {
|
||||
type.source = data;
|
||||
$timeout(Prism.highlightAll, 0);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,65 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Drag & Drop Lists for angular.js</title>
|
||||
|
||||
<!-- jQuery is not required -->
|
||||
<!-- <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> -->
|
||||
|
||||
<!-- angular is the only dependency! -->
|
||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
|
||||
<script src="../angular-drag-and-drop-lists.js"></script>
|
||||
|
||||
<!-- Stuff that is only required in this demo (no need to copy) -->
|
||||
<link rel="stylesheet" href="framework/vendor/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="framework/vendor/bootstrap-theme.min.css">
|
||||
<link rel="stylesheet" href="framework/vendor/prism.css">
|
||||
<link rel="stylesheet" href="framework/demo-framework.css">
|
||||
<link rel="stylesheet" type="text/css" href="simple/simple.css" />
|
||||
<link rel="stylesheet" type="text/css" href="nested/nested.css" />
|
||||
<link rel="stylesheet" type="text/css" href="types/types.css" />
|
||||
<link rel="stylesheet" type="text/css" href="advanced/advanced.css" />
|
||||
<link rel="stylesheet" type="text/css" href="multi/multi.css" />
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-route.min.js"></script>
|
||||
<script src="framework/vendor/prism.js"></script>
|
||||
<script src="framework/demo-framework.js"></script>
|
||||
<script src="framework/view-source.js"></script>
|
||||
<script src="simple/simple.js"></script>
|
||||
<script src="nested/nested.js"></script>
|
||||
<script src="types/types.js"></script>
|
||||
<script src="advanced/advanced.js"></script>
|
||||
<script src="multi/multi.js"></script>
|
||||
|
||||
</head>
|
||||
<body ng-app="demo">
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#">angular-drag-and-drop-lists</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav" navigation></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Angular drag & drop with HTML5</h1>
|
||||
<p>
|
||||
Directives for modifying lists with the HTML5 drag & drop API.
|
||||
Supports nested lists for building trees and other fancy structures.
|
||||
No boilerplate code, no jQuery, just a few KB!
|
||||
</p>
|
||||
<p><a href="https://github.com/marceljuenemann/angular-drag-and-drop-lists" class="btn btn-success btn-lg" role="button">Code on github »</a></p>
|
||||
</div>
|
||||
|
||||
<div ng-view></div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
|
@ -1,37 +0,0 @@
|
|||
<h1>Demo: Multiselect Lists</h1>
|
||||
|
||||
<div class="alert alert-success">
|
||||
<strong>Instructions:</strong>
|
||||
Click on items to select/unselect them. When dragging, all selected items will be moved at once.
|
||||
</div>
|
||||
|
||||
<div class="multiDemo row">
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div ng-repeat="list in models" class="col-md-6">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">List {{list.listName}}</h3>
|
||||
</div>
|
||||
<div class="panel-body" ng-include="'multi/multi.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div view-source="multi"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Generated Model</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<pre class="code">{{modelAsJson}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -1,37 +0,0 @@
|
|||
/**
|
||||
* The dnd-list should always have a min-height,
|
||||
* otherwise you can't drop into it once it's empty
|
||||
*/
|
||||
.multiDemo ul[dnd-list] {
|
||||
min-height: 42px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* An element with .dndPlaceholder class will be
|
||||
* added to the dnd-list while the user is dragging
|
||||
* over it.
|
||||
*/
|
||||
.multiDemo ul[dnd-list] .dndPlaceholder {
|
||||
background-color: #ddd;
|
||||
display: block;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
.multiDemo ul[dnd-list] li {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
display: block;
|
||||
margin-bottom: -1px;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show selected elements in green
|
||||
*/
|
||||
.multiDemo ul[dnd-list] li.selected {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
<ul dnd-list dnd-drop="onDrop(list, item, index)">
|
||||
<li ng-repeat="item in list.items"
|
||||
dnd-draggable="getSelectedItemsIncluding(list, item)"
|
||||
dnd-dragstart="onDragstart(list, event)"
|
||||
dnd-moved="onMoved(list)"
|
||||
dnd-dragend="list.dragging = false"
|
||||
dnd-selected="item.selected = !item.selected"
|
||||
ng-class="{'selected': item.selected}"
|
||||
ng-hide="list.dragging && item.selected"
|
||||
>
|
||||
{{item.label}}
|
||||
</li>
|
||||
</ul>
|
|
@ -1,66 +0,0 @@
|
|||
angular.module("demo").controller("MultiDemoController", function($scope) {
|
||||
|
||||
$scope.models = [
|
||||
{listName: "A", items: [], dragging: false},
|
||||
{listName: "B", items: [], dragging: false}
|
||||
];
|
||||
|
||||
/**
|
||||
* dnd-dragging determines what data gets serialized and send to the receiver
|
||||
* of the drop. While we usually just send a single object, we send the array
|
||||
* of all selected items here.
|
||||
*/
|
||||
$scope.getSelectedItemsIncluding = function(list, item) {
|
||||
item.selected = true;
|
||||
return list.items.filter(function(item) { return item.selected; });
|
||||
};
|
||||
|
||||
/**
|
||||
* We set the list into dragging state, meaning the items that are being
|
||||
* dragged are hidden. We also use the HTML5 API directly to set a custom
|
||||
* image, since otherwise only the one item that the user actually dragged
|
||||
* would be shown as drag image.
|
||||
*/
|
||||
$scope.onDragstart = function(list, event) {
|
||||
list.dragging = true;
|
||||
if (event.dataTransfer.setDragImage) {
|
||||
var img = new Image();
|
||||
img.src = 'framework/vendor/ic_content_copy_black_24dp_2x.png';
|
||||
event.dataTransfer.setDragImage(img, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* In the dnd-drop callback, we now have to handle the data array that we
|
||||
* sent above. We handle the insertion into the list ourselves. By returning
|
||||
* true, the dnd-list directive won't do the insertion itself.
|
||||
*/
|
||||
$scope.onDrop = function(list, items, index) {
|
||||
angular.forEach(items, function(item) { item.selected = false; });
|
||||
list.items = list.items.slice(0, index)
|
||||
.concat(items)
|
||||
.concat(list.items.slice(index));
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last but not least, we have to remove the previously dragged items in the
|
||||
* dnd-moved callback.
|
||||
*/
|
||||
$scope.onMoved = function(list) {
|
||||
list.items = list.items.filter(function(item) { return !item.selected; });
|
||||
};
|
||||
|
||||
// Generate the initial model
|
||||
angular.forEach($scope.models, function(list) {
|
||||
for (var i = 1; i <= 4; ++i) {
|
||||
list.items.push({label: "Item " + list.listName + i});
|
||||
}
|
||||
});
|
||||
|
||||
// Model to JSON for demo purpose
|
||||
$scope.$watch('models', function(model) {
|
||||
$scope.modelAsJson = angular.toJson(model, true);
|
||||
}, true);
|
||||
|
||||
});
|
|
@ -1,10 +0,0 @@
|
|||
<h1>Demo: Nested Containers</h1>
|
||||
|
||||
<div class="alert alert-success">
|
||||
<strong>Instructions:</strong>
|
||||
In this demo you can not only drag & drop list items, but also containers, which
|
||||
can contain list items or other containers themselves. To create new elements, use the toolbar on the right.
|
||||
If this is more than you need, check out the <a href="#/simple">simple list demo</a>
|
||||
</div>
|
||||
|
||||
<div class="nestedDemo row" ng-include="'nested/nested.html'"></div>
|
|
@ -1,126 +0,0 @@
|
|||
/***************************** Dropzone Styling *****************************/
|
||||
|
||||
/**
|
||||
* The dnd-list should always have a min-height,
|
||||
* otherwise you can't drop to it once it's empty
|
||||
*/
|
||||
.nestedDemo .dropzone ul[dnd-list] {
|
||||
margin: 0px;
|
||||
min-height: 42px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.nestedDemo .dropzone li {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
display: block;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduce opacity of elements during the drag operation. This allows the user
|
||||
* to see where he is dropping his element, even if the element is huge. The
|
||||
* .dndDragging class is automatically set during the drag operation.
|
||||
*/
|
||||
.nestedDemo .dropzone .dndDragging {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dndDraggingSource class will be applied to the source element of a drag
|
||||
* operation. It makes sense to hide it to give the user the feeling that he's
|
||||
* actually moving it. Note that the source element has also .dndDragging class.
|
||||
*/
|
||||
.nestedDemo .dropzone .dndDraggingSource {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* An element with .dndPlaceholder class will be added as child of the dnd-list
|
||||
* while the user is dragging over it.
|
||||
*/
|
||||
.nestedDemo .dropzone .dndPlaceholder {
|
||||
background-color: #ddd;
|
||||
display: block;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
/***************************** Element Selection *****************************/
|
||||
|
||||
.nestedDemo .dropzone .selected .item {
|
||||
color: #3c763d;
|
||||
background-color: #dff0d8;
|
||||
}
|
||||
|
||||
.nestedDemo .dropzone .selected .box {
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.nestedDemo .dropzone .selected .box > h3 {
|
||||
background-color: #dff0d8;
|
||||
background-image: linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);
|
||||
border-color: #d6e9c6;
|
||||
color: #3c763d;
|
||||
}
|
||||
|
||||
/***************************** Element type specific styles *****************************/
|
||||
|
||||
.nestedDemo .dropzone .item {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.nestedDemo .dropzone .container-element {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.nestedDemo .dropzone .container-element .column {
|
||||
float: left;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/***************************** Toolbox *****************************/
|
||||
|
||||
.nestedDemo .toolbox ul {
|
||||
cursor: move;
|
||||
list-style: none;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.nestedDemo .toolbox button {
|
||||
margin: 5px;
|
||||
opacity: 1.0;
|
||||
width: 123px;
|
||||
}
|
||||
|
||||
.nestedDemo .toolbox .dndDragging {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.nestedDemo .toolbox .dndDraggingSource {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
/***************************** Trashcan *****************************/
|
||||
|
||||
.nestedDemo .trashcan ul {
|
||||
list-style: none;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.nestedDemo .trashcan img {
|
||||
width: 100%;
|
||||
-webkit-filter: grayscale(100%);
|
||||
-moz-filter: grayscale(100%);
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
|
||||
.nestedDemo .trashcan .dndDragover img {
|
||||
width: 100%;
|
||||
-webkit-filter: none;
|
||||
-moz-filter: none;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.nestedDemo .trashcan .dndPlaceholder {
|
||||
display: none;
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
<!-- Markup for lists inside the dropzone. It's inside a seperate template
|
||||
because it will be used recursively. The dnd-list directive enables
|
||||
to drop elements into the referenced array. The dnd-draggable directive
|
||||
makes an element draggable and will transfer the object that was
|
||||
assigned to it. If an element was dragged away, you have to remove
|
||||
it from the original list yourself using the dnd-moved attribute -->
|
||||
<script type="text/ng-template" id="list.html">
|
||||
<ul dnd-list="list">
|
||||
<li ng-repeat="item in list"
|
||||
dnd-draggable="item"
|
||||
dnd-effect-allowed="move"
|
||||
dnd-moved="list.splice($index, 1)"
|
||||
dnd-selected="models.selected = item"
|
||||
ng-class="{selected: models.selected === item}"
|
||||
ng-include="item.type + '.html'">
|
||||
</li>
|
||||
</ul>
|
||||
</script>
|
||||
|
||||
<!-- This template is responsible for rendering a container element. It uses
|
||||
the above list template to render each container column -->
|
||||
<script type="text/ng-template" id="container.html">
|
||||
<div class="container-element box box-blue">
|
||||
<h3>Container {{item.id}}</h3>
|
||||
<div class="column" ng-repeat="list in item.columns" ng-include="'list.html'"></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Template for a normal list item -->
|
||||
<script type="text/ng-template" id="item.html">
|
||||
<div class="item">Item {{item.id}}</div>
|
||||
</script>
|
||||
|
||||
<!-- Main area with dropzones and source code -->
|
||||
<div class="col-md-10">
|
||||
<div class="row">
|
||||
<div ng-repeat="(zone, list) in models.dropzones" class="col-md-6">
|
||||
<div class="dropzone box box-yellow">
|
||||
<!-- The dropzone also uses the list template -->
|
||||
<h3>Dropzone {{zone}}</h3>
|
||||
<div ng-include="'list.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div view-source="nested"></div>
|
||||
|
||||
<h2>Generated Model</h2>
|
||||
<pre>{{modelAsJson}}</pre>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="col-md-2">
|
||||
|
||||
<div class="toolbox box box-grey box-padding">
|
||||
<h3>New Elements</h3>
|
||||
<ul>
|
||||
<!-- The toolbox only allows to copy objects, not move it. After a new
|
||||
element was created, dnd-copied is invoked and we generate the next id -->
|
||||
<li ng-repeat="item in models.templates"
|
||||
dnd-draggable="item"
|
||||
dnd-effect-allowed="copy"
|
||||
dnd-copied="item.id = item.id + 1"
|
||||
>
|
||||
<button type="button" class="btn btn-default btn-lg" disabled="disabled">{{item.type}}</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div ng-if="models.selected" class="box box-grey box-padding">
|
||||
<h3>Selected</h3>
|
||||
<strong>Type: </strong> {{models.selected.type}}<br>
|
||||
<input type="text" ng-model="models.selected.id" class="form-control" style="margin-top: 5px" />
|
||||
</div>
|
||||
|
||||
<div class="trashcan box box-grey box-padding">
|
||||
<!-- If you use [] as referenced list, the dropped elements will be lost -->
|
||||
<h3>Trashcan</h3>
|
||||
<ul dnd-list="[]">
|
||||
<li><img src="nested/trashcan.jpg"></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -1,122 +0,0 @@
|
|||
/**
|
||||
* The controller doesn't do much more than setting the initial data model
|
||||
*/
|
||||
angular.module("demo").controller("NestedListsDemoController", function($scope) {
|
||||
|
||||
$scope.models = {
|
||||
selected: null,
|
||||
templates: [
|
||||
{type: "item", id: 2},
|
||||
{type: "container", id: 1, columns: [[], []]}
|
||||
],
|
||||
dropzones: {
|
||||
"A": [
|
||||
{
|
||||
"type": "container",
|
||||
"id": 1,
|
||||
"columns": [
|
||||
[
|
||||
{
|
||||
"type": "item",
|
||||
"id": "1"
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "2"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "item",
|
||||
"id": "3"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "4"
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "5"
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "6"
|
||||
}
|
||||
],
|
||||
"B": [
|
||||
{
|
||||
"type": "item",
|
||||
"id": 7
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "8"
|
||||
},
|
||||
{
|
||||
"type": "container",
|
||||
"id": "2",
|
||||
"columns": [
|
||||
[
|
||||
{
|
||||
"type": "item",
|
||||
"id": "9"
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "10"
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "11"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "item",
|
||||
"id": "12"
|
||||
},
|
||||
{
|
||||
"type": "container",
|
||||
"id": "3",
|
||||
"columns": [
|
||||
[
|
||||
{
|
||||
"type": "item",
|
||||
"id": "13"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"type": "item",
|
||||
"id": "14"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "15"
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": "16"
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "item",
|
||||
"id": 16
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('models.dropzones', function(model) {
|
||||
$scope.modelAsJson = angular.toJson(model, true);
|
||||
}, true);
|
||||
|
||||
});
|
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
|
@ -1,38 +0,0 @@
|
|||
<h1>Demo: Simple Lists</h1>
|
||||
|
||||
<div class="alert alert-success">
|
||||
<strong>Instructions:</strong>
|
||||
Drag & drop the list items to move them around, or just click to select them.
|
||||
If that's too boring, check out the <a href="#/nested">nested container demo</a>
|
||||
</div>
|
||||
|
||||
<div class="simpleDemo row">
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div ng-repeat="(listName, list) in models.lists" class="col-md-6">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">List {{listName}}</h3>
|
||||
</div>
|
||||
<div class="panel-body" ng-include="'simple/simple.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div view-source="simple"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Generated Model</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<pre class="code">{{modelAsJson}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -1,47 +0,0 @@
|
|||
/**
|
||||
* The dnd-list should always have a min-height,
|
||||
* otherwise you can't drop to it once it's empty
|
||||
*/
|
||||
.simpleDemo ul[dnd-list] {
|
||||
min-height: 42px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dndDraggingSource class will be applied to
|
||||
* the source element of a drag operation. It makes
|
||||
* sense to hide it to give the user the feeling
|
||||
* that he's actually moving it.
|
||||
*/
|
||||
.simpleDemo ul[dnd-list] .dndDraggingSource {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* An element with .dndPlaceholder class will be
|
||||
* added to the dnd-list while the user is dragging
|
||||
* over it.
|
||||
*/
|
||||
.simpleDemo ul[dnd-list] .dndPlaceholder {
|
||||
background-color: #ddd;
|
||||
display: block;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
.simpleDemo ul[dnd-list] li {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show selected elements in green
|
||||
*/
|
||||
.simpleDemo ul[dnd-list] li.selected {
|
||||
background-color: #dff0d8;
|
||||
color: #3c763d;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<!-- The dnd-list directive allows to drop elements into it.
|
||||
The dropped data will be added to the referenced list -->
|
||||
<ul dnd-list="list">
|
||||
<!-- The dnd-draggable directive makes an element draggable and will
|
||||
transfer the object that was assigned to it. If an element was
|
||||
dragged away, you have to remove it from the original list
|
||||
yourself using the dnd-moved attribute -->
|
||||
<li ng-repeat="item in list"
|
||||
dnd-draggable="item"
|
||||
dnd-moved="list.splice($index, 1)"
|
||||
dnd-effect-allowed="move"
|
||||
dnd-selected="models.selected = item"
|
||||
ng-class="{'selected': models.selected === item}"
|
||||
>
|
||||
{{item.label}}
|
||||
</li>
|
||||
</ul>
|
|
@ -1,19 +0,0 @@
|
|||
angular.module("demo").controller("SimpleDemoController", function($scope) {
|
||||
|
||||
$scope.models = {
|
||||
selected: null,
|
||||
lists: {"A": [], "B": []}
|
||||
};
|
||||
|
||||
// Generate initial model
|
||||
for (var i = 1; i <= 3; ++i) {
|
||||
$scope.models.lists.A.push({label: "Item A" + i});
|
||||
$scope.models.lists.B.push({label: "Item B" + i});
|
||||
}
|
||||
|
||||
// Model to JSON for demo purpose
|
||||
$scope.$watch('models', function(model) {
|
||||
$scope.modelAsJson = angular.toJson(model, true);
|
||||
}, true);
|
||||
|
||||
});
|
|
@ -1,40 +0,0 @@
|
|||
<h1>Demo: Item Types</h1>
|
||||
|
||||
<div class="alert alert-success">
|
||||
<strong>Instructions:</strong>
|
||||
Drag & drop the names to move them around. Note that the names can not be
|
||||
dropped in the list for the wrong gender. This is achieved with the dnd-type and
|
||||
dnd-allowed-types attributes.
|
||||
This demo also shows the use of the dnd-disable-if attribute, which is used here
|
||||
to limit the number of names per list, as well as fix Alex' position.
|
||||
You can combine these functions with <a href="#/nested">nested lists</a>
|
||||
to build very powerful UIs.
|
||||
</div>
|
||||
|
||||
<div class="typesDemo row">
|
||||
|
||||
<div ng-repeat="list in lists" class="col-md-4">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">List of {{list.label}} (max. {{list.max}})</h3>
|
||||
</div>
|
||||
<div class="panel-body" ng-include="'types/types.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8" view-source="types"></div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">List Models</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<pre class="code">{{modelAsJson}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,102 +0,0 @@
|
|||
/**
|
||||
* For the correct positioning of the placeholder element, the dnd-list and
|
||||
* it's children must have position: relative
|
||||
*/
|
||||
.typesDemo ul[dnd-list],
|
||||
.typesDemo ul[dnd-list] > li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dnd-list should always have a min-height,
|
||||
* otherwise you can't drop to it once it's empty
|
||||
*/
|
||||
.typesDemo ul[dnd-list] {
|
||||
min-height: 42px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dndDraggingSource class will be applied to
|
||||
* the source element of a drag operation. It makes
|
||||
* sense to hide it to give the user the feeling
|
||||
* that he's actually moving it.
|
||||
*/
|
||||
.typesDemo ul[dnd-list] .dndDraggingSource {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* An element with .dndPlaceholder class will be
|
||||
* added to the dnd-list while the user is dragging
|
||||
* over it.
|
||||
*/
|
||||
.typesDemo ul[dnd-list] .dndPlaceholder {
|
||||
display: block;
|
||||
background-color: #ddd;
|
||||
padding: 10px 15px;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dnd-lists's child elements currently MUST have
|
||||
* position: relative. Otherwise we can not determine
|
||||
* whether the mouse pointer is in the upper or lower
|
||||
* half of the element we are dragging over. In other
|
||||
* browsers we can use event.offsetY for this.
|
||||
*/
|
||||
.typesDemo ul[dnd-list] li {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
display: block;
|
||||
margin-bottom: -1px;
|
||||
|
||||
/* Disable text selection if item is not draggable */
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.typesDemo ul[dnd-list] li dnd-nodrag {
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gender-specifc background
|
||||
*/
|
||||
.typesDemo ul[dnd-list] li.background-man {
|
||||
background-color: #CAE0FC;
|
||||
}
|
||||
|
||||
.typesDemo ul[dnd-list] li.background-woman {
|
||||
background-color: #FFE2F5;
|
||||
}
|
||||
|
||||
.typesDemo ul[dnd-list] input.background-man {
|
||||
background-color: #D8E9FF;
|
||||
color: #2F4D99;
|
||||
}
|
||||
|
||||
.typesDemo ul[dnd-list] input.background-woman {
|
||||
background-color: #FFF0FA;
|
||||
color: #D84FA7;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle positioning
|
||||
*/
|
||||
.typesDemo .handle {
|
||||
cursor: move;
|
||||
position: absolute;
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.typesDemo .name {
|
||||
margin-left: 20px;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
<ul dnd-list="list.people"
|
||||
dnd-allowed-types="list.allowedTypes"
|
||||
dnd-disable-if="list.people.length >= list.max">
|
||||
|
||||
<li ng-repeat="person in list.people"
|
||||
dnd-draggable="person"
|
||||
dnd-type="person.type"
|
||||
dnd-disable-if="person.type == 'unknown'"
|
||||
dnd-moved="list.people.splice($index, 1)"
|
||||
class="background-{{person.type}}"
|
||||
>
|
||||
<dnd-nodrag>
|
||||
<div dnd-handle class="handle">:::</div>
|
||||
<div class="name">
|
||||
<input type="text" ng-model="person.name" class="background-{{person.type}} form-control input-sm">
|
||||
</div>
|
||||
</dnd-nodrag>
|
||||
</li>
|
||||
|
||||
<li class="dndPlaceholder">
|
||||
Drop any <strong>{{list.allowedTypes.join(' or ')}}</strong> here
|
||||
</li>
|
||||
|
||||
</ul>
|
|
@ -1,43 +0,0 @@
|
|||
angular.module("demo").controller("TypesDemoController", function($scope) {
|
||||
|
||||
$scope.lists = [
|
||||
{
|
||||
label: "Men",
|
||||
allowedTypes: ['man'],
|
||||
max: 4,
|
||||
people: [
|
||||
{name: "Bob", type: "man"},
|
||||
{name: "Charlie", type: "man"},
|
||||
{name: "Dave", type: "man"}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "Women",
|
||||
allowedTypes: ['woman'],
|
||||
max: 4,
|
||||
people: [
|
||||
{name: "Alice", type: "woman"},
|
||||
{name: "Eve", type: "woman"},
|
||||
{name: "Peggy", type: "woman"}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "People",
|
||||
allowedTypes: ['man', 'woman'],
|
||||
max: 6,
|
||||
people: [
|
||||
{name: "Frank", type: "man"},
|
||||
{name: "Mallory", type: "woman"},
|
||||
{name: "Alex", type: "unknown"},
|
||||
{name: "Oscar", type: "man"},
|
||||
{name: "Wendy", type: "woman"}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// Model to JSON for demo purpose
|
||||
$scope.$watch('lists', function(lists) {
|
||||
$scope.modelAsJson = angular.toJson(lists, true);
|
||||
}, true);
|
||||
|
||||
});
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"name": "angular-drag-and-drop-lists",
|
||||
"main": "angular-drag-and-drop-lists.js",
|
||||
"version": "2.1.0",
|
||||
"description": "Angular directives for sorting nested lists using the HTML5 Drag and Drop API",
|
||||
"repository": "https://github.com/marceljuenemann/angular-drag-and-drop-lists",
|
||||
"license": "MIT",
|
||||
"main": "angular-drag-and-drop-lists.js",
|
||||
"devDependencies": {
|
||||
"angular": "~1.4.9",
|
||||
"angular-mocks": "~1.4.9",
|
||||
"http-server": "~0.6.1",
|
||||
"minifier": "~0.7.1",
|
||||
"jasmine-core": "~2.4.1",
|
||||
"jquery": "~2.2.0"
|
||||
},
|
||||
"scripts": {
|
||||
"minify": "minify angular-drag-and-drop-lists.js",
|
||||
"start": "http-server -p 8000"
|
||||
}
|
||||
}
|
|
@ -1,173 +0,0 @@
|
|||
describe('dndDraggable', function() {
|
||||
|
||||
var SIMPLE_HTML = '<div dnd-draggable="{hello: \'world\'}"></div>';
|
||||
|
||||
describe('constructor', function() {
|
||||
it('sets the draggable attribute', function() {
|
||||
var element = compileAndLink(SIMPLE_HTML);
|
||||
expect(element.attr('draggable')).toBe('true');
|
||||
});
|
||||
|
||||
it('watches and handles the dnd-disabled-if expression', function() {
|
||||
var element = compileAndLink('<div dnd-draggable dnd-disable-if="disabled"></div>');
|
||||
expect(element.attr('draggable')).toBe('true');
|
||||
|
||||
element.scope().disabled = true;
|
||||
element.scope().$digest();
|
||||
expect(element.attr('draggable')).toBe('false');
|
||||
|
||||
element.scope().disabled = false;
|
||||
element.scope().$digest();
|
||||
expect(element.attr('draggable')).toBe('true');
|
||||
});
|
||||
});
|
||||
|
||||
describe('dragstart handler', function() {
|
||||
var element;
|
||||
|
||||
beforeEach(function() {
|
||||
element = compileAndLink(SIMPLE_HTML);
|
||||
});
|
||||
|
||||
it('calls setData with serialized data', function() {
|
||||
expect(Dragstart.on(element).data).toEqual({'application/x-dnd': '{"hello":"world"}'});
|
||||
});
|
||||
|
||||
it('includes the dnd-type in the mime type', function() {
|
||||
element = compileAndLink('<div dnd-draggable="{}" dnd-type="\'foo\'"></div>');
|
||||
expect(Dragstart.on(element).data).toEqual({'application/x-dnd-foo': '{}'});
|
||||
});
|
||||
|
||||
it('converts the dnd-type to lower case', function() {
|
||||
element = compileAndLink('<div dnd-draggable="{}" dnd-type="\'Foo\'"></div>');
|
||||
expect(Dragstart.on(element).data).toEqual({'application/x-dnd-foo': '{}'});
|
||||
});
|
||||
|
||||
it('uses application/json mime type if custom types are not allowed', function() {
|
||||
element = compileAndLink('<div dnd-draggable="[1]"></div>');
|
||||
var dragstart = Dragstart.on(element, {allowedMimeTypes: ['Text', 'application/json']});
|
||||
expect(dragstart.data).toEqual({'application/json': '{"item":[1]}'});
|
||||
});
|
||||
|
||||
it('uses Text mime type in Internet Explorer', function() {
|
||||
element = compileAndLink('<div dnd-draggable="{}" dnd-type="\'Foo\'"></div>');
|
||||
var dragstart = Dragstart.on(element, {allowedMimeTypes: ['URL', 'Text']});
|
||||
expect(dragstart.data).toEqual({
|
||||
'Text': '{"item":{},"type":"foo"}'
|
||||
});
|
||||
});
|
||||
|
||||
it('stops propagation', function() {
|
||||
expect(Dragstart.on(element).propagationStopped).toBe(true);
|
||||
});
|
||||
|
||||
it('sets effectAllowed to move by default', function() {
|
||||
expect(Dragstart.on(element).effectAllowed).toBe('move');
|
||||
});
|
||||
|
||||
it('sets effectAllowed from dnd-effect-allowed', function() {
|
||||
element = compileAndLink('<div dnd-draggable dnd-effect-allowed="copyMove"></div>');
|
||||
expect(Dragstart.on(element).effectAllowed).toBe('copyMove');
|
||||
});
|
||||
|
||||
it('sets effectAllowed to single effect in IE', function() {
|
||||
element = compileAndLink('<div dnd-draggable dnd-effect-allowed="copyLink"></div>');
|
||||
expect(Dragstart.on(element, {allowedMimeTypes: ['Text']}).effectAllowed).toBe('copy');
|
||||
});
|
||||
|
||||
it('adds CSS classes to element', inject(function($timeout) {
|
||||
Dragstart.on(element);
|
||||
expect(element.hasClass('dndDragging')).toBe(true);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(false);
|
||||
|
||||
$timeout.flush(0);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(true);
|
||||
}));
|
||||
|
||||
it('invokes dnd-dragstart callback', function() {
|
||||
element = compileAndLink('<div dnd-draggable dnd-dragstart="ev = event"></div>');
|
||||
Dragstart.on(element);
|
||||
expect(element.scope().ev).toEqual(jasmine.any(DragEventMock));
|
||||
});
|
||||
|
||||
it('does not start dragging if dnd-disable-if is true', function() {
|
||||
element = compileAndLink('<div dnd-draggable dnd-disable-if="true"></div>');
|
||||
var dragstart = Dragstart.on(element);
|
||||
expect(dragstart.returnValue).toBe(true);
|
||||
expect(dragstart.defaultPrevented).toBe(false);
|
||||
expect(dragstart.propagationStopped).toBe(false);
|
||||
});
|
||||
|
||||
it('sets the dragImage if event was triggered on a dnd-handle', function() {
|
||||
var dragstart = Dragstart.on(element, {allowSetDragImage: true, dndHandle: true});
|
||||
expect(dragstart.dragImage).toBe(element[0]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('dragend handler', function() {
|
||||
var element, dragstart;
|
||||
|
||||
beforeEach(function() {
|
||||
element = compileAndLink(SIMPLE_HTML);
|
||||
dragstart = Dragstart.on(element);
|
||||
});
|
||||
|
||||
it('stops propagation', function() {
|
||||
expect(dragstart.dragend(element).propagationStopped).toBe(true);
|
||||
});
|
||||
|
||||
it('removes CSS classes from element', inject(function($timeout) {
|
||||
$timeout.flush(0);
|
||||
expect(element.hasClass('dndDragging')).toBe(true);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(true);
|
||||
|
||||
dragstart.dragend(element);
|
||||
expect(element.hasClass('dndDragging')).toBe(false);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(false);
|
||||
}));
|
||||
|
||||
it('removes dndDraggingSource after a timeout', inject(function($timeout) {
|
||||
// IE 9 might not flush the $timeout before invoking the dragend handler.
|
||||
expect(element.hasClass('dndDragging')).toBe(true);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(false);
|
||||
|
||||
dragstart.dragend(element);
|
||||
expect(element.hasClass('dndDragging')).toBe(false);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(false);
|
||||
|
||||
$timeout.flush(0);
|
||||
expect(element.hasClass('dndDragging')).toBe(false);
|
||||
expect(element.hasClass('dndDraggingSource')).toBe(false);
|
||||
}));
|
||||
|
||||
var dropEffects = {move: 'moved', copy: 'copied', link: 'linked', none: 'canceled'};
|
||||
angular.forEach(dropEffects, function(callback, dropEffect) {
|
||||
it('calls callbacks for dropEffect ' + dropEffect, function() {
|
||||
var html = '<div dnd-draggable="{}" dnd-effect-allowed="' + dropEffect + '" '
|
||||
+ 'dnd-dragend="returnedDropEffect = dropEffect" '
|
||||
+ 'dnd-' + callback + '="returnedEvent = event"></div>';
|
||||
var element = compileAndLink(html);
|
||||
var target = compileAndLink('<div dnd-list="[]"></div>');
|
||||
Dragstart.on(element).dragover(target).drop(target).dragend(element);
|
||||
|
||||
expect(element.scope().returnedEvent).toEqual(jasmine.any(DragEventMock));
|
||||
expect(element.scope().returnedDropEffect).toBe(dropEffect);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('click handler', function() {
|
||||
it('does nothing if dnd-selected is not set', function() {
|
||||
var element = compileAndLink(SIMPLE_HTML);
|
||||
var click = new DragEventResult(element, 'click', new DataTransferMock(), {});
|
||||
expect(click.propagationStopped).toBe(false);
|
||||
});
|
||||
|
||||
it('invokes dnd-selected callback and stops propagation', function() {
|
||||
var element = compileAndLink('<div dnd-draggable dnd-selected="selected = true"></div>');
|
||||
var click = new DragEventResult(element, 'click', new DataTransferMock(), {});
|
||||
expect(click.propagationStopped).toBe(true);
|
||||
expect(element.scope().selected).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,576 +0,0 @@
|
|||
describe('dndList', function() {
|
||||
|
||||
it('hides the placeholder element', function() {
|
||||
var element = compileAndLink('<dnd-list><img class="dndPlaceholder"></dnd-list>');
|
||||
expect(element.children().length).toBe(0);
|
||||
});
|
||||
|
||||
it('disallows dropping if dnd-disable-if is true', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-disable-if="disabled"></div>');
|
||||
element.scope().disabled = true;
|
||||
forAllHandlers(Dragstart.on(source).dragenter(element), element, verifyDropCancelled);
|
||||
});
|
||||
|
||||
it('allows drop if dnd-disable-if is false', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-disable-if="disabled"></div>');
|
||||
forAllHandlers(Dragstart.on(source).dragenter(element), element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('disallows dropping from external sources', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]"></div>');
|
||||
var dragenter = Dragenter.validExternalOn(element);
|
||||
forAllHandlers(dragenter, element, verifyDropCancelled);
|
||||
});
|
||||
|
||||
it('allows dropping from external sources if dnd-external-sources is set', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-external-sources="true"></div>');
|
||||
var dragenter = Dragenter.validExternalOn(element);
|
||||
forAllHandlers(dragenter, element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('disallows drop without valid mime types', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-external-sources="true"></div>');
|
||||
var dragenter = Dragenter.externalOn(element, {'text/plain': '{}'});
|
||||
forAllHandlers(dragenter, element, verifyDropCancelled);
|
||||
});
|
||||
|
||||
// Old Internet Explorer versions don't have dataTransfer.types.
|
||||
it('allows drop if dataTransfer.types is undefined', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-external-sources="true"></div>');
|
||||
var data = angular.toJson({item: {}, type: 'mytype'});
|
||||
var dragenter = Dragenter.externalOn(element, {'Text': data}, {undefinedTypes: true});
|
||||
forAllHandlers(dragenter, element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('allows drop if dataTransfer.types contains "Text"', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-external-sources="true"></div>');
|
||||
var data = angular.toJson({item: {}, type: 'mytype'});
|
||||
var dragenter = Dragenter.externalOn(element, {'Text': data});
|
||||
forAllHandlers(dragenter, element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('allows drop if dataTransfer.types contains "application/json"', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-external-sources="true"></div>');
|
||||
var data = angular.toJson({item: {}, type: 'mytype'});
|
||||
var dragenter = Dragenter.externalOn(element, {'x-pdf': '{}', 'application/json': data});
|
||||
forAllHandlers(dragenter, element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('disallows dropping untyped elements if dnd-allowed-types is set', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'mytype\']"></div>');
|
||||
forAllHandlers(Dragstart.on(source).dragenter(element), element, verifyDropCancelled);
|
||||
});
|
||||
|
||||
it('allows dropping typed elements if dnd-allowed-types is not set', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'sometype\'"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]"></div>');
|
||||
forAllHandlers(Dragstart.on(source).dragenter(element), element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('disallows dropping elements of the wrong type', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'othertype\'"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'mytype\']"></div>');
|
||||
forAllHandlers(Dragstart.on(source).dragenter(element), element, verifyDropCancelled);
|
||||
});
|
||||
|
||||
it('allows dropping elements of the correct type', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'mytype\'"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'MyType\']"></div>');
|
||||
forAllHandlers(Dragstart.on(source).dragenter(element), element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('disallows dropping elements of the wrong type (test for Edge)', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'othertype\'"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'mytype\']"></div>');
|
||||
var dragstart = Dragstart.on(source, {allowedMimeTypes: ['text/plain', 'application/json']});
|
||||
forAllHandlers(dragstart.dragenter(element), element, verifyDropCancelled);
|
||||
});
|
||||
|
||||
it('allows dropping elements of the correct type (test for Edge)', function() {
|
||||
var source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'mytype\'"></div>');
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'mytype\']"></div>');
|
||||
var dragstart = Dragstart.on(source, {allowedMimeTypes: ['text/plain', 'application/json']});
|
||||
forAllHandlers(dragstart.dragenter(element), element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
it('allows dropping external elements if correct type is encoded inside', function() {
|
||||
var element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'myType\']" ' +
|
||||
'dnd-external-sources="true"></div>');
|
||||
var data = angular.toJson({item: {}, type: 'mytype'});
|
||||
var dragenter = Dragenter.externalOn(element, {'application/json': data});
|
||||
forAllHandlers(dragenter, element, verifyDropAccepted);
|
||||
});
|
||||
|
||||
describe('dragover handler', function() {
|
||||
var source, element;
|
||||
|
||||
beforeEach(function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}"></div>');
|
||||
element = compileAndLink('<div dnd-list="list"></div>');
|
||||
element.scope().list = [];
|
||||
});
|
||||
|
||||
it('adds dndDragover CSS class', function() {
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.hasClass('dndDragover')).toBe(true);
|
||||
});
|
||||
|
||||
it('adds placeholder element', function() {
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.children().length).toBe(1);
|
||||
expect(element.children()[0].tagName).toBe('LI');
|
||||
});
|
||||
|
||||
it('reuses custom placeholder element if it exists', function() {
|
||||
element = compileAndLink('<dnd-list><img class="dndPlaceholder"></dnd-list>');
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.children().length).toBe(1);
|
||||
expect(element.children()[0].tagName).toBe('IMG');
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover callback', function() {
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.scope().dragover.event).toEqual(jasmine.any(DragEventMock));
|
||||
expect(element.scope().dragover.index).toBe(3);
|
||||
expect(element.scope().dragover.external).toBe(false);
|
||||
expect(element.scope().dragover.type).toBeUndefined();
|
||||
expect(element.scope().dragover.item).toBeUndefined();
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover with correct type', function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'mytype\'"></div>');
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.scope().dragover.type).toBe('mytype');
|
||||
expect(element.scope().dragover.external).toBe(false);
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover with correct type (test for IE)', function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'mytype\'"></div>');
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(source, {allowedMimeTypes: ['Text']}).dragover(element);
|
||||
expect(element.scope().dragover.type).toBe('mytype');
|
||||
expect(element.scope().dragover.external).toBe(false);
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover with correct type for external drops', function() {
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragenter.externalOn(element, {'application/x-dnd-mytype': {}}).dragover(element);
|
||||
expect(element.scope().dragover.type).toBe('mytype');
|
||||
expect(element.scope().dragover.external).toBe(true);
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover with null type for external drops from IE', function() {
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragenter.externalOn(element, {'Text': 'unaccessible'}).dragover(element);
|
||||
expect(element.scope().dragover.type).toBeNull();
|
||||
expect(element.scope().dragover.external).toBe(true);
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover with undefined callback', function() {
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.scope().dragover.callback).toBeUndefined();
|
||||
});
|
||||
|
||||
it('invokes dnd-dragover with callback set on dragstart', function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}" dnd-callback="a*b"></div>');
|
||||
source.scope().a = 2;
|
||||
element = compileAndLink('<ul dnd-list="[]" dnd-dragover="result = callback({b: 3});"></ul>');
|
||||
Dragstart.on(source).dragover(element);
|
||||
expect(element.scope().result).toBe(6)
|
||||
});
|
||||
|
||||
it('dnd-dragover callback can cancel the drop', function() {
|
||||
element = compileAndLink('<div dnd-list="list" dnd-dragover="false"></div>');
|
||||
verifyDropCancelled(Dragstart.on(source).dragover(element), element);
|
||||
});
|
||||
|
||||
it('allows all external drops with Text mime type', function() {
|
||||
element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'myType\']" ' +
|
||||
'dnd-external-sources="true"></div>');
|
||||
var dragenter = Dragenter.externalOn(element, {'Text': 'unaccessible'});
|
||||
verifyDropAccepted(dragenter.dragover(element), element);
|
||||
});
|
||||
|
||||
describe('placeholder positioning (vertical)', positioningTests(false, false));
|
||||
describe('placeholder positioning (horizontal)', positioningTests(true, false));
|
||||
|
||||
function positioningTests(horizontal) {
|
||||
return function() {
|
||||
var clientYField = 'client' + (horizontal ? 'X' : 'Y');
|
||||
var heightField = horizontal ? 'width' : 'height';
|
||||
var topField = horizontal ? 'left' : 'top';
|
||||
|
||||
beforeEach(function() {
|
||||
element = createListWithItemsAndCallbacks(horizontal);
|
||||
angular.element(document.body).append(element);
|
||||
if (horizontal) {
|
||||
element.children().css('float','left');
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
element.remove();
|
||||
});
|
||||
|
||||
it('adds actual placeholder element', function() {
|
||||
var options = {target: element.children()[0]};
|
||||
options[clientYField] = 1;
|
||||
Dragstart.on(source).dragover(element, options);
|
||||
expect(element.scope().dragover.index).toBe(0);
|
||||
expect(angular.element(element.children()[0]).hasClass('dndPlaceholder')).toBe(true);
|
||||
});
|
||||
|
||||
it('inserts before element if mouse is in first half', function() {
|
||||
var options = {target: element.children()[1]};
|
||||
var rect = options.target.getBoundingClientRect();
|
||||
options[clientYField] = rect[topField] + rect[heightField] / 2 - 1;
|
||||
Dragstart.on(source).dragover(element, options);
|
||||
expect(element.scope().dragover.index).toBe(1);
|
||||
});
|
||||
|
||||
it('inserts after element if mouse is in second half', function() {
|
||||
var options = {target: element.children()[1]};
|
||||
var rect = options.target.getBoundingClientRect();
|
||||
options[clientYField] = rect[topField] + rect[heightField] / 2 + 1;
|
||||
Dragstart.on(source).dragover(element, options);
|
||||
expect(element.scope().dragover.index).toBe(2);
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
describe('drop handler', function() {
|
||||
var source, element;
|
||||
|
||||
beforeEach(function() {
|
||||
source = compileAndLink('<div dnd-draggable="{example: \'data\'}"></div>');
|
||||
element = createListWithItemsAndCallbacks();
|
||||
});
|
||||
|
||||
it('inserts into the list and removes dndDragover class', function() {
|
||||
var dragover = Dragstart.on(source).dragover(element, {target: element.children()[0]});
|
||||
expect(element.hasClass("dndDragover")).toBe(true);
|
||||
dragover.drop(element);
|
||||
expect(element.scope().list).toEqual([1, {example: 'data'}, 2, 3]);
|
||||
expect(element.hasClass("dndDragover")).toBe(false);
|
||||
expect(element.children().length).toBe(3);
|
||||
});
|
||||
|
||||
it('inserts in correct position', function() {
|
||||
Dragstart.on(source).dragover(element, {target: element.children()[1]}).drop(element);
|
||||
expect(element.scope().list).toEqual([1, 2, {example: 'data'}, 3]);
|
||||
expect(element.scope().inserted.index).toBe(2);
|
||||
});
|
||||
|
||||
it('invokes the dnd-inserted callback', function() {
|
||||
Dragstart.on(source).dragover(element).drop(element);
|
||||
expect(element.scope().inserted.event).toEqual(jasmine.any(DragEventMock));
|
||||
expect(element.scope().inserted.index).toBe(3);
|
||||
expect(element.scope().inserted.external).toBe(false);
|
||||
expect(element.scope().inserted.type).toBeUndefined();
|
||||
expect(element.scope().inserted.item).toBe(element.scope().list[3]);
|
||||
});
|
||||
|
||||
it('dnd-drop can transform the object', function() {
|
||||
var testObject = {transformed: true};
|
||||
element.scope().dropHandler = function(params) {
|
||||
expect(params.event).toEqual(jasmine.any(DragEventMock));
|
||||
expect(params.index).toBe(3);
|
||||
expect(params.external).toBe(false);
|
||||
expect(params.type).toBeUndefined();
|
||||
expect(params.item).toEqual({example: 'data'});
|
||||
return testObject;
|
||||
};
|
||||
Dragstart.on(source).dragover(element).drop(element);
|
||||
expect(element.scope().list[3]).toBe(testObject);
|
||||
});
|
||||
|
||||
it('dnd-drop can cancel the drop', function() {
|
||||
element.scope().dropHandler = function() { return false; };
|
||||
var drop = Dragstart.on(source).dragover(element).drop(element);
|
||||
expect(element.scope().list).toEqual([1, 2, 3]);
|
||||
expect(element.scope().inserted).toBeUndefined();
|
||||
verifyDropCancelled(drop, element, true, 3);
|
||||
});
|
||||
|
||||
it('dnd-drop can take care of inserting the element', function() {
|
||||
element.scope().dropHandler = function() { return true; };
|
||||
verifyDropAccepted(Dragstart.on(source).dragover(element).drop(element), element);
|
||||
expect(element.scope().list).toEqual([1, 2, 3]);
|
||||
});
|
||||
|
||||
it('invokes dnd-drop with undefined callback', function() {
|
||||
element = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(source).dragover(element).drop(element);
|
||||
expect(element.scope().drop.callback).toBeUndefined();
|
||||
});
|
||||
|
||||
it('invokes dnd-drop with callback set on dragstart', function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}" dnd-callback="a*b"></div>');
|
||||
source.scope().a = 2;
|
||||
element = compileAndLink('<ul dnd-list="list" dnd-drop="callback({b: 3});"></ul>');
|
||||
element.scope().list = [];
|
||||
Dragstart.on(source).dragover(element).drop(element);
|
||||
expect(element.scope().list).toEqual([6])
|
||||
});
|
||||
|
||||
it('invokes callbacks with correct type', function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'mytype\'"></div>');
|
||||
Dragstart.on(source).dragover(element).drop(element);
|
||||
expect(element.scope().drop.type).toBe('mytype');
|
||||
expect(element.scope().drop.external).toBe(false);
|
||||
expect(element.scope().inserted.type).toBe('mytype');
|
||||
expect(element.scope().inserted.external).toBe(false);
|
||||
});
|
||||
|
||||
it('invokes callbacks with correct type for Edge', function() {
|
||||
source = compileAndLink('<div dnd-draggable="{}" dnd-type="\'mytype\'"></div>');
|
||||
Dragstart.on(source, {allowedMimeTypes: ['application/json']}).dragover(element).drop(element);
|
||||
expect(element.scope().drop.type).toBe('mytype');
|
||||
expect(element.scope().drop.external).toBe(false);
|
||||
expect(element.scope().inserted.type).toBe('mytype');
|
||||
expect(element.scope().inserted.external).toBe(false);
|
||||
});
|
||||
|
||||
it('invokes callbacks with correct type for external elements', function() {
|
||||
var dragenter = Dragenter.externalOn(element, {'application/x-dnd-mytype': '{}'});
|
||||
verifyDropAccepted(dragenter.dragover(element).drop(element), element);
|
||||
expect(element.scope().drop.type).toBe('mytype');
|
||||
expect(element.scope().drop.external).toBe(true);
|
||||
expect(element.scope().inserted.type).toBe('mytype');
|
||||
expect(element.scope().inserted.external).toBe(true);
|
||||
});
|
||||
|
||||
it('invokes callbacks with correct type for external elements (test for Edge)', function() {
|
||||
var data = angular.toJson({item: [1, 2, 3], type: 'mytype'});
|
||||
var dragenter = Dragenter.externalOn(element, {'application/json': data});
|
||||
verifyDropAccepted(dragenter.dragover(element).drop(element), element);
|
||||
expect(element.scope().drop.type).toBe('mytype');
|
||||
expect(element.scope().drop.external).toBe(true);
|
||||
expect(element.scope().inserted.type).toBe('mytype');
|
||||
expect(element.scope().inserted.external).toBe(true);
|
||||
expect(element.scope().inserted.item).toEqual([1, 2, 3]);
|
||||
});
|
||||
|
||||
it('disallows drops with wrong type encoded inside (test for Edge)', function() {
|
||||
element = compileAndLink('<div dnd-list="[]" dnd-allowed-types="[\'myType\']" ' +
|
||||
'dnd-external-sources="true"></div>');
|
||||
var data = angular.toJson({item: [], type: 'othertype'});
|
||||
var dragenter = Dragenter.externalOn(element, {'application/json': data});
|
||||
verifyDropCancelled(dragenter.dragover(element).drop(element), element, true);
|
||||
});
|
||||
|
||||
it('cancels drop when JSON is invalid', function() {
|
||||
var dragenter = Dragenter.externalOn(element, {'application/x-dnd': 'Lorem ipsum'});
|
||||
verifyDropCancelled(dragenter.dragover(element).drop(element), element, true, 3);
|
||||
});
|
||||
});
|
||||
|
||||
describe('dragleave handler', function() {
|
||||
var element, dragover;
|
||||
|
||||
beforeEach(function() {
|
||||
element = createListWithItemsAndCallbacks();
|
||||
angular.element(document.body).append(element);
|
||||
|
||||
dragover = Dragstart.on(compileAndLink('<div dnd-draggable="{}"></div>')).dragover(element);
|
||||
expect(element.hasClass('dndDragover')).toBe(true);
|
||||
expect(element.children().length).toBe(4);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
element.remove();
|
||||
});
|
||||
|
||||
it('removes the placeholder and dndDragover class', function() {
|
||||
var rect = element[0].getBoundingClientRect();
|
||||
dragover.dragleave(element, {clientX: rect.left - 2, clientY: rect.top - 2});
|
||||
expect(element.hasClass('dndDragover')).toBe(false);
|
||||
expect(element.children().length).toBe(3);
|
||||
});
|
||||
|
||||
it('removes the placeholder and dndDragover if child placeholder is already set', function() {
|
||||
var rect = element[0].getBoundingClientRect();
|
||||
dragover.dragleave(element, {clientX: rect.left + 2, clientY: rect.top + 2, phShown: true});
|
||||
expect(element.hasClass('dndDragover')).toBe(false);
|
||||
expect(element.children().length).toBe(3);
|
||||
});
|
||||
|
||||
it('sets _dndPhShown if mouse is still inside', function() {
|
||||
var rect = element[0].getBoundingClientRect();
|
||||
var result = dragover.dragleave(element, {clientX: rect.left + 2, clientY: rect.top + 2});
|
||||
expect(element.hasClass('dndDragover')).toBe(true);
|
||||
expect(element.children().length).toBe(4);
|
||||
expect(result.dndPhShownSet).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('dropEffect', function() {
|
||||
// This matrix shows the expected drop effect, given two effectAllowed values.
|
||||
var ALL = [ 'all', 'move', 'copy', 'link', 'copyLink', 'copyMove', 'linkMove'];
|
||||
var EXPECTED_MATRIX = {
|
||||
move: ['move', 'move', 'none', 'none', 'none', 'move', 'move'],
|
||||
copy: ['copy', 'none', 'copy', 'none', 'copy', 'copy', 'none'],
|
||||
link: ['link', 'none', 'none', 'link', 'link', 'none', 'link'],
|
||||
copyLink: ['copy', 'none', 'copy', 'link', 'copy', 'copy', 'link'],
|
||||
copyMove: ['move', 'move', 'copy', 'none', 'copy', 'move', 'move'],
|
||||
linkMove: ['move', 'move', 'none', 'link', 'link', 'move', 'move'],
|
||||
all: ['move', 'move', 'copy', 'link', 'copy', 'move', 'move'],
|
||||
'': ['move', 'move', 'copy', 'link', 'copy', 'move', 'move'],
|
||||
};
|
||||
angular.forEach(ALL, function(sourceEffectAllowed, index) {
|
||||
angular.forEach(EXPECTED_MATRIX, function(expected, targetEffectAllowed) {
|
||||
expected = expected[index];
|
||||
it('is ' + expected + ' for effect-allowed ' + sourceEffectAllowed
|
||||
+ ' and ' + targetEffectAllowed, function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-dragend="result = dropEffect" '
|
||||
+ 'dnd-effect-allowed="' + sourceEffectAllowed + '"></div>');
|
||||
var target = createListWithItemsAndCallbacks(false, targetEffectAllowed);
|
||||
expect(Dragstart.on(src).effectAllowed).toBe(sourceEffectAllowed);
|
||||
if (expected != 'none') {
|
||||
// Verify dragover.
|
||||
expect(Dragstart.on(src).dragover(target).dropEffect).toBe(expected);
|
||||
expect(target.scope().dragover.dropEffect).toBe(expected);
|
||||
// Verify drop.
|
||||
expect(Dragstart.on(src).dragover(target).drop(target).dropEffect).toBe(expected);
|
||||
expect(target.scope().drop.dropEffect).toBe(expected);
|
||||
// Verify dragend.
|
||||
Dragstart.on(src).dragover(target).drop(target).dragend(src);
|
||||
expect(src.scope().result).toBe(expected);
|
||||
} else {
|
||||
verifyDropCancelled(Dragstart.on(src).dragover(target), target, false, 3);
|
||||
verifyDropCancelled(Dragstart.on(src).dragover(target).drop(target), target, true, 3);
|
||||
Dragstart.on(src).dragend(src);
|
||||
expect(src.scope().result).toBe('none');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// In Safari dataTransfer.effectAllowed is always 'all', ignoring the value set in dragstart.
|
||||
it('is determined from internal state in Safari', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="link"></div>');
|
||||
var target = createListWithItemsAndCallbacks(false, 'copyLink');
|
||||
var options = {effectAllowed: 'all'};
|
||||
Dragstart.on(src).dragover(target, options).drop(target, options);
|
||||
expect(target.scope().dragover.dropEffect).toBe('link');
|
||||
expect(target.scope().drop.dropEffect).toBe('link');
|
||||
});
|
||||
|
||||
// On MacOS, modifiers automatically limit the effectAllowed passed to dragover and drop.
|
||||
it('is limited by modifier keys on MacOS', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="all"></div>');
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(src).dragover(target, {effectAllowed: 'copyLink'}).drop(target);
|
||||
expect(target.scope().dragover.dropEffect).toBe('copy');
|
||||
expect(target.scope().drop.dropEffect).toBe('copy');
|
||||
});
|
||||
|
||||
it('is copy if Ctrl key is pressed', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="all"></div>');
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(src).dragover(target, {ctrlKey: true}).drop(target);
|
||||
expect(target.scope().dragover.dropEffect).toBe('copy');
|
||||
expect(target.scope().drop.dropEffect).toBe('copy');
|
||||
});
|
||||
|
||||
it('is link if Alt key is pressed', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="all"></div>');
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(src).dragover(target, {altKey: true}).drop(target);
|
||||
expect(target.scope().dragover.dropEffect).toBe('link');
|
||||
expect(target.scope().drop.dropEffect).toBe('link');
|
||||
});
|
||||
|
||||
it('ignores Ctrl key if copy is not possible', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="linkMove"></div>');
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(src).dragover(target, {ctrlKey: true}).drop(target);
|
||||
expect(target.scope().dragover.dropEffect).toBe('move');
|
||||
expect(target.scope().drop.dropEffect).toBe('move');
|
||||
});
|
||||
|
||||
it('respects effectAllowed from external drops', function() {
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragenter.validExternalOn(target, {effectAllowed: 'copyLink'}).dragover(target).drop(target);
|
||||
expect(target.scope().dragover.dropEffect).toBe('copy');
|
||||
expect(target.scope().drop.dropEffect).toBe('copy');
|
||||
});
|
||||
|
||||
it('respects effectAllowed from external drops in IE', function() {
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragenter.externalOn(target, {'Text': '{}'}, {effectAllowed: 'copyLink'})
|
||||
.dragover(target).drop(target);
|
||||
expect(target.scope().dragover.dropEffect).toBe('move');
|
||||
expect(target.scope().drop.dropEffect).toBe('move');
|
||||
});
|
||||
|
||||
it('ignores effectAllowed from internal drops in IE', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="copyLink"></div>');
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
Dragstart.on(src, {allowedMimeTypes: ['Text']}).dragover(target, {altKey: true});
|
||||
expect(target.scope().dragover.dropEffect).toBe('link');
|
||||
});
|
||||
|
||||
it('does not set dropEffect in IE', function() {
|
||||
var src = compileAndLink('<div dnd-draggable="{}" dnd-effect-allowed="copyLink"></div>');
|
||||
var target = createListWithItemsAndCallbacks();
|
||||
var dragover = Dragstart.on(src, {allowedMimeTypes: ['Text']}).dragover(target);
|
||||
expect(dragover.dropEffect).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
function verifyDropAccepted(result) {
|
||||
expect(result.defaultPrevented).toBe(true);
|
||||
if (result.type == 'dragenter') {
|
||||
expect(result.returnValue).toBeUndefined();
|
||||
expect(result.propagationStopped).toBe(false);
|
||||
} else {
|
||||
expect(result.returnValue).toBe(false);
|
||||
expect(result.propagationStopped).toBe(true);
|
||||
}
|
||||
}
|
||||
|
||||
function verifyDropCancelled(result, element, opt_defaultPrevented, opt_children) {
|
||||
expect(result.returnValue).toBe(true);
|
||||
expect(result.propagationStopped).toBe(false);
|
||||
expect(result.defaultPrevented).toBe(opt_defaultPrevented || false);
|
||||
expect(result.dropEffect).toBeUndefined();
|
||||
expect(element.hasClass("dndDragover")).toBe(false);
|
||||
expect(element.children().length).toBe(opt_children || 0);
|
||||
}
|
||||
|
||||
function forAllHandlers(dragenter, element, verify) {
|
||||
verify(dragenter, element);
|
||||
var dragover = dragenter.dragover(element);
|
||||
verify(dragover, element);
|
||||
var dragover2 = dragover.dragover(element);
|
||||
verify(dragover2, element);
|
||||
var drop = dragover2.drop(element);
|
||||
verify(drop, element);
|
||||
}
|
||||
|
||||
function createListWithItemsAndCallbacks(horizontal, effectAllowed) {
|
||||
var params = '{event: event, dropEffect: dropEffect, index: index, '
|
||||
+ 'item: item, external: external, type: type, callback: callback}';
|
||||
var element = compileAndLink('<ul dnd-list="list" dnd-external-sources="true" ' +
|
||||
'dnd-horizontal-list="' + (horizontal || 'false') + '" ' +
|
||||
(effectAllowed ? 'dnd-effect-allowed="' + effectAllowed + '" ' : '') +
|
||||
'dnd-dragover="dragover = ' + params + '" ' +
|
||||
'dnd-drop="dropHandler(' + params + ')" ' +
|
||||
'dnd-inserted="inserted = ' + params + '">' +
|
||||
'<li>A</li><li>B</li><li>C</li></ul>');
|
||||
element.scope().dropHandler = function(params) {
|
||||
element.scope().drop = params;
|
||||
return params.item;
|
||||
};
|
||||
element.scope().list = [1, 2, 3];
|
||||
return element;
|
||||
}
|
||||
});
|
|
@ -1,41 +0,0 @@
|
|||
describe('dndNodrag', function() {
|
||||
var element;
|
||||
|
||||
beforeEach(function() {
|
||||
element = compileAndLink('<div dnd-nodrag></div>');
|
||||
});
|
||||
|
||||
it('sets the draggable attribute', function() {
|
||||
expect(element.attr('draggable')).toBe('true');
|
||||
});
|
||||
|
||||
it('stops propagation and prevents default for dragstart events', function() {
|
||||
var dragstart = Dragstart.on(element);
|
||||
expect(dragstart.propagationStopped).toBe(true);
|
||||
expect(dragstart.defaultPrevented).toBe(true);
|
||||
});
|
||||
|
||||
it('does not call preventDefault if dataTransfer is already set', function() {
|
||||
var dragstart = Dragstart.on(element, {presetTypes: ['text/plain']});
|
||||
expect(dragstart.propagationStopped).toBe(true);
|
||||
expect(dragstart.defaultPrevented).toBe(false);
|
||||
});
|
||||
|
||||
it('does nothing in dragstart if the event was triggered on a dnd-handle', function() {
|
||||
var dragstart = Dragstart.on(element, {dndHandle: true});
|
||||
expect(dragstart.propagationStopped).toBe(false);
|
||||
expect(dragstart.defaultPrevented).toBe(false);
|
||||
});
|
||||
|
||||
it('stops propagation of dragend events', function() {
|
||||
var dragend = Dragend.on(element);
|
||||
expect(dragend.propagationStopped).toBe(true);
|
||||
expect(dragend.defaultPrevented).toBe(false);
|
||||
});
|
||||
|
||||
it('does nothing in dragend if the event was triggered on a dnd-handle', function() {
|
||||
var dragend = Dragend.on(element, {dndHandle: true});
|
||||
expect(dragend.propagationStopped).toBe(false);
|
||||
expect(dragend.defaultPrevented).toBe(false);
|
||||
});
|
||||
});
|
|
@ -1,30 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Testing angular-drag-and-drop-lists...</title>
|
||||
|
||||
<link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
|
||||
|
||||
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
|
||||
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
|
||||
<script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
|
||||
|
||||
<script src="../node_modules/jquery/dist/jquery.js"></script>
|
||||
<script src="../node_modules/angular/angular.js"></script>
|
||||
<script src="../node_modules/angular-mocks/angular-mocks.js"></script>
|
||||
|
||||
<script src="../angular-drag-and-drop-lists.js"></script>
|
||||
|
||||
<!-- Spec files -->
|
||||
<script src="mocks.js"></script>
|
||||
<script src="init.js"></script>
|
||||
<script src="dndDraggableSpec.js"></script>
|
||||
<script src="dndListSpec.js"></script>
|
||||
<script src="dndNodragSpec.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -1,21 +0,0 @@
|
|||
var $compile,
|
||||
$rootScope;
|
||||
|
||||
beforeEach(module('dndLists'));
|
||||
|
||||
beforeEach(inject(function(_$compile_, _$rootScope_){
|
||||
$compile = _$compile_;
|
||||
$rootScope = _$rootScope_;
|
||||
}));
|
||||
|
||||
afterEach(function() {
|
||||
// Reset internal dndState in case dragend was not called.
|
||||
Dragend.on(compileAndLink('<div dnd-draggable="{}"></div>'));
|
||||
});
|
||||
|
||||
function compileAndLink(html) {
|
||||
var scope = $rootScope.$new();
|
||||
var element = $compile(html)(scope);
|
||||
scope.$digest();
|
||||
return element;
|
||||
}
|
199
js/vendor/angular-drag-and-drop-lists/test/mocks.js
vendored
199
js/vendor/angular-drag-and-drop-lists/test/mocks.js
vendored
|
@ -1,199 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
class DataTransferMock {
|
||||
constructor() { this.$results = {}; }
|
||||
get dropEffect() { throw "Unexcepted dropEffect getter invocation"; }
|
||||
set dropEffect(value) { throw "Unexcepted dropEffect setter invocation"; }
|
||||
get effectAllowed() { throw "Unexcepted effectAllowed getter invocation"; }
|
||||
set effectAllowed(value) { throw "Unexcepted effectAllowed setter invocation"; }
|
||||
get types() { throw "Unexcepted types getter invocation"; }
|
||||
set types(value) { throw "Unexcepted types setter invocation"; }
|
||||
getData() { throw "Unexcepted getData invocation"; }
|
||||
setData() { throw "Unexcepted setData invocation"; }
|
||||
setDragImage() { throw "Unexcepted setDragImage invocation"; }
|
||||
getResults() { return this.$results; }
|
||||
}
|
||||
|
||||
class DragstartDataTransfer extends DataTransferMock {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.$allowSetDragImage = options.allowSetDragImage || false;
|
||||
this.$allowedMimeTypes = options.allowedMimeTypes || null;
|
||||
this.$presetTypes = options.presetTypes || [];
|
||||
this.$results.data = {};
|
||||
}
|
||||
|
||||
get effectAllowed() { throw "Unexcepted effectAllowed getter invocation"; }
|
||||
set effectAllowed(value) { this.$results.effectAllowed = value; }
|
||||
get types() { return this.$presetTypes; }
|
||||
set types(value) { throw "Unexcepted types setter invocation"; }
|
||||
|
||||
setData(format, data) {
|
||||
if (this.$allowedMimeTypes && !this.$allowedMimeTypes.includes(format)) {
|
||||
throw "Invalid mime type " + format;
|
||||
}
|
||||
this.$results.data[format] = data;
|
||||
}
|
||||
|
||||
setDragImage(img) {
|
||||
if (!this.$allowSetDragImage) throw "Unexcepted setDragImage invocation";
|
||||
this.$results.dragImage = img;
|
||||
}
|
||||
}
|
||||
|
||||
class DropzoneDataTransfer extends DataTransferMock {
|
||||
constructor(data, options) {
|
||||
super();
|
||||
this.$data = data;
|
||||
this.$dropEffect = options.dropEffect || 'move';
|
||||
this.$effectAllowed = options.effectAllowed || 'move';
|
||||
this.$types = options.undefinedTypes ? undefined : Object.keys(data);
|
||||
}
|
||||
|
||||
get dropEffect() { throw "Unexcepted dropEffect getter invocation"; }
|
||||
set dropEffect(value) { this.$results.dropEffect = value; }
|
||||
get effectAllowed() { return this.$effectAllowed; }
|
||||
set effectAllowed(value) { throw "Unexcepted effectAllowed setter invocation"; }
|
||||
get types() { return this.$types; }
|
||||
set types(value) { throw "Unexcepted types setter invocation"; }
|
||||
}
|
||||
|
||||
class DropDataTransfer extends DropzoneDataTransfer {
|
||||
getData(format) { return this.$data[format]; }
|
||||
}
|
||||
|
||||
class DragEventMock {
|
||||
constructor(type, dataTransfer, options) {
|
||||
this.$type = type;
|
||||
this.$dataTransfer = dataTransfer;
|
||||
this.$options = options;
|
||||
this.$results = {dataTransfer: dataTransfer.getResults()};
|
||||
}
|
||||
|
||||
get clientX() { return this.$options.clientX || 0; }
|
||||
get clientY() { return this.$options.clientY || 0; }
|
||||
get ctrlKey() { return this.$options.ctrlKey || false; }
|
||||
get altKey() { return this.$options.altKey || false; }
|
||||
get dataTransfer() { return this.$dataTransfer; }
|
||||
get originalEvent() { return this; }
|
||||
get target() { return this.$options.target || undefined; }
|
||||
get type() { return this.$type; }
|
||||
get _dndHandle() { return this.$options.dndHandle || undefined; }
|
||||
get _dndPhShown() { return this.$options.phShown || undefined; }
|
||||
set _dndPhShown(value) { this.$results.setDndPhShown = value; }
|
||||
|
||||
preventDefault() { this.$results.invokedPreventDefault = true; }
|
||||
stopPropagation() { this.$results.invokedStopPropagation = true; }
|
||||
getResults() { return this.$results; }
|
||||
}
|
||||
|
||||
class DragEventResult {
|
||||
constructor(element, type, dataTransfer, opt_eventOptions) {
|
||||
let handler = $._data($(element).get(0), "events")[type][0].handler;
|
||||
let event = new DragEventMock(type, dataTransfer, opt_eventOptions || {});
|
||||
this.$results = event.getResults();
|
||||
this.$results.returnValue = handler(event);
|
||||
this.$type = type;
|
||||
}
|
||||
|
||||
get propagationStopped() { return !!this.$results.invokedStopPropagation; }
|
||||
get defaultPrevented() { return !!this.$results.invokedPreventDefault; }
|
||||
get dndPhShownSet() { return this.$results.setDndPhShown || false; }
|
||||
get returnValue() { return this.$results.returnValue; }
|
||||
get dropEffect() { return this.$results.dataTransfer.dropEffect; }
|
||||
get type() { return this.$type; }
|
||||
}
|
||||
|
||||
class Dragstart extends DragEventResult {
|
||||
constructor(element, options) {
|
||||
super(element, 'dragstart', new DragstartDataTransfer(options), options);
|
||||
}
|
||||
|
||||
get data() { return this.$results.dataTransfer.data; }
|
||||
get dragImage() { return this.$results.dataTransfer.dragImage; }
|
||||
get effectAllowed() { return this.$results.dataTransfer.effectAllowed; }
|
||||
|
||||
dragenter(element, opt_options) {
|
||||
var options = $.extend({effectAllowed: this.effectAllowed}, opt_options);
|
||||
return new Dragenter(element, this.$results.dataTransfer.data, options);
|
||||
}
|
||||
|
||||
dragover(element, opt_options) {
|
||||
return this.dragenter(element, opt_options).dragover(element);
|
||||
}
|
||||
|
||||
dragend(element) {
|
||||
return Dragend.on(element);
|
||||
}
|
||||
|
||||
static on(element, opt_options) {
|
||||
return new Dragstart(element, opt_options || {});
|
||||
}
|
||||
}
|
||||
|
||||
class Dragend extends DragEventResult {
|
||||
constructor(element, options) {
|
||||
super(element, 'dragend', new DataTransferMock(), options);
|
||||
}
|
||||
|
||||
static on(element, opt_options) {
|
||||
return new Dragend(element, opt_options || {});
|
||||
}
|
||||
}
|
||||
|
||||
class DropzoneEventResult extends DragEventResult {
|
||||
constructor(element, type, data, dataTransfer, options) {
|
||||
options.target = options.target || element[0];
|
||||
super(element, type, dataTransfer, options);
|
||||
this.$originalData = $.extend({}, data);
|
||||
this.$options = options;
|
||||
}
|
||||
|
||||
dragover(element, opt_options) {
|
||||
return new Dragover(element, this.$originalData, $.extend({}, this.$options, opt_options));
|
||||
}
|
||||
}
|
||||
|
||||
class Dragenter extends DropzoneEventResult {
|
||||
constructor(element, data, options) {
|
||||
super(element, 'dragenter', data, new DropzoneDataTransfer(data, options), options);
|
||||
}
|
||||
|
||||
static externalOn(element, data, opt_options) {
|
||||
return new Dragenter(element, data, opt_options || {});
|
||||
}
|
||||
|
||||
static validExternalOn(element, opt_options) {
|
||||
return Dragenter.externalOn(element, {'application/x-dnd': '{"hello":"world"}'}, opt_options);
|
||||
}
|
||||
}
|
||||
|
||||
class Dragover extends DropzoneEventResult {
|
||||
constructor(element, data, options) {
|
||||
super(element, 'dragover', data, new DropzoneDataTransfer(data, options), options);
|
||||
}
|
||||
|
||||
dragleave(element, opt_options) {
|
||||
return new Dragleave(element, this.$originalData, $.extend({}, this.$options, opt_options));
|
||||
}
|
||||
|
||||
drop(element, opt_options) {
|
||||
return new Drop(element, this.$originalData, $.extend({}, this.$options, opt_options));
|
||||
}
|
||||
}
|
||||
|
||||
class Dragleave extends DropzoneEventResult {
|
||||
constructor(element, data, options) {
|
||||
super(element, 'dragleave', data, new DataTransferMock(), options);
|
||||
}
|
||||
}
|
||||
|
||||
class Drop extends DropzoneEventResult {
|
||||
constructor(element, data, options) {
|
||||
super(element, 'drop', data, new DropDataTransfer(data, options), options);
|
||||
}
|
||||
|
||||
dragend(element) {
|
||||
return Dragend.on(element);
|
||||
}
|
||||
}
|
68
js/vendor/angular-route/README.md
vendored
68
js/vendor/angular-route/README.md
vendored
|
@ -1,68 +0,0 @@
|
|||
# packaged angular-route
|
||||
|
||||
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/ngRoute).
|
||||
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-route
|
||||
```
|
||||
|
||||
Then add `ngRoute` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', [require('angular-route')]);
|
||||
```
|
||||
|
||||
### bower
|
||||
|
||||
```shell
|
||||
bower install angular-route
|
||||
```
|
||||
|
||||
Add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/bower_components/angular-route/angular-route.js"></script>
|
||||
```
|
||||
|
||||
Then add `ngRoute` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ngRoute']);
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is available on the
|
||||
[AngularJS docs site](http://docs.angularjs.org/api/ngRoute).
|
||||
|
||||
## 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.
|
1025
js/vendor/angular-route/angular-route.js
vendored
1025
js/vendor/angular-route/angular-route.js
vendored
File diff suppressed because it is too large
Load diff
15
js/vendor/angular-route/angular-route.min.js
vendored
15
js/vendor/angular-route/angular-route.min.js
vendored
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
AngularJS v1.5.5
|
||||
(c) 2010-2016 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(C,d){'use strict';function z(r,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,y){function k(){n&&(g.cancel(n),n=null);l&&(l.$destroy(),l=null);m&&(n=g.leave(m),n.then(function(){n=null}),m=null)}function x(){var b=r.current&&r.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),f=r.current;m=y(b,function(b){g.enter(b,null,m||c).then(function(){!d.isDefined(t)||t&&!a.$eval(t)||h()});k()});l=f.scope=b;l.$emit("$viewContentLoaded");
|
||||
l.$eval(u)}else k()}var l,m,n,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(d,h,g){return{restrict:"ECA",priority:-400,link:function(a,c){var b=g.current,f=b.locals;c.html(f.$template);var y=d(c.contents());if(b.controller){f.$scope=a;var k=h(b.controller,f);b.controllerAs&&(a[b.controllerAs]=k);c.data("$ngControllerController",k);c.children().data("$ngControllerController",k)}a[b.resolveAs||"$resolve"]=f;y(a)}}}var w=d.module("ngRoute",["ng"]).provider("$route",function(){function r(a,
|
||||
c){return d.extend(Object.create(a),c)}function h(a,d){var b=d.caseInsensitiveMatch,f={originalPath:a,regexp:a},g=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[\?\*])?/g,function(a,d,b,c){a="?"===c||"*?"===c?"?":null;c="*"===c||"*?"===c?"*":null;g.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=new RegExp("^"+a+"$",b?"i":"");return f}var g={};this.when=function(a,c){var b=
|
||||
d.copy(c);d.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0);d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=d.extend(b,a&&h(a,b));if(a){var f="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[f]=d.extend({redirectTo:a},h(f,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest",
|
||||
"$sce",function(a,c,b,f,h,k,x){function l(b){var e=s.current;(w=(p=n())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!u)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function m(){var v=s.current,e=p;if(w)v.params=e.params,d.copy(v.params,b),a.$broadcast("$routeUpdate",v);else if(e||v)u=!1,(s.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?c.path(t(e.redirectTo,e.params)).search(e.params).replace():c.url(e.redirectTo(e.pathParams,
|
||||
c.path(),c.search())).replace()),f.when(e).then(function(){if(e){var a=d.extend({},e.resolve),b,c;d.forEach(a,function(b,e){a[e]=d.isString(b)?h.get(b):h.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(c=e.templateUrl)&&(d.isFunction(c)&&(c=c(e.params)),d.isDefined(c)&&(e.loadedTemplateUrl=x.valueOf(c),b=k(c)));d.isDefined(b)&&(a.$template=b);return f.all(a)}}).then(function(c){e==s.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",
|
||||
e,v))},function(b){e==s.current&&a.$broadcast("$routeChangeError",e,v,b)})}function n(){var a,b;d.forEach(g,function(f,g){var q;if(q=!b){var h=c.path();q=f.keys;var l={};if(f.regexp)if(h=f.regexp.exec(h)){for(var k=1,n=h.length;k<n;++k){var m=q[k-1],p=h[k];m&&p&&(l[m.name]=p)}q=l}else q=null;else q=null;q=a=q}q&&(b=r(f,{params:d.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||g[null]&&r(g[null],{params:{},pathParams:{}})}function t(a,b){var c=[];d.forEach((a||"").split(":"),function(a,
|
||||
d){if(0===d)c.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),g=f[1];c.push(b[g]);c.push(f[2]||"");delete b[g]}});return c.join("")}var u=!1,p,w,s={routes:g,reload:function(){u=!0;var b={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0;u=!1}};a.$evalAsync(function(){l(b);b.defaultPrevented||m()})},updateParams:function(a){if(this.current&&this.current.$$route)a=d.extend({},this.current.params,a),c.path(t(this.current.$$route.originalPath,a)),c.search(a);else throw B("norout");
|
||||
}};a.$on("$locationChangeStart",l);a.$on("$locationChangeSuccess",m);return s}]}),B=d.$$minErr("ngRoute");w.provider("$routeParams",function(){this.$get=function(){return{}}});w.directive("ngView",z);w.directive("ngView",A);z.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular);
|
||||
//# sourceMappingURL=angular-route.min.js.map
|
File diff suppressed because one or more lines are too long
10
js/vendor/angular-route/bower.json
vendored
10
js/vendor/angular-route/bower.json
vendored
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name": "angular-route",
|
||||
"version": "1.5.5",
|
||||
"license": "MIT",
|
||||
"main": "./angular-route.js",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"angular": "1.5.5"
|
||||
}
|
||||
}
|
2
js/vendor/angular-route/index.js
vendored
2
js/vendor/angular-route/index.js
vendored
|
@ -1,2 +0,0 @@
|
|||
require('./angular-route');
|
||||
module.exports = 'ngRoute';
|
26
js/vendor/angular-route/package.json
vendored
26
js/vendor/angular-route/package.json
vendored
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"name": "angular-route",
|
||||
"version": "1.5.5",
|
||||
"description": "AngularJS router module",
|
||||
"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",
|
||||
"router",
|
||||
"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"
|
||||
}
|
68
js/vendor/angular-sanitize/README.md
vendored
68
js/vendor/angular-sanitize/README.md
vendored
|
@ -1,68 +0,0 @@
|
|||
# packaged angular-sanitize
|
||||
|
||||
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/ngSanitize).
|
||||
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-sanitize
|
||||
```
|
||||
|
||||
Then add `ngSanitize` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', [require('angular-sanitize')]);
|
||||
```
|
||||
|
||||
### bower
|
||||
|
||||
```shell
|
||||
bower install angular-sanitize
|
||||
```
|
||||
|
||||
Add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/bower_components/angular-sanitize/angular-sanitize.js"></script>
|
||||
```
|
||||
|
||||
Then add `ngSanitize` as a dependency for your app:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ngSanitize']);
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is available on the
|
||||
[AngularJS docs site](http://docs.angularjs.org/api/ngSanitize).
|
||||
|
||||
## 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.
|
717
js/vendor/angular-sanitize/angular-sanitize.js
vendored
717
js/vendor/angular-sanitize/angular-sanitize.js
vendored
|
@ -1,717 +0,0 @@
|
|||
/**
|
||||
* @license AngularJS v1.5.5
|
||||
* (c) 2010-2016 Google, Inc. http://angularjs.org
|
||||
* License: MIT
|
||||
*/
|
||||
(function(window, angular) {'use strict';
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Any commits to this file should be reviewed with security in mind. *
|
||||
* Changes to this file can potentially create security vulnerabilities. *
|
||||
* An approval from 2 Core members with history of modifying *
|
||||
* this file is required. *
|
||||
* *
|
||||
* Does the change somehow allow for arbitrary javascript to be executed? *
|
||||
* Or allows for someone to change the prototype of built-in objects? *
|
||||
* Or gives undesired access to variables likes document or window? *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
var $sanitizeMinErr = angular.$$minErr('$sanitize');
|
||||
|
||||
/**
|
||||
* @ngdoc module
|
||||
* @name ngSanitize
|
||||
* @description
|
||||
*
|
||||
* # ngSanitize
|
||||
*
|
||||
* The `ngSanitize` module provides functionality to sanitize HTML.
|
||||
*
|
||||
*
|
||||
* <div doc-module-components="ngSanitize"></div>
|
||||
*
|
||||
* See {@link ngSanitize.$sanitize `$sanitize`} for usage.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc service
|
||||
* @name $sanitize
|
||||
* @kind function
|
||||
*
|
||||
* @description
|
||||
* Sanitizes an html string by stripping all potentially dangerous tokens.
|
||||
*
|
||||
* The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
|
||||
* then serialized back to properly escaped html string. This means that no unsafe input can make
|
||||
* it into the returned string.
|
||||
*
|
||||
* The whitelist for URL sanitization of attribute values is configured using the functions
|
||||
* `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider
|
||||
* `$compileProvider`}.
|
||||
*
|
||||
* The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.
|
||||
*
|
||||
* @param {string} html HTML input.
|
||||
* @returns {string} Sanitized HTML.
|
||||
*
|
||||
* @example
|
||||
<example module="sanitizeExample" deps="angular-sanitize.js">
|
||||
<file name="index.html">
|
||||
<script>
|
||||
angular.module('sanitizeExample', ['ngSanitize'])
|
||||
.controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {
|
||||
$scope.snippet =
|
||||
'<p style="color:blue">an html\n' +
|
||||
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
|
||||
'snippet</p>';
|
||||
$scope.deliberatelyTrustDangerousSnippet = function() {
|
||||
return $sce.trustAsHtml($scope.snippet);
|
||||
};
|
||||
}]);
|
||||
</script>
|
||||
<div ng-controller="ExampleController">
|
||||
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Directive</td>
|
||||
<td>How</td>
|
||||
<td>Source</td>
|
||||
<td>Rendered</td>
|
||||
</tr>
|
||||
<tr id="bind-html-with-sanitize">
|
||||
<td>ng-bind-html</td>
|
||||
<td>Automatically uses $sanitize</td>
|
||||
<td><pre><div ng-bind-html="snippet"><br/></div></pre></td>
|
||||
<td><div ng-bind-html="snippet"></div></td>
|
||||
</tr>
|
||||
<tr id="bind-html-with-trust">
|
||||
<td>ng-bind-html</td>
|
||||
<td>Bypass $sanitize by explicitly trusting the dangerous value</td>
|
||||
<td>
|
||||
<pre><div ng-bind-html="deliberatelyTrustDangerousSnippet()">
|
||||
</div></pre>
|
||||
</td>
|
||||
<td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
|
||||
</tr>
|
||||
<tr id="bind-default">
|
||||
<td>ng-bind</td>
|
||||
<td>Automatically escapes</td>
|
||||
<td><pre><div ng-bind="snippet"><br/></div></pre></td>
|
||||
<td><div ng-bind="snippet"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</file>
|
||||
<file name="protractor.js" type="protractor">
|
||||
it('should sanitize the html snippet by default', function() {
|
||||
expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
|
||||
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
|
||||
});
|
||||
|
||||
it('should inline raw snippet if bound to a trusted value', function() {
|
||||
expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).
|
||||
toBe("<p style=\"color:blue\">an html\n" +
|
||||
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
|
||||
"snippet</p>");
|
||||
});
|
||||
|
||||
it('should escape snippet without any filter', function() {
|
||||
expect(element(by.css('#bind-default div')).getInnerHtml()).
|
||||
toBe("<p style=\"color:blue\">an html\n" +
|
||||
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
|
||||
"snippet</p>");
|
||||
});
|
||||
|
||||
it('should update', function() {
|
||||
element(by.model('snippet')).clear();
|
||||
element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
|
||||
expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
|
||||
toBe('new <b>text</b>');
|
||||
expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(
|
||||
'new <b onclick="alert(1)">text</b>');
|
||||
expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(
|
||||
"new <b onclick=\"alert(1)\">text</b>");
|
||||
});
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc provider
|
||||
* @name $sanitizeProvider
|
||||
*
|
||||
* @description
|
||||
* Creates and configures {@link $sanitize} instance.
|
||||
*/
|
||||
function $SanitizeProvider() {
|
||||
var svgEnabled = false;
|
||||
|
||||
this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
|
||||
if (svgEnabled) {
|
||||
angular.extend(validElements, svgElements);
|
||||
}
|
||||
return function(html) {
|
||||
var buf = [];
|
||||
htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {
|
||||
return !/^unsafe:/.test($$sanitizeUri(uri, isImage));
|
||||
}));
|
||||
return buf.join('');
|
||||
};
|
||||
}];
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $sanitizeProvider#enableSvg
|
||||
* @kind function
|
||||
*
|
||||
* @description
|
||||
* Enables a subset of svg to be supported by the sanitizer.
|
||||
*
|
||||
* <div class="alert alert-warning">
|
||||
* <p>By enabling this setting without taking other precautions, you might expose your
|
||||
* application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned
|
||||
* outside of the containing element and be rendered over other elements on the page (e.g. a login
|
||||
* link). Such behavior can then result in phishing incidents.</p>
|
||||
*
|
||||
* <p>To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg
|
||||
* tags within the sanitized content:</p>
|
||||
*
|
||||
* <br>
|
||||
*
|
||||
* <pre><code>
|
||||
* .rootOfTheIncludedContent svg {
|
||||
* overflow: hidden !important;
|
||||
* }
|
||||
* </code></pre>
|
||||
* </div>
|
||||
*
|
||||
* @param {boolean=} regexp New regexp to whitelist urls with.
|
||||
* @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called
|
||||
* without an argument or self for chaining otherwise.
|
||||
*/
|
||||
this.enableSvg = function(enableSvg) {
|
||||
if (angular.isDefined(enableSvg)) {
|
||||
svgEnabled = enableSvg;
|
||||
return this;
|
||||
} else {
|
||||
return svgEnabled;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function sanitizeText(chars) {
|
||||
var buf = [];
|
||||
var writer = htmlSanitizeWriter(buf, angular.noop);
|
||||
writer.chars(chars);
|
||||
return buf.join('');
|
||||
}
|
||||
|
||||
|
||||
// Regular Expressions for parsing tags and attributes
|
||||
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
|
||||
// Match everything outside of normal chars and " (quote character)
|
||||
NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
|
||||
|
||||
|
||||
// Good source of info about elements and attributes
|
||||
// http://dev.w3.org/html5/spec/Overview.html#semantics
|
||||
// http://simon.html5.org/html-elements
|
||||
|
||||
// Safe Void Elements - HTML5
|
||||
// http://dev.w3.org/html5/spec/Overview.html#void-elements
|
||||
var voidElements = toMap("area,br,col,hr,img,wbr");
|
||||
|
||||
// Elements that you can, intentionally, leave open (and which close themselves)
|
||||
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
|
||||
var optionalEndTagBlockElements = toMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
|
||||
optionalEndTagInlineElements = toMap("rp,rt"),
|
||||
optionalEndTagElements = angular.extend({},
|
||||
optionalEndTagInlineElements,
|
||||
optionalEndTagBlockElements);
|
||||
|
||||
// Safe Block Elements - HTML5
|
||||
var blockElements = angular.extend({}, optionalEndTagBlockElements, toMap("address,article," +
|
||||
"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," +
|
||||
"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul"));
|
||||
|
||||
// Inline Elements - HTML5
|
||||
var inlineElements = angular.extend({}, optionalEndTagInlineElements, toMap("a,abbr,acronym,b," +
|
||||
"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," +
|
||||
"samp,small,span,strike,strong,sub,sup,time,tt,u,var"));
|
||||
|
||||
// SVG Elements
|
||||
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements
|
||||
// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.
|
||||
// They can potentially allow for arbitrary javascript to be executed. See #11290
|
||||
var svgElements = toMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph," +
|
||||
"hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline," +
|
||||
"radialGradient,rect,stop,svg,switch,text,title,tspan");
|
||||
|
||||
// Blocked Elements (will be stripped)
|
||||
var blockedElements = toMap("script,style");
|
||||
|
||||
var validElements = angular.extend({},
|
||||
voidElements,
|
||||
blockElements,
|
||||
inlineElements,
|
||||
optionalEndTagElements);
|
||||
|
||||
//Attributes that have href and hence need to be sanitized
|
||||
var uriAttrs = toMap("background,cite,href,longdesc,src,xlink:href");
|
||||
|
||||
var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
|
||||
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
|
||||
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
|
||||
'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +
|
||||
'valign,value,vspace,width');
|
||||
|
||||
// SVG attributes (without "id" and "name" attributes)
|
||||
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes
|
||||
var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +
|
||||
'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +
|
||||
'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +
|
||||
'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +
|
||||
'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +
|
||||
'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +
|
||||
'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +
|
||||
'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +
|
||||
'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +
|
||||
'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +
|
||||
'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +
|
||||
'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +
|
||||
'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +
|
||||
'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +
|
||||
'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);
|
||||
|
||||
var validAttrs = angular.extend({},
|
||||
uriAttrs,
|
||||
svgAttrs,
|
||||
htmlAttrs);
|
||||
|
||||
function toMap(str, lowercaseKeys) {
|
||||
var obj = {}, items = str.split(','), i;
|
||||
for (i = 0; i < items.length; i++) {
|
||||
obj[lowercaseKeys ? angular.lowercase(items[i]) : items[i]] = true;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
var inertBodyElement;
|
||||
(function(window) {
|
||||
var doc;
|
||||
if (window.document && window.document.implementation) {
|
||||
doc = window.document.implementation.createHTMLDocument("inert");
|
||||
} else {
|
||||
throw $sanitizeMinErr('noinert', "Can't create an inert html document");
|
||||
}
|
||||
var docElement = doc.documentElement || doc.getDocumentElement();
|
||||
var bodyElements = docElement.getElementsByTagName('body');
|
||||
|
||||
// usually there should be only one body element in the document, but IE doesn't have any, so we need to create one
|
||||
if (bodyElements.length === 1) {
|
||||
inertBodyElement = bodyElements[0];
|
||||
} else {
|
||||
var html = doc.createElement('html');
|
||||
inertBodyElement = doc.createElement('body');
|
||||
html.appendChild(inertBodyElement);
|
||||
doc.appendChild(html);
|
||||
}
|
||||
})(window);
|
||||
|
||||
/**
|
||||
* @example
|
||||
* htmlParser(htmlString, {
|
||||
* start: function(tag, attrs) {},
|
||||
* end: function(tag) {},
|
||||
* chars: function(text) {},
|
||||
* comment: function(text) {}
|
||||
* });
|
||||
*
|
||||
* @param {string} html string
|
||||
* @param {object} handler
|
||||
*/
|
||||
function htmlParser(html, handler) {
|
||||
if (html === null || html === undefined) {
|
||||
html = '';
|
||||
} else if (typeof html !== 'string') {
|
||||
html = '' + html;
|
||||
}
|
||||
inertBodyElement.innerHTML = html;
|
||||
|
||||
//mXSS protection
|
||||
var mXSSAttempts = 5;
|
||||
do {
|
||||
if (mXSSAttempts === 0) {
|
||||
throw $sanitizeMinErr('uinput', "Failed to sanitize html because the input is unstable");
|
||||
}
|
||||
mXSSAttempts--;
|
||||
|
||||
// strip custom-namespaced attributes on IE<=11
|
||||
if (window.document.documentMode) {
|
||||
stripCustomNsAttrs(inertBodyElement);
|
||||
}
|
||||
html = inertBodyElement.innerHTML; //trigger mXSS
|
||||
inertBodyElement.innerHTML = html;
|
||||
} while (html !== inertBodyElement.innerHTML);
|
||||
|
||||
var node = inertBodyElement.firstChild;
|
||||
while (node) {
|
||||
switch (node.nodeType) {
|
||||
case 1: // ELEMENT_NODE
|
||||
handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));
|
||||
break;
|
||||
case 3: // TEXT NODE
|
||||
handler.chars(node.textContent);
|
||||
break;
|
||||
}
|
||||
|
||||
var nextNode;
|
||||
if (!(nextNode = node.firstChild)) {
|
||||
if (node.nodeType == 1) {
|
||||
handler.end(node.nodeName.toLowerCase());
|
||||
}
|
||||
nextNode = node.nextSibling;
|
||||
if (!nextNode) {
|
||||
while (nextNode == null) {
|
||||
node = node.parentNode;
|
||||
if (node === inertBodyElement) break;
|
||||
nextNode = node.nextSibling;
|
||||
if (node.nodeType == 1) {
|
||||
handler.end(node.nodeName.toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
node = nextNode;
|
||||
}
|
||||
|
||||
while (node = inertBodyElement.firstChild) {
|
||||
inertBodyElement.removeChild(node);
|
||||
}
|
||||
}
|
||||
|
||||
function attrToMap(attrs) {
|
||||
var map = {};
|
||||
for (var i = 0, ii = attrs.length; i < ii; i++) {
|
||||
var attr = attrs[i];
|
||||
map[attr.name] = attr.value;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Escapes all potentially dangerous characters, so that the
|
||||
* resulting string can be safely inserted into attribute or
|
||||
* element text.
|
||||
* @param value
|
||||
* @returns {string} escaped text
|
||||
*/
|
||||
function encodeEntities(value) {
|
||||
return value.
|
||||
replace(/&/g, '&').
|
||||
replace(SURROGATE_PAIR_REGEXP, function(value) {
|
||||
var hi = value.charCodeAt(0);
|
||||
var low = value.charCodeAt(1);
|
||||
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
|
||||
}).
|
||||
replace(NON_ALPHANUMERIC_REGEXP, function(value) {
|
||||
return '&#' + value.charCodeAt(0) + ';';
|
||||
}).
|
||||
replace(/</g, '<').
|
||||
replace(/>/g, '>');
|
||||
}
|
||||
|
||||
/**
|
||||
* create an HTML/XML writer which writes to buffer
|
||||
* @param {Array} buf use buf.join('') to get out sanitized html string
|
||||
* @returns {object} in the form of {
|
||||
* start: function(tag, attrs) {},
|
||||
* end: function(tag) {},
|
||||
* chars: function(text) {},
|
||||
* comment: function(text) {}
|
||||
* }
|
||||
*/
|
||||
function htmlSanitizeWriter(buf, uriValidator) {
|
||||
var ignoreCurrentElement = false;
|
||||
var out = angular.bind(buf, buf.push);
|
||||
return {
|
||||
start: function(tag, attrs) {
|
||||
tag = angular.lowercase(tag);
|
||||
if (!ignoreCurrentElement && blockedElements[tag]) {
|
||||
ignoreCurrentElement = tag;
|
||||
}
|
||||
if (!ignoreCurrentElement && validElements[tag] === true) {
|
||||
out('<');
|
||||
out(tag);
|
||||
angular.forEach(attrs, function(value, key) {
|
||||
var lkey=angular.lowercase(key);
|
||||
var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
|
||||
if (validAttrs[lkey] === true &&
|
||||
(uriAttrs[lkey] !== true || uriValidator(value, isImage))) {
|
||||
out(' ');
|
||||
out(key);
|
||||
out('="');
|
||||
out(encodeEntities(value));
|
||||
out('"');
|
||||
}
|
||||
});
|
||||
out('>');
|
||||
}
|
||||
},
|
||||
end: function(tag) {
|
||||
tag = angular.lowercase(tag);
|
||||
if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) {
|
||||
out('</');
|
||||
out(tag);
|
||||
out('>');
|
||||
}
|
||||
if (tag == ignoreCurrentElement) {
|
||||
ignoreCurrentElement = false;
|
||||
}
|
||||
},
|
||||
chars: function(chars) {
|
||||
if (!ignoreCurrentElement) {
|
||||
out(encodeEntities(chars));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare
|
||||
* ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want
|
||||
* to allow any of these custom attributes. This method strips them all.
|
||||
*
|
||||
* @param node Root element to process
|
||||
*/
|
||||
function stripCustomNsAttrs(node) {
|
||||
if (node.nodeType === window.Node.ELEMENT_NODE) {
|
||||
var attrs = node.attributes;
|
||||
for (var i = 0, l = attrs.length; i < l; i++) {
|
||||
var attrNode = attrs[i];
|
||||
var attrName = attrNode.name.toLowerCase();
|
||||
if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
|
||||
node.removeAttributeNode(attrNode);
|
||||
i--;
|
||||
l--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var nextNode = node.firstChild;
|
||||
if (nextNode) {
|
||||
stripCustomNsAttrs(nextNode);
|
||||
}
|
||||
|
||||
nextNode = node.nextSibling;
|
||||
if (nextNode) {
|
||||
stripCustomNsAttrs(nextNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// define ngSanitize module and register $sanitize service
|
||||
angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
|
||||
|
||||
/* global sanitizeText: false */
|
||||
|
||||
/**
|
||||
* @ngdoc filter
|
||||
* @name linky
|
||||
* @kind function
|
||||
*
|
||||
* @description
|
||||
* Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and
|
||||
* plain email address links.
|
||||
*
|
||||
* Requires the {@link ngSanitize `ngSanitize`} module to be installed.
|
||||
*
|
||||
* @param {string} text Input text.
|
||||
* @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in.
|
||||
* @param {object|function(url)} [attributes] Add custom attributes to the link element.
|
||||
*
|
||||
* Can be one of:
|
||||
*
|
||||
* - `object`: A map of attributes
|
||||
* - `function`: Takes the url as a parameter and returns a map of attributes
|
||||
*
|
||||
* If the map of attributes contains a value for `target`, it overrides the value of
|
||||
* the target parameter.
|
||||
*
|
||||
*
|
||||
* @returns {string} Html-linkified and {@link $sanitize sanitized} text.
|
||||
*
|
||||
* @usage
|
||||
<span ng-bind-html="linky_expression | linky"></span>
|
||||
*
|
||||
* @example
|
||||
<example module="linkyExample" deps="angular-sanitize.js">
|
||||
<file name="index.html">
|
||||
<div ng-controller="ExampleController">
|
||||
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Filter</th>
|
||||
<th>Source</th>
|
||||
<th>Rendered</th>
|
||||
</tr>
|
||||
<tr id="linky-filter">
|
||||
<td>linky filter</td>
|
||||
<td>
|
||||
<pre><div ng-bind-html="snippet | linky"><br></div></pre>
|
||||
</td>
|
||||
<td>
|
||||
<div ng-bind-html="snippet | linky"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="linky-target">
|
||||
<td>linky target</td>
|
||||
<td>
|
||||
<pre><div ng-bind-html="snippetWithSingleURL | linky:'_blank'"><br></div></pre>
|
||||
</td>
|
||||
<td>
|
||||
<div ng-bind-html="snippetWithSingleURL | linky:'_blank'"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="linky-custom-attributes">
|
||||
<td>linky custom attributes</td>
|
||||
<td>
|
||||
<pre><div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"><br></div></pre>
|
||||
</td>
|
||||
<td>
|
||||
<div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="escaped-html">
|
||||
<td>no filter</td>
|
||||
<td><pre><div ng-bind="snippet"><br></div></pre></td>
|
||||
<td><div ng-bind="snippet"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</file>
|
||||
<file name="script.js">
|
||||
angular.module('linkyExample', ['ngSanitize'])
|
||||
.controller('ExampleController', ['$scope', function($scope) {
|
||||
$scope.snippet =
|
||||
'Pretty text with some links:\n'+
|
||||
'http://angularjs.org/,\n'+
|
||||
'mailto:us@somewhere.org,\n'+
|
||||
'another@somewhere.org,\n'+
|
||||
'and one more: ftp://127.0.0.1/.';
|
||||
$scope.snippetWithSingleURL = 'http://angularjs.org/';
|
||||
}]);
|
||||
</file>
|
||||
<file name="protractor.js" type="protractor">
|
||||
it('should linkify the snippet with urls', function() {
|
||||
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
|
||||
toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
|
||||
'another@somewhere.org, and one more: ftp://127.0.0.1/.');
|
||||
expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
|
||||
});
|
||||
|
||||
it('should not linkify snippet without the linky filter', function() {
|
||||
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
|
||||
toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
|
||||
'another@somewhere.org, and one more: ftp://127.0.0.1/.');
|
||||
expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
|
||||
});
|
||||
|
||||
it('should update', function() {
|
||||
element(by.model('snippet')).clear();
|
||||
element(by.model('snippet')).sendKeys('new http://link.');
|
||||
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
|
||||
toBe('new http://link.');
|
||||
expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
|
||||
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
|
||||
.toBe('new http://link.');
|
||||
});
|
||||
|
||||
it('should work with the target property', function() {
|
||||
expect(element(by.id('linky-target')).
|
||||
element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()).
|
||||
toBe('http://angularjs.org/');
|
||||
expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
|
||||
});
|
||||
|
||||
it('should optionally add custom attributes', function() {
|
||||
expect(element(by.id('linky-custom-attributes')).
|
||||
element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()).
|
||||
toBe('http://angularjs.org/');
|
||||
expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow');
|
||||
});
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
|
||||
var LINKY_URL_REGEXP =
|
||||
/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
|
||||
MAILTO_REGEXP = /^mailto:/i;
|
||||
|
||||
var linkyMinErr = angular.$$minErr('linky');
|
||||
var isString = angular.isString;
|
||||
|
||||
return function(text, target, attributes) {
|
||||
if (text == null || text === '') return text;
|
||||
if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);
|
||||
|
||||
var match;
|
||||
var raw = text;
|
||||
var html = [];
|
||||
var url;
|
||||
var i;
|
||||
while ((match = raw.match(LINKY_URL_REGEXP))) {
|
||||
// We can not end in these as they are sometimes found at the end of the sentence
|
||||
url = match[0];
|
||||
// if we did not match ftp/http/www/mailto then assume mailto
|
||||
if (!match[2] && !match[4]) {
|
||||
url = (match[3] ? 'http://' : 'mailto:') + url;
|
||||
}
|
||||
i = match.index;
|
||||
addText(raw.substr(0, i));
|
||||
addLink(url, match[0].replace(MAILTO_REGEXP, ''));
|
||||
raw = raw.substring(i + match[0].length);
|
||||
}
|
||||
addText(raw);
|
||||
return $sanitize(html.join(''));
|
||||
|
||||
function addText(text) {
|
||||
if (!text) {
|
||||
return;
|
||||
}
|
||||
html.push(sanitizeText(text));
|
||||
}
|
||||
|
||||
function addLink(url, text) {
|
||||
var key;
|
||||
html.push('<a ');
|
||||
if (angular.isFunction(attributes)) {
|
||||
attributes = attributes(url);
|
||||
}
|
||||
if (angular.isObject(attributes)) {
|
||||
for (key in attributes) {
|
||||
html.push(key + '="' + attributes[key] + '" ');
|
||||
}
|
||||
} else {
|
||||
attributes = {};
|
||||
}
|
||||
if (angular.isDefined(target) && !('target' in attributes)) {
|
||||
html.push('target="',
|
||||
target,
|
||||
'" ');
|
||||
}
|
||||
html.push('href="',
|
||||
url.replace(/"/g, '"'),
|
||||
'">');
|
||||
addText(text);
|
||||
html.push('</a>');
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
|
||||
})(window, window.angular);
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
AngularJS v1.5.5
|
||||
(c) 2010-2016 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(n,e){'use strict';function B(a){var c=[];w(c,e.noop).chars(a);return c.join("")}function h(a,c){var b={},d=a.split(","),l;for(l=0;l<d.length;l++)b[c?e.lowercase(d[l]):d[l]]=!0;return b}function C(a,c){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);g.innerHTML=a;var b=5;do{if(0===b)throw x("uinput");b--;n.document.documentMode&&t(g);a=g.innerHTML;g.innerHTML=a}while(a!==g.innerHTML);for(b=g.firstChild;b;){switch(b.nodeType){case 1:c.start(b.nodeName.toLowerCase(),D(b.attributes));
|
||||
break;case 3:c.chars(b.textContent)}var d;if(!(d=b.firstChild)&&(1==b.nodeType&&c.end(b.nodeName.toLowerCase()),d=b.nextSibling,!d))for(;null==d;){b=b.parentNode;if(b===g)break;d=b.nextSibling;1==b.nodeType&&c.end(b.nodeName.toLowerCase())}b=d}for(;b=g.firstChild;)g.removeChild(b)}function D(a){for(var c={},b=0,d=a.length;b<d;b++){var l=a[b];c[l.name]=l.value}return c}function y(a){return a.replace(/&/g,"&").replace(E,function(a){var b=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(b-55296)+
|
||||
(a-56320)+65536)+";"}).replace(F,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function w(a,c){var b=!1,d=e.bind(a,a.push);return{start:function(a,f){a=e.lowercase(a);!b&&G[a]&&(b=a);b||!0!==u[a]||(d("<"),d(a),e.forEach(f,function(b,f){var g=e.lowercase(f),h="img"===a&&"src"===g||"background"===g;!0!==H[g]||!0===z[g]&&!c(b,h)||(d(" "),d(f),d('="'),d(y(b)),d('"'))}),d(">"))},end:function(a){a=e.lowercase(a);b||!0!==u[a]||!0===A[a]||(d("</"),d(a),d(">"));a==
|
||||
b&&(b=!1)},chars:function(a){b||d(y(a))}}}function t(a){if(a.nodeType===n.Node.ELEMENT_NODE)for(var c=a.attributes,b=0,d=c.length;b<d;b++){var e=c[b],f=e.name.toLowerCase();if("xmlns:ns1"===f||0===f.indexOf("ns1:"))a.removeAttributeNode(e),b--,d--}(c=a.firstChild)&&t(c);(c=a.nextSibling)&&t(c)}var x=e.$$minErr("$sanitize"),E=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,F=/([^\#-~ |!])/g,A=h("area,br,col,hr,img,wbr"),q=h("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),k=h("rp,rt"),v=e.extend({},k,q),q=e.extend({},
|
||||
q,h("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),k=e.extend({},k,h("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),I=h("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),
|
||||
G=h("script,style"),u=e.extend({},A,q,k,v),z=h("background,cite,href,longdesc,src,xlink:href"),v=h("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),k=h("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",
|
||||
!0),H=e.extend({},z,k,v),g;(function(a){if(a.document&&a.document.implementation)a=a.document.implementation.createHTMLDocument("inert");else throw x("noinert");var c=(a.documentElement||a.getDocumentElement()).getElementsByTagName("body");1===c.length?g=c[0]:(c=a.createElement("html"),g=a.createElement("body"),c.appendChild(g),a.appendChild(c))})(n);e.module("ngSanitize",[]).provider("$sanitize",function(){var a=!1;this.$get=["$$sanitizeUri",function(c){a&&e.extend(u,I);return function(a){var d=
|
||||
[];C(a,w(d,function(a,b){return!/^unsafe:/.test(c(a,b))}));return d.join("")}}];this.enableSvg=function(c){return e.isDefined(c)?(a=c,this):a}});e.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,b=/^mailto:/i,d=e.$$minErr("linky"),g=e.isString;return function(f,h,m){function k(a){a&&p.push(B(a))}function q(a,b){var c;p.push("<a ");e.isFunction(m)&&(m=m(a));if(e.isObject(m))for(c in m)p.push(c+
|
||||
'="'+m[c]+'" ');else m={};!e.isDefined(h)||"target"in m||p.push('target="',h,'" ');p.push('href="',a.replace(/"/g,"""),'">');k(b);p.push("</a>")}if(null==f||""===f)return f;if(!g(f))throw d("notstring",f);for(var r=f,p=[],s,n;f=r.match(c);)s=f[0],f[2]||f[4]||(s=(f[3]?"http://":"mailto:")+s),n=f.index,k(r.substr(0,n)),q(s,f[0].replace(b,"")),r=r.substring(n+f[0].length);k(r);return a(p.join(""))}}])})(window,window.angular);
|
||||
//# sourceMappingURL=angular-sanitize.min.js.map
|
File diff suppressed because one or more lines are too long
10
js/vendor/angular-sanitize/bower.json
vendored
10
js/vendor/angular-sanitize/bower.json
vendored
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name": "angular-sanitize",
|
||||
"version": "1.5.5",
|
||||
"license": "MIT",
|
||||
"main": "./angular-sanitize.js",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"angular": "1.5.5"
|
||||
}
|
||||
}
|
2
js/vendor/angular-sanitize/index.js
vendored
2
js/vendor/angular-sanitize/index.js
vendored
|
@ -1,2 +0,0 @@
|
|||
require('./angular-sanitize');
|
||||
module.exports = 'ngSanitize';
|
26
js/vendor/angular-sanitize/package.json
vendored
26
js/vendor/angular-sanitize/package.json
vendored
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
"name": "angular-sanitize",
|
||||
"version": "1.5.5",
|
||||
"description": "AngularJS module for sanitizing HTML",
|
||||
"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",
|
||||
"html",
|
||||
"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"
|
||||
}
|
64
js/vendor/angular/README.md
vendored
64
js/vendor/angular/README.md
vendored
|
@ -1,64 +0,0 @@
|
|||
# packaged angular
|
||||
|
||||
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).
|
||||
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
|
||||
```
|
||||
|
||||
Then add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/node_modules/angular/angular.js"></script>
|
||||
```
|
||||
|
||||
Or `require('angular')` from your code.
|
||||
|
||||
### bower
|
||||
|
||||
```shell
|
||||
bower install angular
|
||||
```
|
||||
|
||||
Then add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/bower_components/angular/angular.js"></script>
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is available on the
|
||||
[AngularJS docs site](http://docs.angularjs.org/).
|
||||
|
||||
## 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.
|
21
js/vendor/angular/angular-csp.css
vendored
21
js/vendor/angular/angular-csp.css
vendored
|
@ -1,21 +0,0 @@
|
|||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
@charset "UTF-8";
|
||||
|
||||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
|
||||
.ng-cloak, .x-ng-cloak,
|
||||
.ng-hide:not(.ng-hide-animate) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
ng\:form {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ng-animate-shim {
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
.ng-anchor {
|
||||
position:absolute;
|
||||
}
|
30868
js/vendor/angular/angular.js
vendored
30868
js/vendor/angular/angular.js
vendored
File diff suppressed because it is too large
Load diff
314
js/vendor/angular/angular.min.js
vendored
314
js/vendor/angular/angular.min.js
vendored
|
@ -1,314 +0,0 @@
|
|||
/*
|
||||
AngularJS v1.5.5
|
||||
(c) 2010-2016 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(v){'use strict';function O(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.5/"+(a?a+"/":"")+b;for(b=1;b<arguments.length;b++){d=d+(1==b?"?":"&")+"p"+(b-1)+"=";var c=encodeURIComponent,e;e=arguments[b];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;d+=c(e)}return Error(d)}}function ya(a){if(null==a||Va(a))return!1;if(K(a)||F(a)||B&&a instanceof B)return!0;
|
||||
var b="length"in Object(a)&&a.length;return Q(b)&&(0<=b&&(b-1 in a||a instanceof Array)||"function"==typeof a.item)}function q(a,b,d){var c,e;if(a)if(E(a))for(c in a)"prototype"==c||"length"==c||"name"==c||a.hasOwnProperty&&!a.hasOwnProperty(c)||b.call(d,a[c],c,a);else if(K(a)||ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==q)a.forEach(b,d,a);else if(oc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&
|
||||
b.call(d,a[c],c,a);else for(c in a)ua.call(a,c)&&b.call(d,a[c],c,a);return a}function pc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function qc(a){return function(b,d){a(d,b)}}function Xd(){return++nb}function Nb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(G(g)||E(g))for(var h=Object.keys(g),k=0,l=h.length;k<l;k++){var n=h[k],m=g[n];d&&G(m)?fa(m)?a[n]=new Date(m.valueOf()):Wa(m)?a[n]=new RegExp(m):m.nodeName?a[n]=m.cloneNode(!0):
|
||||
Ob(m)?a[n]=m.clone():(G(a[n])||(a[n]=K(m)?[]:{}),Nb(a[n],[m],!0)):a[n]=m}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function R(a){return Nb(a,za.call(arguments,1),!1)}function Yd(a){return Nb(a,za.call(arguments,1),!0)}function X(a){return parseInt(a,10)}function Pb(a,b){return R(Object.create(a),b)}function C(){}function Xa(a){return a}function da(a){return function(){return a}}function rc(a){return E(a.toString)&&a.toString!==ma}function y(a){return"undefined"===typeof a}function x(a){return"undefined"!==
|
||||
typeof a}function G(a){return null!==a&&"object"===typeof a}function oc(a){return null!==a&&"object"===typeof a&&!sc(a)}function F(a){return"string"===typeof a}function Q(a){return"number"===typeof a}function fa(a){return"[object Date]"===ma.call(a)}function E(a){return"function"===typeof a}function Wa(a){return"[object RegExp]"===ma.call(a)}function Va(a){return a&&a.window===a}function Ya(a){return a&&a.$evalAsync&&a.$watch}function Da(a){return"boolean"===typeof a}function Zd(a){return a&&Q(a.length)&&
|
||||
$d.test(ma.call(a))}function Ob(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function ae(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function va(a){return P(a.nodeName||a[0]&&a[0].nodeName)}function Za(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function qa(a,b){function d(a,b){var d=b.$$hashKey,e;if(K(a)){e=0;for(var f=a.length;e<f;e++)b.push(c(a[e]))}else if(oc(a))for(e in a)b[e]=c(a[e]);else if(a&&"function"===typeof a.hasOwnProperty)for(e in a)a.hasOwnProperty(e)&&
|
||||
(b[e]=c(a[e]));else for(e in a)ua.call(a,e)&&(b[e]=c(a[e]));d?b.$$hashKey=d:delete b.$$hashKey;return b}function c(a){if(!G(a))return a;var b=f.indexOf(a);if(-1!==b)return g[b];if(Va(a)||Ya(a))throw Aa("cpws");var b=!1,c=e(a);void 0===c&&(c=K(a)?[]:Object.create(sc(a)),b=!0);f.push(a);g.push(c);return b?d(a,c):c}function e(a){switch(ma.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(c(a.buffer));
|
||||
case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(E(a.cloneNode))return a.cloneNode(!0)}var f=[],
|
||||
g=[];if(b){if(Zd(b)||"[object ArrayBuffer]"===ma.call(b))throw Aa("cpta");if(a===b)throw Aa("cpi");K(b)?b.length=0:q(b,function(a,d){"$$hashKey"!==d&&delete b[d]});f.push(a);g.push(b);return d(a,b)}return c(a)}function ha(a,b){if(K(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(G(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function pa(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d==typeof b&&
|
||||
"object"==d)if(K(a)){if(!K(b))return!1;if((d=a.length)==b.length){for(c=0;c<d;c++)if(!pa(a[c],b[c]))return!1;return!0}}else{if(fa(a))return fa(b)?pa(a.getTime(),b.getTime()):!1;if(Wa(a))return Wa(b)?a.toString()==b.toString():!1;if(Ya(a)||Ya(b)||Va(a)||Va(b)||K(b)||fa(b)||Wa(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!E(a[c])){if(!pa(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&x(b[c])&&!E(b[c]))return!1;return!0}return!1}function $a(a,b,d){return a.concat(za.call(b,
|
||||
d))}function tc(a,b){var d=2<arguments.length?za.call(arguments,2):[];return!E(b)||b instanceof RegExp?b:d.length?function(){return arguments.length?b.apply(a,$a(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function be(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:Va(b)?d="$WINDOW":b&&v.document===b?d="$DOCUMENT":Ya(b)&&(d="$SCOPE");return d}function ab(a,b){if(!y(a))return Q(b)||(b=b?2:null),JSON.stringify(a,be,
|
||||
b)}function uc(a){return F(a)?JSON.parse(a):a}function vc(a,b){a=a.replace(ce,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+a)/6E4;return isNaN(d)?b:d}function Qb(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=vc(b,c);d*=b-c;a=new Date(a.getTime());a.setMinutes(a.getMinutes()+d);return a}function wa(a){a=B(a).clone();try{a.empty()}catch(b){}var d=B("<div>").append(a).html();try{return a[0].nodeType===Ma?P(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+P(b)})}catch(c){return P(d)}}
|
||||
function wc(a){try{return decodeURIComponent(a)}catch(b){}}function xc(a){var b={};q((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=wc(e),x(e)&&(f=x(f)?wc(f):!0,ua.call(b,e)?K(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Rb(a){var b=[];q(a,function(a,c){K(a)?q(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}
|
||||
function ob(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function de(a,b){var d,c,e=Na.length;for(c=0;c<e;++c)if(d=Na[c]+b,F(d=a.getAttribute(d)))return d;return null}function ee(a,b){var d,c,e={};q(Na,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});
|
||||
q(Na,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});d&&(e.strictDi=null!==de(d,"strict-di"),b(d,c?[c]:[],e))}function yc(a,b,d){G(d)||(d={});d=R({strictDi:!1},d);var c=function(){a=B(a);if(a.injector()){var c=a[0]===v.document?"document":wa(a);throw Aa("btstrpd",c.replace(/</,"<").replace(/>/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);
|
||||
b.unshift("ng");c=bb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;v&&e.test(v.name)&&(d.debugInfoEnabled=!0,v.name=v.name.replace(e,""));if(v&&!f.test(v.name))return c();v.name=v.name.replace(f,"");ea.resumeBootstrap=function(a){q(a,function(a){b.push(a)});return c()};E(ea.resumeDeferredBootstrap)&&ea.resumeDeferredBootstrap()}function fe(){v.name=
|
||||
"NG_ENABLE_DEBUG_INFO!"+v.name;v.location.reload()}function ge(a){a=ea.element(a).injector();if(!a)throw Aa("test");return a.get("$$testability")}function zc(a,b){b=b||"_";return a.replace(he,function(a,c){return(c?b:"")+a.toLowerCase()})}function ie(){var a;if(!Ac){var b=pb();(Z=y(b)?v.jQuery:b?v[b]:void 0)&&Z.fn.on?(B=Z,R(Z.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),a=Z.cleanData,Z.cleanData=function(b){for(var c,
|
||||
e=0,f;null!=(f=b[e]);e++)(c=Z._data(f,"events"))&&c.$destroy&&Z(f).triggerHandler("$destroy");a(b)}):B=U;ea.element=B;Ac=!0}}function qb(a,b,d){if(!a)throw Aa("areq",b||"?",d||"required");return a}function Pa(a,b,d){d&&K(a)&&(a=a[a.length-1]);qb(E(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Qa(a,b){if("hasOwnProperty"===a)throw Aa("badname",b);}function Bc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g<f;g++)c=
|
||||
b[g],a&&(a=(e=a)[c]);return!d&&E(a)?tc(e,a):a}function rb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=B(za.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function je(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=O("$injector"),c=O("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||O;return b(a,"module",function(){var a={};return function(f,g,h){if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&
|
||||
(a[f]=null);return b(a,f,function(){function a(b,d,e,f){f||(f=c);return function(){f[e||"push"]([b,d,arguments]);return M}}function b(a,d){return function(b,e){e&&E(e)&&(e.$$moduleName=f);c.push([a,d,arguments]);return M}}if(!g)throw d("nomod",f);var c=[],e=[],r=[],N=a("$injector","invoke","push",e),M={_invokeQueue:c,_configBlocks:e,_runBlocks:r,requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide",
|
||||
"constant","unshift"),decorator:b("$provide","decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:N,run:function(a){r.push(a);return this}};h&&N(h);return M})}})}function ke(a){R(a,{bootstrap:yc,copy:qa,extend:R,merge:Yd,equals:pa,element:B,forEach:q,injector:bb,noop:C,bind:tc,toJson:ab,fromJson:uc,identity:Xa,isUndefined:y,
|
||||
isDefined:x,isString:F,isFunction:E,isObject:G,isNumber:Q,isElement:Ob,isArray:K,version:le,isDate:fa,lowercase:P,uppercase:sb,callbacks:{counter:0},getTestability:ge,$$minErr:O,$$csp:Ea,reloadWithDebugInfo:fe});Sb=je(v);Sb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:me});a.provider("$compile",Cc).directive({a:ne,input:Dc,textarea:Dc,form:oe,script:pe,select:qe,style:re,option:se,ngBind:te,ngBindHtml:ue,ngBindTemplate:ve,ngClass:we,ngClassEven:xe,ngClassOdd:ye,ngCloak:ze,ngController:Ae,
|
||||
ngForm:Be,ngHide:Ce,ngIf:De,ngInclude:Ee,ngInit:Fe,ngNonBindable:Ge,ngPluralize:He,ngRepeat:Ie,ngShow:Je,ngStyle:Ke,ngSwitch:Le,ngSwitchWhen:Me,ngSwitchDefault:Ne,ngOptions:Oe,ngTransclude:Pe,ngModel:Qe,ngList:Re,ngChange:Se,pattern:Ec,ngPattern:Ec,required:Fc,ngRequired:Fc,minlength:Gc,ngMinlength:Gc,maxlength:Hc,ngMaxlength:Hc,ngValue:Te,ngModelOptions:Ue}).directive({ngInclude:Ve}).directive(tb).directive(Ic);a.provider({$anchorScroll:We,$animate:Xe,$animateCss:Ye,$$animateJs:Ze,$$animateQueue:$e,
|
||||
$$AnimateRunner:af,$$animateAsyncRun:bf,$browser:cf,$cacheFactory:df,$controller:ef,$document:ff,$exceptionHandler:gf,$filter:Jc,$$forceReflow:hf,$interpolate:jf,$interval:kf,$http:lf,$httpParamSerializer:mf,$httpParamSerializerJQLike:nf,$httpBackend:of,$xhrFactory:pf,$location:qf,$log:rf,$parse:sf,$rootScope:tf,$q:uf,$$q:vf,$sce:wf,$sceDelegate:xf,$sniffer:yf,$templateCache:zf,$templateRequest:Af,$$testability:Bf,$timeout:Cf,$window:Df,$$rAF:Ef,$$jqLite:Ff,$$HashMap:Gf,$$cookieReader:Hf})}])}function cb(a){return a.replace(If,
|
||||
function(a,d,c,e){return e?c.toUpperCase():c}).replace(Jf,"Moz$1")}function Kc(a){a=a.nodeType;return 1===a||!a||9===a}function Lc(a,b){var d,c,e=b.createDocumentFragment(),f=[];if(Tb.test(a)){d=d||e.appendChild(b.createElement("div"));c=(Kf.exec(a)||["",""])[1].toLowerCase();c=ia[c]||ia._default;d.innerHTML=c[1]+a.replace(Lf,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=$a(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";q(f,function(a){e.appendChild(a)});
|
||||
return e}function Mc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a);b.appendChild(a)}function U(a){if(a instanceof U)return a;var b;F(a)&&(a=V(a),b=!0);if(!(this instanceof U)){if(b&&"<"!=a.charAt(0))throw Ub("nosel");return new U(a)}if(b){b=v.document;var d;a=(d=Mf.exec(a))?[b.createElement(d[1])]:(d=Lc(a,b))?d.childNodes:[]}Nc(this,a)}function Vb(a){return a.cloneNode(!0)}function ub(a,b){b||db(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c<e;c++)db(d[c])}function Oc(a,
|
||||
b,d,c){if(x(c))throw Ub("offargs");var e=(c=vb(a))&&c.events,f=c&&c.handle;if(f)if(b){var g=function(b){var c=e[b];x(d)&&Za(c||[],d);x(d)&&c&&0<c.length||(a.removeEventListener(b,f,!1),delete e[b])};q(b.split(" "),function(a){g(a);wb[a]&&g(wb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f,!1),delete e[b]}function db(a,b){var d=a.ng339,c=d&&eb[d];c&&(b?delete c.data[b]:(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),Oc(a)),delete eb[d],a.ng339=void 0))}function vb(a,b){var d=
|
||||
a.ng339,d=d&&eb[d];b&&!d&&(a.ng339=d=++Nf,d=eb[d]={events:{},data:{},handle:void 0});return d}function Wb(a,b,d){if(Kc(a)){var c=x(d),e=!c&&b&&!G(b),f=!b;a=(a=vb(a,!e))&&a.data;if(c)a[b]=d;else{if(f)return a;if(e)return a&&a[b];R(a,b)}}}function xb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function yb(a,b){b&&a.setAttribute&&q(b.split(" "),function(b){a.setAttribute("class",V((" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
|
||||
" ").replace(" "+V(b)+" "," ")))})}function zb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");q(b.split(" "),function(a){a=V(a);-1===d.indexOf(" "+a+" ")&&(d+=a+" ")});a.setAttribute("class",V(d))}}function Nc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function Pc(a,b){return Ab(a,"$"+(b||"ngController")+"Controller")}function Ab(a,
|
||||
b,d){9==a.nodeType&&(a=a.documentElement);for(b=K(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(x(d=B.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function Qc(a){for(ub(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Bb(a,b){b||ub(a);var d=a.parentNode;d&&d.removeChild(a)}function Of(a,b){b=b||v;if("complete"===b.document.readyState)b.setTimeout(a);else B(b).on("load",a)}function Rc(a,b){var d=Cb[b.toLowerCase()];return d&&Sc[va(a)]&&d}function Pf(a,b){var d=function(c,
|
||||
d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(y(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var k=f.specialHandlerWrapper||Qf;1<g&&(f=ha(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||k(a,c,f[l])}};d.elem=
|
||||
a;return d}function Qf(a,b,d){d.call(a,b)}function Rf(a,b,d){var c=b.relatedTarget;c&&(c===a||Sf.call(a,c))||d.call(a,b)}function Ff(){this.$get=function(){return R(U,{hasClass:function(a,b){a.attr&&(a=a[0]);return xb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return zb(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return yb(a,b)}})}}function Fa(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"==d||"object"==d&&null!==a?a.$$hashKey=
|
||||
d+":"+(b||Xd)():d+":"+a}function Ra(a,b){if(b){var d=0;this.nextUid=function(){return++d}}q(a,this.put,this)}function Tc(a){a=Function.prototype.toString.call(a).replace(Tf,"");return a.match(Uf)||a.match(Vf)}function Wf(a){return(a=Tc(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function bb(a,b){function d(a){return function(b,c){if(G(b))q(b,qc(a));else return a(b,c)}}function c(a,b){Qa(a,"service");if(E(b)||K(b))b=r.instantiate(b);if(!b.$get)throw Ga("pget",a);return m[a+"Provider"]=
|
||||
b}function e(a,b){return function(){var c=w.invoke(b,this);if(y(c))throw Ga("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){qb(y(a)||K(a),"modulesToLoad","not an array");var b=[],c;q(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=r.get(e[0]);f[e[1]].apply(f,e[2])}}if(!n.get(a)){n.put(a,!0);try{F(a)?(c=Sb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):E(a)?b.push(r.invoke(a)):K(a)?b.push(r.invoke(a)):
|
||||
Pa(a,"module")}catch(e){throw K(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||e);}}});return b}function h(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===k)throw Ga("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=k,a[b]=c(b,e)}catch(f){throw a[b]===k&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=bb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];
|
||||
if("string"!==typeof l)throw Ga("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);K(a)&&(a=a[a.length-1]);d=11>=Ca?!1:"function"===typeof a&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(a));return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=K(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,
|
||||
a))},get:d,annotate:bb.$$annotate,has:function(b){return m.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],n=new Ra([],!0),m={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,da(b),!1)}),constant:d(function(a,b){Qa(a,"constant");m[a]=b;N[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=w.invoke(d,c);return w.invoke(b,null,
|
||||
{$delegate:a})}}}},r=m.$injector=h(m,function(a,b){ea.isString(b)&&l.push(b);throw Ga("unpr",l.join(" <- "));}),N={},M=h(N,function(a,b){var c=r.get(a+"Provider",b);return w.invoke(c.$get,c,void 0,a)}),w=M;m.$injectorProvider={$get:da(M)};var p=g(a),w=M.get("$injector");w.strictDi=b;q(p,function(a){a&&w.invoke(a)});return w}function We(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,
|
||||
function(a){if("a"===va(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;E(c)?c=c():Ob(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):Q(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=F(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===
|
||||
b&&""===a||Of(function(){c.$evalAsync(g)})});return g}]}function fb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;K(a)&&(a=a.join(" "));K(b)&&(b=b.join(" "));return a+" "+b}function Xf(a){F(a)&&(a=a.split(" "));var b=T();q(a,function(a){a.length&&(b[a]=!0)});return b}function Ha(a){return G(a)?a:{}}function Yf(a,b,d,c){function e(a){try{a.apply(null,za.call(arguments,1))}finally{if(M--,0===M)for(;w.length;)try{w.pop()()}catch(b){d.error(b)}}}function f(){u=null;g();h()}function g(){p=I();
|
||||
p=y(p)?null:p;pa(p,L)&&(p=L);L=p}function h(){if(t!==k.url()||H!==p)t=k.url(),H=p,q(J,function(a){a(k.url(),p)})}var k=this,l=a.location,n=a.history,m=a.setTimeout,r=a.clearTimeout,N={};k.isMock=!1;var M=0,w=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){M++};k.notifyWhenNoOutstandingRequests=function(a){0===M?a():w.push(a)};var p,H,t=l.href,z=b.find("base"),u=null,I=c.history?function(){try{return n.state}catch(a){}}:C;g();H=p;k.url=function(b,d,e){y(e)&&(e=null);l!==
|
||||
a.location&&(l=a.location);n!==a.history&&(n=a.history);if(b){var f=H===e;if(t===b&&(!c.history||f))return k;var h=t&&Ia(t)===Ia(b);t=b;H=e;if(!c.history||h&&f){if(!h||u)u=b;d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b;l.href!==b&&(u=b)}else n[d?"replaceState":"pushState"](e,"",b),g(),H=p;return k}return u||l.href.replace(/%27/g,"'")};k.state=function(){return p};var J=[],D=!1,L=null;k.onUrlChange=function(b){if(!D){if(c.history)B(a).on("popstate",f);B(a).on("hashchange",
|
||||
f);D=!0}J.push(b);return b};k.$$applicationDestroyed=function(){B(a).off("hashchange popstate",f)};k.$$checkUrlChange=h;k.baseHref=function(){var a=z.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};k.defer=function(a,b){var c;M++;c=m(function(){delete N[c];e(a)},b||0);N[c]=!0;return c};k.defer.cancel=function(a){return N[a]?(delete N[a],r(a),e(C),!0):!1}}function cf(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new Yf(a,c,b,d)}]}function df(){this.$get=
|
||||
function(){function a(a,c){function e(a){a!=m&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,m),m=a,m.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw O("$cacheFactory")("iid",a);var g=0,h=R({},c,{id:a}),k=T(),l=c&&c.capacity||Number.MAX_VALUE,n=T(),m=null,r=null;return b[a]={put:function(a,b){if(!y(b)){if(l<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in k||g++;k[a]=b;g>l&&this.remove(r.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return k[a]},
|
||||
remove:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;b==m&&(m=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}a in k&&(delete k[a],g--)},removeAll:function(){k=T();g=0;n=T();m=r=null},destroy:function(){n=h=k=null;delete b[a]},info:function(){return R({},h,{size:g})}}}var b={};a.info=function(){var a={};q(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function zf(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Cc(a,b){function d(a,
|
||||
b,c){var d=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,e=T();q(a,function(a,f){if(a in n)e[f]=n[a];else{var g=a.match(d);if(!g)throw ga("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(n[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==P(b))throw ga("baddir",a);if(a!==a.trim())throw ga("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,g=/(([\w\-]+)(?:\:([^;]+))?;?)/,
|
||||
h=ae("ngSrc,ngSrcset,src,srcset"),k=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,l=/^(on[a-z]+|formaction)$/,n=T();this.directive=function M(b,d){Qa(b,"directive");F(b)?(c(b),qb(d,"directiveFactory"),e.hasOwnProperty(b)||(e[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];q(e[b],function(e,f){try{var g=a.invoke(e);E(g)?g={compile:da(g)}:!g.compile&&g.link&&(g.compile=da(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||b;g.require=g.require||g.controller&&g.name;g.restrict=
|
||||
g.restrict||"EA";g.$$moduleName=e.$$moduleName;d.push(g)}catch(h){c(h)}});return d}])),e[b].push(d)):q(b,qc(M));return this};this.component=function(a,b){function c(a){function e(b){return E(b)||K(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Uc(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
|
||||
require:b.require};q(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}var d=b.controller||function(){};q(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,E(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return x(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};var m=!0;this.debugInfoEnabled=
|
||||
function(a){return x(a)?(m=a,this):m};var r=10;this.onChangesTtl=function(a){return arguments.length?(r=a,this):r};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(a,b,c,n,t,z,u,I,J,D){function L(){try{if(!--qa)throw Z=void 0,ga("infchng",r);u.$apply(function(){for(var a=0,b=Z.length;a<b;++a)Z[a]();Z=void 0})}finally{qa++}}function S(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<
|
||||
e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function $(a,b,c){na.innerHTML="<span "+b+">";b=na.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function A(a,b){try{a.addClass(b)}catch(c){}}function ba(a,b,c,d,e){a instanceof B||(a=B(a));for(var f=/\S+/,g=0,h=a.length;g<h;g++){var k=a[g];k.nodeType===Ma&&k.nodeValue.match(f)&&Mc(k,a[g]=v.document.createElement("span"))}var l=s(a,b,a,c,d,e);ba.$$addScopeClass(a);var m=null;return function(b,
|
||||
c,d){qb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var f=d.parentBoundTranscludeFn,g=d.transcludeControllers;d=d.futureParentElement;f&&f.$$boundTransclude&&(f=f.$$boundTransclude);m||(m=(d=d&&d[0])?"foreignobject"!==va(d)&&ma.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==m?B(ca(m,B("<div>").append(a).html())):c?Oa.clone.call(a):a;if(g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);ba.$$addScopeInfo(d,b);c&&c(d,b);l&&l(b,d,d,f);return d}}function s(a,b,c,d,e,f){function g(a,
|
||||
c,d,e){var f,k,l,m,n,t,p;if(r)for(p=Array(c.length),m=0;m<h.length;m+=3)f=h[m],p[f]=c[f];else p=c;m=0;for(n=h.length;m<n;)k=p[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),ba.$$addScopeInfo(B(k),l)):l=a,t=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,t)):f&&f(a,k.childNodes,void 0,e)}for(var h=[],k,l,m,n,r,t=0;t<a.length;t++){k=new S;l=x(a[t],[],k,0===t?d:void 0,e);(f=l.length?Ba(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&ba.$$addScopeClass(k.$$element);
|
||||
k=f&&f.terminal||!(m=a[t].childNodes)||!m.length?null:s(m,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(t,f,k),n=!0,r=r||f;f=null}return n?g:null}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function x(a,b,c,d,e){var h=c.$attr,k;switch(a.nodeType){case 1:la(b,
|
||||
xa(va(a)),"E",d,e);for(var l,m,n,t=a.attributes,r=0,p=t&&t.length;r<p;r++){var I=!1,D=!1;l=t[r];k=l.name;m=V(l.value);l=xa(k);if(n=ya.test(l))k=k.replace(Vc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});(l=l.match(Aa))&&Q(l[1])&&(I=k,D=k.substr(0,k.length-5)+"end",k=k.substr(0,k.length-6));l=xa(k.toLowerCase());h[l]=k;if(n||!c.hasOwnProperty(l))c[l]=m,Rc(a,l)&&(c[l]=!0);fa(a,b,m,l,n);la(b,l,"A",d,e,I,D)}a=a.className;G(a)&&(a=a.animVal);if(F(a)&&""!==a)for(;k=g.exec(a);)l=xa(k[2]),
|
||||
la(b,l,"C",d,e)&&(c[l]=V(k[3])),a=a.substr(k.index+k[0].length);break;case Ma:if(11===Ca)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Ma;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);X(b,a.nodeValue);break;case 8:try{if(k=f.exec(a.nodeValue))l=xa(k[1]),la(b,l,"M",d,e)&&(c[l]=V(k[2]))}catch(J){}}b.sort(Y);return b}function Wc(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ga("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&
|
||||
e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function Xc(a,b,c){return function(d,e,f,g,h){e=Wc(e[0],b,c);return a(d,e,f,g,h)}}function Yb(a,b,c,d,e,f){var g;return a?ba(b,c,d,e,f):function(){g||(g=ba(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function Ba(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=Xc(a,c,d));a.require=A.require;a.directiveName=M;if(D===A||A.$$isolateScope)a=ha(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Xc(b,c,d));
|
||||
b.require=A.require;b.directiveName=M;if(D===A||A.$$isolateScope)b=ha(b,{isolateScope:!0});k.push(b)}}function n(a,c,e,f,g){function l(a,b,c,d){var e;Ya(a)||(d=c,c=b,b=a,a=void 0);H&&(e=u);c||(c=H?z.parent():z);if(d){var f=g.$$slots[d];if(f)return f(a,b,e,c,$);if(y(f))throw ga("noslot",d,wa(z));}else return g(a,b,e,c,$)}var m,t,p,A,w,u,L,z;b===e?(f=d,z=d.$$element):(z=B(e),f=new S(z,d));w=c;D?A=c.$new(!0):r&&(w=c.$parent);g&&(L=l,L.$$boundTransclude=g,L.isSlotFilled=function(a){return!!g.$$slots[a]});
|
||||
I&&(u=O(z,f,L,I,A,c,D));D&&(ba.$$addScopeInfo(z,A,!0,!(J&&(J===D||J===D.$$originalDirective))),ba.$$addScopeClass(z,!0),A.$$isolateBindings=D.$$isolateBindings,t=ia(c,f,A,A.$$isolateBindings,D),t.removeWatches&&A.$on("$destroy",t.removeWatches));for(m in u){t=I[m];p=u[m];var Xb=t.$$bindings.bindToController;p.bindingInfo=p.identifier&&Xb?ia(w,f,p.instance,Xb,t):{};var M=p();M!==p.instance&&(p.instance=M,z.data("$"+t.name+"Controller",M),p.bindingInfo.removeWatches&&p.bindingInfo.removeWatches(),p.bindingInfo=
|
||||
ia(w,f,p.instance,Xb,t))}q(I,function(a,b){var c=a.require;a.bindToController&&!K(c)&&G(c)&&R(u[b].instance,gb(b,c,z,u))});q(u,function(a){var b=a.instance;E(b.$onChanges)&&b.$onChanges(a.bindingInfo.initialChanges);E(b.$onInit)&&b.$onInit();E(b.$onDestroy)&&w.$on("$destroy",function(){b.$onDestroy()})});m=0;for(t=h.length;m<t;m++)p=h[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);var $=c;D&&(D.template||null===D.templateUrl)&&($=A);a&&a($,e.childNodes,void 0,g);for(m=
|
||||
k.length-1;0<=m;m--)p=k[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);q(u,function(a){a=a.instance;E(a.$postLink)&&a.$postLink()})}l=l||{};for(var t=-Number.MAX_VALUE,r=l.newScopeDirective,I=l.controllerDirectives,D=l.newIsolateScopeDirective,J=l.templateDirective,w=l.nonTlbTranscludeDirective,u=!1,L=!1,H=l.hasElementTranscludeDirective,z=d.$$element=B(b),A,M,$,s=e,Sa,ka=!1,C=!1,v,F=0,Ba=a.length;F<Ba;F++){A=a[F];var P=A.$$start,Q=A.$$end;P&&(z=Wc(b,P,Q));$=void 0;
|
||||
if(t>A.priority)break;if(v=A.scope)A.templateUrl||(G(v)?(W("new/isolated scope",D||r,A,z),D=A):W("new/isolated scope",D,A,z)),r=r||A;M=A.name;if(!ka&&(A.replace&&(A.templateUrl||A.template)||A.transclude&&!A.$$tlb)){for(v=F+1;ka=a[v++];)if(ka.transclude&&!ka.$$tlb||ka.replace&&(ka.templateUrl||ka.template)){C=!0;break}ka=!0}!A.templateUrl&&A.controller&&(v=A.controller,I=I||T(),W("'"+M+"' controller",I[M],A,z),I[M]=A);if(v=A.transclude)if(u=!0,A.$$tlb||(W("transclusion",w,A,z),w=A),"element"==v)H=
|
||||
!0,t=A.priority,$=z,z=d.$$element=B(ba.$$createComment(M,d[M])),b=z[0],da(f,za.call($,0),b),$[0].$$parentNode=$[0].parentNode,s=Yb(C,$,e,t,g&&g.name,{nonTlbTranscludeDirective:w});else{var la=T();$=B(Vb(b)).contents();if(G(v)){$=[];var Y=T(),X=T();q(v,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Y[a]=b;la[b]=null;X[b]=c});q(z.contents(),function(a){var b=Y[xa(va(a))];b?(X[b]=!0,la[b]=la[b]||[],la[b].push(a)):$.push(a)});q(X,function(a,b){if(!a)throw ga("reqslot",b);});for(var Z in la)la[Z]&&
|
||||
(la[Z]=Yb(C,la[Z],e))}z.empty();s=Yb(C,$,e,void 0,void 0,{needsNewScope:A.$$isolateScope||A.$$newScope});s.$$slots=la}if(A.template)if(L=!0,W("template",J,A,z),J=A,v=E(A.template)?A.template(z,d):A.template,v=ta(v),A.replace){g=A;$=Tb.test(v)?Yc(ca(A.templateNamespace,V(v))):[];b=$[0];if(1!=$.length||1!==b.nodeType)throw ga("tplrt",M,"");da(f,z,b);Ba={$attr:{}};v=x(b,[],Ba);var ea=a.splice(F+1,a.length-(F+1));(D||r)&&Zc(v,D,r);a=a.concat(v).concat(ea);U(d,Ba);Ba=a.length}else z.html(v);if(A.templateUrl)L=
|
||||
!0,W("template",J,A,z),J=A,A.replace&&(g=A),n=aa(a.splice(F,a.length-F),z,d,f,u&&s,h,k,{controllerDirectives:I,newScopeDirective:r!==A&&r,newIsolateScopeDirective:D,templateDirective:J,nonTlbTranscludeDirective:w}),Ba=a.length;else if(A.compile)try{Sa=A.compile(z,d,s),E(Sa)?m(null,Sa,P,Q):Sa&&m(Sa.pre,Sa.post,P,Q)}catch(fa){c(fa,wa(z))}A.terminal&&(n.terminal=!0,t=Math.max(t,A.priority))}n.scope=r&&!0===r.scope;n.transcludeOnThisElement=u;n.templateOnThisElement=L;n.transclude=s;l.hasElementTranscludeDirective=
|
||||
H;return n}function gb(a,b,c,d){var e;if(F(b)){var f=b.match(k);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw ga("ctreq",b,a);}else if(K(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=gb(a,b[g],c,d);else G(b)&&(e={},q(b,function(b,f){e[f]=gb(a,b,c,d)}));return e||null}function O(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,
|
||||
$element:a,$attrs:b,$transclude:c},n=l.controller;"@"==n&&(n=b[l.name]);m=z(n,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function Zc(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=Pb(a[d],{$$isolateScope:b,$$newScope:c})}function la(b,f,g,h,k,l,m){if(f===k)return null;k=null;if(e.hasOwnProperty(f)){var n;f=a.get(f+"Directive");for(var t=0,r=f.length;t<r;t++)try{if(n=f[t],(y(h)||h>n.priority)&&-1!=n.restrict.indexOf(g)){l&&(n=Pb(n,{$$start:l,$$end:m}));if(!n.$$bindings){var I=
|
||||
n,D=n,A=n.name,J={isolateScope:null,bindToController:null};G(D.scope)&&(!0===D.bindToController?(J.bindToController=d(D.scope,A,!0),J.isolateScope={}):J.isolateScope=d(D.scope,A,!1));G(D.bindToController)&&(J.bindToController=d(D.bindToController,A,!0));if(G(J.bindToController)){var w=D.controller,z=D.controllerAs;if(!w)throw ga("noctrl",A);if(!Uc(w,z))throw ga("noident",A);}var u=I.$$bindings=J;G(u.isolateScope)&&(n.$$isolateBindings=u.isolateScope)}b.push(n);k=n}}catch(L){c(L)}}return k}function Q(b){if(e.hasOwnProperty(b))for(var c=
|
||||
a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function U(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,f){"class"==f?(A(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function aa(a,b,c,d,e,f,
|
||||
g,h){var k=[],l,m,t=b[0],p=a.shift(),r=Pb(p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),I=E(p.templateUrl)?p.templateUrl(b,c):p.templateUrl,D=p.templateNamespace;b.empty();n(I).then(function(n){var J,w;n=ta(n);if(p.replace){n=Tb.test(n)?Yc(ca(D,V(n))):[];J=n[0];if(1!=n.length||1!==J.nodeType)throw ga("tplrt",p.name,I);n={$attr:{}};da(d,b,J);var z=x(J,[],n);G(p.scope)&&Zc(z,!0);a=z.concat(a);U(c,n)}else J=t,b.html(n);a.unshift(r);l=Ba(a,J,c,e,b,p,f,g,h);q(d,function(a,c){a==
|
||||
J&&(d[c]=b[0])});for(m=s(b[0].childNodes,e);k.length;){n=k.shift();w=k.shift();var u=k.shift(),L=k.shift(),z=b[0];if(!n.$$destroyed){if(w!==t){var S=w.className;h.hasElementTranscludeDirective&&p.replace||(z=Vb(J));da(u,B(w),z);A(B(z),S)}w=l.transcludeOnThisElement?ka(n,l.transclude,L):L;l(m,n,z,d,w)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(l.transcludeOnThisElement&&(a=ka(b,l.transclude,e)),l(m,b,c,d,a)))}}function Y(a,b){var c=b.priority-a.priority;return 0!==
|
||||
c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function W(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ga("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,wa(d));}function X(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&ba.$$addBindingClass(a);return function(a,c){var e=c.parent();b||ba.$$addBindingClass(e);ba.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ca(a,b){a=
|
||||
P(a||"html");switch(a){case "svg":case "math":var c=v.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function ea(a,b){if("srcdoc"==b)return I.HTML;var c=va(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return I.RESOURCE_URL}function fa(a,c,d,e,f){var g=ea(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===va(a))throw ga("selmulti",wa(a));c.push({priority:100,compile:function(){return{pre:function(a,
|
||||
c,h){c=h.$$observers||(h.$$observers=T());if(l.test(e))throw ga("nodomevents");var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m);k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function da(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=
|
||||
c);break}f&&f.replaceChild(c,d);a=v.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);B.hasData(d)&&(B.data(c,B.data(d)),B(d).off("$destroy"));B.cleanData(a.querySelectorAll("*"));for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function ha(a,b){return R(function(){return a.apply(null,arguments)},a,b)}function ja(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,wa(d))}}function ia(a,c,d,e,f){function g(b,c,e){E(d.$onChanges)&&c!==e&&(Z||(a.$$postDigest(L),Z=[]),m||(m={},Z.push(h)),m[b]&&
|
||||
(e=m[b].previousValue),m[b]=new Db(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;q(e,function(e,h){var m=e.attrName,n=e.optional,p,r,I,D;switch(e.mode){case "@":n||ua.call(c,m)||(d[h]=c[m]=void 0);c.$observe(m,function(a){if(F(a)||Da(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;p=c[m];F(p)?d[h]=b(p)(a):Da(p)&&(d[h]=p);l[h]=new Db(Zb,d[h]);break;case "=":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);D=r.literal?pa:function(a,b){return a===b||a!==a&&b!==b};
|
||||
I=r.assign||function(){p=d[h]=r(a);throw ga("nonassign",c[m],m,f.name);};p=d[h]=r(a);n=function(b){D(b,d[h])||(D(b,p)?I(a,b=d[h]):d[h]=b);return p=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(t(c[m],n),null,r.literal);k.push(n);break;case "<":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);d[h]=r(a);l[h]=new Db(Zb,d[h]);n=a.$watch(r,function(a,b){a===b&&(b=d[h]);g(h,a,b);d[h]=a},r.literal);k.push(n);break;case "&":r=c.hasOwnProperty(m)?t(c[m]):C;if(r===
|
||||
C&&n)break;d[h]=function(b){return r(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var oa=/^\w/,na=v.document.createElement("div"),qa=r,Z;S.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&J.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&J.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=$c(a,b);c&&c.length&&J.addClass(this.$$element,c);(c=$c(b,a))&&c.length&&J.removeClass(this.$$element,
|
||||
c)},$set:function(a,b,d,e){var f=Rc(this.$$element[0],a),g=ad[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=zc(a,"-"));f=va(this.$$element);if("a"===f&&("href"===a||"xlinkHref"===a)||"img"===f&&"src"===a)this[a]=b=D(b,"src"===a);else if("img"===f&&"srcset"===a){for(var f="",g=V(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(g)?k:/(,)/,g=g.split(k),k=Math.floor(g.length/2),l=0;l<k;l++)var m=2*l,f=f+D(V(g[m]),!0),f=
|
||||
f+(" "+V(g[m+1]));g=V(g[2*l]).split(/\s/);f+=D(V(g[0]),!0);2===g.length&&(f+=" "+V(g[1]));this[a]=b=f}!1!==d&&(null===b||y(b)?this.$$element.removeAttr(e):oa.test(e)?this.$$element.attr(e,b):$(this.$$element[0],e,b));(a=this.$$observers)&&q(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);u.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||y(c[a])||b(c[a])});return function(){Za(e,b)}}};var ra=b.startSymbol(),
|
||||
sa=b.endSymbol(),ta="{{"==ra&&"}}"==sa?Xa:function(a){return a.replace(/\{\{/g,ra).replace(/}}/g,sa)},ya=/^ngAttr[A-Z]/,Aa=/^(.+)Start$/;ba.$$addBindingInfo=m?function(a,b){var c=a.data("$binding")||[];K(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:C;ba.$$addBindingClass=m?function(a){A(a,"ng-binding")}:C;ba.$$addScopeInfo=m?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:C;ba.$$addScopeClass=m?function(a,b){A(a,b?"ng-isolate-scope":"ng-scope")}:C;ba.$$createComment=
|
||||
function(a,b){var c="";m&&(c=" "+(a||"")+": "+(b||"")+" ");return v.document.createComment(c)};return ba}]}function Db(a,b){this.previousValue=a;this.currentValue=b}function xa(a){return cb(a.replace(Vc,""))}function $c(a,b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],h=0;h<e.length;h++)if(g==e[h])continue a;d+=(0<d.length?" ":"")+g}return d}function Yc(a){a=B(a);var b=a.length;if(1>=b)return a;for(;b--;)8===a[b].nodeType&&Zf.call(a,b,1);return a}function Uc(a,
|
||||
b){if(b&&F(b))return b;if(F(a)){var d=bd.exec(a);if(d)return d[3]}}function ef(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,c){Qa(b,"controller");G(b)?R(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!G(a.$scope))throw O("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,n,m;h=!0===h;k&&F(k)&&(m=k);if(F(f)){k=f.match(bd);if(!k)throw $f("ctrlfmt",f);n=k[1];m=
|
||||
m||k[3];f=a.hasOwnProperty(n)?a[n]:Bc(g.$scope,n,!0)||(b?Bc(c,n,!0):void 0);Pa(f,n,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),m&&e(g,m,l,n||f.name),R(function(){var a=d.invoke(f,l,g,n);a!==l&&(G(a)||E(a))&&(l=a,m&&e(g,m,l,n||f.name));return l},{instance:l,identifier:m});l=d.instantiate(f,g,n);m&&e(g,m,l,n||f.name);return l}}]}function ff(){this.$get=["$window",function(a){return B(a.document)}]}function gf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,
|
||||
arguments)}}]}function $b(a){return G(a)?fa(a)?a.toISOString():ab(a):a}function mf(){this.$get=function(){return function(a){if(!a)return"";var b=[];pc(a,function(a,c){null===a||y(a)||(K(a)?q(a,function(a){b.push(ja(c)+"="+ja($b(a)))}):b.push(ja(c)+"="+ja($b(a))))});return b.join("&")}}}function nf(){this.$get=function(){return function(a){function b(a,e,f){null===a||y(a)||(K(a)?q(a,function(a,c){b(a,e+"["+(G(a)?c:"")+"]")}):G(a)&&!fa(a)?pc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+
|
||||
"="+ja($b(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function ac(a,b){if(F(a)){var d=a.replace(ag,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(cd))||(c=(c=d.match(bg))&&cg[c[0]].test(d));c&&(a=uc(d))}}return a}function dd(a){var b=T(),d;F(a)?q(a.split("\n"),function(a){d=a.indexOf(":");var e=P(V(a.substr(0,d)));a=V(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):G(a)&&q(a,function(a,d){var f=P(d),g=V(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function ed(a){var b;
|
||||
return function(d){b||(b=dd(a));return d?(d=b[P(d)],void 0===d&&(d=null),d):b}}function fd(a,b,d,c){if(E(c))return c(a,b,d);q(c,function(c){a=c(a,b,d)});return a}function lf(){var a=this.defaults={transformResponse:[ac],transformRequest:[function(a){return G(a)&&"[object File]"!==ma.call(a)&&"[object Blob]"!==ma.call(a)&&"[object FormData]"!==ma.call(a)?ab(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ha(bc),put:ha(bc),patch:ha(bc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",
|
||||
paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return x(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return x(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function n(b){function c(a){var b=R({},a);b.data=fd(a.data,a.headers,a.status,f.transformResponse);a=a.status;return 200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};q(a,function(a,
|
||||
e){E(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!G(b))throw O("$http")("badreq",b);if(!F(b.url))throw O("$http")("badreq",b.url);var f=R({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var c=a.headers,d=R({},b.headers),f,g,h,c=R({},c.common,c[P(b.method)]);a:for(f in c){g=P(f);for(h in d)if(P(h)===g)continue a;d[f]=c[f]}return e(d,ha(b))}(b);f.method=sb(f.method);f.paramSerializer=F(f.paramSerializer)?
|
||||
l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=fd(b.data,ed(d),void 0,b.transformRequest);y(e)&&q(d,function(a,b){"content-type"===P(b)&&delete d[b]});y(b.withCredentials)&&!y(a.withCredentials)&&(b.withCredentials=a.withCredentials);return m(b,e).then(c,c)},void 0],h=k.when(f);for(q(M,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var n=g.shift(),
|
||||
h=h.then(b,n)}d?(h.success=function(a){Pa(a,"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Pa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=gd("success"),h.error=gd("error"));return h}function m(c,d){function g(a){if(a){var c={};q(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function l(a,c,d,e){function f(){m(c,a,d,e)}L&&(200<=a&&300>a?L.put(A,[a,c,dd(d),
|
||||
e]):L.remove(A));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function m(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?J.resolve:J.reject)({data:a,status:b,headers:ed(d),config:c,statusText:e})}function u(a){m(a.data,a.status,ha(a.headers()),a.statusText)}function I(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var J=k.defer(),D=J.promise,L,S,M=c.headers,A=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);D.then(I,I);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&
|
||||
"JSONP"!==c.method||(L=G(c.cache)?c.cache:G(a.cache)?a.cache:N);L&&(S=L.get(A),x(S)?S&&E(S.then)?S.then(u,u):K(S)?m(S[1],S[0],ha(S[2]),S[3]):m(S,200,{},"OK"):L.put(A,D));y(S)&&((S=hd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(M[c.xsrfHeaderName||a.xsrfHeaderName]=S),e(c.method,A,d,l,M,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return D}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var N=g("$http");a.paramSerializer=
|
||||
F(a.paramSerializer)?l.get(a.paramSerializer):a.paramSerializer;var M=[];q(c,function(a){M.unshift(F(a)?l.get(a):l.invoke(a))});n.pendingRequests=[];(function(a){q(arguments,function(a){n[a]=function(b,c){return n(R({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){q(arguments,function(a){n[a]=function(b,c,d){return n(R({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function pf(){this.$get=function(){return function(){return new v.XMLHttpRequest}}}
|
||||
function of(){this.$get=["$browser","$window","$document","$xhrFactory",function(a,b,d,c){return dg(a,c,a.defer,b.angular.callbacks,d[0])}]}function dg(a,b,d,c,e){function f(a,b,d){var f=e.createElement("script"),n=null;f.type="text/javascript";f.src=a;f.async=!0;n=function(a){f.removeEventListener("load",n,!1);f.removeEventListener("error",n,!1);e.body.removeChild(f);f=null;var g=-1,N="unknown";a&&("load"!==a.type||c[b].called||(a={type:"error"}),N=a.type,g="error"===a.type?404:200);d&&d(g,N)};f.addEventListener("load",
|
||||
n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,h,k,l,n,m,r,N,M,w){function p(){z&&z();u&&u.abort()}function H(b,c,e,f,g){x(J)&&d.cancel(J);z=u=null;b(c,e,f,g);a.$$completeOutstandingRequest(C)}a.$$incOutstandingRequestCount();h=h||a.url();if("jsonp"==P(e)){var t="_"+(c.counter++).toString(36);c[t]=function(a){c[t].data=a;c[t].called=!0};var z=f(h.replace("JSON_CALLBACK","angular.callbacks."+t),t,function(a,b){H(l,a,c[t].data,"",b);c[t]=C})}else{var u=b(e,h);
|
||||
u.open(e,h,!0);q(n,function(a,b){x(a)&&u.setRequestHeader(b,a)});u.onload=function(){var a=u.statusText||"",b="response"in u?u.response:u.responseText,c=1223===u.status?204:u.status;0===c&&(c=b?200:"file"==ra(h).protocol?404:0);H(l,c,b,u.getAllResponseHeaders(),a)};e=function(){H(l,-1,null,null,"")};u.onerror=e;u.onabort=e;q(M,function(a,b){u.addEventListener(b,a)});q(w,function(a,b){u.upload.addEventListener(b,a)});r&&(u.withCredentials=!0);if(N)try{u.responseType=N}catch(I){if("json"!==N)throw I;
|
||||
}u.send(y(k)?null:k)}if(0<m)var J=d(p,m);else m&&E(m.then)&&m.then(p)}}function jf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,a).replace(r,b)}function h(a,b,c,d){var e;return e=a.$watch(function(a){e();return d(a)},b,c)}function k(f,k,m,r){function H(a){try{var b=a;a=m?e.getTrusted(m,b):e.valueOf(b);
|
||||
var d;if(r&&!x(a))d=a;else if(null==a)d="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=ab(a)}d=a}return d}catch(g){c(Ja.interr(f,g))}}if(!f.length||-1===f.indexOf(a)){var t;k||(k=g(f),t=da(k),t.exp=f,t.expressions=[],t.$$watchDelegate=h);return t}r=!!r;var z,u,I=0,J=[],D=[];t=f.length;for(var L=[],S=[];I<t;)if(-1!=(z=f.indexOf(a,I))&&-1!=(u=f.indexOf(b,z+l)))I!==z&&L.push(g(f.substring(I,z))),I=f.substring(z+l,u),J.push(I),D.push(d(I,H)),I=u+n,S.push(L.length),L.push("");
|
||||
else{I!==t&&L.push(g(f.substring(I)));break}m&&1<L.length&&Ja.throwNoconcat(f);if(!k||J.length){var q=function(a){for(var b=0,c=J.length;b<c;b++){if(r&&y(a[b]))return;L[S[b]]=a[b]}return L.join("")};return R(function(a){var b=0,d=J.length,e=Array(d);try{for(;b<d;b++)e[b]=D[b](a);return q(e)}catch(g){c(Ja.interr(f,g))}},{exp:f,expressions:J,$$watchDelegate:function(a,b){var c;return a.$watchGroup(D,function(d,e){var f=q(d);E(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,n=b.length,m=new RegExp(a.replace(/./g,
|
||||
f),"g"),r=new RegExp(b.replace(/./g,f),"g");k.startSymbol=function(){return a};k.endSymbol=function(){return b};return k}]}function kf(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,d,c,e){function f(f,k,l,n){function m(){r?f.apply(null,N):f(p)}var r=4<arguments.length,N=r?za.call(arguments,4):[],q=b.setInterval,w=b.clearInterval,p=0,H=x(n)&&!n,t=(H?c:d).defer(),z=t.promise;l=x(l)?l:0;z.$$intervalId=q(function(){H?e.defer(m):a.$evalAsync(m);t.notify(p++);0<l&&p>=l&&(t.resolve(p),
|
||||
w(z.$$intervalId),delete g[z.$$intervalId]);H||a.$apply()},k);g[z.$$intervalId]=t;return z}var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0):!1};return f}]}function cc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=ob(a[b]);return a.join("/")}function id(a,b){var d=ra(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=X(d.port)||eg[d.protocol]||null}function jd(a,b){var d="/"!==a.charAt(0);
|
||||
d&&(a="/"+a);var c=ra(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=xc(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function na(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Ia(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function hb(a){return a.replace(/(#.+)|#$/,"$1")}function dc(a,b,d){this.$$html5=!0;d=d||"";id(a,this);this.$$parse=function(a){var d=na(b,
|
||||
a);if(!F(d))throw Eb("ipthprfx",a,b);jd(d,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Rb(this.$$search),d=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;x(f=na(a,c))?(g=f,g=x(f=na(d,f))?b+(na("/",f)||f):a+g):x(f=na(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function ec(a,b,d){id(a,this);
|
||||
this.$$parse=function(c){var e=na(a,c)||na(b,c),f;y(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",y(e)&&(a=c,this.replace())):(f=na(d,e),y(f)&&(f=e));jd(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"")};this.$$parseLinkUrl=
|
||||
function(b,d){return Ia(a)==Ia(b)?(this.$$parse(b),!0):!1}}function kd(a,b,d){this.$$html5=!0;ec.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Ia(c)?f=c:(g=na(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Fb(a){return function(){return this[a]}}function ld(a,
|
||||
b){return function(d){if(y(d))return this[a];this[a]=b(d);this.$$compose();return this}}function qf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return x(b)?(a=b,this):a};this.html5Mode=function(a){return Da(a)?(b.enabled=a,this):G(a)?(Da(a.enabled)&&(b.enabled=a.enabled),Da(a.requireBase)&&(b.requireBase=a.requireBase),Da(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,
|
||||
c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,n;n=c.baseHref();var m=c.url(),r;if(b.enabled){if(!n&&b.requireBase)throw Eb("nobase");r=m.substring(0,m.indexOf("/",m.indexOf("//")+2))+(n||"/");n=e.history?dc:kd}else r=Ia(m),n=ec;var N=r.substr(0,Ia(r).lastIndexOf("/")+1);l=new n(r,N,"#"+a);l.$$parseLinkUrl(m,m);l.$$state=c.state();
|
||||
var q=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=B(a.target);"a"!==va(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");G(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=ra(h.animVal).href);q.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=
|
||||
!0))}});hb(l.absUrl())!=hb(m)&&c.url(l.absUrl(),!0);var w=!0;c.onUrlChange(function(a,b){y(na(N,a))?g.location.href=a:(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=hb(a);l.$$parse(a);l.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(w=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=hb(c.url()),b=hb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(w||
|
||||
m)w=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))});l.$$replace=!1});return l}]}function rf(){var a=!0,b=this;this.debugEnabled=function(b){return x(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&
|
||||
(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||C;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];q(arguments,function(b){a.push(c(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Ta(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===
|
||||
a||"__proto__"===a)throw ca("isecfld",b);return a}function fg(a){return a+""}function sa(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a.window===a)throw ca("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ca("isecdom",b);if(a===Object)throw ca("isecobj",b);}return a}function md(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a===gg||a===hg||a===ig)throw ca("isecff",b);}}function Gb(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||
|
||||
a==={}.constructor||a===[].constructor||a===Function.constructor))throw ca("isecaf",b);}function jg(a,b){return"undefined"!==typeof a?a:b}function nd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function aa(a,b){var d,c;switch(a.type){case s.Program:d=!0;q(a.body,function(a){aa(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:aa(a.argument,b);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;
|
||||
break;case s.BinaryExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:aa(a.test,b);aa(a.alternate,b);aa(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant=
|
||||
!1;a.toWatch=[a];break;case s.MemberExpression:aa(a.object,b);a.computed&&aa(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful:!1;c=[];q(a.arguments,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;
|
||||
a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];q(a.elements,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];q(a.properties,function(a){aa(a.value,b);d=d&&a.value.constant;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1;a.toWatch=[];break;case s.LocalsExpression:a.constant=!1,a.toWatch=[]}}function od(a){if(1==a.length){a=a[0].expression;
|
||||
var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function pd(a){return a.type===s.Identifier||a.type===s.MemberExpression}function qd(a){if(1===a.body.length&&pd(a.body[0].expression))return{type:s.AssignmentExpression,left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function sd(a,
|
||||
b){this.astBuilder=a;this.$filter=b}function td(a,b){this.astBuilder=a;this.$filter=b}function Hb(a){return"constructor"==a}function fc(a){return E(a.valueOf)?a.valueOf():kg.call(a)}function sf(){var a=T(),b=T(),d={"true":!0,"false":!1,"null":null,undefined:void 0},c,e;this.addLiteral=function(a,b){d[a]=b};this.setIdentifierFns=function(a,b){c=a;e=b;return this};this.$get=["$filter",function(f){function g(c,d,e){var g,k,D;e=e||H;switch(typeof c){case "string":D=c=c.trim();var q=e?b:a;g=q[D];if(!g){":"===
|
||||
c.charAt(0)&&":"===c.charAt(1)&&(k=!0,c=c.substring(2));g=e?p:w;var S=new gc(g);g=(new hc(S,f,g)).parse(c);g.constant?g.$$watchDelegate=r:k?g.$$watchDelegate=g.literal?m:n:g.inputs&&(g.$$watchDelegate=l);e&&(g=h(g));q[D]=g}return N(g,d);case "function":return N(c,d);default:return N(C,d)}}function h(a){function b(c,d,e,f){var g=H;H=!0;try{return a(c,d,e,f)}finally{H=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate;b.assign=h(a.assign);b.constant=a.constant;b.literal=a.literal;for(var c=0;a.inputs&&
|
||||
c<a.inputs.length;++c)a.inputs[c]=h(a.inputs[c]);b.inputs=a.inputs;return b}function k(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function l(a,b,c,d,e){var f=d.inputs,g;if(1===f.length){var h=k,f=f[0];return a.$watch(function(a){var b=f(a);k(b,h)||(g=d(a,void 0,void 0,[b]),h=b&&fc(b));return g},b,c,e)}for(var l=[],m=[],n=0,r=f.length;n<r;n++)l[n]=k,m[n]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var h=f[c](a);
|
||||
if(b||(b=!k(h,l[c])))m[c]=h,l[c]=h&&fc(h)}b&&(g=d(a,void 0,void 0,m));return g},b,c,e)}function n(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;E(b)&&b.apply(this,arguments);x(a)&&d.$$postDigest(function(){x(f)&&e()})},c)}function m(a,b,c,d){function e(a){var b=!0;q(a,function(a){x(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;E(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function r(a,b,c,d){var e;
|
||||
return e=a.$watch(function(a){e();return d(a)},b,c)}function N(a,b){if(!b)return a;var c=a.$$watchDelegate,d=!1,c=c!==m&&c!==n?function(c,e,f,g){f=d&&g?g[0]:a(c,e,f,g);return b(f,c,e)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return x(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==l?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=l,d=!a.inputs,c.inputs=a.inputs?a.inputs:[a]);return c}var M=Ea().noUnsafeEval,w={csp:M,expensiveChecks:!1,literals:qa(d),isIdentifierStart:E(c)&&c,
|
||||
isIdentifierContinue:E(e)&&e},p={csp:M,expensiveChecks:!0,literals:qa(d),isIdentifierStart:E(c)&&c,isIdentifierContinue:E(e)&&e},H=!1;g.$$runningExpensiveChecks=function(){return H};return g}]}function uf(){this.$get=["$rootScope","$exceptionHandler",function(a,b){return ud(function(b){a.$evalAsync(b)},b)}]}function vf(){this.$get=["$browser","$exceptionHandler",function(a,b){return ud(function(b){a.defer(b)},b)}]}function ud(a,b){function d(){this.$$state={status:0}}function c(a,b){return function(c){b.call(a,
|
||||
c)}}function e(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,a(function(){var a,d,e;e=c.pending;c.processScheduled=!1;c.pending=void 0;for(var f=0,g=e.length;f<g;++f){d=e[f][0];a=e[f][c.status];try{E(a)?d.resolve(a(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),b(h)}}}))}function f(){this.promise=new d}var g=O("$q",TypeError);R(d.prototype,{then:function(a,b,c){if(y(a)&&y(b)&&y(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,
|
||||
a,b,c]);0<this.$$state.status&&e(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}});R(f.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(g("qcycle",a)):this.$$resolve(a))},$$resolve:function(a){function d(a){k||(k=!0,h.$$resolve(a))}function f(a){k||(k=!0,h.$$reject(a))}var g,h=this,k=!1;try{if(G(a)||E(a))g=a&&a.then;E(g)?
|
||||
(this.promise.$$state.status=-1,g.call(a,d,f,c(this,this.notify))):(this.promise.$$state.value=a,this.promise.$$state.status=1,e(this.promise.$$state))}catch(l){f(l),b(l)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;e(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;f<g;f++){e=d[f][0];
|
||||
a=d[f][3];try{e.notify(E(a)?a(c):c)}catch(h){b(h)}}})}});var h=function(a,b){var c=new f;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{E(c)&&(d=c())}catch(e){return h(e,!1)}return d&&E(d.then)?d.then(function(){return h(a,b)},function(a){return h(a,!1)}):h(a,b)},l=function(a,b,c,d){var e=new f;e.resolve(a);return e.promise.then(b,c,d)},n=function(a){if(!E(a))throw g("norslvr",a);var b=new f;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};n.prototype=
|
||||
d.prototype;n.defer=function(){var a=new f;a.resolve=c(a,a.resolve);a.reject=c(a,a.reject);a.notify=c(a,a.notify);return a};n.reject=function(a){var b=new f;b.reject(a);return b.promise};n.when=l;n.resolve=l;n.all=function(a){var b=new f,c=0,d=K(a)?[]:{};q(a,function(a,e){c++;l(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return n}function Ef(){this.$get=["$window","$timeout",function(a,
|
||||
b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function tf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++nb;this.$$ChildScope=
|
||||
null}b.prototype=a;return b}var b=10,d=O("$rootScope"),c=null,e=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,h){function k(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function n(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=
|
||||
this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function m(a){if(H.$$phase)throw d("inprog",H.$$phase);H.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function N(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function w(){for(;u.length;)try{u.shift()()}catch(a){f(a)}e=
|
||||
null}function p(){null===e&&(e=h.defer(function(){H.$apply(w)}))}n.prototype={constructor:n,$new:function(b,c){var d;c=c||this;b?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,d,e){var f=g(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,
|
||||
a);var h=this,k=h.$$watchers,l={fn:b,last:s,get:f,exp:e||a,eq:!!d};c=null;E(b)||(l.fn=C);k||(k=h.$$watchers=[]);k.unshift(l);r(this,1);return function(){0<=Za(k,l)&&r(h,-1);c=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});q(a,function(a,
|
||||
b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!y(e)){if(G(e))if(ya(e))for(f!==m&&(f=m,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==r&&(f=r={},t=0,l++);a=0;for(b in e)ua.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>
|
||||
a)for(b in l++,f)ua.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1<b.length,l=0,n=g(a,c),m=[],r={},p=!0,t=0;return this.$watch(n,function(){p?(p=!1,b(e,e,d)):b(e,h,d);if(k)if(G(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ua.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,k,l,n,r,p,q,N=b,u,x=[],y,v;m("$digest");h.$$checkUrlChange();this===H&&null!==e&&(h.defer.cancel(e),w());c=null;do{q=!1;
|
||||
for(u=this;t.length;){try{v=t.shift(),v.scope.$eval(v.expression,v.locals)}catch(C){f(C)}c=null}a:do{if(r=u.$$watchers)for(p=r.length;p--;)try{if(a=r[p])if(n=a.get,(g=n(u))!==(k=a.last)&&!(a.eq?pa(g,k):"number"===typeof g&&"number"===typeof k&&isNaN(g)&&isNaN(k)))q=!0,c=a,a.last=a.eq?qa(g,null):g,l=a.fn,l(g,k===s?g:k,u),5>N&&(y=4-N,x[y]||(x[y]=[]),x[y].push({msg:E(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}));else if(a===c){q=!1;break a}}catch(F){f(F)}if(!(r=u.$$watchersCount&&
|
||||
u.$$childHead||u!==this&&u.$$nextSibling))for(;u!==this&&!(r=u.$$nextSibling);)u=u.$parent}while(u=r);if((q||t.length)&&!N--)throw H.$$phase=null,d("infdig",b,x);}while(q||t.length);for(H.$$phase=null;z.length;)try{z.shift()()}catch(B){f(B)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===H&&h.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)N(this,this.$$listenerCount[b],b);a&&a.$$childHead==
|
||||
this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=C;this.$on=this.$watch=this.$watchGroup=function(){return C};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){H.$$phase||
|
||||
t.length||h.defer(function(){t.length&&H.$digest()});t.push({scope:this,expression:g(a),locals:b})},$$postDigest:function(a){z.push(a)},$apply:function(a){try{m("$apply");try{return this.$eval(a)}finally{H.$$phase=null}}catch(b){f(b)}finally{try{H.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&u.push(b);a=g(a);p()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=
|
||||
0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,N(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=$a([h],arguments,1),l,n;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(n=d.length;l<n;l++)if(d[l])try{d[l].apply(null,k)}catch(m){f(m)}else d.splice(l,1),l--,n--;if(g)return h.currentScope=null,h;e=e.$parent}while(e);
|
||||
h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=$a([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=
|
||||
null;return e}};var H=new n,t=H.$$asyncQueue=[],z=H.$$postDigestQueue=[],u=H.$$applyAsyncQueue=[];return H}]}function me(){var a=/^\s*(https?|ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return x(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f;f=ra(d).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function lg(a){if("self"===a)return a;
|
||||
if(F(a)){if(-1<a.indexOf("***"))throw ta("iwcard",a);a=vd(a).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+a+"$")}if(Wa(a))return new RegExp("^"+a.source+"$");throw ta("imatcher");}function wd(a){var b=[];x(a)&&q(a,function(a){b.push(lg(a))});return b}function xf(){this.SCE_CONTEXTS=oa;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=wd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=wd(a));return b};this.$get=["$injector",
|
||||
function(d){function c(a,b){return"self"===a?hd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw ta("unsafe");};d.has("$sanitize")&&(f=d.get("$sanitize"));var g=e(),h={};h[oa.HTML]=e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=
|
||||
e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw ta("icontext",a,b);if(null===b||y(b)||""===b)return b;if("string"!==typeof b)throw ta("itype",a);return new c(b)},getTrusted:function(d,e){if(null===e||y(e)||""===e)return e;var g=h.hasOwnProperty(d)?h[d]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(d===oa.RESOURCE_URL){var g=ra(e.toString()),m,r,q=!1;m=0;for(r=a.length;m<r;m++)if(c(a[m],g)){q=!0;break}if(q)for(m=0,r=b.length;m<r;m++)if(c(b[m],
|
||||
g)){q=!1;break}if(q)return e;throw ta("insecurl",e.toString());}if(d===oa.HTML)return f(e);throw ta("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function wf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw ta("iequirks");var c=ha(oa);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},
|
||||
c.valueOf=Xa);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;q(oa,function(a,b){var d=P(b);c[cb("parse_as_"+d)]=function(b){return e(a,b)};c[cb("get_trusted_"+d)]=function(b){return f(a,b)};c[cb("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function yf(){this.$get=["$window","$document",function(a,b){var d={},c=!(a.chrome&&a.chrome.app&&a.chrome.app.runtime)&&a.history&&a.history.pushState,
|
||||
e=X((/android (\d+)/.exec(P((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h,k=/^(Moz|webkit|ms)(?=[A-Z])/,l=g.body&&g.body.style,n=!1,m=!1;if(l){for(var r in l)if(n=k.exec(r)){h=n[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");n=!!("transition"in l||h+"Transition"in l);m=!!("animation"in l||h+"Animation"in l);!e||n&&m||(n=F(l.webkitTransition),m=F(l.webkitAnimation))}return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===
|
||||
a&&11>=Ca)return!1;if(y(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ea(),vendorPrefix:h,transitions:n,animations:m,android:e}}]}function Af(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++;F(g)&&b.get(g)||(g=e.getTrustedResourceUrl(g));var k=d.defaults&&d.defaults.transformResponse;K(k)?k=k.filter(function(a){return a!==ac}):k===ac&&(k=null);return d.get(g,
|
||||
R({cache:b,transformResponse:k},a))["finally"](function(){f.totalPendingRequests--}).then(function(a){b.put(g,a.data);return a.data},function(a){if(!h)throw mg("tpload",g,a.status,a.statusText);return c.reject(a)})}f.totalPendingRequests=0;return f}]}function Bf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];q(a,function(a){var c=ea.element(a).data("$binding");c&&q(c,function(c){d?(new RegExp("(^|\\s)"+
|
||||
vd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var k=a.querySelectorAll("["+g[h]+"model"+(d?"=":"*=")+'"'+b+'"]');if(k.length)return k}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function Cf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",
|
||||
function(a,b,d,c,e){function f(f,k,l){E(f)||(l=k,k=f,f=C);var n=za.call(arguments,3),m=x(l)&&!l,r=(m?c:d).defer(),q=r.promise,s;s=b.defer(function(){try{r.resolve(f.apply(null,n))}catch(b){r.reject(b),e(b)}finally{delete g[q.$$timeoutId]}m||a.$apply()},k);q.$$timeoutId=s;g[s]=r;return q}var g={};f.cancel=function(a){return a&&a.$$timeoutId in g?(g[a.$$timeoutId].reject("canceled"),delete g[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)):!1};return f}]}function ra(a){Ca&&(Y.setAttribute("href",a),a=
|
||||
Y.href);Y.setAttribute("href",a);return{href:Y.href,protocol:Y.protocol?Y.protocol.replace(/:$/,""):"",host:Y.host,search:Y.search?Y.search.replace(/^\?/,""):"",hash:Y.hash?Y.hash.replace(/^#/,""):"",hostname:Y.hostname,port:Y.port,pathname:"/"===Y.pathname.charAt(0)?Y.pathname:"/"+Y.pathname}}function hd(a){a=F(a)?ra(a):a;return a.protocol===xd.protocol&&a.host===xd.host}function Df(){this.$get=da(v)}function yd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},
|
||||
c={},e="";return function(){var a,g,h,k,l;a=d.cookie||"";if(a!==e)for(e=a,a=e.split("; "),c={},h=0;h<a.length;h++)g=a[h],k=g.indexOf("="),0<k&&(l=b(g.substring(0,k)),y(c[l])&&(c[l]=b(g.substring(k+1))));return c}}function Hf(){this.$get=yd}function Jc(a){function b(d,c){if(G(d)){var e={};q(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",zd);b("date",Ad);b("filter",ng);
|
||||
b("json",og);b("limitTo",pg);b("lowercase",qg);b("number",Bd);b("orderBy",Cd);b("uppercase",rg)}function ng(){return function(a,b,d){if(!ya(a)){if(null==a)return a;throw O("filter")("notarray",a);}var c;switch(ic(b)){case "function":break;case "boolean":case "null":case "number":case "string":c=!0;case "object":b=sg(b,d,c);break;default:return a}return Array.prototype.filter.call(a,b)}}function sg(a,b,d){var c=G(a)&&"$"in a;!0===b?b=pa:E(b)||(b=function(a,b){if(y(a))return!1;if(null===a||null===b)return a===
|
||||
b;if(G(b)||G(a)&&!rc(a))return!1;a=P(""+a);b=P(""+b);return-1!==a.indexOf(b)});return function(e){return c&&!G(e)?Ka(e,a.$,b,!1):Ka(e,a,b,d)}}function Ka(a,b,d,c,e){var f=ic(a),g=ic(b);if("string"===g&&"!"===b.charAt(0))return!Ka(a,b.substring(1),d,c);if(K(a))return a.some(function(a){return Ka(a,b,d,c)});switch(f){case "object":var h;if(c){for(h in a)if("$"!==h.charAt(0)&&Ka(a[h],b,d,!0))return!0;return e?!1:Ka(a,b,d,!1)}if("object"===g){for(h in b)if(e=b[h],!E(e)&&!y(e)&&(f="$"===h,!Ka(f?a:a[h],
|
||||
e,d,f,f)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function ic(a){return null===a?"null":typeof a}function zd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){y(c)&&(c=b.CURRENCY_SYM);y(e)&&(e=b.PATTERNS[1].maxFrac);return null==a?a:Dd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(/\u00A4/g,c)}}function Bd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Dd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function tg(a){var b=0,d,c,e,f,g;-1<
|
||||
(c=a.indexOf(Ed))&&(a=a.replace(Ed,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)==jc;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==jc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Fd&&(d=d.splice(0,Fd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function ug(a,b,d,c){var e=a.d,f=e.length-a.i;b=y(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=
|
||||
Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Dd(a,b,d,c,e){if(!F(a)&&!Q(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,h=Math.abs(a)+"",k="";if(f)k="\u221e";else{g=tg(h);ug(g,e,b.minFrac,b.maxFrac);k=g.d;h=g.i;e=g.e;f=[];for(g=k.reduce(function(a,
|
||||
b){return a&&!b},!0);0>h;)k.unshift(0),h++;0<h?f=k.splice(h):(f=k,k=[0]);h=[];for(k.length>=b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Ib(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=jc+a;d&&(a=a.substr(a.length-b));return e+a}function W(a,b,d,c,e){d=
|
||||
d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12==d&&(f=12);return Ib(f,b,c,e)}}function ib(a,b,d){return function(c,e){var f=c["get"+a](),g=sb((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Gd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Hd(a){return function(b){var d=Gd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ib(b,a)}}function kc(a,b){return 0>=a.getFullYear()?
|
||||
b.ERAS[0]:b.ERAS[1]}function Ad(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=X(b[9]+b[10]),g=X(b[9]+b[11]));h.call(a,X(b[1]),X(b[2])-1,X(b[3]));f=X(b[4]||0)-f;g=X(b[5]||0)-g;h=X(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",h=
|
||||
[],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;F(c)&&(c=vg.test(c)?X(c):b(c));Q(c)&&(c=new Date(c));if(!fa(c)||!isFinite(c.getTime()))return c;for(;d;)(l=wg.exec(d))?(h=$a(h,l,1),d=h.pop()):(h.push(d),d=null);var n=c.getTimezoneOffset();f&&(n=vc(f,n),c=Qb(c,f,!0));q(h,function(b){k=xg[b];g+=k?k(c,a.DATETIME_FORMATS,n):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function og(){return function(a,b){y(b)&&(b=2);return ab(a,b)}}function pg(){return function(a,b,d){b=Infinity===
|
||||
Math.abs(Number(b))?Number(b):X(b);if(isNaN(b))return a;Q(a)&&(a=a.toString());if(!K(a)&&!F(a))return a;d=!d||isNaN(d)?0:X(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)}}function Cd(a){function b(b,d){d=d?-1:1;return b.map(function(b){var c=1,h=Xa;if(E(b))h=b;else if(F(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(h=a(b),h.constant))var k=h(),h=function(a){return a[k]}}return{get:h,
|
||||
descending:c*d}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(a,e,f){if(null==a)return a;if(!ya(a))throw O("orderBy")("notarray",a);K(e)||(e=[e]);0===e.length&&(e=["+"]);var g=b(e,f);g.push({get:function(){return{}},descending:f?-1:1});a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("string"===c)e=e.toLowerCase();else if("object"===
|
||||
c)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),d(e)))break a;if(rc(e)&&(e=e.toString(),d(e)))break a;e=b}return{value:e,type:c}})}});a.sort(function(a,b){for(var c=0,d=0,e=g.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],q=0;c.type===f.type?c.value!==f.value&&(q=c.value<f.value?-1:1):q=c.type<f.type?-1:1;if(c=q*g[d].descending)break}return c});return a=a.map(function(a){return a.value})}}function La(a){E(a)&&(a={link:a});a.restrict=a.restrict||"AC";return da(a)}function Id(a,
|
||||
b,d,c,e){var f=this,g=[];f.$error={};f.$$success={};f.$pending=void 0;f.$name=e(b.name||b.ngForm||"")(d);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;f.$$parentForm=Jb;f.$rollbackViewValue=function(){q(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){q(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){Qa(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a);a.$$parentForm=f};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];
|
||||
f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];q(f.$pending,function(b,c){f.$setValidity(c,null,a)});q(f.$error,function(b,c){f.$setValidity(c,null,a)});q(f.$$success,function(b,c){f.$setValidity(c,null,a)});Za(g,a);a.$$parentForm=Jb};Jd({ctrl:this,$element:a,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Za(d,c),0===d.length&&delete a[b])},$animate:c});f.$setDirty=function(){c.removeClass(a,Ua);
|
||||
c.addClass(a,Kb);f.$dirty=!0;f.$pristine=!1;f.$$parentForm.$setDirty()};f.$setPristine=function(){c.setClass(a,Ua,Kb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;q(g,function(a){a.$setPristine()})};f.$setUntouched=function(){q(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){c.addClass(a,"ng-submitted");f.$submitted=!0;f.$$parentForm.$setSubmitted()}}function lc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function jb(a,b,d,c,e,f){var g=P(b[0].type);
|
||||
if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0});b.on("compositionend",function(){h=!1;l()})}var k,l=function(a){k&&(f.defer.cancel(k),k=null);if(!h){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=V(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<
|
||||
b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut",n)}b.on("change",l);if(Kd[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Lb(a,b){return function(d,c){var e,f;if(fa(d))return d;if(F(d)){'"'==d.charAt(0)&&
|
||||
'"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(yg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},q(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(a,b,d,c){return function(e,f,g,h,k,l,n){function m(a){return a&&
|
||||
!(a.getTime&&a.getTime()!==a.getTime())}function r(a){return x(a)&&!fa(a)?d(a)||void 0:a}Ld(e,f,g,h);jb(e,f,g,h,k,l);var q=h&&h.$options&&h.$options.timezone,s;h.$$parserName=a;h.$parsers.push(function(a){if(h.$isEmpty(a))return null;if(b.test(a))return a=d(a,s),q&&(a=Qb(a,q)),a});h.$formatters.push(function(a){if(a&&!fa(a))throw lb("datefmt",a);if(m(a))return(s=a)&&q&&(s=Qb(s,q,!0)),n("date")(a,c,q);s=null;return""});if(x(g.min)||g.ngMin){var w;h.$validators.min=function(a){return!m(a)||y(w)||d(a)>=
|
||||
w};g.$observe("min",function(a){w=r(a);h.$validate()})}if(x(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!m(a)||y(p)||d(a)<=p};g.$observe("max",function(a){p=r(a);h.$validate()})}}}function Ld(a,b,d,c){(c.$$hasNativeValidators=G(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function Md(a,b,d,c,e){if(x(c)){a=a(c);if(!a.constant)throw lb("constexpr",d,c);return a(b)}return e}function mc(a,b){a="ngClass"+a;return["$animate",
|
||||
function(d){function c(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],n=0;n<b.length;n++)if(e==b[n])continue a;c.push(e)}return c}function e(a){var b=[];return K(a)?(q(a,function(a){b=b.concat(e(a))}),b):F(a)?a.split(" "):G(a)?(q(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function k(a){a=l(a,1);h.$addClass(a)}function l(a,b){var c=g.data("$classCounts")||T(),d=[];q(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",
|
||||
c);return d.join(" ")}function n(a,b){var e=c(b,a),f=c(a,b),e=l(e,1),f=l(f,-1);e&&e.length&&d.addClass(g,e);f&&f.length&&d.removeClass(g,f)}function m(a){if(!0===b||f.$index%2===b){var c=e(a||[]);if(!r)k(c);else if(!pa(a,r)){var d=e(r);n(d,c)}}r=K(a)?a.map(function(a){return ha(a)}):ha(a)}var r;f.$watch(h[a],m,!0);h.$observe("class",function(b){m(f.$eval(h[a]))});"ngClass"!==a&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var m=e(f.$eval(h[a]));g===b?k(m):(g=l(m,-1),h.$removeClass(g))}})}}}]}
|
||||
function Jd(a){function b(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function d(a,c){a=a?"-"+zc(a,"-"):"";b(mb+a,!0===c);b(Nd+a,!1===c)}var c=a.ctrl,e=a.$element,f={},g=a.set,h=a.unset,k=a.$animate;f[Nd]=!(f[mb]=e.hasClass(mb));c.$setValidity=function(a,e,f){y(e)?(c.$pending||(c.$pending={}),g(c.$pending,a,f)):(c.$pending&&h(c.$pending,a,f),Od(c.$pending)&&(c.$pending=void 0));Da(e)?e?(h(c.$error,a,f),g(c.$$success,a,f)):(g(c.$error,a,f),h(c.$$success,a,f)):(h(c.$error,
|
||||
a,f),h(c.$$success,a,f));c.$pending?(b(Pd,!0),c.$valid=c.$invalid=void 0,d("",null)):(b(Pd,!1),c.$valid=Od(c.$error),c.$invalid=!c.$valid,d("",c.$valid));e=c.$pending&&c.$pending[a]?void 0:c.$error[a]?!1:c.$$success[a]?!0:null;d(a,e);c.$$parentForm.$setValidity(a,e,c)}}function Od(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var zg=/^\/(.+)\/([a-z]*)$/,ua=Object.prototype.hasOwnProperty,P=function(a){return F(a)?a.toLowerCase():a},sb=function(a){return F(a)?a.toUpperCase():a},Ca,
|
||||
B,Z,za=[].slice,Zf=[].splice,Ag=[].push,ma=Object.prototype.toString,sc=Object.getPrototypeOf,Aa=O("ng"),ea=v.angular||(v.angular={}),Sb,nb=0;Ca=v.document.documentMode;C.$inject=[];Xa.$inject=[];var K=Array.isArray,$d=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,V=function(a){return F(a)?a.trim():a},vd=function(a){return a.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ea=function(){if(!x(Ea.rules)){var a=v.document.querySelector("[ng-csp]")||
|
||||
v.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ea.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ea;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ea.rules},pb=function(){if(x(pb.name_))return pb.name_;var a,b,d=Na.length,c,e;for(b=0;b<d;++b)if(c=Na[b],a=v.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+
|
||||
"jq");break}return pb.name_=e},ce=/:/g,Na=["ng-","data-ng-","ng:","x-ng-"],he=/[A-Z]/g,Ac=!1,Ma=3,le={full:"1.5.5",major:1,minor:5,dot:5,codeName:"material-conspiration"};U.expando="ng339";var eb=U.cache={},Nf=1;U._data=function(a){return this.cache[a[this.expando]]||{}};var If=/([\:\-\_]+(.))/g,Jf=/^moz([A-Z])/,wb={mouseleave:"mouseout",mouseenter:"mouseover"},Ub=O("jqLite"),Mf=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Tb=/<|&#?\w+;/,Kf=/<([\w:-]+)/,Lf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
|
||||
ia={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option;ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead;ia.th=ia.td;var Sf=v.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Oa=U.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===
|
||||
v.document.readyState?v.setTimeout(b):(this.on("DOMContentLoaded",b),U(v).on("load",b))},toString:function(){var a=[];q(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?B(this[a]):B(this[this.length+a])},length:0,push:Ag,sort:[].sort,splice:[].splice},Cb={};q("multiple selected checked disabled readOnly required open".split(" "),function(a){Cb[P(a)]=a});var Sc={};q("input select option textarea button form details".split(" "),function(a){Sc[a]=!0});var ad={ngMinlength:"minlength",
|
||||
ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};q({data:Wb,removeData:db,hasData:function(a){for(var b in eb[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)db(a[b])}},function(a,b){U[b]=a});q({data:Wb,inheritedData:Ab,scope:function(a){return B.data(a,"$scope")||Ab(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return B.data(a,"$isolateScope")||B.data(a,"$isolateScopeNoTemplate")},controller:Pc,injector:function(a){return Ab(a,
|
||||
"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:xb,css:function(a,b,d){b=cb(b);if(x(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Ma&&2!==c&&8!==c)if(c=P(b),Cb[c])if(x(d))d?(a[b]=!0,a.setAttribute(b,c)):(a[b]=!1,a.removeAttribute(c));else return a[b]||(a.attributes.getNamedItem(b)||C).specified?c:void 0;else if(x(d))a.setAttribute(b,d);else if(a.getAttribute)return a=a.getAttribute(b,2),null===a?void 0:a},prop:function(a,b,d){if(x(d))a[b]=
|
||||
d;else return a[b]},text:function(){function a(a,d){if(y(d)){var c=a.nodeType;return 1===c||c===Ma?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(y(b)){if(a.multiple&&"select"===va(a)){var d=[];q(a.options,function(a){a.selected&&d.push(a.value||a.text)});return 0===d.length?null:d}return a.value}a.value=b},html:function(a,b){if(y(b))return a.innerHTML;ub(a,!0);a.innerHTML=b},empty:Qc},function(a,b){U.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==Qc&&y(2==a.length&&
|
||||
a!==xb&&a!==Pc?b:c)){if(G(b)){for(e=0;e<g;e++)if(a===Wb)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=y(e)?Math.min(g,1):g;for(f=0;f<g;f++){var h=a(this[f],b,c);e=e?e+h:h}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});q({removeData:db,on:function(a,b,d,c){if(x(c))throw Ub("onargs");if(Kc(a)){c=vb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=Pf(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,h=function(b,c,g){var h=e[b];h||(h=e[b]=[],h.specialHandlerWrapper=
|
||||
c,"$destroy"===b||g||a.addEventListener(b,f,!1));h.push(d)};g--;)b=c[g],wb[b]?(h(wb[b],Rf),h(b,void 0,!0)):h(b)}},off:Oc,one:function(a,b,d){a=B(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;ub(a);q(new U(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];q(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,
|
||||
b){var d=a.nodeType;if(1===d||11===d){b=new U(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;q(new U(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){Mc(a,B(b).eq(0).clone()[0])},remove:Bb,detach:function(a){Bb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;b=new U(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}},addClass:zb,removeClass:yb,toggleClass:function(a,b,d){b&&q(b.split(" "),
|
||||
function(b){var e=d;y(e)&&(e=!xb(a,b));(e?zb:yb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:Vb,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=vb(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
|
||||
!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:C,type:f,target:a},b.type&&(c=R(c,b)),b=ha(g),e=d?[c].concat(d):[c],q(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){U.prototype[b]=function(b,c,e){for(var f,g=0,h=this.length;g<h;g++)y(f)?(f=a(this[g],b,c,e),x(f)&&(f=B(f))):Nc(f,a(this[g],b,c,e));return x(f)?f:this};U.prototype.bind=U.prototype.on;U.prototype.unbind=U.prototype.off});Ra.prototype={put:function(a,
|
||||
b){this[Fa(a,this.nextUid)]=b},get:function(a){return this[Fa(a,this.nextUid)]},remove:function(a){var b=this[a=Fa(a,this.nextUid)];delete this[a];return b}};var Gf=[function(){this.$get=[function(){return Ra}]}],Uf=/^([^\(]+?)=>/,Vf=/^[^\(]*\(\s*([^\)]*)\)/m,Bg=/,/,Cg=/^\s*(_?)(\S+?)\1\s*$/,Tf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=O("$injector");bb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw F(d)&&d||(d=a.name||Wf(a)),Ga("strictdi",d);
|
||||
b=Tc(a);q(b[1].split(Bg),function(a){a.replace(Cg,function(a,b,d){c.push(d)})})}a.$inject=c}}else K(a)?(b=a.length-1,Pa(a[b],"fn"),c=a.slice(0,b)):Pa(a,"fn",!0);return c};var Qd=O("$animate"),Ze=function(){this.$get=C},$e=function(){var a=new Ra,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=F(b)?b.split(" "):K(b)?b:[],q(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){q(b,function(b){var c=a.get(b);if(c){var d=Xf(b.attr("class")),e="",f="";q(c,
|
||||
function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});q(b,function(a){e&&zb(a,e);f&&yb(a,f)});a.remove(b)}});b.length=0}return{enabled:C,on:C,off:C,pin:C,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},Xe=["$provide",function(a){var b=this;this.$$registeredAnimations=
|
||||
Object.create(null);this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Qd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e;a.factory(e,c)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Qd("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h<d.length;h++){var k=
|
||||
d[h];if(1===k.nodeType){h=k;break a}}h=void 0}!h||h.parentNode||h.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"enter",Ha(h))},move:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"move",Ha(h))},leave:function(b,c){return a.push(b,"leave",Ha(c),function(){b.remove()})},addClass:function(b,
|
||||
c,g){g=Ha(g);g.addClass=fb(g.addclass,c);return a.push(b,"addClass",g)},removeClass:function(b,c,g){g=Ha(g);g.removeClass=fb(g.removeClass,c);return a.push(b,"removeClass",g)},setClass:function(b,c,g,h){h=Ha(h);h.addClass=fb(h.addClass,c);h.removeClass=fb(h.removeClass,g);return a.push(b,"setClass",h)},animate:function(b,c,g,h,k){k=Ha(k);k.from=k.from?R(k.from,c):c;k.to=k.to?R(k.to,g):g;k.tempClasses=fb(k.tempClasses,h||"ng-inline-animate");return a.push(b,"animate",k)}}}]}],bf=function(){this.$get=
|
||||
["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},af=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$document","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){var d=c[0];d&&d.hidden?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);
|
||||
else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;q(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:C,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},
|
||||
"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=
|
||||
0,this._state=2)}};return f}]},Ye=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);h||k.complete();h=!0});return k}var g=e||{};g.$$prepared||(g=qa(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var h,k=new d;return{start:f,end:f}}}]},ga=O("$compile"),Zb=new function(){};
|
||||
Cc.$inject=["$provide","$$sanitizeUriProvider"];Db.prototype.isFirstChange=function(){return this.previousValue===Zb};var Vc=/^((?:x|data)[\:\-_])/i,$f=O("$controller"),bd=/^(\S+)(\s+as\s+([\w$]+))?$/,hf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof B&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},cd="application/json",bc={"Content-Type":cd+";charset=utf-8"},bg=/^\[|^\{(?!\{)/,cg={"[":/]$/,"{":/}$/},ag=/^\)\]\}',?\n/,Dg=O("$http"),gd=function(a){return function(){throw Dg("legacy",
|
||||
a);}},Ja=ea.$interpolateMinErr=O("$interpolate");Ja.throwNoconcat=function(a){throw Ja("noconcat",a);};Ja.interr=function(a,b){return Ja("interr",a,b.toString())};var Eg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,eg={http:80,https:443,ftp:21},Eb=O("$location"),Fg={$$html5:!1,$$replace:!1,absUrl:Fb("$$absUrl"),url:function(a){if(y(a))return this.$$url;var b=Eg.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Fb("$$protocol"),
|
||||
host:Fb("$$host"),port:Fb("$$port"),path:ld("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(F(a)||Q(a))a=a.toString(),this.$$search=xc(a);else if(G(a))a=qa(a,{}),q(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw Eb("isrcharg");break;default:y(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:ld("$$hash",function(a){return null!==
|
||||
a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};q([kd,ec,dc],function(a){a.prototype=Object.create(Fg);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==dc||!this.$$html5)throw Eb("nostate");this.$$state=y(b)?null:b;return this}});var ca=O("$parse"),gg=Function.prototype.call,hg=Function.prototype.apply,ig=Function.prototype.bind,Mb=T();q("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var Gg={n:"\n",f:"\f",r:"\r",
|
||||
t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;
|
||||
else{var b=a+this.peek(),d=b+this.peek(2),c=Mb[b],e=Mb[d];Mb[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||
|
||||
"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,
|
||||
b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=x(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw ca("lexerr",
|
||||
a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=P(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"==d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},
|
||||
readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||
|
||||
this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=Gg[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var s=function(a,b){this.lexer=a;this.options=b};s.Program="Program";s.ExpressionStatement="ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";
|
||||
s.LogicalExpression="LogicalExpression";s.BinaryExpression="BinaryExpression";s.UnaryExpression="UnaryExpression";s.CallExpression="CallExpression";s.MemberExpression="MemberExpression";s.Identifier="Identifier";s.Literal="Literal";s.ArrayExpression="ArrayExpression";s.Property="Property";s.ObjectExpression="ObjectExpression";s.ThisExpression="ThisExpression";s.LocalsExpression="LocalsExpression";s.NGValueParameter="NGValueParameter";s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);
|
||||
a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:s.Program,body:a}},expressionStatement:function(){return{type:s.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},
|
||||
assignment:function(){var a=this.ternary();this.expect("=")&&(a={type:s.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:s.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=
|
||||
this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),
|
||||
b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):
|
||||
this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=qa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:s.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:s.CallExpression,
|
||||
callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==
|
||||
this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},
|
||||
object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:s.Property,kind:"init"};this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");b.value=this.expression();a.push(b)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,b){throw ca("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===
|
||||
this.tokens.length)throw ca("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw ca("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?
|
||||
(this.tokens.shift(),a):!1},selfReferential:{"this":{type:s.ThisExpression},$locals:{type:s.LocalsExpression}}};sd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};aa(c,d.$filter);var e="",f;this.stage="assign";if(f=qd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=od(c.body);
|
||||
d.stage="inputs";q(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext",
|
||||
"ifDefined","plus","text",e))(this.$filter,Ta,sa,md,fg,Gb,jg,nd,a);this.state=this.stage=void 0;e.literal=rd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;q(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;q(this.state.filters,
|
||||
function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,n;c=c||C;if(!f&&x(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:q(a.body,function(b,c){k.recurse(b.expression,
|
||||
void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:n=this.escape(a.value);this.assign(b,n);c(n);break;case s.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});n=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,n);c(n);break;case s.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});n="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,
|
||||
0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,n);c(n);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",
|
||||
a.name)+"?l:s"),d.computed=!1,d.name=a.name);Ta(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Hb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||
|
||||
this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g);if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),n=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,n),d&&(d.computed=!0,d.name=h);else{Ta(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),
|
||||
k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));n=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Hb(a.property.name))n=k.ensureSafeObject(n);k.assign(b,n);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],q(a.arguments,function(a){var b=k.nextId();k.recurse(a,b);l.push(b)}),n=h+"("+l.join(",")+")",k.assign(b,n),c(b)):(h=k.nextId(),g={},l=
|
||||
[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);q(a.arguments,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),n=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):n=h+"("+l.join(",")+")";n=k.ensureSafeObject(n);k.assign(b,n)},function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!pd(a.left))throw ca("lval");
|
||||
this.recurse(a.left,void 0,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);n=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,n);c(b||n)})},1);break;case s.ArrayExpression:l=[];q(a.elements,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(a)})});n="["+l.join(",")+"]";this.assign(b,n);c(n);break;case s.ObjectExpression:l=[];q(a.properties,function(a){k.recurse(a.value,
|
||||
k.nextId(),void 0,function(b){l.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+b)})});n="{"+l.join(",")+"}";this.assign(b,n);c(n);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.LocalsExpression:this.assign(b,"l");c("l");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,
|
||||
"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+
|
||||
"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/[$_a-zA-Z][$_a-zA-Z0-9]*/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),
|
||||
";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=
|
||||
this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(F(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(Q(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw ca("esc");},nextId:function(a,
|
||||
b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};td.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;aa(c,d.$filter);var e,f;if(e=qd(c))f=this.recurse(e);e=od(c.body);var g;e&&(g=[],q(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];q(c.body,function(a){h.push(d.recurse(a.expression))});e=0===c.body.length?C:1===
|
||||
c.body.length?h[0]:function(a,b){var c;q(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=rd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
|
||||
this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Ta(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Hb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Ta(a.property.name,f.expression),
|
||||
e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],q(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var m=[],r=0;r<g.length;++r)m.push(g[r](a,c,d,f));a=e.apply(void 0,m,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,
|
||||
c,d,n){var m=e(a,c,d,n),r;if(null!=m.value){sa(m.context,f.expression);md(m.value,f.expression);r=[];for(var q=0;q<g.length;++q)r.push(sa(g[q](a,c,d,n),f.expression));r=sa(m.value.apply(m.context,r),f.expression)}return b?{value:r}:r};case s.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,g,n){var m=c(a,d,g,n);a=e(a,d,g,n);sa(m.value,f.expression);Gb(m.context);m.context[m.name]=a;return b?{value:a}:a};case s.ArrayExpression:return g=[],q(a.elements,function(a){g.push(f.recurse(a))}),
|
||||
function(a,c,d,e){for(var f=[],r=0;r<g.length;++r)f.push(g[r](a,c,d,e));return b?{value:f}:f};case s.ObjectExpression:return g=[],q(a.properties,function(a){g.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},r=0;r<g.length;++r)f[g[r].key]=g[r].value(a,c,d,e);return b?{value:f}:f};case s.ThisExpression:return function(a){return b?{value:a}:a};case s.LocalsExpression:return function(a,c){return b?{value:c}:c};case s.NGValueParameter:return function(a,
|
||||
c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?-d:0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);h=nd(h,c);return d?{value:h}:h}},"binary-":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);
|
||||
h=(x(h)?h:0)-(x(c)?c:0);return d?{value:h}:h}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,
|
||||
e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,
|
||||
g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,
|
||||
name:void 0,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f=g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:void 0;b&&sa(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var l=a(f,g,h,k),n,m;null!=l&&(n=b(f,g,h,k),n+="",Ta(n,e),c&&1!==c&&(Gb(l),l&&!l[n]&&(l[n]={})),m=l[n],sa(m,e));return d?{context:l,name:n,value:m}:m}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){g=a(g,h,k,l);e&&1!==e&&(Gb(g),
|
||||
g&&!g[b]&&(g[b]={}));h=null!=g?g[b]:void 0;(d||Hb(b))&&sa(h,f);return c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var hc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(a,d);this.astCompiler=d.csp?new td(this.ast,b):new sd(this.ast,b)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var kg=Object.prototype.valueOf,ta=O("$sce"),oa={HTML:"html",CSS:"css",
|
||||
URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},mg=O("$compile"),Y=v.document.createElement("a"),xd=ra(v.location.href);yd.$inject=["$document"];Jc.$inject=["$provide"];var Fd=22,Ed=".",jc="0";zd.$inject=["$locale"];Bd.$inject=["$locale"];var xg={yyyy:W("FullYear",4,0,!1,!0),yy:W("FullYear",2,0,!0,!0),y:W("FullYear",1,0,!1,!0),MMMM:ib("Month"),MMM:ib("Month",!0),MM:W("Month",2,1),M:W("Month",1,1),LLLL:ib("Month",!1,!0),dd:W("Date",2),d:W("Date",1),HH:W("Hours",2),H:W("Hours",1),hh:W("Hours",2,-12),
|
||||
h:W("Hours",1,-12),mm:W("Minutes",2),m:W("Minutes",1),ss:W("Seconds",2),s:W("Seconds",1),sss:W("Milliseconds",3),EEEE:ib("Day"),EEE:ib("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ib(Math[0<a?"floor":"ceil"](a/60),2)+Ib(Math.abs(a%60),2))},ww:Hd(2),w:Hd(1),G:kc,GG:kc,GGG:kc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},wg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
|
||||
vg=/^\-?\d+$/;Ad.$inject=["$locale"];var qg=da(P),rg=da(sb);Cd.$inject=["$parse"];var ne=da({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ma.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),tb={};q(Cb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=xa("ng-"+b),e=d;"checked"===a&&(e=function(a,
|
||||
b,e){e.ngModel!==e[c]&&d(a,b,e)});tb[c]=function(){return{restrict:"A",priority:100,link:e}}}});q(ad,function(a,b){tb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(zg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});q(["src","srcset","href"],function(a){var b=xa("ng-"+a);tb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===
|
||||
ma.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Jb={$addControl:C,$$renameControl:function(a,b){a.$name=b},$removeControl:C,$setValidity:C,$setDirty:C,$setPristine:C,$setSubmitted:C};Id.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Rd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||C}return{name:"form",
|
||||
restrict:a?"EAC":"E",require:["form","^^?form"],controller:Id,compile:function(d,f){d.addClass(Ua).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var m=f[0];if(!("action"in e)){var r=function(b){a.$apply(function(){m.$commitViewValue();m.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",r,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",r,!1)},0,!1)})}(f[1]||m.$$parentForm).$addControl(m);var q=g?c(m.$name):C;g&&
|
||||
(q(a,m),e.$observe(g,function(b){m.$name!==b&&(q(a,void 0),m.$$parentForm.$$renameControl(m,b),q=c(m.$name),q(a,m))}));d.on("$destroy",function(){m.$$parentForm.$removeControl(m);q(a,void 0);R(m,Jb)})}}}}}]},oe=Rd(),Be=Rd(!0),yg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,Hg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ig=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
|
||||
Jg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Sd=/^(\d{4,})-(\d{2})-(\d{2})$/,Td=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,nc=/^(\d{4,})-W(\d\d)$/,Ud=/^(\d{4,})-(\d\d)$/,Vd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Kd=T();q(["date","datetime-local","month","time","week"],function(a){Kd[a]=!0});var Wd={text:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c)},date:kb("date",Sd,Lb(Sd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Td,Lb(Td,"yyyy MM dd HH mm ss sss".split(" ")),
|
||||
"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Vd,Lb(Vd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",nc,function(a,b){if(fa(a))return a;if(F(a)){nc.lastIndex=0;var d=nc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Gd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:kb("month",Ud,Lb(Ud,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Ld(a,b,d,c);jb(a,b,d,c,e,f);c.$$parserName=
|
||||
"number";c.$parsers.push(function(a){if(c.$isEmpty(a))return null;if(Jg.test(a))return parseFloat(a)});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!Q(a))throw lb("numfmt",a);a=a.toString()}return a});if(x(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||y(g)||a>=g};d.$observe("min",function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));g=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}if(x(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||y(h)||a<=h};d.$observe("max",
|
||||
function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));h=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}},url:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||Hg.test(d)}},email:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Ig.test(d)}},radio:function(a,b,d,c){y(d.name)&&b.attr("name",++nb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,
|
||||
a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Md(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Md(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return pa(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:C,button:C,submit:C,reset:C,
|
||||
file:C},Dc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Wd[P(g.type)]||Wd.text)(e,f,g,h[0],b,a,d,c)}}}}],Kg=/^(true|false|\d+)$/,Te=function(){return{restrict:"A",priority:100,compile:function(a,b){return Kg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},te=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);
|
||||
return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=y(a)?"":a})}}}}],ve=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=y(a)?"":a})}}}}],ue=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=
|
||||
b(e.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Se=da({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),we=mc("",!0),ye=mc("Odd",0),xe=mc("Even",1),ze=La({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ae=[function(){return{restrict:"A",scope:!0,controller:"@",
|
||||
priority:500}}],Ic={},Lg={blur:!0,focus:!0};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=xa("ng-"+a);Ic[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Lg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var De=["$animate","$compile",function(a,
|
||||
b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l=rb(h.clone),a.leave(l).then(function(){l=null}),h=null))})}}}],Ee=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,
|
||||
transclude:"element",controller:ea.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,n,m,r){var q=0,s,w,p,y=function(){w&&(w.remove(),w=null);s&&(s.$destroy(),s=null);p&&(d.leave(p).then(function(){w=null}),w=p,p=null)};c.$watch(f,function(f){var n=function(){!x(h)||h&&!c.$eval(h)||b()},u=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&u===q){var b=c.$new();m.template=a;a=r(b,function(a){y();d.enter(a,null,e).then(n)});s=b;p=a;s.$emit("$includeContentLoaded",
|
||||
f);c.$eval(g)}},function(){c.$$destroyed||u!==q||(y(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(y(),m.template=null)})}}}}],Ve=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ma.call(d[0]).match(/SVG/)?(d.empty(),a(Lc(e.template,v.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Fe=La({priority:450,compile:function(){return{pre:function(a,
|
||||
b,d){a.$eval(d.ngInit)}}}}),Re=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!y(a)){var b=[];a&&q(a.split(g),function(a){a&&b.push(f?V(a):a)});return b}});c.$formatters.push(function(a){if(K(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",Nd="ng-invalid",Ua="ng-pristine",Kb="ng-dirty",Pd="ng-pending",lb=O("ngModel"),Mg=["$scope",
|
||||
"$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=l(d.name||"",!1)(a);
|
||||
this.$$parentForm=Jb;var n=e(d.ngModel),m=n.assign,r=n,s=m,v=null,w,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");r=function(a){var c=n(a);E(c)&&(c=b(a));return c};s=function(a,b){E(n(a))?f(a,{$$$p:b}):m(a,b)}}else if(!n.assign)throw lb("nonassign",d.ngModel,wa(c));};this.$render=C;this.$isEmpty=function(a){return y(a)||""===a||null===a||a!==a};this.$$updateEmptyClasses=function(a){p.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),
|
||||
f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var H=0;Jd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;f.removeClass(c,Kb);f.addClass(c,Ua)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;f.removeClass(c,Ua);f.addClass(c,Kb);p.$$parentForm.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};
|
||||
this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(v);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!Q(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:void 0,p.$modelValue!==c&&p.$$writeModelToScope())})}};
|
||||
this.$$runValidators=function(a,b,c){function d(){var c=!0;q(p.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(q(p.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;q(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!E(h.then))throw lb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)},C):g(!0)}function f(a,b){h===H&&p.$setValidity(a,b)}function g(a){h===H&&c(a)}H++;var h=
|
||||
H;(function(){var a=p.$$parserName||"parse";if(y(w))f(a,null);else return w||(q(p.$validators,function(a,b){f(b,null)}),q(p.$asyncValidators,function(a,b){f(b,null)})),f(a,w),w;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(v);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$updateEmptyClasses(a),p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;
|
||||
if(w=y(b)?void 0:!0)for(var c=0;c<p.$parsers.length;c++)if(b=p.$parsers[c](b),y(b)){w=!1;break}Q(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=r(a));var d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=b;e&&(p.$modelValue=b,p.$modelValue!==d&&p.$$writeModelToScope());p.$$runValidators(b,p.$$lastCommittedViewValue,function(a){e||(p.$modelValue=a?b:void 0,p.$modelValue!==d&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){s(a,p.$modelValue);q(p.$viewChangeListeners,
|
||||
function(a){try{a()}catch(c){b(c)}})};this.$setViewValue=function(a,b){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(b)};this.$$debounceViewValueCommit=function(b){var c=0,d=p.$options;d&&x(d.debounce)&&(d=d.debounce,Q(d)?c=d:Q(d[b])?c=d[b]:Q(d["default"])&&(c=d["default"]));g.cancel(v);c?v=g(function(){p.$commitViewValue()},c):h.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var b=r(a);if(b!==p.$modelValue&&(p.$modelValue===
|
||||
p.$modelValue||b===b)){p.$modelValue=p.$$rawModelValue=b;w=void 0;for(var c=p.$formatters,d=c.length,e=b;d--;)e=c[d](e);p.$viewValue!==e&&(p.$$updateEmptyClasses(e),p.$viewValue=p.$$lastCommittedViewValue=e,p.$render(),p.$$runValidators(b,e,C))}return b})}],Qe=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Mg,priority:1,compile:function(b){b.addClass(Ua).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||
|
||||
g.$$parentForm;g.$$setOptions(f[2]&&f[2].$options);b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){var g=f[0];if(g.$options&&g.$options.updateOn)c.on(g.$options.updateOn,function(a){g.$$debounceViewValueCommit(a&&a.type)});c.on("blur",function(){g.$touched||(a.$$phase?b.$evalAsync(g.$setTouched):b.$apply(g.$setTouched))})}}}}}],Ng=/(\s+|^)default(\s+|$)/,Ue=function(){return{restrict:"A",
|
||||
controller:["$scope","$attrs",function(a,b){var d=this;this.$options=qa(a.$eval(b.ngModelOptions));x(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=V(this.$options.updateOn.replace(Ng,function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ge=La({terminal:!0,priority:1E3}),Og=O("ngOptions"),Pg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
|
||||
Oe=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!q&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var m=a.match(Pg);if(!m)throw Og("iexp",a,wa(b));var r=m[5]||m[7],q=m[6];a=/ as /.test(m[0])&&m[1];var s=m[9];b=d(m[2]?m[1]:r);var w=a&&d(a)||b,p=s&&d(s),v=s?function(a,b){return p(c,b)}:function(a){return Fa(a)},
|
||||
t=function(a,b){return v(a,L(a,b))},z=d(m[2]||m[1]),u=d(m[3]||""),y=d(m[4]||""),x=d(m[8]),D={},L=q?function(a,b){D[q]=b;D[r]=a;return D}:function(a){D[r]=a;return D};return{trackBy:s,getTrackByValue:t,getWatchables:d(x,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var h=a===d?g:d[g],l=a[h],h=L(l,h),l=v(l,h);b.push(l);if(m[2]||m[1])l=z(c,h),b.push(l);m[4]&&(h=y(c,h),b.push(h))}return b}),getOptions:function(){for(var a=[],b={},d=x(c)||[],g=f(d),h=g.length,m=0;m<h;m++){var p=d===
|
||||
g?m:g[m],q=L(d[p],p),r=w(c,q),p=v(r,q),D=z(c,q),N=u(c,q),q=y(c,q),r=new e(p,r,D,N,q);a.push(r);b[p]=r}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[t(a)]},getViewValueFromOption:function(a){return s?ea.copy(a.viewValue):a.viewValue}}}}}var e=v.document.createElement("option"),f=v.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=C},post:function(d,h,k,l){function n(a,b){a.element=
|
||||
b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);a.value!==b.value&&(b.value=a.selectValue)}function m(){var a=u&&r.readValue();if(u)for(var b=u.items.length-1;0<=b;b--){var c=u.items[b];c.group?Bb(c.element.parentNode):Bb(c.element)}u=I.getOptions();var d={};t&&h.prepend(w);u.items.forEach(function(a){var b;if(x(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),E.appendChild(b),b.label=a.group,d[a.group]=b);var c=e.cloneNode(!1)}else b=E,c=e.cloneNode(!1);b.appendChild(c);
|
||||
n(a,c)});h[0].appendChild(E);s.$render();s.$isEmpty(a)||(b=r.readValue(),(I.trackBy||v?pa(a,b):a===b)||(s.$setViewValue(b),s.$render()))}var r=l[0],s=l[1],v=k.multiple,w;l=0;for(var p=h.children(),y=p.length;l<y;l++)if(""===p[l].value){w=p.eq(l);break}var t=!!w,z=B(e.cloneNode(!1));z.val("?");var u,I=c(k.ngOptions,h,d),E=b[0].createDocumentFragment();v?(s.$isEmpty=function(a){return!a||0===a.length},r.writeValue=function(a){u.items.forEach(function(a){a.element.selected=!1});a&&a.forEach(function(a){if(a=
|
||||
u.getOptionFromViewValue(a))a.element.selected=!0})},r.readValue=function(){var a=h.val()||[],b=[];q(a,function(a){(a=u.selectValueMap[a])&&!a.disabled&&b.push(u.getViewValueFromOption(a))});return b},I.trackBy&&d.$watchCollection(function(){if(K(s.$viewValue))return s.$viewValue.map(function(a){return I.getTrackByValue(a)})},function(){s.$render()})):(r.writeValue=function(a){var b=u.getOptionFromViewValue(a);b?(h[0].value!==b.selectValue&&(z.remove(),t||w.remove(),h[0].value=b.selectValue,b.element.selected=
|
||||
!0),b.element.setAttribute("selected","selected")):null===a||t?(z.remove(),t||h.prepend(w),h.val(""),w.prop("selected",!0),w.attr("selected",!0)):(t||w.remove(),h.prepend(z),h.val("?"),z.prop("selected",!0),z.attr("selected",!0))},r.readValue=function(){var a=u.selectValueMap[h.val()];return a&&!a.disabled?(t||w.remove(),z.remove(),u.getViewValueFromOption(a)):null},I.trackBy&&d.$watch(function(){return I.getTrackByValue(s.$viewValue)},function(){s.$render()}));t?(w.remove(),a(w)(d),w.removeClass("ng-scope")):
|
||||
w=B(e.cloneNode(!1));h.empty();m();d.$watchCollection(I.getWatchables,m)}}}}],He=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,h){function k(a){g.text(a||"")}var l=h.count,n=h.$attr.when&&g.attr(h.$attr.when),m=h.offset||0,r=f.$eval(n)||{},s={},v=b.startSymbol(),w=b.endSymbol(),p=v+l+"-"+m+w,x=ea.noop,t;q(h,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+P(c[2]),r[c]=g.attr(h.$attr[b]))});q(r,function(a,d){s[d]=b(a.replace(c,p))});f.$watch(l,
|
||||
function(b){var c=parseFloat(b),e=isNaN(c);e||c in r||(c=a.pluralCat(c-m));c===t||e&&Q(t)&&isNaN(t)||(x(),e=s[c],y(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+n),x=C,k()):x=f.$watch(e,k),t=c)})}}}],Ie=["$parse","$animate","$compile",function(a,b,d){var c=O("ngRepeat"),e=function(a,b,c,d,e,n,m){a[c]=d;e&&(a[e]=n);a.$index=b;a.$first=0===b;a.$last=b===m-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,
|
||||
terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,k=d.$$createComment("end ngRepeat",h),l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!l)throw c("iexp",h);var n=l[1],m=l[2],r=l[3],s=l[4],l=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!l)throw c("iidexp",n);var v=l[3]||l[1],w=l[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw c("badident",
|
||||
r);var p,y,t,z,u={$id:Fa};s?p=a(s):(t=function(a,b){return Fa(b)},z=function(a){return a});return function(a,d,f,g,l){p&&(y=function(b,c,d){w&&(u[w]=b);u[v]=c;u.$index=d;return p(a,u)});var n=T();a.$watchCollection(m,function(f){var g,m,p=d[0],s,u=T(),x,D,E,C,F,B,G;r&&(a[r]=f);if(ya(f))F=f,m=y||t;else for(G in m=y||z,F=[],f)ua.call(f,G)&&"$"!==G.charAt(0)&&F.push(G);x=F.length;G=Array(x);for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],C=m(D,E,g),n[C])B=n[C],delete n[C],u[C]=B,G[g]=B;else{if(u[C])throw q(G,
|
||||
function(a){a&&a.scope&&(n[a.id]=a)}),c("dupes",h,C,E);G[g]={id:C,scope:void 0,clone:void 0};u[C]=!0}for(s in n){B=n[s];C=rb(B.clone);b.leave(C);if(C[0].parentNode)for(g=0,m=C.length;g<m;g++)C[g].$$NG_REMOVED=!0;B.scope.$destroy()}for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],B=G[g],B.scope){s=p;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);B.clone[0]!=s&&b.move(rb(B.clone),null,p);p=B.clone[B.clone.length-1];e(B.scope,g,v,E,w,D,x)}else l(function(a,c){B.scope=c;var d=k.cloneNode(!1);a[a.length++]=d;b.enter(a,
|
||||
null,p);p=d;B.clone=a;u[B.id]=B;e(B.scope,g,v,E,w,D,x)});n=u})}}}}],Je=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ce=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ke=La(function(a,b,d){a.$watch(d.ngStyle,function(a,
|
||||
d){d&&a!==d&&q(d,function(a,c){b.css(c,"")});a&&b.css(a)},!0)}),Le=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],h=[],k=[],l=[],n=function(a,b){return function(){a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=k.length;d<e;++d)a.cancel(k[d]);d=k.length=0;for(e=l.length;d<e;++d){var s=rb(h[d].clone);l[d].$destroy();(k[d]=a.leave(s)).then(n(k,d))}h.length=0;l.length=0;(g=f.cases["!"+
|
||||
c]||f.cases["?"])&&q(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Me=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["!"+d.ngSwitchWhen]=c.cases["!"+d.ngSwitchWhen]||[];c.cases["!"+d.ngSwitchWhen].push({transclude:e,element:b})}}),Ne=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
|
||||
b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),Qg=O("ngTransclude"),Pe=La({restrict:"EAC",link:function(a,b,d,c,e){d.ngTransclude===d.$attr.ngTransclude&&(d.ngTransclude="");if(!e)throw Qg("orphan",wa(b));e(function(a){a.length&&(b.empty(),b.append(a))},null,d.ngTransclude||d.ngTranscludeSlot)}}),pe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"==d.type&&a.put(d.id,b[0].text)}}}],Rg={$setViewValue:C,$render:C},
|
||||
Sg=["$element","$scope",function(a,b){var d=this,c=new Ra;d.ngModelCtrl=Rg;d.unknownOption=B(v.document.createElement("option"));d.renderUnknownOption=function(b){b="? "+Fa(b)+" ?";d.unknownOption.val(b);a.prepend(d.unknownOption);a.val(b)};b.$on("$destroy",function(){d.renderUnknownOption=C});d.removeUnknownOption=function(){d.unknownOption.parent()&&d.unknownOption.remove()};d.readValue=function(){d.removeUnknownOption();return a.val()};d.writeValue=function(b){d.hasOption(b)?(d.removeUnknownOption(),
|
||||
a.val(b),""===b&&d.emptyOption.prop("selected",!0)):null==b&&d.emptyOption?(d.removeUnknownOption(),a.val("")):d.renderUnknownOption(b)};d.addOption=function(a,b){if(8!==b[0].nodeType){Qa(a,'"option value"');""===a&&(d.emptyOption=b);var g=c.get(a)||0;c.put(a,g+1);d.ngModelCtrl.$render();b[0].hasAttribute("selected")&&(b[0].selected=!0)}};d.removeOption=function(a){var b=c.get(a);b&&(1===b?(c.remove(a),""===a&&(d.emptyOption=void 0)):c.put(a,b-1))};d.hasOption=function(a){return!!c.get(a)};d.registerOption=
|
||||
function(a,b,c,h,k){if(h){var l;c.$observe("value",function(a){x(l)&&d.removeOption(l);l=a;d.addOption(a,b)})}else k?a.$watch(k,function(a,e){c.$set("value",a);e!==a&&d.removeOption(e);d.addOption(a,b)}):d.addOption(c.value,b);b.on("$destroy",function(){d.removeOption(c.value);d.ngModelCtrl.$render()})}}],qe=function(){return{restrict:"E",require:["select","?ngModel"],controller:Sg,priority:1,link:{pre:function(a,b,d,c){var e=c[1];if(e){var f=c[0];f.ngModelCtrl=e;b.on("change",function(){a.$apply(function(){e.$setViewValue(f.readValue())})});
|
||||
if(d.multiple){f.readValue=function(){var a=[];q(b.find("option"),function(b){b.selected&&a.push(b.value)});return a};f.writeValue=function(a){var c=new Ra(a);q(b.find("option"),function(a){a.selected=x(c.get(a.value))})};var g,h=NaN;a.$watch(function(){h!==e.$viewValue||pa(g,e.$viewValue)||(g=ha(e.$viewValue),e.$render());h=e.$viewValue});e.$isEmpty=function(a){return!a||0===a.length}}}},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},se=["$interpolate",
|
||||
function(a){return{restrict:"E",priority:100,compile:function(b,d){if(x(d.value))var c=a(d.value,!0);else{var e=a(b.text(),!0);e||d.$set("value",b.text())}return function(a,b,d){var k=b.parent();(k=k.data("$selectController")||k.parent().data("$selectController"))&&k.registerOption(a,b,d,c,e)}}}}],re=da({restrict:"E",terminal:!1}),Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){c&&(d.required=!0,c.$validators.required=function(a,b){return!d.required||!c.$isEmpty(b)},d.$observe("required",
|
||||
function(){c.$validate()}))}}},Ec=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e,f=d.ngPattern||d.pattern;d.$observe("pattern",function(a){F(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw O("ngPattern")("noregexp",f,a,wa(b));e=a||void 0;c.$validate()});c.$validators.pattern=function(a,b){return c.$isEmpty(b)||y(e)||e.test(b)}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=-1;d.$observe("maxlength",function(a){a=
|
||||
X(a);e=isNaN(a)?-1:a;c.$validate()});c.$validators.maxlength=function(a,b){return 0>e||c.$isEmpty(b)||b.length<=e}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=X(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};v.angular.bootstrap?v.console&&console.log("WARNING: Tried to load angular more than once."):(ie(),ke(ea),ea.module("ngLocale",[],["$provide",function(a){function b(a){a+=
|
||||
"";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),
|
||||
WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,
|
||||
c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),B(v.document).ready(function(){ee(v.document,yc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
|
||||
//# sourceMappingURL=angular.min.js.map
|
BIN
js/vendor/angular/angular.min.js.gzip
vendored
BIN
js/vendor/angular/angular.min.js.gzip
vendored
Binary file not shown.
8
js/vendor/angular/angular.min.js.map
vendored
8
js/vendor/angular/angular.min.js.map
vendored
File diff suppressed because one or more lines are too long
9
js/vendor/angular/bower.json
vendored
9
js/vendor/angular/bower.json
vendored
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"name": "angular",
|
||||
"version": "1.5.5",
|
||||
"license": "MIT",
|
||||
"main": "./angular.js",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
2
js/vendor/angular/index.js
vendored
2
js/vendor/angular/index.js
vendored
|
@ -1,2 +0,0 @@
|
|||
require('./angular');
|
||||
module.exports = angular;
|
25
js/vendor/angular/package.json
vendored
25
js/vendor/angular/package.json
vendored
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"name": "angular",
|
||||
"version": "1.5.5",
|
||||
"description": "HTML enhanced for web apps",
|
||||
"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",
|
||||
"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"
|
||||
}
|
164
js/vendor/ical.js/README.md
vendored
164
js/vendor/ical.js/README.md
vendored
|
@ -1,164 +0,0 @@
|
|||
# jsical - Javascript parser for rfc5545
|
||||
|
||||
This is a library to parse the iCalendar format defined in
|
||||
[rfc5545](http://tools.ietf.org/html/rfc5545), as well as similar formats like
|
||||
vCard.
|
||||
|
||||
There are still some issues to be taken care of, but the library works for most
|
||||
cases. If you would like to help out and would like to discuss any API changes,
|
||||
please [contact me](mailto:mozilla@kewis.ch) or create an issue.
|
||||
|
||||
The initial goal was to use it as a replacement for libical in the [Mozilla
|
||||
Calendar Project](http://www.mozilla.org/projects/calendar/), but the library
|
||||
has been written with the web in mind. This library is now called ICAL.js and
|
||||
enables you to do all sorts of cool experiments with calendar data and the web.
|
||||
I am also aiming for a caldav.js when this is done. Most algorithms here were
|
||||
taken from [libical](https://github.com/libical/libical). If you are bugfixing
|
||||
this library, please check if the fix can be upstreamed to libical.
|
||||
|
||||
[![Build Status](https://secure.travis-ci.org/mozilla-comm/ical.js.png?branch=master)](http://travis-ci.org/mozilla-comm/ical.js) [![Coverage Status](https://coveralls.io/repos/mozilla-comm/ical.js/badge.svg)](https://coveralls.io/r/mozilla-comm/ical.js) [![npm version](https://badge.fury.io/js/ical.js.svg)](http://badge.fury.io/js/ical.js)
|
||||
[![Dependency Status](https://david-dm.org/mozilla-comm/ical.js.svg)](https://david-dm.org/mozilla-comm/ical.js) [![devDependency Status](https://david-dm.org/mozilla-comm/ical.js/dev-status.svg)](https://david-dm.org/mozilla-comm/ical.js#info=devDependencies)
|
||||
|
||||
## Sandbox and Validator
|
||||
|
||||
If you want to try out ICAL.js right now, there is a
|
||||
[jsfiddle](http://jsfiddle.net/kewisch/227efboL/) set up and ready to use. Read
|
||||
on for documentation and example links.
|
||||
|
||||
There is also a validator that demonstrates how to use the library in a webpage
|
||||
in the [sandbox/](https://github.com/mozilla-comm/ical.js/tree/master/sandbox)
|
||||
subdirectory.
|
||||
|
||||
[Try the validator online](http://mozilla-comm.github.com/ical.js/validator.html), it always uses the latest copy of ICAL.js.
|
||||
|
||||
## Installing
|
||||
|
||||
You can install ICAL.js via [npm](https://www.npmjs.com/), if you would like to
|
||||
use it in node:
|
||||
```
|
||||
npm install ical.js
|
||||
```
|
||||
|
||||
Alternatively, it is also available via [bower](http://bower.io/) for front-end
|
||||
development:
|
||||
```
|
||||
bower install ical.js
|
||||
```
|
||||
|
||||
ICAL.js has no dependencies and uses fairly basic JavaScript. Therefore, it
|
||||
should work in all versions of node and modern browsers. It does use getters
|
||||
and setters, so the minimum version of Internet Explorer is 9.
|
||||
|
||||
## Documentation
|
||||
|
||||
For a few guides with code samples, please check out
|
||||
[the wiki](https://github.com/mozilla-comm/ical.js/wiki). If you prefer,
|
||||
full API documentation [is available here](http://mozilla-comm.github.io/ical.js/api/).
|
||||
If you are missing anything, please don't hesitate to create an issue.
|
||||
|
||||
## Developing
|
||||
|
||||
To contribute to ICAL.js you need to set up the development environment. This
|
||||
requires node 0.10.x or later and grunt. Run the following steps to get
|
||||
started.
|
||||
|
||||
npm install -g grunt-cli # Might need to run with sudo
|
||||
npm install .
|
||||
|
||||
You can now dive into the code, run the tests and check coverage.
|
||||
|
||||
### Tests
|
||||
|
||||
Tests can either be run via node or in the browser, but setting up the testing
|
||||
infrastructure requires [node](https://github.com/joyent/node). More
|
||||
information on how to set up and run tests can be found on
|
||||
[the wiki](https://github.com/mozilla-comm/ical.js/wiki/Running-Tests).
|
||||
|
||||
#### in node js
|
||||
|
||||
The quickest way to execute tests is using node. Running the following command
|
||||
will run all test suites: performance, acceptance and unit tests.
|
||||
|
||||
grunt test-node
|
||||
|
||||
You can also select a single suite, or run a single test.
|
||||
|
||||
grunt test-node:performance
|
||||
grunt test-node:acceptance
|
||||
grunt test-node:unit
|
||||
|
||||
grunt test-node:single --test test/parse_test.js
|
||||
|
||||
Appending the `--debug` option to any of the above commands will run the
|
||||
test(s) with node-inspector. It will start the debugging server and open it in
|
||||
Chrome or Opera, depending on what you have installed. The tests will pause
|
||||
before execution starts so you can set breakpoints and debug the unit tests
|
||||
you are working on.
|
||||
|
||||
If you run the performance tests comparison will be done between the current
|
||||
working version (latest), a previous build of ICAL.js (previous) and the
|
||||
unchanged copy of build/ical.js (from the master branch). See
|
||||
[the wiki](https://github.com/mozilla-comm/ical.js/wiki/Running-Tests) for more
|
||||
details.
|
||||
|
||||
#### in the browser (with karma)
|
||||
|
||||
There are currently two ways to run the browser tests because we are currently
|
||||
experimenting with using [karma](http://karma-runner.github.io/). To run tests
|
||||
with karma, you can run the following targets:
|
||||
|
||||
grunt karma:unit # run only the unit tests
|
||||
grunt karma:acceptance # run the acceptance tests
|
||||
|
||||
Now you can visit [http://localhost:9876](http://localhost:9876) in your
|
||||
browser. The test output will be shown in the console you started the grunt
|
||||
task from. You can also run a single test:
|
||||
|
||||
grunt karma:single --test test/parse_test.js
|
||||
|
||||
The mentioned targets all run the tests from start to finish. If you would like
|
||||
to debug the tests instead, you can add the `--debug` flag. Once you open the
|
||||
browser there will be a "debug" button. Clicking on the button opens am empty
|
||||
page, but if you open your browser's developer tools you will see the test
|
||||
output. You can reload this page as often as you want until all tests are
|
||||
running.
|
||||
|
||||
Last off, if you add the `--remote` option, karma will listen on all
|
||||
interfaces. This is useful if you are running the browser to test in a VM, for
|
||||
example when using [Internet Exporer VM images](https://www.modern.ie/virtualization-tools).
|
||||
|
||||
#### in the browser (the old way)
|
||||
|
||||
Running `grunt test-server` will start a webserver and open the page in your
|
||||
browser. You can then select and execute tests as you wish. If you want to run
|
||||
all tests you can also open a second terminal and run `grunt test-browser`
|
||||
|
||||
### Code Coverage
|
||||
ICAL.js is set up to calculate code coverage. You can
|
||||
[view the coverage results](https://coveralls.io/r/mozilla-comm/ical.js)
|
||||
online, or run them locally to make sure new code is covered. Running `grunt
|
||||
coverage` will run the unit test suite measuring coverage. You can then open
|
||||
`coverage/lcov-report/index.html` to view the results in your browser.
|
||||
|
||||
### Linters
|
||||
To make sure all ICAL.js code uses a common style, please run the linters using
|
||||
`grunt linters`. Please make sure you fix any issues shown by this command
|
||||
before sending a pull request.
|
||||
|
||||
### Documentation
|
||||
You can generate the documentation locally, this is also helpful to ensure the
|
||||
jsdoc you have written is valid. To do so, run `grunt jsdoc`. You will find the
|
||||
output in the `api/` subdirectory.
|
||||
|
||||
### Packaging
|
||||
When you are done with your work, you can run `grunt package` to create the
|
||||
single-file build for use in the browser, including its minified counterpart
|
||||
and the source map. These files need to be checked in (in a separate commit)
|
||||
and can be found in [build/ical.js](build/ical.js),
|
||||
[build/ical.min.js](build/ical.min.js) and
|
||||
[build/ical.min.js.map](build/ical.min.js.map). Please see
|
||||
[CONTRIBUTING.md](CONTRIBUTING.md) for more details.
|
||||
|
||||
## License
|
||||
ical.js is licensed under the
|
||||
[Mozilla Public License](https://www.mozilla.org/MPL/2.0/), version 2.0.
|
9313
js/vendor/ical.js/build/ical.js
vendored
9313
js/vendor/ical.js/build/ical.js
vendored
File diff suppressed because it is too large
Load diff
181
js/vendor/ical.js/lib/ical/binary.js
vendored
181
js/vendor/ical.js/lib/ical/binary.js
vendored
|
@ -1,181 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.Binary = (function() {
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents the BINARY value type, which contains extra methods for
|
||||
* encoding and decoding.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.Binary
|
||||
* @param {String} aValue The binary data for this value
|
||||
*/
|
||||
function Binary(aValue) {
|
||||
this.value = aValue;
|
||||
}
|
||||
|
||||
Binary.prototype = {
|
||||
/**
|
||||
* The type name, to be used in the jCal object.
|
||||
* @default "binary"
|
||||
* @constant
|
||||
*/
|
||||
icaltype: "binary",
|
||||
|
||||
/**
|
||||
* Base64 decode the current value
|
||||
*
|
||||
* @return {String} The base64-decoded value
|
||||
*/
|
||||
decodeValue: function decodeValue() {
|
||||
return this._b64_decode(this.value);
|
||||
},
|
||||
|
||||
/**
|
||||
* Encodes the passed parameter with base64 and sets the internal
|
||||
* value to the result.
|
||||
*
|
||||
* @param {String} aValue The raw binary value to encode
|
||||
*/
|
||||
setEncodedValue: function setEncodedValue(aValue) {
|
||||
this.value = this._b64_encode(aValue);
|
||||
},
|
||||
|
||||
_b64_encode: function base64_encode(data) {
|
||||
// http://kevin.vanzonneveld.net
|
||||
// + original by: Tyler Akins (http://rumkin.com)
|
||||
// + improved by: Bayron Guevara
|
||||
// + improved by: Thunder.m
|
||||
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// + bugfixed by: Pellentesque Malesuada
|
||||
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// + improved by: Rafał Kukawski (http://kukawski.pl)
|
||||
// * example 1: base64_encode('Kevin van Zonneveld');
|
||||
// * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
|
||||
// mozilla has this native
|
||||
// - but breaks in 2.0.0.12!
|
||||
//if (typeof this.window['atob'] == 'function') {
|
||||
// return atob(data);
|
||||
//}
|
||||
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
||||
"abcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
|
||||
ac = 0,
|
||||
enc = "",
|
||||
tmp_arr = [];
|
||||
|
||||
if (!data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
do { // pack three octets into four hexets
|
||||
o1 = data.charCodeAt(i++);
|
||||
o2 = data.charCodeAt(i++);
|
||||
o3 = data.charCodeAt(i++);
|
||||
|
||||
bits = o1 << 16 | o2 << 8 | o3;
|
||||
|
||||
h1 = bits >> 18 & 0x3f;
|
||||
h2 = bits >> 12 & 0x3f;
|
||||
h3 = bits >> 6 & 0x3f;
|
||||
h4 = bits & 0x3f;
|
||||
|
||||
// use hexets to index into b64, and append result to encoded string
|
||||
tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
|
||||
} while (i < data.length);
|
||||
|
||||
enc = tmp_arr.join('');
|
||||
|
||||
var r = data.length % 3;
|
||||
|
||||
return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
|
||||
|
||||
},
|
||||
|
||||
_b64_decode: function base64_decode(data) {
|
||||
// http://kevin.vanzonneveld.net
|
||||
// + original by: Tyler Akins (http://rumkin.com)
|
||||
// + improved by: Thunder.m
|
||||
// + input by: Aman Gupta
|
||||
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// + bugfixed by: Onno Marsman
|
||||
// + bugfixed by: Pellentesque Malesuada
|
||||
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// + input by: Brett Zamir (http://brett-zamir.me)
|
||||
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
|
||||
// * returns 1: 'Kevin van Zonneveld'
|
||||
// mozilla has this native
|
||||
// - but breaks in 2.0.0.12!
|
||||
//if (typeof this.window['btoa'] == 'function') {
|
||||
// return btoa(data);
|
||||
//}
|
||||
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
||||
"abcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
|
||||
ac = 0,
|
||||
dec = "",
|
||||
tmp_arr = [];
|
||||
|
||||
if (!data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
data += '';
|
||||
|
||||
do { // unpack four hexets into three octets using index points in b64
|
||||
h1 = b64.indexOf(data.charAt(i++));
|
||||
h2 = b64.indexOf(data.charAt(i++));
|
||||
h3 = b64.indexOf(data.charAt(i++));
|
||||
h4 = b64.indexOf(data.charAt(i++));
|
||||
|
||||
bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
|
||||
|
||||
o1 = bits >> 16 & 0xff;
|
||||
o2 = bits >> 8 & 0xff;
|
||||
o3 = bits & 0xff;
|
||||
|
||||
if (h3 == 64) {
|
||||
tmp_arr[ac++] = String.fromCharCode(o1);
|
||||
} else if (h4 == 64) {
|
||||
tmp_arr[ac++] = String.fromCharCode(o1, o2);
|
||||
} else {
|
||||
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
|
||||
}
|
||||
} while (i < data.length);
|
||||
|
||||
dec = tmp_arr.join('');
|
||||
|
||||
return dec;
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this value
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function() {
|
||||
return this.value;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a binary value from the given string.
|
||||
*
|
||||
* @param {String} aString The binary value string
|
||||
* @return {ICAL.Binary} The binary value instance
|
||||
*/
|
||||
Binary.fromString = function(aString) {
|
||||
return new Binary(aString);
|
||||
};
|
||||
|
||||
return Binary;
|
||||
}());
|
508
js/vendor/ical.js/lib/ical/component.js
vendored
508
js/vendor/ical.js/lib/ical/component.js
vendored
|
@ -1,508 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.Component = (function() {
|
||||
'use strict';
|
||||
|
||||
var PROPERTY_INDEX = 1;
|
||||
var COMPONENT_INDEX = 2;
|
||||
var NAME_INDEX = 0;
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Wraps a jCal component, adding convenience methods to add, remove and
|
||||
* update subcomponents and properties.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.Component
|
||||
* @param {Array|String} jCal Raw jCal component data OR name of new
|
||||
* component
|
||||
* @param {ICAL.Component} parent Parent component to associate
|
||||
*/
|
||||
function Component(jCal, parent) {
|
||||
if (typeof(jCal) === 'string') {
|
||||
// jCal spec (name, properties, components)
|
||||
jCal = [jCal, [], []];
|
||||
}
|
||||
|
||||
// mostly for legacy reasons.
|
||||
this.jCal = jCal;
|
||||
|
||||
this.parent = parent || null;
|
||||
}
|
||||
|
||||
Component.prototype = {
|
||||
/**
|
||||
* Hydrated properties are inserted into the _properties array at the same
|
||||
* position as in the jCal array, so its possible the array contains
|
||||
* undefined values for unhydrdated properties. To avoid iterating the
|
||||
* array when checking if all properties have been hydrated, we save the
|
||||
* count here.
|
||||
*
|
||||
* @type {Number}
|
||||
* @private
|
||||
*/
|
||||
_hydratedPropertyCount: 0,
|
||||
|
||||
/**
|
||||
* The same count as for _hydratedPropertyCount, but for subcomponents
|
||||
*
|
||||
* @type {Number}
|
||||
* @private
|
||||
*/
|
||||
_hydratedComponentCount: 0,
|
||||
|
||||
/**
|
||||
* The name of this component
|
||||
* @readonly
|
||||
*/
|
||||
get name() {
|
||||
return this.jCal[NAME_INDEX];
|
||||
},
|
||||
|
||||
/**
|
||||
* The design set for this component, e.g. icalendar vs vcard
|
||||
*
|
||||
* @type {ICAL.design.designSet}
|
||||
* @private
|
||||
*/
|
||||
get _designSet() {
|
||||
var parentDesign = this.parent && this.parent._designSet;
|
||||
return parentDesign || ICAL.design.getDesignSet(this.name);
|
||||
},
|
||||
|
||||
_hydrateComponent: function(index) {
|
||||
if (!this._components) {
|
||||
this._components = [];
|
||||
this._hydratedComponentCount = 0;
|
||||
}
|
||||
|
||||
if (this._components[index]) {
|
||||
return this._components[index];
|
||||
}
|
||||
|
||||
var comp = new Component(
|
||||
this.jCal[COMPONENT_INDEX][index],
|
||||
this
|
||||
);
|
||||
|
||||
this._hydratedComponentCount++;
|
||||
return (this._components[index] = comp);
|
||||
},
|
||||
|
||||
_hydrateProperty: function(index) {
|
||||
if (!this._properties) {
|
||||
this._properties = [];
|
||||
this._hydratedPropertyCount = 0;
|
||||
}
|
||||
|
||||
if (this._properties[index]) {
|
||||
return this._properties[index];
|
||||
}
|
||||
|
||||
var prop = new ICAL.Property(
|
||||
this.jCal[PROPERTY_INDEX][index],
|
||||
this
|
||||
);
|
||||
|
||||
this._hydratedPropertyCount++;
|
||||
return (this._properties[index] = prop);
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds first sub component, optionally filtered by name.
|
||||
*
|
||||
* @param {String=} name Optional name to filter by
|
||||
* @return {?ICAL.Component} The found subcomponent
|
||||
*/
|
||||
getFirstSubcomponent: function(name) {
|
||||
if (name) {
|
||||
var i = 0;
|
||||
var comps = this.jCal[COMPONENT_INDEX];
|
||||
var len = comps.length;
|
||||
|
||||
for (; i < len; i++) {
|
||||
if (comps[i][NAME_INDEX] === name) {
|
||||
var result = this._hydrateComponent(i);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.jCal[COMPONENT_INDEX].length) {
|
||||
return this._hydrateComponent(0);
|
||||
}
|
||||
}
|
||||
|
||||
// ensure we return a value (strict mode)
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds all sub components, optionally filtering by name.
|
||||
*
|
||||
* @param {String=} name Optional name to filter by
|
||||
* @return {ICAL.Component[]} The found sub components
|
||||
*/
|
||||
getAllSubcomponents: function(name) {
|
||||
var jCalLen = this.jCal[COMPONENT_INDEX].length;
|
||||
var i = 0;
|
||||
|
||||
if (name) {
|
||||
var comps = this.jCal[COMPONENT_INDEX];
|
||||
var result = [];
|
||||
|
||||
for (; i < jCalLen; i++) {
|
||||
if (name === comps[i][NAME_INDEX]) {
|
||||
result.push(
|
||||
this._hydrateComponent(i)
|
||||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
if (!this._components ||
|
||||
(this._hydratedComponentCount !== jCalLen)) {
|
||||
for (; i < jCalLen; i++) {
|
||||
this._hydrateComponent(i);
|
||||
}
|
||||
}
|
||||
|
||||
return this._components || [];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true when a named property exists.
|
||||
*
|
||||
* @param {String} name The property name
|
||||
* @return {Boolean} True, when property is found
|
||||
*/
|
||||
hasProperty: function(name) {
|
||||
var props = this.jCal[PROPERTY_INDEX];
|
||||
var len = props.length;
|
||||
|
||||
var i = 0;
|
||||
for (; i < len; i++) {
|
||||
// 0 is property name
|
||||
if (props[i][NAME_INDEX] === name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds the first property, optionally with the given name.
|
||||
*
|
||||
* @param {String=} name Lowercase property name
|
||||
* @return {?ICAL.Property} The found property
|
||||
*/
|
||||
getFirstProperty: function(name) {
|
||||
if (name) {
|
||||
var i = 0;
|
||||
var props = this.jCal[PROPERTY_INDEX];
|
||||
var len = props.length;
|
||||
|
||||
for (; i < len; i++) {
|
||||
if (props[i][NAME_INDEX] === name) {
|
||||
var result = this._hydrateProperty(i);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.jCal[PROPERTY_INDEX].length) {
|
||||
return this._hydrateProperty(0);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns first property's value, if available.
|
||||
*
|
||||
* @param {String=} name Lowercase property name
|
||||
* @return {?String} The found property value.
|
||||
*/
|
||||
getFirstPropertyValue: function(name) {
|
||||
var prop = this.getFirstProperty(name);
|
||||
if (prop) {
|
||||
return prop.getFirstValue();
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get all properties in the component, optionally filtered by name.
|
||||
*
|
||||
* @param {String=} name Lowercase property name
|
||||
* @return {ICAL.Property[]} List of properties
|
||||
*/
|
||||
getAllProperties: function(name) {
|
||||
var jCalLen = this.jCal[PROPERTY_INDEX].length;
|
||||
var i = 0;
|
||||
|
||||
if (name) {
|
||||
var props = this.jCal[PROPERTY_INDEX];
|
||||
var result = [];
|
||||
|
||||
for (; i < jCalLen; i++) {
|
||||
if (name === props[i][NAME_INDEX]) {
|
||||
result.push(
|
||||
this._hydrateProperty(i)
|
||||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
if (!this._properties ||
|
||||
(this._hydratedPropertyCount !== jCalLen)) {
|
||||
for (; i < jCalLen; i++) {
|
||||
this._hydrateProperty(i);
|
||||
}
|
||||
}
|
||||
|
||||
return this._properties || [];
|
||||
}
|
||||
},
|
||||
|
||||
_removeObjectByIndex: function(jCalIndex, cache, index) {
|
||||
cache = cache || [];
|
||||
// remove cached version
|
||||
if (cache[index]) {
|
||||
var obj = cache[index];
|
||||
if ("parent" in obj) {
|
||||
obj.parent = null;
|
||||
}
|
||||
}
|
||||
|
||||
cache.splice(index, 1);
|
||||
|
||||
// remove it from the jCal
|
||||
this.jCal[jCalIndex].splice(index, 1);
|
||||
},
|
||||
|
||||
_removeObject: function(jCalIndex, cache, nameOrObject) {
|
||||
var i = 0;
|
||||
var objects = this.jCal[jCalIndex];
|
||||
var len = objects.length;
|
||||
var cached = this[cache];
|
||||
|
||||
if (typeof(nameOrObject) === 'string') {
|
||||
for (; i < len; i++) {
|
||||
if (objects[i][NAME_INDEX] === nameOrObject) {
|
||||
this._removeObjectByIndex(jCalIndex, cached, i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (cached) {
|
||||
for (; i < len; i++) {
|
||||
if (cached[i] && cached[i] === nameOrObject) {
|
||||
this._removeObjectByIndex(jCalIndex, cached, i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
_removeAllObjects: function(jCalIndex, cache, name) {
|
||||
var cached = this[cache];
|
||||
|
||||
// Unfortunately we have to run through all children to reset their
|
||||
// parent property.
|
||||
var objects = this.jCal[jCalIndex];
|
||||
var i = objects.length - 1;
|
||||
|
||||
// descending search required because splice
|
||||
// is used and will effect the indices.
|
||||
for (; i >= 0; i--) {
|
||||
if (!name || objects[i][NAME_INDEX] === name) {
|
||||
this._removeObjectByIndex(jCalIndex, cached, i);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds a single sub component.
|
||||
*
|
||||
* @param {ICAL.Component} component The component to add
|
||||
* @return {ICAL.Component} The passed in component
|
||||
*/
|
||||
addSubcomponent: function(component) {
|
||||
if (!this._components) {
|
||||
this._components = [];
|
||||
this._hydratedComponentCount = 0;
|
||||
}
|
||||
|
||||
if (component.parent) {
|
||||
component.parent.removeSubcomponent(component);
|
||||
}
|
||||
|
||||
var idx = this.jCal[COMPONENT_INDEX].push(component.jCal);
|
||||
this._components[idx - 1] = component;
|
||||
this._hydratedComponentCount++;
|
||||
component.parent = this;
|
||||
return component;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a single component by name or the instance of a specific
|
||||
* component.
|
||||
*
|
||||
* @param {ICAL.Component|String} nameOrComp Name of component, or component
|
||||
* @return {Boolean} True when comp is removed
|
||||
*/
|
||||
removeSubcomponent: function(nameOrComp) {
|
||||
var removed = this._removeObject(COMPONENT_INDEX, '_components', nameOrComp);
|
||||
if (removed) {
|
||||
this._hydratedComponentCount--;
|
||||
}
|
||||
return removed;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all components or (if given) all components by a particular
|
||||
* name.
|
||||
*
|
||||
* @param {String=} name Lowercase component name
|
||||
*/
|
||||
removeAllSubcomponents: function(name) {
|
||||
var removed = this._removeAllObjects(COMPONENT_INDEX, '_components', name);
|
||||
this._hydratedComponentCount = 0;
|
||||
return removed;
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds an {@link ICAL.Property} to the component.
|
||||
*
|
||||
* @param {ICAL.Property} property The property to add
|
||||
* @return {ICAL.Property} The passed in property
|
||||
*/
|
||||
addProperty: function(property) {
|
||||
if (!(property instanceof ICAL.Property)) {
|
||||
throw new TypeError('must instance of ICAL.Property');
|
||||
}
|
||||
|
||||
if (!this._properties) {
|
||||
this._properties = [];
|
||||
this._hydratedPropertyCount = 0;
|
||||
}
|
||||
|
||||
if (property.parent) {
|
||||
property.parent.removeProperty(property);
|
||||
}
|
||||
|
||||
var idx = this.jCal[PROPERTY_INDEX].push(property.jCal);
|
||||
this._properties[idx - 1] = property;
|
||||
this._hydratedPropertyCount++;
|
||||
property.parent = this;
|
||||
return property;
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper method to add a property with a value to the component.
|
||||
*
|
||||
* @param {String} name Property name to add
|
||||
* @param {String|Number|Object} value Property value
|
||||
* @return {ICAL.Property} The created property
|
||||
*/
|
||||
addPropertyWithValue: function(name, value) {
|
||||
var prop = new ICAL.Property(name);
|
||||
prop.setValue(value);
|
||||
|
||||
this.addProperty(prop);
|
||||
|
||||
return prop;
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper method that will update or create a property of the given name
|
||||
* and sets its value. If multiple properties with the given name exist,
|
||||
* only the first is updated.
|
||||
*
|
||||
* @param {String} name Property name to update
|
||||
* @param {String|Number|Object} value Property value
|
||||
* @return {ICAL.Property} The created property
|
||||
*/
|
||||
updatePropertyWithValue: function(name, value) {
|
||||
var prop = this.getFirstProperty(name);
|
||||
|
||||
if (prop) {
|
||||
prop.setValue(value);
|
||||
} else {
|
||||
prop = this.addPropertyWithValue(name, value);
|
||||
}
|
||||
|
||||
return prop;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a single property by name or the instance of the specific
|
||||
* property.
|
||||
*
|
||||
* @param {String|ICAL.Property} nameOrProp Property name or instance to remove
|
||||
* @return {Boolean} True, when deleted
|
||||
*/
|
||||
removeProperty: function(nameOrProp) {
|
||||
var removed = this._removeObject(PROPERTY_INDEX, '_properties', nameOrProp);
|
||||
if (removed) {
|
||||
this._hydratedPropertyCount--;
|
||||
}
|
||||
return removed;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all properties associated with this component, optionally
|
||||
* filtered by name.
|
||||
*
|
||||
* @param {String=} name Lowercase property name
|
||||
* @return {Boolean} True, when deleted
|
||||
*/
|
||||
removeAllProperties: function(name) {
|
||||
var removed = this._removeAllObjects(PROPERTY_INDEX, '_properties', name);
|
||||
this._hydratedPropertyCount = 0;
|
||||
return removed;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the Object representation of this component. The returned object
|
||||
* is a live jCal object and should be cloned if modified.
|
||||
* @return {Object}
|
||||
*/
|
||||
toJSON: function() {
|
||||
return this.jCal;
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this component.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function() {
|
||||
return ICAL.stringify.component(
|
||||
this.jCal, this._designSet
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an {@link ICAL.Component} by parsing the passed iCalendar string.
|
||||
*
|
||||
* @param {String} str The iCalendar string to parse
|
||||
*/
|
||||
Component.fromString = function(str) {
|
||||
return new Component(ICAL.parse.component(str));
|
||||
};
|
||||
|
||||
return Component;
|
||||
}());
|
163
js/vendor/ical.js/lib/ical/component_parser.js
vendored
163
js/vendor/ical.js/lib/ical/component_parser.js
vendored
|
@ -1,163 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.ComponentParser = (function() {
|
||||
/**
|
||||
* @classdesc
|
||||
* The ComponentParser is used to process a String or jCal Object,
|
||||
* firing callbacks for various found components, as well as completion.
|
||||
*
|
||||
* @example
|
||||
* var options = {
|
||||
* // when false no events will be emitted for type
|
||||
* parseEvent: true,
|
||||
* parseTimezone: true
|
||||
* };
|
||||
*
|
||||
* var parser = new ICAL.ComponentParser(options);
|
||||
*
|
||||
* parser.onevent(eventComponent) {
|
||||
* //...
|
||||
* }
|
||||
*
|
||||
* // ontimezone, etc...
|
||||
*
|
||||
* parser.oncomplete = function() {
|
||||
*
|
||||
* };
|
||||
*
|
||||
* parser.process(stringOrComponent);
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.ComponentParser
|
||||
* @param {Object=} options Component parser options
|
||||
* @param {Boolean} options.parseEvent Whether events should be parsed
|
||||
* @param {Boolean} options.parseTimezeone Whether timezones should be parsed
|
||||
*/
|
||||
function ComponentParser(options) {
|
||||
if (typeof(options) === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
|
||||
var key;
|
||||
for (key in options) {
|
||||
/* istanbul ignore else */
|
||||
if (options.hasOwnProperty(key)) {
|
||||
this[key] = options[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ComponentParser.prototype = {
|
||||
|
||||
/**
|
||||
* When true, parse events
|
||||
*
|
||||
* @type {Boolean}
|
||||
*/
|
||||
parseEvent: true,
|
||||
|
||||
/**
|
||||
* When true, parse timezones
|
||||
*
|
||||
* @type {Boolean}
|
||||
*/
|
||||
parseTimezone: true,
|
||||
|
||||
|
||||
/* SAX like events here for reference */
|
||||
|
||||
/**
|
||||
* Fired when parsing is complete
|
||||
* @callback
|
||||
*/
|
||||
oncomplete: /* istanbul ignore next */ function() {},
|
||||
|
||||
/**
|
||||
* Fired if an error occurs during parsing.
|
||||
*
|
||||
* @callback
|
||||
* @param {Error} err details of error
|
||||
*/
|
||||
onerror: /* istanbul ignore next */ function(err) {},
|
||||
|
||||
/**
|
||||
* Fired when a top level component (VTIMEZONE) is found
|
||||
*
|
||||
* @callback
|
||||
* @param {ICAL.Timezone} component Timezone object
|
||||
*/
|
||||
ontimezone: /* istanbul ignore next */ function(component) {},
|
||||
|
||||
/**
|
||||
* Fired when a top level component (VEVENT) is found.
|
||||
*
|
||||
* @callback
|
||||
* @param {ICAL.Event} component Top level component
|
||||
*/
|
||||
onevent: /* istanbul ignore next */ function(component) {},
|
||||
|
||||
/**
|
||||
* Process a string or parse ical object. This function itself will return
|
||||
* nothing but will start the parsing process.
|
||||
*
|
||||
* Events must be registered prior to calling this method.
|
||||
*
|
||||
* @param {ICAL.Component|String|Object} ical The component to process,
|
||||
* either in its final form, as a jCal Object, or string representation
|
||||
*/
|
||||
process: function(ical) {
|
||||
//TODO: this is sync now in the future we will have a incremental parser.
|
||||
if (typeof(ical) === 'string') {
|
||||
ical = ICAL.parse(ical);
|
||||
}
|
||||
|
||||
if (!(ical instanceof ICAL.Component)) {
|
||||
ical = new ICAL.Component(ical);
|
||||
}
|
||||
|
||||
var components = ical.getAllSubcomponents();
|
||||
var i = 0;
|
||||
var len = components.length;
|
||||
var component;
|
||||
|
||||
for (; i < len; i++) {
|
||||
component = components[i];
|
||||
|
||||
switch (component.name) {
|
||||
case 'vtimezone':
|
||||
if (this.parseTimezone) {
|
||||
var tzid = component.getFirstPropertyValue('tzid');
|
||||
if (tzid) {
|
||||
this.ontimezone(new ICAL.Timezone({
|
||||
tzid: tzid,
|
||||
component: component
|
||||
}));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'vevent':
|
||||
if (this.parseEvent) {
|
||||
this.onevent(new ICAL.Event(component));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//XXX: ideally we should do a "nextTick" here
|
||||
// so in all cases this is actually async.
|
||||
this.oncomplete();
|
||||
}
|
||||
};
|
||||
|
||||
return ComponentParser;
|
||||
}());
|
987
js/vendor/ical.js/lib/ical/design.js
vendored
987
js/vendor/ical.js/lib/ical/design.js
vendored
|
@ -1,987 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
/** @namespace ICAL */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.design = (function() {
|
||||
'use strict';
|
||||
|
||||
var FROM_ICAL_NEWLINE = /\\\\|\\;|\\,|\\[Nn]/g;
|
||||
var TO_ICAL_NEWLINE = /\\|;|,|\n/g;
|
||||
var FROM_VCARD_NEWLINE = /\\\\|\\,|\\[Nn]/g;
|
||||
var TO_VCARD_NEWLINE = /\\|,|\n/g;
|
||||
|
||||
function createTextType(fromNewline, toNewline) {
|
||||
var result = {
|
||||
matches: /.*/,
|
||||
|
||||
fromICAL: function(aValue, structuredEscape) {
|
||||
return replaceNewline(aValue, fromNewline, structuredEscape);
|
||||
},
|
||||
|
||||
toICAL: function(aValue, structuredEscape) {
|
||||
var regEx = toNewline;
|
||||
if (structuredEscape)
|
||||
regEx = new RegExp(regEx.source + '|' + structuredEscape);
|
||||
return aValue.replace(regEx, function(str) {
|
||||
switch (str) {
|
||||
case "\\":
|
||||
return "\\\\";
|
||||
case ";":
|
||||
return "\\;";
|
||||
case ",":
|
||||
return "\\,";
|
||||
case "\n":
|
||||
return "\\n";
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
return str;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
// default types used multiple times
|
||||
var DEFAULT_TYPE_TEXT = { defaultType: "text" };
|
||||
var DEFAULT_TYPE_TEXT_MULTI = { defaultType: "text", multiValue: "," };
|
||||
var DEFAULT_TYPE_TEXT_STRUCTURED = { defaultType: "text", structuredValue: ";" };
|
||||
var DEFAULT_TYPE_INTEGER = { defaultType: "integer" };
|
||||
var DEFAULT_TYPE_DATETIME_DATE = { defaultType: "date-time", allowedTypes: ["date-time", "date"] };
|
||||
var DEFAULT_TYPE_DATETIME = { defaultType: "date-time" };
|
||||
var DEFAULT_TYPE_URI = { defaultType: "uri" };
|
||||
var DEFAULT_TYPE_UTCOFFSET = { defaultType: "utc-offset" };
|
||||
var DEFAULT_TYPE_RECUR = { defaultType: "recur" };
|
||||
var DEFAULT_TYPE_DATE_ANDOR_TIME = { defaultType: "date-and-or-time", allowedTypes: ["date-time", "date", "text"] };
|
||||
|
||||
function replaceNewlineReplace(string) {
|
||||
switch (string) {
|
||||
case "\\\\":
|
||||
return "\\";
|
||||
case "\\;":
|
||||
return ";";
|
||||
case "\\,":
|
||||
return ",";
|
||||
case "\\n":
|
||||
case "\\N":
|
||||
return "\n";
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
||||
function replaceNewline(value, newline, structuredEscape) {
|
||||
// avoid regex when possible.
|
||||
if (value.indexOf('\\') === -1) {
|
||||
return value;
|
||||
}
|
||||
if (structuredEscape)
|
||||
newline = new RegExp(newline.source + '|\\\\' + structuredEscape);
|
||||
return value.replace(newline, replaceNewlineReplace);
|
||||
}
|
||||
|
||||
var commonProperties = {
|
||||
"categories": DEFAULT_TYPE_TEXT_MULTI,
|
||||
"url": DEFAULT_TYPE_URI,
|
||||
"version": DEFAULT_TYPE_TEXT,
|
||||
"uid": DEFAULT_TYPE_TEXT
|
||||
};
|
||||
|
||||
var commonValues = {
|
||||
"boolean": {
|
||||
values: ["TRUE", "FALSE"],
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
switch (aValue) {
|
||||
case 'TRUE':
|
||||
return true;
|
||||
case 'FALSE':
|
||||
return false;
|
||||
default:
|
||||
//TODO: parser warning
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
if (aValue) {
|
||||
return 'TRUE';
|
||||
}
|
||||
return 'FALSE';
|
||||
}
|
||||
|
||||
},
|
||||
float: {
|
||||
matches: /^[+-]?\d+\.\d+$/,
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
var parsed = parseFloat(aValue);
|
||||
if (ICAL.helpers.isStrictlyNaN(parsed)) {
|
||||
// TODO: parser warning
|
||||
return 0.0;
|
||||
}
|
||||
return parsed;
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
return String(aValue);
|
||||
}
|
||||
},
|
||||
integer: {
|
||||
fromICAL: function(aValue) {
|
||||
var parsed = parseInt(aValue);
|
||||
if (ICAL.helpers.isStrictlyNaN(parsed)) {
|
||||
return 0;
|
||||
}
|
||||
return parsed;
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
return String(aValue);
|
||||
}
|
||||
},
|
||||
"utc-offset": {
|
||||
toICAL: function(aValue) {
|
||||
if (aValue.length < 7) {
|
||||
// no seconds
|
||||
// -0500
|
||||
return aValue.substr(0, 3) +
|
||||
aValue.substr(4, 2);
|
||||
} else {
|
||||
// seconds
|
||||
// -050000
|
||||
return aValue.substr(0, 3) +
|
||||
aValue.substr(4, 2) +
|
||||
aValue.substr(7, 2);
|
||||
}
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
if (aValue.length < 6) {
|
||||
// no seconds
|
||||
// -05:00
|
||||
return aValue.substr(0, 3) + ':' +
|
||||
aValue.substr(3, 2);
|
||||
} else {
|
||||
// seconds
|
||||
// -05:00:00
|
||||
return aValue.substr(0, 3) + ':' +
|
||||
aValue.substr(3, 2) + ':' +
|
||||
aValue.substr(5, 2);
|
||||
}
|
||||
},
|
||||
|
||||
decorate: function(aValue) {
|
||||
return ICAL.UtcOffset.fromString(aValue);
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var icalParams = {
|
||||
// Although the syntax is DQUOTE uri DQUOTE, I don't think we should
|
||||
// enfoce anything aside from it being a valid content line.
|
||||
//
|
||||
// At least some params require - if multi values are used - DQUOTEs
|
||||
// for each of its values - e.g. delegated-from="uri1","uri2"
|
||||
// To indicate this, I introduced the new k/v pair
|
||||
// multiValueSeparateDQuote: true
|
||||
//
|
||||
// "ALTREP": { ... },
|
||||
|
||||
// CN just wants a param-value
|
||||
// "CN": { ... }
|
||||
|
||||
"cutype": {
|
||||
values: ["INDIVIDUAL", "GROUP", "RESOURCE", "ROOM", "UNKNOWN"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
},
|
||||
|
||||
"delegated-from": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
"delegated-to": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
// "DIR": { ... }, // See ALTREP
|
||||
"encoding": {
|
||||
values: ["8BIT", "BASE64"]
|
||||
},
|
||||
// "FMTTYPE": { ... }, // See ALTREP
|
||||
"fbtype": {
|
||||
values: ["FREE", "BUSY", "BUSY-UNAVAILABLE", "BUSY-TENTATIVE"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
},
|
||||
// "LANGUAGE": { ... }, // See ALTREP
|
||||
"member": {
|
||||
valueType: "cal-address",
|
||||
multiValue: ",",
|
||||
multiValueSeparateDQuote: true
|
||||
},
|
||||
"partstat": {
|
||||
// TODO These values are actually different per-component
|
||||
values: ["NEEDS-ACTION", "ACCEPTED", "DECLINED", "TENTATIVE",
|
||||
"DELEGATED", "COMPLETED", "IN-PROCESS"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
},
|
||||
"range": {
|
||||
values: ["THISLANDFUTURE"]
|
||||
},
|
||||
"related": {
|
||||
values: ["START", "END"]
|
||||
},
|
||||
"reltype": {
|
||||
values: ["PARENT", "CHILD", "SIBLING"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
},
|
||||
"role": {
|
||||
values: ["REQ-PARTICIPANT", "CHAIR",
|
||||
"OPT-PARTICIPANT", "NON-PARTICIPANT"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
},
|
||||
"rsvp": {
|
||||
values: ["TRUE", "FALSE"]
|
||||
},
|
||||
"sent-by": {
|
||||
valueType: "cal-address"
|
||||
},
|
||||
"tzid": {
|
||||
matches: /^\//
|
||||
},
|
||||
"value": {
|
||||
// since the value here is a 'type' lowercase is used.
|
||||
values: ["binary", "boolean", "cal-address", "date", "date-time",
|
||||
"duration", "float", "integer", "period", "recur", "text",
|
||||
"time", "uri", "utc-offset"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
}
|
||||
};
|
||||
|
||||
// When adding a value here, be sure to add it to the parameter types!
|
||||
var icalValues = ICAL.helpers.extend(commonValues, {
|
||||
text: createTextType(FROM_ICAL_NEWLINE, TO_ICAL_NEWLINE),
|
||||
|
||||
uri: {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
|
||||
"binary": {
|
||||
decorate: function(aString) {
|
||||
return ICAL.Binary.fromString(aString);
|
||||
},
|
||||
|
||||
undecorate: function(aBinary) {
|
||||
return aBinary.toString();
|
||||
}
|
||||
},
|
||||
"cal-address": {
|
||||
// needs to be an uri
|
||||
},
|
||||
"date": {
|
||||
decorate: function(aValue, aProp) {
|
||||
return ICAL.Time.fromDateString(aValue, aProp);
|
||||
},
|
||||
|
||||
/**
|
||||
* undecorates a time object.
|
||||
*/
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
// from: 20120901
|
||||
// to: 2012-09-01
|
||||
return aValue.substr(0, 4) + '-' +
|
||||
aValue.substr(4, 2) + '-' +
|
||||
aValue.substr(6, 2);
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
// from: 2012-09-01
|
||||
// to: 20120901
|
||||
|
||||
if (aValue.length > 11) {
|
||||
//TODO: serialize warning?
|
||||
return aValue;
|
||||
}
|
||||
|
||||
return aValue.substr(0, 4) +
|
||||
aValue.substr(5, 2) +
|
||||
aValue.substr(8, 2);
|
||||
}
|
||||
},
|
||||
"date-time": {
|
||||
fromICAL: function(aValue) {
|
||||
// from: 20120901T130000
|
||||
// to: 2012-09-01T13:00:00
|
||||
var result = aValue.substr(0, 4) + '-' +
|
||||
aValue.substr(4, 2) + '-' +
|
||||
aValue.substr(6, 2) + 'T' +
|
||||
aValue.substr(9, 2) + ':' +
|
||||
aValue.substr(11, 2) + ':' +
|
||||
aValue.substr(13, 2);
|
||||
|
||||
if (aValue[15] && aValue[15] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
// from: 2012-09-01T13:00:00
|
||||
// to: 20120901T130000
|
||||
|
||||
if (aValue.length < 19) {
|
||||
// TODO: error
|
||||
return aValue;
|
||||
}
|
||||
|
||||
var result = aValue.substr(0, 4) +
|
||||
aValue.substr(5, 2) +
|
||||
// grab the (DDTHH) segment
|
||||
aValue.substr(8, 5) +
|
||||
// MM
|
||||
aValue.substr(14, 2) +
|
||||
// SS
|
||||
aValue.substr(17, 2);
|
||||
|
||||
if (aValue[19] && aValue[19] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
decorate: function(aValue, aProp) {
|
||||
return ICAL.Time.fromDateTimeString(aValue, aProp);
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
}
|
||||
},
|
||||
duration: {
|
||||
decorate: function(aValue) {
|
||||
return ICAL.Duration.fromString(aValue);
|
||||
},
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
}
|
||||
},
|
||||
period: {
|
||||
|
||||
fromICAL: function(string) {
|
||||
var parts = string.split('/');
|
||||
parts[0] = icalValues['date-time'].fromICAL(parts[0]);
|
||||
|
||||
if (!ICAL.Duration.isValueString(parts[1])) {
|
||||
parts[1] = icalValues['date-time'].fromICAL(parts[1]);
|
||||
}
|
||||
|
||||
return parts;
|
||||
},
|
||||
|
||||
toICAL: function(parts) {
|
||||
parts[0] = icalValues['date-time'].toICAL(parts[0]);
|
||||
|
||||
if (!ICAL.Duration.isValueString(parts[1])) {
|
||||
parts[1] = icalValues['date-time'].toICAL(parts[1]);
|
||||
}
|
||||
|
||||
return parts.join("/");
|
||||
},
|
||||
|
||||
decorate: function(aValue, aProp) {
|
||||
return ICAL.Period.fromJSON(aValue, aProp);
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toJSON();
|
||||
}
|
||||
},
|
||||
recur: {
|
||||
fromICAL: function(string) {
|
||||
return ICAL.Recur._stringToData(string, true);
|
||||
},
|
||||
|
||||
toICAL: function(data) {
|
||||
var str = "";
|
||||
for (var k in data) {
|
||||
/* istanbul ignore if */
|
||||
if (!Object.prototype.hasOwnProperty.call(data, k)) {
|
||||
continue;
|
||||
}
|
||||
var val = data[k];
|
||||
if (k == "until") {
|
||||
if (val.length > 10) {
|
||||
val = icalValues['date-time'].toICAL(val);
|
||||
} else {
|
||||
val = icalValues.date.toICAL(val);
|
||||
}
|
||||
} else if (k == "wkst") {
|
||||
if (typeof val === 'number') {
|
||||
val = ICAL.Recur.numericDayToIcalDay(val);
|
||||
}
|
||||
} else if (Array.isArray(val)) {
|
||||
val = val.join(",");
|
||||
}
|
||||
str += k.toUpperCase() + "=" + val + ";";
|
||||
}
|
||||
return str.substr(0, str.length - 1);
|
||||
},
|
||||
|
||||
decorate: function decorate(aValue) {
|
||||
return ICAL.Recur.fromData(aValue);
|
||||
},
|
||||
|
||||
undecorate: function(aRecur) {
|
||||
return aRecur.toJSON();
|
||||
}
|
||||
},
|
||||
|
||||
time: {
|
||||
fromICAL: function(aValue) {
|
||||
// from: MMHHSS(Z)?
|
||||
// to: HH:MM:SS(Z)?
|
||||
if (aValue.length < 6) {
|
||||
// TODO: parser exception?
|
||||
return aValue;
|
||||
}
|
||||
|
||||
// HH::MM::SSZ?
|
||||
var result = aValue.substr(0, 2) + ':' +
|
||||
aValue.substr(2, 2) + ':' +
|
||||
aValue.substr(4, 2);
|
||||
|
||||
if (aValue[6] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
// from: HH:MM:SS(Z)?
|
||||
// to: MMHHSS(Z)?
|
||||
if (aValue.length < 8) {
|
||||
//TODO: error
|
||||
return aValue;
|
||||
}
|
||||
|
||||
var result = aValue.substr(0, 2) +
|
||||
aValue.substr(3, 2) +
|
||||
aValue.substr(6, 2);
|
||||
|
||||
if (aValue[8] === 'Z') {
|
||||
result += 'Z';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var icalProperties = ICAL.helpers.extend(commonProperties, {
|
||||
|
||||
"action": DEFAULT_TYPE_TEXT,
|
||||
"attach": { defaultType: "uri" },
|
||||
"attendee": { defaultType: "cal-address" },
|
||||
"calscale": DEFAULT_TYPE_TEXT,
|
||||
"class": DEFAULT_TYPE_TEXT,
|
||||
"comment": DEFAULT_TYPE_TEXT,
|
||||
"completed": DEFAULT_TYPE_DATETIME,
|
||||
"contact": DEFAULT_TYPE_TEXT,
|
||||
"created": DEFAULT_TYPE_DATETIME,
|
||||
"description": DEFAULT_TYPE_TEXT,
|
||||
"dtend": DEFAULT_TYPE_DATETIME_DATE,
|
||||
"dtstamp": DEFAULT_TYPE_DATETIME,
|
||||
"dtstart": DEFAULT_TYPE_DATETIME_DATE,
|
||||
"due": DEFAULT_TYPE_DATETIME_DATE,
|
||||
"duration": { defaultType: "duration" },
|
||||
"exdate": {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
multiValue: ','
|
||||
},
|
||||
"exrule": DEFAULT_TYPE_RECUR,
|
||||
"freebusy": { defaultType: "period", multiValue: "," },
|
||||
"geo": { defaultType: "float", structuredValue: ";" },
|
||||
"last-modified": DEFAULT_TYPE_DATETIME,
|
||||
"location": DEFAULT_TYPE_TEXT,
|
||||
"method": DEFAULT_TYPE_TEXT,
|
||||
"organizer": { defaultType: "cal-address" },
|
||||
"percent-complete": DEFAULT_TYPE_INTEGER,
|
||||
"priority": DEFAULT_TYPE_INTEGER,
|
||||
"prodid": DEFAULT_TYPE_TEXT,
|
||||
"related-to": DEFAULT_TYPE_TEXT,
|
||||
"repeat": DEFAULT_TYPE_INTEGER,
|
||||
"rdate": {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date", "period"],
|
||||
multiValue: ',',
|
||||
detectType: function(string) {
|
||||
if (string.indexOf('/') !== -1) {
|
||||
return 'period';
|
||||
}
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
"recurrence-id": DEFAULT_TYPE_DATETIME_DATE,
|
||||
"resources": DEFAULT_TYPE_TEXT_MULTI,
|
||||
"request-status": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"rrule": DEFAULT_TYPE_RECUR,
|
||||
"sequence": DEFAULT_TYPE_INTEGER,
|
||||
"status": DEFAULT_TYPE_TEXT,
|
||||
"summary": DEFAULT_TYPE_TEXT,
|
||||
"transp": DEFAULT_TYPE_TEXT,
|
||||
"trigger": { defaultType: "duration", allowedTypes: ["duration", "date-time"] },
|
||||
"tzoffsetfrom": DEFAULT_TYPE_UTCOFFSET,
|
||||
"tzoffsetto": DEFAULT_TYPE_UTCOFFSET,
|
||||
"tzurl": DEFAULT_TYPE_URI,
|
||||
"tzid": DEFAULT_TYPE_TEXT,
|
||||
"tzname": DEFAULT_TYPE_TEXT
|
||||
});
|
||||
|
||||
// When adding a value here, be sure to add it to the parameter types!
|
||||
var vcardValues = ICAL.helpers.extend(commonValues, {
|
||||
text: createTextType(FROM_VCARD_NEWLINE, TO_VCARD_NEWLINE),
|
||||
uri: createTextType(FROM_VCARD_NEWLINE, TO_VCARD_NEWLINE),
|
||||
|
||||
date: {
|
||||
decorate: function(aValue) {
|
||||
return ICAL.VCardTime.fromDateAndOrTimeString(aValue, "date");
|
||||
},
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
},
|
||||
fromICAL: function(aValue) {
|
||||
if (aValue.length == 8) {
|
||||
return icalValues.date.fromICAL(aValue);
|
||||
} else if (aValue[0] == '-' && aValue.length == 6) {
|
||||
return aValue.substr(0, 4) + '-' + aValue.substr(4);
|
||||
} else {
|
||||
return aValue;
|
||||
}
|
||||
},
|
||||
toICAL: function(aValue) {
|
||||
if (aValue.length == 10) {
|
||||
return icalValues.date.toICAL(aValue);
|
||||
} else if (aValue[0] == '-' && aValue.length == 7) {
|
||||
return aValue.substr(0, 4) + aValue.substr(5);
|
||||
} else {
|
||||
return aValue;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
time: {
|
||||
decorate: function(aValue) {
|
||||
return ICAL.VCardTime.fromDateAndOrTimeString("T" + aValue, "time");
|
||||
},
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
},
|
||||
fromICAL: function(aValue) {
|
||||
var splitzone = vcardValues.time._splitZone(aValue, true);
|
||||
var zone = splitzone[0], value = splitzone[1];
|
||||
|
||||
//console.log("SPLIT: ",splitzone);
|
||||
|
||||
if (value.length == 6) {
|
||||
value = value.substr(0, 2) + ':' +
|
||||
value.substr(2, 2) + ':' +
|
||||
value.substr(4, 2);
|
||||
} else if (value.length == 4 && value[0] != '-') {
|
||||
value = value.substr(0, 2) + ':' + value.substr(2, 2);
|
||||
} else if (value.length == 5) {
|
||||
value = value.substr(0, 3) + ':' + value.substr(3, 2);
|
||||
}
|
||||
|
||||
if (zone.length == 5 && (zone[0] == '-' || zone[0] == '+')) {
|
||||
zone = zone.substr(0, 3) + ':' + zone.substr(3);
|
||||
}
|
||||
|
||||
return value + zone;
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
var splitzone = vcardValues.time._splitZone(aValue);
|
||||
var zone = splitzone[0], value = splitzone[1];
|
||||
|
||||
if (value.length == 8) {
|
||||
value = value.substr(0, 2) +
|
||||
value.substr(3, 2) +
|
||||
value.substr(6, 2);
|
||||
} else if (value.length == 5 && value[0] != '-') {
|
||||
value = value.substr(0, 2) + value.substr(3, 2);
|
||||
} else if (value.length == 6) {
|
||||
value = value.substr(0, 3) + value.substr(4, 2);
|
||||
}
|
||||
|
||||
if (zone.length == 6 && (zone[0] == '-' || zone[0] == '+')) {
|
||||
zone = zone.substr(0, 3) + zone.substr(4);
|
||||
}
|
||||
|
||||
return value + zone;
|
||||
},
|
||||
|
||||
_splitZone: function(aValue, isFromIcal) {
|
||||
var lastChar = aValue.length - 1;
|
||||
var signChar = aValue.length - (isFromIcal ? 5 : 6);
|
||||
var sign = aValue[signChar];
|
||||
var zone, value;
|
||||
|
||||
if (aValue[lastChar] == 'Z') {
|
||||
zone = aValue[lastChar];
|
||||
value = aValue.substr(0, lastChar);
|
||||
} else if (aValue.length > 6 && (sign == '-' || sign == '+')) {
|
||||
zone = aValue.substr(signChar);
|
||||
value = aValue.substr(0, signChar);
|
||||
} else {
|
||||
zone = "";
|
||||
value = aValue;
|
||||
}
|
||||
|
||||
return [zone, value];
|
||||
}
|
||||
},
|
||||
|
||||
"date-time": {
|
||||
decorate: function(aValue) {
|
||||
return ICAL.VCardTime.fromDateAndOrTimeString(aValue, "date-time");
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
return vcardValues['date-and-or-time'].fromICAL(aValue);
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
return vcardValues['date-and-or-time'].toICAL(aValue);
|
||||
}
|
||||
},
|
||||
|
||||
"date-and-or-time": {
|
||||
decorate: function(aValue) {
|
||||
return ICAL.VCardTime.fromDateAndOrTimeString(aValue, "date-and-or-time");
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
var parts = aValue.split('T');
|
||||
return (parts[0] ? vcardValues.date.fromICAL(parts[0]) : '') +
|
||||
(parts[1] ? 'T' + vcardValues.time.fromICAL(parts[1]) : '');
|
||||
},
|
||||
|
||||
toICAL: function(aValue) {
|
||||
var parts = aValue.split('T');
|
||||
return vcardValues.date.toICAL(parts[0]) +
|
||||
(parts[1] ? 'T' + vcardValues.time.toICAL(parts[1]) : '');
|
||||
|
||||
}
|
||||
},
|
||||
timestamp: icalValues['date-time'],
|
||||
"language-tag": {
|
||||
matches: /^[a-zA-Z0-9\-]+$/ // Could go with a more strict regex here
|
||||
}
|
||||
});
|
||||
|
||||
var vcardParams = {
|
||||
"type": {
|
||||
valueType: "text",
|
||||
multiValue: ","
|
||||
},
|
||||
"value": {
|
||||
// since the value here is a 'type' lowercase is used.
|
||||
values: ["text", "uri", "date", "time", "date-time", "date-and-or-time",
|
||||
"timestamp", "boolean", "integer", "float", "utc-offset",
|
||||
"language-tag"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
}
|
||||
};
|
||||
|
||||
var vcardProperties = ICAL.helpers.extend(commonProperties, {
|
||||
"adr": { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
"anniversary": DEFAULT_TYPE_DATE_ANDOR_TIME,
|
||||
"bday": DEFAULT_TYPE_DATE_ANDOR_TIME,
|
||||
"caladruri": DEFAULT_TYPE_URI,
|
||||
"caluri": DEFAULT_TYPE_URI,
|
||||
"clientpidmap": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"email": DEFAULT_TYPE_TEXT,
|
||||
"fburl": DEFAULT_TYPE_URI,
|
||||
"fn": DEFAULT_TYPE_TEXT,
|
||||
"gender": DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
"geo": DEFAULT_TYPE_URI,
|
||||
"impp": DEFAULT_TYPE_URI,
|
||||
"key": DEFAULT_TYPE_URI,
|
||||
"kind": DEFAULT_TYPE_TEXT,
|
||||
"lang": { defaultType: "language-tag" },
|
||||
"logo": DEFAULT_TYPE_URI,
|
||||
"member": DEFAULT_TYPE_URI,
|
||||
"n": { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
"nickname": DEFAULT_TYPE_TEXT_MULTI,
|
||||
"note": DEFAULT_TYPE_TEXT,
|
||||
"org": { defaultType: "text", structuredValue: ";" },
|
||||
"photo": DEFAULT_TYPE_URI,
|
||||
"related": DEFAULT_TYPE_URI,
|
||||
"rev": { defaultType: "timestamp" },
|
||||
"role": DEFAULT_TYPE_TEXT,
|
||||
"sound": DEFAULT_TYPE_URI,
|
||||
"source": DEFAULT_TYPE_URI,
|
||||
"tel": { defaultType: "uri", allowedTypes: ["uri", "text"] },
|
||||
"title": DEFAULT_TYPE_TEXT,
|
||||
"tz": { defaultType: "text", allowedTypes: ["text", "utc-offset", "uri"] },
|
||||
"xml": DEFAULT_TYPE_TEXT
|
||||
});
|
||||
|
||||
var vcard3Values = ICAL.helpers.extend(commonValues, {
|
||||
binary: icalValues.binary,
|
||||
date: vcardValues.date,
|
||||
"date-time": vcardValues["date-time"],
|
||||
"phone-number": {
|
||||
// TODO
|
||||
/* ... */
|
||||
},
|
||||
uri: icalValues.uri,
|
||||
text: icalValues.text,
|
||||
time: icalValues.time,
|
||||
vcard: icalValues.text,
|
||||
"utc-offset": {
|
||||
toICAL: function(aValue) {
|
||||
return aValue.substr(0, 7);
|
||||
},
|
||||
|
||||
fromICAL: function(aValue) {
|
||||
return aValue.substr(0, 7);
|
||||
},
|
||||
|
||||
decorate: function(aValue) {
|
||||
return ICAL.UtcOffset.fromString(aValue);
|
||||
},
|
||||
|
||||
undecorate: function(aValue) {
|
||||
return aValue.toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var vcard3Params = {
|
||||
"type": {
|
||||
valueType: "text",
|
||||
multiValue: ","
|
||||
},
|
||||
"value": {
|
||||
// since the value here is a 'type' lowercase is used.
|
||||
values: ["text", "uri", "date", "date-time", "phone-number", "time",
|
||||
"boolean", "integer", "float", "utc-offset", "vcard", "binary"],
|
||||
allowXName: true,
|
||||
allowIanaToken: true
|
||||
}
|
||||
};
|
||||
|
||||
var vcard3Properties = ICAL.helpers.extend(commonProperties, {
|
||||
fn: DEFAULT_TYPE_TEXT,
|
||||
n: { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
nickname: DEFAULT_TYPE_TEXT_MULTI,
|
||||
photo: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
bday: {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
detectType: function(string) {
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
|
||||
adr: { defaultType: "text", structuredValue: ";", multiValue: "," },
|
||||
label: DEFAULT_TYPE_TEXT,
|
||||
|
||||
tel: { defaultType: "phone-number" },
|
||||
email: DEFAULT_TYPE_TEXT,
|
||||
mailer: DEFAULT_TYPE_TEXT,
|
||||
|
||||
tz: { defaultType: "utc-offset", allowedTypes: ["utc-offset", "text"] },
|
||||
geo: { defaultType: "float", structuredValue: ";" },
|
||||
|
||||
title: DEFAULT_TYPE_TEXT,
|
||||
role: DEFAULT_TYPE_TEXT,
|
||||
logo: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
agent: { defaultType: "vcard", allowedTypes: ["vcard", "text", "uri"] },
|
||||
org: DEFAULT_TYPE_TEXT_STRUCTURED,
|
||||
|
||||
note: DEFAULT_TYPE_TEXT_MULTI,
|
||||
prodid: DEFAULT_TYPE_TEXT,
|
||||
rev: {
|
||||
defaultType: "date-time",
|
||||
allowedTypes: ["date-time", "date"],
|
||||
detectType: function(string) {
|
||||
return (string.indexOf('T') === -1) ? 'date' : 'date-time';
|
||||
}
|
||||
},
|
||||
"sort-string": DEFAULT_TYPE_TEXT,
|
||||
sound: { defaultType: "binary", allowedTypes: ["binary", "uri"] },
|
||||
|
||||
class: DEFAULT_TYPE_TEXT,
|
||||
key: { defaultType: "binary", allowedTypes: ["binary", "text"] }
|
||||
});
|
||||
|
||||
/**
|
||||
* iCalendar design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var icalSet = {
|
||||
value: icalValues,
|
||||
param: icalParams,
|
||||
property: icalProperties
|
||||
};
|
||||
|
||||
/**
|
||||
* vCard 4.0 design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var vcardSet = {
|
||||
value: vcardValues,
|
||||
param: vcardParams,
|
||||
property: vcardProperties
|
||||
};
|
||||
|
||||
/**
|
||||
* vCard 3.0 design set
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
var vcard3Set = {
|
||||
value: vcard3Values,
|
||||
param: vcard3Params,
|
||||
property: vcard3Properties
|
||||
};
|
||||
|
||||
/**
|
||||
* The design data, used by the parser to determine types for properties and
|
||||
* other metadata needed to produce correct jCard/jCal data.
|
||||
*
|
||||
* @alias ICAL.design
|
||||
* @namespace
|
||||
*/
|
||||
var design = {
|
||||
/**
|
||||
* A designSet describes value, parameter and property data. It is used by
|
||||
* ther parser and stringifier in components and properties to determine they
|
||||
* should be represented.
|
||||
*
|
||||
* @typedef {Object} designSet
|
||||
* @memberOf ICAL.design
|
||||
* @property {Object} value Definitions for value types, keys are type names
|
||||
* @property {Object} param Definitions for params, keys are param names
|
||||
* @property {Object} property Defintions for properties, keys are property names
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* The default set for new properties and components if none is specified.
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
defaultSet: icalSet,
|
||||
|
||||
/**
|
||||
* The default type for unknown properties
|
||||
* @type {String}
|
||||
*/
|
||||
defaultType: 'unknown',
|
||||
|
||||
/**
|
||||
* Holds the design set for known top-level components
|
||||
*
|
||||
* @type {Object}
|
||||
* @property {ICAL.design.designSet} vcard vCard VCARD
|
||||
* @property {ICAL.design.designSet} vevent iCalendar VEVENT
|
||||
* @property {ICAL.design.designSet} vtodo iCalendar VTODO
|
||||
* @property {ICAL.design.designSet} vjournal iCalendar VJOURNAL
|
||||
* @property {ICAL.design.designSet} valarm iCalendar VALARM
|
||||
* @property {ICAL.design.designSet} vtimezone iCalendar VTIMEZONE
|
||||
* @property {ICAL.design.designSet} daylight iCalendar DAYLIGHT
|
||||
* @property {ICAL.design.designSet} standard iCalendar STANDARD
|
||||
*
|
||||
* @example
|
||||
* var propertyName = 'fn';
|
||||
* var componentDesign = ICAL.design.components.vcard;
|
||||
* var propertyDetails = componentDesign.property[propertyName];
|
||||
* if (propertyDetails.defaultType == 'text') {
|
||||
* // Yep, sure is...
|
||||
* }
|
||||
*/
|
||||
components: {
|
||||
vcard: vcardSet,
|
||||
vcard3: vcard3Set,
|
||||
vevent: icalSet,
|
||||
vtodo: icalSet,
|
||||
vjournal: icalSet,
|
||||
valarm: icalSet,
|
||||
vtimezone: icalSet,
|
||||
daylight: icalSet,
|
||||
standard: icalSet
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* The design set for iCalendar (rfc5545/rfc7265) components.
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
icalendar: icalSet,
|
||||
|
||||
/**
|
||||
* The design set for vCard (rfc6350/rfc7095) components.
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
vcard: vcardSet,
|
||||
|
||||
/**
|
||||
* The design set for vCard (rfc2425/rfc2426/rfc7095) components.
|
||||
* @type {ICAL.design.designSet}
|
||||
*/
|
||||
vcard3: vcard3Set,
|
||||
|
||||
/**
|
||||
* Gets the design set for the given component name.
|
||||
*
|
||||
* @param {String} componentName The name of the component
|
||||
* @return {ICAL.design.designSet} The design set for the component
|
||||
*/
|
||||
getDesignSet: function(componentName) {
|
||||
var isInDesign = componentName && componentName in design.components;
|
||||
return isInDesign ? design.components[componentName] : design.defaultSet;
|
||||
}
|
||||
};
|
||||
|
||||
return design;
|
||||
}());
|
358
js/vendor/ical.js/lib/ical/duration.js
vendored
358
js/vendor/ical.js/lib/ical/duration.js
vendored
|
@ -1,358 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
"use strict";
|
||||
|
||||
(function() {
|
||||
var DURATION_LETTERS = /([PDWHMTS]{1,1})/;
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* This class represents the "duration" value type, with various calculation
|
||||
* and manipulation methods.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.Duration
|
||||
* @param {Object} data An object with members of the duration
|
||||
* @param {Number} data.weeks Duration in weeks
|
||||
* @param {Number} data.days Duration in days
|
||||
* @param {Number} data.hours Duration in hours
|
||||
* @param {Number} data.minutes Duration in minutes
|
||||
* @param {Number} data.seconds Duration in seconds
|
||||
* @param {Boolean} data.isNegative If true, the duration is negative
|
||||
*/
|
||||
ICAL.Duration = function icalduration(data) {
|
||||
this.wrappedJSObject = this;
|
||||
this.fromData(data);
|
||||
};
|
||||
|
||||
ICAL.Duration.prototype = {
|
||||
/**
|
||||
* The weeks in this duration
|
||||
* @type {Number}
|
||||
* @default 0
|
||||
*/
|
||||
weeks: 0,
|
||||
|
||||
/**
|
||||
* The days in this duration
|
||||
* @type {Number}
|
||||
* @default 0
|
||||
*/
|
||||
days: 0,
|
||||
|
||||
/**
|
||||
* The days in this duration
|
||||
* @type {Number}
|
||||
* @default 0
|
||||
*/
|
||||
hours: 0,
|
||||
|
||||
/**
|
||||
* The minutes in this duration
|
||||
* @type {Number}
|
||||
* @default 0
|
||||
*/
|
||||
minutes: 0,
|
||||
|
||||
/**
|
||||
* The seconds in this duration
|
||||
* @type {Number}
|
||||
* @default 0
|
||||
*/
|
||||
seconds: 0,
|
||||
|
||||
/**
|
||||
* The seconds in this duration
|
||||
* @type {Boolean}
|
||||
* @default false
|
||||
*/
|
||||
isNegative: false,
|
||||
|
||||
/**
|
||||
* The class identifier.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "icalduration"
|
||||
*/
|
||||
icalclass: "icalduration",
|
||||
|
||||
/**
|
||||
* The type name, to be used in the jCal object.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "duration"
|
||||
*/
|
||||
icaltype: "duration",
|
||||
|
||||
/**
|
||||
* Returns a clone of the duration object.
|
||||
*
|
||||
* @return {ICAL.Duration} The cloned object
|
||||
*/
|
||||
clone: function clone() {
|
||||
return ICAL.Duration.fromData(this);
|
||||
},
|
||||
|
||||
/**
|
||||
* The duration value expressed as a number of seconds.
|
||||
*
|
||||
* @return {Number} The duration value in seconds
|
||||
*/
|
||||
toSeconds: function toSeconds() {
|
||||
var seconds = this.seconds + 60 * this.minutes + 3600 * this.hours +
|
||||
86400 * this.days + 7 * 86400 * this.weeks;
|
||||
return (this.isNegative ? -seconds : seconds);
|
||||
},
|
||||
|
||||
/**
|
||||
* Reads the passed seconds value into this duration object. Afterwards,
|
||||
* members like {@link ICAL.Duration#days days} and {@link ICAL.Duration#weeks weeks} will be set up
|
||||
* accordingly.
|
||||
*
|
||||
* @param {Number} aSeconds The duration value in seconds
|
||||
* @return {ICAL.Duration} Returns this instance
|
||||
*/
|
||||
fromSeconds: function fromSeconds(aSeconds) {
|
||||
var secs = Math.abs(aSeconds);
|
||||
|
||||
this.isNegative = (aSeconds < 0);
|
||||
this.days = ICAL.helpers.trunc(secs / 86400);
|
||||
|
||||
// If we have a flat number of weeks, use them.
|
||||
if (this.days % 7 == 0) {
|
||||
this.weeks = this.days / 7;
|
||||
this.days = 0;
|
||||
} else {
|
||||
this.weeks = 0;
|
||||
}
|
||||
|
||||
secs -= (this.days + 7 * this.weeks) * 86400;
|
||||
|
||||
this.hours = ICAL.helpers.trunc(secs / 3600);
|
||||
secs -= this.hours * 3600;
|
||||
|
||||
this.minutes = ICAL.helpers.trunc(secs / 60);
|
||||
secs -= this.minutes * 60;
|
||||
|
||||
this.seconds = secs;
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets up the current instance using members from the passed data object.
|
||||
*
|
||||
* @param {Object} aData An object with members of the duration
|
||||
* @param {Number} aData.weeks Duration in weeks
|
||||
* @param {Number} aData.days Duration in days
|
||||
* @param {Number} aData.hours Duration in hours
|
||||
* @param {Number} aData.minutes Duration in minutes
|
||||
* @param {Number} aData.seconds Duration in seconds
|
||||
* @param {Boolean} aData.isNegative If true, the duration is negative
|
||||
*/
|
||||
fromData: function fromData(aData) {
|
||||
var propsToCopy = ["weeks", "days", "hours",
|
||||
"minutes", "seconds", "isNegative"];
|
||||
for (var key in propsToCopy) {
|
||||
/* istanbul ignore if */
|
||||
if (!propsToCopy.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
var prop = propsToCopy[key];
|
||||
if (aData && prop in aData) {
|
||||
this[prop] = aData[prop];
|
||||
} else {
|
||||
this[prop] = 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Resets the duration instance to the default values, i.e. PT0S
|
||||
*/
|
||||
reset: function reset() {
|
||||
this.isNegative = false;
|
||||
this.weeks = 0;
|
||||
this.days = 0;
|
||||
this.hours = 0;
|
||||
this.minutes = 0;
|
||||
this.seconds = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Compares the duration instance with another one.
|
||||
*
|
||||
* @param {ICAL.Duration} aOther The instance to compare with
|
||||
* @return {Number} -1, 0 or 1 for less/equal/greater
|
||||
*/
|
||||
compare: function compare(aOther) {
|
||||
var thisSeconds = this.toSeconds();
|
||||
var otherSeconds = aOther.toSeconds();
|
||||
return (thisSeconds > otherSeconds) - (thisSeconds < otherSeconds);
|
||||
},
|
||||
|
||||
/**
|
||||
* Normalizes the duration instance. For example, a duration with a value
|
||||
* of 61 seconds will be normalized to 1 minute and 1 second.
|
||||
*/
|
||||
normalize: function normalize() {
|
||||
this.fromSeconds(this.toSeconds());
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this duration.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function toString() {
|
||||
if (this.toSeconds() == 0) {
|
||||
return "PT0S";
|
||||
} else {
|
||||
var str = "";
|
||||
if (this.isNegative) str += "-";
|
||||
str += "P";
|
||||
if (this.weeks) str += this.weeks + "W";
|
||||
if (this.days) str += this.days + "D";
|
||||
|
||||
if (this.hours || this.minutes || this.seconds) {
|
||||
str += "T";
|
||||
if (this.hours) str += this.hours + "H";
|
||||
if (this.minutes) str += this.minutes + "M";
|
||||
if (this.seconds) str += this.seconds + "S";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The iCalendar string representation of this duration.
|
||||
* @return {String}
|
||||
*/
|
||||
toICALString: function() {
|
||||
return this.toString();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a new ICAL.Duration instance from the passed seconds value.
|
||||
*
|
||||
* @param {Number} aSeconds The seconds to create the instance from
|
||||
* @return {ICAL.Duration} The newly created duration instance
|
||||
*/
|
||||
ICAL.Duration.fromSeconds = function icalduration_from_seconds(aSeconds) {
|
||||
return (new ICAL.Duration()).fromSeconds(aSeconds);
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal helper function to handle a chunk of a duration.
|
||||
*
|
||||
* @param {String} letter type of duration chunk
|
||||
* @param {String} number numeric value or -/+
|
||||
* @param {Object} dict target to assign values to
|
||||
*/
|
||||
function parseDurationChunk(letter, number, object) {
|
||||
var type;
|
||||
switch (letter) {
|
||||
case 'P':
|
||||
if (number && number === '-') {
|
||||
object.isNegative = true;
|
||||
} else {
|
||||
object.isNegative = false;
|
||||
}
|
||||
// period
|
||||
break;
|
||||
case 'D':
|
||||
type = 'days';
|
||||
break;
|
||||
case 'W':
|
||||
type = 'weeks';
|
||||
break;
|
||||
case 'H':
|
||||
type = 'hours';
|
||||
break;
|
||||
case 'M':
|
||||
type = 'minutes';
|
||||
break;
|
||||
case 'S':
|
||||
type = 'seconds';
|
||||
break;
|
||||
default:
|
||||
// Not a valid chunk
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (type) {
|
||||
if (!number && number !== 0) {
|
||||
throw new Error(
|
||||
'invalid duration value: Missing number before "' + letter + '"'
|
||||
);
|
||||
}
|
||||
var num = parseInt(number, 10);
|
||||
if (ICAL.helpers.isStrictlyNaN(num)) {
|
||||
throw new Error(
|
||||
'invalid duration value: Invalid number "' + number + '" before "' + letter + '"'
|
||||
);
|
||||
}
|
||||
object[type] = num;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given string is an iCalendar duration value.
|
||||
*
|
||||
* @param {String} value The raw ical value
|
||||
* @return {Boolean} True, if the given value is of the
|
||||
* duration ical type
|
||||
*/
|
||||
ICAL.Duration.isValueString = function(string) {
|
||||
return (string[0] === 'P' || string[1] === 'P');
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.Duration} instance from the passed string.
|
||||
*
|
||||
* @param {String} aStr The string to parse
|
||||
* @return {ICAL.Duration} The created duration instance
|
||||
*/
|
||||
ICAL.Duration.fromString = function icalduration_from_string(aStr) {
|
||||
var pos = 0;
|
||||
var dict = Object.create(null);
|
||||
var chunks = 0;
|
||||
|
||||
while ((pos = aStr.search(DURATION_LETTERS)) !== -1) {
|
||||
var type = aStr[pos];
|
||||
var numeric = aStr.substr(0, pos);
|
||||
aStr = aStr.substr(pos + 1);
|
||||
|
||||
chunks += parseDurationChunk(type, numeric, dict);
|
||||
}
|
||||
|
||||
if (chunks < 2) {
|
||||
// There must be at least a chunk with "P" and some unit chunk
|
||||
throw new Error(
|
||||
'invalid duration value: Not enough duration components in "' + aStr + '"'
|
||||
);
|
||||
}
|
||||
|
||||
return new ICAL.Duration(dict);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new ICAL.Duration instance from the given data object.
|
||||
*
|
||||
* @param {Object} aData An object with members of the duration
|
||||
* @param {Number} aData.weeks Duration in weeks
|
||||
* @param {Number} aData.days Duration in days
|
||||
* @param {Number} aData.hours Duration in hours
|
||||
* @param {Number} aData.minutes Duration in minutes
|
||||
* @param {Number} aData.seconds Duration in seconds
|
||||
* @param {Boolean} aData.isNegative If true, the duration is negative
|
||||
* @return {ICAL.Duration} The createad duration instance
|
||||
*/
|
||||
ICAL.Duration.fromData = function icalduration_from_data(aData) {
|
||||
return new ICAL.Duration(aData);
|
||||
};
|
||||
})();
|
531
js/vendor/ical.js/lib/ical/event.js
vendored
531
js/vendor/ical.js/lib/ical/event.js
vendored
|
@ -1,531 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.Event = (function() {
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* ICAL.js is organized into multiple layers. The bottom layer is a raw jCal
|
||||
* object, followed by the component/property layer. The highest level is the
|
||||
* event representation, which this class is part of. See the
|
||||
* {@tutorial layers} guide for more details.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.Event
|
||||
* @param {ICAL.Component=} component The ICAL.Component to base this event on
|
||||
* @param {Object} options Options for this event
|
||||
* @param {Boolean} options.strictExceptions
|
||||
* When true, will verify exceptions are related by their UUID
|
||||
* @param {Array<ICAL.Component|ICAL.Event>} options.exceptions
|
||||
* Exceptions to this event, either as components or events
|
||||
*/
|
||||
function Event(component, options) {
|
||||
if (!(component instanceof ICAL.Component)) {
|
||||
options = component;
|
||||
component = null;
|
||||
}
|
||||
|
||||
if (component) {
|
||||
this.component = component;
|
||||
} else {
|
||||
this.component = new ICAL.Component('vevent');
|
||||
}
|
||||
|
||||
this._rangeExceptionCache = Object.create(null);
|
||||
this.exceptions = Object.create(null);
|
||||
this.rangeExceptions = [];
|
||||
|
||||
if (options && options.strictExceptions) {
|
||||
this.strictExceptions = options.strictExceptions;
|
||||
}
|
||||
|
||||
if (options && options.exceptions) {
|
||||
options.exceptions.forEach(this.relateException, this);
|
||||
}
|
||||
}
|
||||
|
||||
Event.prototype = {
|
||||
|
||||
THISANDFUTURE: 'THISANDFUTURE',
|
||||
|
||||
/**
|
||||
* List of related event exceptions.
|
||||
*
|
||||
* @type {ICAL.Event[]}
|
||||
*/
|
||||
exceptions: null,
|
||||
|
||||
/**
|
||||
* When true, will verify exceptions are related by their UUID.
|
||||
*
|
||||
* @type {Boolean}
|
||||
*/
|
||||
strictExceptions: false,
|
||||
|
||||
/**
|
||||
* Relates a given event exception to this object. If the given component
|
||||
* does not share the UID of this event it cannot be related and will throw
|
||||
* an exception.
|
||||
*
|
||||
* If this component is an exception it cannot have other exceptions
|
||||
* related to it.
|
||||
*
|
||||
* @param {ICAL.Component|ICAL.Event} obj Component or event
|
||||
*/
|
||||
relateException: function(obj) {
|
||||
if (this.isRecurrenceException()) {
|
||||
throw new Error('cannot relate exception to exceptions');
|
||||
}
|
||||
|
||||
if (obj instanceof ICAL.Component) {
|
||||
obj = new ICAL.Event(obj);
|
||||
}
|
||||
|
||||
if (this.strictExceptions && obj.uid !== this.uid) {
|
||||
throw new Error('attempted to relate unrelated exception');
|
||||
}
|
||||
|
||||
var id = obj.recurrenceId.toString();
|
||||
|
||||
// we don't sort or manage exceptions directly
|
||||
// here the recurrence expander handles that.
|
||||
this.exceptions[id] = obj;
|
||||
|
||||
// index RANGE=THISANDFUTURE exceptions so we can
|
||||
// look them up later in getOccurrenceDetails.
|
||||
if (obj.modifiesFuture()) {
|
||||
var item = [
|
||||
obj.recurrenceId.toUnixTime(), id
|
||||
];
|
||||
|
||||
// we keep them sorted so we can find the nearest
|
||||
// value later on...
|
||||
var idx = ICAL.helpers.binsearchInsert(
|
||||
this.rangeExceptions,
|
||||
item,
|
||||
compareRangeException
|
||||
);
|
||||
|
||||
this.rangeExceptions.splice(idx, 0, item);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if this record is an exception and has the RANGE=THISANDFUTURE
|
||||
* value.
|
||||
*
|
||||
* @return {Boolean} True, when exception is within range
|
||||
*/
|
||||
modifiesFuture: function() {
|
||||
var range = this.component.getFirstPropertyValue('range');
|
||||
return range === this.THISANDFUTURE;
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds the range exception nearest to the given date.
|
||||
*
|
||||
* @param {ICAL.Time} time usually an occurrence time of an event
|
||||
* @return {?ICAL.Event} the related event/exception or null
|
||||
*/
|
||||
findRangeException: function(time) {
|
||||
if (!this.rangeExceptions.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var utc = time.toUnixTime();
|
||||
var idx = ICAL.helpers.binsearchInsert(
|
||||
this.rangeExceptions,
|
||||
[utc],
|
||||
compareRangeException
|
||||
);
|
||||
|
||||
idx -= 1;
|
||||
|
||||
// occurs before
|
||||
if (idx < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var rangeItem = this.rangeExceptions[idx];
|
||||
|
||||
/* istanbul ignore next: sanity check only */
|
||||
if (utc < rangeItem[0]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return rangeItem[1];
|
||||
},
|
||||
|
||||
/**
|
||||
* This object is returned by {@link ICAL.Event#getOccurrenceDetails getOccurrenceDetails}
|
||||
*
|
||||
* @typedef {Object} occurrenceDetails
|
||||
* @memberof ICAL.Event
|
||||
* @property {ICAL.Time} recurrenceId The passed in recurrence id
|
||||
* @property {ICAL.Event} item The occurrence
|
||||
* @property {ICAL.Time} startDate The start of the occurrence
|
||||
* @property {ICAL.Time} endDate The end of the occurrence
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the occurrence details based on its start time. If the
|
||||
* occurrence has an exception will return the details for that exception.
|
||||
*
|
||||
* NOTE: this method is intend to be used in conjunction
|
||||
* with the {@link ICAL.Event#iterator iterator} method.
|
||||
*
|
||||
* @param {ICAL.Time} occurrence time occurrence
|
||||
* @return {ICAL.Event.occurrenceDetails} Information about the occurrence
|
||||
*/
|
||||
getOccurrenceDetails: function(occurrence) {
|
||||
var id = occurrence.toString();
|
||||
var utcId = occurrence.convertToZone(ICAL.Timezone.utcTimezone).toString();
|
||||
var item;
|
||||
var result = {
|
||||
//XXX: Clone?
|
||||
recurrenceId: occurrence
|
||||
};
|
||||
|
||||
if (id in this.exceptions) {
|
||||
item = result.item = this.exceptions[id];
|
||||
result.startDate = item.startDate;
|
||||
result.endDate = item.endDate;
|
||||
result.item = item;
|
||||
} else if (utcId in this.exceptions) {
|
||||
item = this.exceptions[utcId];
|
||||
result.startDate = item.startDate;
|
||||
result.endDate = item.endDate;
|
||||
result.item = item;
|
||||
} else {
|
||||
// range exceptions (RANGE=THISANDFUTURE) have a
|
||||
// lower priority then direct exceptions but
|
||||
// must be accounted for first. Their item is
|
||||
// always the first exception with the range prop.
|
||||
var rangeExceptionId = this.findRangeException(
|
||||
occurrence
|
||||
);
|
||||
var end;
|
||||
|
||||
if (rangeExceptionId) {
|
||||
var exception = this.exceptions[rangeExceptionId];
|
||||
|
||||
// range exception must modify standard time
|
||||
// by the difference (if any) in start/end times.
|
||||
result.item = exception;
|
||||
|
||||
var startDiff = this._rangeExceptionCache[rangeExceptionId];
|
||||
|
||||
if (!startDiff) {
|
||||
var original = exception.recurrenceId.clone();
|
||||
var newStart = exception.startDate.clone();
|
||||
|
||||
// zones must be same otherwise subtract may be incorrect.
|
||||
original.zone = newStart.zone;
|
||||
startDiff = newStart.subtractDate(original);
|
||||
|
||||
this._rangeExceptionCache[rangeExceptionId] = startDiff;
|
||||
}
|
||||
|
||||
var start = occurrence.clone();
|
||||
start.zone = exception.startDate.zone;
|
||||
start.addDuration(startDiff);
|
||||
|
||||
end = start.clone();
|
||||
end.addDuration(exception.duration);
|
||||
|
||||
result.startDate = start;
|
||||
result.endDate = end;
|
||||
} else {
|
||||
// no range exception standard expansion
|
||||
end = occurrence.clone();
|
||||
end.addDuration(this.duration);
|
||||
|
||||
result.endDate = end;
|
||||
result.startDate = occurrence;
|
||||
result.item = this;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Builds a recur expansion instance for a specific point in time (defaults
|
||||
* to startDate).
|
||||
*
|
||||
* @param {ICAL.Time} startTime Starting point for expansion
|
||||
* @return {ICAL.RecurExpansion} Expansion object
|
||||
*/
|
||||
iterator: function(startTime) {
|
||||
return new ICAL.RecurExpansion({
|
||||
component: this.component,
|
||||
dtstart: startTime || this.startDate
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the event is recurring
|
||||
*
|
||||
* @return {Boolean} True, if event is recurring
|
||||
*/
|
||||
isRecurring: function() {
|
||||
var comp = this.component;
|
||||
return comp.hasProperty('rrule') || comp.hasProperty('rdate');
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the event describes a recurrence exception. See
|
||||
* {@tutorial terminology} for details.
|
||||
*
|
||||
* @return {Boolean} True, if the even describes a recurrence exception
|
||||
*/
|
||||
isRecurrenceException: function() {
|
||||
return this.component.hasProperty('recurrence-id');
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the types of recurrences this event may have.
|
||||
*
|
||||
* Returned as an object with the following possible keys:
|
||||
*
|
||||
* - YEARLY
|
||||
* - MONTHLY
|
||||
* - WEEKLY
|
||||
* - DAILY
|
||||
* - MINUTELY
|
||||
* - SECONDLY
|
||||
*
|
||||
* @return {Object.<ICAL.Recur.frequencyValues, Boolean>}
|
||||
* Object of recurrence flags
|
||||
*/
|
||||
getRecurrenceTypes: function() {
|
||||
var rules = this.component.getAllProperties('rrule');
|
||||
var i = 0;
|
||||
var len = rules.length;
|
||||
var result = Object.create(null);
|
||||
|
||||
for (; i < len; i++) {
|
||||
var value = rules[i].getFirstValue();
|
||||
result[value.freq] = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* The uid of this event
|
||||
* @type {String}
|
||||
*/
|
||||
get uid() {
|
||||
return this._firstProp('uid');
|
||||
},
|
||||
|
||||
set uid(value) {
|
||||
this._setProp('uid', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The start date
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
get startDate() {
|
||||
return this._firstProp('dtstart');
|
||||
},
|
||||
|
||||
set startDate(value) {
|
||||
this._setTime('dtstart', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The end date. This can be the result directly from the property, or the
|
||||
* end date calculated from start date and duration.
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
get endDate() {
|
||||
var endDate = this._firstProp('dtend');
|
||||
if (!endDate) {
|
||||
var duration = this._firstProp('duration');
|
||||
endDate = this.startDate.clone();
|
||||
if (duration) {
|
||||
endDate.addDuration(duration);
|
||||
} else if (endDate.isDate) {
|
||||
endDate.day += 1;
|
||||
}
|
||||
}
|
||||
return endDate;
|
||||
},
|
||||
|
||||
set endDate(value) {
|
||||
this._setTime('dtend', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The duration. This can be the result directly from the property, or the
|
||||
* duration calculated from start date and end date.
|
||||
* @type {ICAL.Duration}
|
||||
* @readonly
|
||||
*/
|
||||
get duration() {
|
||||
var duration = this._firstProp('duration');
|
||||
if (!duration) {
|
||||
return this.endDate.subtractDate(this.startDate);
|
||||
}
|
||||
return duration;
|
||||
},
|
||||
|
||||
/**
|
||||
* The location of the event.
|
||||
* @type {String}
|
||||
*/
|
||||
get location() {
|
||||
return this._firstProp('location');
|
||||
},
|
||||
|
||||
set location(value) {
|
||||
return this._setProp('location', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The attendees in the event
|
||||
* @type {ICAL.Property[]}
|
||||
* @readonly
|
||||
*/
|
||||
get attendees() {
|
||||
//XXX: This is way lame we should have a better
|
||||
// data structure for this later.
|
||||
return this.component.getAllProperties('attendee');
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* The event summary
|
||||
* @type {String}
|
||||
*/
|
||||
get summary() {
|
||||
return this._firstProp('summary');
|
||||
},
|
||||
|
||||
set summary(value) {
|
||||
this._setProp('summary', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The event description.
|
||||
* @type {String}
|
||||
*/
|
||||
get description() {
|
||||
return this._firstProp('description');
|
||||
},
|
||||
|
||||
set description(value) {
|
||||
this._setProp('description', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The organizer value as an uri. In most cases this is a mailto: uri, but
|
||||
* it can also be something else, like urn:uuid:...
|
||||
* @type {String}
|
||||
*/
|
||||
get organizer() {
|
||||
return this._firstProp('organizer');
|
||||
},
|
||||
|
||||
set organizer(value) {
|
||||
this._setProp('organizer', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The sequence value for this event. Used for scheduling
|
||||
* see {@tutorial terminology}.
|
||||
* @type {Number}
|
||||
*/
|
||||
get sequence() {
|
||||
return this._firstProp('sequence');
|
||||
},
|
||||
|
||||
set sequence(value) {
|
||||
this._setProp('sequence', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* The recurrence id for this event. See {@tutorial terminology} for details.
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
get recurrenceId() {
|
||||
return this._firstProp('recurrence-id');
|
||||
},
|
||||
|
||||
set recurrenceId(value) {
|
||||
this._setProp('recurrence-id', value);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set/update a time property's value.
|
||||
* This will also update the TZID of the property.
|
||||
*
|
||||
* TODO: this method handles the case where we are switching
|
||||
* from a known timezone to an implied timezone (one without TZID).
|
||||
* This does _not_ handle the case of moving between a known
|
||||
* (by TimezoneService) timezone to an unknown timezone...
|
||||
*
|
||||
* We will not add/remove/update the VTIMEZONE subcomponents
|
||||
* leading to invalid ICAL data...
|
||||
* @private
|
||||
* @param {String} propName The property name
|
||||
* @param {ICAL.Time} time The time to set
|
||||
*/
|
||||
_setTime: function(propName, time) {
|
||||
var prop = this.component.getFirstProperty(propName);
|
||||
|
||||
if (!prop) {
|
||||
prop = new ICAL.Property(propName);
|
||||
this.component.addProperty(prop);
|
||||
}
|
||||
|
||||
// utc and local don't get a tzid
|
||||
if (
|
||||
time.zone === ICAL.Timezone.localTimezone ||
|
||||
time.zone === ICAL.Timezone.utcTimezone
|
||||
) {
|
||||
// remove the tzid
|
||||
prop.removeParameter('tzid');
|
||||
} else {
|
||||
prop.setParameter('tzid', time.zone.tzid);
|
||||
}
|
||||
|
||||
prop.setValue(time);
|
||||
},
|
||||
|
||||
_setProp: function(name, value) {
|
||||
this.component.updatePropertyWithValue(name, value);
|
||||
},
|
||||
|
||||
_firstProp: function(name) {
|
||||
return this.component.getFirstPropertyValue(name);
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this event.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function() {
|
||||
return this.component.toString();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function compareRangeException(a, b) {
|
||||
if (a[0] > b[0]) return 1;
|
||||
if (b[0] > a[0]) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Event;
|
||||
}());
|
319
js/vendor/ical.js/lib/ical/helpers.js
vendored
319
js/vendor/ical.js/lib/ical/helpers.js
vendored
|
@ -1,319 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
/* jshint ignore:start */
|
||||
if (typeof module === 'object') {
|
||||
// CommonJS, where exports may be different each time.
|
||||
ICAL = module.exports;
|
||||
} else if (typeof ICAL !== 'object') {/* istanbul ignore next */
|
||||
/** @ignore */
|
||||
this.ICAL = {};
|
||||
}
|
||||
/* jshint ignore:end */
|
||||
|
||||
|
||||
/**
|
||||
* The number of characters before iCalendar line folding should occur
|
||||
* @type {Number}
|
||||
* @default 75
|
||||
*/
|
||||
ICAL.foldLength = 75;
|
||||
|
||||
|
||||
/**
|
||||
* The character(s) to be used for a newline. The default value is provided by
|
||||
* rfc5545.
|
||||
* @type {String}
|
||||
* @default "\r\n"
|
||||
*/
|
||||
ICAL.newLineChar = '\r\n';
|
||||
|
||||
|
||||
/**
|
||||
* Helper functions used in various places within ical.js
|
||||
* @namespace
|
||||
*/
|
||||
ICAL.helpers = {
|
||||
/**
|
||||
* Checks if the given type is of the number type and also NaN.
|
||||
*
|
||||
* @param {Number} number The number to check
|
||||
* @return {Boolean} True, if the number is strictly NaN
|
||||
*/
|
||||
isStrictlyNaN: function(number) {
|
||||
return typeof(number) === 'number' && isNaN(number);
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a string value that is expected to be an integer, when the valid is
|
||||
* not an integer throws a decoration error.
|
||||
*
|
||||
* @param {String} string Raw string input
|
||||
* @return {Number} Parsed integer
|
||||
*/
|
||||
strictParseInt: function(string) {
|
||||
var result = parseInt(string, 10);
|
||||
|
||||
if (ICAL.helpers.isStrictlyNaN(result)) {
|
||||
throw new Error(
|
||||
'Could not extract integer from "' + string + '"'
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates or returns a class instance of a given type with the initialization
|
||||
* data if the data is not already an instance of the given type.
|
||||
*
|
||||
* @example
|
||||
* var time = new ICAL.Time(...);
|
||||
* var result = ICAL.helpers.formatClassType(time, ICAL.Time);
|
||||
*
|
||||
* (result instanceof ICAL.Time)
|
||||
* // => true
|
||||
*
|
||||
* result = ICAL.helpers.formatClassType({}, ICAL.Time);
|
||||
* (result isntanceof ICAL.Time)
|
||||
* // => true
|
||||
*
|
||||
*
|
||||
* @param {Object} data object initialization data
|
||||
* @param {Object} type object type (like ICAL.Time)
|
||||
* @return {?} An instance of the found type.
|
||||
*/
|
||||
formatClassType: function formatClassType(data, type) {
|
||||
if (typeof(data) === 'undefined') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (data instanceof type) {
|
||||
return data;
|
||||
}
|
||||
return new type(data);
|
||||
},
|
||||
|
||||
/**
|
||||
* Identical to indexOf but will only match values when they are not preceded
|
||||
* by a backslash character.
|
||||
*
|
||||
* @param {String} buffer String to search
|
||||
* @param {String} search Value to look for
|
||||
* @param {Number} pos Start position
|
||||
* @return {Number} The position, or -1 if not found
|
||||
*/
|
||||
unescapedIndexOf: function(buffer, search, pos) {
|
||||
while ((pos = buffer.indexOf(search, pos)) !== -1) {
|
||||
if (pos > 0 && buffer[pos - 1] === '\\') {
|
||||
pos += 1;
|
||||
} else {
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Find the index for insertion using binary search.
|
||||
*
|
||||
* @param {Array} list The list to search
|
||||
* @param {?} seekVal The value to insert
|
||||
* @param {function(?,?)} cmpfunc The comparison func, that can
|
||||
* compare two seekVals
|
||||
* @return {Number} The insert position
|
||||
*/
|
||||
binsearchInsert: function(list, seekVal, cmpfunc) {
|
||||
if (!list.length)
|
||||
return 0;
|
||||
|
||||
var low = 0, high = list.length - 1,
|
||||
mid, cmpval;
|
||||
|
||||
while (low <= high) {
|
||||
mid = low + Math.floor((high - low) / 2);
|
||||
cmpval = cmpfunc(seekVal, list[mid]);
|
||||
|
||||
if (cmpval < 0)
|
||||
high = mid - 1;
|
||||
else if (cmpval > 0)
|
||||
low = mid + 1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (cmpval < 0)
|
||||
return mid; // insertion is displacing, so use mid outright.
|
||||
else if (cmpval > 0)
|
||||
return mid + 1;
|
||||
else
|
||||
return mid;
|
||||
},
|
||||
|
||||
/**
|
||||
* Convenience function for debug output
|
||||
* @private
|
||||
*/
|
||||
dumpn: /* istanbul ignore next */ function() {
|
||||
if (!ICAL.debug) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof (console) !== 'undefined' && 'log' in console) {
|
||||
ICAL.helpers.dumpn = function consoleDumpn(input) {
|
||||
console.log(input);
|
||||
};
|
||||
} else {
|
||||
ICAL.helpers.dumpn = function geckoDumpn(input) {
|
||||
dump(input + '\n');
|
||||
};
|
||||
}
|
||||
|
||||
ICAL.helpers.dumpn(arguments[0]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Clone the passed object or primitive. By default a shallow clone will be
|
||||
* executed.
|
||||
*
|
||||
* @param {*} aSrc The thing to clone
|
||||
* @param {Boolean=} aDeep If true, a deep clone will be performed
|
||||
* @return {*} The copy of the thing
|
||||
*/
|
||||
clone: function(aSrc, aDeep) {
|
||||
if (!aSrc || typeof aSrc != "object") {
|
||||
return aSrc;
|
||||
} else if (aSrc instanceof Date) {
|
||||
return new Date(aSrc.getTime());
|
||||
} else if ("clone" in aSrc) {
|
||||
return aSrc.clone();
|
||||
} else if (Array.isArray(aSrc)) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < aSrc.length; i++) {
|
||||
arr.push(aDeep ? ICAL.helpers.clone(aSrc[i], true) : aSrc[i]);
|
||||
}
|
||||
return arr;
|
||||
} else {
|
||||
var obj = {};
|
||||
for (var name in aSrc) {
|
||||
// uses prototype method to allow use of Object.create(null);
|
||||
/* istanbul ignore else */
|
||||
if (Object.prototype.hasOwnProperty.call(aSrc, name)) {
|
||||
if (aDeep) {
|
||||
obj[name] = ICAL.helpers.clone(aSrc[name], true);
|
||||
} else {
|
||||
obj[name] = aSrc[name];
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Performs iCalendar line folding. A line ending character is inserted and
|
||||
* the next line begins with a whitespace.
|
||||
*
|
||||
* @example
|
||||
* SUMMARY:This line will be fold
|
||||
* ed right in the middle of a word.
|
||||
*
|
||||
* @param {String} aLine The line to fold
|
||||
* @return {String} The folded line
|
||||
*/
|
||||
foldline: function foldline(aLine) {
|
||||
var result = "";
|
||||
var line = aLine || "";
|
||||
|
||||
while (line.length) {
|
||||
result += ICAL.newLineChar + " " + line.substr(0, ICAL.foldLength);
|
||||
line = line.substr(ICAL.foldLength);
|
||||
}
|
||||
return result.substr(ICAL.newLineChar.length + 1);
|
||||
},
|
||||
|
||||
/**
|
||||
* Pads the given string or number with zeros so it will have at least two
|
||||
* characters.
|
||||
*
|
||||
* @param {String|Number} data The string or number to pad
|
||||
* @return {String} The number padded as a string
|
||||
*/
|
||||
pad2: function pad(data) {
|
||||
if (typeof(data) !== 'string') {
|
||||
// handle fractions.
|
||||
if (typeof(data) === 'number') {
|
||||
data = parseInt(data);
|
||||
}
|
||||
data = String(data);
|
||||
}
|
||||
|
||||
var len = data.length;
|
||||
|
||||
switch (len) {
|
||||
case 0:
|
||||
return '00';
|
||||
case 1:
|
||||
return '0' + data;
|
||||
default:
|
||||
return data;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Truncates the given number, correctly handling negative numbers.
|
||||
*
|
||||
* @param {Number} number The number to truncate
|
||||
* @return {Number} The truncated number
|
||||
*/
|
||||
trunc: function trunc(number) {
|
||||
return (number < 0 ? Math.ceil(number) : Math.floor(number));
|
||||
},
|
||||
|
||||
/**
|
||||
* Poor-man's cross-browser inheritance for JavaScript. Doesn't support all
|
||||
* the features, but enough for our usage.
|
||||
*
|
||||
* @param {Function} base The base class constructor function.
|
||||
* @param {Function} child The child class constructor function.
|
||||
* @param {Object} extra Extends the prototype with extra properties
|
||||
* and methods
|
||||
*/
|
||||
inherits: function(base, child, extra) {
|
||||
function F() {}
|
||||
F.prototype = base.prototype;
|
||||
child.prototype = new F();
|
||||
|
||||
if (extra) {
|
||||
ICAL.helpers.extend(extra, child.prototype);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Poor-man's cross-browser object extension. Doesn't support all the
|
||||
* features, but enough for our usage. Note that the target's properties are
|
||||
* not overwritten with the source properties.
|
||||
*
|
||||
* @example
|
||||
* var child = ICAL.helpers.extend(parent, {
|
||||
* "bar": 123
|
||||
* });
|
||||
*
|
||||
* @param {Object} source The object to extend
|
||||
* @param {Object} target The object to extend with
|
||||
* @return {Object} Returns the target.
|
||||
*/
|
||||
extend: function(source, target) {
|
||||
for (var key in source) {
|
||||
var descr = Object.getOwnPropertyDescriptor(source, key);
|
||||
if (descr && !Object.getOwnPropertyDescriptor(target, key)) {
|
||||
Object.defineProperty(target, key, descr);
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
};
|
547
js/vendor/ical.js/lib/ical/parse.js
vendored
547
js/vendor/ical.js/lib/ical/parse.js
vendored
|
@ -1,547 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* Contains various functions to parse iCalendar and vCard data.
|
||||
* @namespace
|
||||
*/
|
||||
ICAL.parse = (function() {
|
||||
'use strict';
|
||||
|
||||
var CHAR = /[^ \t]/;
|
||||
var MULTIVALUE_DELIMITER = ',';
|
||||
var VALUE_DELIMITER = ':';
|
||||
var PARAM_DELIMITER = ';';
|
||||
var PARAM_NAME_DELIMITER = '=';
|
||||
var DEFAULT_VALUE_TYPE = 'unknown';
|
||||
var DEFAULT_PARAM_TYPE = 'text';
|
||||
|
||||
var design = ICAL.design;
|
||||
var helpers = ICAL.helpers;
|
||||
|
||||
/**
|
||||
* An error that occurred during parsing.
|
||||
*
|
||||
* @param {String} message The error message
|
||||
* @memberof ICAL.parse
|
||||
* @extends {Error}
|
||||
* @class
|
||||
*/
|
||||
function ParserError(message) {
|
||||
this.message = message;
|
||||
this.name = 'ParserError';
|
||||
|
||||
try {
|
||||
throw new Error();
|
||||
} catch (e) {
|
||||
if (e.stack) {
|
||||
var split = e.stack.split('\n');
|
||||
split.shift();
|
||||
this.stack = split.join('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ParserError.prototype = Error.prototype;
|
||||
|
||||
/**
|
||||
* Parses iCalendar or vCard data into a raw jCal object. Consult
|
||||
* documentation on the {@tutorial layers|layers of parsing} for more
|
||||
* details.
|
||||
*
|
||||
* @function ICAL.parse
|
||||
* @variation function
|
||||
* @todo Fix the API to be more clear on the return type
|
||||
* @param {String} input The string data to parse
|
||||
* @return {Object|Object[]} A single jCal object, or an array thereof
|
||||
*/
|
||||
function parser(input) {
|
||||
var state = {};
|
||||
var root = state.component = [];
|
||||
|
||||
state.stack = [root];
|
||||
|
||||
parser._eachLine(input, function(err, line) {
|
||||
parser._handleContentLine(line, state);
|
||||
});
|
||||
|
||||
|
||||
// when there are still items on the stack
|
||||
// throw a fatal error, a component was not closed
|
||||
// correctly in that case.
|
||||
if (state.stack.length > 1) {
|
||||
throw new ParserError(
|
||||
'invalid ical body. component began but did not end'
|
||||
);
|
||||
}
|
||||
|
||||
state = null;
|
||||
|
||||
return (root.length == 1 ? root[0] : root);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an iCalendar property value into the jCal for a single property
|
||||
*
|
||||
* @function ICAL.parse.property
|
||||
* @param {String} str
|
||||
* The iCalendar property string to parse
|
||||
* @param {ICAL.design.designSet=} designSet
|
||||
* The design data to use for this property
|
||||
* @return {Object}
|
||||
* The jCal Object containing the property
|
||||
*/
|
||||
parser.property = function(str, designSet) {
|
||||
var state = {
|
||||
component: [[], []],
|
||||
designSet: designSet || design.defaultSet
|
||||
};
|
||||
parser._handleContentLine(str, state);
|
||||
return state.component[1][0];
|
||||
};
|
||||
|
||||
/**
|
||||
* Convenience method to parse a component. You can use ICAL.parse() directly
|
||||
* instead.
|
||||
*
|
||||
* @function ICAL.parse.component
|
||||
* @see ICAL.parse(function)
|
||||
* @param {String} str The iCalendar component string to parse
|
||||
* @return {Object} The jCal Object containing the component
|
||||
*/
|
||||
parser.component = function(str) {
|
||||
return parser(str);
|
||||
};
|
||||
|
||||
// classes & constants
|
||||
parser.ParserError = ParserError;
|
||||
|
||||
/**
|
||||
* The state for parsing content lines from an iCalendar/vCard string.
|
||||
*
|
||||
* @private
|
||||
* @memberof ICAL.parse
|
||||
* @typedef {Object} parserState
|
||||
* @property {ICAL.design.designSet} designSet The design set to use for parsing
|
||||
* @property {ICAL.Component[]} stack The stack of components being processed
|
||||
* @property {ICAL.Component} component The currently active component
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Handles a single line of iCalendar/vCard, updating the state.
|
||||
*
|
||||
* @private
|
||||
* @function ICAL.parse._handleContentLine
|
||||
* @param {String} line The content line to process
|
||||
* @param {ICAL.parse.parserState} The current state of the line parsing
|
||||
*/
|
||||
parser._handleContentLine = function(line, state) {
|
||||
// break up the parts of the line
|
||||
var valuePos = line.indexOf(VALUE_DELIMITER);
|
||||
var paramPos = line.indexOf(PARAM_DELIMITER);
|
||||
|
||||
var lastParamIndex;
|
||||
var lastValuePos;
|
||||
|
||||
// name of property or begin/end
|
||||
var name;
|
||||
var value;
|
||||
// params is only overridden if paramPos !== -1.
|
||||
// we can't do params = params || {} later on
|
||||
// because it sacrifices ops.
|
||||
var params = {};
|
||||
|
||||
/**
|
||||
* Different property cases
|
||||
*
|
||||
*
|
||||
* 1. RRULE:FREQ=foo
|
||||
* // FREQ= is not a param but the value
|
||||
*
|
||||
* 2. ATTENDEE;ROLE=REQ-PARTICIPANT;
|
||||
* // ROLE= is a param because : has not happened yet
|
||||
*/
|
||||
// when the parameter delimiter is after the
|
||||
// value delimiter then its not a parameter.
|
||||
|
||||
if ((paramPos !== -1 && valuePos !== -1)) {
|
||||
// when the parameter delimiter is after the
|
||||
// value delimiter then its not a parameter.
|
||||
if (paramPos > valuePos) {
|
||||
paramPos = -1;
|
||||
}
|
||||
}
|
||||
|
||||
var parsedParams;
|
||||
if (paramPos !== -1) {
|
||||
name = line.substring(0, paramPos).toLowerCase();
|
||||
parsedParams = parser._parseParameters(line.substring(paramPos), 0, state.designSet);
|
||||
if (parsedParams[2] == -1) {
|
||||
throw new ParserError("Invalid parameters in '" + line + "'");
|
||||
}
|
||||
params = parsedParams[0];
|
||||
lastParamIndex = parsedParams[1].length + parsedParams[2] + paramPos;
|
||||
if ((lastValuePos =
|
||||
line.substring(lastParamIndex).indexOf(VALUE_DELIMITER)) !== -1) {
|
||||
value = line.substring(lastParamIndex + lastValuePos + 1);
|
||||
} else {
|
||||
throw new ParserError("Missing parameter value in '" + line + "'");
|
||||
}
|
||||
} else if (valuePos !== -1) {
|
||||
// without parmeters (BEGIN:VCAENDAR, CLASS:PUBLIC)
|
||||
name = line.substring(0, valuePos).toLowerCase();
|
||||
value = line.substring(valuePos + 1);
|
||||
|
||||
if (name === 'begin') {
|
||||
var newComponent = [value.toLowerCase(), [], []];
|
||||
if (state.stack.length === 1) {
|
||||
state.component.push(newComponent);
|
||||
} else {
|
||||
state.component[2].push(newComponent);
|
||||
}
|
||||
state.stack.push(state.component);
|
||||
state.component = newComponent;
|
||||
if (!state.designSet) {
|
||||
state.designSet = design.getDesignSet(state.component[0]);
|
||||
}
|
||||
return;
|
||||
} else if (name === 'end') {
|
||||
state.component = state.stack.pop();
|
||||
return;
|
||||
}
|
||||
// If its not begin/end, then this is a property with an empty value,
|
||||
// which should be considered valid.
|
||||
} else {
|
||||
/**
|
||||
* Invalid line.
|
||||
* The rational to throw an error is we will
|
||||
* never be certain that the rest of the file
|
||||
* is sane and its unlikely that we can serialize
|
||||
* the result correctly either.
|
||||
*/
|
||||
throw new ParserError(
|
||||
'invalid line (no token ";" or ":") "' + line + '"'
|
||||
);
|
||||
}
|
||||
|
||||
var valueType;
|
||||
var multiValue = false;
|
||||
var structuredValue = false;
|
||||
var propertyDetails;
|
||||
|
||||
if (name in state.designSet.property) {
|
||||
propertyDetails = state.designSet.property[name];
|
||||
|
||||
if ('multiValue' in propertyDetails) {
|
||||
multiValue = propertyDetails.multiValue;
|
||||
}
|
||||
|
||||
if ('structuredValue' in propertyDetails) {
|
||||
structuredValue = propertyDetails.structuredValue;
|
||||
}
|
||||
|
||||
if (value && 'detectType' in propertyDetails) {
|
||||
valueType = propertyDetails.detectType(value);
|
||||
}
|
||||
}
|
||||
|
||||
// attempt to determine value
|
||||
if (!valueType) {
|
||||
if (!('value' in params)) {
|
||||
if (propertyDetails) {
|
||||
valueType = propertyDetails.defaultType;
|
||||
} else {
|
||||
valueType = DEFAULT_VALUE_TYPE;
|
||||
}
|
||||
} else {
|
||||
// possible to avoid this?
|
||||
valueType = params.value.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
delete params.value;
|
||||
|
||||
/**
|
||||
* Note on `var result` juggling:
|
||||
*
|
||||
* I observed that building the array in pieces has adverse
|
||||
* effects on performance, so where possible we inline the creation.
|
||||
* Its a little ugly but resulted in ~2000 additional ops/sec.
|
||||
*/
|
||||
|
||||
var result;
|
||||
if (multiValue && structuredValue) {
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], multiValue, state.designSet, structuredValue);
|
||||
result = [name, params, valueType, value];
|
||||
} else if (multiValue) {
|
||||
result = [name, params, valueType];
|
||||
parser._parseMultiValue(value, multiValue, valueType, result, null, state.designSet, false);
|
||||
} else if (structuredValue) {
|
||||
value = parser._parseMultiValue(value, structuredValue, valueType, [], null, state.designSet, structuredValue);
|
||||
result = [name, params, valueType, value];
|
||||
} else {
|
||||
value = parser._parseValue(value, valueType, state.designSet, false);
|
||||
result = [name, params, valueType, value];
|
||||
}
|
||||
// rfc6350 requires that in vCard 4.0 the first component is the VERSION
|
||||
// component with as value 4.0, note that 3.0 does not have this requirement.
|
||||
if (state.component[0] === 'vcard' && state.component[1].length === 0 &&
|
||||
!(name === 'version' && value === '4.0')) {
|
||||
state.designSet = design.getDesignSet("vcard3");
|
||||
}
|
||||
state.component[1].push(result);
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse a value from the raw value into the jCard/jCal value.
|
||||
*
|
||||
* @private
|
||||
* @function ICAL.parse._parseValue
|
||||
* @param {String} value Original value
|
||||
* @param {String} type Type of value
|
||||
* @param {Object} designSet The design data to use for this value
|
||||
* @return {Object} varies on type
|
||||
*/
|
||||
parser._parseValue = function(value, type, designSet, structuredValue) {
|
||||
if (type in designSet.value && 'fromICAL' in designSet.value[type]) {
|
||||
return designSet.value[type].fromICAL(value, structuredValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse parameters from a string to object.
|
||||
*
|
||||
* @function ICAL.parse._parseParameters
|
||||
* @private
|
||||
* @param {String} line A single unfolded line
|
||||
* @param {Numeric} start Position to start looking for properties
|
||||
* @param {Object} designSet The design data to use for this property
|
||||
* @return {Object} key/value pairs
|
||||
*/
|
||||
parser._parseParameters = function(line, start, designSet) {
|
||||
var lastParam = start;
|
||||
var pos = 0;
|
||||
var delim = PARAM_NAME_DELIMITER;
|
||||
var result = {};
|
||||
var name, lcname;
|
||||
var value, valuePos = -1;
|
||||
var type, multiValue, mvdelim;
|
||||
|
||||
// find the next '=' sign
|
||||
// use lastParam and pos to find name
|
||||
// check if " is used if so get value from "->"
|
||||
// then increment pos to find next ;
|
||||
|
||||
while ((pos !== false) &&
|
||||
(pos = helpers.unescapedIndexOf(line, delim, pos + 1)) !== -1) {
|
||||
|
||||
name = line.substr(lastParam + 1, pos - lastParam - 1);
|
||||
if (name.length == 0) {
|
||||
throw new ParserError("Empty parameter name in '" + line + "'");
|
||||
}
|
||||
lcname = name.toLowerCase();
|
||||
|
||||
if (lcname in designSet.param && designSet.param[lcname].valueType) {
|
||||
type = designSet.param[lcname].valueType;
|
||||
} else {
|
||||
type = DEFAULT_PARAM_TYPE;
|
||||
}
|
||||
|
||||
if (lcname in designSet.param) {
|
||||
multiValue = designSet.param[lcname].multiValue;
|
||||
if (designSet.param[lcname].multiValueSeparateDQuote) {
|
||||
mvdelim = parser._rfc6868Escape('"' + multiValue + '"');
|
||||
}
|
||||
}
|
||||
|
||||
var nextChar = line[pos + 1];
|
||||
if (nextChar === '"') {
|
||||
valuePos = pos + 2;
|
||||
pos = helpers.unescapedIndexOf(line, '"', valuePos);
|
||||
if (multiValue && pos != -1) {
|
||||
var extendedValue = true;
|
||||
while (extendedValue) {
|
||||
if (line[pos + 1] == multiValue && line[pos + 2] == '"') {
|
||||
pos = helpers.unescapedIndexOf(line, '"', pos + 3);
|
||||
} else {
|
||||
extendedValue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pos === -1) {
|
||||
throw new ParserError(
|
||||
'invalid line (no matching double quote) "' + line + '"'
|
||||
);
|
||||
}
|
||||
value = line.substr(valuePos, pos - valuePos);
|
||||
lastParam = helpers.unescapedIndexOf(line, PARAM_DELIMITER, pos);
|
||||
if (lastParam === -1) {
|
||||
pos = false;
|
||||
}
|
||||
} else {
|
||||
valuePos = pos + 1;
|
||||
|
||||
// move to next ";"
|
||||
var nextPos = helpers.unescapedIndexOf(line, PARAM_DELIMITER, valuePos);
|
||||
var propValuePos = helpers.unescapedIndexOf(line, VALUE_DELIMITER, valuePos);
|
||||
if (propValuePos !== -1 && nextPos > propValuePos) {
|
||||
// this is a delimiter in the property value, let's stop here
|
||||
nextPos = propValuePos;
|
||||
pos = false;
|
||||
} else if (nextPos === -1) {
|
||||
// no ";"
|
||||
if (propValuePos === -1) {
|
||||
nextPos = line.length;
|
||||
} else {
|
||||
nextPos = propValuePos;
|
||||
}
|
||||
pos = false;
|
||||
} else {
|
||||
lastParam = nextPos;
|
||||
pos = nextPos;
|
||||
}
|
||||
|
||||
value = line.substr(valuePos, nextPos - valuePos);
|
||||
}
|
||||
|
||||
value = parser._rfc6868Escape(value);
|
||||
if (multiValue) {
|
||||
var delimiter = mvdelim || multiValue;
|
||||
result[lcname] = parser._parseMultiValue(value, delimiter, type, [], null, designSet);
|
||||
} else {
|
||||
result[lcname] = parser._parseValue(value, type, designSet);
|
||||
}
|
||||
}
|
||||
return [result, value, valuePos];
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal helper for rfc6868. Exposing this on ICAL.parse so that
|
||||
* hackers can disable the rfc6868 parsing if the really need to.
|
||||
*
|
||||
* @function ICAL.parse._rfc6868Escape
|
||||
* @param {String} val The value to escape
|
||||
* @return {String} The escaped value
|
||||
*/
|
||||
parser._rfc6868Escape = function(val) {
|
||||
return val.replace(/\^['n^]/g, function(x) {
|
||||
return RFC6868_REPLACE_MAP[x];
|
||||
});
|
||||
};
|
||||
var RFC6868_REPLACE_MAP = { "^'": '"', "^n": "\n", "^^": "^" };
|
||||
|
||||
/**
|
||||
* Parse a multi value string. This function is used either for parsing
|
||||
* actual multi-value property's values, or for handling parameter values. It
|
||||
* can be used for both multi-value properties and structured value properties.
|
||||
*
|
||||
* @private
|
||||
* @function ICAL.parse._parseMultiValue
|
||||
* @param {String} buffer The buffer containing the full value
|
||||
* @param {String} delim The multi-value delimiter
|
||||
* @param {String} type The value type to be parsed
|
||||
* @param {Array.<?>} result The array to append results to, varies on value type
|
||||
* @param {String} innerMulti The inner delimiter to split each value with
|
||||
* @param {ICAL.design.designSet} designSet The design data for this value
|
||||
* @return {?|Array.<?>} Either an array of results, or the first result
|
||||
*/
|
||||
parser._parseMultiValue = function(buffer, delim, type, result, innerMulti, designSet, structuredValue) {
|
||||
var pos = 0;
|
||||
var lastPos = 0;
|
||||
var value;
|
||||
if (delim.length === 0) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// split each piece
|
||||
while ((pos = helpers.unescapedIndexOf(buffer, delim, lastPos)) !== -1) {
|
||||
value = buffer.substr(lastPos, pos - lastPos);
|
||||
if (innerMulti) {
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet, structuredValue);
|
||||
} else {
|
||||
value = parser._parseValue(value, type, designSet, structuredValue);
|
||||
}
|
||||
result.push(value);
|
||||
lastPos = pos + delim.length;
|
||||
}
|
||||
|
||||
// on the last piece take the rest of string
|
||||
value = buffer.substr(lastPos);
|
||||
if (innerMulti) {
|
||||
value = parser._parseMultiValue(value, innerMulti, type, [], null, designSet, structuredValue);
|
||||
} else {
|
||||
value = parser._parseValue(value, type, designSet, structuredValue);
|
||||
}
|
||||
result.push(value);
|
||||
|
||||
return result.length == 1 ? result[0] : result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Process a complete buffer of iCalendar/vCard data line by line, correctly
|
||||
* unfolding content. Each line will be processed with the given callback
|
||||
*
|
||||
* @private
|
||||
* @function ICAL.parse._eachLine
|
||||
* @param {String} buffer The buffer to process
|
||||
* @param {function(?String, String)} callback The callback for each line
|
||||
*/
|
||||
parser._eachLine = function(buffer, callback) {
|
||||
var len = buffer.length;
|
||||
var lastPos = buffer.search(CHAR);
|
||||
var pos = lastPos;
|
||||
var line;
|
||||
var firstChar;
|
||||
|
||||
var newlineOffset;
|
||||
|
||||
do {
|
||||
pos = buffer.indexOf('\n', lastPos) + 1;
|
||||
|
||||
if (pos > 1 && buffer[pos - 2] === '\r') {
|
||||
newlineOffset = 2;
|
||||
} else {
|
||||
newlineOffset = 1;
|
||||
}
|
||||
|
||||
if (pos === 0) {
|
||||
pos = len;
|
||||
newlineOffset = 0;
|
||||
}
|
||||
|
||||
firstChar = buffer[lastPos];
|
||||
|
||||
if (firstChar === ' ' || firstChar === '\t') {
|
||||
// add to line
|
||||
line += buffer.substr(
|
||||
lastPos + 1,
|
||||
pos - lastPos - (newlineOffset + 1)
|
||||
);
|
||||
} else {
|
||||
if (line)
|
||||
callback(null, line);
|
||||
// push line
|
||||
line = buffer.substr(
|
||||
lastPos,
|
||||
pos - lastPos - newlineOffset
|
||||
);
|
||||
}
|
||||
|
||||
lastPos = pos;
|
||||
} while (pos !== len);
|
||||
|
||||
// extra ending line
|
||||
line = line.trim();
|
||||
|
||||
if (line.length)
|
||||
callback(null, line);
|
||||
};
|
||||
|
||||
return parser;
|
||||
|
||||
}());
|
224
js/vendor/ical.js/lib/ical/period.js
vendored
224
js/vendor/ical.js/lib/ical/period.js
vendored
|
@ -1,224 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
"use strict";
|
||||
|
||||
(function() {
|
||||
/**
|
||||
* @classdesc
|
||||
* This class represents the "period" value type, with various calculation
|
||||
* and manipulation methods.
|
||||
*
|
||||
* @description
|
||||
* The passed data object cannot contain both and end date and a duration.
|
||||
*
|
||||
* @class
|
||||
* @param {Object} aData An object with members of the period
|
||||
* @param {ICAL.Time=} aData.start The start of the period
|
||||
* @param {ICAL.Time=} aData.end The end of the period
|
||||
* @param {ICAL.Duration=} aData.duration The duration of the period
|
||||
*/
|
||||
ICAL.Period = function icalperiod(aData) {
|
||||
this.wrappedJSObject = this;
|
||||
|
||||
if (aData && 'start' in aData) {
|
||||
if (aData.start && !(aData.start instanceof ICAL.Time)) {
|
||||
throw new TypeError('.start must be an instance of ICAL.Time');
|
||||
}
|
||||
this.start = aData.start;
|
||||
}
|
||||
|
||||
if (aData && aData.end && aData.duration) {
|
||||
throw new Error('cannot accept both end and duration');
|
||||
}
|
||||
|
||||
if (aData && 'end' in aData) {
|
||||
if (aData.end && !(aData.end instanceof ICAL.Time)) {
|
||||
throw new TypeError('.end must be an instance of ICAL.Time');
|
||||
}
|
||||
this.end = aData.end;
|
||||
}
|
||||
|
||||
if (aData && 'duration' in aData) {
|
||||
if (aData.duration && !(aData.duration instanceof ICAL.Duration)) {
|
||||
throw new TypeError('.duration must be an instance of ICAL.Duration');
|
||||
}
|
||||
this.duration = aData.duration;
|
||||
}
|
||||
};
|
||||
|
||||
ICAL.Period.prototype = {
|
||||
|
||||
/**
|
||||
* The start of the period
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
start: null,
|
||||
|
||||
/**
|
||||
* The end of the period
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
end: null,
|
||||
|
||||
/**
|
||||
* The duration of the period
|
||||
* @type {ICAL.Duration}
|
||||
*/
|
||||
duration: null,
|
||||
|
||||
/**
|
||||
* The class identifier.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "icalperiod"
|
||||
*/
|
||||
icalclass: "icalperiod",
|
||||
|
||||
/**
|
||||
* The type name, to be used in the jCal object.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "period"
|
||||
*/
|
||||
icaltype: "period",
|
||||
|
||||
/**
|
||||
* Returns a clone of the duration object.
|
||||
*
|
||||
* @return {ICAL.Period} The cloned object
|
||||
*/
|
||||
clone: function() {
|
||||
return ICAL.Period.fromData({
|
||||
start: this.start ? this.start.clone() : null,
|
||||
end: this.end ? this.end.clone() : null,
|
||||
duration: this.duration ? this.duration.clone() : null
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Calculates the duration of the period, either directly or by subtracting
|
||||
* start from end date.
|
||||
*
|
||||
* @return {ICAL.Duration} The calculated duration
|
||||
*/
|
||||
getDuration: function duration() {
|
||||
if (this.duration) {
|
||||
return this.duration;
|
||||
} else {
|
||||
return this.end.subtractDate(this.start);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Calculates the end date of the period, either directly or by adding
|
||||
* duration to start date.
|
||||
*
|
||||
* @return {ICAL.Time} The calculated end date
|
||||
*/
|
||||
getEnd: function() {
|
||||
if (this.end) {
|
||||
return this.end;
|
||||
} else {
|
||||
var end = this.start.clone();
|
||||
end.addDuration(this.duration);
|
||||
return end;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this period.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function toString() {
|
||||
return this.start + "/" + (this.end || this.duration);
|
||||
},
|
||||
|
||||
/**
|
||||
* The jCal representation of this period type.
|
||||
* @return {Object}
|
||||
*/
|
||||
toJSON: function() {
|
||||
return [this.start.toString(), (this.end || this.duration).toString()];
|
||||
},
|
||||
|
||||
/**
|
||||
* The iCalendar string representation of this period.
|
||||
* @return {String}
|
||||
*/
|
||||
toICALString: function() {
|
||||
return this.start.toICALString() + "/" +
|
||||
(this.end || this.duration).toICALString();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.Period} instance from the passed string.
|
||||
*
|
||||
* @param {String} str The string to parse
|
||||
* @param {ICAL.Property} prop The property this period will be on
|
||||
* @return {ICAL.Period} The created period instance
|
||||
*/
|
||||
ICAL.Period.fromString = function fromString(str, prop) {
|
||||
var parts = str.split('/');
|
||||
|
||||
if (parts.length !== 2) {
|
||||
throw new Error(
|
||||
'Invalid string value: "' + str + '" must contain a "/" char.'
|
||||
);
|
||||
}
|
||||
|
||||
var options = {
|
||||
start: ICAL.Time.fromDateTimeString(parts[0], prop)
|
||||
};
|
||||
|
||||
var end = parts[1];
|
||||
|
||||
if (ICAL.Duration.isValueString(end)) {
|
||||
options.duration = ICAL.Duration.fromString(end);
|
||||
} else {
|
||||
options.end = ICAL.Time.fromDateTimeString(end, prop);
|
||||
}
|
||||
|
||||
return new ICAL.Period(options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.Period} instance from the given data object.
|
||||
* The passed data object cannot contain both and end date and a duration.
|
||||
*
|
||||
* @param {Object} aData An object with members of the period
|
||||
* @param {ICAL.Time=} aData.start The start of the period
|
||||
* @param {ICAL.Time=} aData.end The end of the period
|
||||
* @param {ICAL.Duration=} aData.duration The duration of the period
|
||||
* @return {ICAL.Period} The period instance
|
||||
*/
|
||||
ICAL.Period.fromData = function fromData(aData) {
|
||||
return new ICAL.Period(aData);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a new period instance from the given jCal data array. The first
|
||||
* member is always the start date string, the second member is either a
|
||||
* duration or end date string.
|
||||
*
|
||||
* @param {Array<String,String>} aData The jCal data array
|
||||
* @param {ICAL.Property} aProp The property this jCal data is on
|
||||
* @return {ICAL.Period} The period instance
|
||||
*/
|
||||
ICAL.Period.fromJSON = function(aData, aProp) {
|
||||
if (ICAL.Duration.isValueString(aData[1])) {
|
||||
return ICAL.Period.fromData({
|
||||
start: ICAL.Time.fromDateTimeString(aData[0], aProp),
|
||||
duration: ICAL.Duration.fromString(aData[1])
|
||||
});
|
||||
} else {
|
||||
return ICAL.Period.fromData({
|
||||
start: ICAL.Time.fromDateTimeString(aData[0], aProp),
|
||||
end: ICAL.Time.fromDateTimeString(aData[1], aProp)
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
406
js/vendor/ical.js/lib/ical/property.js
vendored
406
js/vendor/ical.js/lib/ical/property.js
vendored
|
@ -1,406 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.Property = (function() {
|
||||
'use strict';
|
||||
|
||||
var NAME_INDEX = 0;
|
||||
var PROP_INDEX = 1;
|
||||
var TYPE_INDEX = 2;
|
||||
var VALUE_INDEX = 3;
|
||||
|
||||
var design = ICAL.design;
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Provides a layer on top of the raw jCal object for manipulating a single
|
||||
* property, with its parameters and value.
|
||||
*
|
||||
* @description
|
||||
* Its important to note that mutations done in the wrapper
|
||||
* directly mutate the jCal object used to initialize.
|
||||
*
|
||||
* Can also be used to create new properties by passing
|
||||
* the name of the property (as a String).
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.Property
|
||||
* @param {Array|String} jCal Raw jCal representation OR
|
||||
* the new name of the property
|
||||
*
|
||||
* @param {ICAL.Component=} parent Parent component
|
||||
*/
|
||||
function Property(jCal, parent) {
|
||||
this._parent = parent || null;
|
||||
|
||||
if (typeof(jCal) === 'string') {
|
||||
// We are creating the property by name and need to detect the type
|
||||
this.jCal = [jCal, {}, design.defaultType];
|
||||
this.jCal[TYPE_INDEX] = this.getDefaultType();
|
||||
} else {
|
||||
this.jCal = jCal;
|
||||
}
|
||||
this._updateType();
|
||||
}
|
||||
|
||||
Property.prototype = {
|
||||
|
||||
/**
|
||||
* The value type for this property
|
||||
* @readonly
|
||||
* @type {String}
|
||||
*/
|
||||
get type() {
|
||||
return this.jCal[TYPE_INDEX];
|
||||
},
|
||||
|
||||
/**
|
||||
* The name of this property, in lowercase.
|
||||
* @readonly
|
||||
* @type {String}
|
||||
*/
|
||||
get name() {
|
||||
return this.jCal[NAME_INDEX];
|
||||
},
|
||||
|
||||
/**
|
||||
* The parent component for this property.
|
||||
* @type {ICAL.Component}
|
||||
*/
|
||||
get parent() {
|
||||
return this._parent;
|
||||
},
|
||||
|
||||
set parent(p) {
|
||||
// Before setting the parent, check if the design set has changed. If it
|
||||
// has, we later need to update the type if it was unknown before.
|
||||
var designSetChanged = !this._parent || (p && p._designSet != this._parent._designSet);
|
||||
|
||||
this._parent = p;
|
||||
|
||||
if (this.type == design.defaultType && designSetChanged) {
|
||||
this.jCal[TYPE_INDEX] = this.getDefaultType();
|
||||
this._updateType();
|
||||
}
|
||||
|
||||
return p;
|
||||
},
|
||||
|
||||
/**
|
||||
* The design set for this property, e.g. icalendar vs vcard
|
||||
*
|
||||
* @type {ICAL.design.designSet}
|
||||
* @private
|
||||
*/
|
||||
get _designSet() {
|
||||
return this.parent ? this.parent._designSet : design.defaultSet;
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the type metadata from the current jCal type and design set.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_updateType: function() {
|
||||
var designSet = this._designSet;
|
||||
|
||||
if (this.type in designSet.value) {
|
||||
var designType = designSet.value[this.type];
|
||||
|
||||
if ('decorate' in designSet.value[this.type]) {
|
||||
this.isDecorated = true;
|
||||
} else {
|
||||
this.isDecorated = false;
|
||||
}
|
||||
|
||||
if (this.name in designSet.property) {
|
||||
this.isMultiValue = ('multiValue' in designSet.property[this.name]);
|
||||
this.isStructuredValue = ('structuredValue' in designSet.property[this.name]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Hydrate a single value. The act of hydrating means turning the raw jCal
|
||||
* value into a potentially wrapped object, for example {@link ICAL.Time}.
|
||||
*
|
||||
* @private
|
||||
* @param {Number} index The index of the value to hydrate
|
||||
* @return {Object} The decorated value.
|
||||
*/
|
||||
_hydrateValue: function(index) {
|
||||
if (this._values && this._values[index]) {
|
||||
return this._values[index];
|
||||
}
|
||||
|
||||
// for the case where there is no value.
|
||||
if (this.jCal.length <= (VALUE_INDEX + index)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.isDecorated) {
|
||||
if (!this._values) {
|
||||
this._values = [];
|
||||
}
|
||||
return (this._values[index] = this._decorate(
|
||||
this.jCal[VALUE_INDEX + index]
|
||||
));
|
||||
} else {
|
||||
return this.jCal[VALUE_INDEX + index];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Decorate a single value, returning its wrapped object. This is used by
|
||||
* the hydrate function to actually wrap the value.
|
||||
*
|
||||
* @private
|
||||
* @param {?} value The value to decorate
|
||||
* @return {Object} The decorated value
|
||||
*/
|
||||
_decorate: function(value) {
|
||||
return this._designSet.value[this.type].decorate(value, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Undecorate a single value, returning its raw jCal data.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} value The value to undecorate
|
||||
* @return {?} The undecorated value
|
||||
*/
|
||||
_undecorate: function(value) {
|
||||
return this._designSet.value[this.type].undecorate(value, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the value at the given index while also hydrating it. The passed
|
||||
* value can either be a decorated or undecorated value.
|
||||
*
|
||||
* @private
|
||||
* @param {?} value The value to set
|
||||
* @param {Number} index The index to set it at
|
||||
*/
|
||||
_setDecoratedValue: function(value, index) {
|
||||
if (!this._values) {
|
||||
this._values = [];
|
||||
}
|
||||
|
||||
if (typeof(value) === 'object' && 'icaltype' in value) {
|
||||
// decorated value
|
||||
this.jCal[VALUE_INDEX + index] = this._undecorate(value);
|
||||
this._values[index] = value;
|
||||
} else {
|
||||
// undecorated value
|
||||
this.jCal[VALUE_INDEX + index] = value;
|
||||
this._values[index] = this._decorate(value);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets a parameter on the property.
|
||||
*
|
||||
* @param {String} name Property name (lowercase)
|
||||
* @return {Array|String} Property value
|
||||
*/
|
||||
getParameter: function(name) {
|
||||
if (name in this.jCal[PROP_INDEX]) {
|
||||
return this.jCal[PROP_INDEX][name];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets a parameter on the property.
|
||||
*
|
||||
* @param {String} name The parameter name
|
||||
* @param {Array|String} value The parameter value
|
||||
*/
|
||||
setParameter: function(name, value) {
|
||||
var lcname = name.toLowerCase();
|
||||
if (typeof value === "string" &&
|
||||
lcname in this._designSet.param &&
|
||||
'multiValue' in this._designSet.param[lcname]) {
|
||||
value = [value];
|
||||
}
|
||||
this.jCal[PROP_INDEX][name] = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a parameter
|
||||
*
|
||||
* @param {String} name The parameter name
|
||||
*/
|
||||
removeParameter: function(name) {
|
||||
delete this.jCal[PROP_INDEX][name];
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the default type based on this property's name.
|
||||
*
|
||||
* @return {String} The default type for this property
|
||||
*/
|
||||
getDefaultType: function() {
|
||||
var name = this.jCal[NAME_INDEX];
|
||||
var designSet = this._designSet;
|
||||
|
||||
if (name in designSet.property) {
|
||||
var details = designSet.property[name];
|
||||
if ('defaultType' in details) {
|
||||
return details.defaultType;
|
||||
}
|
||||
}
|
||||
return design.defaultType;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets type of property and clears out any existing values of the current
|
||||
* type.
|
||||
*
|
||||
* @param {String} type New iCAL type (see design.*.values)
|
||||
*/
|
||||
resetType: function(type) {
|
||||
this.removeAllValues();
|
||||
this.jCal[TYPE_INDEX] = type;
|
||||
this._updateType();
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds the first property value.
|
||||
*
|
||||
* @return {String} First property value
|
||||
*/
|
||||
getFirstValue: function() {
|
||||
return this._hydrateValue(0);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets all values on the property.
|
||||
*
|
||||
* NOTE: this creates an array during each call.
|
||||
*
|
||||
* @return {Array} List of values
|
||||
*/
|
||||
getValues: function() {
|
||||
var len = this.jCal.length - VALUE_INDEX;
|
||||
|
||||
if (len < 1) {
|
||||
// its possible for a property to have no value.
|
||||
return [];
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
var result = [];
|
||||
|
||||
for (; i < len; i++) {
|
||||
result[i] = this._hydrateValue(i);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all values from this property
|
||||
*/
|
||||
removeAllValues: function() {
|
||||
if (this._values) {
|
||||
this._values.length = 0;
|
||||
}
|
||||
this.jCal.length = 3;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the values of the property. Will overwrite the existing values.
|
||||
* This can only be used for multi-value properties.
|
||||
*
|
||||
* @param {Array} values An array of values
|
||||
*/
|
||||
setValues: function(values) {
|
||||
if (!this.isMultiValue) {
|
||||
throw new Error(
|
||||
this.name + ': does not not support mulitValue.\n' +
|
||||
'override isMultiValue'
|
||||
);
|
||||
}
|
||||
|
||||
var len = values.length;
|
||||
var i = 0;
|
||||
this.removeAllValues();
|
||||
|
||||
if (len > 0 &&
|
||||
typeof(values[0]) === 'object' &&
|
||||
'icaltype' in values[0]) {
|
||||
this.resetType(values[0].icaltype);
|
||||
}
|
||||
|
||||
if (this.isDecorated) {
|
||||
for (; i < len; i++) {
|
||||
this._setDecoratedValue(values[i], i);
|
||||
}
|
||||
} else {
|
||||
for (; i < len; i++) {
|
||||
this.jCal[VALUE_INDEX + i] = values[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the current value of the property. If this is a multi-value
|
||||
* property, all other values will be removed.
|
||||
*
|
||||
* @param {String|Object} value New property value.
|
||||
*/
|
||||
setValue: function(value) {
|
||||
this.removeAllValues();
|
||||
if (typeof(value) === 'object' && 'icaltype' in value) {
|
||||
this.resetType(value.icaltype);
|
||||
}
|
||||
|
||||
if (this.isDecorated) {
|
||||
this._setDecoratedValue(value, 0);
|
||||
} else {
|
||||
this.jCal[VALUE_INDEX] = value;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the Object representation of this component. The returned object
|
||||
* is a live jCal object and should be cloned if modified.
|
||||
* @return {Object}
|
||||
*/
|
||||
toJSON: function() {
|
||||
return this.jCal;
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this component.
|
||||
* @return {String}
|
||||
*/
|
||||
toICALString: function() {
|
||||
return ICAL.stringify.property(
|
||||
this.jCal, this._designSet, true
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an {@link ICAL.Property} by parsing the passed iCalendar string.
|
||||
*
|
||||
* @param {String} str The iCalendar string to parse
|
||||
* @param {ICAL.design.designSet=} designSet The design data to use for this property
|
||||
* @return {ICAL.Property} The created iCalendar property
|
||||
*/
|
||||
Property.fromString = function(str, designSet) {
|
||||
return new Property(ICAL.parse.property(str, designSet));
|
||||
};
|
||||
|
||||
return Property;
|
||||
}());
|
559
js/vendor/ical.js/lib/ical/recur.js
vendored
559
js/vendor/ical.js/lib/ical/recur.js
vendored
|
@ -1,559 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
"use strict";
|
||||
|
||||
(function() {
|
||||
var DOW_MAP = {
|
||||
SU: ICAL.Time.SUNDAY,
|
||||
MO: ICAL.Time.MONDAY,
|
||||
TU: ICAL.Time.TUESDAY,
|
||||
WE: ICAL.Time.WEDNESDAY,
|
||||
TH: ICAL.Time.THURSDAY,
|
||||
FR: ICAL.Time.FRIDAY,
|
||||
SA: ICAL.Time.SATURDAY
|
||||
};
|
||||
|
||||
var REVERSE_DOW_MAP = {};
|
||||
for (var key in DOW_MAP) {
|
||||
/* istanbul ignore else */
|
||||
if (DOW_MAP.hasOwnProperty(key)) {
|
||||
REVERSE_DOW_MAP[DOW_MAP[key]] = key;
|
||||
}
|
||||
}
|
||||
|
||||
var COPY_PARTS = ["BYSECOND", "BYMINUTE", "BYHOUR", "BYDAY",
|
||||
"BYMONTHDAY", "BYYEARDAY", "BYWEEKNO",
|
||||
"BYMONTH", "BYSETPOS"];
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* This class represents the "recur" value type, with various calculation
|
||||
* and manipulation methods.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.Recur
|
||||
* @param {Object} data An object with members of the recurrence
|
||||
* @param {ICAL.Recur.frequencyValues} freq The frequency value
|
||||
* @param {Number=} data.interval The INTERVAL value
|
||||
* @param {ICAL.Time.weekDay=} data.wkst The week start value
|
||||
* @param {ICAL.Time=} data.until The end of the recurrence set
|
||||
* @param {Number=} data.count The number of occurrences
|
||||
* @param {Array.<Number>=} data.bysecond The seconds for the BYSECOND part
|
||||
* @param {Array.<Number>=} data.byminute The minutes for the BYMINUTE part
|
||||
* @param {Array.<Number>=} data.byhour The hours for the BYHOUR part
|
||||
* @param {Array.<String>=} data.byday The BYDAY values
|
||||
* @param {Array.<Number>=} data.bymonthday The days for the BYMONTHDAY part
|
||||
* @param {Array.<Number>=} data.byyearday The days for the BYYEARDAY part
|
||||
* @param {Array.<Number>=} data.byweekno The weeks for the BYWEEKNO part
|
||||
* @param {Array.<Number>=} data.bymonth The month for the BYMONTH part
|
||||
* @param {Array.<Number>=} data.bysetpos The positionals for the BYSETPOS part
|
||||
*/
|
||||
ICAL.Recur = function icalrecur(data) {
|
||||
this.wrappedJSObject = this;
|
||||
this.parts = {};
|
||||
|
||||
if (data && typeof(data) === 'object') {
|
||||
this.fromData(data);
|
||||
}
|
||||
};
|
||||
|
||||
ICAL.Recur.prototype = {
|
||||
/**
|
||||
* An object holding the BY-parts of the recurrence rule
|
||||
* @type {Object}
|
||||
*/
|
||||
parts: null,
|
||||
|
||||
/**
|
||||
* The interval value for the recurrence rule.
|
||||
* @type {Number}
|
||||
*/
|
||||
interval: 1,
|
||||
|
||||
/**
|
||||
* The week start day
|
||||
*
|
||||
* @type {ICAL.Time.weekDay}
|
||||
* @default ICAL.Time.MONDAY
|
||||
*/
|
||||
wkst: ICAL.Time.MONDAY,
|
||||
|
||||
/**
|
||||
* The end of the recurrence
|
||||
* @type {?ICAL.Time}
|
||||
*/
|
||||
until: null,
|
||||
|
||||
/**
|
||||
* The maximum number of occurrences
|
||||
* @type {?Number}
|
||||
*/
|
||||
count: null,
|
||||
|
||||
/**
|
||||
* The frequency value.
|
||||
* @type {ICAL.Recur.frequencyValues}
|
||||
*/
|
||||
freq: null,
|
||||
|
||||
/**
|
||||
* The class identifier.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "icalrecur"
|
||||
*/
|
||||
icalclass: "icalrecur",
|
||||
|
||||
/**
|
||||
* The type name, to be used in the jCal object.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "recur"
|
||||
*/
|
||||
icaltype: "recur",
|
||||
|
||||
/**
|
||||
* Create a new iterator for this recurrence rule. The passed start date
|
||||
* must be the start date of the event, not the start of the range to
|
||||
* search in.
|
||||
*
|
||||
* @example
|
||||
* var recur = comp.getFirstPropertyValue('rrule');
|
||||
* var dtstart = comp.getFirstPropertyValue('dtstart');
|
||||
* var iter = recur.iterator(dtstart);
|
||||
* for (var next = iter.next(); next; next = iter.next()) {
|
||||
* if (next.compare(rangeStart) < 0) {
|
||||
* continue;
|
||||
* }
|
||||
* console.log(next.toString());
|
||||
* }
|
||||
*
|
||||
* @param {ICAL.Time} aStart The item's start date
|
||||
* @return {ICAL.RecurIterator} The recurrence iterator
|
||||
*/
|
||||
iterator: function(aStart) {
|
||||
return new ICAL.RecurIterator({
|
||||
rule: this,
|
||||
dtstart: aStart
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a clone of the recurrence object.
|
||||
*
|
||||
* @return {ICAL.Recur} The cloned object
|
||||
*/
|
||||
clone: function clone() {
|
||||
return new ICAL.Recur(this.toJSON());
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the current rule is finite, i.e. has a count or until part.
|
||||
*
|
||||
* @return {Boolean} True, if the rule is finite
|
||||
*/
|
||||
isFinite: function isfinite() {
|
||||
return !!(this.count || this.until);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the current rule has a count part, and not limited by an until
|
||||
* part.
|
||||
*
|
||||
* @return {Boolean} True, if the rule is by count
|
||||
*/
|
||||
isByCount: function isbycount() {
|
||||
return !!(this.count && !this.until);
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds a component (part) to the recurrence rule. This is not a component
|
||||
* in the sense of {@link ICAL.Component}, but a part of the recurrence
|
||||
* rule, i.e. BYMONTH.
|
||||
*
|
||||
* @param {String} aType The name of the component part
|
||||
* @param {Array|String} aValue The component value
|
||||
*/
|
||||
addComponent: function addPart(aType, aValue) {
|
||||
var ucname = aType.toUpperCase();
|
||||
if (ucname in this.parts) {
|
||||
this.parts[ucname].push(aValue);
|
||||
} else {
|
||||
this.parts[ucname] = [aValue];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the component value for the given by-part.
|
||||
*
|
||||
* @param {String} aType The component part name
|
||||
* @param {Array} aValues The component values
|
||||
*/
|
||||
setComponent: function setComponent(aType, aValues) {
|
||||
this.parts[aType.toUpperCase()] = aValues.slice();
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets (a copy) of the requested component value.
|
||||
*
|
||||
* @param {String} aType The component part name
|
||||
* @return {Array} The component part value
|
||||
*/
|
||||
getComponent: function getComponent(aType) {
|
||||
var ucname = aType.toUpperCase();
|
||||
return (ucname in this.parts ? this.parts[ucname].slice() : []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves the next occurrence after the given recurrence id. See the
|
||||
* guide on {@tutorial terminology} for more details.
|
||||
*
|
||||
* NOTE: Currently, this method iterates all occurrences from the start
|
||||
* date. It should not be called in a loop for performance reasons. If you
|
||||
* would like to get more than one occurrence, you can iterate the
|
||||
* occurrences manually, see the example on the
|
||||
* {@link ICAL.Recur#iterator iterator} method.
|
||||
*
|
||||
* @param {ICAL.Time} aStartTime The start of the event series
|
||||
* @param {ICAL.Time} aRecurrenceId The date of the last occurrence
|
||||
* @return {ICAL.Time} The next occurrence after
|
||||
*/
|
||||
getNextOccurrence: function getNextOccurrence(aStartTime, aRecurrenceId) {
|
||||
var iter = this.iterator(aStartTime);
|
||||
var next, cdt;
|
||||
|
||||
do {
|
||||
next = iter.next();
|
||||
} while (next && next.compare(aRecurrenceId) <= 0);
|
||||
|
||||
if (next && aRecurrenceId.zone) {
|
||||
next.zone = aRecurrenceId.zone;
|
||||
}
|
||||
|
||||
return next;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets up the current instance using members from the passed data object.
|
||||
*
|
||||
* @param {Object} data An object with members of the recurrence
|
||||
* @param {ICAL.Recur.frequencyValues} freq The frequency value
|
||||
* @param {Number=} data.interval The INTERVAL value
|
||||
* @param {ICAL.Time.weekDay=} data.wkst The week start value
|
||||
* @param {ICAL.Time=} data.until The end of the recurrence set
|
||||
* @param {Number=} data.count The number of occurrences
|
||||
* @param {Array.<Number>=} data.bysecond The seconds for the BYSECOND part
|
||||
* @param {Array.<Number>=} data.byminute The minutes for the BYMINUTE part
|
||||
* @param {Array.<Number>=} data.byhour The hours for the BYHOUR part
|
||||
* @param {Array.<String>=} data.byday The BYDAY values
|
||||
* @param {Array.<Number>=} data.bymonthday The days for the BYMONTHDAY part
|
||||
* @param {Array.<Number>=} data.byyearday The days for the BYYEARDAY part
|
||||
* @param {Array.<Number>=} data.byweekno The weeks for the BYWEEKNO part
|
||||
* @param {Array.<Number>=} data.bymonth The month for the BYMONTH part
|
||||
* @param {Array.<Number>=} data.bysetpos The positionals for the BYSETPOS part
|
||||
*/
|
||||
fromData: function(data) {
|
||||
for (var key in data) {
|
||||
var uckey = key.toUpperCase();
|
||||
|
||||
if (uckey in partDesign) {
|
||||
if (Array.isArray(data[key])) {
|
||||
this.parts[uckey] = data[key];
|
||||
} else {
|
||||
this.parts[uckey] = [data[key]];
|
||||
}
|
||||
} else {
|
||||
this[key] = data[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (this.wkst && typeof this.wkst != "number") {
|
||||
this.wkst = ICAL.Recur.icalDayToNumericDay(this.wkst);
|
||||
}
|
||||
|
||||
if (this.until && !(this.until instanceof ICAL.Time)) {
|
||||
this.until = ICAL.Time.fromString(this.until);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The jCal representation of this recurrence type.
|
||||
* @return {Object}
|
||||
*/
|
||||
toJSON: function() {
|
||||
var res = Object.create(null);
|
||||
res.freq = this.freq;
|
||||
|
||||
if (this.count) {
|
||||
res.count = this.count;
|
||||
}
|
||||
|
||||
if (this.interval > 1) {
|
||||
res.interval = this.interval;
|
||||
}
|
||||
|
||||
for (var k in this.parts) {
|
||||
/* istanbul ignore if */
|
||||
if (!this.parts.hasOwnProperty(k)) {
|
||||
continue;
|
||||
}
|
||||
var kparts = this.parts[k];
|
||||
if (Array.isArray(kparts) && kparts.length == 1) {
|
||||
res[k.toLowerCase()] = kparts[0];
|
||||
} else {
|
||||
res[k.toLowerCase()] = ICAL.helpers.clone(this.parts[k]);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.until) {
|
||||
res.until = this.until.toString();
|
||||
}
|
||||
if ('wkst' in this && this.wkst !== ICAL.Time.DEFAULT_WEEK_START) {
|
||||
res.wkst = ICAL.Recur.numericDayToIcalDay(this.wkst);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this recurrence rule.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function icalrecur_toString() {
|
||||
// TODO retain order
|
||||
var str = "FREQ=" + this.freq;
|
||||
if (this.count) {
|
||||
str += ";COUNT=" + this.count;
|
||||
}
|
||||
if (this.interval > 1) {
|
||||
str += ";INTERVAL=" + this.interval;
|
||||
}
|
||||
for (var k in this.parts) {
|
||||
/* istanbul ignore else */
|
||||
if (this.parts.hasOwnProperty(k)) {
|
||||
str += ";" + k + "=" + this.parts[k];
|
||||
}
|
||||
}
|
||||
if (this.until) {
|
||||
str += ';UNTIL=' + this.until.toString();
|
||||
}
|
||||
if ('wkst' in this && this.wkst !== ICAL.Time.DEFAULT_WEEK_START) {
|
||||
str += ';WKST=' + ICAL.Recur.numericDayToIcalDay(this.wkst);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
function parseNumericValue(type, min, max, value) {
|
||||
var result = value;
|
||||
|
||||
if (value[0] === '+') {
|
||||
result = value.substr(1);
|
||||
}
|
||||
|
||||
result = ICAL.helpers.strictParseInt(result);
|
||||
|
||||
if (min !== undefined && value < min) {
|
||||
throw new Error(
|
||||
type + ': invalid value "' + value + '" must be > ' + min
|
||||
);
|
||||
}
|
||||
|
||||
if (max !== undefined && value > max) {
|
||||
throw new Error(
|
||||
type + ': invalid value "' + value + '" must be < ' + min
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an ical representation of a day (SU, MO, etc..)
|
||||
* into a numeric value of that day.
|
||||
*
|
||||
* @param {String} string The iCalendar day name
|
||||
* @return {Number} Numeric value of given day
|
||||
*/
|
||||
ICAL.Recur.icalDayToNumericDay = function toNumericDay(string) {
|
||||
//XXX: this is here so we can deal
|
||||
// with possibly invalid string values.
|
||||
|
||||
return DOW_MAP[string];
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert a numeric day value into its ical representation (SU, MO, etc..)
|
||||
*
|
||||
* @param {Number} num Numeric value of given day
|
||||
* @return {String} The ICAL day value, e.g SU,MO,...
|
||||
*/
|
||||
ICAL.Recur.numericDayToIcalDay = function toIcalDay(num) {
|
||||
//XXX: this is here so we can deal with possibly invalid number values.
|
||||
// Also, this allows consistent mapping between day numbers and day
|
||||
// names for external users.
|
||||
return REVERSE_DOW_MAP[num];
|
||||
};
|
||||
|
||||
var VALID_DAY_NAMES = /^(SU|MO|TU|WE|TH|FR|SA)$/;
|
||||
var VALID_BYDAY_PART = /^([+-])?(5[0-3]|[1-4][0-9]|[1-9])?(SU|MO|TU|WE|TH|FR|SA)$/;
|
||||
|
||||
/**
|
||||
* Possible frequency values for the FREQ part
|
||||
* (YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY)
|
||||
*
|
||||
* @typedef {String} frequencyValues
|
||||
* @memberof ICAL.Recur
|
||||
*/
|
||||
|
||||
var ALLOWED_FREQ = ['SECONDLY', 'MINUTELY', 'HOURLY',
|
||||
'DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY'];
|
||||
|
||||
var optionDesign = {
|
||||
FREQ: function(value, dict, fmtIcal) {
|
||||
// yes this is actually equal or faster then regex.
|
||||
// upside here is we can enumerate the valid values.
|
||||
if (ALLOWED_FREQ.indexOf(value) !== -1) {
|
||||
dict.freq = value;
|
||||
} else {
|
||||
throw new Error(
|
||||
'invalid frequency "' + value + '" expected: "' +
|
||||
ALLOWED_FREQ.join(', ') + '"'
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
COUNT: function(value, dict, fmtIcal) {
|
||||
dict.count = ICAL.helpers.strictParseInt(value);
|
||||
},
|
||||
|
||||
INTERVAL: function(value, dict, fmtIcal) {
|
||||
dict.interval = ICAL.helpers.strictParseInt(value);
|
||||
if (dict.interval < 1) {
|
||||
// 0 or negative values are not allowed, some engines seem to generate
|
||||
// it though. Assume 1 instead.
|
||||
dict.interval = 1;
|
||||
}
|
||||
},
|
||||
|
||||
UNTIL: function(value, dict, fmtIcal) {
|
||||
if (fmtIcal) {
|
||||
if (value.length > 10) {
|
||||
dict.until = ICAL.design.icalendar.value['date-time'].fromICAL(value);
|
||||
} else {
|
||||
dict.until = ICAL.design.icalendar.value.date.fromICAL(value);
|
||||
}
|
||||
} else {
|
||||
dict.until = ICAL.Time.fromString(value);
|
||||
}
|
||||
},
|
||||
|
||||
WKST: function(value, dict, fmtIcal) {
|
||||
if (VALID_DAY_NAMES.test(value)) {
|
||||
dict.wkst = ICAL.Recur.icalDayToNumericDay(value);
|
||||
} else {
|
||||
throw new Error('invalid WKST value "' + value + '"');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var partDesign = {
|
||||
BYSECOND: parseNumericValue.bind(this, 'BYSECOND', 0, 60),
|
||||
BYMINUTE: parseNumericValue.bind(this, 'BYMINUTE', 0, 59),
|
||||
BYHOUR: parseNumericValue.bind(this, 'BYHOUR', 0, 23),
|
||||
BYDAY: function(value) {
|
||||
if (VALID_BYDAY_PART.test(value)) {
|
||||
return value;
|
||||
} else {
|
||||
throw new Error('invalid BYDAY value "' + value + '"');
|
||||
}
|
||||
},
|
||||
BYMONTHDAY: parseNumericValue.bind(this, 'BYMONTHDAY', -31, 31),
|
||||
BYYEARDAY: parseNumericValue.bind(this, 'BYYEARDAY', -366, 366),
|
||||
BYWEEKNO: parseNumericValue.bind(this, 'BYWEEKNO', -53, 53),
|
||||
BYMONTH: parseNumericValue.bind(this, 'BYMONTH', 0, 12),
|
||||
BYSETPOS: parseNumericValue.bind(this, 'BYSETPOS', -366, 366)
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.Recur} instance from the passed string.
|
||||
*
|
||||
* @param {String} string The string to parse
|
||||
* @return {ICAL.Recur} The created recurrence instance
|
||||
*/
|
||||
ICAL.Recur.fromString = function(string) {
|
||||
var data = ICAL.Recur._stringToData(string, false);
|
||||
return new ICAL.Recur(data);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.Recur} instance using members from the passed
|
||||
* data object.
|
||||
*
|
||||
* @param {Object} aData An object with members of the recurrence
|
||||
* @param {ICAL.Recur.frequencyValues} freq The frequency value
|
||||
* @param {Number=} aData.interval The INTERVAL value
|
||||
* @param {ICAL.Time.weekDay=} aData.wkst The week start value
|
||||
* @param {ICAL.Time=} aData.until The end of the recurrence set
|
||||
* @param {Number=} aData.count The number of occurrences
|
||||
* @param {Array.<Number>=} aData.bysecond The seconds for the BYSECOND part
|
||||
* @param {Array.<Number>=} aData.byminute The minutes for the BYMINUTE part
|
||||
* @param {Array.<Number>=} aData.byhour The hours for the BYHOUR part
|
||||
* @param {Array.<String>=} aData.byday The BYDAY values
|
||||
* @param {Array.<Number>=} aData.bymonthday The days for the BYMONTHDAY part
|
||||
* @param {Array.<Number>=} aData.byyearday The days for the BYYEARDAY part
|
||||
* @param {Array.<Number>=} aData.byweekno The weeks for the BYWEEKNO part
|
||||
* @param {Array.<Number>=} aData.bymonth The month for the BYMONTH part
|
||||
* @param {Array.<Number>=} aData.bysetpos The positionals for the BYSETPOS part
|
||||
*/
|
||||
ICAL.Recur.fromData = function(aData) {
|
||||
return new ICAL.Recur(aData);
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts a recurrence string to a data object, suitable for the fromData
|
||||
* method.
|
||||
*
|
||||
* @param {String} string The string to parse
|
||||
* @param {Boolean} fmtIcal If true, the string is considered to be an
|
||||
* iCalendar string
|
||||
* @return {ICAL.Recur} The recurrence instance
|
||||
*/
|
||||
ICAL.Recur._stringToData = function(string, fmtIcal) {
|
||||
var dict = Object.create(null);
|
||||
|
||||
// split is slower in FF but fast enough.
|
||||
// v8 however this is faster then manual split?
|
||||
var values = string.split(';');
|
||||
var len = values.length;
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
var parts = values[i].split('=');
|
||||
var ucname = parts[0].toUpperCase();
|
||||
var lcname = parts[0].toLowerCase();
|
||||
var name = (fmtIcal ? lcname : ucname);
|
||||
var value = parts[1];
|
||||
|
||||
if (ucname in partDesign) {
|
||||
var partArr = value.split(',');
|
||||
var partArrIdx = 0;
|
||||
var partArrLen = partArr.length;
|
||||
|
||||
for (; partArrIdx < partArrLen; partArrIdx++) {
|
||||
partArr[partArrIdx] = partDesign[ucname](partArr[partArrIdx]);
|
||||
}
|
||||
dict[name] = (partArr.length == 1 ? partArr[0] : partArr);
|
||||
} else if (ucname in optionDesign) {
|
||||
optionDesign[ucname](value, dict, fmtIcal);
|
||||
} else {
|
||||
// Don't swallow unknown values. Just set them as they are.
|
||||
dict[lcname] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return dict;
|
||||
};
|
||||
})();
|
498
js/vendor/ical.js/lib/ical/recur_expansion.js
vendored
498
js/vendor/ical.js/lib/ical/recur_expansion.js
vendored
|
@ -1,498 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.RecurExpansion = (function() {
|
||||
function formatTime(item) {
|
||||
return ICAL.helpers.formatClassType(item, ICAL.Time);
|
||||
}
|
||||
|
||||
function compareTime(a, b) {
|
||||
return a.compare(b);
|
||||
}
|
||||
|
||||
function isRecurringComponent(comp) {
|
||||
return comp.hasProperty('rdate') ||
|
||||
comp.hasProperty('rrule') ||
|
||||
comp.hasProperty('recurrence-id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Primary class for expanding recurring rules. Can take multiple rrules,
|
||||
* rdates, exdate(s) and iterate (in order) over each next occurrence.
|
||||
*
|
||||
* Once initialized this class can also be serialized saved and continue
|
||||
* iteration from the last point.
|
||||
*
|
||||
* NOTE: it is intended that this class is to be used
|
||||
* with ICAL.Event which handles recurrence exceptions.
|
||||
*
|
||||
* @example
|
||||
* // assuming event is a parsed ical component
|
||||
* var event;
|
||||
*
|
||||
* var expand = new ICAL.RecurExpansion({
|
||||
* component: event,
|
||||
* dtstart: event.getFirstPropertyValue('dtstart')
|
||||
* });
|
||||
*
|
||||
* // remember there are infinite rules
|
||||
* // so its a good idea to limit the scope
|
||||
* // of the iterations then resume later on.
|
||||
*
|
||||
* // next is always an ICAL.Time or null
|
||||
* var next;
|
||||
*
|
||||
* while (someCondition && (next = expand.next())) {
|
||||
* // do something with next
|
||||
* }
|
||||
*
|
||||
* // save instance for later
|
||||
* var json = JSON.stringify(expand);
|
||||
*
|
||||
* //...
|
||||
*
|
||||
* // NOTE: if the component's properties have
|
||||
* // changed you will need to rebuild the
|
||||
* // class and start over. This only works
|
||||
* // when the component's recurrence info is the same.
|
||||
* var expand = new ICAL.RecurExpansion(JSON.parse(json));
|
||||
*
|
||||
* @description
|
||||
* The options object can be filled with the specified initial values. It can
|
||||
* also contain additional members, as a result of serializing a previous
|
||||
* expansion state, as shown in the example.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.RecurExpansion
|
||||
* @param {Object} options
|
||||
* Recurrence expansion options
|
||||
* @param {ICAL.Time} options.dtstart
|
||||
* Start time of the event
|
||||
* @param {ICAL.Component=} options.component
|
||||
* Component for expansion, required if not resuming.
|
||||
*/
|
||||
function RecurExpansion(options) {
|
||||
this.ruleDates = [];
|
||||
this.exDates = [];
|
||||
this.fromData(options);
|
||||
}
|
||||
|
||||
RecurExpansion.prototype = {
|
||||
/**
|
||||
* True when iteration is fully completed.
|
||||
* @type {Boolean}
|
||||
*/
|
||||
complete: false,
|
||||
|
||||
/**
|
||||
* Array of rrule iterators.
|
||||
*
|
||||
* @type {ICAL.RecurIterator[]}
|
||||
* @private
|
||||
*/
|
||||
ruleIterators: null,
|
||||
|
||||
/**
|
||||
* Array of rdate instances.
|
||||
*
|
||||
* @type {ICAL.Time[]}
|
||||
* @private
|
||||
*/
|
||||
ruleDates: null,
|
||||
|
||||
/**
|
||||
* Array of exdate instances.
|
||||
*
|
||||
* @type {ICAL.Time[]}
|
||||
* @private
|
||||
*/
|
||||
exDates: null,
|
||||
|
||||
/**
|
||||
* Current position in ruleDates array.
|
||||
* @type {Number}
|
||||
* @private
|
||||
*/
|
||||
ruleDateInc: 0,
|
||||
|
||||
/**
|
||||
* Current position in exDates array
|
||||
* @type {Number}
|
||||
* @private
|
||||
*/
|
||||
exDateInc: 0,
|
||||
|
||||
/**
|
||||
* Current negative date.
|
||||
*
|
||||
* @type {ICAL.Time}
|
||||
* @private
|
||||
*/
|
||||
exDate: null,
|
||||
|
||||
/**
|
||||
* Current additional date.
|
||||
*
|
||||
* @type {ICAL.Time}
|
||||
* @private
|
||||
*/
|
||||
ruleDate: null,
|
||||
|
||||
/**
|
||||
* Start date of recurring rules.
|
||||
*
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
dtstart: null,
|
||||
|
||||
/**
|
||||
* Last expanded time
|
||||
*
|
||||
* @type {ICAL.Time}
|
||||
*/
|
||||
last: null,
|
||||
|
||||
/**
|
||||
* Initialize the recurrence expansion from the data object. The options
|
||||
* object may also contain additional members, see the
|
||||
* {@link ICAL.RecurExpansion constructor} for more details.
|
||||
*
|
||||
* @param {Object} options
|
||||
* Recurrence expansion options
|
||||
* @param {ICAL.Time} options.dtstart
|
||||
* Start time of the event
|
||||
* @param {ICAL.Component=} options.component
|
||||
* Component for expansion, required if not resuming.
|
||||
*/
|
||||
fromData: function(options) {
|
||||
var start = ICAL.helpers.formatClassType(options.dtstart, ICAL.Time);
|
||||
|
||||
if (!start) {
|
||||
throw new Error('.dtstart (ICAL.Time) must be given');
|
||||
} else {
|
||||
this.dtstart = start;
|
||||
}
|
||||
|
||||
if (options.component) {
|
||||
this._init(options.component);
|
||||
} else {
|
||||
this.last = formatTime(options.last) || start.clone();
|
||||
|
||||
if (!options.ruleIterators) {
|
||||
throw new Error('.ruleIterators or .component must be given');
|
||||
}
|
||||
|
||||
this.ruleIterators = options.ruleIterators.map(function(item) {
|
||||
return ICAL.helpers.formatClassType(item, ICAL.RecurIterator);
|
||||
});
|
||||
|
||||
this.ruleDateInc = options.ruleDateInc;
|
||||
this.exDateInc = options.exDateInc;
|
||||
|
||||
if (options.ruleDates) {
|
||||
this.ruleDates = options.ruleDates.map(formatTime);
|
||||
this.ruleDate = this.ruleDates[this.ruleDateInc];
|
||||
}
|
||||
|
||||
if (options.exDates) {
|
||||
this.exDates = options.exDates.map(formatTime);
|
||||
this.exDate = this.exDates[this.exDateInc];
|
||||
}
|
||||
|
||||
if (typeof(options.complete) !== 'undefined') {
|
||||
this.complete = options.complete;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieve the next occurrence in the series.
|
||||
* @return {ICAL.Time}
|
||||
*/
|
||||
next: function() {
|
||||
var iter;
|
||||
var ruleOfDay;
|
||||
var next;
|
||||
var compare;
|
||||
|
||||
var maxTries = 500;
|
||||
var currentTry = 0;
|
||||
|
||||
while (true) {
|
||||
if (currentTry++ > maxTries) {
|
||||
throw new Error(
|
||||
'max tries have occured, rule may be impossible to forfill.'
|
||||
);
|
||||
}
|
||||
|
||||
next = this.ruleDate;
|
||||
iter = this._nextRecurrenceIter(this.last);
|
||||
|
||||
// no more matches
|
||||
// because we increment the rule day or rule
|
||||
// _after_ we choose a value this should be
|
||||
// the only spot where we need to worry about the
|
||||
// end of events.
|
||||
if (!next && !iter) {
|
||||
// there are no more iterators or rdates
|
||||
this.complete = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// no next rule day or recurrence rule is first.
|
||||
if (!next || (iter && next.compare(iter.last) > 0)) {
|
||||
// must be cloned, recur will reuse the time element.
|
||||
next = iter.last.clone();
|
||||
// move to next so we can continue
|
||||
iter.next();
|
||||
}
|
||||
|
||||
// if the ruleDate is still next increment it.
|
||||
if (this.ruleDate === next) {
|
||||
this._nextRuleDay();
|
||||
}
|
||||
|
||||
this.last = next;
|
||||
|
||||
// check the negative rules
|
||||
if (this.exDate) {
|
||||
compare = this.exDate.compare(this.last);
|
||||
|
||||
if (compare < 0) {
|
||||
this._nextExDay();
|
||||
}
|
||||
|
||||
// if the current rule is excluded skip it.
|
||||
if (compare === 0) {
|
||||
this._nextExDay();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//XXX: The spec states that after we resolve the final
|
||||
// list of dates we execute exdate this seems somewhat counter
|
||||
// intuitive to what I have seen most servers do so for now
|
||||
// I exclude based on the original date not the one that may
|
||||
// have been modified by the exception.
|
||||
return this.last;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts object into a serialize-able format. This format can be passed
|
||||
* back into the expansion to resume iteration.
|
||||
* @return {Object}
|
||||
*/
|
||||
toJSON: function() {
|
||||
function toJSON(item) {
|
||||
return item.toJSON();
|
||||
}
|
||||
|
||||
var result = Object.create(null);
|
||||
result.ruleIterators = this.ruleIterators.map(toJSON);
|
||||
|
||||
if (this.ruleDates) {
|
||||
result.ruleDates = this.ruleDates.map(toJSON);
|
||||
}
|
||||
|
||||
if (this.exDates) {
|
||||
result.exDates = this.exDates.map(toJSON);
|
||||
}
|
||||
|
||||
result.ruleDateInc = this.ruleDateInc;
|
||||
result.exDateInc = this.exDateInc;
|
||||
result.last = this.last.toJSON();
|
||||
result.dtstart = this.dtstart.toJSON();
|
||||
result.complete = this.complete;
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Extract all dates from the properties in the given component. The
|
||||
* properties will be filtered by the property name.
|
||||
*
|
||||
* @private
|
||||
* @param {ICAL.Component} component The component to search in
|
||||
* @param {String} propertyName The property name to search for
|
||||
* @return {ICAL.Time[]} The extracted dates.
|
||||
*/
|
||||
_extractDates: function(component, propertyName) {
|
||||
function handleProp(prop) {
|
||||
idx = ICAL.helpers.binsearchInsert(
|
||||
result,
|
||||
prop,
|
||||
compareTime
|
||||
);
|
||||
|
||||
// ordered insert
|
||||
result.splice(idx, 0, prop);
|
||||
}
|
||||
|
||||
var result = [];
|
||||
var props = component.getAllProperties(propertyName);
|
||||
var len = props.length;
|
||||
var i = 0;
|
||||
var prop;
|
||||
|
||||
var idx;
|
||||
|
||||
for (; i < len; i++) {
|
||||
props[i].getValues().forEach(handleProp);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize the recurrence expansion.
|
||||
*
|
||||
* @private
|
||||
* @param {ICAL.Component} component The component to initialize from.
|
||||
*/
|
||||
_init: function(component) {
|
||||
this.ruleIterators = [];
|
||||
|
||||
this.last = this.dtstart.clone();
|
||||
|
||||
// to provide api consistency non-recurring
|
||||
// events can also use the iterator though it will
|
||||
// only return a single time.
|
||||
if (!isRecurringComponent(component)) {
|
||||
this.ruleDate = this.last.clone();
|
||||
this.complete = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.hasProperty('rdate')) {
|
||||
this.ruleDates = this._extractDates(component, 'rdate');
|
||||
|
||||
// special hack for cases where first rdate is prior
|
||||
// to the start date. We only check for the first rdate.
|
||||
// This is mostly for google's crazy recurring date logic
|
||||
// (contacts birthdays).
|
||||
if ((this.ruleDates[0]) &&
|
||||
(this.ruleDates[0].compare(this.dtstart) < 0)) {
|
||||
|
||||
this.ruleDateInc = 0;
|
||||
this.last = this.ruleDates[0].clone();
|
||||
} else {
|
||||
this.ruleDateInc = ICAL.helpers.binsearchInsert(
|
||||
this.ruleDates,
|
||||
this.last,
|
||||
compareTime
|
||||
);
|
||||
}
|
||||
|
||||
this.ruleDate = this.ruleDates[this.ruleDateInc];
|
||||
}
|
||||
|
||||
if (component.hasProperty('rrule')) {
|
||||
var rules = component.getAllProperties('rrule');
|
||||
var i = 0;
|
||||
var len = rules.length;
|
||||
|
||||
var rule;
|
||||
var iter;
|
||||
|
||||
for (; i < len; i++) {
|
||||
rule = rules[i].getFirstValue();
|
||||
iter = rule.iterator(this.dtstart);
|
||||
this.ruleIterators.push(iter);
|
||||
|
||||
// increment to the next occurrence so future
|
||||
// calls to next return times beyond the initial iteration.
|
||||
// XXX: I find this suspicious might be a bug?
|
||||
iter.next();
|
||||
}
|
||||
}
|
||||
|
||||
if (component.hasProperty('exdate')) {
|
||||
this.exDates = this._extractDates(component, 'exdate');
|
||||
// if we have a .last day we increment the index to beyond it.
|
||||
this.exDateInc = ICAL.helpers.binsearchInsert(
|
||||
this.exDates,
|
||||
this.last,
|
||||
compareTime
|
||||
);
|
||||
|
||||
this.exDate = this.exDates[this.exDateInc];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Advance to the next exdate
|
||||
* @private
|
||||
*/
|
||||
_nextExDay: function() {
|
||||
this.exDate = this.exDates[++this.exDateInc];
|
||||
},
|
||||
|
||||
/**
|
||||
* Advance to the next rule date
|
||||
* @private
|
||||
*/
|
||||
_nextRuleDay: function() {
|
||||
this.ruleDate = this.ruleDates[++this.ruleDateInc];
|
||||
},
|
||||
|
||||
/**
|
||||
* Find and return the recurrence rule with the most recent event and
|
||||
* return it.
|
||||
*
|
||||
* @private
|
||||
* @return {?ICAL.RecurIterator} Found iterator.
|
||||
*/
|
||||
_nextRecurrenceIter: function() {
|
||||
var iters = this.ruleIterators;
|
||||
|
||||
if (iters.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var len = iters.length;
|
||||
var iter;
|
||||
var iterTime;
|
||||
var iterIdx = 0;
|
||||
var chosenIter;
|
||||
|
||||
// loop through each iterator
|
||||
for (; iterIdx < len; iterIdx++) {
|
||||
iter = iters[iterIdx];
|
||||
iterTime = iter.last;
|
||||
|
||||
// if iteration is complete
|
||||
// then we must exclude it from
|
||||
// the search and remove it.
|
||||
if (iter.completed) {
|
||||
len--;
|
||||
if (iterIdx !== 0) {
|
||||
iterIdx--;
|
||||
}
|
||||
iters.splice(iterIdx, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
// find the most recent possible choice
|
||||
if (!chosenIter || chosenIter.last.compare(iterTime) > 0) {
|
||||
// that iterator is saved
|
||||
chosenIter = iter;
|
||||
}
|
||||
}
|
||||
|
||||
// the chosen iterator is returned but not mutated
|
||||
// this iterator contains the most recent event.
|
||||
return chosenIter;
|
||||
}
|
||||
};
|
||||
|
||||
return RecurExpansion;
|
||||
}());
|
1428
js/vendor/ical.js/lib/ical/recur_iterator.js
vendored
1428
js/vendor/ical.js/lib/ical/recur_iterator.js
vendored
File diff suppressed because it is too large
Load diff
297
js/vendor/ical.js/lib/ical/stringify.js
vendored
297
js/vendor/ical.js/lib/ical/stringify.js
vendored
|
@ -1,297 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* Contains various functions to convert jCal and jCard data back into
|
||||
* iCalendar and vCard.
|
||||
* @namespace
|
||||
*/
|
||||
ICAL.stringify = (function() {
|
||||
'use strict';
|
||||
|
||||
var LINE_ENDING = '\r\n';
|
||||
var DEFAULT_VALUE_TYPE = 'unknown';
|
||||
|
||||
var design = ICAL.design;
|
||||
var helpers = ICAL.helpers;
|
||||
|
||||
/**
|
||||
* Convert a full jCal/jCard array into a iCalendar/vCard string.
|
||||
*
|
||||
* @function ICAL.stringify
|
||||
* @variation function
|
||||
* @param {Array} jCal The jCal/jCard document
|
||||
* @return {String} The stringified iCalendar/vCard document
|
||||
*/
|
||||
function stringify(jCal) {
|
||||
if (typeof jCal[0] == "string") {
|
||||
// This is a single component
|
||||
jCal = [jCal];
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
var len = jCal.length;
|
||||
var result = '';
|
||||
|
||||
for (; i < len; i++) {
|
||||
result += stringify.component(jCal[i]) + LINE_ENDING;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an jCal component array into a ICAL string.
|
||||
* Recursive will resolve sub-components.
|
||||
*
|
||||
* Exact component/property order is not saved all
|
||||
* properties will come before subcomponents.
|
||||
*
|
||||
* @function ICAL.stringify.component
|
||||
* @param {Array} component
|
||||
* jCal/jCard fragment of a component
|
||||
* @param {ICAL.design.designSet} designSet
|
||||
* The design data to use for this component
|
||||
* @return {String} The iCalendar/vCard string
|
||||
*/
|
||||
stringify.component = function(component, designSet) {
|
||||
var name = component[0].toUpperCase();
|
||||
var result = 'BEGIN:' + name + LINE_ENDING;
|
||||
|
||||
var props = component[1];
|
||||
var propIdx = 0;
|
||||
var propLen = props.length;
|
||||
|
||||
var designSetName = component[0];
|
||||
// rfc6350 requires that in vCard 4.0 the first component is the VERSION
|
||||
// component with as value 4.0, note that 3.0 does not have this requirement.
|
||||
if (designSetName === 'vcard' && component[1].length > 0 &&
|
||||
!(component[1][0][0] === "version" && component[1][0][3] === "4.0")) {
|
||||
designSetName = "vcard3";
|
||||
}
|
||||
designSet = designSet || design.getDesignSet(designSetName);
|
||||
|
||||
for (; propIdx < propLen; propIdx++) {
|
||||
result += stringify.property(props[propIdx], designSet) + LINE_ENDING;
|
||||
}
|
||||
|
||||
var comps = component[2];
|
||||
var compIdx = 0;
|
||||
var compLen = comps.length;
|
||||
|
||||
for (; compIdx < compLen; compIdx++) {
|
||||
result += stringify.component(comps[compIdx], designSet) + LINE_ENDING;
|
||||
}
|
||||
|
||||
result += 'END:' + name;
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts a single jCal/jCard property to a iCalendar/vCard string.
|
||||
*
|
||||
* @function ICAL.stringify.property
|
||||
* @param {Array} property
|
||||
* jCal/jCard property array
|
||||
* @param {ICAL.design.designSet} designSet
|
||||
* The design data to use for this property
|
||||
* @param {Boolean} noFold
|
||||
* If true, the line is not folded
|
||||
* @return {String} The iCalendar/vCard string
|
||||
*/
|
||||
stringify.property = function(property, designSet, noFold) {
|
||||
var name = property[0].toUpperCase();
|
||||
var jsName = property[0];
|
||||
var params = property[1];
|
||||
|
||||
var line = name;
|
||||
|
||||
var paramName;
|
||||
for (paramName in params) {
|
||||
var value = params[paramName];
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (params.hasOwnProperty(paramName)) {
|
||||
var multiValue = (paramName in designSet.param) && designSet.param[paramName].multiValue;
|
||||
if (multiValue && Array.isArray(value)) {
|
||||
if (designSet.param[paramName].multiValueSeparateDQuote) {
|
||||
multiValue = '"' + multiValue + '"';
|
||||
}
|
||||
value = value.map(stringify._rfc6868Unescape);
|
||||
value = stringify.multiValue(value, multiValue, "unknown", null, designSet);
|
||||
} else {
|
||||
value = stringify._rfc6868Unescape(value);
|
||||
}
|
||||
|
||||
|
||||
line += ';' + paramName.toUpperCase();
|
||||
line += '=' + stringify.propertyValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (property.length === 3) {
|
||||
// If there are no values, we must assume a blank value
|
||||
return line + ':';
|
||||
}
|
||||
|
||||
var valueType = property[2];
|
||||
|
||||
if (!designSet) {
|
||||
designSet = design.defaultSet;
|
||||
}
|
||||
|
||||
var propDetails;
|
||||
var multiValue = false;
|
||||
var structuredValue = false;
|
||||
var isDefault = false;
|
||||
|
||||
if (jsName in designSet.property) {
|
||||
propDetails = designSet.property[jsName];
|
||||
|
||||
if ('multiValue' in propDetails) {
|
||||
multiValue = propDetails.multiValue;
|
||||
}
|
||||
|
||||
if (('structuredValue' in propDetails) && Array.isArray(property[3])) {
|
||||
structuredValue = propDetails.structuredValue;
|
||||
}
|
||||
|
||||
if ('defaultType' in propDetails) {
|
||||
if (valueType === propDetails.defaultType) {
|
||||
isDefault = true;
|
||||
}
|
||||
} else {
|
||||
if (valueType === DEFAULT_VALUE_TYPE) {
|
||||
isDefault = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (valueType === DEFAULT_VALUE_TYPE) {
|
||||
isDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
// push the VALUE property if type is not the default
|
||||
// for the current property.
|
||||
if (!isDefault) {
|
||||
// value will never contain ;/:/, so we don't escape it here.
|
||||
line += ';VALUE=' + valueType.toUpperCase();
|
||||
}
|
||||
|
||||
line += ':';
|
||||
|
||||
if (multiValue && structuredValue) {
|
||||
line += stringify.multiValue(
|
||||
property[3], structuredValue, valueType, multiValue, designSet, structuredValue
|
||||
);
|
||||
} else if (multiValue) {
|
||||
line += stringify.multiValue(
|
||||
property.slice(3), multiValue, valueType, null, designSet, false
|
||||
);
|
||||
} else if (structuredValue) {
|
||||
line += stringify.multiValue(
|
||||
property[3], structuredValue, valueType, null, designSet, structuredValue
|
||||
);
|
||||
} else {
|
||||
line += stringify.value(property[3], valueType, designSet, false);
|
||||
}
|
||||
|
||||
return noFold ? line : ICAL.helpers.foldline(line);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles escaping of property values that may contain:
|
||||
*
|
||||
* COLON (:), SEMICOLON (;), or COMMA (,)
|
||||
*
|
||||
* If any of the above are present the result is wrapped
|
||||
* in double quotes.
|
||||
*
|
||||
* @function ICAL.stringify.propertyValue
|
||||
* @param {String} value Raw property value
|
||||
* @return {String} Given or escaped value when needed
|
||||
*/
|
||||
stringify.propertyValue = function(value) {
|
||||
|
||||
if ((helpers.unescapedIndexOf(value, ',') === -1) &&
|
||||
(helpers.unescapedIndexOf(value, ':') === -1) &&
|
||||
(helpers.unescapedIndexOf(value, ';') === -1)) {
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
return '"' + value + '"';
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an array of ical values into a single
|
||||
* string based on a type and a delimiter value (like ",").
|
||||
*
|
||||
* @function ICAL.stringify.multiValue
|
||||
* @param {Array} values List of values to convert
|
||||
* @param {String} delim Used to join the values (",", ";", ":")
|
||||
* @param {String} type Lowecase ical value type
|
||||
* (like boolean, date-time, etc..)
|
||||
* @param {?String} innerMulti If set, each value will again be processed
|
||||
* Used for structured values
|
||||
* @param {ICAL.design.designSet} designSet
|
||||
* The design data to use for this property
|
||||
*
|
||||
* @return {String} iCalendar/vCard string for value
|
||||
*/
|
||||
stringify.multiValue = function(values, delim, type, innerMulti, designSet, structuredValue) {
|
||||
var result = '';
|
||||
var len = values.length;
|
||||
var i = 0;
|
||||
|
||||
for (; i < len; i++) {
|
||||
if (innerMulti && Array.isArray(values[i])) {
|
||||
result += stringify.multiValue(values[i], innerMulti, type, null, designSet, structuredValue);
|
||||
} else {
|
||||
result += stringify.value(values[i], type, designSet, structuredValue);
|
||||
}
|
||||
|
||||
if (i !== (len - 1)) {
|
||||
result += delim;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Processes a single ical value runs the associated "toICAL" method from the
|
||||
* design value type if available to convert the value.
|
||||
*
|
||||
* @function ICAL.stringify.value
|
||||
* @param {String|Number} value A formatted value
|
||||
* @param {String} type Lowercase iCalendar/vCard value type
|
||||
* (like boolean, date-time, etc..)
|
||||
* @return {String} iCalendar/vCard value for single value
|
||||
*/
|
||||
stringify.value = function(value, type, designSet, structuredValue) {
|
||||
if (type in designSet.value && 'toICAL' in designSet.value[type]) {
|
||||
return designSet.value[type].toICAL(value, structuredValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal helper for rfc6868. Exposing this on ICAL.stringify so that
|
||||
* hackers can disable the rfc6868 parsing if the really need to.
|
||||
*
|
||||
* @param {String} val The value to unescape
|
||||
* @return {String} The escaped value
|
||||
*/
|
||||
stringify._rfc6868Unescape = function(val) {
|
||||
return val.replace(/[\n^"]/g, function(x) {
|
||||
return RFC6868_REPLACE_MAP[x];
|
||||
});
|
||||
};
|
||||
var RFC6868_REPLACE_MAP = { '"': "^'", "\n": "^n", "^": "^^" };
|
||||
|
||||
return stringify;
|
||||
}());
|
1295
js/vendor/ical.js/lib/ical/time.js
vendored
1295
js/vendor/ical.js/lib/ical/time.js
vendored
File diff suppressed because it is too large
Load diff
529
js/vendor/ical.js/lib/ical/timezone.js
vendored
529
js/vendor/ical.js/lib/ical/timezone.js
vendored
|
@ -1,529 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2012 */
|
||||
|
||||
"use strict";
|
||||
|
||||
(function() {
|
||||
var OPTIONS = ["tzid", "location", "tznames",
|
||||
"latitude", "longitude"];
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Timezone representation, created by passing in a tzid and component.
|
||||
*
|
||||
* @example
|
||||
* var vcalendar;
|
||||
* var timezoneComp = vcalendar.getFirstSubcomponent('vtimezone');
|
||||
* var tzid = timezoneComp.getFirstPropertyValue('tzid');
|
||||
*
|
||||
* var timezone = new ICAL.Timezone({
|
||||
* component: timezoneComp,
|
||||
* tzid
|
||||
* });
|
||||
*
|
||||
* @class
|
||||
* @param {ICAL.Component|Object} data options for class
|
||||
* @param {String|ICAL.Component} data.component
|
||||
* If data is a simple object, then this member can be set to either a
|
||||
* string containing the component data, or an already parsed
|
||||
* ICAL.Component
|
||||
* @param {String} data.tzid The timezone identifier
|
||||
* @param {String} data.location The timezone locationw
|
||||
* @param {String} data.tznames An alternative string representation of the
|
||||
* timezone
|
||||
* @param {Number} data.latitude The latitude of the timezone
|
||||
* @param {Number} data.longitude The longitude of the timezone
|
||||
*/
|
||||
ICAL.Timezone = function icaltimezone(data) {
|
||||
this.wrappedJSObject = this;
|
||||
this.fromData(data);
|
||||
};
|
||||
|
||||
ICAL.Timezone.prototype = {
|
||||
|
||||
/**
|
||||
* Timezone identifier
|
||||
* @type {String}
|
||||
*/
|
||||
tzid: "",
|
||||
|
||||
/**
|
||||
* Timezone location
|
||||
* @type {String}
|
||||
*/
|
||||
location: "",
|
||||
|
||||
/**
|
||||
* Alternative timezone name, for the string representation
|
||||
* @type {String}
|
||||
*/
|
||||
tznames: "",
|
||||
|
||||
/**
|
||||
* The primary latitude for the timezone.
|
||||
* @type {Number}
|
||||
*/
|
||||
latitude: 0.0,
|
||||
|
||||
/**
|
||||
* The primary longitude for the timezone.
|
||||
* @type {Number}
|
||||
*/
|
||||
longitude: 0.0,
|
||||
|
||||
/**
|
||||
* The vtimezone component for this timezone.
|
||||
* @type {ICAL.Component}
|
||||
*/
|
||||
component: null,
|
||||
|
||||
/**
|
||||
* The year this timezone has been expanded to. All timezone transition
|
||||
* dates until this year are known and can be used for calculation
|
||||
*
|
||||
* @private
|
||||
* @type {Number}
|
||||
*/
|
||||
expandedUntilYear: 0,
|
||||
|
||||
/**
|
||||
* The class identifier.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "icaltimezone"
|
||||
*/
|
||||
icalclass: "icaltimezone",
|
||||
|
||||
/**
|
||||
* Sets up the current instance using members from the passed data object.
|
||||
*
|
||||
* @param {ICAL.Component|Object} aData options for class
|
||||
* @param {String|ICAL.Component} aData.component
|
||||
* If aData is a simple object, then this member can be set to either a
|
||||
* string containing the component data, or an already parsed
|
||||
* ICAL.Component
|
||||
* @param {String} aData.tzid The timezone identifier
|
||||
* @param {String} aData.location The timezone locationw
|
||||
* @param {String} aData.tznames An alternative string representation of the
|
||||
* timezone
|
||||
* @param {Number} aData.latitude The latitude of the timezone
|
||||
* @param {Number} aData.longitude The longitude of the timezone
|
||||
*/
|
||||
fromData: function fromData(aData) {
|
||||
this.expandedUntilYear = 0;
|
||||
this.changes = [];
|
||||
|
||||
if (aData instanceof ICAL.Component) {
|
||||
// Either a component is passed directly
|
||||
this.component = aData;
|
||||
} else {
|
||||
// Otherwise the component may be in the data object
|
||||
if (aData && "component" in aData) {
|
||||
if (typeof aData.component == "string") {
|
||||
// If a string was passed, parse it as a component
|
||||
var jCal = ICAL.parse(aData.component);
|
||||
this.component = new ICAL.Component(jCal);
|
||||
} else if (aData.component instanceof ICAL.Component) {
|
||||
// If it was a component already, then just set it
|
||||
this.component = aData.component;
|
||||
} else {
|
||||
// Otherwise just null out the component
|
||||
this.component = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy remaining passed properties
|
||||
for (var key in OPTIONS) {
|
||||
/* istanbul ignore else */
|
||||
if (OPTIONS.hasOwnProperty(key)) {
|
||||
var prop = OPTIONS[key];
|
||||
if (aData && prop in aData) {
|
||||
this[prop] = aData[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we have a component but no TZID, attempt to get it from the
|
||||
// component's properties.
|
||||
if (this.component instanceof ICAL.Component && !this.tzid) {
|
||||
this.tzid = this.component.getFirstPropertyValue('tzid');
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds the utcOffset the given time would occur in this timezone.
|
||||
*
|
||||
* @param {ICAL.Time} tt The time to check for
|
||||
* @return {Number} utc offset in seconds
|
||||
*/
|
||||
utcOffset: function utcOffset(tt) {
|
||||
if (this == ICAL.Timezone.utcTimezone || this == ICAL.Timezone.localTimezone) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this._ensureCoverage(tt.year);
|
||||
|
||||
if (!this.changes.length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var tt_change = {
|
||||
year: tt.year,
|
||||
month: tt.month,
|
||||
day: tt.day,
|
||||
hour: tt.hour,
|
||||
minute: tt.minute,
|
||||
second: tt.second
|
||||
};
|
||||
|
||||
var change_num = this._findNearbyChange(tt_change);
|
||||
var change_num_to_use = -1;
|
||||
var step = 1;
|
||||
|
||||
// TODO: replace with bin search?
|
||||
for (;;) {
|
||||
var change = ICAL.helpers.clone(this.changes[change_num], true);
|
||||
if (change.utcOffset < change.prevUtcOffset) {
|
||||
ICAL.Timezone.adjust_change(change, 0, 0, 0, change.utcOffset);
|
||||
} else {
|
||||
ICAL.Timezone.adjust_change(change, 0, 0, 0,
|
||||
change.prevUtcOffset);
|
||||
}
|
||||
|
||||
var cmp = ICAL.Timezone._compare_change_fn(tt_change, change);
|
||||
|
||||
if (cmp >= 0) {
|
||||
change_num_to_use = change_num;
|
||||
} else {
|
||||
step = -1;
|
||||
}
|
||||
|
||||
if (step == -1 && change_num_to_use != -1) {
|
||||
break;
|
||||
}
|
||||
|
||||
change_num += step;
|
||||
|
||||
if (change_num < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (change_num >= this.changes.length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var zone_change = this.changes[change_num_to_use];
|
||||
var utcOffset_change = zone_change.utcOffset - zone_change.prevUtcOffset;
|
||||
|
||||
if (utcOffset_change < 0 && change_num_to_use > 0) {
|
||||
var tmp_change = ICAL.helpers.clone(zone_change, true);
|
||||
ICAL.Timezone.adjust_change(tmp_change, 0, 0, 0,
|
||||
tmp_change.prevUtcOffset);
|
||||
|
||||
if (ICAL.Timezone._compare_change_fn(tt_change, tmp_change) < 0) {
|
||||
var prev_zone_change = this.changes[change_num_to_use - 1];
|
||||
|
||||
var want_daylight = false; // TODO
|
||||
|
||||
if (zone_change.is_daylight != want_daylight &&
|
||||
prev_zone_change.is_daylight == want_daylight) {
|
||||
zone_change = prev_zone_change;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO return is_daylight?
|
||||
return zone_change.utcOffset;
|
||||
},
|
||||
|
||||
_findNearbyChange: function icaltimezone_find_nearby_change(change) {
|
||||
// find the closest match
|
||||
var idx = ICAL.helpers.binsearchInsert(
|
||||
this.changes,
|
||||
change,
|
||||
ICAL.Timezone._compare_change_fn
|
||||
);
|
||||
|
||||
if (idx >= this.changes.length) {
|
||||
return this.changes.length - 1;
|
||||
}
|
||||
|
||||
return idx;
|
||||
},
|
||||
|
||||
_ensureCoverage: function(aYear) {
|
||||
if (ICAL.Timezone._minimumExpansionYear == -1) {
|
||||
var today = ICAL.Time.now();
|
||||
ICAL.Timezone._minimumExpansionYear = today.year;
|
||||
}
|
||||
|
||||
var changesEndYear = aYear;
|
||||
if (changesEndYear < ICAL.Timezone._minimumExpansionYear) {
|
||||
changesEndYear = ICAL.Timezone._minimumExpansionYear;
|
||||
}
|
||||
|
||||
changesEndYear += ICAL.Timezone.EXTRA_COVERAGE;
|
||||
|
||||
if (changesEndYear > ICAL.Timezone.MAX_YEAR) {
|
||||
changesEndYear = ICAL.Timezone.MAX_YEAR;
|
||||
}
|
||||
|
||||
if (!this.changes.length || this.expandedUntilYear < aYear) {
|
||||
var subcomps = this.component.getAllSubcomponents();
|
||||
var compLen = subcomps.length;
|
||||
var compIdx = 0;
|
||||
|
||||
for (; compIdx < compLen; compIdx++) {
|
||||
this._expandComponent(
|
||||
subcomps[compIdx], changesEndYear, this.changes
|
||||
);
|
||||
}
|
||||
|
||||
this.changes.sort(ICAL.Timezone._compare_change_fn);
|
||||
this.expandedUntilYear = changesEndYear;
|
||||
}
|
||||
},
|
||||
|
||||
_expandComponent: function(aComponent, aYear, changes) {
|
||||
if (!aComponent.hasProperty("dtstart") ||
|
||||
!aComponent.hasProperty("tzoffsetto") ||
|
||||
!aComponent.hasProperty("tzoffsetfrom")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var dtstart = aComponent.getFirstProperty("dtstart").getFirstValue();
|
||||
var change;
|
||||
|
||||
function convert_tzoffset(offset) {
|
||||
return offset.factor * (offset.hours * 3600 + offset.minutes * 60);
|
||||
}
|
||||
|
||||
function init_changes() {
|
||||
var changebase = {};
|
||||
changebase.is_daylight = (aComponent.name == "daylight");
|
||||
changebase.utcOffset = convert_tzoffset(
|
||||
aComponent.getFirstProperty("tzoffsetto").getFirstValue()
|
||||
);
|
||||
|
||||
changebase.prevUtcOffset = convert_tzoffset(
|
||||
aComponent.getFirstProperty("tzoffsetfrom").getFirstValue()
|
||||
);
|
||||
|
||||
return changebase;
|
||||
}
|
||||
|
||||
if (!aComponent.hasProperty("rrule") && !aComponent.hasProperty("rdate")) {
|
||||
change = init_changes();
|
||||
change.year = dtstart.year;
|
||||
change.month = dtstart.month;
|
||||
change.day = dtstart.day;
|
||||
change.hour = dtstart.hour;
|
||||
change.minute = dtstart.minute;
|
||||
change.second = dtstart.second;
|
||||
|
||||
ICAL.Timezone.adjust_change(change, 0, 0, 0,
|
||||
-change.prevUtcOffset);
|
||||
changes.push(change);
|
||||
} else {
|
||||
var props = aComponent.getAllProperties("rdate");
|
||||
for (var rdatekey in props) {
|
||||
/* istanbul ignore if */
|
||||
if (!props.hasOwnProperty(rdatekey)) {
|
||||
continue;
|
||||
}
|
||||
var rdate = props[rdatekey];
|
||||
var time = rdate.getFirstValue();
|
||||
change = init_changes();
|
||||
|
||||
change.year = time.year;
|
||||
change.month = time.month;
|
||||
change.day = time.day;
|
||||
|
||||
if (time.isDate) {
|
||||
change.hour = dtstart.hour;
|
||||
change.minute = dtstart.minute;
|
||||
change.second = dtstart.second;
|
||||
|
||||
if (dtstart.zone != ICAL.Timezone.utcTimezone) {
|
||||
ICAL.Timezone.adjust_change(change, 0, 0, 0,
|
||||
-change.prevUtcOffset);
|
||||
}
|
||||
} else {
|
||||
change.hour = time.hour;
|
||||
change.minute = time.minute;
|
||||
change.second = time.second;
|
||||
|
||||
if (time.zone != ICAL.Timezone.utcTimezone) {
|
||||
ICAL.Timezone.adjust_change(change, 0, 0, 0,
|
||||
-change.prevUtcOffset);
|
||||
}
|
||||
}
|
||||
|
||||
changes.push(change);
|
||||
}
|
||||
|
||||
var rrule = aComponent.getFirstProperty("rrule");
|
||||
|
||||
if (rrule) {
|
||||
rrule = rrule.getFirstValue();
|
||||
change = init_changes();
|
||||
|
||||
if (rrule.until && rrule.until.zone == ICAL.Timezone.utcTimezone) {
|
||||
rrule.until.adjust(0, 0, 0, change.prevUtcOffset);
|
||||
rrule.until.zone = ICAL.Timezone.localTimezone;
|
||||
}
|
||||
|
||||
var iterator = rrule.iterator(dtstart);
|
||||
|
||||
var occ;
|
||||
while ((occ = iterator.next())) {
|
||||
change = init_changes();
|
||||
if (occ.year > aYear || !occ) {
|
||||
break;
|
||||
}
|
||||
|
||||
change.year = occ.year;
|
||||
change.month = occ.month;
|
||||
change.day = occ.day;
|
||||
change.hour = occ.hour;
|
||||
change.minute = occ.minute;
|
||||
change.second = occ.second;
|
||||
change.isDate = occ.isDate;
|
||||
|
||||
ICAL.Timezone.adjust_change(change, 0, 0, 0,
|
||||
-change.prevUtcOffset);
|
||||
changes.push(change);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return changes;
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this timezone.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function toString() {
|
||||
return (this.tznames ? this.tznames : this.tzid);
|
||||
}
|
||||
};
|
||||
|
||||
ICAL.Timezone._compare_change_fn = function icaltimezone_compare_change_fn(a, b) {
|
||||
if (a.year < b.year) return -1;
|
||||
else if (a.year > b.year) return 1;
|
||||
|
||||
if (a.month < b.month) return -1;
|
||||
else if (a.month > b.month) return 1;
|
||||
|
||||
if (a.day < b.day) return -1;
|
||||
else if (a.day > b.day) return 1;
|
||||
|
||||
if (a.hour < b.hour) return -1;
|
||||
else if (a.hour > b.hour) return 1;
|
||||
|
||||
if (a.minute < b.minute) return -1;
|
||||
else if (a.minute > b.minute) return 1;
|
||||
|
||||
if (a.second < b.second) return -1;
|
||||
else if (a.second > b.second) return 1;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert the date/time from one zone to the next.
|
||||
*
|
||||
* @param {ICAL.Time} tt The time to convert
|
||||
* @param {ICAL.Timezone} from_zone The source zone to convert from
|
||||
* @param {ICAL.Timezone} to_zone The target zone to conver to
|
||||
* @return {ICAL.Time} The converted date/time object
|
||||
*/
|
||||
ICAL.Timezone.convert_time = function icaltimezone_convert_time(tt, from_zone, to_zone) {
|
||||
if (tt.isDate ||
|
||||
from_zone.tzid == to_zone.tzid ||
|
||||
from_zone == ICAL.Timezone.localTimezone ||
|
||||
to_zone == ICAL.Timezone.localTimezone) {
|
||||
tt.zone = to_zone;
|
||||
return tt;
|
||||
}
|
||||
|
||||
var utcOffset = from_zone.utcOffset(tt);
|
||||
tt.adjust(0, 0, 0, - utcOffset);
|
||||
|
||||
utcOffset = to_zone.utcOffset(tt);
|
||||
tt.adjust(0, 0, 0, utcOffset);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new ICAL.Timezone instance from the passed data object.
|
||||
*
|
||||
* @param {ICAL.Component|Object} aData options for class
|
||||
* @param {String|ICAL.Component} aData.component
|
||||
* If aData is a simple object, then this member can be set to either a
|
||||
* string containing the component data, or an already parsed
|
||||
* ICAL.Component
|
||||
* @param {String} aData.tzid The timezone identifier
|
||||
* @param {String} aData.location The timezone locationw
|
||||
* @param {String} aData.tznames An alternative string representation of the
|
||||
* timezone
|
||||
* @param {Number} aData.latitude The latitude of the timezone
|
||||
* @param {Number} aData.longitude The longitude of the timezone
|
||||
*/
|
||||
ICAL.Timezone.fromData = function icaltimezone_fromData(aData) {
|
||||
var tt = new ICAL.Timezone();
|
||||
return tt.fromData(aData);
|
||||
};
|
||||
|
||||
/**
|
||||
* The instance describing the UTC timezone
|
||||
* @type {ICAL.Timezone}
|
||||
* @constant
|
||||
* @instance
|
||||
*/
|
||||
ICAL.Timezone.utcTimezone = ICAL.Timezone.fromData({
|
||||
tzid: "UTC"
|
||||
});
|
||||
|
||||
/**
|
||||
* The instance describing the local timezone
|
||||
* @type {ICAL.Timezone}
|
||||
* @constant
|
||||
* @instance
|
||||
*/
|
||||
ICAL.Timezone.localTimezone = ICAL.Timezone.fromData({
|
||||
tzid: "floating"
|
||||
});
|
||||
|
||||
/**
|
||||
* Adjust a timezone change object.
|
||||
* @private
|
||||
* @param {Object} change The timezone change object
|
||||
* @param {Number} days The extra amount of days
|
||||
* @param {Number} hours The extra amount of hours
|
||||
* @param {Number} minutes The extra amount of minutes
|
||||
* @param {Number} seconds The extra amount of seconds
|
||||
*/
|
||||
ICAL.Timezone.adjust_change = function icaltimezone_adjust_change(change, days, hours, minutes, seconds) {
|
||||
return ICAL.Time.prototype.adjust.call(
|
||||
change,
|
||||
days,
|
||||
hours,
|
||||
minutes,
|
||||
seconds,
|
||||
change
|
||||
);
|
||||
};
|
||||
|
||||
ICAL.Timezone._minimumExpansionYear = -1;
|
||||
ICAL.Timezone.MAX_YEAR = 2035; // TODO this is because of time_t, which we don't need. Still usefull?
|
||||
ICAL.Timezone.EXTRA_COVERAGE = 5;
|
||||
})();
|
92
js/vendor/ical.js/lib/ical/timezone_service.js
vendored
92
js/vendor/ical.js/lib/ical/timezone_service.js
vendored
|
@ -1,92 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.TimezoneService = (function() {
|
||||
var zones;
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Singleton class to contain timezones. Right now its all manual registry in
|
||||
* the future we may use this class to download timezone information or handle
|
||||
* loading pre-expanded timezones.
|
||||
*
|
||||
* @namespace
|
||||
* @alias ICAL.TimezoneService
|
||||
*/
|
||||
var TimezoneService = {
|
||||
reset: function() {
|
||||
zones = Object.create(null);
|
||||
var utc = ICAL.Timezone.utcTimezone;
|
||||
|
||||
zones.Z = utc;
|
||||
zones.UTC = utc;
|
||||
zones.GMT = utc;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if timezone id has been registered.
|
||||
*
|
||||
* @param {String} tzid Timezone identifier (e.g. America/Los_Angeles)
|
||||
* @return {Boolean} False, when not present
|
||||
*/
|
||||
has: function(tzid) {
|
||||
return !!zones[tzid];
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a timezone by its tzid if present.
|
||||
*
|
||||
* @param {String} tzid Timezone identifier (e.g. America/Los_Angeles)
|
||||
* @return {?ICAL.Timezone} The timezone, or null if not found
|
||||
*/
|
||||
get: function(tzid) {
|
||||
return zones[tzid];
|
||||
},
|
||||
|
||||
/**
|
||||
* Registers a timezone object or component.
|
||||
*
|
||||
* @param {String=} name
|
||||
* The name of the timezone. Defaults to the component's TZID if not
|
||||
* passed.
|
||||
* @param {ICAL.Component|ICAL.Timezone} zone
|
||||
* The initialized zone or vtimezone.
|
||||
*/
|
||||
register: function(name, timezone) {
|
||||
if (name instanceof ICAL.Component) {
|
||||
if (name.name === 'vtimezone') {
|
||||
timezone = new ICAL.Timezone(name);
|
||||
name = timezone.tzid;
|
||||
}
|
||||
}
|
||||
|
||||
if (timezone instanceof ICAL.Timezone) {
|
||||
zones[name] = timezone;
|
||||
} else {
|
||||
throw new TypeError('timezone must be ICAL.Timezone or ICAL.Component');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a timezone by its tzid from the list.
|
||||
*
|
||||
* @param {String} tzid Timezone identifier (e.g. America/Los_Angeles)
|
||||
* @return {?ICAL.Timezone} The removed timezone, or null if not registered
|
||||
*/
|
||||
remove: function(tzid) {
|
||||
return (delete zones[tzid]);
|
||||
}
|
||||
};
|
||||
|
||||
// initialize defaults
|
||||
TimezoneService.reset();
|
||||
|
||||
return TimezoneService;
|
||||
}());
|
194
js/vendor/ical.js/lib/ical/utc_offset.js
vendored
194
js/vendor/ical.js/lib/ical/utc_offset.js
vendored
|
@ -1,194 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */
|
||||
|
||||
|
||||
/**
|
||||
* This symbol is further described later on
|
||||
* @ignore
|
||||
*/
|
||||
ICAL.UtcOffset = (function() {
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* This class represents the "duration" value type, with various calculation
|
||||
* and manipulation methods.
|
||||
*
|
||||
* @class
|
||||
* @alias ICAL.UtcOffset
|
||||
* @param {Object} aData An object with members of the utc offset
|
||||
* @param {Number=} aData.hours The hours for the utc offset
|
||||
* @param {Number=} aData.minutes The minutes in the utc offset
|
||||
* @param {Number=} aData.factor The factor for the utc-offset, either -1 or 1
|
||||
*/
|
||||
function UtcOffset(aData) {
|
||||
this.fromData(aData);
|
||||
}
|
||||
|
||||
UtcOffset.prototype = {
|
||||
|
||||
/**
|
||||
* The hours in the utc-offset
|
||||
* @type {Number}
|
||||
*/
|
||||
hours: 0,
|
||||
|
||||
/**
|
||||
* The minutes in the utc-offset
|
||||
* @type {Number}
|
||||
*/
|
||||
minutes: 0,
|
||||
|
||||
/**
|
||||
* The sign of the utc offset, 1 for positive offset, -1 for negative
|
||||
* offsets.
|
||||
* @type {Number}
|
||||
*/
|
||||
factor: 1,
|
||||
|
||||
/**
|
||||
* The type name, to be used in the jCal object.
|
||||
* @constant
|
||||
* @type {String}
|
||||
* @default "utc-offset"
|
||||
*/
|
||||
icaltype: "utc-offset",
|
||||
|
||||
/**
|
||||
* Returns a clone of the utc offset object.
|
||||
*
|
||||
* @return {ICAL.UtcOffset} The cloned object
|
||||
*/
|
||||
clone: function() {
|
||||
return ICAL.UtcOffset.fromSeconds(this.toSeconds());
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets up the current instance using members from the passed data object.
|
||||
*
|
||||
* @param {Object} aData An object with members of the utc offset
|
||||
* @param {Number=} aData.hours The hours for the utc offset
|
||||
* @param {Number=} aData.minutes The minutes in the utc offset
|
||||
* @param {Number=} aData.factor The factor for the utc-offset, either -1 or 1
|
||||
*/
|
||||
fromData: function(aData) {
|
||||
if (aData) {
|
||||
for (var key in aData) {
|
||||
/* istanbul ignore else */
|
||||
if (aData.hasOwnProperty(key)) {
|
||||
this[key] = aData[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
this._normalize();
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets up the current instance from the given seconds value. The seconds
|
||||
* value is truncated to the minute. Offsets are wrapped when the world
|
||||
* ends, the hour after UTC+14:00 is UTC-12:00.
|
||||
*
|
||||
* @param {Number} aSeconds The seconds to convert into an offset
|
||||
*/
|
||||
fromSeconds: function(aSeconds) {
|
||||
var secs = Math.abs(aSeconds);
|
||||
|
||||
this.factor = aSeconds < 0 ? -1 : 1;
|
||||
this.hours = ICAL.helpers.trunc(secs / 3600);
|
||||
|
||||
secs -= (this.hours * 3600);
|
||||
this.minutes = ICAL.helpers.trunc(secs / 60);
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert the current offset to a value in seconds
|
||||
*
|
||||
* @return {Number} The offset in seconds
|
||||
*/
|
||||
toSeconds: function() {
|
||||
return this.factor * (60 * this.minutes + 3600 * this.hours);
|
||||
},
|
||||
|
||||
/**
|
||||
* Compare this utc offset with another one.
|
||||
*
|
||||
* @param {ICAL.UtcOffset} other The other offset to compare with
|
||||
* @return {Number} -1, 0 or 1 for less/equal/greater
|
||||
*/
|
||||
compare: function icaltime_compare(other) {
|
||||
var a = this.toSeconds();
|
||||
var b = other.toSeconds();
|
||||
return (a > b) - (b > a);
|
||||
},
|
||||
|
||||
_normalize: function() {
|
||||
// Range: 97200 seconds (with 1 hour inbetween)
|
||||
var secs = this.toSeconds();
|
||||
var factor = this.factor;
|
||||
while (secs < -43200) { // = UTC-12:00
|
||||
secs += 97200;
|
||||
}
|
||||
while (secs > 50400) { // = UTC+14:00
|
||||
secs -= 97200;
|
||||
}
|
||||
|
||||
this.fromSeconds(secs);
|
||||
|
||||
// Avoid changing the factor when on zero seconds
|
||||
if (secs == 0) {
|
||||
this.factor = factor;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The iCalendar string representation of this utc-offset.
|
||||
* @return {String}
|
||||
*/
|
||||
toICALString: function() {
|
||||
return ICAL.design.icalendar.value['utc-offset'].toICAL(this.toString());
|
||||
},
|
||||
|
||||
/**
|
||||
* The string representation of this utc-offset.
|
||||
* @return {String}
|
||||
*/
|
||||
toString: function toString() {
|
||||
return (this.factor == 1 ? "+" : "-") +
|
||||
ICAL.helpers.pad2(this.hours) + ':' +
|
||||
ICAL.helpers.pad2(this.minutes);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.UtcOffset} instance from the passed string.
|
||||
*
|
||||
* @param {String} aString The string to parse
|
||||
* @return {ICAL.Duration} The created utc-offset instance
|
||||
*/
|
||||
UtcOffset.fromString = function(aString) {
|
||||
// -05:00
|
||||
var options = {};
|
||||
//TODO: support seconds per rfc5545 ?
|
||||
options.factor = (aString[0] === '+') ? 1 : -1;
|
||||
options.hours = ICAL.helpers.strictParseInt(aString.substr(1, 2));
|
||||
options.minutes = ICAL.helpers.strictParseInt(aString.substr(4, 2));
|
||||
|
||||
return new ICAL.UtcOffset(options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new {@link ICAL.UtcOffset} instance from the passed seconds
|
||||
* value.
|
||||
*
|
||||
* @param {Number} aSeconds The number of seconds to convert
|
||||
*/
|
||||
UtcOffset.fromSeconds = function(aSeconds) {
|
||||
var instance = new UtcOffset();
|
||||
instance.fromSeconds(aSeconds);
|
||||
return instance;
|
||||
};
|
||||
|
||||
return UtcOffset;
|
||||
}());
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue