From 11a82c1b4700a4c8d5e9f52bf0ae3623ce3deb97 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 9 Apr 2016 00:12:29 +0200 Subject: [PATCH] Destroyed Module System Proposal (asciidoc) --- Module-System-Proposal.asciidoc | 45 --------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 Module-System-Proposal.asciidoc diff --git a/Module-System-Proposal.asciidoc b/Module-System-Proposal.asciidoc deleted file mode 100644 index 6dcaa22..0000000 --- a/Module-System-Proposal.asciidoc +++ /dev/null @@ -1,45 +0,0 @@ -With the growing additional features of the MagicMirror, we might want to overhaul the MagicMirror module system, and move all the existing functionalities into default modules. Before we overhaul the the complete system, I'd like to document to proposed API. - -My suggestion is as follows: - -## Module Loader - -We define a few preset regions on the mirror in which we can load modules: - -image::http://i.imgur.com/mshIn9n.png[regions] - -In the config, we can set which modules we would like to load: - - modules = { - TOP_LEFT: { - ["clock", {timeFormat: 12, displaySeconds: true, digitFade: false}], - ["calendar", {maximumEntries: 10, displaySymbol: true, defaultSymbol: 'calendar' urls: [...]}] - }, - TOP_RIGHT: { - ["weather", {q: 'Baarn,Netherlands', units: 'metric', APPID: '...'}] - }, - LOWER_THIRD: { - ["compliments", {interval: 30000, fadeInterval: 4000, ...}] - }, - ... - } - -## Module anatomy - -Every module in the module folder should contain the module.js file defining a class for the module with the following methods: - -`function initModule(region, options) { ... }` - This initializes the module. The region variable can be used to display a different version of the module, depending on the region. - -`function htmlForModule() { ... }` - This returns the html injected into the region. (maybe this should just return a dom object?) T - -`function cssFileForModule() { ... }` - This returns an array of urls to a css files needed by the module. - -`function jsFileForModule() { ... }` - This returns an array of urls to js files needed by the module. - -Any helper scrips (php) should be in the module folder, and should not affect any other module or the main system. There should be a way to start scripts (python, node etc.) as daemons. Maybe some kind of API to send data back to the modules should be implemented (socket.io & UNIX sockets). - -## API Design - -*** - -_... please edit with your suggestions ...._ \ No newline at end of file