kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Get rid of more vestiges of the old empty generation mechanism
rodzic
454f892cf2
commit
0dbe4c0291
|
@ -57,9 +57,7 @@ Command.prototype.execute = function() {
|
||||||
case "GET":
|
case "GET":
|
||||||
if(path === "/") {
|
if(path === "/") {
|
||||||
response.writeHead(200, {"Content-Type": serveType});
|
response.writeHead(200, {"Content-Type": serveType});
|
||||||
var text = self.commander.wiki.renderTiddler(renderType,rootTiddler,{
|
var text = self.commander.wiki.renderTiddler(renderType,rootTiddler);
|
||||||
"with": ["","[!is[shadow]]"]
|
|
||||||
});
|
|
||||||
response.end(text, "utf8");
|
response.end(text, "utf8");
|
||||||
} else {
|
} else {
|
||||||
response.writeHead(404);
|
response.writeHead(404);
|
||||||
|
|
|
@ -611,19 +611,14 @@ exports.callSaver = function(method /*, args */ ) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Save the wiki contents. Options are:
|
Save the wiki contents. Options are:
|
||||||
saveEmpty: causes the wiki to be saved without any content
|
|
||||||
template: the tiddler containing the template to save
|
template: the tiddler containing the template to save
|
||||||
downloadType: the content type for the saved file
|
downloadType: the content type for the saved file
|
||||||
*/
|
*/
|
||||||
exports.saveWiki = function(options) {
|
exports.saveWiki = function(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var template = options.template || "$:/core/templates/tiddlywiki5.template.html",
|
var template = options.template || "$:/core/templates/tiddlywiki5.template.html",
|
||||||
downloadType = options.downloadType || "text/plain",
|
downloadType = options.downloadType || "text/plain";
|
||||||
renderOptions = {};
|
var text = this.renderTiddler(downloadType,template);
|
||||||
renderOptions["with"] = options.saveEmpty ?
|
|
||||||
[undefined,"[!is[shadow]is[shadow]]"] :
|
|
||||||
[undefined,"[!is[shadow]]"];
|
|
||||||
var text = this.renderTiddler(downloadType,template,renderOptions);
|
|
||||||
this.callSaver("save",text);
|
this.callSaver("save",text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue