diff --git a/core/boot.js b/core/boot.js index 44553e2c1..639d8812e 100644 --- a/core/boot.js +++ b/core/boot.js @@ -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 = {isBrowser: false}; + global.$tw = {}; // No ``browser`` member for the server } // Boot information @@ -419,7 +419,7 @@ $tw.wiki = new $tw.Wiki(); /////////////////////////// Browser definitions -if($tw.isBrowser) { +if($tw.browser) { /* Execute the module named 'moduleName'. The name can optionally be relative to the module named 'moduleRoot' @@ -526,12 +526,12 @@ $tw.wiki.shadows.addTiddlers( $tw.wiki.deserializeTiddlers("(DOM)",document.getElementById("shadowArea")) ); -// End of if($tw.isBrowser) +// End of if($tw.browser) } /////////////////////////// Server definitions -if(!$tw.isBrowser) { +if(!$tw.browser) { var fs = require("fs"), path = require("path"), @@ -640,7 +640,7 @@ $tw.plugins.loadPluginsFromFolder(path.resolve($tw.boot.wikiPath,"./shadows")); // Load tiddlers from wiki tiddlers directory $tw.plugins.loadPluginsFromFolder(path.resolve($tw.boot.wikiPath,"./tiddlers"),null,null,$tw.wiki); -// End of if(!$tw.isBrowser) +// End of if(!$tw.browser) } /////////////////////////// Final initialisation diff --git a/core/bootprefix.js b/core/bootprefix.js index d8989e3b4..ec69f6fe7 100644 --- a/core/bootprefix.js +++ b/core/bootprefix.js @@ -14,7 +14,7 @@ See Boot.js for further details of the boot process. // Set up $tw global for the browser if(window && !window.$tw) { - window.$tw = {isBrowser: true}; + window.$tw = {browser: {}}; } $tw.modules = {titles: {}}; // hashmap by module name of {fn:, exports:, moduleType:} diff --git a/core/modules/startup.js b/core/modules/startup.js index f76f79fcc..1b47a6be6 100644 --- a/core/modules/startup.js +++ b/core/modules/startup.js @@ -14,6 +14,15 @@ This is the main application logic for both the client and server exports.startup = function() { var modules,n,m,f,commander; + // This should be somewhere else + if($tw.browser) { + $tw.browser.prefix = document.body.style.webkitTransform !== undefined ? "webkit" : + document.body.style.MozTransform !== undefined ? "Moz" : + document.body.style.OTransform !== undefined ? "O" : null; + $tw.browser.transition = $tw.browser.prefix + "Transition"; + $tw.browser.transform = $tw.browser.prefix + "Transform"; + $tw.browser.transformorigin = $tw.browser.prefix + "TransformOrigin"; + } // Set up additional global objects $tw.plugins.applyMethods("global",$tw); // Wire up plugin modules @@ -30,7 +39,7 @@ exports.startup = function() { // Get version information $tw.version = $tw.utils.extractVersionInfo(); // Load up the tiddlers in the root of the core directory (we couldn't do before because we didn't have the serializers installed) - if(!$tw.isBrowser) { + if(!$tw.browser) { $tw.plugins.loadPluginsFromFolder($tw.boot.bootPath,"$:/core",/^\.DS_Store$|.meta$|^modules$/); } // Set up the wiki store @@ -41,7 +50,7 @@ exports.startup = function() { // Set up the command plugins $tw.Commander.initCommands(); // Host-specific startup - if($tw.isBrowser) { + if($tw.browser) { // Display the PageTemplate var renderer = $tw.wiki.parseTiddler("PageTemplate"); renderer.execute([],"PageTemplate"); diff --git a/core/modules/utils.js b/core/modules/utils.js index f1acf54ec..46410dacd 100644 --- a/core/modules/utils.js +++ b/core/modules/utils.js @@ -335,7 +335,7 @@ exports.getVersionString = function() { Extract the version number from the meta tag or from the boot file */ -if($tw.isBrowser) { +if($tw.browser) { // Browser version exports.extractVersionInfo = function() {