@grafit/era-dependencies 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/package.json +7 -0
  2. package/vendor/fonts/FontAwesome.otf +0 -0
  3. package/vendor/fonts/fontawesome-webfont.eot +0 -0
  4. package/vendor/fonts/fontawesome-webfont.svg +685 -0
  5. package/vendor/fonts/fontawesome-webfont.ttf +0 -0
  6. package/vendor/fonts/fontawesome-webfont.woff +0 -0
  7. package/vendor/fonts/fontawesome-webfont.woff2 +0 -0
  8. package/vendor/fonts/glyphicons-halflings-regular.eot +0 -0
  9. package/vendor/fonts/glyphicons-halflings-regular.svg +288 -0
  10. package/vendor/fonts/glyphicons-halflings-regular.ttf +0 -0
  11. package/vendor/fonts/glyphicons-halflings-regular.woff +0 -0
  12. package/vendor/fonts/glyphicons-halflings-regular.woff2 +0 -0
  13. package/vendor/scripts/angular/angular-cookies.js +322 -0
  14. package/vendor/scripts/angular/angular-file-upload.js +2087 -0
  15. package/vendor/scripts/angular/angular-filter.js +2287 -0
  16. package/vendor/scripts/angular/angular-locale_ru-ru.js +143 -0
  17. package/vendor/scripts/angular/angular-route.js +1069 -0
  18. package/vendor/scripts/angular/angular-sanitize.js +738 -0
  19. package/vendor/scripts/angular/angular-ui-router-0.2.18.js +4539 -0
  20. package/vendor/scripts/angular/angular.js +31768 -0
  21. package/vendor/scripts/angular/datetimepicker.js +578 -0
  22. package/vendor/scripts/angular/datetimepicker.templates.js +30 -0
  23. package/vendor/scripts/angular/mask.min.js +7 -0
  24. package/vendor/scripts/angular/ng-table.js +1518 -0
  25. package/vendor/scripts/angular/select.js +2356 -0
  26. package/vendor/scripts/angular/ui-bootstrap-tpls-2.1.3.js +7536 -0
  27. package/vendor/scripts/angular/uploader.js +3 -0
  28. package/vendor/scripts/bootbox.js +985 -0
  29. package/vendor/scripts/bootstrap.js +2377 -0
  30. package/vendor/scripts/es6-shim.js +3837 -0
  31. package/vendor/scripts/highchart/highcharts-more.src.js +3165 -0
  32. package/vendor/scripts/highchart/highstock.src.js +32008 -0
  33. package/vendor/scripts/highchart/modules/boost.src.js +2721 -0
  34. package/vendor/scripts/highchart/modules/exporting.src.js +951 -0
  35. package/vendor/scripts/jquery/jquery.js +11008 -0
  36. package/vendor/scripts/jquery.datetimepicker.full.js +2911 -0
  37. package/vendor/scripts/keycloak.js +2382 -0
  38. package/vendor/scripts/lodash.js +16733 -0
  39. package/vendor/scripts/moment-with-locales.js +12251 -0
  40. package/vendor/scripts/moment.js +4234 -0
  41. package/vendor/scripts/old/datepicker-ru.js +38 -0
  42. package/vendor/scripts/old/jquery-ui-1.11.1.js +16375 -0
  43. package/vendor/scripts/old/jquery.form.js +1278 -0
  44. package/vendor/scripts/perfect-scrollbar.js +1549 -0
  45. package/vendor/scripts/pickmeup/pickmeup-locales.js +11 -0
  46. package/vendor/scripts/pickmeup/pickmeup.js +1383 -0
  47. package/vendor/scripts/quill.js +9676 -0
  48. package/vendor/scripts/socket.io.min.js +3 -0
  49. package/vendor/scripts/textAngular/angular-spectrum-colorpicker.min.js +2 -0
  50. package/vendor/scripts/textAngular/spectrum.min.js +1 -0
  51. package/vendor/scripts/textAngular/textAngular-dropdownToggle.js +38 -0
  52. package/vendor/scripts/textAngular/textAngular-rangy.min.js +478 -0
  53. package/vendor/scripts/textAngular/textAngular-sanitize.min.js +322 -0
  54. package/vendor/scripts/textAngular/textAngular.min.js +1481 -0
  55. package/vendor/scripts/textAngular/textAngularSetup.js +1013 -0
  56. package/vendor/styles/bootstrap-theme.css +587 -0
  57. package/vendor/styles/bootstrap-theme.css.map +1 -0
  58. package/vendor/styles/bootstrap-theme.min.css +6 -0
  59. package/vendor/styles/bootstrap-theme.min.css.map +1 -0
  60. package/vendor/styles/bootstrap.css +6757 -0
  61. package/vendor/styles/bootstrap.css.map +1 -0
  62. package/vendor/styles/bootstrap.min.css +6 -0
  63. package/vendor/styles/bootstrap.min.css.map +1 -0
  64. package/vendor/styles/datetimepicker.css +115 -0
  65. package/vendor/styles/font-awesome.css +2199 -0
  66. package/vendor/styles/jquery.datetimepicker.min.css +1 -0
  67. package/vendor/styles/ng-table.css +136 -0
  68. package/vendor/styles/normalize.css +424 -0
  69. package/vendor/styles/perfect-scrollbar.css +165 -0
  70. package/vendor/styles/pickmeup.css +137 -0
  71. package/vendor/styles/spectrum.min.css +1 -0
  72. package/vendor/styles/textAngular.css +193 -0
@@ -0,0 +1,322 @@
1
+ /**
2
+ * @license AngularJS v1.3.10
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
+ * License: MIT
5
+ */
6
+ !function(a,b,c){"use strict";/**
7
+ * @ngdoc module
8
+ * @name ngSanitize
9
+ * @description
10
+ *
11
+ * # ngSanitize
12
+ *
13
+ * The `ngSanitize` module provides functionality to sanitize HTML.
14
+ *
15
+ *
16
+ * <div doc-module-components="ngSanitize"></div>
17
+ *
18
+ * See {@link ngSanitize.$sanitize `$sanitize`} for usage.
19
+ */
20
+ /*
21
+ * HTML Parser By Misko Hevery (misko@hevery.com)
22
+ * based on: HTML Parser By John Resig (ejohn.org)
23
+ * Original code by Erik Arvidsson, Mozilla Public License
24
+ * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
25
+ *
26
+ * // Use like so:
27
+ * htmlParser(htmlString, {
28
+ * start: function(tag, attrs, unary) {},
29
+ * end: function(tag) {},
30
+ * chars: function(text) {},
31
+ * comment: function(text) {}
32
+ * });
33
+ *
34
+ */
35
+ /**
36
+ * @ngdoc service
37
+ * @name $sanitize
38
+ * @kind function
39
+ *
40
+ * @description
41
+ * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
42
+ * then serialized back to properly escaped html string. This means that no unsafe input can make
43
+ * it into the returned string, however, since our parser is more strict than a typical browser
44
+ * parser, it's possible that some obscure input, which would be recognized as valid HTML by a
45
+ * browser, won't make it through the sanitizer. The input may also contain SVG markup.
46
+ * The whitelist is configured using the functions `aHrefSanitizationWhitelist` and
47
+ * `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.
48
+ *
49
+ * @param {string} html HTML input.
50
+ * @returns {string} Sanitized HTML.
51
+ *
52
+ * @example
53
+ <example module="sanitizeExample" deps="angular-sanitize.js">
54
+ <file name="index.html">
55
+ <script>
56
+ angular.module('sanitizeExample', ['ngSanitize'])
57
+ .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {
58
+ $scope.snippet =
59
+ '<p style="color:blue">an html\n' +
60
+ '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
61
+ 'snippet</p>';
62
+ $scope.deliberatelyTrustDangerousSnippet = function() {
63
+ return $sce.trustAsHtml($scope.snippet);
64
+ };
65
+ }]);
66
+ </script>
67
+ <div ng-controller="ExampleController">
68
+ Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
69
+ <table>
70
+ <tr>
71
+ <td>Directive</td>
72
+ <td>How</td>
73
+ <td>Source</td>
74
+ <td>Rendered</td>
75
+ </tr>
76
+ <tr id="bind-html-with-sanitize">
77
+ <td>ng-bind-html</td>
78
+ <td>Automatically uses $sanitize</td>
79
+ <td><pre>&lt;div ng-bind-html="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
80
+ <td><div ng-bind-html="snippet"></div></td>
81
+ </tr>
82
+ <tr id="bind-html-with-trust">
83
+ <td>ng-bind-html</td>
84
+ <td>Bypass $sanitize by explicitly trusting the dangerous value</td>
85
+ <td>
86
+ <pre>&lt;div ng-bind-html="deliberatelyTrustDangerousSnippet()"&gt;
87
+ &lt;/div&gt;</pre>
88
+ </td>
89
+ <td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
90
+ </tr>
91
+ <tr id="bind-default">
92
+ <td>ng-bind</td>
93
+ <td>Automatically escapes</td>
94
+ <td><pre>&lt;div ng-bind="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
95
+ <td><div ng-bind="snippet"></div></td>
96
+ </tr>
97
+ </table>
98
+ </div>
99
+ </file>
100
+ <file name="protractor.js" type="protractor">
101
+ it('should sanitize the html snippet by default', function() {
102
+ expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
103
+ toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
104
+ });
105
+
106
+ it('should inline raw snippet if bound to a trusted value', function() {
107
+ expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).
108
+ toBe("<p style=\"color:blue\">an html\n" +
109
+ "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
110
+ "snippet</p>");
111
+ });
112
+
113
+ it('should escape snippet without any filter', function() {
114
+ expect(element(by.css('#bind-default div')).getInnerHtml()).
115
+ toBe("&lt;p style=\"color:blue\"&gt;an html\n" +
116
+ "&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\n" +
117
+ "snippet&lt;/p&gt;");
118
+ });
119
+
120
+ it('should update', function() {
121
+ element(by.model('snippet')).clear();
122
+ element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
123
+ expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
124
+ toBe('new <b>text</b>');
125
+ expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(
126
+ 'new <b onclick="alert(1)">text</b>');
127
+ expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(
128
+ "new &lt;b onclick=\"alert(1)\"&gt;text&lt;/b&gt;");
129
+ });
130
+ </file>
131
+ </example>
132
+ */
133
+ function d(){this.$get=["$$sanitizeUri",function(a){return function(b){"undefined"!=typeof arguments[1]&&(arguments[1].version="taSanitize");var c=[];return g(b,l(c,function(b,c){return!/^unsafe/.test(a(b,c))})),c.join("")}}]}function e(a){var c=[],d=l(c,b.noop);return d.chars(a),c.join("")}function f(a){var b,c={},d=a.split(",");for(b=0;b<d.length;b++)c[d[b]]=!0;return c}/**
134
+ * @example
135
+ * htmlParser(htmlString, {
136
+ * start: function(tag, attrs, unary) {},
137
+ * end: function(tag) {},
138
+ * chars: function(text) {},
139
+ * comment: function(text) {}
140
+ * });
141
+ *
142
+ * @param {string} html string
143
+ * @param {object} handler
144
+ */
145
+ function g(a,c){function d(a,d,f,g){if(d=b.lowercase(d),D[d])for(;k.last()&&E[k.last()];)e("",k.last());C[d]&&k.last()==d&&e("",d),g=z[d]||!!g,g||k.push(d);var i={};f.replace(p,function(a,b,c,d,e){var f=c||d||e||"";i[b]=h(f)}),c.start&&c.start(d,i,g)}function e(a,d){var e,f=0;if(d=b.lowercase(d))
146
+ // Find the closest opened tag of the same type
147
+ for(f=k.length-1;f>=0&&k[f]!=d;f--);if(f>=0){
148
+ // Close all the open elements, up the stack
149
+ for(e=k.length-1;e>=f;e--)c.end&&c.end(k[e]);
150
+ // Remove the open elements from the stack
151
+ k.length=f}}"string"!=typeof a&&(a=null===a||"undefined"==typeof a?"":""+a);var f,g,i,j,k=[],l=a;for(k.last=function(){return k[k.length-1]};a;){
152
+ // Make sure we're not in a script or style element
153
+ if(j="",g=!0,k.last()&&G[k.last()])a=a.replace(new RegExp("([^]*)<\\s*\\/\\s*"+k.last()+"[^>]*>","i"),function(a,b){return b=b.replace(s,"$1").replace(v,"$1"),c.chars&&c.chars(h(b)),""}),e("",k.last());else{
154
+ // White space
155
+ if(y.test(a)){if(i=a.match(y)){i[0];c.whitespace&&c.whitespace(i[0]),a=a.replace(i[0],""),g=!1}}else t.test(a)?(i=a.match(t),i&&(c.comment&&c.comment(i[1]),a=a.replace(i[0],""),g=!1)):u.test(a)?(i=a.match(u),i&&(a=a.replace(i[0],""),g=!1)):r.test(a)?(i=a.match(o),i&&(a=a.substring(i[0].length),i[0].replace(o,e),g=!1)):q.test(a)&&(i=a.match(n),i?(
156
+ // We only have a valid start-tag if there is a '>'.
157
+ i[4]&&(a=a.substring(i[0].length),i[0].replace(n,d)),g=!1):(
158
+ // no ending tag found --- this piece should be encoded as an entity.
159
+ j+="<",a=a.substring(1)));g&&(f=a.indexOf("<"),j+=f<0?a:a.substring(0,f),a=f<0?"":a.substring(f),c.chars&&c.chars(h(j)))}if(a==l)throw m("badparse","The sanitizer was unable to parse the following block of html: {0}",a);l=a}
160
+ // Clean up any remaining tags
161
+ e()}/**
162
+ * decodes all entities into regular string
163
+ * @param value
164
+ * @returns {string} A string with decoded entities.
165
+ */
166
+ function h(a){if(!a)return"";
167
+ // Note: IE8 does not preserve spaces at the start/end of innerHTML
168
+ // so we must capture them and reattach them afterward
169
+ var b=N.exec(a),c=b[1],d=b[3],e=b[2];
170
+ // innerText depends on styling as it doesn't display hidden elements.
171
+ // Therefore, it's better to use textContent not to cause unnecessary
172
+ // reflows. However, IE<9 don't support textContent so the innerText
173
+ // fallback is necessary.
174
+ return e&&(M.innerHTML=e.replace(/</g,"&lt;"),e="textContent"in M?M.textContent:M.innerText),c+e+d}/**
175
+ * Escapes all potentially dangerous characters, so that the
176
+ * resulting string can be safely inserted into attribute or
177
+ * element text.
178
+ * @param value
179
+ * @returns {string} escaped text
180
+ */
181
+ function i(a){return a.replace(/&/g,"&amp;").replace(w,function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1);return"&#"+(1024*(b-55296)+(c-56320)+65536)+";"}).replace(x,function(a){
182
+ // unsafe chars are: \u0000-\u001f \u007f-\u009f \u00ad \u0600-\u0604 \u070f \u17b4 \u17b5 \u200c-\u200f \u2028-\u202f \u2060-\u206f \ufeff \ufff0-\uffff from jslint.com/lint.html
183
+ // decimal values are: 0-31, 127-159, 173, 1536-1540, 1807, 6068, 6069, 8204-8207, 8232-8239, 8288-8303, 65279, 65520-65535
184
+ var b=a.charCodeAt(0);
185
+ // if unsafe character encode
186
+ // if unsafe character encode
187
+ return b<=159||173==b||b>=1536&&b<=1540||1807==b||6068==b||6069==b||b>=8204&&b<=8207||b>=8232&&b<=8239||b>=8288&&b<=8303||65279==b||b>=65520&&b<=65535?"&#"+b+";":a}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}
188
+ // Custom logic for accepting certain style options only - textAngular
189
+ // Currently allows only the color, background-color, text-align, float, width and height attributes
190
+ // all other attributes should be easily done through classes.
191
+ function j(a){var c="",d=a.split(";");return b.forEach(d,function(a){var d=a.split(":");if(2==d.length){var e=O(b.lowercase(d[0])),a=O(b.lowercase(d[1]));(("color"===e||"background-color"===e)&&(a.match(/^rgb\([0-9%,\. ]*\)$/i)||a.match(/^rgba\([0-9%,\. ]*\)$/i)||a.match(/^hsl\([0-9%,\. ]*\)$/i)||a.match(/^hsla\([0-9%,\. ]*\)$/i)||a.match(/^#[0-9a-f]{3,6}$/i)||a.match(/^[a-z]*$/i))||"text-align"===e&&("left"===a||"right"===a||"center"===a||"justify"===a)||"text-decoration"===e&&("underline"===a||"line-through"===a)||"font-weight"===e&&"bold"===a||"font-style"===e&&"italic"===a||"float"===e&&("left"===a||"right"===a||"none"===a)||"vertical-align"===e&&("baseline"===a||"sub"===a||"super"===a||"test-top"===a||"text-bottom"===a||"middle"===a||"top"===a||"bottom"===a||a.match(/[0-9]*(px|em)/)||a.match(/[0-9]+?%/))||"font-size"===e&&("xx-small"===a||"x-small"===a||"small"===a||"medium"===a||"large"===a||"x-large"===a||"xx-large"===a||"larger"===a||"smaller"===a||a.match(/[0-9]*\.?[0-9]*(px|em|rem|mm|q|cm|in|pt|pc|%)/))||("width"===e||"height"===e)&&a.match(/[0-9\.]*(px|em|rem|%)/)||// Reference #520
192
+ "direction"===e&&a.match(/^ltr|rtl|initial|inherit$/))&&(c+=e+": "+a+";")}}),c}
193
+ // this function is used to manually allow specific attributes on specific tags with certain prerequisites
194
+ function k(a,b,c,d){
195
+ // catch the div placeholder for the iframe replacement
196
+ return!("img"!==a||!b["ta-insert-video"]||"ta-insert-video"!==c&&"allowfullscreen"!==c&&"frameborder"!==c&&("contenteditable"!==c||"false"!==d))}/**
197
+ * create an HTML/XML writer which writes to buffer
198
+ * @param {Array} buf use buf.jain('') to get out sanitized html string
199
+ * @returns {object} in the form of {
200
+ * start: function(tag, attrs, unary) {},
201
+ * end: function(tag) {},
202
+ * chars: function(text) {},
203
+ * comment: function(text) {}
204
+ * }
205
+ */
206
+ function l(a,c){var d=!1,e=b.bind(a,a.push);return{start:function(a,f,g){a=b.lowercase(a),!d&&G[a]&&(d=a),d||H[a]!==!0||(e("<"),e(a),b.forEach(f,function(d,g){var h=b.lowercase(g),l="img"===a&&"src"===h||"background"===h;("style"===h&&""!==(d=j(d))||k(a,f,h,d)||L[h]===!0&&(I[h]!==!0||c(d,l)))&&(e(" "),e(g),e('="'),e(i(d)),e('"'))}),e(g?"/>":">"))},comment:function(a){e(a)},whitespace:function(a){e(i(a))},end:function(a){a=b.lowercase(a),d||H[a]!==!0||(e("</"),e(a),e(">")),a==d&&(d=!1)},chars:function(a){d||e(i(a))}}}var m=b.$$minErr("$sanitize"),n=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,o=/^<\/\s*([\w:-]+)[^>]*>/,p=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,q=/^</,r=/^<\//,s=/<!--(.*?)-->/g,t=/(^<!--.*?-->)/,u=/<!DOCTYPE([^>]*?)>/i,v=/<!\[CDATA\[(.*?)]]>/g,w=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
207
+ // Match everything outside of normal chars and " (quote character)
208
+ x=/([^\#-~| |!])/g,y=/^(\s+)/,z=f("area,br,col,hr,img,wbr,input"),A=f("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),B=f("rp,rt"),C=b.extend({},B,A),D=b.extend({},A,f("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,script,section,table,ul")),E=b.extend({},B,f("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")),F=f("animate,animateColor,animateMotion,animateTransform,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,set,stop,svg,switch,text,title,tspan,use"),G=f("script,style"),H=b.extend({},z,D,E,C,F),I=f("background,cite,href,longdesc,src,usemap,xlink:href"),J=f("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,id,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width"),K=f("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,attributeName,attributeType,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"),L=b.extend({},I,K,J),M=document.createElement("pre"),N=/^(\s*)([\s\S]*?)(\s*)$/,O=function(){
209
+ // native trim is way faster: http://jsperf.com/angular-trim-test
210
+ // but IE doesn't have it... :-(
211
+ // TODO: we should move this into IE/ES5 polyfill
212
+ // native trim is way faster: http://jsperf.com/angular-trim-test
213
+ // but IE doesn't have it... :-(
214
+ // TODO: we should move this into IE/ES5 polyfill
215
+ return String.prototype.trim?function(a){return b.isString(a)?a.trim():a}:function(a){return b.isString(a)?a.replace(/^\s\s*/,"").replace(/\s\s*$/,""):a}}();
216
+ // define ngSanitize module and register $sanitize service
217
+ b.module("ngSanitize",[]).provider("$sanitize",d),/* global sanitizeText: false */
218
+ /**
219
+ * @ngdoc filter
220
+ * @name linky
221
+ * @kind function
222
+ *
223
+ * @description
224
+ * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
225
+ * plain email address links.
226
+ *
227
+ * Requires the {@link ngSanitize `ngSanitize`} module to be installed.
228
+ *
229
+ * @param {string} text Input text.
230
+ * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.
231
+ * @returns {string} Html-linkified text.
232
+ *
233
+ * @usage
234
+ <span ng-bind-html="linky_expression | linky"></span>
235
+ *
236
+ * @example
237
+ <example module="linkyExample" deps="angular-sanitize.js">
238
+ <file name="index.html">
239
+ <script>
240
+ angular.module('linkyExample', ['ngSanitize'])
241
+ .controller('ExampleController', ['$scope', function($scope) {
242
+ $scope.snippet =
243
+ 'Pretty text with some links:\n'+
244
+ 'http://angularjs.org/,\n'+
245
+ 'mailto:us@somewhere.org,\n'+
246
+ 'another@somewhere.org,\n'+
247
+ 'and one more: ftp://127.0.0.1/.';
248
+ $scope.snippetWithTarget = 'http://angularjs.org/';
249
+ }]);
250
+ </script>
251
+ <div ng-controller="ExampleController">
252
+ Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
253
+ <table>
254
+ <tr>
255
+ <td>Filter</td>
256
+ <td>Source</td>
257
+ <td>Rendered</td>
258
+ </tr>
259
+ <tr id="linky-filter">
260
+ <td>linky filter</td>
261
+ <td>
262
+ <pre>&lt;div ng-bind-html="snippet | linky"&gt;<br>&lt;/div&gt;</pre>
263
+ </td>
264
+ <td>
265
+ <div ng-bind-html="snippet | linky"></div>
266
+ </td>
267
+ </tr>
268
+ <tr id="linky-target">
269
+ <td>linky target</td>
270
+ <td>
271
+ <pre>&lt;div ng-bind-html="snippetWithTarget | linky:'_blank'"&gt;<br>&lt;/div&gt;</pre>
272
+ </td>
273
+ <td>
274
+ <div ng-bind-html="snippetWithTarget | linky:'_blank'"></div>
275
+ </td>
276
+ </tr>
277
+ <tr id="escaped-html">
278
+ <td>no filter</td>
279
+ <td><pre>&lt;div ng-bind="snippet"&gt;<br>&lt;/div&gt;</pre></td>
280
+ <td><div ng-bind="snippet"></div></td>
281
+ </tr>
282
+ </table>
283
+ </file>
284
+ <file name="protractor.js" type="protractor">
285
+ it('should linkify the snippet with urls', function() {
286
+ expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
287
+ toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
288
+ 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
289
+ expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
290
+ });
291
+
292
+ it('should not linkify snippet without the linky filter', function() {
293
+ expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
294
+ toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
295
+ 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
296
+ expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
297
+ });
298
+
299
+ it('should update', function() {
300
+ element(by.model('snippet')).clear();
301
+ element(by.model('snippet')).sendKeys('new http://link.');
302
+ expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
303
+ toBe('new http://link.');
304
+ expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
305
+ expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
306
+ .toBe('new http://link.');
307
+ });
308
+
309
+ it('should work with the target property', function() {
310
+ expect(element(by.id('linky-target')).
311
+ element(by.binding("snippetWithTarget | linky:'_blank'")).getText()).
312
+ toBe('http://angularjs.org/');
313
+ expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
314
+ });
315
+ </file>
316
+ </example>
317
+ */
318
+ b.module("ngSanitize").filter("linky",["$sanitize",function(a){var c=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"”’]/,d=/^mailto:/;return function(f,g){function h(a){a&&n.push(e(a))}function i(a,c){n.push("<a "),b.isDefined(g)&&n.push('target="',g,'" '),n.push('href="',a.replace(/"/g,"&quot;"),'">'),h(c),n.push("</a>")}if(!f)return f;for(var j,k,l,m=f,n=[];j=m.match(c);)
319
+ // We can not end in these as they are sometimes found at the end of the sentence
320
+ k=j[0],
321
+ // if we did not match ftp/http/www/mailto then assume mailto
322
+ j[2]||j[4]||(k=(j[3]?"http://":"mailto:")+k),l=j.index,h(m.substr(0,l)),i(k,j[0].replace(d,"")),m=m.substring(l+j[0].length);return h(m),a(n.join(""))}}])}(window,window.angular);