mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-11 11:04:08 +00:00
Improved comments
And one minor refactoring
This commit is contained in:
parent
8e6647b615
commit
0bcaa75f18
@ -3,7 +3,7 @@ title: $:/core/boot.js
|
|||||||
type: application/javascript
|
type: application/javascript
|
||||||
|
|
||||||
The main boot kernel for TiddlyWiki. This single file creates a barebones TW environment that is just
|
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
|
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:
|
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
|
// Set up $tw global for the server
|
||||||
if(typeof(window) === "undefined" && !global.$tw) {
|
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;
|
exports.$tw = $tw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +75,8 @@ $tw.config.wikiPluginsSubDir = $tw.config.wikiPluginsSubDir || "./plugins";
|
|||||||
$tw.config.wikiShadowsSubDir = $tw.config.wikiShadowsSubDir || "./wiki";
|
$tw.config.wikiShadowsSubDir = $tw.config.wikiShadowsSubDir || "./wiki";
|
||||||
$tw.config.wikiTiddlersSubDir = $tw.config.wikiTiddlersSubDir || "./tiddlers";
|
$tw.config.wikiTiddlersSubDir = $tw.config.wikiTiddlersSubDir || "./tiddlers";
|
||||||
|
|
||||||
|
$tw.config.jsModuleHeaderRegExpString = "^\\/\\*\\\\\\n((?:^[^\\n]*\\n)+?)(^\\\\\\*\\/$\\n?)"
|
||||||
|
|
||||||
// File extension mappings
|
// File extension mappings
|
||||||
$tw.config.fileExtensionInfo = {
|
$tw.config.fileExtensionInfo = {
|
||||||
".tid": {type: "application/x-tiddler"},
|
".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",{
|
$tw.modules.registerTypedModule($tw.config.root + "/kernel/tiddlerdeserializer/js","tiddlerdeserializer",{
|
||||||
"application/javascript": function(text,fields) {
|
"application/javascript": function(text,fields) {
|
||||||
var headerCommentRegExp = /^\/\*\\\n((?:^[^\n]*\n)+?)(^\\\*\/$\n?)/mg,
|
var headerCommentRegExp = new RegExp($tw.config.jsModuleHeaderRegExpString,"mg"),
|
||||||
match = headerCommentRegExp.exec(text);
|
match = headerCommentRegExp.exec(text);
|
||||||
fields.text = text;
|
fields.text = text;
|
||||||
if(match) {
|
if(match) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user