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
classdef for the controller. - Remove useless getter/setter: if you don't need fine control, default js setters and getters are ok
- Change numerous
ifsequences byswitches. This is very opinionated, I can rewind if needed. - Check with
jshintand 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
classfrom es6, - I don't mind the
switchinstead 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
showToCtobuildToCand then writeshowHideToCwhich is what will be called by pressingt. PressingTrebuilds the table of content in the DOM and should now be deleted.