Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7505d12

Browse files
thorn0petebacondarwin
authored andcommittedNov 23, 2014
chore(docs): regroup version selector options into major branches and latest
Before this change we grouped by the discontinued stable/unstable distinction. Closes #10053
1 parent 7044e55 commit 7505d12

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed
 

‎docs/app/src/versions.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
"use strict";
2+
13
angular.module('versions', [])
24

35
.controller('DocsVersionsCtrl', ['$scope', '$location', '$window', 'NG_VERSIONS', function($scope, $location, $window, NG_VERSIONS) {
46
$scope.docs_version = NG_VERSIONS[0];
7+
$scope.docs_versions = NG_VERSIONS;
58

69
for(var i=0, minor = NaN; i < NG_VERSIONS.length; i++) {
710
var version = NG_VERSIONS[i];
@@ -13,9 +16,8 @@ angular.module('versions', [])
1316
minor = version.minor;
1417
}
1518

16-
$scope.docs_versions = NG_VERSIONS;
1719
$scope.getGroupName = function(v) {
18-
return v.isLatest ? 'Latest' : (v.isStable ? 'Stable' : 'Unstable');
20+
return v.isLatest ? 'Latest' : ('v' + v.major + '.' + v.minor + '.x');
1921
};
2022

2123
$scope.jumpToDocsVersion = function(version) {

‎lib/versions/version-info.js

-11
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@ var getTaggedVersion = function() {
9191
return null;
9292
};
9393

94-
/**
95-
* Stable versions have an even minor version and have no prerelease
96-
* @param {SemVer} version The version to test
97-
* @return {Boolean} True if the version is stable
98-
*/
99-
var isStable = function(version) {
100-
return semver.satisfies(version, '1.0 || 1.2') && version.prerelease.length === 0;
101-
};
102-
10394
/**
10495
* Get a collection of all the previous versions sorted by semantic version
10596
* @return {Array.<SemVer>} The collection of previous versions
@@ -119,8 +110,6 @@ var getPreviousVersions = function() {
119110
})
120111
.filter()
121112
.map(function(version) {
122-
version.isStable = isStable(version);
123-
124113
version.docsUrl = 'http://code.angularjs.org/' + version.version + '/docs';
125114
// Versions before 1.0.2 had a different docs folder name
126115
if ( version.major < 1 || (version.major === 1 && version.minor === 0 && version.dot < 2 ) ) {

0 commit comments

Comments
 (0)
This repository has been archived.