djplaner / Content-Interface-Tweak

Improves both the task of creating content for Blackboard Learn, and reading that content.
https://djplaner.github.io/Content-Interface-Tweak/
GNU General Public License v3.0
0 stars 0 forks source link

Move model/view into modules #12

Closed djplaner closed 4 years ago

djplaner commented 4 years ago

Move the steps of reading the HTML and transforming it into models. Perhaps into a model/view type separation.

Controller

Model

View

There are actually three parts of the view

  1. transform the raw HTML
    • cards, readings etc all become one of these
  2. Add the interface (initially accordions)
  3. Add the instructions to the tweak - perhaps this goes - setupEdit
djplaner commented 4 years ago

What might the contentInterface method look like?

  1. getModel

    Get the parameters and other page details into an object, including

    • editModeOn - T|F
    • tweak_bb - current object
    • contentInterface - jQuery object ??
    • wordDoc - jQuery object
    • params
    • TERM, YEAR, PERIOD
  2. transformContent( model )

    Make modifications to the study guide HTML. All the current cards, readings etc.

  3. finaliseInterface( model )

    Currently adding the accordions


model = new ciModel();
view = new ciView(); 
view.transformContent( );
view.finaliseInterface( );
view.setUpEdit();
djplaner commented 4 years ago

Actually better to separate out these concerns into separate views?

Would enable factory classes for each task and then allow mixing and matching of various different approaches.

Though perhaps the jQuery reliance would move into the view, rather than in the HTML tweak.

model = new ciModel();
contentView = new ciContentView( model );
contentView.view();
interfaceView = new ciInterfaceView( model );
interfaceView.view();
tweakView = new tweakView( model);
tweakView.view();

This would need to eventually be improved. e.g. strategy factory or some such.