From ef76349c37662e9706acfffc2c2edb51a920183d Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 22 Feb 2021 12:11:39 +0000 Subject: [PATCH] Add support for utils-browser modules --- core/language/en-GB/Docs/ModuleTypes.multids | 1 + core/modules/startup/load-modules.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/language/en-GB/Docs/ModuleTypes.multids b/core/language/en-GB/Docs/ModuleTypes.multids index 1e1abd424..9a03d8887 100644 --- a/core/language/en-GB/Docs/ModuleTypes.multids +++ b/core/language/en-GB/Docs/ModuleTypes.multids @@ -23,6 +23,7 @@ tiddlerfield: Defines the behaviour of an individual tiddler field. tiddlermethod: Adds methods to the `$tw.Tiddler` prototype. upgrader: Applies upgrade processing to tiddlers during an upgrade/import. utils: Adds methods to `$tw.utils`. +utils-browser: Adds browser-specific methods to `$tw.utils`. utils-node: Adds Node.js-specific methods to `$tw.utils`. widget: Widgets encapsulate DOM rendering and refreshing. wikimethod: Adds methods to `$tw.Wiki`. diff --git a/core/modules/startup/load-modules.js b/core/modules/startup/load-modules.js index e2234d0ac..1dc71f7ac 100644 --- a/core/modules/startup/load-modules.js +++ b/core/modules/startup/load-modules.js @@ -22,6 +22,9 @@ exports.startup = function() { if($tw.node) { $tw.modules.applyMethods("utils-node",$tw.utils); } + if($tw.browser) { + $tw.modules.applyMethods("utils-browser",$tw.utils); + } $tw.modules.applyMethods("global",$tw); $tw.modules.applyMethods("config",$tw.config); $tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");