From 65b55925de72c97f8792359b377420bc13891c68 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 30 Mar 2012 13:48:59 +0100 Subject: [PATCH] Added support for committing edits to a draft tiddler --- js/macros/story.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/js/macros/story.js b/js/macros/story.js index 54a25f5a9..a781a4df8 100644 --- a/js/macros/story.js +++ b/js/macros/story.js @@ -54,6 +54,32 @@ exports.macro = { this.store.addTiddler(new Tiddler(storyTiddler,{text: JSON.stringify(story)})); event.stopPropagation(); return false; + }, + "tw-SaveTiddler": function(event) { + var template = this.hasParameter("defaultViewTemplate") ? this.params.defaultEditTemplate : "SimpleTemplate", + storyTiddler = this.store.getTiddler(this.params.story), + story = {tiddlers: []}; + if(storyTiddler && storyTiddler.hasOwnProperty("text")) { + story = JSON.parse(storyTiddler.text); + } + for(var t=0; t