Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
<<mgtdList startTag:Project title:'Projects with no area' tags:'!Complete' view:Project mode:global
group:ProjectStatus
gView:bold
where:tiddler.getByIndex('Area').length==0
>>
<<mgtdList startTag:Action title:'You should give these actions a context' tags:'!Done' view:DoneAction mode:global
where:tiddler.getByIndex('Context').length==0&&tiddler.hasActiveProject()
>>
<<mgtdList startTag:Action title:'Actions with no project' tags:'!Done' view:DoneAction mode:global
where:tiddler.getByIndex('Project').length==0
>>
{{cols3{
{{col{
}}}
{{col{
}}}
{{col{
}}}
{{clear{
}}}
}}}
Enter projects and actions here. Click 'create these items' to create them.
Example usage:
{{{
Paint House
.Buy ladder and brushes|@Errand
.Choose colours|@Home|W
}}}
By default actions are next actions.
Specify W or F to make them future or Waiting For. You can create multiple projects and project-less actions.
You can also specify area for projects. Order dosn't matter, as there can only be one uniquely named tiddler. The following is valid:
{{{
Paint House|Home Maintenance|Personal
.Buy ladder and brushes|@Errand
.Choose colours|W|@Home
}}}
To specify multiple projects and tasks, along with project-less actions, the below is an example of one way create two projects with tasks, and then a stand alone action.
{{{
Clean up yard|Personal|Home Maintenance
.Pick up sticks|@Weekend
.Bag all the sticks|@Weekend
Check out latest SAN offerings|Research|Work
.Read up on all major vendors offerings|@Reading
.Call Doug for opinion|@Call
.Check budget|@Work|F
.Call Tara about tickets
}}}
If you want to add an action to an already existing project, you can specify the project name to do so:
{{{
.Pick up lumber at Home Depot|Build toolshed|@Errand
}}}
{{cols3{
{{col{
<<tiddler 'Ticklers Requiring Action'>>
<<mgtdList
title:'Next Actions'
startTag:Action tags:'Next && !Done'
view:ActionProj
mode:global
where:tiddler.hasActiveProject()
newButtonTags:'Action Next'
>>
<<mgtdList
title:'Waiting Actions'
startTag:Action
tags:'[(Waiting For)] && !Done'
view:ActionProj
mode:global
where:tiddler.hasActiveProject()
newButtonTags:'Action [(Waiting For)]'
>>
}}}
{{col{
<<mgtdList
title:'Future Actions'
startTag:Action
tags:'Future && !Done'
view:ActionProj
mode:global
where:tiddler.hasActiveProject()
newButtonTags:'Action Future'
>>
{{scroll10{
<<mgtdList
title:'Done Actions'
startTag:Action
tags:'Done'
view:DoneAction
mode:global
newButtonTags:'Action Next Done'
sort:-modified
>>
}}}
}}}
{{col{
<<mgtdList
title:'Active Projects'
startTag:Project
tags:'!Complete && !Someday/Maybe'
view:ProjectBare
mode:global
newButtonTags:'Project Active'
>>
}}}
{{clear{
}}}
}}}
{{cols3{
{{col{
<<tiddler 'Ticklers Requiring Action'>>
<<mgtdList title:'Next Actions' startTag:Action tags:'Next && !Done' view:ActionProj mode:global
group:Context
gView:Context
where:tiddler.hasActiveProject()
newButtonTags:'Action Next'
>>
<<mgtdList title:'Waiting Actions' startTag:Action tags:'[(Waiting For)] && !Done' view:ActionProj mode:global
group:Context
gView:Context
where:tiddler.hasActiveProject()
newButtonTags:'Action [(Waiting For)]'
>>
}}}
{{col{
<<mgtdList title:'Future Actions' startTag:Action tags:'Future && !Done' view:ActionProj mode:global
group:Context
gView:Context
where:tiddler.hasActiveProject()
newButtonTags:'Action Future'
>>
{{scroll10{
<<mgtdList title:'Done Actions' startTag:Action tags:'Done' view:DoneAction mode:global
newButtonTags:'Action Next Done'
sort:-modified
>>
}}}
}}}
{{col{
<<mgtdList title:'Active Projects' startTag:Project tags:'!Complete && !Someday/Maybe' view:ProjectBare mode:global
newButtonTags:'Project Active'
>>
}}}
{{clear{
}}}
}}}
{{cols3{
{{col{
<<tiddler 'Ticklers Requiring Action'>>
<<mgtdList title:'Next Actions' startTag:Action tags:'Next && !Done' view:Action mode:global
group:Project
gView:bold
where:tiddler.hasActiveProject()
newButtonTags:'Action Next'
>>
<<mgtdList title:'Waiting Actions' startTag:Action tags:'[(Waiting For)] && !Done' view:Action mode:global
group:Project
gView:bold
where:tiddler.hasActiveProject()
newButton:'Action [(Waiting For)]'
>>
}}}
{{col{
<<mgtdList title:'Future Actions' startTag:Action tags:'Future && !Done' view:Action mode:global
group:Project
gView:bold
where:tiddler.hasActiveProject()
newButtonTags:'Action Future'
>>
}}}
{{col{
{{scroll10{
<<mgtdList title:'Done Actions' startTag:Action tags:'Done' view:DoneAction mode:global
group:Project
gView:bold
sort:-modified
newButtonTags:'Action Next Done'
where:tiddler.hasActiveProject()
>>
}}}
}}}
{{clear{
}}}
}}}
order:1
button:a
buttonLong:active
<<mgtdList startTag:Project title:'You must assign a next action to these projects (or make them into Someday/Maybe)'
tags:'!Complete && !Someday/Maybe' view:Project mode:global
where:!tiddler.hasNextActionOrSubProject()
>>
Sigh! weekend work to insure no customer impact. Bring server active, take traffic through server as part of the cluster, monitor,
Change Control to bring this server as active to cluster. Rem to enter the tasks to tell the facilities, storage, network, inventory and support teams to update the databases showing this server as a production part of the infrastructure.
Change control to make this server a part of existing cluster. Possible customer impact, so needs a CC.
2 network cables once Network tells me IP's and net switch ports they assign. 2 SAN cables, 1 per HBA once Storage tells me the SAN switch ports they assign. Will get info back from requests once requests are submitted.
Put in CC for physical install and initial configuration of new server.
!!Actions
Done actions older than 14 days. <<deleteAllTagged 'Delete old actions' 'Action' '' 'Done' 'tiddler.olderThanDays(14)'>>
<<mgtdList title:'Done actions older than 14 days'
view:DoneAction
mode:global
sort:-modified
startTag:Action
tags:'Done'
where:'tiddler.olderThanDays(14)'
>>
!!Ticklers
Inactive ticklers older than 14 days. <<deleteAllTagged 'Delete old ticklers' 'Tickler' '' 'Actioned' 'tiddler.olderThanDays(14)'>>
<<mgtdList title:'Inactive ticklers older than 14 days'
startTag:Tickler
tags:'Actioned'
view:Tickler
mode:global
sort:-tickleDate
where:'tiddler.olderThanDays(14)'
>>
!!Projects
Completed projects older than 14 days. (Delete individually).
<<mgtdList title:'Completed projects older than 14 days'
mode:global
sort:-modified
startTag:Project
tags:'Complete'
view:ProjectComplete
where:'tiddler.olderThanDays(14)'
>>
/***
|Name:|CloseOnCancelPlugin|
|Description:|Closes the tiddler if you click new tiddler then cancel. Default behaviour is to leave it open|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#CloseOnCancelPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.commands.cancelTiddler,{
handler_mptw_orig_closeUnsaved: config.commands.cancelTiddler.handler,
handler: function(event,src,title) {
this.handler_mptw_orig_closeUnsaved(event,src,title);
if (!store.tiddlerExists(title) && !store.isShadowTiddler(title))
story.closeTiddler(title,true);
return false;
}
});
//}}}
Name: MptwBlue
Background: #fff
Foreground: #000
PrimaryPale: #cdf
PrimaryLight: #57c
PrimaryMid: #114
PrimaryDark: #012
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
<<saveChanges>>
<<search>>
<<closeAll>>
<<tiddler 'MgtdSettings'>>
!!Theme
(Currently <<eval {{config.options.txtTheme}}>>)
<<selectTheme>>
create the config files for this server to run the CustCheck app on the cluster shared storage. Insure outward network interface is disabled for external(customer) access. Test CustCheck application on this server. Sigh! weekend work to insure no customer impact.
connect the server to existing server cluster. make sure heartbeat is working and cluster management "sees" this server. test cluster. MAKE SURE you turn this server off from active traffic once testing is complete. Sigh! weekend work to insure no customer impact.
/***
|''Name:''|CryptoFunctionsPlugin|
|''Description:''|Support for cryptographic functions|
***/
//{{{
if(!version.extensions.CryptoFunctionsPlugin) {
version.extensions.CryptoFunctionsPlugin = {installed:true};
//--
//-- Crypto functions and associated conversion routines
//--
// Crypto "namespace"
function Crypto() {}
// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
{
var be = Array();
var len = Math.floor(str.length/4);
var i, j;
for(i=0, j=0; i<len; i++, j+=4) {
be[i] = ((str.charCodeAt(j)&0xff) << 24)|((str.charCodeAt(j+1)&0xff) << 16)|((str.charCodeAt(j+2)&0xff) << 8)|(str.charCodeAt(j+3)&0xff);
}
while (j<str.length) {
be[j>>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
j++;
}
return be;
};
// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
{
var str = "";
for(var i=0;i<be.length*32;i+=8)
str += String.fromCharCode((be[i>>5]>>>(24-i%32)) & 0xff);
return str;
};
// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
{
var hex = "0123456789ABCDEF";
var str = "";
for(var i=0;i<be.length*4;i++)
str += hex.charAt((be[i>>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
return str;
};
// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
{
return Crypto.be32sToHex(Crypto.sha1Str(str));
};
// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
{
return Crypto.sha1(Crypto.strToBe32s(str),str.length);
};
// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
{
// Add 32-bit integers, wrapping at 32 bits
add32 = function(a,b)
{
var lsw = (a&0xFFFF)+(b&0xFFFF);
var msw = (a>>16)+(b>>16)+(lsw>>16);
return (msw<<16)|(lsw&0xFFFF);
};
// Add five 32-bit integers, wrapping at 32 bits
add32x5 = function(a,b,c,d,e)
{
var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
return (msw<<16)|(lsw&0xFFFF);
};
// Bitwise rotate left a 32-bit integer by 1 bit
rol32 = function(n)
{
return (n>>>31)|(n<<1);
};
var len = blen*8;
// Append padding so length in bits is 448 mod 512
x[len>>5] |= 0x80 << (24-len%32);
// Append length
x[((len+64>>9)<<4)+15] = len;
var w = Array(80);
var k1 = 0x5A827999;
var k2 = 0x6ED9EBA1;
var k3 = 0x8F1BBCDC;
var k4 = 0xCA62C1D6;
var h0 = 0x67452301;
var h1 = 0xEFCDAB89;
var h2 = 0x98BADCFE;
var h3 = 0x10325476;
var h4 = 0xC3D2E1F0;
for(var i=0;i<x.length;i+=16) {
var j,t;
var a = h0;
var b = h1;
var c = h2;
var d = h3;
var e = h4;
for(j = 0;j<16;j++) {
w[j] = x[i+j];
t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=16;j<20;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=20;j<40;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=40;j<60;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=60;j<80;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
h0 = add32(h0,a);
h1 = add32(h1,b);
h2 = add32(h2,c);
h3 = add32(h3,d);
h4 = add32(h4,e);
}
return Array(h0,h1,h2,h3,h4);
};
}
//}}}
Need additional server for customer interface. Response time of existing server cluster is causing customer dissatisfaction.
order:1
button:none
buttonLong:daily
<div macro="showWhenTagged 'Project'">[[TagDashboards##Project]]</div>
<div macro="showWhenTagged 'Context'">[[TagDashboards##Context]]</div>
<div macro="showWhenTagged 'Area'">[[TagDashboards##Area]]</div>
<div macro="showWhenTagged 'Ticklers Requiring Action'">[[TagDashboards##Ticklers Requiring Action]]</div>
<div macro="showWhenTagged 'Upcoming Ticklers '">[[TagDashboards##Upcoming Ticklers ]]</div>
<div macro="showWhenTagged 'Reference'">[[TagDashboards##Reference]]</div>
<div macro="showWhenTagged 'Contact'">[[TagDashboards##Contact]]</div>
/***
|''Name:''|DatePickerLibrary|
|''Description:''|DatePicker library for use with macros|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Code Repository:''|http://svn.tiddlywiki.org/Trunk/contributors/SaqImtiaz/libraries/DatePicker.js|
|''Version:''|0.9|
|''Date:''|06/04/2007|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.3.0|
***/
// /%
//!BEGIN-PLUGIN-CODE
//{{{
function $id(n) {
return document.getElementById(n);
}
DatePicker = {
days : ['S','M','T','W','T','F','S'],
cells : new Array(42),
setup : function(){
var cte = createTiddlyElement;
var table = this.table = cte(null,"table","datePickerTable");
table.style.display = 'none';
document.body.appendChild(table);
var thead = cte(table,"thead");
var hRow = cte(thead,"tr");
hRow.onclick = stopEvent;
cte(hRow,"td",null,"datePickerNav","<<").onclick = DatePicker.prevm;
cte(hRow,"td","datePickerMNS",null,null,{colSpan:"5"});
cte(hRow,"td",null,"datePickerNav",">>",{align:"right"}).onclick=DatePicker.nextm;
var tbody = cte(table,"tbody","datePickerTableBody");
var dayRow = cte(tbody,"tr",null,"datePickerDaysHeader");
for (var i=0; i<this.days.length; i++){
cte(dayRow,"td",null,null,this.days[i]);
}
},
show : function(el,dateObj,cb) {
var me = DatePicker;
var now = me.now = new Date();
if (!dateObj)
dateObj = now;
me.root = el;
if (cb)
me.root.datePickerCallback = cb;
me.scc = { m : now.getMonth(), y : now.getFullYear(), d : now.getDate() };
Popup.place(el,me.table,{x:0,y:1});
var cur = [dateObj.getDate(),dateObj.getMonth()+1,dateObj.getFullYear()];
me.cc = { m : cur[1]-1, y : cur[2] };
me.sd = { m : cur[1]-1, y : cur[2], d : cur[0] };
me.fillCalendar(cur[0],me.scc.d,cur[1]-1,cur[2]);
},
fillCalendar : function(hd,today,cm,cy) {
var me = DatePicker;
var sd = me.now.getDate();
var td = new Date(cy,cm,1)
var cd = td.getDay();
$id('datePickerMNS').innerHTML = td.formatString('MMM YYYY')
var tbody = $id('datePickerTableBody');
removeChildren(tbody);
var days = (new Date(cy, cm+1, 0)).getDate();
var day = 1;
for (var j=1;j<=6;j++) { //rows
var row = createTiddlyElement(tbody,"tr",null,"datePickerDayRow");
for (var t=1; t<=7; t++) { //cells
var d = 7 * (j-1) - (-t); //id key
if ( (d >= (cd -(-1))) && (d<=cd-(-(days))) ) {
var dip = ( ((d-cd < sd) && (cm == me.scc.m) && (cy == me.scc.y)) || (cm < me.scc.m && cy == me.scc.y) || (cy < me.scc.y) );
var htd = ( (hd != '') && (d-cd == hd) );
var hToday = ( (today != '') && (d-cd == today) && cy == me.scc.y && cm == me.scc.m );
if (htd)
_class = 'highlightedDate';
else if (dip)
_class = 'oldDate';
else if (hToday && ! htd)
_class = 'todayDate';
else
_class = 'defaultDate';
var cell = createTiddlyElement(row,"td","datePickerDay"+d,_class,d-cd);
cell.onmouseover = function(e){addClass(this,'tdover');};
cell.onmouseout = function(e){removeClass(this,'tdover');};
cell.onclick = me.selectDate;
me.cells[d] = new Date(cy,cm,d-cd);
}
else {
var cell = createTiddlyElement(row,"td","datePickerDay"+d,"emptyDate");
}
day++;
}
if(day > days + cd)
break;
}
},
nextm : function() {
var me = DatePicker;
me.cc.m += 1;
if (me.cc.m >= 12) {
me.cc.m = 0;
me.cc.y++;
}
me.fillCalendar(me.getDayStatus(me.cc.m,me.cc.y),me.scc.d,me.cc.m,me.cc.y);
return false;
},
prevm : function() {
var me = DatePicker;
me.cc.m -= 1;
if (me.cc.m < 0) {
me.cc.m = 11;
me.cc.y--;
}
me.fillCalendar(me.getDayStatus(me.cc.m,me.cc.y),me.scc.d,me.cc.m,me.cc.y);
return false;
},
getDayStatus : function(ccm,ccy){
return (ccy == this.sd.y && ccm == this.sd.m)? this.sd.d : '';
},
selectDate : function(ev){
var e = ev ? ev : window.event;
var me = DatePicker;
var date = me.cells[resolveTarget(e).id.substring(13,resolveTarget(e).id.length)];
if (me.root.datePickerCallback && typeof me.root.datePickerCallback == 'function')
me.root.datePickerCallback(me.root,date);
$id('datePickerTable').style.display = 'none';
return false;
},
onclick : function(ev){
$id("datePickerTable").style.display = 'none';
return false;
},
create : function(el,dateObj,cb){
el.onclick = el.onfocus = function(e){DatePicker.show(el,dateObj,cb);stopEvent(e)};
},
css: "table#datePickerTable td.datePickerNav {\n"+
" cursor:pointer;\n"+
"}\n"+
"\n"+
".datePickerDaysHeader td {\n"+
" text-align:center;\n"+
" background:#ABABAB;\n"+
" font:12px Arial;\n"+
"}\n"+
"\n"+
".datePickerDayRow td {\n"+
" width:18px;\n"+
" height:18px;\n"+
"}\n"+
"\n"+
"td#datePickerMNS, td.datePickerNav {\n"+
" font:bold 13px Arial;\n"+
"}\n"+
"\n"+
"table#datePickerTable {\n"+
" position:absolute;\n"+
" border-collapse:collapse;\n"+
" background:#FFFFFF;\n"+
" border:1px solid #ABABAB;\n"+
" display:none; \n"+
"}\n"+
"\n"+
"table#datePickerTable td{\n"+
" padding: 3px;\n"+
"}\n"+
"\n"+
"td#datePickerMNS {\n"+
" text-align: center;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td {\n"+
" background-color : #C4D3EA;\n"+
" cursor : pointer;\n"+
" border : 1px solid #6487AE;\n"+
" text-align : center;\n"+
" font : 10px Arial;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.defaultDate {\n"+
" color : #333333; \n"+
" text-decoration : none; \n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.emptyDate {\n"+
" cursor:default; \n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.oldDate {\n"+
" color : #ABABAB;\n"+
" text-decoration : line-through;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.highlightedDate {\n"+
" background : #FFF799;\n"+
" font-weight : bold;\n"+
" color : #333333;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.todayDate {\n"+
" font-weight : bold;\n"+
" color : red;\n"+
"}\n"+
"\n"+
"table#datePickerTable tr.datePickerDayRow td.tdover {\n"+
" background:#fc6;\n"+
"}",
init : function(){
this.setup();
addEvent(document,'click',DatePicker.onclick);
config.shadowTiddlers['StyleSheetDatePicker'] = this.css;
if(store)
store.addNotification('StyleSheetDatePicker',refreshStyles);
}
};
DatePicker.init();
//}}}
//!END-PLUGIN-CODE
// %/
[[Next and Waiting Actions by Context]]
{{cols2{
{{col{
<<mgtdList
title:'Delegated/Waiting For'
startTag:Action
tags:'[(Waiting For)] && !Done'
view:ActionProj
mode:global
where:tiddler.getByIndex("Contact").length > 0'
group:Contact
gView:bold
newButtonTags:'Action && [(Waiting For)]'
>>
}}}
{{col{
<<mgtdList title:'Done' startTag:Action tags:'Done && [(Waiting For)]' view:DoneAction mode:global
where:tiddler.getByIndex('Contact').length>0
group:Contact
gView:bold
newButtonTags:'Action && Done && [(Waiting For)]'
>>
}}}
{{clear{
}}}
}}}
/***
|Name|DeleteAllTaggedPlugin|
|Based on|http://ido-xp.tiddlyspot.com/#DeleteAllTaggedPlugin|
|Version|MGTD Hacked|
An adaptation of DeleteDoneTasks (Simon Baird) by Ido Magal
To use this insert {{{<<deleteAllTagged>>}}} into the desired tiddler.
Modified quite a bit by Simon for MonkeyGTD
Now only works with MgtdIndexedTags...
Example usage:
{{{<<deleteAllTagged>>}}}
<<deleteAllTagged>>
***/
//{{{
config.macros.deleteAllTagged = {
handler: function ( place,macroName,params,wikifier,paramString,tiddler ) {
var buttonTitle = params[0] ? params[0] : "Delete tiddlers tagged '"+tiddler.title+"'"; // simon's tweak
var tagToDelete = params[1] ? params[1] : tiddler.title;
var alsoDeleteThisTiddler = params[2] ? params[2] : "";
var tagExpr = params[3] ? params[3] : tagToDelete;
var whereExpr = params[4] ? params[4] : "true";
createTiddlyButton( place, buttonTitle, "Delete every tiddler tagged with '"+tiddler.title+"'",
this.deleteAllTagged( tagToDelete, alsoDeleteThisTiddler == "delete", tagExpr, whereExpr ));
},
deleteAllTagged: function(tag,deleteMe,tagExpr,whereExpr) {
return function() {
var collected = fastTagged(tag).filterByTagExpr('[['+tagExpr+']]').filterByEval(whereExpr).toTitleList();
if (collected.length == 0) {
alert( "None found." );
}
else {
if (confirm( "Found these tiddlers:\n'"
+ collected.join( "', '" ) + "'\n\n\n"
+ "Are you sure you want to delete these?" )) {
store.suspendNotifications();
for ( var i=0;i<collected.length;i++ ) {
store.removeTiddler( collected[i] );
story.closeTiddler( collected[i], true );
displayMessage( "Deleted '"+collected[i]+"'" );
}
store.resumeNotifications();
}
}
if (deleteMe) {
if (confirm("Also delete this tiddler, '"+tag+"'?")) {
store.removeTiddler( tag );
story.closeTiddler( tag, true );
displayMessage( "Deleted '"+tag+"'" );
}
}
}
}
};
//}}}
/***
|''Name:''|DeprecatedFunctionsPlugin|
|''Description:''|Support for deprecated functions removed from core|
***/
//{{{
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};
//--
//-- Deprecated code
//--
// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
};
// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = function(w)
{
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var text = lookaheadMatch[1];
if(config.browser.isIE)
text = text.replace(/\n/g,"\r");
createTiddlyElement(w.output,"pre",null,null,text);
w.nextMatch = lookaheadRegExp.lastIndex;
}
};
// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)
{
createTiddlyElement(place,"br");
};
// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
var i = this.indexOf(item);
return i == -1 ? null : i;
};
// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
return store.getLoader().internalizeTiddler(store,this,title,divRef);
};
// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
return store.getSaver().externalizeTiddler(store,this);
};
// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
return store.allTiddlersAsHtml();
}
// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
refreshPageTemplate(title);
}
// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)
{
story.displayTiddlers(srcElement,titles,template,animate);
}
// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)
{
story.displayTiddler(srcElement,title,template,animate);
}
// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;
// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");
}
//}}}
/%<slider+ Grouped by Context>
%/[[Next Actions|Next Actions by Context]]
[[Starred Next Actions|Starred Next Actions]]
[[Next and Waiting Actions|Next and Waiting Actions by Context]]
[[Action Dashboard|Action Dashboard by Context]]
/%</slider>
%/[[Starred Items]]
[[Tickler Dashboard]]
[[Delegated Tasks Dashboard]]
[[Reference Items]]
[[Done Actions]]
<slider+ Contexts>
<<mgtdList startTag:Action tags:'Next && !Done' groupCountOnly:yes group:Context gView:Context where:tiddler.hasActiveProject()>>
</slider>
<slider Grouped by Project>
[[Next Actions|Next Actions by Project]]
[[Next and Waiting Actions|Next and Waiting Actions by Project]]
[[Action Dashboard|Action Dashboard by Project]]
</slider>
<slider Ungrouped>
[[Next Actions]]
[[Next and Waiting Actions]]
[[Action Dashboard]]
</slider>
<slider All contexts>
<<mgtdList startTag:Context>>
</slider>
<<mgtdList
title:'Done'
mode:global
startTag:Action
tags:'Done'
view:DoneAction
group:day
gView:DoneAction
gSort:-title
newButtonTags:'Action Next Done'
sort:-modified
>>
Heads up to Dave in facilities so he can start planing for power and rack space. Can't put in full request until PO is approved.
Let them know about new server. Will need to connect to existing cluster storage and will need 12gb of storage outside of cluster pool.
Create PO for standard configuration server. Insure customer interface software is included on this PO. Submit PO for approval.
/***
|Name:|ExtentTagButtonPlugin|
|Description:|Adds a New tiddler button in the tag drop down|
|Version:|3.2 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#ExtendTagButtonPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
window.onClickTag_mptw_orig = window.onClickTag;
window.onClickTag = function(e) {
window.onClickTag_mptw_orig.apply(this,arguments);
var tag = this.getAttribute("tag");
var title = this.getAttribute("tiddler");
// Thanks Saq, you're a genius :)
var popup = Popup.stack[Popup.stack.length-1].popup;
createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div");
wikify("<<newTiddler label:'New tiddler' tag:'"+tag+"'>>",createTiddlyElement(popup,"li"));
return false;
}
//}}}
order:3
button:f
buttonLong:future
Need PO approval completed, before I can submit this to facilities.
/***
|Name:|HideWhenPlugin|
|Description:|Allows conditional inclusion/exclusion in templates|
|Version:|3.1 ($Rev: 3919 $)|
|Date:|$Date: 2008-03-13 02:03:12 +1000 (Thu, 13 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#HideWhenPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
For use in ViewTemplate and EditTemplate. Example usage:
{{{<div macro="showWhenTagged Task">[[TaskToolbar]]</div>}}}
{{{<div macro="showWhen tiddler.modifier == 'BartSimpson'"><img src="bart.gif"/></div>}}}
***/
//{{{
window.hideWhenLastTest = false;
window.removeElementWhen = function(test,place) {
window.hideWhenLastTest = test;
if (test) {
removeChildren(place);
place.parentNode.removeChild(place);
}
};
merge(config.macros,{
hideWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( eval(paramString), place);
}},
showWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !eval(paramString), place);
}},
hideWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.tags.containsAll(params), place);
}},
showWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !tiddler.tags.containsAll(params), place);
}},
hideWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.tags.containsAny(params), place);
}},
showWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !tiddler.tags.containsAny(params), place);
}},
hideWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.tags.containsAll(params), place);
}},
showWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !tiddler.tags.containsAll(params), place);
}},
hideWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0]), place);
}},
showWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !(store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0])), place);
}},
hideWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.title == params[0], place);
}},
showWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( tiddler.title != params[0], place);
}},
'else': { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
removeElementWhen( !window.hideWhenLastTest, place);
}}
});
//}}}
/***
|Name:|InstantTimestampPlugin|
|Description:|A handy way to insert timestamps in your tiddler content|
|Version:|1.0.10 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#InstantTimestampPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Usage
If you enter {ts} in your tiddler content (without the spaces) it will be replaced with a timestamp when you save the tiddler. Full list of formats:
* {ts} or {t} -> timestamp
* {ds} or {d} -> datestamp
* !ts or !t at start of line -> !!timestamp
* !ds or !d at start of line -> !!datestamp
(I added the extra ! since that's how I like it. Remove it from translations below if required)
!!Notes
* Change the timeFormat and dateFormat below to suit your preference.
* See also http://mptw2.tiddlyspot.com/#AutoCorrectPlugin
* You could invent other translations and add them to the translations array below.
***/
//{{{
config.InstantTimestamp = {
// adjust to suit
timeFormat: 'DD/0MM/YY 0hh:0mm',
dateFormat: 'DD/0MM/YY',
translations: [
[/^!ts?$/img, "'!!{{ts{'+now.formatString(config.InstantTimestamp.timeFormat)+'}}}'"],
[/^!ds?$/img, "'!!{{ds{'+now.formatString(config.InstantTimestamp.dateFormat)+'}}}'"],
// thanks Adapted Cat
[/\{ts?\}(?!\}\})/ig,"'{{ts{'+now.formatString(config.InstantTimestamp.timeFormat)+'}}}'"],
[/\{ds?\}(?!\}\})/ig,"'{{ds{'+now.formatString(config.InstantTimestamp.dateFormat)+'}}}'"]
],
excludeTags: [
"noAutoCorrect",
"noTimestamp",
"html",
"CSS",
"css",
"systemConfig",
"systemConfigDisabled",
"zsystemConfig",
"Plugins",
"Plugin",
"plugins",
"plugin",
"javascript",
"code",
"systemTheme",
"systemPalette"
],
excludeTiddlers: [
"StyleSheet",
"StyleSheetLayout",
"StyleSheetColors",
"StyleSheetPrint"
// more?
]
};
TiddlyWiki.prototype.saveTiddler_mptw_instanttimestamp = TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler = function(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created) {
tags = (typeof(tags) == "string") ? tags.readBracketedList() : tags;
var conf = config.InstantTimestamp;
if ( !tags.containsAny(conf.excludeTags) && !conf.excludeTiddlers.contains(newTitle) ) {
var now = new Date();
var trans = conf.translations;
for (var i=0;i<trans.length;i++) {
newBody = newBody.replace(trans[i][0], eval(trans[i][1]));
}
}
// TODO: use apply() instead of naming all args?
return this.saveTiddler_mptw_instanttimestamp(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created);
}
// you can override these in StyleSheet
setStylesheet(".ts,.ds { background-color:#ddd; font-style:italic; }","instantTimestampStyles");
//}}}
/***
|Name:|LessBackupsPlugin|
|Description:|Intelligently limit the number of backup files you create|
|Version:|3.0.1 ($Rev: 2320 $)|
|Date:|$Date: 2007-06-18 22:37:46 +1000 (Mon, 18 Jun 2007) $|
|Source:|http://mptw.tiddlyspot.com/#LessBackupsPlugin|
|Author:|Simon Baird|
|Email:|simon.baird@gmail.com|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Description
You end up with just backup one per year, per month, per weekday, per hour, minute, and second. So total number won't exceed about 200 or so. Can be reduced by commenting out the seconds/minutes/hours line from modes array
!!Notes
Works in IE and Firefox only. Algorithm by Daniel Baird. IE specific code by by Saq Imtiaz.
***/
//{{{
var MINS = 60 * 1000;
var HOURS = 60 * MINS;
var DAYS = 24 * HOURS;
if (!config.lessBackups) {
config.lessBackups = {
// comment out the ones you don't want or set config.lessBackups.modes in your 'tweaks' plugin
modes: [
["YYYY", 365*DAYS], // one per year for ever
["MMM", 31*DAYS], // one per month
["ddd", 7*DAYS], // one per weekday
//["d0DD", 1*DAYS], // one per day of month
["h0hh", 24*HOURS], // one per hour
["m0mm", 1*HOURS], // one per minute
["s0ss", 1*MINS], // one per second
["latest",0] // always keep last version. (leave this).
]
};
}
window.getSpecialBackupPath = function(backupPath) {
var now = new Date();
var modes = config.lessBackups.modes;
for (var i=0;i<modes.length;i++) {
// the filename we will try
var specialBackupPath = backupPath.replace(/(\.)([0-9]+\.[0-9]+)(\.html)$/,
'$1'+now.formatString(modes[i][0]).toLowerCase()+'$3')
// open the file
try {
if (config.browser.isIE) {
var fsobject = new ActiveXObject("Scripting.FileSystemObject")
var fileExists = fsobject.FileExists(specialBackupPath);
if (fileExists) {
var fileObject = fsobject.GetFile(specialBackupPath);
var modDate = new Date(fileObject.DateLastModified).valueOf();
}
}
else {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(specialBackupPath);
var fileExists = file.exists();
if (fileExists) {
var modDate = file.lastModifiedTime;
}
}
}
catch(e) {
// give up
return backupPath;
}
// expiry is used to tell if it's an 'old' one. Eg, if the month is June and there is a
// June file on disk that's more than an month old then it must be stale so overwrite
// note that "latest" should be always written because the expiration period is zero (see above)
var expiry = new Date(modDate + modes[i][1]);
if (!fileExists || now > expiry)
return specialBackupPath;
}
}
// hijack the core function
window.getBackupPath_mptw_orig = window.getBackupPath;
window.getBackupPath = function(localPath) {
return getSpecialBackupPath(getBackupPath_mptw_orig(localPath));
}
//}}}
<<tabs txtMGTDMore
"Timeline" "Timeline" TabTimeline
"MGTD" "Configuration Options" ConfigMenu
"TW" "TiddlyWiki SideBar" TWSideBar
>>
<<tabs txtMGTDMain
"Work" "Do Work" DoWorkMenu
"Review" "Review" ReviewMenu
"Process" "Process Inbox" ProcessInboxMenu
"More..." "More..." MGTDMoreTab
>>
MPTW is a distribution or edition of TiddlyWiki that includes a standard TiddlyWiki core packaged with some plugins designed to improve usability and provide a better way to organise your information. For more information see http://mptw.tiddlyspot.com/.
merge(Array.prototype,{
each: function(func) {
for (var i=0;i<this.length;i++)
func(this[i]);
},
// TODO, there is a map in the core now. Is it same as this or different?
map: function(func) {
var result = [];
this.each(function(item) {
result.push(func(item));
});
return result;
},
select: function(func) {
var result = [];
this.each(function(item) {
if (func(item))
result.push(item);
});
return result;
},
reject: function(func) {
var result = [];
this.each(function(item) {
if (!func(item))
result.push(item);
});
return result;
}
});
//------------------------------------------
merge(String.prototype,{
parseTagExpr: function(debug) {
if (this.trim() == "")
return "(true)";
var logicOps = /(!|&&|\|\||\(|\))/g;
var spaced = this.
// because square brackets in templates are no good
// this means you can use [(With Spaces)] instead of [[With Spaces]]
replace(/\[\(/g," [[").
replace(/\)\]/g,"]] ").
// space things out so we can use readBracketedList. tricky eh?
replace(logicOps," $1 ");
var expr = "";
var tokens = spaced.readBracketedList(false); // false means not unique. nice one JR!
tokens.each(function(tok) {
if (tok.match(logicOps)) {
expr += tok;
}
else if (tok.match(/^parent:/)) {
// experimental
var lookForTagInParent = tok.split(":")[1];
expr += "tiddler.parents().anyHasTag('"+lookForTagInParent+"')";
}
else {
expr += "tiddler.tags.contains('%0')".format([
// fix single quote bug. hurrah
// but still have nasty round bracket bug
tok.replace(/'/,"\\'")
]);
}
});
if (debug)
alert(expr);
return '('+expr+')';
}
});
merge(Tiddler.prototype,{
matchesEvalExpr: function(evalExpr) {
var tiddler = this;
return eval(evalExpr);
},
matchesTagExpr: function(tagExpr) {
return this.matchesEvalExpr(tagExpr.parseTagExpr());
},
olderThanDays: function(days) {
return this.modified.getTime() < (new Date()).getTime() - days*1000*60*60*24;
}
});
//------------------------------------
merge(Tiddler.prototype,{
render: function(method,renderOptions) {
return this["render_"+method](renderOptions);
},
renderUtil: function(formatString,formatValues) {
return formatString.format(formatValues);
},
sorter: function(field) {
var sortMethod = "sort_"+field;
if (this[sortMethod])
return this[sortMethod]();
else
return this[field];
},
sorterUtil: function(otherTiddler,method) {
var desc = false;
if (method.substring(0,1) == "-") {
desc = true;
method = method.substring(1);
}
if (this.sorter(method) > otherTiddler.sorter(method))
return (desc ? -1 : +1);
else if (this.sorter(method) < otherTiddler.sorter(method))
return (desc ? +1 : -1);
else
return 0;
}
});
merge(String.prototype,{
sorterUtil: function(otherTiddler,method) {
var t1 = store.getTiddler(this);
var t2 = store.getTiddler(otherTiddler);
if (t1 && t2)
return t1.sorterUtil(t2,method);
// this part is a little flakey but I'm aiming to
// put the None heading last in all cases
else if (t2)
return +1;
else if (t1)
return -1;
else
return 0;
}
});
//------------------------------------------
merge(Array.prototype,{
// returns a hash
groupBy_hash: function(func) {
var result = {};
var leftOverGroup = '__NONE__';
this.each(function(item) {
var groups = func(item);
if (groups.length > 0) {
groups.each(function(group) {
if (!result[group])
result[group] = [];
result[group].push(item);
});
}
else {
if (!result[leftOverGroup])
result[leftOverGroup] = [];
result[leftOverGroup].push(item);
}
});
return result;
},
// returns an array of arrays, like Hash#sort in ruby
groupBy: function(func,itemSort,groupSort) {
if (!itemSort) itemSort = "title";
if (!groupSort) groupSort = "-title";
var result = this.groupBy_hash(func);
var sortedResult = [];
for (var g in result)
sortedResult.push([g,result[g].sort(function(a,b){return a.sorterUtil(b,itemSort);})]);
return sortedResult.sort(function(a,b){return a[0].sorterUtil(b[0],groupSort);});
},
// for convenience since it's mostly what we want
groupByTag: function(tag,itemSort,groupSort) {
return this.groupBy(function(t){return t.getByIndex(tag);},itemSort,groupSort);
}
});
//------------------------------------------
// for lists of tiddlers
merge(Array.prototype,{
filterByEval: function(evalExpr) {
return this.select(function(t) {
return t.matchesEvalExpr(evalExpr);
});
},
filterByTagExpr: function(tagExpr) {
return this.filterByEval(tagExpr.parseTagExpr());
},
filterGroupsByEval: function(evalExpr) {
// presumes the group name is a tiddler
return this.select(function(tGroup) {
var tiddler = store.getTiddler(tGroup[0]);
return tiddler && tiddler.matchesEvalExpr(evalExpr);
});
},
filterGroupsByTagExpr: function(tagExpr) {
return this.filterGroupsByEval(tagExpr.parseTagExpr());
},
render: function(renderMethod,renderOptions) {
return this.map(function(tiddler){
return tiddler.render(renderMethod,renderOptions);
}).join("\n");
},
renderGrouped: function(listRenderMethod,headingRenderMethod,noneHeading,renderOptions,groupCountOnly,nbTags) {
// do I ever use renderOptions??
// this lost some elegance when I shoehorned the groupCountOnly part in. todo refactor
// then lost some more with the nbTags addition...
// might need some reworking
var result = "";
this.each(function(g) {
var groupName = g[0];
var groupItems = g[1];
var showCount = "";
if (groupCountOnly && groupCountOnly != "")
showCount = groupItems.length > 0 ? " ("+groupItems.length+")" : "";
var makeHeading = (groupCountOnly&&groupCountOnly!="") ? "" : "!!";
var newButtonMarkup = "";
// this sucks
if (nbTags && nbTags != '') {
newButtonMarkup = " "+config.macros.mgtdList.getNewButton(nbTags + " [["+groupName+"]]");
}
if (groupName == "__NONE__") {
result = result + makeHeading + "[[("+(noneHeading?noneHeading:"No "+headingRenderMethod)+")]]"+showCount+newButtonMarkup+"\n";
}
else {
var gTiddler = store.getTiddler(groupName);
if (gTiddler) {
result = result + makeHeading+gTiddler.render(headingRenderMethod)+showCount+newButtonMarkup+"\n";
}
else {
result = result + makeHeading+"[["+groupName+"]]"+showCount+newButtonMarkup+"\n";
}
}
if (!groupCountOnly || groupCountOnly == "")
result = result + groupItems.render(listRenderMethod,renderOptions) + "\n";
});
if (groupCountOnly && groupCountOnly != "")
result = result.replace(/\n$/,''); // hack. remove trailing linefeed
return result;
},
tiddlerSort: function(sortBy) {
return this.sort(function(a,b) { return a.sorterUtil(b,sortBy); });
},
toTitleList: function() {
return this.map(function(t){return t.title;});
}
});
//------------------------------------------
config.options.txtTheme = 'MonkeyGTDTheme';
if (!config.mGTD) config.mGTD = {};
config.mGTD.specialTags = [
"Action",
"Project",
"Area",
"Realm",
"Context",
"View",
"Tickler",
"Reference",
"Contact"
]
config.mGTD.tagsToIndex = [
"Project",
"Area",
"Realm",
"Context",
"ActionStatus",
"TicklerStatus",
"ProjectStatus",
"GTDComponent",
"Sidebar",
"Contact",
"TicklerRepeatType"
];
config.mgtdVersion = "3.0 alpha r510095";
config.macros.mgtdVersion={handler:function(place){wikify(config.mgtdVersion,place);}};
config.toggleTagAlwaysTouchModDate = true; // see ToggleTagPlugin
config.shadowTiddlers.SiteTitle = 'MonkeyGTD';
config.shadowTiddlers.SiteSubtitle = 'a getting things done system powered by tiddlywiki';
config.mGTD.getOptChk = function(option) { return store.fetchTiddler('MgtdSettings').tags.contains(option); }
config.mGTD.getOptTxt = function(fieldName) { return store.fetchTiddler('MgtdSettings').fields[fieldName.toLowerCase()]; }
config.mGTD.setOptTxt = function(fieldName,fieldValue) { store.fetchTiddler('MgtdSettings').fields[fieldName.toLowerCase()] = fieldValue; }
// from tiddlytools.com/#CoreTweaks, thanks Eric
window.coreWikify = wikify;
window.wikify = function(source,output,highlightRegExp,tiddler)
{
if (source) arguments[0]=source.replace(/\\\\\n/mg,"<br>");
coreWikify.apply(this,arguments);
}
merge(Date.prototype,{
addDay: function(n) { this.setDate( this.getDate() + n); },
addWeek: function(n) { this.setDate( this.getDate() + n*7); },
addMonth: function(n) { this.setMonth( this.getMonth() + n); },
addYear: function(n) { this.setYear( this.getFullYear() + n); }
});
// TODO. this doesn't really belong here
merge(Tiddler.prototype,{
touch: function() {
this.changed();
this.modified = new Date();
store.setDirty(true);
store.notify(this.title,true);
}
});
// it works in view mode, that's why we can't just use edit macro
merge(config.macros, {
mgtdEditField: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var fieldName = params[0];
var useTiddler = tiddler;
if (params[1])
useTiddler = store.fetchTiddler(params[1]);
var curVal = useTiddler.fields[fieldName] || '';
var editBox = createTiddlyElement(place,'input',null,'editBox');
editBox.value = curVal;
var callback = function(){
useTiddler.fields[fieldName] = this.value;
useTiddler.touch(); // see MgtdDateUtils
}
editBox.onchange = callback;
}
}
});
function wikifiedMessage(message) {
wikify(message,getMessageDiv());
}
merge(config.macros,{
help: {
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
createTiddlyButton(place,"?","help",function() {
var useThis = params[0]?params[0]:tiddler.title;
var helpContent = "{{help{\n''~MonkeyGTD Help''\n!"+useThis+"\n"+store.getTiddlerText("MonkeyGTDHelp##"+useThis)+"\n}}}\n";
// doesn't work at all. I have no idea how to use TW popups apparently ...
//var popup = Popup.create(place,"div","popupTiddler");
//wikify(helpContent,popup,null,tiddler);
//Popup.show();
// stick with this for now
clearMessage();
wikifiedMessage("{{help{\n''~MonkeyGTD Help''\n!"+useThis+"\n"+store.getTiddlerText("MonkeyGTDHelp##"+useThis)+"\n}}}\n");
return false;
});
}
}
});
config.indexedTags = {
// will be populated with our tag lists
tagLists: {},
// will be populated with our tag indexes
indexes: {},
// will be populated with the tags that need indexing
tagsToIndex: [],
saveTiddlerHijack: function(title,newTitle,newBody,modifier,modified,tags,fields) {
var before = store.getTiddler(title);
var oldTags = before ? [].concat(before.tags) : null; // concat so we get a dup
store.suspendNotifications();
var result = this.saveTiddler_orig_indexedTags(title,newTitle,newBody,modifier,modified,tags,fields);
var newTags = store.getTiddler(newTitle).tags;
config.indexedTags.updateTagLists(title,oldTags,newTitle,newTags);
config.indexedTags.updateIndexes(title,newTitle,newTags);
store.resumeNotifications();
store.notify(title,true);
return result;
},
removeTiddlerHijack: function(title) {
var before = store.getTiddler(title);
var oldTags = before ? [].concat(before.tags) : null; // concat so we get a dup
store.suspendNotifications();
this.removeTiddler_orig_indexedTags(title);
config.indexedTags.updateTagLists(title,oldTags);
config.indexedTags.updateIndexes(title);
store.resumeNotifications();
store.notify(title,true);
},
setTiddlerTagHijack: function(title,status,tag) {
var before = store.getTiddler(title);
var oldTags = before ? [].concat(before.tags) : null; // concat so we get a dup
store.suspendNotifications();
this.setTiddlerTag_orig_indexedTags(title,status,tag);
var after = store.getTiddler(title);
var newTags = after ? after.tags : null;
config.indexedTags.updateTagLists(title,oldTags,title,newTags);
config.indexedTags.updateIndexes(title,title,newTags);
store.resumeNotifications();
store.notify(title,true);
},
updateTagLists: function(title,oldTags,newTitle,newTags) {
if (oldTags)
oldTags.each(function(tagName) {
config.indexedTags.tagLists[tagName].remove(title);
});
if (newTags)
newTags.each(function(tagName) {
if (!config.indexedTags.tagLists[tagName])
config.indexedTags.tagLists[tagName] = [];
config.indexedTags.tagLists[tagName].pushUnique(newTitle);
});
},
updateIndexes: function(title,newTitle,newTags) {
delete config.indexedTags.indexes[title];
if (newTags) {
config.indexedTags.indexes[newTitle] = {};
config.indexedTags.tagsToIndex.each(function(tagToIndex) {
config.indexedTags.indexes[newTitle][tagToIndex] = [];
newTags.each(function(tag) {
if (config.indexedTags.tagLists[tagToIndex] && config.indexedTags.tagLists[tagToIndex].contains(tag)) {
config.indexedTags.indexes[newTitle][tagToIndex].pushUnique(tag);
}
});
});
}
},
initTagLists: function() {
store.getTags().map(function(pair) { return pair[0]; }).each(function(t) {
config.indexedTags.tagLists[t] = store.getTaggedTiddlers(t).map(function(tt) { return tt.title; });
});
},
initIndexes: function() {
store.forEachTiddler(function(title,tiddler) {
config.indexedTags.updateIndexes(title,title,tiddler.tags);
});
},
dump: function() {
alert(this.indexes["Buy petrol for mower"]["Project"]);
alert(this.indexes["Buy petrol for mower"]["Realm"]);
},
tiddlerMethods: {
getByIndex: function(tag) {
return config.indexedTags.indexes[this.title][tag];
},
hasParent: function(tag) {
return this.getByIndex(tag).length > 0
},
hasNoParent: function(tag) {
return !this.hasParent(tag);
},
hasActiveProject: function() {
var projs = this.getByIndex("Project");
if (projs.length == 0)
// no project but we will say it's active
// because otherwise it will not show up anywhere
return true;
for (var i=0;i<projs.length;i++)
if (
(config.indexedTags.indexes[projs[i]]['ProjectStatus'].contains('Active'))
&&
!store.fetchTiddler(projs[i]).tags.contains('Complete') // seems stupid
)
return true;
return false;
},
getAreasForAction: function() {
// we will go to some trouble to permit actions in multiple areas
// either explicitly or via their project...
// also permit multiple projects......
// explicit:
var result = [];
result = result.concat(this.getByIndex("Area"));
// implicit (via project/s):
var projs = this.getByIndex("Project");
for (var i=0;i<projs.length;i++)
result = result.concat(store.fetchTiddler(projs[i]).getByIndex("Area"));
return result;
},
hasNextAction: function() {
var children = fastTagged(this.title).filterByTagExpr('Action && !Done && (Next || [(Waiting For)])');
return children.length > 0;
},
hasSubProject: function() {
var children = fastTagged(this.title).filterByTagExpr('Project && !Complete && Active');
return children.length > 0;
},
hasNextActionOrSubProject: function() {
return (this.hasSubProject() || this.hasNextAction());
}
},
globalMethods: {
fastTagged: function(tag) {
var list = config.indexedTags.tagLists[tag];
return (list?list:[]).map(function(t){return store.getTiddler(t);});
}
},
init: function(tagsToIndex) {
merge(window,this.globalMethods);
merge(Tiddler.prototype,this.tiddlerMethods);
this.tagsToIndex = tagsToIndex;
this.initTagLists();
this.initIndexes();
TiddlyWiki.prototype.saveTiddler_orig_indexedTags = TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.removeTiddler_orig_indexedTags = TiddlyWiki.prototype.removeTiddler;
TiddlyWiki.prototype.setTiddlerTag_orig_indexedTags = TiddlyWiki.prototype.setTiddlerTag;
TiddlyWiki.prototype.saveTiddler = this.saveTiddlerHijack;
TiddlyWiki.prototype.removeTiddler = this.removeTiddlerHijack;
TiddlyWiki.prototype.setTiddlerTag = this.setTiddlerTagHijack;
}
};
config.indexedTags.init(config.mGTD.tagsToIndex);
merge(config.macros,{
ticklerAlert: {
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
var realmFilter = '';
if (!config.mGTD.getOptChk('AlertsIgnoreRealm'))
realmFilter = ' && tiddler.tags.containsAny(config.macros.mgtdList.getActiveRealms())';
var theList = fastTagged('Tickler').
filterByTagExpr('Enabled && !Actioned').
filterByEval('tiddler.fields.mgtd_date <= (new Date()).convertToYYYYMMDDHHMM()'+realmFilter);
if (theList.length > 0) {
var blinker = createTiddlyElement(place,'blink');
wikify('{{ticklerAlert{[[*ticklers*|Ticklers Requiring Action]]}}}',blinker,null,tiddler);
}
}
},
mgtdList: {
getActiveRealms: function() {
return store.fetchTiddler("MgtdSettings").getByIndex("Realm");
},
getRealm: function(tiddlerTitle) {
// if we're in a project inherit the realm from the project
var inTiddler = store.fetchTiddler(tiddlerTitle);
if (inTiddler && inTiddler.tags.contains('Project')) {
// get the realm from the project
return inTiddler.getByIndex('Realm');
}
// otherwise use the active realm
var active = config.macros.mgtdList.getActiveRealms();
if (active.length == 1) {
return active[0];
}
// if there's more than one active realm use a slice to get the realm priority and choose the highest one
else {
// TODO, make this prettier
var toBeat = "zzzzzzz";
var soFar = active[0];
for (var i=0;i<active.length;i++) {
var pri = store.getTiddlerSlice(active[i],"priority");
if (pri && pri < toBeat) {
toBeat = pri;
soFar = active[i];
}
}
return soFar;
}
},
getNewButton: function(tags,extraTags) {
if (typeof tags != 'string')
tags = String.encodeTiddlyLinkList(tags);
return '<<newSavedTiddler label:+ tag:"'+tags+'">>'; // newSavedTiddler wants tags in one param?
},
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
var pp = paramString.parseParams("tags",null,true);
// title of the list
var title = getParam(pp,"title","");
// local means only look at tiddlers tagged with this tiddler
// global means look at every tiddler
var tagMode = getParam(pp,"mode","local");
// optional. ignored unless mode global. specify for speed gains
var startTag = getParam(pp,"startTag");
// eg, "Next && !Done"
var tagExpr = getParam(pp,"tags","");
// additional filter. gets eval'ed
var whereExpr = getParam(pp,"where","");
// group by another tag
var groupBy = getParam(pp,"group","");
// group by count only mode
var groupCountOnly = getParam(pp,"groupCountOnly","");
// filter the groups by tag expr
var gTagExpr = getParam(pp,"gTag","");
// or eval'ed expression
var gWhereExpr = getParam(pp,"gWhere","");
// how to render list items
var viewType = getParam(pp,"view","plain");
// how to render headings
var gViewType = getParam(pp,"gView",groupBy);
// if there are tiddlers who aren't grouped then give them this title
// mainly used to label future actions...
var leftoverTitle = getParam(pp,"leftoverTitle","No "+groupBy);
// if set to "yes" then we ignore the realm and show everthing
var ignoreRealm = getParam(pp, "ignoreRealm","");
// sort items
var sortBy = getParam(pp,"sort","title");
// sort groups
var gSortBy = getParam(pp,"gSort","title");
// new button
var newButton = getParam(pp,"newButton",""); // not using
var newButtonTags = getParam(pp,"newButtonTags","");
newButtonTags = newButtonTags.replace(/\[\(/g," [[").replace(/\)\]/g,"]] "); // change [(..)] to [[..]]
if (!startTag)
if (tagMode != "global")
startTag = tiddler.title;
var listRefreshContainer = createTiddlyElement(place,"div");
// TODO one big attribute?
listRefreshContainer.setAttribute("refresh","macro");
listRefreshContainer.setAttribute("macroName",macroName);
listRefreshContainer.setAttribute("title",title);
listRefreshContainer.setAttribute("startTag",startTag);
listRefreshContainer.setAttribute("tagMode",tagMode);
listRefreshContainer.setAttribute("tagExpr",tagExpr);
listRefreshContainer.setAttribute("groupBy",groupBy);
listRefreshContainer.setAttribute("groupCountOnly",groupCountOnly);
listRefreshContainer.setAttribute("gTagExpr",gTagExpr);
listRefreshContainer.setAttribute("whereExpr",whereExpr);
listRefreshContainer.setAttribute("gWhereExpr",gWhereExpr);
listRefreshContainer.setAttribute("sortBy",sortBy);
listRefreshContainer.setAttribute("gSortBy",gSortBy);
listRefreshContainer.setAttribute("viewType",viewType);
listRefreshContainer.setAttribute("gViewType",gViewType);
listRefreshContainer.setAttribute("ignoreRealm",ignoreRealm);
listRefreshContainer.setAttribute("leftoverTitle",leftoverTitle);
listRefreshContainer.setAttribute("newButton",newButton);
listRefreshContainer.setAttribute("newButtonTags",newButtonTags);
if (tiddler)
listRefreshContainer.setAttribute("tiddlerTitle",tiddler.title);
this.refresh(listRefreshContainer);
},
refresh: function(place) {
removeChildren(place);
var title = place.getAttribute("title");
var startTag = place.getAttribute("startTag");
var tagMode = place.getAttribute("tagMode");
var tagExpr = place.getAttribute("tagExpr");
var groupBy = place.getAttribute("groupBy");
var groupCountOnly = place.getAttribute("groupCountOnly");
var gTagExpr = place.getAttribute("gTagExpr");
var whereExpr = place.getAttribute("whereExpr");
var gWhereExpr = place.getAttribute("gWhereExpr");
var sortBy = place.getAttribute("sortBy");
var gSortBy = place.getAttribute("gSortBy");
var viewType = place.getAttribute("viewType");
var gViewType = place.getAttribute("gViewType");
var ignoreRealm = place.getAttribute("ignoreRealm");
var leftoverTitle = place.getAttribute("leftoverTitle");
var newButton = place.getAttribute("newButton");
var newButtonTags = place.getAttribute("newButtonTags");
var tiddlerTitle = place.getAttribute("tiddlerTitle");
var wikifyThis = "";
wikifyThis += "{{mgtdList{\n";
if (title != "")
wikifyThis += "!"+title
var nbTags;
if (newButtonTags != '') {
nbTags = [
newButtonTags, // the tags specified in the macro params
'[['+config.macros.mgtdList.getRealm(tiddlerTitle)+']]', // the realm. always want a realm
(tagMode=='global'?'':'[['+tiddlerTitle+']]') // if not global, then the add tiddler we're in, new here style
].join(' ');
var nbList = nbTags.readBracketedList();
var nbExtra = nbTags;
// also we want an area. another hack. darn you subprojects.. :)
if (nbList.contains('Project') && !nbList.containsAny(fastTagged('Area').toTitleList())) {
var foo = store.fetchTiddler(tiddlerTitle).getByIndex('Area');
if (foo.length > 0) {
nbExtra += ' [[' + foo[0] + ']]';
}
}
if (nbList.contains('Project') && !nbList.containsAny(fastTagged('ProjectStatus').toTitleList())) {
// stupid hack for subprojects list in project dashboards
// don't want to create a project with no status
// this is the hack:
nbExtra += ' Active';
}
// same hack thing for actions
if (nbList.contains('Action') && !nbList.containsAny(fastTagged('ActionStatus').toTitleList())) {
nbExtra += ' Next';
}
wikifyThis += this.getNewButton(nbExtra);
// but still use nbTags later on in group headings...
}
if (title != "" || newButton != "")
wikifyThis += "\n";
wikifyThis += "{{innerList{\n";
var checkForContent = wikifyThis;
var theList = [];
if (startTag && startTag != 'undefined'/* this sucks */) {
theList = fastTagged(startTag);
}
else {
// why so hard to get an array of all tiddlers?
store.forEachTiddler(function(t_title,t_tiddler) { theList.push(t_tiddler); });
}
if (tagExpr != "") theList = theList.filterByTagExpr(tagExpr);
if (whereExpr != "") theList = theList.filterByEval(whereExpr);
if (ignoreRealm != "yes") {
var activeRealms = config.macros.mgtdList.getActiveRealms();
theList = theList.select(function(t) {
var realm = t.getByIndex("Realm");
return (
realm.length == 0 || // so something with no realm shows up
realm.containsAny(activeRealms)
);
});
}
if (groupBy == "day") {
// experimental. changing a tag doesn't update modified so
// this isn't as useful
theList = theList.groupBy(function(t){return [t.modified.formatString('YYYY-0MM-0DD')];});
wikifyThis += theList.renderGrouped(viewType,gViewType,leftoverTitle);
}
else if (groupBy != "") {
theList = theList.groupByTag(groupBy,sortBy,gSortBy);
if (gTagExpr != "") theList = theList.filterGroupsByTagExpr(gTagExpr);
if (gWhereExpr != "") theList = theList.filterGroupsByEval(gWhereExpr);
wikifyThis += theList.renderGrouped(viewType,gViewType,leftoverTitle,null,groupCountOnly,nbTags);
}
else {
theList = theList.tiddlerSort(sortBy);
wikifyThis += theList.render(viewType);
}
if (wikifyThis == checkForContent)
wikifyThis += "{{none{none}}}";
wikifyThis += "}}}\n";
wikifyThis += "}}}\n";
wikify(wikifyThis,place,null,tiddler);
forceReflow();
}
}
});
merge(config.macros,{
processInbox: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var shortHand = {
'W': 'Waiting For',
'N': 'Next',
'F': 'Future'
};
wikify("Quick add projects and actions (See [[About Quick Add]] for more info):\n",place);
var pi = createTiddlyElement(place,"textarea",null,"piBox");
wikify("\n",place);
var a1 = createTiddlyCheckbox(place,"Open created projects",true,null);
a1.id = 'piShowProjects';
var a2 = createTiddlyCheckbox(place,"Open created actions",true,null);
a2.id = 'piShowActions';
wikify("\n",place);
var btn = createTiddlyButton(place,"quick add now","create these items",function(e) {
var lines = pi.value.split("\n");
var currentProject = "";
var displayThese = [];
for (var i=0;i<lines.length;i++) {
//alert(lines[i]);
var fields = lines[i].split(/[|;]/);
if (!fields[0] || fields[0].trim() == "") {
currentProject = "";
}
else {
var title = fields.shift();
//alert(title);
// add the realm
fields.push(config.macros.mgtdList.getRealm());
if (title[0] != '.') {
//alert("project "+title);
currentProject = title;
if (document.getElementById('piShowProjects').checked)
displayThese.push(title);
fields.push("Project"); // make it a project
fields.push("Active"); // make it active
if (store.tiddlerExists(title))
alert("Warning: '"+title+"' already exists, did not create");
else
store.saveTiddler(
title,title,
"", // content
config.options.txtUserName,
new Date(),
fields, // tags
null // extra fields
);
}
else {
// default to next actions
if (!fields.containsAny(['N','F','W']))
fields.push('N');
fields = fields.map(function(f) {
if (shortHand[f] && shortHand[f] != '')
return shortHand[f];
else
return f;
});
//alert("action "+title);
title = title.trim();
title = title.replace(/^\.+/,'');
if (document.getElementById('piShowActions').checked)
displayThese.push(title);
fields.push("GTD"); // make it a GTD item
fields.push("Action"); // make it an action
if (currentProject.trim() != "")
fields.push(currentProject); // make it in this project
if (store.tiddlerExists(title))
alert("Warning: '"+title+" already exists, did not create");
else
store.saveTiddler(
title,title,
"", // content
config.options.txtUserName,
new Date(),
fields, // tags
null // extra fields
);
}
}
}
for (var ii=0;ii<displayThese.length;ii++)
story.displayTiddler("bottom",displayThese[ii]);
alert("Done creating items");
return false;
}); // end of createTiddlyButton
}
}
});
!!Options
Show tickler alerts regardless of realm settings.
<<toggleTag AlertsIgnoreRealm MgtdSettings>>
Actions can have multiple contexts.
<<toggleTag MultipleContexts MgtdSettings>>
Show full project name next to actions in action lists instead of just [P].
<<toggleTag FullProjectInActionLists MgtdSettings>>
Show full contact name next to actions in action lists instead of just [C].
<<toggleTag FullContactInActionLists MgtdSettings>>
Enter the date format for ticklers.
Tickler date format:<<mgtdEditField ticklerdateformat MgtdSettings>>
(see [[Date Formats|http://tiddlywiki.org/wiki/Date_Formats]])
// requires MgtdIndexedTags for the fastTagged and getByIndex methods
// TODO make these usable without MgtdIndexedTags if it doesn't exist
merge(Tiddler.prototype,{
addTag: function(tag) {
store.setTiddlerTag(this.title,true,tag);
},
removeTag: function(tag) {
store.setTiddlerTag(this.title,false,tag);
},
setTagFromGroup: function(tagGroup,tag) {
var tagList = fastTagged(tagGroup);
// it goes slow if you don't do this
store.suspendNotifications();
// remove all the tags in the group
for (var i=0;i<tagList.length;i++)
this.removeTag(tagList[i].title);
// add the one selected
if (tag)
this.addTag(tag);
// touch the modified date so we can sort usefully
this.modified = new Date();
// resume notification and notify
store.resumeNotifications();
store.notify(this.title,true);
},
toggleTag: function(tag) {
store.setTiddlerTag(this.title,!this.hasTag(tag),tag);
// touch the modified date
this.modified = new Date();
},
hasTag: function(tag) {
return this.tags.contains(tag);
}
});
merge(config.macros,{
singleToggleTag: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var pp = paramString.parseParams("tag",null,true);
if (!tiddler)
tiddler = store.getTiddler(getParam(pp,"title"));
var tag = getParam(pp,"tag");
var t = store.fetchTiddler(tag);
var title = getParam(pp,"title",tiddler.title);
var actOnTiddler = store.getTiddler(title);
var label = store.getTiddlerSlice(t.title,"button");
var labelOff = store.getTiddlerSlice(t.title,"buttonOff");
// dreadful hack
if (tag == "Starred")
label = "\u2605";
var autoClass = "button " + t.title.replace(/[\/ ]/g,'')
if (!label) label = t.title;
if (!labelOff) labelOff = label;
var curState = actOnTiddler.hasTag(tag);
var cl = createTiddlyButton(place, curState?label:labelOff, t.title, function(e) {
actOnTiddler.toggleTag(tag);
return false;
},
autoClass + " " + (curState ? "on" : "off")
);
}
},
groupOfSingleToggleTags: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var pp = paramString.parseParams("tag",null,true);
var useCheckbox = getParam(pp,"useCheckbox","");
if (!tiddler)
tiddler = store.getTiddler(getParam(pp,"title"));
var tag = getParam(pp,"tag");
var title = getParam(pp,"title",tiddler.title);
var refresh = getParam(pp,"refresh"); // stupid bit for pagetemplate hack
var actOnTiddler = store.getTiddler(title);
var getValues = fastTagged(tag).sort(function(a,b){
return a.sorterUtil(b,"orderSlice");
});
getValues.each(function(t) {
var label = store.getTiddlerSlice(t.title,"button");
var autoClass = "button " + t.title.replace(/[\/ ]/g,'')
if (!label)
label = t.title;
if (useCheckbox == "yes") {
// checkbox style toggle tags
wikify("<<toggleTag [["+t.title+"]] [["+tiddler.title+"]] ->>[["+label+"]] " ,place,null,tiddler);
}
else {
// button style toggle tags
var cl = createTiddlyButton(place, label, t.title, function(e) {
actOnTiddler.toggleTag(t.title);
if (refresh == "page")
refreshPageTemplate();
return false;
},
autoClass + " " + (actOnTiddler.getByIndex(tag).contains(t.title) ? "on" : "off")
);
}
});
}
},
multiToggleTag: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var pp = paramString.parseParams("tag",null,true);
if (!tiddler)
tiddler = store.getTiddler(getParam(pp,"title"));
var tag = getParam(pp,"tag");
var refresh = getParam(pp,"refresh"); // stupid bit for pagetemplate hack
var longVersion = getParam(pp,"longVersion");
var title = getParam(pp,"title",tiddler.title);
var actOnTiddler = store.getTiddler(title);
var getValues = fastTagged(tag).sort(function(a,b){
return a.sorterUtil(b,"orderSlice");
});
getValues.each(function(t) {
var label = store.getTiddlerSlice(t.title,longVersion?"buttonLong":"button");
var extraClass = store.getTiddlerSlice(t.title,"buttonClass");
var autoClass = (extraClass ? extraClass : "") + " button " + t.title.replace(/[\/ ]/g,'')
if (!label) label = t.title;
var cl = createTiddlyButton(place, label, t.title, function(e) {
actOnTiddler.setTagFromGroup(tag,t.title);
if (refresh == "page")
refreshPageTemplate();
return false;
},
autoClass + " " + (actOnTiddler.getByIndex(tag).contains(t.title) ? "on" : "off")
);
});
}
},
multiSelectTag: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var pp = paramString.parseParams("tag",null,true);
if (!tiddler)
tiddler = store.getTiddler(getParam(pp,"title"));
var tag = getParam(pp,"tag");
var refresh = getParam(pp,"refresh"); // stupid bit for pagetemplate hack
var allowNone = getParam(pp,"allowNone");
var title = getParam(pp,"title",tiddler.title);
var actOnTiddler = store.getTiddler(title);
var selectOptions = [];
if (allowNone)
selectOptions.push({name: null, caption:'-'});// TODO this doesn't work right?
var getValues = fastTagged(tag).sort(function(a,b){
return a.sorterUtil(b,"orderSlice");
});
getValues.each(function(t) {
var useTitle = store.getTiddlerSlice(t.title,"button");
if (!useTitle) useTitle = t.title;
selectOptions.push({name: t.title, caption:useTitle});
});
var dd = createTiddlyDropDown(place, function(e) {
actOnTiddler.setTagFromGroup(
tag,
selectOptions[this.selectedIndex].name
);
if (refresh == "page")
refreshPageTemplate();
return false;
},
selectOptions,
actOnTiddler.getByIndex(tag)[0]
);
}
},
multiCheckboxTag: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var pp = paramString.parseParams("tag",null,true);
if (!tiddler)
tiddler = store.getTiddler(getParam(pp,"title"));
var tag = getParam(pp,"tag");
var title = getParam(pp,"title",tiddler.title);
var actOnTiddler = store.getTiddler(title);
var getValues = fastTagged(tag).sort(function(a,b){
return a.sorterUtil(b,"orderSlice");
});
var output = "";
getValues.each(function(t) {
output += "<<toggleTag [[%0]] [[%1]] [[%0]]>>".format([
t.title,
actOnTiddler.title
]);
});
wikify(output,place,null,tiddler);
}
},
// these don't really belong here but never mind..
convertToFromTickler: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
if (tiddler.tags.contains('Tickler')) {
createTiddlyButton(place, "make action", "make this tickler into a next action", function(e) {
tiddler.removeTag("Tickler");
tiddler.addTag("Action");
tiddler.removeTag("Done");
tiddler.setTagFromGroup("ActionStatus","Next");
return false;
});
createTiddlyButton(place, "make project", "make this tickler into an active project", function(e) {
tiddler.removeTag("Tickler");
tiddler.addTag("Project");
tiddler.removeTag("Complete");
tiddler.setTagFromGroup("ProjectStatus",'Active');
return false;
});
}
if (tiddler.tags.containsAny(['Action','Project'])) {
createTiddlyButton(place, "make tickler", "make this item into a tickler", function(e) {
tiddler.removeTag("Action");
tiddler.removeTag("Project");
tiddler.addTag("Tickler");
return false;
});
}
}
},
linkToParent: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var label = params[1] ? params[1] : '>>';
var useTiddler = params[2] ? store.fetchTiddler(params[2]) : tiddler;
var links = useTiddler.getByIndex(params[0]);
var output = "";
for (var i=0;i<links.length;i++)
output += ( (i==0?'':' ') + "[[%1|%0]]".format([links[i], label == 'title' ? '['+links[i]+']' : label]) );
if (output != "")
wikify(output,place,null,useTiddler);
}
}
});
setStylesheet(["",
".button.off {font-weight:bold;border-color:#eee;background:#fff;color:#ccc;margin:0px;font-size:110%}",
".button.on {font-weight:bold;border-color:#444;background:#888;color:#fff;margin:0px;font-size:110%}",
".button.tiny { font-size:75%; }",
// TODO move this css elsewhere
"#realmSelector .button.off {margin:0 0.5em;padding:0 1em;border:2px solid #aaa;background:#eee;color:#333;}", // actually reversed, ie off is "on"
"#realmSelector .button.on {margin:0 0.5em;padding:0 1em;border:2px solid #999;background:#999;color:#ccc;}", // actually reversed, ie off is "on"
// TODO put into styles instead of here?
// actions
".viewer .Next.button.on {border-color:#55c;background:#cfa;color:#4a4;}",
".viewer .WaitingFor.button.on {border-color:#b84;background:#fdb;color:#b84;}",
".viewer .Future.button.on {border-color:#48b;background:#bdf;color:#48b;}",
// projects
".viewer .Active.button.on {border-color:#55c;background:#cfa;color:#4a4;}",
".viewer .SomedayMaybe.button.on {border-color:#48b;background:#bdf;color:#48b;}",
// ticklers
".viewer .Enabled.button.on {border-color:#55c;background:#cfa;color:#4a4;}",
".viewer .Disabled.button.on {border-color:#b84;background:#fdb;color:#b84;}",
".viewer .Starred.button {padding:0;font-size:170%;}",
".viewer .Starred.button.on {border-color:#fff;background:#fff;color:#f80;}",
".viewer .Starred.button.off {border-color:#fff;background:#fff;color:#ddd;}",
""].join("\n"),"tTag");
//}}}
URL: http://monkeygtd.tiddlyspot.com/upgrade.html
// won't be overwritten by updates
// eg:
//// config.options.txtTheme = 'MonkeyGTDPrint3x5';
//{{{
merge(config.macros, {
eval: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify(eval(paramString),place,null,tiddler);
}
}
});
//}}}
/%
This is the contents of the help you get when you click the question mark button
%/
!Project
No help yet for Project
!Action
No help yet for Action
!Tickler
No help yet for Tickler
!View
No help yet for View
!Context
No help yet for Context
!Area
No help yet for Area
!Realm
No help yet for Realm
!Reference
No help yet for Reference
!Action Dashboard
This Dashboard is the place where you can get an overview of your next actions.
!Action Dashboard by Project
This Dashboard is the place where you can get an overview of your next actions organised by Project. Note that when doing work you shouldn't be really be using this view. You should be focussed on context rather than project.
!Action Dashboard by Context
This Dashboard is the place where you can get an overview of your next actions organised by Context. This might be too cluttered if you have a lot of actions. If you know you are in a particular context consider just clicking the context to focus on that context.
!Next Actions
No help yet for Next Actions
!Next Actions by Context
No help yet for Next Actions by Context
!Next Actions by Project
No help yet for Next Actions by Project
!Projects Dashboard
No help yet for Projects Dashboard
!Projects Dashboard by Area
No help yet for Projects Dashboard by Area
!Next and Waiting Actions
No help yet for Next and Waiting Actions
!Next and Waiting Actions by Context
No help yet for Next and Waiting Actions by Context
!Next and Waiting Actions by Project
No help yet for Next and Waiting Actions by Project
!Done Actions
No help yet for Done Actions
!Active Projects With No Next Action
No help yet for Active Projects With No Next Action
!Quick Add
No help yet for Quick Add
!About Quick Add
No help yet for About Quick Add
!Tickler Dashboard
No help yet for Tickler Dashboard
!Ticklers Requiring Action
No help yet for Ticklers Requiring Action
!Reference Items
No help yet for Reference Items
!Starred Items
No help yet for Starred Items
|Name|MonkeyGTD Narrow|
|Description|MonkeyGTD Theme for Narrow Screens|
|PageTemplate|MonkeyGTDTheme##PageTemplate|
|StyleSheet|MonkeyGTDNarrow##StyleSheet|
|ViewTemplate|MonkeyGTDTheme##ViewTemplate|
|EditTemplate|MptwTheme##EditTemplate|
!StyleSheet
/*{{{*/
[[MonkeyGTDTheme##StyleSheet]]
/* give a little less space for menu */
#sidebar { width: 16em; /* instead of 16em */ }
#displayArea { margin-right:15.7em; /* instead of 15.7em */ }
#sidebarTabs .tabContents { width:15em; /* instead of 15em */ }
.txtMGTDMain .tab {
font-size:80%!important;
}
.txtMGTDMain .tabContents {
font-size:90%;
}
[[StyleSheet]]
/*}}}*/
|Name|MonkeyGTD Print 3x5|
|Description|MonkeyGTD Theme for Printing 3x5 Cards|
|PageTemplate|MonkeyGTDTheme##PageTemplate|
|StyleSheet|MonkeyGTDPrint3x5##StyleSheet|
|ViewTemplate|MonkeyGTDTheme##ViewTemplate|
|EditTemplate|MptwTheme##EditTemplate|
!StyleSheet
/*{{{*/
[[MonkeyGTDTheme##StyleSheet]]
[[MonkeyGTDTheme##Printing3x5Styles]]
[[StyleSheet]]
/*}}}*/
|Name|MonkeyGTD|
|Description|MonkeyGTD Theme|
|PageTemplate|MonkeyGTDTheme##PageTemplate|
|StyleSheet|MonkeyGTDTheme##StyleSheet|
|ViewTemplate|MonkeyGTDTheme##ViewTemplate|
|EditTemplate|MptwTheme##EditTemplate|
!ViewTemplate
<!--{{{-->
<div macro="showWhen tiddler.tags.containsAny(config.mGTD.specialTags)">
[[MptwTheme##ViewTemplateToolbar]]
<div class='titleContainer viewer'>[[TitleButtonsSelector]]</div>
[[MonkeyGTDTheme##Panel]]
<div macro="showWhenTaggedAny Reference View">
<!--- just make it look like a normal tiddler --->
<div class='viewer' macro='view text wikified'></div>
</div>
<div macro="else">
<div macro="showWhen tiddler.text != ''">
<div class='viewer'>Notes:</div>
<div class='viewer postityellow' macro='view text wikified'></div>
</div>
</div>
<div class='viewer'>[[DashboardSelector]]</div>
</div>
<div macro="hideWhen tiddler.tags.containsAny(config.mGTD.specialTags)">
<!--- use standard template for non gtd tiddlers --->
[[MptwTheme##ViewTemplate]]
</div>
<!--}}}-->
!Panel
<!--{{{-->
<!--- nothing as yet? --->
<!--}}}-->
!Dashboard
<!--{{{-->
<div macro="showWhenTagged Project" class="viewer" >[[Dashboards##Project]]</div>
<div macro="showWhenTagged Area" class="viewer" >[[Dashboards##Area]]</