Update Angular to 1.2.0 RC2
This commit is contained in:
parent
7416269494
commit
0d3a40980e
184 changed files with 17993 additions and 21133 deletions
67
lib/angular/docs/js/docs.js
vendored
67
lib/angular/docs/js/docs.js
vendored
|
@ -4,61 +4,11 @@ var docsApp = {
|
|||
serviceFactory: {}
|
||||
};
|
||||
|
||||
docsApp.controller.DocsVersionsCtrl = ['$scope', '$window', 'NG_VERSIONS', function($scope, $window, NG_VERSIONS) {
|
||||
$scope.versions = expandVersions(NG_VERSIONS);
|
||||
$scope.version = ($scope.version || angular.version.full).match(/^([\d\.]+\d+)/)[1]; //match only the number
|
||||
|
||||
$scope.jumpToDocsVersion = function(value) {
|
||||
var isLastStable,
|
||||
version,
|
||||
versions = $scope.versions;
|
||||
for(var i=versions.length-1;i>=0;i--) {
|
||||
var v = versions[i];
|
||||
if(v.version == value) {
|
||||
var next = versions[i - 1];
|
||||
isLastStable = v.stable && (!next || next && !next.stable);
|
||||
version = v;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
if(version && version.version >= '1.0.0') {
|
||||
//the older versions have a different path to the docs within their repo directory
|
||||
var docsPath = version.version < '1.0.2' ? 'docs-' + version.version : 'docs';
|
||||
|
||||
//the last stable version should redirect to docs.angularjs.org instead of code.angularjs.org
|
||||
var url = 'http://' +
|
||||
(isLastStable ?
|
||||
'docs.angularjs.org' :
|
||||
'code.angularjs.org/' + version.version + '/' + docsPath);
|
||||
|
||||
$window.location = url;
|
||||
}
|
||||
};
|
||||
|
||||
function expandVersions(angularVersions) {
|
||||
var unstableVersionStart = 0;
|
||||
angularVersions.forEach(function(version) {
|
||||
var split = version.split('.');
|
||||
unstableVersionStart = split[1] % 2 == 1 ?
|
||||
Math.max(unstableVersionStart, parseInt(split[0] + '' + split[1])) :
|
||||
unstableVersionStart;
|
||||
});
|
||||
|
||||
var versions = [];
|
||||
for(var i=angularVersions.length-1;i>=0;i--) {
|
||||
var version = angularVersions[i];
|
||||
var split = version.split('.');
|
||||
var stable = parseInt(split[0] + '' + split[1]) < unstableVersionStart;
|
||||
versions.push({
|
||||
version : version,
|
||||
stable : stable,
|
||||
title : 'AngularJS - v' + version,
|
||||
group : (stable ? 'Stable' : 'Unstable')
|
||||
});
|
||||
};
|
||||
|
||||
return versions;
|
||||
docsApp.controller.DocsVersionsCtrl = ['$scope', '$window', 'NG_VERSIONS', 'NG_VERSION', function($scope, $window, NG_VERSIONS, NG_VERSION) {
|
||||
$scope.docs_versions = NG_VERSIONS;
|
||||
$scope.docs_version = NG_VERSIONS[0];
|
||||
$scope.jumpToDocsVersion = function(version) {
|
||||
$window.location = version.url;
|
||||
};
|
||||
}];
|
||||
|
||||
|
@ -109,6 +59,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) {
|
||||
|
@ -122,7 +74,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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue