Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
Actions waiting for a certain event before they are actionable...
projects that may be undertaken in the future...
development related issues
company contact informations...
social contacts and organisations...
(information) technology related contacts...
Stuff I need to find (or research)...
/***
|''Name:''|AccordionMenuPlugin|
|''Description:''|Turn an unordered list into an accordion style menu|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#AccordionMenuPlugin|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.0|
|''Date:''|03/11/2007|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.5|
((_@@color:red;modified version for tbGTD@@(''Note'': This version has been modified for tbGTD, i.e. doubleclick opening all categories.)))
!!Usage:
* put {{{<<accordion>>}}} on the line after your unordered list
!!Customizing:
* customize the css via the shadow tiddler [[StyleSheetAccordionMenu]]
* or give the list a custom class by passing the classes as parameters to the macro.
** Eg: {{{<<accordion ClassName1 ClassName2>>}}}
***/
//{{{
config.macros.accordion={
dblClick:true, //allows doubleclick to open all
dropchar:"", //" \u00BB",
handler:function(place,macroName,params,wikifier,paramString,tiddler){
list=findRelated(place.lastChild,"UL","tagName","previousSibling");
if(!list)return;
addClass(list,"accordion");
if(params.length)addClass(list,paramString);
this.fixLinks(list.childNodes);
},
fixLinks:function(els){
for(var i=0;i<els.length;i++){
if(els[i].tagName.toLowerCase()=="li"){
var link=findRelated(els[i].firstChild,"A","tagName","nextSibling");
if(!link){
var ih=els[i].firstChild.data;
els[i].removeChild(els[i].firstChild);
link=createTiddlyElement(null,"a",null,null,ih+this.dropchar,{href:"javascript:;"});
els[i].insertBefore(link,els[i].firstChild);
}
else{
link.firstChild.data=link.firstChild.data + this.dropchar;
removeClass(link,"tiddlyLinkNonExisting");
}
link.onclick=this.show;
addClass(link,'main');
if(this.dblClick)link.ondblclick=this.showall;
}
}
},
showall:function(e){
var i,u=this.parentNode.parentNode;
for(i=0;i<u.childNodes.length;i++)u.childNodes[i].setAttribute('class','accordion-active')
},
show:function(e){
var list=this.parentNode.parentNode;
var els=list.childNodes;
for(var i=0;i<els.length;i++){removeClass(els[i],"accordion-active");}
addClass(this.parentNode,"accordion-active");
}
}
config.shadowTiddlers["StyleSheetAccordionMenu"] =
"ul.accordion li ul {display:none;}\n"+
"ul.accordion li.accordion-active ul {display:block;}\n"+
store.addNotification("StyleSheetAccordionMenu",refreshStyles);
//}}}
! all content content transfered to another place: www.ignas.in
- - - - - - - - -> [[www.ignas.in|http://www.ignas.in]] <- - - - - - - - -
I leave this place just for reference
----
Welcome to my project page.
This is a project to parse evt and evtx windows event log files with pure python. I wish to write evt and later evtx file parser with python. Read about my idea [[here|Starting new project]]
All the information on this page will be mostly for my development needs, and some blog records about progress. Feel free to use all information found here to create somethin constructive, and please send me suggestions __<html><a href="mailto:lixas666+evt@gmail.com">lixas666@gmail.com</html>__
Here you will find all my Blog record in chronological order. All my thoughts and ideas worth to be spread will come here.
<<tiddlerList tags:"blog" dateFormat:"0DDd (ddd)" itemTemplate:"*[[%created - %title|%title]] \n" group:"tiddler.created.formatString('YYYY, MMM')" groupTemplate:"!!!%group \n" order:"-created">>
/***
|Name|CalendarPlugin|
|Source|http://www.TiddlyTools.com/#CalendarPlugin|
|Version|1.5.0|
|Author|Eric Shulman|
|Original Author|SteveRumsby|
|License|unknown|
|~CoreVersion|2.1|
|Type|plugin|
|Description|display monthly and yearly calendars|
NOTE: For //enhanced// date popup display, optionally install [[DatePlugin]] and [[ReminderMacros]]
!!!Usage:
<<<
|{{{<<calendar>>}}}|full-year calendar for the current year|
|{{{<<calendar year>>}}}|full-year calendar for the specified year|
|{{{<<calendar year month>>}}}|one month calendar for the specified month and year|
|{{{<<calendar thismonth>>}}}|one month calendar for the current month|
|{{{<<calendar lastmonth>>}}}|one month calendar for last month|
|{{{<<calendar nextmonth>>}}}|one month calendar for next month|
|{{{<<calendar +n>>}}}<br>{{{<<calendar -n>>}}}|one month calendar for a month +/- 'n' months from now|
<<<
!!!Configuration:
<<<
|''First day of week:''<br>{{{config.options.txtCalFirstDay}}}|<<option txtCalFirstDay>>|(Monday = 0, Sunday = 6)|
|''First day of weekend:''<br>{{{config.options.txtCalStartOfWeekend}}}|<<option txtCalStartOfWeekend>>|(Monday = 0, Sunday = 6)|
<<option chkDisplayWeekNumbers>> Display week numbers //(note: Monday will be used as the start of the week)//
|''Week number display format:''<br>{{{config.options.txtWeekNumberDisplayFormat }}}|<<option txtWeekNumberDisplayFormat >>|
|''Week number link format:''<br>{{{config.options.txtWeekNumberLinkFormat }}}|<<option txtWeekNumberLinkFormat >>|
<<<
!!!Code
***/
//{{{
version.extensions.CalendarPlugin= { major: 1, minor: 5, revision: 0, date: new Date(2009,5,31)};
//}}}
//{{{
if(config.options.txtCalFirstDay == undefined)
config.options.txtCalFirstDay = 0;
if(config.options.txtCalStartOfWeekend == undefined)
config.options.txtCalStartOfWeekend = 5;
if(config.options.chkDisplayWeekNumbers == undefined)
config.options.chkDisplayWeekNumbers = false;
if(config.options.chkDisplayWeekNumbers)
config.options.txtCalFirstDay = 0;
if(config.options.txtWeekNumberDisplayFormat == undefined)
config.options.txtWeekNumberDisplayFormat = 'w0WW';
if(config.options.txtWeekNumberLinkFormat == undefined)
config.options.txtWeekNumberLinkFormat = 'YYYY-w0WW';
if(config.options.txtCalendarReminderTags == undefined)
config.options.txtCalendarReminderTags = 'reminder';
config.macros.calendar = {
monthnames:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
daynames:['M','T','W','T','F','S','S'],
todaybg:'#070',
weekendbg:'#333',
monthbg:'#111',
holidaybg:'#093',
journalDateFmt:'DD MMM YYYY',
monthdays:[31,28,31,30,31,30,31,31,30,31,30,31],
holidays:[ ] // for customization see [[CalendarPluginConfig]]
};
//}}}
//{{{
function calendarIsHoliday(date)
{
var longHoliday = date.formatString('0DD/0MM/YYYY');
var shortHoliday = date.formatString('0DD/0MM');
for(var i = 0; i < config.macros.calendar.holidays.length; i++) {
if( config.macros.calendar.holidays[i]==longHoliday
|| config.macros.calendar.holidays[i]==shortHoliday)
return true;
}
return false;
}
//}}}
//{{{
config.macros.calendar.handler = function(place,macroName,params) {
var calendar = createTiddlyElement(place, 'table', null, 'calendar', null);
calendar.cellPadding="0";calendar.cellSpacing="0";
var tbody = createTiddlyElement(calendar, 'tbody');
var today = new Date();
var year = today.getYear();
if (year<1900) year+=1900;
// get journal format from SideBarOptions (ELS 5/29/06 - suggested by MartinBudden)
var text = store.getTiddlerText('SideBarOptions');
var re = new RegExp('<<(?:newJournal)([^>]*)>>','mg'); var fm = re.exec(text);
if (fm && fm[1]!=null) { var pa=fm[1].readMacroParams(); if (pa[0]) this.journalDateFmt = pa[0]; }
var month=-1;
if (params[0] == 'thismonth') {
var month=today.getMonth();
} else if (params[0] == 'lastmonth') {
var month = today.getMonth()-1; if (month==-1) { month=11; year--; }
} else if (params[0] == 'nextmonth') {
var month = today.getMonth()+1; if (month>11) { month=0; year++; }
} else if (params[0]&&'+-'.indexOf(params[0].substr(0,1))!=-1) {
var month = today.getMonth()+parseInt(params[0]);
if (month>11) { year+=Math.floor(month/12); month%=12; };
if (month<0) { year+=Math.floor(month/12); month=12+month%12; }
} else if (params[0]) {
year = params[0];
if(params[1]) month=parseInt(params[1])-1;
if (month>11) month=11; if (month<0) month=0;
}
if (month!=-1) {
cacheReminders(new Date(year, month, 1, 0, 0), 31);
createCalendarOneMonth(tbody, year, month);
} else {
cacheReminders(new Date(year, 0, 1, 0, 0), 366);
createCalendarYear(tbody, year);
}
window.reminderCacheForCalendar = null;
}
//}}}
//{{{
// cache used to store reminders while the calendar is being rendered
// it will be renulled after the calendar is fully rendered.
window.reminderCacheForCalendar = null;
//}}}
//{{{
function cacheReminders(date, leadtime)
{
if (window.findTiddlersWithReminders == null) return;
window.reminderCacheForCalendar = {};
var leadtimeHash = [];
leadtimeHash [0] = 0;
leadtimeHash [1] = leadtime;
var t = findTiddlersWithReminders(date, leadtimeHash, null, 1);
for(var i = 0; i < t.length; i++) {
//just tag it in the cache, so that when we're drawing days, we can bold this one.
window.reminderCacheForCalendar[t[i]['matchedDate']] = 'reminder:' + t[i]['params']['title'];
}
}
//}}}
//{{{
function createCalendarOneMonth(calendar, year, mon)
{
var row = createTiddlyElement(calendar, 'tr');
createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon]+' '+year, true, year, mon);
row = createTiddlyElement(calendar, 'tr');
createCalendarDayHeader(row, 1);
createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}
//{{{
function createCalendarMonth(calendar, year, mon)
{
var row = createTiddlyElement(calendar, 'tr');
createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon]+' '+ year, false, year, mon);
row = createTiddlyElement(calendar, 'tr');
createCalendarDayHeader(row, 1);
createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}
//{{{
function createCalendarYear(calendar, year)
{
var row;
row = createTiddlyElement(calendar, 'tr');
var back = createTiddlyElement(row, 'td');
var backHandler = function() {
removeChildren(calendar);
createCalendarYear(calendar, parseInt(year)-1);
return false; // consume click
};
createTiddlyButton(back, '<', 'Previous year', backHandler);
back.align = 'center';
var yearHeader = createTiddlyElement(row, 'td', null, 'calendarYear', year);
yearHeader.align = 'center';
yearHeader.setAttribute('colSpan',config.options.chkDisplayWeekNumbers?22:19);//wn**
var fwd = createTiddlyElement(row, 'td');
var fwdHandler = function() {
removeChildren(calendar);
createCalendarYear(calendar, parseInt(year)+1);
return false; // consume click
};
createTiddlyButton(fwd, '>', 'Next year', fwdHandler);
fwd.align = 'center';
createCalendarMonthRow(calendar, year, 0);
createCalendarMonthRow(calendar, year, 3);
createCalendarMonthRow(calendar, year, 6);
createCalendarMonthRow(calendar, year, 9);
}
//}}}
//{{{
function createCalendarMonthRow(cal, year, mon)
{
var row = createTiddlyElement(cal, 'tr');
createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon], false, year, mon);
createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+1], false, year, mon);
createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+2], false, year, mon);
row = createTiddlyElement(cal, 'tr');
createCalendarDayHeader(row, 3);
createCalendarDayRows(cal, year, mon);
}
//}}}
//{{{
function createCalendarMonthHeader(cal, row, name, nav, year, mon)
{
var month;
if (nav) {
var back = createTiddlyElement(row, 'td');
back.align = 'center';
back.style.background = config.macros.calendar.monthbg;
var backMonHandler = function() {
var newyear = year;
var newmon = mon-1;
if(newmon == -1) { newmon = 11; newyear = newyear-1;}
removeChildren(cal);
cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);
createCalendarOneMonth(cal, newyear, newmon);
return false; // consume click
};
createTiddlyButton(back, '<', 'Previous month', backMonHandler);
month = createTiddlyElement(row, 'td', null, 'calendarMonthname')
createTiddlyLink(month,name,true);
month.setAttribute('colSpan', config.options.chkDisplayWeekNumbers?6:5);//wn**
var fwd = createTiddlyElement(row, 'td');
fwd.align = 'center';
fwd.style.background = config.macros.calendar.monthbg;
var fwdMonHandler = function() {
var newyear = year;
var newmon = mon+1;
if(newmon == 12) { newmon = 0; newyear = newyear+1;}
removeChildren(cal);
cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);
createCalendarOneMonth(cal, newyear, newmon);
return false; // consume click
};
createTiddlyButton(fwd, '>', 'Next month', fwdMonHandler);
} else {
month = createTiddlyElement(row, 'td', null, 'calendarMonthname', name)
month.setAttribute('colSpan',config.options.chkDisplayWeekNumbers?8:7);//wn**
}
month.align = 'center';
month.style.background = config.macros.calendar.monthbg;
}
//}}}
//{{{
function createCalendarDayHeader(row, num)
{
var cell;
for(var i = 0; i < num; i++) {
if (config.options.chkDisplayWeekNumbers) createTiddlyElement(row, 'td');//wn**
for(var j = 0; j < 7; j++) {
var d = j + (config.options.txtCalFirstDay - 0);
if(d > 6) d = d - 7;
cell = createTiddlyElement(row, 'td', null, null);
createTiddlyElement(cell,'span',null,'button',config.macros.calendar.daynames[d]);
if(d == (config.options.txtCalStartOfWeekend-0) || d == (config.options.txtCalStartOfWeekend-0+1))
cell.style.background = config.macros.calendar.weekendbg;
}
}
}
//}}}
//{{{
function createCalendarDays(row, col, first, max, year, mon) {
var i;
if (config.options.chkDisplayWeekNumbers){
if (first<=max) {
var ww = new Date(year,mon,first);
var td=createTiddlyElement(row, 'td');//wn**
var link=createTiddlyLink(td,ww.formatString(config.options.txtWeekNumberLinkFormat),false,"weekNo");
link.appendChild(document.createTextNode(
ww.formatString(config.options.txtWeekNumberDisplayFormat)));
}
else createTiddlyElement(row, 'td');//wn**
}
for(i = 0; i < col; i++)
createTiddlyElement(row, 'td');
var day = first;
for(i = col; i < 7; i++) {
var d = i + (config.options.txtCalFirstDay - 0);
if(d > 6) d = d - 7;
var daycell = createTiddlyElement(row, 'td');
var isaWeekend=((d==(config.options.txtCalStartOfWeekend-0)
|| d==(config.options.txtCalStartOfWeekend-0+1))?true:false);
if(day > 0 && day <= max) {
var celldate = new Date(year, mon, day);
// ELS 10/30/05 - use <<date>> macro's showDate() function to create popup
// ELS 05/29/06 - use journalDateFmt
if (window.showDate) showDate(daycell,celldate,'popup','DD',
config.macros.calendar.journalDateFmt,true, isaWeekend);
else {
if(isaWeekend) daycell.style.background = config.macros.calendar.weekendbg;
var title = celldate.formatString(config.macros.calendar.journalDateFmt);
if(calendarIsHoliday(celldate))
daycell.style.background = config.macros.calendar.holidaybg;
var now=new Date();
if ((now-celldate>=0) && (now-celldate<86400000)) // is today?
daycell.style.background = config.macros.calendar.todaybg;
if(window.findTiddlersWithReminders == null) {
var link = createTiddlyLink(daycell, title, false);
link.appendChild(document.createTextNode(day));
} else
var button = createTiddlyButton(daycell, day, title, onClickCalendarDate);
}
}
day++;
}
}
//}}}
//{{{
// Create a pop-up containing:
// * a link to a tiddler for this date
// * a 'new tiddler' link to add a reminder for this date
// * links to current reminders for this date
// NOTE: this code is only used if [[ReminderMacros]] is installed AND [[DatePlugin]] is //not// installed.
function onClickCalendarDate(ev) { ev=ev||window.event;
var d=new Date(this.getAttribute('title')); var date=d.formatString(config.macros.calendar.journalDateFmt);
var p=Popup.create(this); if (!p) return;
createTiddlyLink(createTiddlyElement(p,'li'),date,true);
var rem='\\n\\<\\<reminder day:%0 month:%1 year:%2 title: \\>\\>';
rem=rem.format([d.getDate(),d.getMonth()+1,d.getYear()+1900]);
var cmd="<<newTiddler label:[[new reminder...]] prompt:[[add a new reminder to '%0']]"
+" title:[[%0]] text:{{store.getTiddlerText('%0','')+'%1'}} tag:%2>>";
wikify(cmd.format([date,rem,config.options.txtCalendarReminderTags]),p);
createTiddlyElement(p,'hr');
var t=findTiddlersWithReminders(d,[0,31],null,1);
for(var i=0; i<t.length; i++) {
var link=createTiddlyLink(createTiddlyElement(p,'li'), t[i].tiddler, false);
link.appendChild(document.createTextNode(t[i]['params']['title']));
}
Popup.show(); ev.cancelBubble=true; if (ev.stopPropagation) ev.stopPropagation(); return false;
}
//}}}
//{{{
function calendarMaxDays(year, mon)
{
var max = config.macros.calendar.monthdays[mon];
if(mon == 1 && (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0)) max++;
return max;
}
//}}}
//{{{
function createCalendarDayRows(cal, year, mon)
{
var row = createTiddlyElement(cal, 'tr');
var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first1 < 0) first1 = first1 + 7;
var day1 = -first1 + 1;
var first2 = (new Date(year, mon+1, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first2 < 0) first2 = first2 + 7;
var day2 = -first2 + 1;
var first3 = (new Date(year, mon+2, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first3 < 0) first3 = first3 + 7;
var day3 = -first3 + 1;
var max1 = calendarMaxDays(year, mon);
var max2 = calendarMaxDays(year, mon+1);
var max3 = calendarMaxDays(year, mon+2);
while(day1 <= max1 || day2 <= max2 || day3 <= max3) {
row = createTiddlyElement(cal, 'tr');
createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
createCalendarDays(row, 0, day2, max2, year, mon+1); day2 += 7;
createCalendarDays(row, 0, day3, max3, year, mon+2); day3 += 7;
}
}
//}}}
//{{{
function createCalendarDayRowsSingle(cal, year, mon)
{
var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);
if(first1 < 0) first1 = first1+ 7;
var day1 = -first1 + 1;
var max1 = calendarMaxDays(year, mon);
while(day1 <= max1) {
row = createTiddlyElement(cal, 'tr');
createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
}
}
//}}}
//{{{
setStylesheet('.calendar, .calendar table, .calendar th, .calendar tr, .calendar td { text-align:center; } .calendar, .calendar a { margin:0px !important; padding:0px !important; }', 'calendarStyles');
//}}}
Background: #fff
Foreground: #000
PrimaryPale: #EEE
PrimaryLight: #777
PrimaryMid: #111
PrimaryDark: #000
SecondaryPale: #EEF
SecondaryLight: #CCF
SecondaryMid: #69C
SecondaryDark: #36C
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #333
Error: #f88
/***
|Name|[[DatePlugin]]|
|Source|http://www.TiddlyTools.com/#DatePlugin|
|Documentation|http://www.TiddlyTools.com/#DatePluginInfo|
|Version|2.7.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|formatted dates plus popup menu with 'journal' link, changes and (optional) reminders|
This plugin provides a general approach to displaying formatted dates and/or links and popups that permit easy navigation and management of tiddlers based on their creation/modification dates.
!!!!!Documentation
>see [[DatePluginInfo]]
!!!!!Configuration
<<<
<<option chkDatePopupHideCreated>> omit 'created' section from date popups
<<option chkDatePopupHideChanged>> omit 'changed' section from date popups
<<option chkDatePopupHideTagged>> omit 'tagged' section from date popups
<<option chkDatePopupHideReminders>> omit 'reminders' section from date popups
<<option chkShowJulianDate>> display Julian day number (1-365) below current date
see [[DatePluginConfig]] for additional configuration settings, for use in calendar displays, including:
*date formats
*color-coded backgrounds
*annual fixed-date holidays
*weekends
<<<
!!!!!Code
***/
//{{{
version.extensions.DatePlugin= {major: 2, minor: 7, revision: 1, date: new Date(2009,5,31)};
config.macros.date = {
format: 'YYYY.0MM.0DD', // default date display format
linkformat: 'YYYY.0MM.0DD', // 'dated tiddler' link format
linkedbg: '#033',
todaybg: '#070',
weekendbg: '#333',
holidaybg: '#662',
createdbg: '#026',
modifiedsbg: '#406',
remindersbg: '#800',
weekend: [ 1,0,0,0,0,0,1 ], // [ day index values: sun=0, mon=1, tue=2, wed=3, thu=4, fri=5, sat=6 ],
holidays: [ '01/01', '07/04', '07/24', '11/24' ]
// NewYearsDay, IndependenceDay(US), Eric's Birthday (hooray!), Thanksgiving(US)
};
config.macros.date.handler = function(place,macroName,params)
{
// default: display current date
var now =new Date();
var date=now;
var mode='display';
if (params[0]&&['display','popup','link'].contains(params[0].toLowerCase()))
{ mode=params[0]; params.shift(); }
if (!params[0] || params[0]=='today')
{ params.shift(); }
else if (params[0]=='filedate')
{ date=new Date(document.lastModified); params.shift(); }
else if (params[0]=='tiddler')
{ date=store.getTiddler(story.findContainingTiddler(place).id.substr(7)).modified; params.shift(); }
else if (params[0].substr(0,8)=='tiddler:')
{ var t; if ((t=store.getTiddler(params[0].substr(8)))) date=t.modified; params.shift(); }
else {
var y = eval(params.shift().replace(/Y/ig,(now.getYear()<1900)?now.getYear()+1900:now.getYear()));
var m = eval(params.shift().replace(/M/ig,now.getMonth()+1));
var d = eval(params.shift().replace(/D/ig,now.getDate()+0));
date = new Date(y,m-1,d);
}
// date format with optional custom override
var format=this.format; if (params[0]) format=params.shift();
var linkformat=this.linkformat; if (params[0]) linkformat=params.shift();
showDate(place,date,mode,format,linkformat);
}
window.showDate=showDate;
function showDate(place,date,mode,format,linkformat,autostyle,weekend)
{
mode =mode||'display';
format =format||config.macros.date.format;
linkformat=linkformat||config.macros.date.linkformat;
// format the date output
var title=date.formatString(format);
var linkto=date.formatString(linkformat);
// just show the formatted output
if (mode=='display') { place.appendChild(document.createTextNode(title)); return; }
// link to a 'dated tiddler'
var link = createTiddlyLink(place, linkto, false);
link.appendChild(document.createTextNode(title));
link.title = linkto;
link.date = date;
link.format = format;
link.linkformat = linkformat;
// if using a popup menu, replace click handler for dated tiddler link
// with handler for popup and make link text non-italic (i.e., an 'existing link' look)
if (mode=='popup') {
link.onclick = onClickDatePopup;
link.style.fontStyle='normal';
}
// format the popup link to show what kind of info it contains (for use with calendar generators)
if (autostyle) setDateStyle(place,link,weekend);
}
//}}}
//{{{
// NOTE: This function provides default logic for setting the date style when displayed in a calendar
// To customize the date style logic, please see[[DatePluginConfig]]
function setDateStyle(place,link,weekend) {
// alias variable names for code readability
var date=link.date;
var fmt=link.linkformat;
var linkto=date.formatString(fmt);
var cmd=config.macros.date;
if ((weekend!==undefined?weekend:isWeekend(date))&&(cmd.weekendbg!=''))
{ place.style.background = cmd.weekendbg; }
if (hasModifieds(date)||hasCreateds(date)||hasTagged(date,fmt))
{ link.style.fontStyle='normal'; link.style.fontWeight='bold'; }
if (hasReminders(date))
{ link.style.textDecoration='underline'; }
if (isToday(date))
{ link.style.textDecoration = 'underline';}
if (isHoliday(date)&&(cmd.holidaybg!=''))
{ place.style.background = cmd.holidaybg; }
if (hasCreateds(date)&&(cmd.createdbg!=''))
{ place.style.background = cmd.createdbg; }
if (hasModifieds(date)&&(cmd.modifiedsbg!=''))
{ place.style.background = cmd.modifiedsbg; }
if ((hasTagged(date,fmt)||store.tiddlerExists(linkto))&&(cmd.linkedbg!=''))
{ place.style.background = cmd.linkedbg; }
if (hasReminders(date)&&(cmd.remindersbg!=''))
{ place.style.background = cmd.remindersbg; }
if (isToday(date)&&(cmd.todaybg!=''))
{ place.style.background = cmd.todaybg; }
if (config.options.chkShowJulianDate) { // optional display of Julian date numbers
var m=[0,31,59,90,120,151,181,212,243,273,304,334];
var d=date.getDate()+m[date.getMonth()];
var y=date.getFullYear();
if (date.getMonth()>1 && (y%4==0 && y%100!=0) || y%400==0)
d++; // after February in a leap year
wikify('@@font-size:80%;<br>'+d+'@@',place);
}
}
//}}}
//{{{
function isToday(date) // returns true if date is today
{ var now=new Date(); return ((now-date>=0) && (now-date<86400000)); }
function isWeekend(date) // returns true if date is a weekend
{ return (config.macros.date.weekend[date.getDay()]); }
function isHoliday(date) // returns true if date is a holiday
{
var longHoliday = date.formatString('0MM/0DD/YYYY');
var shortHoliday = date.formatString('0MM/0DD');
for(var i = 0; i < config.macros.date.holidays.length; i++) {
var holiday=config.macros.date.holidays[i];
if (holiday==longHoliday||holiday==shortHoliday) return true;
}
return false;
}
//}}}
//{{{
// Event handler for clicking on a day popup
function onClickDatePopup(e) { e=e||window.event;
var p=Popup.create(this); if (!p) return false;
// always show dated tiddler link (or just date, if readOnly) at the top...
if (!readOnly || store.tiddlerExists(this.date.formatString(this.linkformat)))
createTiddlyLink(createTiddlyElement(p,'li'),this.date.formatString(this.linkformat),true);
else
createTiddlyText(createTiddlyElement(p,'li'),this.date.formatString(this.linkformat));
if (!config.options.chkDatePopupHideCreated)
addCreatedsToPopup(p,this.date,this.format);
if (!config.options.chkDatePopupHideChanged)
addModifiedsToPopup(p,this.date,this.format);
if (!config.options.chkDatePopupHideTagged)
addTaggedToPopup(p,this.date,this.linkformat);
if (!config.options.chkDatePopupHideReminders)
addRemindersToPopup(p,this.date,this.linkformat);
Popup.show(); e.cancelBubble=true; if(e.stopPropagation)e.stopPropagation(); return false;
}
//}}}
//{{{
function indexCreateds() // build list of tiddlers, hash indexed by creation date
{
var createds= { };
var tiddlers = store.getTiddlers('title','excludeLists');
for (var t = 0; t < tiddlers.length; t++) {
var date = tiddlers[t].created.formatString('YYYY0MM0DD')
if (!createds[date])
createds[date]=new Array();
createds[date].push(tiddlers[t].title);
}
return createds;
}
function hasCreateds(date) // returns true if date has created tiddlers
{
if (!config.macros.date.createds) config.macros.date.createds=indexCreateds();
return (config.macros.date.createds[date.formatString('YYYY0MM0DD')]!=undefined);
}
function addCreatedsToPopup(p,when,format)
{
var force=(store.isDirty() && when.formatString('YYYY0MM0DD')==new Date().formatString('YYYY0MM0DD'));
if (force || !config.macros.date.createds) config.macros.date.createds=indexCreateds();
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var createds = config.macros.date.createds[when.formatString('YYYY0MM0DD')];
if (createds) {
createds.sort();
var e=createTiddlyElement(p,'div',null,null,'created ('+createds.length+')');
for(var t=0; t<createds.length; t++) {
var link=createTiddlyLink(createTiddlyElement(p,'li'),createds[t],false);
link.appendChild(document.createTextNode(indent+createds[t]));
}
}
}
//}}}
//{{{
function indexModifieds() // build list of tiddlers, hash indexed by modification date
{
var modifieds= { };
var tiddlers = store.getTiddlers('title','excludeLists');
for (var t = 0; t < tiddlers.length; t++) {
var date = tiddlers[t].modified.formatString('YYYY0MM0DD')
if (!modifieds[date])
modifieds[date]=new Array();
modifieds[date].push(tiddlers[t].title);
}
return modifieds;
}
function hasModifieds(date) // returns true if date has modified tiddlers
{
if (!config.macros.date.modifieds) config.macros.date.modifieds = indexModifieds();
return (config.macros.date.modifieds[date.formatString('YYYY0MM0DD')]!=undefined);
}
function addModifiedsToPopup(p,when,format)
{
var date=when.formatString('YYYY0MM0DD');
var force=(store.isDirty() && date==new Date().formatString('YYYY0MM0DD'));
if (force || !config.macros.date.modifieds) config.macros.date.modifieds=indexModifieds();
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var mods = config.macros.date.modifieds[date];
if (mods) {
// if a tiddler was created on this date, don't list it in the 'changed' section
if (config.macros.date.createds && config.macros.date.createds[date]) {
var temp=[];
for(var t=0; t<mods.length; t++)
if (!config.macros.date.createds[date].contains(mods[t]))
temp.push(mods[t]);
mods=temp;
}
mods.sort();
var e=createTiddlyElement(p,'div',null,null,'changed ('+mods.length+')');
for(var t=0; t<mods.length; t++) {
var link=createTiddlyLink(createTiddlyElement(p,'li'),mods[t],false);
link.appendChild(document.createTextNode(indent+mods[t]));
}
}
}
//}}}
//{{{
function hasTagged(date,format) // returns true if date is tagging other tiddlers
{
return store.getTaggedTiddlers(date.formatString(format)).length>0;
}
function addTaggedToPopup(p,when,format)
{
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var tagged=store.getTaggedTiddlers(when.formatString(format));
if (tagged.length) var e=createTiddlyElement(p,'div',null,null,'tagged ('+tagged.length+')');
for(var t=0; t<tagged.length; t++) {
var link=createTiddlyLink(createTiddlyElement(p,'li'),tagged[t].title,false);
link.appendChild(document.createTextNode(indent+tagged[t].title));
}
}
//}}}
//{{{
function indexReminders(date,leadtime) // build list of tiddlers with reminders, hash indexed by reminder date
{
var reminders = { };
if(window.findTiddlersWithReminders!=undefined) { // reminder plugin is installed
var t = findTiddlersWithReminders(date, [0,leadtime], null, null, 1);
for(var i=0; i<t.length; i++) reminders[t[i].matchedDate]=true;
}
return reminders;
}
function hasReminders(date) // returns true if date has reminders
{
if (window.reminderCacheForCalendar)
return window.reminderCacheForCalendar[date]; // use calendar cache
if (!config.macros.date.reminders)
config.macros.date.reminders = indexReminders(date,90); // create a 90-day leadtime reminder cache
return (config.macros.date.reminders[date]);
}
function addRemindersToPopup(p,when,format)
{
if(window.findTiddlersWithReminders==undefined) return; // reminder plugin not installed
var indent = String.fromCharCode(160)+String.fromCharCode(160);
var reminders=findTiddlersWithReminders(when, [0,31],null,null,1);
createTiddlyElement(p,'div',null,null,'reminders ('+(reminders.length||'none')+')');
for(var t=0; t<reminders.length; t++) {
link = createTiddlyLink(createTiddlyElement(p,'li'),reminders[t].tiddler,false);
var diff=reminders[t].diff;
diff=(diff<1)?'Today':((diff==1)?'Tomorrow':diff+' days');
var txt=(reminders[t].params['title'])?reminders[t].params['title']:reminders[t].tiddler;
link.appendChild(document.createTextNode(indent+diff+' - '+txt));
}
if (readOnly) return; // readonly... omit 'new reminder...' command
var rem='\\<\\<reminder day:%0 month:%1 year:%2 title:"Enter a reminder title here"\\>\\>';
rem=rem.format([when.getDate(),when.getMonth()+1,when.getYear()+1900]);
var cmd="<<newTiddler label:[["+indent+"new reminder...]] prompt:[[add a reminder to '%0']]"
+" title:[[%0]] text:{{var t=store.getTiddlerText('%0','');t+(t.length?'\\n':'')+'%1'}} tag:%2>>";
wikify(cmd.format([when.formatString(format),rem,config.options.txtCalendarReminderTags||'']),
createTiddlyElement(p,'li'));
}
//}}}
/***
|''Name:''|DeliciousTaggingPlugin|
|''Version:''|0.5|
|''Source''|http://tbGTD.tiddlyspot.com|
|''Author:''|[[TobiasBeer]]|
!Description
@@color:red;Mod of Jack's [[DeliciousTaggingPlugin|http://jackparke.googlepages.com/jtw.html]] to allow...
*custom tag-chosers
*tag-exclusion
@@
Allows easy tagging in the EditTemplate by showing all tags as a list of link-buttons.
Replace your the editorFooter div in your [[EditTemplate]] with the following:
{{{<div class='editorFooter' macro='deliciousTagging'></div>}}}
!Code
***/
//{{{
version.extensions.deliciousTagging={major: 0, minor: 1, revision: 0, date: new Date("June 11, 2007")};
config.macros.deliciousTagging={
catChose:"Tag this tiddler with '%0' its sub-tags or tiddlers tagging to them",
catList:'x-tagger config##Tags',
catsMore:['archive','reference'],
exclude:['noCloud','excludeLists'],
arrow:document.all?"â–¼":"â–¾",
handler:function(place,macroName,params,wikifier,paramString,tiddler){
if(tiddler instanceof Tiddler){
var b,c,g,t,tx,tg,tn,tgs,ex=[],x,xx=this.exclude,lng=config.views.editor.tagChooser;
for(tx=0;tx<xx.length;tx++){
x=store.getTaggedTiddlers(xx[tx]);
for(t=0;t<x.length;t++)ex.pushUnique(x[t].title);
}
g=store.getTiddlerText(this.catList);g=g?g.readBracketedList():[];
for(c=0;c<this.catsMore.length;c++)g.pushUnique(this.catsMore[c]);
for(c=0;c<g.length;c++){
if(!store.getTiddler(g[c]))continue;
b=createTiddlyButton(place,g[c]+this.arrow,this.catChose.format([g[c]]),this.clickCat);
b.setAttribute("tiddler",tiddler.title);b.setAttribute("tags",g[c]);
}
tgs=store.getTags();
for(t=0;t<tgs.length;t++){
tn=tgs[t][0];if(ex.contains(tn))continue;
tg=createTiddlyButton(place,tn,lng.tagTooltip.format([tn]),config.macros.tagChooser.onTagClick);
tg.setAttribute("tag",tn);tg.setAttribute("tiddler",tiddler.title);
place.appendChild(document.createTextNode(" "));
}
}
},
clickCat:function(e){
var b,pop,t,tg,ti,tgs=[],tgt,c,cx,lng=config.views.editor.tagChooser;
e=e||window.event;
pop=Popup.create(this);
t=this.getAttribute('tags');tgs.pushUnique('MAIN:'+t);
cx=store.getTaggedTiddlers(t);
for(c=0;c<cx.length;c++){
ti=cx[c].title;
tgs.pushUnique('GROUP:'+ti);
tgt=store.getTaggedTiddlers(ti);
for(t=0;t<tgt.length;t++)tgs.pushUnique(tgt[t].title);
}
for(t=0;t<tgs.length;t++){
tg=tgs[t];
if(tg.indexOf('MAIN:')==0)tg=ti=tg.substr(5);
else if(tg.indexOf('GROUP:')==0){tg=tg.substr(6);ti='\u00A0\u00A0'+tg;}
else ti='\u00A0\u00A0\u00A0\u00A0'+tg;
b=createTiddlyButton(createTiddlyElement(pop,"li"),ti,lng.tagTooltip.format([tg]),config.macros.tagChooser.onTagClick);
b.setAttribute("tiddler",this.getAttribute("tiddler"));b.setAttribute("tag",tg);
}
Popup.show();
e.cancelBubble = true;
if(e.stopPropagation) e.stopPropagation();
return false;
}
}
//}}}
<html>
<iframe src="http://pastebin.com/embed_iframe.php?i=4jtjp07V" style="border:none;width:100%"></iframe>
</html>
The evtx file structure is different from previous version log format (evt). New file structure was introduced in Vista and systems prior to Vista (XP, NT and older) are not capable of reading that format.
Technical documentation on MSDN:
http://msdn.microsoft.com/en-us/library/cc231282%28v=PROT.13%29.aspx
Structure:
*<<popup [[File Header]] [[<<tiddler evtxStructure##fileHeader$))]]>>
#*Log Chunk (size in hex: 1000 )
##*<<popup Header [[<<tiddler evtxStructure##chunkHeader$))]]>>
##*<<popup Content [[<<tiddler evtxStructure##eventRecord$))]]>>
#*Log Chunk
##*<<popup Header [[<<tiddler evtxStructure##chunkHeader$))]]>>
##*<<popup Content [[<<tiddler evtxStructure##eventRecord$))]]>>
#*.........................
A log within Log Chunk Content saved as XML <<popup XML [[<<tiddler evtxStructure##xmlStructure$))]]>>. How text <<popup tokenized [[<<tiddler evtxStructure##xmlToken$))]]>> [[read here|http://computer.forensikblog.de/en/2007/07/tokenization.html]].
/***
|''Name:''|FE2|
|''Description:''|create, edit, view and delete commands in toolbar <<toolbar fields>>|
|''Version:''|1.0.2|
|''Date:''|Oct. 21,2009|
|''Source:''|http://tbGTD.tiddlyspot.com|
|''Author:''|Tobias Beer|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.5.3|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Note
This is a refactored version of [[FieldsEditorPlugin|http://visualtw.ouvaton.org/VisualTW.html#FieldsEditorPlugin]] by Pascal Collin
!Installation:
*import this tiddler, keep tagged as systemConfig, save and reload
!Code
***/
//{{{
//language settings for header, also see language options for macro.FE2 below!
config.commands.fields.lang={field:"field",actions:"actions",value:"value"};
config.commands.fields.handlePopup=function(popup,title){
addClass(popup,'FE2');
var tid=store.fetchTiddler(title);
if(!tid)return;
var t='[['+title+']]';
var fields={};
store.forEachField(tid,function(tid,field,v){fields[field]=v;},true);
var list=[];
for(var f in fields){
var e='[['+f+']]';
list.push({
field:f,
value:fields[f],
actions:"<<FE2 "+t+" rename "+e+">> <<FE2 "+t+" delete "+e+">> <<FE2 "+t+" edit "+e+">>"
});
}
list.sort(function(a,b){return a.field<b.field?-1:(a.field==b.field?0:+1);});
list.push({field:'',value:"",actions:"<<FE2 "+t+" create>>"});
var table=ListView.create(popup,list,{
columns:[
{name:'Field',field:'field',title:this.lang.field,type:'String'},
{name: 'Actions',field:'actions',title:this.lang.actions,type: 'WikiText'},
{name:'Value',field:'value',title:this.lang.value,type:'WikiText'}
],
rowClasses:[
{field:'actions'}
],
buttons:[ //can't use button for selected then delete, because click on checkbox will hide the popup
]
});
}
config.macros.FE2={
//language options
lang:{
'delete':'delete', //string since keyword!
rename:'<rename',
create:'Create a new field...',
edit:'edit>',
lineBreaks:"The field value contains linebreaks.\nEditing here will convert it to a single line!\nProceed?",
enterName:"Enter new field name...",
enterNewName:"Enter new name for '%1'...",
enterVal:"Enter field value for '%1'...",
enterNewVal:"Enter new value for '%1'..",
doDelete:"Delete field '%1' from tiddler '%2' ?",
existing:"This field already exists! "
},
handler:function(place,macroName,params,wikifier,paramString,tiddler){
if(!readOnly){
var tid=params[0];
var mode=params[1];
var field=params[2];
var btn=createTiddlyButton(place,this.lang[mode],this.lang[mode]+" "+field,this.clicked);
btn.setAttribute("tiddler",tid);
btn.setAttribute("field",field);
btn.setAttribute("mode",mode);
}
},
clicked:function(){
var lng=config.macros.FE2.lang;
var title=this.getAttribute("tiddler");
var field=this.getAttribute("field");
var mode=this.getAttribute("mode");
var tid=store.getTiddler(title);
if(!tid)return;
switch(mode){
case'create':
var first="";
do{
field=prompt(first+ lng.enterName,"");
first=lng.existing;
}while(store.getValue(tid,field));
if(field){
var v=prompt(lng.enterVal.replace(/%1/,field),"");
if(v)tid.fields[field]=v;else return;
}else return;
break;
case'delete':
if(confirm(lng.doDelete.replace(/%1/,field).replace(/%2/,title))){
delete tid.fields[field];
}else return;
break;
case'edit':
var v=tid.fields[field]||'';
if(!v.match(/\n/mg)||confirm(lng.lineBreaks)){
var v=prompt(lng.enterNewVal.replace(/%1/,field),v);
if(v||v=='')tid.fields[field]=v;else return;
}else return;
break;
case'rename':
var name=prompt(lng.enterNewName.replace(/%1/,field),field);
if(name){
tid.fields[name]=tid.fields[field];
delete tid.fields[field];
}else return;
break;
default:return;
}
store.saveTiddler(tid.title,tid.title,tid.text,tid.modifier,tid.modified,tid.tags,tid.fields);
story.refreshTiddler(title,null,true);
return false;
}
}
config.shadowTiddlers.StyleSheetFE2=
".FE2 td br{display:block;}\n"+
".FE2 td {font-size:12px;padding:1px 3px}\n"+
".FE2 .button {border:0;padding:0 0.2em;}\n"+
".FE2 .twtable,.FE2 .twtable thead, .FE2 .twtable tr{border:0}\n"+
".FE2 .twtable tr:hover{background:"+store.getTiddlerSlice('ColorPalette','TertiaryDark')+"}\n"+
".FE2 .twtable thead{font-size:13px;}";
store.addNotification("StyleSheetFE2",refreshStyles);
//}}}
You can get a full copy of this page right here: [[download|http://evtx.tiddlyspot.com/download]]
/***
|Name|GotoPlugin|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Documentation|http://www.TiddlyTools.com/#GotoPluginInfo|
|Version|1.9.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|view any tiddler by entering it's title - displays list of possible matches|
''View a tiddler by typing its title and pressing //enter//.'' As you type, a list of possible matches is displayed. You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press escape to close the listbox to resume typing. When the listbox is not displayed, pressing //escape// clears the current input.
!!!Configuration
<<<
*Match titles only after {{twochar{<<option txtIncrementalSearchMin>>}}} or more characters are entered.<br>Use down-arrow to start matching with shorter input. //Note: This option value is also set/used by [[SearchOptionsPlugin]]//.
*To set the maximum height of the listbox, you can create a tiddler tagged with <<tag systemConfig>>, containing:
//{{{
config.macros.gotoTiddler.listMaxSize=10; // change this number
//}}}
!!!Code
***/
//{{{
version.extensions.GotoPlugin= {major: 1, minor: 9, revision: 2, date: new Date(2009,5,22)};
// automatically tweak shadow SideBarOptions to add <<gotoTiddler>> macro above <<search>>
config.shadowTiddlers.SideBarOptions=config.shadowTiddlers.SideBarOptions.replace(/<<search>>/,"{{button{goto}}}\n<<gotoTiddler>><<search>>");
if (config.options.txtIncrementalSearchMin===undefined) config.options.txtIncrementalSearchMin=2;
config.macros.gotoTiddler= {
listMaxSize: 10,
listHeading: 'Found %0 matching title%1...',
searchItem: "Search for '%0'...",
handler:
function(place,macroName,params,wikifier,paramString,tiddler) {
var quiet =params.contains("quiet");
var showlist =params.contains("showlist");
var search =params.contains("search");
params = paramString.parseParams("anon",null,true,false,false);
var instyle =getParam(params,"inputstyle","");
var liststyle =getParam(params,"liststyle","");
var filter =getParam(params,"filter","");
var html=this.html;
var keyevent=window.event?"onkeydown":"onkeypress"; // IE event fixup for ESC handling
html=html.replace(/%keyevent%/g,keyevent);
html=html.replace(/%search%/g,search);
html=html.replace(/%quiet%/g,quiet);
html=html.replace(/%showlist%/g,showlist);
html=html.replace(/%display%/g,showlist?'block':'none');
html=html.replace(/%position%/g,showlist?'static':'absolute');
html=html.replace(/%instyle%/g,instyle);
html=html.replace(/%liststyle%/g,liststyle);
html=html.replace(/%filter%/g,filter);
//if (config.browser.isIE) html=this.IEtableFixup.format([html]);
var span=createTiddlyElement(place,'span');
span.innerHTML=html; var form=span.getElementsByTagName("form")[0];
if (showlist) this.fillList(form.list,'',filter,search,0);
},
html:
'<form onsubmit="return false" style="display:inline;margin:0;padding:0">\
<input name=gotoTiddler type=text value="search..." autocomplete="off" accesskey="G" style="%instyle%"\
title="ENTER=search | SHIFT+ENTER=open | DOWN=list"\
onfocus="this.select(); this.setAttribute(\'accesskey\',\'G\');"\
%keyevent%="return config.macros.gotoTiddler.inputEscKeyHandler(event,this,this.form.list,%search%,%showlist%);"\
onkeyup="return config.macros.gotoTiddler.inputKeyHandler(event,this,%quiet%,%search%,%showlist%);">\
<select name=list style="display:%display%;position:%position%;%liststyle%"\
onchange="if (!this.selectedIndex) this.selectedIndex=1;"\
onblur="this.style.display=%showlist%?\'block\':\'none\';"\
%keyevent%="return config.macros.gotoTiddler.selectKeyHandler(event,this,this.form.gotoTiddler,%showlist%);"\
onclick="return config.macros.gotoTiddler.processItem(this.value,this.form.gotoTiddler,this,%showlist%);">\
</select><input name="filter" type="hidden" value="%filter%">\
</form>',
IEtableFixup:
"<table style='width:100%;display:inline;padding:0;margin:0;border:0;'>\
<tr style='padding:0;margin:0;border:0;'><td style='padding:0;margin:0;border:0;'>\
%0</td></tr></table>",
getItems:
function(list,val,filter) {
if (!list.cache || !list.cache.length || val.length<=config.options.txtIncrementalSearchMin) {
// starting new search, fetch and cache list of tiddlers/shadows/tags
list.cache=new Array();
if (filter.length) {
var fn=store.getMatchingTiddlers||store.getTaggedTiddlers;
var tiddlers=store.sortTiddlers(fn.apply(store,[filter]),'title');
} else
var tiddlers=store.reverseLookup('tags','');
for(var t=0; t<tiddlers.length; t++) list.cache.push(tiddlers[t].title);
if (!filter.length) {
for (var t in config.shadowTiddlers) list.cache.pushUnique(t);
var tags=store.getTags();
for(var t=0; t<tags.length; t++) list.cache.pushUnique(tags[t][0]);
}
}
var found = [];
var match=val.toLowerCase();
for(var i=0; i<list.cache.length; i++)
if (list.cache[i].toLowerCase().indexOf(match)!=-1) found.push(list.cache[i]);
return found;
},
getItemSuffix:
function(t) {
if (store.tiddlerExists(t)) return ""; // tiddler
if (store.isShadowTiddler(t)) return " (shadow)"; // shadow
return " (tag)"; // tag
},
fillList:
function(list,val,filter,search,key) {
if (list.style.display=="none") return; // not visible... do nothing!
var indent='\xa0\xa0\xa0';
var found = this.getItems(list,val,filter); // find matching items...
found.sort(); // alpha by title
while (list.length > 0) list.options[0]=null; // clear list
var hdr=this.listHeading.format([found.length,found.length==1?"":"s"]);
list.options[0]=new Option(hdr,"",false,false);
for (var t=0; t<found.length; t++) list.options[list.length]=
new Option(indent+found[t]+this.getItemSuffix(found[t]),found[t],false,false);
if (search)
list.options[list.length]=new Option(this.searchItem.format([val]),"*",false,false);
list.size=(list.length<this.listMaxSize?list.length:this.listMaxSize); // resize list...
list.selectedIndex=key==38?list.length-1:key==40?1:0;
},
keyProcessed:
function(ev) { // utility function
ev.cancelBubble=true; // IE4+
try{event.keyCode=0;}catch(e){}; // IE5
if (window.event) ev.returnValue=false; // IE6
if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
if (ev.stopPropagation) ev.stopPropagation(); // all
return false;
},
inputEscKeyHandler:
function(event,here,list,search,showlist) {
if (event.keyCode==27) {
if (showlist) { // clear input, reset list
here.value=here.defaultValue;
this.fillList(list,'',here.form.filter.value,search,0);
}
else if (list.style.display=="none") // clear input
here.value=here.defaultValue;
else list.style.display="none"; // hide list
return this.keyProcessed(event);
}
return true; // key bubbles up
},
inputKeyHandler:
function(event,here,quiet,search,showlist) {
var key=event.keyCode;
var list=here.form.list;
var filter=here.form.filter;
// non-printing chars bubble up, except for a few:
if (key<48) switch(key) {
// backspace=8, enter=13, space=32, up=38, down=40, delete=46
case 8: case 13: case 32: case 38: case 40: case 46: break; default: return true;
}
// blank input... if down/enter... fall through (list all)... else, and hide or reset list
if (!here.value.length && !(key==40 || key==13)) {
if (showlist) this.fillList(here.form.list,'',here.form.filter.value,search,0);
else list.style.display="none";
return this.keyProcessed(event);
}
// hide list if quiet, or below input minimum (and not showlist)
list.style.display=(!showlist&&(quiet||here.value.length<config.options.txtIncrementalSearchMin))?'none':'block';
// non-blank input... enter=show/create tiddler, SHIFT-enter=search for text
if (key==13 && here.value.length) return this.processItem(event.shiftKey?here.value:'*',here,list,showlist);
// up or down key, or enter with blank input... shows and moves to list...
if (key==38 || key==40 || key==13) { list.style.display="block"; list.focus(); }
this.fillList(list,here.value,filter.value,search,key);
return true; // key bubbles up
},
selectKeyHandler:
function(event,list,editfield,showlist) {
if (event.keyCode==27) // escape... hide list, move to edit field
{ editfield.focus(); list.style.display=showlist?'block':'none'; return this.keyProcessed(event); }
if (event.keyCode==13 && list.value.length) // enter... view selected item
{ this.processItem(list.value,editfield,list,showlist); return this.keyProcessed(event); }
return true; // key bubbles up
},
processItem:
function(title,here,list,showlist) {
if (!title.length) return;
list.style.display=showlist?'block':'none';
if (title=="*") { story.search(here.value); return false; } // do full-text search
if (!showlist) here.value=title;
story.displayTiddler(null,title); // show selected tiddler
return false;
}
}
//}}}
On Freitag, 13. November 2009 19:07:08, Tobias imported 1 tiddler from
[[C:\xTiddle\tiddlyspot\tbGTD\tbGTD.html|C:\xTiddle\tiddlyspot\tbGTD\tbGTD.html]]:
<<<
#[[tbGTD help]] - added
<<<
----
On Freitag, 13. November 2009 19:05:51, Tobias imported 9 tiddlers from
[[C:\xTiddle\tiddlyspot\tbGTD\tbGTD.html|C:\xTiddle\tiddlyspot\tbGTD\tbGTD.html]]:
<<<
#[[DeliciousTagging]] - replaces DeliciousTagging - 11/9/2009 23:37:00 by Tobias
#[[StyleSheetShortcuts]] - replaces StyleSheetShortcuts - 11/9/2009 23:51:00 by Tobias
#[[TagCloud]] - replaces TagCloud - 11/9/2009 23:37:00 by Tobias
#[[TagCloudMacro]] - replaces TagCloudMacro - 11/7/2009 23:53:00 by Tobias
#[[TiddlersBarPlugin]] - replaces TiddlersBarPlugin - 11/10/2009 03:24:00 by Tobias
#[[help]] - replaces help - 11/10/2009 02:19:00 by Tobias
#[[tbGtdTheme]] - replaces tbGtdTheme - 11/9/2009 23:50:00 by Tobias
#[[x-plore]] - replaces x-plore - 11/9/2009 23:53:00 by Tobias
#[[x-tagger]] - replaces x-tagger - 11/7/2009 22:46:00 by Tobias
<<<
----
On Freitag, 13. November 2009 19:05:32, Tobias imported 1 tiddler from
[[C:\xTiddle\tiddlyspot\tbGTD\tbGTD.html|C:\xTiddle\tiddlyspot\tbGTD\tbGTD.html]]:
<<<
#[[update]] - added
<<<
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 5, date: new Date(2009,4,11)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?(?: key=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: 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 src=lookaheadMatch[1];
var label=lookaheadMatch[2];
var tip=lookaheadMatch[3];
var key=lookaheadMatch[4];
var show=lookaheadMatch[5];
var code=lookaheadMatch[6];
if (src) { // external script library
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // inline code
if (show) // display source in tiddler
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create 'onclick' command link
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place,tiddler){"+fixup+"\n};_out(this,this.tiddler);"
link.tiddler=w.tiddler;
link.onclick=function(){
this.bufferedHTML="";
try{ var r=eval(this.code);
if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
if(this.bufferedHTML.length)
s.innerHTML=this.bufferedHTML;
if((typeof(r)==="string")&&r.length) {
wikify(r,s,null,this.tiddler);
return false;
} else return r!==undefined?r:false;
} catch(e){alert(e.description||e.toString());return false;}
};
link.setAttribute("title",tip||"");
var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
link.setAttribute("href",URIcode);
link.style.cursor="pointer";
if (key) link.accessKey=key.substr(0,1); // single character only
}
else { // run script immediately
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var c="function _out(place,tiddler){"+fixup+"\n};_out(w.output,w.tiddler);";
try { var out=eval(c); }
catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
if(limit > 0) text = text.substr(0,limit);
var wikifier = new Wikifier(text,formatter,null,tiddler);
return wikifier.wikifyPlain();
}
//}}}
// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
/***
|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));
}
//}}}
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
major: 1, minor: 1, revision: 0,
date: new Date("mar 17, 2007"),
source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};
if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};
bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){
url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
}
return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
<script>
var out='',s,t,tags=[],tids=[],ti,tgt;
tags=store.getTiddlerText('x-tagger config##Tags').readBracketedList();
for(t=0;t<tags.length;t++){
ti=tags[t];tgt=tids.contains(ti)?[]:store.getTaggedTiddlers(ti);
if(tgt.length==0)tags.splice(t,1);//takes out subitems of toplevel ones, e.g. $active projects
else for(var s=0;s<tgt.length;s++)tids.pushUnique(tgt[s].title);
}
for(t=0;t<tags.length;t++){
ti=tags[t];tids=store.getTaggedTiddlers(ti);
out+="*"+(tids[0]?' '+tids[0].title.substr(0,1)+' ':'')+ti+"\n";
for(s=0;s<tids.length;s++){
ti=tids[s].title;
out+="**<<newTiddler label:+ title:'new "+ti+"' prompt:'create a new "+ti+"' focus:title tag:'"+ti+"'>><<tag "+ti+">>\n";
}
}
return out;
</script><<accordion>>/%do all you want, but please be so kind as to leave the link to http://tbGTD.tiddlyspot.com in here%/<html><a class="noCopy" href="javascript:story.displayTiddler(null,'tweet');" title="post on twitter" style="clear:both;display:block;width:46%;padding:0 2%;float:left;text-align:center;">tweet</a>
<a class="noCopy" href="http://tbgtd.tiddlyspot.com" title="go to the original tbGTD" style="display:block;width:46%;padding:0 2% 0 0;float:left;text-align:center;" target="_blank">tbGTD</a>
<a class="noCopy" style="display:block;width:46%;padding:0 2% 0 0;float:left;text-align:center;" href="index.xml"><img src="http://b.dryicons.com/images/icon_sets/stickers_icon_set/png/32x32/rss_feed.png" border="0" /></a>
<g:plusone annotation="none"></g:plusone>
</html>
<script>var _hey_lt_w = "", _hey_lt_h = "", _hey_lt_c = "";_hey_lt_w = screen.width; _hey_lt_h = screen.height; _hey_lt_c = navigator.appName.indexOf("Microsoft") >= 0 ?screen.colorDepth : screen.pixelDepth;return "<html><a class='noCopy' style='display:block;width:100%;padding:0 2% 0 0;float:left;text-align:center;' target='_blank' href='http://www.hey.lt/details.php?id=evtx' title='Counter Statistics'><img width=88 height=31 border=0 src='http://www.hey.lt/count.php?id=evtx&width=" + _hey_lt_w + "&height=" + _hey_lt_h + "&color=" + _hey_lt_c + "&referer=" + escape(document.referrer) + "' alt='Counter'></a></html>";</script>
<html><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-27768366-1");
pageTracker._trackPageview();
} catch(err) {}
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script></html>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' /><style type="text/css">body {background:black;}#contentWrapper {display:none;}</style><div id="SplashScreen" style="display: block; text-align: center; width: 500px; margin: 100px auto; padding: 20px 30px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#333;color:#FFF;border: 2px solid #ddd;-moz-border-radius:5px; -webkit-border-radius:5px;"><b>tbGTD</b> is loading<span style="text-decoration: blink;">...</span><br/><span style="font-size: 14px; color:#FDD;">requires javascript</span></div>
<!--}}}-->
//{{{
config.options.txtFadeTimer = 5000; // 5 seconds
window.displayMessage=function(text,linkText,fadeTimer) {
var e = getMessageDiv();
if(!e) {
alert(text);
return;
}
if(linkText) {
var link = createTiddlyElement(e,"a",null,null,text);
link.href = linkText;
link.target = "_blank";
} else {
e.appendChild(document.createTextNode(text));
}
if(config.options.txtFadeTimer > 0) {
setTimeout(clearMessage, config.options.txtFadeTimer);
}
}
//}}}
/***
|Name:|NewHerePlugin|
|Description:|Creates the new here and new journal macros|
|Version:|3.0 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#NewHerePlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.macros, {
newHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]] prompt:'Create a new tiddler tagging to this tiddler'>>",place,null,tiddler);
}
},
newJournalHere: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
wikify("<<newJournal "+paramString+" label:'journal' tag:journal tag:[["+tiddler.title+"]] prompt:'Create a new journal entry tagging to this tiddler'>>",place,null,tiddler);
}
}
});
//}}}
/***
|Name:|NewMeansNewPlugin|
|Description:|If 'New Tiddler' already exists then create 'New Tiddler (1)' and so on|
|Version:|1.1 ($Rev: 2263 $)|
|Date:|$Date: 2007-06-13 04:22:32 +1000 (Wed, 13 Jun 2007) $|
|Source:|http://mptw.tiddlyspot.com/empty.html#NewMeansNewPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Note: I think this should be in the core
***/
//{{{
String.prototype.getNextFreeName = function() {
var numberRegExp = / \(([0-9]+)\)$/;
var match = numberRegExp.exec(this);
if (match) {
var num = parseInt(match[1]) + 1;
return this.replace(numberRegExp," ("+num+")");
}
else {
return this + " (1)";
}
}
config.macros.newTiddler.checkForUnsaved = function(newName) {
var r = false;
story.forEachTiddler(function(title,element) {
if (title == newName)
r = true;
});
return r;
}
config.macros.newTiddler.getName = function(newName) {
while (store.getTiddler(newName) || config.macros.newTiddler.checkForUnsaved(newName))
newName = newName.getNextFreeName();
return newName;
}
config.macros.newTiddler.onClickNewTiddler = function()
{
var title = this.getAttribute("newTitle");
if(this.getAttribute("isJournal") == "true") {
var now = new Date();
title = now.formatString(title.trim());
}
title = config.macros.newTiddler.getName(title); // <--- only changed bit
var params = this.getAttribute("params");
var tags = params ? params.split("|") : [];
var focus = this.getAttribute("newFocus");
var template = this.getAttribute("newTemplate");
var customFields = this.getAttribute("customFields");
story.displayTiddler(null,title,template,false,null,null);
var tiddlerElem = document.getElementById(story.idPrefix + title);
if(customFields)
story.addCustomFields(tiddlerElem,customFields);
var text = this.getAttribute("newText");
if(typeof text == "string")
story.getTiddlerField(title,"text").value = text.format([title]);
for(var t=0;t<tags.length;t++)
story.setTiddlerTag(title,tags[t],+1);
story.focusTiddler(title,focus);
return false;
};
//}}}
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
major: 1, minor: 0, revision: 2,
date: new Date("Apr 19, 2007"),
source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
coreVersion: '2.2.0 (Beta 5)'
};
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");
merge(config.macros.option.types, {
'pas': {
elementType: "input",
valueField: "value",
eventName: "onkeyup",
className: "pasOptionInput",
typeValue: config.macros.option.passwordInputType,
create: function(place,type,opt,className,desc) {
// password field
config.macros.option.genericCreate(place,'pas',opt,className,desc);
// checkbox linked with this password "save this password on this computer"
config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);
// text savePasswordCheckboxLabel
place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
},
onChange: config.macros.option.genericOnChange
}
});
merge(config.optionHandlers['chk'], {
get: function(name) {
// is there an option linked with this chk ?
var opt = name.substr(3);
if (config.options[opt])
saveOptionCookie(opt);
return config.options[name] ? "true" : "false";
}
});
merge(config.optionHandlers, {
'pas': {
get: function(name) {
if (config.options["chk"+name]) {
return encodeCookie(config.options[name].toString());
} else {
return "";
}
},
set: function(name,value) {config.options[name] = decodeCookie(value);}
}
});
// need to reload options to load passwordOptions
loadOptionsCookie();
/*
if (!config.options['pasPassword'])
config.options['pasPassword'] = '';
merge(config.optionsDesc,{
pasPassword: "Test password"
});
*/
//}}}
/***
|''Name:''|~PopupMacro|
|''Author:''|Saq Imtiaz (mod Tobias Beer)|
|''Version:''|1.1 (2009-11-08)|
|''Description:''|Create popups with custom content|
|''Source:''|http://tbGTD.tiddlyspor.com/#PopupMacro|
|''Documentation:''|http://tw.lewcid.org/#PopupMacroDocs|
|''Requires:''|TW Version 2.0.8 or better|
@@((mod for tbGTD(^removed styles and code cleanup)))@@
!Code
***/
//{{{
config.macros.popup={
err1:'missing macro parameters',
err2:'missing label or content parameter',
arrow:document.all?"â–¼":"â–¾",
handler:function(place,macroName,params,wikifier,paramString,theTiddler){
var cls,id,lbl,src,click;
if(!params[0]||!params[1]){createTiddlyError(place,this.err1,this.err2);return false;}
lbl=params[0];
src=(params[1]).replace(/\$\)\)/g,">>");
id=params[2]?params[2]:'nestedpopup';
cls='popup'+(params[3]?' ' +params[3]:'');
click=function(e){
var btn,nest,p,tgt;
e=e||window.event;
tgt=resolveTarget(e);
nest=!isNested(tgt);
id=nest?id:'popup';
if(nest&&Popup.stack.length>1)Popup.removeFrom(1);
else if(!nest&&Popup.stack.length>0)Popup.removeFrom(0);
p=createTiddlyElement(document.body,"ol",id,cls,null);
Popup.stack.push({root:this,popup:p});
wikify(src,p);
Popup.show(p,true);e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();return false;
}
btn=createTiddlyButton(place,lbl+this.arrow,lbl,click,null);
}
}
window.isNested=function(el){
var c=document.getElementById("contentWrapper");
while(el!=null){if(el==c)return true;el=el.parentNode;}return false;
}
setStylesheet('#nestedpopup {margin-left:1em;}','PopupMacroStyles');
//}}}
/***
|Name:|PrettyDatesPlugin|
|Description:|Provides a new date format ('pppp') that displays times such as '2 days ago'|
|Version:|1.0 ($Rev: 3646 $)|
|Date:|$Date: 2008-02-27 02:34:38 +1000 (Wed, 27 Feb 2008) $|
|Source:|http://mptw.tiddlyspot.com/#PrettyDatesPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!Notes
* If you want to you can rename this plugin. :) Some suggestions: LastUpdatedPlugin, RelativeDatesPlugin, SmartDatesPlugin, SexyDatesPlugin.
* Inspired by http://ejohn.org/files/pretty.js
***/
//{{{
Date.prototype.prettyDate = function() {
var diff = (((new Date()).getTime() - this.getTime()) / 1000);
var day_diff = Math.floor(diff / 86400);
if (isNaN(day_diff)) return "";
else if (diff < 0) return "in the future";
else if (diff < 60) return "just now";
else if (diff < 120) return "1 minute ago";
else if (diff < 3600) return Math.floor(diff/60) + " minutes ago";
else if (diff < 7200) return "1 hour ago";
else if (diff < 86400) return Math.floor(diff/3600) + " hours ago";
else if (day_diff == 1) return "Yesterday";
else if (day_diff < 7) return day_diff + " days ago";
else if (day_diff < 14) return "a week ago";
else if (day_diff < 31) return Math.ceil(day_diff/7) + " weeks ago";
else if (day_diff < 62) return "a month ago";
else if (day_diff < 365) return "about " + Math.ceil(day_diff/31) + " months ago";
else if (day_diff < 730) return "a year ago";
else return Math.ceil(day_diff/365) + " years ago";
}
Date.prototype.formatString_orig_mptw = Date.prototype.formatString;
Date.prototype.formatString = function(template) {
return this.formatString_orig_mptw(template).replace(/pppp/,this.prettyDate());
}
// for MPTW. otherwise edit your ViewTemplate as required.
// config.mptwDateFormat = 'pppp (DD/MM/YY)';
config.mptwDateFormat = 'pppp';
//}}}
/***
|Name|PreviewPlugin|
|Source|http://www.TiddlyTools.com/#PreviewPlugin|
|Documentation|http://www.TiddlyTools.com/#PreviewPluginInfo|
|Version|1.8.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|add key-by-key wikified preview to any textarea input field|
Provides key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content as you type input into a textarea (multi-line) edit field.
!!!!!Documentation
>see [[PreviewPluginInfo]]
!!!!!Configuration
<<<
Automatically freeze preview updates when a tiddler takes more than <<option txtPreviewAutoFreeze>> milliseconds to render.
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.11.18 [1.8.1] in config.commands.previewTiddler, changed alt command text to use character-based "psuedo-checkbox" instead of embedded html fragment
2007.09.27 [1.8.0] split TidIDE preview functionality into separate stand-alone plugin (see [[TidIDEPlugin]]).
|please see [[TidIDEPluginInfo]] for additional revision details|
2006.04.15 [0.5.0] Initial ALPHA release. Converted from inline script.
<<<
!!!!!Code
***/
// // version info
//{{{
version.extensions.PreviewPlugin= {major: 1, minor: 8, revision: 1, date: new Date(2007,11,18)};
//}}}
// // macro definition
//{{{
if (config.options.txtPreviewAutoFreeze==undefined)
config.options.txtPreviewAutoFreeze=250; // limit (in milliseconds) for auto-freezing preview display
config.macros.preview = {
renderMsg: "rendering preview...",
timeoutMsg: " (> %0ms)",
freezeMsg: " - preview is frozen. Press [refresh] to re-display.",
handler: function(place,macroName,params) {
var hide=params[0]=="hide"; if (hide) params.shift();
var field=params[0];
var height=params[1]; if (!height) height=15;
var here=this.findContainingForm(place);
if (!here) here=story.findContainingTiddler(place);
if (!here) here=place.parentNode;
if (!here) here=place;
var elems=here.getElementsByTagName("textarea");
if (field) for (var e=0; e<elems.length; e++) // find matching textarea (by fieldname)
if (elems[e].getAttribute("edit")==field) var ta=elems[e];
else
if (elems.length) var ta=elems[elems.length-1]; // default to last rendered text area
if (!ta) {
var elems=here.getElementsByTagName("input");
if (field) for (var e=0; e<elems.length; e++) // find matching input field (by fieldname)
if (elems[e].getAttribute("edit")==field) var ta=elems[e];
else
if (elems.length) var ta=elems[elems.length-1]; // default to last rendered input field
}
if (!ta) return false; // no textarea or input field found... do nothing...
var id=(new Date().getTime()).toString()+Math.random(); // unique instance ID
ta.id=id+"_edit";
ta.setAttribute("previewid",id+"_preview");
ta.saved_onkeyup=ta.onkeyup;
ta.onkeyup=function(ev) {
if (this.saved_onkeyup) this.saved_onkeyup.apply(this,arguments);
config.macros.preview.render(this.id,this.getAttribute("previewid"));
}
var html=this.html.replace(/%previd%/g,id+"_preview")
html=html.replace(/%srcid%/g,id+"_edit");
html=html.replace(/%hide%/g,hide?"none":"block");
html=html.replace(/%limit%/g,config.options.txtPreviewAutoFreeze);
html=html.replace(/%frozen%/g,hide?"checked":"");
html=html.replace(/%height%/g,height);
html=html.replace(/%halfheight%/g,height/2);
createTiddlyElement(place,"span").innerHTML=html;
this.render(id+"_edit",id+"_preview");
},
findContainingForm: function(e) {
while (e && e.nodeName.toLowerCase()!="form") e=e.parentNode;
return e;
},
render: function(srcid,previd,force) {
var value=document.getElementById(srcid).value;
var panel=document.getElementById(previd);
var f=this.findContainingForm(panel);
if (!f || (f.freeze.checked && !force)) return;
var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
p.innerHTML="";
f.status.value=this.renderMsg;
var start=new Date();
wikify(value.replace(/\r/g,''),p);
var end=new Date();
this.renderDOM(previd);
this.renderHTML(previd);
f.status.value="elapsed: "+(end-start+1)+"ms";
// automatically suspend preview updates for slow rendering tiddlers
if (end-start+1>config.options.txtPreviewAutoFreeze) {
f.freeze.checked=true;
f.status.value+=this.timeoutMsg.format([config.options.txtPreviewAutoFreeze]);
}
if (f.freeze.checked) f.status.value+=this.freezeMsg;
},
renderDOM: function(id) {
var panel=document.getElementById(id);
var f=this.findContainingForm(panel); if (!f) return;
var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
var height=p.getAttribute("height");
p.style.height=((f.dom.checked||f.html.checked)?height/2:height)+"em";
if (f.dom.checked) d.value=this.getNodeTree(p,"| ");
if (!d.style||!h.style) return;
d.style.height=height/2+"em";
d.style.display=f.dom.checked?"inline":"none";
d.style.width=f.html.checked?"49.5%":"100%";
h.style.width=f.dom.checked?"49.5%":"100%";
},
renderHTML: function(id) {
var panel=document.getElementById(id);
var f=this.findContainingForm(panel); if (!f) return;
var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
var height=p.getAttribute("height");
p.style.height=((f.dom.checked||f.html.checked)?height/2:height)+"em";
if (f.html.checked) h.value=this.formatHTML(p.innerHTML);
if (!h.style||!d.style) return;
h.style.height=height/2+"em";
h.style.display=f.html.checked?"inline":"none";
h.style.width=f.dom.checked?"49.5%":"100%";
d.style.width=f.html.checked?"49.5%":"100%";
},
formatHTML: function(txt) {
if (config.browser.isIE) return txt; // BYPASS - 4/24/2006 due to IE hang problem. Will fix later...
var out="";
var indent="";
var level=0;
for (var i=0;i<txt.length;i++) {
var c=txt.substr(i,1);
if (c=="<") {
if (txt.substr(i+1,1)=="/") indent=indent.substr(0,indent.length-2);
out+="\n"+indent;
if (txt.substr(i+1,1)!="/" && txt.substr(i+1,3)!="br>" && txt.substr(i+1,2)!="p>" && txt.substr(i+1,3)!="hr>") indent+=" ";
}
out+=c;
if (c=="\n")
out+=indent;
if (c==">" && txt.substr(i+1,1)!="<")
out+="\n"+indent;
}
return out;
},
getNodeTree: function(theNode,theIndent,showPath,inline,thePrefix,thePath)
{
if (!theNode) return "";
if (!thePrefix) thePrefix="";
if (!thePath) thePath="";
var mquote='"'+(inline?"{{{":"");
var endmquote=(inline?"}}}":"")+'"';
// generate output for this node
var out = thePrefix;
if (showPath && thePath.length)
out += (inline?"//":"")+thePath.substr(1)+":"+(inline?"//":"")+"\r\n"+thePrefix;
if (theNode.className=="DOMViewer")
return out+'[DOMViewer]\r\n'; // avoid self-referential recursion
out += (inline?"''":"")+theNode.nodeName.toUpperCase()+(inline?"''":"");
if (theNode.nodeName=="#text")
out += ' '+mquote+theNode.nodeValue.replace(/\n/g,'\\n')+endmquote;
if (theNode.className)
out += ' class='+mquote+theNode.className+endmquote;
if (theNode.type)
out += ' type='+mquote+theNode.type+endmquote;
if (theNode.id)
out += ' id='+mquote+theNode.id+endmquote;
if (theNode.name)
out += " "+theNode.name+(theNode.value?"="+mquote+theNode.value+endmquote:"");
if (theNode.href)
out += ' href='+mquote+theNode.href+endmquote;
if (theNode.src)
out += ' src='+mquote+theNode.src+endmquote;
if (theNode.attributes && theNode.getAttribute("tiddlyLink")!=undefined)
out += ' tiddler='+mquote+theNode.getAttribute("tiddlyLink")+endmquote;
out += "\r\n";
// recursively generate output for child nodes
thePath=thePath+"."+theNode.nodeName.toLowerCase();
thePrefix=theIndent+thePrefix;
for (var i=0;i<theNode.childNodes.length;i++)
{
var thisChild=theNode.childNodes.item(i);
var theNum=(inline?"~~":"(")+(i+1)+(inline?"~~":")");
out += this.getNodeTree(thisChild,theIndent,showPath,inline,thePrefix,thePath+theNum);
}
return out;
},
html: " <form style='width:100%'><span id='%previd%' editID='%srcid%' style='display:%hide%'><div class='viewer' \
height='%height%' style='margin:0;margin-top:.5em;height:%height%em;overflow:auto;white-space:normal'> \
\
</div> \
<!-- DOM and HTML viewers --> \
<textarea name=domview cols=60 rows=12 wrap=off \
onfocus='this.select()' style='display:none;width:100%;height:%halfheight%em;'></textarea><!-- \
--><textarea name=htmlview cols=60 rows=12 wrap=off \
onfocus='this.select()' style='display:none;width:100%;height:%halfheight%em;'></textarea> \
<!-- status line, preview option checkboxes, run/refresh buttons --> \
<table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \
<td style='border:0;padding:0;margin:0'><!-- \
--><input type=text name=status style='padding:0;width:100%;' \
title='ELAPSED: time (in milliseconds) used to render tiddler content in preview display'><!-- \
--></td><td style='width:1%;border:0;padding:0;margin:0;'><!-- \
--><input type=text name=limit size='6' maxlength='6' style='padding:0;width:5em;text-align:center' \
value='%limit%ms' title='TIME LIMIT: maximum rendering time (in milliseconds) before auto-freezing preview' \
onfocus='this.select()' \
onchange='var val=this.value.replace(/[^0-9]/g,\"\"); if (!val.length) val=this.defaultValue; \
this.value=val+\"ms\"; config.options.txtPreviewAutoFreeze=val; saveOptionCookie(\"txtPreviewAutoFreeze\"); \
this.form.freeze.checked=false; config.macros.preview.render(\"%srcid%\",\"%previd%\",true);'><!-- \
--></td><td style='width:1%;border:0;padding:0;margin:0;'><!-- \
--><input type=text name=height size='4' maxlength='4' style='padding:0;width:4em;text-align:center' \
value='%height%em' title='HEIGHT: size (in \"ems\") of preview area, including controls' \
onfocus='this.select()' \
onchange='var val=this.value.replace(/[^0-9]/g,\"\"); if (!val.length) val=this.defaultValue; \
this.value=val+\"em\"; document.getElementById(\"%previd%\").firstChild.setAttribute(\"height\",val); \
config.macros.preview.render(\"%srcid%\",\"%previd%\",true)'><!-- \
--></td><td style='width:1%;border:0;padding:0;margin:0;text-align:right;white-space:nowrap'> \
<input type=checkbox name=dom style='display:inline;width:auto;margin:1px;' \
title='show Document Object Model (DOM) information' \
onclick='config.macros.preview.renderDOM(\"%previd%\");'>DOM \
<input type=checkbox name=html style='display:inline;width:auto;margin:1px;' \
title='show rendered HTML' \
onclick='config.macros.preview.renderHTML(\"%previd%\");'>HTML \
<input type=checkbox name=freeze style='display:inline;width:auto;margin:1px;' %frozen% \
title='do not update preview display as changes are made' \
onclick='var p=document.getElementById(\"%previd%\"); \
if (this.checked) this.form.status.value+=config.macros.preview.freezeMsg; \
else config.macros.preview.render(\"%srcid%\",\"%previd%\",true);'>freeze \
<input type=button style='display:inline;width:auto;' value='refresh' \
title='update preview display' \
onclick='config.macros.preview.render(\"%srcid%\",\"%previd%\",true)'> \
</td></tr></table> \
</span></form>"
}
//}}}
// // toolbar definition
//{{{
config.commands.previewTiddler = {
text: 'preview',
tooltip: 'show key-by-key preview',
text_alt: '\u221Apreview',
handler: function(event,src,title) {
var here=story.findContainingTiddler(src); if (!here) return;
var elems=here.getElementsByTagName("span");
for (var e=0; e<elems.length; e++) {
if (elems[e].getAttribute("editid")) {
var show=elems[e].style.display=="none";
src.innerHTML=show?this.text_alt:this.text;
elems[e].style.display=show?"block":"none";
config.macros.preview.findContainingForm(elems[e]).freeze.checked=!show;
if (show) config.macros.preview.render(elems[e].getAttribute("editid"),elems[e].id);
}
}
return false;
}
};
//}}}
[[IronPython|http://ironpython.codeplex.com/]] is capable of compille python programs to dll
<script>if(!window.tbQA)window.tbQA={
bigSize:'300px',//height for bigger-size textarea
searchAll:true,//determines whether all tiddlers will be scanned to find unidentified tags in quick-add
lingo:{//translation
none:"Nothing to be added! Open quick-add help?",
empty:"No message, no nothing.",
noMatch:"No match found for '%0', neither in added nor in existing tiddlers!%1Try again...",
justAdded:"All those you just added are:%0. ",
notFound:"No %0tag found matching '%1' for '%2'! ",
noDefault:"No default %0-tag defined. ",
useShort:"Use any shortform of '%0'. ",
usePrefix:"Alternatively, use just the prefix '%0' for '%1'. ",
enterNew:"Enter another %0tag for '%1'...",
listPrefix:"|linkTable|k\n| type | tiddler | tags | action |h\n"
},
cfg:{
//---tbGTD quick-add configuration (stored as global object)---
//edit to suit your needs ...changes apply only after reload!
//all inspected prefixes (not allowed: 'fst','all'!)
p:['#','^','$','§','@','?','&','-'],
//definition arrays for those prefixes -> comma (!) separated strings
//'prefix':[0='master-tag', 1='default subtag, [2='arr of allowed subitems {...for multi-level-add}']],
'$':['project','$active',['$','§','#','?']], //only those with subitems are allowed as line-starters!
'#':['action','#next',['#','?']],
'^':['priority','^1.high'],
'§':['stage',,['#','?']],
'@':['context'],
'?':['contact'],
'&':['area'],
'-':['realm','-private-'] //-> mind the last comma on each line, but not on the last!
//---end of quick-add setup---
//better not edit below
},
init:function(){
var c,cat,def,pr,t,tag,tgt,tit;
c=this.cfg;c.fst=[];c.all=[];
//c=quickkad cfg, cat=category, def=definition, pr=prefix, t,tag=tag, tgt=tagged, tit=title
for(pr=0;pr<c.p.length;pr++){
cat=c.p[pr];def=c[cat];
if(def){
tag=def[0];
if(tag){
if(def[2])c.fst.pushUnique(cat);//arr with prefixes allowed to have subitems
c[cat]['tags']=[];//named arr for the following prefixed(!) subtags
tgt=store.getTaggedTiddlers(tag);
for(t=0;t<tgt.length;t++){
tit=tgt[t].title;
c[cat]['tags'].pushUnique(tit);//store subtag
c.all.pushUnique(tit);//all allowed
}
}
}
}
},
find:function(dt,pr,ti){//dt=tag from def, pr=prefix, ti=new title
var c=tbQA.cfg,ct,fo='',l=tbQA.lingo,t,nd;
//c=config, ct=check-tag, fo=return: found tag, l=lingo, t=ctrl var, nd=no default
while(fo==''&&dt){//while invalid and tag given
nd=false;
if(dt.length<=1){//only prefix
if(c[pr][1])fo=c[pr][1];//get default from cfg
else nd=true;
}else{//prefix+string
for(t=0;t<c[pr]['tags'].length;t++){
ct=c[pr]['tags'][t];//check tagged
if(ct.indexOf(dt)==0){fo=ct;break;}//starting characters match
}
}
//if not found, ask again
if(!fo)dt=prompt((nd?l.noDefault.format([c[pr][0]]):l.notFound.format([c[pr][0]+'-',dt,ti]))+
(c[pr][0]?l.useShort.format([c[pr]['tags']]):'')+
(c[pr][1]?l.usePrefix.format([pr,c[pr][1]]):'')+
l.enterNew.format([c[pr][0]+'-',ti]),pr).trim();
}
return fo;
}
};
tbQA.init();//get GTD tags
config.shadowTiddlers['Recent notes']='<<tiddlerList filter:"tiddler.tags.containsAny([\'quickadd\',\'note\'])" top:"5" order:"-created" dateFormat:"pppp" itemTemplate:"!@@background:#DDD;display:block;width:98%;padding:5px 1%;%link@@\\n<<tiddler scripts##deleteTiddler with: \'%title\' \'Recent notes\' norefresh$)) (%created) @@padding-left:2em;tags: %tags@@\\n\\n%text\\n">>';
</script><html><nowiki><form id="qNotes" style="width:100%;">
<table class='borderless' cellpadding='0' cellspacing='0' style='width:100%;'>
<tr><td style='width:75%;margin-left:-5px;'>
<input name='tags' type='text' title='add tags to this note (in addition, all tags will be tagged "note")' cols='60' style='width:29.5%;float:right;border:1px solid #CCC;'>
<input name='title' type='text' title='note title ...when blank this timestamp will be inserted: YYYY-0MM-0DD 0hh:0mm:0ss' cols='60' style='width:69.25%;float:right;border:1px solid #CCC;'>
</td><td rowspan='2' style='width:25%'>
<input type='button' class='button btn' value='list all notes' id='toggleNotesArchive' title="click to show or hide a list of all tiddlers tagged 'note'" onclick="
var show=value=='list all notes';
var el=document.getElementById('showNoteList');
show?wikify(store.getTiddlerText('QuickNotes##archive'),el):el.innerHTML='';
el.style.display=show?'block':'none';
this.value=show?'hide note-list':'list all notes';
return false;">
<input type='button' class='button btn' value='bigger size' id='toggleInputSize' title='click to toggle the size of the textarea' onclick="
var big=this.value=='bigger size';
this.value=(big?'normal':'bigger') + ' size';
this.form.note.style.height=(big?tbQA.bigSize:'120px');
return false;">
<input type='button' class='button btn' value='add reminder' title='add a reminder to the current note' onClick='
var d=new Date();
this.form.note.value=this.form.note.value+"\n"+"<<reminder year:%0 month:%1 day:%2 title:\"reminder title\">>".format(
[d.getFullYear(),
String.zeroPad(d.getMonth()+1,2),
String.zeroPad(d.getDate(),2)]);
this.form.note.focus();
return false;'>
<input type='button' class='button btn' value='quick-add help' title='show help for quick-add' onclick="story.displayTiddler(null,'quick-add help');">
<input type='button' name='save' class='button btn' value='add note (click)
quick-add (ctrl+click)' style='height:55px;' title='click to add note | ctr-click to quick-add projects, actions, etc...' onclick="
var arr,c,cs=0,cul,def,dt,ev,fi,fo,hr,ind,la=[],key,lash,l,len,lev,li,ll;
//arr= tmp array, c=quickadd cfg, cs=corrected shift, cul=curr line, dt=def tag, ev=event, fi=first char, fo=found, ind=indent ftc
//key=keycode, l=lingo, la=arr of last entries, lash=last shift value, len=arr length, lev=level, li=lines, ll=last line
var nu,ok,out,note,ntgs,pos,pr,sh,subs,t,tag,tgs=[],tid,tids=[],ti='',txt='',who,when,x;
//nu=new tid, ok=write tid. out=output, pr=prefix, pos=char position, ntgs=quickadd tags, sh=shift
//t/tag=tag, tid=added tiddler title , tids=tiddlers to be created, tgs=tags, txt=tid text
c=tbQA.cfg,l=tbQA.lingo;//get cfg, find & lingo
ev=event||window.event;
ok=function(ti){return !store.tiddlerExists(ti)||confirm(config.messages.overwriteWarning.format([ti]))};
who=config.options.txtUserName;
when=new Date();
tgs=this.form.tags.value.readBracketedList();
note=this.form.note.value;
if(note==''){alert(l.empty);return;}//no empty notes
if(ev.ctrlKey){//quickadd
tids['add']=[];//init arr for all added tids
tids['all']=store.getTiddlers('title');//&all existing ones too
li=note.split('\n');//split lines
while(true){
ll=li.length==0;
cul=li.shift();//get first line of rest
if(!ll){
sh=cul.match(/^(\.*)/)[0].length;//get shifted dots (.)
cs=Math.min(cs+1,sh);//correct -> max one deeper
subs=cs>0&&la[cs-1]?c[la[cs-1][1]][2]:[];//get allowed subitems for this level from cfg
fi=cul.substr(sh,1);//get first char
}
if(ll||cs==0&&c.fst.contains(fi)||(subs&&subs.contains(fi))){//valid definition prefix
if(ti&&ok(ti)){//if new title exists yet & confirm overwrite, create & remember new tiddler
tids['add'].pushUnique(ti);
tids.push([ti,lash,ntgs,pr]);
store.saveTiddler(ti,ti,txt,who,when,ntgs,{});
}if(ll)break;//no more lines -> we're done
cul=cul.substr(sh,cul.length);//get rest of line
pr=fi;
ti=txt='';//reset tid title & text
ntgs=tgs.slice();//reset tid tags to global tags
pos=cul.indexOf(' ');//split at first empty
if(pos<0)continue;//only prefix -> invalid
dt=cul.substr(0,pos);//get category tag
cul=cul.substr(pos+1,cul.length);//get rest
arr=cul.split('|');//split rest by divider
ti=arr[0].trim();//first part is new title
fo=tbQA.find(dt,pr,ti);//find this tag
if(fo)ntgs.push(fo);//found? -> add tag
def=arr[1]?arr[1].readBracketedList():[];//remaining GTD tags
while(def[0]){//loop 'em
dt=def.shift().trim();//get next
fi=dt.substr(0,1);
fi=c.p.contains(fi)?fi:'';
if(fi){
fo=tbQA.find(dt,fi,ti);//find
if(fo)ntgs.push(fo);//found? -> add tag
}else{
fo='';
while(!fo&&dt){
for(t=0;t<tids['add'].length;t++){
tid=tids['add'][t];
if(tid.indexOf(dt)==0){fo=tid;break;}
}
if(!fo&&tbQA.searchAll){
for(t=0;t<tids['all'].length;t++){
tid=tids['all'][t].title;
if(tid.indexOf(dt)==0){fo=tid;break;}
}
}
if(!fo)dt=prompt(l.noMatch.format([dt],(tids['add'].length==0?'':l.justAdded.format([tids['add']]))),dt);
else ntgs.push(fo);//found? -> add tag
}
}
}
if(cs>0&&store.getTiddler(la[cs-1][0]))ntgs.pushUnique(la[cs-1][0]);//subitem -> push parent tag
la[cs]=[ti,pr];//remember new subitem title & prefix
lash=cs;//store 'last shift' value
}else txt+=cul+'\n';//add to content
}
//quick-add summary
if(tids.length==0){
if(confirm(l.none))story.displayTiddler(null,'quick-add help');
}else{
txt=l.listPrefix;
for(t=0;t<tids.length;t++){//for all added
nu=tids[t];
tgs=nu[2].map(function(t){return '<<tag [['+t+']]>>'}).join(',');
txt+='|<<tag [['+c[nu[3]][0]+']]>>|padding-right:5px;padding-left:'+(nu[1]*20+5)+'px;<<tag [['+nu[0]+']]>>|'+tgs+
'|<<tiddler scripts##deleteTiddler with: [['+nu[0]+']] [[Recent notes]] norefresh >>|\n';
}
tit='quick-add '+when.formatString('YYYY-0MM-0DD 0hh:0mm');//timestamp as summary title
store.saveTiddler(tit,tit,txt,who,when,'quickadd',{});//save summary
}
}else{//regular note
tit=this.form.title.value||when.formatString('YYYY-0MM-0DD 0hh:0mm:0ss');//entered title or timestamp
tgs.push('note');//add 'note' tag
tgs.push('excludeLists');//add 'note' tag
if(ok(tit))store.saveTiddler(tit,tit,note,who,when,tgs,{});//if ok -> save
}
this.form.note.focus();
story.refreshTiddler('Recent notes',null,true);
refreshDisplay();">
</td></tr><tr><td><textarea name='note' title='note text' rows='5' cols='60' style='height:120px;width:99%;float:right;border:1px solid #CCC;'></textarea></td><td>
</td></tr></table>
</form><div id="showNoteList" style="clear:both;width:98%;margin:2px 0 5px 0;padding:2px 1%;display:none;"></div><h1 style="padding-top:0;">Recent notes</h1></html><<tiddler 'Recent notes'>>/%
!archive
<<tiddlerList tags:"note" order:"-modified" dateFormat:"pppp" itemTemplate:"<<tiddler scripts##deleteTiddler with:'%title' 'Recent notes' norefresh $)): %link (%created) @@padding-left:2em;tags: %tags@@\n">>
!end%/<<tiddler {{
jQuery("#qNotes .button").css({'margin':'0','padding':'0','display':'block'});
jQuery("#qNotes .btn").css({'margin':'0 0 2px 0','clear':'both','z-index':'1','width':'98%','display':'block','float':'right'});
"";}}>>
/***
|Name:|QuickOpenTagPlugin|
|Description:|Changes tag links to make it easier to open tags as tiddlers|
|Version:|3.0.1 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#QuickOpenTagPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
@@color:red; ((modified for tbGTD(^mod by Tobias Beer ...optionally does not show ~QuickOpenTag-button if there are no tagging tiddlers)))@@
***/
//{{{
config.quickOpenTag = {
hideIfNoneTagging:true,
dropdownChar: "\u25be", //(document.all ? "\u25bc" : "\u25be"), // the little one doesn't work in IE?
createTagButton: function(place,tag,excludeTiddler) {
// little hack so we can do this: <<tag PrettyTagName|RealTagName>>
var splitTag = tag.split("|");
var pretty = tag;
if (splitTag.length == 2) {
tag = splitTag[1];
pretty = splitTag[0];
}
var sp = createTiddlyElement(place,"span",null,"quickopentag");
createTiddlyText(createTiddlyLink(sp,tag,false),pretty);
if(config.quickOpenTag.hideIfNoneTagging&&store.getTaggedTiddlers(tag).length==0)return; //tbGTD
var theTag = createTiddlyButton(sp,config.quickOpenTag.dropdownChar,
config.views.wikified.tag.tooltip.format([tag]),onClickTag);
theTag.setAttribute("tag",tag);
if (excludeTiddler)
theTag.setAttribute("tiddler",excludeTiddler);
return(theTag);
},
miniTagHandler: function(place,macroName,params,wikifier,paramString,tiddler) {
var tid=params[0]?params[0]:tiddler;
if (!store.getValue(tid,'nominitag')&&store.getTaggedTiddlers(tid.title).length>0) {
var theTag = createTiddlyButton(place,config.quickOpenTag.dropdownChar,
config.views.wikified.tag.tooltip.format([tid.title]),onClickTag);
theTag.setAttribute("tag",tid.title);
theTag.className = "miniTag";
}
},
allTagsHandler: function(place,macroName,params) {
var tags = store.getTags(params[0]);
var filter = params[1]; // new feature
var ul = createTiddlyElement(place,"ul");
if(tags.length == 0)
createTiddlyElement(ul,"li",null,"listTitle",this.noTags);
for(var t=0; t<tags.length; t++) {
var title = tags[t][0];
if (!filter || (title.match(new RegExp('^'+filter)))) {
var info = getTiddlyLinkInfo(title);
var theListItem =createTiddlyElement(ul,"li");
var theLink = createTiddlyLink(theListItem,tags[t][0],true);
var theCount = " (" + tags[t][1] + ")";
theLink.appendChild(document.createTextNode(theCount));
var theDropDownBtn = createTiddlyButton(theListItem," " +
config.quickOpenTag.dropdownChar,this.tooltip.format([tags[t][0]]),onClickTag);
theDropDownBtn.setAttribute("tag",tags[t][0]);
}
}
},
// todo fix these up a bit
styles: [
"/*{{{*/",
"/* created by QuickOpenTagPlugin */",
".tagglyTagged .quickopentag, .tagged .quickopentag {margin-right:1.2em; border:1px solid [[ColorPalette::TertiaryPale]]; padding:2px 0 2px 1px;}",
".quickopentag .tiddlyLink, .quickopentag a.button {padding:1px;margin:0;}",
".miniTag:hover {background:[[ColorPalette::SecondaryLight]]}",
"#displayArea .viewer .quickopentag a.button, ",
"#displayArea .viewer .quickopentag a.tiddyLink {border:0px solid [[ColorPalette::Foreground]];}",
"/*}}}*/",
""].join("\n"),
init: function() {
// we fully replace these builtins. can't hijack them easily
window.createTagButton = this.createTagButton;
config.macros.allTags.handler = this.allTagsHandler;
config.macros.miniTag = { handler: this.miniTagHandler };
config.shadowTiddlers["QuickOpenTagStyles"] = this.styles;
store.addNotification("QuickOpenTagStyles",refreshStyles);
}
}
config.quickOpenTag.init();
//}}}
/***
|''Name:''|ReminderPlugin|
|''Version:''|2.3.11 (Oct 17, 2009)|
|''Source:''|http://remindermacros.tiddlyspot.com|
|''Author:''|Jeremy Sheeley(pop1280 [at] excite [dot] com) / Modded: Tobias Beer|
|''Licence:''|[[BSD open source license]]|
|''Macros:''|reminder, showreminders, displayTiddlersWithReminders, newReminder|
|''TiddlyWiki:''|2.0+|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
@@color:red;massively modded for tbGTD! ...shrinked code| dateformat | list format + prefix@@
!Description
This plugin provides macros for tagging a date with a reminder. Use the {{{reminder}}} macro to do this.
The macros {{{showReminders}}} and {{{displayTiddlersWithReminder}}} search through all available tiddlers looking for upcoming reminders.
!Code
***/
//{{{
version.extensions.ReminderPlugin={major:2,minor:3,revision:11,date:new Date(209,10,17),source:"http://remindermacros.tiddlyspot.com/"};
//========== Configuration... modify this section to change the defaults for leadtime and display strings
config.macros["reminder"]={};
config.macros["newReminder"]={};
config.macros["showReminders"]={};
config.macros["displayTiddlersWithReminders"]={};
config.macros.reminders={
defaultLeadTime:[-365,6000],
defaultReminderMessagePrefix:"@@padding-right:5px;color:"+store.getTiddlerSlice('ColorPalette','SecondaryMid')+";''reminder:''@@",
defaultReminderMessage:"DATE ANNIVERSARY @@color:"+store.getTiddlerSlice('ColorPalette','TertiaryMid')+";(DIFF)@@@@padding:0 3px;TITLE@@",
defaultShowReminderMessagePrefix:"|noborder|k\n", //|__''when''__|__''what''__|__''tiddler''__|\n",
defaultShowReminderMessage:"|DATE ANNIVERSARY @@color:"+store.getTiddlerSlice('ColorPalette','TertiaryMid')+";(DIFF)@@|TITLE|<<tag TIDDLER>>|",
defaultAnniversaryMessage:"(DIFF)",
untitledReminder:"Untitled Reminder",
noReminderFound:"Overdue reminder? Couldn't find a match for 'TITLE' in the next LEADTIMEUPPER days.",
todayString:"Today",
tomorrowString:"Tomorrow",
ndaysString:"DIFF days",
dateFormat:"MMM. DD",
emtpyShowRemindersString:"no upcoming events",
txtRemindTip:"open a form to add a new reminder to this tiddler",
txtRemind:"remind",
txtTitle:"Please enter a title",
txtEachYear:"Every year",
txtEachMonth:"Every month",
txtEachDay:"Every day"
}
//========== Code... no need to edit below!
//holds the cache of reminders, so that we don't recompute the same reminder over again
var reminderCache={};
config.macros.showReminders.handler=function showReminders(place,macroName,params){
var lead=[0,14];
var now=new Date().getMidnight();
var r=getParamsForReminder(params);
var hasDate=r["year"]!=null||r["month"]!=null||r["day"]!=null||r["dayofweek"]!=null;
if(r["leadtime"]!=null){
lead=r["leadtime"];
//If they've entered a day, we need to make sure to find it
if(hasDate)r["leadtime"]=[-10000,10000];
}
var match=now;
if(hasDate){
var LBound=new Date().getMidnight().addDays(r["leadtime"][0]);
var UBound=new Date().getMidnight().addDays(r["leadtime"][1]);
match=findDateForReminder(r,new Date().getMidnight(),LBound,UBound);
}
var arr=findTiddlersWithReminders(match,lead,r["tag"],r["limit"]);
var el=createTiddlyElement(place,"span",null,null,null);
var msg="";
c=config.macros.reminders;
if(arr.length==0)msg+=c.emtpyShowRemindersString;
else msg+=!r["format"]||r["format"]&&!r["formatprefix"]?c.defaultShowReminderMessagePrefix:r["formatprefix"]; //tbGTD
for(var x=0;x<arr.length;x++){
var t=arr[x];
if(r["format"]!=null)t["params"]["format"]=r["format"];
else arr[x]["params"]["format"]=c.defaultShowReminderMessage;
msg+=getReminderMessageForDisplay(t["diff"],t["params"],t["matchedDate"],t["tiddler"]);
msg+="\n";
}
wikify(msg,el,null,null);
};
config.macros.displayTiddlersWithReminders.handler=function displayTiddlersWithReminders(place,macroName,params){
var now=new Date().getMidnight();
var lead=[0,14];
var r=getParamsForReminder(params);
var hasDate=r["year"]!=null||r["month"]!=null||r["day"]!=null||r["dayofweek"]!=null;
if(r["leadtime"]!=null){
lead=r["leadtime"];
//If they've entered a day, make sure to find it
if(hasDate)r["leadtime"]=[-10000,10000];
}
var match=now;
if(hasDate){
var LBound=new Date().getMidnight().addDays(r["leadtime"][0]);
var UBound=new Date().getMidnight().addDays(r["leadtime"][1]);
match=findDateForReminder(r,new Date().getMidnight(),LBound,UBound);
}
var arr=findTiddlersWithReminders(match,lead,r["tag"],r["limit"]);
for(var x=0;x<arr.length;x++)displayTiddler(null,arr[x]["tiddler"],0,null,false,false,false);
};
config.macros.reminder.handler=function reminder(place,macroName,params){
var set=config.macros.reminders;
var r=getParamsForReminder(params);
if(r["hidden"]!=null)return;
var lead=r["leadtime"];
var c=config.macros.reminders;
if(lead==null)lead=c.defaultLeadTime;
var LBound=new Date().getMidnight().addDays(lead[0]);
var UBound=new Date().getMidnight().addDays(lead[1]);
var match=findDateForReminder(r,new Date().getMidnight(),LBound,UBound);
var tid=story.findContainingTiddler(place);if(!tid)return;
var title=tid.getAttribute('tiddler');
if(match!=null){
var diff=match.getDifferenceInDays(new Date().getMidnight());
var el=createTiddlyElement(place,"span",null,set.txtRemind,null);
var msg=c.defaultReminderMessagePrefix+getReminderMessageForDisplay(diff,r,match,title);
wikify(msg,el,null,null);
}else createTiddlyElement(place,"span",null,"remind",c.noReminderFound.replace("TITLE",r["title"]).replace("LEADTIMEUPPER",lead[1]).replace("LEADTIMELOWER",lead[0]).replace("TIDDLERNAME",title).replace("TIDDLER","[["+title+"]]"));
}
config.macros.newReminder.handler=function newReminder(place,macroName,params){
var set=config.macros.reminders;
var today=new Date().getMidnight();
var out='<html><form id="addReminderForm"><select name="year"><option value="">'+set.txtEachYear+'</option>';
for(var i=0;i<5;i++)
out+='<option'+(i==0?' selected':'')+' value="'+(today.getFullYear()+i)+'">'+(today.getFullYear()+i)+'</option>';
out+='</select><select name="month"><option value="">'+set.txtEachMonth+'</option>';
for(i=0;i<12;i++)
out+='<option'+(i==today.getMonth()?' selected':'')+' value="'+(i+1)+'">'+config.messages.dates.months[i]+'</option>';
out+='</select><select name="day"><option value="">'+set.txtEachDay+'</option>';
for(i=1;i<32;i++)
out+='<option'+(i==today.getDate()?' selected':'')+' value="'+i+'">'+i+'</option>';
out+='</select><input type="text" size="25" name="title" value="'+set.txtTitle+'" onfocus="this.select();"><input type="button" value="ok" onclick="addReminderToTiddler(this.form)"></form></html>';
var panel=config.macros.slider.createSlider(place,null,set.txtRemind,set.txtRemindTip);
wikify(out,panel,null,store.getTiddler(params[1]));
}
// onclick: process input and insert reminder at 'marker'
window.addReminderToTiddler=function(form){
if(!store.getTiddler)store.getTiddler=function(title){return this.tiddlers[title];};
var title=story.findContainingTiddler(form).getAttribute('tiddler');
var tiddler=store.getTiddler(title);
var add='\n<<reminder ';
if(form.year.value!="")add+='year:'+form.year.value+' ';
if(form.month.value!="")add+='month:'+form.month.value+' ';
if(form.day.value!="")add+='day:'+form.day.value+' ';
add+='title:"'+form.title.value+'" ';
add+='>>';
tiddler.set(null,tiddler.text+add);
form.parentNode.parentNode.previousSibling.onclick(); //tbGTD: close form when done processing
story.refreshTiddler(title,1,true);
store.setDirty(true);
};
function hasTag(tags,filters){
//Make sure we respond well to empty tiddlerTaglists or tagFilterlists
if(filters.length==0||tags.length==0)return true;
var bHasTag=false;
var bNoPos=true;
for(var t3=0;t3<filters.length;t3++){
for(var t2=0;t2<tags.length;t2++){
if(filters[t3].length>1&&filters[t3].charAt(0)=='!'){
//If at any time a negative filter is matched, we return false
if(tags[t2]==filters[t3].substring(1))return false;
}else{
//We encountered the first positive filter
if(bNoPos)bNoPos=false;
//A positive filter is matched. As long as no negative filter is matched, hasTag will return true
if(tags[t2]==filters[t3])bHasTag=true;
}
}
}
return (bNoPos||bHasTag);
};
window.findTiddlersWithReminders=function findTiddlersWithReminders(base,lead,tags,limit){
var expr=new RegExp("<<(reminder)(.*)>>","mg");
var matches=store.search(expr,"title","");
var arr=[];
var arrTags=null;
//allows tags with spaces. thanks Robin Summerhill, 4-Oct-06.
if(tags!=null)arrTags=tags.readBracketedList();
for(var t=matches.length-1;t>=0;t--){
if(arrTags!=null&&!hasTag(matches[t].tags,arrTags))continue;
var targetText=matches[t].text;
do{
// Get the next formatting match
var match=expr.exec(targetText);
if(match&&match[1]!=null&&match[1].toLowerCase()=="reminder"){
//Find the matching date.
var params=match[2]!=null ? match[2].readMacroParams():{};
var r=getParamsForReminder(params);
if(limit!=null||r["leadtime"]==null){
if(lead==null)r["leadtime"]=lead;
else{
r["leadtime"]=[];
r["leadtime"][0]=lead[0];
r["leadtime"][1]=lead[1];
}
}
if(r["leadtime"]==null)r["leadtime"]=config.macros.reminders.defaultLeadTime;
var LBound=base.addDays(r["leadtime"][0]);
var UBound=base.addDays(r["leadtime"][1]);
var found=findDateForReminder(r,base,LBound,UBound);
while(found!=null){
var tmp={};
tmp["diff"]=found.getDifferenceInDays(base);
tmp["matchedDate"]=new Date(found.getFullYear(),found.getMonth(),found.getDate(),0,0);
tmp["params"]=cloneParams(r);
tmp["tiddler"]=matches[t].title;
tmp["tags"]=matches[t].tags;
arr.pushUnique(tmp);
if(r["recurdays"]!=null||(r["year"]==null)){
LBound=LBound.addDays(found.getDifferenceInDays(LBound)+ 1);
found=findDateForReminder(r,base,LBound,UBound);
}
else found=null;
}
}
}while(match);
}
//Sort the array by number of days remaining
if(arr.length>1)arr.sort(function(a,b){if(a["diff"]==b["diff"])return(0);else return a["diff"]<b["diff"]?-1:+1;});
return arr;
};
//Takes the reminder macro parameters and generates the string that is used for display ...not intended to be called by other plugins.
window.getReminderMessageForDisplay= function getReminderMessageForDisplay(diff,params,match,tid){
var c=config.macros.reminders;
var anniv="";
var reminderTitle=params["title"];
if(reminderTitle==null)reminderTitle=c.untitledReminder;
if(params["firstyear"]!=null)anniv=c.defaultAnniversaryMessage.replace("DIFF",(match.getFullYear()-params["firstyear"]));
var sDiff="";
if(diff==0)sDiff=c.todayString;
else if(diff==1)sDiff=c.tomorrowString;
else sDiff=c.ndaysString.replace("DIFF",diff);
msg=params["format"]!=null?params["format"]:c.defaultReminderMessage;
msg=msg.replace(/TIDDLER/g,"TIDELER"); //Avoid replacing DD in TIDDLER with the date
msg=match.formatStringDateOnly(msg);
msg=msg.replace(/TIDELER/g,"TIDDLER");
if(tid!=null){
msg=msg.replace(/TIDDLERNAME/g,tid);
msg=msg.replace(/TIDDLER/g,"[["+tid+"]]");
}
msg=msg.replace("DIFF",sDiff).replace("TITLE",reminderTitle).replace("DATE",match.formatString("mmm. 0DD")).replace("ANNIVERSARY",anniv);
return msg;
};
// Parse macro params into a hashtable. This handles the arguments for reminder, showReminders and displayTiddlersWithReminders
window.getParamsForReminder=function getParamsForReminder(params){
var r={};
var type="";
var num=0;
var title="";
for(var p=0;p<params.length;p++){
var split=params[p].split(":");
type=split[0].toLowerCase();
var value=split[1];
for(var i=2;i<split.length;i++)value+=":"+split[i];
if(type=="nolinks"||type=="limit"||type=="hidden")num=1;
else if(type=="leadtime"){
var leads=value.split("...");
if(leads.length==1){leads[1]=leads[0];leads[0]=0;}
leads[0]=parseInt(leads[0],10);
leads[1]=parseInt(leads[1],10);
num=leads;
}
else if(type=="offsetdayofweek"){
if(value.substr(0,1)=="-"){r["negativeOffsetDayOfWeek"]=1;value=value.substr(1);}
num=parseInt(value,10);
}
else if(type!="title"&&type!="tag"&&type!="format")num=parseInt(value,10);
else{
p++;
title=value;
while(title.substr(0,1)=='"'&&title.substr(title.length-1,1)!='"'&¶ms[p]!=undefined)title+= " "+params[p++];
//Trim off the leading and trailing quotes
if(title.substr(0,1)=="\""&&title.substr(title.length-1,1)== "\""){
title=title.substr(1,title.length-2);
p--;
}
num=title;
}
r[type]=num;
}
//date is synonymous with day
if(r["day"]==null)r["day"]=r["date"];
return r;
};
//Finds the date specified in the reminder params; returns null if no match found; not intended for use by other plugins
window.findDateForReminder= function findDateForReminder(r,base,LBound,UBound){
if(base==null)base=new Date().getMidnight();
var key=base.convertToYYYYMMDDHHMM();
for(var k in r)key+=","+k+"|"+r[k];
key+=","+LBound.convertToYYYYMMDDHHMM();
key+=","+UBound.convertToYYYYMMDDHHMM();
//If we don't find a match in this run, then cache that the reminder can't be matched
if(reminderCache[key]==null)reminderCache[key]=false;
//We've already tried this date and failed
else if(reminderCache[key]==false)return null;
else return reminderCache[key];
var bOffsetSpecified=
r["offsetyear"]!=null||
r["offsetmonth"]!=null||
r["offsetday"]!=null||
r["offsetdayofweek"]!=null||
r["recurdays"]!=null;
// If matching the base date for a dayofweek offset, look for the base date a little further back.
var tmp1LBound=LBound;
if(r["offsetdayofweek"]!=null)tmp1LBound=LBound.addDays(-6);
var match=base.findMatch(r,tmp1LBound,UBound);
if(match!=null){
var newMatch=match;
if(r["recurdays"]!=null)
while(newMatch.getTime()<LBound.getTime())newMatch=newMatch.addDays(r["recurdays"]);
else if(
r["offsetyear"]!=null||
r["offsetmonth"]!=null||
r["offsetday"]!=null||
r["offsetdayofweek"]!=null){
var tmp=cloneParams(r);
tmp["year"]=r["offsetyear"];
tmp["month"]=r["offsetmonth"];
tmp["day"]=r["offsetday"];
tmp["dayofweek"]=r["offsetdayofweek"];
var tmpL=LBound;
var tmpU=UBound;
if(tmp["offsetdayofweek"]!=null){
if(tmp["negativeOffsetDayOfWeek"]==1){
tmpL=match.addDays(-6);
tmpU=match;
}else{
tmpL=match;
tmpU=match.addDays(6);
}
}
newMatch=match.findMatch(tmp,tmpL,tmpU);
//The offset couldn't be matched. return null.
if(newMatch==null)return null;
}
if(newMatch.isBetween(LBound,UBound)){
reminderCache[key]=newMatch;
return newMatch;
}
}
return null;
};
//Does the same job as findDateForReminder, but doesn't deal with offsets or recurring reminders.
Date.prototype.findMatch=function findMatch(r,LBound,UBound){
var Y=(r["year"]!=null);
var M=(r["month"]!=null);
var D=(r["day"]!=null);
var W=(r["dayofweek"]!=null);
if(D&&M&&Y)return new Date(r["year"],r["month"]-1,r["day"],0,0);
if(D&&M&&!Y&&!W){
//Shortcut: first try this year... if too small, try next year
var tmp=new Date(this.getFullYear(),r["month"]-1,r["day"],0,0);
if(tmp.getTime()<LBound.getTime())tmp=new Date((this.getFullYear()+1),r["month"]-1,r["day"],0,0);
if(tmp.isBetween(LBound,UBound))return tmp;
else return null;
}
var newDate=LBound;
while(newDate.isBetween(LBound,UBound)){
var test=testDate(newDate,r,Y,M,D,W);
if(test!=null)return test;
newDate=newDate.addDays(1);
}
}
function cloneParams(p){var tmp={};for(var i in p)tmp[i]=p[i];return tmp;}
function testDate(str,d,Y,M,D,W){if((!Y&&d["year"]==str.getFullYear())&&(!M&&(d["month"]-1)==str.getMonth())&&(!D&&d["day"]==str.getDate())&&(!W&&d["dayofweek"]==str.getDay())) return str;}
//Returns true if the date is in between two given dates
Date.prototype.isBetween=function isBetween(lowerBound,upperBound){return(this.getTime()>=lowerBound.getTime()&&this.getTime()<=upperBound.getTime());}
//Return a new date, with the time set to midnight (0000)
Date.prototype.getMidnight=function getMidnight(){return new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0);}
//Add the specified number of days to a date
Date.prototype.addDays=function addDays(numberOfDays){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+numberOfDays,0,0);}
//Return the number of days between two dates
Date.prototype.getDifferenceInDays=function getDifferenceInDays(d){
//ignores daylight savings
var tmp=this.addDays(0);
if(this.getTime()>d.getTime()){for(var i=0;tmp.getTime()>d.getTime();i++)tmp=tmp.addDays(-1);return i;}
else{for(var i=0;tmp.getTime()<d.getTime();i++)tmp=tmp.addDays(1);return i*-1;}
return 0;
}
//Substitute date components into a string
Date.prototype.formatStringDateOnly=function formatStringDateOnly(d){
d=d.replace("YYYY",this.getFullYear());
d=d.replace("YY",String.zeroPad(this.getFullYear()-2000,2));
d=d.replace("MMM",config.messages.dates.months[this.getMonth()]);
d=d.replace("0MM",String.zeroPad(this.getMonth()+1,2));
d=d.replace("MM",this.getMonth()+1);
d=d.replace("DDD",config.messages.dates.days[this.getDay()]);
d=d.replace("0DD",String.zeroPad(this.getDate(),2));
d=d.replace("DD",this.getDate());
return d;
};
//}}}
/***
|Name:|RenameTagsPlugin|
|Description:|Allows you to easily rename or delete tags across multiple tiddlers|
|Version:|3.0 ($Rev: 3861 $)|
|Date:|$Date: 2008-03-08 10:53:09 +1000 (Sat, 08 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#RenameTagsPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License|http://mptw.tiddlyspot.com/#TheBSDLicense|
Rename a tag and you will be prompted to rename it in all its tagged tiddlers.
***/
//{{{
config.renameTags = {
prompts: {
rename: "Rename the tag '%0' to '%1' in %2 tidder%3?",
remove: "Remove the tag '%0' from %1 tidder%2?"
},
removeTag: function(tag,tiddlers) {
store.suspendNotifications();
for (var i=0;i<tiddlers.length;i++) {
store.setTiddlerTag(tiddlers[i].title,false,tag);
}
store.resumeNotifications();
store.notifyAll();
},
renameTag: function(oldTag,newTag,tiddlers) {
store.suspendNotifications();
for (var i=0;i<tiddlers.length;i++) {
store.setTiddlerTag(tiddlers[i].title,false,oldTag); // remove old
store.setTiddlerTag(tiddlers[i].title,true,newTag); // add new
}
store.resumeNotifications();
store.notifyAll();
},
storeMethods: {
saveTiddler_orig_renameTags: TiddlyWiki.prototype.saveTiddler,
saveTiddler: function(title,newTitle,newBody,modifier,modified,tags,fields) {
if (title != newTitle) {
var tagged = this.getTaggedTiddlers(title);
if (tagged.length > 0) {
// then we are renaming a tag
if (confirm(config.renameTags.prompts.rename.format([title,newTitle,tagged.length,tagged.length>1?"s":""])))
config.renameTags.renameTag(title,newTitle,tagged);
if (!this.tiddlerExists(title) && newBody == "")
// dont create unwanted tiddler
return null;
}
}
return this.saveTiddler_orig_renameTags(title,newTitle,newBody,modifier,modified,tags,fields);
},
removeTiddler_orig_renameTags: TiddlyWiki.prototype.removeTiddler,
removeTiddler: function(title) {
var tagged = this.getTaggedTiddlers(title);
if (tagged.length > 0)
if (confirm(config.renameTags.prompts.remove.format([title,tagged.length,tagged.length>1?"s":""])))
config.renameTags.removeTag(title,tagged);
return this.removeTiddler_orig_renameTags(title);
}
},
init: function() {
merge(TiddlyWiki.prototype,this.storeMethods);
}
}
config.renameTags.init();
//}}}
<script>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var size=store.getTiddlerText(title).length;
return size+" bytes";
</script>
{{black{
<<calendar thismonth>>
}}}
<<tabs txtMainTab tags "list of tags" TagCloud recent "list tiddlers by date" SideBarTabs##recent toc "browse tiddlers" SideBarTabs##all more "standard lists and more" TabMore>>/%
!recent
{{recent{<<timeline "created" "17" "YYYY-0MM-0DD">>
----
@@padding-left:10px;[[::complete timeline::|timeline]]@@}}}
!all
<<tableOfContents "label:browse tiddlers..." sort:title width:100% size:20 date:YYYY-0MM-0DD>>
----
@@padding-left:10px;[[::alphabetical list::|TabAll]]@@
!end%/
/***
|''Name''|SimpleSearchPlugin|
|''Description''|displays search results as a simple list of matching tiddlers|
|''Authors''|FND|
|''Version''|0.4.1|
|''Status''|stable|
|''Source''|http://devpad.tiddlyspot.com/#SimpleSearchPlugin|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Keywords''|search|
!Code
***/
//{{{
if(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.SimpleSearchPlugin = { installed: true };
if(!config.extensions) { config.extensions = {}; }
config.extensions.SimpleSearchPlugin = {
heading: "Search Results",
containerId: "searchResults",
btnCloseLabel: "close",
btnCloseTooltip: "dismiss search results",
btnCloseId: "search_close",
btnOpenLabel: "open all",
btnOpenTooltip: "open all search results",
btnOpenId: "search_open",
displayResults: function(matches, query) {
story.refreshAllTiddlers(true); // update highlighting within story tiddlers
var el = document.getElementById(this.containerId);
query = '"""' + query + '"""'; // prevent WikiLinks
if(el) {
removeChildren(el);
} else { //# fallback: use displayArea as parent
var container = document.getElementById("displayArea");
el = document.createElement("div");
el.id = this.containerId;
el = container.insertBefore(el, container.firstChild);
}
var msg = "!" + this.heading + "\n";
if(matches.length > 0) {
msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n";
this.results = [];
for(var i = 0 ; i < matches.length; i++) {
this.results.push(matches[i].title);
msg += "* [[" + matches[i].title + "]]\n";
}
} else {
msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?
}
createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.SimpleSearchPlugin.closeResults, "button", this.btnCloseId);
if(matches.length > 0) { // XXX: redundant!?
createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.SimpleSearchPlugin.openAll, "button", this.btnOpenId);
}
wikify(msg, el);
},
closeResults: function() {
var el = document.getElementById(config.extensions.SimpleSearchPlugin.containerId);
removeNode(el);
config.extensions.SimpleSearchPlugin.results = null;
highlightHack = null;
},
openAll: function(ev) {
story.displayTiddlers(null, config.extensions.SimpleSearchPlugin.results);
return false;
}
};
// override Story.search()
Story.prototype.search = function(text, useCaseSensitive, useRegExp) {
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack, null, "excludeSearch");
var q = useRegExp ? "/" : "'";
config.extensions.SimpleSearchPlugin.displayResults(matches, q + text + q);
};
// override TiddlyWiki.search() to sort by relevance
TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {
var candidates = this.reverseLookup("tags", excludeTag, !!match);
var primary = [];
var secondary = [];
var tertiary = [];
for(var t = 0; t < candidates.length; t++) {
if(candidates[t].title.search(searchRegExp) != -1) {
primary.push(candidates[t]);
} else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {
secondary.push(candidates[t]);
} else if(candidates[t].text.search(searchRegExp) != -1) {
tertiary.push(candidates[t]);
}
}
var results = primary.concat(secondary).concat(tertiary);
if(sortField) {
results.sort(function(a, b) {
return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);
});
}
return results;
};
} //# end of "install only once"
//}}}
|tblSITE|k
|width:200px;padding:0.5em;font-size:2em;SiteTitle|>|>|>|font-size:1.1em;padding-top:1em;SiteSubtitle @@padding-left:7%;[[topMenuL]]@@@@padding-left:15%;[[topMenuR]]@@|
|{{floatleft{@@padding-left:10px;font-size:0.9em;font-weight:bold;display:inline;<<tiddler topMenuL>>@@}}}{{floatright{@@text-align:right;font-size:0.9em;font-weight:bold;display:inline;<<tiddler topMenuR>>@@}}}|>|>|>|>|
|width:10%;padding:0;text-align:left; @@font-weight:bold;font-size:1.2em;padding-left:15px;[[MainMenu]]@@<br/>@@display:block;margin-top:10px;padding:0;<<tiddler MainMenu>>@@|>|>|border-bottom:1px solid #333;background:#444;color:#111;width:60%;height:15px;padding:2px 2px 0 2px;{{tblLAYOUTMID{@@background:#eee;[[TiddlersBar|TiddlersBarPlugin]]@@}}} |width:20%; <<tiddler SiteLayout##Sidebar>> |
|~|~|background:#EEE;color:#111;height:150px;text-align:center;padding-top:10px; {{tblLAYOUTMID{<<tiddler SiteLayout##Tiddlers>>}}}|>|~|
|>|>|>|>| |
/%
!Tiddlers
@@display:block;position:relative;left:-40%;top:0px;Tiddler viewer@@@@display:block;position:relative;right:-22%;top:-15px; [[x-tab]] / [[x-plore]] / [[x-tag|x-tagger]] / [[ToolbarCommands]]@@
@@font-size:1.5em;color:#999;displayArea / tiddlerDisplay@@
@@display:block;margin-top:15px;font-size:2em;[[tbGtdTheme]] / <<tag site>>@@
@@display:block;margin-top:5px;font-size:1em;[[StyleSheet]] / [[StyleSheetShortcuts]]@@
!Sidebar
@@display:block;width:100%;height:50px;padding-right:0%;padding-top:10px;[[SideBarOptions]]<br/>[[calendar]]@@@@display:block;margin-top:5px;width:100%;height:150px;SideBarTabs<br /><<tiddler SiteLayout##Tabs>>@@
!Tabs
@@display:block;text-align:left;font-size:0.9em;padding:5px;background:#555;height:100px;[[tags|TagCloud]]|[[recent|TabTimeline]]|[[toc|SideBarTabs]]|[[more|TabMore]]<br>[[tags|TabTags]]|[[plug|systemConfig]]|[[miss|TabMoreMissing]]|[[orph|TabMoreOrphans]]|[[shad|TabMoreShadowed]]|[[ex|excludeLists]]<br /><br />{{medium{[[TagCloud]]}}}@@
!End%/
<<tiddler {{
var s='.tblSITE, .tblSITE thead, .tblSITE tr, .tblSITE td{border:0;color:white;background:#333;}'+
'.tblSITE a,.tblSITE a.tiddlyLink, .tblSITE a.button{color:#EEE;border-color:transparent;font-weight:bold;padding:0 3px;font-style:normal;}'+
'.tblSITE a:hover,.tblSITE a.tiddlyLink:hover, .tblSITE a.button:hover{color:#39F;border-color:transparent;background:transparent;}'+
'.tblSITE{-moz-border-radius:5px; -webkit-border-radius:5px;}'+
'.tblSITE ul, .tblSITE li{list-style-type:none;}'+
'.tblLAYOUTMID a.tiddlyLink{color:#111;}';
setStylesheet(s,'StyleSheetSiteLayout');
'';}}>>
Windows event log parser in Python
[[PyEVT(x)|Blog Archive]]
Hey.
I wish to build application for my need to automatically monitor log and perform predefined actions. I could choose from two ways how to obtain logs: WMI or direct log parsing. WMI works good, but it's slow. Direct file parsing need an engine to parse EVT files. After some research I have [[found|evtFileStructure]] some information about evt file structure. Also [[here|http://www.tzworks.net/prototype_page.php?proto_id=4]] you can get application to parse evt and evtx files. I will be using them to write my own open source parser engine.
At first I will try to create EVT parser class in python. EVT files is easier to parse. Later I will do my best to create class for EVTX file parsing. Will try to release my job as ''D''ynamic-''L''ink ''L''ibrary ([[dll|http://en.wikipedia.org/wiki/Dynamic-link_library]])
You may ask why. Because I can! And because I believe in open source
[[StyleSheetShortcuts]][[StyleSheetSyntaxHighlighter]]
/***
|Name|StyleSheetShortcuts|
|Source|http://www.TiddlyTools.com/#StyleSheetShortcuts|
|Version||
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|CSS|
|Description|'convenience' classes for common formatting, alignment, boxes, tables, etc.|
These 'style tweaks' can be easily included in other stylesheet tiddler so they can share a baseline look-and-feel that can then be customized to create a wide variety of 'flavors'.
***/
/*{{{*/
/* text alignments */
.left
{ display:block;text-align:left; }
.center
{ display:block;text-align:center; }
.center table
{ margin:auto !important; }
.right
{ display:block;text-align:right; }
.justify
{ display:block;text-align:justify; }
.indent
{ display:block;margin:0;padding:0;border:0;margin-left:2em; }
.floatleft
{ float:left; }
.floatright
{ float:right; }
.valignTop, .valignTop table, .valignTop tbody, .valignTop th, .valignTop tr, .valignTop td
{ vertical-align:top; }
.valignBottom, .valignBottom table, .valignBottom tbody, .valignBottom th, .valignBottom tr, .valignBottom td
{ vertical-align:bottom; }
.clear
{ clear:both; }
.wrap
{ white-space:normal; }
.nowrap
{ white-space:nowrap; }
.hidden
{ display:none; }
.show
{ display:inline !important; }
.span
{ display:span; }
.block
{ display:block; }
.relative
{ position:relative; }
.absolute
{ position:absolute; }
/* font sizes */
.big
{ font-size:14pt;line-height:120% }
.medium
{ font-size:12pt;line-height:120% }
.normal
{ font-size:9pt;line-height:120% }
.small
{ font-size:8pt;line-height:120% }
.fine
{ font-size:7pt;line-height:120% }
.tiny
{ font-size:6pt;line-height:120% }
.larger
{ font-size:120%; }
.smaller
{ font-size:80%; }
/* font styles */
.bold
{ font-weight:bold; }
.italic
{ font-style:italic; }
.underline
{ text-decoration:underline; }
/* plain list items (no bullets or indent) */
.nobullets li { list-style-type: none; margin-left:-2em; }
/* multi-column tiddler content (not supported in Internet Explorer) */
.twocolumns { display:block;
-moz-column-count:2; -moz-column-gap:1em; -moz-column-width:50%; /* FireFox */
-webkit-column-count:2; -webkit-column-gap:1em; -webkit-column-width:50%; /* Safari */
column-count:2; column-gap:1em; column-width:50%; /* Opera */
}
.threecolumns { display:block;
-moz-column-count:3; -moz-column-gap:1em; -moz-column-width:33%; /* FireFox */
-webkit-column-count:3; -webkit-column-gap:1em; -webkit-column-width:33%; /* Safari */
column-count:3; column-gap:1em; column-width:33%; /* Opera */
}
.fourcolumns { display:block;
-moz-column-count:4; -moz-column-gap:1em; -moz-column-width:25%; /* FireFox */
-webkit-column-count:4; -webkit-column-gap:1em; -webkit-column-width:25%; /* Safari */
column-count:4; column-gap:1em; column-width:25%; /* Opera */
}
/* page breaks */
.breakbefore { page-break-before:always; }
.breakafter { page-break-before:always; }
/* show/hide browser-specific content for InternetExplorer vs. non-IE ("moz") browsers */
*[class="ieOnly"]
{ display:none; } /* hide in moz (uses CSS selector) */
* html .mozOnly, *:first-child+html .mozOnly
{ display: none; } /* hide in IE (uses IE6/IE7 CSS hacks) */
/* borderless tables */
.borderless, .borderless table, .borderless td, .borderless tr, .borderless th, .borderless tbody
{ border:0 !important; margin:0 !important; padding:0 !important; }
.widetable, .widetable table
{ width:100%; }
/* thumbnail images (fixed-sized scaled images) */
.thumbnail img { height:5em !important; }
/* stretchable images (auto-size to fit tiddler) */
.stretch img { width:95%; }
/* grouped content */
.outline
{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; }
.menubox
{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#fff; color:#000; }
.menubox .button, .menubox .tiddlyLinkExisting, .menubox .tiddlyLinkNonExisting
{ color:#009 !important; }
.groupbox
{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#ffe; color:#000; }
.groupbox a, .groupbox .button, .groupbox .tiddlyLinkExisting, .groupbox .tiddlyLinkNonExisting
{ color:#009 !important; }
.groupbox code
{ color:#333 !important; }
.borderleft
{ margin:0;padding:0;border:0;margin-left:1em; border-left:1px dotted; padding-left:.5em; }
.borderright
{ margin:0;padding:0;border:0;margin-right:1em; border-right:1px dotted; padding-right:.5em; }
.borderbottom
{ margin:0;padding:1px 0;border:0;border-bottom:1px dotted; margin-bottom:1px; padding-bottom:1px; }
.bordertop
{ margin:0;padding:0;border:0;border-top:1px dotted; margin-top:1px; padding-top:1px; }
/* scrolled content */
.scrollbars { overflow:auto; }
.height10em { height:10em; }
.height15em { height:15em; }
.height20em { height:20em; }
.height25em { height:25em; }
.height30em { height:30em; }
.height35em { height:35em; }
.height40em { height:40em; }
/* compact form */
.smallform
{ white-space:nowrap; }
.smallform input, .smallform textarea, .smallform button, .smallform checkbox, .smallform radio, .smallform select
{ font-size:8pt; }
/* stretchable edit fields and textareas (auto-size to fit tiddler) */
.stretch input { width:99%; }
.stretch textarea { width:99%; }
/* compact input fields (limited to a few characters for entering percentages and other small values) */
.onechar input { width:1em; }
.twochar input { width:2em; }
.threechar input { width:3em; }
.fourchar input { width:4em; }
.fivechar input { width:5em; }
/* text colors */
.white { color:#fff !important }
.gray { color:#999 !important }
.black { color:#000 !important }
.red { color:#f66 !important }
.green { color:#0c0 !important }
.blue { color:#99f !important }
/* rollover highlighting */
.mouseover
{color:[[ColorPalette::TertiaryLight]] !important;}
.mouseover a
{color:[[ColorPalette::TertiaryLight]] !important;}
.selected .mouseover
{color:[[ColorPalette::Foreground]] !important;}
.selected .mouseover .button, .selected .mouseover a
{color:[[ColorPalette::PrimaryDark]] !important;}
/* rollover zoom text */
.zoomover
{ font-size:80% !important; }
.selected .zoomover
{ font-size:100% !important; }
.BG{color:[[ColorPalette::Background]];}
.FG{color:[[ColorPalette::Foreground]];}
.PP{color:[[ColorPalette::PrimaryPale]];}
.PL{color:[[ColorPalette::PrimaryLight]];}
.PM{color:[[ColorPalette::PrimaryMid]];}
.PD{color:[[ColorPalette::PrimaryDark]];}
.SP{color:[[ColorPalette::SecondaryPale]];}
.SL{color:[[ColorPalette::SecondaryLight]];}
.SM{color:[[ColorPalette::SecondaryMid]];}
.SD{color:[[ColorPalette::SecondaryDark]];}
.TP{color:[[ColorPalette::TertiaryPale]];}
.TL{color:[[ColorPalette::TertiaryLight]];}
.TM{color:[[ColorPalette::TertiaryMid]];}
.TD{color:[[ColorPalette::TertiaryDark]];}
.Err{color:[[ColorPalette::Error]];}
.bgBG{background-color:[[ColorPalette::Background]];}
.bgFG{background-color:[[ColorPalette::Foreground]];}
.bgPP{background-color:[[ColorPalette::PrimaryPale]];}
.bgPL{background-color:[[ColorPalette::PrimaryLight]];}
.bgPM{background-color:[[ColorPalette::PrimaryMid]];}
.bgPD{background-color:[[ColorPalette::PrimaryDark]];}
.bgSP{background-color:[[ColorPalette::SecondaryPale]];}
.bgSL{background-color:[[ColorPalette::SecondaryLight]];}
.bgSM{background-color:[[ColorPalette::SecondaryMid]];}
.bgSD{background-color:[[ColorPalette::SecondaryDark]];}
.bgTP{background-color:[[ColorPalette::TertiaryPale]];}
.bgTL{background-color:[[ColorPalette::TertiaryLight]];}
.bgTM{background-color:[[ColorPalette::TertiaryMid]];}
.bgTD{background-color:[[ColorPalette::TertiaryDark]];}
.bgErr{background-color:[[ColorPalette::Error]];}
/*}}}*/
/***
StyleSheet for ~SyntaxHighlighter
***/
/*{{{*/
.dp-highlighter
{
font-family: "Consolas", "Courier New", Courier, mono, serif;
font-size: 12px;
background-color: #E7E5DC;
width: 99%;
overflow: auto;
margin: 18px 0 18px 0 !important;
padding-top: 1px; /* adds a little border on top when controls are hidden */
}
/* clear styles */
.dp-highlighter ol,
.dp-highlighter ol li,
.dp-highlighter ol li span
{
margin: 0;
padding: 0;
border: none;
}
.dp-highlighter a,
.dp-highlighter a:hover
{
background: none;
border: none;
padding: 0;
margin: 0;
}
.dp-highlighter .bar
{
padding-left: 45px;
}
.dp-highlighter.collapsed .bar,
.dp-highlighter.nogutter .bar
{
padding-left: 0px;
}
.dp-highlighter ol
{
list-style: decimal; /* for ie */
background-color: #fff;
margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
padding: 0px;
color: #5C5C5C;
}
.dp-highlighter.nogutter ol,
.dp-highlighter.nogutter ol li
{
list-style: none !important;
margin-left: 0px !important;
}
.dp-highlighter ol li,
.dp-highlighter .columns div
{
list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
list-style-position: outside !important;
border-left: 3px solid #6CE26C;
background-color: #F8F8F8;
color: #5C5C5C;
padding: 0 3px 0 10px !important;
margin: 0 !important;
line-height: 14px;
}
.dp-highlighter.nogutter ol li,
.dp-highlighter.nogutter .columns div
{
border: 0;
}
.dp-highlighter .columns
{
background-color: #F8F8F8;
color: gray;
overflow: hidden;
width: 100%;
}
.dp-highlighter .columns div
{
padding-bottom: 5px;
}
.dp-highlighter ol li.alt
{
background-color: #FFF;
color: inherit;
}
.dp-highlighter ol li span
{
color: black;
background-color: inherit;
}
/* Adjust some properties when collapsed */
.dp-highlighter.collapsed ol
{
margin: 0px;
}
.dp-highlighter.collapsed ol li
{
display: none;
}
/* Additional modifications when in print-view */
.dp-highlighter.printing
{
border: none;
}
.dp-highlighter.printing .tools
{
display: none !important;
}
.dp-highlighter.printing li
{
display: list-item !important;
}
/* Styles for the tools */
.dp-highlighter .tools
{
padding: 3px 8px 3px 10px;
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: silver;
background-color: #f8f8f8;
padding-bottom: 10px;
border-left: 3px solid #6CE26C;
}
.dp-highlighter.nogutter .tools
{
border-left: 0;
}
.dp-highlighter.collapsed .tools
{
border-bottom: 0;
}
.dp-highlighter .tools a
{
font-size: 9px;
color: #a0a0a0;
background-color: inherit;
text-decoration: none;
margin-right: 10px;
}
.dp-highlighter .tools a:hover
{
color: red;
background-color: inherit;
text-decoration: underline;
}
/* About dialog styles */
.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
.dp-about td { padding: 10px; vertical-align: top; }
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
.dp-about .para { margin: 0 0 4px 0; }
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
/* Language specific styles */
.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
.dp-highlighter .string { color: blue; background-color: inherit; }
.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
/*}}}*/
/***
!Metadata:
|''Name:''|SyntaxHighlighterPlugin|
|''Description:''|Code Syntax Highlighter Plugin for TiddlyWiki.|
|''Version:''|1.1.3|
|''Date:''|Oct 24, 2008|
|''Source:''|http://www.coolcode.cn/show-310-1.html|
|''Author:''|Ma Bingyao (andot (at) ujn (dot) edu (dot) cn)|
|''License:''|[[GNU Lesser General Public License|http://www.gnu.org/licenses/lgpl.txt]]|
|''~CoreVersion:''|2.4.1|
|''Browser:''|Firefox 1.5+; InternetExplorer 6.0; Safari; Opera; Chrome; etc.|
!Syntax:
{{{
<code options>
codes
</code>
}}}
!Examples:
{{{
<code java>
public class HelloWorld {
public static void main(String args[]) {
System.out.println("HelloWorld!");
}
}
</code>
}}}
!Revision History:
|''Version''|''Date''|''Note''|
|1.1.2|Oct 15, 2008|Optimize Highlight|
|1.0.0|Oct 13, 2008|Initial release|
!Code section:
***/
//{{{
var dp={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:"<html><head><title>About...</title></head><body class=\"dp-about\"><table cellspacing=\"0\"><tr><td class=\"copy\"><p class=\"title\">dp.SyntaxHighlighter</div><div class=\"para\">Version: {V}</p><p><a href=\"http://www.dreamprojections.com/syntaxhighlighter/?ref=about\" target=\"_blank\">http://www.dreamprojections.com/syntaxhighlighter</a></p>©2004-2007 Alex Gorbatchev.</td></tr><tr><td class=\"footer\"><input type=\"button\" class=\"close\" value=\"OK\" onClick=\"window.close()\"/></td></tr></table></body></html>"},ClipboardSwf:null,Version:"1.5.1"}};dp.SyntaxHighlighter=dp.sh;dp.sh.Toolbar.Commands={ExpandSource:{label:"+ expand source",check:function($){return $.collapse},func:function($,_){$.parentNode.removeChild($);_.div.className=_.div.className.replace("collapsed","")}},ViewSource:{label:"view plain",func:function($,_){var A=dp.sh.Utils.FixForBlogger(_.originalCode).replace(/</g,"<"),B=window.open("","_blank","width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=0");B.document.write("<textarea style=\"width:99%;height:99%\">"+A+"</textarea>");B.document.close()}},CopyToClipboard:{label:"copy to clipboard",check:function(){return window.clipboardData!=null||dp.sh.ClipboardSwf!=null},func:function($,A){var B=dp.sh.Utils.FixForBlogger(A.originalCode).replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");if(window.clipboardData)window.clipboardData.setData("text",B);else if(dp.sh.ClipboardSwf!=null){var _=A.flashCopier;if(_==null){_=document.createElement("div");A.flashCopier=_;A.div.appendChild(_)}_.innerHTML="<embed src=\""+dp.sh.ClipboardSwf+"\" FlashVars=\"clipboard="+encodeURIComponent(B)+"\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>"}alert("The code is in your clipboard now")}},PrintSource:{label:"print",func:function($,B){var _=document.createElement("IFRAME"),A=null;_.style.cssText="position:absolute;width:0px;height:0px;left:-500px;top:-500px;";document.body.appendChild(_);A=_.contentWindow.document;dp.sh.Utils.CopyStyles(A,window.document);A.write("<div class=\""+B.div.className.replace("collapsed","")+" printing\">"+B.div.innerHTML+"</div>");A.close();_.contentWindow.focus();_.contentWindow.print();alert("Printing...");document.body.removeChild(_)}},About:{label:"?",func:function(_){var A=window.open("","_blank","dialog,width=300,height=150,scrollbars=0"),$=A.document;dp.sh.Utils.CopyStyles($,window.document);$.write(dp.sh.Strings.AboutDialog.replace("{V}",dp.sh.Version));$.close();A.focus()}}};dp.sh.Toolbar.Create=function(B){var A=document.createElement("DIV");A.className="tools";for(var _ in dp.sh.Toolbar.Commands){var $=dp.sh.Toolbar.Commands[_];if($.check!=null&&!$.check(B))continue;A.innerHTML+="<a href=\"#\" onclick=\"dp.sh.Toolbar.Command('"+_+"',this);return false;\">"+$.label+"</a>"}return A};dp.sh.Toolbar.Command=function(_,$){var A=$;while(A!=null&&A.className.indexOf("dp-highlighter")==-1)A=A.parentNode;if(A!=null)dp.sh.Toolbar.Commands[_].func($,A.highlighter)};dp.sh.Utils.CopyStyles=function(A,_){var $=_.getElementsByTagName("link");for(var B=0;B<$.length;B++)if($[B].rel.toLowerCase()=="stylesheet")A.write("<link type=\"text/css\" rel=\"stylesheet\" href=\""+$[B].href+"\"></link>")};dp.sh.Utils.FixForBlogger=function($){return(dp.sh.isBloggerMode==true)?$.replace(/<br\s*\/?>|<br\s*\/?>/gi,"\n"):$};dp.sh.RegexLib={MultiLineCComments:new RegExp("/\\*[\\s\\S]*?\\*/","gm"),SingleLineCComments:new RegExp("//.*$","gm"),SingleLinePerlComments:new RegExp("#.*$","gm"),DoubleQuotedString:new RegExp("\"(?:\\.|(\\\\\\\")|[^\\\"\"\\n])*\"","g"),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'","g")};dp.sh.Match=function(_,$,A){this.value=_;this.index=$;this.length=_.length;this.css=A};dp.sh.Highlighter=function(){this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true};dp.sh.Highlighter.SortCallback=function($,_){if($.index<_.index)return-1;else if($.index>_.index)return 1;else if($.length<_.length)return-1;else if($.length>_.length)return 1;return 0};dp.sh.Highlighter.prototype.CreateElement=function(_){var $=document.createElement(_);$.highlighter=this;return $};dp.sh.Highlighter.prototype.GetMatches=function(_,B){var $=0,A=null;while((A=_.exec(this.code))!=null)this.matches[this.matches.length]=new dp.sh.Match(A[0],A.index,B)};dp.sh.Highlighter.prototype.AddBit=function($,A){if($==null||$.length==0)return;var C=this.CreateElement("SPAN");$=$.replace(/ /g," ");$=$.replace(/</g,"<");$=$.replace(/\n/gm," <br>");if(A!=null){if((/br/gi).test($)){var _=$.split(" <br>");for(var B=0;B<_.length;B++){C=this.CreateElement("SPAN");C.className=A;C.innerHTML=_[B];this.div.appendChild(C);if(B+1<_.length)this.div.appendChild(this.CreateElement("BR"))}}else{C.className=A;C.innerHTML=$;this.div.appendChild(C)}}else{C.innerHTML=$;this.div.appendChild(C)}};dp.sh.Highlighter.prototype.IsInside=function(_){if(_==null||_.length==0)return false;for(var A=0;A<this.matches.length;A++){var $=this.matches[A];if($==null)continue;if((_.index>$.index)&&(_.index<$.index+$.length))return true}return false};dp.sh.Highlighter.prototype.ProcessRegexList=function(){for(var $=0;$<this.regexList.length;$++)this.GetMatches(this.regexList[$].regex,this.regexList[$].css)};dp.sh.Highlighter.prototype.ProcessSmartTabs=function(E){var B=E.split("\n"),$="",D=4,A="\t";function _(A,E,_){var B=A.substr(0,E),C=A.substr(E+1,A.length),$="";for(var D=0;D<_;D++)$+=" ";return B+$+C}function C(B,C){if(B.indexOf(A)==-1)return B;var D=0;while((D=B.indexOf(A))!=-1){var $=C-D%C;B=_(B,D,$)}return B}for(var F=0;F<B.length;F++)$+=C(B[F],D)+"\n";return $};dp.sh.Highlighter.prototype.SwitchToList=function(){var C=this.div.innerHTML.replace(/<(br)\/?>/gi,"\n"),B=C.split("\n");if(this.addControls==true)this.bar.appendChild(dp.sh.Toolbar.Create(this));if(this.showColumns){var A=this.CreateElement("div"),_=this.CreateElement("div"),E=10,G=1;while(G<=150)if(G%E==0){A.innerHTML+=G;G+=(G+"").length}else{A.innerHTML+="·";G++}_.className="columns";_.appendChild(A);this.bar.appendChild(_)}for(var G=0,D=this.firstLine;G<B.length-1;G++,D++){var $=this.CreateElement("LI"),F=this.CreateElement("SPAN");$.className=(G%2==0)?"alt":"";F.innerHTML=B[G]+" ";$.appendChild(F);this.ol.appendChild($)}this.div.innerHTML=""};dp.sh.Highlighter.prototype.Highlight=function(C){function A($){return $.replace(/^\s*(.*?)[\s\n]*$/g,"$1")}function $($){return $.replace(/\n*$/,"").replace(/^\n*/,"")}function _(B){var E=dp.sh.Utils.FixForBlogger(B).split("\n"),C=new Array(),D=new RegExp("^\\s*","g"),$=1000;for(var F=0;F<E.length&&$>0;F++){if(A(E[F]).length==0)continue;var _=D.exec(E[F]);if(_!=null&&_.length>0)$=Math.min(_[0].length,$)}if($>0)for(F=0;F<E.length;F++)E[F]=E[F].substr($);return E.join("\n")}function D(A,$,_){return A.substr($,_-$)}var F=0;if(C==null)C="";this.originalCode=C;this.code=$(_(C));this.div=this.CreateElement("DIV");this.bar=this.CreateElement("DIV");this.ol=this.CreateElement("OL");this.matches=new Array();this.div.className="dp-highlighter";this.div.highlighter=this;this.bar.className="bar";this.ol.start=this.firstLine;if(this.CssClass!=null)this.ol.className=this.CssClass;if(this.collapse)this.div.className+=" collapsed";if(this.noGutter)this.div.className+=" nogutter";if(this.tabsToSpaces==true)this.code=this.ProcessSmartTabs(this.code);this.ProcessRegexList();if(this.matches.length==0){this.AddBit(this.code,null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol);return}this.matches=this.matches.sort(dp.sh.Highlighter.SortCallback);for(var E=0;E<this.matches.length;E++)if(this.IsInside(this.matches[E]))this.matches[E]=null;for(E=0;E<this.matches.length;E++){var B=this.matches[E];if(B==null||B.length==0)continue;this.AddBit(D(this.code,F,B.index),null);this.AddBit(B.value,B.css);F=B.index+B.length}this.AddBit(this.code.substr(F),null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol)};dp.sh.Highlighter.prototype.GetKeywords=function($){return"\\b"+$.replace(/ /g,"\\b|\\b")+"\\b"};dp.sh.BloggerMode=function(){dp.sh.isBloggerMode=true};dp.sh.HighlightAll=function(N,B,K,I,O,E){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function J($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function L(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}function C(B,A,_){var $=document.getElementsByTagName(_);for(var C=0;C<$.length;C++)if($[C].getAttribute("name")==A)B.push($[C])}var T=[],P=null,M={},$="innerHTML";C(T,N,"pre");C(T,N,"textarea");if(T.length==0)return;for(var R in dp.sh.Brushes){var F=dp.sh.Brushes[R].Aliases;if(F==null)continue;for(var G=0;G<F.length;G++)M[F[G]]=R}for(G=0;G<T.length;G++){var _=T[G],U=A(_.attributes["class"],_.className,_.attributes["language"],_.language),Q="";if(U==null)continue;U=U.split(":");Q=U[0].toLowerCase();if(M[Q]==null)continue;P=new dp.sh.Brushes[M[Q]]();_.style.display="none";P.noGutter=(B==null)?J("nogutter",U):!B;P.addControls=(K==null)?!J("nocontrols",U):K;P.collapse=(I==null)?J("collapse",U):I;P.showColumns=(E==null)?J("showcolumns",U):E;var D=document.getElementsByTagName("head")[0];if(P.Style&&D){var S=document.createElement("style");S.setAttribute("type","text/css");if(S.styleSheet)S.styleSheet.cssText=P.Style;else{var H=document.createTextNode(P.Style);S.appendChild(H)}D.appendChild(S)}P.firstLine=(O==null)?parseInt(L("firstline",U,1)):O;P.Highlight(_[$]);P.source=_;_.parentNode.insertBefore(P.div,_)}};version.extensions.SyntaxHighLighterPlugin={major:1,minor:1,revision:3,date:new Date(2008,10,24)};dp.sh.ClipboardSwf="clipboard.swf";dp.sh.Highlight=function(_,Q,B,J,H,M,D){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function I($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function K(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}var N=null,$="innerHTML";if(this.registered==undefined){var L={};for(var O in dp.sh.Brushes){var E=dp.sh.Brushes[O].Aliases;if(E==null)continue;for(var F=0;F<E.length;F++)L[E[F]]=O}this.registered=L}Q=Q.split(":");language=Q[0].toLowerCase();if(this.registered[language]==null)return;N=new dp.sh.Brushes[this.registered[language]]();_.style.display="none";N.noGutter=(B==null)?I("nogutter",Q):!B;N.addControls=(J==null)?!I("nocontrols",Q):J;N.collapse=(H==null)?I("collapse",Q):H;N.showColumns=(D==null)?I("showcolumns",Q):D;var C=document.getElementsByTagName("head")[0],P=document.getElementById(N.CssClass);if(N.Style&&C&&!P){P=document.createElement("style");P.setAttribute("id",N.CssClass);P.setAttribute("type","text/css");if(P.styleSheet)P.styleSheet.cssText=N.Style;else{var G=document.createTextNode(N.Style);P.appendChild(G)}C.appendChild(P)}N.firstLine=(M==null)?parseInt(K("firstline",Q,1)):M;N.Highlight(_[$]);N.source=_;_.parentNode.insertBefore(N.div,_)};config.formatters.push({name:"SyntaxHighlighter",match:"^<code[\\s]+[^>]+>\\n",element:"pre",handler:function(_){this.lookaheadRegExp=/<code[\s]+([^>]+)>\n((?:^[^\n]*\n)+?)(^<\/code>$\n?)/mg;this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var C=$[1],B=$[2];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);dp.sh.Highlight(A,C);_.nextMatch=$.index+$[0].length}}});config.formatterHelpers.enclosedTextHelper=function(_){this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var B=$[1];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);switch(_.matchText){case"/*{{{*/\n":dp.sh.Highlight(A,"css");break;case"//{{{\n":dp.sh.Highlight(A,"js");break;case"<!--{{{-->\n":dp.sh.Highlight(A,"xml");break}_.nextMatch=$.index+$[0].length}};dp.sh.Brushes.AS3=function(){var _="class interface package",$="Array Boolean Date decodeURI decodeURIComponent encodeURI encodeURIComponent escape "+"int isFinite isNaN isXMLName Number Object parseFloat parseInt "+"String trace uint unescape XML XMLList "+"Infinity -Infinity NaN undefined "+"as delete instanceof is new typeof "+"break case catch continue default do each else finally for if in "+"label return super switch throw try while with "+"dynamic final internal native override private protected public static "+"...rest const extends function get implements namespace set "+"import include use "+"AS3 flash_proxy object_proxy "+"false null this true "+"void Null";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"blockcomment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"definition"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp("var","gm"),css:"variable"}];this.CssClass="dp-as";this.Style=".dp-as .comment { color: #009900; font-style: italic; }"+".dp-as .blockcomment { color: #3f5fbf; }"+".dp-as .string { color: #990000; }"+".dp-as .preprocessor { color: #0033ff; }"+".dp-as .definition { color: #9900cc; font-weight: bold; }"+".dp-as .keyword { color: #0033ff; }"+".dp-as .variable { color: #6699cc; font-weight: bold; }"};dp.sh.Brushes.AS3.prototype=new dp.sh.Highlighter();dp.sh.Brushes.AS3.Aliases=["as","actionscript","ActionScript","as3","AS3"];dp.sh.Brushes.Bash=function(){var _="alias bg bind break builtin cd command compgen complete continue "+"declare dirs disown echo enable eval exec exit export fc fg "+"getopts hash help history jobs kill let local logout popd printf "+"pushd pwd read readonly return set shift shopt source "+"suspend test times trap type typeset ulimit umask unalias unset wait",$="case do done elif else esac fi for function if in select then "+"time until while";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("\\s-\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-bash";this.Style=".dp-bash .builtin {color: maroon; font-weight: bold;}"+".dp-bash .comment {color: gray;}"+".dp-bash .delim {font-weight: bold;}"+".dp-bash .flag {color: green;}"+".dp-bash .string {color: red;}"+".dp-bash .vars {color: blue;}"};dp.sh.Brushes.Bash.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Bash.Aliases=["bash","sh"];dp.sh.Brushes.Batch=function(){var _="APPEND ATTRIB CD CHDIR CHKDSK CHOICE CLS COPY DEL ERASE DELTREE "+"DIR EXIT FC COMP FDISK FIND FORMAT FSUTIL HELP JOIN "+"LABEL LOADFIX MK MKDIR MEM MEMMAKER MORE MOVE MSD PCPARK "+"PRINT RD RMDIR REN SCANDISK SHARE SORT SUBST SYS "+"TIME DATE TREE TRUENAME TYPE UNDELETE VER XCOPY",$="DO ELSE FOR IN CALL CHOICE GOTO SHIFT PAUSE ERRORLEVEL "+"IF NOT EXIST LFNFOR START SETLOCAL ENDLOCAL ECHO SET";this.regexList=[{regex:new RegExp("REM.*$","gm"),css:"comment"},{regex:new RegExp("::.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("%\\w+%","g"),css:"vars"},{regex:new RegExp("%%\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("@\\w+","g"),css:"keyword"},{regex:new RegExp(":\\w+","g"),css:"keyword"},{regex:new RegExp("\\s/\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-batch";this.Style=".dp-batch .builtin {color: maroon; font-weight: bold;}"+".dp-batch .comment {color: gray;}"+".dp-batch .delim {font-weight: bold;}"+".dp-batch .flag {color: green;}"+".dp-batch .string {color: red;}"+".dp-batch .vars {color: blue;font-weight: bold;}"};dp.sh.Brushes.Batch.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Batch.Aliases=["batch","dos"];dp.sh.Brushes.ColdFusion=function(){this.CssClass="dp-coldfusion";this.Style=".dp-coldfusion { font: 13px \"Courier New\", Courier, monospace; }"+".dp-coldfusion .tag, .dp-coldfusion .tag-name { color: #990033; }"+".dp-coldfusion .attribute { color: #990033; }"+".dp-coldfusion .attribute-value { color: #0000FF; }"+".dp-coldfusion .cfcomments { background-color: #FFFF99; color: #000000; }"+".dp-coldfusion .cfscriptcomments { color: #999999; }"+".dp-coldfusion .keywords { color: #0000FF; }"+".dp-coldfusion .mgkeywords { color: #CC9900; }"+".dp-coldfusion .numbers { color: #ff0000; }"+".dp-coldfusion .strings { color: green; }";this.mgKeywords="setvalue getvalue addresult viewcollection viewstate";this.keywords="var eq neq gt gte lt lte not and or true false "+"abs acos addsoaprequestheader addsoapresponseheader "+"arrayappend arrayavg arrayclear arraydeleteat arrayinsertat "+"arrayisempty arraylen arraymax arraymin arraynew "+"arrayprepend arrayresize arrayset arraysort arraysum "+"arrayswap arraytolist asc asin atn binarydecode binaryencode "+"bitand bitmaskclear bitmaskread bitmaskset bitnot bitor bitshln "+"bitshrn bitxor ceiling charsetdecode charsetencode chr cjustify "+"compare comparenocase cos createdate createdatetime createobject "+"createobject createobject createobject createobject createodbcdate "+"createodbcdatetime createodbctime createtime createtimespan "+"createuuid dateadd datecompare dateconvert datediff dateformat "+"datepart day dayofweek dayofweekasstring dayofyear daysinmonth "+"daysinyear de decimalformat decrementvalue decrypt decryptbinary "+"deleteclientvariable directoryexists dollarformat duplicate encrypt "+"encryptbinary evaluate exp expandpath fileexists find findnocase "+"findoneof firstdayofmonth fix formatbasen generatesecretkey "+"getauthuser getbasetagdata getbasetaglist getbasetemplatepath "+"getclientvariableslist getcontextroot getcurrenttemplatepath "+"getdirectoryfrompath getencoding getexception getfilefrompath "+"getfunctionlist getgatewayhelper gethttprequestdata gethttptimestring "+"getk2serverdoccount getk2serverdoccountlimit getlocale "+"getlocaledisplayname getlocalhostip getmetadata getmetricdata "+"getpagecontext getprofilesections getprofilestring getsoaprequest "+"getsoaprequestheader getsoapresponse getsoapresponseheader "+"gettempdirectory gettempfile gettemplatepath gettickcount "+"gettimezoneinfo gettoken hash hour htmlcodeformat htmleditformat "+"iif incrementvalue inputbasen insert int isarray isbinary isboolean "+"iscustomfunction isdate isdebugmode isdefined isk2serverabroker "+"isk2serverdoccountexceeded isk2serveronline isleapyear islocalhost "+"isnumeric isnumericdate isobject isquery issimplevalue issoaprequest "+"isstruct isuserinrole isvalid isvalid isvalid iswddx isxml "+"isxmlattribute isxmldoc isxmlelem isxmlnode isxmlroot javacast "+"jsstringformat lcase left len listappend listchangedelims listcontains "+"listcontainsnocase listdeleteat listfind listfindnocase listfirst "+"listgetat listinsertat listlast listlen listprepend listqualify "+"listrest listsetat listsort listtoarray listvaluecount "+"listvaluecountnocase ljustify log log10 lscurrencyformat lsdateformat "+"lseurocurrencyformat lsiscurrency lsisdate lsisnumeric lsnumberformat "+"lsparsecurrency lsparsedatetime lsparseeurocurrency lsparsenumber "+"lstimeformat ltrim max mid min minute month monthasstring now "+"numberformat paragraphformat parameterexists parsedatetime pi "+"preservesinglequotes quarter queryaddcolumn queryaddrow querynew "+"querysetcell quotedvaluelist rand randomize randrange refind "+"refindnocase releasecomobject removechars repeatstring replace "+"replacelist replacenocase rereplace rereplacenocase reverse right "+"rjustify round rtrim second sendgatewaymessage setencoding "+"setlocale setprofilestring setvariable sgn sin spanexcluding "+"spanincluding sqr stripcr structappend structclear structcopy "+"structcount structdelete structfind structfindkey structfindvalue "+"structget structinsert structisempty structkeyarray structkeyexists "+"structkeylist structnew structsort structupdate tan timeformat "+"tobase64 tobinary toscript tostring trim ucase urldecode urlencodedformat "+"urlsessionformat val valuelist week wrap writeoutput xmlchildpos "+"xmlelemnew xmlformat xmlgetnodetype xmlnew xmlparse xmlsearch xmltransform "+"xmlvalidate year yesnoformat";this.stringMatches=new Array();this.attributeMatches=new Array()};dp.sh.Brushes.ColdFusion.prototype=new dp.sh.Highlighter();dp.sh.Brushes.ColdFusion.Aliases=["coldfusion","cf"];dp.sh.Brushes.ColdFusion.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}function A(A,$){for(var _=0;_<A.length;_++)if(A[_]==$)return _;return-1}var _=null,$=null;this.GetMatches(new RegExp("\\b(\\d+)","gm"),"numbers");this.GetMatches(new RegExp(this.GetKeywords(this.mgKeywords),"igm"),"mgkeywords");this.GetMatches(dp.sh.RegexLib.SingleLineCComments,"cfscriptcomments");this.GetMatches(dp.sh.RegexLib.MultiLineCComments,"cfscriptcomments");this.GetMatches(new RegExp("(<|<)!---[\\s\\S]*?---(>|>)","gm"),"cfcomments");$=new RegExp("(cfset\\s*)?([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?')*","gm");while((_=$.exec(this.code))!=null){if(_[1]!=undefined&&_[1]!="")continue;if(_[3]!=undefined&&_[3]!=""&&_[3]!="\"\""&&_[3]!="''"){B(this.matches,new dp.sh.Match(_[2],_.index,"attribute"));B(this.matches,new dp.sh.Match(_[3],_.index+_[0].indexOf(_[3]),"attribute-value"));B(this.stringMatches,_[3]);B(this.attributeMatches,_[2])}}this.GetMatches(new RegExp("(<|<)/*\\?*(?!\\!)|/*\\?*(>|>)","gm"),"tag");$=new RegExp("(?:<|<)/*\\?*\\s*([:\\w-.]+)","gm");while((_=$.exec(this.code))!=null)B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"tag-name"));$=new RegExp(this.GetKeywords(this.keywords),"igm");while((_=$.exec(this.code))!=null)if(A(this.attributeMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"keywords"));$=new RegExp("cfset\\s*.*(\".*?\"|'.*?')","gm");while((_=$.exec(this.code))!=null)if(_[1]!=undefined&&_[1]!=""){B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"strings"));B(this.stringMatches,_[1])}while((_=dp.sh.RegexLib.DoubleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"));while((_=dp.sh.RegexLib.SingleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"))};dp.sh.Brushes.Cpp=function(){var _="ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR "+"DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH "+"HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP "+"HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY "+"HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT "+"HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE "+"LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF "+"LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR "+"LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR "+"PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT "+"PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 "+"POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR "+"PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 "+"PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT "+"SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG "+"ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM "+"char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t "+"clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS "+"FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t "+"__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t "+"jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler "+"sig_atomic_t size_t _stat __stat64 _stati64 terminate_function "+"time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf "+"va_list wchar_t wctrans_t wctype_t wint_t signed",$="break case catch class const __finally __exception __try "+"const_cast continue private public protected __declspec "+"default delete deprecated dllexport dllimport do dynamic_cast "+"else enum explicit extern if for friend goto inline "+"mutable naked namespace new noinline noreturn nothrow "+"register reinterpret_cast return selectany "+"sizeof static static_cast struct switch template this "+"thread throw true false try typedef typeid typename union "+"using uuid virtual void volatile whcar_t while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^ *#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"datatypes"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-cpp";this.Style=".dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }"};dp.sh.Brushes.Cpp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Cpp.Aliases=["cpp","c","c++"];dp.sh.Brushes.CSharp=function(){var $="abstract as base bool break byte case catch char checked class const "+"continue decimal default delegate do double else enum event explicit "+"extern false finally fixed float for foreach get goto if implicit in int "+"interface internal is lock long namespace new null object operator out "+"override params private protected public readonly ref return sbyte sealed set "+"short sizeof stackalloc static string struct switch this throw true try "+"typeof uint ulong unchecked unsafe ushort using virtual void while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c";this.Style=".dp-c .vars { color: #d00; }"};dp.sh.Brushes.CSharp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSharp.Aliases=["c#","c-sharp","csharp"];dp.sh.Brushes.CSS=function(){var _="ascent azimuth background-attachment background-color background-image background-position "+"background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top "+"border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color "+"border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width "+"border-bottom-width border-left-width border-width border cap-height caption-side centerline clear clip color "+"content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display "+"elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font "+"height letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top "+"margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans "+"outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page "+"page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position "+"quotes richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress "+"table-layout text-align text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em "+"vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index",$="above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder "+"both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed "+"continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double "+"embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia "+"gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic "+"justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha "+"lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower "+"navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset "+"outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side "+"rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow "+"small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize "+"table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal "+"text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin "+"upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow",A="[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif";this.regexList=[{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\#[a-zA-Z0-9]{3,6}","g"),css:"value"},{regex:new RegExp("(-?\\d+)(.\\d+)?(px|em|pt|:|%|)","g"),css:"value"},{regex:new RegExp("!important","g"),css:"important"},{regex:new RegExp(this.GetKeywordsCSS(_),"gm"),css:"keyword"},{regex:new RegExp(this.GetValuesCSS($),"g"),css:"value"},{regex:new RegExp(this.GetValuesCSS(A),"g"),css:"value"}];this.CssClass="dp-css";this.Style=".dp-css .value { color: black; }"+".dp-css .important { color: red; }"};dp.sh.Highlighter.prototype.GetKeywordsCSS=function($){return"\\b([a-z_]|)"+$.replace(/ /g,"(?=:)\\b|\\b([a-z_\\*]|\\*|)")+"(?=:)\\b"};dp.sh.Highlighter.prototype.GetValuesCSS=function($){return"\\b"+$.replace(/ /g,"(?!-)(?!:)\\b|\\b()")+":\\b"};dp.sh.Brushes.CSS.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSS.Aliases=["css"];dp.sh.Brushes.Delphi=function(){var $="abs addr and ansichar ansistring array as asm begin boolean byte cardinal "+"case char class comp const constructor currency destructor div do double "+"downto else end except exports extended false file finalization finally "+"for function goto if implementation in inherited int64 initialization "+"integer interface is label library longint longword mod nil not object "+"of on or packed pansichar pansistring pchar pcurrency pdatetime pextended "+"pint64 pointer private procedure program property pshortstring pstring "+"pvariant pwidechar pwidestring protected public published raise real real48 "+"record repeat set shl shortint shortstring shr single smallint string then "+"threadvar to true try type unit until uses val var varirnt while widechar "+"widestring with word write writeln xor";this.regexList=[{regex:new RegExp("\\(\\*[\\s\\S]*?\\*\\)","gm"),css:"comment"},{regex:new RegExp("{(?!\\$)[\\s\\S]*?}","gm"),css:"comment"},{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\{\\$[a-zA-Z]+ .+\\}","g"),css:"directive"},{regex:new RegExp("\\b[\\d\\.]+\\b","g"),css:"number"},{regex:new RegExp("\\$[a-zA-Z0-9]+\\b","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-delphi";this.Style=".dp-delphi .number { color: blue; }"+".dp-delphi .directive { color: #008284; }"+".dp-delphi .vars { color: #000; }"};dp.sh.Brushes.Delphi.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Delphi.Aliases=["delphi","pascal"];dp.sh.Brushes.Java=function(){var $="abstract assert boolean break byte case catch char class const "+"continue default do double else enum extends "+"false final finally float for goto if implements import "+"instanceof int interface long native new null "+"package private protected public return "+"short static strictfp super switch synchronized this throw throws true "+"transient try void volatile while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b","gi"),css:"number"},{regex:new RegExp("(?!\\@interface\\b)\\@[\\$\\w]+\\b","g"),css:"annotation"},{regex:new RegExp("\\@interface\\b","g"),css:"keyword"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-j";this.Style=".dp-j .annotation { color: #646464; }"+".dp-j .number { color: #C00000; }"};dp.sh.Brushes.Java.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Java.Aliases=["java"];dp.sh.Brushes.JScript=function(){var $="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.JScript.prototype=new dp.sh.Highlighter();dp.sh.Brushes.JScript.Aliases=["js","jscript","javascript"];dp.sh.Brushes.Lua=function(){var $="break do end else elseif function if local nil not or repeat return and then until while this",_="math\\.\\w+ string\\.\\w+ os\\.\\w+ debug\\.\\w+ io\\.\\w+ error fopen dofile coroutine\\.\\w+ arg getmetatable ipairs loadfile loadlib loadstring longjmp print rawget rawset seek setmetatable assert tonumber tostring";this.regexList=[{regex:new RegExp("--\\[\\[[\\s\\S]*\\]\\]--","gm"),css:"comment"},{regex:new RegExp("--[^\\[]{2}.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"func"},];this.CssClass="dp-lua"};dp.sh.Brushes.Lua.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Lua.Aliases=["lua"];dp.sh.Brushes.Mxml=function(){this.CssClass="dp-mxml";this.Style=".dp-mxml .cdata { color: #000000; }"+".dp-mxml .tag { color : #0000ff; }"+".dp-mxml .tag-name { color: #0000ff; }"+".dp-mxml .script { color: green; }"+".dp-mxml .metadata { color: green; }"+".dp-mxml .attribute { color: #000000; }"+".dp-mxml .attribute-value { color: #990000; }"+".dp-mxml .trace { color: #cc6666; }"+".dp-mxml .var { color: #6699cc; }"+".dp-mxml .comment { color: #009900; }"+".dp-mxml .string { color: #990000; }"+".dp-mxml .keyword { color: blue; }"};dp.sh.Brushes.Mxml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Mxml.Aliases=["mxml"];dp.sh.Brushes.Mxml.prototype.ProcessRegexList=function(){function H(_,$){_[_.length]=$}function B(B,_){var A=0,$=false;for(A=0;A<B.length;A++)if(_.index>B[A].firstIndex&&_.index<B[A].lastIndex)$=true;return $}var $=0,F=null,D=null,A=null,C="",E=new Array(),_="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with",G=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords("trace"),"gm"),css:"trace"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"keyword"}];A=new RegExp("<\\!\\[CDATA\\[(.|\\s)*?\\]\\]>","gm");while((F=A.exec(this.code))!=null){C=F[0].substr(0,12);H(this.matches,new dp.sh.Match(C,F.index,"cdata"));C=F[0].substr(12,F[0].length-12-6);for(var I=0;I<G.length;I++)while((D=G[I].regex.exec(C))!=null)H(this.matches,new dp.sh.Match(D[0],F.index+12+D.index,G[I].css));C=F[0].substr(F[0].length-6,6);H(this.matches,new dp.sh.Match(C,F.index+F[0].length-6,"cdata"));E.push({firstIndex:F.index,lastIndex:F.index+F[0].length-1})}this.GetMatches(new RegExp("(<|<)!--\\s*.*?\\s*--(>|>)","gm"),"comments");A=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((F=A.exec(this.code))!=null){if(F[1]==null)continue;if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[1],F.index,"attribute"));if(F[2]!=undefined)H(this.matches,new dp.sh.Match(F[2],F.index+F[0].indexOf(F[2]),"attribute-value"))}A=new RegExp("(?:<|<)/*\\?*\\s*([:\\w-.]+)","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;C=F[0].substr(4,F[0].length-4);switch(C){case"mx:Script":case"/mx:Script":H(this.matches,new dp.sh.Match(F[0]+">",F.index,"script"));break;case"mx:Metadata":case"/mx:Metadata":H(this.matches,new dp.sh.Match(F[0]+">",F.index,"metadata"));break;default:H(this.matches,new dp.sh.Match(F[0],F.index,"tag-name"));break}}A=new RegExp("\\?>|>|/>","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[0],F.index,"tag"))}};dp.sh.Brushes.Perl=function(){var _="abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir connect cos crypt dbmclose dbmopen defined delete dump each endgrent endhostent endnetent endprotoent endpwent endservent eof exec exists exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime grep hex import index int ioctl join keys kill lc lcfirst length link listen localtime lock log lstat m map mkdir msgctl msgget msgrcv msgsnd no oct open opendir ord pack pipe pop pos print printf prototype push q qq quotemeta qw qx rand read readdir readline readlink readpipe recv ref rename reset reverse rewinddir rindex rmdir scalar seek seekdir semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unlink unpack unshift untie utime values vec waitpid wantarray warn write qr",$="s select goto die do package redo require return continue for foreach last next wait while use if else elsif eval exit unless switch case",A="my our local";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("(\\$|@|%)\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(A),"gm"),css:"declarations"}];this.CssClass="dp-perl"};dp.sh.Brushes.Perl.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Perl.Aliases=["perl"];dp.sh.Brushes.Php=function(){var _="abs acos acosh addcslashes addslashes "+"array_change_key_case array_chunk array_combine array_count_values array_diff "+"array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill "+"array_filter array_flip array_intersect array_intersect_assoc array_intersect_key "+"array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map "+"array_merge array_merge_recursive array_multisort array_pad array_pop array_product "+"array_push array_rand array_reduce array_reverse array_search array_shift "+"array_slice array_splice array_sum array_udiff array_udiff_assoc "+"array_udiff_uassoc array_uintersect array_uintersect_assoc "+"array_uintersect_uassoc array_unique array_unshift array_values array_walk "+"array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert "+"basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress "+"bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir "+"checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists "+"closedir closelog copy cos cosh count count_chars date decbin dechex decoct "+"deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log "+"error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded "+"feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents "+"fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype "+"floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf "+"fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname "+"gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt "+"getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext "+"gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set "+"interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double "+"is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long "+"is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault "+"is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br "+"parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir "+"round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split "+"str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes "+"stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk "+"strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime "+"strtoupper strtr strval substr substr_compare",$="and or xor __FILE__ __LINE__ array as break case "+"cfunction class const continue declare default die do else "+"elseif empty enddeclare endfor endforeach endif endswitch endwhile "+"extends for foreach function include include_once global if "+"new old_function return static switch use require require_once "+"var while __FUNCTION__ __CLASS__ "+"__METHOD__ abstract interface public implements extends private protected throw";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.Php.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Php.Aliases=["php"];dp.sh.Brushes.Python=function(){var $="and assert break class continue def del elif else "+"except exec finally for from global if import in is "+"lambda not or pass print raise return try yield while",_="None True False self cls class_";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:new RegExp("^\\s*@\\w+","gm"),css:"decorator"},{regex:new RegExp("(['\"]{3})([^\\1])*?\\1","gm"),css:"comment"},{regex:new RegExp("\"(?!\")(?:\\.|\\\\\\\"|[^\\\"\"\\n\\r])*\"","gm"),css:"string"},{regex:new RegExp("'(?!')*(?:\\.|(\\\\\\')|[^\\''\\n\\r])*'","gm"),css:"string"},{regex:new RegExp("\\b\\d+\\.?\\w*","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"special"}];this.CssClass="dp-py";this.Style=".dp-py .builtins { color: #ff1493; }"+".dp-py .magicmethods { color: #808080; }"+".dp-py .exceptions { color: brown; }"+".dp-py .types { color: brown; font-style: italic; }"+".dp-py .commonlibs { color: #8A2BE2; font-style: italic; }"};dp.sh.Brushes.Python.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Python.Aliases=["py","python"];dp.sh.Brushes.Ruby=function(){var $="alias and BEGIN begin break case class def define_method defined do each else elsif "+"END end ensure false for if in module new next nil not or raise redo rescue retry return "+"self super then throw true undef unless until when while yield",_="Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload "+"Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol "+"ThreadGroup Thread Time TrueClass";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(":[a-z][A-Za-z0-9_]*","g"),css:"symbol"},{regex:new RegExp("(\\$|@@|@)\\w+","g"),css:"variable"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"}];this.CssClass="dp-rb";this.Style=".dp-rb .symbol { color: #a70; }"+".dp-rb .variable { color: #a70; font-weight: bold; }"};dp.sh.Brushes.Ruby.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Ruby.Aliases=["ruby","rails","ror"];dp.sh.Brushes.Sql=function(){var _="abs avg case cast coalesce convert count current_timestamp "+"current_user day isnull left lower month nullif replace right "+"session_user space substring sum system_user upper user year",$="absolute action add after alter as asc at authorization begin bigint "+"binary bit by cascade char character check checkpoint close collate "+"column commit committed connect connection constraint contains continue "+"create cube current current_date current_time cursor database date "+"deallocate dec decimal declare default delete desc distinct double drop "+"dynamic else end end-exec escape except exec execute false fetch first "+"float for force foreign forward free from full function global goto grant "+"group grouping having hour ignore index inner insensitive insert instead "+"int integer intersect into is isolation key last level load local max min "+"minute modify move name national nchar next no numeric of off on only "+"open option order out output partial password precision prepare primary "+"prior privileges procedure public read real references relative repeatable "+"restrict return returns revoke rollback rollup rows rule schema scroll "+"second section select sequence serializable set size smallint static "+"statistics table temp temporary then time timestamp to top transaction "+"translation trigger true truncate uncommitted union unique update values "+"varchar varying view when where with work",A="all and any between cross in join like not null or outer some";this.regexList=[{regex:new RegExp("--(.*)$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords(A),"gmi"),css:"op"},{regex:new RegExp(this.GetKeywords($),"gmi"),css:"keyword"}];this.CssClass="dp-sql";this.Style=".dp-sql .func { color: #ff1493; }"+".dp-sql .op { color: #808080; }"};dp.sh.Brushes.Sql.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Sql.Aliases=["sql"];dp.sh.Brushes.Vb=function(){var $="AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto "+"Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate "+"CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType "+"Date Decimal Declare Default Delegate Dim DirectCast Do Double Each "+"Else ElseIf End Enum Erase Error Event Exit False Finally For Friend "+"Function Get GetType GoSub GoTo Handles If Implements Imports In "+"Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module "+"MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing "+"NotInheritable NotOverridable Object On Option Optional Or OrElse "+"Overloads Overridable Overrides ParamArray Preserve Private Property "+"Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume "+"Return Select Set Shadows Shared Short Single Static Step Stop String "+"Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until "+"Variant When While With WithEvents WriteOnly Xor";this.regexList=[{regex:new RegExp("'.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-vb"};dp.sh.Brushes.Vb.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Vb.Aliases=["vb","vb.net"];dp.sh.Brushes.Xml=function(){this.CssClass="dp-xml";this.Style=".dp-xml .cdata { color: #ff1493; }"+".dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }"+".dp-xml .attribute { color: red; }"+".dp-xml .attribute-value { color: blue; }"};dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=["xml","xhtml","xslt","html","xhtml"];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}var $=0,A=null,_=null;this.GetMatches(new RegExp("(<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](>|>)","gm"),"cdata");this.GetMatches(new RegExp("(<|<)!--\\s*.*?\\s*--(>|>)","gm"),"comments");_=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((A=_.exec(this.code))!=null){if(A[1]==null)continue;B(this.matches,new dp.sh.Match(A[1],A.index,"attribute"));if(A[2]!=undefined)B(this.matches,new dp.sh.Match(A[2],A.index+A[0].indexOf(A[2]),"attribute-value"))}this.GetMatches(new RegExp("(<|<)/*\\?*(?!\\!)|/*\\?*(>|>)","gm"),"tag");_=new RegExp("(?:<|<)/*\\?*\\s*([:\\w-.]+)","gm");while((A=_.exec(this.code))!=null)B(this.matches,new dp.sh.Match(A[1],A.index+A[0].indexOf(A[1]),"tag-name"))}
//}}}
<<tabs txtMoreTab tags "all tags" TabTags plug "installed plugins" systemConfig miss "missing tiddlers" TabMoreMissing orph "orphaned tiddlers" TabMoreOrphans shad "shadowed tiddlers" TabMoreShadowed ex "tiddlers on excludeLists" excludeLists>>
<<list missing>>
----
[[::excludeMissing::|excludeMissing]]
{{sidebarTitle{[[all available tags:|TabTags]]}}}
{{sideBarTags{<<allTags>>}}}
/***
|Name|TableOfContentsPlugin|
|Source|http://www.TiddlyTools.com/#TableOfContentsPlugin|
|Documentation|http://www.TiddlyTools.com/#TableOfContentsPluginInfo|
|Version|2.4.3|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|replace the standard tabbed contents list with a scrolling listbox|
When there are many tiddlers in a document, the standard 'tabbed list of tiddlers' in the right-hand sidebar can become very long, occupying a lot of page space and requiring a lot scrolling in order to locate and select a tiddler. The TableOfContentsPlugin addresses this problem by replacing the standard tabbed list display with a single listbox/droplist control that uses a very small amount of page space, regardless of the number of tiddlers in the document.
!!!!!Documentation
>see [[TableOfContentsPluginInfo]]
!!!!!Configuration
<<option chkTOCShow>> display table of contents listbox
<<option chkTOCIncludeHidden>> include tiddlers tagged with <<tag excludeLists>> in listbox
listbox shows <<option txtTOCListSize>> lines, sorted by <<option txtTOCSortBy>>
<<<
!!!!!Code
***/
//{{{
version.extensions.TableOfContentsPlugin= {major: 2, minor: 4, revision: 3, date: new Date(2008,4,9)};
//}}}
// // 1.2.x compatibility
//{{{
if (!window.story) window.story=window;
if (!store.getTiddler) store.getTiddler=function(title){return store.tiddlers[title]}
if (!store.addTiddler) store.addTiddler=function(tiddler){store.tiddlers[tiddler.title]=tiddler}
if (!store.deleteTiddler) store.deleteTiddler=function(title){delete store.tiddlers[title]}
//}}}
//{{{
// define defaults for cookie-based option values
if (config.options.txtTOCSortBy==undefined) config.options.txtTOCSortBy="modified";
if (config.options.txtTOCListSize==undefined) config.options.txtTOCListSize=19;
if (config.options.chkTOCShow==undefined) config.options.chkTOCShow=true;
if (config.options.chkTOCIncludeHidden==undefined) config.options.chkTOCIncludeHidden=false;
// define macro "tableOfContents" to render controls
config.macros.tableOfContents = { label: "contents" };
config.macros.tableOfContents.cmdMax=8; // index of maximum command item
config.macros.tableOfContents.css = '\
.TOC { padding:0.5em 1em 0.5em 1em; }\
.TOC a { padding:0em 0.25em 0em 0.25em; color:inherit; }\
.TOCList { width: 100%; font-size:8pt; margin:0em; }\
';
config.macros.tableOfContents.html = '\
<div style="text-align:right">\
<span style="float:left">\
<a href="JavaScript:;" id="TOCMenu" style="padding: 0em;"\
onclick="onClickTOCMenu(this)" title="show/hide table of contents">%label%</a>\
</span>\
<a href="JavaScript:;" id="TOCSmaller" style="display:inline"\
onclick="resizeTOC(this)" title="reduce list size">–</a>\
<a href="JavaScript:;" id="TOCLarger"style="display:inline"\
onclick="resizeTOC(this)" title="increase list size">+</a>\
<a href="JavaScript:;" id="TOCMaximize"style="display:inline"\
onclick="resizeTOC(this)" title="maximize/restore list size">=</a>\
</div>\
';
config.macros.tableOfContents.handler = function(place,macroName,params) {
var parsedParams = new Array();
parsedParams['label']=this.label;
parsedParams['inline']=false;
while (params.length>0) {
if (params[0]=="label:none") parsedParams['label']="";
else if (params[0].substr(0,6)=="label:") parsedParams['label']=params[0].substr(6);
if (params[0].substr(0,7)=="prompt:") parsedParams['prompt']=params[0].substr(7);
if (params[0].substr(0,8)=="padding:")parsedParams['padding']=params[0].substr(8);
if (params[0].substr(0,7)=="margin:") parsedParams['margin']=params[0].substr(7);
if (params[0].substr(0,5)=="sort:") parsedParams['sortby']=params[0].substr(5);
if (params[0].substr(0,5)=="date:") parsedParams['date']=params[0].substr(5);
if ((params[0]=="size:auto")||(params[0]=="size:0")) parsedParams['autosize']=true;
else if (params[0] && (params[0].substr(0,5)=="size:")) parsedParams['requestedSize']=params[0].substr(5);
if (params[0].substr(0,6)=="width:") parsedParams['width']=params[0].substr(6);
if (params[0]=="hidelist") parsedParams['hidelist']=true;
if (params[0]=="inline") parsedParams['inline']=true;
if (params[0]=="-title") parsedParams['hide_title']=true;
if (params[0]=="-date") parsedParams['hide_date']=true;
if (params[0]=="-author") parsedParams['hide_author']=true;
if (params[0]=="-creator") parsedParams['hide_creator']=true;
if (params[0]=="-tags") parsedParams['hide_tags']=true;
if (params[0]=="-missing") parsedParams['hide_missing']=true;
if (params[0]=="-orphans") parsedParams['hide_orphans']=true;
if (params[0]=="-shadows") parsedParams['hide_shadows']=true;
params.shift();
}
setStylesheet(config.macros.tableOfContents.css,"tableOfContents");
var newTOC=createTiddlyElement(place,parsedParams['inline']?"span":"div",null,"TOC",null)
if (parsedParams['margin']) { newTOC.style.margin=parsedParams['margin']; }
if (parsedParams['padding']) { newTOC.style.padding=parsedParams['padding']; }
if (parsedParams['label']!="") newTOC.innerHTML=config.macros.tableOfContents.html.replace(/%label%/,parsedParams['label']);
var newTOCList=createTOCList(newTOC,parsedParams)
refreshTOCList(newTOCList);
store.addNotification(null,reloadTOCLists); // reload listbox after every tiddler change
}
// IE needs explicit global scoping for functions/vars called from browser events
window.onChangeTOCList=onChangeTOCList;
window.onClickTOCList=onClickTOCList;
window.onDblClickTOCList=onDblClickTOCList;
window.reloadTOCLists=reloadTOCLists;
window.refreshTOCList=refreshTOCList;
window.onClickTOCMenu=onClickTOCMenu;
window.resizeTOC=resizeTOC;
function createTOCList(place,params) {
var list = createTiddlyElement(place,"select",null,"TOCList",params['prompt'])
list.params=params;
list.onchange=onChangeTOCList;
list.onclick=onClickTOCList;
list.ondblclick=onDblClickTOCList;
list.onkeyup=onKeyUpTOCList;
list.style.display=config.options.chkTOCShow ? "block" : "none" ;
list.sortBy=config.options.txtTOCSortBy;
list.dateFormat="DD MMM YYYY";
list.requestedSize=config.options.txtTOCListSize;
list.expandall=false;
list.cmdMax=config.macros.tableOfContents.cmdMax;
if (params['hide_title']) list.cmdMax--;
if (params['hide_date']) list.cmdMax--;
if (params['hide_author']) list.cmdMax--;
if (params['hide_creator']) list.cmdMax--;
if (params['hide_tags']) list.cmdMax--;
if (params['hide_missing']) list.cmdMax--;
if (params['hide_orphans']) list.cmdMax--;
if (params['hide_shadows']) list.cmdMax--;
if (params['sortby']) { list.sortBy=params['sortby']; list.noSortCookie=true; }
if (params['date']) { list.dateFormat=params['date']; }
if (params['autosize']) { list.autosize=true; list.noSizeCookie=true; }
if (params['requestedSize']){ list.requestedSize=params['requestedSize']; list.noSizeCookie=true; }
if (params['width']) { list.style.width=params['width']; }
if (params['hidelist']) { list.style.display ="none" ; list.noShowCookie=true; }
if (params['expandall']) { list.expandall=true; }
return list;
}
function onChangeTOCList() {
var thisTiddler=this.options[this.selectedIndex].value;
if ((this.size==1)&&(thisTiddler!='')&&(this.selectedIndex>this.cmdMax))
story.displayTiddler(null,thisTiddler,1);
refreshTOCList(this);
return false;
}
function onClickTOCList(e) {
if (!e) var e = window.event;
if (this.size==1) return; // don't toggle display for droplist
if (e.shiftKey) { this.expandall=!this.expandall; refreshTOCList(this);}
e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation();
return true;
}
function onDblClickTOCList(e) {
if (!e) var e = window.event;
var thisTiddler=this.options[this.selectedIndex].value;
if ((thisTiddler!='')&&(this.selectedIndex>this.cmdMax))
story.displayTiddler(null,thisTiddler,1);
e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation();
return false;
}
function onKeyUpTOCList(e) {
if (!e) var e = window.event;
if (e.keyCode!=13) return true;
var thisTiddler=this.options[this.selectedIndex].value;
if ((thisTiddler!='')&&(this.selectedIndex>this.cmdMax))
story.displayTiddler(null,thisTiddler,1);
e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation();
return false;
}
function reloadTOCLists() {
var all=document.all? document.all.tags("select") : document.getElementsByTagName("select");
for (var i=0; i<all.length; i++)
if (all[i].className=="TOCList")
{ all[i].selectedIndex=-1; refreshTOCList(all[i]); }
}
function refreshTOCList(list) {
var selectedIndex = list.selectedIndex;
if (selectedIndex==-1) selectedIndex=0;
var sortBy = list.sortBy;
var showHidden = config.options.chkTOCIncludeHidden && !(config.options.chkHttpReadOnly && readOnly);
if (selectedIndex==0) sortBy=list.sortBy; // "nnn tiddlers" heading - use previous sort order
else if (selectedIndex<=list.cmdMax)sortBy=list.value;
else { if (list.options[list.selectedIndex].value=='') expandTOC(list); return; }
list.sortBy = sortBy; // save current sort order
if (!list.noSortCookie) { config.options.txtTOCSortBy=sortBy; saveOptionCookie("txtTOCSortBy"); }
// get the list of tiddlers
var tiddlers = [];
switch (sortBy) {
case "missing": tiddlers=store.getMissingLinks(); break;
case "tags": tiddlers=store.getTags(); break;
case "orphans": tiddlers=store.getOrphans(); break;
case "shadows": for (var t in config.shadowTiddlers) tiddlers.push(t); tiddlers.sort(); break;
default: tiddlers=store.getTiddlers(sortBy=='creator'?'modifier':sortBy,showHidden?'':'excludeLists'); break;
}
// clear current listbox contents
while (list.length > 0) { list.options[0] = null; }
list.saved=null;
// add heading and control items to list
var i=0;
var theHeading=tiddlers.length+' tiddlers:';
if (sortBy=='missing') theHeading=tiddlers.length+' missing tiddlers:';
if (sortBy=='orphans') theHeading=tiddlers.length+' orphaned tiddlers:';
if (sortBy=='tags') theHeading=tiddlers.length+' tags:';
if (sortBy=='shadows') theHeading=tiddlers.length+' shadow tiddlers:';
var indent=String.fromCharCode(160)+String.fromCharCode(160);
var sel=">";
list.options[i++]=new Option(theHeading,'');
function headerOpt(txt,val) { return new Option(((sortBy==val)?sel:indent)+' ['+txt+']',val); }
if (!list.params['hide_title']) list.options[i++]=headerOpt('by title','title');
if (!list.params['hide_date']) list.options[i++]=headerOpt('by date','modified');
if (!list.params['hide_author']) list.options[i++]=headerOpt('by author','modifier');
if (!list.params['hide_creator']) list.options[i++]=headerOpt('by creator','creator');
if (!list.params['hide_tags']) list.options[i++]=headerOpt('by tags','tags');
if (!list.params['hide_missing']) list.options[i++]=headerOpt('missing','missing');
if (!list.params['hide_orphans']) list.options[i++]=headerOpt('orphans','orphans');
if (!list.params['hide_shadows']) list.options[i++]=headerOpt('shadows','shadows');
// output the tiddler list
switch(sortBy) {
case "title":
for (var t = 0; t < tiddlers.length; t++)
list.options[i++] = new Option(tiddlers[t].title,tiddlers[t].title);
break;
case "modified":
case "modifier":
case "creator":
if (sortBy=="modified") tiddlers.reverse(); // show newest first
if (sortBy=="creator") { // sort by custom field with fallback value
tiddlers.sort(function (a,b) {
var v1=a.fields.creator||a.modifier;
var v2=b.fields.creator||b.modifier;
return (v1==v2)?0:(v1>v2?1:-1);
});
}
var lastSection = "";
for (var t = 0; t < tiddlers.length; t++){
var tiddler = tiddlers[t];
var theSection = "";
var m=tiddler.modified;
if (sortBy=="modified") theSection=m.getFullYear()+'.'+(m.getMonth()+1)+'.'+m.getDate();
if (sortBy=="modifier") theSection = tiddler.modifier;
if (sortBy=="creator") theSection=tiddler.fields['creator']||tiddler.modifier;
if (theSection != lastSection) {
lastSection = theSection;
if (sortBy=="modified") theSection = m.formatString(list.dateFormat);
list.options[i++] = new Option('+ '+theSection,"");
}
list.options[i++] = new Option(indent+indent+tiddler.title,tiddler.title);
}
expandTOC(list);
break;
case "tags":
// tagged tiddlers, by tag
var tagcount=0;
var lastTag = null;
for (var t = 0; t < tiddlers.length; t++) { // actually a list of tags, not tiddlers...
var theTag = tiddlers[t][0]; var tid=store.getTiddler(theTag);
if (tid && tid.isTagged('excludeLists')) continue; // skip excluded tags
var temp = store.getTaggedTiddlers(theTag);
var tagged=[]; for (var q=0; q<temp.length; q++) // hide excluded tiddlers
if (!temp[q].isTagged('excludeLists')) tagged.push(temp[q]);
if (tagged.length) { tagcount++;
list.options[i++]=new Option('+ '+theTag+" ("+tagged.length+")","");
for(var r=0; r<tagged.length; r++)
list.options[i++]=
new Option(indent+indent+tagged[r].title,tagged[r].title);
}
}
// count untagged tiddlers
var temp = store.getTiddlers("title");
var c=0; for (var r=0; r<temp.length;r++) if (!temp[r].tags.length) c++;
// create 'pseudo-tag' listing untagged tiddlers (if any)
if (c>0) {
list.options[i++] = new Option("+ untagged ("+c+")","");
for (var r=0; r<temp.length;r++) if (!temp[r].tags.length)
list.options[i++] = new
Option(indent+indent+temp[r].title,temp[r].title);
}
list.options[0].text=tagcount+' tags:';
expandTOC(list);
break;
case "missing": case "orphans": case "shadows":
for (var t = 0; t < tiddlers.length; t++)
list.options[i++] = new Option(tiddlers[t],tiddlers[t]);
break;
}
list.selectedIndex=selectedIndex; // select current control item
list.size = (list.autosize)?list.options.length:list.requestedSize;
}
// show/hide branch of TOCList based on current selection
function expandTOC(list) {
var selectedIndex = list.selectedIndex;
if (selectedIndex==-1) selectedIndex=0;
var sortBy = list.sortBy;
// don't collapse/expand list for alpha-sorted "flatlist" TOC contents
// or list control items
if ((sortBy=="title")||(sortBy=="missing")||(sortBy=="orphans")||(sortBy=="shadows")) return;
if ((selectedIndex>0)&&(selectedIndex<=list.cmdMax)) return;
// get current selected text/value and cache the
// complete list. Then clear the current list contents
var theText = list.options[selectedIndex].text;
var theValue = list.options[selectedIndex].value;
if (!list.saved) {
list.saved=new Array();
for (var i=0;i<list.length;i++) list.saved[i]=list.options[i];
}
while (list.length > 0) { list.options[0] = null; }
// put back heading items until item text matches current selected heading
var i=0;
for (var t=0; t<list.saved.length; t++) {
var opt=list.saved[t];
if (list.expandall||(opt.value=='')||(i<=list.cmdMax)) list.options[i++] = opt;
if (opt.text==theText) break;
}
selectedIndex=i-1; // this is the NEW index of the current selected heading
// put back items with value!='' until value==''
for ( t++; t<list.saved.length; t++) {
var opt=list.saved[t];
if (list.expandall||opt.value!='') list.options[i++] = opt;
if (opt.value=='') break;
}
// put back remaining items with value==''
for ( ; t<list.saved.length; t++) {
var opt=list.saved[t];
if (list.expandall||opt.value=='') list.options[i++] = opt;
}
list.selectedIndex = selectedIndex;
list.size = (list.autosize)?list.options.length:list.requestedSize;
}
// these functions process clicks on the 'control links' that are displayed above the listbox
function getTOCListFromButton(which) {
var list = null;
switch (which.id) {
case 'TOCMenu':
var theSiblings = which.parentNode.parentNode.parentNode.childNodes;
var thePlace=which.parentNode.parentNode.parentNode.parentNode.parentNode.id;
break;
case 'TOCSmaller': case 'TOCLarger': case 'TOCMaximize':
var theSiblings = which.parentNode.parentNode.childNodes;
var thePlace=which.parentNode.parentNode.parentNode.parentNode.id;
break;
}
for (var k=0; k<theSiblings.length; k++)
if (theSiblings[k].className=="TOCList") { list=theSiblings[k]; break; }
return list;
}
function onClickTOCMenu(which) {
var list=getTOCListFromButton(which); if (!list) return;
var opening = list.style.display=="none";
if(config.options.chkAnimate) anim.startAnimating(new Slider(list,opening,false,"none"));
else list.style.display = opening ? "block" : "none" ;
if (!list.noShowCookie) { config.options.chkTOCShow = opening; saveOptionCookie("chkTOCShow"); }
return(false);
}
function resizeTOC(which) {
var list=getTOCListFromButton(which); if (!list) return;
var size = list.size;
if (list.style.display=="none") // make sure list is visible
if(config.options.chkAnimate) anim.startAnimating(new Slider(list,true,false,"none"));
else list.style.display = "block" ;
switch (which.id) {
case 'TOCSmaller': // decrease current listbox size
if (list.autosize) { list.autosize=false; size=config.options.txtTOCListSize; }
if (size==1) break;
size -= 1; // shrink by one line
list.requestedSize = list.size = size;
break;
case 'TOCLarger': // increase current listbox size
if (list.autosize) { list.autosize=false; size=config.options.txtTOCListSize; }
if (size>=list.options.length) break;
size += 1; // grow by one line
list.requestedSize = list.size = size;
break;
case 'TOCMaximize': // toggle autosize
list.autosize = (list.size!=list.options.length);
list.size = (list.autosize)?list.options.length:list.requestedSize;
break;
}
if (!list.noSizeCookie && !list.autosize)
{ config.options.txtTOCListSize=size; saveOptionCookie("txtTOCListSize"); }
}
//}}}
<<tagCloud excludeLists noCloud>>
----
@@padding-left:10px;[[::list tiddlers by tags::|TiddlersByTags]]@@
/***
|''Plugin'' |TagCloudMacro |
|''Author'' |Clint Checketts |
|''Source URL'' |http://tiddlystyles.com |
!Usage
{{{<<tagCloud>>}}}
<<tagCloud>>
!Code
***/
//{{{
setStylesheet(".tagCloud span{height: 1.8em;margin: 3px;}.tagCloud1{font-size: 10px;}.tagCloud2{font-size:12px;}.tagCloud3{font-size: 14px;}.tagCloud4{font-size: 16px;font-weight: bold;}.tagCloud5{font-size: 20px;font-weight: bold;}","tagCloudsStyles");
version.extensions.tagCloud={major: 1, minor: 0 , revision: 0, date: new Date(2006,2,04)};
//Created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
config.macros.tagCloud={
noTags:"There are no tags.",
tooltip:"%1 tiddlers tagged with '%0'",
exclude:['excludeLists','noCloud'],
handler:function(place,macroName,params){
var el,max,p,segm,t,tg,tags,wrap;
wrap=createTiddlyElement(place,"div",null,"tagCloud",null);
tags=store.getTags();
for(t=0;t<tags.length;t++){
tiddler=store.fetchTiddler(tags[t][0]);
if(tiddler&&tiddler.tags.containsAny(this.exclude))tags[t][0]="";
for(p=0;p<params.length;p++)if(tags[t][0]==params[p])tags[t][0]="";
}
if(tags.length==0)createTiddlyElement(wrap,"span",null,null,this.noTags);
max=0;//Find max num of tags
for(var t=0;t<tags.length;t++)if(tags[t][0].length>0){if(tags[t][1]>max)max=tags[t][1];}
segm=max/4;//divide max into 4 tagCloud sizes
for(t=0;t<tags.length;t++)if(tags[t][0].length>0){
el=createTiddlyElement(wrap,"span",null,null,null);
wrap.appendChild(document.createTextNode(" "));
tg=createTiddlyButton(el,tags[t][0],this.tooltip.format(tags[t]),onClickTag,"tagCloudtag tagCloud"+(Math.round(tags[t][1]/segm)+1));
tg.setAttribute("tag",tags[t][0]);
tg.setAttribute("showOpenTag",true);
}
}
}
//}}}
/***
|Name:|TagglyTaggingPlugin|
|Description:|tagglyTagging macro is a replacement for the builtin tagging macro in your ~ViewTemplate|
|Version:|3.1 ($Rev: 4092 $)|
|Date:|$Date: 2008-03-24 12:32:33 +1000 (Mon, 24 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#TagglyTaggingPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
See http://mptw.tiddlyspot.com/#TagglyTagging
***/
//{{{
config.taggly = {
// for translations
lingo: {
labels: {
asc: "\u2191", // down arrow
desc: "\u2193", // up arrow
title: "title",
modified: "modified",
created: "created",
show: "+",
hide: "-",
normal: "normal",
group: "group",
commas: "commas",
sitemap: "sitemap",
numCols: "cols\u00b1", // plus minus sign
label: "Tagged as '%0':",
excerpts: "excerpts",
descr: "descr",
slices: "slices",
contents: "contents",
sliders: "sliders",
noexcerpts: "title only"
},
tooltips: {
title: "Click to sort by title",
modified: "Click to sort by modified date",
created: "Click to sort by created date",
show: "Click to show tagging list",
hide: "Click to hide tagging list",
normal: "Click to show a normal ungrouped list",
group: "Click to show list grouped by tag",
sitemap: "Click to show a sitemap style list",
commas: "Click to show a comma separated list",
numCols: "Click to change number of columns",
excerpts: "Click to show excerpts",
descr: "Click to show the description slice",
slices: "Click to show all slices",
contents: "Click to show entire tiddler contents",
sliders: "Click to show tiddler contents in sliders",
noexcerpts: "Click to show entire title only"
}
},
config: {
showTaggingCounts: true,
listOpts: {
// the first one will be the default
sortBy: ["title","modified","created"],
sortOrder: ["asc","desc"],
hideState: ["show","hide"],
listMode: ["normal","group","sitemap","commas"],
numCols: ["1","2","3","4","5","6"],
excerpts: ["noexcerpts","excerpts","descr","slices","contents","sliders"]
},
valuePrefix: "taggly.",
excludeTags: ['excludeTagging'],
excerptSize: 50,
excerptMarker: "/%"+"%/"
},
getTagglyOpt: function(title,opt) {
var val = store.getValue(title,this.config.valuePrefix+opt);
return val ? val : this.config.listOpts[opt][0];
},
setTagglyOpt: function(title,opt,value) {
if (!store.tiddlerExists(title))
// create it silently
store.saveTiddler(title,title,config.views.editor.defaultText.format([title]),config.options.txtUserName,new Date(),"");
// if value is default then remove it to save space
return store.setValue(title,
this.config.valuePrefix+opt,
value == this.config.listOpts[opt][0] ? null : value);
},
getNextValue: function(title,opt) {
var current = this.getTagglyOpt(title,opt);
var pos = this.config.listOpts[opt].indexOf(current);
// a little usability enhancement. actually it doesn't work right for grouped or sitemap
var limit = (opt == "numCols" ? store.getTaggedTiddlers(title).length : this.config.listOpts[opt].length);
var newPos = (pos + 1) % limit;
return this.config.listOpts[opt][newPos];
},
toggleTagglyOpt: function(title,opt) {
var newVal = this.getNextValue(title,opt);
this.setTagglyOpt(title,opt,newVal);
},
createListControl: function(place,title,type) {
var lingo = config.taggly.lingo;
var label;
var tooltip;
var onclick;
if ((type == "title" || type == "modified" || type == "created")) {
// "special" controls. a little tricky. derived from sortOrder and sortBy
label = lingo.labels[type];
tooltip = lingo.tooltips[type];
if (this.getTagglyOpt(title,"sortBy") == type) {
label += lingo.labels[this.getTagglyOpt(title,"sortOrder")];
onclick = function() {
config.taggly.toggleTagglyOpt(title,"sortOrder");
return false;
}
}
else {
onclick = function() {
config.taggly.setTagglyOpt(title,"sortBy",type);
config.taggly.setTagglyOpt(title,"sortOrder",config.taggly.config.listOpts.sortOrder[0]);
return false;
}
}
}
else {
// "regular" controls, nice and simple
label = lingo.labels[type == "numCols" ? type : this.getNextValue(title,type)];
tooltip = lingo.tooltips[type == "numCols" ? type : this.getNextValue(title,type)];
onclick = function() {
config.taggly.toggleTagglyOpt(title,type);
return false;
}
}
// hide button because commas don't have columns
if (!(this.getTagglyOpt(title,"listMode") == "commas" && type == "numCols"))
createTiddlyButton(place,label,tooltip,onclick,type == "hideState" ? "hidebutton" : "button");
},
makeColumns: function(orig,numCols) {
var listSize = orig.length;
var colSize = listSize/numCols;
var remainder = listSize % numCols;
var upperColsize = colSize;
var lowerColsize = colSize;
if (colSize != Math.floor(colSize)) {
// it's not an exact fit so..
upperColsize = Math.floor(colSize) + 1;
lowerColsize = Math.floor(colSize);
}
var output = [];
var c = 0;
for (var j=0;j<numCols;j++) {
var singleCol = [];
var thisSize = j < remainder ? upperColsize : lowerColsize;
for (var i=0;i<thisSize;i++)
singleCol.push(orig[c++]);
output.push(singleCol);
}
return output;
},
drawTable: function(place,columns,theClass) {
var newTable = createTiddlyElement(place,"table",null,theClass);
var newTbody = createTiddlyElement(newTable,"tbody");
var newTr = createTiddlyElement(newTbody,"tr");
for (var j=0;j<columns.length;j++) {
var colOutput = "";
for (var i=0;i<columns[j].length;i++)
colOutput += columns[j][i];
var newTd = createTiddlyElement(newTr,"td",null,"tagglyTagging"); // todo should not need this class
wikify(colOutput,newTd);
}
return newTable;
},
createTagglyList: function(place,title) {
switch(this.getTagglyOpt(title,"listMode")) {
case "group": return this.createTagglyListGrouped(place,title); break;
case "normal": return this.createTagglyListNormal(place,title,false); break;
case "commas": return this.createTagglyListNormal(place,title,true); break;
case "sitemap":return this.createTagglyListSiteMap(place,title); break;
}
},
getTaggingCount: function(title) {
// thanks to Doug Edmunds
if (this.config.showTaggingCounts) {
var tagCount = store.getTaggedTiddlers(title).length;
if (tagCount > 0)
return " ("+tagCount+")";
}
return "";
},
getExcerpt: function(inTiddlerTitle,title,indent) {
if (!indent)
indent = 1;
var displayMode = this.getTagglyOpt(inTiddlerTitle,"excerpts");
var t = store.getTiddler(title);
if (t && displayMode == "excerpts") {
var text = t.text.replace(/\n/," ");
var marker = text.indexOf(this.config.excerptMarker);
if (marker != -1) {
return " {{excerpt{<nowiki>" + text.substr(0,marker) + "</nowiki>}}}";
}
else if (text.length < this.config.excerptSize) {
return " {{excerpt{<nowiki>" + t.text + "</nowiki>}}}";
}
else {
return " {{excerpt{<nowiki>" + t.text.substr(0,this.config.excerptSize) + "..." + "</nowiki>}}}";
}
}
else if (t && displayMode == "contents") {
return "\n{{contents indent"+indent+"{\n" + t.text + "\n}}}";
}
else if (t && displayMode == "sliders") {
return "<slider slide>\n{{contents{\n" + t.text + "\n}}}\n</slider>";
}
else if (t && displayMode == "descr") {
var descr = store.getTiddlerSlice(title,'Description');
return descr ? " {{excerpt{" + descr + "}}}" : "";
}
else if (t && displayMode == "slices") {
var result = "";
var slices = store.calcAllSlices(title);
for (var s in slices)
result += "|%0|<nowiki>%1</nowiki>|\n".format([s,slices[s]]);
return result ? "\n{{excerpt excerptIndent{\n" + result + "}}}" : "";
}
return "";
},
notHidden: function(t,inTiddler) {
if (typeof t == "string")
t = store.getTiddler(t);
return (!t || !t.tags.containsAny(this.config.excludeTags) ||
(inTiddler && this.config.excludeTags.contains(inTiddler)));
},
// this is for normal and commas mode
createTagglyListNormal: function(place,title,useCommas) {
var list = store.getTaggedTiddlers(title,this.getTagglyOpt(title,"sortBy"));
if (this.getTagglyOpt(title,"sortOrder") == "desc")
list = list.reverse();
var output = [];
var first = true;
for (var i=0;i<list.length;i++) {
if (this.notHidden(list[i],title)) {
var countString = this.getTaggingCount(list[i].title);
var excerpt = this.getExcerpt(title,list[i].title);
if (useCommas)
output.push((first ? "" : ", ") + "[[" + list[i].title + "]]" + countString + excerpt);
else
output.push("*[[" + list[i].title + "]]" + countString + excerpt + "\n");
first = false;
}
}
return this.drawTable(place,
this.makeColumns(output,useCommas ? 1 : parseInt(this.getTagglyOpt(title,"numCols"))),
useCommas ? "commas" : "normal");
},
// this is for the "grouped" mode
createTagglyListGrouped: function(place,title) {
var sortBy = this.getTagglyOpt(title,"sortBy");
var sortOrder = this.getTagglyOpt(title,"sortOrder");
var list = store.getTaggedTiddlers(title,sortBy);
if (sortOrder == "desc")
list = list.reverse();
var leftOvers = []
for (var i=0;i<list.length;i++)
leftOvers.push(list[i].title);
var allTagsHolder = {};
for (var i=0;i<list.length;i++) {
for (var j=0;j<list[i].tags.length;j++) {
if (list[i].tags[j] != title) { // not this tiddler
if (this.notHidden(list[i].tags[j],title)) {
if (!allTagsHolder[list[i].tags[j]])
allTagsHolder[list[i].tags[j]] = "";
if (this.notHidden(list[i],title)) {
allTagsHolder[list[i].tags[j]] += "**[["+list[i].title+"]]"
+ this.getTaggingCount(list[i].title) + this.getExcerpt(title,list[i].title) + "\n";
leftOvers.setItem(list[i].title,-1); // remove from leftovers. at the end it will contain the leftovers
}
}
}
}
}
var allTags = [];
for (var t in allTagsHolder)
allTags.push(t);
var sortHelper = function(a,b) {
if (a == b) return 0;
if (a < b) return -1;
return 1;
};
allTags.sort(function(a,b) {
var tidA = store.getTiddler(a);
var tidB = store.getTiddler(b);
if (sortBy == "title") return sortHelper(a,b);
else if (!tidA && !tidB) return 0;
else if (!tidA) return -1;
else if (!tidB) return +1;
else return sortHelper(tidA[sortBy],tidB[sortBy]);
});
var leftOverOutput = "";
for (var i=0;i<leftOvers.length;i++)
if (this.notHidden(leftOvers[i],title))
leftOverOutput += "*[["+leftOvers[i]+"]]" + this.getTaggingCount(leftOvers[i]) + this.getExcerpt(title,leftOvers[i]) + "\n";
var output = [];
if (sortOrder == "desc")
allTags.reverse();
else if (leftOverOutput != "")
// leftovers first...
output.push(leftOverOutput);
for (var i=0;i<allTags.length;i++)
if (allTagsHolder[allTags[i]] != "")
output.push("*[["+allTags[i]+"]]" + this.getTaggingCount(allTags[i]) + this.getExcerpt(title,allTags[i]) + "\n" + allTagsHolder[allTags[i]]);
if (sortOrder == "desc" && leftOverOutput != "")
// leftovers last...
output.push(leftOverOutput);
return this.drawTable(place,
this.makeColumns(output,parseInt(this.getTagglyOpt(title,"numCols"))),
"grouped");
},
// used to build site map
treeTraverse: function(title,depth,sortBy,sortOrder) {
var list = store.getTaggedTiddlers(title,sortBy);
if (sortOrder == "desc")
list.reverse();
var indent = "";
for (var j=0;j<depth;j++)
indent += "*"
var childOutput = "";
for (var i=0;i<list.length;i++)
if (list[i].title != title)
if (this.notHidden(list[i].title,this.config.inTiddler))
childOutput += this.treeTraverse(list[i].title,depth+1,sortBy,sortOrder);
if (depth == 0)
return childOutput;
else
return indent + "[["+title+"]]" + this.getTaggingCount(title) + this.getExcerpt(this.config.inTiddler,title,depth) + "\n" + childOutput;
},
// this if for the site map mode
createTagglyListSiteMap: function(place,title) {
this.config.inTiddler = title; // nasty. should pass it in to traverse probably
var output = this.treeTraverse(title,0,this.getTagglyOpt(title,"sortBy"),this.getTagglyOpt(title,"sortOrder"));
return this.drawTable(place,
this.makeColumns(output.split(/(?=^\*\[)/m),parseInt(this.getTagglyOpt(title,"numCols"))), // regexp magic
"sitemap"
);
},
macros: {
tagglyTagging: {
handler: function (place,macroName,params,wikifier,paramString,tiddler) {
var refreshContainer = createTiddlyElement(place,"div");
// do some refresh magic to make it keep the list fresh - thanks Saq
refreshContainer.setAttribute("refresh","macro");
refreshContainer.setAttribute("macroName",macroName);
if (params[0])
refreshContainer.setAttribute("title",params[0]);
else {
refreshContainer.setAttribute("title",tiddler.title);
}
this.refresh(refreshContainer);
},
refresh: function(place) {
var title = place.getAttribute("title");
removeChildren(place);
addClass(place,"tagglyTagging");
if (store.getTaggedTiddlers(title).length > 0) {
var lingo = config.taggly.lingo;
config.taggly.createListControl(place,title,"hideState");
if (config.taggly.getTagglyOpt(title,"hideState") == "show") {
createTiddlyElement(place,"span",null,"tagglyLabel",lingo.labels.label.format([title]));
config.taggly.createListControl(place,title,"title");
config.taggly.createListControl(place,title,"modified");
config.taggly.createListControl(place,title,"created");
config.taggly.createListControl(place,title,"listMode");
config.taggly.createListControl(place,title,"excerpts");
config.taggly.createListControl(place,title,"numCols");
config.taggly.createTagglyList(place,title);
}
}
}
}
},
// todo fix these up a bit
styles: [
"/*{{{*/",
"/* created by TagglyTaggingPlugin */",
".tagglyTagging { padding-top:0.5em; }",
".tagglyTagging li.listTitle { display:none; }",
".tagglyTagging ul {",
" margin-top:0px; padding-top:0.5em; padding-left:2em;",
" margin-bottom:0px; padding-bottom:0px;",
"}",
".tagglyTagging { vertical-align: top; margin:0px; padding:0px; }",
".tagglyTagging table { margin:0px; padding:0px; }",
".tagglyTagging .button { visibility:hidden; margin-left:3px; margin-right:3px; }",
".tagglyTagging .button, .tagglyTagging .hidebutton {",
" color:[[ColorPalette::TertiaryLight]]; font-size:90%;",
" border:0px; padding-left:0.3em;padding-right:0.3em;",
"}",
".tagglyTagging .button:hover, .hidebutton:hover, ",
".tagglyTagging .button:active, .hidebutton:active {",
" border:0px; background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]];",
"}",
".selected .tagglyTagging .button { visibility:visible; }",
".tagglyTagging .hidebutton { color:[[ColorPalette::Background]]; }",
".selected .tagglyTagging .hidebutton { color:[[ColorPalette::TertiaryLight]] }",
".tagglyLabel { color:[[ColorPalette::TertiaryMid]]; font-size:90%; }",
".tagglyTagging ul {padding-top:0px; padding-bottom:0.5em; margin-left:1em; }",
".tagglyTagging ul ul {list-style-type:disc; margin-left:-1em;}",
".tagglyTagging ul ul li {margin-left:0.5em; }",
".editLabel { font-size:90%; padding-top:0.5em; }",
".tagglyTagging .commas { padding-left:1.8em; }",
"/* not technically tagglytagging but will put them here anyway */",
".tagglyTagged li.listTitle { display:none; }",
".tagglyTagged li { display: inline; font-size:90%; }",
".tagglyTagged ul { margin:0px; padding:0px; }",
".excerpt { color:[[ColorPalette::TertiaryDark]]; }",
".excerptIndent { margin-left:4em; }",
"div.tagglyTagging table,",
"div.tagglyTagging table tr,",
"td.tagglyTagging",
" {border-style:none!important; }",
".tagglyTagging .contents { border-bottom:2px solid [[ColorPalette::TertiaryPale]]; padding:0 1em 1em 0.5em;",
" margin-bottom:0.5em; }",
".tagglyTagging .indent1 { margin-left:3em; }",
".tagglyTagging .indent2 { margin-left:4em; }",
".tagglyTagging .indent3 { margin-left:5em; }",
".tagglyTagging .indent4 { margin-left:6em; }",
".tagglyTagging .indent5 { margin-left:7em; }",
".tagglyTagging .indent6 { margin-left:8em; }",
".tagglyTagging .indent7 { margin-left:9em; }",
".tagglyTagging .indent8 { margin-left:10em; }",
".tagglyTagging .indent9 { margin-left:11em; }",
".tagglyTagging .indent10 { margin-left:12em; }",
"/*}}}*/",
""].join("\n"),
init: function() {
merge(config.macros,this.macros);
config.shadowTiddlers["TagglyTaggingStyles"] = this.styles;
store.addNotification("TagglyTaggingStyles",refreshStyles);
}
};
config.taggly.init();
//}}}
/***
InlineSlidersPlugin
By Saq Imtiaz
http://tw.lewcid.org/sandbox/#InlineSlidersPlugin
// syntax adjusted to not clash with NestedSlidersPlugin
// added + syntax to start open instead of closed
***/
//{{{
config.formatters.unshift( {
name: "inlinesliders",
// match: "\\+\\+\\+\\+|\\<slider",
match: "\\<slider",
// lookaheadRegExp: /(?:\+\+\+\+|<slider) (.*?)(?:>?)\n((?:.|\n)*?)\n(?:====|<\/slider>)/mg,
lookaheadRegExp: /(?:<slider)(\+?) (.*?)(?:>)\n((?:.|\n)*?)\n(?:<\/slider>)/mg,
handler: function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart ) {
var btn = createTiddlyButton(w.output,lookaheadMatch[2] + " "+"\u00BB",lookaheadMatch[2],this.onClickSlider,"button sliderButton");
var panel = createTiddlyElement(w.output,"div",null,"sliderPanel");
panel.style.display = (lookaheadMatch[1] == '+' ? "block" : "none");
wikify(lookaheadMatch[3],panel);
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
},
onClickSlider : function(e) {
if(!e) var e = window.event;
var n = this.nextSibling;
n.style.display = (n.style.display=="none") ? "block" : "none";
return false;
}
});
//}}}
/***
|''Name:''|TiddlerListMacro|
|''Version:''|2.3 (8-Jan-2008)|
|''Source''|http://jackparke.googlepages.com/jtw.html#TiddlerListMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23TiddlerListMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
|''Documentation:''|http://jackparke.googlepages.com/jtw.html#TiddlerListMacroDoc|
!Usage
{{{<<tiddlerList parameter1:"value1" parameter2:"value2" ...>>}}}
See TiddlerListMacroDocumentation and TiddlerListMacroExamples
!Code
***/
//{{{
version.extensions.tiddlerList = {major: 2, minor: 3, revision: 0, date: new Date("Jan 08, 2008")};
// template = [header, item, separator, group, footer]
config.macros.tiddlerList={
formats : {list:true, nlist:true, span:true, stack:true, csv:true, table:true},
templates : {
list : [ "%0\n", "* %0\n", "", "%group\n", "%0\n"],
nlist : [ "%0", "# %0\n", "", "%group\n", "%0\n"],
span : [ "%0", "%0", " ", "%group", "%0"],
stack : [ "%0", "%0", "\n", "%group", "%0"],
csv : [ "%0", "%0", ", ", "%0", "%0\n"],
table : ["|!%0|\n", "|%0|\n", "", "|%group|\n", "|%0|\n"]
},
dateFormat : "DD MMM YYYY"
}
if (typeof gCurrentTiddler == 'undefined')
var gCurrentTiddler;
config.macros.tiddlerList.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
// Some globals
var count=0, groupCount=0, theGroup="", lastGroup="", firstInGroup = false;
var currentTiddler = tiddler;
gCurrentTiddler = tiddler;
var listWikiText="";
var formats = this.formats;
// SQL-Like parameters
var parameters = paramString.parseParams("name",null,true);
var pTags = parameters[0]["tags"]?parameters[0]["tags"][0].split(','):[];
var pOrder = parameters[0]["order"]?parameters[0]["order"][0]:"title";
var pTop = parameters[0]["top"]?parameters[0]["top"][0]:-1;
var pText = parameters[0]["text"]?parameters[0]["text"][0]:"";
var pTitle = parameters[0]["title"]?parameters[0]["title"][0]:"";
var pSearch = parameters[0]["search"]?parameters[0]["search"][0]:"";
var pFilter = parameters[0]["filter"]?parameters[0]["filter"][0]:"";
var pHeader = parameters[0]["header"]?paramFormat(parameters[0]["header"][0]):"";
var pFooter = parameters[0]["footer"]?paramFormat(parameters[0]["footer"][0]):"";
var pGroup = parameters[0]["group"]?parameters[0]["group"][0]:"";
var pDateFormat = parameters[0]["dateFormat"]?parameters[0]["dateFormat"][0]:this.dateFormat;
var pCustomParameter = parameters[0]["customParameter"]?parameters[0]["customParameter"][0]:"";
var pFormat = parameters[0]["format"]?parameters[0]["format"][0]:"list";
pFormat = formats[pFormat]?pFormat:"list"
// Separator
var pSeparator = parameters[0]["separator"]?paramFormat(parameters[0]["separator"][0]):(parameters[0]["seperator"]?paramFormat(parameters[0]["seperator"][0]):this.templates[pFormat][2])
// Template for group
var pGroupTemplate = this.templates[pFormat][3];
if (parameters[0]["groupTemplate"])
pGroupTemplate = paramFormat(parameters[0]["groupTemplate"][0])
pGroupTemplate = pGroupTemplate.replace(/\$\)\)/g, ">>")
// Template for group footer
var pGroupFooterTemplate = "";
if (parameters[0]["groupFooterTemplate"])
pGroupFooterTemplate = paramFormat(parameters[0]["groupFooterTemplate"][0]);
pGroupFooterTemplate = pGroupFooterTemplate.replace(/\$\)\)/g, ">>");
// Template for item
var pItemTemplate = this.templates[pFormat][1];
if (parameters[0]["itemTemplate"])
pItemTemplate = paramFormat(parameters[0]["itemTemplate"][0])
pItemTemplate = pItemTemplate.replace(/\$\)\)/g, ">>").replace(/%link/g, "%0").replace(/%item/g, "%1").replace(/%abstract/g, "%2").replace(/%text/g, "%3").replace(/%created/g, "%4").replace(/%modified/g, "%5").replace(/%modifier/g, "%6").replace(/%group/g, "%7").replace(/%title/g, "%8").replace(/%tags/g, "%9").replace(/%nolink/g, "%10").replace(/%custom/g, "%11")
// Template for footer
var pFooterTemplate = this.templates[pFormat][4].replace(/%count/g, "%1")
// Get all tiddlers
var tiddlers = store.reverseLookup("tags","",false);
// Sorting
if(!pOrder)
pOrder = "title";
if (pOrder.match(/^\-/i)) {
pOrder = pOrder.substr(1)
var sortDesc = true;
}
// Sorting on a standard field
if (pOrder.match(/(title)|(text)|(modifier)|(modified)|(created)|(tags)/))
if (sortDesc)
tiddlers.sort(function (a,b) {if(a[pOrder] == b[pOrder]) return(0); else return (a[pOrder] > b[pOrder]) ? -1 : +1; });
else
tiddlers.sort(function (a,b) {if(a[pOrder] == b[pOrder]) return(0); else return (a[pOrder] < b[pOrder]) ? -1 : +1; });
else
if (sortDesc)
tiddlers.sort(function (a,b) {if(a.fields[pOrder] == b.fields[pOrder]) return(0); else return (a.fields[pOrder] > b.fields[pOrder]) ? -1 : +1; });
else
tiddlers.sort(function (a,b) {if(a.fields[pOrder] == b.fields[pOrder]) return(0); else return (a.fields[pOrder] < b.fields[pOrder]) ? -1 : +1; });
// Header
if (pHeader)
listWikiText += formatItem(this.templates[pFormat][0], [pHeader], pFormat)
for(var t=0; t<tiddlers.length; t++) {
tiddler = tiddlers[t];
if (pText!="" && tiddler.text=="") tiddler.text=store.getValue(tiddler, 'text')
if (pTop==-1 || count<pTop) {
if (pText=="" || tiddler.text.match(pText)) {
if (pTitle=="" || tiddler.title.match(pTitle)) {
if (pSearch=="" || (tiddler.title.match(pSearch) || tiddler.text.match(pSearch))) {
if (pFilter=="" || eval(pFilter)) {
if (pTags.length==0 || compareArrays(tiddler.tags, pTags, "all")) {
count++;
if (tiddler.text=="") tiddler.text=store.getValue(tiddler, 'text')
// Grouping
if (pGroup) {
theGroup = eval(pGroup);
if(theGroup != lastGroup) {
groupCount++;firstInGroup = true;
if (pGroupFooterTemplate && groupCount>1)
listWikiText += pGroupFooterTemplate.replace("%group", theGroup)
listWikiText += pGroupTemplate.replace("%group", theGroup)
lastGroup = theGroup;
} else
firstInGroup = false;
}
// Separators
if (count>1 && !firstInGroup) listWikiText += pSeparator;
//Plaintext title
var noLink = tiddler.title.match(config.textPrimitives.wikiLink)?"~" + tiddler.title:tiddler.title;
// Custom parameter
if (pCustomParameter)
var custom="";
try {
custom = eval(pCustomParameter)
} catch (e) {}
// List individual tiddler
var strItem = formatItem(pItemTemplate,["[[" + tiddler.title + "]]",count,tiddler.text.substr(0,300),tiddler.text,tiddler.created.formatString(pDateFormat),tiddler.modified.formatString(pDateFormat),tiddler.modifier,theGroup,tiddler.title,(tiddler.tags.length>0?"[["+tiddler.tags.join("]], [[")+"]]":""),noLink,custom], pFormat)
for (var fld in tiddler.fields) strItem = strItem.replace('%field.' + fld, tiddler.fields[fld]);
listWikiText += strItem
}
}
}
}
}
}
}
// Last group footer
if (pGroup && pGroupFooterTemplate && count>0)
listWikiText += pGroupFooterTemplate.replace("%group", theGroup)
// Footer
if (pFooter) {
pFooter = pFooter.replace("%count", count)
listWikiText += formatItem(pFooterTemplate, [pFooter], pFormat)
}
// Render result
if (!parameters[0]["debug"])
wikify(listWikiText,place, null, currentTiddler)
else
place.innerHTML = "<textarea style=\"width:100%;\" rows=30>" + listWikiText + "</textarea>"
// Local functions
function paramFormat(param) {
// Allow "\n" in non evalled parameters
return param.replace(/\\n/g, "\n");
}
function formatItem(template, values, format) {
// Fill template with values (depending on list format)
if (format.match(/table/) && values[0].match(/\|/))
return ("%0\n").format(values)
else
return template.format(values)
}
function compareArrays(array, values, logic) {
// Compare items in array with AND("all") or OR("any") logic
var matches=0;
for(var v=0; v<values.length; v++)
if(values[v].replace(/^\s+|\s+$/g,"").match(/^\-/) && !array.contains(values[v].replace(/^\s+|\s+$/g,"").substr(1)))
matches++;
else if (array.contains(values[v]))
matches++;
return ((logic=="all" && matches==values.length) || (logic!="all" && matches>0))
}
}
String.prototype.prettyTrim = function(len,prefix,postfix) {
var result = this.trim().replace(/\r\n/g,' ').replace(/\n/g,' ');
if (!prefix) prefix = '';
if (!postfix) postfix = '';
if (result.length > len - 3)
return prefix + result.substr(0,len) + '...' + postfix;
else if (result.length > 0)
return prefix + result + postfix;
else
return result;
}
//}}}
/***
|''Name:''|TiddlersBarPlugin|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed.
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab = config.options.chkHideTabsBarWhenSingleTab ? config.options.chkHideTabsBarWhenSingleTab : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "closeOthers";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
tooltip : "see ",
tooltipClose : "click here to close this tab",
tooltipSave : "click here to save this tab",
promptRename : "Enter tiddler new name",
currentTiddler : "",
previousState : false,
previousKey : config.options.txtPreviousTabKey,
nextKey : config.options.txtNextTabKey,
tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
handler: function(place,macroName,params) {
var previous = null;
if (config.macros.tiddlersBar.isShown())
story.forEachTiddler(function(title,e){
if (title==config.macros.tiddlersBar.currentTiddler){
var d = createTiddlyElement(null,"span",null,"tab tabSelected");
config.macros.tiddlersBar.createActiveTabButton(d,title);
if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
previous = "active";
}
else {
var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
btn.setAttribute("tiddler", title);
if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
previous=btn;
}
var isDirty =story.isDirty(title);
var c = createTiddlyButton(d,isDirty ?"!":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
c.setAttribute("tiddler", title);
if (place.childNodes) {
place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
place.insertBefore(d,place.firstChild);
}
else place.appendChild(d);
})
},
refresh: function(place,params){
removeChildren(place);
config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
story.refreshAllTiddlers();
if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
}
},
isShown : function(){
if (config.options.chkDisableTabsBar) return false;
if (!config.options.chkHideTabsBarWhenSingleTab) return true;
var cpt=0;
story.forEachTiddler(function(){cpt++});
return (cpt>1);
},
selectNextTab : function(){ //used when the current tab is closed (to select another tab)
var previous="";
story.forEachTiddler(function(title){
if (!config.macros.tiddlersBar.currentTiddler) {
story.displayTiddler(null,title);
return;
}
if (title==config.macros.tiddlersBar.currentTiddler) {
if (previous) {
story.displayTiddler(null,previous);
return;
}
else config.macros.tiddlersBar.currentTiddler=""; // so next tab will be selected
}
else previous=title;
});
},
onSelectTab : function(e){
var t = this.getAttribute("tiddler");
if (t) story.displayTiddler(null,t);
return false;
},
onTabClose : function(e){
var t = this.getAttribute("tiddler");
if (t) {
//tbGTD Why? if(story.hasChanges(t) && !readOnly) if(!confirm(config.commands.cancelTiddler.warning.format([t]))) return false;
story.closeTiddler(t);
}
return false;
},
onTabSave : function(e) {
var t = this.getAttribute("tiddler");
if (!e) e=window.event;
if (t) config.commands.saveTiddler.handler(e,null,t);
return false;
},
onSelectedTabButtonClick : function(event,src,title) {
var t = this.getAttribute("tiddler");
if (!event) event=window.event;
if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
return false;
},
onTiddlersBarAction: function(event) {
var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
},
createActiveTabButton : function(place,title) {
if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
btn.setAttribute("tiddler", title);
}
else
createTiddlyText(place,title);
}
}
story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;
story.closeTiddler = function(title,animate,unused) {
if (title==config.macros.tiddlersBar.currentTiddler)
config.macros.tiddlersBar.selectNextTab();
story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;
if (config.macros.tiddlersBar.isShown()) {
story.forEachTiddler(function(t,e){
if (t!=title) e.style.display="none";
else e.style.display="";
})
config.macros.tiddlersBar.currentTiddler=title;
}
var e=document.getElementById("tiddlersBar");
if (e){config.macros.tiddlersBar.refresh(e,null);}
if(config.options.chkSinglePagePermalink){
var sUrl=encodeURIComponent(String.encodeTiddlyLink(title));
window.location.hash = sUrl;
config.lastURL = window.location.hash;
document.title = wikifyPlain("SiteTitle") + " - " + title;
if(window.atREFRESH)window.atREFRESH();
}
}
var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
coreRefreshPageTemplate(title);
if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}
// tb: code cleanup and different highlight for selected tab
var barStyle
barStyle = "/*{{{*/\n"
+ ".tiddler {border: 3px solid [[ColorPalette::TertiaryPale]];border-left-width:2px;border-top-width:2px;clear:both;z-index:10;}\n"
+ "#tiddlersBar {z-index:0;}\n"
+ "#tiddlersBar .tab:hover {border-color:[[ColorPalette::SecondaryMid]];}\n"
+ "#tiddlersBar .tab {display:block;float:left;margin:3px 3px 0 0;padding: 2px 4px;}\n"
+ "#tiddlersBar .tabUnselected .tabButton, #tiddlersBar .tabSelected .tabButton {padding : 0 2px; margin: 0 0 0 2px;}\n"
+ "#tiddlersBar .tab {white-space:nowrap;border:0;border-top:2px solid [[ColorPalette::TertiaryMid]];border-bottom:2px solid [[ColorPalette::TertiaryPale]];margin-bottom:-2px;background:[[ColorPalette::TertiaryMid]];}\n"
+ "#tiddlersBar .button {border:0;color:[[ColorPalette::Foreground]];}\n"
+ "#tiddlersBar {padding:0 0 0 1%;marign:0;max-width:84%;}\n"
+ "#tiddlersBar .tabButton:hover, #tiddlersBar .button:hover, #tiddlersBar .tab:hover {color:[[ColorPalette::Background]];background:[[ColorPalette::SecondaryMid]]}\n"
+ "#tiddlersBar .tabSelected {background:[[ColorPalette::Background]];border:2px solid [[ColorPalette::TertiaryPale]];border-bottom:2px solid [[ColorPalette::Background]];margin-bottom:-2px;}\n"
+ "#tiddlersBar .tabSelected .button:hover{background:transparent;color:[[ColorPalette::Background]];}\n"
+ "#tiddlersBar .tabContents {border:1px [[ColorPalette::TertiaryMid]] solid;}\n"
+ "/*}}}*/";
config.shadowTiddlers.StyleSheetTiddlersBar = barStyle;
store.addNotification("StyleSheetTiddlersBar", refreshStyles);
config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");
//}}}
/%all tiddlers tagged with tags after 'with:' will be excluded %/<<tiddler scripts##tidsByTags with: tbGTD>>
[[manage the TagCloud...|TagCloud]]
The [[wiki|http://www.tiddlywiki.com]] that makes all this possible.
/***
!!usage
In edit-mode, the following will be replaced when you save the tiddler
* {ts} or {t} -> timestamp
* {ds} or {d} -> datestamp
Configure ''timeFormat'' and ''dateFormat'' to your needs.
!all praises go to
[[InstantTimestampPlugin@MPTW|http://mptw.tiddlyspot.com/#InstantTimestampPlugin]]
!source
***/
//{{{
config.timeStampGTD={
timeFormat:'YYYY-0MM-0DD 0hh:0mm',
dateFormat:'YYYY-0MM-0DD',
excludeTags:['systemConfig'],
excludeTiddlers:[],
formats:[
[/\{ts?\}(?!\}\})/ig,"'{{ts{'+t.formatString(config.timeStampGTD.timeFormat)+'}}}'"],
[/\{ds?\}(?!\}\})/ig,"'{{ds{'+t.formatString(config.timeStampGTD.dateFormat)+'}}}'"]
]
}
TiddlyWiki.prototype.saveTiddler_tbGTD=TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler=function(title,newTitle,newBody,modifier,modified,tags,fields,clearChangeCount,created){
var t,f,i,c=config.timeStampGTD;
tags=tags?tags:[];tags=(typeof(tags)=="string")?tags.readBracketedList():tags;
if(!tags.containsAny(c.excludeTags)&&!c.excludeTiddlers.contains(newTitle)){
t=new Date();f=c.formats;
for(var i=0;i<f.length;i++)newBody=newBody.replace(f[i][0],eval(f[i][1]));
}
return this.saveTiddler_tbGTD.apply(this, arguments);
}
setStylesheet(".ts,.ds {font-weight:bold;color:#666;}","TimeStampStyles");
//}}}
The guy who took the time to design this nice TiddlyWiki flavour...
Is the same as ...[[Tobias]]
/***
|''Name:''|ToggleSideBarTB|
|''Description''|allows to toggle left and right sidebar|
|''Version:''|1.0|
|''Type''|macro|
|''Author:''|[[TobiasBeer]]|
|''Info:''|http://tbgtd.tiddlyspot.com/#ToggleSideBarTB|
|''Source:''|http://tbgtd.tiddlyspot.com/#ToggleSideBarTB|
|''License''|[[Creative Commons Attribution-Share Alike 3.0|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion''|2.xx|
!Code
***/
//{{{
config.macros.toggleSideBarTB={
settings:{
arr1:"â–º",arr2:"â—„",
leftBarID:"mainMenu",leftBarLbl:"main menu",
leftBarHide:"margin-left:1em;",leftBarShow:"margin-left:10.1em;",
rightBarID:"sidebar",rightBarLbl:"sidebar",
rightBarHide:"margin-right:1em;",rightBarShow:"margin-right:17.1em;"
},
handler:function(place,macroName,params,wikifier,paramString,tiddler){
var l=params[0]&¶ms[0]=="left";
var h=params[1]&¶ms[1]=="hide";
var no=params[2]&¶ms[2]=="notip";
var s=this.settings;
var el=l?s.leftBarID:s.rightBarID;
var btnId="ToggleSideBar"+(l?"Left":"Right");
var arr=l?(h?s.arr1:s.arr2):(h?s.arr2:s.arr1);
var lbl=(no?'':"toggle "+(l?s.leftBarLbl:s.rightBarLbl));
var fct=function(){config.macros.toggleSideBarTB.toggle(btnId)};
document.getElementById(el).setAttribute("toggle",(h?"show":"hide"));
createTiddlyButton(place,arr,lbl,fct,"button HideSideBarButton",btnId);
},
toggle:function(btnId){
var btn=document.getElementById(btnId);
var l=btn.id=="ToggleSideBarLeft";
var s=config.macros.toggleSideBarTB.settings;
var bl=document.getElementById(s.leftBarID);
var br=document.getElementById(s.rightBarID);
var bar=(l?bl:br);
var hl=bl.getAttribute("toggle")=='show';if(l)hl=!hl;
var hr=br.getAttribute("toggle")=='show';if(!l)hr=!hr;
var h=(l?hl:hr);
setStylesheet("#contentWrapper #displayArea {"+
(hl?s.leftBarHide:s.leftBarShow)+
(hr?s.rightBarHide:s.rightBarShow)+
"}","ToggleSideBarStyles");
bar.style.display=h?"none":"block";
bar.setAttribute("toggle",(h?"show":"hide"));
arr1=l?s.arr2:s.arr1;arr2=l?s.arr1:s.arr2;
btn.innerHTML=h?arr2:arr1;
}
}
//}}}
/***
An under construction replacement for toggleTag
<<tTag mode:text text:D tag:Done>>
<<tTag mode:text text:N tag:Next>>
***/
//{{{
merge(config.macros,{
tTag: {
createIfRequired: true,
shortLabel: "[[%0]]",
longLabel: "[[%0]] [[%1]]",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var parsedParams = paramString.parseParams("tags",null,true);
if (!tiddler)
tiddler = store.getTiddler(getParam(parsedParams,"title"));
var tag = getParam(parsedParams,"tag","checked");
var title = getParam(parsedParams,"title",tiddler.title);
var refreshAll = getParam(parsedParams,"refreshAll",false);
var defaultLabel = (title == tiddler.title ? this.shortLabel : this.longLabel);
var label = getParam(parsedParams,"label",defaultLabel);
var theTiddler = title == tiddler.title ? tiddler : store.getTiddler(title);
var mode = getParam(parsedParams,"mode","checkbox");
var theClass = getParam(parsedParams,"class",tag+"Button");
var currentValue = theTiddler &&
(macroName == "tTag" ? theTiddler.isTagged(tag) : store.getValue(theTiddler,tag)=="true");
if (mode == "checkbox") {
// create the checkbox
var cb = createTiddlyCheckbox(place, label.format([tag,title]), currentValue, function(e) {
if (!store.tiddlerExists(title)) {
if (config.macros.tTag.createIfRequired) {
var content = store.getTiddlerText(title); // just in case it's a shadow
store.saveTiddler(title,title,content?content:"",config.options.txtUserName,new Date(),null);
}
else
return false;
}
//store.suspendNotifications();
if (macroName == "tTag")
store.setTiddlerTag(title,this.checked,tag);
else // it must be tField
store.setValue(title,tag,this.checked?"true":null);
if (refreshAll) {
story.forEachTiddler(function(title,element) {
if (element.getAttribute("dirty") != "true")
story.refreshTiddler(title,false,true);
});
}
//store.resumeNotifications();
return true;
});
}
else if (mode == "text") {
var text = getParam(parsedParams,"text","X");
var cl = createTiddlyButton(place, text, "Toggle "+text, function(e) {
if(!e) var e = window.event;
if (!store.tiddlerExists(title)) {
if (config.macros.tTag.createIfRequired) {
var content = store.getTiddlerText(title); // just in case it's a shadow
store.saveTiddler(title,title,content?content:"",config.options.txtUserName,new Date(),null);
}
else
return false;
}
//store.suspendNotifications();
var currentState = this.getAttribute("state")=="true";
var newState = !currentState;
store.setTiddlerTag(title,newState,tag);
if (macroName == "tTag")
store.setTiddlerTag(title,newState,tag);
else // it must be tField
store.setValue(title,tag,newState?"true":null);
// this is terrible please refactor
if (currentState) {
cl.setAttribute("state","false");
removeClass(cl,"on");
addClass(cl,"off");
}
else {
cl.setAttribute("state","true");
removeClass(cl,"off");
addClass(cl,"on");
}
//refreshDisplay();
if (refreshAll) {
story.forEachTiddler(function(title,element) {
if (element.getAttribute("dirty") != "true")
story.refreshTiddler(title,false,true);
});
}
//store.resumeNotifications();
e.cancelBubble = true;
if(e.stopPropagation) e.stopPropagation();
return false;
});
addClass(cl,theClass.replace(/ /g,''));
if (currentValue) {
cl.setAttribute("state","true");
removeClass(cl,"off");
addClass(cl,"on");
}
else {
cl.setAttribute("state","false");
removeClass(cl,"on");
addClass(cl,"off");
}
}
else if (mode == "popup") {
var cl = createTiddlyButton(place, "zzz", "Toggle "+text, function(e) {
// props to Saq
if(!e) var e = window.event;
var popup = Popup.create(this);
createTiddlyButton(createTiddlyElement(popup,"li"),"foo","bar",function(e) {
// under contruction
alert(this.getAttribute("tag"));
});
Popup.show(popup,false);
e.cancelBubble = true;
if(e.stopPropagation) e.stopPropagation();
return false ;
});
}
}
}
});
config.macros.tField = config.macros.tTag;
setStylesheet(["",
".button.off {border-style:none;background:#fff;color:#ccc;}",
".button.on {border-style:none;background:#ddd;color:#000;}",
// 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"
""].join("\n"),"tTag");
//}}}
|~ViewToolbar|refreshTiddler -closeTiddler +editTiddler deleteTiddler > syncing permalink fields <|
|~EditToolbar|+saveTiddler -cancelTiddler|
| tiddlyspot password:|<<option pasUploadPassword>>|
| site management:|<<upload http://evtx.tiddlyspot.com/store.cgi index.html . . evtx>>//(requires tiddlyspot password)//<br>[[control panel|http://evtx.tiddlyspot.com/controlpanel]], [[backups|http://evtx.tiddlyspot.com/backup/]], [[download (go offline)|http://evtx.tiddlyspot.com/download]]|
| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|
/***
Description: Contains the stuff you need to use Tiddlyspot
Note, you also need UploadPlugin, PasswordOptionPlugin and LoadRemoteFileThroughProxy
from http://tiddlywiki.bidix.info for a complete working Tiddlyspot site.
***/
//{{{
// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'evtx';
// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)
window.showBackstage = true; // show backstage too
// disable autosave in d3
if (window.location.protocol != "file:")
config.options.chkGTDLazyAutoSave = false;
// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToTiddlyspot]] ");
MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}
// create some shadow tiddler content
merge(config.shadowTiddlers,{
'TspotOptions':[
"tiddlyspot password:",
"<<option pasUploadPassword>>",
""
].join("\n"),
'TspotControls':[
"| tiddlyspot password:|<<option pasUploadPassword>>|",
"| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
"| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),
'WelcomeToTiddlyspot':[
"This document is a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //What now?// @@ Before you can save any changes, you need to enter your password in the form below. Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
"<<tiddler TspotControls>>",
"See also GettingStarted.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working online// @@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// @@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Help!// @@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// @@ We hope you like using your tiddlyspot.com site. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),
'TspotSidebar':[
"<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n")
});
//}}}
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 16/12/2011 13:32:54 | Lixas | [[/|http://evtx.tiddlyspot.com/#%5B%5BBlog%20Archive%5D%5D]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 16/12/2011 14:08:29 | Lixas | [[/|http://evtx.tiddlyspot.com/#%5B%5BBlog%20Archive%5D%5D]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 16/12/2011 14:32:08 | Lixas | [[/|http://evtx.tiddlyspot.com/#%5B%5BEVTX%20log%20file%20structure%5D%5D]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 20/12/2011 08:11:15 | Lixas | [[/|http://evtx.tiddlyspot.com/#options]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 20/12/2011 08:21:12 | Lixas | [[evtx.html|file:///C:/Documents%20and%20Settings/I.Bukys/Desktop/evtx.html#options]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 20/12/2011 08:36:29 | Lixas | [[/|http://evtx.tiddlyspot.com/#%5B%5BBlog%20Archive%5D%5D]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 23/12/2011 09:59:10 | Lixas | [[/|http://evtx.tiddlyspot.com/#%5B%5BBlog%20Archive%5D%5D]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 02/02/2012 16:47:07 | Lixas | [[/|http://evtx.tiddlyspot.com/#%5B%5BEVTX%20log%20file%20structure%5D%5D]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
| 09/11/2012 14:58:08 | YourName | [[/|http://evtx.tiddlyspot.com/#options]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . | failed |
| 09/11/2012 14:58:26 | Lixas | [[/|http://evtx.tiddlyspot.com/#options]] | [[store.cgi|http://evtx.tiddlyspot.com/store.cgi]] | . | [[index.html | http://evtx.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
major: 4, minor: 1, revision: 3,
date: new Date("Feb 24, 2008"),
source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
coreVersion: '2.2.0'
};
//
// Environment
//
if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false; // true to activate both in Plugin and UploadService
//
// Upload Macro
//
config.macros.upload = {
// default values
defaultBackupDir: '', //no backup
defaultStoreScript: "store.php",
defaultToFilename: "index.html",
defaultUploadDir: ".",
authenticateUser: true // UploadService Authenticate User
};
config.macros.upload.label = {
promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
promptParamMacro: "Save and Upload this TiddlyWiki in %0",
saveLabel: "save to web",
saveToDisk: "save to disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "No store URL in parmeters or options",
usernameOrPasswordMissing: "Username or password missing"
};
config.macros.upload.handler = function(place,macroName,params) {
if (readOnly)
return;
var label;
if (document.location.toString().substr(0,4) == "http")
label = this.label.saveLabel;
else
label = this.label.uploadLabel;
var prompt;
if (params[0]) {
prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0],
(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
} else {
prompt = this.label.promptOption;
}
createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};
config.macros.upload.action = function(params)
{
// for missing macro parameter set value from options
if (!params) params = {};
var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
var username = params[4] ? params[4] : config.options.txtUploadUserName;
var password = config.options.pasUploadPassword; // for security reason no password as macro parameter
// for still missing parameter set default value
if ((!storeUrl) && (document.location.toString().substr(0,4) == "http"))
storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
if (storeUrl.substr(0,4) != "http")
storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
if (!toFilename)
toFilename = bidix.basename(window.location.toString());
if (!toFilename)
toFilename = config.macros.upload.defaultToFilename;
if (!uploadDir)
uploadDir = config.macros.upload.defaultUploadDir;
if (!backupDir)
backupDir = config.macros.upload.defaultBackupDir;
// report error if still missing
if (!storeUrl) {
alert(config.macros.upload.messages.noStoreUrl);
clearMessage();
return false;
}
if (config.macros.upload.authenticateUser && (!username || !password)) {
alert(config.macros.upload.messages.usernameOrPasswordMissing);
clearMessage();
return false;
}
bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password);
return false;
};
config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir)
{
if (!storeUrl)
return null;
var dest = bidix.dirname(storeUrl);
if (uploadDir && uploadDir != '.')
dest = dest + '/' + uploadDir;
dest = dest + '/' + toFilename;
return dest;
};
//
// uploadOptions Macro
//
config.macros.uploadOptions = {
handler: function(place,macroName,params) {
var wizard = new Wizard();
wizard.createWizard(place,this.wizardTitle);
wizard.addStep(this.step1Title,this.step1Html);
var markList = wizard.getElement("markList");
var listWrapper = document.createElement("div");
markList.parentNode.insertBefore(listWrapper,markList);
wizard.setValue("listWrapper",listWrapper);
this.refreshOptions(listWrapper,false);
var uploadCaption;
if (document.location.toString().substr(0,4) == "http")
uploadCaption = config.macros.upload.label.saveLabel;
else
uploadCaption = config.macros.upload.label.uploadLabel;
wizard.setButtons([
{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption,
onClick: config.macros.upload.action},
{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
]);
},
options: [
"txtUploadUserName",
"pasUploadPassword",
"txtUploadStoreUrl",
"txtUploadDir",
"txtUploadFilename",
"txtUploadBackupDir",
"chkUploadLog",
"txtUploadLogMaxLine"
],
refreshOptions: function(listWrapper) {
var opts = [];
for(i=0; i<this.options.length; i++) {
var opt = {};
opts.push();
opt.option = "";
n = this.options[i];
opt.name = n;
opt.lowlight = !config.optionsDesc[n];
opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
opts.push(opt);
}
var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
for(n=0; n<opts.length; n++) {
var type = opts[n].name.substr(0,3);
var h = config.macros.option.types[type];
if (h && h.create) {
h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
}
}
},
onCancel: function(e)
{
backstage.switchTab(null);
return false;
},
wizardTitle: "Upload with options",
step1Title: "These options are saved in cookies in your browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Cancel",
cancelButtonPrompt: "Cancel prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
};
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
backupSaved: "Backup saved",
backupFailed: "Failed to upload backup file",
rssSaved: "RSS feed uploaded",
rssFailed: "Failed to upload RSS feed file",
emptySaved: "Empty template uploaded",
emptyFailed: "Failed to upload empty template file",
mainSaved: "Main TiddlyWiki file uploaded",
mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
//specific upload
loadOriginalHttpPostError: "Can't get original file",
aboutToSaveOnHttpPost: 'About to upload on %0 ...',
storePhpNotFound: "The store script '%0' was not found."
};
bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
var callback = function(status,uploadParams,original,url,xhr) {
if (!status) {
displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
return;
}
if (bidix.debugMode)
alert(original.substr(0,500)+"\n...");
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.upload.uploadRss(uploadParams,original,posDiv);
};
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
// save on localdisk ?
if (document.location.toString().substr(0,4) == "file") {
var path = document.location.toString();
var localPath = getLocalPath(path);
saveChanges();
}
// get original
var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
var originalPath = document.location.toString();
// If url is a directory : add index.html
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + "index.html";
var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
var log = new bidix.UploadLog();
log.startUpload(storeUrl, dest, uploadDir, backupDir);
displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
if (bidix.debugMode)
alert("about to execute Http - GET on "+originalPath);
var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
bidix.upload.uploadRss = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
bidix.upload.uploadMain(params[0],params[1],params[2]);
} else {
displayMessage(bidix.upload.messages.rssFailed);
}
};
// do uploadRss
if(config.options.chkGenerateAnRssFeed) {
var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
var rssString = generateRss();
// no UnicodeToUTF8 conversion needed when location is "file" !!!
if (document.location.toString().substr(0,4) != "file")
rssString = convertUnicodeToUTF8(rssString);
bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
} else {
bidix.upload.uploadMain(uploadParams,original,posDiv);
}
};
bidix.upload.uploadMain = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
var log = new bidix.UploadLog();
if(status) {
// if backupDir specified
if ((params[3]) && (responseText.indexOf("backupfile:") > -1)) {
var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
}
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
store.setDirty(false);
log.endUpload("ok");
} else {
alert(bidix.upload.messages.mainFailed);
displayMessage(bidix.upload.messages.mainFailed);
log.endUpload("failed");
}
};
// do uploadMain
var revised = bidix.upload.updateOriginal(original,posDiv);
bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};
bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
var localCallback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (xhr.status == 404)
alert(bidix.upload.messages.storePhpNotFound.format([url]));
if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
alert(responseText);
if (responseText.indexOf("Debug mode") >= 0 )
responseText = responseText.substring(responseText.indexOf("\n\n")+2);
} else if (responseText.charAt(0) != '0')
alert(responseText);
if (responseText.charAt(0) != '0')
status = null;
callback(status,params,responseText,url,xhr);
};
// do httpUpload
var boundary = "---------------------------"+"AaB03x";
var uploadFormName = "UploadPlugin";
// compose headers data
var sheader = "";
sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
sheader += uploadFormName +"\"\r\n\r\n";
sheader += "backupDir="+uploadParams[3] +
";user=" + uploadParams[4] +
";password=" + uploadParams[5] +
";uploaddir=" + uploadParams[2];
if (bidix.debugMode)
sheader += ";debug=1";
sheader += ";;\r\n";
sheader += "\r\n" + "--" + boundary + "\r\n";
sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
sheader += "Content-Length: " + data.length + "\r\n\r\n";
// compose trailer data
var strailer = new String();
strailer = "\r\n--" + boundary + "--\r\n";
data = sheader + data + strailer;
if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
if (!posDiv)
posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
store.allTiddlersAsHtml() + "\n" +
original.substr(posDiv[1]);
var newSiteTitle = getPageTitle().htmlEncode();
revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
return revised;
};
//
// UploadLog
//
// config.options.chkUploadLog :
// false : no logging
// true : logging
// config.options.txtUploadLogMaxLine :
// -1 : no limit
// 0 : no Log lines but UploadLog is still in place
// n : the last n lines are only kept
// NaN : no limit (-1)
bidix.UploadLog = function() {
if (!config.options.chkUploadLog)
return; // this.tiddler = null
this.tiddler = store.getTiddler("UploadLog");
if (!this.tiddler) {
this.tiddler = new Tiddler();
this.tiddler.title = "UploadLog";
this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
this.tiddler.created = new Date();
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
}
return this;
};
bidix.UploadLog.prototype.addText = function(text) {
if (!this.tiddler)
return;
// retrieve maxLine when we need it
var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
if (isNaN(maxLine))
maxLine = -1;
// add text
if (maxLine != 0)
this.tiddler.text = this.tiddler.text + text;
// Trunck to maxLine
if (maxLine >= 0) {
var textArray = this.tiddler.text.split('\n');
if (textArray.length > maxLine + 1)
textArray.splice(1,textArray.length-1-maxLine);
this.tiddler.text = textArray.join('\n');
}
// update tiddler fields
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
// refresh and notifiy for immediate update
story.refreshTiddler(this.tiddler.title);
store.notify(this.tiddler.title, true);
};
bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
if (!this.tiddler)
return;
var now = new Date();
var text = "\n| ";
var filename = bidix.basename(document.location.toString());
if (!filename) filename = '/';
text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
text += config.options.txtUserName + " | ";
text += "[["+filename+"|"+location + "]] |";
text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
text += uploadDir + " | ";
text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
text += backupDir + " |";
this.addText(text);
};
bidix.UploadLog.prototype.endUpload = function(status) {
if (!this.tiddler)
return;
this.addText(" "+status+" |");
};
//
// Utilities
//
bidix.checkPlugin = function(plugin, major, minor, revision) {
var ext = version.extensions[plugin];
if (!
(ext &&
((ext.major > major) ||
((ext.major == major) && (ext.minor > minor)) ||
((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
// write error in PluginManager
if (pluginInfo)
pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
}
};
bidix.dirname = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(0, lastpos);
} else {
return filePath.substring(0, filePath.lastIndexOf("\\"));
}
};
bidix.basename = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("#")) != -1)
filePath = filePath.substring(0, lastpos);
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(lastpos + 1);
} else
return filePath.substring(filePath.lastIndexOf("\\")+1);
};
bidix.initOption = function(name,value) {
if (!config.options[name])
config.options[name] = value;
};
//
// Initializations
//
// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);
// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");
//optionsDesc
merge(config.optionsDesc,{
txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
txtUploadUserName: "Upload Username",
pasUploadPassword: "Upload Password",
chkUploadLog: "do Logging in UploadLog (default: true)",
txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});
// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');
// Backstage
merge(config.tasks,{
uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
//}}}
All high priority items tag here...
All medium priority items tag here...
All low priority items tag here...
Actions reflect that which you want or need to do...
''New:'' <<newTiddler label:"#next" title:"new next action" prompt:"create a new next action" focus:title tag:#next>> <<newTiddler label:"#queued" title:"new queued action" prompt:"queue an new action" focus:title tag:#queued>> <<newTiddler label:"#waiting" title:"new waiting action" prompt:"create a new waiting action" focus:title tag:#waiting>><<newTiddler label:"#future" title:"new future action" prompt:"create a new future action" focus:title tag:#future>>
Use the archive to store information you no longer need for your daily work by assigning archive-tags to tiddlers. To avoid clutter and distraction, regularly import archived items into an extra tbGTD archive-document and afterwards delete them in your main document...
Areas are contextual categories for stuff...
//{{{
//utility functions for tbGTD
window.tbGTD={
//get type of GTD element 1=toplevel, 2=subcategory, 3=tagged, noGTD=null
type:function(title,list){
if(!title)return;
var l,s,t,cats,sub=[],ti,tgt;
if(!list)list='x-tagger';
l=store.getTiddlerText(list);if(!l)return;
cats=l.readBracketedList();
for(t=0;t<cats.length;t++){
ti=cats[t];if(title==ti)return 1;
tgt=store.getTaggedTiddlers(ti);
for(var s=0;s<tgt.length;s++){
ti=tgt[s].title;
if(title==ti)return 2;
sub.pushUnique(ti);}
}
for(t=0;t<sub.length;t++){
ti=sub[t];
tgt=store.getTaggedTiddlers(ti);
for(s=0;s<tgt.length;s++)if(title==tgt[s].title)return 3;
}
return null;
},
nu:function(tg,txt){
return '<<newTiddler label:"+" title:"new '+tg+'" prompt:"create new tiddler tagging to \''+tg+'\'" focus:title text:[['+txt+']] tag:[['+tg+']]>>';
}
}
//}}}
|widetable noborder|k
|padding:10px;<<tiddler SideBarOptions>>|vertical-align:top;padding:10px;<<showReminders leadtime:-14...7>> |
{{{-> }}}[[display calendar of the complete year|calendar year]]
{{black{<<calendar>>}}}{{tagClear{}}}
{{{-> }}}[[display calendar for this month|calendar]]
If you want to clean archived tiddlers <script label="click here!" title="click here to clean archived tiddlers.">
var t,tgt,ca,ar,clean=[];
ar=store.getTaggedTiddlers('archive');
for(ca=0;ca<ar.length;ca++){
tgt=store.getTaggedTiddlers(ar[ca].title);
for(t=0;t<tgt.length;t++)clean.pushUnique(tgt[t].title);
}
if(clean.length>0){
if(!confirm('Do you really want to delete '+clean.length+' archived items?\n'+clean))return;
for(t=0;t<clean.length;t++){
store.removeTiddler(clean[t]);
story.closeTiddler(clean[t],true);
}
}else alert('Nothing to be deleted.');
</script>
''Note'': You will be asked to confirm tiddlers to be deleted.
Tag project related contacts with contact-catogories...
<html><iframe src="http://goto.bplaced.net/x/tiddlyspot/tbgtd/" style="border:0"></iframe></html>
Contexts specify the type of activity you will do to complete an action...
{{desk{
|widetable|k
|width:50%;font-size:16px; <<newTiddler label:"+" title:"new next action" prompt:"create a new next action" focus:title tag:#next>>[[next|#next]] [[actions|action]]((*({{popBtn{<<tiddler action>>}}}))) |font-size:16px; <<newTiddler label:"+" title:"new reminder" prompt:"create a new reminder" focus:title tag:reminder text:{{var d=new Date();'<<reminder year:%0 month:%1 day:%2 title:"reminder title">\>'.format([d.getFullYear(),String.zeroPad(d.getMonth()+1,2),String.zeroPad(d.getMonth(),2)]);}}>>[[this weeks |calendar]][[reminders|reminder]]((*(<<tiddler reminder##info>>))) |h
|height:20px;background-color:#eee;{{deskNew{<<newTiddler label:"+" title:"queue new action" prompt:"create a new queued action" focus:title tag:#queued>><<tag #queued>><<rB queued>><<newTiddler label:"+" title:"new waiting action" prompt:"create a waiting action" focus:title tag:#waiting>><<tag #waiting>><<rB waiting>><<newTiddler label:"+" title:"new future action" prompt:"create a new future action" focus:title tag:#future>><<tag #future>><<rB future>><<tag #done>><<rB done>>}}}|padding-left:0.7em;{{block{<<showReminders leadtime:-3...7>>}}} |
|padding:1px;{{block{<<tiddlerList tags:"#next" order:"-modified" itemTemplate:"|<<tag [[%title]]$))|width:20px;<<tiddler scripts##miniTag with: %link '' '#next'$))|\n" header:"|noborder|k">>}}} |~|
|font-size:16px; <<newTiddler label:"+" title:"new active project" prompt:"create a new active project" focus:title tag:$active>>[[active|$active]] [[projects|project]]((*({{popBtn{<<tiddler project>>}}}))) |font-size:16px; <<newTiddler label:"+" title:"new starred tiddler" prompt:"create a new starred tiddler" focus:title tag:star>>[[starred tiddlers|star]]((*(<<tiddler star>>))) |h
|height:20px;background-color:#eee;{{deskNew{<<newTiddler label:"+" title:"new someday project" prompt:"create a new someday project" focus:title tag:$someday>><<tag $someday>><<rB someday>><<newTiddler label:"+" title:"new maybe project" prompt:"create a new maybe project" focus:title tag:$maybe>><<tag $maybe>><<rB maybe>><<tag $completed>><<rB completed>>}}}|padding:1px;{{block{<<tiddlerList tags:"star" order:"-modified" itemTemplate:"|<<tag [[%title]]$))|width:20px;<<tiddler scripts##miniTag with: %link '' 'star'$))|\n" header:"|noborder|k">>}}} |
|padding:1px;{{block{<<tiddlerList tags:"$active" order:"-modified" itemTemplate:"|<<tag [[%title]]$))|width:20px;<<tiddler scripts##miniTag with: %link '' '$active'$))|\n" header:"|noborder|k">>}}}|~|
<html><div style="width:80px;float:left;text-align:right;margin:0px 10px;">more views:</div></html>{{view{((_*(<<tiddler context>>)))<<tag context>><<rB contexts>>}}}{{view{((_*(<<tiddler contact>>)))<<tag contact>><<rB contacts>>}}}{{view{((_*(<<tiddler area>>)))<<tag area>><<rB areas>>}}}{{view{((_*(<<tiddler realm>>)))<<tag realm>><<rB realms>>}}}{{view{((_*(<<tiddler stage##info>>)))<<tag stage>><<rB stages>>}}}{{view{((_*(<<tiddler priority>>)))<<tag priority>><<rB priorities>>}}}{{view{<<popup 'more tools...' [[<<tiddler topMenuR##options$))]]>>}}}
!Latest articles
<<tiddlerList tags:"journal" top:"5" dateFormat:"mmm. 0DD" itemTemplate:"*[[%created - %title|%title]] \n" order:"-created">>
}}}
All the information in this page about this is taken from http://www.whitehats.ca/main/members/Malik/malik_eventlogs/malik_eventlogs.html just for reference, in case some day that source will be unavailable
|>|>|>|>|>|>|>|>|>|>|>|>|>|>|Windows Event Log in binary format|h
|1|2|>|3|4|5|6|7|8|>| 9 |10|11|>| 12 |
|>|>| 13 |>|>|>| 14 |>|>| 15 |>|>|>| 16 | 17 |
#Message Separator (''4 bytes'' - Separator is (1001100011001100100110001100101 - bin) or (4c664c65 - hex) or (LfLe - ascii))
#Message Number (''4 bytes'' - Padded with null characters from left to right to fill in the full 4 bytes. It is in little endian byte order)
#Date Created (''4 bytes'', little endian, decimal value in epoch)
#Date Written (''4 bytes'', little endian, decimal value in epoch)
#Event ID (''2 bytes'', little endian, decimal value)
#Unknown? (''1 byte'')
#Unknown? (''1 byte'')
#Event Type (''1 byte'' - number - used as index to retrieve 'Event Name')
#String Count (''2 bytes'' - The number of strings in the event in decimal)
#Category (''2 bytes'' - decimal value)
#SID? (''8 bytes'' - possibly the decimal value of the SID)
#Unknown? (''8 bytes'' - possibly related to the SID)
#Unknown? (''11 bytes'')
#Source Name (Variable Length in words (''4 bytes'') with at least the last two bytes being null and 0 or more bytes of null padding up to the length of a full word)
#Computer Name (Variable Length in words (''4 bytes'') with at least the last two bytes being null and 0 or more bytes of null padding up to the length of a full word)
#String1 (Variable Length - Also known as the 'Message' - Variable Length in words (''4 bytes'') with at least the last two bytes being null and 0 or more bytes of null padding up to the length of a full word.)
#String'n' (Depending on the number of strings specified by //9:String count//
#Unknown? (''8 bytes'')
End of event log: hex string noted: '11111111222222223333333344444444' - could be an end marker
/%
!fileHeader
|>|>|>| Table 1 - File header |h
| No.| Ofs | Len | Meaning |
| 1 | 0x00 | 8 | Magic string ''ElfFile'' 0x00 |
| 2 | 0x10 | 8 | No. of current chunk |
| 3 | 0x18 | 8 | No. of next record |
| 4 | 0x20 | 4 | Header space used,constant 0x80 |
| 5 | 0x24 | 2 | Minor version, constant 1 |
| 6 | 0x26 | 2 | Major version, constant 3 |
| 7 | 0x28 | 2 | Size of header, constant 4096 |
| 8 | 0x2a | 2 | Chunk count |
| 9 | 0x78 | 4 | Flags |
| 10 | 0x7c | 4 | Check sum |
{{{Introducing the Microsoft Vista Log File Format. Andreas Schuster.
http://www.dfrws.org/2007/proceedings/p65-schuster.pdf Page 3}}}
!chunkHeader
|>|>|>| Table 2 - Chunk header |h
|No. | Ofs | Len | Meaning |
| 1 | 0x00 | 8 | Magic string ''ElfChnk'' 0x00 |
| 2 | 0x08 | 8 | Number of first record in log |
| 3 | 0x10 | 8 | Number of last record in log |
| 4 | 0x18 | 8 | Number of first record in file |
| 5 | 0x20 | 8 | Number of last record in file |
| 6 | 0x28 | 4 | Size of header |
| 7 | 0x2c | 4 | Offset of last record |
| 8 | 0x30 | 4 | Offset of next record |
| 9 | 0x7c | 4 | Check sum |
{{{Introducing the Microsoft Vista Log File Format. Andreas Schuster.
http://www.dfrws.org/2007/proceedings/p65-schuster.pdf Page 3}}}
!eventRecord
|>|>|>| Table 3 - Event record |h
| No. | Ofs | Len | Meaning |
| 1 | 0x00 | 4 | Magic string ''**'' 0x00 0x00 |
| 2 | 0x04 | 4 | Record length |
| 3 | 0x08 | 8 | EventRecordID |
| 4 | 0x10 | 8 | TimeCreated (FILETIME) |
| 5 | 0x18 | var. | Event message, binary XML |
| 6 | var. | 4 | Length (repeated) |
{{{Introducing the Microsoft Vista Log File Format. Andreas Schuster.
http://www.dfrws.org/2007/proceedings/p65-schuster.pdf Page 4}}}
!xmlStructure
{{{
<Events>
<Event>
<System> . . . </System>
<EventData> . . . </EventData>
</Event>
<Event>
<System> . . . </System>
<UserData> . . . </UserData>
</Event>
<Event>
...
</Event>
</Events>
}}}
//Introducing the Microsoft Vista Log File Format. Andreas Schuster.//
http://www.dfrws.org/2007/proceedings/p65-schuster.pdf Page ''4''
!nameString
|>|>|>|>|>|>|>| NameString Structure |h
|0| 7|8 | 15|16 | 23|24 | 31|
|>|>|>|>|>|>|>| Token (offset) of previous NameString |
|>|>|>| Hash |>|>|>| Length |
|>|>|>|>|>|>|>| <br />Name (//Length// [[UCS-2|http://bit.ly/sIyLMC]] characters)<br /><br /><br /><br /> |
|>|>|>||>|>|>| 0x00 0x00 |
!xmlToken
|Value|Meaning|Example|
|0x00|EndOfBXmlStream||
|0x01|OpenStartElementTag|< name >|
|0x02|CloseStartElementTag|< name >|
|0x03|CloseEmptyElementTag|< name />|
|0x04|EndElementTag|</ name >|
|0x05|Value|attribute = "value"|
|0x06|Attribute|attribute = "value"|
|0x0c|TemplateInstance||
|0x0d|NormalSubstitution||
|0x0e|OptionalSubstitution||
|0x0f|StartOfBXmlStream||
!end%/
Tiddlers tagged with //excludeLists// will be excluded from public sources: Tags cloud, Rss and so on
{{sidebarTitle{[[tagged excludeList:|excludeLists]]}}}
<<list filter [tag[excludeLists]]>>
<<list filter [tag[excludeSearch]]>>
!!Links
{{{
WikiWord
~EscapedWikiWord
[[Wiki Word With Spaces]]
[[display text|WikiWord]]
http://www.externalLink.com
[[title|URL]]
[img[my.jpg][link]]
[>img[alias|path/my.jpg][link]]
to filesystem...
[[folder/file]] — relative path
file://///server/share — win share
file:///c:/folder/file — win local
file://folder/file — unix local
}}}
!!Basics
{{{
''bold''
//italic//
__underline__
--strikethrough--
~~subscript~~
^^superscript^^
@@highlight@@
{{{monospaced}}}
{{{
multiline code
}}}
/%comments%/
}}}
!!Headings & lists
{{{
!h1
!!h2
!!!h3 ...
#ol1
##ol2
###ol3 ...
*ul1
**ul2
***ul3 ...
;definition title
:definition
nested example...
*bullet
*#number
*#;item
*#:definition
multiline styled contents...
#{{block{
!heading
still bullet1
}}}
#bullet2
}}}
!!Block quotes
{{{
>indent1
>>indent2
>>>indent3 ...
<<<
blockquoted
<<<
}}}
!!Dashes & rules
{{{
-- em dash
---- horizontal rule
}}}
!!Tables
{{{
|cssClass|k
|table caption|c
|heading|heading|h
|table|footer|f
|!heading|!heading|
|left-aligned | right-aligned|
| centered |background:blue;coloured|
|>|colspan|
|rowspan|with<br />linebreak|
|~|whatever|
|NoB|k
.NoB,.NoB th,.NoB thead,.NoB tbody,.NoB tr,.NoB td
{border:0 !important;} /*in StyleSheet*/
}}}
!!Escaping
{{{
"""escaped"""
/%hidden%/
/%
!section
hidden section content
!end%/
}}}
!!Markup & style
{{{
@@cssProperty:cssValue; text@@
{{{class{content styled via css class}}}
<html>valid xHTML markup</html>
linebreak: <br /> <br>
entities: & «
}}}
!!Macros
{{{
tid = [[TidName]] or TidName or 'tid name'
<<tiddler tid>>
<<tiddler 'tid##section'>>
<<tiddler 'tid::slice'>>
<<tabs id label tip tid ...>>
<<slider id tid label tip>>
<<today [format]>>
<<version>>
<<timeline [date][len][format]>>
<<list [all|missing|default|
orphans|shadowed|touched|
filter>>
<<allTags>>
<<tag name [label] [tip]>>
<<tags [tid]>>
<<tagging [tag]>>
<<newJournal [format]>>
<<newTiddler label:tidName
text:"text" tag:tag tag:tag
accessKey:key focus:field>>
<<saveChanges [label] [tip]>>
<<search [term]>>
<<closeAll>>
<<permaview>>
}}}
!!Startup paramifiers
{{{
#[open:]WikiWord
#[open:]WikiWord%20WikiWord…
#start:safe
#search:text
#tag:text
#newTiddler:WikiWord
#newJournal:format
}}}
!!Date formats
{{{
YYYY MMM DDD — year month day full
YY MM DD — 2 digit nums
0MM 0DD — leading zero
mmm ddd — short names
DDth — with suffix
WW — week num
wYY with week number
hh mm ss — hours min sec
0hh 0mm 0ss — leading zero
am AM or pm PM — indicator
hh12 — hours by 12
}}}
!!Specials
{{{
To include content from other tiddler:
<<tiddler "TiddlerName##ContentPartName">>
File has to be like this structure:
/%
!part1
content
!part2
Another content
!end%/
}}}
<script>
var c='$1',fl,gt,h,o='',t,ti,toc='\n!Table of contents',hx,x=place;
hx=[
['Introduction','intro'],
['TiddlyWiki','tw0',[
['General','tw'],
['Tiddler','tid'],
['Tags','tag'],
['Formating','fmt']]],
['GTD','gtd0',[
['Method','gtd'],
['Workflow','flow']]],
['tbGTD','tb0',[
['Geneneral','tbGTD'],
['Categories','cats'],
['Add stuff','add'],
['Stages','stages']]],
['How to','how',[
['Bookmarks','bmk'],
['Reminders','remind'],
['QuickNotes','qn'],
['MainMenu','menu'],
['x-tab','xtab'],
['x-plore','xplore'],
['x-tag','xtag'],
['tag-cloud','cloud'],
['tag-choser','deli'],
['sidebars','side']]],
['Broken?','brk'],
['Contact','mail']
];
gt=function(c){
var i,s,sc,sx,tx,tab=isNaN(c);//as tabs?
for(i=0;i<hx.length;i++){
sc=hx[i][1];
if(tab&&c==sc||!tab&&c==i){
sx=hx[i][2];if(tab&&!sx)break;
ti=hx[i][0];
o+=tab?'@@display:block;min-height:300px;<<tabs tabHelp'+sc:'\n!'+(i+1)+'. '+ti;
toc+="\n#''"+ti+"''";
if(sx){
for(s=0;s<sx.length;s++){
ti=sx[s][0];sc=sx[s][1];
o+=tab?" '"+ti+"' '' 'help##"+sc+"'":"\n!!"+(i+1)+'.'+String.fromCharCode(97+s)+' '+ti+"\n"+"<<tiddler help##"+sc+">>";
toc+="\n##"+ti;
}
if(tab)o+='>>@@';
}else o+="\n<<tiddler help##"+sc+">>";
}
}
}
switch(c){
case '$'+'1':o="{{vTabs help{<<tabs tabHelp";for(t=0;t<hx.length;t++){ti=hx[t][0];o+=" '"+ti+"' '' 'help##"+hx[t][1]+"'";}o+='>>}}}';break;
case 'all':o="{{tbHelp{TOCHELP";for(t=0;t<hx.length;t++)gt(t);o+="}}}";break;
default:gt(c);
}
if(c=='$'+'1'){
h=createTiddlyElement(x,'div',null,'tbHelp');
wikify(o,h);
o="<<slider chkLayout SiteLayout SiteLayout 'Toggles the SiteLayout. You can click on any of the links to get to the tiddler responsible for that content.'>> "+
"[[help printout|tbGTD help]]";
}
wikify((c=='all'?o.replace('TOCHELP',toc):o),x);
setStylesheet(
'.tbHelp{margin:10px 0;}'+
'.tbHelp table{border-width:1px;}'+
'.tbHelp .marked{background:#E6E6FF;}'+
'.tbHelp .tabContents{min-height:180px;}'+
'.helpInner{border:2px solid #CCC;background:#F6F6F6;display:block;padding:5px;}'+
'.vTabs .helpInner{border:0;overflow-y:scroll;}'+
'.vTabs .helpSM {height:200px;}'+
'.vTabs .helpBG {height:350px;}','GtdHelpStyles');
</script>@@display:block;height:1px;clear:both; @@/%
!tw0
<<tiddler help with: tw0>>
!gtd0
<<tiddler help with: gtd0>>
!tb0
<<tiddler help with: tb0>>
!how
<<tiddler help with: how>>
!intro
In the following sections you will be introduced to
*the inner workings of this document
*its elements
*how to use them
''Note'': Unless an external link -- an __underlined__ term indicates that there is a corresponding section in this [[help]] document.
This is an adaptation of __~TiddlyWiki__
*with a focus on __GTD__
*designed to help you manage your ideas and actions
*to relieve your brain from (stress related to) forgetfulness
*to aid documentation and knowledge management
@@color:#C33;''Note:'' Use this great document, but know that you do so at your own risk.@@
!tw
tbGTD is powered by [[TiddlyWiki]], which is...
*an amazing @@opensource@@ [[wiki|http://en.wikipedia.org/wiki/Wiki]] platform
*integrating all of @@content@@, @@layout@@, @@style@@ and @@javascript@@ into a @@single html file@@
*actively developped and supported by a vivacious community
Learn more at...
*the main site http://www.tiddlywiki.com
*the community wiki http://www.tiddlywiki.org
*the google user group http://groups.google.com/group/TiddlyWiki
!tid
A tiddler is the basic content element of a __[[TiddlyWiki]]__. with a few basic properties...
*a @@unique name@@
*@@text-content@@ given to it
*by an @@author@@
*@@created@@ at some date or @@modified@@ later
*@@__tags__@@, which are keywords linked to a tiddler and
*@@fields@@ providing basic information as well as extensibility
A tiddler is displayed in two basic modes...
*@@view-mode@@ displays the content, e.g. wiki-markup of the tiddler in the __TiddlyWiki__ @@displayArea@@
*@@edit-mode@@ displays editable fields to change the tiddlers contents
**you can easily access edit-mode by double clicking on a tiddlers display area
**use keyboard-shortcuts in edit-mode
***{{{ctrl-enter}}} saves the tiddler
***{{{escape}}} leaves edit-mode ...while not saving changes
A tiddler may be or contain...
*a content item composed of
**text __formating__ using wiki-markup, possibly with embedded contents, such as...
***images
***tables
***other tiddlers ...which is called a @@transclusion@@
*pure html content wrapped in an {{{<html></html>}}}-block, like...
**iframes ...an html-file or remote website embedded into it
**an {{{embed object}}}, sometimes called a @@widget@@ or @@gadget@@
*a plugin, macro, script or transclusion
**extending a basic __TiddlyWiki__ with more functionality
*[[css|http://en.wikipedia.org/wiki/Cascading_Style_Sheets]] design rules
**a StyleSheet defining how __TiddlyWiki__ looks
*a template ...or template-collection called a @@theme@@
**that determines the presentational @@structure@@ and @@layout@@ of your TiddlyWiki and its elements
*a shadow tiddler ...or system tiddler
**a tiddler with default content that can be overwritten but will be restored when you delete your custom content
!tag
Tags are a powerful concept to relate tiddlers to one another. In addition to ~WikiLinks -- links inside your TiddlyWiki -- they allow you to categorize tiddlers, but with the added benefit of updating upon name changes. Above all, a tag is a tiddler!
Use tags to establish...
*categories
*keywords
*relations
**between parent and child elements
*indicators or switches
**to change style or behaviour of tiddlers with a certain tag
In general, tag those tiddlers on which others depend...
*a sub-element with the corresponding higher-level element
*a task with the corresponding project or contact
In the toolbar {{button{x-tab}}}{{button{x-plore}}}&{{button{x-tag}}} provide tag-related features
*see __How to__
An important plugin integrated into this wiki is called [[TagglyTagging|TagglyTaggingPlugin]].
It is displayed at the bottom of a tiddler...
*showing you a configurable view of tiddlers tagging to the current one (if there are any)
*play with the options (!)
*[[go here|http://mptw.tiddlyspot.com]] to learn more about it
!fmt
The tiddler [[formating]] provides a reference for basic and advanced @@wiki-markup@@.
{{helpInner helpBG{<<tiddler formating>>}}}
!gtd
''GTD'' stands for @@Getting Things Done@@.
[[David Allen|http://en.wikipedia.org/wiki/David_Allen_%28author%29]] coined the term as a @@method@@ in his [[book|http://en.wikipedia.org/wiki/Getting_Things_Done]].
Central to its method is that you...
*collect
*process
*organize
*review
*do
...actions and ideas that occupy your brain capacity...
*whether you chose to or not
*which you may find worthy or in need of pursuing
!flow
|font-size:90%;incoming stuff...@@font-size:120%;margin-left:30%; ''inbox''@@ {{floatright{...What is it?}}}|>|>|>|h
| !Is it actionable? |>|>|>|
|>|>| ''yes'' |vertical-align:middle; ''no'' |
|>|>|>1 actions? -- new [[$active]] project (define success)|~|
|>|>|font-size:150%; !What is the next action? |<<tiddler help##noact>>|
| !do | !delegate | !defer |~|
|if <2 minutes|<<tiddler help##wait>>|<<tiddler help##defer>>|~|
|>|>| plan, do, review actions & projects |~|
!noact
#eliminate
**@@trash@@
#incubate
**task:@@[[#queued]], [[#future]]@@
**project:@@[[$someday]], [[$maybe]]@@
#[[reference]]
**set as tags
**tag with corresponding task, project, contact, etc.
!defer
#[[#next]]
**for me @@asap@@
#[[calendar]]
**@@specific@@ time & date
#set a [[reminder]]
!wait
*use [[#waiting]]
*tag with item (if exists)
!tbGTD
Why the name ''tbGTD''?
*Plain and simple, my initials following the you-know-what.
The original can be found at http://tbGTD.tiddlyspot.com...
*the tag <<tag site>> is a collection of tiddlers that manage the design of this tiddlywiki
*on the very bottom of this tiddler you find an illustrated layout of tbGTD
**in which you can click on most any links
***to open the tiddlers responsible for the respective content
!cats
Some tags begin or end with a special character in order to facilitate recognition:
<script>var c,f,i,l,n,o,t,x;
c=['!action','context','priority','!project','stage','contact','area','realm','!archive'];
o='| prefix | category | sub-categories |h\n';f='@@background:#fcc; %0@@';
for(x=0;x<c.length;x++){
i=c[x].substr(0,1)=='!'; n=i?c[x].substr(1):c[x];
t=store.getTaggedTiddlers(n);l=t.map(function(t){return '[['+t.title+']] '});
o+='| '+t[1].title.substr(0,1)+' |'+f.format(['((_*({{popBtn{<<tiddler "'+n+'">>}}})))[['+n+']]'])+' |'+(i?f.format([l]):l)+'|\n';
}return o;</script>
To assign a new item to a category, simply tag your tiddler with the corresponding category.
@@background:#fcc;padding:0 3px;These tiddlers@@ are essential and should only be modified if you know what you're doing:
*@@background:#fcc;[[desk]], [[journal]], [[calendar]], [[reminder]], [[reference]] and all tagged <<tag site>> or <<tag tbGTD>>@@
''Note:''
*type any of those prefixes in the searchbox, hit the down key and observe!
*you are not bound to using these categories
**delete or rename whatever category you don't like or need
**might require some tweaking of the [[desk]] or [[tagger|x-tagger]] or the [[MainMenu]]
!add
First, learn the basics of [[TiddlyWiki|http://tiddlywiki.com]].
You can add new items via...
*the {{button{+}}}buttons on the desk
*the {{button{new}}}popup in the [[top-left menu|topMenuL]]
*the MainMenu on the left hand side
*the {{button{new}}}button a tiddlers toolbar
Once you add a new tiddler, it is essential that you give it a meaningful tag...
*use the provided __categories__
To create a new [[next action|#next]], all it requires is a tiddler tagged [[#next]].
!stages
[[Stages|stage]] are a very powerful apporach for your project management and documentation, allowing you to...
*generate overviews of how much effort is going into which stages
*track project progress
''Tips'':
*adjust stages to suit your (different) project designs
**simply edit the corresponding stage-tiddlers or rename them
*consider using tbGTD template files for different project categories
*try to use stages with quick-add in [[QuickNotes]]!
Here is an overview of all <<tag stage>><<rB 'predefined stages...'>>
{{helpInner helpSM{<<tiddler stage>>}}}
!bmk
tbGTD is set-up such that the url always points to the current tiddler.
If you turned @@chkSinglePagePermalink@@ off...
*use the {{button{url}}}button on the toolbar of a tiddler
*you may need to click on the {{button{+}}}button
*then your browsers address bar shows a url pointing to the @@current tiddler@@
Retrieve a link to @@all displayed tiddlers@@ by clicking <<permaview>> under <<popup options [[<<tiddler topMenuR##options$))]]>>.
!remind
Add a reminder...
*by clicking on a date in the calendar
*using the {{button{remind}}}button in the tiddlers toolbar
*using [[QuickNotes]]
To delete or edit a reminder, edit the tiddler.
!qn
Use [[QuickNotes]] to quickly type away notes. It offers a powerful [[quick-add|quick-add help]] feature...
*allowing you to add even a complete project outline in one go
{{helpInner helpBG{<<tiddler 'quick-add help'>>}}}
!menu
The [[MainMenu]] on the left-hand side
*gives you quick access to all GTD categories
*allows to add new items
*indicates, which categories are actually used and let'S you open those subitems
The section @@Tags@@ in [[x-tagger config]] contains links to those tiddlers which are the categories used in the MainMenu as well as by [[x-tagger]] ...the {{button{x-tag}}}popup in the toolbar. Any tiddler tagging to these __categories__ will be displayed in either place.
''Note'':
*configure [[x-tagger]] using [[x-tagger config]]
**also accessible via {{button{edit categories...}}} under ''options'' in the {{button{x-tag}}}popup.
*change [[x-tagger config]] to your liking
**remove anything you don't want or need
*doubleclick on a tag-category in the MainMenu shows all categories
!cloud
To hide a __tag__ from the [[TagCloud]]...
*assign it the tag <<tag noCloud>>
*or use <<tag excludeLists>> to hide it from other lists too
You can also edit the macro call in [[TagCloud]] to exclude further tags, without using [[noCloud]].
!deli
To assign or remove a tag to a tiddler in edit-mode use...
*the default @@tag-choser@@ for any existing tag
*a GTD @@tag-choser@@ to quickly assign
**one of the main GTD __categories__
**its sub-tags
**any tiddlers tagging to the subtags
The tag-choser in edit-mode -- called [[DeliciousTagging]] -- by default ignores the same tags as does __~TagCloud__ ...see parameter @@exclude@@ in the sourcecode.
!side
There are two sidebars...
*@@left@@: MainMenu
*@@right@@: [[calendar|SideBarOptions]] and [[lists|SideBarTabs]]
To hide sidebars on startup...
*change the second parameter in {{{<<toggleSideBarTB left show>>}}} from {{{show}}} to {{{hide}}} in...
**[[topMenuL]] (@@left@@ sidebar)
**[[topMenuR]] (@@right@@ sidebar)
!xtab
Clicking on [[x-tab]] in the toolbar will open...
*an interface allowing you to see a crosstable of tagged items...
**providing you with @@presets@@ which you can delete, expand or edit
**preconfigured to @@detect@@ all GTD __categories__
**configurable to find what you're looking for the way you need it
Customize [[x-tab]]'s presets, tags and auto-detect in [[x-tab config]].
!xplore
Clicking on [[x-plore]] in the toolbar of the current tiddler
*opens a popup displaying the four most common tiddler relations
*in a treelike manner
Define elements to be excluded or truncated using the corresponding sections in [[x-plore]].
!xtag
The {{button{x-tag}}}popup allows you to easily assign tags to the current tiddler or remove them.
Customize [[x-tagger]] as described in __~MainMenu__ via [[x-tagger config]].
!brk
As tbGTD is based on __~TiddlyWiki__ it is facing the same browser restrictions that may come up.
It is highly recommended that you use Firefox!
Something looks weird or doesn't work in Internet Explorer, Safari, Opera, Chrome?
*I am trying my best to make tbGTD work correctly in other browsers
*if you come accross css bugs - rather than complain - try to suggest a fix
!mail
Need more help? Drop a line here...
*[[tiddlywiki discussion group on google|http://groups.google.com/group/tiddlywiki/browse_frm/thread/bd6a9784706784f6]]
*[[contact me here|contact me]] or on [[tbGTD.tiddlyspot.com|http://tbGTD.tiddlyspot.com/#%5B%5Bcontact%20me%5D%5D]]
!end%/
I just had to swap the prefixes of [[project]] and [[stage]]!
*from now on, the ''$dollar''-prefix will indicate a [[project category|project]] while the ''§paragraph''-prefix indicates a [[stage]]
*the symbology just makes 10 times more sense that way
*also, you're probably accustomed to the $ key ...therefore, it's good for starters, i.e. projects
I know that this somewhat breaks backwards-compatibility and I am sorry!
''Just say'': {{{Alright then. I'ts fine... nay bother.}}}
!So here's what I recommend you should do before updating ...after the release is outthere
Assign the new prefixes of [[project]]- and [[stage]]-categories for those categories in which you have items. That will take care of reassigning the new tagname in all tagging tiddlers. The MainMenu indicates which tag-categories have items. Finally, import your tiddlers into a blank tbGTD. Wasn't all that difficult, was it?
/***
|''Name:''|jQueryPopup|
|''Description:''|Inline annotations for tiddler text with a 'jQueryfied' popup|
|''Author:''|Tobias Beer (original AnnotationsPlugin by Saq Imtiaz)|
|''Source:''|http://tbGTD.tiddlyspot.com/#jQueryPopup|
|''Version:''|0.1|
|''Date:''|2009.10.19|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.3|
|''incompatible with!!!''|AnnotationsPlugin|
((@@color:red;background:transparent;mod of ~AnnotationsPlugin@@(^strongly modded for tbGTD<br />*added delay<br />*wikified annotated & annotation<br />*used general tw Popup<br />*jQuery magic)))
!!Usage:
*{{{((text to annotate(annotation goes here)))}}}
* To include the text being annotated, in the popup as a title, put {{{^}}} as the first letter of the annotation text.
** {{{((text to annotate(^annotation goes here)))}}}
!!Examples:
Mouse over, the text below:
* ((_banana(the best fruit in the world)))
* ((_banana(^the best fruit in the world)))
***/
//{{{
config.extensions.anno={
show:function(id){
var el=document.getElementById(id);
el.timerA=false;
var wrap=document.getElementById('annowrap');
if (wrap==undefined)wrap=createTiddlyElement(document.body,"div","annowrap",null);
else wrap.innerHTML='';
wrap.style.display='none';
var stackPosition = Popup.find(el,"popup");
Popup.remove(stackPosition+1);
var popup = createTiddlyElement(wrap,"ol","popup","popup");
popup.stackPosition = stackPosition;
Popup.stack.push({root: el, popup: popup});
if(el.subject)wikify("!"+el.subject+"\n",popup);
wikify(el.anno,popup);
Popup.show();
popup.annoId=id;
popup.onmouseover=this.mouseover;
popup.onmouseout=this.mouseout;
jQuery(wrap).fadeIn('slow');
addClass(el,"annosubover");
el.wrap=wrap;
},
hide:function(id){var el=document.getElementById(id);if(el.keepAnno)return;else this.remove(id);
},
mouseover:function(e){
var el=document.getElementById(this.annoId);el.keepAnno=true;if(annoHideTimer)clearTimeout(annoHideTimer);
},
mouseout:function(e){
annoHideTimer=setTimeout("config.extensions.anno.remove("+this.annoId+")",200);
},
remove:function(id){
var el=document.getElementById(id);
Popup.remove();
removeNode(el.wrap);
el.wrap=null;
el.keepAnno=false;
removeClass(el,"annosubover");
}
}
config.formatters.unshift({
name:"annotations",
match:"\\(\\(",
lookaheadRegExp:/\(\((\_{0,2})(.*?)\((\^?)((?:.|\n)*?)\)\)\)/g,
handler:function(w){
this.lookaheadRegExp.lastIndex=w.matchStart;
var an=this.lookaheadRegExp.exec(w.source);
if(an&&an.index==w.matchStart){
var el=createTiddlyElement(w.output,"span",null,"annosub");
if (an[1]) el=createTiddlyElement(el,"span",null,null);
wikify('xxx'+an[2],el);
el.innerHTML=el.innerHTML.replace(/xxx/,'',1);
el.anno=an[4];
if(an[3])el.subject=an[2];
el.onmouseover=this.onmouseover;
el.onmouseout=this.onmouseout;
el.ondblclick=this.onmouseout;
w.nextMatch=an.index+an[0].length;
}
},
onmouseover:function(e){
if (!this.id) this.id=new Date().getTime()+Math.random();
if(this.timerA)return;
this.timerA=true;
annoTimer=setTimeout("config.extensions.anno.show("+this.id+")",300);
},
onmouseout:function(e){
this.timerA=false;
if(!this.wrap||this.keep)clearTimeout(annoTimer);
var id=this.id;
annoHideTimer=setTimeout("config.extensions.anno.hide("+this.id+")",200);
}
});
setStylesheet(".anno{position:absolute;padding:0.5em;max-width:15em;z-index:101;width:expression(document.body.clientWidth > (255/12) *parseInt(document.body.currentStyle.fontSize)?'15em':'auto' );}.anno h1, .anno h2{margin-top:0;}.annosubover{cursor:text;}","AnnotationStyles");
//}}}
<<newJournal "YYYY-0MM-0DD " label:"Write a new journal entry..." focus:title prompt:"Click to create a new journal entry!" tag:journal>>
<<tiddlerList tags:"journal" dateFormat:"mmm. 0DD" itemTemplate:"*%created - %0 \n" group:"tiddler.created.formatString('YYYY, MMM')" groupTemplate:"!!!%group \n" order:"-created">>
Tiddlers hidden from the [[TagCloud]]...
All [[quick notes|QuickNotes]] are tagging here...
@@display:block;margin:1em 1em 0 1em; [[SiteLayout]] <<saveChanges 'save'>><<tiddler TspotSidebar>><<slider chkTspotControls TspotControls "more tiddlyspot options »" "Show more tiddlyspot options">><<slider chkAdvOptionsPanel AdvancedOptions "advanced options »" "Show advanced options">>@@
|widetable|k
| option | description |h
| <<tiddler TspotOptions>>|options are saved as cookies in your browser|
| <<option txtUserName>>|username for signing your edits|
| <<option chkAnimate>>|enable animations|
| <<option chkAutoSave>>|autosave|
| <<option chkSaveBackups>>|save backups|
| <<option chkRegExpSearch>>|search regular expressions|
| <<option chkCaseSensitiveSearch>>|search case sensitive|
Assign priorities to differentiate importance...
Group [[actions|action]] into projects by assigning projects as tags to action-tiddlers. Assign project-tags to projects to indicating their status...
''New'': <<newTiddler label:"$active" title:"new active project" prompt:"create a new active project" focus:title tag:$active>><<newTiddler label:"$someday" title:"new someday project" prompt:"create a new someday project" focus:title tag:$someday>> <<newTiddler label:"$maybe" title:"new maybe project" prompt:"create a new maybe project" focus:title tag:$maybe>>
!QuickNotes has two modes of operation
#''simple note'' -- saves a new [[note]]-tiddler with the following properties:
**a ''title'' (optional) {{{...if none provided a timestamp will be inserted}}}
**some ''tags'' (optional) {{{...all notes will be tagged with 'note'}}}
**a ''note'' (required) {{{...the text body of your note}}}
#''quick-add'' -- allows you to add multiple new GTD items:
**invoked via ''ctrl-click'' on the ''save note''-button
**define items to be added with a simple, yet powerful syntax {{{...as described below}}}
!Using 'quick-add'
Using the default settings only [[projects|project]] and [[actions|action]] can be added via quick-add.
Here's a first example of the syntax for adding actions:
>#q call Maria|@c &fa {{{...creates the #queued action 'call Maria' tagged with context '@call' and area '&family'}}}
>!Notes {{{...this will be an actual heading of the content of the tiddler 'call Maria'}}}
>!!Things to talk about: {{{...a subheading}}}
>*foo {{{...you can even use lists}}}
>*http://bar.com {{{...could also be a WikiLink, like: [[bar]]}}}
>.#q remind her of Juans birthday|^1 {{{...creates a queued subaction tagging to 'call maria' with high priority }}}
''Note'': When using quick-add, a time-stamped summary will be created allowing you to check and quickly access all the tiddlers you just created.
!The syntax in detail
!!Basics
To create a default [[#next]] [[action]] or [[$active]] [[project]], just use the prefixes ''#'' or ''$'' by themselves followed by an empty space:
>''$'' my new active project
>''#'' my new next action
Append any unique starting letters of a category-tag to create something other than the defaults:
>''#q'' a queued action
>''$s'' a someday project
And, of course, preceded by an empty character follows the title:
>''# my new next action title''
To add any other GTD tags use the separator ' ''|'' ' followed by GTD tags using the same nomenclature as above, separated with empty spaces:
># read the js cookbook''|@r &t'' {{{...adds a next action called 'read the js cookbook' tagged @read and &tech}}}
''Note'': As for all tags following ' ''|'' ', you can in fact use the starting characters of any items already added, even existing tiddlers. If those contain empty spaces use square brackets, e.g. {{{[[a q]]}}} to refer to some added item called {{{'a queued item'}}} or in fact any existing tiddler that starts with {{{'a q'}}}. Note that items which you just added will be preferred over other existing tiddlers. For example...
># ''d''o this
># then that|''d'' {{{...refers to 'do this' and will therefore be given it as a tag}}}
!!Dependencies
Use nesting or tagging to create action dependencies whereas...
*items used as tags are depending on those tagging to them
*high level items depend on lower level items, like a project depends on the completion of its subactions
!!Subitems
By adding dots ( ''.'' ) to the beginning of a line, items become nested subitems, being tagged with the name of the item of the next higher level:
>$s a someday project
>''.''#f some future subaction {{{...will be tagged with 'a someday project'}}}
>''.''#f another future subaction|§6 {{{...regarding some experiments}}}
>''..''#f the future on level two {{{...sub to 'another future subaction'}}}
>''.''#d already done in advance for my someday project
>$ another next project
>''.''#action xyz {{{...you guessed it, its subitem}}}
Which items allow nesting is defined at the beginning of the sourcecode of QuickNotes. Here are the defaults:
>''$''projects may contain any of the following subitems
>>''.$''subproject
>>''.#''stage
>>''.#''action
>>''.?''contact
>''§''stages may contain... {{{...not recommended, stages should rather be tags of actions}}}
>>''.#''action
>>''.?''contact
>''#''actions may contain...
>>''.#''action
>>''.?''contact
!!More tagging
Entering tags into the tag input field of QuickNotes will also add these tags to __all__ tiddlers created via quick-add! For example, if you entered...
>{{{[[your project name in brackets]]}}}
...it will be set as a tag to all subactions, in addition to any further nesting.
''Note'': If you forget the square brackets in the example above, all items will get 5 more tags instead of the one you wanted! However, you could as well use single- or double-quotes.
!!New item with content
Every line that doesn't start with ''#'' or ''$'' will be used as the tiddler content of the item defined beforehand:
>$s my private someday project|-p {{{...is the definition line for 'my private someday project' tagged '-private-'}}}
>!Project Introduction {{{...here starts its content}}}
>*a list
>*in the project-tiddler text {{{...and here it ends}}}
>.#n my nested next science action|&sc {{{...another definition for an action tagged &science}}}
>See...http://w3.org {{{...and its content}}}
>*#with a pseudo-numbered-list {{{...can't use # directly as that is a 'definition prefix'!}}}
>*#list item number two {{{...ending here}}}
!Tips
Try not to confuse ''$ dollar'' (project) and ''§ paragraph'' (project stage).
[[quick-add|QuickNotes]] summaries...
Realms are the broadest context you can think of for your activities, assign them to projects...
Use this tag for information related to your actions, projects, contacts, etc...
!All reminders...
{{block{<<showReminders leadtime:-356...356>>}}}
@@color:#999;(only includes reminders +/- 1 year)@@/%
!info
Find more date and reminder related information via the [[calendar]] link in the [[left-topmenu|topMenuL]] or in the right [[sidebar|SideBarOptions]] ...or click on thse links.
!end%/
/%
!refreshBtn
<html><a class='refresh' title="redisplay the contents of $1" href="javascript:story.refreshTiddler('$1',null,true);return false;">refresh</a></html>
!refresh
<<tiddler scriptCollection##refreshBtn with: {{('$1'=='$'+'1')?tid=story.findContainingTiddler(place).getAttribute("tiddler"):'$1';}}>>
!tidsByTags
<script>
/***
|''Name:''|TiddlersByTags|
|''Description:''|Displays a table listing tiddlers by tags, excluding certain ones|
|''Author:''|Tobias Beer|
|''Source:''|http://tbGTD.tiddlyspot.com|
|''Version:''|1.1|
|''Date:''|2009.11.07|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Requires:''|InlineJavascriptPlugin|
***/
var ex=[],i,t,tx,xt='$1'.readBracketedList();
for(t=0;t<xt.length;t++){
tx=store.getTaggedTiddlers(xt[t]);
for(var i=0;i<tx.length;i++)ex.pushUnique(tx[i].title);
}
var out="|linkTable|k\n| tag | tiddlers |h\n";
var tags=store.getTags();
for (var tag=0;tag<tags.length;tag++) {
if (ex.contains(tags[tag][0])) continue;
var tids=store.getTaggedTiddlers(tags[tag][0]);
out+="| [["+tags[tag][0]+"]]|";
for (var t=0;t<tids.length;t++) out+="[["+tids[t].title+"]]";
out+="|\n";
}
return out;
</script>
!deleteTiddler
<script label="delete" title="click to delete $1">
var sTid='$1';
var update='$2';
var refresh='$3'!='norefresh';
if(sTid=="$"+"1"){
sTid=story.findContainingTiddler(place).getAttribute('tiddler');
if (sTid=="DeleteTiddler") return;
if (!confirm("Do you really want to delete "+sTid+"?")) return;
else refresh=false;
}
var oTid=store.getTiddler(sTid);
if (oTid==undefined){
alert("Unable to delete '$1'. Tiddler does not exist.");
return;
}
store.removeTiddler(sTid);
story.closeTiddler(sTid,true);
if (refresh) story.refreshTiddler(story.findContainingTiddler(place).getAttribute('tiddler'),null,true);
if (update!="$"+"2")story.refreshTiddler("$2",null,true);
refreshDisplay();
</script>
!miniTag
<script>
var click=function(e){
if(!e)var e=window.event;
var popup=Popup.create(this);
var tags=this.getAttribute('tags').readBracketedList();
for(var t=0; t<tags.length; t++) createTiddlyLink(createTiddlyElement(popup,"li"),tags[t],true);
Popup.show(popup,false);
e.cancelBubble=true;
if(e.stopPropagation)e.stopPropagation();
return false;
}
var title="$1"!='$'+'1'?'$1':story.findContainingTiddler(place).getAttribute('tiddler');
var tid=store.getTiddler(title);
if(tid){
var title=('$2'!='$'+'2'?'$2':'')+'\u25b6';
var exclude=('$3'!='$'+'3'?'$3':'').readBracketedList();
var tags=tid.tags;
out=[];
for(var t=0; t<tags.length; t++)if(!exclude.contains(tags[t])) out.push(tags[t]);
if (out.length>0){
addClass(place,'miniTags');
var btn=createTiddlyButton(place,title,'show tags for \''+tid.title+'\'',click);
btn.setAttribute('tags',(out.length>1?"[["+out.join(']][[')+']]':'[['+out+']]'));
}
}
</script>
!end%/
Tiddlers that relate to the design of this site...
!Think in project stages
<<tiddlerList tags:"stage" order:"title" header:'| stage | description |h' itemTemplate:"|text-align:left;!<<tag '%title'$))|<<tiddler '%title'$))|\n">>/%
!info
Use [[stages|stage]] to indicate which step in your project cycle an element relates to. See [[here|stage]] for an overview of all predefined stages and their meaning. Stages are most useful when you do specific kinds of projects on a regular basis. It is essential that stages reflect your own project flow. Therefore, do not hesitate to adjust them to suit your needs or make specific tbGTD templates for different kinds of projects.
!end%/
Tiddlers tagged with star ([[♥|star]]) are currently of interest or high importance so you can retrieve them quickly. Use the star {{button{[[♥|star]]}}} in the toolbar to mark a tiddler...
{{sidebarTitle{[[plugin manager:|PluginManager]]}}}
<<list filter [tag[systemConfig]]>>
disabled plugins:
<<list filter [tag[systemConfigDisable]]>>
All tiddlers powering this wiki...
<<tiddler help with: all>>
|''URL:''|http://tbGTD.tiddlyspot.com/|
|''Author:''|Tobias Beer|
|''Description:''|a tiddlywiki GTD system|
|Name|tbGtdTheme|
|Description|A theme based on ~MptwTheme ($Rev: 1829 $) with innumerable customizations |
|PageTemplate|##PageTemplate|
|ViewTemplate|##ViewTemplate|
|EditTemplate|##EditTemplate|
|StyleSheet|##StyleSheet|
!PageTemplate
<!--{{{-->
<div class="topMenu" id="topMenuR" refresh='content' tiddler='topMenuR'></div>
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<!-- horizontal MainMenu -->
<div class='topMenu' id="topMenu" macro='gradient vert [[ColorPalette::PrimaryMid]] [[ColorPalette::PrimaryMid]] [[ColorPalette::PrimaryMid]] [[ColorPalette::PrimaryMid]] [[ColorPalette::TertiaryDark]]'>
<span id="topMenuL" refresh='content' tiddler='topMenuL'></span>
</div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='mainMenu' refresh='content' force='true' tiddler='MainMenu'></div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
!ViewTemplate
<!--{{{-->
[[tbGtdTheme##Viewtemplatetoolbar]]
<div class="tagglyTagged" macro="tags"></div>
<div class='titleContainer'>
<span class='title' macro='view title'></span>
<span macro="miniTag"></span>
</div>
<div class='subtitle'>
(updated <span macro='view modified date {{config.options.txtPrettyDates?config.options.txtPrettyDates:"YYYY-0MM-0DD"}}'></span> by <span macro='view modifier link'></span> size <span macro='tiddler ShowTiddlerSize'></span>)
<!--
(<span macro='message views.wikified.createdPrompt'></span>
<span macro='view created date {{config.options.txtPrettyDates?config.options.txtPrettyDates:"YYYY-0MM-0DD"}}'></span>)
-->
</div>
<div class='viewer' macro='view text wikified'></div>
<div class="tagglyTagging" macro="tagglyTagging"></div>
<div class='toolbar toTop' style='line-height:100%;margin-top:.5em;'><a href="javascript:;"
onclick="window.scrollTo(0,ensureVisible(story.findContainingTiddler(this)));return false;"
onmouseover="this.title='scroll to top of '+story.findContainingTiddler(this).getAttribute('tiddler')">▲</a>
</div>
<!--}}}-->
!Viewtemplatetoolbar
<!--{{{-->
<div class='toolbar'>
<span macro="tiddler {{var v=store.getValue(tiddler,'need');v?v:'';}}"></span>
<span style="padding:1em;"></span>
<span macro="tTag tag:star mode:text text:♥" style="padding-top:0.2em;"></span>
<span macro="xtab button defaults:true position:first" style="margin:0 0 0 10px;"></span>
<span macro="xplore button:true toolbar:true exclude:GET==x-plore##exclude truncate:GET==x-plore##truncate class:'borderless'"></span>
<span macro="xtagger source:'x-tagger config##Tags' exclude:'' label:'x-tag' tooltip:'Set GTD related tags' more:'x-tagger config##More'" style="margin-right:20px;"></span>
<span macro='newHere label:"new"'></span>
<span macro='toolbar [[ToolbarCommands::ViewToolbar]]'></span>
<span macro='newReminder' class='reminder'></span>
</div>
<!--}}}-->
!EditTemplate
<!--{{{-->
<div class="toolbar" macro="toolbar [[ToolbarCommands::EditToolbar]]"><span class='toolbar' macro='toolbar previewTiddler'></span><span macro='popup [[info on formating]] [[<<tiddler formating$))]] "" helpPopup' style='margin-right:30px;'></span></div>
<div class="title" macro="view title"></div>
<div class="editLabel">Title</div><div class="editor" macro="edit title"></div>
<div class="editLabel">Tags</div><div class="editor" macro="edit tags"></div>
<div class='editorFooter' macro='deliciousTagging'><span class='tagChooser' title='set tiddler tags' macro='tagChooser'></span></div>
<div macro='annotations'></div>
<div class="editLabel">Content</div><div class="editor" macro="edit text"></div>
<div class='editor' macro='preview hide previewTiddler'></div>
<!--}}}-->
!StyleSheet
/*{{{*/
body{background: [[ColorPalette::TertiaryDark]];}
#backstageButton a{color:[[ColorPalette::TertiaryLight]];padding-left:10em;}
#backstageButton a:hover{color:[[ColorPalette::Background]];background:transparent;}
#backstageToolbar{text-align:center;}
#messageArea{position:absolute;top:0.3em;left:38%;padding:0.7em 1%;width:25%;border:2px solid [[ColorPalette::TertiaryLight]];-moz-border-radius:3px; -webkit-border-radius:3px;background:[[ColorPalette::TertiaryDark]];color:[[ColorPalette::TertiaryMid]];}
#messageArea .messageToolbar{display:block;float:right;padding:0.1em;text-align:right;width:30px;}
#messageArea a, #messageArea .button{background:transparent;text-decoration:none;color:[[ColorPalette::Background]];}
#messageArea a:hover{color:[[ColorPalette::Foreground]];}
.headerShadow{padding: 1em 1em 0;font-family: 'Baskerville, Verdana, Trebuchet MS' sans-serif;font-weight:bold;}
.headerShadow, .headerShadow .siteSubtitle, .headerShadow .tiddlyLink{color: [[ColorPalette::TertiaryPale]];}
.headerShadow .tiddlyLink:hover{color:[[ColorPalette::SecondaryMid]];}
.subtitle{padding:0px;margin:0px;padding-left:1em;font-size: 90%;color: [[ColorPalette::TertiaryMid]];}
.subtitle .tiddlyLink{color: [[ColorPalette::TertiaryMid]];}
.topMenu{background-color:transparent;color:[[ColorPalette::PrimaryPale]];}
.popup .popBtn .button, .topMenu .button, .topMenu .tiddlyLink{font-weight:bold;margin:0 0.5em;padding:3px 1px;color:[[ColorPalette::PrimaryPale]];background:transparent;font-size:115%;border:0 !important;}
.popup .popBtn .button{font-size:100%;margin:0 3px;}
.popup .popBtn .button:hover, .topMenu .button:hover, .topMenu .tiddlyLink:hover{color: [[ColorPalette::SecondaryMid]];background:transparent;}
#topMenu{width:100%;padding:0.3em 0;}
#topMenuL br, #topMenuR br{display:none;}
#topMenuL{float:left;margin-left:0.5em;height:25px;}
#topMenuR{display:block;position:absolute;right:0em;z-index:11;height:25px;color:[[ColorPalette::TertiaryMid]];min-width:10%;float:right;top:4.9em;}
#topMenuClear{clear:both;width:100%;height:1px;border:0px;margin:0px;padding:0px;}
#toggleLeftSideBar{position:absolute;top:5px;left:5px;z-index:999;left:40;color:[[ColorPalette::Background]];}
#toggleLeftSideBar a{color:[[ColorPalette::Background]];background:none;border:0;}
#toggleLeftSideBar a:hover{background:none;border:0;}
#mainMenu{padding:10px 0 0 0;margin-top:-10px; width:8.1em; background:[[ColorPalette::PrimaryMid]]; -moz-border-radius:5px; -webkit-border-radius:5px;border:0; border-right: 5px solid [[ColorPalette::PrimaryMid]]; border-bottom: 5px solid [[ColorPalette::PrimaryMid]];text-align:left;z-index:0;}
#mainMenu ul{list-style:none;padding:0;margin:0px;}
#mainMenu li{clear:both;}
#mainMenu a{padding-left:5%;width:95%;margin-top:-1px;border-bottom:1px solid [[ColorPalette::Foreground]];border-top:1px solid [[ColorPalette::Foreground]];color:[[ColorPalette::PrimaryPale]];display:block;}
#mainMenu a:hover{color:[[ColorPalette::SecondaryMid]];background:[[ColorPalette::TertiaryDark]];}
#mainMenu ul ul{margin-bottom:30px;}
#mainMenu .accordion ul li .button, #mainMenu .accordion ul li .button:hover ,
#mainMenu .accordion ul li .quickopentag .button,
#mainMenu .accordion ul li .quickopentag .button:hover {border:0 none;float:left;padding:0 3%;text-align:center;width:10%;font-size:11px;}
.popup .quickopentag .button {border-color:transparent;}
#mainMenu .accordion ul li .quickopentag .tiddlyLink{border:0;float:left;padding:0 0 0 1%;width:67%;color:[[ColorPalette::SecondaryLight]];}
#mainMenu .accordion ul li .quickopentag .tiddlyLink:hover {text-decoration:underline;color:[[ColorPalette::SecondaryMid]];background:[[ColorPalette::Foreground]];}
#mainMenu .noCopy{color:[[ColorPalette::TertiaryDark]];border-top:none;}
#mainMenu .main{padding:1px 0 1px 5px;}
.xtagger .quickopentag .tiddlyLink:hover {text-decoration:underline;color:[[ColorPalette::SecondaryMid]];background:[[ColorPalette::Foreground]];}
.xtagger .quickopentag .tiddlyLink{font-size:110%;border:0;padding:0 0 0 1%;display:inline;color:[[ColorPalette::SecondaryLight]];}
#sidebar{margin:-10px 0 0 0;padding:14px 0 5px 0; background:[[ColorPalette::PrimaryMid]]; -moz-border-radius:5px; -webkit-border-radius:5px;border:0; border-left: 5px solid [[ColorPalette::PrimaryMid]]; border-bottom: 5px solid [[ColorPalette::PrimaryMid]];width:17.6em;right:0;}
#sidebarTabs{margin:1em 0 0 0.5em;}
#sidebar .button{border-style:none;padding:2px 8px 2px 2px;}
#sidebar .button:hover{color:[[ColorPalette::SecondaryMid]];}
#sidebar br{display:none;}
#sidebar hr{height:0;border:0;border-bottom:1px solid [[ColorPalette::Foreground]];}
#sidebar li a{display:block;}
#sidebar a{color:[[ColorPalette::TertiaryPale]];}
#sidebar .tiddlyLinkNonExisting{color:[[ColorPalette::TertiaryLight]];}
#sidebar .highlight, #sidebar .marked, #sidebar a:hover{color:[[ColorPalette::SecondaryMid]];background:[[ColorPalette::Foreground]];}
#sidebar .tabset{margin-bottom:2px;padding:0.5em 0 0 0 !important}
#sidebar .tabset .tab {padding:3px;font-size:9px;font-weight:bold;height:16px;background-color:[[ColorPalette::Foreground]];color:[[ColorPalette::TertiaryLight]];display:inline;border:0;border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
#sidebar .tabset .tab:hover{background-color:[[ColorPalette::TertiaryDark]];color:[[ColorPalette::Background]];}
#sidebar .tabset .tabSelected{color:[[ColorPalette::SecondaryMid]];background:[[ColorPalette::TertiaryDark]];}
#sidebar .tabContents{background-color:[[ColorPalette::PrimaryMid]];border:0;border-top:1px solid [[ColorPalette::TertiaryDark]];color:[[ColorPalette::Background]];}
#sidebar .tagCloudtag, #sidebar #TOCMenu{display:inline;}
#sidebar .tabContents .tabset, #sidebar .tabContents .tabContents{padding:0;margin-left:-0.5em;}
#sidebar .tabContents .tabContents {padding-top:5px;margin-left:0.2em;}
#sidebar .tabContents .sideBarTags ul .tiddlyLink{padding:1px 0;width:88%;float:right;}
#sidebar .tabContents .sideBarTags .button{width:8%;padding:1px 1%;text-align:center;}
#sidebar .sidebarTitle a{display:block;font-size:110%;border-bottom:1px solid [[ColorPalette::Foreground]];font-weight:normal;}
#sidebar .TOC{padding:0;}
#sidebar .TOCList{padding:0;margin-top:3px;display:block;}
#sidebar .TOCList, #sidebar .TOCList option{border:[[ColorPalette::PrimaryMid]];background:[[ColorPalette::PrimaryMid]];color:[[ColorPalette::Background]];}
#sidebar .TOCList option:hover{background:[[ColorPalette::Foreground]];color:[[ColorPalette::SecondaryMid]];}
#searchResults{padding:1em;border: 1px solid [[ColorPalette::TertiaryLight]];margin:0;right:0.5em;position:absolute;background:[[ColorPalette::Background]];min-width:30%;max-width:40%;z-index:1000;}
#searchResults ul{max-height:150px;overflow:auto;}
#searchResults h1{clear:both;}
#searchResults ul{margin: 0.5em;padding-left:1.5em;}
#searchResults li{list-style-type:circle;}
#search_open,
#search_close{display:block;float:right;padding:5px 10px;width:70px;margin:5px 10px 10px 0px;text-align:center;border: 1px solid [[ColorPalette::TertiaryLight]];}
#searchResults .tiddlyLink{display:block;}
#tiddlersBar{margin-top:0px;padding-top:0px;}
.toolbar{float:right;}^
.toolbar .tiddlyLinkExisting{font-weight:normal;}
.toolbar{visibility:hidden;}
.selected .toolbar{visibility:visible;}
#displayArea{margin: 0.5em 17.1em 0em 10.1em;}
.tiddler{background:[[ColorPalette::Background]];border:3px solid [[ColorPalette::Background]];-moz-border-radius:3px; -webkit-border-radius:3px;border-right: 2px [[ColorPalette::TertiaryMid]] solid;border-bottom: 2px [[ColorPalette::TertiaryMid]] solid;margin-bottom: 1em;padding:1em 2em 2em 1.5em;}
.viewer{clear:both; POSITION: relative;color:[[ColorPalette::TertiaryDark]];padding-bottom:3px;}
.title, .titleContainer .miniTag{font-size: 250%;color: [[ColorPalette::PrimaryLight]];font-family: 'Baskerville, Verdana,Trebuchet MS' sans-serif;}
.editor textarea, .editor input{font-family: 'Consolas' monospace;background-color:[[ColorPalette::TertiaryPale]];}
.editorFooter{line-height:1.6em;}
.tagChooser{font-weight:bold;font-size:120%;}
h1,h2,h3,h4,h5,h6{background-color: transparent;color: [[ColorPalette::Foreground]];}
.toTop a:hover{background:transparent;}
#addReminderForm{clear:both;}
.clearDiv{clear:both; margin:0px; padding:0px; width:100%; height:1px;}
.toolbar a.on{color:orange;font-size:15px;background-color:[[ColorPalette::Background]];}
#popup {padding:3px;}
.popup li,.popup ul,.popup ol,.popup span li,.popup span ul,.popup span ol {list-style:none !important;margin:0px !important;padding:0px !important;}
#popup tr.fieldTableRow td{padding:1px 3px 1px 3px;}
#popup div{color:[[ColorPalette::SecondaryMid]];text-decoration:underline;}
ol.popup{border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryMid]] [[ColorPalette::PrimaryMid]] [[ColorPalette::PrimaryDark]]; -moz-border-radius:3px; -webkit-border-radius:3px;}
.popup{background:[[ColorPalette::PrimaryMid]];}
.popup br{display:none;}
.popup ul li .button{padding:0.4em;display:block;}
.popup hr{padding:0;margin:0;border:0;}
.popup a, ol.popup li a, .popup ul li .button, .popup .menuH .button, .popup li a:visited{background:transparent;color:[[ColorPalette::TertiaryPale]];}
.popup a:hover, ol.popup li a:hover{background:[[ColorPalette::TertiaryDark]];color:[[ColorPalette::SecondaryMid]];}
.popup h1, .popup h2, .popup h3, .popup hr{border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
.popup h1, .popup h2, .popup h3, .popup h4, .popup h5, .popup{background:[[ColorPalette::Foreground]];color:[[ColorPalette::Background]];}
.popup .menuH{display:block;margin:0.5em 0 0 3px;padding:0;font-size:1.4em;font-weight:bold;border-bottom:1px solid [[ColorPalette::TertiaryDark]];min-width:250px;}
.helpPopup{font-size:120%;font-family:overflow:none;overflow-y:scroll;height:400px;font-family:'Verdana,sans-serif';}
td, tr{vertical-align:top;}
.viewer table,table.twtable{margin:0;border-collapse:collapse;border:1px solid [[ColorPalette:TertiaryMid]];}
.viewer table, table.twtable, .viewer td, .viewer tr, .twtable td, .twtable tr,
.viewer th, .viewer thead td, .twtable th, .twtable thead td{border:1px solid [[ColorPalette:TertiaryMid]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td{font-weight:bold;}
.viewer th .tiddlyLink, .viewer th .tiddlyLinkExisting, .viewer th .externalLink,
.viewer thead .tiddlyLink, .viewer thead .tiddlyLinkExisting, .viewer thead .externalLink{color:[[ColorPalette::Foreground]];}
.viewer th .tiddlyLink:hover, .viewer th .tiddlyLinkExisting:hover, .viewer th .externalLink:hover,
.viewer thead .tiddlyLink:hover, .viewer thead .tiddlyLinkExisting:hover, .viewer thead .externalLink:hover{color:[[ColorPalette::Background]];}
.linkTable .quickopentag .tiddlyLinkExisting,.linkTable .quickopentag .externalLink{display:inline;}
.noborder, .noborder table, .noborder td, .noborder tr, .noborder th, .noborder tbody { border:0 !important;margin:0 !important;}
.noborder tbody td{padding:1px 4px 1px 2px;}
#sidebarOptions .black .calendar{text-align:center;margin:0 auto;}
.black{display:inline-block;color:[[ColorPalette::TertiaryMid]];}
.black table{border:0 !important;}
.viewer .black{border:10px solid [[ColorPalette::PrimaryMid]];-moz-border-radius:10px; -webkit-border-radius:10px;}
.black, .black table, .black th, .black tr, .black td{background:[[ColorPalette::PrimaryMid]];padding:0 !important;border:0;}
.black .calendar td{border:1px solid [[ColorPalette::PrimaryMid]] !important;border-collapse:collapse;}
.black .calendar .weekNo{font-style:normal;color:[[ColorPalette::TertiaryMid]];border-left:5px solid [[ColorPalette::PrimaryMid]];border-collapse:collapse;}
.black .calendar a,.black .calendar td .button{padding:2px 3px !important;margin:0;color:[[ColorPalette::TertiaryPale]];display:block;}
.black .calendar td .button{color:[[ColorPalette::TertiaryMid]];}
.black .tiddlyLinkNonExisting, .black .tiddlyLink, .black .button{background:transparent;border:transparent;fonts-style:normal;}
.black .calendarMonthname,
.black .calendarMonthname .tiddlyLink{color:[[ColorPalette::TertiaryMid]];font-style:normal;}
.black .calendarMonthname .tiddlyLink:hover, .black .tiddlyLink:hover, .black .button:hover{color:[[ColorPalette::SecondaryMid]];}
.black br{display:none;}
.viewer iframe{width:100%;height:450px;border:1px solid [[ColorPalette::TertiaryMid]];-moz-border-radius:3px; -webkit-border-radius:3px;}
.viewer .tiddlyLink, .viewer .tiddlyLinkExisting, .viewer .externalLink{border-bottom:1px solid transparent;border-top:1px solid transparent;color:[[ColorPalette::TertiaryDark]];}
.tiddlyLink:hover, .tiddlyLinkExisting:hover, .externalLink:hover{color:[[ColorPalette::SecondaryMid]];background:transparent;border-bottom-color:[[ColorPalette::SecondaryPale]];border-top-color:[[ColorPalette::SecondaryPale]];}
.block .tiddlyLink, .remind .tiddlyLink{padding: 0 3px;}
.block .tiddlyLink,
table.linkTable .tiddlyLinkExisting, table.linkTable .externalLink{display:block;padding-left:0.7em;}
table.linkTable .tiddlyLinkExisting{text-decoration:none;}
.block .tiddlyLink:hover,.remind .tiddlyLink:hover,
table.linkTable .tiddlyLinkExisting:hover, table.linkTable .externalLink:hover{}
.remind{padding:2px 5px;border:3px solid transparent;-moz-border-radius:3px; -webkit-border-radius:3px;}
.remind:hover{background:#f6f6f6;border-color:#f6f6f6;}
.vTabs .tabset {float:left;display:block;padding:0px;margin-top:5px;min-width:15%;}
.vTabs .tabset .tabset {margin-top:0px;}
.vTabs .tabset .tabSelected {color:[[ColorPalette::SecondaryDark]];background:[[ColorPalette::TertiatyMid]];font-weight:bold;text-decoration:underline;}
.vTabs .tabset .tab {display:block;text-align:right;padding:2px 5px; margin:0 1px 1px 0;background:transparent;border:0;color:[[ColorPalette::SecondaryMid]];}
.vTabs .tabset .tab:hover {background:[[ColorPalette::SecondaryMid]];color:[[ColorPalette::Background]];}
.vTabs .tabContents {margin-left:15%;max-width:85%;padding:0 10px 5px 10px;background:transparent;border:none;border-left:1px solid [[ColorPalette::TertiaryLight]];}
#annowrap {padding:0;margin:0;border:0;}
#annowrap .popup{display:block;min-width:100px;max-width:300px;font-size:100%;}
#annowrap .popup br {display:block !important;}
#annowrap .popup h1, .anno .popup h2{color:[[ColorPalette::TertiaryLight]];}
.annosub{cursor:pointer;padding:0px 1px 0px 3px;}
.annosub span{padding:0px 1px 0px 3px;}
.annosubover{color:[[ColorPalette::SecondaryDark]];cursor:pointer;}
.annosubover span{background-color:[[ColorPalette::SecondaryPale]];padding:0px 1px 0px 3px;}
.desk .annosub {color:[[ColorPalette::TertiaryDark]];}
.desk .view {display:block;float:left;padding:0 5px;}
.desk table .button{padding:1px 3px;border-color:transparent;font-weight:bold;}
.desk .block .noborder td{padding:0 1px 0 0;}
.desk .block .quickopentag .tiddlyLink{padding:1px 1%;width:92%;float:left;}
.desk .block .miniTags .button, .desk .block .quickopentag .button{width:4%;padding:1px 1%;text-align:center;float:left;font-size:14px;}
.desk .block .miniTags .button{width:96%;float:left;font-size:10px;}
.deskNew span{display:inline-block;width:75px;}
.miniTags .button{margin:0 2px;border:0;}
.topMenu .pL .button{padding-left:25px;}
.topMenu .pR .tiddlyLink{padding-right:25px;}
.viewer .marked {padding:0 2px;}
#tbHelp .tabContents{min-height:150px;}
@media print{
#topMenu, #topMenuR, #tiddlersBar{display: none ! important;}
.headerShadow{visibility: hidden ! important;}
.tiddler{border-style: none ! important;margin:0px ! important;padding:0px ! important;padding-bottom:2em ! important;}
.tagglyTagging .button, .tagglyTagging .hidebutton{display: none ! important;}
.tagglyTagged .quickopentag, .tagged .quickopentag{border-style: none ! important;}
.quickopentag a.button, .miniTag{display: none ! important;}
}
/* get user styles specified in StyleSheet */
[[StyleSheet]]
/*}}}*/
|linkTable|k
|width:500px; !by date created |width:500px; !by date modified |
|vertical-align:top;padding-left:20px;<<timeline "created">>|vertical-align:top;padding-left:20px;<<timeline "modified">>|
<<toggleSideBarTB left show>>|<<popup ♥ [[<<tiddler topMenuL##star$))]]>>|[[desk|desk]]|<<popup journal [[<<tiddler topMenuL##journal$))]]>>|<<popup new [[<<tiddler topMenuL##new$))]]>>|<<popup next [[<<tiddler topMenuL##next$))]]>>|<<popup calendar [[<<tiddler topMenuL##calendar$))]]>>|{{pR{[[+|QuickNotes]]}}}/%
!star
{{menuH{List of important tiddlers}}}
<<tiddlerList tags:"star" itemTemplate:"*%0 \n" -modified">>
!next
{{menuH{list of next actions}}}
<<tiddlerList tags:"#next" itemTemplate:"*%0 \n" -modified">>
!calendar
{{menuH{this month's [[calendar]] & list of [[reminders|reminder]]}}}
<<tiddler calendar>>
!journal
*<<newJournal "YYYY-0MM-0DD" label:"write new article" focus:title prompt:"Write a new journal entry for today" tag:journal>>
*[[see all articles|journal]]
<<tiddlerList tags:"journal" top:"10" dateFormat:"ddd. 0DD" itemTemplate:"*[[%created - %title|%title]] \n" group:"tiddler.created.formatString('YYYY, MMM')" groupTemplate:"!!!%group \n" order:"-created">>
!new
{{menuH{add new content...}}}
*[[new quick note|QuickNotes]]
*<<newTiddler label:"new tiddler">>
*<<newTiddler label:"new blog entry" focus:title prompt:"Write a new blog entry for today" tag:blog>>
*<<newTiddler label:"new next action" title:"new action" prompt:"create a new next action" focus:title tag:#next>>
*<<newTiddler label:"new active project" title:"new project" prompt:"create a new active project" focus:title tag:$active>>
*<<newJournal "YYYY-0MM-0DD" label:"new journal entry" focus:title prompt:"Write a new journal entry for today" tag:journal>>
*<<newTiddler label:"new reminder" title:"new reminder" prompt:"create a new reminder" focus:title tag:reminder text:{{store.getTiddlerText("templateNewReminder")}}>>
----
*<<newTiddler label:"new reference" title:"new reference" prompt:"create a new reference" focus:title tag:reference>>
*<<newTiddler label:"new action type" title:"#new action type" prompt:"create an action type" focus:title tag:action>>
*<<newTiddler label:"new project type" title:"$new project type" prompt:"create a new project type" focus:title tag:project>>
*<<newTiddler label:"new project stage" title:"§new project stage" prompt:"create a new project stage" focus:title tag:stage>>
*<<newTiddler label:"new contact group" title:"?new contact group" prompt:"create a new contact group" focus:title tag:contact>>
*<<newTiddler label:"new context" title:"@new context" prompt:"create a new context" focus:title tag:context>>
*<<newTiddler label:"new area" title:"&new area" prompt:"create a new area" focus:title tag:area>>
!end%/
{{pL{<<closeAll>><<rB x>>}}}[[help]]|<<popup options [[<<tiddler topMenuR##options$))]]>> <<gotoTiddler inputstyle:"display:inline;border:1px solid #ccc;padding:0px;width:150px;z-index:0;margin-left:5px;" liststyle:"display:block;position:absolute;right:2.5em;top:1.7em;z-index:10;border:1px solid #ccc;padding:0;width:auto;display:none;">><<toggleSideBarTB right show>>/%
!options
*<<permaview>>
*<<upload http://evtx.tiddlyspot.com/store.cgi index.html . . evtx>>
*[[GetThisWiki]]
----
*[[archive]]
*[[reference]]
*[[quick-notes|QuickNotes]]
*[[x-tab config]]
*[[x-tagger config]]
----
*[[more options...|options]]
!end%/
<html><iframe src="http://www.twittergadget.com/gadget.asp"></iframe></html>
/***
|''Name:''|x-plore|
|''Description''|Explore tiddler relations|
|''Version:''|0.1|
|''Type''|macro|
|''Author:''|[[TobiasBeer]]|
|''Source:''|http://tbGTD.tiddlyspot.com/#x-plore|
|''License''|[[Creative Commons Attribution-Share Alike 3.0|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Note''|idea and parts of the code have their roots in [[RelatedTiddlersPlugin|http://tiddlytools.com/#RelatedTiddlersPlugin]]|
!important
<<tiddler 'under development'>>
!configuration
Use the following sections in [[x-plore]] to define elements...
*not to be explored via ''exclude''
*to be cut of via ''truncate''
!exclude
star
!truncate
excludeLists
systemConfig
TAG==site
!help
<<tiddler {{t='x-plore info';store.getTiddler(t)?t:'x-plore::helplink'}}>>/%
helplink:For more information see or import [[x-tab info]] from [[tbGTDServer]]...
%/
!source code
***/
//{{{
config.macros.xplore={
skipped:' ...',
lblBtn:'x-plore'+(document.all?"â–¼":"â–¾"),
topBtn:'Explore tiddler relations',
lblTagging:'!!tagged by',
lblTags:'!!tagging to',
lblRefs:'!!referenced by',
lblLinks:'!!linking to',
styles:
'#popup #xplore div {text-decoration:none;padding:7px;min-width:136px;_width:180px;}'+
'#popup #xplore div a {padding:2px;white-space:nowrap;font-weight:normal;display:block;}'+
'#popup #xplore blockquote {padding-left:3px;margin:0;}'+
'#popup #xplore blockquote blockquote {border-left:1px solid #333;margin:0 0 0 10px;}'+
'#popup #xplore blockquote a {_width:90%;}'+
'#popup #xplore h2 {border:0;margin-top:0.5em;}'+
'#popup #xplore td {border:1px solid transparent !important;padding: 0 5px 5px 5px !important;}'+
'#popup #xplore td:hover{border:1px solid #333 !important;}'+
'#popup #xplore div br {display:none;}',
handler:function(place,macroName,params,wikifier,paramString,tiddler){
var p,btn,cls,ex,fst,min,mode,tb,tid,tit,tree,trunc,r;
tid=story.findContainingTiddler(place);
tit=tid?tid.getAttribute('tiddler'):'';
p=paramString.parseParams(null,null,true);
btn=getParam(p,'button','')=='true';
tb=getParam(p,'toolbar','')=='true';
if(btn&&tit){
btn=createTiddlyButton(place,this.lblBtn,this.tipBtn,this.click,"button","xploreBtn");
btn.setAttribute('tiddler',tit);
btn.setAttribute('params',paramString);
if(tb)btn.setAttribute('toolbar',true);
return;
}
fst=getParam(p,'first',tit);
cls=getParam(p,'class','');
tree=getParam(p,'tree','true')=='true';
var getArr=function(prm){//retrieve array from tiddler text
var a=getParam(p,prm,'').readBracketedList(),f=a[0],i,i1,t,x,s=[];
if(f&&f.substr(0,5).toUpperCase()=='GET=='){
t=store.getTiddlerText(f.substr(5));
if(s){
a=t.readBracketedList();
for(i=0;i<a.length;i++){
f=a[i];
if(f&&f.substr(0,5).toUpperCase()=='TAG=='){
a.splice(i,1);
x=store.getTaggedTiddlers(f.substr(5));
for(i1=0;i1<x.length;i1++)s.pushUnique(x[i1].title);
}
}
for(i=0;i<s.length;i++)a.pushUnique(s[i]);
a.sort();
}
}return a;
}
ex=getArr('exclude');
trunc=getArr('truncate');
r=getParam(p,'root','')=='true';
min=getParam(p,'minimal','')=='true';
mode=getParam(p,'mode','');
if(mode!=''){
if(this['get'+mode]==undefined)mode='Tagging';
wikify(this['lbl'+mode]+'\n'+this.list(fst,tree,trunc,ex,this['get'+mode],r,min),place);
}else{
wikify('|'+cls+'|k\n|||||',place);
var tds=place.lastChild.getElementsByTagName('td');
wikify(this.lblTagging+'\n'+this.list(fst,tree,trunc,ex,this.getTagging,r,min),tds[0]);
wikify(this.lblTags+'\n'+this.list(fst,tree,trunc,ex,this.getTags,r,min),tds[1]);
wikify(this.lblRefs+'\n'+this.list(fst,tree,trunc,ex,this.getRefs,r,min),tds[2]);
wikify(this.lblLinks+'\n'+this.list(fst,tree,trunc,ex,this.getLinks,r,min),tds[3]);
}
},
list:function(first,asTree,trunc,ex,get,r,min){
//first: tree root tid, asTree: tree <> list, trunc: [[tids]] [[limiting]] the tree
//ex: exclude tagged tids, r: display root, min: true=min spanning tree <> false=multiple pathes for 'nodes'
//get: fct getXYZ(tiddlerObj){return arrayOfTiddlerTitles;}
// ...possibly one of getLinks, getRefs, getTags, getTagging (see below)
var out,tids=[],tree={text:''},indent='',paths=min?undefined:[];//init sublists []
tids=this.search(first,tids,tree,indent,trunc,ex,get,r,paths);//start recursion
setStylesheet(this.styles,'xploreStyles');
out= '{{xploreList{\n';
if(asTree)out+=tree.text;//when tree return tree
else if(tids.length>0)out+='[[' + tids.join(']][[')+']]';//when list, join as links
return out+'}}}';
},
search: function(tid,tids,tree,indent,trunc,ex,get,r,paths,p,fst){
//trunc, ex, get, r, paths: dito
//tid: start tid, tids: searched tids[], tree: output tree
//indent: curr indent lvl, paths: all found paths[],p: current path in paths
var t=store.getTiddler(tid);//root tid of branch
var ini=false;
var b=(paths!=undefined); //multiple paths
if(b&&p==undefined){//if so and sublist not paths
p=0;paths[p]=[];ini=true; //init pointer, sublist and store init
}
if(fst==undefined)fst=tid;//check & store fst
//return curr list, if missing, excluded via tag or already in (sub-)list
if(!t||tid==fst&&tids.length>0||t.tags.containsAny(ex)||b&&paths[p].contains(t)||!b&&tids.contains(tid))return tids;
//if not init of multiple paths or rootnode to be displayed... add to sublist
if(!ini||r){
if(b)paths[p].push(t);
tids.push(t.title); //add tiddler to results
var skip=trunc&&trunc.contains(tid); //skip when in truncated
tree.text+=indent+"[["+tid+(skip?this.skipped.format([tid]):"")+"|"+tid+"]]"+"\n";
if(skip)return tids; // branch is pruned... don't follow links
}
var links=get?get(t):this.getTagging(t);//get next level via get fct or links
//init subpaths by copying the current one
if(b)for(var i=1;i<links.length;i++)paths[p+i]=paths[p].slice(0);
for(var i=0; i<links.length; i++)//search subnodes
tids=this.search(links[i],tids,tree,indent+">",trunc,ex,get,r,paths,(p?p+i:p),fst);
return tids;//return list
},
getLinks:function(t){if(!t.linksUpdated)t.changed(); return t.links;},
getRefs:function(t){
var i,o=[],r=store.getReferringTiddlers(t.title);
for(i=0;i<r.length;i++)if(r[i].title!=t.title)o.push(r[i].title);
return o;
},
getTags:function(t){return t.tags;},
getTagging:function(t){
var o=[],l=store.getTaggedTiddlers(t.title);
for(var i=0;i<l.length;i++)if(l[i].title != t)o.push(l[i].title);
return o;
},
click:function(e){
e=e||window.event;
var p=Popup.create(this);
wikify('<<xplore first:\''+this.getAttribute('tiddler')+'\''+this.getAttribute("params")+' >>',createTiddlyElement(p,'span','xplore','xplore'));
Popup.show(p,false);
s=document.getElementById('sidebar');
if(this.getAttribute('toolbar')){p.style.left='';p.style.right=(20+(s?s.offsetWidth:0))+'px';}
e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();
return false;
}
}
//}}}
/***
<<xtab defaults:true>>
|''Name''|x-tab|
|''Description''|a crosstable for tags|
|''Version''|1.0|
|''Type''|macro|
|''Author''|[[TobiasBeer]]|
|''Source''|http://tbGTD.tiddlyspot.com/#x-tab|
|''Documentation''|http://tbGTD.tiddlyspot.com/#%5B%5Bx-tab%20info%5D%5D|
|''License''|[[Creative Commons Attribution-Share Alike 3.0|http://creativecommons.org/licenses/by-sa/3.0/]]|
!Code
***/
//{{{
setStylesheet('.xtabBtn{cursor:pointer}'+
'.xtab{margin:5px 0 20px 0;background:#F6F6F6;padding:10px;border:5px solid #EEE;-moz-border-radius:5px;-webkit-border-radius:5px;}'+
'.xtabFrm td{vertical-align:bottom;height:30px;margin-right:10px !important;}'+
'.xtabFrm em{margin-left:10px;font-style:normal;color:#39C;font-weight:bold;font-size:90%;}'+
'.xtabFrm input{margin-left:10px;}.xtabFrm input,.xtabFrm span{cursor:pointer;}.xtabFrm .externalLink{margin-left:10px;}'+
'.xtabFrm select{padding-right:0 !important;width:210px;cursor:pointer;float:right;}'+
'.xtabFrm xtabToggle{display:inline-block;width:65px;text-align:center;cursor:pointer;margin-right:10px;}'+
'.xtabPrv{color:#888;margin:5px 0 10px 50px;display:block;}.xtabPrv span{color:#39C;}'+
'.xtabOut {max-width:100%;overflow-y:hidden;}'+
'.viewer .xtabOut .button{margin:0;}','StyleSheetGTDxLookup');
//}}}
//{{{
config.macros.xtab={
cfg:{
//defaults: 0=taglist, 1=presetlist, 2=autodetect-config, 3=preset
defaults:['x-tab config##Tags','x-tab config##Presets','x-tab config##Detect','xtab'],
dropClass:'button',
resultTabClass:'',
miniTag:'<<tiddler scripts##miniTag with: [[%0]]>>',
addNew:true,
headerRightFrom:10,
//preset identifiers
pRows:'rows',
pCols:'cols',
pSec:'snd',
pOps:'options',
pOpAL:'ALLTAGS!',
pOpSR:'1row',
pOpSC:'1col',
pOpTR:'transpose',
//language
info:'info',
btnShow:"x-tab",
btnHide:"hide x-tab",
btnTip:"toggle x-tab panel",
template:"preset template... ",
noTags:"No valid tags provided for x-tab. ",
nOkTags:"Invalid taglist for x-tab! '%0' could not be found.",
nOkPresets:"Invalid presets for x-tab! '%0' could not be found.",
nOkPreset:"Invalid x-tab preset! No option '%0' in dropdown '%1'. Check your custom fields or parameters.",
nOkRender:"Could not render x-tab into %0. No such dom-element!",
nOkDetect:"Invalid x-tab parameter '%0' for 'detect'!",
nOkField:"x-tab can't find field '%0' for tiddler '%1'.",
nDef:"undefined",
P:["preset:","select a preset","select preset..."],
R:["rows:","select a category tag for rows","select rows tag..."],
C:["columns:","select a category tag for columns","select columns tag..."],
S:["secondary:","select secondary for rows (first select a tag-category for rows)","select secondary..."],
TR:["transpose","click to swap rows and columns"],
SR:["1row","use the tag in 'rows' or 'secondary' directly instead of its subtags"],
SC:["1col","use the tag in 'columns' directly instead of its subtags"],
AL:["all tags","use all available tags for dropdowns"],
PT:["template","provides a template which you can use to add to your list of preset definitions"]
},
handler:function(place,macroName,params,wikifier,paramString,tiddler){
this.cfg.drop=document.all?"â–¼":"â–¾";
var el,id,ps=paramString,b=params[0];
id=new Date().getTime()+(''+Math.random()).substr(5);
if(b&&b.toUpperCase().indexOf('BUTTON')==0){//button must be first!
el=createTiddlyButton(place,this.cfg.btnShow+this.cfg.drop,this.cfg.btnTip,this.toggle,'button xtabBtn');
jQuery(el).attr({'tiddler':b.substr(7),'params':ps,'xtabid':id});//set tiddler for button@tiddler
}else this.create(id,ps,place);
},
toggle:function(e){
var c,f,h=false; //h=hide, f=form, x=macro
x=config.macros.xtab,c=x.cfg;
f=document.getElementById('xtab'+this.getAttribute('xtabid')||'');
if(f){//form exists -> toggle
h=f.style.display!='none';
f.style.display=h?'none':'block';
}else x.create(this);
this.innerHTML=(h?c.btnShow:c.btnHide)+c.drop;
return false;
},
update:function(id){
var a1,a2,al,by,c,chk,cols,d1,d2,el,f,hc,hd,hd2='',hr,nu,o,out='',pr,rows,sc,sr,snd,t,ti,t1,t2,tr,v,v1,v2,x=config.macros.xtab,c=x.cfg;
by=function(i){return document.getElementById(i);}
f=by('xtabFrm'+id);el=by('xtabOut'+id);pr=by('xtabPrv'+id);
removeChildren(el);removeChildren(pr);
sr=by('SR'+id).checked;
sc=by('SC'+id).checked;
tr=by('TR'+id).checked;
al=by('AL'+id).checked;
snd=by('snd'+id);
cols=by('cols'+id);
rows=by('rows'+id);
d1=snd.selectedIndex>0?snd:by('rows'+id);
d2=by('cols'+id);
if(tr){v=d1;d1=d2;d2=v;}
v1=d1.selectedIndex==0?null:d1.value;
v2=d2.selectedIndex==0?null:d2.value;
if(v1&&v2){
a1=sc&&tr?[store.getTiddler(v1)]:(sr&&!tr?[store.getTiddler(v1)]:store.getTaggedTiddlers(v1));
a2=sc&&!tr?[store.getTiddler(v2)]:(sr&&tr?[store.getTiddler(v2)]:store.getTaggedTiddlers(v2));
hc='\u25bc'+v1;if(sc&&tr||sr&&!tr)hc='';
hr=v2+'\u25b6';if(sr&&tr||sc&&!tr)hr='';
hd='"""'+(hc&&hr?hc+'/ '+hr:(hc?hc:hr))+'"""';
if(a2.length>=c.headerRightFrom){hr=hr?'\u25C0'+v2:'';hd2='"""'+(hc&&hr?hr+'/ '+hc:(hc?hc:hr))+'"""';}
out='|'+c.resultTabClass+'|k\n| '+hd;
for(t2=0;t2<a2.length;t2++){
ti=a2[t2].title;
nu=c.addNew?tbGTD.nu(ti):'';
out+=' | '+nu+'<<tag [['+ti+']]>>';
}out+=(hd2!=''?'|'+hd2:'')+' |h\n';
for(t1=0;t1<a1.length;t1++){
ti=a1[t1].title;
nu=c.addNew?tbGTD.nu(ti):'';
hd='<<tag [['+ti+']]>>';
out+='| !'+nu+hd;
for(t2=0;t2<a2.length;t2++){
out+='|'
tgt=store.getTaggedTiddlers(a1[t1].title);
for(t=0;t<tgt.length;t++){
if(tgt[t].tags.contains(a2[t2].title)){
ti=tgt[t].title;out+='@@margin:0;<<tag [['+ti+']]>>'+c.miniTag.format([ti])+'@@<br />';
}
}
}
out+=(hd2!=''?'|'+hd+' ':'')+'|\n';
}
//preset template
if(by('PT'+id).checked){
chk=function(s){return s.indexOf(' ')>=0?"'"+s+"'":s;};
o=sr||sc||tr;
o=o?c.pOps+':'+
(sr?c.pOpSR:'')+
(sc?(sr?'&':'')+c.pOpSC:'')+
(tr?(sr||sc?'&':'')+c.pOpTR:''):'';
v=snd.value;v=snd.selectedIndex==0?'':v;v1=rows.value;v2=cols.value;
wikify(c.template+'@@font-weight:bold;'+(al?c.pOpAL:'')+chk(v)+' '+chk(v1)+' by '+chk(v2)+'=='+
c.pRows+':'+chk(v1)+' ' + (v?c.pSec+':'+chk(v)+' ':'') + c.pCols+':'+chk(v2)+' '+chk(o)+'@@',pr);
}
}
//create output
wikify(out,el);
},
create:function(id,ps,el,setAll){
var a,all,at,c=this.cfg,cr,cs,d,dc,dt,f,fs,gd,i,p,pls,pos,pr,prs,rt,sp,src,t,ti,tid,tids=[],td,tds,tgs=[],tmp,tls,xel=false;
if(typeof(id)=='object'){
rt=id;
tmp=id.getAttribute('tiddler');
if(tmp=='')el=story.findContainingTiddler(id);//into this tid
else{
xel=tmp.toUpperCase().indexOf('ID==')==0;
el=xel?document.getElementById(tmp.substr(4)):story.getTiddler(el);//into id or named tiddler
}
if(!el)alert(c.nOkRender.format([tmp]));
else{
tid=el.getAttribute('tiddler');
if(!xel)el=jQuery('.viewer',el)[0];//if tid, render in viewer
//get attribs
ps=id.getAttribute('params');
id=id.getAttribute('xtabid');
}
}
if(!tid){tid=story.findContainingTiddler(el);if(tid)tid=tid.getAttribute('tiddler');}
p=ps.parseParams(null,null,true);//get params
def=getParam(p,'defaults','').toUpperCase()=='TRUE';
tls=getParam(p,'taglist');if(!tls&&def&&c.defaults[0])tls=c.defaults[0];
pls=getParam(p,'presets');if(!pls&&def&&c.defaults[1])pls=c.defaults[1];
dt=getParam(p,'detect','');if(!dt&&def&&c.defaults[2])dt=c.defaults[2];
pr=getParam(p,'preset','');if(!pr&&def&&c.defaults[3])pr=c.defaults[3];
pos=getParam(p,'position','').toUpperCase();
all=pr.toUpperCase().indexOf(c.pOpAL)==0;
if(all)pr=pr.substr(c.pOpAL.length);
a=setAll||!tls||all&&setAll==undefined;
if(a){//get tags
tgs=store.getTags();
}else{
//init taglist
if(tls){
tgs=store.getTiddlerText(tls);
if(!tgs)alert(c.nOkTags.format([tls]));
else tgs=tgs.readBracketedList();
}
if(tgs.length==0&&!a)alert(c.noTags);
}
//init presets
if(pls){
prs=store.getTiddlerText(pls);
if(!prs)alert(c.nOkTags.format([pls]));
else prs=prs.split('\n');
}
dc=c.dropClass;
cr=createTiddlyElement;
if(setAll==undefined){
sp=document.createElement('span');//render container
if(pos=='FIRST')el.insertBefore(sp,el.firstChild);
else if(!xel&&rt&&pos!='LAST')el.insertBefore(sp,rt.nextSibling);
else el.appendChild(sp);
}else sp=el;
el=cr(sp,'div','xtab'+id,'xtab');//div
f=cr(el,'form','xtabFrm'+id,'xtabFrm');//form
f.setAttribute('params',ps);
wikify('|borderless|k\n|||>|\n||||\n',f);
tds=f.lastChild.getElementsByTagName('td');
td=tds[1];this.nuSel(tds[0],'presets',prs,c.P,'P',dc);
cs=[['PT','tmpl'],['TR','trans'],['SR','oner'],['SC','onec'],['AL','allt',a]];
for(i=0;i<cs.length;i++)this.nuChk(td,cs[i][0]+id,cs[i][1],c[cs[i][0]],dc,cs[i][2]);
createExternalLink(td,store.getTiddlerSlice("x-tab","Documentation"),c.info);
this.nuSel(tds[2],'rows',tgs,c.R,a?'A':'R',dc,id);
this.nuSel(tds[3],'snd',[],c.S,'S',dc,id);
this.nuSel(tds[4],'cols',tgs,c.C,a?'A':'C',dc,id);
cr(el,'div','xtabPrv'+id,'xtabPrv');
cr(el,'div','xtabOut'+id,'xtabOut');
if(pr.indexOf(':')<=0){//preset from field(@tid)
at=pr.indexOf('@');
if(at>0){
ti=pr.substr(at+1);
tid=store.getTiddler(ti);
pr=pr.substr(0,at);
if(!tid)alert(c.nOkField.format([pr,ti]));
else tid=tid.title;
}
pr=store.getValue(tid,pr);
}
if(tid&&dt&&!pr)pr=this.detect(dt,tid);//Autodetect
this.setPreset(id,pr,setAll);
return id;
},
nuChk:function(el,cid,n,t,cl,c){
var bt,cb;
cb=createTiddlyElement(el,'input',cid,null,null,{'type':'checkbox','name':n,'value':t[0]});
cb.checked=c?c:false;
cb.onclick=this.check;
bt=createTiddlyElement(el,'span',null,cl+' xtabToggle',t[0],{'title':t[1],'toggle':cid});
bt.onclick=this.check;
return(cb);
},
check:function(e){
var c,el,f,id,ns,p,x=config.macros.xtab,ps;
c=document.getElementById(this.getAttribute('toggle'));
if(c)c.checked=!c.checked;
el=c?c:this;
id=el.getAttribute('id').substr(2);
if(el.name=='allt'){
c=el.checked;f=el.form;
el=f.parentNode;p=el.parentNode;
ps=f.getAttribute('params');
removeChildren(el);p.removeChild(el);
x.create(id,ps,p,c);
}else x.update(id);
},
nuSel:function(el,n,o,t,typ,c,id){
createTiddlyElement(el,'em',null,null,t[0]);
var s=createTiddlyElement(el,'select',n+id,c,null,{'name':n,'title':t[1]});
s.onchange=this.chgSel;
this.setOpt(s,o,null,typ,t[2]);
},
setOpt:function(el,o,val,typ,title){
if(val&&el.getAttribute('cat')==val)return;
var i,l,os;
l=o?o.length:0;
os=el.options;
el.disabled=l==0;
while(os.length>1)os[os.length-1]=null;
os[0]=new Option(title,null,false,false);
if(l){
for(i=0;i<l;i++){
var t=o[i];
switch(typ){
case 'P':t=t.split('==');n=t[0];v=t[1];break;
case 'A':n=v=t[0];break;
case 'S':t=t.title;
default:n=t;v=t;
}
os[os.length]=new Option(n,v,false,false);
}
}
},
chgSel:function(e){
var x=config.macros.xtab,id=this.form.getAttribute('id').substr(7);
switch(this.name){
case 'presets':if(this.selectedIndex>0)x.setPreset(id,this.value);break;
case 'rows':x.initSecondary(id);
default:x.update(id);
}
},
initSecondary:function(id){
var s,r,tgt,v;
r=document.getElementById('rows'+id);
v=r.value;
s=document.getElementById('snd'+id);
tgt=r.selectedIndex>0?store.getTaggedTiddlers(v):[];
this.setOpt(s,tgt,v,'S',this.cfg.S[2]);
s.setAttribute('cat',v?v:'');
},
setPreset:function(id,pr,setAll){
var chk,f,l,ls,o,p,x,c=this.cfg,u=c.nDef;
if(pr){
f=document.getElementById('xtabFrm'+id);
p=pr.parseParams(null,null,false);
ls=[
['rows',getParam(p,c.pRows,u),c.pRows],
['cols',getParam(p,c.pCols,u),c.pCols],
['snd',getParam(p,c.pSec),c.pSec]
];
document.getElementById('snd'+id).selectedIndex=0;
for(l=0;l<ls.length;l++){if(ls[l][1]&&!this.chkSel(id,ls[l],f))return false;}
o=getParam(p,c.pOps,'');
x=function(n,s){document.getElementById(n+id).checked=o.indexOf(s)>=0};
x('TR',c.pOpTR);x('SR',c.pOpSR);x('SC',c.pOpSC);if(setAll==undefined)x('AL',c.pOpAT);
}
this.update(id);
},
detect:function(t,tid){
var a,d,l,n,ot,tgs,c=this.cfg;
d=store.getTiddlerText(t);
f=[c.pRows+':[[%0]] '+c.pCols+':[[%1]]',
c.pRows+':[[%0]] '+c.pCols+':[[%1]] '+c.pSec+':[[%2]] '+c.pOps+':'+c.pOpTR+'&'+c.pOpSR,
c.pRows+':[[%0]] '+c.pCols+':[[%1]] '+c.pSec+':[[%2]] '+c.pOps+':'+c.pOpTR];
if(!d)alert(c.nOkDetect.format([t]));
else{
a=d.split('\n');
while(a.length>0){
l=a.shift().readBracketedList();n=l.length;
if(tid==l[0]){
switch(n){
case 3:return f[2].format([l[0],l[1],l[2]]);
case 2:
case 4:return f[0].format([l[0],l[1]]);
}
}else{
ot=store.getTiddler(tid);
if(ot.tags.contains(l[0])){
switch(n){
case 3:return f[2].format([l[0],l[1],tid]);
case 2:
case 4:return f[1].format([l[0],l[1],tid]);
}
}
}
}
}
},
chkSel:function(id,a,f){
var c='',o,s,t,v;
s=document.getElementById(a[0]+id);v=a[1];
if(s){
o=s.options;
for(t=1;t<o.length;t++){c=o[t].value;if(v==c){s.selectedIndex=t;break;}}
}
if(v!=c){alert(this.cfg.nOkPreset.format([v,a[2]]));return false;}
if(a[0]=='rows')this.initSecondary(id);//reset secondary
return true;
}
}
//}}}
!Tags
[[action]]
[[priority]]
[[context]]
[[project]]
[[stage]]
[[$active]]
[[area]]
[[realm]]
[[contact]]
[[journal]]
[[star]]
!Presets
starred actions==rows:action cols:star options:1col
starred projects==rows:project cols:star options:1col
starred contacts==rows:contact cols:star options:1col
action by priority==rows:action cols:priority
action by area==rows:action cols:area
context by action==rows:context cols:action
context by priority==rows:context cols:priority
context by area==rows:context cols:area
stages by action==rows:stage cols:action
stages by priority==rows:stage cols:priority
stages by context==rows:stage cols:context
active projects by action==rows:project snd:$active cols:action options:transpose
active projects by stage==rows:project snd:$active cols:stage options:transpose
active projects by context==rows:project snd:$active cols:context options:transpose
active projects by priority==rows:project snd:$active cols:priority options:transpose
someday projects by context==rows:project snd:$someday cols:context options:transpose
someday projects by priority==rows:project snd:$someday cols:priority options:transpose
projects by realm==rows:project cols:realm
contacts by priority==rows:contact cols:priority
contacts by action==rows:contact cols:action
contacts by priority==rows:contact cols:priority
contacts by context==rows:contact cols:context
contacts by area==rows:contact cols:area
!Detect
action context
context action
priority action
project action $active
stage action §0.kickoff transpose
area action
realm project
contact action
/***
|''Name:''|x-tagger|
|''Version:''|1.0 (2009-11-02)|
|''Source:''|http://tbGTD.tiddlyspot.com/#x-tagger|
|''Author:''|[[TobiasBeer]]|
|''Description:''|Provides a drop down listing current tags and others to be set.|
|''~TiddlyWiki:''|Version 2.5 or better|
***/
//{{{
setStylesheet(
".xtagger li{display:block;float:left;padding-bottom:10px !important;}"+
".xtagger li ol li{padding:0 5px 5px 5px !important;clear:both;min-width:120px;display:inline;border:1px solid transparent;}"+
".xtagger li ol li:hover{border:1px solid #333;}"+
".xtagger li ol li ol li{padding:1px 0 !important;}"+
".xtagger li ol li ol li:hover{border:1px solid transparent;}"+
".xtagger li a{display:inline;font-weight:bold;}.xtagger .tiddlyLink:hover{background:transparent;}"+
".xtagger .quickopentag {width:82%;display:inline-block;}"+
".xtagger .quickopentag .tiddlyLink {display:inline;}"+
".xtagger .quickopentag .button {display:inline;border:0;padding:0 3%;text-align:center;width:10%;font-size:11px;}"+
".xtagger a.button{padding:0;}"+
".xtagger a.toggleButton {display:inline;padding:0 2px;margin-right:1px; font-size:110%;}"+
".xtagger .title {font-weight:bold;font-size:150%;color:#CCC;}","StyleSheetxTagger");
//}}}
//{{{
config.macros.xtagger={
cfg:{
mode:1,// 0 -> ask for substitution, 1 -> substitute (silent), >1 -> always add (silent)
horizontal:false,//all in one row
sidebarOffset:20,//dist from sidebar
sideWidth:'180px',//width of sides
topMarginSides:'10px',
newAt:16,//new block each
archive:'archive',//archive tag
excludeTags:'',
list:'true',
arrow:document.all?"â–¼":"â–¾", //only the fat works in IE
label:'Tags: ', //language settings
options:'options',
more:'more...',
tooltip:'Manage tiddler tags',
notags:'no tags set...',
aretags:'current tags',
txtRemove: 'remove tag',
txtEdit:"edit categories...",
txtEditTip:"edit tiddler with GTD tag categories used by x-tagger",
txtNew:"add another tag",
txtAdd:"set tag ",
promptNew:"Enter new tag:",
modeAsk:"Do also you want to remove tag '%1' and other tags from category '%2'?\nCancel simply adds tag '%3'."
},
handler:function(place,macroName,params,wikifier,paramString,tiddler){
var c,click,ex,lbl,list,more,p,src,tip,x;
x=config.macros.xtagger;c=x.cfg;
p=paramString.parseParams('tagman',null,true);
lbl=getParam(p,"label",c.label)+c.arrow;
tip=getParam(p,"tooltip",c.tooltip);
list=getParam(p,"taglist",c.list);
ex=getParam(p,"exclude",c.excludeTags).readBracketedList();
src=getParam(p,"source");if(src&&!store.getTiddlerText(src))return false;
more=getParam(p,"more",'');
click=function(e){
e=e||window.event;
var ar,d1,d2,i,curr,nuBtns,nuLi,m,max=nu=c.newAt,pop,s,t,tags=[],tids,tgt;
pop=Popup.create(this);
addClass(pop,'xtagger');
if(src){//mod tb:different method for source tiddler
tids=store.getTiddlerText(src).readBracketedList();
for(t=0;t<tids.length;t++){
tgt=store.getTaggedTiddlers(tids[t]);
tags.push('TAG:'+tids[t]);
for(s=0;s<tgt.length;s++)tags.push(tgt[s].title);
}
}else tags=store.getTags();
curr=tiddler.tags.sort();
nuLi=function(p){return createTiddlyElement(createTiddlyElement(p,"li",null,null),"ol",null,null);}
nuBtns=function(where,text,tag,pref){
var s,t;
s=createTiddlyElement(createTiddlyElement(where,"li"),"span",null,null);
t=createTiddlyButton(s,text,pref+" '"+tag+"'",x.setTag,"button toggleButton", null);
t.setAttribute("tiddler",tiddler.title);
t.setAttribute("tag",tag);
t.setAttribute("source",src);
insertSpacer(s);
if(window.createTagButton_orig_mptw)createTagButton_orig_mptw(s,tag);
else createTagButton(s,tag);
}
d1=nuLi(pop);d2=nuLi(d1);if(c.topMarginSides)d1.style.marginTop=c.topMarginSides;
createTiddlyElement(d2,"li",null,"title",(tiddler.tags.length==0?c.notags:c.aretags));
for(t=0;t<curr.length;t++)nuBtns(d2,"[x]",curr[t],c.txtRemove);
if(c.sideWidth)jQuery('li',d1).css('min-width',c.sideWidth);
if(list!='false'){
for(i=0;i<tags.length;i++){
var ti=tags[i];nu++;
if(ti.indexOf('TAG:')==0){ti=ti.substr(4);
if(nu>max||c.horizontal){nu=0;d1=nuLi(pop);}d2=nuLi(d1);
createTiddlyLink(createTiddlyElement(d2,"li",null,null),ti,ti,'title');
}
else if(!tiddler.tags.contains(ti)&&!ex.contains(ti))nuBtns(d2,"["+String.fromCharCode(160,160)+"]",ti,c.txtAdd);
}
}
//options
d1=nuLi(pop);d2=nuLi(d1);createTiddlyElement(d2,'li',null,'title',c.options);
if(c.topMarginSides)d1.style.marginTop=c.topMarginSides;
var newBtn=createTiddlyButton(createTiddlyElement(d2,"li"),(c.txtNew),null,x.setTag);
newBtn.setAttribute("tiddler",tiddler.title);
var edit=createTiddlyButton(createTiddlyElement(d2,"li"),c.txtEdit,c.txtEditTip,onClickTiddlerLink);
edit.setAttribute("tiddlyLink",src.split('##')[0]);
//archive
ti=c.archive;
if(ti){
d2=nuLi(d1);createTiddlyLink(createTiddlyElement(d2,"li",null,null),ti,ti,'title');
ar=store.getTaggedTiddlers(ti);
for(i=0;i<ar.length;i++){var ti=ar[i].title;
if(!tiddler.tags.contains(ti)&&!ex.contains(ti))nuBtns(d2,"["+String.fromCharCode(160,160)+"]",ti,c.txtAdd);
}
}
//more
m=store.getTiddlerText(more).readBracketedList();
if(m.length>0){
d2=nuLi(d1);createTiddlyElement(d2,'li',null,'title',c.more);
for(i=0;i<m.length;i++){var ti=m[i];
if(!tiddler.tags.contains(ti)&&!ex.contains(ti))nuBtns(d2,"["+String.fromCharCode(160,160)+"]",ti,c.txtAdd);
}
}
if(c.sideWidth)jQuery('li',d1).css('min-width',c.sideWidth);
Popup.show(pop,false);
s=document.getElementById('sidebar');
pop.style.left='';pop.style.right=(c.sidebarOffset+(s?s.offsetWidth:0))+'px';
e.cancelBubble=true;
if(e.stopPropagation)e.stopPropagation();
return false;
}
createTiddlyButton(place,lbl,tip,click,"button","xtaggerDrop");
},
setTag:function(e){
var nu,r,s,src,t,tag,ti,tid,title,c=config.macros.xtagger.cfg;
title=this.getAttribute("tiddler");
src=this.getAttribute("source");
tag=this.getAttribute("tag");
tid=store.getTiddler(title);
if(!tag){nu=prompt(c.promptNew,"");if(!nu)return false;else tag=nu;}
if(!tid||!tid.tags)store.saveTiddler(title,title,'',config.options.txtUserName,new Date(),tag);
else{
if(!tid.tags.contains(tag)){
if(store.getTiddlerText(src)){
if(c.mode<2){
var cats=store.getTiddlerText(src).readBracketedList();
findTagged: for(t=0;t<cats.length;t++){
ti=cats[t];
var tgt=store.getTaggedTiddlers(ti);
for(s=0;s<tgt.length;s++){
if(tgt[s].title==tag){
for(r=0;r<tgt.length;r++){
if(tid.tags.contains(tgt[r].title)){
var ok;
if(c.mode==0&&!ok){
if(!confirm(c.modeAsk.replace(/%1/,tgt[r].title).replace(/%2/,ti).replace(/%3/,tag)))break findTagged;
ok=true;
}
store.setTiddlerTag(title,false,tgt[r].title);
}
}
break findTagged;
}
}
}
}
}
store.setTiddlerTag(title,true,tag);
}
else if(!nu)store.setTiddlerTag(title,false,tag);
story.saveTiddler(title);
}
}
}
window.onClickTag=function(e){
if(!e)var e=window.event;
var nested=true;
var tgt=resolveTarget(e);
var cw=document.getElementById("contentWrapper");
while(tgt!= null){if(cw==tgt)nested=false;tgt=tgt.parentNode;}
if((Popup.stack.length>1)&&nested)Popup.removeFrom(1);
else if(Popup.stack.length>0 && nested==false)Popup.removeFrom(0);
var theId=(nested==false)?"popup":"nestedtagger";
var pop=createTiddlyElement(document.body,"ol",theId,"popup",null);
Popup.stack.push({root:this,popup:pop});
var tag=this.getAttribute("tag");
var title=this.getAttribute("tiddler");
if(pop&&tag){
var tgt=store.getTaggedTiddlers(tag);
var titles=[];
for(var r=0;r<tgt.length;r++)if(tgt[r].title!=title)titles.push(tgt[r].title);
var lingo=config.views.wikified.tag;
if(titles.length>0){
var openAll=createTiddlyButton(createTiddlyElement(pop,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);
openAll.setAttribute("tag",tag);
createTiddlyElement(createTiddlyElement(pop,"li"),"hr");
for(r=0; r<titles.length; r++)createTiddlyLink(createTiddlyElement(pop,"li"),titles[r],true);
}else{createTiddlyText(createTiddlyElement(pop,"li",null,"disabled"),lingo.popupNone.format([tag]));}
if(this.getAttribute('showOpenTag')){
createTiddlyElement(createTiddlyElement(pop,"li"),"hr");
var h=createTiddlyLink(createTiddlyElement(pop,"li"),tag,false);
createTiddlyText(h,lingo.openTag.format([tag]));
}
}
Popup.show(pop,false);
e.cancelBubble=true;
if(e.stopPropagation)e.stopPropagation();
return(false);
}
//}}}
!Notes
These sections define the categories used by [[x-tagger]] and the MainMenu. If a lower item is directly tagging to an upper item it will be ignored by the MainMenu, e.g. [[$active]]. Tags under the section ''More'' will be shown in the corresponding section in tagger. For more configuration options, look at the beginning of [[x-taggers sourcecode|x-tagger]].
!Tags
[[action]]
[[priority]]
[[context]]
[[project]]
[[stage]]
[[$active]]
[[area]]
[[realm]]
[[contact]]
!More
[[help]]
[[journal]]
[[reference]]
[[systemConfig]]
[[systemConfigDisable]]
[[excludeLists]]
[[excludeMissing]]
[[excludeSearch]]
[[noCloud]]
//{{{
//shortcuts
var c=config;
var co=c.options;
var cc=c.commands;
var cm=c.macros;
var cv=c.views;
//adopted from mptwConfig
readOnly=false;
showBackstage=true;
cv.editor.tagChooser.text='tags...';
co.txtTheme='tbGtdTheme';
//no msg when no tiddler
cv.wikified.defaultText="";
//no text for a new tiddler
cv.editor.defaultText="";
//tab as tab when editing
co.chkInsertTabs=true;
//visitors can edit
co.chkHttpReadOnly=false;
co.chkSaveBackups=true;
//backups in this folder
co.txtBackupFolder='twbackup';
//autosave when local
co.chkAutoSave=(window.location.protocol=="file:");
co.chkHideTabsBarWhenSingleTab =true;
co.chkTOCIncludeHidden=true;
co.chkDisplayWeekNumbers=true;
co.txtPrettyDates='pppp';
co.chkAnimate=false;
co.chkSinglePagePermalink=true;
co.txtLastShared='tbGTD:::http://tbGTD.tiddlyspot.com';
merge(cm.toolbar,{moreLabel:'+',lessLabel:'-'});
merge(c.messages.backstage,{open:{text:''},close:{text:''}});
//see ViewTemplate
c.mptwDateFormat='YYYY-0MM-0DD';c.mptwJournalFormat='YYYY-0MM-0DD';
//language settings
c.glyphs.codes.star=["\u22C6","\u22C6"];
cc.syncing.text="sync";
cc.references.text="ref";
cc.permalink.text="url";
var show="Show an URL in the brower address bar that ";
cc.permalink.tooltip=show+"links to the currently displayed tiddler";
cm.permaview.prompt=show+"retrieves all the currently displayed tiddlers";
cm.permaview.label="permalink";
cm.list.missing.prompt="referenced without tiddler:\n";
cm.list.orphans.prompt="tiddlers without reference:\n";
cm.list.shadowed.prompt="default shadow tiddlers:\n";
cm.option.passwordCheckboxLabel="save on this computer";
//refresh command -> for toolbar (force=true)
cc.refreshTiddler={
text:'refresh',tooltip:'Refresh this tiddler',
handler:function(e,src,title){clearMessage();story.refreshTiddler(title,false,true);return false;}
}
//rename buttons
cm.rB={handler:function(place,macroName,params,wikifier,paramString,tiddler){
if(place.lastChild.tagName!="BR"){
var p1=params.shift().split("#");
var name=p1[0];
var id=p1[1];
var title=params[0];
el=place.lastChild;
if(el.tagName.toUpperCase()!="A")el=el.firstChild;
el.firstChild.data=name;
if(id)el.setAttribute('id',id);
if(title)el.title=title;
}
}}
//shortened splashscreen code
var tbRestart=window.restart;
window.restart = function(){
var splash=document.getElementById('SplashScreen');
if (splash) splash.style.display = "none";
document.getElementById('contentWrapper').style.display = "block";
tbRestart();
}
//fix ie styles
if(jQuery.browser.msie){setStylesheet('#topMenuR{top:4.55em !important;}','ieStyles');}
//DummyTiddlerHack
config.macros.dummy={handler:function(place,macroName,params,wikifier,paramString,tiddler){var t=params.shift();if(t)place.setAttribute('tiddler',t);}}
//}}}
Project kick-off notes link here...
Project definitions...
*goals and (measurable !) success criteria
*the system and it's environment boundaries and interfaces
Estimates regarding project requirements for...
*people
*time
*ressources
*finances
*opportunities, threats, strengths and weaknesses (swot)
Efforts to meet prerequisites, to aquire necessary data and information to get started...
The collection of design, development and improvement efforts which pave your path to success...
|borderless widetable|k
|''Validate'' design, data, processes, components and properties as to whether or not they meet requirements.| @@color:#39C;margin-left:10px;display:block;text-align:center;background:#eee;border-bottom:1px solid #39C;padding:3px;''Do the __right__ thing!''@@|
|''Verify'' efforts numerically and logically as to whether or not they actually do what they're designed for.| @@color:#39C;margin-left:10px;display:block;text-align:center;background:#eee;padding:3px;''Do the thing __right__!''@@|
Efforts made to check whether ideas for the desired system, improved or new, are are in fact working...
Experiment, calculate or simulate different, envisioned alternatives and scenarios...
*results and statistics...
*#gather
*#evaluate
*#compare
Analyse alternatives and __decide__ as to which ones are best suitable to meet projects goals...
The project roll-out and implementation depending on the carefully chosen path...
Assessment of how implementation meets the verified and validated model and, above all, project goals and requirements...