mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-19 17:57:38 +00:00
Refine node vs. browser behaviour
Now we’re using TiddlyWiki as the core of TiddlyDesktop we need more granular control of the platform specific code.
This commit is contained in:
@@ -524,29 +524,22 @@ exports.isValidFieldName = function(name) {
|
||||
Extract the version number from the meta tag or from the boot file
|
||||
*/
|
||||
|
||||
if($tw.browser) {
|
||||
|
||||
// Browser version
|
||||
exports.extractVersionInfo = function() {
|
||||
var metatags = document.getElementsByTagName("meta");
|
||||
for(var t=0; t<metatags.length; t++) {
|
||||
var m = metatags[t];
|
||||
if(m.name === "tiddlywiki-version") {
|
||||
return m.content;
|
||||
if($tw.packageInfo) {
|
||||
return $tw.packageInfo.version;
|
||||
} else {
|
||||
var metatags = document.getElementsByTagName("meta");
|
||||
for(var t=0; t<metatags.length; t++) {
|
||||
var m = metatags[t];
|
||||
if(m.name === "tiddlywiki-version") {
|
||||
return m.content;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
// Server version
|
||||
exports.extractVersionInfo = function() {
|
||||
return $tw.packageInfo.version;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Get the animation duration in ms
|
||||
*/
|
||||
|
Reference in New Issue
Block a user