Permalink
Comparing changes
Open a pull request
- 3 commits
- 6 files changed
- 0 commit comments
- 1 contributor
Commits on Oct 17, 2016
Internationalized Domain Urls, for example urls with Umlaut (Ä, Ö, Ü) cause infinite digest in Edge 38.14393.0.0 because lastIndexOf doesn't work correctly in this version when the search string is the same as the haystack string. The patch uses an implementation based on core.js: https://github.com/zloirock/core-js/blob/v2.4.1/modules/es6.string.starts-with.js#L16 Edge Bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9271625/ Fixes #15217 PR #15235
Unified
Split
Showing
with
74 additions
and 8 deletions.
- +7 −0 docs/app/src/docs.js
- +2 −3 docs/app/src/examples.js
- +5 −2 docs/config/index.js
- +49 −0 docs/config/services/deployments/plnkr.js
- +2 −2 src/ng/location.js
- +9 −1 test/ng/locationSpec.js
| @@ -23,6 +23,11 @@ angular.module('DocsController', []) | ||
| $scope.$on('$includeContentLoaded', function() { | ||
| var pagePath = $scope.currentPage ? $scope.currentPage.path : $location.path(); | ||
| $window._gaq.push(['_trackPageview', pagePath]); | ||
| $scope.loading = false; | ||
| }); | ||
|
|
||
| $scope.$on('$includeContentError', function() { | ||
| $scope.loading = false; | ||
| }); | ||
|
|
||
| $scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) { | ||
| @@ -31,6 +36,8 @@ angular.module('DocsController', []) | ||
|
|
||
| var currentPage = $scope.currentPage = NG_PAGES[path]; | ||
|
|
||
| $scope.loading = true; | ||
|
|
||
| if (currentPage) { | ||
| $scope.partialPath = 'partials/' + path + '.html'; | ||
| $scope.currentArea = NG_NAVIGATION[currentPage.area]; | ||
| @@ -181,9 +181,8 @@ angular.module('examples', []) | ||
| filePromises.push($http.get(exampleFolder + '/' + filename, { transformResponse: [] }) | ||
| .then(function(response) { | ||
|
|
||
| // The manifests provide the production index file but Plunkr wants | ||
| // a straight index.html | ||
| if (filename === 'index-production.html') { | ||
| // Plunkr needs an index file that's simply named index.html | ||
| if (filename === 'index-plnkr.html') { | ||
| filename = 'index.html'; | ||
| } | ||
|
|
||
| @@ -23,6 +23,7 @@ module.exports = new Package('angularjs', [ | ||
| .factory(require('./services/deployments/default')) | ||
| .factory(require('./services/deployments/jquery')) | ||
| .factory(require('./services/deployments/production')) | ||
| .factory(require('./services/deployments/plnkr')) | ||
|
|
||
| .factory(require('./inline-tag-defs/type')) | ||
|
|
||
| @@ -150,7 +151,8 @@ module.exports = new Package('angularjs', [ | ||
| generateProtractorTestsProcessor, | ||
| generateExamplesProcessor, | ||
| debugDeployment, defaultDeployment, | ||
| jqueryDeployment, productionDeployment) { | ||
| jqueryDeployment, productionDeployment, | ||
| plnkrDeployment) { | ||
|
|
||
| generateIndexPagesProcessor.deployments = [ | ||
| debugDeployment, | ||
| @@ -170,7 +172,8 @@ module.exports = new Package('angularjs', [ | ||
| debugDeployment, | ||
| defaultDeployment, | ||
| jqueryDeployment, | ||
| productionDeployment | ||
| productionDeployment, | ||
| plnkrDeployment | ||
| ]; | ||
| }) | ||
|
|
||
| @@ -0,0 +1,49 @@ | ||
| 'use strict'; | ||
| // Special deployment that is only used for the examples on plnkr. | ||
| // While the embedded examples use the Angular files relative the docs folder, | ||
| // plnkr uses the CDN urls, and needs to switch between Google CDN for tagged versions | ||
| // and the code.angularjs.org server for the snapshot (master) version. | ||
|
|
||
| var versionInfo = require('../../../../lib/versions/version-info'); | ||
| var isSnapshot = versionInfo.currentVersion.isSnapshot; | ||
|
|
||
| var cdnUrl = isSnapshot ? | ||
| '//code.angularjs.org/snapshot' : | ||
| '//ajax.googleapis.com/ajax/libs/angularjs/' + versionInfo.cdnVersion; | ||
|
|
||
| module.exports = function plnkrDeployment(getVersion) { | ||
| return { | ||
| name: 'plnkr', | ||
| examples: { | ||
| commonFiles: { | ||
| scripts: [cdnUrl + '/angular.min.js'] | ||
| }, | ||
| dependencyPath: cdnUrl + '/' | ||
| }, | ||
| scripts: [ | ||
| cdnUrl + '/angular.min.js', | ||
| cdnUrl + '/angular-resource.min.js', | ||
| cdnUrl + '/angular-route.min.js', | ||
| cdnUrl + '/angular-cookies.min.js', | ||
| cdnUrl + '/angular-sanitize.min.js', | ||
| cdnUrl + '/angular-touch.min.js', | ||
| cdnUrl + '/angular-animate.min.js', | ||
| 'components/marked-' + getVersion('marked', 'node_modules', 'package.json') + '/lib/marked.js', | ||
| 'js/angular-bootstrap/dropdown-toggle.min.js', | ||
| 'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js', | ||
| 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', | ||
| 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', | ||
| 'js/versions-data.js', | ||
| 'js/pages-data.js', | ||
| 'js/nav-data.js', | ||
| 'js/docs.min.js' | ||
| ], | ||
| stylesheets: [ | ||
| 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css', | ||
| 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', | ||
| 'css/prettify-theme.css', | ||
| 'css/docs.css', | ||
| 'css/animations.css' | ||
| ] | ||
| }; | ||
| }; |
| @@ -48,8 +48,8 @@ function parseAppUrl(relativeUrl, locationObj) { | ||
| } | ||
| } | ||
|
|
||
| function startsWith(haystack, needle) { | ||
| return haystack.lastIndexOf(needle, 0) === 0; | ||
| function startsWith(str, search) { | ||
| return str.slice(0, search.length) === search; | ||
| } | ||
|
|
||
| /** | ||
| @@ -2428,10 +2428,11 @@ describe('$location', function() { | ||
|
|
||
|
|
||
| describe('LocationHtml5Url', function() { | ||
| var locationUrl, locationIndexUrl; | ||
| var locationUrl, locationUmlautUrl, locationIndexUrl; | ||
|
|
||
| beforeEach(function() { | ||
| locationUrl = new LocationHtml5Url('http://server/pre/', 'http://server/pre/', 'http://server/pre/path'); | ||
| locationUmlautUrl = new LocationHtml5Url('http://särver/pre/', 'http://särver/pre/', 'http://särver/pre/path'); | ||
| locationIndexUrl = new LocationHtml5Url('http://server/pre/index.html', 'http://server/pre/', 'http://server/pre/path'); | ||
| }); | ||
|
|
||
| @@ -2443,6 +2444,13 @@ describe('$location', function() { | ||
| // Note: relies on the previous state! | ||
| expect(parseLinkAndReturn(locationUrl, 'someIgnoredAbsoluteHref', '#test')).toEqual('http://server/pre/otherPath#test'); | ||
|
|
||
| expect(parseLinkAndReturn(locationUmlautUrl, 'http://other')).toEqual(undefined); | ||
| expect(parseLinkAndReturn(locationUmlautUrl, 'http://särver/pre')).toEqual('http://särver/pre/'); | ||
| expect(parseLinkAndReturn(locationUmlautUrl, 'http://särver/pre/')).toEqual('http://särver/pre/'); | ||
| expect(parseLinkAndReturn(locationUmlautUrl, 'http://särver/pre/otherPath')).toEqual('http://särver/pre/otherPath'); | ||
| // Note: relies on the previous state! | ||
| expect(parseLinkAndReturn(locationUmlautUrl, 'someIgnoredAbsoluteHref', '#test')).toEqual('http://särver/pre/otherPath#test'); | ||
|
|
||
| expect(parseLinkAndReturn(locationIndexUrl, 'http://server/pre')).toEqual('http://server/pre/'); | ||
| expect(parseLinkAndReturn(locationIndexUrl, 'http://server/pre/')).toEqual('http://server/pre/'); | ||
| expect(parseLinkAndReturn(locationIndexUrl, 'http://server/pre/otherPath')).toEqual('http://server/pre/otherPath'); | ||