To make the other changes required by this app, additional separation of functionality is desired.
Namely, batchFileRenamer.js must be split up into a model and a view.
The model will know about the file system and settings but NOT about the view directly. It will receive a callback to evoke when its observable state changes.
The view (also a bit of controller) will redraw when the model changes and give the model updates on user actions. The view will require the model to be constructed.
To make the other changes required by this app, additional separation of functionality is desired.
Namely,
batchFileRenamer.js
must be split up into a model and a view.The model will know about the file system and settings but NOT about the view directly. It will receive a callback to evoke when its observable state changes.
The view (also a bit of controller) will redraw when the model changes and give the model updates on user actions. The view will require the model to be constructed.
I'll use Douglas Crockford's object convention.