Skip to content

Commit

Permalink
Merge branch 'dev' of git@github.com:AntSYau/ubb_final.git
Browse files Browse the repository at this point in the history
# By Hakim El Hattab (15) and others
# Via GitHub (9) and others
* 'dev' of git@github.com:AntSYau/ubb_final.git: (28 commits)
  Adding missing file to use it properly
  Update package.json for node 12 support
  docs: fix typo
  Tweak to MathJax example
  readme tweak
  rephrased hakimel#2378
  remove available route changes hakimel#2416
  enable url hash for default index.html hakimel#2434 hakimel#2175
  add missing comma to MathJax example in README
  * Mobile Linear Navigation: Fix swipes to navigate linearly
  * Linear Navigation: Fix showing arrows when last slide has vertical children
  first/last slide shortcut now uses shift modified, cmd conflicted with browser back/fwd
  down arrow padding for edge aligned controls
  avoid exception when highlighting empty code blocks
  Notes: Weakly enforce a minimum allocated pacing time per slide
  fix issue where syncSlide would not run/play newly added background content
  new API methods for getting horizontal/vertical slides, force linear navigation for one-dimensional decks
  fix the touch devices issues with the down arrow
  iframe background preload behavior now matches inline iframes + adheres to the new 'preloadIframes' config option
  Notes: Introduce alternate pacing timer, based on total presentation time
  ...

# Conflicts:
#	index.html
  • Loading branch information
Anthony Yau committed Aug 6, 2019
2 parents 9f30b03 + 073d0e3 commit 33c189a
Show file tree
Hide file tree
Showing 11 changed files with 560 additions and 445 deletions.
62 changes: 53 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@ Reveal.initialize({
// speaker view
defaultTiming: 120,
// Specify the total time in seconds that is available to
// present. If this is set to a nonzero value, the pacing
// timer will work out the time available for each slide,
// instead of using the defaultTiming value
totalTime: 0,
// Specify the minimum amount of time you want to allot to
// each slide, if using the totalTime calculation method. If
// the automated time allocation causes slide pacing to fall
// below this threshold, then you will see an alert in the
// speaker notes window
minimumTimePerSlide: 0;
// Enable slide navigation via mouse wheel
mouseWheel: false,
Expand Down Expand Up @@ -629,6 +642,15 @@ Reveal.getProgress(); // (0 == first slide, 1 == last slide)
Reveal.getSlides(); // Array of all slides
Reveal.getTotalSlides(); // Total number of slides
// Returns an array with all horizontal/vertical slides in the deck
Reveal.getHorizontalSlides();
Reveal.getVerticalSlides();
// Checks if the presentation contains two or more
// horizontal/vertical slides
Reveal.hasHorizontalSlides();
Reveal.hasVerticalSlides();
// Returns the speaker notes for the current slide
Reveal.getSlideNotes();
Expand All @@ -640,7 +662,7 @@ Reveal.isPaused();
Reveal.isAutoSliding();
// Returns the top-level DOM element
getRevealElement(); // <div class="reveal">...</div>
Reveal.getRevealElement(); // <div class="reveal">...</div>
```
### Custom Key Bindings
Expand Down Expand Up @@ -778,6 +800,8 @@ Embeds a web page as a slide background that covers 100% of the reveal.js width
</section>
```
Iframes are lazy-loaded when they become visible. If you'd like to preload iframes aehad of time, you can append a `data-preload` attribute to the slide `<section>`. You can also enable preloading globally for all iframes using the `preloadIframes` configuration option.
#### Background Transitions
Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing `backgroundTransition: 'slide'` to the `Reveal.initialize()` call. Alternatively you can set `data-background-transition` on any section with a background to override that specific transition.
Expand Down Expand Up @@ -1065,18 +1089,38 @@ The framework has a built-in postMessage API that can be used when communicating
<window>.postMessage( JSON.stringify({ method: 'slide', args: [ 2 ] }), '*' );
```
#### postMessage Events
When reveal.js runs inside of an iframe it can optionally bubble all of its events to the parent. Bubbled events are stringified JSON with three fields: namespace, eventName and state. Here's how you subscribe to them from the parent window:
```javascript
window.addEventListener( 'message', function( event ) {
var data = JSON.parse( event.data );
if( data.namespace === 'reveal' && data.eventName ==='slidechanged' ) {
if( data.namespace === 'reveal' && data.eventName === 'slidechanged' ) {
// Slide changed, see data.state for slide number
}
} );
```
This cross-window messaging can be toggled on or off using configuration flags.
#### postMessage Callbacks
When you call any method via the postMessage API, reveal.js will dispatch a message with the return value. This is done so that you can call a getter method and see what the result is. Check out this example:
```javascript
<revealWindow>.postMessage( JSON.stringify({ method: 'getTotalSlides' }), '*' );
window.addEventListener( 'message', function( event ) {
var data = JSON.parse( event.data );
// `data.method`` is the method that we invoked
if( data.namespace === 'reveal' && data.eventName === 'callback' && data.method === 'getTotalSlides' ) {
data.result // = the total number of slides
}
} );
```
#### Turning postMessage on/off
This cross-window messaging can be toggled on or off using configuration flags. These are the default values.
```javascript
Reveal.initialize({
Expand Down Expand Up @@ -1208,7 +1252,7 @@ The speaker notes window will also show:
- Current wall-clock time
- (Optionally) a pacing timer which indicates whether the current pace of the presentation is on track for the right timing (shown in green), and if not, whether the presenter should speed up (shown in red) or has the luxury of slowing down (blue).
The pacing timer can be enabled by configuring by the `defaultTiming` parameter in the `Reveal` configuration block, which specifies the number of seconds per slide. 120 can be a reasonable rule of thumb. Timings can also be given per slide `<section>` by setting the `data-timing` attribute. Both values are in numbers of seconds.
The pacing timer can be enabled by configuring the `defaultTiming` parameter in the `Reveal` configuration block, which specifies the number of seconds per slide. 120 can be a reasonable rule of thumb. Alternatively, you can enable the timer by setting `totalTime`, which sets the total length of your presentation (also in seconds). If both values are specified, `totalTime` wins and `defaultTiming` is ignored. Regardless of the baseline timing method, timings can also be given per slide `<section>` by setting the `data-timing` attribute (again, in seconds).
## Server Side Speaker Notes
Expand All @@ -1228,7 +1272,7 @@ Reveal.initialize({
Then:
1. Install [Node.js](http://nodejs.org/) (4.0.0 or later)
1. Install [Node.js](http://nodejs.org/) (9.0.0 or later)
2. Run `npm install`
3. Run `node plugin/notes-server`
Expand All @@ -1237,7 +1281,7 @@ Then:
Plugins should register themselves with reveal.js by calling `Reveal.registerPlugin( 'myPluginID', MyPlugin )`. Registered plugin instances can optionally expose an "init" function that reveal.js will call to initialize them.
When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fullfilled before finshing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that does some asynchronous work before reveal.js can proceed:
When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fulfilled before finshing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that does some asynchronous work before reveal.js can proceed:
```javascript
let MyPlugin = {
Expand All @@ -1248,7 +1292,7 @@ Reveal.addEventListener( 'ready', () => console.log( 'Three seconds later...' )
Reveal.initialize();
```
If the init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence.
Note that reveal.js will *not* wait for init Promise fullfillment if the plugin is loaded as an [async dependency](#dependencies). If the plugin's init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence.
### Retrieving Plugins
Expand Down Expand Up @@ -1411,9 +1455,9 @@ Reveal.initialize({
math: {
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html
config: 'TeX-AMS_HTML-full', // See http://docs.mathjax.org/en/latest/config-files.html
// pass other options into `MathJax.Hub.Config()`
TeX: { Macros: macros }
TeX: { Macros: { RR: "{\\bf R}" } }
},
dependencies: [
Expand Down
22 changes: 15 additions & 7 deletions css/reveal.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ body {
bottom: 12px;
right: 12px;
left: auto;
z-index: 1;
z-index: 11;
color: #000;
pointer-events: none;
font-size: 10px; }
Expand Down Expand Up @@ -312,7 +312,8 @@ body {
transform: rotate(90deg); }
.reveal .controls .navigate-down {
right: 3.2em;
bottom: 0;
bottom: -1.4em;
padding-bottom: 1.4em;
-webkit-transform: translateY(10px);
transform: translateY(10px); }
.reveal .controls .navigate-down .controls-arrow {
Expand Down Expand Up @@ -395,18 +396,18 @@ body {
right: auto; }
.reveal .controls[data-controls-layout="edges"] .navigate-left {
top: 50%;
left: 8px;
left: 0.8em;
margin-top: -1.8em; }
.reveal .controls[data-controls-layout="edges"] .navigate-right {
top: 50%;
right: 8px;
right: 0.8em;
margin-top: -1.8em; }
.reveal .controls[data-controls-layout="edges"] .navigate-up {
top: 8px;
top: 0.8em;
left: 50%;
margin-left: -1.8em; }
.reveal .controls[data-controls-layout="edges"] .navigate-down {
bottom: 8px;
bottom: -0.3em;
left: 50%;
margin-left: -1.8em; } }

Expand Down Expand Up @@ -1453,9 +1454,16 @@ body {
text-align: right;
vertical-align: top; }

.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) {
.reveal .hljs.has-highlights tr:not(.highlight-line) {
opacity: 0.4; }

.reveal .hljs:not(:first-child).fragment {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box; }

/*********************************************
* ROLLING LINKS
*********************************************/
Expand Down
19 changes: 14 additions & 5 deletions css/reveal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ $controlsArrowAngleActive: 36deg;
bottom: $spacing;
right: $spacing;
left: auto;
z-index: 1;
z-index: 11;
color: #000;
pointer-events: none;
font-size: 10px;
Expand Down Expand Up @@ -355,7 +355,8 @@ $controlsArrowAngleActive: 36deg;

.navigate-down {
right: $controlArrowSpacing + $controlArrowSize/2;
bottom: 0;
bottom: -$controlArrowSpacing;
padding-bottom: $controlArrowSpacing;
transform: translateY( 10px );

.controls-arrow {
Expand Down Expand Up @@ -452,7 +453,7 @@ $controlsArrowAngleActive: 36deg;
// Edge aligned controls layout
@media screen and (min-width: 500px) {

$spacing: 8px;
$spacing: 0.8em;

.reveal .controls[data-controls-layout="edges"] {
& {
Expand Down Expand Up @@ -489,7 +490,7 @@ $controlsArrowAngleActive: 36deg;
}

.navigate-down {
bottom: $spacing;
bottom: $spacing - $controlArrowSpacing + 0.3em;
left: 50%;
margin-left: -$controlArrowSize/2;
}
Expand Down Expand Up @@ -1590,10 +1591,18 @@ $controlsArrowAngleActive: 36deg;
vertical-align: top;
}

.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) {
.reveal .hljs.has-highlights tr:not(.highlight-line) {
opacity: 0.4;
}

.reveal .hljs:not(:first-child).fragment {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
}


/*********************************************
* ROLLING LINKS
Expand Down
4 changes: 2 additions & 2 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h2>Iframe Backgrounds</h2>

<section>
<h2>Pretty Code</h2>
<pre><code class="hljs" data-trim data-line-numbers="4,8-11">
<pre><code class="hljs" data-trim data-line-numbers="4|9|4,8-11">
import React, { useState } from 'react';

function Example() {
Expand Down Expand Up @@ -412,7 +412,7 @@ <h1>THE END</h1>
dependencies: [
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true },
{ src: 'plugin/highlight/highlight.js' },
{ src: 'plugin/search/search.js', async: true },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
Expand Down
Loading

0 comments on commit 33c189a

Please sign in to comment.