/*\ title: $:/core/modules/startup.js type: application/javascript module-type: startup This is the main application logic for both the client and server \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; exports.startup = function() { var modules,n,m,f,commander; // Load modules $tw.modules.applyMethods("global",$tw); $tw.modules.applyMethods("config",$tw.config); $tw.modules.applyMethods("utils",$tw.utils); if($tw.browser) { $tw.utils.getBrowserInfo($tw.browser); } $tw.version = $tw.utils.extractVersionInfo(); $tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield"); $tw.modules.applyMethods("tiddlermethod",$tw.Tiddler.prototype); $tw.modules.applyMethods("wikimethod",$tw.Wiki.prototype); $tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules); $tw.Wiki.tiddlerSerializerModules = {}; $tw.modules.applyMethods("tiddlerserializer",$tw.Wiki.tiddlerSerializerModules); $tw.modules.applyMethods("treeutils",$tw.Tree); $tw.modules.applyMethods("treenode",$tw.Tree); // Set up the wiki store $tw.wiki.initMacros(); $tw.wiki.initEditors(); $tw.wiki.initStoryViews(); $tw.wiki.initParsers(); // Set up the command modules $tw.Commander.initCommands(); // Host-specific startup if($tw.browser) { // Call browser startup modules var modules = $tw.modules.types["browser-startup"]; for(var m=0; m