]> git.lizzy.rs Git - rust.git/blob - util/gh-pages/versions.html
Auto merge of #8040 - xFrednet:6610-known-problems-section-for-pre-expansion, r=camst...
[rust.git] / util / gh-pages / versions.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4     <meta charset="UTF-8"/>
5     <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
7     <title>Clippy lints documentation</title>
8
9     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"/>
10     <style>
11         [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
12     </style>
13 </head>
14 <body>
15     <div class="container" ng-app="clippy" ng-controller="docVersions">
16         <div class="page-header">
17             <h1>Clippy lints documentation</h1>
18         </div>
19
20         <div ng-cloak>
21             <div class="alert alert-info" role="alert" ng-if="loading">
22                 Loading&#x2026;
23             </div>
24             <div class="alert alert-danger" role="alert" ng-if="error">
25                 Error loading versions!<br/>
26                 You can always try to get <a href="master/index.html">the master branch docs</a>.
27             </div>
28
29             <article class="panel panel-default" ng-show="data">
30                 <div class="panel-heading">
31                     <h3 class="panel-title">
32                         Available versions
33                     </h3>
34                 </div>
35
36                 <ul class="list-group">
37                     <a class="list-group-item" ng-repeat="version in data | orderBy:versionOrder:true"
38                        href="./{{version}}/index.html">
39                         {{normalizeVersionDisplay(version)}}
40                     </a>
41                 </ul>
42             </article>
43         </div>
44     </div>
45
46     <a href="https://github.com/rust-lang/rust-clippy">
47         <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"/>
48     </a>
49
50
51     <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.12/angular.min.js"></script>
52     <script>
53         angular.module('clippy', [])
54         .controller('docVersions', function ($scope, $http) {
55             $scope.loading = true;
56
57             $scope.normalizeVersionDisplay = function(v) {
58                 return v.replace(/^v/, '');
59             };
60
61             $scope.normalizeVersion = function(v) {
62                 return v.replace(/^v/, '').replace(/^rust-/, '');
63             };
64
65             $scope.versionOrder = function(v) {
66                 if (v === 'master') { return Infinity; }
67                 if (v === 'stable') { return Number.MAX_VALUE; }
68                 if (v === 'beta') { return Number.MAX_VALUE - 1; }
69
70                 return $scope.normalizeVersion(v)
71                     .split('.')
72                     .reverse()
73                     .reduce(function(acc, val, index) {
74                         return acc + (val * Math.pow(100, index));
75                     }, 0);
76             }
77
78             $http.get('./versions.json')
79             .success(function (data) {
80                 $scope.data = data;
81                 $scope.loading = false;
82             })
83             .error(function (data) {
84                 $scope.error = data;
85                 $scope.loading = false;
86             });
87         })
88         ;
89     </script>
90 </body>
91 </html>