mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Updated to node v.0.8.2
This commit is contained in:
parent
3a24bdbaf3
commit
d910d75124
@ -570,7 +570,7 @@ $tw.loadTiddlersFromFile = function(file,fields,isShadow) {
|
|||||||
data = fs.readFileSync(file).toString(typeInfo ? typeInfo.encoding : "utf8"),
|
data = fs.readFileSync(file).toString(typeInfo ? typeInfo.encoding : "utf8"),
|
||||||
tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields),
|
tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields),
|
||||||
metafile = file + ".meta";
|
metafile = file + ".meta";
|
||||||
if(ext !== ".json" && tiddlers.length === 1 && path.existsSync(metafile)) {
|
if(ext !== ".json" && tiddlers.length === 1 && fs.existsSync(metafile)) {
|
||||||
var metadata = fs.readFileSync(metafile).toString("utf8");
|
var metadata = fs.readFileSync(metafile).toString("utf8");
|
||||||
if(metadata) {
|
if(metadata) {
|
||||||
tiddlers = [$tw.utils.parseFields(metadata,tiddlers[0])];
|
tiddlers = [$tw.utils.parseFields(metadata,tiddlers[0])];
|
||||||
@ -585,7 +585,7 @@ Load all the plugins from the plugins directory
|
|||||||
$tw.loadTiddlersFromFolder = function(filepath,basetitle,excludeRegExp,isShadow) {
|
$tw.loadTiddlersFromFolder = function(filepath,basetitle,excludeRegExp,isShadow) {
|
||||||
basetitle = basetitle || "$:/plugins";
|
basetitle = basetitle || "$:/plugins";
|
||||||
excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/;
|
excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/;
|
||||||
if(path.existsSync(filepath)) {
|
if(fs.existsSync(filepath)) {
|
||||||
var stat = fs.statSync(filepath);
|
var stat = fs.statSync(filepath);
|
||||||
if(stat.isDirectory()) {
|
if(stat.isDirectory()) {
|
||||||
var files = fs.readdirSync(filepath);
|
var files = fs.readdirSync(filepath);
|
||||||
|
@ -40,7 +40,7 @@ exports["application/x-tiddlywiki-recipe"] = function(text,fields) {
|
|||||||
fields = {title: sourcePath},
|
fields = {title: sourcePath},
|
||||||
tids = self.deserializeTiddlers(ext,data,fields),
|
tids = self.deserializeTiddlers(ext,data,fields),
|
||||||
metafile = sourcePath + ".meta";
|
metafile = sourcePath + ".meta";
|
||||||
if(ext !== ".json" && tids.length === 1 && path.existsSync(metafile)) {
|
if(ext !== ".json" && tids.length === 1 && fs.existsSync(metafile)) {
|
||||||
var metadata = fs.readFileSync(metafile).toString("utf8");
|
var metadata = fs.readFileSync(metafile).toString("utf8");
|
||||||
if(metadata) {
|
if(metadata) {
|
||||||
tids = [$tw.utils.parseFields(metadata,tids[0])];
|
tids = [$tw.utils.parseFields(metadata,tids[0])];
|
||||||
|
Loading…
Reference in New Issue
Block a user