Commit Graph

163 Commits

Author SHA1 Message Date
Henrik Ingo 443a4a82c1 Fix goto plugin: set lib variable from impress:init 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 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
https://github.com/henrikingo/impress.js/commit/c44fd0f4c102e98a90ee564b91a5cf4f66cec6c3
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
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 ab30317cd0 Set browser:true in .jshintrc 2017-10-02 23:52:04 +03: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
Chad Whitacre 82bc45e6b0 Fix typo from 'arraify' to 'arrayify' (#595) 2016-11-02 23:36:31 +11:00
John-David Dalton 1bf05799a0 Breakout perspective for better IE11 support. (#594) 2016-10-28 16:46:25 -07:00
Chalk 20fe5189fb Corrected the version in the header (#591) 2016-10-28 23:00:46 +11:00
Fagner Brack 3f4eddeb6e Apply JSHint and JSCS with jQuery configs
Closes gh-535. Closes gh-529.
2016-04-16 16:55:49 +10:00
Anjaly Saju d8995aa319 shift/meta key issue fixed 2016-02-03 14:19:37 +01:00
Simeon Visser d33aad069b Fixed use of "were" 2014-08-18 14:10:41 +01:00
Bijan Himself 6cde43b056 Update impress.js
Fixed typo from "how thing work" to "how things work"
2013-07-26 10:34:43 -04:00
Jenil Gogari 950bc935e6 select a step more precisely. 2013-05-14 19:44:21 +05:30
Bartek Szopka edff5a08c1 release 0.5.3 2012-04-04 21:32:17 +00:00
Bartek Szopka 2da949ea18 stopped using transitionend event to provide more consistent impress:stepenter triggering even if there is no transition 2012-04-04 19:39:30 +00:00
Bartek Szopka 8949aae00e next version 2012-04-04 18:23:23 +00:00
Bartek Szopka 9e6b22dccc release 0.5.2 2012-03-31 19:46:42 +00:00
Bartek Szopka c87d7dff48 finally some more descriptive comments in js 2012-03-31 19:44:15 +00:00
Bartek Szopka de6c37949f next version in development 2012-03-28 18:14:00 +00:00
Bartek Szopka d3ce5a8735 release 0.5.1 2012-03-21 08:13:35 +00:00
Bartek Szopka c7f5771211 fixing clicking links on active steps 2012-03-21 08:05:18 +00:00
Bartek Szopka 88662339a9 release 0.5 2012-03-20 21:37:08 +00:00
Bartek Szopka fb32cf1bdd only call enter and leave events when necessary 2012-03-19 20:21:01 +00:00
Bartek Szopka b3d680eab4 lowercase event names to keep DOM events convention, with backbone-style impress: namespace - in courtesy of @medikoo 2012-03-18 20:15:46 +00:00
Bartek Szopka b0c5644b47 "goto now accepts duration parameter" 2012-03-14 22:53:17 +00:00
Bartek Szopka 9d99c03392 "goto now accepts more types of parameters: numbers, id strings and DOM elements" 2012-03-14 22:06:57 +00:00
Bartek Szopka 1a21865ea6 "goto is back, bye bye ugly stepTo" 2012-03-14 20:44:04 +00:00
Bartek Szopka b2ba0ee421 "more readable event names" 2012-03-12 23:43:59 +00:00
Bartek Szopka c64d9fbf97 "added impress-enabled and impress-disabled CSS classes used in impress initialization" 2012-03-12 22:57:58 +00:00
Bartek Szopka e06cda174e "cleaning the code after init refactoring" 2012-03-12 22:48:33 +00:00
Bartek Szopka a055e97a54 "navigation handlers are now added when impress is initialized" 2012-03-12 22:29:45 +00:00
Bartek Szopka 70bc3b737b "impressive API update - added initialization init function and event" 2012-03-12 21:51:07 +00:00
Bartek Szopka 8220ab9393 "merge with master branch (release 0.4.1)" 2012-03-11 19:59:02 +00:00
Bartek Szopka b59a4bf4d7 "bugfix release 0.4.1" 2012-03-11 09:15:35 +00:00
Bartek Szopka 78f2ce657c "fallback mode fix" 2012-03-11 09:10:36 +00:00
Bartek Szopka 5fd0f58fc6 "present and past can't appear together on element" 2012-03-10 23:14:40 +00:00
Bartek Szopka b23506e885 "past, present and future classes on step elements" 2012-03-10 23:06:48 +00:00
Bartek Szopka b0a139ef81 "removed unnecessary transitions and jumpiness when presentation starts" 2012-03-10 22:51:20 +00:00
Bartek Szopka 1bbf205bc7 "added impressive events when step is entered and left, triggered by transition end" 2012-03-10 22:36:08 +00:00
Bartek Szopka 2f677e1292 "next version in development" 2012-03-10 20:22:32 +00:00