Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
af61c833
Commit
af61c833
authored
May 09, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade to angular v1.1.4
parent
190a8dc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2258 additions
and
653 deletions
+2258
-653
angular-bootstrap.js
h/lib/angular-bootstrap.js
+2
-1
angular-sanitize.js
h/lib/angular-sanitize.js
+27
-4
angular.js
h/lib/angular.js
+2229
-648
No files found.
h/lib/angular-bootstrap.js
View file @
af61c833
/**
* @license AngularJS v1.
0.5
* @license AngularJS v1.
1.4
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*/
...
...
@@ -163,4 +163,5 @@ directive.tabPane = function() {
angular
.
module
(
'bootstrap'
,
[]).
directive
(
directive
);
})(
window
,
window
.
angular
);
h/lib/angular-sanitize.js
View file @
af61c833
/**
* @license AngularJS v1.
0.5
* @license AngularJS v1.
1.4
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*/
...
...
@@ -129,7 +129,7 @@ var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:
BEGING_END_TAGE_REGEXP
=
/^<
\s
*
\/
/
,
COMMENT_REGEXP
=
/<!--
(
.*
?)
-->/g
,
CDATA_REGEXP
=
/<!
\[
CDATA
\[(
.*
?)
]]>/g
,
URI_REGEXP
=
/^
((
ftp|https
?)
:
\/\/
|mailto:|#
)
/
,
URI_REGEXP
=
/^
((
ftp|https
?)
:
\/\/
|mailto:|
tel:|
#
)
/
,
NON_ALPHANUMERIC_REGEXP
=
/
([^\#
-~| |!
])
/g
;
// Match everything outside of normal chars and " (quote character)
...
...
@@ -422,6 +422,7 @@ angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($san
});
};
}]);
/**
* @ngdoc filter
* @name ngSanitize.filter:linky
...
...
@@ -432,6 +433,7 @@ angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($san
* plain email address links.
*
* @param {string} text Input text.
* @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.
* @returns {string} Html-linkified text.
*
* @usage
...
...
@@ -448,6 +450,7 @@ angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($san
'mailto:us@somewhere.org,\n'+
'another@somewhere.org,\n'+
'and one more: ftp://127.0.0.1/.';
$scope.snippetWithTarget = 'http://angularjs.org/';
}
</script>
<div ng-controller="Ctrl">
...
...
@@ -467,6 +470,15 @@ angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($san
<div ng-bind-html="snippet | linky"></div>
</td>
</tr>
<tr id="linky-target">
<td>linky target</td>
<td>
<pre><div ng-bind-html="snippetWithTarget | linky:'_blank'"><br></div></pre>
</td>
<td>
<div ng-bind-html="snippetWithTarget | linky:'_blank'"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre><div ng-bind="snippet"><br></div></pre></td>
...
...
@@ -499,6 +511,11 @@ angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($san
toBe('new <a href="http://link">http://link</a>.');
expect(using('#escaped-html').binding('snippet')).toBe('new http://link.');
});
it('should work with the target property', function() {
expect(using('#linky-target').binding("snippetWithTarget | linky:'_blank'")).
toBe('<a target="_blank" href="http://angularjs.org/">http://angularjs.org/</a>');
});
</doc:scenario>
</doc:example>
*/
...
...
@@ -506,7 +523,7 @@ angular.module('ngSanitize').filter('linky', function() {
var
LINKY_URL_REGEXP
=
/
((
ftp|https
?)
:
\/\/
|
(
mailto:
)?[
A-Za-z0-9._%+-
]
+@
)\S
*
[^\s\.\;\,\(\)\{\}\<\>]
/
,
MAILTO_REGEXP
=
/^mailto:/
;
return
function
(
text
)
{
return
function
(
text
,
target
)
{
if
(
!
text
)
return
text
;
var
match
;
var
raw
=
text
;
...
...
@@ -515,6 +532,10 @@ angular.module('ngSanitize').filter('linky', function() {
var
writer
=
htmlSanitizeWriter
(
html
);
var
url
;
var
i
;
var
properties
=
{};
if
(
angular
.
isDefined
(
target
))
{
properties
.
target
=
target
;
}
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
];
...
...
@@ -522,7 +543,8 @@ angular.module('ngSanitize').filter('linky', function() {
if
(
match
[
2
]
==
match
[
3
])
url
=
'mailto:'
+
url
;
i
=
match
.
index
;
writer
.
chars
(
raw
.
substr
(
0
,
i
));
writer
.
start
(
'a'
,
{
href
:
url
});
properties
.
href
=
url
;
writer
.
start
(
'a'
,
properties
);
writer
.
chars
(
match
[
0
].
replace
(
MAILTO_REGEXP
,
''
));
writer
.
end
(
'a'
);
raw
=
raw
.
substring
(
i
+
match
[
0
].
length
);
...
...
@@ -532,4 +554,5 @@ angular.module('ngSanitize').filter('linky', function() {
};
});
})(
window
,
window
.
angular
);
h/lib/angular.js
View file @
af61c833
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment