mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-09-20 11:31:31 +02:00
Compare commits
218 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9da952fea3 | ||
|
7285653b01 | ||
|
da949c33e0 | ||
|
55dceaaa0a | ||
|
08fb6cb2f9 | ||
|
8b8cc607d4 | ||
|
4068c5221d | ||
|
e6069caa86 | ||
|
552525c7a5 | ||
|
9a9ce672b7 | ||
|
bc62963c8f | ||
|
65bd155c34 | ||
|
fdb03b4f10 | ||
|
78dfbf5202 | ||
|
d4e04b82dc | ||
|
f2097417da | ||
|
13da34cc6b | ||
|
d52eb599d1 | ||
|
8ad633e4f3 | ||
|
3330c2a764 | ||
|
dd9fa3e22b | ||
|
31438c88ba | ||
|
3d2549d4f4 | ||
|
f1a416d07c | ||
|
599bef5fdf | ||
|
f7b612b1e4 | ||
|
0eba619c1a | ||
|
b314cf7b27 | ||
|
69bf9b51ec | ||
|
2be89c3772 | ||
|
c7595b29a9 | ||
|
6ca071cd3a | ||
|
740f472ce2 | ||
|
cb9e507cd4 | ||
|
3be84bcbe3 | ||
|
75845a92c3 | ||
|
544020bb96 | ||
|
c8b46050a0 | ||
|
e947f0f216 | ||
|
b46fd8dd70 | ||
|
adbf36ad47 | ||
|
7730f2bab5 | ||
|
d41a5ca87f | ||
|
0fcff33a61 | ||
|
0fb343f5bf | ||
|
3427561b64 | ||
|
ef82645589 | ||
|
ead723bc1c | ||
|
c33aa66666 | ||
|
2faae3d95b | ||
|
60a74ebfa3 | ||
|
08808abf04 | ||
|
ffd8ccbffa | ||
|
0ffbe8d09c | ||
|
9d0ac52780 | ||
|
8550186afc | ||
|
b4e2c97d0c | ||
|
e0dccd85be | ||
|
85c2a0a3c1 | ||
|
bdb46060b3 | ||
|
c4d7b1b93f | ||
|
f31644cca8 | ||
|
23bcd1eb1f | ||
|
705d5a012c | ||
|
3a8bcb174a | ||
|
0069e3ad14 | ||
|
5eff8902ff | ||
|
3653ad5b19 | ||
|
150cb81405 | ||
|
a119c83f86 | ||
|
e7e941b663 | ||
|
6afec76bf0 | ||
|
4b0fe47bb6 | ||
|
efbb31cf29 | ||
|
1774de2113 | ||
|
2cdd1afe85 | ||
|
492a094955 | ||
|
198821f52b | ||
|
d098385103 | ||
|
4def7f116c | ||
|
83ee2eb00e | ||
|
d6b8e4a246 | ||
|
ec72e8cbc7 | ||
|
e1b11e737e | ||
|
f6445a04a0 | ||
|
c51ab74d72 | ||
|
7da98d8110 | ||
|
d4e6fa12bf | ||
|
778969c000 | ||
|
f1dd807f66 | ||
|
06078f987f | ||
|
dda885b71a | ||
|
7b63cda19d | ||
|
fcf91ec261 | ||
|
89cc3f3a29 | ||
|
080ae79b54 | ||
|
d844195be1 | ||
|
6cf5269bfc | ||
|
8cb3c279b0 | ||
|
f92f2fdea6 | ||
|
a87ce95794 | ||
|
7aa93af0ca | ||
|
28198b2ff0 | ||
|
d20760f40d | ||
|
0bc3a836fc | ||
|
82d2ae654d | ||
|
3ad4320f61 | ||
|
9dfaf8815a | ||
|
7cb8d96529 | ||
|
1b1dedd2bd | ||
|
97b66d1fe0 | ||
|
806a2f53fc | ||
|
d66fe964bc | ||
|
f1f28f61e6 | ||
|
8473394643 | ||
|
c7077cf798 | ||
|
f356d7228a | ||
|
1e6f9429df | ||
|
34a2cc5dce | ||
|
a28cae4d68 | ||
|
41a19baa8e | ||
|
9da2921b74 | ||
|
e84a07cb78 | ||
|
1b0673d98e | ||
|
3c2d394112 | ||
|
d761adf002 | ||
|
2736945385 | ||
|
dd08b86a0f | ||
|
465209c6fe | ||
|
68318407a8 | ||
|
4bea9bc7a8 | ||
|
cfb78d2ee8 | ||
|
49cfd05022 | ||
|
f318928281 | ||
|
fbbffb6f23 | ||
|
2de43199ef | ||
|
29c5af84be | ||
|
6aaf88aae7 | ||
|
abf33e55b0 | ||
|
356a1cf3b7 | ||
|
9fa1382508 | ||
|
e14f5a95da | ||
|
88d84e4551 | ||
|
b455b0281d | ||
|
942724238f | ||
|
f8fed1358a | ||
|
bbad51e891 | ||
|
8f3b14193e | ||
|
421e52d6fb | ||
|
e94f62a58f | ||
|
1421934fde | ||
|
a143861478 | ||
|
ac1dbd9d61 | ||
|
9a7fbd6cd1 | ||
|
275efa061a | ||
|
80a4dfc0f8 | ||
|
6043756b2e | ||
|
059311923b | ||
|
1cfb4fc242 | ||
|
86216ac645 | ||
|
36061b43ba | ||
|
8399e828db | ||
|
347a907041 | ||
|
2fc0dfa8e1 | ||
|
9cf7de54b8 | ||
|
1fb85d4df6 | ||
|
c28e023c32 | ||
|
45ad161930 | ||
|
ba20df4db9 | ||
|
73bfb87ed1 | ||
|
a3f10e0b0f | ||
|
041a525a3c | ||
|
b8efad0b27 | ||
|
2bd228534b | ||
|
2b5c06c4ef | ||
|
79340908f4 | ||
|
0f79903a10 | ||
|
c453bc4770 | ||
|
ef9168c7c4 | ||
|
6f5ed2f90e | ||
|
a3e6c95e79 | ||
|
6ba1a4b780 | ||
|
2578fddd3f | ||
|
7cd4af80a6 | ||
|
932a6e047b | ||
|
4251c5cd4d | ||
|
8a468394b5 | ||
|
4ce5c75d19 | ||
|
a0f0371fb1 | ||
|
8a7618793a | ||
|
bba5a5d69c | ||
|
d9c9474938 | ||
|
e9b0f5b481 | ||
|
cf8b004052 | ||
|
571fb67864 | ||
|
d62093c228 | ||
|
7e629936e5 | ||
|
1c8fd60595 | ||
|
7f85c21386 | ||
|
1c5da37ca6 | ||
|
4350c0024f | ||
|
b968dfef15 | ||
|
f215528575 | ||
|
798fbc3dff | ||
|
2440e19fab | ||
|
a0501a30b2 | ||
|
5cf49561a8 | ||
|
502b26ecf0 | ||
|
b3db69745d | ||
|
45fd91f962 | ||
|
c01e1b648b | ||
|
d49ff9aa5f | ||
|
f61ee9a693 | ||
|
a7b348e83b | ||
|
c7728ba659 | ||
|
8d7e93cfc6 | ||
|
55d3aea268 | ||
|
90a8ca4168 |
21
Gruntfile.js
21
Gruntfile.js
@@ -1,6 +1,6 @@
|
||||
/* global module:false */
|
||||
module.exports = function(grunt) {
|
||||
|
||||
var port = grunt.option('port') || 8000;
|
||||
// Project configuration
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
@@ -11,13 +11,12 @@ module.exports = function(grunt) {
|
||||
' * http://lab.hakim.se/reveal-js\n' +
|
||||
' * MIT licensed\n' +
|
||||
' *\n' +
|
||||
' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
|
||||
' * Copyright (C) 2014 Hakim El Hattab, http://hakim.se\n' +
|
||||
' */'
|
||||
},
|
||||
|
||||
// Tests will be added soon
|
||||
qunit: {
|
||||
files: [ 'test/**/*.html' ]
|
||||
files: [ 'test/*.html' ]
|
||||
},
|
||||
|
||||
uglify: {
|
||||
@@ -48,7 +47,8 @@ module.exports = function(grunt) {
|
||||
'css/theme/simple.css': 'css/theme/source/simple.scss',
|
||||
'css/theme/sky.css': 'css/theme/source/sky.scss',
|
||||
'css/theme/moon.css': 'css/theme/source/moon.scss',
|
||||
'css/theme/solarized.css': 'css/theme/source/solarized.scss'
|
||||
'css/theme/solarized.css': 'css/theme/source/solarized.scss',
|
||||
'css/theme/blood.css': 'css/theme/source/blood.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -69,7 +69,8 @@ module.exports = function(grunt) {
|
||||
globals: {
|
||||
head: false,
|
||||
module: false,
|
||||
console: false
|
||||
console: false,
|
||||
unescape: false
|
||||
}
|
||||
},
|
||||
files: [ 'Gruntfile.js', 'js/reveal.js' ]
|
||||
@@ -78,7 +79,7 @@ module.exports = function(grunt) {
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 8000,
|
||||
port: port,
|
||||
base: '.'
|
||||
}
|
||||
}
|
||||
@@ -109,6 +110,7 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
// Dependencies
|
||||
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
|
||||
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
||||
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
|
||||
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
|
||||
@@ -118,7 +120,7 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks( 'grunt-zip' );
|
||||
|
||||
// Default task
|
||||
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
|
||||
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify', 'qunit' ] );
|
||||
|
||||
// Theme task
|
||||
grunt.registerTask( 'themes', [ 'sass' ] );
|
||||
@@ -129,4 +131,7 @@ module.exports = function(grunt) {
|
||||
// Serve presentation locally
|
||||
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
|
||||
|
||||
// Run tests
|
||||
grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );
|
||||
|
||||
};
|
||||
|
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|
||||
Copyright (C) 2014 Hakim El Hattab, http://hakim.se
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
217
README.md
217
README.md
@@ -11,7 +11,7 @@ reveal.js comes with a broad range of features including [nested slides](https:/
|
||||
- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
|
||||
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
|
||||
|
||||
## Slides
|
||||
## Online Editor
|
||||
|
||||
Presentations are written using HTML or markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slid.es](http://slid.es).
|
||||
|
||||
@@ -54,10 +54,44 @@ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Iri
|
||||
|
||||
You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file.
|
||||
|
||||
When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
|
||||
|
||||
```html
|
||||
<section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n" data-notes="^Note:" data-charset="iso-8859-15"></section>
|
||||
<section data-markdown="example.md"
|
||||
data-separator="^\n\n\n"
|
||||
data-vertical="^\n\n"
|
||||
data-notes="^Note:"
|
||||
data-charset="iso-8859-15">
|
||||
</section>
|
||||
```
|
||||
|
||||
#### Element Attributes
|
||||
|
||||
Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
|
||||
|
||||
```html
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
- Item 1 <!-- .element: class="fragment" data-fragment-index="2" -->
|
||||
- Item 2 <!-- .element: class="fragment" data-fragment-index="1" -->
|
||||
</script>
|
||||
</section>
|
||||
```
|
||||
|
||||
#### Slide Attributes
|
||||
|
||||
Special syntax (in html comment) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
|
||||
|
||||
```html
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
<!-- .slide: data-background="#ff0000" -->
|
||||
Mardown content
|
||||
</script>
|
||||
</section>
|
||||
```
|
||||
|
||||
|
||||
### Configuration
|
||||
|
||||
At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below.
|
||||
@@ -71,43 +105,72 @@ Reveal.initialize({
|
||||
// Display a presentation progress bar
|
||||
progress: true,
|
||||
|
||||
// Display the page number of the current slide
|
||||
slideNumber: false,
|
||||
|
||||
// Push each slide change to the browser history
|
||||
history: false,
|
||||
|
||||
// Enable keyboard shortcuts for navigation
|
||||
keyboard: true,
|
||||
|
||||
// Enable touch events for navigation
|
||||
touch: true,
|
||||
|
||||
// Enable the slide overview mode
|
||||
overview: true,
|
||||
|
||||
// Vertical centering of slides
|
||||
center: true,
|
||||
|
||||
// Enables touch navigation on devices with touch input
|
||||
touch: true,
|
||||
|
||||
// Loop the presentation
|
||||
loop: false,
|
||||
|
||||
// Change the presentation direction to be RTL
|
||||
rtl: false,
|
||||
|
||||
// Turns fragments on and off globally
|
||||
fragments: true,
|
||||
|
||||
// Flags if the presentation is running in an embedded mode,
|
||||
// i.e. contained within a limited portion of the screen
|
||||
embedded: false,
|
||||
|
||||
// Number of milliseconds between automatically proceeding to the
|
||||
// next slide, disabled when set to 0, this value can be overwritten
|
||||
// by using a data-autoslide attribute on your slides
|
||||
autoSlide: 0,
|
||||
|
||||
// Stop auto-sliding after user input
|
||||
autoSlideStoppable: true,
|
||||
|
||||
// Enable slide navigation via mouse wheel
|
||||
mouseWheel: false,
|
||||
|
||||
// Hides the address bar on mobile devices
|
||||
hideAddressBar: true,
|
||||
|
||||
// Opens links in an iframe preview overlay
|
||||
previewLinks: false,
|
||||
|
||||
// Transition style
|
||||
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
|
||||
|
||||
// Transition speed
|
||||
transitionSpeed: 'default', // default/fast/slow
|
||||
|
||||
// Transition style for full page backgrounds
|
||||
backgroundTransition: 'default' // default/linear/none
|
||||
// Transition style for full page slide backgrounds
|
||||
backgroundTransition: 'default', // default/none/slide/concave/convex/zoom
|
||||
|
||||
// Number of slides away from the current that are visible
|
||||
viewDistance: 3,
|
||||
|
||||
// Parallax background image
|
||||
parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
|
||||
|
||||
// Parallax background size
|
||||
parallaxBackgroundSize: '' // CSS syntax, e.g. "2100px 900px"
|
||||
|
||||
|
||||
});
|
||||
```
|
||||
@@ -192,6 +255,27 @@ Reveal.initialize({
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
### Auto-sliding
|
||||
|
||||
Presentations can be configure to progress through slides automatically, without any user input. To enable this you will need to tell the framework how many milliseconds it should wait between slides:
|
||||
|
||||
```javascript
|
||||
// Slide every five seconds
|
||||
Reveal.configure({
|
||||
autoSlide: 5000
|
||||
});
|
||||
```
|
||||
|
||||
When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Sliding is also paused automatically as soon as the user starts navigating. You can disable these controls by specifying ```autoSlideStoppable: false``` in your reveal.js config.
|
||||
|
||||
You can also override the slide duration for individual slides by using the ```data-autoslide``` attribute on individual sections:
|
||||
|
||||
```html
|
||||
<section data-autoslide="10000">This will remain on screen for 10 seconds</section>
|
||||
```
|
||||
|
||||
|
||||
### Keyboard Bindings
|
||||
|
||||
If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
|
||||
@@ -292,6 +376,29 @@ Slides are contained within a limited portion of the screen by default to allow
|
||||
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.
|
||||
|
||||
|
||||
### Parallax Background
|
||||
|
||||
If you want to use a parallax scrolling background, set the two following config properties when initializing reveal.js (the third one is optional).
|
||||
|
||||
```javascript
|
||||
Reveal.initialize({
|
||||
|
||||
// Parallax background image
|
||||
parallaxBackgroundImage: '', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg"
|
||||
|
||||
// Parallax background size
|
||||
parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto)
|
||||
|
||||
// This slide transition gives best results:
|
||||
transition: linear
|
||||
|
||||
});
|
||||
```
|
||||
|
||||
Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://lab.hakim.se/reveal-js/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px).
|
||||
|
||||
|
||||
|
||||
### Slide Transitions
|
||||
The global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute:
|
||||
|
||||
@@ -330,7 +437,7 @@ You can also add relative navigation links, similar to the built in reveal.js co
|
||||
|
||||
|
||||
### Fragments
|
||||
Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/16
|
||||
Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/fragments
|
||||
|
||||
The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment:
|
||||
|
||||
@@ -340,6 +447,8 @@ The default fragment style is to start out invisible and fade in. This style can
|
||||
<p class="fragment shrink">shrink</p>
|
||||
<p class="fragment roll-in">roll-in</p>
|
||||
<p class="fragment fade-out">fade-out</p>
|
||||
<p class="fragment current-visible">visible only once</p>
|
||||
<p class="fragment highlight-current-blue">blue only once</p>
|
||||
<p class="fragment highlight-red">highlight-red</p>
|
||||
<p class="fragment highlight-green">highlight-green</p>
|
||||
<p class="fragment highlight-blue">highlight-blue</p>
|
||||
@@ -397,6 +506,13 @@ By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/
|
||||
</section>
|
||||
```
|
||||
|
||||
### Slide number
|
||||
If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value.
|
||||
|
||||
```javascript
|
||||
Reveal.configure({ slideNumber: true });
|
||||
```
|
||||
|
||||
|
||||
### Overview mode
|
||||
|
||||
@@ -424,6 +540,8 @@ Add `data-autoplay` to your media element if you want it to automatically start
|
||||
<video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
|
||||
```
|
||||
|
||||
Additionally the framework automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to all iframes, ```slide:start``` when the slide containing the iframe is made visible and ```slide:stop``` when it is hidden.
|
||||
|
||||
|
||||
### Stretching elements
|
||||
Sometimes it's desirable to have an element, like an image or video, stretch to consume as much space as possible within a given slide. This can be done by adding the ```.stretch``` class to an element as seen below:
|
||||
@@ -464,6 +582,7 @@ The framework comes with a few different themes included:
|
||||
- night: Black background, thick white text, orange links
|
||||
- serif: Cappuccino background, gray text, brown links
|
||||
- simple: White background, black text, blue links
|
||||
- solarized: Cream-colored background, dark green text, blue links
|
||||
|
||||
Each theme is available as a separate stylesheet. To change theme you will need to replace **default** below with your desired theme name in index.html:
|
||||
|
||||
@@ -480,6 +599,8 @@ reveal.js comes with a speaker notes plugin which can be used to present per-sli
|
||||
|
||||
Notes are defined by appending an ```<aside>``` element to a slide as seen below. You can add the ```data-markdown``` attribute to the aside element if you prefer writing notes using Markdown.
|
||||
|
||||
When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
|
||||
|
||||
```html
|
||||
<section>
|
||||
<h2>Some Slide</h2>
|
||||
@@ -664,31 +785,27 @@ Reveal.initialize({
|
||||
The Leap Motion plugin lets you utilize your [Leap Motion](https://www.leapmotion.com/) device to control basic navigation of your presentation. The gestures currently supported are:
|
||||
|
||||
##### 1 to 2 fingers
|
||||
* Pointer — Point to anything on screen. Move your finger past the device to expand the pointer.
|
||||
|
||||
##### 1 hand + 3 or more fingers
|
||||
|
||||
* Left
|
||||
* Right
|
||||
* Up
|
||||
* down
|
||||
Pointer — Point to anything on screen. Move your finger past the device to expand the pointer.
|
||||
|
||||
##### 1 hand + 3 or more fingers (left/right/up/down)
|
||||
Navigate through your slides. See config options to invert movements.
|
||||
|
||||
##### 2 hands
|
||||
* Up
|
||||
|
||||
##### 2 hands upwards
|
||||
Toggle the overview mode. Do it a second time to exit the overview.
|
||||
|
||||
#### Config Options
|
||||
You can edit the following options:
|
||||
* autoCenter: Defaults to true. Center the pointer based on where you put your finger into the leap motions detection field.
|
||||
* gestureDelay: Defaults to 500. How long to delay between gestures in milliseconds.
|
||||
* naturalSwipe: Defaults to true. Swipe as though you were touching a touch screen. Set to false to invert.
|
||||
* pointerColor: Defaults to #00aaff. The color of the pointer.
|
||||
* pointerOpacity: Defaults to 0.7. The opacity of the pointer.
|
||||
* pointerSize: Defaults to 15. The minimum height and width of the pointer.
|
||||
* pointerTolerance: Defaults to 120. Bigger = slower pointer.
|
||||
|
||||
| Property | Default | Description
|
||||
| ----------------- |:-----------------:| :-------------
|
||||
| autoCenter | true | Center the pointer based on where you put your finger into the leap motions detection field.
|
||||
| gestureDelay | 500 | How long to delay between gestures in milliseconds.
|
||||
| naturalSwipe | true | Swipe as though you were touching a touch screen. Set to false to invert.
|
||||
| pointerColor | #00aaff | The color of the pointer.
|
||||
| pointerOpacity | 0.7 | The opacity of the pointer.
|
||||
| pointerSize | 15 | The minimum height and width of the pointer.
|
||||
| pointerTolerance | 120 | Bigger = slower pointer.
|
||||
|
||||
|
||||
Example configuration:
|
||||
```js
|
||||
@@ -734,7 +851,7 @@ Reveal.initialize({
|
||||
});
|
||||
```
|
||||
|
||||
Read MathJax's documentation if you want [secure delivery](http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) or serve [specific versons](http://docs.mathjax.org/en/latest/configuration.html#loading-mathjax-from-the-cdn) for stabilty.
|
||||
Read MathJax's documentation if you need [HTTPS delivery](http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) or serving of [specific versions](http://docs.mathjax.org/en/latest/configuration.html#loading-mathjax-from-the-cdn) for stability.
|
||||
|
||||
|
||||
## Installation
|
||||
@@ -754,34 +871,36 @@ The core of reveal.js is very easy to install. You'll simply need to download a
|
||||
|
||||
### Full setup
|
||||
|
||||
Some reveal.js features, like external markdown, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code.
|
||||
Some reveal.js features, like external markdown and speaker notes, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code.
|
||||
|
||||
1. Install [Node.js](http://nodejs.org/)
|
||||
|
||||
2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
|
||||
|
||||
4. Clone the reveal.js repository
|
||||
```
|
||||
$ git clone git@github.com:hakimel/reveal.js.git
|
||||
```
|
||||
```sh
|
||||
$ git clone https://github.com/hakimel/reveal.js.git
|
||||
```
|
||||
|
||||
5. Navigate to the reveal.js folder
|
||||
```
|
||||
$ cd reveal.js
|
||||
```
|
||||
```sh
|
||||
$ cd reveal.js
|
||||
```
|
||||
|
||||
6. Install dependencies
|
||||
```
|
||||
$ npm install
|
||||
```
|
||||
```sh
|
||||
$ npm install
|
||||
```
|
||||
|
||||
7. Serve the presentation and monitor source files for changes
|
||||
```
|
||||
$ grunt serve
|
||||
```
|
||||
```sh
|
||||
$ grunt serve
|
||||
```
|
||||
|
||||
8. Open <http://localhost:8000> to view your presentation
|
||||
|
||||
You can change the port by using `grunt serve --port 8001`.
|
||||
|
||||
|
||||
### Folder Structure
|
||||
- **css/** Core styles without which the project does not function
|
||||
@@ -790,9 +909,25 @@ $ grunt serve
|
||||
- **lib/** All other third party assets (JavaScript, CSS, fonts)
|
||||
|
||||
|
||||
### Contributing
|
||||
|
||||
Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. If you are reporting a bug make sure to include information about which browser and operating system you are using as well as the necessary steps to reproduce the issue.
|
||||
|
||||
If you have personal support questions use [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js).
|
||||
|
||||
|
||||
#### Pull requests
|
||||
|
||||
- Should follow the coding style of the file you work in, most importantly:
|
||||
- Tabs to indent
|
||||
- Single-quoted strings
|
||||
- Should be made towards the **dev branch**
|
||||
- Should be submitted from a feature/topic branch (not your master)
|
||||
- Should not include the minified **reveal.min.js** file
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT licensed
|
||||
|
||||
Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|
||||
Copyright (C) 2014 Hakim El Hattab, http://hakim.se
|
||||
|
@@ -67,7 +67,7 @@ h1,h2,h3,h4,h5,h6 {
|
||||
the URL to the end of the link for usability. */
|
||||
a:link,
|
||||
a:visited {
|
||||
font-weight: bold;
|
||||
font-weight: normal;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
267
css/reveal.css
267
css/reveal.css
@@ -5,7 +5,7 @@
|
||||
* http://lab.hakim.se/reveal-js
|
||||
* MIT licensed
|
||||
*
|
||||
* Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|
||||
* Copyright (C) 2014 Hakim El Hattab, http://hakim.se
|
||||
*/
|
||||
|
||||
|
||||
@@ -179,9 +179,20 @@ body {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.reveal .slides section .fragment.current-visible {
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
.reveal .slides section .fragment.current-visible.current-fragment {
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
.reveal .slides section .fragment.highlight-red,
|
||||
.reveal .slides section .fragment.highlight-current-red,
|
||||
.reveal .slides section .fragment.highlight-green,
|
||||
.reveal .slides section .fragment.highlight-blue {
|
||||
.reveal .slides section .fragment.highlight-current-green,
|
||||
.reveal .slides section .fragment.highlight-blue,
|
||||
.reveal .slides section .fragment.highlight-current-blue {
|
||||
opacity: 1;
|
||||
}
|
||||
.reveal .slides section .fragment.highlight-red.visible {
|
||||
@@ -194,6 +205,16 @@ body {
|
||||
color: #1b91ff;
|
||||
}
|
||||
|
||||
.reveal .slides section .fragment.highlight-current-red.current-fragment {
|
||||
color: #ff2c2d
|
||||
}
|
||||
.reveal .slides section .fragment.highlight-current-green.current-fragment {
|
||||
color: #17ff2e;
|
||||
}
|
||||
.reveal .slides section .fragment.highlight-current-blue.current-fragment {
|
||||
color: #1b91ff;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************
|
||||
* DEFAULT ELEMENT STYLES
|
||||
@@ -334,7 +355,7 @@ body {
|
||||
}
|
||||
|
||||
.reveal table th {
|
||||
text-shadow: rgb(255,255,255) 1px 1px 2px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.reveal sup {
|
||||
@@ -476,6 +497,19 @@ body {
|
||||
transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
|
||||
.reveal .slide-number {
|
||||
position: fixed;
|
||||
display: block;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
opacity: 0.5;
|
||||
z-index: 31;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* SLIDES
|
||||
@@ -517,6 +551,10 @@ body {
|
||||
perspective-origin: 0px -100px;
|
||||
}
|
||||
|
||||
.reveal .slides>section {
|
||||
-ms-perspective: 600px;
|
||||
}
|
||||
|
||||
.reveal .slides>section,
|
||||
.reveal .slides>section>section {
|
||||
display: none;
|
||||
@@ -526,7 +564,7 @@ body {
|
||||
|
||||
z-index: 10;
|
||||
line-height: 1.2em;
|
||||
font-weight: normal;
|
||||
font-weight: inherit;
|
||||
|
||||
-webkit-transform-style: preserve-3d;
|
||||
-moz-transform-style: preserve-3d;
|
||||
@@ -707,6 +745,15 @@ body {
|
||||
* ZOOM TRANSITION
|
||||
*********************************************/
|
||||
|
||||
.reveal .slides>section[data-transition=zoom],
|
||||
.reveal.zoom .slides>section {
|
||||
-webkit-transition-timing-function: ease;
|
||||
-moz-transition-timing-function: ease;
|
||||
-ms-transition-timing-function: ease;
|
||||
-o-transition-timing-function: ease;
|
||||
transition-timing-function: ease;
|
||||
}
|
||||
|
||||
.reveal .slides>section[data-transition=zoom].past,
|
||||
.reveal.zoom .slides>section.past {
|
||||
opacity: 0;
|
||||
@@ -1050,8 +1097,8 @@ body {
|
||||
|
||||
.reveal.fade.overview .slides section,
|
||||
.reveal.fade.overview .slides>section>section,
|
||||
.reveal.fade.exit-overview .slides section,
|
||||
.reveal.fade.exit-overview .slides>section>section {
|
||||
.reveal.fade.overview-deactivating .slides section,
|
||||
.reveal.fade.overview-deactivating .slides>section>section {
|
||||
-webkit-transition: none;
|
||||
-moz-transition: none;
|
||||
-ms-transition: none;
|
||||
@@ -1264,6 +1311,11 @@ body {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
-webkit-perspective: 600px;
|
||||
-moz-perspective: 600px;
|
||||
-ms-perspective: 600px;
|
||||
perspective: 600px;
|
||||
}
|
||||
.reveal .slide-background {
|
||||
position: absolute;
|
||||
@@ -1277,11 +1329,11 @@ body {
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
-webkit-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-moz-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-ms-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-o-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-webkit-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-moz-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-ms-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
-o-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
}
|
||||
.reveal .slide-background.present {
|
||||
opacity: 1;
|
||||
@@ -1303,7 +1355,7 @@ body {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
/* Linear sliding transition style */
|
||||
/* 2D slide */
|
||||
.reveal[data-background-transition=slide]>.backgrounds .slide-background,
|
||||
.reveal>.backgrounds .slide-background[data-background-transition=slide] {
|
||||
opacity: 1;
|
||||
@@ -1312,12 +1364,6 @@ body {
|
||||
-moz-backface-visibility: hidden;
|
||||
-ms-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
|
||||
-webkit-transition-duration: 800ms;
|
||||
-moz-transition-duration: 800ms;
|
||||
-ms-transition-duration: 800ms;
|
||||
-o-transition-duration: 800ms;
|
||||
transition-duration: 800ms;
|
||||
}
|
||||
.reveal[data-background-transition=slide]>.backgrounds .slide-background.past,
|
||||
.reveal>.backgrounds .slide-background.past[data-background-transition=slide] {
|
||||
@@ -1354,6 +1400,142 @@ body {
|
||||
}
|
||||
|
||||
|
||||
/* Convex */
|
||||
.reveal[data-background-transition=convex]>.backgrounds .slide-background.past,
|
||||
.reveal>.backgrounds .slide-background.past[data-background-transition=convex] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0);
|
||||
-moz-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0);
|
||||
-ms-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0);
|
||||
transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0);
|
||||
}
|
||||
.reveal[data-background-transition=convex]>.backgrounds .slide-background.future,
|
||||
.reveal>.backgrounds .slide-background.future[data-background-transition=convex] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0);
|
||||
-moz-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0);
|
||||
-ms-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0);
|
||||
transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
.reveal[data-background-transition=convex]>.backgrounds .slide-background>.slide-background.past,
|
||||
.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=convex] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0);
|
||||
-moz-transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0);
|
||||
-ms-transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0);
|
||||
transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0);
|
||||
}
|
||||
.reveal[data-background-transition=convex]>.backgrounds .slide-background>.slide-background.future,
|
||||
.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=convex] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0);
|
||||
-moz-transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0);
|
||||
-ms-transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0);
|
||||
transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Concave */
|
||||
.reveal[data-background-transition=concave]>.backgrounds .slide-background.past,
|
||||
.reveal>.backgrounds .slide-background.past[data-background-transition=concave] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0);
|
||||
-moz-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0);
|
||||
-ms-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0);
|
||||
transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0);
|
||||
}
|
||||
.reveal[data-background-transition=concave]>.backgrounds .slide-background.future,
|
||||
.reveal>.backgrounds .slide-background.future[data-background-transition=concave] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0);
|
||||
-moz-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0);
|
||||
-ms-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0);
|
||||
transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
.reveal[data-background-transition=concave]>.backgrounds .slide-background>.slide-background.past,
|
||||
.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=concave] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0);
|
||||
-moz-transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0);
|
||||
-ms-transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0);
|
||||
transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0);
|
||||
}
|
||||
.reveal[data-background-transition=concave]>.backgrounds .slide-background>.slide-background.future,
|
||||
.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=concave] {
|
||||
opacity: 0;
|
||||
|
||||
-webkit-transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0);
|
||||
-moz-transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0);
|
||||
-ms-transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0);
|
||||
transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0);
|
||||
}
|
||||
|
||||
/* Zoom */
|
||||
.reveal[data-background-transition=zoom]>.backgrounds .slide-background,
|
||||
.reveal>.backgrounds .slide-background[data-background-transition=zoom] {
|
||||
-webkit-transition-timing-function: ease;
|
||||
-moz-transition-timing-function: ease;
|
||||
-ms-transition-timing-function: ease;
|
||||
-o-transition-timing-function: ease;
|
||||
transition-timing-function: ease;
|
||||
}
|
||||
|
||||
.reveal[data-background-transition=zoom]>.backgrounds .slide-background.past,
|
||||
.reveal>.backgrounds .slide-background.past[data-background-transition=zoom] {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
|
||||
-webkit-transform: scale(16);
|
||||
-moz-transform: scale(16);
|
||||
-ms-transform: scale(16);
|
||||
-o-transform: scale(16);
|
||||
transform: scale(16);
|
||||
}
|
||||
.reveal[data-background-transition=zoom]>.backgrounds .slide-background.future,
|
||||
.reveal>.backgrounds .slide-background.future[data-background-transition=zoom] {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
|
||||
-webkit-transform: scale(0.2);
|
||||
-moz-transform: scale(0.2);
|
||||
-ms-transform: scale(0.2);
|
||||
-o-transform: scale(0.2);
|
||||
transform: scale(0.2);
|
||||
}
|
||||
|
||||
.reveal[data-background-transition=zoom]>.backgrounds .slide-background>.slide-background.past,
|
||||
.reveal>.backgrounds .slide-background>.slide-background.past[data-background-transition=zoom] {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
|
||||
-webkit-transform: scale(16);
|
||||
-moz-transform: scale(16);
|
||||
-ms-transform: scale(16);
|
||||
-o-transform: scale(16);
|
||||
transform: scale(16);
|
||||
}
|
||||
.reveal[data-background-transition=zoom]>.backgrounds .slide-background>.slide-background.future,
|
||||
.reveal>.backgrounds .slide-background>.slide-background.future[data-background-transition=zoom] {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
|
||||
-webkit-transform: scale(0.2);
|
||||
-moz-transform: scale(0.2);
|
||||
-ms-transform: scale(0.2);
|
||||
-o-transform: scale(0.2);
|
||||
transform: scale(0.2);
|
||||
}
|
||||
|
||||
|
||||
/* Global transition speed settings */
|
||||
.reveal[data-transition-speed="fast"]>.backgrounds .slide-background {
|
||||
-webkit-transition-duration: 400ms;
|
||||
@@ -1398,6 +1580,31 @@ body {
|
||||
float: right
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* PARALLAX BACKGROUND
|
||||
*********************************************/
|
||||
|
||||
.reveal.has-parallax-background .backgrounds {
|
||||
-webkit-transition: all 0.8s ease;
|
||||
-moz-transition: all 0.8s ease;
|
||||
-ms-transition: all 0.8s ease;
|
||||
transition: all 0.8s ease;
|
||||
}
|
||||
|
||||
/* Global transition speed settings */
|
||||
.reveal.has-parallax-background[data-transition-speed="fast"] .backgrounds {
|
||||
-webkit-transition-duration: 400ms;
|
||||
-moz-transition-duration: 400ms;
|
||||
-ms-transition-duration: 400ms;
|
||||
transition-duration: 400ms;
|
||||
}
|
||||
.reveal.has-parallax-background[data-transition-speed="slow"] .backgrounds {
|
||||
-webkit-transition-duration: 1200ms;
|
||||
-moz-transition-duration: 1200ms;
|
||||
-ms-transition-duration: 1200ms;
|
||||
transition-duration: 1200ms;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************
|
||||
* LINK PREVIEW OVERLAY
|
||||
@@ -1522,6 +1729,30 @@ body {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********************************************
|
||||
* PLAYBACK COMPONENT
|
||||
*********************************************/
|
||||
|
||||
.reveal .playback {
|
||||
position: fixed;
|
||||
left: 15px;
|
||||
bottom: 15px;
|
||||
z-index: 30;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: all 400ms ease;
|
||||
-moz-transition: all 400ms ease;
|
||||
-ms-transition: all 400ms ease;
|
||||
transition: all 400ms ease;
|
||||
}
|
||||
|
||||
.reveal.overview .playback {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************
|
||||
* ROLLING LINKS
|
||||
*********************************************/
|
||||
|
4
css/reveal.min.css
vendored
4
css/reveal.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
|
||||
Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceding: https://github.com/hakimel/reveal.js#full-setup
|
||||
|
||||
|
||||
You also need to install Ruby and then Sass (with `gem install sass`).
|
||||
|
||||
## Creating a Theme
|
||||
|
||||
@@ -21,3 +21,5 @@ This is where you override the default theme. Either by specifying variables (se
|
||||
|
||||
4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)**
|
||||
The template theme file which will generate final CSS output based on the currently defined variables.
|
||||
|
||||
When you are done, run `grunt themes` to compile the Sass file to CSS and you are ready to use your new theme.
|
||||
|
@@ -27,7 +27,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Lato", sans-serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #333333; }
|
||||
|
||||
@@ -140,3 +140,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #8b743d; }
|
||||
|
175
css/theme/blood.css
Normal file
175
css/theme/blood.css
Normal file
@@ -0,0 +1,175 @@
|
||||
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic);
|
||||
/**
|
||||
* Blood theme for reveal.js
|
||||
* Author: Walther http://github.com/Walther
|
||||
*
|
||||
* Designed to be used with highlight.js theme
|
||||
* "monokai_sublime.css" available from
|
||||
* https://github.com/isagalaev/highlight.js/
|
||||
*
|
||||
* For other themes, change $codeBackground accordingly.
|
||||
*
|
||||
*/
|
||||
/*********************************************
|
||||
* GLOBAL STYLES
|
||||
*********************************************/
|
||||
body {
|
||||
background: #222222;
|
||||
background: -moz-radial-gradient(center, circle cover, #626262 0%, #222222 100%);
|
||||
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #626262), color-stop(100%, #222222));
|
||||
background: -webkit-radial-gradient(center, circle cover, #626262 0%, #222222 100%);
|
||||
background: -o-radial-gradient(center, circle cover, #626262 0%, #222222 100%);
|
||||
background: -ms-radial-gradient(center, circle cover, #626262 0%, #222222 100%);
|
||||
background: radial-gradient(center, circle cover, #626262 0%, #222222 100%);
|
||||
background-color: #2b2b2b; }
|
||||
|
||||
.reveal {
|
||||
font-family: Ubuntu, "sans-serif";
|
||||
font-size: 36px;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #eeeeee; }
|
||||
|
||||
::selection {
|
||||
color: white;
|
||||
background: #aa2233;
|
||||
text-shadow: none; }
|
||||
|
||||
/*********************************************
|
||||
* HEADERS
|
||||
*********************************************/
|
||||
.reveal h1,
|
||||
.reveal h2,
|
||||
.reveal h3,
|
||||
.reveal h4,
|
||||
.reveal h5,
|
||||
.reveal h6 {
|
||||
margin: 0 0 20px 0;
|
||||
color: #eeeeee;
|
||||
font-family: Ubuntu, "sans-serif";
|
||||
line-height: 0.9em;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: uppercase;
|
||||
text-shadow: 2px 2px 2px #222222; }
|
||||
|
||||
.reveal h1 {
|
||||
text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); }
|
||||
|
||||
/*********************************************
|
||||
* LINKS
|
||||
*********************************************/
|
||||
.reveal a:not(.image) {
|
||||
color: #aa2233;
|
||||
text-decoration: none;
|
||||
-webkit-transition: color .15s ease;
|
||||
-moz-transition: color .15s ease;
|
||||
-ms-transition: color .15s ease;
|
||||
-o-transition: color .15s ease;
|
||||
transition: color .15s ease; }
|
||||
|
||||
.reveal a:not(.image):hover {
|
||||
color: #dd5566;
|
||||
text-shadow: none;
|
||||
border: none; }
|
||||
|
||||
.reveal .roll span:after {
|
||||
color: #fff;
|
||||
background: #6a1520; }
|
||||
|
||||
/*********************************************
|
||||
* IMAGES
|
||||
*********************************************/
|
||||
.reveal section img {
|
||||
margin: 15px 0px;
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border: 4px solid #eeeeee;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
|
||||
-webkit-transition: all .2s linear;
|
||||
-moz-transition: all .2s linear;
|
||||
-ms-transition: all .2s linear;
|
||||
-o-transition: all .2s linear;
|
||||
transition: all .2s linear; }
|
||||
|
||||
.reveal a:hover img {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-color: #aa2233;
|
||||
box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); }
|
||||
|
||||
/*********************************************
|
||||
* NAVIGATION CONTROLS
|
||||
*********************************************/
|
||||
.reveal .controls div.navigate-left,
|
||||
.reveal .controls div.navigate-left.enabled {
|
||||
border-right-color: #aa2233; }
|
||||
|
||||
.reveal .controls div.navigate-right,
|
||||
.reveal .controls div.navigate-right.enabled {
|
||||
border-left-color: #aa2233; }
|
||||
|
||||
.reveal .controls div.navigate-up,
|
||||
.reveal .controls div.navigate-up.enabled {
|
||||
border-bottom-color: #aa2233; }
|
||||
|
||||
.reveal .controls div.navigate-down,
|
||||
.reveal .controls div.navigate-down.enabled {
|
||||
border-top-color: #aa2233; }
|
||||
|
||||
.reveal .controls div.navigate-left.enabled:hover {
|
||||
border-right-color: #dd5566; }
|
||||
|
||||
.reveal .controls div.navigate-right.enabled:hover {
|
||||
border-left-color: #dd5566; }
|
||||
|
||||
.reveal .controls div.navigate-up.enabled:hover {
|
||||
border-bottom-color: #dd5566; }
|
||||
|
||||
.reveal .controls div.navigate-down.enabled:hover {
|
||||
border-top-color: #dd5566; }
|
||||
|
||||
/*********************************************
|
||||
* PROGRESS BAR
|
||||
*********************************************/
|
||||
.reveal .progress {
|
||||
background: rgba(0, 0, 0, 0.2); }
|
||||
|
||||
.reveal .progress span {
|
||||
background: #aa2233;
|
||||
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #aa2233; }
|
||||
|
||||
.reveal p {
|
||||
font-weight: 300;
|
||||
text-shadow: 1px 1px #222222; }
|
||||
|
||||
.reveal h1,
|
||||
.reveal h2,
|
||||
.reveal h3,
|
||||
.reveal h4,
|
||||
.reveal h5,
|
||||
.reveal h6 {
|
||||
font-weight: 700; }
|
||||
|
||||
.reveal a:not(.image),
|
||||
.reveal a:not(.image):hover {
|
||||
text-shadow: 2px 2px 2px #000; }
|
||||
|
||||
.reveal small a:not(.image),
|
||||
.reveal small a:not(.image):hover {
|
||||
text-shadow: 1px 1px 1px #000; }
|
||||
|
||||
.reveal p code {
|
||||
background-color: #23241f;
|
||||
display: inline-block;
|
||||
border-radius: 7px; }
|
||||
|
||||
.reveal small code {
|
||||
vertical-align: baseline; }
|
@@ -27,7 +27,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Lato", sans-serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #eeeeee; }
|
||||
|
||||
@@ -140,3 +140,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #13daec; }
|
||||
|
@@ -27,7 +27,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Lato", sans-serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #93a1a1; }
|
||||
|
||||
@@ -140,3 +140,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #268bd2; }
|
||||
|
@@ -15,7 +15,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 30px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #eeeeee; }
|
||||
|
||||
@@ -128,3 +128,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #e7ad52; }
|
||||
|
@@ -17,7 +17,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: black; }
|
||||
|
||||
@@ -130,3 +130,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #51483d; }
|
||||
|
@@ -17,7 +17,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Lato", sans-serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: black; }
|
||||
|
||||
@@ -130,3 +130,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: darkblue; }
|
||||
|
@@ -24,7 +24,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #333333; }
|
||||
|
||||
@@ -137,3 +137,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #3b759e; }
|
||||
|
@@ -27,7 +27,7 @@ body {
|
||||
.reveal {
|
||||
font-family: "Lato", sans-serif;
|
||||
font-size: 36px;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: #657b83; }
|
||||
|
||||
@@ -140,3 +140,9 @@ body {
|
||||
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
|
||||
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: #268bd2; }
|
||||
|
91
css/theme/source/blood.scss
Normal file
91
css/theme/source/blood.scss
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Blood theme for reveal.js
|
||||
* Author: Walther http://github.com/Walther
|
||||
*
|
||||
* Designed to be used with highlight.js theme
|
||||
* "monokai_sublime.css" available from
|
||||
* https://github.com/isagalaev/highlight.js/
|
||||
*
|
||||
* For other themes, change $codeBackground accordingly.
|
||||
*
|
||||
*/
|
||||
|
||||
// Default mixins and settings -----------------
|
||||
@import "../template/mixins";
|
||||
@import "../template/settings";
|
||||
// ---------------------------------------------
|
||||
|
||||
// Include theme-specific fonts
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic);
|
||||
|
||||
// Colors used in the theme
|
||||
$blood: #a23;
|
||||
$coal: #222;
|
||||
$codeBackground: #23241f;
|
||||
|
||||
// Main text
|
||||
$mainFont: Ubuntu, 'sans-serif';
|
||||
$mainFontSize: 36px;
|
||||
$mainColor: #eee;
|
||||
|
||||
// Headings
|
||||
$headingFont: Ubuntu, 'sans-serif';
|
||||
$headingTextShadow: 2px 2px 2px $coal;
|
||||
|
||||
// h1 shadow, borrowed humbly from
|
||||
// (c) Default theme by Hakim El Hattab
|
||||
$heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15);
|
||||
|
||||
// Links
|
||||
$linkColor: $blood;
|
||||
$linkColorHover: lighten( $linkColor, 20% );
|
||||
|
||||
// Text selection
|
||||
$selectionBackgroundColor: $blood;
|
||||
$selectionColor: #fff;
|
||||
|
||||
// Background generator
|
||||
@mixin bodyBackground() {
|
||||
@include radial-gradient( $coal, lighten( $coal, 25% ) );
|
||||
}
|
||||
|
||||
// Theme template ------------------------------
|
||||
@import "../template/theme";
|
||||
// ---------------------------------------------
|
||||
|
||||
// some overrides after theme template import
|
||||
|
||||
.reveal p {
|
||||
font-weight: 300;
|
||||
text-shadow: 1px 1px $coal;
|
||||
}
|
||||
|
||||
.reveal h1,
|
||||
.reveal h2,
|
||||
.reveal h3,
|
||||
.reveal h4,
|
||||
.reveal h5,
|
||||
.reveal h6 {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.reveal a:not(.image),
|
||||
.reveal a:not(.image):hover {
|
||||
text-shadow: 2px 2px 2px #000;
|
||||
}
|
||||
|
||||
.reveal small a:not(.image),
|
||||
.reveal small a:not(.image):hover {
|
||||
text-shadow: 1px 1px 1px #000;
|
||||
}
|
||||
|
||||
.reveal p code {
|
||||
background-color: $codeBackground;
|
||||
display: inline-block;
|
||||
border-radius: 7px;
|
||||
}
|
||||
|
||||
.reveal small code {
|
||||
vertical-align: baseline;
|
||||
}
|
@@ -12,7 +12,7 @@ body {
|
||||
.reveal {
|
||||
font-family: $mainFont;
|
||||
font-size: $mainFontSize;
|
||||
font-weight: 200;
|
||||
font-weight: normal;
|
||||
letter-spacing: -0.02em;
|
||||
color: $mainColor;
|
||||
}
|
||||
@@ -160,4 +160,11 @@ body {
|
||||
transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* SLIDE NUMBER
|
||||
*********************************************/
|
||||
.reveal .slide-number {
|
||||
color: $linkColor;
|
||||
}
|
||||
|
||||
|
||||
|
28
index.html
28
index.html
@@ -20,9 +20,15 @@
|
||||
<!-- For syntax highlighting -->
|
||||
<link rel="stylesheet" href="lib/css/zenburn.css">
|
||||
|
||||
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
|
||||
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
|
||||
<script>
|
||||
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
|
||||
if( window.location.search.match( /print-pdf/gi ) ) {
|
||||
var link = document.createElement( 'link' );
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = 'css/print/pdf.css';
|
||||
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
@@ -167,12 +173,14 @@
|
||||
<h2>Themes</h2>
|
||||
<p>
|
||||
Reveal.js comes with a few themes built in: <br>
|
||||
<a href="?#/themes">Default</a> -
|
||||
<a href="?theme=sky#/themes">Sky</a> -
|
||||
<a href="?theme=beige#/themes">Beige</a> -
|
||||
<a href="?theme=simple#/themes">Simple</a> -
|
||||
<a href="?theme=serif#/themes">Serif</a> -
|
||||
<a href="?theme=night#/themes">Night</a> -
|
||||
<a href="?#/themes">Default</a>
|
||||
<a href="?theme=night#/themes">Night</a> <br>
|
||||
<a href="?theme=moon#/themes">Moon</a> -
|
||||
<a href="?theme=solarized#/themes">Solarized</a>
|
||||
</p>
|
||||
<p>
|
||||
<small>
|
||||
@@ -259,10 +267,10 @@ function linkify( selector ) {
|
||||
for( var i = 0, len = nodes.length; i < len; i++ ) {
|
||||
var node = nodes[i];
|
||||
|
||||
if( !node.className ) ) {
|
||||
if( !node.className ) {
|
||||
node.className += ' roll';
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
@@ -278,7 +286,7 @@ function linkify( selector ) {
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section>
|
||||
<section id="fragments">
|
||||
<h2>Fragmented Views</h2>
|
||||
<p>Hit the next arrow...</p>
|
||||
<p class="fragment">... to step through ...</p>
|
||||
@@ -302,6 +310,8 @@ function linkify( selector ) {
|
||||
<p class="fragment highlight-red">highlight-red</p>
|
||||
<p class="fragment highlight-green">highlight-green</p>
|
||||
<p class="fragment highlight-blue">highlight-blue</p>
|
||||
<p class="fragment current-visible">current-visible</p>
|
||||
<p class="fragment highlight-current-blue">highlight-current-blue</p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -363,6 +373,10 @@ function linkify( selector ) {
|
||||
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
|
||||
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
|
||||
|
||||
// Parallax scrolling
|
||||
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
|
||||
// parallaxBackgroundSize: '2100px 900px',
|
||||
|
||||
// Optional libraries used to extend on reveal.js
|
||||
dependencies: [
|
||||
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
||||
|
1202
js/reveal.js
1202
js/reveal.js
File diff suppressed because it is too large
Load Diff
7
js/reveal.min.js
vendored
7
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -13,11 +13,13 @@ pre code {
|
||||
|
||||
pre .keyword,
|
||||
pre .tag,
|
||||
pre .django .tag,
|
||||
pre .django .keyword,
|
||||
pre .css .class,
|
||||
pre .css .id,
|
||||
pre .lisp .title {
|
||||
pre .lisp .title,
|
||||
pre .nginx .title,
|
||||
pre .request,
|
||||
pre .status,
|
||||
pre .clojure .attribute {
|
||||
color: #E3CEAB;
|
||||
}
|
||||
|
||||
@@ -49,32 +51,27 @@ pre .tex .special {
|
||||
}
|
||||
|
||||
pre .diff .chunk,
|
||||
pre .ruby .subst {
|
||||
pre .subst {
|
||||
color: #8F8F8F;
|
||||
}
|
||||
|
||||
pre .dos .keyword,
|
||||
pre .python .decorator,
|
||||
pre .class .title,
|
||||
pre .haskell .label,
|
||||
pre .function .title,
|
||||
pre .ini .title,
|
||||
pre .title,
|
||||
pre .haskell .type,
|
||||
pre .diff .header,
|
||||
pre .ruby .class .parent,
|
||||
pre .apache .tag,
|
||||
pre .nginx .built_in,
|
||||
pre .tex .command,
|
||||
pre .input_number {
|
||||
pre .prompt {
|
||||
color: #efef8f;
|
||||
}
|
||||
|
||||
pre .dos .winutils,
|
||||
pre .ruby .symbol,
|
||||
pre .ruby .symbol .string,
|
||||
pre .ruby .symbol .keyword,
|
||||
pre .ruby .symbol .keymethods,
|
||||
pre .ruby .string,
|
||||
pre .ruby .instancevar {
|
||||
pre .ruby .string {
|
||||
color: #DCA3A3;
|
||||
}
|
||||
|
||||
@@ -106,10 +103,12 @@ pre .doctype {
|
||||
color: #7F9F7F;
|
||||
}
|
||||
|
||||
pre .xml .css,
|
||||
pre .coffeescript .javascript,
|
||||
pre .javascript .xml,
|
||||
pre .tex .formula,
|
||||
pre .xml .javascript,
|
||||
pre .xml .vbscript,
|
||||
pre .tex .formula {
|
||||
pre .xml .css,
|
||||
pre .xml .cdata {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
}
|
19
package.json
19
package.json
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "reveal.js",
|
||||
"version": "2.5.0",
|
||||
"version": "2.6.2",
|
||||
"description": "The HTML Presentation Framework",
|
||||
"homepage": "http://lab.hakim.se/reveal-js",
|
||||
"subdomain": "revealjs",
|
||||
"scripts": {
|
||||
"test": "grunt jshint",
|
||||
"test": "grunt test",
|
||||
"start": ""
|
||||
},
|
||||
"author": {
|
||||
@@ -21,18 +21,19 @@
|
||||
"node": "~0.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"underscore": "~1.3.3",
|
||||
"underscore": "~1.5.1",
|
||||
"express": "~2.5.9",
|
||||
"mustache": "~0.4.0",
|
||||
"mustache": "~0.7.2",
|
||||
"socket.io": "~0.9.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt-contrib-jshint": "~0.2.0",
|
||||
"grunt-contrib-qunit": "~0.2.2",
|
||||
"grunt-contrib-jshint": "~0.6.4",
|
||||
"grunt-contrib-cssmin": "~0.4.1",
|
||||
"grunt-contrib-uglify": "~0.1.1",
|
||||
"grunt-contrib-watch": "~0.2.0",
|
||||
"grunt-contrib-sass": "~0.2.2",
|
||||
"grunt-contrib-connect": "~0.2.0",
|
||||
"grunt-contrib-uglify": "~0.2.4",
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-contrib-sass": "~0.5.0",
|
||||
"grunt-contrib-connect": "~0.4.1",
|
||||
"grunt-zip": "~0.7.0",
|
||||
"grunt": "~0.4.0"
|
||||
},
|
||||
|
File diff suppressed because one or more lines are too long
@@ -8,6 +8,8 @@
|
||||
|
||||
<link rel="stylesheet" href="../../css/reveal.css">
|
||||
<link rel="stylesheet" href="../../css/theme/default.css" id="theme">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/css/zenburn.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -66,6 +68,37 @@
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<!-- Slide attributes -->
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
<!-- .slide: data-background="#000000" -->
|
||||
## Slide attributes
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<!-- Element attributes -->
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
## Element attributes
|
||||
- Item 1 <!-- .element: class="fragment" data-fragment-index="2" -->
|
||||
- Item 2 <!-- .element: class="fragment" data-fragment-index="1" -->
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<!-- Code -->
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
```php
|
||||
public function foo()
|
||||
{
|
||||
$foo = array(
|
||||
'bar' => 'bar'
|
||||
)
|
||||
}
|
||||
```
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -80,14 +113,12 @@
|
||||
history: true,
|
||||
center: true,
|
||||
|
||||
theme: Reveal.getQueryHash().theme,
|
||||
transition: Reveal.getQueryHash().transition || 'default',
|
||||
|
||||
// Optional libraries used to extend on reveal.js
|
||||
dependencies: [
|
||||
{ src: '../../lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
||||
{ src: 'marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||||
{ src: 'markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||||
{ src: '../highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
|
||||
{ src: '../notes/notes.js' }
|
||||
]
|
||||
});
|
||||
|
@@ -1,220 +1,392 @@
|
||||
// From https://gist.github.com/1343518
|
||||
// Modified by Hakim to handle Markdown indented with tabs
|
||||
(function(){
|
||||
/**
|
||||
* The reveal.js markdown plugin. Handles parsing of
|
||||
* markdown inside of presentations as well as loading
|
||||
* of external markdown documents.
|
||||
*/
|
||||
(function( root, factory ) {
|
||||
if( typeof exports === 'object' ) {
|
||||
module.exports = factory( require( './marked' ) );
|
||||
}
|
||||
else {
|
||||
// Browser globals (root is window)
|
||||
root.RevealMarkdown = factory( root.marked );
|
||||
root.RevealMarkdown.initialize();
|
||||
}
|
||||
}( this, function( marked ) {
|
||||
|
||||
if( typeof marked === 'undefined' ) {
|
||||
throw 'The reveal.js Markdown plugin requires marked to be loaded';
|
||||
}
|
||||
if( typeof marked === 'undefined' ) {
|
||||
throw 'The reveal.js Markdown plugin requires marked to be loaded';
|
||||
}
|
||||
|
||||
if (typeof hljs !== 'undefined') {
|
||||
marked.setOptions({
|
||||
highlight: function (lang, code) {
|
||||
return hljs.highlightAuto(lang, code).value;
|
||||
}
|
||||
});
|
||||
}
|
||||
if( typeof hljs !== 'undefined' ) {
|
||||
marked.setOptions({
|
||||
highlight: function( lang, code ) {
|
||||
return hljs.highlightAuto( lang, code ).value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var stripLeadingWhitespace = function(section) {
|
||||
var DEFAULT_SLIDE_SEPARATOR = '^\n---\n$',
|
||||
DEFAULT_NOTES_SEPARATOR = 'note:',
|
||||
DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR = '\\\.element\\\s*?(.+?)$',
|
||||
DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR = '\\\.slide:\\\s*?(\\\S.+?)$';
|
||||
|
||||
var template = section.querySelector( 'script' );
|
||||
|
||||
// strip leading whitespace so it isn't evaluated as code
|
||||
var text = ( template || section ).textContent;
|
||||
/**
|
||||
* Retrieves the markdown contents of a slide section
|
||||
* element. Normalizes leading tabs/whitespace.
|
||||
*/
|
||||
function getMarkdownFromSlide( section ) {
|
||||
|
||||
var leadingWs = text.match(/^\n?(\s*)/)[1].length,
|
||||
leadingTabs = text.match(/^\n?(\t*)/)[1].length;
|
||||
var template = section.querySelector( 'script' );
|
||||
|
||||
if( leadingTabs > 0 ) {
|
||||
text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
|
||||
}
|
||||
else if( leadingWs > 1 ) {
|
||||
text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' );
|
||||
}
|
||||
// strip leading whitespace so it isn't evaluated as code
|
||||
var text = ( template || section ).textContent;
|
||||
|
||||
return text;
|
||||
var leadingWs = text.match( /^\n?(\s*)/ )[1].length,
|
||||
leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
|
||||
|
||||
};
|
||||
if( leadingTabs > 0 ) {
|
||||
text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
|
||||
}
|
||||
else if( leadingWs > 1 ) {
|
||||
text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' );
|
||||
}
|
||||
|
||||
var twrap = function(el) {
|
||||
var content = el.content || el;
|
||||
content += el.asideContent ? ('<aside class="notes" data-markdown>' + el.asideContent + '</aside>') : '';
|
||||
return '<script type="text/template">' + content + '</script>';
|
||||
};
|
||||
return text;
|
||||
|
||||
var getForwardedAttributes = function(section) {
|
||||
var attributes = section.attributes;
|
||||
var result = [];
|
||||
}
|
||||
|
||||
for( var i = 0, len = attributes.length; i < len; i++ ) {
|
||||
var name = attributes[i].name,
|
||||
value = attributes[i].value;
|
||||
/**
|
||||
* Given a markdown slide section element, this will
|
||||
* return all arguments that aren't related to markdown
|
||||
* parsing. Used to forward any other user-defined arguments
|
||||
* to the output markdown slide.
|
||||
*/
|
||||
function getForwardedAttributes( section ) {
|
||||
|
||||
// disregard attributes that are used for markdown loading/parsing
|
||||
if( /data\-(markdown|separator|vertical|notes)/gi.test( name ) ) continue;
|
||||
var attributes = section.attributes;
|
||||
var result = [];
|
||||
|
||||
if( value ) {
|
||||
result.push( name + '=' + value );
|
||||
}
|
||||
else {
|
||||
result.push( name );
|
||||
}
|
||||
}
|
||||
for( var i = 0, len = attributes.length; i < len; i++ ) {
|
||||
var name = attributes[i].name,
|
||||
value = attributes[i].value;
|
||||
|
||||
return result.join( ' ' );
|
||||
};
|
||||
// disregard attributes that are used for markdown loading/parsing
|
||||
if( /data\-(markdown|separator|vertical|notes)/gi.test( name ) ) continue;
|
||||
|
||||
var slidifyMarkdown = function(markdown, separator, vertical, notes, attributes) {
|
||||
if( value ) {
|
||||
result.push( name + '=' + value );
|
||||
}
|
||||
else {
|
||||
result.push( name );
|
||||
}
|
||||
}
|
||||
|
||||
separator = separator || '^\n---\n$';
|
||||
notes = notes || 'note:';
|
||||
return result.join( ' ' );
|
||||
|
||||
var separatorRegex = new RegExp( separator + ( vertical ? '|' + vertical : '' ), 'mg' ),
|
||||
horizontalSeparatorRegex = new RegExp( separator ),
|
||||
notesSeparatorRegex = new RegExp( notes, 'mgi' ),
|
||||
matches,
|
||||
noteMatch,
|
||||
lastIndex = 0,
|
||||
isHorizontal,
|
||||
wasHorizontal = true,
|
||||
content,
|
||||
asideContent,
|
||||
slide,
|
||||
sectionStack = [],
|
||||
markdownSections = '';
|
||||
}
|
||||
|
||||
// iterate until all blocks between separators are stacked up
|
||||
while( matches = separatorRegex.exec( markdown ) ) {
|
||||
asideContent = null;
|
||||
/**
|
||||
* Inspects the given options and fills out default
|
||||
* values for what's not defined.
|
||||
*/
|
||||
function getSlidifyOptions( options ) {
|
||||
|
||||
// determine direction (horizontal by default)
|
||||
isHorizontal = horizontalSeparatorRegex.test( matches[0] );
|
||||
options = options || {};
|
||||
options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR;
|
||||
options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR;
|
||||
options.attributes = options.attributes || '';
|
||||
|
||||
if( !isHorizontal && wasHorizontal ) {
|
||||
// create vertical stack
|
||||
sectionStack.push( [] );
|
||||
}
|
||||
return options;
|
||||
|
||||
// pluck slide content from markdown input
|
||||
content = markdown.substring( lastIndex, matches.index );
|
||||
noteMatch = content.split( notesSeparatorRegex );
|
||||
}
|
||||
|
||||
if( noteMatch.length === 2 ) {
|
||||
content = noteMatch[0];
|
||||
asideContent = noteMatch[1].trim();
|
||||
}
|
||||
/**
|
||||
* Helper function for constructing a markdown slide.
|
||||
*/
|
||||
function createMarkdownSlide( content, options ) {
|
||||
|
||||
slide = {
|
||||
content: content,
|
||||
asideContent: asideContent || ""
|
||||
};
|
||||
options = getSlidifyOptions( options );
|
||||
|
||||
if( isHorizontal && wasHorizontal ) {
|
||||
// add to horizontal stack
|
||||
sectionStack.push(slide);
|
||||
} else {
|
||||
// add to vertical stack
|
||||
sectionStack[sectionStack.length-1].push(slide);
|
||||
}
|
||||
var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) );
|
||||
|
||||
lastIndex = separatorRegex.lastIndex;
|
||||
wasHorizontal = isHorizontal;
|
||||
}
|
||||
if( notesMatch.length === 2 ) {
|
||||
content = notesMatch[0] + '<aside class="notes" data-markdown>' + notesMatch[1].trim() + '</aside>';
|
||||
}
|
||||
|
||||
// add the remaining slide
|
||||
(wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1]).push(markdown.substring(lastIndex));
|
||||
return '<script type="text/template">' + content + '</script>';
|
||||
|
||||
// flatten the hierarchical stack, and insert <section data-markdown> tags
|
||||
for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
|
||||
// vertical
|
||||
if( sectionStack[k].propertyIsEnumerable(length) && typeof sectionStack[k].splice === 'function' ) {
|
||||
markdownSections += '<section '+ attributes +'>' +
|
||||
'<section data-markdown>' + sectionStack[k].map(twrap).join('</section><section data-markdown>') + '</section>' +
|
||||
'</section>';
|
||||
} else {
|
||||
markdownSections += '<section '+ attributes +' data-markdown>' + twrap( sectionStack[k] ) + '</section>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return markdownSections;
|
||||
};
|
||||
/**
|
||||
* Parses a data string into multiple slides based
|
||||
* on the passed in separator arguments.
|
||||
*/
|
||||
function slidify( markdown, options ) {
|
||||
|
||||
var querySlidingMarkdown = function() {
|
||||
options = getSlidifyOptions( options );
|
||||
|
||||
var sections = document.querySelectorAll( '[data-markdown]'),
|
||||
section;
|
||||
var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ),
|
||||
horizontalSeparatorRegex = new RegExp( options.separator );
|
||||
|
||||
for( var j = 0, jlen = sections.length; j < jlen; j++ ) {
|
||||
var matches,
|
||||
lastIndex = 0,
|
||||
isHorizontal,
|
||||
wasHorizontal = true,
|
||||
content,
|
||||
sectionStack = [];
|
||||
|
||||
section = sections[j];
|
||||
// iterate until all blocks between separators are stacked up
|
||||
while( matches = separatorRegex.exec( markdown ) ) {
|
||||
notes = null;
|
||||
|
||||
if( section.getAttribute('data-markdown').length ) {
|
||||
// determine direction (horizontal by default)
|
||||
isHorizontal = horizontalSeparatorRegex.test( matches[0] );
|
||||
|
||||
var xhr = new XMLHttpRequest(),
|
||||
url = section.getAttribute('data-markdown');
|
||||
if( !isHorizontal && wasHorizontal ) {
|
||||
// create vertical stack
|
||||
sectionStack.push( [] );
|
||||
}
|
||||
|
||||
datacharset = section.getAttribute('data-charset');
|
||||
// see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes
|
||||
if (datacharset != null && datacharset != '') {
|
||||
xhr.overrideMimeType('text/html; charset=' + datacharset);
|
||||
}
|
||||
// pluck slide content from markdown input
|
||||
content = markdown.substring( lastIndex, matches.index );
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if( xhr.readyState === 4 ) {
|
||||
if (xhr.status >= 200 && xhr.status < 300) {
|
||||
section.outerHTML = slidifyMarkdown( xhr.responseText, section.getAttribute('data-separator'), section.getAttribute('data-vertical'), section.getAttribute('data-notes'), getForwardedAttributes(section) );
|
||||
} else {
|
||||
section.outerHTML = '<section data-state="alert">ERROR: The attempt to fetch ' + url + ' failed with the HTTP status ' + xhr.status +
|
||||
'. Check your browser\'s JavaScript console for more details.' +
|
||||
'<p>Remember that you need to serve the presentation HTML from a HTTP server and the Markdown file must be there too.</p></section>';
|
||||
}
|
||||
}
|
||||
};
|
||||
if( isHorizontal && wasHorizontal ) {
|
||||
// add to horizontal stack
|
||||
sectionStack.push( content );
|
||||
}
|
||||
else {
|
||||
// add to vertical stack
|
||||
sectionStack[sectionStack.length-1].push( content );
|
||||
}
|
||||
|
||||
xhr.open('GET', url, false);
|
||||
try {
|
||||
xhr.send();
|
||||
} catch (e) {
|
||||
alert('Failed to get the Markdown file ' + url + '. Make sure that the presentation and the file are served by a HTTP server and the file can be found there. ' + e);
|
||||
}
|
||||
lastIndex = separatorRegex.lastIndex;
|
||||
wasHorizontal = isHorizontal;
|
||||
}
|
||||
|
||||
} else if( section.getAttribute('data-separator') ) {
|
||||
// add the remaining slide
|
||||
( wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1] ).push( markdown.substring( lastIndex ) );
|
||||
|
||||
var markdown = stripLeadingWhitespace(section);
|
||||
section.outerHTML = slidifyMarkdown( markdown, section.getAttribute('data-separator'), section.getAttribute('data-vertical'), section.getAttribute('data-notes'), getForwardedAttributes(section) );
|
||||
var markdownSections = '';
|
||||
|
||||
}
|
||||
}
|
||||
// flatten the hierarchical stack, and insert <section data-markdown> tags
|
||||
for( var i = 0, len = sectionStack.length; i < len; i++ ) {
|
||||
// vertical
|
||||
if( sectionStack[i] instanceof Array ) {
|
||||
markdownSections += '<section '+ options.attributes +'>';
|
||||
|
||||
};
|
||||
sectionStack[i].forEach( function( child ) {
|
||||
markdownSections += '<section data-markdown>' + createMarkdownSlide( child, options ) + '</section>';
|
||||
} );
|
||||
|
||||
var queryMarkdownSlides = function() {
|
||||
markdownSections += '</section>';
|
||||
}
|
||||
else {
|
||||
markdownSections += '<section '+ options.attributes +' data-markdown>' + createMarkdownSlide( sectionStack[i], options ) + '</section>';
|
||||
}
|
||||
}
|
||||
|
||||
var sections = document.querySelectorAll( '[data-markdown]');
|
||||
return markdownSections;
|
||||
|
||||
for( var j = 0, jlen = sections.length; j < jlen; j++ ) {
|
||||
}
|
||||
|
||||
makeHtml(sections[j]);
|
||||
/**
|
||||
* Parses any current data-markdown slides, splits
|
||||
* multi-slide markdown into separate sections and
|
||||
* handles loading of external markdown.
|
||||
*/
|
||||
function processSlides() {
|
||||
|
||||
}
|
||||
var sections = document.querySelectorAll( '[data-markdown]'),
|
||||
section;
|
||||
|
||||
};
|
||||
for( var i = 0, len = sections.length; i < len; i++ ) {
|
||||
|
||||
var makeHtml = function(section) {
|
||||
section = sections[i];
|
||||
|
||||
var notes = section.querySelector( 'aside.notes' );
|
||||
if( section.getAttribute( 'data-markdown' ).length ) {
|
||||
|
||||
var markdown = stripLeadingWhitespace(section);
|
||||
var xhr = new XMLHttpRequest(),
|
||||
url = section.getAttribute( 'data-markdown' );
|
||||
|
||||
section.innerHTML = marked(markdown);
|
||||
datacharset = section.getAttribute( 'data-charset' );
|
||||
|
||||
if( notes ) {
|
||||
section.appendChild( notes );
|
||||
}
|
||||
// see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes
|
||||
if( datacharset != null && datacharset != '' ) {
|
||||
xhr.overrideMimeType( 'text/html; charset=' + datacharset );
|
||||
}
|
||||
|
||||
};
|
||||
xhr.onreadystatechange = function() {
|
||||
if( xhr.readyState === 4 ) {
|
||||
if ( xhr.status >= 200 && xhr.status < 300 ) {
|
||||
|
||||
querySlidingMarkdown();
|
||||
section.outerHTML = slidify( xhr.responseText, {
|
||||
separator: section.getAttribute( 'data-separator' ),
|
||||
verticalSeparator: section.getAttribute( 'data-vertical' ),
|
||||
notesSeparator: section.getAttribute( 'data-notes' ),
|
||||
attributes: getForwardedAttributes( section )
|
||||
});
|
||||
|
||||
queryMarkdownSlides();
|
||||
}
|
||||
else {
|
||||
|
||||
})();
|
||||
section.outerHTML = '<section data-state="alert">' +
|
||||
'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' +
|
||||
'Check your browser\'s JavaScript console for more details.' +
|
||||
'<p>Remember that you need to serve the presentation HTML from a HTTP server.</p>' +
|
||||
'</section>';
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.open( 'GET', url, false );
|
||||
|
||||
try {
|
||||
xhr.send();
|
||||
}
|
||||
catch ( e ) {
|
||||
alert( 'Failed to get the Markdown file ' + url + '. Make sure that the presentation and the file are served by a HTTP server and the file can be found there. ' + e );
|
||||
}
|
||||
|
||||
}
|
||||
else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-vertical' ) || section.getAttribute( 'data-notes' ) ) {
|
||||
|
||||
section.outerHTML = slidify( getMarkdownFromSlide( section ), {
|
||||
separator: section.getAttribute( 'data-separator' ),
|
||||
verticalSeparator: section.getAttribute( 'data-vertical' ),
|
||||
notesSeparator: section.getAttribute( 'data-notes' ),
|
||||
attributes: getForwardedAttributes( section )
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
section.innerHTML = createMarkdownSlide( getMarkdownFromSlide( section ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a node value has the attributes pattern.
|
||||
* If yes, extract it and add that value as one or several attributes
|
||||
* the the terget element.
|
||||
*
|
||||
* You need Cache Killer on Chrome to see the effect on any FOM transformation
|
||||
* directly on refresh (F5)
|
||||
* http://stackoverflow.com/questions/5690269/disabling-chrome-cache-for-website-development/7000899#answer-11786277
|
||||
*/
|
||||
function addAttributeInElement( node, elementTarget, separator ) {
|
||||
|
||||
var mardownClassesInElementsRegex = new RegExp( separator, 'mg' );
|
||||
var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"=]+?)\"", 'mg' );
|
||||
var nodeValue = node.nodeValue;
|
||||
if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) {
|
||||
|
||||
var classes = matches[1];
|
||||
nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( mardownClassesInElementsRegex.lastIndex );
|
||||
node.nodeValue = nodeValue;
|
||||
while( matchesClass = mardownClassRegex.exec( classes ) ) {
|
||||
elementTarget.setAttribute( matchesClass[1], matchesClass[2] );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to the parent element of a text node,
|
||||
* or the element of an attribute node.
|
||||
*/
|
||||
function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) {
|
||||
|
||||
if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) {
|
||||
previousParentElement = element;
|
||||
for( var i = 0; i < element.childNodes.length; i++ ) {
|
||||
childElement = element.childNodes[i];
|
||||
if ( i > 0 ) {
|
||||
j = i - 1;
|
||||
while ( j >= 0 ) {
|
||||
aPreviousChildElement = element.childNodes[j];
|
||||
if ( typeof aPreviousChildElement.setAttribute == 'function' && aPreviousChildElement.tagName != "BR" ) {
|
||||
previousParentElement = aPreviousChildElement;
|
||||
break;
|
||||
}
|
||||
j = j - 1;
|
||||
}
|
||||
}
|
||||
parentSection = section;
|
||||
if( childElement.nodeName == "section" ) {
|
||||
parentSection = childElement ;
|
||||
previousParentElement = childElement ;
|
||||
}
|
||||
if ( typeof childElement.setAttribute == 'function' || childElement.nodeType == Node.COMMENT_NODE ) {
|
||||
addAttributes( parentSection, childElement, previousParentElement, separatorElementAttributes, separatorSectionAttributes );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( element.nodeType == Node.COMMENT_NODE ) {
|
||||
if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) == false ) {
|
||||
addAttributeInElement( element, section, separatorSectionAttributes );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts any current data-markdown slides in the
|
||||
* DOM to HTML.
|
||||
*/
|
||||
function convertSlides() {
|
||||
|
||||
var sections = document.querySelectorAll( '[data-markdown]');
|
||||
|
||||
for( var i = 0, len = sections.length; i < len; i++ ) {
|
||||
|
||||
var section = sections[i];
|
||||
|
||||
// Only parse the same slide once
|
||||
if( !section.getAttribute( 'data-markdown-parsed' ) ) {
|
||||
|
||||
section.setAttribute( 'data-markdown-parsed', true )
|
||||
|
||||
var notes = section.querySelector( 'aside.notes' );
|
||||
var markdown = getMarkdownFromSlide( section );
|
||||
|
||||
section.innerHTML = marked( markdown );
|
||||
addAttributes( section, section, null, section.getAttribute( 'data-element-attributes' ) ||
|
||||
section.parentNode.getAttribute( 'data-element-attributes' ) ||
|
||||
DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR,
|
||||
section.getAttribute( 'data-attributes' ) ||
|
||||
section.parentNode.getAttribute( 'data-attributes' ) ||
|
||||
DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR);
|
||||
|
||||
// If there were notes, we need to re-add them after
|
||||
// having overwritten the section's HTML
|
||||
if( notes ) {
|
||||
section.appendChild( notes );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// API
|
||||
return {
|
||||
|
||||
initialize: function() {
|
||||
processSlides();
|
||||
convertSlides();
|
||||
},
|
||||
|
||||
// TODO: Do these belong in the API?
|
||||
processSlides: processSlides,
|
||||
convertSlides: convertSlides,
|
||||
slidify: slidify
|
||||
|
||||
};
|
||||
|
||||
}));
|
||||
|
@@ -1,6 +1,7 @@
|
||||
(function() {
|
||||
// don't emit events from inside the previews themselves
|
||||
// Don't emit events from inside of notes windows
|
||||
if ( window.location.search.match( /receiver/gi ) ) { return; }
|
||||
|
||||
var multiplex = Reveal.getConfig().multiplex;
|
||||
|
||||
var socket = io.connect(multiplex.url);
|
||||
|
@@ -138,12 +138,20 @@
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
function getNotesURL( controls ) {
|
||||
return window.opener.location.protocol + '//' + window.opener.location.host + window.opener.location.pathname + '?receiver&controls='+ ( controls || 'false' ) +'&progress=false&overview=false' + window.opener.location.hash;
|
||||
}
|
||||
var notesCurrentSlideURL = getNotesURL( true );
|
||||
var notesNextSlideURL = getNotesURL( false );
|
||||
</script>
|
||||
|
||||
<div id="wrap-current-slide" class="slides">
|
||||
<script>document.write( '<iframe width="1280" height="1024" id="current-slide" src="'+ window.opener.location.href +'"></iframe>' );</script>
|
||||
<script>document.write( '<iframe width="1280" height="1024" id="current-slide" src="'+ notesCurrentSlideURL +'"></iframe>' );</script>
|
||||
</div>
|
||||
|
||||
<div id="wrap-next-slide" class="slides">
|
||||
<script>document.write( '<iframe width="640" height="512" id="next-slide" src="'+ window.opener.location.href +'"></iframe>' );</script>
|
||||
<script>document.write( '<iframe width="640" height="512" id="next-slide" src="'+ notesNextSlideURL +'"></iframe>' );</script>
|
||||
<span>UPCOMING:</span>
|
||||
</div>
|
||||
|
||||
|
@@ -17,11 +17,11 @@
|
||||
* Detects if notes are enable and the current page is opened inside an /iframe
|
||||
* this prevents loading Remotes.io several times
|
||||
*/
|
||||
var remotesAndIsNotes = (function(){
|
||||
return !(window.RevealNotes && self == top);
|
||||
var isNotesAndIframe = (function(){
|
||||
return window.RevealNotes && !(self == top);
|
||||
})();
|
||||
|
||||
if(!hasTouch && !remotesAndIsNotes){
|
||||
if(!hasTouch && !isNotesAndIframe){
|
||||
head.ready( 'remotes.ne.min.js', function() {
|
||||
new Remotes("preview")
|
||||
.on("swipe-left", function(e){ Reveal.right(); })
|
||||
@@ -34,6 +34,6 @@
|
||||
;
|
||||
} );
|
||||
|
||||
head.js('https://raw.github.com/Remotes/Remotes/master/dist/remotes.ne.min.js');
|
||||
head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js');
|
||||
}
|
||||
})(window);
|
@@ -3,7 +3,9 @@
|
||||
var isEnabled = true;
|
||||
|
||||
document.querySelector( '.reveal' ).addEventListener( 'mousedown', function( event ) {
|
||||
if( event.altKey && isEnabled ) {
|
||||
var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key';
|
||||
|
||||
if( event[ modifier ] && isEnabled ) {
|
||||
event.preventDefault();
|
||||
zoom.to({ element: event.target, pan: false });
|
||||
}
|
||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -6,7 +6,7 @@
|
||||
|
||||
<title>reveal.js - Barebones</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../../css/reveal.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -29,8 +29,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../../js/reveal.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
@@ -8,8 +8,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../css/theme/default.css" id="theme">
|
||||
<link rel="stylesheet" href="../../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../../css/theme/default.css" id="theme">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../../lib/js/head.min.js"></script>
|
||||
<script src="../../js/reveal.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
@@ -8,8 +8,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../css/theme/night.css" id="theme">
|
||||
<link rel="stylesheet" href="../../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../../css/theme/night.css" id="theme">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -159,8 +159,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../../lib/js/head.min.js"></script>
|
||||
<script src="../../js/reveal.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -174,8 +174,8 @@
|
||||
},
|
||||
|
||||
dependencies: [
|
||||
{ src: '../lib/js/classList.js' },
|
||||
{ src: '../plugin/math/math.js', async: true }
|
||||
{ src: '../../lib/js/classList.js' },
|
||||
{ src: '../../plugin/math/math.js', async: true }
|
||||
]
|
||||
});
|
||||
|
@@ -8,8 +8,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../css/theme/serif.css" id="theme">
|
||||
<link rel="stylesheet" href="../../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="../../css/theme/serif.css" id="theme">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -75,12 +75,33 @@
|
||||
<h2>Same background twice (2/2)</h2>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section data-background="#417203">
|
||||
<h2>Same background twice vertical (1/2)</h2>
|
||||
</section>
|
||||
<section data-background="#417203">
|
||||
<h2>Same background twice vertical (2/2)</h2>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section data-background="#934f4d">
|
||||
<h2>Same background from horizontal to vertical (1/3)</h2>
|
||||
</section>
|
||||
<section>
|
||||
<section data-background="#934f4d">
|
||||
<h2>Same background from horizontal to vertical (2/3)</h2>
|
||||
</section>
|
||||
<section data-background="#934f4d">
|
||||
<h2>Same background from horizontal to vertical (3/3)</h2>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../../lib/js/head.min.js"></script>
|
||||
<script src="../../js/reveal.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -92,7 +113,7 @@
|
||||
|
||||
transition: 'linear',
|
||||
// transitionSpeed: 'slow',
|
||||
// backgroundTransition: 'linear'
|
||||
// backgroundTransition: 'slide'
|
||||
});
|
||||
|
||||
</script>
|
244
test/qunit-1.12.0.css
Normal file
244
test/qunit-1.12.0.css
Normal file
@@ -0,0 +1,244 @@
|
||||
/**
|
||||
* QUnit v1.12.0 - A JavaScript Unit Testing Framework
|
||||
*
|
||||
* http://qunitjs.com
|
||||
*
|
||||
* Copyright 2012 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
/** Font Family and Sizes */
|
||||
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
|
||||
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
|
||||
#qunit-tests { font-size: smaller; }
|
||||
|
||||
|
||||
/** Resets */
|
||||
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/** Header */
|
||||
|
||||
#qunit-header {
|
||||
padding: 0.5em 0 0.5em 1em;
|
||||
|
||||
color: #8699a4;
|
||||
background-color: #0d3349;
|
||||
|
||||
font-size: 1.5em;
|
||||
line-height: 1em;
|
||||
font-weight: normal;
|
||||
|
||||
border-radius: 5px 5px 0 0;
|
||||
-moz-border-radius: 5px 5px 0 0;
|
||||
-webkit-border-top-right-radius: 5px;
|
||||
-webkit-border-top-left-radius: 5px;
|
||||
}
|
||||
|
||||
#qunit-header a {
|
||||
text-decoration: none;
|
||||
color: #c2ccd1;
|
||||
}
|
||||
|
||||
#qunit-header a:hover,
|
||||
#qunit-header a:focus {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar label {
|
||||
display: inline-block;
|
||||
padding: 0 .5em 0 .1em;
|
||||
}
|
||||
|
||||
#qunit-banner {
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
#qunit-testrunner-toolbar {
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
color: #5E740B;
|
||||
background-color: #eee;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#qunit-userAgent {
|
||||
padding: 0.5em 0 0.5em 2.5em;
|
||||
background-color: #2b81af;
|
||||
color: #fff;
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||
}
|
||||
|
||||
#qunit-modulefilter-container {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/** Tests: Pass/Fail */
|
||||
|
||||
#qunit-tests {
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
#qunit-tests li {
|
||||
padding: 0.4em 0.5em 0.4em 2.5em;
|
||||
border-bottom: 1px solid #fff;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests li strong {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#qunit-tests li a {
|
||||
padding: 0.5em;
|
||||
color: #c2ccd1;
|
||||
text-decoration: none;
|
||||
}
|
||||
#qunit-tests li a:hover,
|
||||
#qunit-tests li a:focus {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#qunit-tests li .runtime {
|
||||
float: right;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.qunit-assert-list {
|
||||
margin-top: 0.5em;
|
||||
padding: 0.5em;
|
||||
|
||||
background-color: #fff;
|
||||
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
.qunit-collapsed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests table {
|
||||
border-collapse: collapse;
|
||||
margin-top: .2em;
|
||||
}
|
||||
|
||||
#qunit-tests th {
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
padding: 0 .5em 0 0;
|
||||
}
|
||||
|
||||
#qunit-tests td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#qunit-tests pre {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#qunit-tests del {
|
||||
background-color: #e0f2be;
|
||||
color: #374e0c;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#qunit-tests ins {
|
||||
background-color: #ffcaca;
|
||||
color: #500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/*** Test Counts */
|
||||
|
||||
#qunit-tests b.counts { color: black; }
|
||||
#qunit-tests b.passed { color: #5E740B; }
|
||||
#qunit-tests b.failed { color: #710909; }
|
||||
|
||||
#qunit-tests li li {
|
||||
padding: 5px;
|
||||
background-color: #fff;
|
||||
border-bottom: none;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
/*** Passing Styles */
|
||||
|
||||
#qunit-tests li li.pass {
|
||||
color: #3c510c;
|
||||
background-color: #fff;
|
||||
border-left: 10px solid #C6E746;
|
||||
}
|
||||
|
||||
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
|
||||
#qunit-tests .pass .test-name { color: #366097; }
|
||||
|
||||
#qunit-tests .pass .test-actual,
|
||||
#qunit-tests .pass .test-expected { color: #999999; }
|
||||
|
||||
#qunit-banner.qunit-pass { background-color: #C6E746; }
|
||||
|
||||
/*** Failing Styles */
|
||||
|
||||
#qunit-tests li li.fail {
|
||||
color: #710909;
|
||||
background-color: #fff;
|
||||
border-left: 10px solid #EE5757;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
#qunit-tests > li:last-child {
|
||||
border-radius: 0 0 5px 5px;
|
||||
-moz-border-radius: 0 0 5px 5px;
|
||||
-webkit-border-bottom-right-radius: 5px;
|
||||
-webkit-border-bottom-left-radius: 5px;
|
||||
}
|
||||
|
||||
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
|
||||
#qunit-tests .fail .test-name,
|
||||
#qunit-tests .fail .module-name { color: #000000; }
|
||||
|
||||
#qunit-tests .fail .test-actual { color: #EE5757; }
|
||||
#qunit-tests .fail .test-expected { color: green; }
|
||||
|
||||
#qunit-banner.qunit-fail { background-color: #EE5757; }
|
||||
|
||||
|
||||
/** Result */
|
||||
|
||||
#qunit-testresult {
|
||||
padding: 0.5em 0.5em 0.5em 2.5em;
|
||||
|
||||
color: #2b81af;
|
||||
background-color: #D2E0E6;
|
||||
|
||||
border-bottom: 1px solid white;
|
||||
}
|
||||
#qunit-testresult .module-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/** Fixture */
|
||||
|
||||
#qunit-fixture {
|
||||
position: absolute;
|
||||
top: -10000px;
|
||||
left: -10000px;
|
||||
width: 1000px;
|
||||
height: 1000px;
|
||||
}
|
2212
test/qunit-1.12.0.js
Normal file
2212
test/qunit-1.12.0.js
Normal file
File diff suppressed because it is too large
Load Diff
134
test/test-markdown-element-attributes.html
Normal file
134
test/test-markdown-element-attributes.html
Normal file
@@ -0,0 +1,134 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Markdown Element Attributes</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="qunit-1.12.0.css">
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<div class="reveal" style="display: none;">
|
||||
|
||||
<div class="slides">
|
||||
|
||||
<!-- <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n"></section> -->
|
||||
|
||||
<!-- Slides are separated by newline + three dashes + newline, vertical slides identical but two dashes -->
|
||||
<section data-markdown data-separator="^\n---\n$" data-vertical="^\n--\n$" data-element-attributes="{_\s*?([^}]+?)}">>
|
||||
<script type="text/template">
|
||||
## Slide 1.1
|
||||
<!-- {_class="fragment fade-out" data-fragment-index="1"} -->
|
||||
|
||||
--
|
||||
|
||||
## Slide 1.2
|
||||
<!-- {_class="fragment shrink"} -->
|
||||
|
||||
Paragraph 1
|
||||
<!-- {_class="fragment grow"} -->
|
||||
|
||||
Paragraph 2
|
||||
<!-- {_class="fragment grow"} -->
|
||||
|
||||
- list item 1 <!-- {_class="fragment roll-in"} -->
|
||||
- list item 2 <!-- {_class="fragment roll-in"} -->
|
||||
- list item 3 <!-- {_class="fragment roll-in"} -->
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Slide 2
|
||||
|
||||
|
||||
Paragraph 1.2
|
||||
multi-line <!-- {_class="fragment highlight-red"} -->
|
||||
|
||||
Paragraph 2.2 <!-- {_class="fragment highlight-red"} -->
|
||||
|
||||
Paragraph 2.3 <!-- {_class="fragment highlight-red"} -->
|
||||
|
||||
Paragraph 2.4 <!-- {_class="fragment highlight-red"} -->
|
||||
|
||||
- list item 1 <!-- {_class="fragment highlight-green"} -->
|
||||
- list item 2<!-- {_class="fragment highlight-green"} -->
|
||||
- list item 3<!-- {_class="fragment highlight-green"} -->
|
||||
- list item 4
|
||||
<!-- {_class="fragment highlight-green"} -->
|
||||
- list item 5<!-- {_class="fragment highlight-green"} -->
|
||||
|
||||
Test
|
||||
|
||||

|
||||
<!-- {_class="reveal stretch"} -->
|
||||
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section data-markdown data-separator="^\n\n\n"
|
||||
data-vertical="^\n\n"
|
||||
data-notes="^Note:"
|
||||
data-charset="utf-8">
|
||||
<script type="text/template">
|
||||
# Test attributes in Markdown with default separator
|
||||
## Slide 1 Def <!-- .element: class="fragment highlight-red" data-fragment-index="1" -->
|
||||
|
||||
|
||||
## Slide 2 Def
|
||||
<!-- .element: class="fragment highlight-red" -->
|
||||
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
## Hello world
|
||||
A paragraph
|
||||
<!-- .element: class="fragment highlight-blue" -->
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
## Hello world
|
||||
|
||||
Multiple
|
||||
Line
|
||||
<!-- .element: class="fragment highlight-blue" -->
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
## Hello world
|
||||
|
||||
Test<!-- .element: class="fragment highlight-blue" -->
|
||||
|
||||
More Test
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../plugin/markdown/marked.js"></script>
|
||||
<script src="../plugin/markdown/markdown.js"></script>
|
||||
<script src="qunit-1.12.0.js"></script>
|
||||
|
||||
<script src="test-markdown-element-attributes.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
46
test/test-markdown-element-attributes.js
Normal file
46
test/test-markdown-element-attributes.js
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
Reveal.addEventListener( 'ready', function() {
|
||||
|
||||
QUnit.module( 'Markdown' );
|
||||
|
||||
test( 'Vertical separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' );
|
||||
});
|
||||
|
||||
|
||||
test( 'Attributes on element header in vertical slides', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' );
|
||||
});
|
||||
|
||||
test( 'Attributes on element paragraphs in vertical slides', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' );
|
||||
});
|
||||
|
||||
test( 'Attributes on element list items in vertical slides', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.roll-in' ).length, 3, 'found a vertical slide with three list items with class fragment.roll-in' );
|
||||
});
|
||||
|
||||
test( 'Attributes on element paragraphs in horizontal slides', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' );
|
||||
});
|
||||
test( 'Attributes on element list items in horizontal slides', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' );
|
||||
});
|
||||
test( 'Attributes on element list items in horizontal slides', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' );
|
||||
});
|
||||
|
||||
test( 'Attributes on elements in vertical slides with default element attribute separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' );
|
||||
});
|
||||
|
||||
test( 'Attributes on elements in single slides with default element attribute separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' );
|
||||
});
|
||||
|
||||
} );
|
||||
|
||||
Reveal.initialize();
|
||||
|
128
test/test-markdown-slide-attributes.html
Normal file
128
test/test-markdown-slide-attributes.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Markdown Attributes</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="qunit-1.12.0.css">
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<div class="reveal" style="display: none;">
|
||||
|
||||
<div class="slides">
|
||||
|
||||
<!-- <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n"></section> -->
|
||||
|
||||
<!-- Slides are separated by three lines, vertical slides by two lines, attributes are one any line starting with (spaces and) two dashes -->
|
||||
<section data-markdown data-separator="^\n\n\n"
|
||||
data-vertical="^\n\n"
|
||||
data-notes="^Note:"
|
||||
data-attributes="--\s(.*?)$"
|
||||
data-charset="utf-8">
|
||||
<script type="text/template">
|
||||
# Test attributes in Markdown
|
||||
## Slide 1
|
||||
|
||||
|
||||
|
||||
## Slide 2
|
||||
<!-- -- id="slide2" data-transition="zoom" data-background="#A0C66B" -->
|
||||
|
||||
|
||||
## Slide 2.1
|
||||
<!-- -- data-background="#ff0000" data-transition="fade" -->
|
||||
|
||||
|
||||
## Slide 2.2
|
||||
[Link to Slide2](#/slide2)
|
||||
|
||||
|
||||
|
||||
## Slide 3
|
||||
<!-- -- data-transition="zoom" data-background="#C6916B" -->
|
||||
|
||||
|
||||
|
||||
## Slide 4
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown data-separator="^\n\n\n"
|
||||
data-vertical="^\n\n"
|
||||
data-notes="^Note:"
|
||||
data-charset="utf-8">
|
||||
<script type="text/template">
|
||||
# Test attributes in Markdown with default separator
|
||||
## Slide 1 Def
|
||||
|
||||
|
||||
|
||||
## Slide 2 Def
|
||||
<!-- .slide: id="slide2def" data-transition="concave" data-background="#A7C66B" -->
|
||||
|
||||
|
||||
## Slide 2.1 Def
|
||||
<!-- .slide: data-background="#f70000" data-transition="page" -->
|
||||
|
||||
|
||||
## Slide 2.2 Def
|
||||
[Link to Slide2](#/slide2def)
|
||||
|
||||
|
||||
|
||||
## Slide 3 Def
|
||||
<!-- .slide: data-transition="concave" data-background="#C7916B" -->
|
||||
|
||||
|
||||
|
||||
## Slide 4
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
<!-- .slide: data-background="#ff0000" -->
|
||||
## Hello world
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
## Hello world
|
||||
<!-- .slide: data-background="#ff0000" -->
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section data-markdown>
|
||||
<script type="text/template">
|
||||
## Hello world
|
||||
|
||||
Test
|
||||
<!-- .slide: data-background="#ff0000" -->
|
||||
|
||||
More Test
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../plugin/markdown/marked.js"></script>
|
||||
<script src="../plugin/markdown/markdown.js"></script>
|
||||
<script src="qunit-1.12.0.js"></script>
|
||||
|
||||
<script src="test-markdown-slide-attributes.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
47
test/test-markdown-slide-attributes.js
Normal file
47
test/test-markdown-slide-attributes.js
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
|
||||
Reveal.addEventListener( 'ready', function() {
|
||||
|
||||
QUnit.module( 'Markdown' );
|
||||
|
||||
test( 'Vertical separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' );
|
||||
});
|
||||
|
||||
test( 'Id on slide', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' );
|
||||
});
|
||||
|
||||
test( 'data-background attributes', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
|
||||
});
|
||||
|
||||
test( 'data-transition attributes', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' );
|
||||
});
|
||||
|
||||
test( 'data-background attributes with default separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
|
||||
});
|
||||
|
||||
test( 'data-transition attributes with default separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' );
|
||||
});
|
||||
|
||||
test( 'data-transition attributes with inline content', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' );
|
||||
});
|
||||
|
||||
} );
|
||||
|
||||
Reveal.initialize();
|
||||
|
52
test/test-markdown.html
Normal file
52
test/test-markdown.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Markdown</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="qunit-1.12.0.css">
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<div class="reveal" style="display: none;">
|
||||
|
||||
<div class="slides">
|
||||
|
||||
<!-- <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n"></section> -->
|
||||
|
||||
<!-- Slides are separated by newline + three dashes + newline, vertical slides identical but two dashes -->
|
||||
<section data-markdown data-separator="^\n---\n$" data-vertical="^\n--\n$">
|
||||
<script type="text/template">
|
||||
## Slide 1.1
|
||||
|
||||
--
|
||||
|
||||
## Slide 1.2
|
||||
|
||||
---
|
||||
|
||||
## Slide 2
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="../plugin/markdown/marked.js"></script>
|
||||
<script src="../plugin/markdown/markdown.js"></script>
|
||||
<script src="qunit-1.12.0.js"></script>
|
||||
|
||||
<script src="test-markdown.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
15
test/test-markdown.js
Normal file
15
test/test-markdown.js
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
Reveal.addEventListener( 'ready', function() {
|
||||
|
||||
QUnit.module( 'Markdown' );
|
||||
|
||||
test( 'Vertical separator', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
|
||||
});
|
||||
|
||||
|
||||
} );
|
||||
|
||||
Reveal.initialize();
|
||||
|
81
test/test.html
Normal file
81
test/test.html
Normal file
@@ -0,0 +1,81 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Tests</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.min.css">
|
||||
<link rel="stylesheet" href="qunit-1.12.0.css">
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<div class="reveal" style="display: none;">
|
||||
|
||||
<div class="slides">
|
||||
|
||||
<section>
|
||||
<h1>1</h1>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<section>
|
||||
<h1>2.1</h1>
|
||||
</section>
|
||||
<section>
|
||||
<h1>2.2</h1>
|
||||
</section>
|
||||
<section>
|
||||
<h1>2.3</h1>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="fragment-slides">
|
||||
<section>
|
||||
<h1>3.1</h1>
|
||||
<ul>
|
||||
<li class="fragment">4.1</li>
|
||||
<li class="fragment">4.2</li>
|
||||
<li class="fragment">4.3</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1>3.2</h1>
|
||||
<ul>
|
||||
<li class="fragment" data-fragment-index="0">4.1</li>
|
||||
<li class="fragment" data-fragment-index="0">4.2</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1>3.3</h1>
|
||||
<ul>
|
||||
<li class="fragment" data-fragment-index="1">3.3.1</li>
|
||||
<li class="fragment" data-fragment-index="4">3.3.2</li>
|
||||
<li class="fragment" data-fragment-index="4">3.3.3</li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h1>4</h1>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/js/head.min.js"></script>
|
||||
<script src="../js/reveal.min.js"></script>
|
||||
<script src="qunit-1.12.0.js"></script>
|
||||
|
||||
<script src="test.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
438
test/test.js
Normal file
438
test/test.js
Normal file
@@ -0,0 +1,438 @@
|
||||
|
||||
// These tests expect the DOM to contain a presentation
|
||||
// with the following slide structure:
|
||||
//
|
||||
// 1
|
||||
// 2 - Three sub-slides
|
||||
// 3 - Three fragment elements
|
||||
// 3 - Two fragments with same data-fragment-index
|
||||
// 4
|
||||
|
||||
|
||||
Reveal.addEventListener( 'ready', function() {
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// DOM TESTS
|
||||
|
||||
QUnit.module( 'DOM' );
|
||||
|
||||
test( 'Initial slides classes', function() {
|
||||
var horizontalSlides = document.querySelectorAll( '.reveal .slides>section' )
|
||||
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section.past' ).length, 0, 'no .past slides' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section.present' ).length, 1, 'one .present slide' );
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides>section.future' ).length, horizontalSlides.length - 1, 'remaining horizontal slides are .future' );
|
||||
|
||||
strictEqual( document.querySelectorAll( '.reveal .slides section.stack' ).length, 2, 'two .stacks' );
|
||||
|
||||
ok( document.querySelectorAll( '.reveal .slides section.stack' )[0].querySelectorAll( '.future' ).length > 0, 'vertical slides are given .future' );
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// API TESTS
|
||||
|
||||
QUnit.module( 'API' );
|
||||
|
||||
test( 'Reveal.isReady', function() {
|
||||
strictEqual( Reveal.isReady(), true, 'returns true' );
|
||||
});
|
||||
|
||||
test( 'Reveal.isOverview', function() {
|
||||
strictEqual( Reveal.isOverview(), false, 'false by default' );
|
||||
|
||||
Reveal.toggleOverview();
|
||||
strictEqual( Reveal.isOverview(), true, 'true after toggling on' );
|
||||
|
||||
Reveal.toggleOverview();
|
||||
strictEqual( Reveal.isOverview(), false, 'false after toggling off' );
|
||||
});
|
||||
|
||||
test( 'Reveal.isPaused', function() {
|
||||
strictEqual( Reveal.isPaused(), false, 'false by default' );
|
||||
|
||||
Reveal.togglePause();
|
||||
strictEqual( Reveal.isPaused(), true, 'true after pausing' );
|
||||
|
||||
Reveal.togglePause();
|
||||
strictEqual( Reveal.isPaused(), false, 'false after resuming' );
|
||||
});
|
||||
|
||||
test( 'Reveal.isFirstSlide', function() {
|
||||
Reveal.slide( 0, 0 );
|
||||
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
|
||||
|
||||
Reveal.slide( 1, 0 );
|
||||
strictEqual( Reveal.isFirstSlide(), false, 'false after Reveal.slide( 1, 0 )' );
|
||||
|
||||
Reveal.slide( 0, 0 );
|
||||
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
|
||||
});
|
||||
|
||||
test( 'Reveal.isLastSlide', function() {
|
||||
Reveal.slide( 0, 0 );
|
||||
strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
|
||||
|
||||
var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
|
||||
|
||||
Reveal.slide( lastSlideIndex, 0 );
|
||||
strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( ', 0+ lastSlideIndex +' )' );
|
||||
|
||||
Reveal.slide( 0, 0 );
|
||||
strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
|
||||
});
|
||||
|
||||
test( 'Reveal.getIndices', function() {
|
||||
var indices = Reveal.getIndices();
|
||||
|
||||
ok( typeof indices.hasOwnProperty( 'h' ), 'h exists' );
|
||||
ok( typeof indices.hasOwnProperty( 'v' ), 'v exists' );
|
||||
ok( typeof indices.hasOwnProperty( 'f' ), 'f exists' );
|
||||
|
||||
Reveal.slide( 1, 0 );
|
||||
ok( Reveal.getIndices().h === 1 && Reveal.getIndices().v === 0, 'h 1, v 0' );
|
||||
|
||||
Reveal.slide( 1, 2 );
|
||||
ok( Reveal.getIndices().h === 1 && Reveal.getIndices().v === 2, 'h 1, v 2' );
|
||||
|
||||
Reveal.slide( 0, 0 );
|
||||
});
|
||||
|
||||
test( 'Reveal.getSlide', function() {
|
||||
var firstSlide = document.querySelector( '.reveal .slides>section:first-child' );
|
||||
|
||||
equal( Reveal.getSlide( 0 ), firstSlide, 'gets correct first slide' );
|
||||
|
||||
strictEqual( Reveal.getSlide( 100 ), undefined, 'returns undefined when slide can\'t be found' );
|
||||
});
|
||||
|
||||
test( 'Reveal.getPreviousSlide/getCurrentSlide', function() {
|
||||
Reveal.slide( 0, 0 );
|
||||
Reveal.slide( 1, 0 );
|
||||
|
||||
var firstSlide = document.querySelector( '.reveal .slides>section:first-child' );
|
||||
var secondSlide = document.querySelector( '.reveal .slides>section:nth-child(2)>section' );
|
||||
|
||||
equal( Reveal.getPreviousSlide(), firstSlide, 'previous is slide #0' );
|
||||
equal( Reveal.getCurrentSlide(), secondSlide, 'current is slide #1' );
|
||||
});
|
||||
|
||||
test( 'Reveal.getScale', function() {
|
||||
ok( typeof Reveal.getScale() === 'number', 'has scale' );
|
||||
});
|
||||
|
||||
test( 'Reveal.getConfig', function() {
|
||||
ok( typeof Reveal.getConfig() === 'object', 'has config' );
|
||||
});
|
||||
|
||||
test( 'Reveal.configure', function() {
|
||||
strictEqual( Reveal.getConfig().loop, false, '"loop" is false to start with' );
|
||||
|
||||
Reveal.configure({ loop: true });
|
||||
strictEqual( Reveal.getConfig().loop, true, '"loop" has changed to true' );
|
||||
|
||||
Reveal.configure({ loop: false, customTestValue: 1 });
|
||||
strictEqual( Reveal.getConfig().customTestValue, 1, 'supports custom values' );
|
||||
});
|
||||
|
||||
test( 'Reveal.availableRoutes', function() {
|
||||
Reveal.slide( 0, 0 );
|
||||
deepEqual( Reveal.availableRoutes(), { left: false, up: false, down: false, right: true }, 'correct for first slide' );
|
||||
|
||||
Reveal.slide( 1, 0 );
|
||||
deepEqual( Reveal.availableRoutes(), { left: true, up: false, down: true, right: true }, 'correct for vertical slide' );
|
||||
});
|
||||
|
||||
test( 'Reveal.next', function() {
|
||||
Reveal.slide( 0, 0 );
|
||||
|
||||
// Step through vertical child slides
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 1, v: 0, f: undefined } );
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 1, v: 1, f: undefined } );
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined } );
|
||||
|
||||
// Step through fragments
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 } );
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 } );
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 } );
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 } );
|
||||
});
|
||||
|
||||
test( 'Reveal.next at end', function() {
|
||||
Reveal.slide( 3 );
|
||||
|
||||
// We're at the end, this should have no effect
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
|
||||
});
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// FRAGMENT TESTS
|
||||
|
||||
QUnit.module( 'Fragments' );
|
||||
|
||||
test( 'Sliding to fragments', function() {
|
||||
Reveal.slide( 2, 0, -1 );
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 }, 'Reveal.slide( 2, 0, -1 )' );
|
||||
|
||||
Reveal.slide( 2, 0, 0 );
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'Reveal.slide( 2, 0, 0 )' );
|
||||
|
||||
Reveal.slide( 2, 0, 2 );
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'Reveal.slide( 2, 0, 2 )' );
|
||||
|
||||
Reveal.slide( 2, 0, 1 );
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'Reveal.slide( 2, 0, 1 )' );
|
||||
});
|
||||
|
||||
test( 'Hiding all fragments', function() {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
||||
|
||||
Reveal.slide( 2, 0, 0 );
|
||||
strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 1, 'one fragment visible when index is 0' );
|
||||
|
||||
Reveal.slide( 2, 0, -1 );
|
||||
strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when index is -1' );
|
||||
});
|
||||
|
||||
test( 'Current fragment', function() {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
||||
|
||||
Reveal.slide( 2, 0 );
|
||||
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment at index -1' );
|
||||
|
||||
Reveal.slide( 2, 0, 0 );
|
||||
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 1, 'one current fragment at index 0' );
|
||||
|
||||
Reveal.slide( 1, 0, 0 );
|
||||
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to previous slide' );
|
||||
|
||||
Reveal.slide( 3, 0, 0 );
|
||||
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to next slide' );
|
||||
});
|
||||
|
||||
test( 'Stepping through fragments', function() {
|
||||
Reveal.slide( 2, 0, -1 );
|
||||
|
||||
// forwards:
|
||||
|
||||
Reveal.next();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'next() goes to next fragment' );
|
||||
|
||||
Reveal.right();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'right() goes to next fragment' );
|
||||
|
||||
Reveal.down();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'down() goes to next fragment' );
|
||||
|
||||
Reveal.down(); // moves to f #3
|
||||
|
||||
// backwards:
|
||||
|
||||
Reveal.prev();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'prev() goes to prev fragment' );
|
||||
|
||||
Reveal.left();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'left() goes to prev fragment' );
|
||||
|
||||
Reveal.up();
|
||||
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'up() goes to prev fragment' );
|
||||
});
|
||||
|
||||
test( 'Stepping past fragments', function() {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
||||
|
||||
Reveal.slide( 0, 0, 0 );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when on previous slide' );
|
||||
|
||||
Reveal.slide( 3, 0, 0 );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 3, 'all fragments visible when on future slide' );
|
||||
});
|
||||
|
||||
test( 'Fragment indices', function() {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(2)' );
|
||||
|
||||
Reveal.slide( 3, 0, 0 );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 2, 'both fragments of same index are shown' );
|
||||
});
|
||||
|
||||
test( 'Index generation', function() {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
||||
|
||||
// These have no indices defined to start with
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' );
|
||||
});
|
||||
|
||||
test( 'Index normalization', function() {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(3)' );
|
||||
|
||||
// These start out as 1-4-4 and should normalize to 0-1-1
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
|
||||
equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' );
|
||||
});
|
||||
|
||||
asyncTest( 'fragmentshown event', function() {
|
||||
expect( 2 );
|
||||
|
||||
var _onEvent = function( event ) {
|
||||
ok( true, 'event fired' );
|
||||
}
|
||||
|
||||
Reveal.addEventListener( 'fragmentshown', _onEvent );
|
||||
|
||||
Reveal.slide( 2, 0 );
|
||||
Reveal.slide( 2, 0 ); // should do nothing
|
||||
Reveal.slide( 2, 0, 0 ); // should do nothing
|
||||
Reveal.next();
|
||||
Reveal.next();
|
||||
Reveal.prev(); // shouldn't fire fragmentshown
|
||||
|
||||
start();
|
||||
|
||||
Reveal.removeEventListener( 'fragmentshown', _onEvent );
|
||||
});
|
||||
|
||||
asyncTest( 'fragmenthidden event', function() {
|
||||
expect( 2 );
|
||||
|
||||
var _onEvent = function( event ) {
|
||||
ok( true, 'event fired' );
|
||||
}
|
||||
|
||||
Reveal.addEventListener( 'fragmenthidden', _onEvent );
|
||||
|
||||
Reveal.slide( 2, 0, 2 );
|
||||
Reveal.slide( 2, 0, 2 ); // should do nothing
|
||||
Reveal.prev();
|
||||
Reveal.prev();
|
||||
Reveal.next(); // shouldn't fire fragmenthidden
|
||||
|
||||
start();
|
||||
|
||||
Reveal.removeEventListener( 'fragmenthidden', _onEvent );
|
||||
});
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// CONFIGURATION VALUES
|
||||
|
||||
QUnit.module( 'Configuration' );
|
||||
|
||||
test( 'Controls', function() {
|
||||
var controlsElement = document.querySelector( '.reveal>.controls' );
|
||||
|
||||
Reveal.configure({ controls: false });
|
||||
equal( controlsElement.style.display, 'none', 'controls are hidden' );
|
||||
|
||||
Reveal.configure({ controls: true });
|
||||
equal( controlsElement.style.display, 'block', 'controls are visible' );
|
||||
});
|
||||
|
||||
test( 'Progress', function() {
|
||||
var progressElement = document.querySelector( '.reveal>.progress' );
|
||||
|
||||
Reveal.configure({ progress: false });
|
||||
equal( progressElement.style.display, 'none', 'progress are hidden' );
|
||||
|
||||
Reveal.configure({ progress: true });
|
||||
equal( progressElement.style.display, 'block', 'progress are visible' );
|
||||
});
|
||||
|
||||
test( 'Loop', function() {
|
||||
Reveal.configure({ loop: true });
|
||||
|
||||
Reveal.slide( 0, 0 );
|
||||
|
||||
Reveal.left();
|
||||
notEqual( Reveal.getIndices().h, 0, 'looped from start to end' );
|
||||
|
||||
Reveal.right();
|
||||
equal( Reveal.getIndices().h, 0, 'looped from end to start' );
|
||||
|
||||
Reveal.configure({ loop: false });
|
||||
});
|
||||
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// EVENT TESTS
|
||||
|
||||
QUnit.module( 'Events' );
|
||||
|
||||
asyncTest( 'slidechanged', function() {
|
||||
expect( 3 );
|
||||
|
||||
var _onEvent = function( event ) {
|
||||
ok( true, 'event fired' );
|
||||
}
|
||||
|
||||
Reveal.addEventListener( 'slidechanged', _onEvent );
|
||||
|
||||
Reveal.slide( 1, 0 ); // should trigger
|
||||
Reveal.slide( 1, 0 ); // should do nothing
|
||||
Reveal.next(); // should trigger
|
||||
Reveal.slide( 3, 0 ); // should trigger
|
||||
Reveal.next(); // should do nothing
|
||||
|
||||
start();
|
||||
|
||||
Reveal.removeEventListener( 'slidechanged', _onEvent );
|
||||
|
||||
});
|
||||
|
||||
asyncTest( 'paused', function() {
|
||||
expect( 1 );
|
||||
|
||||
var _onEvent = function( event ) {
|
||||
ok( true, 'event fired' );
|
||||
}
|
||||
|
||||
Reveal.addEventListener( 'paused', _onEvent );
|
||||
|
||||
Reveal.togglePause();
|
||||
Reveal.togglePause();
|
||||
|
||||
start();
|
||||
|
||||
Reveal.removeEventListener( 'paused', _onEvent );
|
||||
});
|
||||
|
||||
asyncTest( 'resumed', function() {
|
||||
expect( 1 );
|
||||
|
||||
var _onEvent = function( event ) {
|
||||
ok( true, 'event fired' );
|
||||
}
|
||||
|
||||
Reveal.addEventListener( 'resumed', _onEvent );
|
||||
|
||||
Reveal.togglePause();
|
||||
Reveal.togglePause();
|
||||
|
||||
start();
|
||||
|
||||
Reveal.removeEventListener( 'resumed', _onEvent );
|
||||
});
|
||||
|
||||
|
||||
} );
|
||||
|
||||
Reveal.initialize();
|
||||
|
Reference in New Issue
Block a user