1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Improved comments

And one minor refactoring
This commit is contained in:
Jeremy Ruston 2012-08-22 12:33:21 +01:00
parent 8e6647b615
commit 0bcaa75f18

View File

@ -3,7 +3,7 @@ title: $:/core/boot.js
type: application/javascript
The main boot kernel for TiddlyWiki. This single file creates a barebones TW environment that is just
sufficient to bootstrap the modules containing the main logic of the applicaiton.
sufficient to bootstrap the modules containing the main logic of the application.
On the server this file is executed directly to boot TiddlyWiki. In the browser, this file is packed
into a single HTML file along with other elements:
@ -32,7 +32,7 @@ In practice, each module is wrapped in a separate script block.
// Set up $tw global for the server
if(typeof(window) === "undefined" && !global.$tw) {
global.$tw = {}; // No ``browser`` member for the server
global.$tw = {}; // No `browser` member for the server
exports.$tw = $tw;
}
@ -75,6 +75,8 @@ $tw.config.wikiPluginsSubDir = $tw.config.wikiPluginsSubDir || "./plugins";
$tw.config.wikiShadowsSubDir = $tw.config.wikiShadowsSubDir || "./wiki";
$tw.config.wikiTiddlersSubDir = $tw.config.wikiTiddlersSubDir || "./tiddlers";
$tw.config.jsModuleHeaderRegExpString = "^\\/\\*\\\\\\n((?:^[^\\n]*\\n)+?)(^\\\\\\*\\/$\\n?)"
// File extension mappings
$tw.config.fileExtensionInfo = {
".tid": {type: "application/x-tiddler"},
@ -463,7 +465,7 @@ Register the built in tiddler deserializer modules
*/
$tw.modules.registerTypedModule($tw.config.root + "/kernel/tiddlerdeserializer/js","tiddlerdeserializer",{
"application/javascript": function(text,fields) {
var headerCommentRegExp = /^\/\*\\\n((?:^[^\n]*\n)+?)(^\\\*\/$\n?)/mg,
var headerCommentRegExp = new RegExp($tw.config.jsModuleHeaderRegExpString,"mg"),
match = headerCommentRegExp.exec(text);
fields.text = text;
if(match) {