Просмотр исходного кода

Merge pull request #97 from weseek/fix/96-presentation

Fix/96 presentation
Yuki Takei 8 лет назад
Родитель
Сommit
9d1d841179

+ 1 - 0
config/webpack.common.js

@@ -100,6 +100,7 @@ module.exports = function (options) {
       new webpack.ProvidePlugin({
         jQuery: "jquery",
         $: "jquery",
+        hljs: "reveal.js/plugin/highlight/highlight",
       }),
 
       // omit moment/locale/*.js

+ 18 - 0
lib/views/page_presentation.html

@@ -6,6 +6,17 @@
     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
 
+    <!-- polyfills for IE11 -->
+    <script>
+      var userAgent = window.navigator.userAgent.toLowerCase();
+      if (userAgent.indexOf('msie') != -1 || userAgent.indexOf('trident') != -1) {
+        var scriptElement = document.createElement('script');
+        scriptElement.src = 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js';
+        var headElement = document.getElementsByTagName('head')[0];
+        headElement.appendChild(scriptElement);
+      }
+    </script>
+
     <!-- jQuery -->
     <script src="//cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
 
@@ -20,6 +31,13 @@
     <script src="{{ webpack_asset('legacy-presentation').js }}" defer></script>
 
     <title>{{ path|path2name }} | {{ path }}</title>
+
+    <!-- Google Fonts -->
+    <link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
+
+    <style>
+      {{ customCss() }}
+    </style>
   </head>
   <body>
     <div class="reveal">

+ 4 - 1
resource/css/crowi-reveal.scss

@@ -1,7 +1,10 @@
+// import crowi variable
+@import 'utilities';
+
 .reveal {
   font-size: 32px;
   section * {
-    font-family: "Lucida Grande", "Hiragino Kaku Gothic Pro W3", Meiryo, san-serif;
+    font-family: $font-family-sans-serif !important;
   }
 
   .slides > section {

+ 7 - 0
resource/js/legacy/crowi-presentation.js

@@ -17,6 +17,9 @@ Reveal.initialize({
   center: true,
   transition: 'slide',
 
+  //// This specification method can't be used
+  ////   sice deleting symlink prevented `src` from being resolved -- 2017.06.15 Yuki Takei
+  //
   // Optional libraries used to extend on reveal.js
   // dependencies: [
   //   { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
@@ -35,6 +38,10 @@ require.ensure([], () => {
   require('reveal.js/plugin/highlight/highlight.js');
   require('reveal.js/plugin/zoom-js/zoom.js');
   require('reveal.js/plugin/notes/notes.js');
+
+  // fix https://github.com/weseek/crowi-plus/issues/96
+  Reveal.slide(0,0);
+  Reveal.sync();
 })
 
 Reveal.addEventListener('ready', function(event) {