This commit adds a generic mouse-timeout plugin. (Same code was
originally part of toolbar plugin, but is now general purpose and
available to user to apply any CSS to it.)
Although this implementation is different and more generic, the
suggestion to add ability to hide mouse cursor came from
a pull request by Sebastian Clausen (@sclausen):
impress#536
The functionality is simple:
After 3 seconds of mouse inactivity, add the css class
`body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the
class.
A user will then use (or not) his own CSS to hide whatever he wants to hide
after 3 seconds of mouse inactivity.
Press 'P' to show a speaker console in a separate window.
Supports:
- Navigation controls
- This slide and next slide preview screens
- Speaker notes
- Clock and timer
Also applies this patch, which makes impressConsole.js follow the new
impress.js plugin standard: regebro/impress-console#22
Note: As impressConsole is now a plugin, it is included by default. You
no longer need to include it with a separate <script> tag. Nor do you
need to call its init() method.
Shows a help popup when user presses H. Add
<div id="impress-help">
...to the presentation to enable it.
Other plugins send their help text to this plugin as events.
The idea and style for this help popup comes from hovercraft, which would
generate such html code into each presentation it creates.
Adds new form plugin, which blurs() focus on impress:stepleave. This is to
prevent an input field from being focused when it is no longer visible.
Related to supporting forms, in an earlier commit we already changed the
navigation plugin to only listen to keypress events from body and html
elements. This was to allow presentations to have, for example, form
elements, where users can type text, including spaces, use arrows, etc.
To make loading of extras/ addons simpler, and remove cruft from
presentation html files, I created a new plugin src/plugins/extras/.
If any of the extra addons (highlight.js, markdown.js, mathjax.js
or mermaid.js) are added to the html file with a regular <script> tag,
then this module will discover and know how to init the module for you,
so it is not necessary to do that in html. If you're not using
the extras, this plugin does nothing.
Note that in the branch history where you are reading this commit,
the extras/ directory doesn't actually exist yet, nor do the
examples/ that use them. But they will hopefully join this branch soon.
It turns out in CSS 3D, the order in which you specify for example
the rotateX(), rotateY() and rotateZ() transformations matter.
Each rotation is relative to the objects then-current position.
Impress.js being hardwired to always do rotateX->rotateY->rotateZ
was therefore limiting, and in fact there are some positions that
can never be reached with an xyz order. The new data-rotate-order=""
attribute allows to specify the order as a permutation of the 3
letters x, y, z, thus relaxing this limitation.
See http://openlife.cc/blogs/2016/october/3d-rotations-css-and-impressjs
for (much) more details.
Unlike impress:stepenter, we emit impress:steprefresh event also
when the "entered" step is the current step. This allows plugins
to reload or redraw objects if needed.
(Note that resize plugin already calls goto() on the active element
for similar purposes when it sees a window resize event. Emitting
impress:steprefresh allows other plugins to join in such a refresh,
and also others can call goto() if a refresh is needed.)
The Mobile plugin adds CSS classes body.impress-mobile and
div.prev, div.next. These can be used in CSS to hide non-active
steps completely, in order to reduce memory consumption on
small mobile devices.
Also:
- Removes the code that allowed navigation by tapping left/right edge of screen.
- Actually, this was already removed in this branch...
- Removes the code that disabled impress.js on mobile devices
- Adds new API call impress().swipe()
Refactored for the plugin api from this pull request by @and3rson:
https://github.com/impress/impress.js/pull/496
Manually "cherry picked" from
c44fd0f4c1
This allows plugins to register to be executed at the beginning of
impress().init() and impress().goto() respectively. By returning false,
a plugin can also cancel the event.
Also adds 3 plugins that use this: rel, goto and stop.
- Libraries are under src/lib/
- Added to build.js as usual, before plugins.
- See src/lib/README.md for details
gc library implements a "garbage collector" library, which allows
both the core and plugins to store elements and listeners to a list,
and when impress().lib.gc.teardown() is called, to have all of them
removed from the DOM. It also allows plugins to register their own
callback functions, which are called at teardown.
Commentary:
This work is based on copying the src/lib/gc.js from impressionist. While it was
useful, it turns out on the impress.js side there was much more a need to reset
attributes rather than delete elements. For now, this means lots of plugins do this
via their own lib.gc.addCallback() functions. Probably it would be nicer to add
some generic lib.gc.resetAttributes() functionality for this particular case.
I'll return to this in a future patch.
extras/ are not supported for impress().tear(). What can I say, they're extras.
Maybe in the future I'll support them, for now I can live without.
* Source files are under src/
* js/impress.js is now generated, but remains part of the repo (so it just works)
* npm run build
* build.js uses buildify node module
* Break out navigation and resize plugins from core src/impress.js file
* core_tests.js and navigation_tests.js have more tests
* qunit_test_runner.html runs QUnit in a browser (without karma) and
provides a generic iframe based platform to test different presentations.
* copy qunit.js and syn.js into the repo. This allows qunit_test_runner.html
to work without any dependency on node/npm. (Karma obviously does need them.)
* Move jscs cli option to .jscsrc instead
* Add encrypted sauce credentials with new key
* Remove binary workaround in ".gitattributes"
* Revert a5fd940cd9
* Use the -out syntax instead of >>
* Revert "Use the -out syntax instead of >>"
This reverts commit 7caf1de18c9103ea9c7397c1c8f0a45c31850ec6.
Is this commit causing a "npm: command not found" error in CircleCI?
* Update sauce-encrypted-env-vars to use `export`.
* Normalize `transformOrigin` result for IE11 and Safari.
* Add webkit prefixes for Safari 8 test pass.