Commit Graph

336 Commits

Author SHA1 Message Date
Henrik Ingo
c5e93f6885 Fix a couple links in README.md 2017-11-12 21:41:13 +02:00
Henrik Ingo
7354dbf5fc Merge pull request #643 from impress/dev
1.0.0-beta1: Merge 2 years worth of work from dev to master!

Highlights

* New plugin based architecture allows adding more features without bloating core src/impress.js file
* Source files are in src/ and compiled into js/impress.js with npm run build. End users should continue to use js/impress.js as before.
* 19 new plugins
* Integrates impressConsole.js by default (press 'P' to open speaker console)
* Markdown support for those that are too much in a hurry to type HTML
* 5 new demo presentations under examples/ show case the new features
* Removes the code that prevented impress.js from running on mobile phones
2017-11-12 19:29:24 +02:00
Henrik Ingo
8a1384769c Fix the DOCUMENTATION.md for impress:stepenter and impress:stepleave events
Use event.target and event.detail.next in the examples.
2017-11-12 19:11:58 +02:00
Henrik Ingo
f7f217114e Add example of a plugin capturing the impress:init event to plugin README 2017-11-05 19:18:32 +02:00
Henrik Ingo
1946c5be55 Change hyperlinks to github.com/henrikingo/impress.js back to upstream repo 2017-11-05 18:42:27 +02:00
Henrik Ingo
003664c840 Add impress-extras as git submodule
This adds extra addons, which are 3rd party libraries, into extras/

* Highlight.js
* Markdown.js
* Mathjax.js
* Mermaid.js
2017-11-05 18:42:27 +02:00
Henrik Ingo
d6c6cd47c2 Change gc.lib.addCallback to gc.lib.pushCallback (#626) 2017-11-05 18:42:27 +02:00
Henrik Ingo
2d229bf4a6 Update karma.conf-sauce.js to work with the post-merge way of testing 2017-11-05 18:42:27 +02:00
Henrik Ingo
2a8f784592 Bump version to 1.0.0-beta1 2017-11-05 18:42:27 +02:00
Henrik Ingo
3ef230053e Update README.md to match the new repository structure
Explains the plugins, lib and build.js, etc.

Also delete the contributor guidelines in .github. We won't be using
those going forward, what README.md says is enough.
2017-11-05 18:42:27 +02:00
Henrik Ingo
443a4a82c1 Fix goto plugin: set lib variable from impress:init 2017-11-05 18:42:27 +02:00
Henrik Ingo
7505838891 Use autoplay and toolbar plugins in the main impress demo
For all the other features, see demos under extras/
2017-11-05 18:42:27 +02:00
Henrik Ingo
ff036a5dbd Add demo examples/2D-navigation
Show cases the new non-linear navigation possibilities of goto plugin.
2017-11-05 18:42:27 +02:00
Henrik Ingo
cfd1200dcc Add new demo presentation examples/3D-rotations
...to showcase a truly 3-dimensional presentation and also the
use of the new data-rotate-order="" attribute.
2017-11-05 18:42:27 +02:00
Henrik Ingo
4a62376145 Add new demo examples/cube to showcase a simple 3-dimensional presentation.
Also nice demo of multi-dimensional navigation from impress#465
2017-11-05 18:42:27 +02:00
Henrik Ingo
a37723fd82 Add demo presentation: examples/markdown
This demo presentation is written entirely in Markdown, as provided
by the combination of the extras plugin, and extras/markdown/markdown.js

The idea for using Markdown instead of HTML came from users who felt that
sometimes when you just need to quickly toss together some slides, using
Markdown is faster than HTML. Same approach is also familiar to Hovercraft
users, where RST is converted to a traditional HTML based impress.js presentation.

Unlike Hovercraft, using Markdown.js allows you to write Markdown directly into
your html file that is the presentation. It is converted in the browser, and no
separate command line tool is necessary. As a result you can also mix and match:
some slides can be HTML (when needed) and some in Markdown.
2017-11-05 18:42:27 +02:00
Henrik Ingo
e847fb4fb4 Add another demo presentation: examples/classic-slides
Add one presentation that provides a very simple demo, using
impress.js to create a very traditional "slide show". Possibly
it's an easier way to learn impress.js (it's commented, just like
the official demo.) It uses the relative positioning plugin and
uses "speaker notes", which aren't shown in the presentation,
but are picked up and shown in the speaker console (press 'P').
Also uses autoplay, forms... and includes short demo of all the extra
addons from extras/. (Highlight.js, Markdown.js, Mathjax.js, Mermaid.js)
2017-11-05 18:42:27 +02:00
Henrik Ingo
478a572294 Add data-rotate-order to DOCUMENTATION.md, as well as a link to plugins README.md 2017-11-05 18:42:27 +02:00
Henrik Ingo
c9c1943f39 Update build.js to activate all the plugins added in previous commits
Also adds esversion:6 to .jshintrc. This is required by impressConsole.js.
2017-10-30 17:07:14 +02:00
Henrik Ingo
f11a01d6fc Add skip plugin
Add class="skip" to a step to cause the step to be skipped when nagivating
with prev() and next(). A goto() to the step will still work.
2017-10-30 17:07:14 +02:00
Henrik Ingo
3bb704578a Add toolbar plugin
The toolbar plugin produces a generic toolbar container, which then can contain
buttons, drop-downs or any html inside it. The user can position and otherwise
style the toolbar, and any widgets inside it will follow.

Other plugins that wish to expose graphical controls (navigation-ui, autoplay)
will use the impress:toolbar:appendChild event to 'send' their controls to
this plugin.
2017-10-30 17:07:14 +02:00
Henrik Ingo
156da0bb3f By popular request: substep plugin!
References:
https://github.com/impress/impress.js/issues/81
https://github.com/impress/impress.js/issues/600
2017-10-30 17:07:14 +02:00
m42e
b0ee19950e Add progress bar plugin by Matthias Bilger (@m42e).
Originally from https://github.com/m42e/impress.js-progress and
adapted for the new plugin api. Also made the sample CSS produce
a smaller bar and font.

Adds event.detail.next to impress:stepleave event in impress.js.
2017-10-30 17:07:14 +02:00
Henrik Ingo
f6ec70cd03 Add navigation-ui plugin.
navigation-ui plugin provides "back" and "forward" controls,
as well as a select drop down list to jump to any step. It is
added to act as an example of a UI plugin, meaning that it
exposes visible html elements.

(This plugin depends on the toolbar plugin, which is added 3 commits
from now.)
2017-10-30 17:07:14 +02:00
Henrik Ingo
713557d4d2 Add mouse-timeout plugin
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.
2017-10-30 17:07:14 +02:00
Lennart Regebro
3697c5b540 Add the popular impressConsole.js from Lennart Regebro.
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.
2017-10-30 17:07:14 +02:00
Henrik Ingo
0c891e792c Add help popup plugin
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.
2017-10-30 17:07:14 +02:00
Henrik Ingo
1af3c739f8 Add form plugin
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.
2017-10-30 17:07:14 +02:00
Henrik Ingo
78c412cace Add extras plugin
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.
2017-10-30 17:07:14 +02:00
Strikeskids
2757613fd4 Add blackout plugin
Press 'b' to hide / unhide presentation content.
impress#372
2017-10-30 17:07:14 +02:00
Henrik Ingo
4bec5db356 Add autoplay plugin
The autoplay plugin will automatically advance to the next slide
after N seconds.
2017-10-30 17:07:14 +02:00
Henrik Ingo
fd8bc69eb9 Add code comment that impress().swipe() is internal API method.
By internal, we mean it is not documented on DOCUMENTATION.md.
2017-10-23 22:29:59 +03:00
Henrik Ingo
b56b16d1cf Add support for data-rotate-order="xyz" attribute.
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.
2017-10-23 22:29:59 +03:00
Henrik Ingo
aa93a8b563 Support data-transition-duration attributes for step elements.
If the next element has its own data-transition-duration attribute,
use that value instead of the global setting.

References:
https://github.com/impress/impress.js/issues/142
2017-10-23 22:29:59 +03:00
Henrik Ingo
b15b07ef49 Trigger impress:steprefresh for every onStepEnter ( goto() )
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.)
2017-10-23 22:29:59 +03:00
Kurt Zenisek
f0b99f81ac Add Mobile plugin, which allows authors to hide most slides with CSS.
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.
2017-10-23 22:29:59 +03:00
and3rson
b10f710499 Add swipe support for navigation between steps
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
2017-10-23 22:29:59 +03:00
Henrik Ingo
10632c2ebc Add rel goto and skip plugins to build.js too 2017-10-21 14:31:56 +03:00
Henrik Ingo
5645849079 Small comment fixes from code review 2017-10-21 12:22:22 +03:00
Henrik Ingo
82ff7cbde0 Add a framework for synchronously executed preInit and preStepLeave plugins.
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.
2017-10-21 12:22:22 +03:00
Fagner Brack
8902a0a709 Remove second example for ".tear()" (#627) 2017-10-09 22:19:42 +11:00
Henrik Ingo
a66947e119 Merge pull request #625 from henrikingo/merge-lib
Common libraries in src/lib
2017-10-09 10:02:18 +03:00
Henrik Ingo
8c12757b96 Documentation fixes based on code review. 2017-10-09 09:30:11 +03:00
Henrik Ingo
f3d193d636 Move helper functions from core to src/lib/util.js
This facilitates them being used from plugins as well as core impress.js.
2017-10-05 17:57:16 +03:00
Henrik Ingo
9b958f0e00 Add a framework for libraries, and a first library gc
- 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.
2017-10-05 14:57:59 +03:00
Henrik Ingo
9198ca854b Merge pull request #622 from henrikingo/plugin-framework
Introduce plugin framework
2017-10-02 16:53:24 -04:00
Henrik Ingo
ab30317cd0 Set browser:true in .jshintrc 2017-10-02 23:52:04 +03:00
Bartek Szopka
525e4fc5f2 Merge pull request #616 from darkshell/master
changing link fonts.googleapi.com  from http to https
2017-09-25 10:14:35 +02:00
Henrik Ingo
0dc8b43650 Introduce plugin framework
* 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
2017-09-25 03:01:58 +03:00
Bartek Szopka
c58b7b8a44 Merge pull request #621 from henrikingo/merge-testing
Merge more testing coverage from henrikingo fork
2017-09-24 13:07:52 +02:00