JS structure

source: pixabay.com
EzGitDoc designer logic is split into more than one script file to make it easier to understand, maintain and view it's source code for potential contributors or viewers. In this article, you will find out responsibilities for each script created for EzGitDoc.
ezBtnController.js
- Attaches to page key combinations that trigger specific modals
- Closes all modals on using valid key combination
ezGenLogic.js
- EzGitDoc UI Core that setup's & generate's elements in designer
ezLogicTranslator.js
- Translates elements created by UI Core into code that can be used in
.mdfile
ezMisc.js
- Initializes elements in (document).ready function
- Implements:
- toast (and it's time counter)
- helpful functions (e.g. GenerateUniqueId, validateURL, checkIfNumber, checkifNaN)
- list group
activeclass management - copying code to clipboard
- saving code to file
- RESET, GENERATE CODE buttons behaviour
ezQuickBuilder.js
- Translates Quickbuilder input into
.mdcode
ezReferencesLogic.js
- Builds anchors to elements created by UI Core for
Referencesmodal - Implements highlighting system
- Implements changing element's position system
ezSettings.js
- Defines available settings for EzGitDoc tool
- Defines functions for saving/loading settings
- Defines functions for
Theme, Settingsmodals UIs
ezUpdateLogic.js
- Triggers and then loads chosen element's data into update modal
- Defines update logic for elements created by UI Core (ezGenLogic.js)
ezValidation.js
- Defines messages for toasts
- Defines functions for validation requests