Fix slide export pdf styles not applied issue and add shiv and shim for IE

This commit is contained in:
Wu Cheng-Han 2016-10-29 23:35:10 +08:00
parent a8bce53c47
commit 70d2fa388e
2 changed files with 28 additions and 4 deletions

View file

@ -309,3 +309,15 @@ html, body {
.reveal .controls {
position: absolute;
}
.print-pdf .container {
position: relative;
}
.print-pdf .container.hidescrollbar {
right: 0;
}
.print-pdf .footer {
display: none;
}

View file

@ -40,10 +40,22 @@
<link rel="stylesheet" href="<%- url %>/css/site.css">
<link rel="stylesheet" href="<%- url %>/css/slide.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="<%- url %>/vendor/reveal.js/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = '<%- url %>/vendor/reveal.js/' + (window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css');
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" integrity="sha256-3Jy/GbSLrg0o9y5Z5n1uw0qxZECH7C6OQpVBgNFYa0g=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js" integrity="sha256-g6iAfvZp+nDQ2TdTR/VVKJf3bGro4ub5fvWSWVRi2NE=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js" integrity="sha256-8E4Is26QH0bD52WoQpcB+R/tcWQtpzlCojrybUd7Mxo=" crossorigin="anonymous"></script>
<![endif]-->
</head>
<body>
<div class="container">