Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for issue 38 related to '"new dependent action" from action doesn…

…'t tag with action/realm/context'.
  • Loading branch information...
commit d6a9d4e68177396e5c77810788199c6cb425c90e 1 parent 24ee7f6
Georg-Victor Voutsinos authored
2  layout/MonkeyGTDTheme.theme
View
@@ -42,7 +42,7 @@
<span macro='toolbar closeTiddler closeOthers +editTiddler deleteTiddler > fields syncing permalink references jump'></span>
<span macro='newHere label:"new here" tag:Reference'></span>
<span macro='newJournalHere {{config.mGTD.getOptTxt("newjournaldateformat")?config.mGTD.getOptTxt("newjournaldateformat"):"DD-mmm-YY 0hh:0mm"}} tag:Reference'></span>
- <span macro="showWhenTagged Action"><span macro="newSavedTiddler title:'new dependent action' label:'new dependent action' tag:{{'Action Future [['+config.macros.mgtdList.getRealm()+']] [['+tiddler.getParent('Context')+']] [['+tiddler.getParent('Project')+']] [['+tiddler.title+']]'}}"></span></span>
+ <span macro="showWhenTagged Action"><span macro="newSavedTiddler title:'new dependent action' label:'new dependent action' tag:{{'Action Future \[\['+tiddler.getByIndex('Realm')+'\]\] \[\['+tiddler.getParent('Context').join('\]\] \[\[')+'\]\] \[\['+tiddler.getParent('Project')+'\]\] \[\['+tiddler.title+'\]\]'}}"></span></span>
</div>
<!--}}}-->
13 supporting/NewSavedTiddlerPlugin.js
View
@@ -3,6 +3,11 @@ config.macros.newSavedTiddler.handler = function(place,macroName,params,wikifier
if (readOnly) {
return false;
}
+ //
+ // temporarily fix global tiddler reference for possible usage in executable params
+ //
+ var currentTiddler = window.tiddler;
+ window.tiddler = tiddler;
var p = paramString.parseParams("anon",null,true,false,false);
var label = getParam(p,"label","NewSavedTiddler");
var tooltip = getParam(p,"tooltip","");
@@ -28,10 +33,17 @@ config.macros.newSavedTiddler.handler = function(place,macroName,params,wikifier
}
var btn = createTiddlyButton(place,label,tooltip,this.onClick);
btn.params = paramString;
+ btn.tiddler = tiddler; // save tiddler reference this button relates to
+ window.tiddler = currentTiddler; // restore global tiddler reference
return false;
};
config.macros.newSavedTiddler.onClick = function(e) {
+ //
+ // temporarily fix global tiddler reference for possible usage in executable params
+ //
+ var currentTiddler = window.tiddler;
+ window.tiddler = this.tiddler;
var p = this.params.parseParams("anon",null,true,false,false);
var titlePrompt = getParam(p,"prompt","");
//
@@ -71,6 +83,7 @@ config.macros.newSavedTiddler.onClick = function(e) {
autoSaveChanges(null,[tiddler]);
story.displayTiddler(this,title);
}
+ window.tiddler = currentTiddler; // restore global tiddler reference
return false;
}
2  views/TitleButtons.tiddler
View
@@ -65,7 +65,7 @@
<br style="clear:left"/>
<div class="floatleft">
<span class="label">Depends on:</span><br/><span macro="multiSelectTag Action allowNone:on"></span><span macro="linkToParent Action"></span>
- <!-- fixme. broken in 2.4.1 but works in 2.4.3?: <span macro="newSavedTiddler title:'new dependent action' label:'+ dependent action' tag:{{'Action Future [['+config.macros.mgtdList.getRealm()+']] [['+tiddler.getParent('Context')+']] [['+tiddler.getParent('Project')+']] [['+tiddler.title +']]'}}"></span> -->
+ <span macro="newSavedTiddler title:'new dependent action' label:'+ dependent action' tag:{{'Action Future \[\['+tiddler.getByIndex('Realm')+'\]\] \[\['+tiddler.getParent('Context').join('\]\] \[\[')+'\]\] \[\['+tiddler.getParent('Project')+'\]\] \[\['+tiddler.title+'\]\]'}}"></span>
</div>
<div class="clearboth"></div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.