Commit Graph

60 Commits

Author SHA1 Message Date
thawk
b572362c3a Auto guess slide title from first non-blank line (#821)
* Auto guess slide title from first non-blank line
* If line content is too long, trim to the first 40 bytes
2022-10-17 08:39:54 +08:00
thawk
f8dd0e92b4 Improve markdown support. (#817)
1. Support `marked`, you can using it instead. #811
2. Auto trim the indentation, so it can be indent like regular HTML.
   #812
2022-08-19 11:57:48 +03:00
thawk
dc3cf69747 Fix issue that data-x/y/z can't use relative-to-screen-size unit. (#815) 2022-07-21 21:49:39 +03:00
Christoph Neumann
bc3612118a Fix impress().lib.util reference in blackout.js (#810) 2022-05-02 16:33:18 +03:00
thawk
629f7686f3 Add relative move and rotate to rel plugin (#794)
The relative position in rel plugin is currently based on the world coordinate. So for the same effect, like fly in from the right-hand side, we must use different `data-rel-x/y/z` value. Why not let the plugin do the hard part?

So I introduce a `data-rel-position`, when set to `relative`, all relative attribute is based on the position and rotation of previous slide. So no matter the rotation of previous slide, data-rel-x="1000" always looks like fly in from the right-hand side. We can change the position and rotation of one slide, and the position of all following slides will be changed too.

When `data-rel-position` is set to `relative`, relative rotation has a clear meaning. It describes the relative rotations between slides. We don't need to set rotations for all slide, setting the key slides is enough. If `data-rel-position` is not relative, the effect of `data-rel-rotate-x/y/z` is not clear, so they're only used when `data-rel-position="relative"`.

After the introduction of relative rotation, there're 6 attribute that will inherit from previous slide. If we want to set a relative X move, we have to set all other 5 attributes to 0. It's boring. So a `data-rel-clear` is used to set all 6 attributes to 0, and then the value specified in current slide is applied. 

The `examples/3D-positions/index.html` shows some usage. As you can see, the html code of two slide ring is the same, and slides except for the first two in a ring has no position attributes. It work by inheriting the previous one.

This PR invokes a lot math calculations. Basically, the rotation of a slide is translated into the coordinate describing the directions of X/Y/Z axes. And `data-rel-x/y/z` can be easily calculated by that. The rotations is the hard part, I mainly use the algorithm in the Quaternions and spatial rotation - Wikipedia to compose two and more rotations.  I'm not a math guy, hope I don't make much mistakes.
2022-04-24 21:37:50 +03:00
thawk
d3760dfa0a make data-x/y/z supports relative-to-screen size (#804) 2022-02-13 12:35:52 +02:00
thawk
20f74a8b56 Fix relative-to-screen-size calculation (h and w) (#799) 2022-01-30 17:17:56 +02:00
hugocvx
ecbdd43ca8 use element title as navigation select option text when available (#803) 2022-01-30 17:06:42 +02:00
thawk
e366207cea apply markdown dialect to all elements 2021-07-28 11:01:40 +03:00
Daniel Sockwell
4c9d2e38aa Add ability to specify substep order (#779)
The substep plugin currently shows each substep in the order in which
it appears in the HTML.  This is not always an ideal fit for some
presentation styles, where it would be helpful to specify a different
order (e.g., to add annotations to an image).

This commit allows users to specify a custom order via the
`data-substep-order` attribute.  Substeps without a
`data-substep-order` attribute are revealed last.

This commit also updates the Substep README to document the new
feature.
2021-02-26 16:24:10 +02:00
kdxcxs
d0c427f172 Support Chinese in impressConsole (#774) 2020-10-11 10:42:48 +03:00
Tim Gates
d8e2f17f95 docs: Fix simple typo, glithes -> glitches (#773) 2020-09-13 20:33:02 +03:00
IngridRegina
a5e5b96291 created impress-common.css (#760)
Co-authored-by: Ingrid-Regina Vähi <ingrid.vahi@adm.ee>
2020-04-05 17:14:18 +03:00
Mohamed Feddad
93b846f07a Add autoplay URL parameter trigger. (#764)
Resolves #720
2020-04-02 13:21:20 +03:00
Mohamed Feddad
203b85808c Add markdown dialect attribute. (#763)
Resolves #724
2020-04-01 10:08:27 +03:00
Tobias Bora
b7983887aa media plugin doc: autostart -> autoplay (#748) 2019-12-07 11:40:07 +02:00
Oliver Sanders
934c2266c4 substep: add substep-active class (#741) 2019-09-11 14:42:24 +03:00
Henrik Ingo
646fc3c45a Fix lint 2019-06-27 09:07:33 +03:00
Henrik Ingo
05cf6ffded rel: In teardown, only reset data-x/y/z attribute if we modified it.
Fixes downstream bug in impressionist:
https://github.com/henrikingo/impressionist/issues/20
2019-06-27 06:58:48 +03:00
Will Soares
c61403d57a Trigger event on substep enter (#730) 2019-04-25 13:41:50 +03:00
Guilherme I F L Weizenmann
97546a5536 Add fullscreen with support to remote presentation controller (#712)
- F5 to enter/exit
- Escape to exit
2019-02-06 13:36:04 +02:00
Guilherme I F L Weizenmann
6db3f7c877 Add support for "." to enter/exit blackout screen (#716)
* Add support for "." to enter/exit blackout screen

- This is the default on Power Point
- THis add support for remote controller presentation blackout key

* Rename autoplay event call from resume to play
2019-02-06 13:25:11 +02:00
Guilherme I F L Weizenmann
6776a0dab7 Add pause and play events to autoplay (#713)
This is useful to request pause/resume from other plugins
2019-02-06 13:21:51 +02:00
Henrik Ingo
24e28cc43f Fix example in plugin README 2019-01-02 13:35:27 +02:00
Henrik Ingo
4d3adb09cd Fix form plugin for input fields.
It turns out input[type=text] will only find input fields where
the type attribute is explicitly set to text, but would skip
fields that left it out and defaulted to type text. This changes
to catch all types of input elements.
2019-01-01 21:40:46 +02:00
zilioti
dd74d3da0a Add keyup for 191 keyCode (#705) 2018-10-22 11:16:53 -04:00
Henrik Ingo
194ae3bb62 Fixes to data-rel-to
Fixes 80ffff0e8f
2018-05-08 20:01:11 +03:00
Holger Teichert
80ffff0e8f rel: Add relative positioning relative to any previous step. (#686) 2018-05-01 21:57:40 +03:00
Holger Teichert
c09ce88749 New plugin: media (#676)
The media plugin can autoplay and autopause/autostop <audio> and <video> elements when entering and leaving a step.

Support for impressConsole: don't autoplay in preview window and play but mute clips in current window.
2018-03-17 16:33:34 +02:00
Henrik Ingo
e99a2df7f2 Fix typo 2018-01-07 18:46:36 +02:00
Henrik Ingo
4b5fe0fbf8 Set stopPropagation() event handlers for text input fields
Fixes #525 #140
2018-01-06 18:28:34 +02:00
Henrik Ingo
8b14eda98f Broader try-catch for handling impress-console-button disappearance (#652)
The previous attempt at merely reading a property of event.target was
incorrect. It worked at first but errors reappeared later, so must
have been a reace.

This wraps the entire navigation event handlers in the try-catch, and
then checks for the very specific error and suppresses it. Other errors
are rethrown as is.
2018-01-01 16:03:13 +02:00
Henrik Ingo
729651dd5d Fix lint errors 2018-01-01 15:27:33 +02:00
Henrik Ingo
e92e02ccb4 Make impress-console-button actually clickable (#651)
Changed the onclick handler to trigger the impress:console:open event
and not use the impressConsole() global function any more. The latter
is considered deprecated now that impressConsole is integrated into
impress.js itself.

Also catch some errors that appear in event handlers when the target
for the click event was immediately removed from DOM.

Fixes #651
2018-01-01 15:05:55 +02:00
Naja Melan
b86214c6e9 impressConsole: Don't put onclick inside style attribute (#652) 2018-01-01 12:54:55 +02:00
Henrik Ingo
df3532085f impressConsole broke init() if root element didn't have id="impress"
Also adds regression tests to prevent this from happening in the future
as well as upgrades karma-chrome-launcher to newest version.

Fixes #654
2017-12-31 14:36:43 +02:00
Blaine Carter
cd499ed8cf Fixed the link to "extra addons" in the plugins README (#647)
* Fixed the link to extra addons. It was 404, now it's linked to https://github.com/impress/impress-extras

* Added new sentence describing how to use extra addons.
2017-12-11 13:04:01 +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
d6c6cd47c2 Change gc.lib.addCallback to gc.lib.pushCallback (#626) 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
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