/*\ title: js/App.js This is the main() function in the browser \*/ (function(){ /*jslint node: true, browser: true */ "use strict"; var WikiStore = require("./WikiStore.js").WikiStore, Tiddler = require("./Tiddler.js").Tiddler, tiddlerInput = require("./TiddlerInput.js"), tiddlerOutput = require("./TiddlerOutput.js"), WikiTextProcessor = require("./WikiTextProcessor.js").WikiTextProcessor, Sandbox = require("./Sandbox.js").Sandbox, Navigators = require("./Navigators.js").Navigators, StoryNavigator = require("./StoryNavigator.js").StoryNavigator; var App = function() { var t; // Check if we're running on the server or the client this.isBrowser = typeof window !== "undefined"; // Create the main store this.store = new WikiStore(); // Register the wikitext processor this.store.registerTextProcessor("text/x-tiddlywiki",new WikiTextProcessor({ store: this.store })); // Register the standard tiddler serializers and deserializers tiddlerInput.register(this.store); tiddlerOutput.register(this.store); // Add the shadow tiddlers that are built into TiddlyWiki var shadowShadowStore = new WikiStore({ shadowStore: null }), shadowShadows = [ {title: "StyleSheet", text: ""}, {title: "MarkupPreHead", text: ""}, {title: "MarkupPostHead", text: ""}, {title: "MarkupPreBody", text: ""}, {title: "MarkupPostBody", text: ""}, {title: "TabTimeline", text: "<>"}, {title: "TabAll", text: "<>"}, {title: "TabTags", text: "<>"}, {title: "TabMoreMissing", text: "<>"}, {title: "TabMoreOrphans", text: "<>"}, {title: "TabMoreShadowed", text: "<>"}, {title: "AdvancedOptions", text: "<>"}, {title: "PluginManager", text: "<>"}, {title: "SystemSettings", text: ""}, {title: "ToolbarCommands", text: "|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|"}, {title: "WindowTitle", text: "<> - <>"}, {title: "DefaultTiddlers", text: "[[GettingStarted]]"}, {title: "MainMenu", text: "[[GettingStarted]]"}, {title: "SiteTitle", text: "My TiddlyWiki"}, {title: "SiteSubtitle", text: "a reusable non-linear personal web notebook"}, {title: "SiteUrl", text: ""}, {title: "SideBarOptions", text: '<><><><><><><>'}, {title: "SideBarTabs", text: '<>'}, {title: "TabMore", text: '<>'} ]; this.store.shadows.shadows = shadowShadowStore; for(t=0; t