| | 140 | //# getDiscussion command definition |
|---|
| | 141 | config.commands.getDiscussion = {}; |
|---|
| | 142 | merge(config.commands.getDiscussion,{ |
|---|
| | 143 | text: "getdiscussion", |
|---|
| | 144 | tooltip:"Get discussion for this tiddler", |
|---|
| | 145 | hideReadOnly: true, |
|---|
| | 146 | done: "Discussion downloaded" |
|---|
| | 147 | }); |
|---|
| | 148 | |
|---|
| | 149 | config.commands.getDiscussion.isEnabled = function(tiddler) |
|---|
| | 150 | { |
|---|
| | 151 | return isAdaptorFunctionSupported('getTopicList',tiddler.fields); |
|---|
| | 152 | }; |
|---|
| | 153 | |
|---|
| | 154 | config.commands.getDiscussion.handler = function(event,src,title) |
|---|
| | 155 | { |
|---|
| | 156 | displayMessage("config.commands.getTiddler.handler:"+title); |
|---|
| | 157 | var tiddler = store.fetchTiddler(title); |
|---|
| | 158 | if(tiddler) { |
|---|
| | 159 | var fields = tiddler.fields; |
|---|
| | 160 | } else { |
|---|
| | 161 | fields = String(document.getElementById(story.idPrefix + title).getAttribute("tiddlyFields")); |
|---|
| | 162 | fields = fields ? fields.decodeHashMap() : null; |
|---|
| | 163 | } |
|---|
| | 164 | config.macros.importWikispacesMessages.getTopicList(title,config.macros.importWikispacesMessages.createContext(fields)); |
|---|
| | 165 | return true; |
|---|
| | 166 | }; |
|---|