Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/components/angular-bootstrap/bootstrap-prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ directive.prettyprint = ['reindentCode', function(reindentCode) {
//ensure that angular won't compile {{ curly }} values
html = html.replace(/\{\{/g, '<span>{{</span>')
.replace(/\}\}/g, '<span>}}</span>');
element.html(window.prettyPrintOne(reindentCode(html), undefined, true));
if (window.RUNNING_IN_NG_TEST_RUNNER) {
element.html(html);
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this carriage return before the else normal style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

element.html(window.prettyPrintOne(reindentCode(html), undefined, true));
}
}
};
}];
Expand Down
23 changes: 16 additions & 7 deletions docs/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
// we can't add css/js the usual way, because some browsers (FF) eagerly prefetch resources
// before the base attribute is added, causing 404 and terribly slow loading of the docs app.
(function() {
if (window.name.indexOf('NG_DEFER_BOOTSTRAP!') == 0) {
//TODO(i): super ugly hack to temporarily speed up our e2e tests until we move to protractor + extracted examples
window.RUNNING_IN_NG_TEST_RUNNER = true;
}

var indexFile = (location.pathname.match(/\/(index[^\.]*\.html)/) || ['', ''])[1],
rUrl = /(#!\/|api|guide|misc|tutorial|cookbook|error|index[^\.]*\.html).*$/,
baseUrl = location.href.replace(rUrl, indexFile),
Expand Down Expand Up @@ -49,8 +54,10 @@
addTag('script', {src: path('angular-animate.js') }, sync);
addTag('script', {src: 'components/angular-bootstrap.js' }, sync);
addTag('script', {src: 'components/angular-bootstrap-prettify.js' }, sync);
addTag('script', {src: 'components/google-code-prettify.js' }, sync);
addTag('script', {src: 'components/' + (debug ? 'lunr.js' : 'lunr.min.js') }, sync);
if (!window.RUNNING_IN_NG_TEST_RUNNER) {
addTag('script', {src: 'components/google-code-prettify.js' }, sync);
addTag('script', {src: 'components/' + (debug ? 'lunr.js' : 'lunr.min.js') }, sync);
}
addTag('script', {src: 'components/marked.js' }, sync);
addTag('script', {src: 'docs-data.js'}, sync);
addTag('script', {src: 'js/docs.js'}, sync);
Expand Down Expand Up @@ -112,11 +119,13 @@
_gaq.push(['_setAccount', 'UA-8594346-3']);
_gaq.push(['_setDomainName', '.angularjs.org']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
if (!window.RUNNING_IN_NG_TEST_RUNNER) {
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
}
</script>
</head>

Expand Down
7 changes: 6 additions & 1 deletion docs/src/templates/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ docsApp.controller.DocsNavigationCtrl = ['$scope', '$location', 'docsSearch', fu

docsApp.serviceFactory.lunrSearch = function() {
return function(properties) {
if (window.RUNNING_IN_NG_TEST_RUNNER) return null;

var engine = lunr(properties);
return {
store : function(values) {
Expand All @@ -122,7 +124,10 @@ docsApp.serviceFactory.lunrSearch = function() {
};

docsApp.serviceFactory.docsSearch = ['$rootScope','lunrSearch', 'NG_PAGES',
function($rootScope, lunrSearch, NG_PAGES) {
function($rootScope, lunrSearch, NG_PAGES) {
if (window.RUNNING_IN_NG_TEST_RUNNER) {
return null;
}

var index = lunrSearch(function() {
this.ref('id');
Expand Down
14 changes: 8 additions & 6 deletions src/auto/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ function annotate(fn) {
if (typeof fn == 'function') {
if (!($inject = fn.$inject)) {
$inject = [];
fnText = fn.toString().replace(STRIP_COMMENTS, '');
argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
arg.replace(FN_ARG, function(all, underscore, name){
$inject.push(name);
if (fn.length) {
fnText = fn.toString().replace(STRIP_COMMENTS, '');
argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
arg.replace(FN_ARG, function(all, underscore, name){
$inject.push(name);
});
});
});
}
fn.$inject = $inject;
}
} else if (isArray(fn)) {
Expand Down