slipshow icon indicating copy to clipboard operation
slipshow copied to clipboard

Reformat controller

Open voodoos opened this issue 5 years ago • 1 comments

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 by switches. This is very opinionated, I can rewind if needed.
  • Check with jshint and reformat with javascript 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" ?

voodoos avatar Jan 18 '20 13:01 voodoos

Yes, lots of reformat are needed :)

  • I agree with the use of class from es6,
  • I don't mind the switch instead of if, 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 a start() method to engine.
  • I need to rename showToC to buildToC and then write showHideToC which is what will be called by pressing t. Pressing T rebuilds the table of content in the DOM and should now be deleted.

panglesd avatar Jan 20 '20 15:01 panglesd