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

Commit 4a88bad

Browse files
committed
Merge branch 'feature/true-2.5.1' into dev
2 parents 8497d9a + cf957fd commit 4a88bad

File tree

16 files changed

+238
-29
lines changed

16 files changed

+238
-29
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ CHANGELOG
33

44
This changelog references the relevant changes and bug fixes.
55

6+
* 2.5.1 (2015-03-05)
7+
* #353 Improve print styles
8+
* #348 #347 Fix errors with image flow in Publications
9+
* #339 Fix error with buttons in main navbar
10+
* #271 Change alt text of main logo
11+
612
* 2.5.0 (2015-01-20)
713
* #325 [CONTRAST] fix contrast in carets
814
* #279 [CONTRAST] fix input placeholders color

assets/examples/gallery.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ The single view mode allows the user to browse through the complete contents of
219219
<div class="row">
220220
<div class="col-sm-12">
221221
<hr>
222-
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
222+
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
223223
<nav class="pull-right">
224224
<ul>
225225
<li><a href="#">Previous</a></li>
@@ -252,7 +252,7 @@ The single view mode allows the user to browse through the complete contents of
252252
<div class="row">
253253
<div class="col-sm-12">
254254
<hr>
255-
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
255+
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
256256
<nav class="pull-right">
257257
<ul>
258258
<li><a href="#">Previous</a></li>

assets/js/print.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/* ==========================================================
2+
* print.js
3+
* Add print preview windows
4+
*
5+
* Author: Yann, yann@antistatique.net
6+
* Date: 2015-02-02
7+
*
8+
* Copyright 2014 Federal Chancellery of Switzerland
9+
* Licensed under MIT
10+
========================================================== */
11+
12+
(function($) {
13+
14+
// Initialization
15+
$.fn.printPreview = function() {
16+
return this;
17+
};
18+
19+
$.printPreview = {
20+
21+
printPreview: function() {
22+
var $body = $('body'),
23+
$container = $('.container-main'),
24+
footnoteLinks = "",
25+
linksIndex = 0;
26+
27+
$body.find('.nav-mobile, .drilldown, .nav-main, .header-separator, .nav-service, .nav-lang, .form-search, .yamm--select, header > div:first-child, footer, .alert, .icon--print, .social-sharing, form, .nav-process, .carousel-indicators, .carousel-control, .breadcrumb, .pagination-container').remove();
28+
$body.addClass('print-preview');
29+
30+
$container.prepend('<div class="row" id="print-settings">'+
31+
'<div class="col-sm-12">'+
32+
'<nav class="pagination-container clearfix">'+
33+
'<span class="pull-left">'+
34+
'<input type="checkbox" id="footnote-links">&nbsp;&nbsp;'+
35+
'<label for="footnote-links">Links as footnotes</label>'+
36+
'</span>'+
37+
'<ul class="pull-right pagination">'+
38+
'<li>'+
39+
'<button id="print-button" title="print" class="btn"><span class="icon icon--print"></span></button>'+
40+
'&nbsp;&nbsp;'+
41+
'<button id="close-button" title="close" class="btn btn-secondary"><span class="icon icon--close"></span></button>'+
42+
'</li>'+
43+
'</ul>'+
44+
'</nav>'+
45+
'</div>'+
46+
'</div>');
47+
48+
$('#print-button').click(function () {
49+
$.printPreview.printProcess();
50+
});
51+
52+
$('#close-button').click(function () {
53+
$.printPreview.printClose();
54+
});
55+
56+
57+
$('a').not('.access-keys a').each(function () {
58+
var target = $(this).attr('href');
59+
target = String(target);
60+
61+
if (target != "undefined" && target.indexOf("http") >= 0) {
62+
linksIndex ++;
63+
footnoteLinks += '<li>'+target+'</li>';
64+
$('<sup class="link-ref">('+linksIndex+')</sup>').insertAfter(this);
65+
}
66+
});
67+
68+
69+
$('#footnote-links').change(function(){
70+
if (this.checked) {
71+
$container.append('<div id="footnote-links-wrapper" class="row footnote-links-wrapper">'+
72+
'<div class="col-sm-12">'+
73+
'<h3>Page Links</h3><hr>'+
74+
'<ol>'+
75+
footnoteLinks+
76+
'</ol>'+
77+
'</div>'+
78+
'</div>');
79+
$body.addClass('print-footnotes');
80+
} else {
81+
$('#footnote-links-wrapper').remove();
82+
$body.removeClass('print-footnotes');
83+
}
84+
});
85+
},
86+
87+
printProcess: function() {
88+
window.print();
89+
},
90+
91+
printClose: function() {
92+
window.location.reload();
93+
}
94+
95+
};
96+
97+
$('a.truc').printPreview();
98+
$(document).bind('keydown', function(e) {
99+
var code = (e.keyCode ? e.keyCode : e.which);
100+
if (code == 80 && !$('body').hasClass('print-preview')) {
101+
$.printPreview.printPreview();
102+
return false;
103+
}
104+
});
105+
106+
// To test print preview mode
107+
// $.printPreview.printPreview();
108+
109+
}) (jQuery);

assets/pages/detail.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="visible-xs visible-sm">
99
<p><a href="#context-sidebar" class="icon icon--before icon--root">Context sidebar</a></p>
1010
</div>
11-
<a href="#" onclick="window.print()" class="icon icon--before icon--print pull-right"></a>
11+
<a href="#" onclick="$.printPreview.printPreview()" class="icon icon--before icon--print pull-right"></a>
1212
<h1 class="text-inline">This is the page title, and it can be really quite long.</h1>
1313
<figure>
1414
<img src="http://placehold.it/588x368" alt="image description">
@@ -165,10 +165,10 @@
165165

166166
<br>
167167

168-
<p><small><a href="#" class="icon icon--before icon--less">Back to Overview</a></small></p>
168+
<p><small><a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a></small></p>
169169

170170
<!-- End Page Link -->
171-
<p><small><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
171+
<p><small class="hidden-print"><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
172172

173173
<div class="social-sharing">
174174
<a href="#" aria-label="Facebook"

assets/pages/homepage-global-nav.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@
262262
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
263263
</p>
264264
<div class="spacer"></div>
265+
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
265266
<figure class="pull-left">
266267
<img src="http://placehold.it/130x81" alt="image description">
267268
</figure>
268-
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
269269
<p>
270270
<small>
271271
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
@@ -278,10 +278,10 @@
278278
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
279279
</p>
280280
<div class="spacer"></div>
281+
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
281282
<figure class="pull-left">
282283
<img src="http://placehold.it/130x81" alt="image description">
283284
</figure>
284-
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
285285
<p>
286286
<small>
287287
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
@@ -294,10 +294,10 @@
294294
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
295295
</p>
296296
<div class="spacer"></div>
297+
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
297298
<figure class="pull-left">
298299
<img src="http://placehold.it/130x81" alt="image description">
299300
</figure>
300-
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
301301
<p>
302302
<small>
303303
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Lorem porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a.

assets/pages/layout.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</div>
128128

129129
<a href="#" class="brand hidden-xs" title="back to home">
130-
<img src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="The Federal Authorities of the Swiss Confederation, www.admin.ch" />
130+
<img src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="back to home" />
131131
<h1>Department of the Environment, Transport, Energy and Communications</h1>
132132
</a>
133133

@@ -668,7 +668,7 @@
668668
</select>
669669
</p>
670670
<hr class="footer-line visible-xs">
671-
<img class="visible-xs" src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="The Federal Authorities of the Swiss Confederation, www.admin.ch" />
671+
<img class="visible-xs" src="../img/logo-CH.svg" onerror="this.onerror=null; this.src='../img/logo-CH.png'" alt="back to home" />
672672
</div>
673673

674674
<address>

assets/pages/publications.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<p><a href="#context-sidebar" class="icon icon--before icon--root">Context sidebar</a></p>
99
</div>
1010
<article>
11-
<a href="#" class="icon icon--before icon--less">Back to Overview</a>
11+
<a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a>
1212
<button type="button" class="btn btn-link pull-right"><span class="icon icon--print"></span></button>
1313
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h1>
1414
<br>
@@ -112,8 +112,8 @@
112112

113113

114114
<p><a href="#" class="icon icon--after icon--external">External link</a></p>
115-
<p><a href="#" class="icon icon--before icon--less">Back to Overview</a></p>
116-
<p><small><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
115+
<p><a href="#" class="icon icon--before icon--less hidden-print">Back to Overview</a></p>
116+
<p><small class="hidden-print"><a href="#" class="icon icon--before icon--power">Back to top</a><span class="text-dimmed">Last edition: 21.03.2014</span></small></p>
117117
</article>
118118

119119
</div>

assets/pages/results.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
{% block content %}
99
<div class="col-sm-12">
10-
<a href="#" onclick="window.print()" class="icon icon--before icon--print pull-right"></a>
10+
<a href="#" onclick="$.printPreview.printPreview()" class="icon icon--before icon--print pull-right"></a>
1111
<h1 class="text-inline">Search</h1>
1212

1313
<br>

assets/sass/components/carousel.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ The carousel consists of various information blocks, each of which contains a la
2828
2929
The carousel component is not totally compliant with accessibility standards. If you need to be compliant, please consider other options for presenting your content.
3030
31+
<br>
32+
<div class="alert alert-warning">
33+
**2.5.1**
34+
35+
- put `<figure>` element after `<h4>` to avoid ungraceful alignment
36+
</div>
37+
3138
```html_example
3239
<div class="row">
3340
<div class="col-sm-6 col-sm-offset-3">
@@ -56,10 +63,10 @@ The carousel component is not totally compliant with accessibility standards. If
5663
<img class="carousel-img" src="http://placehold.it/588x331">
5764
</p>
5865
<div class="spacer"></div>
66+
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
5967
<figure class="pull-left">
6068
<img src="http://placehold.it/130x81" alt="image description">
6169
</figure>
62-
<h4><a href="#">Strassenbau in Nepal 1: ein Weg aus der Armut</a></h4>
6370
<p>
6471
<small>
6572
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
@@ -72,10 +79,10 @@ The carousel component is not totally compliant with accessibility standards. If
7279
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
7380
</p>
7481
<div class="spacer"></div>
82+
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
7583
<figure class="pull-left">
7684
<img src="http://placehold.it/130x81" alt="image description">
7785
</figure>
78-
<h4><a href="#">Strassenbau in Nepal 2: ein Weg aus der Armut</a></h4>
7986
<p>
8087
<small>
8188
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae.
@@ -88,10 +95,10 @@ The carousel component is not totally compliant with accessibility standards. If
8895
<img class="carousel-img" src="http://placehold.it/588x331" alt="image description">
8996
</p>
9097
<div class="spacer"></div>
98+
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
9199
<figure class="pull-left">
92100
<img src="http://placehold.it/130x81" alt="image description">
93101
</figure>
94-
<h4><a href="#">Strassenbau in Nepal 3: ein Weg aus der Armut</a></h4>
95102
<p>
96103
<small>
97104
In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a. Lorem porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a.

assets/sass/components/list-group.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,11 @@ The elements list is a very generic element that groups content elements in a li
148148
font-size: 14px;
149149
margin-bottom: 0;
150150
a, p {font-size: 14px;}
151+
&:after {
152+
content: '\00a0';
153+
display: block;
154+
height: 0px;
155+
overflow: hidden;
156+
clear: both;
157+
}
151158
}

0 commit comments

Comments
 (0)