slipshow
slipshow copied to clipboard
Reformat controller
Not for merging yet
I would like to start a series of opinionated code cleanup:
Now that we use babel
es6 features can be used without restrictions.
Changes
Change I made for now, only in controller.mjs
- Use new
class
def for the controller. - Remove useless getter/setter: if you don't need fine control, default js setters and getters are ok
- Change numerous
if
sequences byswitch
es. This is very opinionated, I can rewind if needed. - Check with
jshint
and reformat withjavascript prettier
. We might want to add these tools to the build chain.
Questions
Most of the key shortcuts do nothing, is that expected ? (zoom, rotate etc) What is the difference between "t" and "T" ?
Yes, lots of reformat are needed :)
- I agree with the use of
class
from es6, - I don't mind the
switch
instead ofif
, though for me they are the same, - rotate used to work. It would be easy to make it work again, but I want a better way of dealing with it first, and it's clearly not a priority
- zoom works once you enter the first slip, that is after the first
next()
. This is because I haven't yet implemented astart()
method toengine
. - I need to rename
showToC
tobuildToC
and then writeshowHideToC
which is what will be called by pressingt
. PressingT
rebuilds the table of content in the DOM and should now be deleted.