This repository was archived by the owner on Nov 10, 2020. It is now read-only.
File tree 7 files changed +98
-24
lines changed
7 files changed +98
-24
lines changed Original file line number Diff line number Diff line change 77
77
78
78
body .home {
79
79
#header {
80
- height : 235 px ;
80
+ height : 275 px ;
81
81
82
82
h1 {
83
83
font-size : 60px ;
@@ -89,6 +89,19 @@ body.home {
89
89
font-size : 20px ;
90
90
display : block ;
91
91
}
92
+
93
+ .dropdown {
94
+ margin-top : 12px ;
95
+ button {
96
+ font-size : 17px ;
97
+ }
98
+ .dropdown-menu {
99
+ left :41% ;
100
+ }
101
+ a {
102
+ color : #333 ;
103
+ }
104
+ }
92
105
}
93
106
}
94
107
@@ -173,13 +186,19 @@ body.home {
173
186
.select2-chosen , .select2-choice > span :first-child {
174
187
padding-top : 7px ;
175
188
}
176
- .input-group .form-control-feedback {
189
+ .input .form-control-feedback , .input -group .form-control-feedback {
177
190
top : 0 ;
178
191
}
179
- .input-group-lg .form-control-feedback {
192
+ .input-lg .form-control-feedback , .input- group-lg .form-control-feedback {
180
193
top : 7px ;
181
194
right : 7px ;
182
195
}
196
+ #home-select .col-xs-3 {
197
+ padding-right : 5px ;
198
+ }
199
+ #home-search .col-xs-9 {
200
+ padding-left : 3px ;
201
+ }
183
202
184
203
#wrapper .select2-arrow { display : none ; }
185
204
@@ -192,6 +211,20 @@ body.home {
192
211
margin : 35px 0 0 ;
193
212
width : 100% ;
194
213
}
214
+
215
+ .dropdown {
216
+ margin-top : 8px ;
217
+ font-weight : normal ;
218
+ font-size : 14px ;
219
+
220
+ .btn-default {
221
+ background : transparent ;
222
+ }
223
+ }
224
+
225
+ #select-container {
226
+ width : 100% ;
227
+ }
195
228
196
229
#accordion {
197
230
display : none ;
Original file line number Diff line number Diff line change @@ -125,10 +125,15 @@ $(function() {
125
125
if ( shouldHideInherited ) hideInherited ( true ) ;
126
126
}
127
127
128
- // revise link to alternate version
128
+ // revise links to alternate version
129
+ $ ( '.dropdown-menu a' ) . each ( function ( i , item ) {
130
+ item . href = ( item . href + location . href ) . replace ( / ( v [ . a - z 0 - 9 ] + \/ ) .+ ?( \/ v [ . a - z 0 - 9 ] + \/ | $ ) / , '$1' )
131
+ } ) ;
132
+ /*
129
133
$('#version a').each(function(i, item) {
130
134
item.href = (item.href + location.href).replace(/(v[.a-z0-9]+\/).+?(\/v[.a-z0-9]+\/|$)/, '$1');
131
135
});
136
+ */
132
137
133
138
// highlight key parts of identifiers
134
139
$ ( '.toggle-link' ) . each ( function ( i , link ) {
Original file line number Diff line number Diff line change
1
+ path,name,note
2
+ /v3.0/,Swift 3.0,swift/master
3
+ /v2.2/,Swift 2.2,Xcode 7.3 beta
4
+ /v2.1/,Swift 2.1,Xcode 7.2
5
+ /v1.2/,Swift 1.2,Xcode 6.3+
Original file line number Diff line number Diff line change 1
- {% capture homeUrl %}{% if page.url contains 'swift-2' %}/swift-2{% endif %}/{% endcapture %}
1
+ {% capture homeUrl %}{% if page.url contains 'swift-2' %}/swift-2{% endif %}/{% endcapture %}
2
+ {% assign current = 'Swift 2.2 (Xcode 7.3 beta)' %}
3
+ {% for version in site.data.versions %}
4
+ {% if page.url contains version.path %}
5
+ {% capture current %}{{ version.name }} ({{ version.note }}){% endcapture %}
6
+ {% endif %}
7
+ {% endfor %}
8
+
2
9
< nav class ="navbar navbar-default " role ="navigation " id ="navbar ">
3
10
< div class ="container-fluid ">
4
11
<!-- Brand and toggle get grouped for better mobile display -->
@@ -41,18 +48,19 @@ <h1><a href="{{ homeUrl }}">{{ site.title }}</a></h1>
41
48
< input type ="hidden " class ="form-control select2 ">
42
49
< span class ="glyphicon glyphicon-search form-control-feedback "> </ span >
43
50
</ div >
44
- {% endif %}
45
- </ div >
46
- </ div >
51
+
52
+ < div class ="dropdown ">
53
+ < button class ="btn btn-default dropdown-toggle " type ="button " id ="versionMenu " data-toggle ="dropdown " aria-haspopup ="true " aria-expanded ="true ">
54
+ {{ current }}
55
+ < span class ="caret "> </ span >
56
+ </ button >
57
+ < ul class ="dropdown-menu " aria-labelledby ="versionMenu ">
58
+ {% for version in site.data.versions %}
59
+ < li > < a href ="{{ version.path }} "> {{ version.name }} ({{ version.note }})</ a > </ li >
60
+ {% endfor %}
61
+ </ ul >
62
+ </ div >
47
63
48
- {% unless page.url contains "/news" or page.noversions %}
49
- < div id ="version ">
50
- < div class ="container ">
51
- {% if page.url contains "/v1.2" %}
52
- Swift version: < strong > 1.2</ strong > | < a href ="/v2.1/ "> 2.1</ a >
53
- {% else %}
54
- Swift version: < a href ="/v1.2/ "> 1.2</ a > | < strong > 2.1</ strong >
55
64
{% endif %}
56
65
</ div >
57
- </ div >
58
- {% endunless %}
66
+ </ div >
Original file line number Diff line number Diff line change
1
+ {% if page.isdoc %}
2
+ {% assign current = 'Swift 2.2 (Xcode 7.3 beta)' %}
3
+ {% for version in site.data.versions %}
4
+ {% if page.url contains version.path %}
5
+ {% capture current %}{{ version.name }} ({{ version.note }}){% endcapture %}
6
+ {% endif %}
7
+ {% endfor %}
1
8
< div id ="intranav ">
2
9
< h4 > On this page</ h4 >
3
10
< ul id ="chapters ">
@@ -7,4 +14,18 @@ <h4>On this page</h4>
7
14
< h4 > Display</ h4 >
8
15
< ul id ="display ">
9
16
</ ul >
10
- </ div >
17
+
18
+ < h4 > Swift Version</ h4 >
19
+ < div class ="dropdown ">
20
+ < button class ="btn btn-default dropdown-toggle " type ="button " id ="versionMenu " data-toggle ="dropdown " aria-haspopup ="true " aria-expanded ="true ">
21
+ {{ current }}
22
+ < span class ="caret "> </ span >
23
+ </ button >
24
+ < ul class ="dropdown-menu " aria-labelledby ="versionMenu ">
25
+ {% for version in site.data.versions %}
26
+ < li > < a href ="{{ version.path }} "> {{ version.name }} ({{ version.note }})</ a > </ li >
27
+ {% endfor %}
28
+ </ ul >
29
+ </ div >
30
+ </ div >
31
+ {% endif %}
Original file line number Diff line number Diff line change 1
1
---
2
2
layout: wrapper
3
-
3
+ isdoc: true
4
4
---
5
5
< header >
6
6
< h2 > {{ page.title }}</ h2 >
Original file line number Diff line number Diff line change 12
12
13
13
< div id ="fixed-sidebar " data-spy ="">
14
14
15
- < div class ="form-group input-group has-feedback ">
16
- < input type ="hidden " class ="form-control select2 ">
17
- < span class ="glyphicon glyphicon-search form-control-feedback "> </ span >
18
- </ div >
19
-
15
+ < div class ="form-group ">
16
+ < div class ="input-group has-feedback " id ="select-container ">
17
+ < input type ="hidden " class ="form-control select2 ">
18
+ < span class ="glyphicon glyphicon-search form-control-feedback "> </ span >
19
+ </ div >
20
+ </ div >
21
+
20
22
{% include sidebar.html %}
21
23
22
24
</ div >
You can’t perform that action at this time.
0 commit comments