Steps to incorporate user settings in existing code

mdsupport wrote on Wednesday, September 21, 2016:

Pull Request #265 provides one way to incorporate user preferences in existing code potentially eliminating need for a global setting. Steps are:

  1. At start fetch previous setting into a php variable using existing hard coded value as the default.
  2. Pass php variable to jquery/javascript with json_encode.
  3. Modify html code to replace existing default with php variable.
  4. Add/modify event listener for dom object to immediately post changes to user setting.
  5. Maintain user’s ability to reverse effects of their action.