1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 16:30:46 +00:00

Added plain module serialiser

Needed when we pack lots of modules into a single .js file
This commit is contained in:
Jeremy Ruston 2012-10-10 16:32:55 +01:00
parent bf75735db9
commit 1896063788

View File

@ -22,7 +22,7 @@ var mapEachTiddler = function(wiki,tiddlers,callback) {
}
}
return result.join("");
}
};
exports["text/plain"] = function(tiddlers) {
return mapEachTiddler(this,tiddlers,function(tiddler) {
@ -89,6 +89,12 @@ exports["application/x-tiddler-module"] = function(tiddlers) {
});
};
exports["application/x-tiddler-module-plain"] = function(tiddlers) {
return mapEachTiddler(this,tiddlers,function(tiddler) {
return "$tw.modules.define(\"" + tiddler.fields.title + "\",\"" + tiddler.fields["module-type"] + "\",function(module,exports,require) {" + tiddler.fields.text + "});\n";
});
};
exports["application/x-tiddler-library"] = function(tiddlers) {
return mapEachTiddler(this,tiddlers,function(tiddler) {
var attributes = {