<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0em 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0em 1em;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox where print preview displays the noscript content */
noscript {display:none;}
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)

<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations

Also see AdvancedOptions

TiddlyWiki.prototype.getCascadingTaggedTiddlers = function(lookupValue,lookupMatch,sortField)
	var candidates =[];
	store.forEachTiddler(function(title,tiddler) {if (tiddler.isTagged(lookupValue)) candidates.push(title)})
	var results = [];
	this.forEachTiddler(function(title,tiddler) {
		var f = !lookupMatch;
		for(var lookup=0; lookup<tiddler.tags.length; lookup++) {
			if((tiddler.tags[lookup]== lookupValue)|| (candidates.indexOf(tiddler.tags[lookup])>=0))
				f = lookupMatch;
		sortField = "title";
	results.sort(function(a,b) {return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);});
	return results;

config.macros.timeline.handler = function(place,macroName,params)
	var field = params[0] ? params[0] : "modified";
	var tiddlers = store.getCascadingTaggedTiddlers("excludeLists",false,field);
	var lastDay = "";
	var last = params[1] ? tiddlers.length-Math.min(tiddlers.length,parseInt(params[1])) : 0;
	var dateFormat = params[2] ? params[2] : this.dateFormat;
	for(var t=tiddlers.length-1; t>=last; t--) {
		var tiddler = tiddlers[t];
		var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
		if(theDay != lastDay) {
			var ul = document.createElement("ul");
			lastDay = theDay;

config.macros.list.all.handler = function(params)
	return store.getCascadingTaggedTiddlers("excludeLists",false,"title");

Background: #fff
Foreground: #000
PrimaryPale: #fc8
PrimaryLight: #f81
PrimaryMid: #b40
PrimaryDark: #410
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
*<<newJournal "DD MMM YYYY" "journal">>
*<<popup options [[<<tiddler OptionsPanel$))]]>>
|HTMLFormattingPlugin|Embed wiki syntax formatting inside of HTML content|[[http://www.TiddlyTools.com|http://www.TiddlyTools.com/#HTMLFormattingPlugin]]|
|GotoPlugin|View any tiddler by entering it's title - displays list of possible matches|[[http://www.tiddlytools.com|http://www.tiddlytools.com/#GotoPlugin]]|
|LessBackupsPlugin|Intelligently limit the number of backup files you create|http://lessbackupsplugin.tiddlyspot.com/|
|TaggerPlugin|Provides a drop down listing current tiddler tags, and allowing toggling of tags|[[http://tw.lewcid.org|http://tw.lewcid.org//#TaggerPlugin]]|
|PopupMacro|Create popups with custom content|http://tw.lewcid.org/#PopupMacro|
|''Description:''|Support for cryptographic functions|
if(!version.extensions.CryptoFunctionsPlugin) {
version.extensions.CryptoFunctionsPlugin = {installed:true};

//-- Crypto functions and associated conversion routines

// Crypto "namespace"
function Crypto() {}

// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
	var be = Array();
	var len = Math.floor(str.length/4);
	var i, j;
	for(i=0, j=0; i<len; i++, j+=4) {
		be[i] = ((str.charCodeAt(j)&0xff) << 24)|((str.charCodeAt(j+1)&0xff) << 16)|((str.charCodeAt(j+2)&0xff) << 8)|(str.charCodeAt(j+3)&0xff);
	while (j<str.length) {
		be[j>>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
	return be;

// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
	var str = "";
	for(var i=0;i<be.length*32;i+=8)
		str += String.fromCharCode((be[i>>5]>>>(24-i%32)) & 0xff);
	return str;

// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
	var hex = "0123456789ABCDEF";
	var str = "";
	for(var i=0;i<be.length*4;i++)
		str += hex.charAt((be[i>>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
	return str;

// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
	return Crypto.be32sToHex(Crypto.sha1Str(str));

// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
	return Crypto.sha1(Crypto.strToBe32s(str),str.length);

// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
	// Add 32-bit integers, wrapping at 32 bits
	add32 = function(a,b)
		var lsw = (a&0xFFFF)+(b&0xFFFF);
		var msw = (a>>16)+(b>>16)+(lsw>>16);
		return (msw<<16)|(lsw&0xFFFF);
	// Add five 32-bit integers, wrapping at 32 bits
	add32x5 = function(a,b,c,d,e)
		var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
		var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
		return (msw<<16)|(lsw&0xFFFF);
	// Bitwise rotate left a 32-bit integer by 1 bit
	rol32 = function(n)
		return (n>>>31)|(n<<1);

	var len = blen*8;
	// Append padding so length in bits is 448 mod 512
	x[len>>5] |= 0x80 << (24-len%32);
	// Append length
	x[((len+64>>9)<<4)+15] = len;
	var w = Array(80);

	var k1 = 0x5A827999;
	var k2 = 0x6ED9EBA1;
	var k3 = 0x8F1BBCDC;
	var k4 = 0xCA62C1D6;

	var h0 = 0x67452301;
	var h1 = 0xEFCDAB89;
	var h2 = 0x98BADCFE;
	var h3 = 0x10325476;
	var h4 = 0xC3D2E1F0;

	for(var i=0;i<x.length;i+=16) {
		var j,t;
		var a = h0;
		var b = h1;
		var c = h2;
		var d = h3;
		var e = h4;
		for(j = 0;j<16;j++) {
			w[j] = x[i+j];
			t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		for(j=16;j<20;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		for(j=20;j<40;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		for(j=40;j<60;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
		for(j=60;j<80;j++) {
			w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
			t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;

		h0 = add32(h0,a);
		h1 = add32(h1,b);
		h2 = add32(h2,c);
		h3 = add32(h3,d);
		h4 = add32(h4,e);
	return Array(h0,h1,h2,h3,h4);

<<option chkNoHeader>> hide header
merge(config.messages.messageClose,{text: "X",tooltip: "close this message area"});
if (config.options.chkNoHeader) setStylesheet(".headerForeground,.headerShadow,#mainToolbar{display:none}","noHeader");
config.options.txtExternalizeProccessing = "ExternalizeAsHTML";

|''Description:''|Support for deprecated functions removed from core|
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};

//-- Deprecated code

// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)

// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = function(w)
	var lookaheadRegExp = new RegExp(this.lookahead,"mg");
	lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = lookaheadRegExp.exec(w.source);
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var text = lookaheadMatch[1];
			text = text.replace(/\n/g,"\r");
		w.nextMatch = lookaheadRegExp.lastIndex;

// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)

// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
	var i = this.indexOf(item);
	return i == -1 ? null : i;

// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
	return store.getLoader().internalizeTiddler(store,this,title,divRef);

// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
	return store.getSaver().externalizeTiddler(store,this);

// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
	return store.allTiddlersAsHtml();

// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)

// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)

// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)

// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;

// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");


body {color:#444; font-size:0.75em;line-height:1.4em;font-family:arial,helvetica;margin : 0.5em; padding : 0;}
html {border:0}
a, a:link, a:visited, a:active {text-decoration:none;color:#BB4400;font-weight:bold}
ul, ol {margin-left:0.5em;padding-left:1.5em;}
|''Description:''|Lite and extensible Wysiwyg editor for TiddlyWiki.|
|''Date:''|Dec 21,2007|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0|
*On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[WysiwygDemo]] and use the {{{write}}} button.
#import the plugin,
#save and reload,
#use the <<toolbar easyEdit>> button in the tiddler's toolbar (in default ViewTemplate) or add {{{easyEdit}}} command in your own toolbar.
! Useful Addons
*[[HTMLFormattingPlugin|http://www.tiddlytools.com/#HTMLFormattingPlugin]] to embed wiki syntax in html tiddlers.<<br>>//__Tips__ : When this plugin is installed, you can use anchor syntax to link tiddlers in wysiwyg mode (example : #example). Anchors are converted back and from wiki syntax when editing.//
*[[TaggedTemplateTweak|http://www.TiddlyTools.com/#TaggedTemplateTweak]] to use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values.
|Buttons in the toolbar (empty = all).<<br>>//Example : bold,underline,separator,forecolor//<<br>>The buttons will appear in this order.| <<option txtEasyEditorButtons>>|
|EasyEditor default height | <<option txtEasyEditorHeight>>|
|Stylesheet applied to the edited richtext |[[EasyEditDocStyleSheet]]|
|Template called by the {{{write}}} button |[[EasyEditTemplate]]|
!How to extend EasyEditor
*To add your own buttons, add some code like the following in a systemConfig tagged tiddler (//use the prompt attribute only if there is a parameter//) :
**{{{EditorToolbar.buttons.heading = {label:"H", toolTip : "Set heading level", prompt: "Enter heading level"};}}} 
**{{{EditorToolbar.buttonsList +=",heading";}}}
*To get the list of all possible commands, see the documentation of the [[Gecko built-in rich text editor|http://developer.mozilla.org/en/docs/Midas]] or the [[IE command identifiers|http://msdn2.microsoft.com/en-us/library/ms533049.aspx]].
*To go further in customization, see [[Link button|EasyEditPlugin-LinkButton]] as an example.


var geckoEditor={};
var IEeditor={};

config.options.txtEasyEditorHeight = config.options.txtEasyEditorHeight ? config.options.txtEasyEditorHeight : "500px";
config.options.txtEasyEditorButtons = config.options.txtEasyEditorButtons ? config.options.txtEasyEditorButtons : "";

// TW2.1.x compatibility
config.browser.isGecko = config.browser.isGecko ? config.browser.isGecko : (config.userAgent.indexOf("gecko") != -1); 
config.macros.annotations = config.macros.annotations ? config.macros.annotations : {handler : function() {}}


config.macros.easyEdit = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var height = params[1] ? params[1] : config.options.txtEasyEditorHeight;
		var editor = field ? new easyEditor(tiddler,field,place,height) : null;
	gather: function(element){
		var iframes = element.getElementsByTagName("iframe");
		if (iframes.length!=1) return null
		var text = "<html>"+iframes[0].contentWindow.document.body.innerHTML+"</html>";
		text = config.browser.isGecko ? geckoEditor.postProcessor(text) : (config.browser.isIE ? IEeditor.postProcessor(text) : text);
		return text;


function easyEditor(tiddler,field,place,height) {
	this.tiddler = tiddler;
	this.field = field;
	this.browser = config.browser.isGecko ? geckoEditor : (config.browser.isIE ? IEeditor : null);
	this.wrapper = createTiddlyElement(place,"div",null,"easyEditor");
	this.iframe = createTiddlyElement(null,"iframe");

easyEditor.prototype.onload = function(){
	this.editor = this.iframe.contentWindow;
	this.doc = this.editor.document;
	if (!this.browser.isDocReady(this.doc)) return null;
	if (!this.tiddler.isReadOnly() && this.doc.designMode.toLowerCase()!="on") {
		this.doc.designMode = "on";
		if (this.browser.reloadOnDesignMode) return false;	// IE fire readystatechange after designMode change
	var internalCSS = store.getTiddlerText("EasyEditDocStyleSheet");

	var barElement=createTiddlyElement(null,"div",null,"easyEditorToolBar");
	this.toolbar = new EditorToolbar(this.doc,barElement,this.editor);


easyEditor.SimplePreProcessoror = function(text) {
	var re = /^<html>(.*)<\/html>$/m;
	var htmlValue = re.exec(text);
	var value = (htmlValue && (htmlValue.length>0)) ? htmlValue[1] : text;
	return value;

easyEditor.prototype.scheduleButtonsRefresh=function() { //doesn't refresh buttons state when rough typing
	if (this.nextUpdate) window.clearTimeout(this.nextUpdate);
	this.nextUpdate = window.setTimeout(contextualCallback(this.toolbar,EditorToolbar.onUpdateButton),easyEditor.buttonDelay);

easyEditor.buttonDelay = 200;


function EditorToolbar(target,parent,window){
	this.target = target;
	var row = createTiddlyElement(createTiddlyElement(createTiddlyElement(parent,"table"),"tbody"),"tr");
	var buttons = (config.options.txtEasyEditorButtons ? config.options.txtEasyEditorButtons : EditorToolbar.buttonsList).split(",");
	for(var cpt = 0; cpt < buttons.length; cpt++){
		var b = buttons[cpt];
		var button = EditorToolbar.buttons[b];
		if (button) {
			if (button.separator)
			else {
				var cell=createTiddlyElement(row,"td",null,b+"Button");
				if (button.onCreate) button.onCreate.call(this, cell, b);
				else EditorToolbar.createButton.call(this, cell, b);

EditorToolbar.createButton = function(place,name){
	this.elements[name] = createTiddlyButton(place,EditorToolbar.buttons[name].label,EditorToolbar.buttons[name].toolTip,contextualCallback(this,EditorToolbar.onCommand(name)),"button");

EditorToolbar.onCommand = function(name){
	var button = EditorToolbar.buttons[name];
	return function(){
		var parameter = false;
		if (button.prompt) {
			var parameter = this.target.queryCommandValue(name);
			parameter = prompt(button.prompt,parameter);
		if (parameter != null) {
			this.target.execCommand(name, false, parameter);
		return false;

EditorToolbar.getCommandState = function(target,name){
	try {return target.queryCommandState(name)}
	catch(e){return false}

EditorToolbar.onRefreshButton = function (name){
	if (EditorToolbar.getCommandState(this.target,name)) addClass(this.elements[name].parentNode,"buttonON");
	else removeClass(this.elements[name].parentNode,"buttonON");

EditorToolbar.onUpdateButton = function(){
	for (b in this.elements) 
		if (EditorToolbar.buttons[b].onRefresh) EditorToolbar.buttons[b].onRefresh.call(this,b);
		else EditorToolbar.onRefreshButton.call(this,b);

EditorToolbar.buttons = {
	separator : {separator : true},
	bold : {label:"B", toolTip : "Bold"},
	italic : {label:"I", toolTip : "Italic"},
	underline : {label:"U", toolTip : "Underline"},
	strikethrough : {label:"S", toolTip : "Strikethrough"},
	insertunorderedlist : {label:"\u25CF", toolTip : "Unordered list"},
	insertorderedlist : {label:"1.", toolTip : "Ordered list"},
	justifyleft : {label:"[\u2261", toolTip : "Align left"},
	justifyright : {label:"\u2261]", toolTip : "Align right"},
	justifycenter : {label:"\u2261", toolTip : "Align center"},
	justifyfull : {label:"[\u2261]", toolTip : "Justify"},
	removeformat : {label:"\u00F8", toolTip : "Remove format"},
	fontsize : {label:"\u00B1", toolTip : "Set font size", prompt: "Enter font size"},
	forecolor : {label:"C", toolTip : "Set font color", prompt: "Enter font color"},
	fontname : {label:"F", toolTip : "Set font name", prompt: "Enter font name"},
	heading : {label:"H", toolTip : "Set heading level", prompt: "Enter heading level (example : h1, h2, ...)"},
	indent : {label:"\u2192[", toolTip : "Indent paragraph"},
	outdent : {label:"[\u2190", toolTip : "Outdent paragraph"},
	inserthorizontalrule : {label:"\u2014", toolTip : "Insert an horizontal rule"},
	insertimage : {label:"\u263C", toolTip : "Insert image", prompt: "Enter image url"}

EditorToolbar.buttonsList = "bold,italic,underline,strikethrough,separator,increasefontsize,decreasefontsize,fontsize,forecolor,fontname,separator,removeformat,separator,insertparagraph,insertunorderedlist,insertorderedlist,separator,justifyleft,justifyright,justifycenter,justifyfull,indent,outdent,separator,heading,separator,inserthorizontalrule,insertimage";

if (config.browser.isGecko) {
	EditorToolbar.buttons.increasefontsize = {onCreate : EditorToolbar.createButton, label:"A", toolTip : "Increase font size"};
	EditorToolbar.buttons.decreasefontsize = {onCreate : EditorToolbar.createButton, label:"A", toolTip : "Decrease font size"};
	EditorToolbar.buttons.insertparagraph = {label:"P", toolTip : "Format as paragraph"};


geckoEditor.setupFrame = function(iframe,height,callback) {
	iframe.setAttribute("style","width: 100%; height:" + height);

geckoEditor.plugEvents = function(doc,onchange){
	doc.addEventListener("keyup", onchange, true);
	doc.addEventListener("keydown", onchange, true);
	doc.addEventListener("click", onchange, true);

geckoEditor.postProcessor = function(text){return text};

geckoEditor.preProcessor = function(text){return easyEditor.SimplePreProcessoror(text)}

geckoEditor.isDocReady = function() {return true;}


geckoEditor.initContent = function(doc,content){
	if (content) doc.execCommand("insertHTML",false,geckoEditor.preProcessor(content));

IEeditor.setupFrame = function(iframe,height,callback) {
	iframe.width="99%";  //IE displays the iframe at the bottom if 100%. CSS layout problem ? I don't know. To be studied...

IEeditor.plugEvents = function(doc,onchange){
	doc.attachEvent("onkeyup", onchange);
	doc.attachEvent("onkeydown", onchange);
	doc.attachEvent("onclick", onchange);

IEeditor.isDocReady = function(doc){
	if (doc.readyState!="complete") return false;
	if (!doc.body) return false;
	return (doc && doc.getElementsByTagName && doc.getElementsByTagName("head") && doc.getElementsByTagName("head").length>0);

IEeditor.postProcessor = function(text){return text};

IEeditor.preProcessor = function(text){return easyEditor.SimplePreProcessoror(text)}


IEeditor.initContent = function(doc,content){
	if (content) doc.body.innerHTML=IEeditor.preProcessor(content);
function contextualCallback(obj,func){
    return function(){return func.call(obj)}
Story.prototype.previousGatherSaveEasyEdit = Story.prototype.previousGatherSaveEasyEdit ? Story.prototype.previousGatherSaveEasyEdit : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
	if(e && e.getAttribute) {
		var f = e.getAttribute("easyEdit");
			var newVal = config.macros.easyEdit.gather(e);
			if (newVal) fields[f] = newVal;
		this.previousGatherSaveEasyEdit(e, fields);

	text: "write",
	tooltip: "Edit this tiddler in wysiwyg mode",
	readOnlyText: "view",
	readOnlyTooltip: "View the source of this tiddler",
	handler : function(event,src,title) {
		var tiddlerElem = document.getElementById(story.idPrefix + title);
		var fields = tiddlerElem.getAttribute("tiddlyFields");
		return false;

config.shadowTiddlers.ViewTemplate = config.shadowTiddlers.ViewTemplate.replace(/\+editTiddler/,"+editTiddler easyEdit");

config.shadowTiddlers.EasyEditTemplate = config.shadowTiddlers.EditTemplate.replace(/macro='edit text'/,"macro='easyEdit text'");

config.shadowTiddlers.EasyEditToolBarStyleSheet = "/*{{{*/\n";
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar {font-size:0.8em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".editor iframe {border:1px solid #DDD}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar td{border:1px solid #888; padding:2px 1px 2px 1px; vertical-align:middle}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar td.separator{border:0}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .button{border:0;color:#444}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .buttonON{background-color:#EEE}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar {margin:0.25em 0}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .boldButton {font-weight:bold}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .italicButton .button {font-style:italic;padding-right:0.65em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .underlineButton .button {text-decoration:underline}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .strikeButton .button {text-decoration:line-through}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .unorderedListButton {margin-left:0.7em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .justifyleftButton .button {padding-left:0.1em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .justifyrightButton .button {padding-right:0.1em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .justifyfullButton .button, .easyEditorToolBar .indentButton .button, .easyEditorToolBar .outdentButton .button {padding-left:0.1em;padding-right:0.1em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .increasefontsizeButton .button {padding-left:0.15em;padding-right:0.15em; font-size:1.3em; line-height:0.75em}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .decreasefontsizeButton .button {padding-left:0.4em;padding-right:0.4em; font-size:0.8em;}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .forecolorButton .button {color:red;}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet += ".easyEditorToolBar .fontnameButton .button {font-family:serif}\n" ;
config.shadowTiddlers.EasyEditToolBarStyleSheet +="/*}}}*/";

store.addNotification("EasyEditToolBarStyleSheet", refreshStyles); 

config.shadowTiddlers.EasyEditDocStyleSheet = "/*{{{*/\n \n/*}}}*/";
if (config.annotations) config.annotations.EasyEditDocStyleSheet = "This stylesheet is applied when editing a text with the wysiwyg easyEditor";

!Link button add-on
EditorToolbar.createLinkButton = function(place,name) {
	this.elements[name] = createTiddlyButton(place,EditorToolbar.buttons[name].label,EditorToolbar.buttons[name].toolTip,contextualCallback(this,EditorToolbar.onInputLink()),"button");

EditorToolbar.onInputLink = function() {
	return function(){
		var browser = config.browser.isGecko ? geckoEditor : (config.browser.isIE ? IEeditor : null);
		var value = browser ? browser.getLink(this.target) : "";
		value = prompt(EditorToolbar.buttons["createlink"].prompt,value);
		if (value) browser.doLink(this.target,value);
		else if (value=="") this.target.execCommand("unlink", false, value);
		return false;

EditorToolbar.buttonsList += ",separator,createlink";

EditorToolbar.buttons.createlink = {onCreate : EditorToolbar.createLinkButton, label:"L", toolTip : "Set link", prompt: "Enter link url"};

	var range=doc.defaultView.getSelection().getRangeAt(0);
	var container = range.commonAncestorContainer;
	var node = (container.nodeType==3) ? container.parentNode : range.startContainer.childNodes[range.startOffset];
	if (node && node.tagName=="A") {
		var r=doc.createRange();
		return (node.getAttribute("tiddler") ? "#"+node.getAttribute("tiddler") : node.href);
	else return (container.nodeType==3 ? "#"+container.textContent.substr(range.startOffset, range.endOffset-range.startOffset).replace(/ $/,"") : "");

geckoEditor.doLink=function(doc,link){ // store tiddler in a temporary attribute to avoid url encoding of tiddler's name
	var pin = "href"+Math.random().toString().substr(3);
	doc.execCommand("createlink", false, pin);
	var isTiddler=(link.charAt(0)=="#");
	var node = doc.defaultView.getSelection().getRangeAt(0).commonAncestorContainer;
	var links= (node.nodeType!=3) ? node.getElementsByTagName("a") : [node.parentNode];
	for (var cpt=0;cpt<links.length;cpt++) 
			if (links[cpt].href==pin){
				links[cpt].href=isTiddler ? "javascript:;" : link; 
				links[cpt].setAttribute("tiddler",isTiddler ? link.substr(1) : "");

geckoEditor.beforeLinkPostProcessor = geckoEditor.beforelinkPostProcessor ? geckoEditor.beforelinkPostProcessor : geckoEditor.postProcessor;
geckoEditor.postProcessor = function(text){
	return geckoEditor.beforeLinkPostProcessor(text).replace(/<a tiddler="([^"]*)" href="javascript:;">(.*?)(?:<\/a>)/gi,"[[$2|$1]]").replace(/<a tiddler="" href="/gi,'<a href="');

geckoEditor.beforeLinkPreProcessor = geckoEditor.beforeLinkPreProcessor ? geckoEditor.beforeLinkPreProcessor : geckoEditor.preProcessor
geckoEditor.preProcessor = function(text){
	return geckoEditor.beforeLinkPreProcessor(text).replace(/\[\[([^|\]]*)\|([^\]]*)]]/g,'<a tiddler="$2" href="javascript:;">$1</a>');

	var node=doc.selection.createRange().parentElement();
	if (node.tagName=="A") return node.href;
	else return (doc.selection.type=="Text"? "#"+doc.selection.createRange().text.replace(/ $/,"") :"");

	doc.execCommand("createlink", false, link);

IEeditor.beforeLinkPreProcessor = IEeditor.beforeLinkPreProcessor ? IEeditor.beforeLinkPreProcessor : IEeditor.preProcessor
IEeditor.preProcessor = function(text){
	return IEeditor.beforeLinkPreProcessor(text).replace(/\[\[([^|\]]*)\|([^\]]*)]]/g,'<a ref="#$2">$1</a>');

IEeditor.beforeLinkPostProcessor = IEeditor.beforelinkPostProcessor ? IEeditor.beforelinkPostProcessor : IEeditor.postProcessor;
IEeditor.postProcessor = function(text){
	return IEeditor.beforeLinkPostProcessor(text).replace(/<a href="#([^>]*)">([^<]*)<\/a>/gi,"[[$2|$1]]");

IEeditor.beforeLinkInitContent = IEeditor.beforeLinkInitContent ? IEeditor.beforeLinkInitContent : IEeditor.initContent;
IEeditor.initContent = function(doc,content){
	var links=doc.body.getElementsByTagName("A");
	for (var cpt=0; cpt<links.length; cpt++) {
		links[cpt].href=links[cpt].ref; //to avoid IE conversion of relative URLs to absolute

config.shadowTiddlers.EasyEditToolBarStyleSheet += "\n/*{{{*/\n.easyEditorToolBar .createlinkButton .button {color:blue;text-decoration:underline;}\n/*}}}*/";

config.shadowTiddlers.EasyEditDocStyleSheet += "\n/*{{{*/\na {color:#0044BB;font-weight:bold}\n/*}}}*/";

|''Description:''|Adds RC4 encryption and password protection to tiddywiki.|
|''Date:''|Dec 21,2007|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
*Create an ''encrypted vault'' where all tiddlers are ''password protected''. 
*By default, only the system tiddlers aren't encrypted.
*Even shadow tiddlers (MainMenu, SiteTitle, PageTemplate, StyleSheet, ...) ''can be encrypted''. The shadow version is used until unlocking.
Use <<unlock>> button on a protected wiki. By example : http://visualtw.ouvaton.org/demo/EncryptedVaultPlugin.html
#Import the plugin (tagged as systemConfig)
#Save and reload
#Save once more time to create the encrypted vault
#Reload and set a password
*Use <<unlock>><<setPassword>> button (available by default in SideBarOptions)
*Use a blank password to save unencrypted (disable vault usage)
*Use {{{unencrypted}}} tag to avoid encryption for some tiddler
*Use {{{forceEncryption}}} tag to force some shadow tiddler to be encrypted
The following macros are available :
*{{{<<unlock ButtonTitle ButtonTooltip OpenTiddlersWhenUnlock CloseTiddlersWhenUnlock>>}}} creates a button to unlock the encrypted vault (all parameters are optionnal)
*{{{<<setPassword ButtonTitle ButtonTooltip>>}}} if unlocked, creates a button to set the current password (all parameters are optionnal)
*{{{<<purge ButtonTitle ButtonTooltip>>}}} if locked, creates a button to purge a locked vault, useful for lost password (encrypted content is the deleted)
*{{{<<ifLocked tiddlyText>>}}} displays tiddlyText (wikified) if the vault is locked
*{{{<<ifUnlocked tiddlyText>>}}} displays tiddlyText (wikified) if the vault is unlocked
<<ifLocked "!!!!Lost password ?">><<ifLocked "Click on">> <<purge>><<ifLocked "to delete any content locked in the encrypted vault.">>

config.messages.vaultCreationInfo = "The encrypted vault has been created";
config.messages.purgeConfirm = "Purge the encrypted vault ?\n\nAll unlocked content will be lost.";
config.messages.vaultPurgedInfo = "All contents have been purged from encrypted vault.\nPassword has been blanked.\nYou must save once to apply this changes.";
config.messages.vaultEncryptedInfo = "Saving with encryption";
config.messages.vaultUnchangedInfo = "No changes in Encrypted vault";
config.messages.noLockedVaultWarning = "Unable to proceed. No locked encrypted vault.";
config.messages.emptyVaultInfo = "Saving without encryption";
config.messages.saveWithLockedVaultConfirm = "Encrypted vault is locked. No changes will apply inside.\n\nAre you sure ?";
config.messages.confirmOverload = "This following tiddler already exists in system store. Overload ?\nOK : the encrypted version will replace the system store version\nCancel : the system store version will replace the encrypted version";


var startSaveVaultArea = '<div id="' + 'vaultArea">'; // Split up into two so that indexOf() of this source doesn't find it
var endSaveVaultArea = '</d' + 'iv>';

config.shadowTiddlers.SideBarOptions = config.shadowTiddlers.SideBarOptions.replace(/<<saveChanges>>/,"<<unlock>><<setPassword>><<saveChanges>>");
config.shadowTiddlers.GettingStarted+="\n\n<<ifLocked 'This TiddlyWiki use EncryptedVaultPlugin. To load protected content click on'>><<unlock>><<ifUnlocked 'This TiddlyWiki use EncryptedVaultPlugin. To set or change password click on'>><<setPassword>>"

window.updateOriginal= function(original,posDiv)	// overriding the TW2.2 standard function
	var vaultIsUpdatable = (!locateVaultArea(original) || !vault.isLocked() || vault.purge);  // vault is new, unlocked or must be purged
		posDiv = locateStoreArea(original);
	if(!posDiv) {
		return null;
	var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
				convertUnicodeToUTF8((vaultIsUpdatable && vault.password) ? store.allUnencryptedTiddlersAsHtml() : store.allTiddlersAsHtml())  + "\n" +
	if (vaultIsUpdatable) {
		posVault = locateVaultArea(original)
		if(!posVault) {
			posVault = locateVaultArea(revised);
			if(!posVault) {
		var revised = revised.substr(0,posVault[0] + startSaveVaultArea.length) +
					convertUnicodeToUTF8(vault.password ? vault.encrypt(store.allEncryptedTiddlersAsHtml()) : "") +
		if (vault.password) displayMessage(config.messages.vaultEncryptedInfo);
		else displayMessage(config.messages.emptyVaultInfo);
	else displayMessage(config.messages.vaultUnchangedInfo);
	var newSiteTitle = convertUnicodeToUTF8(getPageTitle()).htmlEncode();
	revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
	revised = updateLanguageAttribute(revised);
	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;

function createVault(original) {
	var revised=original.replace(/<!--POST-SHADOWAREA-->/,'<!--POST-SHADOWAREA-->\n<div id="vaultArea"></div>\n<!--POST-VAULTAREA-->');
	var vaultStyles = '<!--PRE-VAULTSTYLE-START-->\n<style type="text/css">\n#vaultArea {display:none;}\n#vaultArea div {padding:0.5em; margin:1em 0em 0em 0em; border-color:#fff #666 #444 #ddd; border-style:solid; border-width:2px; overflow:auto;}\n</style>\n<!--PRE-VAULTSTYLE-END-->\n';
	if (revised.search("<!--PRE-VAULTSTYLE-START-->")<0) var revised=revised.replace(/<!--POST-HEAD-START-->/,vaultStyles +'<!--POST-HEAD-START-->');
	return revised;

function locateVaultArea(original)  //cloned from the TW2.2 standard function
	// Locate the vaultArea div's. Should be just before the storeArea div
	var posOpeningDiv = original.indexOf(startSaveVaultArea);
	var limitClosingDiv = original.indexOf("<"+"!--POST-VAULTAREA--"+">");
	if(limitClosingDiv == -1)
		limitClosingDiv = original.indexOf("<div id="+'"storeArea"'+">");
	var posClosingDiv = original.lastIndexOf(endSaveVaultArea,limitClosingDiv);
	return (posOpeningDiv != -1 && posClosingDiv != -1) ? [posOpeningDiv,posClosingDiv] : null;

TiddlyWiki.prototype.allUnencryptedTiddlersAsHtml = function() {
	return store.getSaver().externalize(store, SaverBase.systemStore);

TiddlyWiki.prototype.allEncryptedTiddlersAsHtml = function() {
	return store.getSaver().externalize(store, SaverBase.vault);

SaverBase.prototype.externalize = function(store, tiddlerType) // overriding the TW2.2 standard function
	var results = [];
	var tiddlers = store.getTiddlers("title");
	for(var t = 0; t < tiddlers.length; t++)
		if (!tiddlerType || (this.getTiddlerType(tiddlers[t]) == tiddlerType))	// this line was changed from standard function
	return results.join("\n");

SaverBase.prototype.getTiddlerType= function(tiddler) {
	if (tiddler.isTagged(SaverBase.vault)) return SaverBase.vault;
	if (store.isShadowTiddler([tiddler.title])) return SaverBase.systemStore;
	if (tiddler.isTagged("systemConfig")||tiddler.isTagged(SaverBase.systemStore)) return SaverBase.systemStore;
	return SaverBase.vault;

LoaderBase.prototype.loadTiddler = function(store,node,tiddlers) // overriding the TW2.2 standard function
	var title = this.getTitle(store,node);
	if (store.getTiddler(title) && !confirm(config.messages.confirmOverload+"\n\n"+title)) // this line was changed from standard function
	if(title) {
		var tiddler = store.createTiddler(title);

window.saveChanges_noVault = window.saveChanges;
window.saveChanges= function(onlyIfDirty,tiddlers){
	if (!vault.isLocked() || vault.purge || !vault.exists() || (vault.isLocked() && confirm(config.messages.saveWithLockedVaultConfirm)))

vault = {
	load : function(){
		if (!vault.isLocked()) {
			return false;
		else {
			var storeElem = document.getElementById("vaultArea");
			if (storeElem) {
				var src = storeElem.innerHTML;
				var pwd = vault.password ? vault.password : "";
				while ((vault.isEncrypted(src)) && (pwd!=null)) {
					if (pwd) src = vault.decrypt(src, pwd);
					if (vault.isEncrypted(src)) pwd = prompt(vault.prompt,pwd);
				if (pwd!=null) vault.password = pwd;
				if (!vault.isEncrypted(src)) {
					var wasDirty = store.isDirty();
					var e = document.createElement("div");
					if (src) store.getLoader().loadTiddlers(store,e.childNodes);
					vault.loaded = true;
					return true;
				else return false;
	decrypt : function(src,pwd){
		var res = Crypto.cryptomx.decrypt(pwd,src.substr(vault.prefix.length));
		return res  ? res : src;
	isEncrypted : function(src) {
		return (src.substr(0,vault.prefix.length) == vault.prefix);
	encrypt : function(src){
		return vault.password ? vault.prefix + Crypto.cryptomx.encrypt(vault.password,src) : src;
	isLocked : function(){
		if (vault.loaded) return false;
		var storeElem = document.getElementById("vaultArea");
		return (!storeElem || (storeElem && vault.isEncrypted(storeElem.innerHTML)));
	exists : function() {
		return (document.getElementById("vaultArea")!=null);
	prefix : "Cryptomx@",
	prompt : "Enter a password",
	loaded : false,
	purge : false

config.macros.unlock = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var label = params[0] ? params[0] : "unlock vault";
		var tooltip = params[1] ? params[1] : "unlock encrypted vault";
		var openTiddlers = params[2] ? params[2] : "";
		var closeTiddlers = params[3] ? params[3] : "";
		if (vault.isLocked() && vault.exists()) {
			var btn = createTiddlyButton(place,label, tooltip,this.onClick);
		var openTiddlers = this.getAttribute("openTiddlers");
		var closeTiddlers = this.getAttribute("closeTiddlers");
		if (vault.load()) {
			if (closeTiddlers) {
				var tiddlers = store.filterTiddlers(closeTiddlers);
				for(var t=0; t<tiddlers.length; t++) {
					var elem = document.getElementById(story.idPrefix + tiddlers[t].title);
					if (elem && elem.getAttribute("dirty")!="true")
			if (openTiddlers) {
				var tiddlers = store.filterTiddlers(openTiddlers);
				for(var t=0; t<tiddlers.length; t++)
		return false;

config.macros.setPassword = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var label = params[0] ? params[0] : "set password";
		var tooltip = params[1] ? params[1] : "Set password for encrypted vault";
		if (!vault.isLocked()) createTiddlyButton(place, label, tooltip,this.onClick);
		var pwd = prompt(vault.prompt,(vault.password ? vault.password : ""));
		if (pwd != null) vault.password = pwd;
		return false;

config.macros.purge = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var label = params[0] ? params[0] : "purge vault";
		var tooltip = params[1] ? params[1] : "Delete locked vault";
		if (vault.isLocked() && vault.exists()) createTiddlyButton(place,label, tooltip,this.onClick);
		if (!vault.isLocked())
			if (confirm(config.messages.purgeConfirm)) {
		return false;

config.macros.ifLocked = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if (vault.isLocked() && vault.exists()) wikify(params[0],place,null,tiddler);

config.macros.ifUnlocked = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if (!vault.isLocked()) wikify(params[0],place,null,tiddler);


Cryptomx code from http://cryptomx.sourceforge.net
Crypto.cryptomx = {
	dg :'',
	makeArray: function(n) {
		for (var i=1; i<=n; i++) {
		return this
	rc4: function(key, text) {
		var i, x, y, t, x2;
		for (i=0; i<256; i++) {
		for (x=0; x<256; x++) {
			y=(key.charCodeAt(x % key.length) + s[x] + y) % 256
			t=s[x]; s[x]=s[y]; s[y]=t
		x=0;  y=0;
		var z=""
		for (x=0; x<text.length; x++) {
			x2=x % 256
			y=( s[x2] + y) % 256
			t=s[x2]; s[x2]=s[y]; s[y]=t
			z+= String.fromCharCode((text.charCodeAt(x) ^ s[(s[x2] + s[y]) % 256]))
		return z
	badd: function(a,b) { // binary add
		var r=''
		var c=0
		while(a || b) {
			a=a.slice(0,-1); b=b.slice(0,-1)
			if(c & 1) {
			} else {
		if(c) {r="1"+r}
		return r
	chop:function(a) {
		if(a.length) {
			return parseInt(a.charAt(a.length-1))
		} else {
			return 0
	bsub:function(a,b) { // binary subtract
		var r=''
		var c=0
		while(a) {
			a=a.slice(0,-1); b=b.slice(0,-1)
			if(c==0) {
			if(c == 1) {
			if(c == -1) {
			if(c==-2) {
		if(b || c) {return ''}
		return this.bnorm(r)
	bnorm:function(r) { // trim off leading 0s
		var i=r.indexOf('1')
		if(i == -1) {
			return '0'
		} else {
			return r.substr(i)
	bmul:function(a,b) { // binary multiply
		var r=''; var p=''
		while(a) {
			if(this.chop(a) == '1') {
		return r;
	bmod:function(a,m) { // binary modulo
		return this.bdiv(a,m).mod
	bdiv:function(a,m) { // binary divide & modulo
		// this.q = quotient this.mod=remainder
		var lm=m.length, al=a.length
		var p='',d
		for(n=0; n<al; n++) {
			if(p.length<lm || (d=this.bsub(p,m)) == '') {
			} else {
				if(this.q.charAt(0)=='0') {
				} else {
		return this
	bmodexp:function(x,y,m) { // binary modular exponentiation
		var r='1'
		this.status("bmodexp "+x+" "+y+" "+m)
		while(y) {
			if(this.chop(y) == 1) {
		return this.bnorm(r)
	modexp:function(x,y,m) { // modular exponentiation
		// convert packed bits (text) into strings of 0s and 1s
		return this.b2t(this.bmodexp(this.t2b(x),this.t2b(y),this.t2b(m)))
	i2b: function(i) { // convert integer to binary
		var r=''
		while(i) {
			if(i & 1) { r="1"+r} else {r="0"+r}
		return r? r:'0'
	t2b:function(s) {
		var r=''
		if(s=='') {return '0'}
		while(s.length) {
			var i=s.charCodeAt(0)
			for(n=0; n<8; n++) {
				r=((i & 1)? '1':'0') + r
		return this.bnorm(r)
	b2t:function(b) {
		var r=''; var v=0; var m=1
		while(b.length) {
			if(m==256 || b=='') {
				v=0; m=1
		return r
	textToBase64:function(t) {
		this.status("t 2 b64")
		var r=''; var m=0; var a=0; var tl=t.length-1; var c
		for(n=0; n<=tl; n++) {
			r+=this.b64s.charAt((c << m | a) & 63)
			a = c >> (6-m)
			if(m==6 || n==tl) {
				if((n%45)==44) {r+="\n"}
		return r
	base64ToText:function(t) {
		this.status("b64 2 t")
		var r=''; var m=0; var a=0; var c
		for(n=0; n<t.length; n++) {
			if(c >= 0) {
				if(m) {
					r+=String.fromCharCode((c << (8-m))&255 | a)
				a = c >> m
				if(m==8) { m=0 }
		return r

	rand:function(n) {  return Math.floor(Math.random() * n) },
	rstring:function(s,l) {
		var r=""
		var sl=s.length
		while(l>0) {
		//status("rstring "+r)
		return r
	key2:function(k) {
		var l=k.length
		var kl=l
		var r=''
		while(l--) {
		return r
	rsaEncrypt:function(keylen,key,mod,text) {
		// I read that rc4 with keys larger than 256 bytes doesn't significantly
		// increase the level of rc4 encryption because it's sbuffer is 256 bytes
		// makes sense to me, but what do i know...

		if(text.length >= keylen) {
			var sessionkey=this.rc4(rstring(text,keylen),rstring(text,keylen))

			// session key must be less than mod, so mod it

			// return the rsa encoded key and the encrypted text
			// i'm double encrypting because it would seem to me to
			// lessen known-plaintext attacks, but what do i know
			return this.modexp(sessionkey,key,mod) +
		} else {

			// don't need a session key
			return this.modexp(text,key,mod)
	rsaDecrypt:function(keylen,key,mod,text) {
		if(text.length <= keylen) {
			return this.modexp(text,key,mod)
		} else {

			// sessionkey is first keylen bytes
			var sessionkey=text.substr(0,keylen)

			// un-rsa the session key

			// double decrypt the text
			return this.rc4(sessionkey,this.rc4(this.key2(sessionkey,text),text))
	trim2:function(d) { return d.substr(0,d.lastIndexOf('1')+1) },
	bgcd:function(u,v) { // return greatest common divisor
		// algorythm from http://algo.inria.fr/banderier/Seminar/Vallee/index.html
		var d, t
		while(1) {
			//alert(v+" - "+u+" = "+d)
			if(d=='0') {return u}
			if(d) {
				if(d.substr(-1)=='0') {
					v=d.substr(0,d.lastIndexOf('1')+1) // v=(v-u)/2^val2(v-u)
				} else v=d
			} else {
				t=v; v=u; u=t // swap u and v

	isPrime:function(p) {
		var n,p1,p12,t
		for(n=0; n<2; n+=this.mrtest(p,p1,p12,t)) {
			if(n<0) return 0
		return 1
	mrtest:function(p,p1,p12,t) {
		// Miller-Rabin test from forum.swathmore.edu/dr.math/
		var n,a,u
		a='1'+this.rstring('01',Math.floor(p.length/2)) // random a
		//alert("mrtest "+p+", "+p1+", "+a+"-"+p12)
		if(u=='1') {return 1}
		for(n=0;n<t;n++) {
			//dg+=u+" "
			if(u=='1') return -100
			if(u==p1) return 1
		return -100
	// this number is 3*5*7*11*13*17*19*23*29*31*37
	prime:function(bits) {
		// return a prime number of bits length
		var p='1'+this.rstring('001',bits-2)+'1'
		while( ! this.isPrime(p)) {
			p=badd(p,'10'); // add 2
		alert("p is "+p)
		return p
	genkey:function(bits) {
		do {
		} while(bgcd(p,q)!='1')
		// now we need a d, e,  and an n so that:
		//  p1q1*n-1=de  -> bmod(bsub(bmul(d,e),'1'),p1q1)='0'
		// or more specifically an n so that d & p1q1 are rel prime and factor e
		alert('n is '+n)
		alert('factor is '+factorMe)
		// is this always 1?
		//alert('r='+r.q+" "+r.mod)
		//if(r.mod != '0') {alert('Mod Error!')}
		if(d == '1' && e == '1') {alert('Factoring failed '+factorMe+' p='+p+' q='+q)}
		if(r.mod != '0') {alert('Mod Error 2!')}

	status:function(a) { },//alert(a)}
	encrypt:function(key,text) {
		return this.textToBase64(this.rc4(key,"check:"+text));
		var uncrypt = this.rc4(key,this.base64ToText(text));
		return (uncrypt.substr(0,6)=="check:") ? uncrypt.substr(6) : null;

[[EncryptedVaultPlugin]] demo is available [[here|http://visualtw.ouvaton.org/demo/EncryptedVaultPlugin.html]].
|''Description:''|Edit tiddlers directly with your favorite external editor (html editor, text processor, javascript IDE, css editor, ...).|
|''Date:''|Dec 21,2007|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0|
#install [[it's All Text!|https://addons.mozilla.org/fr/firefox/addon/4125]] Firefox extension.
#set up [[it's All Text!|https://addons.mozilla.org/fr/firefox/addon/4125]] options in its dialog box (see tips below).
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig).
#save and reload.
#set up hotkey below.
#use the <<toolbar externalize>> button in the tiddler's toolbar (in default ViewTemplate) or add {{{externalize}}} command in your own toolbar.
! Useful Addons
*[[HTMLFormattingPlugin|http://www.tiddlytools.com/#HTMLFormattingPlugin]] to embed wiki syntax in html tiddlers.<<br>>//__Tips__ : When this plugin is installed, you can use anchor syntax to link tiddlers in wysiwyg mode (example : #example). Anchors are converted back and from wiki syntax when editing.//
*[[TaggedTemplateTweak|http://www.TiddlyTools.com/#TaggedTemplateTweak]] to use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values.
!Configuration options 
|[[it's All Text!|https://addons.mozilla.org/fr/firefox/addon/4125]]  extension hotkey (copy/paste from the extension dialog box)|<<option txtExternalizeHotkey>>|
|Optional tiddler containing instructions to process the text before and after externalization<<br>>Example : [[ExternalizeAsHTML]]|<<option txtExternalizeProccessing>>|
|Template called by the {{{externalize}}} button|[[ExternalizeTemplate]]|
|Max waiting time for //It's All text!// to fire|<<option txtExternalizeMaxTime>>|
!//It's all text!// extension tips
*Tiddler text is edited with the first file extension
*Copy/paste Hot Key from the dialog box (with context menu)
*Edit button isn't necessary for the plugin (it uses hotkey)
*Try the extension configuration first, before trying it with the plugin.
config.options.txtExternalizeHotkey = config.options.txtExternalizeHotkey ? config.options.txtExternalizeHotkey : "";
config.options.txtExternalizeProccessing = config.options.txtExternalizeProccessing ? config.options.txtExternalizeProccessing : "";
config.options.txtExternalizeMaxTime = config.options.txtExternalizeMaxTime ? config.options.txtExternalizeMaxTime : "30";

config.macros.externalize = {
	noExtensionError : "It's all text ! extension wasn't available. Try to fire it manually with htokey or button. If it works, adapt your configuration (increase max waiting time or change hotkey) and try again.",
	hotKeyError : "Hotkey wasn't understood. Use copy/paste from it's all text set up dialog.",
	EmptyHotKeyError : "Hotkey isn't defined. Check ExternalizePlugin configuration.",
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var rows = params[1] || 0;
		var defVal = params[2] || '';
		if((tiddler instanceof Tiddler) && field) {
			var e,v;
			var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix");
			var wrapper2 = createTiddlyElement(wrapper1,"div");
			e = createTiddlyElement(wrapper2,"textarea");
			v = config.macros.externalize.getValue(tiddler,field);
			v = v ? v : defVal;
			e.value = v;
			rows = rows ? rows : 10;
			var lines = v.match(/\n/mg);
			var maxLines = Math.max(parseInt(config.options.txtMaxEditRows),5);
			if(lines != null && lines.length > rows)
				rows = lines.length + 5;
			rows = Math.min(rows,maxLines);
			var id=tiddler.title+"externalize"+field;
			return e;
	externalEdit : function(id){
			var element = document.getElementById(id);
			if (element) {
				var cpt=element.getAttribute("cpt");
				cpt = cpt ? cpt -1 : parseInt(config.options.txtExternalizeMaxTime);
				if (cpt>0) {
					if (element.getAttribute("itsalltext_uid")) {
					else window.setTimeout(arguments.callee,100)
				else alert(config.macros.externalize.noExtensionError);
	getKeyEvent : function(){
		var hotkey = config.options.txtExternalizeHotkey;
		if (hotkey) {
			var m = hotkey.match(/^(alt)?\s*(ctrl)?\s*(meta)?\s*(shift)?\s*(\w+)\s*$/i);
			if (m) {
				var ev = document.createEvent("KeyboardEvent");
				var cc = m[4]!=undefined ? m[5].toUpperCase() : m[5].toLowerCase();
				var charCode = m[5].length==1 ? cc.charCodeAt(0) : 0;
				var keyCode = m[5].length>1 ? config.macros.externalize.keyMap[m[5]] : 0;
				return ev;
			else alert(config.macros.externalize.hotKeyError);
		else alert(config.macros.externalize.EmptyHotKeyError);
	getValue : function(tiddler,field){
		var v = store.getValue(tiddler,field);
		v = v ? config.macros.externalize.textProcessing(v, "Before") : "";
		v = v.replace(/\[\[([^|\]]*)\|([^\]]*)]]/g,'<a href="#$2">$1</a>');
		return v;
	gather : function(e){
		return config.macros.externalize.textProcessing(e.value,"After");
	readParam : function(source,param){
		var re = new RegExp("^"+ param +"\\s*: *(.*)$","mg");
		var r = source && re ? re.exec(source) : null;
		return r!=null ? r[1] : null;
	textProcessing : function(text,key) {
		var params = config.options.txtExternalizeProccessing;
		var rexp = "^\\["+key+"\\] *(.*)\n(.*)\\n(.*)$";
		if (params) {
			var source = store.getTiddler(params);
			source = source ? source.text : config.shadowTiddlers[params];
			if (source) {
				var re=new RegExp(rexp,"mg");
				var instructions = source.match(re);
				for(var cpt=0; cpt<instructions.length; cpt++){
					re=new RegExp(rexp,"mg");
					var res = re.exec(instructions[cpt]);
					text = text.replace(new RegExp(res[2],res[1]),res[3]); 
		return text;	

config.commands.externalize= {
	text: "externalize",
	tooltip: "Edit this tiddler with an external editor",
	handler : function(event,src,title) {
		var tiddlerElem = document.getElementById(story.idPrefix + title);
		var fields = tiddlerElem.getAttribute("tiddlyFields");
		return false;

Story.prototype.previousGatherSaveExternalize = Story.prototype.previousGatherSaveExternalize ? Story.prototype.previousGatherSaveExternalize : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
	if(e && e.getAttribute) {
		var f = e.getAttribute("externalize");
			var newVal = config.macros.externalize.gather(e);
			if (newVal) fields[f] = newVal;
		this.previousGatherSaveExternalize(e, fields);

config.macros.externalize.keyMap = {
        'Backspace'   : 8,
        'Tab'   : 9,
        'Enter'	: 13,
        'Break'	: 19,
        'Escape'	: 27,
        'PgUp'	: 33,
        'PgDn'	: 34,
        'End'	: 35,
        'Home'	: 36,
        'Left'	: 37,
        'Up'	: 38,
        'Right'	: 39,
        'Down'	: 40,
        'Insert'	: 45,
        'Delete'	: 46,
        'F1'	: 112,
        'F2'	: 113,
        'F3'	: 114,
        'F4'	: 115,
        'F5'	: 116,
        'F6'	: 117,
        'F7'	: 118,
        'F8'	: 119,
        'F9'	: 120,
        'F10'	: 121,
        'F11'	: 122,
        'Num Lock'	: 144,
        'Scroll Lock'	: 145

config.shadowTiddlers.ExternalizeAsHTML = "/*{{{*/\n";
config.shadowTiddlers.ExternalizeAsHTML += "[Before] g\n\\n\n<br/>\n\n";
config.shadowTiddlers.ExternalizeAsHTML += "[Before] gi\n(?:^<html>(.*)<\/html>$)|(^.*$)\n<html><body>$1$2</body></html>\n\n";
config.shadowTiddlers.ExternalizeAsHTML += "[After] g\n\\n|\\t\n\n\n";
config.shadowTiddlers.ExternalizeAsHTML += "[After] gi\n.*<html[^>]*>.*<body[^>]*>(.*)<\/body><\/html>\n<html>$1</html>\n\n";
config.shadowTiddlers.ExternalizeAsHTML += "/*}}}*/\n";

config.shadowTiddlers.ViewTemplate = config.shadowTiddlers.ViewTemplate.replace(/\+editTiddler/,"+editTiddler externalize");

config.shadowTiddlers.ExternalizeTemplate = config.shadowTiddlers.EditTemplate.replace(/macro='edit text'/,"macro='externalize text'");

config.shadowTiddlers.StyleSheetExternalize = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetExternalize += ".externalized {color: [[ColorPalette::TertiaryMid]]}\n";
config.shadowTiddlers.StyleSheetExternalize +="/*}}}*/";
store.addNotification("StyleSheetExternalize", refreshStyles);

A great opensource Wysiwyg editor. See [[homepage|http://www.fckeditor.net/]]
|''Description:''|Wysiwyg editor for TiddlyWiki using FCKeditor.|
|''Date:''|Dec 21,2007|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see and edit [[WysiwygDemo]].
#download and unzip [[FCKeditor|http://www.fckeditor.net/download]] (by default, in a wiki subfolder, such that the relative path "fckeditor/fckeditor.js" is right).
#import [[FCKeditorPlugin]] (systemConfig tagged)
#add the following text to MarkupPreHead : {{{<script type="text/javascript" src="fckeditor/fckeditor.js"></script>}}}
#customize FCKeditorPath if needed (in MarkupPreHead and in options below)
#save and reload
#use the <<toolbar editHtml>> button in the tiddler's toolbar (in default ViewTemplate) or add {{{editHtml}}} command in your own toolbar.
! Useful Addons
*[[HTMLFormattingPlugin|http://www.tiddlytools.com/#HTMLFormattingPlugin]] to embed wiki syntax in html tiddlers.<<br>>//__Tips__ : When this plugin is installed, you can use anchor syntax to link tiddlers in wysiwyg mode (example : #example). Anchors are converted back and from wiki syntax when editing.//
*[[TaggedTemplateTweak|http://www.TiddlyTools.com/#TaggedTemplateTweak]] to use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values.
!Configuration options :
|FCKeditor folder (absolute or relative)|<<option txtFCKeditorPath>> |
|FCKeditor custom configuration script path (relative or absolute)<<br>>[[Example|fckeditor/editor/custom_config.js]] : {{{ fckeditor/editor/custom_config.js}}}|<<option txtFCKCustomConfigScript>>|
|Toolbar name ("Default", "Basic" or custom)<<br>>See [[FCKeditor documentation|http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Toolbar]] for more information on custom toolbars|<<option txtFCKToolbar>>|
|FCKeditor default height (if blank = 500px)|<<option txtFCKheight>>|
|Template called by the {{{wysiwyg}}} button|EditHtmlTemplate|
config.options.txtFCKeditorPath = config.options.txtFCKeditorPath ? config.options.txtFCKeditorPath : "fckeditor/";
config.options.txtFCKCustomConfigScript = config.options.txtFCKCustomConfigScript ? config.options.txtFCKCustomConfigScript : "";
config.options.txtFCKToolbar = config.options.txtFCKToolbar ? config.options.txtFCKToolbar : "";
config.options.txtFCKheight = config.options.txtFCKheight ? config.options.txtFCKheight : "500px";

config.macros.editHtml = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		var field = params[0];
		var height = params[1] ? params[1] : config.options.txtFCKheight;
		if (typeof FCKeditor=="undefined"){

		else if (field) {
			var e = createTiddlyElement(null,"div");
			var fckName = "FCKeditor"+ Math.random();
			if (height) e.setAttribute("height",height);
			var fck = new FCKeditor(fckName);
			fck.BasePath = config.options.txtFCKeditorPath;
			if (config.options.txtFCKCustomConfigScript) fck.Config["CustomConfigurationsPath"] = config.options.txtFCKCustomConfigScript ;
			if (config.options.txtFCKToolbar) fck.ToolbarSet = config.options.txtFCKToolbar;
			var re = /^<html>(.*)<\/html>$/m;
			var fieldValue=store.getValue(tiddler,field);
			var htmlValue = re.exec(fieldValue);
			var value = (htmlValue && (htmlValue.length>0)) ? htmlValue[1] : fieldValue;
			value=value.replace(/\[\[([^|\]]*)\|([^\]]*)]]/g,'<a href="#$2">$1</a>');
			e.innerHTML = fck.CreateHtml();
        gather : function(e) {
            var name = e.getAttribute("fckName");
            var oEditor = window.FCKeditorAPI ? FCKeditorAPI.GetInstance(name) : null;
            if (oEditor) {
                        var html = oEditor.GetHTML();
			if (html!=null) 
                                    return "<html>"+html.replace(/<a href="#([^>]*)">([^<]*)<\/a>/gi,"[[$2|$1]]")+"</html>"; 
	FCKvalues : {},
	FCKeditorUnavailable : "FCKeditor was unavailable. Check plugin configuration and reload."

window.FCKeditor_OnComplete= function( editorInstance ) {
        var name=editorInstance.Name;
	var value = config.macros.editHtml.FCKvalues[name];
	delete config.macros.editHtml.FCKvalues[name];
	oEditor = FCKeditorAPI.GetInstance(name);
	if (value) oEditor.SetHTML(value);

Story.prototype.previousGatherSaveEditHtml = Story.prototype.previousGatherSaveEditHtml ? Story.prototype.previousGatherSaveEditHtml : Story.prototype.gatherSaveFields; // to avoid looping if this line is called several times
Story.prototype.gatherSaveFields = function(e,fields){
	if(e && e.getAttribute) {
		var f = e.getAttribute("editHtml");
			var newVal = config.macros.editHtml.gather(e);
			if (newVal) fields[f] = newVal;
		this.previousGatherSaveEditHtml(e, fields);

config.shadowTiddlers.EditHtmlTemplate = config.shadowTiddlers.EditTemplate.replace(/macro='edit text'/,"macro='editHtml text'");

	text: "wysiwyg",
	tooltip: "Edit this tiddler with a rich text editor",
	readOnlyText: "",
	handler : function(event,src,title) {
		var tiddlerElem = document.getElementById(story.idPrefix + title);
		var fields = tiddlerElem.getAttribute("tiddlyFields");
		return false;

config.shadowTiddlers.ViewTemplate = config.shadowTiddlers.ViewTemplate.replace(/\+editTiddler/,"+editTiddler editHtml");

Renamed FieldsEditorPlugin
|''Description:''|//create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>.|
|''Date:''|Dec 21,2007|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], see [[FieldEditor example]]
*import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
*save and reload
*optionnaly : add the following css text in your StyleSheet : {{{#popup tr.fieldTableRow td {padding:1px 3px 1px 3px;}}}}


config.commands.fields.handlePopup = function(popup,title) {
	var tiddler = store.fetchTiddler(title);
	var fields = {};
	store.forEachField(tiddler,function(tiddler,fieldName,value) {fields[fieldName] = value;},true);
	var items = [];
	for(var t in fields) {
		var editCommand = "<<untiddledCall editFieldDialog "+escape(title)+" "+escape(t)+">>";
		var deleteCommand = "<<untiddledCall deleteField "+escape(title)+" "+escape(t)+">>";
		var renameCommand = "<<untiddledCall renameField "+escape(title)+" "+escape(t)+">>";
		items.push({field: t,value: fields[t], actions: editCommand+renameCommand+deleteCommand});
	items.sort(function(a,b) {return a.field < b.field ? -1 : (a.field == b.field ? 0 : +1);});
	var createNewCommand = "<<untiddledCall createField "+escape(title)+">>";
	items.push({field : "", value : "", actions:createNewCommand });
	if(items.length > 0)

config.commands.fields.listViewTemplate = {
	columns: [
		{name: 'Field', field: 'field', title: "Field", type: 'String'},
		{name: 'Actions', field: 'actions', title: "Actions", type: 'WikiText'},
		{name: 'Value', field: 'value', title: "Value", type: 'WikiText'}
	rowClasses: [
			{className: 'fieldTableRow', field: 'actions'}
	buttons: [	//can't use button for selected then delete, because click on checkbox will hide the popup

config.macros.untiddledCall = {  // when called from listview, tiddler is unset, so we need to pass tiddler as parameter
	handler : function(place,macroName,params,wikifier,paramString) {
		var macroName = params.shift();
		if (macroName) var macro = config.macros[macroName];
		var title = params.shift();
		if (title) var tiddler = store.getTiddler(unescape(title));
		if (macro) macro.handler(place,macroName,params,wikifier,paramString,tiddler);		

config.macros.deleteField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"delete", "delete "+fieldName,this.onClickDeleteField);
			btn.setAttribute("fieldName", fieldName);
	onClickDeleteField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName && confirm("delete field " + fieldName+" from " + title +" tiddler ?")) {
			delete tiddler.fields[fieldName];
		return false;

config.macros.createField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly) {
			var btn = createTiddlyButton(place,"create new", "create a new field",this.onClickCreateField);
	onClickCreateField : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		if (tiddler) {
			var fieldName = prompt("Field name","");
			if (store.getValue(tiddler,fieldName)) {
				window.alert("This field already exists.");
			else if (fieldName) {
				var v = prompt("Field value","");
		return false;

config.macros.editFieldDialog = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"edit", "edit this field",this.onClickEditFieldDialog);
			btn.setAttribute("fieldName", fieldName);
	onClickEditFieldDialog : function() {
		var title=this.getAttribute("title");
		var tiddler = store.getTiddler(title);
		var fieldName=this.getAttribute("fieldName");
		if (tiddler && fieldName) {
			var value = tiddler.fields[fieldName];
			value = value ? value : "";
			var lines = value.match(/\n/mg);
			lines = lines ? true : false;
			if (!lines || confirm("This field contains more than one line. Only the first line will be kept if you edit it here. Proceed ?")) {
				var v = prompt("Field value",value);
		return false;

config.macros.renameField = {
	handler : function(place,macroName,params,wikifier,paramString,tiddler) {
		if(!readOnly && params[0]) {
			fieldName = unescape(params[0]);
			var btn = createTiddlyButton(place,"rename", "rename "+fieldName,this.onClickRenameField);
			btn.setAttribute("fieldName", fieldName);
	onClickRenameField : function() {
		var title=this.getAttribute("title");
		var fieldName=this.getAttribute("fieldName");
		var tiddler = store.getTiddler(title);
		if (tiddler && fieldName) {
			var newName = prompt("Rename " + fieldName + " as ?", fieldName);
			if (newName) {
				delete tiddler.fields[fieldName];
		return false;

config.shadowTiddlers.StyleSheetFieldsEditor = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetFieldsEditor += ".fieldTableRow td {padding : 1px 3px}\n";
config.shadowTiddlers.StyleSheetFieldsEditor += ".fieldTableRow .button {border:0; padding : 0 0.2em}\n";
config.shadowTiddlers.StyleSheetFieldsEditor +="/*}}}*/";
store.addNotification("StyleSheetFieldsEditor", refreshStyles);


!NEW : I don't have anymore time to maintain these plugins, but Simon released some updates [[here|http://github.com/huggyfee/VisualTW2]] 

On [[VisualTW|License]], you will find several plugins for TiddlyWiki
!!Wysiwyg edition
*[[EasyEdit|EasyEditPlugin]], a lite and fully integrated solution.
*[[FCKEditor|FCKeditorPlugin]], a more powerful solution, but requires an external component (FCKeditor).
*[[Externalize|ExternalizePlugin]], to edit tiddlers in your favorite application like html editor, text or word processor, javascript IDE, css editor, ...<<br>>Externalize requires ''Firefox'' and [[it's All Text!|https://addons.mozilla.org/fr/firefox/addon/4125]] ''extension''.
A demo of these different plugins is available [[here|WysiwygDemo]].
!!Tabs, fields, encryption, ...
*[[Encrypted vault|EncryptedVaultPlugin]], protects a whole wiki with a single password. All the content is encrypted with RC4 algorithm. Try it on [[demo page|http://visualtw.ouvaton.org/demo/EncryptedVaultPlugin.html]].
*[[Fields editor|FieldsEditorPlugin]], adds edit buttons to fields popup. See <<toolbar fields>> in the tiddlers toolbar
*[[Synchronize from source|SyncFromSourcePlugin]], synchronize plugins from their original source (from plugin info) instead of imported url.
*[[TagsTree|TagsTreePlugin]] Displays the tags hierachy as a tree of tagged tiddlers.It can be used to create dynamic outline navigation (like the MainMenu here).
*[[Tiddlers bar|TiddlersBarPlugin]], adds tabs to browse through opened tiddlers (you see it above)
*Some great plugins from the community are used on ~VisualTW. See the [[list|CommunityPlugins]].
*[[Previous versions|PreviousVersions]] of ~VisualTW are still available.
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|Description|view any tiddler by entering it's title - displays list of possible matches|

''View a tiddler by typing its title and pressing //enter//.''  Input just enough to uniquely match a single tiddler title and ''press //enter// to auto-complete the title for you!!''  If multiple titles match your input, a list 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//'' being displayed, press //escape// to clear the current text input and start over.

Note: ''At any time, you can move the focus directly to the text input field by using the ~ALT-G keyboard shortcut.''
| //IMPORTANT NOTE:// ''As of version 1.4.0 (2007.04.25),<br>to avoid conflict with javascript reserved keywords<br>the {{{<<goto>>}}} macro has been renamed to {{{<<gotoTiddler>>}}}'' |
syntax: {{{<<gotoTiddler quiet insert inputstyle liststyle>>}}}
All parameters are optional.
* ''quiet'' prevents //automatic// display of the list as each character is typed.  To view the list when ''quiet'', use //down// or //enter//.
* ''insert'' causes the selected tiddler title to be inserted into the tiddler source currently being edited (use with EditTemplate)
* ''inputstyle'' and ''liststyle'' are CSS declarations that modify the default input and listbox styles.  Note: styles containing spaces must be surrounded by ({{{"..."}}} or {{{'...'}}}) or ({{{[[...]]}}}).
{{{<<gotoTiddler quiet>>}}}
<<gotoTiddler quiet>>
{{{<<goto width:20em width:20em>>}}}
<<gotoTiddler width:20em width:20em>>

You can also invoke the macro with the "insert" keyword.  When used in the [[EditTemplate]], like this:
<span macro="gotoTiddler insert"></span>
it allows you to type/select a tiddler title, and instantly insert a link to that title (e.g. {{{[[TiddlerName]]}}}) into the tiddler source being edited.
You can create a tiddler tagged with <<tag systemConfig>> to control the maximum height of the listbox of tiddlers/shadows/tags. //The default values are shown below://
import (or copy/paste) the following tiddlers into your document:
''GotoPlugin'' (tagged with <<tag systemConfig>>)
''2007.10.31 [1.4.3]'' removed extra trailing comma on last property of config.macros.gotoTiddler object.  This fixes an error under InternetExplorer that was introduced 6 days ago... sure, I should have found it sooner, but... ''WHY DON'T PEOPLE TELL ME WHEN THINGS ARE BROKEN!!!!''
''2007.10.25 [1.4.2]'' added onclick handler for input field, so that clicking in field hides the listbox.
''2007.10.25 [1.4.1]'' re-wrote getItems() to cache list of tiddlers/shadows/tags and use case-folded simple text match instead of regular expression to find matching tiddlers.  This *vastly* reduces processing overhead between keystrokes, especially for documents with many (>1000) tiddlers.  Also, removed local definition of replaceSelection(), now supported directly by the TW2.2+ core, as well as via backward-compatible plugin (see [[CoreTweaksArchive]]).
''2007.04.25 [1.4.0]'' renamed macro from "goto" to "gotoTiddler".  This was necessary to avoid a fatal syntax error in Opera (and other browsers) that require strict adherence to ECMAScript 1.5 standards which defines the identifier "goto" as "reserved for FUTURE USE"... *sigh*
''2007.04.21 [1.3.2]'' in html definition, removed DIV around droplist (see 1.2.6 below).  It created more layout problems then it solved. :-(
''2007.04.01 [1.3.1]'' in processItem(), ensure that correct textarea field is found by checking for edit=="text" attribute
''2007.03.30 [1.3.0]'' tweak SideBarOptions shadow to automatically add {{{<<goto>>}}} when using default sidebar content
''2007.03.30 [1.2.6]'' in html definition, added DIV around droplist to fix IE problem where list appears next to input field instead of below it.  
''2007.03.28 [1.2.5]'' in processItem(), set focus to text area before setting selection (needed for IE to get correct selection 'range')
''2007.03.28 [1.2.4]'' added prompt for 'pretty text' when inserting a link into tiddler content
''2007.03.28 [1.2.3]'' added local copy of core replaceSelection() and modified for different replace logic
''2007.03.27 [1.2.2]'' in processItem(), use story.getTiddlerField() to retrieve textarea control
''2007.03.26 [1.2.1]'' in html, use either 'onkeydown' (IE) or 'onkeypress' (Moz) event to process <esc> key sooner, to prevent <esc> from 'bubbling up' to the tiddler (which will close the current editor).
''2007.03.26 [1.2.0]'' added support for optional "insert" keyword param. When used in [[EditTemplate]], (e.g. {{{<span macro="goto insert"></span>}}}) it triggers alternative processing: instead of displaying the selected tiddler, that tiddler's title is inserted into a tiddler's textarea edit field surrounded by {{{[[...]]}}}.
''2006.05.10 [1.1.2]'' when filling listbox, set selection to 'heading' item... auto-select first tiddler title when down/enter moves focus into listbox
''2006.05.08 [1.1.1]'' added accesskey ("G") to input field html (also set when field gets focus).  Also, inputKeyHandler() skips non-printing/non-editing keys. 
''2006.05.08 [1.1.0]'' added heading to listbox for better feedback (also avoids problems with 1-line droplist)
''2006.05.07 [1.0.0]'' list matches against tiddlers/shadows/tags.  input field auto-completion... 1st enter=complete matching input (or show list)... 2nd enter=view tiddler.  optional "quiet" param controls when listbox appears.
''2006.05.06 [0.5.0]'' added handling for enter (13), escape(27), and down(40) keys.   Change 'ondblclick' to 'onclick' for list handler to view tiddlers (suggested by Florian Cauvin - prevents unintended trigger of tiddler editor).  shadow titles inserted into list instead of appended to the end.
''2006.05.05 [0.0.0]'' started
>This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
version.extensions.gotoTiddler = {major: 1, minor: 4, revision: 3, date: new Date(2007,10,31)};

// automatically tweak shadow SideBarOptions to add <<gotoTiddler>> macro above <<search>>

config.macros.gotoTiddler= { 
	function(place,macroName,params) {
		var quiet=(params[0] && params[0]=="quiet"); if (quiet) params.shift();
		var insert=(params[0] && params[0]=="insert"); if (insert) params.shift();
		var instyle=params.shift(); if (!instyle) instyle="";
		var liststyle=params.shift(); if (!liststyle) liststyle="";
		var keyevent=window.event?"onkeydown":"onkeypress";

	'<form onsubmit="return false" style="display:inline;margin:0;padding:0">\
		<input name=gotoTiddler type=text autocomplete="off" accesskey="G" style="%instyle%"\
			title="enter a tiddler title"\
			onfocus="this.select(); this.setAttribute(\'accesskey\',\'G\');"\
			%keyevent%="return config.macros.gotoTiddler.inputEscKeyHandler(event,this,this.form.list);"\
			onkeyup="return config.macros.gotoTiddler.inputKeyHandler(event,this,this.form.list,%quiet%,%insert%);">\
		<select name=list style="%liststyle%;display:none;position:absolute"\
			onchange="if (!this.selectedIndex) this.selectedIndex=1;"\
			%keyevent%="return config.macros.gotoTiddler.selectKeyHandler(event,this,this.form.gotoTiddler,%insert%);"\
			onclick="return config.macros.gotoTiddler.processItem(this.value,this.form.gotoTiddler,this,%insert%);">\

	function(val) {
		if (!this.items.length || val.length<2) { // starting new search, refresh cached list of tiddlers/shadows/tags
			this.items=new Array();
			var tiddlers=store.getTiddlers("title","excludeLists");
			for(var t=0; t<tiddlers.length; t++) this.items.push(tiddlers[t].title);
			for (var t in config.shadowTiddlers) this.items.pushUnique(t);
			var tags=store.getTags();
			for(var t=0; t<tags.length; t++) this.items.pushUnique(tags[t][0]);
		var found = [];
		var match=val.toLowerCase();
		for(var i=0; i<this.items.length; i++)
			if (this.items[i].toLowerCase().indexOf(match)!=-1) found.push(this.items[i]);
		return found;
	items: [], // cached list of tiddlers/shadows/tags

	function(t) {
		if (store.tiddlerExists(t)) return "";  // tiddler
		if (store.isShadowTiddler(t)) return " (shadow)"; // shadow
		return " (tag)"; // tag 

	function(ev) { // utility function: exits handler and prevents browser from processing the keystroke
		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;

	function(event,here,list) {
		var key=event.keyCode;
		// escape... hide list (2nd esc=clears input)
		if (key==27) {
			if (list.style.display=="none")
			return this.keyProcessed(event);
		return true; // key bubbles up

	function(event,here,list,quiet,insert) {
		var key=event.keyCode;
		// non-printing chars... bubble up, except: backspace=8, enter=13, space=32, down=40, delete=46
		if (key<48) switch(key) { case 8: case 13: case 32: case 40: case 46: break; default: return true; }
		// blank input... if down/enter... fall through (list all)... else, and hide list
		if (!here.value.length && !(key==40 || key==13))
			{ list.style.display="none"; return this.keyProcessed(event); }
		// find matching items...
		var found = this.getItems(here.value);
		// matched one item using enter key, but not an *exact* match... autocomplete input field
		if (found.length==1 && quiet && key==13 && here.value!=found[0])
			{ list.style.display="none"; here.value=found[0]; return this.keyProcessed(event); }
		// no match or exact match using enter key, create/show tiddler
		if (found.length<2 && key==13)
			return this.processItem(found.length?found[0]:here.value,here,list,insert);
		// quiet/no match, make sure list is hidden
		list.style.display=(!quiet && found.length)?"block":"none";
		// no matches, key bubbles up
		if (!found.length) return true;
		// using down/enter key shows/moves to list...
		if (key==40 || key==13)  { list.style.display="block"; list.focus(); }
		// finally, if list is showing, fill it with found results...
		if (list.style.display!="none") {
			while (list.length > 0) list.options[0]=null; // clear list
			found.sort(); // alpha by title
			var hdr=found.length==1?this.listMatchMsg:this.listHeading.format([found.length]); // list 'heading'
			list.options[0]=new Option(hdr,"",false,false);
			for (var t=0; t<found.length; t++)  // fill list...
				list.options[list.length]=new Option(found[t]+this.getItemSuffix(found[t]),found[t],false,false);
			list.size=(found.length<this.listMaxSize?found.length:this.listMaxSize)+1; // resize list...
			list.selectedIndex=(key==40 || key==13)?1:0;
		return true; // key bubbles up
	listMaxSize: 10,
	listHeading: 'Found %0 matching titles:',
	listMatchMsg: 'Press enter to open tiddler...',

	function(event,list,editfield,insert) {
		if (event.keyCode==27) // escape... hide list, move to edit field
			{ editfield.focus(); list.style.display="none"; return this.keyProcessed(event); }
		if (event.keyCode==13 && list.value.length) // enter... view selected item
			{ this.processItem(list.value,editfield,list,insert); return this.keyProcessed(event); }
		return true; // key bubbles up

	function(title,here,list,insert) {
		if (!title.length) return; here.value=title; list.style.display='none';
		if (insert) {
			var tidElem=story.findContainingTiddler(here); if (!tidElem) { here.focus(); return false; }
			var e=story.getTiddlerField(tidElem.getAttribute("tiddler"),"text");
			if (!e||e.getAttribute("edit")!="text") return false;
			var txt=prompt(this.askForText,title); if (!txt||!txt.length) { here.focus(); return false; }
			e.focus(); // put focus on target field before setting selection
			replaceSelection(e,"[["+txt+"|"+title+"]]"); // insert selected tiddler as a PrettyLink
			story.displayTiddler(null,title); // show selected tiddler
		return false;
	askForText: "Enter the text to display for this link"
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|Overrides|'HTML' formatter|
|Description|embed wiki syntax formatting inside of HTML content|

The shorthand Wiki-style formatting syntax of ~TiddlyWiki is very convenient and enables most content to be reasonably well presented. However, there are times when tried-and-true HTML formatting syntax allows more more precise control of the content display.

When HTML formatting syntax is embedded within a tiddler (in between {{{<}}}{{{html>}}} and {{{<}}}{{{/html>}}} markers) TiddlyWiki passes this content to the browser for processing as 'native' HTML.  However, TiddlyWiki does not also process the HTML source content for any embedded wiki-formatting syntax it may contain.  This means that while you can use HTML formatted content, you cannot mix wiki-formatted content within the HTML formatting.
The ~HTMLFormatting plugin allows you to freely ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.

When a tiddler is about to be displayed, ~TiddlyWiki looks for tiddler content contained within ''<{{{html}}}>'' and ''<{{{/html}}}>'' HTML tags.  This content (if any) is passed directly to the browser's internal "rendering engine" to process as ~HTML-formatted content.  Once the HTML formatting has been processed, all the pieces of text occuring in between the HTML formatting are then processed by the ~TiddlyWiki rendering engine, one piece at a time, so that normal wiki-style formatting can be applied to the individual text pieces.
!!!!!Line breaks
One major difference between Wiki formatting and HTML formatting is how "line breaks" are processed. Wiki formatting treats all line breaks as literal content to be displayed //as-is//. However, because HTML normally ignores line breaks and actually processes them as simple "word separators" instead, many people who write HTML include extra line breaks in their documents, just to make the "source code" easier to read.

Even though you can use HTML tags within your tiddler content, the default treatment for line breaks still follows the Wiki-style rule (i.e., all new lines are displayed as-is). When adding HTML content to a tiddler (especially if you cut-and-paste it from another web page), you should take care to avoid adding extra line breaks to the text.

If removing all the extra line breaks from your HTML content would be a big hassle, you can quickly //override the default Wiki-style line break rule// so that the line breaks use the standard HTML rules instead.  Placing a ''<{{{hide linebreaks}}}>'' tag within the tiddler's HTML content changes all line breaks to spaces before rendering the content, so that the literal line breaks will be processed as simple word-breaks instead.

Note: this does //not// alter the actual tiddler content that is stored in the document, just the manner in which it is displayed. Any line breaks contained in the tiddler will still be there when you edit its content. Also, to include a literal line break when the ''<{{{hide linebreaks}}}>'' tag is present, you will need to use a ''<{{{br}}}>'' or ''<{{{p}}}>'' HTML tag instead of simply typing a line break.
!!!!!How it works
The TW core support for HTML does not let you put ANY wiki-style syntax (including TW macros) *inside* the {{{<html>...</html>}}} block.  Everything between {{{<html>}}} and {{{</html>}}} is handed to the browser for processing and that is it.  Fortunately, this plugin ADDS the ability to let you put wiki-syntax (including macros) inside the html.  It does this by first giving the tiddler source content to the browser to process the HTML, and then handling any wiki-based syntax that remains afterward.

However, not all wiki syntax can be safely passed through the browser's parser. Specifically, any TW macros inside the HTML will get 'eaten' by the browser since the macro brackets, {{{<<...>>}}} use the "<" and ">" that normally delimit the HTML/XML syntax recognized by the browser's parser.

Similarly, you can't use InlineJavascript within the HTML because the {{{<script>...</script>}}} syntax will also be consumed by the browser and there will be nothing left to process afterward.  Note: unfortunately, even though the browser removes the {{{<script>...</script>}}} sequence, it doesn't actually execute the embedded javascript code that it removes, so any scripts contained inside of <html> blocks in TW are currently being ignored. :-(

As a work-around to allow TW *macros* (but not inline scripts) to exist inside of <html> formatted blocks of content, the plugin first converts the {{{<<}}} and {{{>>}}} into "%%(" and ")%%", making them "indigestible" so they can pass unchanged through the belly of the beast (the browser's HTML parser).

After the browser has done its job, the wiki syntax sequences (including the "undigested" macros) are contained in #text nodes in the browser-generated DOM elements.  The plugin then recursively locates and processes each #text node, converts the %%( and )%% back into {{{<<}}} and {{{>>}}}, passes the result to wikify() for further rendering of the wiki-formatted syntax into a containing SPAN that replaces the previous #text node.  At the end of this process, none of the encoded %%( and )%% sequences remain in the rendered tiddler output.
import (or copy/paste) the following tiddlers into your document:
''HTMLFormattingPlugin'' (tagged with <<tag systemConfig>>)
^^documentation and javascript for HTMLFormatting handling^^
!!!!!Revision History
''2007.12.04 [*.*.*]'' update for TW2.3.0: replaced deprecated core functions, regexps, and macros
''2007.06.14 [2.1.5]'' in formatter, removed call to e.normalize().  Creates an INFINITE RECURSION error in Safari!!!!
''2006.09.10 [2.1.4]'' update formatter for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)
''2006.05.28 [2.1.3]'' in wikifyTextNodes(), decode the *value* of TEXTAREA nodes, but don't wikify() its children.  (thanks to "ayj" for bug report)
''2006.02.19 [2.1.2]'' in wikifyTextNodes(), put SPAN element into tiddler DOM (replacing text node), BEFORE wikifying the text content.  This ensures that the 'place' passed to any macros is correctly defined when the macro is evaluated, so that calls to story.findContainingTiddler(place) will work as expected. (Thanks for bug report from GeoffSlocock)
''2006.02.05 [2.1.1]'' wrapped wikifier hijack in init function to eliminate globals and avoid FireFox crash bug when referencing globals
''2005.12.01 [2.1.0]'' don't wikify #TEXT nodes inside SELECT and TEXTAREA elements
''2005.11.06 [2.0.1]'' code cleanup
''2005.10.31 [2.0.0]'' replaced hijack wikify() with hijack config.formatters["html"] and simplified recursive WikifyTextNodes() code
''2005.10.09 [1.0.2]'' combined documentation and code into a single tiddler
''2005.08.05 [1.0.1]'' moved HTML and CSS definitions into plugin code instead of using separate tiddlers
''2005.07.26 [1.0.1]'' Re-released as a plugin. Added <{{{html}}}>...</{{{nohtml}}}> and <{{{hide newlines}}}> handling
''2005.07.20 [1.0.0]'' Initial Release (as code adaptation)
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
version.extensions.HTMLFormatting = {major: 2, minor: 1, revision: 5, date: new Date(2007,6,14)};

// find the formatter for HTML and replace the handler
function initHTMLFormatter()
	for (var i=0; i<config.formatters.length && config.formatters[i].name!="html"; i++);
	if (i<config.formatters.length)	config.formatters[i].handler=function(w) {
		if (!this.lookaheadRegExp)  // fixup for TW2.0.x
			this.lookaheadRegExp = new RegExp(this.lookahead,"mg");
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var html=lookaheadMatch[1];
			// optionally suppress wiki-style literal handling of newlines
			// strip any carriage returns added by Internet Explorer's textarea edit field
			// encode newlines as \n so Internet Explorer's HTML parser won't eat them
			// encode macro brackets (<< and >>) so HTML parser won't eat them
			if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(/\n/g,' ');
			// create span to hold HTML
			// parse HTML and normalize the results
			// walk node tree and call wikify() on each text node
			var e = createTiddlyElement(w.output,"span");
			// advance to next parse position
			w.nextMatch = this.lookaheadRegExp.lastIndex;

// wikify text nodes remaining after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode)
	// textarea node doesn't get wikified, just decoded... 
	if (theNode.nodeName.toLowerCase()=='textarea')
	else for (var i=0;i<theNode.childNodes.length;i++) {
		var theChild=theNode.childNodes.item(i);
		if (theChild.nodeName.toLowerCase()=='option') continue;
		if (theChild.nodeName.toLowerCase()=='select') continue;
		if (theChild.nodeName=='#text') {
			var txt=theChild.nodeValue;
			// decode macro brackets and newlines
			// replace text node with wikified() span
			var newNode=createTiddlyElement(null,"span");
|''Description:''|Support for legacy (pre 2.1) strike through formatting|
|''Date:''|Jul 21, 2006|
|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''License:''|[[BSD open source license]]|

// Ensure that the LegacyStrikeThrough Plugin is only installed once.
if(!version.extensions.LegacyStrikeThroughPlugin) {
version.extensions.LegacyStrikeThroughPlugin = {installed:true};

	name: "legacyStrikeByChar",
	match: "==",
	termRegExp: /(==)/mg,
	element: "strike",
	handler: config.formatterHelpers.createElementAndWikify

} //# end of "install only once"
| Name|LessBackupsPlugin|
| Description|Intelligently limit the number of backup files you create|
| Version|3.0 ($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|
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

Works in IE and Firefox only.  Algorithm by Daniel Baird. IE code by by Saq Imtiaz.
window.getSpecialBackupPath = function(backupPath) {

	var MINS  = 60 * 1000;
	var HOURS = 60 * MINS;
	var DAYS  = 24 * HOURS;

	// comment out the ones you don't want
	var 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).

	var now = new Date();

	for (var i=0;i<modes.length;i++) {

		// the filename we will try
		var specialBackupPath = backupPath.replace(/(\.)([0-9]+\.[0-9]+)(\.html)$/,

		// 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 {
				var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
				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 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_orig = window.getBackupPath;
window.getBackupPath = function(localPath) {
	return getSpecialBackupPath(getBackupPath_orig(localPath));

''Open Source License''

VisualTW and TiddlyWiki are published under a BSD [[open source license|http://en.wikipedia.org/wiki/Open_source_license]]. This gives you the freedom to use it pretty much however you want, including for commercial purposes, as long as you keep the copyright notice. If you do use stuff from this page a links back to http://visualtw.ouvaton.org/VisualTW.html and to http://www.tiddlywiki.com/ are appreciated.
<html><p>It seems Firefox doesn't apply styles on links while there are edited in wysiwyg mode. The default color and underline style can be changed using <a href="about:config">about:config</a> url to change browser.underline_anchors and browser.anchor_color (this apply on all pages).

</p><p>Obviously, this is an ugly way to solve this problem</p></html>
<<tagsTree menu "" 3 4 index label>>
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>

config.options.chkHttpReadOnly = false;
readOnly = false; 

|''Version:''|1.0.0 (2006-05-09)|
|''Author:''|Saq Imtiaz|
|''Description:''|Create popups with custom content|
|''Documentation:''|[[PopupMacro Documentation|PopupMacroDocs]]|
|''~Requires:''|TW Version 2.0.8 or better|
// /%
config.macros.popup = {};
config.macros.popup.arrow = (document.all?"▼":"▾");
config.macros.popup.handler = function(place,macroName,params,wikifier,paramString,theTiddler) {

        if (!params[0] || !params[1]) 
             {createTiddlyError(place,'missing macro parameters','missing label or content parameter');
              return false;};
        var label = params[0];
        var source = (params[1]).replace(/\$\)\)/g,">>"); 
        var nestedId = params[2]? params[2]: 'nestedpopup';        

	var onclick = function(event) {
	        if(!event){var event = window.event;}
                var theTarget = resolveTarget(event);
                var nested = (!isNested(theTarget));
                if ((Popup.stack.length > 1)&&(nested==true)) {Popup.removeFrom(1);}
                else if(Popup.stack.length > 0 && nested==false) {Popup.removeFrom(0);};
                var theId = (nested==false)? "popup" : nestedId; 
	        var popup = createTiddlyElement(document.body,"ol",theId,"popup",null);
	        Popup.stack.push({root: button, popup: popup});

	        event.cancelBubble = true;
		if (event.stopPropagation) event.stopPropagation();
		return false;
	var button = createTiddlyButton(place, label+this.arrow,label, onclick, null);

window.isNested = function(e) {
        while (e != null) {
                var contentWrapper = document.getElementById("contentWrapper");
                if (contentWrapper == e) return true;
                e = e.parentNode;
        return false;

".popup, .popup a, .popup a:visited {color: #fff;}\n"+
".popup  a:hover {background: #014; color: #fff; border: none;}\n"+
".popup li , .popup ul, .popup ol {list-style:none !important; margin-left:0.3em !important; margin-right:0.3em; font-size:100%; padding-top:0.5px !important; padding:0px !important;}\n"+
"#nestedpopup {background:#2E5ADF; border: 1px solid #0331BF; margin-left:1em; }\n"+

config.shadowTiddlers.PopupMacroDocs="The documentation is available [[here.|http://tw.lewcid.org/#PopupMacroDocs]]";
Some previous versions of VisualTW are available [[here|http://visualtw.ouvaton.org/old/]]
<<popup commands [[<<tiddler Commands$))]]>>
<<tabs txtMainTab "Lasts" "Timeline" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>
Wysiwyg, tabs, fields editor and encryption plugins
|''Description:''|Sparklines macro|
if(!version.extensions.SparklinePlugin) {
version.extensions.SparklinePlugin = {installed:true};

//-- Sparklines

config.macros.sparkline = {};
config.macros.sparkline.handler = function(place,macroName,params)
	var data = [];
	var min = 0;
	var max = 0;
	var v;
	for(var t=0; t<params.length; t++) {
		v = parseInt(params[t]);
		if(v < min)
			min = v;
		if(v > max)
			max = v;
	if(data.length < 1)
	var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160));
	box.title = data.join(",");
	var w = box.offsetWidth;
	var h = box.offsetHeight;
	box.style.paddingRight = (data.length * 2 - w) + "px";
	box.style.position = "relative";
	for(var d=0; d<data.length; d++) {
		var tick = document.createElement("img");
		tick.border = 0;
		tick.className = "sparktick";
		tick.style.position = "absolute";
		tick.src = "data:image/gif,GIF89a%01%00%01%00%91%FF%00%FF%FF%FF%00%00%00%C0%C0%C0%00%00%00!%F9%04%01%00%00%02%00%2C%00%00%00%00%01%00%01%00%40%02%02T%01%00%3B";
		tick.style.left = d*2 + "px";
		tick.style.width = "2px";
		v = Math.floor(((data[d] - min)/(max-min)) * h);
		tick.style.top = (h-v) + "px";
		tick.style.height = v + "px";

#sidebarOptions .sliderPanel a {display:block; padding : 0.2em 0}
#sidebarOptions .sliderPanel .sliderPanel a {display:inline}
#sidebarOptions .button {margin:0em 0.2em;padding:0.2em 0.3em}
#tiddlersBar .tab {-moz-border-radius : 0.4em 0.4em 0 0}
.tiddler {-moz-border-radius : 0.4em; padding-bottom : 1em}
.popup {padding:0.4em;}
#nestedpopup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup a, .popup a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}

''Below, you can see an additional //source// column and an additional //reset source// button.'' 
(reopen this tiddler to see changes after reseting source)

|''Description:''|Synchronizes plugins from their original source (issued from plugin info) instead of imported url. So, plugins can be imported from any existing tiddlywiki and still be synchronized with their original source.|
|''Date:''|Dec 21,2007|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 1.5; InternetExplorer 6.0|
#import the plugin, save and reload.
#a new column (source) is available in ''sync task'' from the ''backstage button''. If the plugin's source mismatches the plugin server.host (the place from which is was last imported), the source value is displayed.
#a new button is also available : ''reset source''. Click on this button applies plugin's ''source'' as server.host for the checked lines.
Look at this [[example|SyncFromSourceDemo]] on plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]].
!Patch required for TiddlyWiki 2.3.0
A bug in TW2.3.0 requires [[SyncPatch]].
config.macros.sync.getSyncableTiddlersWithoutSource = config.macros.sync.getSyncableTiddlersWithoutSource ? config.macros.sync.getSyncableTiddlersWithoutSource : config.macros.sync.getSyncableTiddlers;

config.macros.sync.startSyncWithoutSource = config.macros.sync.startSyncWithoutSource ? config.macros.sync.startSyncWithoutSource : config.macros.sync.startSync;

config.macros.sync.getSyncableTiddlers = function(){
	var syncs = config.macros.sync.getSyncableTiddlersWithoutSource();
	for(var cpt=0;cpt<syncs.length;cpt++){
		var s= getPluginInfo(syncs[cpt].tiddler).Source;
		if (s) {
			var source = FileAdaptor.minHostName(s);
			source = source.replace(/#[^#]*$/,"").replace(/\/*$/,"");
			syncs[cpt].source = (source==syncs[cpt].tiddler.fields["server.host"]) ? "": source;
		else syncs[cpt].source = "";
	return syncs;

config.macros.sync.startSync = function(place) {
	var w = new Wizard(place.getElementsByTagName("form")[0]);
			{caption: this.syncLabel, tooltip: this.syncPrompt, onClick: this.doSync},
			{caption: this.syncSourceLabel, tooltip: this.syncSourcePrompt, onClick: this.doSyncSource}

	syncSourceLabel : "reset source",
	syncSourcePrompt : "reset synchronization to plugin source, if available"

config.macros.sync.doSyncSource = function(e)
	var rowNames = ListView.getSelectedRows(currSync.listView);
	for(var t=0; t<currSync.syncList.length; t++) {
		var si = currSync.syncList[t];
		if((rowNames.indexOf(si.title) != -1)&&si.source) {
	return false;

config.macros.sync.listViewTemplate.columns.push({name: 'Source', field: 'source', title: "Source", type: 'Link'});

Corrects a bug in TiddlyWiki 2.3.0

FileAdaptor.getTiddlerComplete = function(context,userParams)
	var t = context.adaptor.store.fetchTiddler(context.title);
	t.fields['server.type'] = FileAdaptor.serverType;
	t.fields['server.host'] = FileAdaptor.minHostName(context.host);
	t.fields['server.page.revision'] = t.modified.convertToYYYYMMDDHHMM();
	context.tiddler = t;
	context.status = true;
	if(context.allowSynchronous) {
		context.isSynchronous = true;
	} else {
		window.setTimeout(function() {context.callback(context,userParams);},10);
	return true;
<<timeline "" 25>>
|''Version:''|1.0.1 (2006-06-01)|
|''Description:''|Provides a drop down listing current tiddler tags, and allowing toggling of tags.|
|''Source Code:''|[[TaggerPluginSource]]|
|''~TiddlyWiki:''|Version 2.0.8 or better|
// /%
config.tagger={defaults:{label:"Tags: ",tooltip:"Manage tiddler tags",taglist:"true",excludeTags:"",notags:"tiddler has no tags",aretags:"current tiddler tags:",toggletext:"add tags:"}};config.macros.tagger={};config.macros.tagger.arrow=(document.all?"▼":"▾");config.macros.tagger.handler=function(_1,_2,_3,_4,_5,_6){var _7=config.tagger.defaults;var _8=_5.parseParams("tagman",null,true);var _9=((_8[0].label)&&(_8[0].label[0])!=".")?_8[0].label[0]+this.arrow:_7.label+this.arrow;var _a=((_8[0].tooltip)&&(_8[0].tooltip[0])!=".")?_8[0].tooltip[0]:_7.tooltip;var _b=((_8[0].taglist)&&(_8[0].taglist[0])!=".")?_8[0].taglist[0]:_7.taglist;var _c=((_8[0].exclude)&&(_8[0].exclude[0])!=".")?(_8[0].exclude[0]).readBracketedList():_7.excludeTags.readBracketedList();if((_8[0].source)&&(_8[0].source[0])!="."){var _d=_8[0].source[0];}if(_d&&!store.getTiddler(_d)){return false;}var _e=function(e){if(!e){var e=window.event;}var _11=Popup.create(this);var _12=store.getTags();var _13=new Array();for(var i=0;i<_12.length;i++){_13.push(_12[i][0]);}if(_d){var _15=store.getTiddler(_d);_13=_15.tags.sort();}var _16=_6.tags.sort();var _17=function(_18,_19,_1a){var sp=createTiddlyElement(createTiddlyElement(_11,"li"),"span",null,"tagger");var _1c=createTiddlyButton(sp,_18,_1a+" '"+_19+"'",taggerOnToggle,"button","toggleButton");_1c.setAttribute("tiddler",_6.title);_1c.setAttribute("tag",_19);insertSpacer(sp);if(window.createTagButton_orig_mptw){createTagButton_orig_mptw(sp,_19)}else{createTagButton(sp,_19);}};createTiddlyElement(_11,"li",null,"listTitle",(_6.tags.length==0?_7.notags:_7.aretags));for(var t=0;t<_16.length;t++){_17("[x]",_16[t],"remove tag ");}createTiddlyElement(createTiddlyElement(_11,"li"),"hr");if(_b!="false"){createTiddlyElement(_11,"li",null,"listTitle",_7.toggletext);for(var i=0;i<_13.length;i++){if(!_6.tags.contains(_13[i])&&!_c.contains(_13[i])){_17("[ ]",_13[i],"add tag ");}}createTiddlyElement(createTiddlyElement(_11,"li"),"hr");}var _1f=createTiddlyButton(createTiddlyElement(_11,"li"),("Create new tag"),null,taggerOnToggle);_1f.setAttribute("tiddler",_6.title);if(_d){_1f.setAttribute("source",_d);}Popup.show(_11,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};createTiddlyButton(_1,_9,_a,_e,"button","taggerDrpBtn");};window.taggerOnToggle=function(e){var tag=this.getAttribute("tag");var _22=this.getAttribute("tiddler");var _23=store.getTiddler(_22);if(!tag){var _24=prompt("Enter new tag:","");if(_24!=""&&_24!=null){var tag=_24;if(this.getAttribute("source")){var _26=store.getTiddler(this.getAttribute("source"));_26.tags.pushUnique(_24);}}else{return false;}}if(!_23||!_23.tags){store.saveTiddler(_22,_22,"",config.options.txtUserName,new Date(),tag);}else{if(_23.tags.find(tag)==null){_23.tags.push(tag);}else{if(!_24){_23.tags.splice(_23.tags.find(tag),1);}}store.saveTiddler(_23.title,_23.title,_23.text,_23.modifier,_23.modified,_23.tags);}story.refreshTiddler(_22,null,true);if(config.options.chkAutoSave){saveChanges();}return false;};setStylesheet(".tagger a.button {font-weight: bold;display:inline; padding:0px;}\n"+".tagger #toggleButton {padding-left:2px; padding-right:2px; margin-right:1px; font-size:110%;}\n"+"#nestedtagger {background:#2E5ADF; border: 1px solid #0331BF;}\n"+".popup .listTitle {color:#000;}\n"+"","TaggerStyles");window.lewcidTiddlerSwapTag=function(_27,_28,_29){for(var i=0;i<_27.tags.length;i++){if(_27.tags[i]==_28){_27.tags[i]=_29;return true;}}return false;};window.lewcidRenameTag=function(e){var tag=this.getAttribute("tag");var _2d=prompt("Rename tag '"+tag+"' to:",tag);if((_2d==tag)||(_2d==null)){return false;}if(store.tiddlerExists(_2d)){if(confirm(config.messages.overwriteWarning.format([_2d.toString()]))){story.closeTiddler(_2d,false,false);}else{return null;}}tagged=store.getTaggedTiddlers(tag);if(tagged.length!=0){for(var j=0;j<tagged.length;j++){lewcidTiddlerSwapTag(tagged[j],tag,_2d);}}if(store.tiddlerExists(tag)){store.saveTiddler(tag,_2d);}if(document.getElementById("tiddler"+tag)){var _2f=document.getElementById(story.idPrefix+tag);var _30=story.positionTiddler(_2f);var _31=document.getElementById(story.container);story.closeTiddler(tag,false,false);story.createTiddler(_31,_30,_2d,null);story.saveTiddler(_2d);}if(config.options.chkAutoSave){saveChanges();}return false;};window.onClickTag=function(e){if(!e){var e=window.event;}var _34=resolveTarget(e);var _35=(!isNested(_34));if((Popup.stack.length>1)&&(_35==true)){Popup.removeFrom(1);}else{if(Popup.stack.length>0&&_35==false){Popup.removeFrom(0);}}var _36=(_35==false)?"popup":"nestedtagger";var _37=createTiddlyElement(document.body,"ol",_36,"popup",null);Popup.stack.push({root:this,popup:_37});var tag=this.getAttribute("tag");var _39=this.getAttribute("tiddler");if(_37&&tag){var _3a=store.getTaggedTiddlers(tag);var _3b=[];var li,r;for(r=0;r<_3a.length;r++){if(_3a[r].title!=_39){_3b.push(_3a[r].title);}}var _3d=config.views.wikified.tag;if(_3b.length>0){var _3e=createTiddlyButton(createTiddlyElement(_37,"li"),_3d.openAllText.format([tag]),_3d.openAllTooltip,onClickTagOpenAll);_3e.setAttribute("tag",tag);createTiddlyElement(createTiddlyElement(_37,"li"),"hr");for(r=0;r<_3b.length;r++){createTiddlyLink(createTiddlyElement(_37,"li"),_3b[r],true);}}else{createTiddlyText(createTiddlyElement(_37,"li",null,"disabled"),_3d.popupNone.format([tag]));}createTiddlyElement(createTiddlyElement(_37,"li"),"hr");var h=createTiddlyLink(createTiddlyElement(_37,"li"),tag,false);createTiddlyText(h,_3d.openTag.format([tag]));createTiddlyElement(createTiddlyElement(_37,"li"),"hr");var _40=createTiddlyButton(createTiddlyElement(_37,"li"),("Rename tag '"+tag+"'"),null,lewcidRenameTag);_40.setAttribute("tag",tag);}Popup.show(_37,false);e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}return (false);};if(!window.isNested){window.isNested=function(e){while(e!=null){var _42=document.getElementById("contentWrapper");if(_42==e){return true;}e=e.parentNode;}return false;};}config.shadowTiddlers.TaggerPluginDocumentation="The documentation is available [[here.|http://tw.lewcid.org/#TaggerPluginDocumentation]]";config.shadowTiddlers.TaggerPluginSource="The uncompressed source code is available [[here.|http://tw.lewcid.org/#TaggerPluginSource]]";
// %/
|''Description:''|Displays tags hierachy as a tree of tagged tiddlers.<br>Can be used to create dynamic outline navigation.|
|''Date:''|Jan 04,2008|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0|
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] :
*Try to tag some <<newTiddler>> with a tag displayed in the menu and edit MainMenu.
*Look at some tags like [[Plugins]] or [[menu]].
#import the plugin,
#save and reload,
#optionally, edit TagsTreeStyleSheet.
! Usage
{{{<<tagsTree>>}}} macro accepts the following //optional// parameters.
|!#|!parameter|!description|!by default|
|1|{{{root}}}|Uses {{{root}}} tag as tree root|- In a //tiddler// content or template : uses the tiddler as root tag.<br>- In the //page// content or template (by ex MainMenu) : displays all untagged tags.|
|2|{{{excludeTag}}}|Excludes all such tagged tiddlers from the tree|Uses default excludeLists tag|
|3|{{{level}}}|Expands nodes until level {{{level}}}.<br>Value {{{0}}} hides expand/collapse buttons.|Nodes are collapsed on first level|
|4|{{{depth}}}|Hierachy depth|6 levels depth (H1 to H6 header styles)|
|5|{{{sortField}}}|Alternate sort field. By example : "index".|Sorts tags and tiddlers alphabetically (on their title)|
|6|{{{labelField}}}|Alertnate label field. By example : "label".|Displays tiddler's title|

!Useful addons
*[[FieldsEditorPlugin]] : //create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>.
*[[TaggerPlugin]] : Provides a drop down listing current tiddler tags, and allowing toggling of tags.
!Advanced Users
You can change the global defaults for TagsTreePlugin, like default {{{level}}} value or level styles, by editing or overriding the first config.macros.tagsTree attributes below.
config.macros.tagsTree = {
	expand : "+",
	collapse : "–",
	depth : 6,
	level : 1,
	sortField : "",	
	labelField : "",
	styles : ["h1","h2","h3","h4","h5","h6"],
	trees : {}

config.macros.tagsTree.handler = function(place,macroName,params,wikifier,paramString,tiddler)
	var root = params[0] ? params[0] : (tiddler ? tiddler.title : null);
	var excludeTag = params[1] ? params[1] : "excludeTagsTree";
	var level = params[2] ? params[2] : config.macros.tagsTree.level;
	var depth = params[3] ? params[3] : config.macros.tagsTree.depth;
	var sortField = params[4] ? params[4] : config.macros.tagsTree.sortField;
	var labelField = params[5] ? params[5] : config.macros.tagsTree.labelField;
	var showButtons = (level>0);
	var id = config.macros.tagsTree.getId(place);
	if (config.macros.tagsTree.trees[id]==undefined) config.macros.tagsTree.trees[id]={};
	config.macros.tagsTree.createSubTree(place,id,root,excludeTag,[],level>0 ? level : 1,depth, sortField, labelField,showButtons);

config.macros.tagsTree.createSubTree = function(place, id, root, excludeTag, ancestors, level, depth, sortField, labelField,showButtons){
	var childNodes = root ? this.getChildNodes(root, ancestors) : this.getRootTags(excludeTag);
	var isOpen = (level>0) || (!showButtons);
	if (root && this.trees[id][root]!=undefined) isOpen = this.trees[id][root]; 
	if (root && ancestors.length) {
		var t = store.getTiddler(root);
		if (childNodes.length && depth>0) {
			var wrapper = createTiddlyElement(place , this.styles[Math.min(Math.max(ancestors.length,1),6)-1],null,"branch");
			if (showButtons) {
				b = createTiddlyButton(wrapper, isOpen ? config.macros.tagsTree.collapse : config.macros.tagsTree.expand, null, config.macros.tagsTree.onClick);
			createTiddlyText(createTiddlyLink(wrapper, root),t&&labelField ? t.fields[labelField] ? t.fields[labelField] : root : root);
			createTiddlyText(createTiddlyLink(place, root,false,"leaf"),t&&labelField ? t.fields[labelField] ? t.fields[labelField] : root : root);
	if (childNodes.length && depth) {
		var d = createTiddlyElement(place,"div",null,"subtree");
		d.style.display= isOpen ? "block" : "none";
		if (sortField)
			childNodes.sort(function(a, b){
				var fa=a.fields[sortField];
				var fb=b.fields[sortField];
				return (fa==undefined && fb==undefined) ? a.title < b.title ? -1 : a.title > b.title ? 1 : 0 : (fa==undefined && fb!=undefined) ? 1 :(fa!=undefined && fb==undefined) ? -1 : fa < fb ? -1 : fa > fb ? 1 : 0;
		for (var cpt=0; cpt<childNodes.length; cpt++)
			this.createSubTree(d, id, childNodes[cpt].title, excludeTag, ancestors.concat(root), level-1, depth-1, sortField, labelField, showButtons);	

config.macros.tagsTree.onClick = function(e){
	var id = this.getAttribute("treeId");
	var tiddler = this.getAttribute("tiddler");	
	var n = this.parentNode.nextSibling;
	var isOpen = n.style.display != "none";
	if(config.options.chkAnimate && anim && typeof Slider == "function")
		anim.startAnimating(new Slider(n,!isOpen,null,"none"));
		n.style.display = isOpen ? "none" : "block";
	this.firstChild.nodeValue = isOpen ? config.macros.tagsTree.expand : config.macros.tagsTree.collapse;
	return false;

config.macros.tagsTree.getChildNodes = function(root ,ancestors){
	var childs = store.getTaggedTiddlers(root);
	var result = new Array();
	for (var cpt=0; cpt<childs.length; cpt++)
		if (childs[cpt].title!=root && ancestors.indexOf(childs[cpt].title)==-1) result.push(childs[cpt]);
	return result;

config.macros.tagsTree.getRootTags = function(excludeTag){
	var tags = store.getTags(excludeTag);
	tags.sort(function(a,b) {return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : (a[0].toLowerCase() == b[0].toLowerCase() ? 0 : +1);});
	var result = new Array();
	for (var cpt=0; cpt<tags.length; cpt++) {
		var t = store.getTiddler(tags[cpt][0]);
		if (!t || t.tags.length==0) result.push(t ? t : {title:tags[cpt][0],fields:{}});
	return result;

config.macros.tagsTree.getId = function(element){
	while (!element.id && element.parentNode) element=element.parentNode;
	return element.id ? element.id : "<html>";

config.shadowTiddlers.TagsTreeStyleSheet = "/*{{{*/\n";
config.shadowTiddlers.TagsTreeStyleSheet +=".leaf, .subtree {display:block; margin-left : 0.5em}\n";
config.shadowTiddlers.TagsTreeStyleSheet +=".subtree {margin-bottom:0.5em}\n";
config.shadowTiddlers.TagsTreeStyleSheet +="#mainMenu {text-align:left}\n";
config.shadowTiddlers.TagsTreeStyleSheet +=".branch .button {border:1px solid #DDD; color:#AAA;font-size:9px;padding:0 2px;margin-right:0.3em;vertical-align:middle;text-align:center;}\n";
config.shadowTiddlers.TagsTreeStyleSheet +="/*}}}*/";

store.addNotification("TagsTreeStyleSheet", refreshStyles); 


config.shadowTiddlers.PageTemplate = config.shadowTiddlers.PageTemplate.replace(/id='mainMenu' refresh='content' /,"id='mainMenu' refresh='content' force='true' ")


|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Date:''|Jan 18,2008|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
#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
*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.
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())
				if (title==config.macros.tiddlersBar.currentTiddler){
					var d = createTiddlyElement(null,"span",null,"tab tabSelected");
					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);
				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
				else place.appendChild(d);
	refresh: function(place,params){
		if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
			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;
		return (cpt>1);
	selectNextTab : function(){  //used when the current tab is closed (to select another tab)
		var previous="";
			if (!config.macros.tiddlersBar.currentTiddler) {
			if (title==config.macros.tiddlersBar.currentTiddler) {
				if (previous) {
				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) {
			if(story.hasChanges(t) && !readOnly) {
				return false;
		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);

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)
	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){
	var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;  
	if (config.macros.tiddlersBar.isShown()) {
			if (t!=title) e.style.display="none";
			else e.style.display="";
	var e=document.getElementById("tiddlersBar");
	if (e) config.macros.tiddlersBar.refresh(e,null);

var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
	if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));

ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)

config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
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>");


TiddlyWiki is a wiki-modeled client-side single page application written by Jeremy Ruston that is designed to be used as a personal notebook. It is a single self-contained HTML file that includes CSS and JavaScript code. When the user downloads it to their PC, TiddlyWiki can save the entered information by overwriting itself on the user's disk, at the user's request. Following TiddlyWiki conventions, users can make a new entry, called a Tiddler, in their local copy of the TiddlyWiki file and save it for future reference. Existing Tiddlers can also be modified or deleted in the same way.

More on http://tiddlywiki.com

<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler editHtml externalize easyEdit > fields syncing permalink references jump'><span macro='tagger exclude:"exdcludeLists systemConfig"'></span></div>
<div class='title' macro='view title'></div>
<div class='tagging' macro='tagsTree'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>

<html><p>Use the tiddler's toolbar to edit this text with :</p><ul><li><p>EasyEditPlugin : click on <b>write</b> button.</p></li><li><p>FCKeditorPlugin : click on <b>wysiwyg</b> button.</p></li><li><p>ExternalizePlugin : click on <b>externalize</b> button<span style="font-weight: bold;">.&nbsp; </span><span style="color: rgb(255, 102, 0); font-weight: bold;">This requires :</span></p><ul><li><p><span style="font-weight: bold;">Firefox <br></span></p></li><li><p><span style="font-weight: bold;">"it's all text!"</span> Firefox extension and configuration (editor and hotkey)</p></li><li><p>[[plugin	configuration|ExternalizePlugin]], enter <span style="font-style: italic;">hotkey</span> and check <span style="font-style: italic;">file Extensions</span> is starting with .html (for this demo)</p></li></ul></li><li>Standard <span style="font-weight: bold;">edit </span>button to look at the resulting code.</li></ul><p>By example, you can use the following formats :</p><ul><li><p>Bullets list</p></li><li><p>Orderer list</p></li><li><p>Font <font color="#ff0000">color</font>, <font face="Times New Roman, serif">name</font>,	<font style="font-size: 15pt;" size="4">size</font>, ...</p></li><li><p><b>Bold</b>, <i>italic</i>, <u>underline</u>, <strike>strikethrough</strike></p></li><li><p>[[Links|EasyEditPlugin]]</p></li></ul></html>
renamed FCKeditorPlugin

This patches should be executed after their original plugins has been loaded 

//hacking taggerPlugin externally to remove excluded tags from the list
if (config.macros.tagger) window.eval(store.getTiddlerText("TaggerPlugin").replace(/store.getTags\(\);/,"store.getTags('excludeLists');"));
//hacking LessBackupsPlugin externally to change configuration without editing the plugin code
if (window.getSpecialBackupPath) {
	window.getBackupModes = [
		["ddd",   7*24*60*60*1000],   // one per weekday
		["latest",0]         // always keep last version. (leave this).

	window.eval(store.getTiddlerText("LessBackupsPlugin").match(/window.getSpecialBackupPath =(.*)\n(.*\n)*(?:\/\/ hijack)/m)[0].replace(/var now /,"var modes = window.getBackupModes;\nvar now "));