Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce random config #1506

Closed
wants to merge 1 commit into from
Closed

Introduce random config #1506

wants to merge 1 commit into from

Conversation

lyndseypadget
Copy link

This is a config-based, built-in alternative to proposals like this one. This PR addresses #1089, which is closed but perhaps worth reconsidering.

To enable:

            // Simply turning random on will use the entire range of top-level (horizontal) slides
            // Reveal.configure({ random: true });

            // Or you can specify an inclusive range of slide numbers
            Reveal.configure({
                random: {
                    rangeStart: 5,
                    rangeEnd: 8
                }
            });

            //Autoslide can be used with random
            //Reveal.configure({ autoSlide: 3000 });

Notes:

  • Of course, random is off by default
  • Can be generally enabled (true) or further specify a range of slides (rangeStart and rangeEnd)
  • Slide range is inclusive
  • Ranges can be manually overridden by any code calling navigateRandom
  • Range will autocorrect if not in the proper order ([5,1] becomes [1,5])
  • Random navigation will ensure you are not routed to the slide you're already on
  • Can be used with autoslide on or off
  • Randomized slides are always at the top (horizontal) level - never "basement" levels
  • Fragments are still honored
  • Transitions are only executed when navigating in a forward (right) direction

@bnjmnt4n
Copy link
Collaborator

bnjmnt4n commented Mar 5, 2016

Marking this as a duplicate of #1089 for now. @hakimel do you have any opinions about this?

@hakimel
Copy link
Owner

hakimel commented Mar 20, 2016

Thanks for the PR and taking the time to implement this. I said in #1089 that this didn't seem like a common enough use case, but judging by the number of votes on Stack Overflow I was wrong.

I'd be happy to add support for random order but I don't think this is the right way to do it. The slides should be moved into random order in the DOM instead, for two reasons:

  • It'll be a lot easier to implement (just a few lines of JS to run at startup)
  • it's a bit strange to have the slide numbers and progress bar jump around as they do when the DOM order remains unchanged

@hakimel
Copy link
Owner

hakimel commented Mar 20, 2016

Added what I mentioned above in 2625a92

It can be used as a config value Reveal.initialize({shuffle: true}) or called manually Reveal.shuffle().

@hakimel hakimel closed this Mar 20, 2016
@bnjmnt4n bnjmnt4n mentioned this pull request Mar 21, 2016
MarcoHengstenberg pushed a commit to MarcoHengstenberg/reveal.js that referenced this pull request Jun 2, 2016
* Add support for custom notes.html file

It would be nice if we could define a custom notes.html file.

Actually, I'm used to compile my js files before releasing my app and, using selectors like `script[src$="notes.js"]`, doesn't work :(

So, what do you think about it?

* Fixed last header having a border-bottom 

`<tbody/>` is automatically inserted, so we can guarantee that this affects all ths and tds in the last row of the table *body* and the head is left untouched

* Gruntfile.js: watch tasks restructured

* add option to mute background videos

* bug fix - when the first section has a background-video, the vido do not execute. Now, it's work

* improvement on spaces and indentation

* Improvement of code. Now none flag is used, but the readyState property  from video element

* UPDATED - Improvement of code. Now none flag is used, but the readyState property  from video element

* UPDATED - Improvement on spaces and indentation

* UPDATED - Improvement on spaces and indentation

* format note content when creating slide

In html content, marked allow `Inline-Level Grammar` but not `Block-Level Grammar`, so when I write following:
```
note:
* a
* b
* c
```
it become:
```html
<p><em> a
</em> b</p>
<ul>
<li>c</li>
</ul>
```
unbelievable!

* fixed loading

* Add autoSlideRight option

When the autoSlideRight config option is active, the auto-sliding
will always navigate to the right and never down even if slides are
present there. This allows hidden "bonus slides" in presentations
which can be displayed as needed but won't show up automatically.

* Add a more flexible autoSlideMethod option

Auto-sliding will now use the method specified in the config if it is
a function or default to navigateNext.

* Fix build error

* add autoSlideMethod to default config

* 2x playback controls for retina displays

* tweak

* Added 4 fragment transitions effect.

* Clean version of the new transitions.

* add option to mute background videos (updated)

* update to highlight.js 9.0.0

* expose version number through  hakimel#1451

* add new fragment styles to readme hakimel#1445

* center help overlay with flexbox

* tweaked fragment examples

* include speaker view keyboard shortcut when applicable hakimel#1466

* rebuild css

* same code format

* fix broken iframe in backgrounds example

* code format

* Change ".video" to ".reveal .video"

I don't know if this is supposed to be this way ?

* use css  to scale slides up in safari

* Remove unused dependencies.

* Fix query parameter issue in notes plugin.

Closes hakimel#1392.

* Make PDF export section less OS X specific.

Closes hakimel#1073.

* fix notes regex hakimel#1522 hakimel#1392

* notes plugin no longer syncs overview mode hakimel#1446

* server notes plugin no longer syncs overview mode hakimel#1446

* update headjs to v1.0.3

* add 'shuffle' config value and API method hakimel#1506 hakimel#1089

* new empty template at index.html, move old index to demo.html hakimel#1526

* remove unintentionally added file

* minor tweaks

* Table of contents added in README.md

* generalize scroll offset prevention

* Update README.md

readme tweaks

* Update README.md

* support for standalone multiplexing

* remove test content

* new multiplex server courtesy of now.sh (closes hakimel#1377)

* Fixes hakimel#1549, now UA match is limiting out MS Edge and Chrome detection is improved. Also improved UserAgent access by storing it in to a local variable, it was accessed so many times in different places.

* Fix watching for markdown files

`./*.md` didn't work `*.md` does work

* lazy load iframe in demo

* widen watch for html files, required for updates to demo.html

* overview now works with percentage based width/height hakimel#1247

* readme tweak for hakimel#1535

* change introduction

* 3.3.0

* Simplify full setup

* Update README.md

more in-depth documentation of slide backgrounds hakimel#1542
SteveDesmond-ca pushed a commit to SteveDesmond-ca/presentations that referenced this pull request Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants