From f469545707b211809541c50d76c41e8157e18011 Mon Sep 17 00:00:00 2001 From: Mees van der Wijk Date: Tue, 29 Apr 2025 18:05:01 +0200 Subject: [PATCH] Added some important principals --- ImportantPrincipals.md | 7 ++++++ _Sidebar.md | 53 +++++++++++++++++++++--------------------- 2 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 ImportantPrincipals.md diff --git a/ImportantPrincipals.md b/ImportantPrincipals.md new file mode 100644 index 0000000..beae632 --- /dev/null +++ b/ImportantPrincipals.md @@ -0,0 +1,7 @@ +# ModuleClientApi - Important Principals + +When creating the client side of a module there are some really important things to take account of! + +- Never use document.getElementById or document.querySelector! Always use api.dom().querySelector so the element are always in the correct scope. +- Never use event 'DOMContentLoaded' since the DOM content is always ready when the code is executed. +- Never use event 'resize' instead use api.onResize() diff --git a/_Sidebar.md b/_Sidebar.md index 6cd28a2..422023c 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,26 +1,27 @@ -* [Introduction](./Home) -* [Prerequisites](./Prerequisites) -* [Setting up server](./ServerSetup) -* [Config](./Config) -* Module Development - * [Module Structure](./ModuleStructure) - * [Module.json](./ModuleJSON) - * [Property](./ModuleJSONProperty) - * [Trigger](./ModuleTrigger) - * [Condition](./ModuleCondition) - * [Complete Example](./module.json) - * [Development environment/Building](./ModuleEnvironment) - * [GetiyoModuleTool](./GetiyoModuleTool) - * [ModuleClientAPI](./ModuleClientAPI) - * [User](./ModuleClientAPIUser) - * [ModuleServerAPI](./ModuleServerAPI) - * [Client](./ModuleServerAPIClient) - * [Property](./ModuleServerAPIProperty) - * [ModuleData](./ModuleServerAPIModuleData) - * [Libs](./ModuleServerAPILibs) - * [LibWebSocket](./ModuleServerAPILibsWebSocketLib) - * [Axios](https://axios-http.com/docs/instance) - * [Module Debugging](./ModuleDebugging) - * [ModuleStore](./ModuleStore) -* [Bug/Feature Reporting](./Reporting) -* [Contact Details](./ContactDetails) \ No newline at end of file +- [Introduction](./Home) +- [Prerequisites](./Prerequisites) +- [Setting up server](./ServerSetup) +- [Config](./Config) +- Module Development + - [Module Structure](./ModuleStructure) + - [Module.json](./ModuleJSON) + - [Property](./ModuleJSONProperty) + - [Trigger](./ModuleTrigger) + - [Condition](./ModuleCondition) + - [Complete Example](./module.json) + - [Development environment/Building](./ModuleEnvironment) + - [GetiyoModuleTool](./GetiyoModuleTool) + - [ModuleClientAPI](./ModuleClientAPI) + - [User](./ModuleClientAPIUser) + - [Important Principals](./ImportantPrincipals) + - [ModuleServerAPI](./ModuleServerAPI) + - [Client](./ModuleServerAPIClient) + - [Property](./ModuleServerAPIProperty) + - [ModuleData](./ModuleServerAPIModuleData) + - [Libs](./ModuleServerAPILibs) + - [LibWebSocket](./ModuleServerAPILibsWebSocketLib) + - [Axios](https://axios-http.com/docs/instance) + - [Module Debugging](./ModuleDebugging) + - [ModuleStore](./ModuleStore) +- [Bug/Feature Reporting](./Reporting) +- [Contact Details](./ContactDetails)