♫♬♪ Our house... in the middle of our street ♫♬♪


This site requires Javascript
My TiddlyWiki - a reusable non-linear personal web notebook
	



♫♬♪ Our house... in the middle of our street ♫♬♪


This site requires Javascript
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]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	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]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#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; width:90%; 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 1.5.0.2 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>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<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>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>

</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></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 [[ToolbarCommands::EditToolbar]]'></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 excludeLists'></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
<<importTiddlers>>
/*{{{*/

// may be required for mikes comments plugi
//window.saveChanges = function(){};

setStylesheet(
	"label {width:8em; float:left; text-align:right; width:9em; font-size:1.1em; padding:3px;  height:1.5em: top:-20px; margin: 0px -2px 0 0;}"+ 
//	"div.wizardFooter {padding-left:0em}"+ 
	"div.wizardStep > input {display:fixed; padding:3px; margin-bottom:5px; margin-top:0px; margin-right:0px}",
'labelStyles');




config.backstageTasks.remove("upgrade");
config.backstageTasks.remove("save");
config.backstageTasks.remove("sync");


//  ccAutoSave config//

config.options.chkAutoSave = true;

if(!config.extensions) { config.extensions = {}; } //# obsolete from v2.4.2
config.extensions.ServerSideSavingPlugin = {
	adaptor: config.adaptors.cctiddly
};


window.ccTiddlyVersion = '1.8.5';
window.workspacePermission= {};
window.url = "http://nemo.house.cx/";
window.workspace = "House";
window.fullUrl = window.url+window.workspace;
window.useModRewrite = 1;
//if (config.options.txtTheme == "")
//config.options.txtTheme = 'purpleTheme';
workspacePermission.anonC = 1 ;
workspacePermission.anonR = 1; 
workspacePermission.anonU = 0;
workspacePermission.anonD = 0;

workspacePermission.userC = 1 ;
workspacePermission.userR = 1; 
workspacePermission.userU = 1;
workspacePermission.userD = 1;
workspacePermission.canCreateWorkspace = 0;


window.workspace_delete = "D";
window.workspace_udate = "D";

var serverside={
	url:"http://nemo.house.cx/",		//server url, for use in local TW or TW hosted elsewhere
	workspace:"House",
	queryString:"workspace=House",
	debug:0,		//debug mode, display alert box for each action
	passwordTime:0,		//defines how long password variable store in cookie. 0 = indefinite
	messageDuration:5000,				//displayMessage autoclose duration (in milliseconds), 0=leave open
	loggedIn:0,
	can_create_account:"0",
	openId:"0"
};

config.defaultCustomFields = {"server.host":window.url, "server.type":"cctiddly", "server.workspace":window.workspace};
config.shadowTiddlers.OptionsPanel = "[[help|Help]] <br />[[settings|AdvancedOptions]]<br /><<ccOptions>>";

readOnly =false;
config.options.chkHttpReadOnly = false;		//make it HTTP writable by default
config.options.chkSaveBackups = false;		//disable save backup
//config.options.chkAutoSave = true;			//disable autosave
config.options.chkUsePreForStorage = false;

/*}}}*/
powerpapepowerpape
<<ccFile>>
<<ccStats>>
<<taggedTabs loginBox>>
<<ccUpload>>
handle/proxy.php?feed=
<<ccChangePassword>>
<div class='toolbar' macro='toolbar closeTiddler closeOthers'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<<ccEditWorkspace>>
<<ccLogin>>
|~ViewToolbar|closeTiddler closeOthers > editTiddler +collapseTiddler collapseOthers permalink ! fields syncing  revisions references ! jump < |
|~CollapsedToolbar|+expandTiddler collapseOthers closeTiddler closeOthers |
|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddlerHosted|
<<ccCreateWorkspace>>
<<taggedTabs loginBox>>
[[Login]]
powerpape
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.4.1|
|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/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.chooseTemplateForTiddler()|
|Description|use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values|
This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.'' 
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2008.08.29 [1.4.1] corrected handling for tiddlers with no matching tagged template when non-default theme is in effect (e.g., use "MyTheme##ViewTemplate").
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
	
version.extensions.TaggedTemplateTweak= {major: 1, minor: 4, revision: 1, date: new Date(2008,8,29)};

Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
	// get default template from core
	var coreTemplate=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);

	// if the tiddler doesn't exist yet or is untagged, return core result
	var tiddler=store.getTiddler(title);
	if (!tiddler || !tiddler.tags.length)
		return coreTemplate;

	// split core template into theme prefix and template name
	var theme="";
	var template=coreTemplate;
	var parts=template.split(config.textPrimitives.sectionSeparator);
	if (parts[1]) { theme=parts[0]; template=parts[1]; }
	else theme=config.options.txtTheme||""; // fallback if theme is not specified
	theme+=config.textPrimitives.sectionSeparator;

	// look for template whose prefix matches a tag on this tiddler (if any)
	for (i=0; i<tiddler.tags.length; i++) {
		var t=tiddler.tags[i]+template; // add tag prefix to template
		var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
		if (store.getTiddlerText(theme+t))	{ return theme+t; } // theme##tagTemplate
		if (store.getTiddlerText(theme+c))	{ return theme+c; } // theme##TagTemplate
		if (store.getTiddlerText(t)) 		{ return t; }	     // tagTemplate
		if (store.getTiddlerText(c))		{ return c; }	     // TagTemplate
	}
	return coreTemplate; // no matching tag, return core result
}

/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.4.1|
|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/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.chooseTemplateForTiddler()|
|Description|use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values|
This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.'' 
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2008.08.29 [1.4.1] corrected handling for tiddlers with no matching tagged template when non-default theme is in effect (e.g., use "MyTheme##ViewTemplate").
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TaggedTemplateTweak= {major: 1, minor: 4, revision: 1, date: new Date(2008,8,29)};

Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
	// get default template from core
	var coreTemplate=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);

	// if the tiddler doesn't exist yet or is untagged, return core result
	var tiddler=store.getTiddler(title);
	if (!tiddler || !tiddler.tags.length)
		return coreTemplate;
	// split core template into theme prefix and template name
	var theme="";
	var template=coreTemplate;
	var parts=template.split(config.textPrimitives.sectionSeparator);
	if (parts[1]) { theme=parts[0]; template=parts[1]; }
	else theme=config.options.txtTheme||""; // fallback if theme is not specified
	theme+=config.textPrimitives.sectionSeparator;

	// look for template whose prefix matches a tag on this tiddler (if any)
	for (i=0; i<tiddler.tags.length; i++) {
		var t=tiddler.tags[i]+template; // add tag prefix to template
		var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
		if (store.getTiddlerText(theme+t))	{ return theme+t; } // theme##tagTemplate
		if (store.getTiddlerText(theme+c))	{ return theme+c; } // theme##TagTemplate
		if (store.getTiddlerText(t)) 		{ return t; }	     // tagTemplate
		if (store.getTiddlerText(c))		{ return c; }	     // TagTemplate
	}
	return coreTemplate; // no matching tag, return core result
}
//}}}
/***
|''Name''|ServerSideSavingPlugin|
|''Description''|server-side saving|
|''Author''|FND|
|''Version''|0.3.2|
|''Status''|@@experimental@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/plugins/ServerSideSavingPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Requires''|[[ServerConfig]]|
|''Keywords''|serverSide|
!Notes
This plugin relies on a dedicated configuration plugin to be present.
The specific nature of this plugins depends on the respective server.
!Revision History
!!v0.1 (2008-11-24)
* initial release
!!v0.2 (2008-12-01)
* added support for local saving
!!v0.3 (2008-12-03)
* added Save to Web macro for manual synchronization
!To Do
* conflict detection/resolution
* rename to ServerLinkPlugin?
* attempt to determine default adaptor (and defaultCustomFields) from systemServer tiddlers
* handle deleting/renaming (e.g. by hijacking the respective commands and creating a log)
!Code
***/
//{{{
if(!version.extensions.ServerSideSavingPlugin) { //# ensure that the plugin is only installed once
version.extensions.ServerSideSavingPlugin = { installed: true };

if(!config.extensions) { config.extensions = {}; } //# obsolete from v2.4.2

(function(plugin) { //# set up alias

if(!plugin || !plugin.adaptor) {
	throw "Missing dependency: ServerConfig";
}

plugin = {
	adaptor: plugin.adaptor, //# N.B.: expects config.extensions.ServerSideSavingPlugin.adaptor to be set
	locale: {
		saved: "%0 saved successfully",
		saveError: "Error saving %0: %1",
		deleted: "Removed %0",
		deleteError: "Error removing %0: %1",
		deleteLocalError: "Error removing %0 locally",
		removedNotice: "This tiddler has been deleted."
	},

	sync: function() {
		store.forEachTiddler(function(title, tiddler) {
			if(tiddler.fields.deleted) {
				plugin.removeTiddler(tiddler);
			} else if(tiddler.isTouched() && tiddler.getServerType() && tiddler.fields["server.host"]) {
				plugin.saveTiddler(tiddler);
			}
		});
	},

	saveTiddler: function(tiddler) {
		var adaptor = new this.adaptor();
		var context = {
			tiddler: tiddler,
			changecount: tiddler.fields.changecount
		};
		context.workspace = tiddler.fields["server.workspace"];
		var req = adaptor.putTiddler(tiddler, context, {}, this.saveTiddlerCallback);
		return req ? tiddler : false;
	},

	saveTiddlerCallback: function(context, userParams) {
		var tiddler = context.tiddler;
		if(context.status) {
			if(tiddler.fields.changecount == context.changecount) { //# check for changes since save was triggered
				tiddler.clearChangeCount();
			} else if(tiddler.fields.changecount > 0) {
				tiddler.fields.changecount -= context.changecount;
			}
			displayMessage(plugin.locale.saved.format([tiddler.title]));
			store.setDirty(false);
		} else {
			displayMessage(plugin.locale.saveError.format([tiddler.title, context.statusText]));
		}
	},

	removeTiddler: function(tiddler) {
		var adaptor = new this.adaptor();
		context = { tiddler: tiddler };
		context.workspace = tiddler.fields["server.workspace"];
		var req = adaptor.deleteTiddler(tiddler, context, {}, this.removeTiddlerCallback);
		return req ? tiddler : false;
	},

	removeTiddlerCallback: function(context, userParams) {
		var tiddler = context.tiddler;
		if(context.status) {
			if(tiddler.fields.deleted) {
				store.deleteTiddler(tiddler.title);
			} else {
				displayMessage(plugin.locale.deleteError.format([tiddler.title]));
			}
			displayMessage(plugin.locale.deleted.format([tiddler.title]));
			store.setDirty(false);
		} else {
			displayMessage(plugin.locale.deleteLocalError.format([tiddler.title, context.statusText]));
		}
	}
};

config.macros.saveToWeb = { // XXX: hijack existing sync macro?
	locale: {
		btnLabel: "save to web",
		btnTooltip: "synchronize changes",
		btnAccessKey: null
	},

	handler: function(place, macroName, params, wikifier, paramString, tiddler) {
		createTiddlyButton(place, this.locale.btnLabel, this.locale.btnTooltip,
			plugin.sync, null, null, this.locale.btnAccessKey);
	}
};

// hijack saveChanges to trigger remote saving
plugin.saveChanges = saveChanges;
saveChanges = function(onlyIfDirty, tiddlers) {
	if(window.location.protocol == "file:") {
		plugin.saveChanges.apply(this, arguments);
	} else {
		plugin.sync();
	}
};

// override removeTiddler to flag tiddler as deleted
TiddlyWiki.prototype.removeTiddler = function(title) { // XXX: should override deleteTiddler instance method?
	var tiddler = this.fetchTiddler(title);
	if(tiddler) {
		tiddler.tags = ["excludeLists", "excludeSearch", "excludeMissing"];
		tiddler.text = plugin.locale.removedNotice;
		tiddler.fields.deleted = true; // XXX: rename to removed/tiddlerRemoved?
		tiddler.incChangeCount();
		this.notify(title, true);
		this.setDirty(true);
	}
};

})(config.extensions.ServerSideSavingPlugin); //# end of alias

// override saveTiddler to fix core bug (ticket #769) -- XXX: to be fixed in TiddlyWiki v2.4.2
Story.prototype.saveTiddler = function(title,minorUpdate)
{
	var tiddlerElem = this.getTiddler(title);
	if(tiddlerElem) {
		var fields = {};
		this.gatherSaveFields(tiddlerElem,fields);
		var newTitle = fields.title || title;
		if(!store.tiddlerExists(newTitle))
			newTitle = newTitle.trim();
		if(store.tiddlerExists(newTitle) && newTitle != title) {
			if(!confirm(config.messages.overwriteWarning.format([newTitle.toString()])))
				return null;
		}
		if(newTitle != title)
			this.closeTiddler(newTitle,false);
		tiddlerElem.id = this.tiddlerId(newTitle);
		tiddlerElem.setAttribute("tiddler",newTitle);
		tiddlerElem.setAttribute("template",DEFAULT_VIEW_TEMPLATE);
		tiddlerElem.setAttribute("dirty","false");
		if(config.options.chkForceMinorUpdate)
			minorUpdate = !minorUpdate;
		if(!store.tiddlerExists(newTitle))
			minorUpdate = false;
		var newDate = new Date();
		var extendedFields = store.tiddlerExists(newTitle) ? store.fetchTiddler(newTitle).fields : (newTitle!=title && store.tiddlerExists(title) ? store.fetchTiddler(title).fields : merge({},config.defaultCustomFields));
		for(var n in fields) {
			if(!TiddlyWiki.isStandardField(n))
				extendedFields[n] = fields[n];
		}
		var tiddler = store.saveTiddler(title,newTitle,fields.text,minorUpdate ? undefined : config.options.txtUserName,minorUpdate ? undefined : newDate,fields.tags,extendedFields);
		autoSaveChanges(null,[tiddler]);
		return newTitle;
	}
	return null;
};

} //# end of "install only once"
//}}}
config.macros.taggedTabs={};

config.macros.taggedTabs.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
	var params = paramString.parseParams("taggedTabset",null,true,false,false);
	var tagged = store.getTaggedTiddlers(params[1].value,"title").reverse();
	var cookie = "taggedTabs";
	var wrapper = createTiddlyElement(null,"div",null,"tabsetWrapper taggedTabset" + cookie);
	var tabset = createTiddlyElement(wrapper,"div",null,"tabset");
	var validTab = false;
	tabset.setAttribute("cookie",cookie);
	for(var t=0; t<tagged.length; t++) {
		var label = tagged[t].title;
		if(label=='ccLogin') 
			tabLabel = config.macros.ccLogin.buttonLogin;
		else
			tabLabel = label;
		var prompt = tagged[t].title;
		var tab = createTiddlyButton(tabset,tabLabel,prompt,config.macros.tabs.onClickTab,"tab tabUnselected");
		tab.setAttribute("tab",label);
		tab.setAttribute("content",label);
		if(config.options[cookie] == label)
			validTab = true;
	}
	if(!validTab)
		config.options[cookie] = tagged[0].title;
	place.appendChild(wrapper);
	config.macros.tabs.switchTab(tabset, config.options[cookie]);
	
	setStylesheet("div.tiddler .tab {font-size:1.2em;  font-weight:bold;padding-left:2em; padding-right:2em; margin-left:0px; margin-right:1em; padding-bottom:2px}"+
	"div.tiddler .wizard { margin:0px; }"+
	" div.tabContents .wizard { margin:0px; }"+
	".tabsetWrapper .wizard h1 {display:none}"+
	".tabsetWrapper .wizard h2 {padding:0.5em}"+
	".viewer {float:right; width:90%;}"+

"div.viewer  div.tabsetWrapper{width:90%}"+
	"a.tabSelected{ filter:'alpha(opacity:60)'; }"+
	"div.tabset {padding:0px}"+
	"div.tabContents {padding:0px; background:transparent}",
	 "taggedTabs");
	
};



//}}}
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
	
version.extensions.LoadRemoteFileThroughProxy = {
 major: 1, minor: 1, revision: 0, 
 date: new Date("mar 17, 2007"), 
 source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};

if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};

bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
 if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){ 
 url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
 }

 return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
powerpape
/*
// Displays the default tiddlers alongside the login box when users are not logged in.
window.restart = function(){
	story.displayDefaultTiddlers();
	invokeParamifier(params,"onstart");
	window.scrollTo(0,0); 
	});
};
*/

// Import Override - ensures imported tiddlers have cctiddly server type. 
config.macros.importTiddlers.onGetTiddler = function(context,wizard)
{
	
	if(!context.status)
		displayMessage("Error in importTiddlers.onGetTiddler: " + context.statusText);
	var tiddler = context.tiddler;
	if(store.tiddlerExists(tiddler.title)) {
		var t = store.getTiddler(tiddler.title);
		tiddler.fields = t.fields;
	}
	store.suspendNotifications();
	tiddler.fields['server.type'] = 'cctiddly';
	tiddler.fields['server.host'] = window.url;
	tiddler.fields['workspace']= window.workspace;
	store.saveTiddler(tiddler.title, tiddler.title, tiddler.text, tiddler.modifier, tiddler.modified, tiddler.tags, tiddler.fields, false, tiddler.created);// local 
//	config.extensions.ServerSideSavingPlugin.saveTiddler(tiddler); // remote save. 
	if(!wizard.getValue("sync")) {
		store.setValue(tiddler.title,'server',null);
	}
	store.resumeNotifications();
	if(!context.isSynchronous)
		store.notify(tiddler.title,true);
	var remainingImports = wizard.getValue("remainingImports")-1;
	wizard.setValue("remainingImports",remainingImports);
	if(remainingImports == 0) {
		if(context.isSynchronous) {
			store.notifyAll();
			refreshDisplay();
		}
		wizard.setButtons([
				{caption: config.macros.importTiddlers.doneLabel, tooltip: config.macros.importTiddlers.donePrompt, onClick: config.macros.importTiddlers.onClose}
			],config.macros.importTiddlers.statusDoneImport);
		autoSaveChanges();
	}
};
config.backstageTasks.push("about");
merge(config.tasks,{about:{text: config.macros.ccAbout.buttonBackstageText,tooltip: config.macros.ccAbout.buttonBackstageTooltip,content: '<<ccAbout>>'}});

if (isLoggedIn()){
	config.backstageTasks.push("logout");
	merge(config.tasks,{logout:{text: config.macros.ccLogin.buttonLogout,tooltip: config.macros.ccLogin.buttonLogoutToolTip,content: '<<ccLogin>>'}});

//	config.backstageTasks.push("create");
//	merge(config.tasks,{create: {text: config.macros.ccCreateWorkspace.buttonCreateText, tooltip: config.macros.ccCreateWorkspace.buttonCreateTooltip, content:'<<ccCreateWorkspace>>'}});

}else{
	config.backstageTasks.push("login");
	merge(config.tasks,{login:{text: config.macros.ccLogin.buttonlogin,tooltip: config.macros.ccLogin.buttonLoginToolTip,content: '\r\n\r\n<<tiddler Login>>'}});	
}

// ccChangePassword //

// {{{
	
	config.macros.ccChangePassword={};
	
	config.macros.ccChangePassword.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
		var w = new Wizard();
		var me = config.macros.ccChangePassword;
		w.createWizard(place,me.title);
		w.addStep(me.subTitle+cookieString(document.cookie).txtUserName,me.step1Html);
		w.setButtons([
			{caption: me.buttonChangeText, tooltip: me.buttonChangeToolTip, onClick: function(){config.macros.ccChangePassword.doPost(w);  } }
		]);
	};

	config.macros.ccChangePassword.doPost = function (w) {
		me = config.macros.ccChangePassword;
		if(!w.formElem.new1.value || !w.formElem.new2.value || !w.formElem.old.value) {
			displayMessage(me.noticePasswordUpdateFailed);
			return false;
		}
		if(w.formElem.new1.value != w.formElem.new2.value){
			displayMessage(me.noticePasswordsNoMatch);
			return false;
		}
		doHttp("POST", url+"handle/changePassword.php", "&new1="+Crypto.hexSha1Str(w.formElem.new1.value)+"&new2="+Crypto.hexSha1Str(w.formElem.new2.value)+"&old1="+Crypto.hexSha1Str(w.formElem.old.value),null,null,null,config.macros.ccChangePassword.callback);	
	}

	config.macros.ccChangePassword.callback = function(status,context,responseText,uri,xhr) {
		if(xhr.status == 304)
			displayMessage(me.noticePasswordUpdateFailed);
		else
			displayMessage(me.noticePasswordUpdated);
	}

	//}}}
// Allows users to change the default tiddlers for anonymous users by setting the AnonDefaultTiddlers tiddler.

// also requires overide of restart. 

Story.prototype.displayDefaultTiddlers = function(){
 	var tiddlers="";
	if(isLoggedIn()){        
		var url = window.location;        
		url = url.toString();        
		var bits = url.split('#');        
		if(bits.length == 1){            
			tiddlers = store.filterTiddlers(store.getTiddlerText("DefaultTiddlers"));            
			story.displayTiddlers(null, tiddlers);
		}
	}else{         
		tiddlers=store.filterTiddlers(store.getTiddlerText("AnonDefaultTiddlers"));        
		story.displayTiddlers(null, tiddlers);   
	}    
};

// ccAdmin //
//{{{
config.macros.ccAdmin = {}
config.macros.ccAdmin.handler = function(place,macroName,params,wikifier,paramString,tiddler, errorMsg){
	var w = new Wizard();
	w.createWizard(place,config.macros.ccAdmin.WizardTitleText);
	config.macros.ccAdmin.refresh(w);
};

config.macros.ccAdmin.refresh= function(w){
	params = {};
	params.w = w;
	params.e = this;
	me = config.macros.ccAdmin;
	doHttp('POST',url+'/handle/workspaceAdmin.php','action=LISTALL&workspace='+workspace,null,null,null,config.macros.ccAdmin.listAllCallback,params);
	w.setButtons([
		{caption: me.buttonDeleteText, tooltip: me.buttonDeleteTooltip, onClick: function(w){ 
			config.macros.ccAdmin.delAdminSubmit(null, params);
		 	return false;
		}}, 
		{caption: me.buttonAddText, tooltip: me.buttonAddTooltip, onClick: function(w){
			config.macros.ccAdmin.addAdminDisplay(null, params); return false } }]);
};

config.macros.ccAdmin.delAdminSubmit = function(e, params){
	var listView = params.w.getValue("listView");
	var rowNames = ListView.getSelectedRows(listView);
	var delUsers = "";
	for(var e=0; e < rowNames.length; e++) 
		delUsers += rowNames[e]+",";
	doHttp('POST',url+'/handle/workspaceAdmin.php','action=DELETEADMIN&username='+delUsers+'&workspace='+workspace,null,null,null,config.macros.ccAdmin.addAdminCallback,params);
	return false; 
};

config.macros.ccAdmin.addAdminDisplay = function(e, params){
	doHttp('POST',url+'/handle/workspaceAdmin.php','action=LISTWORKSPACES',null,null,null,config.macros.ccAdmin.listWorkspaces,params);
};

config.macros.ccAdmin.listWorkspaces = function(status,params,responseText,uri,xhr){
	var frm = createTiddlyElement(null,'form',null,null);
	var me = config.macros.ccAdmin;
	frm.onsubmit = config.macros.ccAdmin.addAdminSubmit;	
	params.w.addStep(me.stepAddTitle,"<input type='hidden' name='admin_placeholder'/>"+me.labelUsername+"<input name=adminUsername><br />"+me.labelWorkspace+"<select name=workspaceName />");
	var workspaces = eval('[ '+responseText+' ]');
	for(var t=0; t<workspaces.length; t++) {
		var o = createTiddlyElement(params.w.formElem.workspaceName, "option", null, null, workspaces[t]);
		o.value=workspaces[t];
		if(workspaces[t] == workspace)
			o.selected = true;
	}
	params.w.formElem.admin_placeholder.parentNode.appendChild(frm);
	params.w.setButtons([
		{caption: me.buttonCancelText, tooltip: me.buttonCancelTooltip, onClick: function(w){ config.macros.ccAdmin.refresh(params.w) } },
		{caption: me.buttonCreateText, tooltip: me.buttonCreateTooltip, onClick: function(){config.macros.ccAdmin.addAdminSubmit(null, params);  } }
	]);
};

config.macros.ccAdmin.addAdminSubmit = function(e, params){
	doHttp('POST',url+'/handle/workspaceAdmin.php','&add_username='+params.w.formElem.adminUsername.value+'&action=addNew&workspace='+params.w.formElem.workspaceName[params.w.formElem.workspaceName.selectedIndex].value,null,null,null,config.macros.ccAdmin.addAdminCallback,params);
	return false; 
};

config.macros.ccAdmin.listAllCallback = function(status,params,responseText,uri,xhr) {
	var me = config.macros.ccAdmin;
	var out = "";
	var adminUsers = [];
	if(xhr.status == 403){
		var html ='';
		params.w.addStep(me.stepErrorText+workspace, me.stepErrorTitle);
		params.w.setButtons([]);
		return false;
	}
	try{
		var a = eval(responseText);
		for(var e=0; e < a.length; e++){
			out += a[e].username;
			adminUsers.push({
			name: a[e].username,
			lastVisit:a[e].lastVisit});
		}
	}catch(ex){
			params.w.addStep(" "+workspace, me.stepNoAdminTitle);
			params.w.setButtons([
				{caption: me.buttonCreateText, tooltip: me.buttonCreateTooltip, onClick: function(){ config.macros.ccAdmin.addAdminDisplay(null, params)}}]);
			return false;
	}
	var html ='<input type="hidden" name="markList"></input>';
	params.w.addStep(me.stepManageWorkspaceTitle+workspace, html);
	var markList = params.w.getElement("markList");
	var listWrapper = document.createElement("div");
	markList.parentNode.insertBefore(listWrapper,markList);
	var listView = ListView.create(listWrapper,adminUsers,config.macros.ccAdmin.listAdminTemplate);
	params.w.setValue("listView",listView);
};

config.macros.ccAdmin.addAdminCallback = function(status,params,responseText,uri,xhr) {
	config.macros.ccAdmin.refresh(params.w);
};
// ccAdaptorCommandsPlugin //
function ccTiddlyAdaptor(){}
merge(ccTiddlyAdaptor,{ 
	errorTitleNotSaved:"<h1>Your changes were NOT saved.</h1>", 
	errorTextSessionExpired:"Your Session has expired. <br /> You will need to log into the new window and then copy your changes from this window into the new window. ", 
	errorTextConfig:"There was a conflict when saving. <br /> Please open the page in a new window to see the changes.",
	errorTextUnknown:"An unknown error occured.",
	errorClose:"close",
	buttonOpenNewWindow:"Open a Window where I can save my changes	.... ",
	buttonHideThisMessage:"Hide this message", 
	msgErrorCode:"Error Code : "
});


if(!config.extensions) { config.extensions = {}; } //# obsolete from v2.4.2
config.extensions.ServerSideSavingPlugin = {
	adaptor: config.adaptors.cctiddly
};

//{{{
	
	config.commands.revisions = {};
	merge(config.commands.revisions,{
		text: "revisions",
		tooltip: "View another revision of this tiddler",
		loading: "loading...",
		done: "Revision downloaded",
		revisionTooltip: "View this revision",
		popupNone: "No revisions",
		revisionTemplate: "%0 r:%1 m:%2",
		dateFormat:"YYYY mmm 0DD 0hh:0mm"	
	});

	config.commands.deleteTiddlerHosted = {};
	merge(config.commands.deleteTiddlerHosted,{
		text: "delete",
		tooltip: "Delete this tiddler",
		warning: "Are you sure you want to delete '%0'?",
		hideReadOnly: true,
		done: "Deleted "
	});
	
	
// Ensure that the plugin is only installed once.
if(!version.extensions.AdaptorCommandsPlugin) {
	version.extensions.AdaptorCommandsPlugin = {installed:true};



// implementing closeTiddler without the clearMessage();
Story.prototype.closeTiddler = function(title,animate,unused)
{
	var tiddlerElem = this.getTiddler(title);
	if(tiddlerElem) {
		this.scrubTiddler(tiddlerElem);
		if(config.options.chkAnimate && animate && anim && typeof Slider == "function")
			anim.startAnimating(new Slider(tiddlerElem,false,null,"all"));
		else {
			removeNode(tiddlerElem);
			forceReflow();
		}
	}
};

function getServerType(fields)
{
	if(!fields)
		return null;
	var serverType = fields['server.type'];
	if(!serverType)
		serverType = fields['wikiformat'];
	if(!serverType)
		serverType = config.defaultCustomFields['server.type'];
	if(!serverType && typeof RevisionAdaptor != 'undefined' && fields.uuid)
		serverType = RevisionAdaptor.serverType;
	return serverType;
}

function invokeAdaptor(fnName,param1,param2,context,userParams,callback,fields)
{
	var serverType = getServerType(fields);
	if(!serverType)
		return null;
	var adaptor = new config.adaptors[serverType];
	if(!adaptor)
		return false;
	if(!config.adaptors[serverType].prototype[fnName])
		return false;
	adaptor.openHost(fields['server.host']);
	adaptor.openWorkspace(fields['server.workspace']);
	var ret = false;
	if(param1)
		ret = param2 ? adaptor[fnName](param1,param2,context,userParams,callback) : adaptor[fnName](param1,context,userParams,callback);
	else
		ret = adaptor[fnName](context,userParams,callback);
	return ret;
}

//# Returns true if function fnName is available for the serverType specified in fields
//# Used by (eg): config.commands.download.isEnabled
function isAdaptorFunctionSupported(fnName,fields)
{
	var serverType = getServerType(fields);
	if(!serverType || !config.adaptors[serverType])
		return false;
	if(!config.adaptors[serverType].isLocal && !fields['server.host'])
		return false;
	var fn = config.adaptors[serverType].prototype[fnName];
	return fn ? true : false;
}

config.commands.revisions.isEnabled = function(tiddler)
{
	return isAdaptorFunctionSupported('getTiddlerRevisionList',tiddler.fields);
};

config.commands.revisions.handler = function(event,src,title)
{
	var tiddler = store.fetchTiddler(title);
	userParams = {};
	userParams.tiddler = tiddler;
	userParams.src = src;
	userParams.dateFormat = config.commands.revisions.dateFormat;
	var revisionLimit = 10;
	if(!invokeAdaptor('getTiddlerRevisionList',title,revisionLimit,null,userParams,config.commands.revisions.callback,tiddler.fields))
		return false;
	event.cancelBubble = true;
	if(event.stopPropagation)
		event.stopPropagation();
	return true;
};

config.commands.revisions.callback = function(context,userParams)
// The revisions are returned as tiddlers in the context.revisions array
{
	var revisions = context.revisions;
	popup = Popup.create(userParams.src);
	Popup.show(popup,false);
	if(revisions.length==0) {
		createTiddlyText(createTiddlyElement(popup,'li',null,'disabled'),config.commands.revisions.popupNone);
	} else {
		revisions.sort(function(a,b) {return a.modified < b.modified ? +1 : -1;});
		for(var i=0; i<revisions.length; i++) {
			var tiddler = revisions[i];
			var modified = tiddler.modified.formatString(context.dateFormat||config.commands.revisions.dateFormat);
			var revision = tiddler.fields['server.page.revision'];
			var btn = createTiddlyButton(createTiddlyElement(popup,'li'),
					config.commands.revisions.revisionTemplate.format([modified,revision,tiddler.modifier]),
					tiddler.text||config.commands.revisions.revisionTooltip,
					function() {
						config.commands.revisions.getTiddlerRevision(this.getAttribute('tiddlerTitle'),this.getAttribute('tiddlerModified'),this.getAttribute('tiddlerRevision'),this);
						return false;
						},
					'tiddlyLinkExisting tiddlyLink');
			btn.setAttribute('tiddlerTitle',userParams.tiddler.title);
			btn.setAttribute('tiddlerRevision',revision);
			btn.setAttribute('tiddlerModified',tiddler.modified.convertToYYYYMMDDHHMM());
			if(userParams.tiddler.fields['server.page.revision'] == revision || (!userParams.tiddler.fields['server.page.revision'] && i==0))
				btn.className = 'revisionCurrent';
		}
	}
};

config.commands.revisions.getTiddlerRevision = function(title,modified,revision)
{
	var tiddler = store.fetchTiddler(title);
	var context = {modified:modified};
	return invokeAdaptor('getTiddlerRevision',title,revision,context,null,config.commands.revisions.getTiddlerRevisionCallback,tiddler.fields);
};

config.commands.revisions.getTiddlerRevisionCallback = function(context,userParams)
{
	if(context.status) {
		var tiddler = context.tiddler;
		store.addTiddler(tiddler);
		store.notify(tiddler.title, true);
		story.refreshTiddler(tiddler.title,1,true);
	} else {
		displayMessage(context.statusText);
	}
};

config.commands.deleteTiddlerHosted.handler = function(event,src,title)
{
	var tiddler = store.fetchTiddler(title);
		if(!tiddler)
			return false;
		var deleteIt = true;
		if(config.options.chkConfirmDelete)
		        deleteIt = confirm(this.warning.format([title]));
		if(deleteIt) {
			var ret = invokeAdaptor('deleteTiddler',title,null,null,null,config.commands.deleteTiddlerHosted.callback,tiddler.fields);
			if(ret){
				store.removeTiddler(title);
				story.closeTiddler(title,true);
			}
		}
		return false;

};

config.commands.deleteTiddlerHosted.callback = function(context,userParams)
{
	if(context.status) {
		displayMessage(config.commands.deleteTiddlerHosted.done + context.title);
	} else {
		if (context.statusText.indexOf("Not Found") == -1)
			displayMessage(context.statusText);
	}
};

}//# end of 'install only once'
//}}}


// ccAdaptor //

//{{{

	window.isLoggedIn = function(){
		return (window.loggedIn == '1') 
	}

	ccTiddlyAdaptor.prototype = new AdaptorBase();

	ccTiddlyAdaptor.mimeType = 'application/json';
	ccTiddlyAdaptor.serverType = 'cctiddly'; // MUST BE LOWER CASE
	ccTiddlyAdaptor.serverParsingErrorMessage = "Error parsing result from server";
	ccTiddlyAdaptor.errorInFunctionMessage = "Error in function ccTiddlyAdaptor.%0";

	ccTiddlyAdaptor.minHostName = function(host){
		return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : '';
	};

	// Convert a page title to the normalized form used in uris
	ccTiddlyAdaptor.normalizedTitle = function(title){
		return title;
	};

	// Convert a date in YYYY-MM-DD hh:mm format into a JavaScript Date object
	ccTiddlyAdaptor.dateFromEditTime = function(editTime){
		var dt = editTime;
		return new Date(Date.UTC(dt.substr(0,4),dt.substr(5,2)-1,dt.substr(8,2),dt.substr(11,2),dt.substr(14,2)));
	};

	ccTiddlyAdaptor.prototype.login = function(context,userParams,callback){
		if(window.location.search.substring(1))
			var uriParams = window.location.search.substring(1);
		else
			var uriParams = "";
		context = this.setContext(context,userParams,callback);
		var uriTemplate = '%0/handle/loginFile.php?cctuser=%1&cctpass=%2&'+uriParams;
		var uri = uriTemplate.format([context.host,context.username,context.password]);
		var req = httpReq('GET',uri,ccTiddlyAdaptor.loginCallback,context);
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.loginCallback = function(status,context,responseText,uri,xhr){
		if(xhr.status==401){
			context.status = false;
		}else{
			context.status = true;
			var c='sessionToken'+"="+responseText;
				c+="; expires=Fri, 1 Jan 2811 12:00:00 UTC; host=*";
				document.cookie=c;
		}
		if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.prototype.register = function(context,userParams,callback){
		context = this.setContext(context,userParams,callback);
		var uriTemplate = '%0/handle/register.php';
		var uri = uriTemplate.format([context.host,context.username,Crypto.hexSha1Str(context.password)]);
		var dataTemplate = 'username=&0&reg_mail=%1&password=%2&password2=%3';
		var data = dataTemplate.format([context.username,context.password1,context.password2]);
		var req = httpReq('POST', uri,ccTiddlyAdaptor.registerCallback,context,null,data);
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.prototype.rename = function(context, userParams, callback){
		if(window.location.search.substring(1))
			var postParams = "&"+window.location.search.substring(1);
		else
			var postParams = "";
		context = this.setContext(context,userParams,callback);
		var uri = window.url+"handle/renameTiddler.php?otitle="+context.title+"&ntitle="+context.newTitle+"&workspace="+window.workspace+postParams;;
		httpReq('POST', uri,ccTiddlyAdaptor.renameCallback,context,null,null);
	};

	ccTiddlyAdaptor.renameCallback = function(status,context,responseText,uri,xhr){
		if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.registerCallback = function(status,context,responseText,uri,xhr){
		if(status){
			context.status = true;
		}else{
			context.status = false;
		}
		if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.prototype.getWorkspaceList = function(context,userParams,callback){
	 	context = this.setContext(context,userParams,callback);
		var uriTemplate = '%0/handle/listWorkspaces.php';
		var uri = uriTemplate.format([context.host]);
		var req = httpReq('GET', uri,ccTiddlyAdaptor.getWorkspaceListCallback,context,{'accept':'application/json'});
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.getWorkspaceListCallback = function(status,context,responseText,uri,xhr){
		context.status = false;
		context.workspaces = [];
		context.statusText = ccTiddlyAdaptor.errorInFunctionMessage.format(['getWorkspaceListCallback']);
		if(status){
		try{
			eval('var workspaces=' + responseText);
		}catch (ex){
			context.statusText = exceptionText(ex,ccTiddlyAdaptor.serverParsingErrorMessage);
			if(context.callback)
				context.callback(context,context.userParams);
				return;
			}
			for (var i=0; i < workspaces.length; i++){
				context.workspaces.push({title:workspaces[i]})
			}
			context.status = true;
		}else{
				context.statusText = xhr.statusText;
		}
		if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.prototype.getTiddlerList = function(context,userParams,callback){
		context = this.setContext(context,userParams,callback);
		var uriTemplate = '%0/handle/listTiddlers.php?workspace=%1';
		var uri = uriTemplate.format([context.host,context.workspace]);
		var req = httpReq('GET', uri,ccTiddlyAdaptor.getTiddlerListCallback,context,{'accept':'application/json'});
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.getTiddlerListCallback = function(status,context,responseText,uri,xhr){
		context.status = false;
		context.statusText = ccTiddlyAdaptor.errorInFunctionMessage.format(['getTiddlerListCallback']);
		if(status){
			try{
				eval('var tiddlers=' + responseText);
			}catch (ex){
				context.statusText = exceptionText(ex,ccTiddlyAdaptor.serverParsingErrorMessage);
				if(context.callback)
					context.callback(context,context.userParams);
				return;
			}
			var list = [];
			for(var i=0; i < tiddlers.length; i++){
				var tiddler = new Tiddler(tiddlers[i]['title']);
				tiddler.fields['server.page.revision'] = tiddlers[i]['revision'];
				list.push(tiddler);
			}
			context.tiddlers = list;
			context.status = true;
		}else{
			context.statusText = xhr.statusText;
		}
		if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.prototype.generateTiddlerInfo = function(tiddler){
		var info ={};
		var host = this && this.host ? this.host : this.fullHostName(tiddler.fields['server.host']);
		var bag = tiddler.fields['server.bag']
		var workspace = tiddler.fields['server.workspace']
		var uriTemplate = '%0/%1/#%2';
		info.uri = uriTemplate.format([host,workspace,tiddler.title]);
		return info;
	};

	ccTiddlyAdaptor.prototype.getTiddlerRevision = function(title,revision,context,userParams,callback){
		context = this.setContext(context,userParams,callback);
		if(revision)
			context.revision = revision;
		return this.getTiddler(title,context,userParams,callback);
	};

	ccTiddlyAdaptor.prototype.getTiddler = function(title,context,userParams,callback){
		context = this.setContext(context,userParams,callback);
		if(title)
			context.title = title;
		   if(context.revision){
		         var uriTemplate = '%0/handle/revisionDisplay.php?title=%2&workspace=%1&revision=%3';
		  }else{
				var uriTemplate = '%0/handle/getTiddler.php?title=%2&workspace=%1';
		  }

		uri = uriTemplate.format([context.host,context.workspace,ccTiddlyAdaptor.normalizedTitle(title),context.revision]);
		context.tiddler = new Tiddler(title);
		context.tiddler.fields['server.type'] = ccTiddlyAdaptor.serverType;
		context.tiddler.fields['server.host'] = ccTiddlyAdaptor.minHostName(context.host);
		context.tiddler.fields['server.workspace'] = context.workspace;
		var req = httpReq('GET', uri,ccTiddlyAdaptor.getTiddlerCallback,context,{'accept':'application/json'});
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.getTiddlerCallback = function(status,context,responseText,uri,xhr){
	        context.status = false;
	        context.statusText = ccTiddlyAdaptor.errorInFunctionMessage.format(['getTiddlerCallback']);
	        if(status){
	                var info=[]
	                try{
	                    eval('info=' + responseText);
	                }catch (ex){
	                        context.statusText = exceptionText(ex,ccTiddlyAdaptor.serverParsingErrorMessage);
	                        if(context.callback)
	                                context.callback(context,context.userParams);
	                        return;
	                }
	                context.tiddler.text = info['text'];
					context.tiddler.tags = info['tags'].split(" ");
	                context.tiddler.fields['server.page.revision'] = info['server.page.revision'];
					context.tiddler.fields['server.id'] = info['id'];
					context.tiddler.fields = merge(info['fields'], context.tiddler.fields);
				    context.tiddler.modifier = info['modifier'];
	                context.tiddler.modified = Date.convertFromYYYYMMDDHHMM(info['modified']);
	                context.tiddler.created = Date.convertFromYYYYMMDDHHMM(info['created']);
	                context.status = true;
	        }else{
	                context.statusText = xhr.statusText;
	                if(context.callback)
	                        context.callback(context,context.userParams);
	                return;
	        }
	        if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.prototype.getTiddlerRevisionList = function(title,limit,context,userParams,callback){
		context = this.setContext(context,userParams,callback);
		context.title = title;
		context.revisions = [];
		var tiddler = store.fetchTiddler(title);
		var encodedTitle = encodeURIComponent(title);
		var uriTemplate = '%0/handle/revisionList.php?workspace=%1&title=%2';
		var host = this.fullHostName(this.host);
		var workspace = context.workspace ? context.workspace : tiddler.fields['server.workspace'];
		var uri = uriTemplate.format([host,workspace,encodedTitle]);
		var req = httpReq('GET', uri,ccTiddlyAdaptor.getTiddlerRevisionListCallback,context);
	};

	ccTiddlyAdaptor.getTiddlerRevisionListCallback = function(status,context,responseText,uri,xhr){
		if(responseText.indexOf('<!DOCTYPE html')==1)
			status = false;
		if(xhr.status=="204")
			status = false;
		context.status = false;
		if(status){
			var r =  responseText;
			if(r != '-' && r.trim() != 'revision not found'){
				var revs = r.split('\n');
				for(var i=0; i<revs.length; i++){
					var parts = revs[i].split(' ');
					if(parts.length>1){
						var tiddler = new Tiddler(context.title);
						tiddler.modified = Date.convertFromYYYYMMDDHHMM(parts[0]);
						tiddler.fields['server.page.revision'] = String(parts[1]);
						tiddler.modifier = String(parts[2]);
						tiddler.fields['server.host'] = ccTiddlyAdaptor.minHostName(context.host);
						tiddler.fields['server.type'] = ccTiddlyAdaptor.serverType;
						context.revisions.push(tiddler);
					}
				}
			}
			context.revisions.sort(function(a,b){return a.modified<b.modified?+1:-1;});
			context.status = true;
		}else{
			context.statusText = xhr.statusText;
		}
		if(context.callback)
			context.callback(context,context.userParams);
	};

	ccTiddlyAdaptor.prototype.putTiddler = function(tiddler,context,userParams,callback){
		context = this.setContext(context,userParams,callback);
		context.title = tiddler.title;
		if(window.location.search.substring(1))
			var postParams = window.location.search.substring(1);
		else
			var postParams = "";
		var recipeuriTemplate = '%0/handle/save.php';
		var host = context.host ? context.host : this.fullHostName(tiddler.fields['server.host']);
		var uri = recipeuriTemplate.format([host,context.workspace,tiddler.title]);
		var d = new Date();
		d.setTime(Date.parse(tiddler['modified']));
		d = d.convertToYYYYMMDDHHMM();

		//  SEO Code

		if(workspace)
		 	var breaker = "/";
		else
			var breaker = "";
		var el = createTiddlyElement(document.body, "div", "ccTiddlyTMP", null, null, { "style.display": "none" });
		el.style.display = "none";  // Just in case the above command is ignored
		var formatter = new Formatter(config.formatters);
		var wikifier = new Wikifier(tiddler.text,formatter,null,tiddler);
			wikifier.isStatic = true;
			wikifier.subWikify(el);
		delete formatter;
		var links = el.getElementsByTagName("a");
		for(var i = 0; i < links.length; i++) {
			var tiddlyLink = links[i].getAttribute("tiddlyLink");
		    if(tiddlyLink) {
		        if(hasClass(links[i], "tiddlyLinkNonExisting")) { // target tiddler does not exist
		            links[i].href = "#";
		        } else {
		            links[i].href = url+ workspace + breaker +tiddlyLink + ".html";
		        }
		    }
		}	
		// End SEO Code 

		var fieldString = "";
		for (var name in tiddler.fields){
			if (String(tiddler.fields[name]) && name != "server.page.revision" && name != "changecount")
				fieldString += name +"='"+tiddler.fields[name]+"' ";
		}
		if(!tiddler.fields['server.page.revision'])
			tiddler.fields['server.page.revision'] = 0;		
		else
			tiddler.fields['server.page.revision'] = parseInt(tiddler.fields['server.page.revision'],10);
		context.revision = tiddler.fields['server.page.revision'];
		if(!context.otitle)
			var otitle = tiddler.title;
		else
			var otitle = context.otitle;
		var payload = "workspace="+window.workspace+"&otitle="+encodeURIComponent(otitle)+"&title="+encodeURIComponent(tiddler.title) + "&modified="+tiddler.modified.convertToYYYYMMDDHHMM()+"&modifier="+tiddler.modifier + "&tags="+encodeURIComponent(tiddler.getTags())+"&revision="+encodeURIComponent(tiddler.fields['server.page.revision']) + "&fields="+encodeURIComponent(fieldString)+
	"&body="+encodeURIComponent(tiddler.text)+"&wikifiedBody="+encodeURIComponent(el.innerHTML)+"&id="+tiddler.fields['server.id']+"&"+postParams;
		var req = httpReq('POST', uri,ccTiddlyAdaptor.putTiddlerCallback,context,{'Content-type':'application/x-www-form-urlencoded', "Content-length": payload.length},payload,"application/x-www-form-urlencoded");
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.putTiddlerCallback = function(status,context,responseText,uri,xhr){
		
		if(xhr.status != 201){
			ccTiddlyAdaptor.handleError(xhr.status);
		}else{
			context.status = true;
			if(responseText!="") {
				context.tiddler.fields['server.id'] = responseText;
			}
			context.tiddler.fields['server.page.revision'] = context.revision + 1;
		}
		if(context.callback){
			context.callback(context,context.userParams);
		}
	};
	
	
	ccTiddlyAdaptor.center  = function(el){
		var size = this.getsize(el);
		el.style.left = (Math.round(findWindowWidth()/2) - (size.width /2) + findScrollX())+'px';
		el.style.top = (Math.round(findWindowHeight()/2) - (size.height /2) + findScrollY())+'px';
	}

	ccTiddlyAdaptor.getsize = function (el){
		var x ={};
		x.width = el.offsetWidth || el.style.pixelWidth;
		x.height = el.offsetHeight || el.style.pixelHeight;
		return x;
	}

	ccTiddlyAdaptor.showCloak = function(){
		var cloak = document.getElementById('backstageCloak');
		if (config.browser.isIE){
			cloak.style.height = Math.max(document.documentElement.scrollHeight,document.documentElement.offsetHeight);
			cloak.style.width = document.documentElement.scrollWidth;
		}
		cloak.style.display = "block";
	}

	ccTiddlyAdaptor.hideError = function(){
		var box = document.getElementById('errorBox');
		box.parentNode.removeChild(box);
		document.getElementById('backstageCloak').style.display = "";
	}

	ccTiddlyAdaptor.handleError = function(error_code){
		setStylesheet(
		"#errorBox .button{padding:0.5em 1em; border:1px solid #222; background-color:#ccc; color:black; margin-right:1em;}\n"+
		"html > body > #backstageCloak{height:100%;}"+
		"#errorBox{border:1px solid #ccc;background-color: #eee; color:#111;padding:1em 2em; z-index:9999;}",'errorBoxStyles');
		var box = document.getElementById('errorBox') || createTiddlyElement(document.body,'div','errorBox');
		var error = ccTiddlyAdaptor.errorTitleNotSaved;
		switch(error_code){
			case 401:
				error += ccTiddlyAdaptor.errorTextSessionExpired;
				break;
			case 409:
				error += "\n\n"+ccTiddlyAdaptor.errorTextConfig+"\n \n error code : "+error_code+" \n";
				break;

			default:
				error += ccTiddlyAdaptor.errorTextUnknown+"<br />"+error_code;
		}
		box.innerHTML = " <a style='float:right' href='javascript:onclick=ccTiddlyAdaptor.hideError()'>"+ccTiddlyAdaptor.errorClose+"</a><p>"+error+"</p><br/><br/>";
		createTiddlyButton(box,ccTiddlyAdaptor.buttonOpenNewWindow,null,function(e){ window.open (window.location,"mywindow");	 return false;});
		createTiddlyElement(box,"br");
		createTiddlyElement(box,"br");
		createTiddlyButton(box,ccTiddlyAdaptor.buttonHideThisMessage,null,function(){ccTiddlyAdaptor.hideError();});
		box.style.position = 'absolute';
		ccTiddlyAdaptor.center(box);
		ccTiddlyAdaptor.showCloak();
	}

	ccTiddlyAdaptor.prototype.deleteTiddler = function(title,context,userParams,callback){	
		context = this.setContext(context,userParams,callback);
		context.title = title;
		title = encodeURIComponent(title);
		var uri = tiddler.fields['server.host']+'/handle/delete.php'
		var data = "workspace="+workspace+"&title="+title;
		
		var req = httpReq('POST', uri,ccTiddlyAdaptor.deleteTiddlerCallback,context, null, data);
		return typeof req == 'string' ? req : true;
	};

	ccTiddlyAdaptor.deleteTiddlerCallback = function(status,context,responseText,uri,xhr){
		if(status){
			context.status = true;
		}else{
			context.status = false;
			context.statusText = xhr.statusText;
		}
		if(context.callback)
			context.callback(context,context.userParams);
	};

	config.adaptors[ccTiddlyAdaptor.serverType] = ccTiddlyAdaptor;
//}}}


//}}}

// ccFile //


//{{{
	
config.macros.ccFile = {};
var iFrameLoad=function(w){
	var uploadIframe = document.getElementById('uploadIframe');
	var a = createTiddlyElement(null, "div");
	a.innerHTML = uploadIframe.contentDocument.body.innerHTML;
	removeChildren(w.formElem.placeholder);
	w.formElem.placeholder.parentNode.appendChild(a);
	var statusArea = w.formElem.placeholder;
	document.getElementById("ccfile").value=""; 
};

config.macros.ccFile.handler=function(place,macroName,params,wikifier,paramString,tiddler, errorMsg){
	var w = new Wizard();
	w.createWizard(place,config.macros.ccFile.wizardTitleText);
	config.macros.ccFile.refresh(w);
};

config.macros.ccFile.refresh=function(w){
	params = {};
	params.w = w;
	params.e = this;
	var me = config.macros.ccFile;
	doHttp('GET',url+'/handle/listFiles.php?workspace='+workspace,'',null,null,null,config.macros.ccFile.listAllCallback,params);
	w.setButtons([
		{caption: me.buttonDeleteText, tooltip: me.buttonDeleteTooltip, onClick: function(w){ 
			config.macros.ccFile.delFileSubmit(null, params);
			 return false;
		}}, 
		{caption: me.buttonUploadText, tooltip: me.buttonUploadTooltip, onClick: function(e){ 
			config.macros.ccFile.addFileDisplay(null, params); return false 
			} }
	]);
};

config.macros.ccFile.delFileSubmit=function(e, params) {
	var listView = params.w.getValue("listView");
	var rowNames = ListView.getSelectedRows(listView);
	for(var e=0; e < rowNames.length; e++) 
	doHttp('POST',url+'/handle/listFiles.php','action=DELETEFILE&file='+rowNames[e]+'&workspace='+workspace,null,null,null,config.macros.ccFile.delFileCallback,params);
	return false; 
};

config.macros.ccFile.delFileCallback=function(status,params,responseText,uri,xhr){
	config.macros.ccFile.refresh(params.w);
};

config.macros.ccFile.addFileDisplay = function(e, params){
	var frm = params.w.formElem;
	if(navigator.appName=="Microsoft Internet Explorer"){
		encType = frm.getAttributeNode("enctype");
	    encType.value = "multipart/form-data";
	}
	frm.setAttribute("enctype","multipart/form-data");
	frm.setAttribute("method","POST");
	frm.action=window.url+"/handle/upload.php"; 
	frm.id="ccUpload";
	frm.target="uploadIframe";
	frm.name = "uploadForm";
	frm.parentNode.appendChild(frm);
	params.w.addStep("ss", "<input id='ccfile' class='input' type='file' name='userFile'/>"+"<input type='hidden' name='placeholder'/>");
	var workspaceName=createTiddlyElement(null,'input','workspaceName','workspaceName');				
	workspaceName .setAttribute('name','workspace');
	workspaceName.type="HIDDEN";
	workspaceName.value=workspace;
	frm.appendChild(workspaceName);
	createTiddlyElement(frm,'br');
	var saveTo=createTiddlyElement(null,"input","saveTo","saveTo");	
	var iframe=document.createElement("iframe");
	iframe.style.display="none";
	iframe.id='uploadIframe';
	iframe.name='uploadIframe';
	iframe.onload = function() {
		iFrameLoad(params.w);
	}	
	frm.appendChild(iframe);
	createTiddlyElement(frm,"div",'uploadStatus');
	params.w.setButtons([
	{caption: config.macros.ccFile.buttonCancelText, tooltip: config.macros.ccFile.buttonCancelTooltip, onClick: function(){config.macros.ccFile.refresh(params.w);}
	},
	{caption: config.macros.ccFile.buttonUploadText, tooltip: config.macros.ccFile.buttonUploadTooltip, onClick: function(){params.w.formElem.submit();}
	}]);
};

function addOption(selectbox,text,value ){
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

config.macros.ccFileImageBox = function(image){
	var full = image.src;
	setStylesheet(
	"#errorBox .button {padding:0.5em 1em; border:1px solid #222; background-color:#ccc; color:black; margin-right:1em;}\n"+
	"html > body > #backstageCloak {height:"+window.innerHeight*2+"px;}"+
	"#errorBox {border:1px solid #ccc;background-color: #fff; color:#111;padding:1em 2em; z-index:9999;}",'errorBoxStyles');
	var box = document.getElementById('errorBox') || createTiddlyElement(document.body,'div','errorBox');
	box.innerHTML =  "<a style='float:right' href='javascript:onclick=ccTiddlyAdaptor.hideError()'>"+ccTiddlyAdaptor.errorClose+"</a><h3>"+image.src+"</h3><br />";
	box.style.position = 'absolute';
	box.style.width= "800px";
	var img = createTiddlyElement(box, "img");
	img.src = full;
	ccTiddlyAdaptor.center(box);
	ccTiddlyAdaptor.showCloak();
}

config.macros.ccFile.listAllCallback = function(status,params,responseText,uri,xhr){
	var me = config.macros.ccFile;
	var out = "";
	var adminUsers = [];
	if(xhr.status!=200){
		params.w.addStep(me.errorPermissionDeniedTitle, me.errorPermissionDeniedView);
		return true;
	}
	try{
		var a = eval(responseText);
		for(var e=0; e < a.length; e++){ 		
		out += a[e].username;	
			adminUsers.push({
				htmlName: "<html><a href='"+a[e].url+"' target='new'>"+a[e].filename+"</a></html>",
				name: a[e].filename,
				wikiText:'<html><img onclick="config.macros.ccFileImageBox(this)"; src="'+a[e].url+'" style="width: 70px; "/></html>',
				URI:a[e].url,
				lastVisit:a[e].lastVisit,
				fileSize:a[e].fileSize
			});
		}
	}catch (ex){
		params.w.setButtons([
			{caption: me.buttonUploadText, tooltip: me.buttonUploadTooltip, onClick: function(w){				
				config.macros.ccFile.addFileDisplay(e, params);
			} }]);
	}
	params.w.addStep(me.wizardStepText+workspace, "<input type='hidden' name='markList'></input>");
	var markList = params.w.getElement("markList");
	var listWrapper = document.createElement("div");
	markList.parentNode.insertBefore(listWrapper,markList);
	var listView = ListView.create(listWrapper,adminUsers,config.macros.ccFile.listAdminTemplate);
	//params.w.setValue("listAdminView",listAdminView);
	params.w.setValue("listView",listView);
};

config.macros.ccFile.addFileCallback = function(status,params,responseText,uri,xhr){	
	config.macros.ccFile.refresh(params.w);
};

//}}}

// ccStats //

//{{{
	
config.macros.ccStats={};	
	
config.macros.ccStats.handler = function(place,macroName,params,wikifier,paramString,tiddler){
	var params;
	params.place = place;
	doHttp('POST',url+'/handle/workspaceAdmin.php','action=LISTWORKSPACES',null,null,null,config.macros.ccStats.listWorkspaces,params);
}

config.macros.ccStats.simpleEncode = function(valueArray,maxValue){
	var simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
	var chartData = ['s:'];
	  for (var i = 0; i < valueArray.length; i++){
	    var currentValue = valueArray[i];
	    if (!isNaN(currentValue) && currentValue >= 0){
	    	chartData.push(simpleEncoding.charAt(Math.round((simpleEncoding.length-1) * currentValue / maxValue)));
	    }else{
	      chartData.push('_');
	    }
	  }
	return chartData.join('');
}

config.macros.ccStats.max = function(array){
	return Math.max.apply(Math, array);
}

config.macros.ccStats.dataCallback = function(status,params,responseText,uri,xhr){
	me = config.macros.ccStats;
	if(xhr.status==401){
		createTiddlyElement(params.container, "h4", null, null, me.errorPermissionDenied.format([params.title], [workspace]));
		return false;
	}
	var res = eval("[" + responseText + "]");
	var d=[];
	var l="";
	for(var c=0; c<res.length; c++){
		d[c]= res[c].hits;
		l+=res[c].date+"|";
	}
	var maxValue = config.macros.ccStats.max(d);
 	params.gData = config.macros.ccStats.simpleEncode(d,maxValue);
	params.XLabel = l.substring(0, l.length -1);
	params.YLabel = "0|"+maxValue+"|";
	var image = 'http://chart.apis.google.com/chart?cht=lc&chs=100x75&chd='+params.gData+'&chxt=x,y&chxl=0:||1:|';
	var div = createTiddlyElement(params.container, "div", null, "div_button");
	setStylesheet(".div_button:hover{opacity:0.7; cursor: pointer} .div_button{ width:100%; padding:5px;color:#555;background-color:white;} ", "DivButton");
	div.onclick = function(){
		var full = "http://chart.apis.google.com/chart?cht=lc&chs=800x375&chd="+params.gData+"&chxt=x,y&chxl=1:|"+params.YLabel+"0:|"+params.XLabel+"&chf=c,lg,90,EEEEEE,0.5,ffffff,20|bg,s,FFFFFF&&chg=10.0,10.0&";
		setStylesheet(
		"#errorBox .button{padding:0.5em 1em; border:1px solid #222; background-color:#ccc; color:black; margin-right:1em;}\n"+
		"html > body > #backstageCloak{height:"+window.innerHeight*2+"px;}"+
		"#errorBox{border:1px solid #ccc;background-color: #fff; color:#111;padding:1em 2em; z-index:9999;}",'errorBoxStyles');
		var box = document.getElementById('errorBox') || createTiddlyElement(document.body,'div','errorBox');
		box.innerHTML =  "<a style='float:right' href='javascript:onclick=ccTiddlyAdaptor.hideError()'>"+ccTiddlyAdaptor.errorClose+"</a><h3>"+params.title+"</h3><br />";
		box.style.position = 'absolute';
		box.style.height= "460px";
		box.style.width= "800px";
		var img = createTiddlyElement(box, "img");
		img.src = full;
		ccTiddlyAdaptor.center(box);
		ccTiddlyAdaptor.showCloak();
	}
	var img = createTiddlyElement(div, "h2", null, null, params.title);
	var img = createTiddlyElement(div, "img");
	img.src = image;
	var span = createTiddlyElement(div, "div", null, "graph_label", params.desc);
	setStylesheet(".graph_label{  position:relative; width:300px; top:-80px; left:130px;}");
}

config.macros.ccStats.switchWorkspace = function(params){
	removeChildren(params.container);
	config.macros.ccStats.refresh(params);	
}

config.macros.ccStats.refresh = function(params){
	var me = config.macros.ccStats;
	var select = params.w.formElem.workspaces;
	if(select[select.selectedIndex].value!="")
		workspace = select[select.selectedIndex].value;
	params ={ container: params.container, url: window.url+"/handle/stats.php?graph=minute&workspace="+workspace,title:me.graph20MinsTitle, desc:me.graph20MinsDesc};
	doHttp('GET',params.url,null, null, null, null, config.macros.ccStats.dataCallback,params);
	params ={ container:params.container, url:  window.url+"/handle/stats.php?graph=hour&workspace="+workspace,title:me.graph24HourTitle, desc:me.graph24HourDesc};
	doHttp('GET',params.url,null, null, null, null, config.macros.ccStats.dataCallback,params);
	params ={ container: params.container, url:  window.url+"/handle/stats.php?graph=day&workspace="+workspace,title:me.graph7DaysTitle, desc:me.graph7DaysDesc};
	doHttp('GET',params.url,null, null, null, null, config.macros.ccStats.dataCallback,params);
	params ={ container: params.container, url:  window.url+"/handle/stats.php?graph=month&workspace="+workspace,title:me.graph5MonthsTitle, desc:me.graph5MonthsDesc};
	doHttp('GET',params.url,null, null, null, null, config.macros.ccStats.dataCallback,params);	
}

config.macros.ccStats.listWorkspaces = function(status,params,responseText,uri,xhr){
	params.container=createTiddlyElement(null, "div", "container");
	var me = config.macros.ccStats;
	var w = new Wizard();
	w.createWizard(params.place,me.stepTitle);
	w.addStep(null, "<select name='workspaces'></select><input name='stats_hol' type='hidden'></input>");
	var s = w.formElem.workspaces;	
	s.onchange = function(){config.macros.ccStats.switchWorkspace(params) ;};
	var workspaces = eval('[ '+responseText+' ]');
	for(var d=0; d < workspaces.length; d++){
		var i = createTiddlyElement(s,"option",null,null,workspaces[d]);
		i.value = workspaces[d];
		if (workspace == workspaces[d]){
			i.selected = true;
		}
	}
	params.w = w; 
	w.formElem.stats_hol.parentNode.appendChild(params.container);
	config.macros.ccStats.refresh(params);
}
//}}}
//{{{

config.macros.ccCreateWorkspace = {};

config.macros.ccCreateWorkspace.setStatus=function(w,element,text){
	var label_var = w.getElement(element);
	removeChildren(label_var.previousSibling);
	var label = document.createTextNode(text);
	label_var.previousSibling.insertBefore(label,null);
}

config.macros.ccCreateWorkspace.workspaceNameKeyPress=function(w){
	params={};
	params.w = w;
	doHttp('POST',url+'/handle/lookupWorkspaceName.php',"ccWorkspaceLookup="+w.formElem["workspace_name"].value+"&free=1",null,null,null,config.macros.ccCreateWorkspace.workspaceNameCallback,params);	
	return false;
};
 	
config.macros.ccCreateWorkspace.workspaceNameCallback=function(status,params,responseText,uri,xhr){
	var me = config.macros.ccCreateWorkspace;
	if(responseText > 0){{
			config.macros.register.setStatus(params.w, "workspace_error", me.errorWorkspaceNameInUse);
			config.macros.register.setStatus(params.w, "workspace_url", "");
	}}else{
		config.macros.register.setStatus(params.w, "workspace_error", me.msgWorkspaceAvailable);
		if (window.useModRewrite == 1)
			config.macros.register.setStatus(params.w, "workspace_url", url+''+params.w.formElem["workspace_name"].value);			 
		else
			config.macros.register.setStatus(params.w, "workspace_url", url+'?workspace='+params.w.formElem["workspace_name"].value);
	}
};

config.macros.ccCreateWorkspace.handler =  function(place,macroName,params,wikifier,paramString,tiddler, errorMsg){
	if (window.workspacePermission.canCreateWorkspace!=1) {
		createTiddlyElement(place,'div', null, "annotation",  config.macros.ccCreateWorkspace.errorPermissions);
		return null;
	}
	var me = config.macros.ccCreateWorkspace;
	var w = new Wizard();
	w.createWizard(place,me.wizardTitle);
	if(config.macros.ccCreateWorkspace.createWorkspaceAdvanced)
		me.stepCreateHtml += config.macros.ccCreateWorkspace.createWorkspaceAdvanced();

	w.addStep(me.stepTitle, me.stepCreateHtml);
	w.formElem["workspace_name"].onkeyup=function() {me.workspaceNameKeyPress(w);};
	w.formElem.onsubmit = function() { config.macros.ccCreateWorkspace.createWorkspaceOnSubmit(w);  return false;};
	w.setButtons([
		{caption: me.buttonCreateWorkspaceText, tooltip: me.buttonCreateWorkspaceTooltip, onClick:function(){config.macros.ccCreateWorkspace.createWorkspaceOnSubmit(w);}
	}]);
};

config.macros.ccCreateWorkspace.createWorkspaceOnSubmit = function(w){
	var params = {}; 
	params.w = w;	
	if(window.useModRewrite == 1)
		params.url = url+w.formElem["workspace_name"].value; 
	else
		params.url = url+'?workspace='+w.formElem["workspace_name"].value;
	var loginResp = doHttp('POST',url+'?&workspace='+w.formElem["workspace_name"].value+"/",'&ccCreateWorkspace=' + encodeURIComponent(w.formElem["workspace_name"].value)+'&amp;ccAnonPerm='+encodeURIComponent("AADD"),null,null,null,config.macros.ccCreateWorkspace.createWorkspaceCallback,params);
	return false; 
};

config.macros.ccCreateWorkspace.createWorkspaceCallback = function(status,params,responseText,uri,xhr) {
	if(xhr.status==201){
		params.w.addStep("Please wait", "This could take afew minutes depending on your internet connection.<img src='http://www.ajaxload.info/cache/FF/FF/FF/00/00/00/37-0.gif'/>"+"<br/><br/><input width='300' name='statusMarker'/>");
		params.w.setButtons([]);
		if(params.selectedPackage) {
	   		var url = store.getTiddlerSlice(params.selectedPackage,'URL');
			loadRemoteFile(url,config.macros.ccCreateWorkspace.fetchFileCallback ,params);
		} else {
			window.location = params.url;
		}
	}else if(xhr.status == 200){
		displayMessage(config.macros.ccCreateWorkspace.errorWorkspaceNameInUse);
	}else if(xhr.status == 403){
		displayMessage(config.macros.ccCreateWorkspace.errorPermissions);	
	}else{
			displayMessage("sd"+responseText);	
	}
};

//}}}


// ccEditWorkspace //


//{{{
config.macros.ccEditWorkspace={};			
config.macros.ccEditWorkspace.handler = function(place, macroName, params, wikifier, paramString, tiddler){
	var me = config.macros.ccEditWorkspace;
	if(workspacePermission.owner !=1){
		createTiddlyElement(place,'div', null, "annotation",  me.errorTextPermissionDenied);
		return null;
	}
	var w = new Wizard();
	w.createWizard(place, this.WizardTitleText);
	var booAdmin = false;
	var booUser = false;
	var booAnon = false;
	// Check which colums to display
	for(i = 0; i <= params.length - 1; i++){
		switch (params[i].toLowerCase()) {
			case 'admin':
				booAdmin = true;
				break;
			case 'user':
				booUser = true;
				break;
			case 'anon':
				booAnon = true;
				break;
		}
	}
	// if nothing passed show all
	if(!booAdmin && !booUser && !booAnon){
		booAdmin = true;
		booUser = true;
		booAnon = true;
	}
	var tableBodyBuffer = new Array();
	tableBodyBuffer.push('<table border=0px class="listView twtable">');
	tableBodyBuffer.push('<tr">');
	tableBodyBuffer.push('<th>' + this.stepLabelPermission + '</th>');
	if(booAnon){
		tableBodyBuffer.push('<th>' + this.stepLabelAnon + '</th>');
	}
	if(booUser){
		tableBodyBuffer.push('<th>' + this.stepLabelUser + '</th>');
	}
	if(booAdmin){
		tableBodyBuffer.push('<th>' + this.stepLabelAdmin + '</th>');
	}
	tableBodyBuffer.push('</tr>');
	tableBodyBuffer.push('<tr>')
	tableBodyBuffer.push('<th align="right">'+this.stepLabelRead+'</th>');
	if(booAnon){
		tableBodyBuffer.push('<td><input name="anR" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.anonR == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booUser){
		tableBodyBuffer.push('<td><input name="usR" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.userR == 1 ? 'checked' : '');
		tableBodyBuffer.push('></input></td>');
	}
	if(booAdmin){
		tableBodyBuffer.push('<td><input name="adR" class="checkInput" type="checkbox" checked disabled></input></td>');
	}
	tableBodyBuffer.push('</tr>');
	tableBodyBuffer.push('<tr>');
	tableBodyBuffer.push('<th  align="right">' + this.stepLabelCreate + '</th>');
	if(booAnon){
		tableBodyBuffer.push('<td><input name="anC" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.anonC == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booUser){
		tableBodyBuffer.push('<td><input name="usC" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.userC == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booAdmin){
		tableBodyBuffer.push('<td><input name="adC" class="checkInput" type="checkbox" checked disabled></input></td>');
	}
	tableBodyBuffer.push('</tr>');
	tableBodyBuffer.push('<tr>');
	tableBodyBuffer.push('<th  align="right">' + this.stepLabelUpdate + '</th>');
	if(booAnon){
		tableBodyBuffer.push('<td><input name="anU" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.anonU == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booUser){
		tableBodyBuffer.push('<td><input name="usU" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.userU == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booAdmin){
		tableBodyBuffer.push('<td><input name="adU" class="checkInput" type="checkbox" checked disabled></input></td>');
	}
	tableBodyBuffer.push('</tr>');
	tableBodyBuffer.push('<tr>');
	tableBodyBuffer.push('<th  align="right">' + this.stepLabelDelete + '</th>');
	if(booAnon){
		tableBodyBuffer.push('<td><input name="anD" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.anonD == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booUser){
		tableBodyBuffer.push('<td><input name="usD" class="checkInput" type="checkbox" ');
		tableBodyBuffer.push(workspacePermission.userD == 1 ? 'checked' : '');
		tableBodyBuffer.push(' ></input></td>');
	}
	if(booAdmin){
		tableBodyBuffer.push('<td><input name="adD" class="checkInput" type="checkbox" checked disabled></input></td>');
	}
	tableBodyBuffer.push('</tr>');
	tableBodyBuffer.push('</table>');
	var stepHTML = tableBodyBuffer.join('');
	w.addStep(this.stepEditTitle,stepHTML);
	w.setButtons([
		{caption: this.buttonSubmitCaption, tooltip: this.buttonSubmitToolTip, onClick: function() {me.ewSubmit(place, macroName, params, wikifier, paramString, tiddler,w,booAnon,booUser);}
	}]);

};

config.macros.ccEditWorkspace.ewSubmit = function(place, macroName, params2, wikifier, paramString, tiddler,w, booAnon, booUser){
	var trueStr = "A";
	var falseStr = "U";
	var anon = '';
	var user = '';
	if(booAnon){
		var anonBuffer = new Array();
		anonBuffer.push(w.formElem['anR'].checked ? trueStr : falseStr);
		anonBuffer.push(w.formElem['anC'].checked ? trueStr : falseStr);
		anonBuffer.push(w.formElem['anU'].checked ? trueStr : falseStr);
		anonBuffer.push(w.formElem['anD'].checked ? trueStr : falseStr);
		anon = anonBuffer.join('');
	}
	if(booUser){
		var userBuffer = new Array();
		userBuffer.push(w.formElem['usR'].checked ? trueStr : falseStr);
		userBuffer.push(w.formElem['usC'].checked ? trueStr : falseStr);
		userBuffer.push(w.formElem['usU'].checked ? trueStr : falseStr);
		userBuffer.push(w.formElem['usD'].checked ? trueStr : falseStr);
		user = userBuffer.join('');
	}
	var params = new Array();
	params.w = w;
	params.u = user;
	params.a = anon;
	params.p = place;
	params.m =  macroName;
	params.pr = params2;
	params.wi = wikifier;
	params.ps = paramString;
	params.t = tiddler;
	doHttp('POST', url + '/handle/updateWorkspace.php', 'ccCreateWorkspace=' + encodeURIComponent(workspace) + '&ccAnonPerm=' + encodeURIComponent(anon) + '&ccUserPerm=' + encodeURIComponent(user), null, null, null, config.macros.ccEditWorkspace.editWorkspaceCallback, params);
	return false;
}
config.macros.ccEditWorkspace.editWorkspaceCallback = function(status,params,responseText,uri,xhr){
	var w = params.w;
	var me = config.macros.ccEditWorkspace;
	if(xhr.status == 200){
		// use the incoming parameters to set the workspace permission variables.
		if (params.a != ''){
			workspacePermission.anonR = (params.a.substr(0,1)=='A'?1:0);
			workspacePermission.anonC = (params.a.substr(1,1)=='A'?1:0);
			workspacePermission.anonU = (params.a.substr(2,1)=='A'?1:0);
			workspacePermission.anonD = (params.a.substr(3,1)=='A'?1:0);
		}
		if (params.u != ''){
			workspacePermission.userR = (params.u.substr(0,1)=='A'?1:0);
			workspacePermission.userC = (params.u.substr(1,1)=='A'?1:0);
			workspacePermission.userU = (params.u.substr(2,1)=='A'?1:0);
			workspacePermission.userD = (params.u.substr(3,1)=='A'?1:0);
		}
		w.addStep('',responseText);
		// want to set a back button here
		w.setButtons([
			{caption: me.button1SubmitCaption, tooltip: me.button1SubmitToolTip, onClick: function() {config.macros.ccEditWorkspace.refresh(params.p,	params.m,	params.pr,	params.wi,	params.ps,	params.t);}}
		]);
	}else{
		w.addStep(me.step2Error+': ' + xhr.status,config.macros.ccEditWorkspace.errorUpdateFailed);
	}
	return false;
};
config.macros.ccEditWorkspace.refresh = function(place, macroName, params, wikifier, paramString, tiddler){
	removeChildren(place);
	config.macros.ccEditWorkspace.handler(place, macroName, params, wikifier, paramString, tiddler);
}
//}}}

// ccLogin //

//{{{

config.macros.ccLogin={sha1:true};
	
function isLoggedIn() {
	if(window.loggedIn)
	 	return true;
	else 
		return false;
}

config.macros.saveChanges.handler=function(place,macroName,params,wikifier,paramString,tiddler){
	if(isLoggedIn()){
		createTiddlyButton(place, config.macros.ccLogin.buttonLogout, config.macros.ccLogin.buttonLogoutToolTip, function(){
				if (window.fullUrl.indexOf("?") >0)
					window.location = window.fullUrl+"&logout=1";
				else
					window.location = window.fullUrl+"?logout=1";
			return false;
		},null,null,this.accessKey);
	}else{
		createTiddlyButton(place,config.macros.ccLogin.buttonlogin, config.macros.ccLogin.buttonLoginToolTip, function() {
			story.displayTiddler(null, "Login");
		},null,null,this.accessKey);
	}
};

var loginState=null;
var registerState=null;

config.macros.ccLogin.handler=function(place,macroName,params,wikifier,paramString,tiddler){
	var params = paramString.parseParams('reload',null,true);
	config.macros.ccLogin.refresh(place, params[0].reload);
};
 
config.macros.ccLogin.refresh=function(place, reload, error){
	removeChildren(place);
	var w = new Wizard();
	if (isLoggedIn()){
		w.createWizard(place,this.stepLogoutTitle);
		w.addStep(null, this.stepLogoutText+decodeURIComponent(cookieString(document.cookie).txtUserName)+"<br /><br />");
		w.setButtons([
			{caption: this.buttonLogout, tooltip: this.buttonLogoutToolTip, onClick: function() {window.location=fullUrl+"?&logout=1"}
		}]);
		return true;
	}
	w.createWizard(place,this.WizardTitleText);
	w.setValue('reload', reload);


	var me=config.macros.ccLogin;
	var oldForm = w.formElem.innerHTML;
	var form = w.formElem;
	if (error!==undefined)
		this.stepLoginTitle=error;	
	w.addStep(this.stepLoginTitle,me.stepLoginIntroTextHtml);
	txtPassword = w.formElem.txtPassword;
	w.formElem.password.style.display="none";
	txtPassword.onkeyup = function() {
		if(me.sha1 == true){
			w.formElem.password.value = Crypto.hexSha1Str(w.formElem.txtPassword.value);
		} else { 
			w.formElem.password.value = w.formElem.txtPassword.value;
		}
	};
	txtPassword.onchange = txtPassword.onkeyup;
	w.formElem.method ="POST";
	w.formElem.onsubmit = function() {config.macros.ccLogin.doLogin(w.formElem["username"].value, w.formElem["password"].value, this, place); return false;};
	var submit = createTiddlyElement(null, "input");
	submit.type="submit";
	submit.style.display="none";
	w.formElem.appendChild(submit);
	var cookieValues=findToken(document.cookie);
	if (cookieValues.txtUserName!==undefined){
		w.formElem["username"].value=decodeURIComponent(cookieValues.txtUserName) ;
	}
	var footer = findRelated(form,"wizardFooter","className");
	createTiddlyButton(w.footer,this.buttonLogin,this.buttonLoginToolTip,function() {
		if (w.formElem["username"].value==""){
			displayMessage(me.msgNoUsername);
			return false;
		}
		if (w.formElem["password"].value==""){
			displayMessage(me.msgNoPassword);
			return false;
		}
		config.macros.ccLogin.doLogin(w.formElem["username"].value, w.formElem["password"].value, this, place);
	});
	
	
	createTiddlyButton(w.footElem,this.buttonLogin,this.buttonLoginToolTip,function() {
		config.macros.ccLogin.doLogin(w.formElem["username"].value, w.formElem["password"].value, this, place);
	},null, null, null,  {tabindex:'3'});

	if(config.macros.register!==undefined){		
		var li_register = createTiddlyElement(w.footElem, "li");
		createTiddlyButton(li_register,config.macros.register.buttonRegister,config.macros.register.buttonRegisterToolTip,function() {
				config.macros.register.displayRegister(place, w, this);
		},"nobox", null, null,  {tabindex:4});
	}
	var li_forgotten = createTiddlyElement(w.footElem, "li");
	createTiddlyButton(li_forgotten,this.buttonForgottenPassword,this.buttonForgottenPasswordToolTip,function() {
		config.macros.ccLogin.displayForgottenPassword(this, place);
	},"nobox", null, null,  {tabindex:5});

};

config.macros.ccLogin.doLogin=function(username, password, item, place){
	var w = new Wizard(item);
	var me = config.macros.ccLogin;
	var userParams = {};
	userParams.place = place;
	var adaptor = new config.adaptors[config.defaultCustomFields['server.type']];
	var context = {};
	context.reload = w.getValue("reload");
	context.host = window.url;
	context.username = username;
	context.password = password;
	adaptor.login(context,userParams,config.macros.ccLogin.loginCallback)
	var html = me.stepDoLoginIntroText; 
	w.addStep(me.stepDoLoginTitle,html);
	w.setButtons([
		{caption: this.buttonCancel, tooltip: this.buttonCancelToolTip, onClick: function() {config.macros.ccLogin.refresh(place);}
	}]);
}

config.macros.ccLogin.loginCallback=function(context,userParams){

	if(!context.status)
	{
		config.macros.ccLogin.refresh(userParams.place, config.macros.ccLogin.msgLoginFailed);
	}else{
		if(context.reload=="false"){
				window.loggedIn = true;
				var $ = jQuery;
				story.refreshTiddler(story.findContainingTiddler(userParams.place).id.replace("tiddler", ""), null, true);			
		}else{
							window.location.reload();	
		}
	}	 
};

config.macros.ccLogin.displayForgottenPassword=function(item, place){	
	var w = new Wizard(item);
	var me = config.macros.ccLogin;
	w.addStep(me.stepForgotPasswordTitle,me.stepForgotPasswordIntroText);
	w.setButtons([
		{caption: this.buttonCancel, tooltip: this.buttonCancelToolTip, onClick: function() {me.refresh(place);}}
	]);
};

//config.macros.ccLogin.sendForgottenPassword=function(item, place){	
//	var w = new Wizard(item);
//	var me = config.macros.ccLogin;
//}

config.macros.toolbar.isCommandEnabled=function(command,tiddler){	
	var title=tiddler.title;
	if (workspace_delete=="D"){
		// REMOVE OPTION TO DELETE TIDDLERS 
		if (command.text=='delete')
			return false;
	}
	if (workspace_udate=="D"){
		// REMOVE EDIT LINK FROM TIDDLERS 
		if (command.text=='edit')
			return false;
	}
	var ro=tiddler.isReadOnly();
	var shadow=store.isShadowTiddler(title) && !store.tiddlerExists(title);
	return (!ro || (ro && !command.hideReadOnly)) && !(shadow && command.hideShadow);
};

// Returns output var with output.txtUsername and output.sessionToken
function findToken(cookieStash){
	var output={};
	if (!cookieStash)
		return false;	
	//  THIS IS VERY HACKY AND SHOULD BE REFACTORED WHEN TESTS ARE IN PLACE
	var cookies=cookieStash.split('path=/');
	for(var c=0; c < cookies.length ; c++){
		var cl =cookies[c].split(";");
		for(var e=0; e < cl.length; e++){ 
			var p=cl[e].indexOf("=");
			if(p!=-1){
				var name=cl[e].substr(0,p).trim();
				var value=cl[e].substr(p+1).trim();       
				if (name=='txtUserName'){
					output.txtUserName=value;
				}
				if (name=='sessionToken'){
					output.sessionToken=value;
				}
			}
		}
	}	
	return output;
};

function cookieString(str){	
	var cookies = str.split(";");
	var output = {};
	for(var c=0; c < cookies.length; c++){
		var p = cookies[c].indexOf("=");
		if(p != -1) {
			var name = cookies[c].substr(0,p).trim();
			var value = cookies[c].substr(p+1).trim();
			if (name=='txtUserName'){
				output.txtUserName=value;
			}
			if (name=='sessionToken'){
				output.sessionToken=value;
			}
		}
	}
	return output;
}


//}}}
// ccLoginStatus //

//{{{


config.macros.ccLoginStatus={};
	
config.macros.ccLoginStatus.handler=function(place,macroName,params,wikifier,paramString,tiddler){
	var loginDiv=createTiddlyElement(place,"div",null,"loginDiv",null);
	this.refresh(loginDiv);
};
	
config.macros.ccLoginStatus.refresh=function(place,errorMsg){
       var me = config.macros.ccLoginStatus;
       var loginDivRef=document.getElementById ("LoginDiv");
       removeChildren(loginDivRef);
       var wrapper=createTiddlyElement(place,"div");
       var str = (workspace == "" ? me.textDefaultWorkspaceLoggedIn :(me.textViewingWorkspace+workspace))+"\r\n\r\n";
       if (isLoggedIn()){
			name = cookieString(document.cookie).txtUserName;
			str += me.textLoggedInAs+decodeURIComponent(name)+".\r\n\r\n";
			if (workspacePermission.owner==1){
				str += me.textAdmin;
			}
       }else{
               str += me.textNotLoggedIn;
       }
       wikify(str,wrapper);
};
//}}}

// ccOptions //
//{{{
config.macros.ccOptions={};		
config.macros.ccOptions.handler=function(place,macroName,params,wikifier,paramString,tiddler){
	var me = config.macros.ccOptions;
	if(workspacePermission.owner==1)
		wikify("[["+me.linkManageUsers+"|Manage Users]]<br />[["+me.linkPermissions+"|Permissions]]<br />[["+me.linkStats+"|Statistics]]<br />", place);
	if (isLoggedIn())
		wikify("[["+me.linkFiles+"|files]]<br />", place);
		if (isLoggedIn()){
			if (workspacePermission.canCreateWorkspace==1)
				wikify("[["+me.linkCreate+"|CreateWorkspace]]<br />", place);
			// append url function required 
			wikify("[["+me.linkPassword+"|Password]]<br />", place);
			if (window.fullUrl.indexOf("?") >0)
				wikify("[["+me.linkOffline+"|"+fullUrl+"&standalone=1]]<br />", place);
			else 
				wikify("[["+me.linkOffline+"|"+fullUrl+"?standalone=1]]<br />", place);	
		}
};

//}}}
// ccRegister //

//{{{
config.macros.register={};	
	
config.macros.register.handler=function(place,macroName,params,wikifier,paramString,tiddler){
	//config.macros.login.refresh(place);
};

config.macros.register.displayRegister=function(place, w, item){
	var me = config.macros.register;
	var w = new Wizard(item);
	w.addStep(me.stepRegisterTitle, me.stepRegisterHtml);
	w.formElem["reg_username"].onkeyup=function() {me.isUsernameAvailable(w);};
	w.setButtons([
		{caption: me.buttonRegister, tooltip: me.buttonRegisterToolTip, onClick:function() { me.doRegister(place, w)}},
		{caption: me.buttonCancel, tooltip: me.buttonCancelToolTip, onClick: function() { config.macros.ccLogin.refresh(place)}}
	]);
	var h1 = createTiddlyElement(null, "h1", null, null, "hahahaha");
	//	w.footElem.appendChild(h1, w.footElem);
	w.footElem.firstChild.parentNode.appendChild(h1, w.footElem);
	//w.footElem.firstChild.insertBefore(h1, w.footElem);
}

config.macros.register.setStatus=function(w, element, text){
	var label_var = w.getElement(element);
	removeChildren(label_var.previousSibling);
	var label = document.createTextNode(text);
	label_var.previousSibling.insertBefore(label,null);
}

config.macros.register.doRegister=function(place, w){
	var me = config.macros.register;
	if(w.formElem["reg_username"].value==''){
		me.setStatus(w, "username_error", me.msgNoUsername);
	}else {
		me.setStatus(w, "username_error", "");
	}
	if(me.emailValid(w.formElem["reg_mail"].value)){
		me.setStatus(w, "mail_error", me.msgEmailOk);
	}else{
		me.setStatus(w, "mail_error", "invalid email address");
		return false;
	}
	if(w.formElem["reg_password1"].value==''){
		me.setStatus(w, "pass1_error", me.msgNoPassword);
		return false;
	}else{
		me.setStatus(w, "pass1_error", "");
	}
	if(w.formElem["reg_password2"].value==''){
		me.setStatus(w, "pass2_error", me.msgNoPassword);
		return false;
	}
	if(w.formElem["reg_password1"].value != w.formElem["reg_password2"].value ){
		me.setStatus(w, "pass1_error", me.msgDifferentPasswords);
		me.setStatus(w, "pass2_error", me.msgDifferentPasswords);
		return false;
	}
 	var params ={};
	params.p = Crypto.hexSha1Str(w.formElem['reg_password1'].value);
	params.u = w.formElem['reg_username'].value;
	params.place = place;
	params.w = w;
	var loginResp=doHttp('POST',url+'/handle/register.php',"username="+w.formElem['reg_username'].value+"&reg_mail="+w.formElem['reg_mail'].value+"&password="+Crypto.hexSha1Str(w.formElem['reg_password1'].value)+"&password2="+Crypto.hexSha1Str(w.formElem['reg_password2'].value),null,null,null,config.macros.register.registerCallback,params);
	w.addStep(me.step2Title, me.msgCreatingAccount);
	w.setButtons([
		{caption: me.buttonCancel, tooltip: me.buttonCancelToolTip, onClick: function() {config.macros.ccLogin.refresh(place);}
	}]);
}

config.macros.register.emailValid=function(str){
	if((str.indexOf(".") > 0) && (str.indexOf("@") > 0))
		return true;
	else
		return false;
};

config.macros.register.usernameValid=function(str){
	if((str.indexOf("_") > 0) && (str.indexOf("@") > 0))
		return false;
	else
		return true;
};

config.macros.register.registerCallback=function(status,params,responseText,uri,xhr){
	var userParams = {};
	userParams.place = params.place;
	if (xhr.status==304){
		params.w.addStep(config.macros.register.errorRegisterTitle, config.macros.register.errorRegister);
		return false;
	}	
	var adaptor = new config.adaptors[config.defaultCustomFields['server.type']];
	var context = {};
	context.host = window.url;
	context.username = params.u;
	context.password = params.p;
	adaptor.login(context,userParams,config.macros.ccLogin.loginCallback);
	return true;
}

config.macros.register.isUsernameAvailable=function(w){
	var params = {};
	params.w = w;
	doHttp('POST',url+'/handle/register.php',"username="+w.formElem["reg_username"].value+"&free=1",null,null,null,config.macros.register.isUsernameAvailabeCallback,params);
	return false;
};

config.macros.register.isUsernameAvailabeCallback=function(status,params,responseText,uri,xhr){
	var me = config.macros.register;
	var resp = (responseText > 0) ? me.msgUsernameTaken : me.msgUsernameAvailable;
	config.macros.register.setStatus(params.w, "username_error", resp);
};
//}}}





//{{{
	
//  ccAbout //
config.macros.ccAbout={};

config.macros.ccAbout.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
	var w = new Wizard();
	var me = config.macros.ccAbout;
	w.createWizard(place,me.stepAboutTitle);
	w.addStep(null, me.stepAboutTextStart + window.ccTiddlyVersion + "<br /><br />" + me.stepAboutTextEnd);
};
//}}}
powerpape
/***
|''Name:''|smmTheme|
|''Author:''|Saq Imtiaz and Simon McManus|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/Trunk/tiddlers/themes/smmTheme.tiddler|
|''~CodeRepository:''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/Trunk/tiddlers/themes/smmTheme.tiddler|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]] |
|''~CoreVersion:''|2.4.1|
|''~PageTemplate:''|##PageTemplate|
|''~tabs:''|##tabs|
|''~OptionsPanel:''|##OptionsPanel|
|''~StyleSheet:''|##StyleSheet|
|''~taskViewTemplate:''|##taskViewTemplate|
|''~taskEditTemplate:''|##taskEditTemplate|
|''~EditTemplate:''|##EditTemplate|
|''~ViewTemplate:''|##ViewTemplate|
***/


!PageTemplate
<!--{{{-->
<div class='header' macro='gradient vert #111 #222'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span><div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
</div>
<div id='bodywrapper'>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' force='true' tiddler='smmTheme##SideBarOptions'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter'  macro='gradient vert #222 #111'></div>
</div>
<!--}}}-->

!taskViewTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'>Task : </div>
<div class='task'>
	<table>
	<tr>
		<td class='taskbody' width=100%><div class='viewer' macro='view text wikified'></div></td>
		<td class='taskControls' valign='top'><div class='taskControls' macro='tiddler TaskTiddlerControls'></td>
	</tr>
	</table>
</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='tagClear'></div>
<!--}}}-->

!taskEditTemplate
<!--{{{-->
<div class="editor">
<div class='toolbar' macro='toolbar[[ToolbarCommands::EditToolbar]]'></div>
<div class='title edit' macro='edit title'></div>
<div class='task'>
	<table>
	<tr>
		<td class='taskbody' width=100% height=100%><div class='viewer edit' macro='edit text wikified'></div></div></td>
		<td class='taskControls' valign=top><div class='taskControls' macro='tiddler TaskTiddlerControls'></td>
	</tr>
	</table>
</div>
<div class='subtitle'>Last edited by: <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='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<div class='tagClear'></div>
</div>
<!--}}}-->

!EditTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></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>
<!--}}}-->

!ViewTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='subtitle'>Last edited by: <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='tagClear'></div>
<!--}}}-->

!wizardViewTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
!OptionsPanel
[[help|Help]] <br />[[settings|AdvancedOptions]]<br /><<ccOptions>>

!tabs
<<tabs txtMainTab "Timeline" "Timeline" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>

!SideBarOptions
<<search {{config.options.search}}>><<closeAll>><<newTiddler label:{{config.macros.newTiddler.label}} text:{{config.macros.newTiddler.text}} title:{{config.macros.newTiddler.title}} tag:"">
<<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel  {{config.macros.ccOptions.options}} 'change TiddlyWiki Options'>><<slider 'chkLoginStatus' 'LoginStatus' {{config.macros.ccLoginStatus.status}} 'Login to make changes'>><<slider chkSliderTabs SideBarTabs {{config.theme.contentTiddler}} {{config.theme.contentTiddlerTooltip}}>>


!StyleSheet
/***
General
***/
/*{{{*/
.tiddler .button:hover {
	background-color:#222;
}
.tiddler .button {
	border:1px solid black;
	line-height:2;
	margin:5px;
	padding:8px;
}

#contentWrapper .tiddler .button {
	margin-left:20px;
}
body .chkOptionInput {
	width:auto;
	float:right;
}

#contentWrapper .wizard .txtOptionInput {
	width:7em;
}

body{
	background: #111;
	color:white;
//	 background-image:url(http://friendster.bigoo.ws/content/layout/film-cartoon/film-cartoon_111.jpg);
//	 background-image:url(http://g.editingmyspace.com/shay773/halloweenbackgrounds/BG1.gif);
}

#backstageCloak {
	opacity:0.9; filter:'alpha(opacity:90)';
	background:#222;
}

#messageArea {
	border:0px;
	color:white;
	background-color:#222;
}

#messageArea .button{
	background:none;
}

#mainMenu br {
	display:none;
}

h1 {
	color:white;
}

#contentWrapper{
	position:relative;
	margin: 2.5em auto;
	width:780px;
	line-height: 1.6em;
	border:1px solid #111;
	font-size: 11px;
	font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif;
	height:1%;
	background-color:#222;
}

.clearAll{
	clear:both;
}

.tagClear{
	clear:none;
}
/*}}}*/

/*{{{*/

.siteTitle {
	font-family: 'Trebuchet MS' sans-serif;
	font-weight: bold;
	position:relative;
	top:20px;
	left :20px;
	font-size: 32px;
	color:#eee;
}

.siteSubtitle {
	padding-top:15px;
	font-size: 1.0em;
	display:block; 
	color: #999; margin-top:0.5em !important; margin-top:1em; margin-left:3em;
}

#displayArea {
	margin-left:1.35em;
	margin-right:16.3em;
	margin-top:0;
	padding-top:1em;
	padding-bottom:10px;
}

.tabUnselected {
	background:#222 none repeat scroll 0%;
	color:#999;
}

#sidebar {
	position:inherit;
	float:right;
	display:inline;
}

#tiddlerDisplay .tagging, #tiddlerDisplay .tagged {
	background-color:#222;
	border:none;
	float:none;
}

.sliderPanel .tabsetWrapper .tabContents {
	border-right:none;
	border-color:#999;
	background-color:#111;
}

#sidebarOptions .sliderPanel a{
	padding:3px;
	margin:0px;
	border:2px;
	background-color:#111;
}

.tabsetWrapper {
	position :relative;
}

#sidebar {
	padding-left:0.5em;
	background-color:#222;
	padding-top:1em;
}

#sidebarOptions a {
	margin:17px;
	display:block;
	margin:0.5em 0em;
	padding:0.3em 0.6em;
}

.popup li a {
	padding:12px;
}

#tiddlerDisplay .toolbar a.button, #sidebarOptions a, .toolbar .popup li a, #mainMenu a, #sidebarOptions .sliderPanel input {
	background-color:#111;
	color:#999;
	border:1px solid #111;
}

.wizard  .txtOptionInput {
	text-align:right;
}

a:hover {
	background-color:#222;
	color:#eee
}

#tiddlerDisplay .toolbar a.button:hover, #sidebarOptions a:hover, #mainMenu a:hover, #sidebarOptions .sliderPanel input:hover {
	border:1px dotted #000;
	background-color:#222;
	color:white;
}

#mainMenu a {
	padding:8px 15px 8px 15px;
	margin:10px;
	line-height:40px;
	border:0px solid #eee;
}

#contentWrapper #mainMenu { 
	position:static;
	width:100%;
	float:left;
	text-align:left;
	padding-top:20px;

}
.editor textarea, .editor input,  input, body select {
	border:1px solid #222;
	background-color:#333;
	color:#999;
	padding:3px;
	margin:3px;
}

#sidebarOptions input {
	border:1px solid #999;
	background-color:#00000;
	width:10em;
}

#sidebarTabs {
	margin:0px;
	padding:0px
}

#sidebarTabs .tabContents {
	color:#eee;
	background:#111;
}
.tagged li
{
	display: inline;
}

.tiddler .button {
	color:white;
	padding:0.4em 0.9em 0.4em 0.9em;
	margin:0px 0px 0px 7px;
}

#sideBarOptions .searchButton {
	display:none;
}

#sidebar .sliderPanel {
	border-color:-moz-use-text-color #222 -moz-use-text-color -moz-use-text-color;
	border-style:none solid none none;
	border-width:0 1px 0 0;
	margin-bottom:0.8em;
	margin-left:5px;
	padding:0;
	margin-left:0px;
}

#sidebarOptions .searchButton {
	display:none;
}

.title {
	color:#C0C0C0;
}

.subtitle, .subtitle a {
	color: #999;
	font-size: 1em;margin:0.2em;
	font-variant: small-caps;
}

.wizard .button:hover{
	background-color:#333;
	border:1px solid #444;
	color:white;
}
.selected .toolbar a {
	color:#999;
}

.selected .toolbar a:hover {
	color:#222;
	background:transparent;
	border:1px solid #fff;
}

.viewer pre {
	background:#111111 none repeat scroll 0 0;
	border:1px solid #FFEE88;
}

* html .viewer pre {
	margin-left: 0em;
}

* html .editor textarea, * html .editor input {
	width: 98%;
}

a,#sidebarOptions .sliderPanel a, #topMenu a, #topMenu .button {
	color:green;
	background-color:transparent;
}

#sidebarOptions .sliderPanel a:hover, #topMenu a, #topMenu .button:hover {
	color:white;
	background-color:transparent;
	border:0px;
}

#topMenu a, #topMenu .button, .wizard .button {
	padding: 5px 15px;
	margin:9px;
	border:1px solid #999;
	font-weight:bold;
	line-height:40px;
	top:1em;
	color:#eee;
	background-color:#222;
}

#topMenu br {
	display:none;
}

#topMenu a:hover, #topMenu .button:hover {
	background-color:#222;
}

.tagging, .tagged {
	border: 1px solid #eee;
}

.highlight, .marked {
	background:transparent;
	color:#111;
	border:none;
	text-decoration:underline;
}

.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
	border: none;
	background:transparent;
	text-decoration:underline;
	color:#222;
}

.tiddler {
	padding-bottom: 40px;
}

.viewer th, thead td {
	background: #222;
	border:none;
	color: #fff;
}

.viewer table {
	border:1px dotted #222;
}

table.twtable {
	border-collapse:seperate;
}

.viewer pre {
	border: 1px solid #999;
}

.viewer hr {
	border-top: dashed 1px #999;
}

.tabSelected {
	background:#111 none repeat scroll 0%;
	border:1px solid #111;
	border-bottom:1px solid black;
	color:#999;
}

.tabContents {
	background:#f7f7f7;
	border:0px;
}

.viewer code {
	background:##222 none repeat scroll 0%;
color:#999;
}

h1,h2,h3,h4,h5 {
	color: #555; border-color:#333; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif;
}

h1 {
	font-size:18px;
}

h2 {
	font-size:16px;
}

h3 {
	font-size: 14px;
}

#contentFooter {
	background:#999;
	clear: both;
	padding: 0.5em 1em;
}

.wizard input {
	border:1px solid #333;
}
#sidebarOptions input {
	border: 1px solid #222;
}

.annotation {
	background-color:green;
	border:1px solid white;
	color:white;
}

.wizardFooter .button{
	background:#222;
	margin:3px;
	padding:0.5em;
	padding-left:1.5em;
	padding-right:1.5em;
	color:white;
	border:1px solid #333;
}
table, .viewer td, .viewer tr, .twtable td, .twtable tr {
	border:0px solid #666666;
}

.tagging .listTitle, .tagged .listTitle, .txtMainTab .tabContents li {
	color:white;
}

body .wizardFooter {
	background:none;
	font-weight:bold;}

.wizardStep {
	border:none;
	background-color:none;
}

body .wizard {
	width:80%;
	padding:10px;
	border:1px solid #EBE6F5;
}

.wizard  th{
	background:#222;
	color:#888;
	padding:3px;
	margin:40px;
};

.wizard, listView twtable {
	border:0px;
};

.wizard {
	padding : 4px 14px 4px 14px;
	font-weight:bold;
	color:#292929;
	border:solid 0px #292929;
	margin-top:1px;
}

.viewer .wizard, body .wizard{
	background:#111;
	margin:2em;
	border:0px;
	border:1px solid #333;
	color:#777;
}

.wizard h1{
	color:#999;
}

.wizard h2{
	padding:4px;
	color:white;
}

body .wizardStep{
	color:#999;
	border:0px;
	margin:0m;
	background:none;
}

body select {
	border:0px;
	padding:3px;
	margin:4px;
}

#backstagePanel {
	border:0px;
	background:none;
	width:60%;
	position:fixed
	padding:0px;
	margin:0px;
	margin-top:-36px;
}

#sidebar .sliderPanel {
	background-color:#222;
	font-size:1em;
}

.viewer .wizardStep table {
	border:0px;
}

.viewer th, .viewer td, .viewer tr, .viewer caption, .twtable th, .twtable td, .twtable tr, .twtable caption {
	border:0px;
	padding:0px;
	margin:0px;
}

.viewer .sortable td  {
	padding:12px;
	margin:21px;
}

.title {
	color:#C0C0C0;
	padding:10px;
}

.viewer table, table.twtable {
	border-collapse:seperated;
	border:0px;
}

.viewer th, .viewer thead td, .twtable th, .twtable thead td {
	border:0px;
	color:white;
}

.twtable th{
	background-color:#333;
	padding:15px;
	margin:15px;
}

table.sortable td.sortedCol {
	background-color:#333;
}

#backstageArea a:hover, #backstageArea a.backstageSelTab {
	background-color:#111;
	color:white;
}
/*}}}*/

[[StyleSheet]]

/***
|''Name:''|purpleTheme|
|''Description:''|A theme with lots of white space and a clean and elegant purple presentation|
|''Author:''|Saq Imtiaz and Simon McManus|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]] |
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/Trunk/tiddlers/themes/purpleTheme.tiddler|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/Trunk/tiddlers/themes/purpleTheme.tiddler|
|''~CoreVersion:''|2.4.1|
|''~PageTemplate:''|##PageTemplate|
|''~tabs:''|##tabs|
|''~OptionsPanel:''|##OptionsPanel|
|''~SideBarTabs:''|##SideBarTabs|
|''~StyleSheet:''|##StyleSheet|
|''~taskViewTemplate:''|##taskViewTemplate|
|''~taskEditTemplate:''|##taskEditTemplate|
|''~EditTemplate:''|##EditTemplate|.wizzz
|''~ViewTemplate:''|##ViewTemplate|
***/
!PageTemplate
<!--{{{-->
<div id='bodywrapper'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' force='true' tiddler='purpleTheme##SideBarOptions'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter'  macro='gradient vert #eee #ccc'></div>
</div>
<!--}}}-->

!EditTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></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>
<!--}}}-->

!ViewTemplate
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='tagClear'></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>
<hr />
<!--}}}-->

!tabs
<<tabs txtMainTab "Timeline" "Timeline" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>


!SideBarOptions
<<search {{config.options.search}}>><<closeAll>><<newTiddler label:{{config.macros.newTiddler.label}} text:{{config.macros.newTiddler.text}} title:{{config.macros.newTiddler.title}} tag:"">
<<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel  {{config.macros.ccOptions.options}} 'change TiddlyWiki Options'>><<slider 'chkLoginStatus' 'LoginStatus' {{config.macros.ccLoginStatus.status}} 'Login to make changes'>><<slider chkSliderTabs SideBarTabs {{config.theme.contentTitle}} {{config.theme.contentTiddlerTooltip}}>>

!StyleSheet
/***
General
***/
/*{{{*/

body, html{
	background-color: #999999;
	color:#333;
//	background:url(http://www.thefabricdeli.com/assets/images/qud21112-purple.jpg);
//	background:url(http://mr-pc.org/inc/paisleyTileSmall.png);
}

#backstageCloak {
	opacity:0.8; filter:'alpha(opacity:70)';
	background:black;
}
.tiddler .button {
	line-height:4;
	margin:5px;
	padding:8px;
}

body .chkOptionInput {
	width:auto;
	float:right;
}

#contentWrapper .wizard .txtOptionInput {
	width:7em;
}

.wizard  .txtOptionInput{
text-align:right;
	border:1px solid #ccc;
}

#contentWrapper .sliderPanel .tabsetWrapper .tabContents {
	border:0px;
	background-color:white;
}

.header {
	background-color:#eee;
}

#messageArea {
	border:1px solid white;
	background-color:#eee;
}

#messageArea .button {
	background:none;
}

h1 {
	color:black;
}

#contentWrapper {
	position:relative;
	margin: 2.5em auto;
	width:780px;
	line-height: 1.6em;
	border:1px solid #ccc;
	font-size: 11px;
	font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif;
	height:1%;
//	display:table;
	background-color:#eee;
}

.clearAll{
	clear:both;
}

.tagClear{
	clear:none;
}
/*}}}*/

/*{{{*/
.siteTitle {
	font-family: 'Trebuchet MS' sans-serif;
	font-weight: bold;
	position:relative;
	top:20px;
	left :20px;
	font-size: 32px;
	color:Purple;
}

.siteSubtitle {
	padding-top:15px;
	font-size: 1.0em;
	display:block;
	color: #999; margin-top:0.5em !important; margin-top:1em; margin-left:3em;
	padding-top:3em;
}

#displayArea {
	margin-left:1.35em;
	margin-right:16.3em;
	margin-top:0;
	padding-top:1em;
	padding-bottom:10px;
}

#sidebarOptions input {
	border:1px solid #ddd;
}

div.tabset {
	margin-bottom:1px;
}

.tabUnselected {
	background:#ddd none repeat scroll 0%;
	color:#999;
	border:1px solid #ccc;
}

#sidebar {
	position:inherit;
	float:right;
	display:inline;
}

#tiddlerDisplay .tagging, #tiddlerDisplay .tagged {
	background-color:#eee;
	border:none;
	float:none;
}

.sliderPanel .tabsetWrapper .tabContents {
	border-right:none;
	border-color:#999;
	background-color:#999;
}

#sidebarOptions .sliderPanel a {
	padding:3px;
	margin:0px;
	border:2px;
	background-color:#999;
}

.tabsetWrapper {
	position :relative;
}

#sidebar{
	padding-left:0.5em;
	background-color:#eee;
	padding-top:1em;
}

#sidebarOptions a {
	margin:17px;
	display:block;
	margin:0.5em 0em;
	padding:0.3em 0.6em;
}

.popup li a {
	margin:0px;
	padding:0px;
	display:inline;
	color:black;
}

.popup {
	background-color:white;
	border:1px solid purple;
}

.popup li a:hover {
	display:inline;
	margin:0px;
	padding:0px;
	background-color:white;
	color:purple;
}

.popup li {
	margin:0px;
	padding:5px;
	background-color:#eee;
}
.popup li:hover {
	background-color:white;
}

#tiddlerDisplay .toolbar a.button, #sidebarOptions a, .toolbar .popup li a, #mainMenu a, .tiddler .button, #sidebarOptions .sliderPanel input {
	border:1px solid white;
	background-color:white;
	color:purple;
}

#tiddlerDisplay .toolbar a.button:hover, #sidebarOptions a:hover,  #mainMenu a:hover, .tiddler .button, #sidebarOptions .sliderPanel input:hover
{
	border:1px solid #ccc;
}

#sidebarOptions a:hover {
border-right:1px solid white;
}

.tagged ul {
	list-style: none;
}

.tagged li {
	display: inline;
}

.zoomer {
	background:none; color:#ddd;
	border:2px solid #ddd;
}

a:active{
	border:1px solid red;
	background-color:#eee;
	color:[[ColorPalette::smmLight1]]
}

a:hover {
	background-color:#eee;
	color:[[ColorPalette::smmLight1]]
}

#backstageArea,#backstageArea a {
	background:transparent;
	color:white;
}

#mainMenu a {
	padding:8px 15px 8px 15px;
	margin:10px;
	line-height:40px;
	border:1px solid #eee;
}

#contentWrapper #mainMenu{
	position:static;
	width:100%;
	float:left;
	text-align:left;
	padding-top:20px;
}

.editor textarea, .editor input, input, body select {
	border:1px solid #ccc;
	background-color:white;
	color:#999;
	padding:3px;
	margin:3px;
}

#sidebarOptions input {
	width:85%;
	margin-left:-0.1em;}

#sidebarTabs {
	margin:0px;
	padding:0px
}

#sidebarTabs .tabContents {
	color:[[ColorPalette::smmLight1]];
	background:#999;
}

#contentWrapper .tiddler .button {
margin:0.4em;
padding:0.4em 0.8em;
}

#sideBarOptions .searchButton{
	display:none;
}

#sidebar .sliderPanel {
	margin-left:5px;
	border:0px;
	padding:0em;
	border-right:1px solid #eee;
	margin-bottom:0.8em;
}

#sidebarOptions .searchButton {
	display:none;
}

.title {
	color:#C0C0C0;
}

.subtitle, .subtitle a {
	color: #999;
	font-size: 1em;margin:0.2em;
	font-variant: small-caps;
}

* html .viewer pre {
	margin-left: 0em;
}

* html .editor textarea, * html .editor input {
	width: 98%;
}

a,#sidebarOptions .sliderPanel a, #topMenu a, #topMenu .button {
	color:purple;
	background-color:transparent;
}

#sidebarOptions .sliderPanel a:hover, #topMenu a, #topMenu .button:hover {
	color:black;
	background-color:transparent;
	border:0px;
}

 
#topMenu a, #topMenu .button {
	padding: 5px 15px;
	margin:9px;
	border:1px solid #999;
	font-weight:bold;
	line-height:40px;
	top:1em;
	color:[[ColorPalette::smmLight1]];
	background-color:#eee;
}

#topMenu br {
	display:none;
}

#topMenu a:hover, #topMenu .button:hover {
	background-color:#eee;
}

.tagging, .tagged {
	border: 0px dotted [[ColorPalette::smmLight1]];
}

.highlight, .marked {
	background:transparent;
	color:#999;
	border:none;
	text-decoration:underline;
}

.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
	border: none;
	background:transparent;
	text-decoration:underline;
	color:#eee;
}

.viewer th, thead td {
	background: #eee;
	border:none;
	color: #fff;
}

.viewer table {
	border:1px solid #eee;
}

table.twtable {
	border-collapse:seperate;
}

.viewer pre {
	background-color:white;
	border: 1px dotted #999;
}

hr {
	border: dotted 1px #ccc;
}

#sidebarOptions .sliderPanel .tabUnselected {
	background:#eee none repeat scroll 0%;
	border:0px solid #999;
	color:#999;
}

.tabSelected, #sidebarOptions .sliderPanel .tabSelected {
	background:white none repeat scroll 0%;
	border:1px solid #ddd;
	border-bottom:1px solid white;
	color:#999;
}

.tabContents {
	background:#f7f7f7;
	border:0px;
}

.viewer code {
	background:##eee none repeat scroll 0%;
	color:#999;
}

h1,h2,h3,h4,h5 {
	color: #555; 
	border-color:#333; 
	background: transparent; 
	padding-bottom:2px; 
	font-family: Arial, Helvetica, sans-serif;
}

h1 {
	font-size:18px;
}

h2 {
	font-size:16px;
	border-bottom:1px solid #FFF;
}

h3 {
	font-size: 14px;
	border-bottom:1px solid #FFF;
}

.annotation {
	background-color:purple;
	border:1px solid white;
	color:white;
}

#contentFooter {
	background:#999;
	clear: both;
	padding: 0.5em 1em;
}

.button, .wizard .button:hover {
	border:0px;
}

.sliderPanel input  {
	border:1px solid #777;
	background-color:white;
	color:#777;	
}

#contentWrapper .tiddler .button:hover {
	border:1px solid;
}

table, .viewer td, .viewer tr, .twtable td, .twtable tr {
	border:0px solid #666666;
}

body .wizardFooter {
	margin:0px;
	padding-top:0px;
	background:white;
	font-weight:bold;
	padding-left:10em;
}

.wizardStep {
	padding:0px;
	border:none;
	background-color:none;
} 
	
.wizard  th{
	background:white;
	color:#888;
	padding:3px;
	margin:40px;
};

.wizard, listView twtable {
	border:0px; 
};

.wizard {
	color:#292929;
}

.viewer .wizard, body .wizard{
	background:white;
	margin:2em;
	border:1px solid #CCCCCC;
	color:#999;
}

.wizard h1 {
	color:#999;
	padding-top:10px;
	padding-bottom:10px;
}

.wizard h2 {
	color:black;
}

body .wizardStep {
	color:#999;
	border:0px;
	margin:0m;
	background:white;	
}

body select {
	border:0px;
	padding:3px;
	margin:4px;
}

#backstageArea a:hover {
	background-color:white;
}

#backstagePanel {
	background:none;
	width:60%;
	position:fixed
	padding:0px;
	margin:0px;
	margin-top:-36px;
}

#backstageToolbar a.backstageSelTab {
	background-color:white;
	border:1px solid white;
}

#sidebar .sliderPanel {
	background-color:#eee;
	font-size:1em;
}

.viewer .wizardStep table {
	border:0px;
}

.viewer th, .viewer td, .viewer tr, .viewer caption, .twtable th, .twtable td, .twtable tr, .twtable caption {
	border:0px;
	padding:0px;
	margin:0px;
}

.viewer .sortable td {
	padding:12px;
	margin:21px;
}

.title {
	color:#777;
	padding:0px;
}

.viewer table, table.twtable {
	border-collapse:seperated;
	border:0px;
}

.viewer th, .viewer thead td, .twtable th, .twtable thead td {
	border:0px;
	background-color:white;
	color:black;
}

.twtable th{
	background-color:#eee;
	padding:15px;
	margin:15px;
}

table.sortable td.sortedCol {
	background-color:white;
}
/*}}}*/

[[StyleSheet]]
powerpape
~TiddlyWiki is a single html file containing all the characteristics of a wiki - all the content, all the functionality (including editing, saving, tagging and searching) and the style sheet. Because it's a single file, it's very portable - you can email it, put it on a web server or share it via a USB stick. ccTiddly provides a serverside backend to ~TiddlyWiki so you can store your content on the web and access it from anywhere. 

Together the two provide a powerful combination which allows you to collaborate with your colleages online, you can then tear a copy of all the work to take on a plane or train journey.  When you have found an internet connection again you can sync your changes with the online copy and you will be notified of any conflicts. 

Some things you could do with ccTiddly workspace include: 

	* A team/public Website
	* A Blog
    * A personal notebook
    * A GTD ("Getting Things Done") productivity tool
    * A collaboration/communication tool
	* A TeamTasks implementation
    * For building websites (this site is a TiddlyWiki file!)
    * For rapid prototyping
    * ...and much more!

You can import and export data to and from all sorts of places. Check out the backstage > import options. There's a more detailed list of features here.

<<slider cctHelpIntro [[ccTiddly Introduction]] "ccTiddly Introduction »" "A introduction to the basics of TiddlyWiki.">>
<<slider cctHelpFormatting [[TiddlyWiki Formatting Guide]] "Tiddly Wiki Formatting Guide »" "A basic guide to TiddlyWiki formatting.">>
<<slider cctHelpccTiddlyMacros [[ccTiddly Macros]] "ccTiddly Macros »" "A Guide to all the ccTiddly Macros">>
<<slider cctHelpTiddlyWikiMacros [[TiddlyWiki Macros]] "TiddlyWiki Macros »" "A Guide to all the TiddlyWiki Macros">>

(this content is a work in progress)

!!!ccTiddly Tiddlers 

[[AnonDefaultTiddlers]]

Allows you to specify a different set of tiddlers to be loaded for anonymous users. Logged in users will be shown the [[DefaultTiddlers]].

[[ccAssignments]]

!!! Predefined ccTiddly Tags 

!!!!wizard
Displays the tiddler without showing the date editor tags or title. 

!!!!private
Only administrators of a workspace can read tiddlers tagged private.

!!! Working Offline : 
To take a copy of a ccTiddly workspace offline add &standalone=1 to the end of the URI and you will be prompted to download an offline file.



Please see the TiddlyWiki community wiki documentation : http://tiddlywiki.org/wiki/TiddlyWiki_Markup

More info on Osmosoft can be found at [[osmosoft.com|http://osmosoft.com/]]
!!!{{{<<today>>}}}
Shows current date.

!!!{{{<<version>>}}} 
This macro shows the version number of the current TiddlyWiki document.

!!!{{{<<Alltags>>}}}
Lists all tags. Clicking on a tag lists all the tiddlers assigned that tag. 

!!!{{{<<List [type]>>}}} 
Parameters : (all (default), missing, orphans, shadowed, touched, filter)

!!!{{{<<Timeline [date] [length] [format]>>}}} 
 The timeline macro creates a list of tiddlers sorted by a date specified.

Example : 
{{{<<timeline "modified" "0" "ddd, YYYY-0MM-0DD">>}}}

Produces : 
<<timeline "modified" "0" "ddd, YYYY-0MM-0DD">>
!!!{{{<<Slider cookie tiddler label tooltip>>}}}
The slider macro allows embedding tiddlers within another tiddler, with the option to toggle the visibility of the transcluded contents.

    * cookie: variable to save the state of the slider
    * tiddler: name of the tiddler to include in the slider
    * label: title text of the slider
    * tooltip: tooltip text of the slider 

 Example
{{{<<slider chkTestSlider [[OptionsPanel]] "Options" "Open advanced options">>}}}

Produces : 
<<slider chkTestSlider [[OptionsPanel]] "Options" "Open advanced options">>
!!!{{{<<Tabs>>}}}
The tabs macro creates an area where it displays one of several tiddlers alternately, as the user clicks on the tab labels at the top.

It is used like this:

{{{<<tabs ID Label1 Tip1 Tiddler1 Label2 Tip2 Tiddler2 [Label3 ...]>>}}}

produces :
<<tabs ID Label1 Tip1 Tiddler1 Label2 Tip2 Tiddler2 [Label3 ...]>>

    * ID: specifies the name of a cookie used to save the information about which tab was displayed last.
    * Label1, Label2, ... define the labels that are displayed at the top of the area for each tab
    * Tip1, Tip2, ... define tooltips that explain, somewhat more verbosely than the labels, what you can expect to find on each tab.
    * Tiddler1, Tiddler2, ... name the tiddlers that are displayed on each tab. 

Obviously, there must be exactly three strings for each tab.

The syntax for the tabs macro looks like this:

{{{<<tabs txt[cookieName]
	"[label]" "[title]" [[tiddler]]
	"[label]" "[title]" [[tiddler]]
	...
     >>}}}

produces :

<<tabs txt[cookieName]
	"[label]" "[title]" [[tiddler]]
	"[label]" "[title]" [[tiddler]]
	...
     >>

!!!{{{<<Tagging [tag]>>}}}
This macro generates a list of tiddlers that carry the specified tag.

<<tagging [tag]>>

If the tag parameter is not specified, the current tiddler's name will be used instead.
!!!{{{<<Tagchooser>>}}}
!!!{{{<<NewJournal>>}}}
This macro generates a button to create a journal tiddler, using the current time and date as title.

It is otherwise identical to the NewTiddler macro.

Example : 
{{{<<newJournal [date format]>>}}}

Produces : 
<<newJournal [date format]>>

The optional parameter can be used to specify a custom date format.

In addition, all of the NewTiddler macro's parameters are valid.

!!!{{{<<NewTiddler>>}}}

 Usage

<<newTiddler [parameters]>>

Parameters

This macro uses named parameters. All parameters are optional.
|Parameter|Description|
|label |button label|
|prompt|button tooltip|
|title|title for the new tiddler (defaults to "New Tiddler")|
|text|contents for the new tiddler|
|tag|tag to be applied to the new tiddler (parameter can be used repeatedly to specify multiple tags)|
|accessKey|single letter to use as access key to trigger the button|
|focus|which of the editable fields to default the focus to (e.g. "title", "text", "tags")|
|template|template tiddler to use to display the new tiddler (defaults to EditTemplate)|
|fields|custom fields to be assigned to the new tiddler, in name:value;name:value; format|

Only fields contained as input fields in the specified template can be primed with an initial value.
[edit] Example

<<newTiddler
	label:"New Tiddler"
	text:"Hello world."
	tag:"test"
	tag:"an example"
	accessKey:"1"
	focus:"tags"
>>



!!!{{{<<Savechanges>>}}}



!!!{{{<<Search>>}}}

This macro creates an input field to perform full-text searches on a TiddlyWiki document's tiddler contents.
[edit] Usage

Example : 
{{{<<search [value]>>}}}

Produces : 

<<search [value]>>

By specifiying the value parameter, the search form can be "preloaded" with the desired term.
[edit] Options
This section is still incomplete. You can help by contributing to its expansion.
Please improve the article, or discuss the issue on the talk page.

    * case-sensitive
    * regular expressions 


!!!{{{<<Gradient>>}}}

The Gradient macro allows simple horizontal and vertical coloured gradients. They are constructed from coloured HTML elements, and don't require any images to work.
The Gradient macro is an extended macro that processes the text after it up until the next '

>>

' sequence. It looks like this:
Example : 
{{{<<gradient vert #ffffff #ffdddd #ff8888>>gradient fill>>}}}

Produces : 
<<gradient vert #ffffff #ffdddd #ff8888>>gradient fill>>

The first parameter can be vert or horiz to indicate the direction of the gradient. The following parameters are two or more colours (CSS RGB(r,g,b) format is also acceptable). The macro constructs a smooth linear gradient between each of the colours in turn.

Inline CSS definitions can be added to gradient fills like this:


Example : 
{{{<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>}}}

Produces : 
<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>

!!!{{{<<Closeall>>}}}
!!!{{{<<Permaview>>}}}
Changes the browser address bar to a permalink to the current Tiddler or the set of open tiddlers. It is used with the ToolbarMacro like this:

Example : 
{{{<<toolbar permalink>>}}}
Produces : 
<<toolbar permalink>>

!!!{{{<<Toolbar>>}}}
The ToolbarMacro is used in the TemplateMechanism to define the toolbar that appearthat appear either in EditMode or in ViewMode. The arguments to the ToolbarMacro is a list of command names, as discussed in the CommandMechanism..

You can precede a command name with a "+" to specify a default command that is automatically chosen when a tiddler is double-clicked, or the ctrl-Enter key combination pressed. Similarly, precede it with "-" to specify a command to be chosen when the Escape key is pressed.
!!!{{{<<Annotations>>}}}

!!!{{{<<Edit>>}}}
The command <<edit>> switches from ViewMode to EditMode. The EditMacro is either a double mouse click inside the tiddler or the entry 'edit' in the tiddler's Toolbar. It is used in ViewTemplate as ToolbarMacro like this:
Example : 
{{{<<toolbar +editTiddler>>}}}
Produces : 
<<toolbar +editTiddler>>

!!!{{{<<Message>>}}}
!!!{{{<<Refreshdisplay>>}}}
!!!{{{<<View fieldname how...>>}}}
Retrieves a specified field (given by fieldname) from the tiddler to be displayed and outputs its value in one of the following ways (the optional //how// parameter):

    * (unspecified): render as is (without formatting)
    * link: format as a link (using createTiddlyLink)
    * wikified: format using all the normal rendering rules
    * date: expects a value of the form YYYYMMDDHHMM and outputs it using either a specified format (...) or config.views.wikified.dateFormat 

The standard field names are:

    * title - the tiddler title
    * tiddler - the tiddler title (as well)
    * text - the text of the tiddler
    * modifier - the person who last modified it
    * modified - date&time of last modification
    * created - when it was created
    * tags - the tiddler tags 

If your tiddlers contain custom fields, they could be specified as well.

The view macro is used extensively in the standard tiddler rendering templates (ViewTemplate and EditTemplate).




!!!{{{<<ccUpload>>}}}
If enabled on the server users can upload files to the ccTiddly server

!!!{{{<<ccLogin>>}}}
Displays the login box if the users is not logged in, if the user is logged in they are shown a logout button

!!!{{{<<ccLoginStatus>>}}}
As with {{{<<ccLogin>>}}} except this displays a link to the login tiddler so can be used where space is tight. 

!!!{{{<<ccCreateWorkspace>>}}}
Allows users with permission to create a workspace and define its permissions.

!!!{{{<<ccEditWorkspace>>}}}
Allows admin users to change the permission of a workspace.

!!!{{{<<ccAdmin>>}}}
Allows admin users to add and remove admin users for a workspace.

!!!{{{<<ccVersion>>}}}
Allows users to confirm which version of ccTiddly they are using.
<<ccAdmin>>
powerpape
|''Description:''|TeamTasks |
|''Type:''|tiddlywiki|
|''URL:''|http://getteamtasks.com/teamtasks.html|
|''image:''|http://127.0.0.1/teamtasks.jpg|
|''Workspace:''|Main|
|''Description:''|TiddlyTools |
|''Type:''|TiddlyWiki|
|''URL:''|http://tiddlytools.com|
|''Workspace:''|Main|
|''Description:''|Visual TW |
|''Type:''|tiddlywiki|
|''URL:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Workspace:''|Main|
|''Description:''|TiddlyVault |
|''Type:''|TiddlyWiki|
|''URL:''|http://tiddlyvault.tiddlyspot.com/|
|''Workspace:''|Main|
|''Description:''|TiddlyThemes |
|''Type:''|tiddlywiki|
|''URL:''|http://tiddlythemes.com|
|''Workspace:''|Main|
|''Description:''|MonkeyPirate|
|''Type:''|tiddlywiki|
|''URL:''|http://mptw.tiddlyspot.com/empty.html|
|''Workspace:''|Main|
|''Description:''|Life Stream |
|''Type:''|tiddlywiki|
|''URL:''|http://simonmcmanus.com|
|''image:''|http://127.0.0.1/simonmcmanustheme.jpg|
|''Workspace:''|Main|
|''Description:''|LocalccTiddly|
|''Type:''|cctiddly|
|''URL:''|http://127.0.0.1/Trunk/|
|''Workspace:''|martin|
powerpape
merge(config.options, {search:"search.."})


config.theme = {
	contentTitle : ' ssss »',
	contentToolTip : 'aaaa',
	contentTiddler : 'Content »',
	contentTiddlerTooltip : 'click to view TiddlyWiki content'
};
merge(config.macros.ccAbout,{
	buttonBackstageText:"about",
	buttonBackstageTooltip:"Find out more about ccTiddly ",
	stepAboutTitle:"About",
	stepAboutTextStart:"You are running ccTiddly ",
	stepAboutTextEnd:"More info about ccTiddly can be found  at <a  target=new href=http://www.tiddlywiki.org/wiki/CcTiddly>http://www.tiddlywiki.org/wiki/CcTiddly</a><br/><br/>  More information about TiddlyWiki can be found at <a target=new href=http://www.tiddlywiki.com>http://www.tiddlywiki.com</a><br/>"
});

merge(config.macros.ccChangePassword,{
	title:"Change Password", 
	subTitle : "for user ", 
	step1Html: " <label for='old'>Old Password </label><input name='old' type='password'/><br/> <label for='new1'>New Password </label> <input  name='new1' type='password' /><br /><label for='new2'>Repeat Password</label> <input  name='new2' type='password' /> ",   
	buttonChangeText:"Change Password",
	buttonChangeToolTip:"Click to change your password", 
	buttonCancelText:"Cancel",
	buttonCancelToolTip:"Click to cancel",
	noticePasswordsNoMatch : "Your new passwords do not match", 
	noticePasswordWrong : "Your password is incorrect.",
	noticePasswordUpdated : "Your Password has been updated", 
	noticePasswordUpdateFailed : "Your Password was NOT updated." 
});

merge(config.macros.ccAdmin,{
	stepAddTitle:"Add a new Workspace Administrator",
	WizardTitleText:"Workspace Administration.",
	buttonDeleteText:"Delete Users",
	buttonDeleteTooltip:"Click to delete users.",
	buttonAddText:"Add User",
	buttonAddTooltip:"Click to add user.",
	buttonCancelText:"Cancel",
	buttonCalcelTooltip:"Calcel adding user.",
	buttonCreateText:"Make User Admin",
	buttonCreateTooltip:"Click to make user admin.",
	labelWorkspace:"Workspace: ",
	labelUsername:"Username  : ",
	stepErrorTitle:"You need to be an administrator of this workspace.",
	stepErrorText:"Permission Denied to edit workspace : ",
	stepNoAdminTitle:"There are no admins of this workspace.",
	stepManageWorkspaceTitle:"",
	listAdminTemplate: {
	columns: [	
		{name: 'Selected', field: 'Selected', rowName: 'name', type: 'Selector'},
		{name: 'Name', field: 'name', title: "Username", type: 'String'},	
		{name: 'Last Visit', field: 'lastVisit', title: "Last Login", type: 'String'}
	],
	rowClasses: [
		{className: 'lowlight', field: 'lowlight'}
	]}
});
/*
merge(ccTiddlyAutoSave,{
	msgSaved:"Saved ",
	msgError:"There was an error saving "
});
*/

merge(config.macros.ccCreateWorkspace, {
	wizardTitle:"Create Workspace",
	buttonCreateText:"create",
	buttonCreateWorkspaceText:"Create Workspace",
	buttonCreateTooltip:'Create new workspace',
	errorPermissions:"You do not have permissions to create a workspace.  You may need to log in.",
	msgPleaseWait:"Please wait, your workspace is being created.",
	msgWorkspaceAvailable:"Workspace name is available.",
	errorWorkspaceNameInUse:"Workspace name is already in use.",
	stepTitle:"Please enter workspace name",
	stepCreateHtml:"<input class='input' id='workspace_name' name='workspace_name' value='' tabindex='1' /><span></span><input type='hidden' name='workspace_error'></input><h2></h2><input type='hidden' name='workspace_url'></input>"
});

merge(config.macros.ccEditWorkspace,{
	WizardTitleText:"Edit Workspace Permissions",
	stepEditTitle:null,
	stepLabelCreate:'Create',
	stepLabelRead:'Read',
	stepLabelUpdate:'Edit',
	stepLabelDelete:'Delete',
	stepLabelPermission:'',
	stepLabelAnon:'  Anonymous   ',
	stepLabelUser:' Authenticated   ',
	stepLabelAdmin:' Admin  ',
	buttonSubmitCaption:"Update Workspace Permissions",
	buttonSubmitToolTip:"Update workspace permissions",
	button1SubmitCaption:"ok",
	button1SubmitToolTip:"review permissions",
	step2Error:"Error", 
	errorTextPermissionDenied:"You do not have permissions to edit this workspace permissions.  You may need to log in.",
	errorUpdateFailed:"Permissions Not changed"
});

merge(config.macros.ccFile,{
	wizardTitleText:"Manage Files",
	wizardStepText:"Manage files in workspace ",
	buttonDeleteText:"Delete Files",
	buttonDeleteTooltip:"Click to Delete files.",
	buttonUploadText:"Upload File",
	buttonUploadTooltip:"Click to Upload files.",
	buttonCancelText:"Cancel",
	buttonCancelTooltip:"Click to cancel.",
	labelFiles:"Existing Files ",
	errorPermissionDeniedTitle:"Permission Denied",
	errorPermissionDeniedUpload:"You do not have permissions to create a file on this server. ",
	errorPermissionDeniedView:"You do not have permissions to view files in this workspace. ",
	listAdminTemplate: {
	columns: [	
	{name: 'wiki text', field: 'wikiText', title: "", type: 'WikiText'},
	{name: 'Selected', field: 'Selected', rowName: 'name', type: 'Selector'},
	{name: 'Name', field: 'name', title: "File", type: 'WikiText'},
	{name: 'URI', field: 'URI', title: "URI", type: 'WikiText'},
	{name: 'Size', field: 'fileSize', title: "size", type: 'String'}
	],
	rowClasses: [
	{className: 'lowlight', field: 'lowlight'}
	]}
});

merge(config.macros.ccLogin,{
	WizardTitleText:null,
	usernameRequest:"Username",
	passwordRequest:"Password",
	stepLoginTitle:null,
	stepLoginIntroTextHtml:"<label>username</label><input name=username id=username tabindex='1'><br /><label>password</label><input type='password' tabindex='2' name='txtPassword' class='txtPassword'><input   name='password'>",
	stepDoLoginTitle:"Logging you in",
	stepDoLoginIntroText:"we are currently trying to log you in.... ",
	stepForgotPasswordTitle:"Password Request",
	stepForgotPasswordIntroText:"Please contact your system administrator or register for a new account.  <br /><input id='forgottenPassword' type='hidden' name='forgottenPassword'/>",
	stepLogoutTitle:"Logout",
	stepLogoutText:"You are currently logged in as ",
	buttonLogout:"logout",
	buttonLogoutToolTip:"Click here to logout.",
	buttonLogin:"Login",
	buttonlogin:"login",
	buttonLoginToolTip:"Click to Login.",	
	buttonCancel:"Cancel",
	buttonCancelToolTip:"Cancel transaction ",
	buttonForgottenPassword:"Forgotten Password",	
	buttonSendForgottenPassword:"Mail me a New Password",
	buttonSendForgottenPasswordToolTip:"Click here if you have forgotten your password",
	buttonForgottenPasswordToolTip:"Click to be reminded of your password",
	msgNoUsername:"Please enter a username", 
	msgNoPassword:"Please enter a password",
	msgLoginFailed:"Login Failed, please try again. ", 
	configURL:window.url+"/handle/login.php", 
	configUsernameInputName:"cctuser",
	configPasswordInputName:"cctpass",
	configPasswordCookieName:"cctPass"
});

merge(config.macros.ccLoginStatus,{
	textDefaultWorkspaceLoggedIn:"Viewing default workspace",
	textViewingWorkspace:"Viewing Workspace : ",
	textLoggedInAs:"Logged in as ",
	status:"status »",
	textNotLoggedIn:"You are not logged in.",
	textAdmin:"You are an Administrator."
});

merge(config.macros.ccOptions, {
	linkManageUsers:"users",
	linkPermissions:"permissions",
	linkFiles:"files",
	linkPassword:"password",
	linkCreate:"create",
	linkOffline:"offline",
	linkStats:"statistics",
	options:"options »"	
});

merge(config.macros.register,{
	usernameRequest:"username",
	passwordRequest:"password",
	passwordConfirmationRequest:"confirm password",
	emailRequest:"email",
	stepRegisterTitle:"Register for an account.",
	stepRegisterIntroText:"Hi, please register below.... ",
	stepRegisterHtml:"<label> username</label><input class='input' id='reg_username' name='reg_username' tabindex='1'/><span></span><input type='hidden'  name='username_error'></input><br /><label>email</label><input class='input' name=reg_mail id='reg_mail' tabindex='2'/><span> </span><input type='hidden' name='mail_error'></input><br/><label>password</label><input type='password' class='input' id='password1' name='reg_password1' tabindex='3'/><span> </span><input type='hidden'  name='pass1_error'></input><br/><label>confirm password</label><input type='password' class='input' id='password2' name='reg_password2' tabindex='4'/><span> </span><input type='hidden'  name='pass2_error'></input>",
	buttonCancel:"Cancel",
	buttonCancelToolTip:"Cancel transaction ",
	buttonRegister:"Register",	
	buttonRegisterToolTip:"click to register",
	msgCreatingAccount:"Attempting to create the account for you.", 
	msgNoUsername:"No username entered", 
	msgEmailOk:"Email address is OK.",
	msgNoPassword:"no password entered.",
	msgDifferentPasswords:"Your Passwords do not match.",
	msgUsernameTaken:"The username requested has been taken.",
	msgUsernameAvailable:"The username is available.",
	step2Title:"",
	step2Html:"Please wait while we create you an account...",
	errorRegisterTitle:"Error",
	errorRegister:"User not created, please try again with a different username."
});

merge(config.macros.ccStats,{
	graph24HourTitle:"Last 24 hours",
	graph24HourDesc:"The number of views of this workspace in the past 24 hours",
	graph20MinsTitle:"Last 20 Minutes",
	graph20MinsDesc:"The number of views of this workspace in the last 20 minutes",
	graph7DaysTitle:"Last 7 days",
	graph7DaysDesc:"The number of views of this workspace in the last 7 days.",
	graph5MonthsTitle:"Last 5 months",
	graph5MonthsDesc:"The number of views of this workspace in the past 30 days.",
	errorPermissionDenied:"Permissions Denied to data for %0 You need to be an administrator on the %1 workspace.",
	stepTitle:"Workspace Statistics"
});


// GENERAL NON CCT CONTENT 

config.theme = {
	contentTitle:"content »",
	contentToolTip : "View the TiddlyWiki tabs",
	help : "Help"
};

merge(config.macros.importTiddlers, {
	wizardTitle: "Import tiddlers",
	step1Title: "Step 1: Locate the server or TiddlyWiki file",
	step1Html: "Specify the type of the server: <select name='selTypes'><option value=''>Choose...</option></select><br>Enter the URL here: <input type='text' size=50 name='txtPath'><br><input type='hidden' size=50 name='txtBrowse'><br><hr>...or select a pre-defined feed: <select name='selFeeds'><option value=''>Choose...</option></select>"
});

merge(config.optionsDesc,{
	txtUserName: "",
	chkRegExpSearch: "Enable regular expressions for searches",
	chkCaseSensitiveSearch: "Case-sensitive searching",
	chkIncrementalSearch: "Incremental key-by-key searching",
	chkAnimate: "Enable animations",
	chkSaveBackups: "",
	chkAutoSave: "",
	txtTheme: "Change the TiddlyWiki theme being used",
	chkGenerateAnRssFeed: "",
	chkSaveEmptyTemplate: "",
	chkOpenInNewWindow: "Open external links in a new window",
	chkToggleLinks: "Clicking on links to open tiddlers causes them to close",
	chkHttpReadOnly: "",
	chkForceMinorUpdate: "",
	chkConfirmDelete: "Require confirmation before deleting tiddlers",
	chkInsertTabs: "Use the tab key to insert tab characters instead of moving between fields",
	txtBackupFolder: "",
	txtMaxEditRows: "Maximum number of rows in edit boxes",
	txtFileSystemCharSet: "Default character set for saving changes (Firefox/Mozilla only)"});

merge(config.macros.options,{
	wizardTitle: "Change Settings",
	step1Title: "",
	step1Html: '<input type="hidden" name="markList"></input><br><input type="hidden" checked="false" name="chkUnknown"></input>These options are saved in a cookie.'
});

merge(config.macros.options,{
	wizardTitle:"Advanced settings",
	step1Title:null,
		unknownDescription: "//(unknown)//",
	listViewTemplate: {
		columns: [
			{name: 'Option', field: 'option', title: "", type: 'String'},
			{name: 'Description', field: 'description', title: "", type: 'WikiText'}
			],
			rowClasses: [
						{className: 'lowlight', field: 'lowlight'}
						]
}
});
config.macros.seo = {};
config.macros.seo.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	createTiddlyButton(place, "Generate HTML files", "Click to generate HTML files.", config.macros.seo.click);
};

config.macros.seo.click = function() {
	var tiddlers=store.getTiddlers("modified","excludeLists").reverse();
	for(var i=0; i<tiddlers.length; i++){
	       store.saveTiddler(tiddlers[i].title);
	}
	
};
<link rel='alternate' type='application/rss+xml' title='RSS Feed for ccTiddly workspace : House' href='http://nemo.house.cx//House/index.xml'/>
 SlumberWiki
To get started with this workspace, you'll need to modify the following tiddlers:
* SiteTitle &amp; 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 workspace is opened when a user is logged in.
* AnonDefaultTiddlers: Contains the names of the tiddlers that you want to appear when the worksace is opened when a user who is not logged in.  This should contain  the login tiddler. [[Login]]
* You can change the permission of this workspace at anytime by opening the [[Manage Users]] and [[Permissions]] tiddlers.<<ccEditWorkspace>>
for [[Slumberland]]. House by [[Nemo|nemo]]
{{center{[img[http://nemo.house.cx/uploads/workspace/House/SlumberWiki Icon.png]]}}}
!!!!Quick Navigation<<tabs txtNavTab "Rooms" "All the rooms" RoomList "Tags" "All the tags... in a cloud!" TagCloud "Recent" "Last 20 changes" TabTimelineLimited20>>
----
!!! Overview
[[design]]
[[technology]]
[[furniture]]
!!! Details
[[bookcases]]
[[stairs]]
[[lighting]]
[[Pop Culture]]
[[material]]
!!! Other
[[GrandDesigns]]

----
{{credit{
page loaded at:
 <<today "YYYY-0MM-0DD 0hh:0MM:0ss">>
(a <<today ddd>> in <<today MMM>>)
}}}
[[SlumberWiki]]
[[Slumberland]]
Slumberland is the house that Nemo will have built... in the [[FUTURRRRRE|timeline]]

What's in a [[name|why Slumberland?]] anyway?

!! A ScratchPad for ideas...
(and perhaps later; a history of construction)

It is intended to be ideas that are feasible under a normal sort of budget, yet still interesting and inovative. The basic idea so far is for a modernised '[[Queenslander]]' house, possibly with a paraboloid hyperbolic [[roof]]! 
<<tiddler room>>
See [[layout]] for some more specifics on orientations and how these [[room]]s fit together. 

I aim to build on land that is sufficient size that I can align the house according to best environmental factors, and not need be defined by restrictive by block boundaries. 
A TV show about house design - what people have done. Here I will keep notes on ideas I've gleaned from GD episodes, alongside references. As I watch the series initially, I'll be striving to pick at least one notable point from each house.

 <<slider chkGDS01 "GrandDesigns S01" "Series 1 (1999) »" "Grand Designs, Series 1">>
 <<slider chkGDIS01 "GrandDesignsIndoors S01" "Indoors, Series 1 (2001) »" "Grand Designs Indoors, Series 1">>

!! Series 2 (2001)
# The Wool Mill
** Custom designed polished granite kitchen benches!
** hot water underfloor heating - with central distribution points
** an amazing central boiler that delivers water on demand... but hassle to install/integrate
** central lighting control system (haha, 1bit LCD display ;)
** "to fail to prepare, is to prepare to fail"
** custom entertainment cabinet (brushed stainless steel!)
# The ~Self-Build
** determination and goals!
# The Regency Villa
** Being too finicky is deadly to the project
** traditional "flawed" windows - ripples that provide "life"
** beautiful regency fireplace
# The Cruciform House
Very experimental and unique design... cross shaped for views. this will be good to watch... 
** they saw a brand new house which felt like "old house". old craft... wooden. lots of oak. 
** lots of custom wooden pieces = long time to fabricate. 
** customised codes to identify the wood for position
** neither architect nor builder has a full picture of the house. Only together. 
** over budget... so easy with a custom house... 25% over estimated before the glass goes in!
** speaking of glass: toughened (4x) glass with flexible rubber gasket tape for required flexibility
** and clever way of making it look like the glass is channeled into the oak
** large amounts of glass = open and inviting to nature. Lots of insulation though (though that's UK :)
** A cool staircase that double backs on itself
** KM describes it as a collision of 15th century (esp inside) and 21st century (esp outside)
** In a custom house, so many things inside have to be custom too - doors, windows, kitchen...
** Speaking of kitchen, it's CENTER to the house and custom. Costing £8k - which KM thinks is a good price. 
** very barn-ish inside. 
** 40% over budget!


# The New England Gable House
# The Isolated Cottage
# The Jewel Box
# The Derelict Barns

*!! Series 3 (2003)
*!! Series 4 (2004)
*!! Grand Designs Abroad (2004)
*!! Series 5 (2005)
*!! Series 6 (2006)
*!! Series 7 (2007)
*!! Grand Designs Trade Secrets Series 1 (2007)
*!! Series 8 (2008)
*!! Grand Designs Trade Secrets Series 2 (2008)
*!! Series 9 (2009)
*!! Series 10 (2010)
*!! Grand Designs Australia (2010)

Note: This isn't a true episode guide, as any information from revisits will be included alongside the original house entry

----
* http://en.wikipedia.org/wiki/Grand_Designs
* http://en.wikipedia.org/wiki/List_of_Grand_Designs_episodes
*  Grand Designs Australia - http://www.lifestyle.com.au/granddesigns/
Background: #ddc
Foreground: #000
PrimaryPale: #ccb
PrimaryLight: #014
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #b84
SecondaryDark: #841
TertiaryPale: #eed
TertiaryLight: #bbb
TertiaryMid: #999
TertiaryDark: #777
Error: #f66
A bipedal hominid, native of earth.

More info at parent wiki: http://nemo.house.cx/ or blog at http://www.thorx.net/, etc
http://nemo.house.cx/House
/***
!! We'll have some custom styles, thanks
This document alters the behaviour of the Shadow Tiddlers of:
* StyleSheetColors
* StyleSheetLayout
* StyleSheetLocale
* StyleSheetPrint
Also, see these for help:
* ColorPaletteView
* ColorPaletteHelp
!!! Let's have a custom body setup. Larger font and other tweaks
***/
/*{{{*/
body {font-size:.8em; font-family:arial,helvetica; margin:0; padding:0;}
#displayArea {
 padding: 1em;
 margin: 0.7em 16.3em 1em 13.5em;
 border-left:1px solid [[ColorPalette::PrimaryLight]];
 border-right: 1px solid [[ColorPalette::PrimaryLight]];
}

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

#tiddlerDisplay {
 padding: 0.5em 0em 0.5em 0em;
 border-top: 1px solid [[ColorPalette::SecondaryDark]];
 border-bottom: 1px solid [[ColorPalette::SecondaryDark]];
 margin: 0.5em 0em 0.5em 0em;
}

.highlight, .marked {border-top: 1px solid [[ColorPalette::PrimaryLight]];}

.header {border-bottom: 2px solid [[ColorPalette::Foreground]];}

/*}}}*/
/***
!!!I can't make the main menu lose dots on lists without losing them in all listLink (where else is that used tho ... tag and tagging lists. ?)
***/
/*{{{*/
#mainMenu {
  width:11em;
  text-align:right;
}
.listTitle, .listLink {list-style: none; text-align: left;}
.listTitle {
  border-bottom: 1px solid;
  border-top: 1px solid;
}
#mainMenu .tab {font-size: 0.8em;}

input { color: [[ColorPalette::Background]]; background: [[ColorPalette::TertiaryDark]]; border: [[ColorPalette::PrimaryDark]]; }
textarea { color: [[ColorPalette::Background]]; background: [[ColorPalette::TertiaryDark]]; border: [[ColorPalette::PrimaryDark]]; }
/*}}}*/
/***
!!! make the tabs headers different
***/
/*{{{*/
.tabSelected{
	color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {
	color:[[ColorPalette::TertiaryMid]];
	background:[[ColorPalette::Background]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
/*}}}*/
/***
!!!Tiddlers get borders. Invisible when not hovered.
***/
/*{{{*/
.tiddler {border: 1px solid [[ColorPalette::Background]]; margin: 1px; }
.selected { border: 1px solid [[ColorPalette::SecondaryMid]]; }
/*}}}*/
/***
!!!Custom subtitle now that I place it at the bottom of each tiddle. 
***/
/*{{{*/
.subtitle {font-size:0.7em; text-align:right; padding:0.2em 1em 0.2em 0.2em; border-top:1px solid; margin-top: 0.5em; margin-bottom: 1.5em;}
.subtitle {color:[[ColorPalette::TertiaryLight]]; }
.subtitle a {color:[[ColorPalette::TertiaryMid]]; }
.selected .subtitle {color:[[ColorPalette::TertiaryMid]]; }
.selected .subtitle a {color:[[ColorPalette::PrimaryDark]]; }
.selected .subtitle a:hover {background-color:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
a img {border:0;}
/*}}}*/
/***
!!!Backstage looks like...
***/
/*{{{*/
#backstageCloak {background:[[ColorPalette::Background]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/***
!!!With a dark colourscheme, we want the buttons looking like this:
***/
/*{{{*/
.wizard .button {
  color:[[ColorPalette::Foreground]];
  background:[[ColorPalette::SecondaryLight]];
  border: 1px solid [[ColorPalette::SecondaryDark]];
}
.wizard .button:hover {
  color:[[ColorPalette::Background]];
  background:[[ColorPalette::PrimaryMid]];
  border: 1px solid [[ColorPalette::PrimaryLight]];
}
.wizard .button:active {
  color:[[ColorPalette::Foreground]];
  background:[[ColorPalette::PrimaryLight]];
  border: 1px solid [[ColorPalette::Background]];
}


/*}}}*/
/***
!!!Tables...
***/
/*{{{*/

.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]];}

.invisibletable table, .invisibletable th, .invisibletable tr, .invisibletable td {border:0px;}

/*}}}*/
/***
!!!Some custom formattings...rightaligned, toc, sliders, small, center, hr...
***/
/*{{{*/
.intelliTaggerSuggestions {background: [[ColorPalette::TertiaryPale]]; }
.justifyright { text-align: right; }
.center { text-align: center;}
.small { font-size: 80%; }
.big { font-size: 120%; }
.border { border: 1px solid; }
.credit {
 text-align: right;
 padding-left: 15%;
 font-size: 80%;
}
.sectionTOC {
 border: 1px solid [[ColorPalette::TertiaryLight]];
 margin: 6px 6px 0px 0px;
  padding: 0em;
}
.sliderPanel {
  border: 1px solid [[ColorPalette::TertiaryPale]];
  margin: 0.5em;
  padding: 0.5em;
}

.tagging {margin:0; float:right; 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;}
.tagging li {float:left; padding-left: 0.4em; padding-right: 0.4em;}
.tagClear {clear:both;}

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

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

.viewer hr {border:0; border-top:solid 2px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}


/*}}}*/
/***
<<sectionTOC>>
***/
/*{{{*/
I am a big fan of bookcases, from the small, the quirky, up to the grand and the library. 
This page will quickly become a link farm!

The idea is to provide many examples and get some ideas...

!! TO SORT…
<<<
!!! Bookcase ideas
A couple of good lists of many styles...
* http://weburbanist.com/2008/04/28/20-brilliant-bookcase-and-bookshelf-designs-creative-modular-and-unique-urban-furniture/
* http://writenowisgood.typepad.com/write_now_is_good/bookshelf_furniture/

Some of those styles in detail...
* ...made from tetris shaped blocks 
** http://www.bravespacedesign.com/products.php
** http://www.hacknmod.com/displayMOD.php?hack=379
* ...made into a bed surrounds: 
** http://bestpicsaround.com/pic-967-Bookcase-Bedroom
** http://www.flickr.com/photos/in-duce/sets/72157602270142788/
* ...made into staircase (steps and sides)
* Expandable
* Like a maze: http://www.destilat.at/html/furniture/ka_os.html
** idea: behind this be the doorway to an ACTUAL maze, in the same layout as the bookcase maze! Amazing! hehe

* Obligatory library porn link: http://thenonist.com/index.php/thenonist/permalink/hot_library_smut/
* And bookstore similar: http://travel.spotcoolstuff.com/shopping/worlds-best-bookstores
* another 20 fantastic bookcases: http://www.incrediblethings.com/lists/20-brilliant-bookcases/
* circular bookcases. top spiral is great! http://curledupwithabook.com/?p=1916
* coffin based bookshelf: http://www.curatedmag.com/news/2009/06/23/coffin-shelves/

Cute:
http://www.thisnext.com/item/92413EBC/EFD1E517/Carousel-Revolving-Bookcase
http://www.thisnext.com/item/BEAE51DB/Baroque-Bookshelves
http://www.thisnext.com/item/E46B4A86/AE89FBCD/Equation-bookshelf
http://www.thisnext.com/item/455ACC8E/B1AEB76C/bookshelf-COMB-from-Jaanus
http://www.thisnext.com/item/9604FF77/AD9ED188/Kartell-Bookworm-Bookshelf

Love this idea
http://www.thisnext.com/item/B2F16327/Lunuganga-Branch-bookshelf

http://atlantareader.wordpress.com/category/bookshelves/
http://robaroundbooks.com/2009/10/bookshelf-of-the-week-amsterdam-public-library/

http://blogof.francescomugnai.com/2010/10/35-of-the-most-incredible-and-creative-bookshelves-ever/

instructable for a nomadic (easily disassemblable) bookcase
http://www.instructables.com/id/Nomadic-Bookcase-2-Mediacase/
<<<

* Not so much a fan of these... http://www.incrediblethings.com/home/angle-nesting-shelves-for-wild-crazy-organizers/
Stuff that goes IN the house... 

!!! Tables

Tables are furniture upon which things can sit. Usually more or less central to a room, though there are side tables and so on. 

I have thoughts about tables...

* Fake top - to reveal storage space underneath
* multilevel - so small knicknacks can store without rolling away
* handles on the sides - for ease of moving (thanks Elizabeth)
* magazine rack on the side - for avoiding magazine clutter on coffee tables (also: thanks Elizabeth)
* Table which resizes when rotated. (TODO: youtube search this)
* EDP Netcom3 Lan furniture: 
** for example: http://www.afis-911-center.com/netcom2148pc.htm#NetCom3%2048%22
* http://www.kustom.biz/page1_14.php - from the guy who did the spiegeltent and was seen on the New Inventors

!!! Chairs
* chair made up as Palpatines throne in Return of the Jedi
** note the possibility of monitor and speakers embedded into overhang, and keyboard/mouse folding out of the armrests. Curtains which can roll down for ultimate privacy too
** perhaps based on a [[wikipedia:Papasan chair]] internally?
** or perhaps based on something like this? http://coolmaterial.com/home/x-rocker-wireless-pedestal-chair/
** or other "audio rocker" type design
** more: http://gizmodo.com/5015730/emperor-workstation-belongs-in-the-death-star-my-office
** also: http://gizmodo.com/5043268/emperor-throne-only-lacks-button-to-fire-death-star-laser

!!! Other
* cushions... for a room of cushions, with barnyard doors. (not dissimilar to a room of plastic balls, but, imho, potentially cooler and comfier. Mix of both?)
* oversize scrabble board as rug
** ...with 100 smaller cushions as tiles! =) (consider a [[Lexicon Crossing 120 tileset|http://wiki.thorx.net/wiki/Lexicon_Crossing#LC120]] as well?
** (so: 15cm square cushion/tiles = 2.25m square board

<<sectionTOC>>
I am a fan of a lot of sci fi and spec fic, so it feels natural to use some designs from fiction... here are some ideas, from those and others too...
;MrScreen / Stargate as feature wall / chandelier
:Both a Pink Floyd reference and, with the right lighting configuration, a Stargate?
;Monolith as [[fireplace]]/surround
:A big fascia of pyrex? 
:Internal oven for [[Kitchen]] goodness?
;TARDIS as...
:computer rack/cabinet
:*Pretty obvious this one. About 50% scale. 
:garden shed
:entrance to library (knowledge store is bigger on inside... right? :)
:Also, TARDIS roundels as styling for [[Games Room]] or [[Library]]? Use the secondary control room style?
;Star wars esque windows (the round spiderweb style) for [[windows]].
:Millenium falcon cockpit as bay window at either end of the library?

;Compass design in floor (not technically pop culture, but still)
:directly under Mr Screen halo? Can be used as a sun/moon rise/set direction indicator? 
: or perhaps in the games room?
Some design philosophies...

!!! Open
A relatively open design, with no internal structural walls
!!! Efficient
No space wasted on hallways
Rooms connect internally to a 'great hall' - a large multipurpose central space
!!! Spacious
* See [[accessibility]]
* High ceilings to allow for internal non-structural mezzanines. 
* [[Verandah]] around most of the house.
!!! Social
Easy movement between areas, and a stadiumesque kitchen
!!! Environmental
Sensibly oriented, with shaded walls in the subtropical climate of SEQ
!!! Landscape
Obviously a little out of my control, but I imagine the northside of a slope, allowing the [[Lounge]] to overlook the valley, whilst the [[Library]] nestles against (or partially within?) the hillside
!!! Style
* Retrofuturistic without being overtly "steampunk". TARDIS Season13 perhaps? Vernepunk hybrid with Decopunk. 
** Especially the [[Library]]
* Polished wooden floors throughout. 
!!!Flexible
The two indeterminate rooms allow for a variety of purposes... 
* Single person (project room, study, computer room, storage room, etc... pick two!)
* Childless couple (1 guest room and study, or two studies, etc...)
* Family (use as bedrooms/etc as needed. Convert games room for up to 4 bedrooms!)

<<sectionTOC>>

I should have a dedicated bookmark page for links like these:
* http://www.architecturendesign.net/36-things-you-obviously-need-in-your-dream-home/
* https://www.boredpanda.com/amazing-home-interior-design-ideas/
Slumberland is planned to have relatively high ceilings - high enough that the rooms can be split vertically (mezzanines) if desired. Indeed, the idea is that the [[Library]] will be split, at least partially, into two or even three levels. Thus the library will need a staircase internally. External stairs are likely to also be part of the house. 

All stairs should be an even count, preferably NOT as a multiple of four (why? because I have found that I take stairs two at a time, but the best way to do so is to ease into it by taking the first and last stair as singles. This leaves the remaining stairs as a multiple of four, which is an equal number of left and right foot 2-stairs steps. so: 6, 10, 14, 18, 22, etc)

Spiral staircase for the library?

* http://www.spoon-tamago.com/2011/05/11/beautiful-storage-casa-brutus-june-2011/  - this is a bookcase/shelves thing too



Additionally, for stairs remember the Rule of 25
>  Enter the fundamental rule of designing any staircase, the “Rule of 25.” It goes like this: a staircase will be safe and easily walkable if the height of two risers plus the width of one tread equals 25
 — http://www.backwoodshome.com/articles2/thomsen0408.html
(note that that "25" is in inches)
DiscoveryPackage  NavigationPackage TidIDEPackage ccTiddly excludeLists excludeSearch loginBox plugins systemConfig systemPackage systemServer systemTheme template wizard script pluginInfo IconPackage tab GrandDesigns electricity
[[Great Hall]]

[[Lounge]]
[[Kitchen]]
[[Bathroom]]
[[Games Room]] 
[[Library]]
[[Master Bedroom]]
[[Room One]]
[[Room Two]]

[[Laundry]]
[[Workshop]]
[[Carspace]]
<<search>><<closeAll>><<permaview>>
<<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">><<slider chkSliderAdminPanel AdminPanel "admin »" "Admin functions">><<slider chkSliderContentTabs SideBarContentTabs "content »" "View TiddlyWiki Tabs">>
----
I am not a fan of direct lighting, and especially not point lights. Halogens that shine down on me from an eyeball piercing zero dimensional space - can go jump. 

Reflected lighting is the way to go and large shapes (spheres?) that glow are lovely. 

Wardrobes and cupboards should have some internal lighting to dispel shadows at the back. Diffuse OLED sheets may be perfect for this? 

Some lamp ideas
* Balls and columns as per DS9 inspiration (episode 'The Search')
** From that idea, this: Pipe Organ.
* Unzip to reveal light: http://www.livbit.com/article/2009/01/04/unzip-the-zip-lamp/

http://en.wikipedia.org/wiki/Deck_prism


OLED lighting is the future?
* http://arstechnica.com/science/news/2011/07/the-future-of-lighting.ars

And of course, this topic totally is incomplete without referring to the MrScreen plans for the feature wall! :)
<<tiddler ColorPaletteHelp>>
<<newTiddler>> | <<newJournal "YYYY 0MM 0DD - a DDD in MMM"
 label:"new blog post"
 tag: "blog">>
{{credit{
[ <<saveChanges>> ] }}}
<<tabs txtMainTab "Timeline" "Timeline" "TabTimeline" "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>
Siteware [[ccTiddly]]
Content [[©|Copyright]] [[nemo]], etc
[img[http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png]]
/***
|''Name''|SimpleSearchPlugin|
|''Description''|displays search results as a simple list of matching tiddlers|
|''Authors''|FND|
|''Version''|0.4.0|
|''Status''|stable|
|''Source''|http://devpad.tiddlyspot.com/#SimpleSearchPlugin|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Keywords''|search|
!Revision History
!!v0.2.0 (2008-08-18)
* initial release
!!v0.3.0 (2008-08-19)
* added Open All button (renders Classic Search option obsolete)
* sorting by relevance (title matches before content matches)
!!v0.4.0 (2008-08-26)
* added tag matching
!To Do
* tag matching optional
* animations for container creation and removal
* when clicking on search results, do not scroll to the respective tiddler (optional)
* use template for search results
!Code
***/
//{{{
if(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.SimpleSearchPlugin = { installed: true };

if(!plugins) { var plugins = {}; }
plugins.SimpleSearchPlugin = {
	heading: "Search Results",
	containerId: "searchResults",
	btnCloseLabel: "close",
	btnCloseTooltip: "dismiss search results",
	btnCloseId: "search_close",
	btnOpenLabel: "Open all",
	btnOpenTooltip: "open all search results",
	btnOpenId: "search_open",
	
	displayResults: function(matches, query) {
		story.refreshAllTiddlers(true); // update highlighting within story tiddlers
		var el = document.getElementById(this.containerId);
		query = '"""' + query + '"""'; // prevent WikiLinks
		if(el) {
			removeChildren(el);
		} else { //# fallback: use displayArea as parent
			var container = document.getElementById("displayArea");
			el = document.createElement("div");
			el.setAttribute("id", this.containerId);
			el = container.insertBefore(el, container.firstChild);
		}
		var msg = "!" + this.heading + "\n";
		if(matches.length > 0) {
			msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n";
			this.results = [];
			for(var i = 0 ; i < matches.length; i++) {
				this.results.push(matches[i].title);
				msg += "* [[" + matches[i].title + "]]\n";
			}
		} else {
			msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?
		}
		createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, plugins.SimpleSearchPlugin.closeResults, "button", this.btnCloseId);
		wikify(msg, el);
		if(matches.length > 0) { // XXX: redundant!?
			createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, plugins.SimpleSearchPlugin.openAll, "button", this.btnOpenId);
		}
	},

	closeResults: function() {
		var el = document.getElementById(plugins.SimpleSearchPlugin.containerId);
		removeNode(el);
		plugins.SimpleSearchPlugin.results = null;
		highlightHack = null;
	},

	openAll: function(ev) {
		story.displayTiddlers(null, plugins.SimpleSearchPlugin.results);
		return false;
	}
};

config.shadowTiddlers.StyleSheetSimpleSearch = "/*{{{*/\n" +
	"#" + plugins.SimpleSearchPlugin.containerId + " {\n" +
	"\toverflow: auto;\n" +
	"\tpadding: 5px 1em 10px;\n" +
	"\tbackground-color: [[ColorPalette::TertiaryPale]];\n" +
	"}\n\n" +
	"#" + plugins.SimpleSearchPlugin.containerId + " h1 {\n" +
	"\tmargin-top: 0;\n" +
	"\tborder: none;\n" +
	"}\n\n" +
	"#" + plugins.SimpleSearchPlugin.containerId + " ul {\n" +
	"\tmargin: 0.5em;\n" +
	"\tpadding-left: 1.5em;\n" +
	"}\n\n" +
	"#" + plugins.SimpleSearchPlugin.containerId + " .button {\n" +
	"\tdisplay: block;\n" +
	"\tborder-color: [[ColorPalette::TertiaryDark]];\n" +
	"\tpadding: 5px;\n" +
	"\tbackground-color: [[ColorPalette::TertiaryLight]];\n" +
	"}\n\n" +
	"#" + plugins.SimpleSearchPlugin.containerId + " .button:hover {\n" +
	"\tborder-color: [[ColorPalette::SecondaryMid]];\n" +
	"\tbackground-color: [[ColorPalette::SecondaryLight]];\n" +
	"}\n\n" +
	"#" + plugins.SimpleSearchPlugin.btnCloseId + " {\n" +
	"\tfloat: right;\n" +
	"\tmargin: -5px -1em 5px 5px;\n" +
	"}\n\n" +
	"#" + plugins.SimpleSearchPlugin.btnOpenId + " {\n" +
	"\tfloat: left;\n" +
	"\tmargin-top: 5px;\n" +
	"}\n" +
	"/*}}}*/";
store.addNotification("StyleSheetSimpleSearch", refreshStyles);

// override Story.search()
Story.prototype.search = function(text, useCaseSensitive, useRegExp) {
	highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");
	var matches = store.search(highlightHack, null, "excludeSearch");
	var q = useRegExp ? "/" : "'";
	plugins.SimpleSearchPlugin.displayResults(matches, q + text + q);
};

// override TiddlyWiki.search() to sort by relevance
TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {
	var candidates = this.reverseLookup("tags", excludeTag, !!match);
	var primary = [];
	var secondary = [];
	var tertiary = [];
	for(var t = 0; t < candidates.length; t++) {
		if(candidates[t].title.search(searchRegExp) != -1) {
			primary.push(candidates[t]);
		} else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {
			secondary.push(candidates[t]);
		} else if(candidates[t].text.search(searchRegExp) != -1) {
			tertiary.push(candidates[t]);
		}
	}
	var results = primary.concat(secondary).concat(tertiary);
	if(sortField) {
		results.sort(function(a, b) {
			return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);
		});
	}
	return results;
};

} //# end of "install only once"
//}}}
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>

<div class='tagged' macro='tags'></div>
<div class='sectionTOC'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagging' macro='tagging'></div>
<div class='tagClear'></div>
<div class='subtitle'> - <span macro='view editsummary'></span> - <span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view creator'></span> <span macro='view created date'></span>)</div>
<!--}}}-->
<<cloud -excludeTags>>
/***
|Name|TagCloudPlugin|
|Source|http://www.TiddlyTools.com/#TagCloudPlugin|
|Version|1.7.0|
|Author|Eric Shulman|
|Original Author|Clint Checketts|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|present a 'cloud' of tags (or links) using proportional font display|
!Usage
<<<
{{{
<<cloud type action:... limit:... tag tag tag ...>>
<<cloud type action:... limit:... +TiddlerName>>
<<cloud type action:... limit:... -TiddlerName>>
<<cloud type action:... limit:... =tagvalue>>
}}}
where:
* //type// is a keyword, one of:
** ''tags'' (default) - displays a cloud of tags, based on frequency of use
** ''links'' - displays a cloud of tiddlers, based on number of links //from// each tiddler
** ''references'' - displays a cloud of tiddlers, based on number of links //to// each tiddler
* ''action:popup'' (default) - clicking a cloud item shows a popup with links to related tiddlers<br>//or//<br> ''action:goto'' - clicking a cloud item immediately opens the tiddler corresponding to that item
* ''limit:N'' (optional) - restricts the cloud display to only show the N most popular tags/links
* ''tag tag tag...'' (or ''title title title'' if ''links''/''references'' is used)<br>shows all tags/links in the document //except// for those listed as macro parameters
* ''+TiddlerName''<br>show only tags/links read from a space-separated, bracketed list stored in a separate tiddler.
* ''-TiddlerName''<br>show all tags/links //except// those read from a space-separated, bracketed list stored in a separate tiddler.
* ''=tagvalue'' (//only if type=''tags''//)<br>shows only tags that are themselves tagged with the indicated tag value (i.e., ~TagglyTagging usage)
//note: for backward-compatibility, you can also use the macro {{{<<tagCloud ...>>}}} in place of {{{<<cloud ...>>}}}//
<<<
!Examples
<<<
//all tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud systemConfig excludeMissing script>>}}}
//top 10 tags excluding<<tag systemConfig>>, <<tag excludeMissing>> and <<tag script>>//
{{{<<cloud limit:10 systemConfig excludeMissing script>>}}}
{{groupbox{<<cloud limit:10 systemConfig excludeMissing script>>}}}
//tags listed in// [[FavoriteTags]]
{{{<<cloud +FavoriteTags>>}}}
{{groupbox{<<cloud +FavoriteTags>>}}}
//tags NOT listed in// [[FavoriteTags]]
{{{<<cloud -FavoriteTags>>}}}
{{groupbox{<<cloud -FavoriteTags>>}}}
//links to tiddlers tagged with 'package'//
{{{<<cloud action:goto =package>>}}}
{{groupbox{<<cloud action:goto =package>>}}}
//top 20 most referenced tiddlers//
{{{<<cloud references limit:20>>}}}
{{groupbox{<<cloud references limit:20>>}}}
//top 20 tiddlers that contain the most links//
{{{<<cloud links limit:20>>}}}
{{groupbox{<<cloud links limit:20>>}}}
<<<
!Revisions
<<<
2009.07.17 [1.7.0] added {{{-TiddlerName}}} parameter to exclude tags that are listed in the indicated tiddler
2009.02.26 [1.6.0] added {{{action:...}}} parameter to apply popup vs. goto action when clicking cloud items
2009.02.05 [1.5.0] added ability to show links or back-links (references) instead of tags and renamed macro to {{{<<cloud>>}}} to reflect more generalized usage.
2008.12.16 [1.4.2] corrected group calculation to prevent 'group=0' error
2008.12.16 [1.4.1] revised tag filtering so excluded tags don't affect calculations
2008.12.15 [1.4.0] added {{{limit:...}}} parameter to restrict the number of tags displayed to the top N most popular
2008.11.15 [1.3.0] added {{{+TiddlerName}}} parameter to include only tags that are listed in the indicated tiddler
2008.09.05 [1.2.0] added '=tagname' parameter to include only tags that are themselves tagged with the specified value (i.e., ~TagglyTagging usage)
2008.07.03 [1.1.0] added 'segments' property to macro object.  Extensive code cleanup
<<<
!Code
***/
//{{{
version.extensions.TagCloudPlugin= {major: 1, minor: 7 , revision: 0, date: new Date(2009,7,17)};
//Originally created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
//Currently maintained and enhanced by Eric Shulman
//}}}
//{{{
config.macros.cloud = {
	tagstip: "%1 tiddlers tagged with '%0'",
	refslabel: " (%0 references)",
	refstip: "%1 tiddlers have links to '%0'",
	linkslabel: " (%0 links)",
	linkstip: "'%0' has links to %1 other tiddlers",
	groups: 9,
	init: function() {
		config.macros.tagCloud=config.macros.cloud; // for backward-compatibility
		config.shadowTiddlers.TagCloud='<<cloud>>';
		config.shadowTiddlers.StyleSheetTagCloud=
			'/*{{{*/\n'
			+'.tagCloud span {line-height: 3.5em; margin:3px;}\n'
			+'.tagCloud1{font-size: 80%;}\n'
			+'.tagCloud2{font-size: 100%;}\n'
			+'.tagCloud3{font-size: 120%;}\n'
			+'.tagCloud4{font-size: 140%;}\n'
			+'.tagCloud5{font-size: 160%;}\n'
			+'.tagCloud6{font-size: 180%;}\n'
			+'.tagCloud7{font-size: 200%;}\n'
			+'.tagCloud8{font-size: 220%;}\n'
			+'.tagCloud9{font-size: 240%;}\n'
			+'/*}}}*/\n';
		setStylesheet(store.getTiddlerText('StyleSheetTagCloud'),'tagCloudsStyles');
	},
	getLinks: function(tiddler) { // get list of links to existing tiddlers and shadows
		if (!tiddler.linksUpdated) tiddler.changed();
		var list=[]; for (var i=0; i<tiddler.links.length; i++) {
			var title=tiddler.links[i];
			if (store.isShadowTiddler(title)||store.tiddlerExists(title))
				list.push(title);
		}
		return list;
	},
	handler: function(place,macroName,params) {
		// unpack params
		var inc=[]; var ex=[]; var limit=0; var action='popup';
		var links=(params[0]&&params[0].toLowerCase()=='links'); if (links) params.shift();
		var refs=(params[0]&&params[0].toLowerCase()=='references'); if (refs) params.shift();
		if (params[0]&&params[0].substr(0,7).toLowerCase()=='action:')
			action=params.shift().substr(7).toLowerCase();
		if (params[0]&&params[0].substr(0,6).toLowerCase()=='limit:')
			limit=parseInt(params.shift().substr(6));
		while (params.length) {
			if (params[0].substr(0,1)=='+') { // read taglist from tiddler
				inc=inc.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
			} else if (params[0].substr(0,1)=='-') { // exclude taglist from tiddler
				ex=ex.concat(store.getTiddlerText(params[0].substr(1),'').readBracketedList());
			} else if (params[0].substr(0,1)=='=') { // get tag list using tagged tags
				var tagged=store.getTaggedTiddlers(params[0].substr(1));
				for (var t=0; t<tagged.length; t++) inc.push(tagged[t].title);
			} else ex.push(params[0]); // exclude params
			params.shift();
		}
		// get all items, include/exclude specific items
		var items=[];
		var list=(links||refs)?store.getTiddlers('title','excludeLists'):store.getTags();
		for (var t=0; t<list.length; t++) {
			var title=(links||refs)?list[t].title:list[t][0];
			if (links)	var count=this.getLinks(list[t]).length;
			else if (refs)	var count=store.getReferringTiddlers(title).length;
			else 		var count=list[t][1];
			if ((!inc.length||inc.contains(title))&&(!ex.length||!ex.contains(title)))
				items.push({ title:title, count:count });
		}
		if(!items.length) return;
		// sort by decending count, limit results (optional)
		items=items.sort(function(a,b){return(a.count==b.count)?0:(a.count>b.count?-1:1);});
		while (limit && items.length>limit) items.pop();
		// find min/max and group size
		var most=items[0].count;
		var least=items[items.length-1].count;
		var groupSize=(most-least+1)/this.groups;
		// sort by title and draw the cloud of items
		items=items.sort(function(a,b){return(a.title==b.title)?0:(a.title>b.title?1:-1);});
		var cloudWrapper = createTiddlyElement(place,'div',null,'tagCloud',null);
		for (var t=0; t<items.length; t++) {
			cloudWrapper.appendChild(document.createTextNode(' '));
			var group=Math.ceil((items[t].count-least)/groupSize)||1;
			var className='tagCloudtag tagCloud'+group;
			var tip=refs?this.refstip:links?this.linkstip:this.tagstip;
			tip=tip.format([items[t].title,items[t].count]);
			if (action=='goto') { // TAG/LINK/REFERENCES GOTO
				var btn=createTiddlyLink(cloudWrapper,items[t].title,true,className);
				btn.title=tip;
				btn.style.fontWeight='normal';
			} else if (!links&&!refs) { // TAG POPUP
				var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,onClickTag,className);
				btn.setAttribute('tag',items[t].title);
			} else { // LINK/REFERENCES POPUP
				var btn=createTiddlyButton(cloudWrapper,items[t].title,tip,
					function(ev) { var e=ev||window.event; var cmt=config.macros.cloud;
						var popup = Popup.create(this);
						var title = this.getAttribute('tiddler');
						var count = this.getAttribute('count');
						var refs  = this.getAttribute('refs')=='T';
						var links = this.getAttribute('links')=='T';
						var label = (refs?cmt.refslabel:cmt.linkslabel).format([count]);
						createTiddlyLink(popup,title,true);
						createTiddlyText(popup,label);
						createTiddlyElement(popup,'hr');
						if (refs) {
							popup.setAttribute('tiddler',title);
							config.commands.references.handlePopup(popup,title);
						}
						if (links) {
							var tiddler = store.fetchTiddler(title);
							var links=config.macros.cloud.getLinks(tiddler);
							for(var i=0;i<links.length;i++)
								createTiddlyLink(createTiddlyElement(popup,'li'),
									links[i],true);
						}
						Popup.show();
						e.cancelBubble=true; if(e.stopPropagation) e.stopPropagation();
						return false;
					}, className);
				btn.setAttribute('tiddler',items[t].title);
				btn.setAttribute('count',items[t].count);
				btn.setAttribute('refs',refs?'T':'F');
				btn.setAttribute('links',links?'T':'F');
				btn.title=tip;
			}
		}
	}
};
//}}}
<<timeline "modified" "20">>
|~ViewToolbar|closeTiddler closeOthers ! collapseTiddler collapseOthers ! > fields syncing  revisions references ! +editTiddler permalink jump < |
|~CollapsedToolbar| closeTiddler closeOthers ! +expandTiddler collapseOthers ! > jump < |
|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddlerHosted |
/***
|Name|CoreTweaks|
|Source|http://www.TiddlyTools.com/#CoreTweaks|
|Version|use with TW2.4.3|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.2.0|
|Type|plugin|
|Requires||
|Overrides|various|
|Description|a small collection of overrides to TW core functions|
This tiddler contains changes TW core functions to provide minor changes in standard features or behavior.  It is hoped that some of these tweaks may someday be added into the TW core, so that these adjustments will be available without needing these add-on definitions.
>''Note: the changes contained in this tiddler are generally applicable for version 2.4.3 of TiddlyWiki.''
>Please view [[CoreTweaksArchive]] for tweaks that may be used with earlier versions of TiddlyWiki.
***/
//{{{
// calculate TW version number - used to determine which tweaks should be applied
var ver=version.major+version.minor/10+version.revision/100;
//}}}
/***
----

***/
// // open tickets:
// // {{block{
/***
!!!890 add conditional test to """<<tiddler>>""" macro
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/890 - OPEN
This tweak extends the {{{<<tiddler>>}}} macro syntax so you can include a javascript-based //test expression// to determine if the tiddler transclusion should be performed:
{{{
<<tiddler TiddlerName if:{{...}} with: param param etc.>>
}}}
If the test is ''true'', then the tiddler is transcluded as usual.  If the test is ''false'', then the transclusion is skipped and //no output is produced//.
***/
//{{{
config.macros.tiddler.if_handler = config.macros.tiddler.handler;
config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	params = paramString.parseParams('name',null,true,false,true);
	if (!getParam(params,'if',true)) return;
	this.if_handler.apply(this,arguments);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!831 backslash-quoting for embedding newlines in 'line-mode' formats
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/831 - OPEN
This tweak pre-processes source content to convert 'double-backslash-newline' into {{{<br>}}} before wikify(), so that literal newlines can be embedded in line-mode wiki syntax (e.g., tables, bullets, etc.)
***/
//{{{
window.coreWikify = wikify;
window.wikify = function(source,output,highlightRegExp,tiddler)
{
	if (source) arguments[0]=source.replace(/\\\\\n/mg,'<br>');
	coreWikify.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!829 """<<tag>>""" macro - sortby parameter
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/829 - OPEN
This tweak adds an optional 'sortby' parameter to the """<<tag tagname label tip sortby>>""" macro, as well as the """<<allTags excludeTag sortby>>""" macro used to generate the sidebar contents 'tags' list.  Specify the field on which the contents of each tag popup is to be sorted, with a '+' or '-' prefix to indicate ascending/descending order, respectively.

Example: """<<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>"""
Try it: <<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>

Similarly, to change the sort order used by the popups from all tags shown in the sidebar contents, edit the [[TagTags]] shadow tiddler and enter: """<<allTags excludeLists -modified>>"""
***/
//{{{
// hijack tag handler() to add 'sortby' attribute to tag button
config.macros.tag.CoreTweaksSortTags_handler=config.macros.tag.handler;
config.macros.tag.handler = function(place,macroName,params)
{
	this.CoreTweaksSortTags_handler.apply(this,arguments);
	var btn=place.lastChild;
	if (params[3]) btn.setAttribute('sortby',params[3]);
}

// tweak <<allTags>> macro to add 'sortby' attribute to each tag button
var fn=config.macros.allTags.handler;
var lines=fn.toString().split('\n');
lines.splice(lines.length-2,0,['if(params[1]) btn.setAttribute("sortby",params[1]);']);
fn=lines.join('\n');
eval('config.macros.allTags.handler='+fn);

// tweak tag event handler to:
// * use tag filtering (only if '[' is present in tag value)
// * use optional 'sortby' attribute
// * save 'sortby' value in 'open all' command (for displaying tiddlers in sorted order)
var fn=onClickTag;
fn=fn.toString().replace(
	/store.getTaggedTiddlers\(tag\);/g,
	'(tag.indexOf("[")==-1?store.getTaggedTiddlers(tag):store.filterTiddlers(tag));'
	+'var sortby=this.getAttribute("sortby");'
	+'if(sortby&&sortby.length) store.sortTiddlers(tagged,sortby);'
);
fn=fn.toString().replace(
	/openAll.setAttribute\("tag",\s*tag\);/g,
	'openAll.setAttribute("tag",tag); openAll.setAttribute("sortby",sortby);'
);
eval(fn);

// tweak 'open all' event handler to use 'sortby' attribute
var fn=onClickTagOpenAll;
fn=fn.toString().replace(
	/story.displayTiddlers\(this,\s*tiddlers\);/g,
	'var sortby=this.getAttribute("sortby");'
	+'if(sortby&&sortby.length) store.sortTiddlers(tiddlers,sortby);'
	+'story.displayTiddlers(this,tiddlers);'
);
eval(fn);
//}}}
// // }}}}}}// // {{block{
/***
!!!824 ~WindowTitle - alternative to combined ~SiteTitle/~SiteSubtitle in window titlebar
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/824 - OPEN
This tweak allows definition of an optional [[WindowTitle]] tiddler that, when present, provides alternative text for display in the browser window's titlebar, instead of using the combined text content from [[SiteTitle]] and [[SiteSubtitle]] (which will still be displayed as usual in the TiddlyWiki document header area).

Note: this ticket replaces http://trac.tiddlywiki.org/ticket/401 (closed), which proposed using a custom [[PageTitle]] tiddler for this purpose.  ''If you were using the previous '401 ~PageTitle' tweak, you will need to rename [[PageTitle]] to [[WindowTitle]] to continue to use your custom window title text''
***/
//{{{
config.shadowTiddlers.WindowTitle='<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>';
window.getPageTitle=function() { return wikifyPlain('WindowTitle'); }
store.addNotification('WindowTitle',refreshPageTitle); // so title stays in sync with tiddler changes
//}}}
// // }}}}}}// // {{block{
/***
!!!784 allow tiddler sections in TiddlyLinks to be used as anchor points for intra-tiddler scrolling.  
>http://trac.tiddlywiki.org/ticket/784 - OPEN - Please see separate [[SectionLinksPlugin]]
!!!683 FireFox3 Import bug: 'browse' button replacement
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/683 - OPEN
The web standard 'type=file' input control that has been used as a local path/file picker for TiddlyWiki no longer works as expected in FireFox3, which has, for security reasons, limited javascript access to this control so that *no* local filesystem path information can be revealed, even when it is intentional and necessary, as it is with TiddlyWiki.  This tweak provides alternative HTML source that patches the backstage import panel.  It replaces the 'type=file' input control with a text+button combination of controls that invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
>Note: ''This tweak also requires http://trac.tiddlywiki.org/ticket/604 - cross-platform askForFilename()''
***/
//{{{
if (window.Components) {
	var fixhtml='<input name="txtBrowse" style="width:30em"><input type="button" value="..."'
		+' onClick="window.browseForFilename(this.previousSibling,true)">';
	var cmi=config.macros.importTiddlers;
	cmi.step1Html=cmi.step1Html.replace(/<input type='file' size=50 name='txtBrowse'>/,fixhtml);
}

merge(config.messages,{selectFile:'Please enter or select a file'}); // ready for I18N translation

window.browseForFilename=function(target,mustExist) { // note: both params are optional
	var msg=config.messages.selectFile;
	if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
	// get local path for current document
	var path=getLocalPath(document.location.href);
	var p=path.lastIndexOf('/'); if (p==-1) p=path.lastIndexOf('\\'); // Unix or Windows
	if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
	var file=''
	var result=window.askForFilename(msg,path,file,mustExist); // requires #604
	if (target && result.length) // set target field and trigger handling
		{ target.value=result; target.onchange(); }
	return result; 
}
//}}}
// // }}}}}}// // {{block{
/***
!!!604 cross-platform askForFilename()
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/604 - OPEN
invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
***/
//{{{
window.askForFilename=function(msg,path,file,mustExist) {
	var r = window.mozAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = window.ieAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = window.javaAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = prompt(msg,path+file);
	return r||'';
}

window.mozAskForFilename=function(msg,path,file,mustExist) {
	if(!window.Components) return false;
	try {
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
		var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
		picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
		var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
		thispath.initWithPath(path);
		picker.displayDirectory=thispath;
		picker.defaultExtension='html';
		picker.defaultString=file;
		picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
		if (picker.show()!=nsIFilePicker.returnCancel)
			var result=picker.file.persistentDescriptor;
	}
	catch(ex) { displayMessage(ex.toString()); }
	return result;
}

window.ieAskForFilename=function(msg,path,file,mustExist) {
	if(!config.browser.isIE) return false;
	try {
		var s = new ActiveXObject('UserAccounts.CommonDialog');
		s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
		s.FilterIndex=3; // default to HTML files;
		s.InitialDir=path;
		s.FileName=file;
		return s.showOpen()?s.FileName:'';
	}
	catch(ex) { displayMessage(ex.toString()); }
	return result;
}

window.javaAskForFilename=function(msg,path,file,mustExist) {
	if(!document.applets['TiddlySaver']) return false;
	// TBD: implement java-based askFile(...) function
	try { return document.applets['TiddlySaver'].askFile(msg,path,file,mustExist); } 
	catch(ex) { displayMessage(ex.toString()); }
}
//}}}
// // }}}}}}// // {{block{
/***
!!!657 wrap tabs onto multiple lines
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/657 - OPEN
This tweak inserts an extra space element following each tab, allowing them to wrap onto multiple lines if needed.
***/
//{{{
config.macros.tabs.handler = function(place,macroName,params)
{
	var cookie = params[0];
	var numTabs = (params.length-1)/3;
	var wrapper = createTiddlyElement(null,'div',null,'tabsetWrapper ' + cookie);
	var tabset = createTiddlyElement(wrapper,'div',null,'tabset');
	tabset.setAttribute('cookie',cookie);
	var validTab = false;
	for(var t=0; t<numTabs; t++) {
		var label = params[t*3+1];
		var prompt = params[t*3+2];
		var content = params[t*3+3];
		var tab = createTiddlyButton(tabset,label,prompt,this.onClickTab,'tab tabUnselected');
		createTiddlyElement(tab,'span',null,null,' ',{style:'font-size:0pt;line-height:0px'}); // ELS
		tab.setAttribute('tab',label);
		tab.setAttribute('content',content);
		tab.title = prompt;
		if(config.options[cookie] == label)
			validTab = true;
	}
	if(!validTab)
		config.options[cookie] = params[1];
	place.appendChild(wrapper);
	this.switchTab(tabset,config.options[cookie]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!628 hide 'no such macro' errors
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/628 - OPEN
When invoking a macro that is not defined, this tweak prevents the display of the 'error in macro... no such macro' message.  This is useful when rendering tiddler content or templates that reference macros that are defined by //optional// plugins that have not been installed in the current document.

<<option chkHideMissingMacros>> hide 'no such macro' error messages
***/
//{{{
if (config.options.chkHideMissingMacros===undefined)
	config.options.chkHideMissingMacros=false;

window.coreTweaks_missingMacro_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
	if (!config.macros[macro] || !config.macros[macro].handler)
		if (config.options.chkHideMissingMacros) return;
	window.coreTweaks_missingMacro_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!608/609/610 toolbars - toggles, separators and transclusion
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/608 - OPEN (more/less toggle)
http://trac.tiddlywiki.org/ticket/609 - OPEN (separators)
http://trac.tiddlywiki.org/ticket/610 - OPEN (wikify tiddler/slice/section content)

This combination tweak extends the """<<toolbar>>""" macro to add use of '<' to insert a 'less' menu command (the opposite of '>' == 'more'), as well as use of '*' to insert linebreaks and "!" to insert a vertical line separator between toolbar items.  In addition, this tweak add the ability to use references to tiddlernames, slices, or sections and render their content inline within the toolbar, allowing easy creation of new toolbar commands using TW content (such as macros, links, inline scripts, etc.)

To produce a one-line style, with "less" at the end, use
| ViewToolbar| foo bar baz > yabba dabba doo < |
resulting in:
{{{
foo bar baz more
   and
foo bar baz yabba dabba doo less
}}}
or to use the CoreTweaks? two-line style:
| ViewToolbar| foo bar baz > < * yabba dabba doo |
which would produce:
{{{
foo bar baz more
   and
foo bar baz less
yabba dabba doo
}}}
''see [[ToolbarCommands]] for examples of how these features can be used''
***/
//{{{
merge(config.macros.toolbar,{
	moreLabel: 'more\u25BC',
	morePrompt: 'Show additional commands',
	lessLabel: '\u25C4less',
	lessPrompt: 'Hide additional commands',
	separator: '|'
});
config.macros.toolbar.onClickMore = function(ev) {
	var e = this.nextSibling;
	e.style.display = 'inline'; // show menu
	this.style.display = 'none'; // hide button
	return false;
};
config.macros.toolbar.onClickLess = function(ev) {
	var e = this.parentNode;
	var m = e.previousSibling;
	e.style.display = 'none'; // hide menu
	m.style.display = 'inline'; // show button
	return false;
};
config.macros.toolbar.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	for(var t=0; t<params.length; t++) {
		var c = params[t];
		switch(c) {
			case '!':  // ELS - SEPARATOR (added)
				createTiddlyText(place,this.separator);
				break;
			case '*':  // ELS - LINEBREAK (added)
				createTiddlyElement(place,'BR');
				break;
			case '<': // ELS - LESS COMMAND (added)
				var btn = createTiddlyButton(place,
					this.lessLabel,this.lessPrompt,config.macros.toolbar.onClickLess,'moreCommand');
				break;
			case '>':
				var btn = createTiddlyButton(place,
					this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore,'moreCommand');
				var e = createTiddlyElement(place,'span',null,'moreCommand');
				e.style.display = 'none';
				place = e;
				break;
			default:
				var theClass = '';
				switch(c.substr(0,1)) {
					case '+':
						theClass = 'defaultCommand';
						c = c.substr(1);
						break;
					case '-':
						theClass = 'cancelCommand';
						c = c.substr(1);
						break;
				}
				if(c in config.commands)

					this.createCommand(place,c,tiddler,theClass);
				else { // ELS - WIKIFY TIDDLER/SLICE/SECTION (added)
					if (c.substr(0,1)=='~') c=c.substr(1); // ignore leading ~
					var txt=store.getTiddlerText(c);
					if (txt) {
						// trim any leading/trailing newlines
						txt=txt.replace(/^\n*/,'').replace(/\n*$/,'');
						// trim PRE format wrapper if any
						txt=txt.replace(/^\{\{\{\n/,'').replace(/\n\}\}\}$/,'');
						// render content into toolbar
						wikify(txt,createTiddlyElement(place,'span'),null,tiddler);
					}
				} // ELS - end WIKIFY CONTENT
				break;
		}
	}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!529 IE fixup - case-sensitive element lookup of tiddler elements
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/529 - OPEN
This tweak hijacks the standard browser function, document.getElementById(), to work-around the case-INsensitivity error in Internet Explorer (all versions up to and including IE7) //''Note: This tweak is only applied when using IE, and only for lookups of rendered tiddler elements within the containing 'tiddlerDisplay' element.''//
***/
//{{{
if (config.browser.isIE) {
document.coreTweaks_coreGetElementById=document.getElementById;
document.getElementById=function(id) {
	var e=document.coreTweaks_coreGetElementById(id);
	if (!e || !e.parentNode || e.parentNode.id!='tiddlerDisplay') return e;
	for (var i=0; i<e.parentNode.childNodes.length; i++)
		if (id==e.parentNode.childNodes[i].id) return e.parentNode.childNodes[i];
	return null;
};
}
//}}}
// // }}}}}}// // {{block{
/***
!!!471 'creator' field for new tiddlers
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/471 - OPEN
This tweak HIJACKS the core's saveTiddler() function to automatically add a 'creator' field to a tiddler when it is FIRST created. You can use """<<view creator>>""" (or """<<view creator wikified>>""" if you prefer) to show this value embedded directly within the tiddler content, or {{{<span macro="view creator"></span>}}} in the ViewTemplate and/or EditTemplate to display the creator value in each tiddler.  
***/
//{{{
// hijack saveTiddler()
TiddlyWiki.prototype.CoreTweaks_creatorSaveTiddler=TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler=function(title,newTitle,newBody,modifier,modified,tags,fields)
{
	var existing=store.tiddlerExists(title);
	var tiddler=this.CoreTweaks_creatorSaveTiddler.apply(this,arguments);
	if (!existing) store.setValue(title,'creator',config.options.txtUserName);
	return tiddler;
}
//}}}
// // }}}}}}
// // closed: won't fix //(leave as core tweaks)//
// // {{block{
/***
!!!637 TiddlyLink tooltip - custom formatting
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/637 - CLOSED: WON'T FIX
This tweak modifies the tooltip format that appears when you mouseover a link to a tiddler.  It adds an option to control the date format, as well as displaying the size of the tiddler (in bytes)

Tiddler link tooltip format:
{{stretch{<<option txtTiddlerLinkTootip>>}}}
^^where: %0=title, %1=username, %2=modification date, %3=size in bytes, %4=description slice^^
Tiddler link tooltip date format:
{{stretch{<<option txtTiddlerLinkTooltipDate>>}}}
***/
//{{{
config.messages.tiddlerLinkTooltip='%0 - %1, %2 (%3 bytes) - %4';
config.messages.tiddlerLinkTooltipDate='DDD, MMM DDth YYYY 0hh12:0mm AM';

config.options.txtTiddlerLinkTootip=
	config.options.txtTiddlerLinkTootip||config.messages.tiddlerLinkTooltip;
config.options.txtTiddlerLinkTooltipDate=
	config.options.txtTiddlerLinkTooltipDate||config.messages.tiddlerLinkTooltipDate;

Tiddler.prototype.getSubtitle = function() {
	var modifier = this.modifier;
	if(!modifier) modifier = config.messages.subtitleUnknown;
	var modified = this.modified;
	if(modified) modified = modified.formatString(config.options.txtTiddlerLinkTooltipDate);
	else modified = config.messages.subtitleUnknown;
	var descr=store.getTiddlerSlice(this.title,'Description')||'';
	return config.options.txtTiddlerLinkTootip.format([this.title,modifier,modified,this.text.length,descr]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!607 add HREF link on permaview command
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/607 - CLOSED: WON'T FIX
This tweak automatically sets the HREF for the 'permaview' sidebar command link so you can use the 'right click' context menu for faster, easier bookmarking.  Note that this does ''not'' automatically set the permaview in the browser's current location URL... it just sets the HREF on the command link.  You still have to click the link to apply the permaview.
***/
//{{{
config.macros.permaview.handler = function(place)
{
	var btn=createTiddlyButton(place,this.label,this.prompt,this.onClick);
	addEvent(btn,'mouseover',this.setHREF);
	addEvent(btn,'focus',this.setHREF);
};
config.macros.permaview.setHREF = function(event){
	var links = [];
	story.forEachTiddler(function(title,element) {
		links.push(String.encodeTiddlyLink(title));
	});
	var newURL=document.location.href;
	var hashPos=newURL.indexOf('#');
	if (hashPos!=-1) newURL=newURL.substr(0,hashPos);
	this.href=newURL+'#'+encodeURIComponent(links.join(' '));
}
//}}}
// // }}}}}}// // {{block{
/***
!!!458 add permalink-like HREFs on internal TiddlyLinks
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/458 - CLOSED: WON'T FIX
This tweak assigns a permalink-like HREF to internal Tiddler links (which normally do not have any HREF defined).  This permits the link's context menu (right-click) to include 'open link in another window/tab' command.  Based on a request from Dustin Spicuzza.
***/
//{{{
window.coreTweaks_createTiddlyLink=window.createTiddlyLink;
window.createTiddlyLink=function(place,title,includeText,theClass,isStatic,linkedFromTiddler,noToggle)
{
	// create the core button, then add the HREF (to internal links only)
	var link=window.coreTweaks_createTiddlyLink.apply(this,arguments);
	if (!isStatic)
		link.href=document.location.href.split('#')[0]+'#'+encodeURIComponent(String.encodeTiddlyLink(title));
	return link;
}
//}}}
// // }}}}}}
// // <<foldHeadings>>
/***
|Name|PreviewPlugin|
|Source|http://www.TiddlyTools.com/#PreviewPlugin|
|Documentation|http://www.TiddlyTools.com/#PreviewPluginInfo|
|Version|1.8.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|add key-by-key wikified preview to any textarea input field|
Provides key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content as you type input into a textarea (multi-line) edit field.
!!!!!Documentation
>see [[PreviewPluginInfo]]
!!!!!Configuration
<<<
Automatically freeze preview updates when a tiddler takes more than <<option txtPreviewAutoFreeze>> milliseconds to render.
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.11.18 [1.8.1] in config.commands.previewTiddler, changed alt command text to use character-based "psuedo-checkbox" instead of embedded html fragment
2007.09.27 [1.8.0] split TidIDE preview functionality into separate stand-alone plugin (see [[TidIDEPlugin]]).  
|please see [[TidIDEPluginInfo]] for additional revision details|
2006.04.15 [0.5.0] Initial ALPHA release. Converted from inline script.
<<<
!!!!!Code
***/
// // version info
//{{{
version.extensions.PreviewPlugin= {major: 1, minor: 8, revision: 1, date: new Date(2007,11,18)};
//}}}

// //  macro definition
//{{{
if (config.options.txtPreviewAutoFreeze==undefined)
	config.options.txtPreviewAutoFreeze=250; // limit (in milliseconds) for auto-freezing preview display

config.macros.preview = {
	renderMsg: "rendering preview...",
	timeoutMsg: " (> %0ms)",
	freezeMsg: " - preview is frozen.  Press [refresh] to re-display.",
	handler: function(place,macroName,params) {
		var hide=params[0]=="hide"; if (hide) params.shift();
		var field=params[0];
		var height=params[1]; if (!height) height=15;
		var here=this.findContainingForm(place);
		if (!here) here=story.findContainingTiddler(place);
		if (!here) here=place.parentNode;
		if (!here) here=place;
		var elems=here.getElementsByTagName("textarea");
		if (field) for (var e=0; e<elems.length; e++)  // find matching textarea (by fieldname)
			if (elems[e].getAttribute("edit")==field) var ta=elems[e];
		else
			if (elems.length) var ta=elems[elems.length-1]; // default to last rendered text area
		if (!ta) {
			var elems=here.getElementsByTagName("input");
			if (field) for (var e=0; e<elems.length; e++)  // find matching input field (by fieldname)
				if (elems[e].getAttribute("edit")==field) var ta=elems[e];
			else
				if (elems.length) var ta=elems[elems.length-1]; // default to last rendered input field
		}
		if (!ta) return false; // no textarea or input field found... do nothing...
		var id=(new Date().getTime()).toString()+Math.random(); // unique instance ID
		ta.id=id+"_edit";
		ta.setAttribute("previewid",id+"_preview");
		ta.saved_onkeyup=ta.onkeyup;
		ta.onkeyup=function(ev) {
			if (this.saved_onkeyup) this.saved_onkeyup.apply(this,arguments);
			config.macros.preview.render(this.id,this.getAttribute("previewid"));
		}
		var html=this.html.replace(/%previd%/g,id+"_preview")
		html=html.replace(/%srcid%/g,id+"_edit");
		html=html.replace(/%hide%/g,hide?"none":"block");
		html=html.replace(/%limit%/g,config.options.txtPreviewAutoFreeze);
		html=html.replace(/%frozen%/g,hide?"checked":"");
		html=html.replace(/%height%/g,height);
		html=html.replace(/%halfheight%/g,height/2);
		createTiddlyElement(place,"span").innerHTML=html;
		this.render(id+"_edit",id+"_preview");
	},
	findContainingForm: function(e) {
		while (e && e.nodeName.toLowerCase()!="form") e=e.parentNode;
		return e;
	},
	render: function(srcid,previd,force) {
		var value=document.getElementById(srcid).value;
		var panel=document.getElementById(previd);
		var f=this.findContainingForm(panel);
		if (!f || (f.freeze.checked && !force)) return;
		var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
		p.innerHTML="";
		f.status.value=this.renderMsg;
		var start=new Date();
		wikify(value.replace(/\r/g,''),p);
		var end=new Date();
		this.renderDOM(previd);
		this.renderHTML(previd);
		f.status.value="elapsed: "+(end-start+1)+"ms";
		// automatically suspend preview updates for slow rendering tiddlers
		if (end-start+1>config.options.txtPreviewAutoFreeze) {
			f.freeze.checked=true;
			f.status.value+=this.timeoutMsg.format([config.options.txtPreviewAutoFreeze]);
		}
		if (f.freeze.checked) f.status.value+=this.freezeMsg;
	},
	renderDOM: function(id) {
		var panel=document.getElementById(id);
		var f=this.findContainingForm(panel); if (!f) return;
		var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
		var height=p.getAttribute("height");
		p.style.height=((f.dom.checked||f.html.checked)?height/2:height)+"em";
		if (f.dom.checked) d.value=this.getNodeTree(p,"|  ");
		if (!d.style||!h.style) return;
		d.style.height=height/2+"em";
		d.style.display=f.dom.checked?"inline":"none";
		d.style.width=f.html.checked?"49.5%":"100%";
		h.style.width=f.dom.checked?"49.5%":"100%";
	},
	renderHTML: function(id) {
		var panel=document.getElementById(id);
		var f=this.findContainingForm(panel); if (!f) return;
		var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
		var height=p.getAttribute("height");
		p.style.height=((f.dom.checked||f.html.checked)?height/2:height)+"em";
		if (f.html.checked) h.value=this.formatHTML(p.innerHTML);
		if (!h.style||!d.style) return;
		h.style.height=height/2+"em";
		h.style.display=f.html.checked?"inline":"none";
		h.style.width=f.dom.checked?"49.5%":"100%";
		d.style.width=f.html.checked?"49.5%":"100%";
	},
	formatHTML: function(txt) {
		if (config.browser.isIE) return txt; // BYPASS - 4/24/2006 due to IE hang problem.  Will fix later...
		var out="";
		var indent="";
		var level=0;
		for (var i=0;i<txt.length;i++) {
			var c=txt.substr(i,1);
			if (c=="<") {
					if (txt.substr(i+1,1)=="/")  indent=indent.substr(0,indent.length-2);
				out+="\n"+indent;
				if (txt.substr(i+1,1)!="/" && txt.substr(i+1,3)!="br>" && txt.substr(i+1,2)!="p>" && txt.substr(i+1,3)!="hr>")  indent+="  ";
			}
			out+=c;
				if (c=="\n")
				out+=indent;
			if (c==">" && txt.substr(i+1,1)!="<")
				out+="\n"+indent;
		}
		return out;
	},
	getNodeTree: function(theNode,theIndent,showPath,inline,thePrefix,thePath)
	{
		if (!theNode) return "";
		if (!thePrefix) thePrefix="";
		if (!thePath) thePath="";
		var mquote='"'+(inline?"{{{":"");
		var endmquote=(inline?"}}}":"")+'"';
		// generate output for this node
		var out = thePrefix;
		if (showPath && thePath.length)
				out += (inline?"//":"")+thePath.substr(1)+":"+(inline?"//":"")+"\r\n"+thePrefix;
		if (theNode.className=="DOMViewer")
			return out+'[DOMViewer]\r\n'; // avoid self-referential recursion
		out += (inline?"''":"")+theNode.nodeName.toUpperCase()+(inline?"''":"");
		if (theNode.nodeName=="#text")
			out += ' '+mquote+theNode.nodeValue.replace(/\n/g,'\\n')+endmquote;
		if (theNode.className)
			out += ' class='+mquote+theNode.className+endmquote;
		if (theNode.type)
			out += ' type='+mquote+theNode.type+endmquote;
		if (theNode.id)
			out += ' id='+mquote+theNode.id+endmquote;
		if (theNode.name)
			out += " "+theNode.name+(theNode.value?"="+mquote+theNode.value+endmquote:"");
		if (theNode.href)
			out += ' href='+mquote+theNode.href+endmquote;
		if (theNode.src)
			out += ' src='+mquote+theNode.src+endmquote;
		if (theNode.attributes && theNode.getAttribute("tiddlyLink")!=undefined)
			out += ' tiddler='+mquote+theNode.getAttribute("tiddlyLink")+endmquote;
		out += "\r\n";
		// recursively generate output for child nodes
		thePath=thePath+"."+theNode.nodeName.toLowerCase();
		thePrefix=theIndent+thePrefix;
		for (var i=0;i<theNode.childNodes.length;i++)
		{
			var thisChild=theNode.childNodes.item(i);
			var theNum=(inline?"~~":"(")+(i+1)+(inline?"~~":")");
			out += this.getNodeTree(thisChild,theIndent,showPath,inline,thePrefix,thePath+theNum);
		}
		return out;
	},
	html: " <form style='width:100%'><span id='%previd%' editID='%srcid%' style='display:%hide%'><div class='viewer' \
			height='%height%' style='margin:0;margin-top:.5em;height:%height%em;overflow:auto;white-space:normal'> \
			&nbsp; \
			</div> \
		<!-- DOM and HTML viewers --> \
		<textarea name=domview cols=60 rows=12 wrap=off \
			onfocus='this.select()' style='display:none;width:100%;height:%halfheight%em;'></textarea><!-- \
		--><textarea name=htmlview cols=60 rows=12 wrap=off \
			onfocus='this.select()' style='display:none;width:100%;height:%halfheight%em;'></textarea> \
		<!-- status line, preview option checkboxes, run/refresh buttons --> \
		<table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \
		<td style='border:0;padding:0;margin:0'><!-- \
			--><input type=text name=status style='padding:0;width:100%;' \
				title='ELAPSED: time (in milliseconds) used to render tiddler content in preview display'><!-- \
		--></td><td style='width:1%;border:0;padding:0;margin:0;'><!-- \
			--><input type=text name=limit size='6' maxlength='6' style='padding:0;width:5em;text-align:center' \
				value='%limit%ms' title='TIME LIMIT: maximum rendering time (in milliseconds) before auto-freezing preview' \
				onfocus='this.select()' \
				onchange='var val=this.value.replace(/[^0-9]/g,\"\"); if (!val.length) val=this.defaultValue; \
					this.value=val+\"ms\"; config.options.txtPreviewAutoFreeze=val; saveOptionCookie(\"txtPreviewAutoFreeze\"); \
					this.form.freeze.checked=false; config.macros.preview.render(\"%srcid%\",\"%previd%\",true);'><!-- \
		--></td><td style='width:1%;border:0;padding:0;margin:0;'><!-- \
			--><input type=text name=height size='4' maxlength='4' style='padding:0;width:4em;text-align:center' \
				value='%height%em' title='HEIGHT: size (in \"ems\") of preview area, including controls' \
				onfocus='this.select()' \
				onchange='var val=this.value.replace(/[^0-9]/g,\"\");  if (!val.length) val=this.defaultValue; \
					this.value=val+\"em\"; document.getElementById(\"%previd%\").firstChild.setAttribute(\"height\",val); \
					config.macros.preview.render(\"%srcid%\",\"%previd%\",true)'><!-- \
		--></td><td style='width:1%;border:0;padding:0;margin:0;text-align:right;white-space:nowrap'> \
			<input type=checkbox name=dom style='display:inline;width:auto;margin:1px;' \
				title='show Document Object Model (DOM) information' \
				onclick='config.macros.preview.renderDOM(\"%previd%\");'>DOM \
			<input type=checkbox name=html style='display:inline;width:auto;margin:1px;' \
				title='show rendered HTML' \
				onclick='config.macros.preview.renderHTML(\"%previd%\");'>HTML \
			<input type=checkbox name=freeze style='display:inline;width:auto;margin:1px;' %frozen% \
				title='do not update preview display as changes are made' \
				onclick='var p=document.getElementById(\"%previd%\");  \
					if (this.checked) this.form.status.value+=config.macros.preview.freezeMsg; \
					else config.macros.preview.render(\"%srcid%\",\"%previd%\",true);'>freeze \
			<input type=button style='display:inline;width:auto;' value='refresh' \
				title='update preview display' \
				onclick='config.macros.preview.render(\"%srcid%\",\"%previd%\",true)'> \
		</td></tr></table> \
		</span></form>"
}
//}}}

// // toolbar definition
//{{{
config.commands.previewTiddler = {
	text: 'preview',
	tooltip: 'show key-by-key preview',
	text_alt: '\u221Apreview',
	handler: function(event,src,title) {
		var here=story.findContainingTiddler(src); if (!here) return;
		var elems=here.getElementsByTagName("span");
		for (var e=0; e<elems.length; e++) {
			if (elems[e].getAttribute("editid")) {
				var show=elems[e].style.display=="none";
				src.innerHTML=show?this.text_alt:this.text;
				elems[e].style.display=show?"block":"none";
				config.macros.preview.findContainingForm(elems[e]).freeze.checked=!show;
				if (show) config.macros.preview.render(elems[e].getAttribute("editid"),elems[e].id);
			}
		}
		return false;
	}
};
//}}}
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]] wikibar'></div>
<div class='wikibar' macro='wikibar'></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='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<div class='editor' macro='edit tags'></div>
<br>
<div class='editor' macro='edit editsummary'>Edit summary</div>
<br>
<div class='toolbar2' macro='toolbar [[ToolbarCommands::EditToolbar]]'>
<span class='toolbar2' macro='toolbar previewTiddler'></span></div>
<br>
<div macro='preview hide fieldname height'></div>
<!--}}}-->
/***
|''Name:''|WikiBar|
|''Version:''|2.0.0 beta3|
|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|
|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|
|''Type:''|toolbar macro command extension|
|''Required:''|TiddlyWiki 2.0.0 beta6|
!Description
WikiBar is a toolbar that gives access to most of TiddlyWiki's formatting features with a few clicks. It's a handy tool for people who are not familiar with TiddlyWiki syntax.
Besides, with WikiBar-addons, users can extend the power of WikiBar.
!Support browser
*Firefox 1.5
!Revision history
*v2.0.0 beta3 (2005/12/30)
** remove macros (replaced by TWMacro addon)
** add wikibar command in toolbar automatically
** rename DOIT to HANDLER
** rename TIP to TOOLTIP
*v2.0.0 beta2 (2005/12/21)
** re-design Wikibar addon framework
*v2.0.0 beta1 (2005/12/14)
** Note:
*** WikiBarPlugin is renamed to WikiBar
** New Features:
*** support TiddlyWiki 2.0.0 template mechanism
*** new wikibar data structure
*** new wikibar-addon framework for developers
**** support dynamic popup menu generator
*** support most new macros added in TiddlyWiki 2.0.0
*** multi-level popup menu
*** fix wikibar tab stop
*** remove paletteSelector
** Known Bugs:
*** popup-menu and color-picker can't be closed correctly
*** some macros can't be displayed correctly in previewer
*** text in previewer will be displayed italic
*v1.2.0 (2005/11/21)
**New Features:
***User defined color palettes supported
####Get color palettes from [[ColorZilla Palettes|http://www.iosart.com/firefox/colorzilla/palettes.html]].
####Save the palette file(*.gpl) as a new tiddler and tag it with 'ColorPalettes', then you can use it in WikiBar.
***WikiBar style sheet supported
***Click on document to close current colorPicker, paletteSelector or aboutWikibar
*v1.1.1 (2005/11/03)
**Bugs fixed:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.1.0 (2005/11/01)
**Bugs fixed:
***WikiBar overruns (reported by by GeoffS <gslocock@yahoo.co.uk>)
**New features:
***Insert a color code at the cursor. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Enable gradient macro. (Thanks to RunningUtes <RunningUtes@gmail.com>)
***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by TiddlyWiki 1.2.37)
***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by TiddlyWiki 1.2.37)
**Enhanced:
***Allow optional parameters in syntax.
**Bugs:
***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'
*v1.0.0 (2005/10/30)
**Initial release
!Code
***/
//{{{
config.macros.wikibar = {major: 2, minor: 0, revision: 0, beta: 3, date: new Date(2005,12,30)};
config.macros.wikibar.handler = function(place,macroName,params,wikifier,paramString,tiddler){
  if(!(tiddler instanceof Tiddler))  {return;}
	story.setDirty(tiddler.title,true);
  place.id = 'wikibar'+tiddler.title;
  place.className = 'toolbar wikibar';
};
function wikibar_install(){
  config.commands.wikibar = {
  	text: 'wikibar',
  	tooltip: 'wikibar on/off',
  	handler: function(e,src,title) {
      if(!e){ e = window.event; }
      var theButton = resolveTarget(e);
      theButton.id = 'wikibarButton'+title;
      wikibarPopup.remove();
      wikibar_installAddons(theButton, title);
      wikibar_createWikibar(title);
      return(false);
    }
  };
  config.shadowTiddlers['EditTemplate'] = wikibar_addWikibarCommand(config.shadowTiddlers['EditTemplate']);
  var tiddler = store.getTiddler('EditTemplate');
  if(tiddler){
    tiddler.text = wikibar_addWikibarCommand(tiddler.text);
  }
}
function wikibar_installAddons(theButton, title){
 	var tiddlers = store.getTaggedTiddlers('wikibarAddons');
	if(!tiddlers)	  { return; }
	theButton.addons=[];
  for(var i=0; i<tiddlers.length; i++){
    try{
      eval(tiddlers[i].text);
      try{
        wikibar_addonInstall(title);
        wikibar_addonInstall = null;
        theButton.addons.push({ok:true, name:tiddlers[i].title});
      }catch(ex){
        theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
      }
    }catch(ex){
      theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});
    }
  }
}
function wikibar_addWikibarCommand(tiddlerText){
  var div = document.createElement('div');
  div.style.display = 'none';
  div.innerHTML = tiddlerText;
  for(var i=0; i<div.childNodes.length; i++){
    var o=div.childNodes[i];
    if(o.tagName==='DIV'){
      if(o.className=='toolbar'){
        var macroText = o.getAttribute('macro').trim();
        if(macroText.search('wikibar')<=0){
          macroText += ' wikibar';
          o.setAttribute('macro', macroText);
        }
        break;
      }
    }
  }
  return div.innerHTML.replace(/\"/g, "\'");
}
function wikibar_processSyntaxParams(theSyntax, params){
  try{
    var pcr = 'AplWikibarPcr';
    var rx=null;
    var allParams=null;
    if(params){
      if(typeof(params)=='object'){
        for(var i=0; i<params.length; i++){
          if(params[i]){
            params[i] = params[i].replace(new RegExp('%','g'), pcr).trim();
            rx = '(\\[%'+(i+1)+'\\])' + '|' + '(%'+(i+1)+')';
            theSyntax = theSyntax.replace(new RegExp(rx,'g'), params[i] );
          }
        }
        allParams = params.join(' ').trim();
      }else{
        allParams = params.replace(new RegExp('%','g'), pcr).trim();
        rx = /(\[%1{1}\])|(%1{1})/g;
        theSyntax = theSyntax.replace(rx, allParams);
      }
    }
    if(allParams){
      theSyntax = theSyntax.replace(new RegExp('%N{1}','g'), allParams);
    }
    rx=/\[%(([1-9]{1,}[0-9]{0,})|(N{1}))\]/g;
    theSyntax = theSyntax.replace(rx, '');
    rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;
    if( theSyntax.match(rx) ){
      throw 'Not enough parameters! ' + theSyntax;
    }
    theSyntax=theSyntax.replace(new RegExp(pcr,'g'), '%');
    return theSyntax;
  } catch(ex){
    return null;
  }
}
function wikibar_resolveEditItem(tiddlerWrapper, itemName){
  if(tiddlerWrapper.hasChildNodes()){
    var c=tiddlerWrapper.childNodes;
    for(var i=0; i<c.length; i++){
      var txt=wikibar_resolveEditItem(c[i], itemName);
      if(!txt){
        continue;
      }else{
        return txt;
      }
    }
  }
  return ((tiddlerWrapper.getAttribute && tiddlerWrapper.getAttribute('edit')==itemName)? tiddlerWrapper : null);
}
function wikibar_resolveEditItemValue(tiddlerWrapper, itemName){
  var o = wikibar_resolveEditItem(tiddlerWrapper, itemName);
  return (o? o.value.replace(/\r/mg,'') : null);
}
function wikibar_resolveTiddlerEditorWrapper(obj){
  if(obj.id=='tiddlerDisplay'){return null;}
  if((obj.getAttribute && obj.getAttribute('macro')=='edit text')){return obj;}
  return wikibar_resolveTiddlerEditorWrapper(obj.parentNode);
}
function wikibar_resolveTiddlerEditor(obj){
  if(obj.hasChildNodes()){
    var c = obj.childNodes;
    for(var i=0; i<c.length; i++){
      var o=wikibar_resolveTiddlerEditor(c[i]);
      if(o){ return o;}
    }
  }
  return ((obj.getAttribute && obj.getAttribute('edit')=='text')? obj : null);
}
function wikibar_resolveTargetButton(obj){
  if(obj.id && obj.id.substring(0,7)=='wikibar'){ return null; }
  if(obj.tiddlerTitle){
    return obj;
  }else{
    return wikibar_resolveTargetButton(obj.parentNode);
  }
}
function wikibar_isValidMenuItem(tool){
  if(!tool){  return false; }
  if(tool.TYPE=='MENU' || tool.TYPE=='MAIN_MENU'){
    for(var key in tool){
      if(key.substring(0,8)=='DYNAITEM'){ return true; }
      if(wikibar_isValidMenuItem(tool[key])){ return true; }
    }
    return false;
  }else{
    return (tool.HANDLER? true : false);
  }
}
function wikibar_editFormat(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
	  frontText  = fullText.substring(0, ss);
	  endText    = fullText.substring(se, fullText.length);
	}
	else if(ss===0 && (se===0 || se == fullText.length) ){
    endText    = fullText;
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByWord(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){return;}
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var selText  = '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
	  frontText  = fullText.substring(0, ss);
	  selText	   = fullText.substring(ss,se);
	  endText    = fullText.substring(se, fullText.length);
	}
	else if(ss===0 && (se===0 || se == fullText.length) ){
    endText    = fullText;
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
	  if(!( fullText.charAt(ss-1).match(/\W/gi) || fullText.charAt(ss).match(/\W/gi) )){
      var m = frontText.match(/\W/gi);
      if(m){
        ss = frontText.lastIndexOf(m[m.length-1])+1;
      }
      else{
        ss = 0;
      }
      m = endText.match(/\W/gi);
      if(m){
        se += endText.indexOf(m[0]);
      }
      else{
        se = fullText.length;
      }
      frontText = fullText.substring(0, ss);
  	  endText   = fullText.substring(se, fullText.length);
  	  selText   = fullText.substring(ss,se);
	  }
	}
	if(selText.length>0){
		repText = repText.replace('user_text', selText);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByCursor(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
	  frontText  = fullText.substring(0, ss);
	  endText    = fullText.substring(se, fullText.length);
	}
	else if(ss===0 && (se===0 || se == fullText.length) ){
    endText    = fullText;
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByLine(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var selText  = '';
	var endText  = '';
	var fullText = editor.value;
	if(se>ss && ss>=0){
		if(this.byBlock){
	    frontText  = fullText.substring(0, ss);
	    selText		 = fullText.substring(ss,se);
	    endText    = fullText.substring(se, fullText.length);
		}
		else{
	  	se = ss;
		}
	}
  if(ss===0 && (se===0 || se == fullText.length) ){
    var m=fullText.match(/(\n|\r)/g);
    if(m){
      se = fullText.indexOf(m[0]);
    }else{
      se = fullText.length;
    }
    selText    = fullText.substring(0, se);
    endText    = fullText.substring(se, fullText.length);
	}
	else if(se==ss && ss>0){
    frontText  = fullText.substring(0, ss);
    endText    = fullText.substring(se, fullText.length);
    m = frontText.match(/(\n|\r)/g);
    if(m){
      ss = frontText.lastIndexOf(m[m.length-1])+1;
    }
    else{
      ss = 0;
    }
    m = endText.match(/(\n|\r)/g);
    if(m){
      se += endText.indexOf(m[0]);
    }
    else{
      se = fullText.length;
    }
    frontText = fullText.substring(0, ss);
	  selText   = fullText.substring(ss,se);
	  endText   = fullText.substring(se, fullText.length);
	}
	if(selText.length>0){
		repText = repText.replace('user_text', selText);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	if(this.byBlock){
    if( (frontText.charAt(frontText.length-1)!='\n') && ss>0 ){
    	repText = '\n' + repText;
    }
    if( (endText.charAt(0)!='\n') || se==fullText.length){
    	repText += '\n';
    }
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editFormatByTableCell(param){
  var editor = param.button.editor;
  var params = param.params;
  clearMessage();
  if(!editor){ return; }
  var repText = wikibar_processSyntaxParams(this.syntax, params);
  if(repText===null){ return; }
	var st = editor.scrollTop;
	var ss = editor.selectionStart;
	var se = editor.selectionEnd;
	var frontText= '';
	var selText  = '';
	var endText  = '';
	var fullText = editor.value;
	if(ss===0 || ss==fullText.length){
		throw 'not valid cell!';
	}
	se=ss;
  frontText  = fullText.substring(0, ss);
  endText    = fullText.substring(se, fullText.length);
  i=frontText.lastIndexOf('\n');
  j=frontText.lastIndexOf('|');
  if(i>j || j<0){
  	throw 'not valid cell!';
  }
	ss = j+1;
  i=endText.indexOf('\n');
  j=endText.indexOf('|');
  if(i<j || j<0){
  	throw 'not valid cell!';
  }
  se += j;
  frontText = fullText.substring(0, ss-1);
  selText   = fullText.substring(ss,se);
  endText   = fullText.substring(se+1, fullText.length);
	if(this.key.substring(0,5)=='align'){
		selText = selText.trim();
		if(	selText=='>' || selText=='~' ||	selText.substring(0,8)=='bgcolor(')	{return; }
	}
	if(selText.length>0){
		repText = repText.replace('user_text', selText);
	}
	if(repText.indexOf('user_text')>=0 && this.hint){
		repText = repText.replace('user_text', this.hint);
	}
	editor.value = frontText + repText + endText;
	editor.selectionStart = ss;
	editor.selectionEnd   = ss + repText.length - 2;
	editor.scrollTop      = st;
	editor.focus();
}
function wikibar_editSelectAll(param){
  var editor = param.button.editor;
	editor.selectionStart = 0;
	editor.selectionEnd   = editor.value.length;
	editor.scrollTop      = 0;
	editor.focus();
}
function wikibar_doPreview(param){
  var theButton = param.button;
  var editor = param.button.editor;
  var wikibar = theButton.parentNode;
  if(!wikibar)  { return; }
  title = theButton.tiddlerTitle;
  var editorWrapper = wikibar_resolveTiddlerEditorWrapper(editor);
  var tiddlerWrapper = editorWrapper.parentNode;
  var previewer = document.getElementById('previewer'+title);
  if(previewer){
    previewer.parentNode.removeChild(previewer);
    editorWrapper.style.display = 'block';
    visible=true;
  }else{
    previewer = document.createElement('div');
    previewer.id = 'previewer'+title;
    previewer.className = 'viewer previewer';
    previewer.style.height = (editor.offsetHeight) + 'px';
    wikify(editor.value, previewer);
    tiddlerWrapper.insertBefore(previewer, editorWrapper);
    editorWrapper.style.display = 'none';
    visible=false;
  }
  var pv=null;
  for(var i=0; i<wikibar.childNodes.length; i++){
    try{
      var btn = wikibar.childNodes[i];
      if(btn.toolItem.key == 'preview'){ pv=btn; }
      if(btn.toolItem.key != 'preview'){
        btn.style.display = visible ? '': 'none';
      }
    }catch(ex){}
  }
  if(!pv) { return; }
  if(visible){
    pv.innerHTML = '<font face=\"verdana\">&infin;</font>';
    pv.title = 'preview current tiddler';
  }
  else{
    pv.innerHTML = '<font face=\"verdana\">&larr;</font>';
    pv.title = 'back to editor';
  }
}
function wikibar_doListAddons(param){
  clearMessage();
  var title = param.button.tiddlerTitle;
  var wikibarButton = document.getElementById('wikibarButton'+title);
  var ok=0, fail=0;
  for(var i=0; i<wikibarButton.addons.length; i++){
    var addon=wikibarButton.addons[i];
    if(addon.ok){
      displayMessage('[ o ] '+addon.name);
      ok++;
    }
    else{
      displayMessage('[ x ] '+addon.name + ': ' + addon.error);
      fail++;
    }
  }
  displayMessage('---------------------------------');
  displayMessage(ok + ' ok ; ' + fail + ' failed');
}
function wikibar_getColorCode(param){
  var cbOnPickColor = function(colorCode, param){
    param.params = colorCode;
    param.button.toolItem.doMore(param);
  };
  wikibarColorTool.openColorPicker(param.button, cbOnPickColor, param);
}
function wikibar_getLinkUrl(param){
  var url= prompt('Please enter the link target', (this.param? this.param : ''));
  if (url && url.trim().length>0){
    param.params = url;
    this.doMore(param);
  }
}
function wikibar_getTableRowCol(param){
  var rc= prompt('Please enter (rows x cols) of the table', '2 x 3');
  if (!rc || (rc.trim()).length<=0){ return; }
  var arr = rc.toUpperCase().split('X');
  if(arr.length != 2)   { return; }
  for(var i=0; i<arr.length; i++){
    if(isNaN(arr[i].trim()))  { return; }
  }
  var rows = parseInt(arr[0].trim(), 10);
  var cols = parseInt(arr[1].trim(), 10);
  var txtTable='';
  for(var r=0; r<rows; r++){
    for(var c=0; c<=cols; c++){
      if(c===0){
        txtTable += '|';
      }else{
        txtTable += ' |';
      }
    }
    txtTable += '\n';
  }
  if(txtTable.trim().length>0){
    param.params = txtTable.trim();
    this.doMore(param);
  }
}
function wikibar_getMacroParam(param){
  var p = prompt('Please enter the parameters of macro \"' + this.key + '\":' +
                 '\nSyntax: ' + this.syntax +
                 '\n\nNote: '+
                 '\n%1,%2,... - parameter needed'+
                 '\n[%1] - optional parameter'+
                 '\n%N   - more than one parameter(1~n)'+
                 '\n[%N] - any number of parameters(0~n)'+
                 '\n\nPS:'+
                 '\n1. Parameters should be seperated with space character'+
                 '\n2. Use \" to wrap the parameter that includes space character, ex: \"hello world\"'+
                 '\n3. Input the word(null) for the optional parameter ignored',
                 (this.param? this.param : '') );
  if(!p)  { return; }
  p=p.readMacroParams();
  for(var i=0; i<p.length; i++){
    var s=p[i].trim();
    if(s.indexOf(' ')>0){ p[i]="'"+s+"'"; }
    if(s.toLowerCase()=='null'){ p[i]=null; }
  }
  param.params = p;
  this.doMore(param);
}
function wikibar_getMorePalette(unused){
  clearMessage();
  displayMessage('Get more color palettes(*.gpl) from ColorZilla Palettes site', 'http:\/\/www.iosart.com/firefox/colorzilla/palettes.html');
  displayMessage('Save it as a new tiddler with \"ColorPalettes\" tag');
}
function wikibar_createWikibar(title){
  var theWikibar = document.getElementById('wikibar' + title);
  if(theWikibar){
    if(theWikibar.hasChildNodes()){
      theWikibar.style.display = (theWikibar.style.display=='block'? 'none':'block');
      return;
    }
  }
  var tiddlerWrapper = document.getElementById('tiddler'+title);
  var theTextarea = wikibar_resolveTiddlerEditor(tiddlerWrapper);
  if(!theTextarea){
    clearMessage();
    displayMessage('WikiBar only works in tiddler edit mode now');
    return;
  }else{
    if(!theTextarea.id){ theTextarea.id = 'editor'+title; }
    if(!theTextarea.parentNode.id){ theTextarea.parentNode.id='editorWrapper'+title;  }
  }
  if(theWikibar){
    theWikibar = document.getElementById('wikibar'+title);
  }else{
    var editorWrapper = wikibar_resolveTiddlerEditorWrapper(theTextarea);
    theWikibar = createTiddlyElement(tiddlerWrapper, 'div', 'wikibar'+title, 'toolbar');
    addClass(theWikibar, 'wikibar');
    var previewer = document.getElementById('previewer'+title);
    if(previewer){
      tiddlerWrapper.insertBefore(theWikibar, previewer);
    }else{
      tiddlerWrapper.insertBefore(theWikibar, editorWrapper);
    }
  }
  wikibar_createMenu(theWikibar,wikibarStore,title,theTextarea);
  if(config.options['chkWikibarSetEditorHeight'] && config.options['txtWikibarEditorRows']){
    theTextarea.rows = config.options['txtWikibarEditorRows'];
  }
  setStylesheet(
    '.wikibar{text-align:left;visibility:visible;margin:2px;padding:1px;}.previewer{overflow:auto;display:block;border:1px solid;}#colorPicker{position:absolute;display:none;z-index:10;margin:0px;padding:0px;}#colorPicker table{margin:0px;padding:0px;border:2px solid #000;border-spacing:0px;border-collapse:collapse;}#colorPicker td{margin:0px;padding:0px;border:1px solid;font-size:11px;text-align:center;cursor:auto;}#colorPicker .header{background-color:#fff;}#colorPicker .button{background-color:#fff;cursor:pointer;cursor:hand;}#colorPicker .button:hover{padding-top:3px;padding-bottom:3px;color:#fff;background-color:#136;}#colorPicker .cell{padding:4px;font-size:7px;cursor:crosshair;}#colorPicker .cell:hover{padding:10px;}.wikibarPopup{position:absolute;z-index:10;border:1px solid #014;color:#014;background-color:#333;}.wikibarPopup table{margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;}.wikibarPopup .button:hover{color:#eee;background-color:#014;}.wikibarPopup .disabled{color:#888;}.wikibarPopup .disabled:hover{color:#888;background-color:#cef;}.wikibarPopup tr .seperator hr{margin:0;padding:0;background-color:#cef;width:100%;border:0;border-top:1px dashed #014;}.wikibarPopup tr .icon{font-family:verdana;font-weight:bolder;}.wikibarPopup tr .marker{font-family:verdana;font-weight:bolder;}.wikibarPopup td{font-size:0.9em;padding:2px;}.wikibarPopup input{border:0;border-bottom:1px solid #014;margin:0;padding:0;font-family:arial;font-size:100%;background-color:#fff;}',
  	'WikiBarStyleSheet');
}
function wikibar_createMenu(place,toolset,title,editor){
  if(!wikibar_isValidMenuItem(toolset)){return;}
  if(!(toolset.TYPE=='MAIN_MENU' || toolset.TYPE=='MENU')){ return; }
    for(var key in toolset){
      if(key.substring(0,9)=='SEPERATOR'){
        wikibar_createMenuSeperator(place);
        continue;
      }
      if(key.substring(0,8)=='DYNAITEM'){
        var dynaTools = toolset[key](title,editor);
        if(dynaTools.TYPE && dynaTools.TYPE=='MENU'){
          wikibar_createMenuItem(place,dynaTools,null,editor,title);
        }else{
          dynaTools.TYPE = 'MENU';
          wikibar_createMenu(place, dynaTools, title, editor);
        }
        continue;
      }
      if((toolset[key].TYPE!='MENU' && toolset[key].TYPE!='MAIN_MENU') && !toolset[key].HANDLER){continue;}
      wikibar_createMenuItem(place,toolset,key,editor,title);
    }
}
function wikibar_createMenuItem(place,toolset,key,editor,title){
  if(!key){
    var tool = toolset;
  }else{
    tool = toolset[key];
    tool.key = key;
  }
  if(!wikibar_isValidMenuItem(tool)){return;}
  var toolIsOnMainMenu = (toolset.TYPE=='MAIN_MENU');
  var toolIsMenu = (tool.TYPE=='MENU');
  var theButton;
  if(toolIsOnMainMenu){
    theButton = createTiddlyButton(
                  place,
                  '',
                  (tool.TOOLTIP? tool.TOOLTIP : ''),
                  (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem),
                  'button');
    theButton.innerHTML = (tool.CAPTION? tool.CAPTION : key);
    theButton.isOnMainMenu = true;
    addClass(theButton, (toolIsMenu? 'menu' : 'item'));
  	place.appendChild( document.createTextNode('\n') );
    if(!toolIsMenu){
      if(config.options['chkWikibarPopmenuOnMouseOver']){
        theButton.onmouseover = function(e){ wikibarPopup.remove(); };
      }
    }
  }else{
    theButton=createTiddlyElement(place, 'tr',key,'button');
    theButton.title = (tool.TOOLTIP? tool.TOOLTIP : '');
    theButton.onclick = (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem);
    var tdL = createTiddlyElement(theButton, 'td','','marker');
    var td = createTiddlyElement(theButton, 'td');
    var tdR = createTiddlyElement(theButton, 'td','','marker');
    td.innerHTML = (tool.CAPTION? tool.CAPTION : key);
    if(toolIsMenu){
      tdR.innerHTML='&nbsp;&nbsp;&rsaquo;';
    }
    if(tool.SELECTED){
      tdL.innerHTML = '&radic; ';
      addClass(theButton, 'selected');
    }
    if(tool.DISABLED){
      addClass(theButton, 'disabled');
    }
  }
  theButton.tiddlerTitle = title;
  theButton.toolItem = tool;
  theButton.editor = editor;
  theButton.tabIndex = 999;
  if(toolIsMenu){
    if(config.options['chkWikibarPopmenuOnMouseOver']){
      theButton.onmouseover = wikibar_onClickMenuItem;
    }
  }
}
function wikibar_createMenuSeperator(place){
  if(place.id.substring(0,7)=='wikibar')  { return; }
  var onclickSeperator=function(e){
  	if(!e){ e = window.event; }
  	e.cancelBubble = true;
    if (e.stopPropagation){ e.stopPropagation();  }
  	return(false);
  };
  var theButton=createTiddlyElement(place,'tr','','seperator');
  var td = createTiddlyElement(theButton, 'td','','seperator');
  td.colSpan=3;
  theButton.onclick=onclickSeperator;
	td.innerHTML = '<hr>';
}
function wikibar_genWikibarAbout(){
  var toolset={};
  toolset.version = {
    CAPTION: '<center>WikiBar ' +
              config.macros.wikibar.major + '.' +
              config.macros.wikibar.minor + '.' +
              config.macros.wikibar.revision +
              (config.macros.wikibar.beta? ' beta '+config.macros.wikibar.beta : '') +
              '</center>',
    HANDLER: function(){}
  };
  toolset.SEPERATOR = {};
  toolset.author = {
    CAPTION: '<center>Arphen Lin<br>arphenlin@gmail.com</center>',
    TOOLTIP: 'send mail to the author',
    HANDLER: function(){ window.open('mailto:arphenlin@gmail.com'); }
  };
  toolset.website = {
    CAPTION: '<center>aiddlywiki.sourceforge.net</center>',
    TOOLTIP: 'go to the web site of WikiBar',
    HANDLER: function(){ window.open('http:\/\/aiddlywiki.sourceforge.net/'); }
  };
  return toolset;
}
function wikibar_genWikibarOptions(title, editor){
  var toolset={};
  toolset.popOnMouseOver = {
    CAPTION:'popup menu on mouse over',
    SELECTED: config.options['chkWikibarPopmenuOnMouseOver'],
    HANDLER: function(param){
      config.options['chkWikibarPopmenuOnMouseOver'] = !config.options['chkWikibarPopmenuOnMouseOver'];
      saveOptionCookie('chkWikibarPopmenuOnMouseOver');
      var title = param.button.tiddlerTitle;
      var wikibar = document.getElementById('wikibar'+title);
      if(wikibar){ wikibar.parentNode.removeChild(wikibar); }
      wikibar_createWikibar(title);
    }
  };
  toolset.setEditorSize = {
    CAPTION:'set editor height: <input id=\"txtWikibarEditorRows\" type=text size=1 MAXLENGTH=3 value=\"' +
            (config.options['txtWikibarEditorRows']? config.options['txtWikibarEditorRows']:editor.rows) + '\"> ok',
    HANDLER: function(param){
      var input = document.getElementById('txtWikibarEditorRows');
      if(input){
        var rows = parseInt(input.value, 10);
        if(!isNaN(rows)){
          var editor = param.button.editor;
          editor.rows = rows;
        }else{
          rows=config.maxEditRows;
        }
        config.options['txtWikibarEditorRows'] = rows;
        saveOptionCookie('txtWikibarEditorRows');
        config.maxEditRows = rows;
      }
    }
  };
  toolset.setEditorSizeOnLoadingWikibar = {
    CAPTION:'set editor height on loading wikibar',
    SELECTED: config.options['chkWikibarSetEditorHeight'],
    HANDLER: function(param){
      config.options['chkWikibarSetEditorHeight'] = !config.options['chkWikibarSetEditorHeight'];
      saveOptionCookie('chkWikibarSetEditorHeight');
      if(config.options['chkWikibarSetEditorHeight']){
        var rows = config.options['txtWikibarEditorRows'];
        if(!isNaN(rows)){ rows = 15; }
        var editor = param.button.editor;
        editor.rows = rows;
        config.options['txtWikibarEditorRows'] = rows;
        saveOptionCookie('txtWikibarEditorRows');
      }
    }
  };
  toolset.SEPERATOR = {};
  toolset.update = {
    CAPTION: 'check for updates',
    DISABLED: true,
    HANDLER: function(){}
  };
  return toolset;
}
function wikibar_genPaletteSelector(){
  try{
  	var cpTiddlers = store.getTaggedTiddlers('ColorPalettes');
  	if(!cpTiddlers) { return; }
  	var palettes=[];
  	palettes.push(wikibarColorTool.defaultPaletteName);
  	for(var i=0; i<cpTiddlers.length; i++){
  		palettes.push(cpTiddlers[i].title.trim());
  	}
    var toolset={};
    for(i=0; i<palettes.length; i++){
      toolset[palettes[i]] = {
        TOOLTIP: palettes[i],
        SELECTED: (palettes[i]==wikibarColorTool.paletteName),
        HANDLER: wikibar_doSelectPalette
      };
    }
    return toolset;
  }catch(ex){ return null; }
}
function wikibar_onClickItem(e){
	if(!e){ e = window.event; }
	var theTarget = resolveTarget(e);
	if(theTarget.tagName=='INPUT'){
    e.cancelBubble = true;
    if (e.stopPropagation){ e.stopPropagation(); }
    return;
	}
	var theButton = wikibar_resolveTargetButton(theTarget);
	if(!theButton){ return(false);  }
  	var o = theButton.toolItem;
    if(!o) { return; }
    var param = {
      event: e,
      button: theButton
    };
    if(o.HANDLER){ o.HANDLER(param);  }
  if(o.DISABLED){
    e.cancelBubble = true;
    if (e.stopPropagation){ e.stopPropagation(); }
  }
	return(false);
}
function wikibar_onClickMenuItem(e){
	if(!e){ e = window.event; }
	var theButton = wikibar_resolveTargetButton(resolveTarget(e));
	if(!theButton){ return(false);  }
	e.cancelBubble = true;
	if (e.stopPropagation){ e.stopPropagation(); }
    var title = theButton.tiddlerTitle;
    var editor = theButton.editor;
    var tool = theButton.toolItem;
    if(!tool) { return; }
    var popup = wikibarPopup.create(this);
  	if(popup){
      wikibar_createMenu(popup,tool,title,editor);
      if(!popup.hasChildNodes()){
        wikibarPopup.remove();
      }else{
        wikibarPopup.show(popup, false);
      }
    }
	return(false);
}
var wikibarColorTool = {
  defaultPaletteName : 'default',
  defaultColumns : 16,
  defaultPalette : [
    '#FFF','#DDD','#CCC','#BBB','#AAA','#999','#666','#333','#111','#000','#FC0','#F90','#F60','#F30','#C30','#C03',
    '#9C0','#9D0','#9E0','#E90','#D90','#C90','#FC3','#FC6','#F96','#F63','#600','#900','#C00','#F00','#F36','#F03',
    '#CF0','#CF3','#330','#660','#990','#CC0','#FF0','#C93','#C63','#300','#933','#C33','#F33','#C36','#F69','#F06',
    '#9F0','#CF6','#9C3','#663','#993','#CC3','#FF3','#960','#930','#633','#C66','#F66','#903','#C39','#F6C','#F09',
    '#6F0','#9F6','#6C3','#690','#996','#CC6','#FF6','#963','#630','#966','#F99','#F39','#C06','#906','#F3C','#F0C',
    '#3F0','#6F3','#390','#6C0','#9F3','#CC9','#FF9','#C96','#C60','#C99','#F9C','#C69','#936','#603','#C09','#303',
    '#0C0','#3C0','#360','#693','#9C6','#CF9','#FFC','#FC9','#F93','#FCC','#C9C','#969','#939','#909','#636','#606',
    '#060','#3C3','#6C6','#0F0','#3F3','#6F6','#9F9','#CFC','#9CF','#FCF','#F9F','#F6F','#F3F','#F0F','#C6C','#C3C',
    '#030','#363','#090','#393','#696','#9C9','#CFF','#39F','#69C','#CCF','#C9F','#96C','#639','#306','#90C','#C0C',
    '#0F3','#0C3','#063','#396','#6C9','#9FC','#9CC','#06C','#369','#99F','#99C','#93F','#60C','#609','#C3F','#C0F',
    '#0F6','#3F6','#093','#0C6','#3F9','#9FF','#699','#036','#039','#66F','#66C','#669','#309','#93C','#C6F','#90F',
    '#0F9','#6F9','#3C6','#096','#6FF','#6CC','#366','#069','#36C','#33F','#33C','#339','#336','#63C','#96F','#60F',
    '#0FC','#6FC','#3C9','#3FF','#3CC','#399','#033','#39C','#69F','#00F','#00C','#009','#006','#003','#63F','#30F',
    '#0C9','#3FC','#0FF','#0CC','#099','#066','#3CF','#6CF','#09C','#36F','#0CF','#09F','#06F','#03F','#03C','#30C'
  ],
	colorPicker : null,
  pickColorHandler: null,
  userData: null
};
wikibarColorTool.paletteName = wikibarColorTool.defaultPaletteName;
wikibarColorTool.columns = wikibarColorTool.defaultColumns;
wikibarColorTool.palette = wikibarColorTool.defaultPalette;
wikibarColorTool.onPickColor = function(e){
	if (!e){ e = window.event; }
	var theCell = resolveTarget(e);
	if(!theCell){ return(false); }
    color = theCell.bgColor.toLowerCase();
    if(!color)  { return; }
    wikibarColorTool.displayColorPicker(false);
    if(wikibarColorTool.pickColorHandler){
      wikibarColorTool.pickColorHandler(color, wikibarColorTool.userData);
    }
	return(false);
};
wikibarColorTool.onMouseOver = function(e){
	if (!e){ e = window.event; }
	var theButton = resolveTarget(e);
	if(!theButton){ return(false);  }
  	if(!wikibarColorTool)  { return; }
    color = theButton.bgColor.toUpperCase();
    if(!color)  { return; }
    td=document.getElementById('colorPickerInfo');
  	if(!td) { return; }
  	td.bgColor = color;
  	td.innerHTML = '<span style=\"color:#000;\">'+color+'</span>&nbsp;&nbsp;&nbsp;' +
  	               '<span style=\"color:#fff;\">'+color+'</span>';
	e.cancelBubble = true;
	if (e.stopPropagation){ e.stopPropagation(); }
	return(false);
};
wikibarColorTool.openColorPicker = function(theTarget, pickColorHandler, userData){
  wikibarColorTool.skipClickDocumentEvent = true;
  wikibarColorTool.pickColorHandler = pickColorHandler;
  wikibarColorTool.userData = userData;
  wikibarColorTool.moveColorPicker(theTarget);
};
wikibarColorTool.convert3to6HexColor = function(c){
  c=c.trim();
  var rx=/^\#(\d|[a-f])(\d|[a-f])(\d|[a-f])$/gi;
  return (rx.test(c)? c.replace(rx, '#$1$1$2$2$3$3') : c);
};
wikibarColorTool.numToHexColor = function (n){
  if(typeof(n)=='number' && (n>=0 && n<=255)) {
  		s = n.toString(16).toLowerCase();
  		return ((s.length==1)? '0'+s : s);
  }else{
	 return null;
	}
};
wikibarColorTool.renderColorPalette = function(){
	if(wikibarColorTool.paletteName==wikibarColorTool.defaultPaletteName){
		wikibarColorTool.palette=wikibarColorTool.defaultPalette;
		wikibarColorTool.columns=wikibarColorTool.defaultColumns;
		return;
	}
	tiddlerText = (store.getTiddlerText(wikibarColorTool.paletteName, '')).trim();
	if(tiddlerText.length<=0) { return; }
	var cpContents = tiddlerText.split('\n');
	var colors=[];
	columns = wikibarColorTool.defaultColumns;
	var tmpArray=null;
	errCount=0;
	for(var i=0; i<cpContents.length; i++){
		cpLine=cpContents[i].trim();
    if( (!cpLine) || (cpLine.length<=0) || (cpLine.charAt(0) == '#') ){ continue; }
		if(cpLine.substring(0,8).toLowerCase()=='columns:'){
			tmpArray = cpLine.split(':');
			try{
				columns = parseInt(tmpArray[1],10);
			}catch(ex){
				columns = wikibarColorTool.defaultColumns;
			}
		}else{
			tmpArray = cpLine.replace('\t', ' ').split(/[ ]{1,}/);
			try{
				color='';
				for(var j=0; j<3; j++){
          c=parseInt(tmpArray[j].trim(), 10);
          if(isNaN(c)){
						break;
          }else{
						c=wikibarColorTool.numToHexColor(c);
						if(!c) {break;}
            color+=c;
					}
				}
				if(color.length==6){
					colors.push('#'+color);
				}	else {
					throw 'error';
				}
			}catch(ex){
			}
		}
	}
	if(colors.length>0){
		wikibarColorTool.palette = colors;
		wikibarColorTool.columns = columns;
	}else{
		throw 'renderColorPalette(): No color defined in the palette.';
	}
};
wikibarColorTool.displayColorPicker = function(visible){
  if(wikibarColorTool.colorPicker){
    wikibarColorTool.colorPicker.style.display = (visible? 'block' : 'none');
  }
};
wikibarColorTool.moveColorPicker = function(theTarget){
  if(!wikibarColorTool.colorPicker){
  	wikibarColorTool.createColorPicker();
  }
	var cp = wikibarColorTool.colorPicker;
	var rootLeft = findPosX(theTarget);
  var rootTop = findPosY(theTarget);
  var popupLeft = rootLeft;
  var popupTop = rootTop;
  var popupWidth = cp.offsetWidth;
  var winWidth = findWindowWidth();
  if(popupLeft + popupWidth > winWidth){
	  popupLeft = winWidth - popupWidth;
	}
  cp.style.left = popupLeft + 'px';
  cp.style.top = popupTop + 'px';
  wikibarColorTool.displayColorPicker(true);
};
wikibarColorTool.createColorPicker = function(unused, palette){
  if(palette){	wikibarColorTool.paletteName=palette; }
	wikibarColorTool.renderColorPalette();
	wikibarColorTool.colorPicker = document.createElement('div');
	wikibarColorTool.colorPicker.id = 'colorPicker';
	document.body.appendChild(wikibarColorTool.colorPicker);
  var theTable = document.createElement('table');
  wikibarColorTool.colorPicker.appendChild(theTable);
  var theTR = document.createElement('tr');
	theTable.appendChild(theTR);
	var theTD = document.createElement('td');
	theTD.className = 'header';
	theTD.colSpan = wikibarColorTool.columns;
	theTD.innerHTML = wikibarColorTool.paletteName;
  theTR.appendChild(theTD);
  for(var i=0; i<wikibarColorTool.palette.length; i++){
    if((i%wikibarColorTool.columns)===0){
      theTR = document.createElement('tr');
      theTable.appendChild(theTR);
    }
    theTD = document.createElement('td');
    theTD.className = 'cell';
    theTD.bgColor = wikibarColorTool.convert3to6HexColor(wikibarColorTool.palette[i]);
    theTD.onclick = wikibarColorTool.onPickColor;
    theTD.onmouseover = wikibarColorTool.onMouseOver;
    theTR.appendChild(theTD);
  }
  rest = wikibarColorTool.palette.length % wikibarColorTool.columns;
  if(rest>0){
    theTD = document.createElement('td');
		theTD.colSpan = wikibarColorTool.columns-rest;
    theTD.bgColor = '#000000';
    theTR.appendChild(theTD);
  }
  theTR = document.createElement('tr');
	theTable.appendChild(theTR);
	theTD = document.createElement('td');
	theTD.colSpan = wikibarColorTool.columns;
	theTD.id = 'colorPickerInfo';
  theTR.appendChild(theTD);
};
wikibarColorTool.onDocumentClick = function(e){
	if (!e){ e = window.event; }
	if(wikibarColorTool.skipClickDocumentEvent) {
	  wikibarColorTool.skipClickDocumentEvent = false;
    return true;
	}
	if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
    wikibarColorTool.displayColorPicker(false);
  }
	return true;
};
function wikibar_doSelectPalette(param){
	clearMessage();
	var theButton = param.button;
	if(!theButton.toolItem.key)  { return; }
	var palette = theButton.toolItem.key;
	var oldPaletteName = wikibarColorTool.paletteName;
	if(oldPaletteName != palette){
		try{
			wikibarColorTool.createColorPicker(theButton, palette);
			displayMessage('Palette \"'+palette+'\" ('+ wikibarColorTool.palette.length +' colors) is selected');
		}catch(ex){
			errMsg = ex;
			if(errMsg.substring(0,18)=='renderColorPalette'){
				displayMessage('Invalid palette \"' + palette + '\", please check it out!');
				wikibarColorTool.createColorPicker(theButton, oldPaletteName);
			}
		}
	}
}
var wikibarPopup = {
  skipClickDocumentEvent: false,
	stack: []
};
wikibarPopup.resolveRootPopup = function(o){
  if(o.isOnMainMenu){  return null; }
  if(o.className.substring(0,12)=='wikibarPopup'){  return o;}
  return wikibarPopup.resolveRootPopup(o.parentNode);
};
wikibarPopup.create = function(root){
  for(var i=0; i<wikibarPopup.stack.length; i++){
    var p=wikibarPopup.stack[i];
    if(p.root==root){
      wikibarPopup.removeFrom(i+1);
      return null;
    }
  }
  var rootPopup = wikibarPopup.resolveRootPopup(root);
  if(!rootPopup){
    wikibarPopup.remove();
  }else{
    wikibarPopup.removeFromRootPopup(rootPopup);
  }
	var popup = createTiddlyElement(document.body,'div','wikibarPopup'+root.toolItem.key,'wikibarPopup');
	var pop = createTiddlyElement(popup,'table','','');
	wikibarPopup.stack.push({rootPopup: rootPopup, root: root, popup: popup});
	return pop;
};
wikibarPopup.show = function(unused,slowly){
	var curr = wikibarPopup.stack[wikibarPopup.stack.length-1];
	var overlayWidth = 1;
  var rootLeft, rootTop, rootWidth, rootHeight, popupLeft, popupTop, popupWidth;
  if(curr.rootPopup){
  	rootLeft = findPosX(curr.rootPopup);
  	rootTop = findPosY(curr.root);
  	rootWidth = curr.rootPopup.offsetWidth;
  	popupLeft = rootLeft + rootWidth - overlayWidth;
  	popupTop = rootTop;
  }else{
  	rootLeft = findPosX(curr.root);
  	rootTop = findPosY(curr.root);
  	rootHeight = curr.root.offsetHeight;
  	popupLeft = rootLeft;
  	popupTop = rootTop + rootHeight;
  }
	var winWidth = findWindowWidth();
	popupWidth = curr.popup.offsetWidth;
	if(popupLeft + popupWidth > winWidth){
		popupLeft = rootLeft - popupWidth + overlayWidth;
	}
	curr.popup.style.left = popupLeft + 'px';
	curr.popup.style.top = popupTop + 'px';
	curr.popup.style.display = 'block';
	addClass(curr.root, 'highlight');
	if(config.options.chkAnimate){
		anim.startAnimating(new Scroller(curr.popup,slowly));
	}else{
		window.scrollTo(0,ensureVisible(curr.popup));
	}
};
wikibarPopup.remove = function(){
	if(wikibarPopup.stack.length > 0){
		wikibarPopup.removeFrom(0);
  }
};
wikibarPopup.removeFrom = function(from){
	for(var t=wikibarPopup.stack.length-1; t>=from; t--){
		var p = wikibarPopup.stack[t];
		removeClass(p.root,'highlight');
		p.popup.parentNode.removeChild(p.popup);
  }
	wikibarPopup.stack = wikibarPopup.stack.slice(0,from);
};
wikibarPopup.removeFromRootPopup = function(from){
  for(var t=0; t<wikibarPopup.stack.length; t++){
    var p = wikibarPopup.stack[t];
    if(p.rootPopup==from){
      wikibarPopup.removeFrom(t);
      break;
    }
  }
};
wikibarPopup.onDocumentClick = function(e){
	if (!e){ e = window.event; }
	if(wikibarPopup.skipClickDocumentEvent){
	 wikibarPopup.skipClickDocumentEvent=false;
	 return true;
	}
	if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){
		wikibarPopup.remove();
	}
	return true;
};
var wikibarStore = {
  TYPE: 'MAIN_MENU',
  help:{
    TYPE:'MENU',
    CAPTION: '<font face=\"verdana\">?</font>',
    TOOLTIP:     'about WikiBar',
    options:{
      TYPE:'MENU',
      DYNAITEM: wikibar_genWikibarOptions
    },
    about:{
      TYPE:'MENU',
      DYNAITEM: wikibar_genWikibarAbout
    }
  },
  preview:{
    TOOLTIP:     'preview this tiddler',
    CAPTION: '<font face=\"verdana\">&infin;</font>',
    HANDLER: wikibar_doPreview
  },
	line:{
		TOOLTIP:    'horizontal line',
		CAPTION: '<font face=\"verdana\">&mdash;</font>',
		syntax: '\n----\n',
		HANDLER: wikibar_editFormatByCursor
	},
	crlf:{
		TOOLTIP:    'new line',
		CAPTION: '<font face=\"verdana\">&para;</font>',
		syntax: '\n',
		HANDLER: wikibar_editFormatByCursor
	},
	selectAll:{
		TOOLTIP:    'select all',
		CAPTION: '<font face=\"verdana\">&sect;</font>',
		HANDLER: wikibar_editSelectAll
	},
	deleteSelected:{
		TOOLTIP:    'delete selected',
		CAPTION: '<font face=\"verdana\">&times;</font>',
		syntax: '',
		HANDLER: wikibar_editFormat
	},
  textFormat:{
    TYPE: 'MENU',
    CAPTION: 'text',
    TOOLTIP: 'text formatters',
    ignore:{
			TOOLTIP:     'ignore wiki word',
			CAPTION: 'ignore wikiWord',
			syntax:  '~user_text',
			hint:    'wiki_word',
			HANDLER:    wikibar_editFormatByWord
		},
		bolder:{
			TOOLTIP:     'bolder text',
			CAPTION: '<strong>bolder</strong>',
			syntax:  "''user_text''",
			hint:		 'bold_text',
			HANDLER:    wikibar_editFormatByWord
		},
		italic:{
			TOOLTIP:    'italic text',
			CAPTION: '<em>italic</em>',
			syntax: '\/\/user_text\/\/',
			hint:		'italic_text',
			HANDLER: wikibar_editFormatByWord
		},
		underline:{
			TOOLTIP:    'underline text',
			CAPTION: '<u>underline</u>',
			syntax: '__user_text__',
			hint:		'underline_text',
			HANDLER: wikibar_editFormatByWord
		},
		strikethrough:{
			TOOLTIP:    'strikethrough text',
			CAPTION: '<strike>strikethrough</strike>',
			syntax: '==user_text==',
			hint:		'strikethrough_text',
			HANDLER: wikibar_editFormatByWord
		},
		superscript:{
			TOOLTIP:    'superscript text',
			CAPTION: 'X<sup>superscript</sup>',
			syntax: '^^user_text^^',
			hint:		'superscript_text',
			HANDLER: wikibar_editFormatByWord
		},
		subscript:{
			TOOLTIP:    'subscript text',
			CAPTION: 'X<sub>subscript</sub>',
			syntax: '~~user_text~~',
			hint:		'subscript_text',
			HANDLER: wikibar_editFormatByWord
		},
		comment:{
			TOOLTIP:    'comment text',
			CAPTION: 'comment text',
			syntax: '/%user_text%/',
			hint:		'comment_text',
			HANDLER: wikibar_editFormatByWord
		},
		monospaced:{
			TOOLTIP:    'monospaced text',
			CAPTION: '<code>monospaced</code>',
			syntax: '{{{user_text}}}',
			hint:		'monospaced_text',
			HANDLER: wikibar_editFormatByWord
		}
  },
  paragraph:{
    TYPE: 'MENU',
    TOOLTIP: 'paragarph formatters',
    list:{
      TYPE: 'MENU',
      TOOLTIP: 'list tools',
      bullet:{
  			TOOLTIP:    'bullet point',
  			syntax: '*user_text',
  			hint:		'bullet_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		numbered:{
  			TOOLTIP:    'numbered list',
  			syntax: '#user_text',
  			hint:		'numbered_text',
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    heading:{
      TYPE: 'MENU',
      heading1:{
  		  CAPTION:'<h1>Heading 1</h1>',
  			TOOLTIP:    'Heading 1',
  			syntax: '!user_text',
  			hint:		'heading_1',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading2:{
  		  CAPTION:'<h2>Heading 2<h2>',
  			TOOLTIP:    'Heading 2',
  			syntax: '!!user_text',
  			hint:		'heading_2',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading3:{
  		  CAPTION:'<h3>Heading 3</h3>',
  			TOOLTIP:    'Heading 3',
  			syntax: '!!!user_text',
  			hint:		'heading_3',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading4:{
  		  CAPTION:'<h4>Heading 4</h4>',
  			TOOLTIP:    'Heading 4',
  			syntax: '!!!!user_text',
  			hint:		'heading_4',
  			HANDLER: wikibar_editFormatByLine
  		},
  		heading5:{
  		  CAPTION:'<h5>Heading 5</h5>',
  			TOOLTIP:    'Heading 5',
  			syntax: '!!!!!user_text',
  			hint:		'heading_5',
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    comment:{
      TYPE: 'MENU',
      commentByLine:{
  			CAPTION:'comment by line',
  			TOOLTIP:    'line comment',
  			syntax: '/%user_text%/',
  			hint:		'comment_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByBlock:{
  			CAPTION:'comment by block',
  			TOOLTIP:    'block comment',
  			syntax: '/%\nuser_text\n%/',
  			hint:		'comment_text',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    monospaced:{
      TYPE: 'MENU',
  		monosByLine:{
  			CAPTION: 	'monospaced by line',
  			TOOLTIP:    'line monospaced',
  			syntax: '{{{\nuser_text\n}}}',
  			hint:		'monospaced_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		monosByBlock:{
  			CAPTION: 	'monospaced by block',
  			TOOLTIP:    'block monospaced',
  			syntax: '{{{\nuser_text\n}}}',
  			hint:		'monospaced_text',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    quote:{
      TYPE: 'MENU',
  		quoteByLine:{
  			CAPTION: 	'quote by line',
  			TOOLTIP:    'line quote',
  			syntax: '>user_text',
  			hint:		'quote_text',
  			HANDLER: wikibar_editFormatByLine
  		},
  		quoteByBlcok:{
  			CAPTION: 	'quote by block',
  			TOOLTIP:    'block quote',
  			syntax: '<<<\nuser_text\n<<<',
  			hint:		'quote_text',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    plugin:{
      TYPE: 'MENU',
      code:{
  			CAPTION: 	'code area',
  			TOOLTIP:    'block monospaced for plugin',
  			syntax: '\n\/\/{{{\nuser_text\n\/\/}}}\n',
  			hint:		'monospaced_plugin_code',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByLine:{
  			CAPTION: 	'comment by line',
  			TOOLTIP:    'line comment',
  			syntax: '\/\/user_text',
  			hint:		'plugin_comment',
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByBlock:{
  			CAPTION: 	'comment by block',
  			TOOLTIP:    'block comment',
  			syntax: '\/\***\nuser_text\n***\/',
  			hint:		'plugin_comment',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    },
    css:{
      TYPE: 'MENU',
      code:{
  			CAPTION: 	'code area',
  			TOOLTIP:    'block monospaced for css',
  			syntax: '\n\nuser_text\n\n',
  			hint:		'monospaced_css_code',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByLine:{
  			CAPTION: 	'comment by line',
  			TOOLTIP:    'line comment',
  			syntax: '',
  			hint:		'css_comment',
  			HANDLER: wikibar_editFormatByLine
  		},
  		commentByBlock:{
  			CAPTION: 	'comment by block',
  			TOOLTIP:    'block comment',
  			syntax: '',
  			hint:		'css_comment',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    }
  },
  color:{
    TYPE: 'MENU',
    TOOLTIP: 'color tools',
    highlight:{
		  CAPTION:'highlight text',
			TOOLTIP:    'highlight text',
			syntax: '@@user_text@@',
			hint:		'highlight_text',
			HANDLER: wikibar_editFormatByWord
		},
		color:{
		  CAPTION:'text color',
			TOOLTIP:    'text color',
			hint:		'your_text',
			syntax: '@@color(%1):user_text@@',
			HANDLER:   wikibar_getColorCode,
			doMore: wikibar_editFormatByWord
		},
		bgcolor:{
		  CAPTION:'background color',
			TOOLTIP:    'background color',
			hint:		'your_text',
			syntax: '@@bgcolor(%1):user_text@@',
			HANDLER: wikibar_getColorCode,
			doMore: wikibar_editFormatByWord
		},
		colorcode:{
      CAPTION:'color code',
      TOOLTIP:    'insert color code',
      syntax: '%1',
      HANDLER: wikibar_getColorCode,
      doMore: wikibar_editFormatByCursor
    },
    'color palette':{
      TYPE:'MENU',
      DYNAITEM: wikibar_genPaletteSelector,
  		SEPERATOR:{},
  		morePalette:{
  		  CAPTION:'more palettes',
  		  TOOLTIP:'get more palettes',
  		  HANDLER: wikibar_getMorePalette
  		}
    }
  },
  link:{
    TYPE: 'MENU',
    TOOLTIP: 'insert link',
    wiki:{
		  CAPTION:'wiki link',
			TOOLTIP:    'wiki link',
			syntax: '[[user_text]]',
			hint:		'wiki_word',
			HANDLER: wikibar_editFormatByWord
		},
		pretty:{
			CAPTION: 	'pretty link',
			TOOLTIP:    'pretty link',
			syntax: '[[user_text|%1]]',
			hint:		'pretty_word',
			param:	'PrettyLink Target',
			HANDLER:   wikibar_getLinkUrl,
			doMore: wikibar_editFormatByWord
		},
		url:{
			TOOLTIP:    'url link',
			syntax: '[[user_text|%1]]',
			hint:		'your_text',
			param:	'http:\/\/...',
			HANDLER:   wikibar_getLinkUrl,
			doMore: wikibar_editFormatByWord
		},
		image:{
			TOOLTIP:    'image link',
			syntax: '[img[user_text|%1]]',
			hint:		'alt_text',
			param:	'image/icon.jpg',
			HANDLER:   wikibar_getLinkUrl,
			doMore: wikibar_editFormatByWord
		}
  },
  macro:{},
  more:{
    TYPE: 'MENU',
    TOOLTIP: 'more tools',
    table:{
      TYPE: 'MENU',
      TOOLTIP: 'table',
      table:{
  		  CAPTION:'create table',
  			TOOLTIP:    'create a new table',
  			syntax: '\n%1\n',
  			HANDLER: wikibar_getTableRowCol,
  			doMore: wikibar_editFormatByWord
  		},
  		header:{
  			TOOLTIP:    'table header text',
  			syntax: '|user_text|c',
  			hint:		'table_header',
  			HANDLER: wikibar_editFormatByWord
  		},
  		cell:{
  			TOOLTIP:    'create a tabel cell',
  			syntax: '|user_text|',
  			hint:		'your_text',
  			HANDLER: wikibar_editFormatByWord
  		},
  		columnHeader:{
  		  CAPTION:'column header',
  			TOOLTIP:    'create a column header cell',
  			syntax: '|!user_text|',
  			hint:		'column_header',
  			HANDLER: wikibar_editFormatByWord
  		},
  	  cell:{
  	    TYPE: 'MENU',
        CAPTION: 'cell options',
    		bgcolor:{
    			CAPTION: 	'background color',
    			TOOLTIP:    'cell bgcolor',
    			syntax: '|bgcolor(%1):user_text|',
    			hint:		'your_text',
    			HANDLER: wikibar_getColorCode,
    			doMore: wikibar_editFormatByTableCell
    		},
    		alignLeft:{
    			CAPTION: 	'align left',
    			TOOLTIP:    'left align cell text',
    			syntax: '|user_text|',
    			hint:		'your_text',
    			HANDLER: wikibar_editFormatByTableCell
    		},
    		alignCenter:{
    			CAPTION: 	'align center',
    			TOOLTIP:    'center align cell text',
    			syntax: '| user_text |',
    			hint:		'your_text',
    			HANDLER: wikibar_editFormatByTableCell
    		},
    		alignRight:{
    			CAPTION: 	'align right',
    			TOOLTIP:    'right align cell text',
    			syntax: '| user_text|',
    			hint:		'your_text',
    			HANDLER: wikibar_editFormatByTableCell
    		}
    	}
    },
    html:{
      TYPE: 'MENU',
      html:{
  			CAPTION: 	'&lt;html&gt;',
  			TOOLTIP:    'html tag',
  			syntax: '<html>\nuser_text\n</html>',
  			hint:		'html_content',
  			byBlock: true,
  			HANDLER: wikibar_editFormatByLine
  		}
    }
  },
  addon:{
    TYPE: 'MENU',
    TOOLTIP:'3rd party tools',
    'about addons':{
      TOOLTIP: 'list loaded addons',
      HANDLER: wikibar_doListAddons
    },
    SEPERATOR:{}
  }
};
addEvent(document, 'click', wikibarColorTool.onDocumentClick);
addEvent(document, 'click', wikibarPopup.onDocumentClick);
wikibar_install();
//}}}
The idea here is to be the main room of the house, in the medieval style. Central to the house both physically, and socially. The "family room" or "living room"Pretty much all other rooms come off this, but unlike a modern "hallway", this is to be a room of it's own. The largest in the house. 

> Even the royal and noble residences had few living rooms in the Middle Ages, and a great hall was a multifunction room. It was used for receiving guests and it was the place where the household would dine together, including the lord of the house, his gentleman attendants and at least some of the servants. At night some members of the household might sleep on the floor of the great hall.
> --  http://en.wikipedia.org/wiki/Great_hall

> The concept of a great room hearkens back to the romanticized ideal of great halls and great chambers in medieval castles, which contained one large central room where everything happened 
> -- http://en.wikipedia.org/wiki/Great_room

My idea is that the hall would be flexible in use - from empty enough to play mini indoor volleyball, to a Hogwarts dinner assembly in miniature. Polished wooden [[flooring]]?

5x7 metres is a nice size which allows for [[MrScreen]] on the small wall, and is a fair approximation of a [[silver rectangle]]
This is a more formal area than the hall. A combination of parlour, and entertainment room. It would have the TV, couches, etc

That is to say, it may not be more formal in use, but it is more formal in design and function

The monolith facing side of the [[fireplace]] would face here. 

...it may also incorporate the [[Games Room]] in a space saving measure. 
The Kitchen is side on to the division between the Hall and the Lounge (a division intended to be made by [[fireplace]]), with openings onto both, providing a flow-through space

The pantry within the kitchen should be walk-through also. That is, effectively a hallway with both ends opening to the kitchen! 

!!! Orientation
East side of the house for breakfast warming sun to assist with waking up

!!! Benches
Marble benchtops that can be used directly for food preparation. eg, kneading pizza dough! 
Also...
* A 'cool rock' area of the bench. ie, the surface can be cooled for the preparation of cold foods. Down to... 0°?
* Similarly, a 'hot rock' area for assisting with the preparation of hot foods. Note: this is NOT a cooking space, but a 'keep warm' space. (or "will not cool things down as fast" space). Up to... 40°?

!!! Pantry
As mentioned above, a long and thin room along the kitchen, both ends open to the kitchen. Should be lit well, ala bookcases in the [[Library]]

An interesting pot rack - an old ladder: http://www.adreamkitchen.com/traditional-kitchens/1/5335568
----
Addtionally, outdoors cooking is handled in the [[Cooking Garden]]

Some great looking fittings:
* http://www.aliexpress.com/store/group/Antique-brass-faucet/716868_212267933.html
* copper ones aint too bad either: http://www.aliexpress.com/store/group/Antique-copper-faucet/716868_212267934.html
Laundy may be under the house. If it's a raised Queenslander, why not! :)
for now, toilet (aka: WC) information here also

!!! Bath/Shower
This is the area with the medicine cabinet, bath/spa shower (2?), toilet, etc

I love the spa-with-seats / shower deck from this, though as it is there, [[accessibility]] would be an issue
* http://www.yankodesign.com/2009/11/02/super-sexy-bathroom/

This is a deep sunken japanese bath. Consider?
* http://www.japanesebathhouse.com/buyjapanesebath.html

A sunken bath of some sort regardless? Intricate Moroccan style tiled design perhaps? (See GrandDesigns Interiors, ~S01E02)

!! Toilet
* Toilet should have a small cabinet reachable when seated. To be stocked with spare toilet paper, reading material, etc. 
* Squatting toilet... as humorously pointed out here: http://www.cracked.com/article_19121_7-basic-things-you-wont-believe-youre-all-doing-wrong.html

!! Other notes
* A mirror that is NOT obstructed with a sink in front. I like to get right up close and personal with mirrors sometimes.
* Sink faucets (not just here, but in [[Kitchen]] too) should not be directed to the plug, but directed to swirl around the basin, so as to ensure spittle, etc, are directly washed away without having to manhandle the waterflow. 
The games oriented room of the four general purpose rooms, it should be big enough to hold a pool table central (what size?) and space to play. 

It may be open to the hall via archway or sliding wall, rather than closed off?

In rationalising the house design to a manageable size, this room may be semi-integrated into the [[Lounge]]

Notes on a [[Pool Table]]
Portal to L-space (http://en.wikipedia.org/wiki/L-space#L-space)

Where the rest of the house has high ceilings, the library should be somewhat cosy (not to the point of being claustrophobic, or even in a "maze of twisty little passages" sense, but certainly in a 'cosy secondhand bookshop' sense. Remember also, I am claustrophilic :), though perhaps with a tall vertical central well/atrium, and an open view between ends - with bay windows to look out over the landscape. ie, can it be both cosy, and have a sense of space? Sealed, but with windows?

I'd like the space between the bay windows to be visible line-of-sight also

Current thoughts are as follows:
The house has high ceilings, so the library has half-height ceilings, fitting two floors where one is. In these library floors, the library has three! The top two match the house, and the bottom is 'under' the house, extruded down into the raised section.

The top two floors are "+" shaped rooms, but with a central hole, whilst the bottom is a rectangular room with skylights. (or: it's one wall room with walkways along the walls). 

The bottom level will be a reading parlour. Snug and cosy. 
Middle has entrance, and is the main book/library space
Top is an observation desk/sunroom, and provides the entire space with a lightwell. 

 - this may require three levels of library (so the centered windows can "see" each other), or a gap down the row of books from one side to the other


!!! Orientation
Southern edge of the house - should avoid direct sunlight onto book, but may means no nighttime moon-lit library either?. This could be rectified with a skylight/dome that can open at night?

!!! Bookcases
Lights embedded in the bookcases at the front (facing down and/or up?) ...this provides basically illumination per-book. See also the pantry in the [[Kitchen]]

!!! Seats
I like this idea - hydraulic panels that can raise or lower in front of any part of the shelves. Overcomplicated and unrealistic perhaps, but neat!
http://www.gunnerkrigg.com/?p=1205
The bedroom oriented room of the four general purpose rooms. Mirroring the Games Room in size, but with the addition of an ensuite. 

!!! Orientation
Facing west to catch the after-midnight full moon. Only ''dedicated'' bedroom of the house.
Another general purpose room, smaller than the Games or Master. 

In a soundbite description of the house, this would be the third bedroom, but equally suited to a store room, project/hobby room, music room, etc... 
Smaller than room one, but otherwise serving the same purpose. The "fourth bedroom". 

...in rationalising the house design to a manageable size, this room may be culled
I like the idea of gadgets, but also of old-school straightforwardness. 

I don't want complicatedness which will remain unused, or break down and be unusable.
A toolbench and some tools. 

Either under the house (alongside the laundry and [[Carspace]]?) or in an external shed structure!
<!--{{{-->
<style type="text/css">
#contentWrapper {display:none;}
</style>

<div id="SplashScreen" style="border: 8px solid olive; display: block; text-align: center; width: 640px; margin: 100px auto; padding: 50px; color:olive; font-size: 18px; font-family:monospace; white-space:nowrap;">
♫♬♪ Our house... in the middle of our street ♫♬♪<br>
<br>
<br>
<span style="font-size: 14px; color:red;">This site requires Javascript</span>
</div>

<!--}}}-->
/***

''Inspired by [[TiddlyPom|http://www.warwick.ac.uk/~tuspam/tiddlypom.html]]''

|Name|SplashScreenPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#SplashScreenPlugin|
|Version|0.21 |
|Requires|~TW2.08+|
!Description:
Provides a simple splash screen that is visible while the TW is loading.

!Installation
Copy the source text of this tiddler to your TW in a new tiddler, tag it with systemConfig and save and reload. The SplashScreen will now be installed and will be visible the next time you reload your TW.

!Customizing
Once the SplashScreen has been installed and you have reloaded your TW, the splash screen html will be present in the MarkupPreHead tiddler. You can edit it and customize to your needs.

!History
* 20-07-06 : version 0.21, modified to hide contentWrapper while SplashScreen is displayed.
* 26-06-06 : version 0.2, first release

!Code
***/
//{{{
window.old_lewcid_splash_restart=window.restart;

window.restart = function()
{   if (document.getElementById("SplashScreen"))
        document.getElementById("SplashScreen").style.display = "none";
      if (document.getElementById("contentWrapper"))
        document.getElementById("contentWrapper").style.display = "block";
    
    window.old_lewcid_splash_restart();
   
    if (splashScreenInstall)
       {if(config.options.chkAutoSave)
			{saveChanges();}
        displayMessage("TW SplashScreen has been installed, please save and refresh your TW.");
        }
}


var oldText = store.getTiddlerText("MarkupPreHead");
if (oldText.indexOf("SplashScreen")==-1)
   {var siteTitle = store.getTiddlerText("SiteTitle");
   var splasher='\n\n<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>'+siteTitle +'</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>';
   if (! store.tiddlerExists("MarkupPreHead"))
       {var myTiddler = store.createTiddler("MarkupPreHead");}
   else
      {var myTiddler = store.getTiddler("MarkupPreHead");}
      myTiddler.set(myTiddler.title,oldText+splasher,config.options.txtUserName,null,null);
      store.setDirty(true);
      var splashScreenInstall = true;
}
//}}}
/***
|Name|SectionLinksPlugin|
|Source|http://www.TiddlyTools.com/#SectionLinksPlugin|
|Documentation|http://www.TiddlyTools.com/#SectionLinksPlugin|
|Version|1.3.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|allow tiddler sections in TiddlyLinks to be used as anchor points|
This plugin enhances the processing of section references they can be used in links to auto-scroll to the indicated heading within a tiddler (i.e., similar to the 'anchor' behavior provided in HTML by {{{<a name="foo">}}} and {{{<a href="#foo">...</a>}}})
!!!Usage
<<<
!!!!!{{{<<tiddler>>}}} macro 
>The {{{<<tiddler SomeTiddler##SomeSection>>}}} syntax has been extended so that if the tiddler title is omitted or the 'here' keyword is used (e.g., {{{<<tiddler ##SomeSection>>}}} or {{{<<tiddler here##SomeSection>>}}}), then the current containing tiddler is implied by default.
!!!!!~TiddlyLink syntax
>the standard link syntax has been extended so that a section name can included in a tiddler link (e.g., {{{[[SomeTiddler##SomeSection]]}}}).  When clicked, the tiddler is displayed and the specified section heading will be automatically scrolled into view. If the tiddler title is omitted or the 'here' keyword is used (e.g., {{{[[##SomeSection]]}}} or {{{[[here##SomeSection]]>>}}}), then the current containing tiddler is implied by default.
!!!!!"""<<sectionTOC>>""" macro
>This macro generates a 'Table of Contents'-style numbered-bullet list with links to all sections within the current tiddler.  Simply place the following macro at the //end of the tiddler content// (i.e., following all section headings):
{{{
<<sectionTOC>> or <<sectionTOC className>>
}}}
>Note: The macro must occur at the end of the tiddler in order to locate the rendered section headings that precede it. In addition, to position the macro's //output// within the tiddler, you must create a special 'target element' that uses a specified classname (default='sectionTOC'), like this:
{{{
{{sectionTOC{}}}
}}}
>When the {{{<<sectionTOC>>}}} macro is rendered, it will find the matching 'sectionTOC'-classed element and writes it's output there.  You can also add the macro and/or target elements directly to the [[ViewTemplate]] definition, so that every tiddler can automatically display the table of contents:
{{{
<span class='sectionTOC'></span> <!-- target element -->
...
<span macro='sectionTOC'></span> <!-- must be at end of tiddler -->
}}}
<<<
!!!Revisions
<<<
2009.08.02 [1.3.1] in sectionTOC.handler(), trim leading/trailing whitespace from generated section links
2009.08.01 [1.3.0] in scrollToSection(), apply 3-tier section matching (exact, startsWith, contains)
2009.07.06 [1.2.2] fixed displayTiddler() hijack
2009.07.03 [1.2.1] in {{{<<sectionTOC>>}}}, suppress output if target is not found
2009.06.02 [1.2.0] added support for 'here' keyword in {{{[[here##section]]}}} links and {{{<<tiddler here##section>>}}} macro
2009.04.09 [1.1.1] in sectionTOC macro, make target visible when TOC is rendered.
2009.01.18 [1.1.0] added {{{<<sectionTOC>>}}} macro to generate numbered-bullet links to sections of current tiddler
2009.01.06 [1.0.0] converted to stand-alone plugin
2008.10.14 [0.0.0] initial release (as [[CoreTweaks]] #784 - http://trac.tiddlywiki.org/ticket/784)
<<<
!!!Code
***/
//{{{
version.extensions.SectionLinksPlugin= {major: 1, minor: 3, revision: 1, date: new Date(2009,8,2)};

Story.prototype.scrollToSection = function(title,section) {
	if (!title||!section) return; var t=this.getTiddler(title); if (!t) return null;
	var elems=t.getElementsByTagName('*'); var heads=[];
	for (var i=0; i<elems.length; i++)
		if (['H1','H2','H3','H4','H5'].contains(elems[i].nodeName)) heads.push(elems[i]);
	for (var i=0; i<heads.length; i++)
		if (getPlainText(heads[i]).trim()==section) break;
	if (i==heads.length) for (var i=0; i<heads.length; i++)
		if (getPlainText(heads[i]).trim().startsWith(section)) break;
	if (i==heads.length) for (var i=0; i<heads.length; i++)
		if (getPlainText(heads[i]).trim().indexOf(section)!=-1) break;
	if (i<heads.length) { var h=heads[i];
		// if section heading is collapsed, click to expand it - see [[FoldHeadingsPlugin]]
		if (hasClass(h,'foldable') && h.nextSibling.style.display=='none') h.onclick();
		// scroll *after* tiddler animation
		var delay=config.options.chkAnimate?config.animDuration+100:0;
		setTimeout('window.scrollTo('+findPosX(h)+','+findPosY(h)+')',delay);
		return h;
	}
}
//}}}
/***
!!!!core hijacks
***/
/***
!!!!!createTiddlyLink
***/
//{{{
// [[tiddlername##section]] and [[##section]]
window.createTiddlyLink_sectionanchor=window.createTiddlyLink;
window.createTiddlyLink=function(place,title) {
	var t=story.findContainingTiddler(place); var tid=t?t.getAttribute('tiddler'):'';
	var parts=title.split(config.textPrimitives.sectionSeparator);
	if (!parts[0].length || parts[0].toLowerCase()=='here') parts[0]=tid;  // default=current tiddler
	if (parts[1]) arguments[1]=parts[0]; // trim section from tiddler title
	var btn=createTiddlyLink_sectionanchor.apply(this,arguments);
	btn.setAttribute('tiddlyLink',parts[0]);
	if (parts[1]) btn.setAttribute('section',parts[1]); // save section
	return btn;
}
//}}}
/***
!!!!!onClickTiddlerLink
***/
//{{{
window.onClickTiddlerLink_sectionanchor=window.onClickTiddlerLink;
window.onClickTiddlerLink=function(ev) {
	var e=ev||window.event;	var target=resolveTarget(e); var title=null;
	while (target!=null && title==null) {
		title=target.getAttribute('tiddlyLink');
		section=target.getAttribute('section');
		target=target.parentNode;
	} 
	var t=story.findContainingTiddler(target); var tid=t?t.getAttribute('tiddler'):'';
	if (title!=tid||!section) onClickTiddlerLink_sectionanchor.apply(this,arguments); // avoid excess scrolling
	story.scrollToSection(title,section);
	return false;
}
//}}}
/***
!!!!! displayTiddler
***/
//{{{
Story.prototype.displayTiddler_sectionanchor=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler)
{
	var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
	var parts=title.split(config.textPrimitives.sectionSeparator);
	if (!parts[0].length || parts[0].toLowerCase()=='here') {
		var t=story.findContainingTiddler(place);
		parts[0]=t?t.getAttribute('tiddler'):'';
	}
	arguments[1]=parts[0];  // default=current tiddler
	this.displayTiddler_sectionanchor.apply(this,arguments);
	story.scrollToSection(parts[0],parts[1]);
}
//}}}
/***
!!!!!isExternalLink
***/
//{{{
config.formatterHelpers.isExternalLink_sectionanchor=config.formatterHelpers.isExternalLink;
config.formatterHelpers.isExternalLink=function(link) {
	if (link.indexOf(config.textPrimitives.sectionSeparator)!=-1) return false;
	return config.formatterHelpers.isExternalLink_sectionanchor.apply(this,arguments);
}
//}}}
/***
!!!!!tiddler.handler
***/
//{{{
config.macros.tiddler.handler_section=config.macros.tiddler.handler;
config.macros.tiddler.handler=function(place,macroName,params,wikifier,paramString,tiddler)
{
	if (!params[0]) return;
	var sep=config.textPrimitives.sectionSeparator;
	var parts=params[0].split(sep); var tid=parts[0]; var sec=parts[1];
	if ((tid.toLowerCase()=='here'||!tid.length) && sec) { // fixup for 'here##section' and '##section'
		var here=story.findContainingTiddler(place)
		var tid=here?here.getAttribute('tiddler'):tiddler?tiddler.title:'';
		arguments[2][0]=tid+sep+sec;
		arguments[4]=paramString.replace(new RegExp('(here)?'+sep+sec),tid+sep+sec);
	}
	config.macros.tiddler.handler_section.apply(this,arguments);
}
//}}}
/***
!!!!sectionTOC macro
***/
//{{{
config.macros.sectionTOC = {
	targetClass: 'sectionTOC',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var out=[];
		var targetClass=params[0]||this.targetClass;
		var t=story.findContainingTiddler(place); if (!t) return;
		var elems=t.getElementsByTagName('*');
		var level=5; // topmost heading level
		for (var i=0; i<elems.length; i++) {
			var txt=getPlainText(elems[i]).trim();
			var link='[['+txt+'|##'+txt+']]';
			switch(elems[i].nodeName) {
				case 'H1': out.push('#'+link);		level=1; break;
				case 'H2': out.push('##'+link);		level=level<2?level:2; break;
				case 'H3': out.push('###'+link);	level=level<3?level:3; break;
				case 'H4': out.push('####'+link);	level=level<4?level:4; break;
				case 'H5': out.push('#####'+link);	level=level<5?level:5; break;
				default: if (hasClass(elems[i],targetClass)) var target=elems[i];
			}
		}
		// trim excess bullet levels
		if (level>1) for (var i=0; i<out.length; i++) out[i]=out[i].substr(level-1);
		// show numbered list
		if (out.length && target) {
			if (target.style.display=='none') target.style.display='block';
			wikify(out.join('\n'),target);
		}
	}
}
//}}}
/***
!!!Invoke macro
{{{
<<sectionTOC>>
}}}
***/
// //<<sectionTOC>>
The layout I have in mind currently is for a central "great hall" surrounded by other rooms. So, based on a southern hemisphere orientation...
;North
: gets midday sun - good to heat the house? Entertainment areas
: ...however, it has been since noted that in the tropic/sub-tropics, the hotter afternoon sun swings to the south?
;East
: Gets morning sun - good for breakfast/waking up
;South
: no sun. "boring". Good for amenities and library (to keep it from the sun direct). May need verandas to ensure no morning/evening sun intrusions. 
;West
: sunsets and post-midnight full moon sets. Entertainment areas and Bedrooms. 


Also, multi layers? In which case...
* top floor = public/entertainment space
* lower floor = bedrooms/personal/private space?
?
Content available as CC ~BY-NC-SA

http://creativecommons.org/licenses/by-nc-sa/3.0/au/deed.en
[IMG[http://mirrors.creativecommons.org/presskit/buttons/88x31/png/by-nc-sa.png]]

...with a footnote to the effect that I would strongly appreciate being notified of any use. 
re: commercial use - I ''will'' waive the NC clause one you let me know of your intent.

    *  Background: page background, text in title and subtitle
    * Foreground: ordinary text
    * PrimaryPale: options box
    * PrimaryLight: top part of the header gradient
    * PrimaryMid: text in MainMenu, links, lists of tiddlers and tags, bottom part of the header gradient
    * PrimaryDark: text of items at the top of right hand menu, text of buttons on the tiddlers
    * SecondaryPale: background of code blocks
    * SecondaryLight: highlighted tiddler buttons, highlighted sidebar items
    * SecondaryMid: table headers, message area, selected tiddler buttons
    * SecondaryDark: tiddler titles
    * TertiaryPale: sidebar background, tag box on tiddlers
    * TertiaryLight: unselected tabs behind the list of tags, tiddlers at the bottom of the sidebar
    * TertiaryMid: borders around the sidebar
    * TertiaryDark: tiddler subtitles
    * Error: error messages 
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','Background')}} Background>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','Foreground')}} Foreground>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryPale')}} PrimaryPale>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryLight')}} PrimaryLight>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryMid')}} PrimaryMid>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryDark')}} PrimaryDark>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryPale')}} SecondaryPale>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryLight')}} SecondaryLight>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryMid')}} SecondaryMid>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryDark')}} SecondaryDark>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryPale')}} TertiaryPale>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryLight')}} TertiaryLight>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryMid')}} TertiaryMid>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryDark')}} TertiaryDark>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','Error')}} Error>>
@@margin:0 1em;padding:0 4em;background-color:$1; @@ @@padding-right:1em;{{{$1}}}@@ [[$2|$3]]
{{invisibletable{
{| style="border-style:none; border:0px; padding: 0em; "
|style="border-right:1px solid grey; padding:0em; padding-right: 1em" width=33% valign=top|> A man is the sum of his memories you know, a Time Lord even more so.
{{credit{-- The Doctor - The Five Doctors}}}
> ''A house is the sum of it's rooms you know, a home - the sum of your memories in it.''
{{credit{-- [[Nemo|nemo]]}}}

...let's focus on the design of the house that may one day also be a home :)
|style="padding-left: 2em;"|!!! What do you need in a house?
* ''Do you need a general multifunctional room?'' <<slider chkGreatHall "Great Hall" "Great Hall »" "The Great Hall">>
* ''a place to entertain'' <<slider chkLounge Lounge "Lounge »" "The Lounge Room">>
* ''a place to make nom'' <<slider chkKitchen Kitchen "Kitchen »" "The Kitchen">>
* ''a place to make clean'' <<slider chkBathroom Bathroom "Bathroom »" "The Bathroom">>
* ''a place to have fun'' <<slider chkGamesRoom "Games Room" "Games Room »" "The Games Room">>
* ''a place to make learn'' <<slider chkLibrary Library "Library »" "The Library">>
* ''a place to make sleep'' <<slider chkMasterBedroom "Master Bedroom" "Master Bedroom »" "The Master Bedroom">>
* ''a place to make spare'' <<slider chkRoomOne "Room One" "Room One »" "The first spare room">>
* ''another place to make spare'' <<slider chkRoomTwo "Room Two" "Room Two »" "The second spare room">>
* ''another place to make clean'' <<slider chkLaundry Laundry "Laundry »" "The Laundry">>
* ''a place to make...'' <<slider chkWorkshop Workshop "Workshop »" "The Workshop">>
* ''a place to keep vehicles?'' <<slider chkCarspace Carspace "Carspace »" "The Carspace">>
|}
}}}
@@padding-right:1em;{{{$2}}}@@
Queenslander is a type of house, of which this may be considered. 

It may not be in the //style// of a traditional Queenslander, but many elements will port across. Possibly key idea being that it be raised on stumps. 

Additionally, a paraboloid [[roof]] may allow for a front peak that looks somewhat traditional...

* http://en.wikipedia.org/wiki/Queenslander_%28architecture%29
Not exactly a room, but nonetheless... 

;Garage
:Enclosed car space
;Carport
:semi-enclosed (ie, roof covering only?)

Either way, somewhere to park vehicles, out of the QLD storms and sun. Space for two fullsize cars? And a ride-on mower?

According to wikipedia, a large garage (http://en.wikipedia.org/wiki/Garage_%28house%29) is 10x20feet (3x6.1metres), and notes that even this is small for some cars of today. 
This is a tag for content which have external links giving examples to design. (amusing smalltalk links do not count). 

External references which are not URLs may also be tagged as bookmark (eg: GrandDesigns)

Note that it is manually maintained, so may be subject to user failure
<!--{{{-->
<!--
|Name|CollapsedTemplate|
|Source|http://www.TiddlyTools.com/#CollapsedTemplate|
|Version||
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|template|
|Requires|ToolbarCommands|
|Overrides||
|Description|alternative to ViewTemplate, used by CollapseTiddlersPlugin to display tiddler when 'folded'|
-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::CollapsedToolbar]]'></div>
<div class='title' macro='view title'></div>

<div class='tagClear'></div>
<div class='subtitle'> - <span macro='view editsummary'></span> - <span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view creator'></span> <span macro='view created date'></span>)</div>
<!--}}}-->
/***
|Name|CollapseTiddlersPlugin|
|Source|http://www.TiddlyTools.com/#CollapseTiddlersPlugin|
|Version|2.0.0|
|Author|Eric Shulman|
|OriginalAuthor|Bradley Meck - http://gensoft.revhost.net/Collapse.html|
|License|unknown|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|CollapsedTemplate|
|Overrides||
|Description|show/hide content of a tiddler while leaving tiddler title visible|
!!!Revisions
<<<
2009.05.04 [2.0.0] standardized documentation and added version #
2008.10.05 collapseAll() and expandAll(): added "return false" to button handlers to prevent IE page transition
2008.03.06 refactored all code for size reduction, readability, and I18N/L10N-readiness.  Also added 'folded' flag to tiddler elements (for use by other plugins that need to know if tiddler is folded (e.g., [[SinglePageModePlugin]]
2007.10.11 moved [[FoldFirst]] inline script and converted to {{{<<foldFirst>>}}} macro
2007.12.09 suspend/resume SinglePageMode (SPM/TPM/BPM) when folding/unfolding tiddlers
2007.05.06 add "return false" at the end of each command handler to prevent IE 'page transition' problem.
2007.03.30 add a shadow definition for CollapsedTemplate.  Tweak ViewTemplate shadow so "fold/unfold" and "focus" toolbar items automatically appear when using default templates.  Remove error check for "CollapsedTemplate" existence, since shadow version will now always work as a fallback.
2006.02.24 added fallback to "CollapsedTemplate" if "WebCollapsedTemplate" is not found
2006.02.06 added check for 'readOnly' flag to use alternative "WebCollapsedTemplate"
<<<
!!!Code
***/
//{{{
version.extensions.CollapseTiddlersPlugin= {major: 2, minor: 0, revision: 0, date: new Date(2009,5,4)};

config.shadowTiddlers.CollapsedTemplate=
	"<!--{{{-->\
	<div class='toolbar' macro='toolbar expandTiddler collapseOthers closeTiddler closeOthers +editTiddler permalink references jump'></div>\
	<div class='title' macro='view title'></div>\
	<!--}}}-->";

// automatically tweak shadow ViewTemplate to add "collapseTiddler collapseOthers" commands
config.shadowTiddlers.ViewTemplate=config.shadowTiddlers.ViewTemplate.replace(/closeTiddler/,"collapseTiddler collapseOthers closeTiddler");

config.commands.collapseTiddler = {
	text: "fold",
	tooltip: "Collapse this tiddler",
	collapsedTemplate: "CollapsedTemplate",
	webCollapsedTemplate: "WebCollapsedTemplate",
	handler: function(event,src,title) {
		var e = story.findContainingTiddler(src); if (!e) return false;
		// don't fold tiddlers that are being edited!
		if(story.isDirty(e.getAttribute("tiddler"))) return false;
		var t=config.commands.collapseTiddler.getCollapsedTemplate();
		config.commands.collapseTiddler.saveTemplate(e);
		config.commands.collapseTiddler.display(title,t);
		e.setAttribute("folded","true");
		return false;
	},
	getCollapsedTemplate: function() {
		if (readOnly&&store.tiddlerExists(this.webCollapsedTemplate))
			return this.webCollapsedTemplate;
		else
			return this.collapsedTemplate
	},
	saveTemplate: function(e) {
		if (e.getAttribute("savedTemplate")==undefined)
			e.setAttribute("savedTemplate",e.getAttribute("template"));

	},
	// fold/unfold tiddler with suspend/resume of single/top/bottom-of-page mode
	display: function(title,t) {
		var opt=config.options;
		var saveSPM=opt.chkSinglePageMode; opt.chkSinglePageMode=false;
		var saveTPM=opt.chkTopOfPageMode; opt.chkTopOfPageMode=false;
		var saveBPM=opt.chkBottomOfPageMode; opt.chkBottomOfPageMode=false;
		story.displayTiddler(null,title,t);
		opt.chkBottomOfPageMode=saveBPM;
		opt.chkTopOfPageMode=saveTPM;
		opt.chkSinglePageMode=saveSPM;
	}
}

config.commands.expandTiddler = {
	text: "unfold",
	tooltip: "Expand this tiddler",
	handler: function(event,src,title) {
		var e = story.findContainingTiddler(src); if (!e) return false;
		var t = e.getAttribute("savedTemplate");
		config.commands.collapseTiddler.display(title,t);
		e.setAttribute("folded","false");
		return false;
	}
}

config.macros.collapseAll = {
	text: "collapse all",
	tooltip: "Collapse all tiddlers",
	handler: function(place,macroName,params,wikifier,paramString,tiddler){
		createTiddlyButton(place,this.text,this.tooltip,function(){
			story.forEachTiddler(function(title,tiddler){
				if(story.isDirty(title)) return;
				var t=config.commands.collapseTiddler.getCollapsedTemplate();


				config.commands.collapseTiddler.saveTemplate(tiddler);
				config.commands.collapseTiddler.display(title,t);
				tiddler.folded=true;
			});
			return false;
		})
	}
}

config.macros.expandAll = {
	text: "expand all",
	tooltip: "Expand all tiddlers",
	handler: function(place,macroName,params,wikifier,paramString,tiddler){
		createTiddlyButton(place,this.text,this.tooltip,function(){
			story.forEachTiddler(function(title,tiddler){
				var t=config.commands.collapseTiddler.getCollapsedTemplate();
				if(tiddler.getAttribute("template")!=t) return; // re-display only if collapsed
				var t=tiddler.getAttribute("savedTemplate");
				config.commands.collapseTiddler.display(title,t);
				tiddler.folded=false;
			});
			return false;
		})
	}
}

config.commands.collapseOthers = {
	text: "focus",
	tooltip: "Expand this tiddler and collapse all others",
	handler: function(event,src,title) {
		var e = story.findContainingTiddler(src); if (!e) return false;
		story.forEachTiddler(function(title,tiddler) {
			if(story.isDirty(title)) return;
			var t=config.commands.collapseTiddler.getCollapsedTemplate();
			if (e==tiddler) t=e.getAttribute("savedTemplate");
			config.commands.collapseTiddler.saveTemplate(tiddler);
			config.commands.collapseTiddler.display(title,t);
			tiddler.folded=(e!=tiddler);
		})
		return false;
	}
}

// {{{<<foldFirst>>}}} macro forces tiddler to be folded when *initially* displayed.
// Subsequent re-render does NOT re-fold tiddler, but closing/re-opening tiddler DOES cause it to fold first again.
config.macros.foldFirst = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler){
		var e=story.findContainingTiddler(place);
		if (e.getAttribute("foldedFirst")=="true") return; // already been folded once
		var title=e.getAttribute("tiddler")
		var t=config.commands.collapseTiddler.getCollapsedTemplate();
		config.commands.collapseTiddler.saveTemplate(e);
		config.commands.collapseTiddler.display(title,t);
		e.setAttribute("folded","true");
		e.setAttribute("foldedFirst","true"); // only when tiddler is first rendered
		return false;
	}
}
//}}}
/***
|Name|BreadcrumbsPlugin|
|Author|Eric Shulman|
|Source|http://www.TiddlyTools.com/#BreadcrumbsPlugin|
|Documentation|http://www.TiddlyTools.com/#BreadcrumbsPluginInfo|
|Version|2.1.0|
|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler,TiddlyWiki.prototype.deleteTiddler|
|Options|##Configuration|
|Description|list/jump to tiddlers viewed during this session plus "back" button/macro|
This plugin provides a list of links to all tiddlers opened during the session, creating a "trail of breadcrumbs" from one tiddler to the next, allowing you to quickly navigate to any previously viewed tiddler, or select 'home' to reset the display to the initial set of tiddlers that were open at the start of the session (i.e., when the document was loaded into the browser).
!!!!!Documentation
<<<
see [[BreadcrumbsPluginInfo]]
<<<
!!!!!Configuration
<<<
<<option chkCreateDefaultBreadcrumbs>> automatically create breadcrumbs display (if needed)
<<option chkShowBreadcrumbs>> show/hide breadcrumbs display
<<option chkReorderBreadcrumbs>> re-order breadcrumbs when visiting a previously viewed tiddler
<<option chkBreadcrumbsHideHomeLink>> omit 'Home' link from breadcrumbs display
<<option chkBreadcrumbsSave>> prompt to save breadcrumbs when 'Home' link is pressed
<<option chkShowStartupBreadcrumbs>> show breadcrumbs for 'startup' tiddlers
<<option chkBreadcrumbsReverse>> show breadcrumbs in reverse order (most recent first)
<<option chkBreadcrumbsLimit>> limit breadcrumbs display to {{twochar{<<option txtBreadcrumbsLimit>>}}} items
<<option chkBreadcrumbsLimitOpenTiddlers>> limit open tiddlers to {{twochar{<<option txtBreadcrumbsLimitOpenTiddlers>>}}} items

<<<
!!!!!Revisions
<<<
2009.03.22 [2.1.0] added 'save breadcrumbs to tiddler' feature
| Please see [[BreadcrumbsPluginInfo]] for previous revision details |
2006.02.01 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.BreadcrumbsPlugin= {major: 2, minor: 1, revision: 0, date: new Date("March 2, 2009")};

var co=config.options; // abbreviation

// show/hide display option (default is to SHOW breadcrumbs)
if (co.chkShowBreadcrumbs===undefined) co.chkShowBreadcrumbs=true;

// REORDER breadcrumbs when visiting previously viewed tiddler (default)
if (co.chkReorderBreadcrumbs===undefined) co.chkReorderBreadcrumbs=true;

// create default breadcrumbs display as needed (default is to CREATE)
if (co.chkCreateDefaultBreadcrumbs===undefined) co.chkCreateDefaultBreadcrumbs=true;

// show breadcrumbs for 'startup' tiddlers (default is FALSE = only show crumbs for tiddlers opened after startup)
if (co.chkShowStartupBreadcrumbs===undefined) co.chkShowStartupBreadcrumbs=false;

// show crumbs in reverse order (most recent first)
if (co.chkBreadcrumbsReverse===undefined) co.chkBreadcrumbsReverse=false;

// limit number of crumbs displayed
if (co.chkBreadcrumbsLimit===undefined) co.chkBreadcrumbsLimit=false;
if (co.txtBreadcrumbsLimit===undefined) co.txtBreadcrumbsLimit=5;

// limit number of open tiddlers
if (co.chkBreadcrumbsLimitOpenTiddlers===undefined) co.chkBreadcrumbsLimitOpenTiddlers=false;
if (co.txtBreadcrumbsLimitOpenTiddlers===undefined) co.txtBreadcrumbsLimitOpenTiddlers=3;

// omit home link from breadcrumbs display
if (co.chkBreadcrumbsHideHomeLink===undefined) co.chkBreadcrumbsHideHomeLink=false;

// prompt for 'save crumbs' when 'home' button is pressed
if (co.chkBreadcrumbsSave===undefined) co.chkBreadcrumbsSave=false;

config.macros.breadcrumbs =  {
	crumbs: [], // the list of current breadcrumbs
	askMsg: "Save current breadcrumbs before clearing?\nPress OK to save, or CANCEL to continue without saving.",
	saveMsg: 'Enter the name of a tiddler in which to save the current breadcrumbs',
	saveTitle: 'SavedBreadcrumbs',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var area=createTiddlyElement(place,"span",null,"breadCrumbs",null);
		area.setAttribute("homeSep",params[0]?params[0]:this.homeSeparator); // custom home separator
		area.setAttribute("crumbSep",params[1]?params[1]:this.crumbSeparator); // custom crumb separator
		this.render(area);
	},
	add: function (title) {
		var thisCrumb = title;
		var ind = this.crumbs.indexOf(thisCrumb);
		if(ind === -1)
			this.crumbs.push(thisCrumb);
		else if (config.options.chkReorderBreadcrumbs)
			this.crumbs.push(this.crumbs.splice(ind,1)[0]); // reorder crumbs
		else
			this.crumbs=this.crumbs.slice(0,ind+1); // trim crumbs
		if (config.options.chkBreadcrumbsLimitOpenTiddlers)
			this.limitOpenTiddlers();
		this.refresh();
		return false;
	},
	getAreas: function() {
		var crumbAreas=[];
		// find all DIVs with classname=="breadCrumbs"
		// Note: use try/catch to avoid "Bad NPObject as private data" fatal error  caused when
		// some versions of embedded QuickTime player element is accessed by hasClass() function.
		var all=document.getElementsByTagName("*");
		for (var i=0; i<all.length; i++)
			try{ if (hasClass(all[i],"breadCrumbs")) crumbAreas.push(all[i]); } catch(e) {;}
		// find single DIV w/fixed ID (backward compatibility)
		var byID=document.getElementById("breadCrumbs")
		if (byID && !hasClass(byID,"breadCrumbs")) crumbAreas.push(byID);
		if (!crumbAreas.length && config.options.chkCreateDefaultBreadcrumbs) {
			// no existing crumbs display areas... create one...
			var defaultArea = createTiddlyElement(null,"span",null,"breadCrumbs",null);
		 	defaultArea.style.display= "none";
			var targetArea= document.getElementById("tiddlerDisplay");
		 	targetArea.parentNode.insertBefore(defaultArea,targetArea);
			crumbAreas.push(defaultArea);
		}
		return crumbAreas;
	},
	refresh: function() {
		var crumbAreas=this.getAreas();
		for (var i=0; i<crumbAreas.length; i++) {
			crumbAreas[i].style.display = config.options.chkShowBreadcrumbs?"block":"none";
			removeChildren(crumbAreas[i]);
			this.render(crumbAreas[i]);
		}
	},
	render: function(here) {
		var co=config.options; var out=""
		var homeSep=here.getAttribute("homeSep"); if (!homeSep) homeSep=this.homeSeparator;
		var crumbSep=here.getAttribute("crumbSep"); if (!crumbSep) crumbSep=this.crumbSeparator;
		if (!co.chkBreadcrumbsHideHomeLink) {
			createTiddlyButton(here,"Home",null,this.home,"tiddlyLink tiddlyLinkExisting");
			out+=homeSep;
		}
		for (c=0; c<this.crumbs.length; c++) // remove non-existing tiddlers from crumbs
			if (!store.tiddlerExists(this.crumbs[c]) && !store.isShadowTiddler(this.crumbs[c]))
				this.crumbs.splice(c,1);
		var count=this.crumbs.length;
		if (co.chkBreadcrumbsLimit && co.txtBreadcrumbsLimit<count) count=co.txtBreadcrumbsLimit;
		var list=[];
		for (c=this.crumbs.length-count; c<this.crumbs.length; c++) list.push('[['+this.crumbs[c]+']]');
		if (co.chkBreadcrumbsReverse) list.reverse();
		out+=list.join(crumbSep);
		wikify(out,here);
	},
	home: function() {
		var cmb=config.macros.breadcrumbs;
		if (config.options.chkBreadcrumbsSave && confirm(cmb.askMsg)) cmb.saveCrumbs();
		story.closeAllTiddlers(); restart();
		cmb.crumbs = []; var crumbAreas=cmb.getAreas();
		for (var i=0; i<crumbAreas.length; i++) crumbAreas[i].style.display = "none";
		return false;
	},
	saveCrumbs: function() {
		var tid=prompt(this.saveMsg,this.saveTitle); if (!tid||!tid.length) return; // cancelled by user
		var t=store.getTiddler(tid);
		if(t && !confirm(config.messages.overwriteWarning.format([tid]))) return;
		var who=config.options.txtUserName;
		var when=new Date();
		var text='[['+this.crumbs.join(']]\n[[')+']]';
		var tags=t?t.tags:[]; tags.pushUnique('story');
		var fields=t?t.fields:{};
		store.saveTiddler(tid,tid,text,who,when,tags,fields);
		story.displayTiddler(null,tid);
		story.refreshTiddler(tid,null,true);
		displayMessage(tid+' has been '+(t?'updated':'created'));
	},
	limitOpenTiddlers: function() {
		var limit=config.options.txtBreadcrumbsLimitOpenTiddlers; if (limit<1) limit=1;
		for (c=this.crumbs.length-1; c>=0; c--) {
			var tid=this.crumbs[c];
			var elem=document.getElementById(story.idPrefix+tid);
			if (elem) { // tiddler is displayed
				if (limit <=0) { // display limit has been reached
					if (elem.getAttribute("dirty")=="true") { // tiddler is being edited
						var msg="'"+tid+"' is currently being edited.\n\n";
						msg+="Press OK to save and close this tiddler\nor press Cancel to leave it opened";
						if (confirm(msg)) { story.saveTiddler(tid); story.closeTiddler(tid); }
					}
					else
						story.closeTiddler(this.crumbs[c]);
				}
				limit--;
			}
		}
	}
};
if (config.macros.breadcrumbs.homeSeparator==undefined) // note: not a cookie
	config.macros.breadcrumbs.homeSeparator=" | ";
if (config.macros.breadcrumbs.crumbSeparator==undefined)  // note: not a cookie
	config.macros.breadcrumbs.crumbSeparator=" > ";

config.commands.previousTiddler = {
	text: 'back',
	tooltip: 'view the previous tiddler',
	hideReadOnly: false,
	dateFormat: 'DDD, MMM DDth YYYY hh:0mm:0ss',
	handler: function(event,src,title) {
		var here=story.findContainingTiddler(src); if (!here) return;
		var crumbs=config.macros.breadcrumbs.crumbs;
		if (crumbs.length>1) {
			var crumb=crumbs[crumbs.length-2];
			story.displayTiddler(here,crumb);
		}
		else
			config.macros.breadcrumbs.home();
		return false;
	}
};

config.macros.previousTiddler= {
	label: 'back',
	prompt: 'view the previous tiddler',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var label=params.shift(); if (!label) label=this.label;
		var prompt=params.shift(); if (!prompt) prompt=this.prompt;
		createTiddlyButton(place,label,prompt,function() {
			var crumbs=config.macros.breadcrumbs.crumbs;
			if (crumbs.length>1) {
				var crumb=crumbs[crumbs.length-2];
				story.displayTiddler(place,crumb);
			}
			else
				config.macros.breadcrumbs.home();
		});
	}
}

// hijack story.displayTiddler() so crumbs can be refreshed when a tiddler is displayed
if (Story.prototype.breadCrumbs_coreDisplayTiddler==undefined)
	Story.prototype.breadCrumbs_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,slowly)
{
	var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
	this.breadCrumbs_coreDisplayTiddler.apply(this,arguments);
	// if not displaying tiddler during document startup, then add it to the breadcrumbs
	// note: 'startingUp' flag is a global, set/reset by the core init() function
	if (!startingUp || config.options.chkShowStartupBreadcrumbs) config.macros.breadcrumbs.add(title);
}

// hijack store.removeTiddler() so crumbs can be refreshed when a tiddler is deleted
if (TiddlyWiki.prototype.breadCrumbs_coreRemoveTiddler==undefined)
	TiddlyWiki.prototype.breadCrumbs_coreRemoveTiddler=TiddlyWiki.prototype.removeTiddler;
TiddlyWiki.prototype.removeTiddler= function(title)
{
	this.breadCrumbs_coreRemoveTiddler.apply(this,arguments);
	config.macros.breadcrumbs.refresh();
}
//}}}
/***
|Name|BreadcrumbsPluginInfo|
|Author|Eric Shulman|
|Source|http://www.TiddlyTools.com/#BreadcrumbsPlugin|
|Documentation|http://www.TiddlyTools.com/#BreadcrumbsPluginInfo|
|Version|2.1.0|
|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler,TiddlyWiki.prototype.removeTiddler|
|Description|Documentation for BreadcrumbsPlugin|
This plugin provides a list of links to all tiddlers opened during the session, creating a "trail of breadcrumbs" from one tiddler to the next, allowing you to quickly navigate to any previously viewed tiddler, or select 'home' to reset the display to the initial set of tiddlers that were open at the start of the session (i.e., when the document was loaded into the browser).
!!!!!Usage
<<<
syntax:
{{{
<<breadcrumbs homeSeparator crumbSeparator>>
}}}
By default, the breadcrumbs are displayed as a continuous, //horizontal// word-wrapped line of text, using default character sequences for ''homeSeparator'' (" | ") and ''crumbSeparator'' (" > ").  The //optional// ''homeSeparator'' and ''crumbSeparator'' macro parameters allow you to specify alternative separators.  For example, to display the breadcrumbs //vertically// (in a stack, rather than a row), set the separator values to use {{{[[<br>]]}}}... and, to display a horizontal line as the home separator, use {{{[[<html><hr></html>]]}}}.
<<<
!!!!!Examples:
<<<
{{{
<<breadcrumbs>>
}}}
<<breadcrumbs>>
{{{
<<breadcrumbs [[<html><hr></html>]] [[<br>]]>>
}}}
<<breadcrumbs [[<html><hr></html>]] [[<br>]]>>
<<<
!!!!!Customization
<<<
Using CSS and a few of the plugin configuration options (see below), you can make the breadcrumbs display resemble browser tabs by adding the following to your [[StyleSheet]]:
{{{
.breadCrumbs { border-bottom:1px solid; }
.breadCrumbs a {
	border: 1px solid; padding: 0px 1em;
	-moz-border-radius-topleft:.5em; -moz-border-radius-topright:.5em;
	-webkit-border-top-left-radius:.5em; -webkit-border-top-right-radius:.5em;
}
}}}
and this in [[ConfigTweaks]] (tagged with systemConfig, of course):
{{{
config.options.chkShowStartupBreadcrumbs=true;
config.options.chkBreadcrumbsLimitOpenTiddlers=true;
config.options.txtBreadcrumbsLimitOpenTiddlers=1;
config.macros.breadcrumbs.homeSeparator=" ";
config.macros.breadcrumbs.crumbSeparator=" ";
}}}
<<<
!!!!!Configuration
<<<
__''display placement:''__
<<option chkCreateDefaultBreadcrumbs>> automatically create breadcrumbs display (if needed)
{{{<<option chkCreateDefaultBreadcrumbs>>}}}
>By default, the plugin automatically creates the "breadCrumbs" display element at the top of the story column, just above the tiddlerDisplay area.  To manually control the display and placement of the breadcrumbs display, you can define a DIV with class="breadCrumbs" in a custom [[PageTemplate]] or embed the {{{<<breadcrumbs>>}}} macro in specific tiddler content.
>
>For example, to add the breadcrumbs below the mainMenu, change this:
{{{
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
}}}
>to:
{{{
<div id='mainMenu'>
	<div refresh='content' tiddler='MainMenu'></div>
	<div id='breadCrumbs' class='breadCrumbs'></div>
</div>
}}}
>You can also block automatic creation of the breadcrumbs display by setting
{{{
config.options.chkCreateDefaultBreadcrumbs=false;
}}}
>in a [[CookieJar]]/[[ConfigTweaks]] plugin tiddler.

__''other settings:''__
<<option chkShowBreadcrumbs>> show/hide breadcrumbs display
{{{<<option chkShowBreadcrumbs>>}}}
>This checkbox toggles the visibility of the breadcrumbs display.  However, the display is not updated until the next crumb is added (or a previous crumb is clicked on).  For immediate effect, the [[ToggleBreadcrumbs]] script uses [[InlineJavascriptPlugin]] to synchronize the checkbox setting and the breadcrumbs display.
<<option chkReorderBreadcrumbs>> re-order breadcrumbs when visiting a previously viewed tiddler
{{{<<option chkReorderBreadcrumbs>>}}}
>When visiting a previously viewed tiddler, the title of the most-recently displayed tiddler is simply moved to the end of the list and individual breadcrumbs are not removed from the list unless the underlying tiddler is deleted.  When ''re-ordering'' is disabled, the breadcrumbs list is ''trimmed'' so that all crumbs following that tiddler are removed from the list.
<<option chkBreadcrumbsHideHomeLink>> omit 'Home' link from breadcrumbs display
{{{<<option chkBreadcrumbsHideHomeLink>>}}}
>Enabling this option suppresses the automatic display of the "Home" link (and home separator).  To manually add the home link elsewhere in your document, use the following HTML:
{{{
<html><a href="javascript:;" onclick="config.macros.breadcrumbs.home()">home</a></html>
}}}
<<option chkBreadcrumbsSave>> prompt to save breadcrumbs when 'Home' link is pressed
{{{<<option chkBreadcrumbsSave>>}}}
>Whenever you press the 'home' button, you can be prompted to save the current breadcrumbs in a tiddler as a space-separated list of tiddler links (default title="SavedBreadcrumbs").  
<<option chkShowStartupBreadcrumbs>> show breadcrumbs for 'startup' tiddlers
{{{<<option chkShowStartupBreadcrumbs>>}}}
>Breadcrumbs are usually only added for tiddlers that are opened after the document has been loaded, and not for tiddlers displayed during initial startup (e.g., [[DefaultTiddlers]]).  Enabling this option displays breadcrumbs for all viewed tiddlers, regardless of when they are opened.
<<option chkBreadcrumbsReverse>> show breadcrumbs in reverse order
{{{<<option chkBreadcrumbsReverse>>}}}
>As tiddlers are displayed, breadcrumbs are usually added to the //end// of the list.  Enabling this option displays breadcrumbs in reverse order, so that the most recently visited tiddlers are listed first.
<<option chkBreadcrumbsLimit>> limit breadcrumbs display to {{twochar{<<option txtBreadcrumbsLimit>>}}} items
{{{<<option chkBreadcrumbsLimit>>}}} and {{{<<option txtBreadcrumbsLimit>>}}}
>By default, breadcrumbs are displayed for all tiddlers that have been visited (unless the list is being 'trimmed' by disabling the chkReorderBreadcrumbs option above).  Enabling this option limits the display of the list to a maximum specified number of breadcrumbs.
<<option chkBreadcrumbsLimitOpenTiddlers>> limit open tiddlers to {{twochar{<<option txtBreadcrumbsLimitOpenTiddlers>>}}} items
{{{<<option chkBreadcrumbsLimitOpenTiddlers>>}}} and {{{<<option txtBreadcrumbsLimitOpenTiddlers>>}}}
>By default, tiddlers remain open (e.g., displayed in the story column) until you explicitly close them.  When this option is enabled, only the most recently opened tiddlers will remain open: ''any tiddlers in excess of the specified limit are automatically closed.''  //Note: for 'data safety', if a tiddler is being edited, you will be asked for permission to "save-and-close" that tiddler or leave it open (even if that would exceed the specified limit).//
<<<
!!!!!Revisions
<<<
2009.03.22 [2.1.0] added 'save breadcrumbs to tiddler' feature
2008.05.01 [2.0.0] added 'limit open tiddlers' feature (with safety check for tiddler in edit mode)
2008.04.06 [1.9.1] corrected 'limit' logic so that //last// N crumbs are shown instead of //first// N crumbs.  Also, added chkBreadcrumbsHideHomeLink
2008.04.04 [1.9.0] added chkBreadcrumbsReverse and chk/txtBreadcrumbsLimit
2008.03.29 [1.8.4] in displayTiddler(), get title from tiddler object (if needed).  Fixes errors caused when calling function passes a tiddler *object* instead of a tiddler *title*
2008.03.24 [1.8.3] include shadow tiddlers in breadcrumbs list.  Also changed settings so that "reordering" breadcrumbs is the default, instead of "trimming" the list
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.10.26 [1.8.2] documentation cleanup
2007.10.18 [1.8.1] in GetAreas(), use try/catch to avoid "Bad NPObject as private data" fatal error caused when embedded QuickTime player element is accessed by hasClass() function.
2007.10.02 [1.8.0] major documentation and code cleanup.  Moved config.breadCrumbs.* to config.macros.breadcrumbs.* to consolidate objects.  Also, fixed homeSeparator and crumbSeparator default handling.
2007.10.02 [1.7.0] added config.options.chkShowStartupBreadcrumbs option
2007.09.16 [1.6.1] in getAreas(), removed errant use of 'place' (was causing fatal error when creating default breadcrumbs display element).  Also, added chkCreateDefaultBreadcrumbs configuration setting to enable/disable automatic creation of a default breadcrumbs display.
2007.09.16 [1.6.0] re-wrote refresh() to enable multiple display instances, by finding elements with "breadCrumbs" classname.  Fallback to fixed ID (="breadCrumbs") is still used for backward-compatibility.  move rendering code from refresh() to separate render() function, and added definition for {{{<<breadCrumbs>>}}} macro to support embedding breadcrumbs displays in tiddler content.
2007.09.15 [1.5.9.1] updated documentation
2007.09.15 [1.5.9] defined homeSeparator (" | ") and crumbSeparator (" > ") as object properties so that they can be redefined as desired for different layouts (e.g., using 'newline' for the crumbSeparator will arrange crumbs in a column rather than a row.
2007.06.21 [1.5.8.1] in home(), return false to prevent IE from attempting to navigate away...
2007.05.26 [1.5.8] added support for {{{<<option chkReorderBreadcrumbs>>}}} to toggle trim vs. re-order behavior when visiting previously viewed tiddlers
2007.05.25 [1.5.7] added support for {{{<<option chkShowBreadcrumbs>>}}} to toggle //display// of breadcrumbs
2007.05.24 [1.5.6] in refresh(), remove non-existing tiddler titles from crumb list.  Also, hijack removeTiddler() so crumbs can be updated after tiddler is deleted.
2007.04.11 [1.5.5] added optional params to previousTiddler macro handler() to allow alternative label and tooltip text (instead of default "back")
2007.03.02 [1.5.4] in refresh(), for TW2.2, look for "storyDisplay" instead of "tiddlerDisplay" but keep fallback to "tiddlerDisplay" for TW2.1 or earlier
2007.02.24 [1.5.3] changed from hijack of onClickTiddlerLink to hijack of displayTiddler() so that ALL displayed tiddlers are recorded in the crumbs, including programmatically displayed tiddlers opened by macros, scripts, etc., (such as [[GotoPlugin]], among many others) in addition to those opened by clicks on links.
2007.02.24 [1.5.2.0] eliminated global space clutter by moving function and data declarations so they are contained inside config.breadCrumbs object.
2007.02.06 [1.5.1] added "previousTiddler" macro (for use in sidebar)
2007.02.05 [1.5.0] added "previousTiddler" toolbar command (aka, "back")
2006.08.04 [1.4.0.1] change spaces to tabs
2006.08.04 [1.4.0] modified from 1.4.0 distro: in refresh(), set {{{display:none/block}}} instead of {{{visibility:hidden/visible}}}.  In home(), check for valid crumbArea before setting style.
2006.08.02 [1.4.0] Fixed bug, the redefined onClickTiddlerLink_orig_breadCrumbs works incorrectly on IE
2006.07.20 [1.3.0] Runs compatibly with TW 2.1.0 (rev #403+)
2006.02.07 [1.2.0] change global array breadCrumbs to config.breadCrumbs by Eric's suggestion
2006.02.04 [1.1.0] JSLint checked
2006.02.01 [1.0.0] initial release
<<<
<<tiddler ToggleBreadcrumbs>>
<<tiddler ToggleSinglePageMode>>
toggle <<tiddler ToggleFullScreen>>
toggle <<tiddler ToggleTiddlerTags>>

more [[settings|AdvancedOptions]]
----
<<ccOptions>>
/%
|Name|BreadcrumbsCommand|
|Source|http://www.TiddlyTools.com/#BreadcrumbsCommand|
|Version|1.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|BreadcrumbsPlugin|
|Overrides||
|Description|"crumbs" command displays current breadcrumbs list in a popup|

%/<html><hide linebreaks><a href="javascript:;" class="TiddlyLink" title="tiddlers viewed during this session"
	onclick="var p=Popup.create(this); if (!p) return;
		var d=createTiddlyElement(p,'div');
		d.style.whiteSpace='normal'; d.style.width='auto'; d.style.padding='2px';
	wikify('\<\<breadcrumbs [[\<html\>\<hr\>\</html\>]] [[<br>]]\>\>',d);
		Popup.show(); event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation();
		return(false);"
>crumbs</a></html>
/%
|Name|ToggleBreadcrumbs|
|Source|http://www.TiddlyTools.com/#ToggleBreadcrumbs|
|Version|0.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|script|
|Requires|BreadcrumbsPlugin, InlineJavascriptPlugin|
|Overrides||
|Description|dynamically enable/disable BreadcrumbsPlugin display|
%/<script>
if (config.options.chkShowBreadcrumbs==undefined) config.options.chkShowBreadcrumbs=true;
</script><<option chkShowBreadcrumbs>><script>
	var chk=place.lastChild;
	chk.coreOnChange=chk.onchange;
	chk.onchange=function() {
		if (this.coreOnChange) this.coreOnChange.apply(this,arguments);
		this.checked=config.options.chkShowBreadcrumbs;
		if (config.macros.breadcrumbs) config.macros.breadcrumbs.refresh();
	};
</script> show breadcrumbs
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2009.04.11 [1.9.5] pass current tiddler object into wrapper code so it can be referenced from within 'onclick' scripts
2009.02.26 [1.9.4] in $(), handle leading '#' on ID for compatibility with JQuery syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 5, date: new Date(2009,4,11)};

config.formatters.push( {
	name: "inlineJavascript",
	match: "\\<script",
	lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?(?: key=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",

	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var src=lookaheadMatch[1];
			var label=lookaheadMatch[2];
			var tip=lookaheadMatch[3];
			var key=lookaheadMatch[4];
			var show=lookaheadMatch[5];
			var code=lookaheadMatch[6];
			if (src) { // external script library
				var script = document.createElement("script"); script.src = src;
				document.body.appendChild(script); document.body.removeChild(script);
			}
			if (code) { // inline code
				if (show) // display source in tiddler
					wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
				if (label) { // create 'onclick' command link
					var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
					var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
					link.code="function _out(place,tiddler){"+fixup+"\n};_out(this,this.tiddler);"
					link.tiddler=w.tiddler;
					link.onclick=function(){
						this.bufferedHTML="";
						try{ var r=eval(this.code);
							if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
								var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
							if(this.bufferedHTML.length)
								s.innerHTML=this.bufferedHTML;
							if((typeof(r)==="string")&&r.length) {
								wikify(r,s,null,this.tiddler);
								return false;
							} else return r!==undefined?r:false;
						} catch(e){alert(e.description||e.toString());return false;}
					};
					link.setAttribute("title",tip||"");
					var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
					URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
					URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
					link.setAttribute("href",URIcode);
					link.style.cursor="pointer";
					if (key) link.accessKey=key.substr(0,1); // single character only
				}
				else { // run script immediately
					var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
					var c="function _out(place,tiddler){"+fixup+"\n};_out(w.output,w.tiddler);";
					try	 { var out=eval(c); }
					catch(e) { out=e.description?e.description:e.toString(); }
					if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
				}
			}
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} )
//}}}

// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
	if(limit > 0) text = text.substr(0,limit);
	var wikifier = new Wikifier(text,formatter,null,tiddler);
	return wikifier.wikifyPlain();
}
//}}}

// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
/***
|Name|InlineJavascriptPluginInfo|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.4|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for InlineJavascriptPlugin|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Usage
<<<
This plugin adds wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be recognized as embedded javascript code.
<script show>
	/* javascript code goes here... */
</script>Every time the tiddler content is rendered, the javascript code is automatically evaluated, allowing you to invoke 'side-effect' processing and/or produce dynamically-generated content that is then inserted into the tiddler content, immediately following the script (see below).  By including the optional ''show'' keyword as the final parameter in a {{{<script>}}} marker, the plugin will also include the script source code in the output that it displays in the tiddler.  This is helpful when creating examples for documentation purposes (such as used in this tiddler!)

__''Deferred execution from an 'onClick' link''__
<script label="click here" title="mouseover tooltip text" key="X" show>
	/* javascript code goes here... */
	alert('you clicked on the link!');
</script>
By including a {{{label="..."}}} parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered.  You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text, and a {{{key="X"}}} parameter to specify an //access key// (which must be a //single// letter or numeric digit only).

__''Loading scripts from external source files''__
<script src="URL" show>
	/* optional javascript code goes here... */
</script>You can also load javascript directly from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}).  This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins.  The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.

In addition to loading the javascript from the external file, you can also use this feature to invoke javascript code contained within the {{{<script>...</script>}}} markers.  This code is invoked //after// the external script file has been processed, and can make immediate use of the functions and/or global variables defined by the external script file.
>Note: To ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that is rendered as soon as your TiddlyWiki document is opened, such as MainMenu.  For example: put your {{{<script src="..."></script>}}} syntax into a separate 'library' tiddler (e.g., LoadScripts), and then add {{{<<tiddler LoadScripts>>}}} to MainMenu so that the library is loaded before any other tiddlers that rely upon the functions it defines. 
>
>Normally, loading external javascript in this way does not produce any direct output, and should not have any impact on the appearance of your MainMenu.  However, if your LoadScripts tiddler contains notes or other visible content, you can suppress this output by using 'inline CSS' in the MainMenu, like this: {{{@@display:none;<<tiddler LoadScripts>>@@}}}
<<<
!!!!!Creating dynamic tiddler content and accessing the ~TiddlyWiki DOM
<<<
An important difference between TiddlyWiki inline scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document: in a typical web document, you use the {{{document.write()}}} (or {{{document.writeln()}}}) function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.

However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and instead will //completely replace the entire ~TiddlyWiki document in your browser window (which is clearly not a good thing!)//.  In order to allow scripts to use {{{document.write()}}}, the plugin automatically converts and buffers all HTML output so it can be safely inserted into your tiddler content, immediately following the script.

''Note that {{{document.write()}}} can only be used to output "pure HTML" syntax.  To produce //wiki-formatted// output, your script should instead return a text value containing the desired wiki-syntax content'', which will then be automatically rendered immediately following the script.  If returning a text value is not sufficient for your needs, the plugin also provides an automatically-defined variable, 'place', that gives the script code ''direct access to the //containing DOM element//'' into which the tiddler output is being rendered.  You can use this variable to ''perform direct DOM manipulations'' that can, for example:
* generate wiki-formatted output using {{{wikify("...content...",place)}}}
* vary the script's actions based upon the DOM element in which it is embedded
* access 'tiddler-relative' DOM information using {{{story.findContainingTiddler(place)}}}
Note:
''When using an 'onclick' script, the 'place' element actually refers to the onclick //link text// itself, instead of the containing DOM element.''  This permits you to directly reference or modify the link text to reflect any 'stateful' conditions that might set by the script.  To refer to the containing DOM element from within an 'onclick' script, you can use "place.parentNode" instead.
<<<
!!!!!Instant "bookmarklets"
<<<
You can also use an 'onclick' link to define a "bookmarklet": a small piece of javascript that can be ''invoked directly from the browser without having to be defined within the current document.''  This allows you to create 'stand-alone' commands that can be applied to virtually ANY TiddlyWiki document... even remotely-hosted documents that have been written by others!!  To create a bookmarklet, simply define an 'onclick' script and then grab the resulting link text and drag-and-drop it onto your browser's toolbar (or right-click and use the 'bookmark this link' command to add it to the browser's menu).

Notes:
*When writing scripts intended for use as bookmarklets, due to the ~URI-encoding required by the browser, ''you cannot not use ANY double-quotes (") within the bookmarklet script code.''
*All comments embedded in the bookmarklet script must ''use the fully-delimited {{{/* ... */}}} comment syntax,'' rather than the shorter {{{//}}} comment syntax.
*Most importantly, because bookmarklets are invoked directly from the browser interface and are not embedded within the TiddlyWiki document, there is NO containing 'place' DOM element surrounding the script.  As a result, ''you cannot use a bookmarklet to generate dynamic output in your document,''  and using {{{document.write()}}} or returning wiki-syntax text or making reference to the 'place' DOM element will halt the script and report a "Reference Error" when that bookmarklet is invoked.  
Please see [[InstantBookmarklets]] for many examples of 'onclick' scripts that can also be used as bookmarklets.
<<<
!!!!!Special reserved function name
<<<
The plugin 'wraps' all inline javascript code inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler.  To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.
<<<
!!!!!$(...) 'shorthand' function
<<<
As described by Dustin Diaz [[here|http://www.dustindiaz.com/top-ten-javascript/]], the plugin defines a 'shorthand' function that allows you to write:
{{{
$(id)
}}}
in place of the normal standard javascript syntax:
{{{
document.getElementById(id)
}}}
This function is provided merely as a convenience for javascript coders that may be familiar with this abbreviation, in order to allow them to save a few bytes when writing their own inline script code.
<<<
!!!!!Examples
<<<
simple dynamic output:
><script show>
	document.write("The current date/time is: "+(new Date())+"<br>");
	return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
	if (!window.story) window.story=window;
	var title=story.findContainingTiddler(place).getAttribute("tiddler");
	var size=store.getTiddlerText(title).length;
	return title+" is using "+size+" bytes";
</script>
dynamic output from an 'onclick' script, using {{{document.write()}}} and/or {{{return "..."}}}
><script label="click here" show>
	document.write("<br>The current date/time is: "+(new Date())+"<br>");
	return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
creating an 'onclick' button/link that accesses the link text AND the containing tiddler:
><script label="click here" title="clicking this link will show an 'alert' box" key="H" show>
	if (!window.story) window.story=window;
	var txt=place.firstChild.data;
	var tid=story.findContainingTiddler(place).getAttribute('tiddler');
	alert('Hello World!\nlinktext='+txt+'\ntiddler='+tid);
</script>
dynamically setting onclick link text based on stateful information:
>{{block{
{{{
<script label="click here">
	/* toggle "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.innerHTML=on?"enable":"disable";
	config.txtSomething=on?"OFF":"ON";
	return "\nThe current value is: "+config.txtSomething;
</script><script>
	/* initialize onclick link text based on current "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.lastChild.previousSibling.innerHTML=on?"disable":"enable";
</script>
}}}
<script label="click here">
	/* toggle "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.innerHTML=on?"enable":"disable";
	config.txtSomething=on?"OFF":"ON";
	return "\nThe current value is: "+config.txtSomething;
</script><script>
	/* initialize onclick link text based on current "txtSomething" value */
	var on=(config.txtSomething=="ON");
	place.lastChild.innerHTML=on?"enable":"disable";
</script>
}}}
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function inlineJavascriptDemo() { alert('Hello from demo.js!!') } }}}
>>{{{displayMessage('InlineJavascriptPlugin: demo.js has been loaded');}}}
>note: When using this example on your local system, you will need to download the external script file from the above URL and install it into the same directory as your document.
>
><script src="demo.js" show>
	return "inlineJavascriptDemo() function has been defined"
</script>
><script label="click to invoke inlineJavascriptDemo()" key="D" show>
	inlineJavascriptDemo();
</script>
<<<
!!!!!Revisions
<<<
2009.02.26 [1.9.4] in $(), handle leading '#' on ID for compatibility with JQuery syntax
2008.06.11 [1.9.3] added $(...) function as 'shorthand' for document.getElementById()
2008.03.03 [1.9.2] corrected fallback declaration of wikifyPlainText() (fixes Safari "parse error")
2008.02.23 [1.9.1] in onclick function, use string instead of array for 'bufferedHTML' (fixes IE errors)
2008.02.21 [1.9.0] output from 'onclick' scripts (return value or document.write() calls) are now buffered and rendered into into a span following the script.  Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed).  Thanks to Xavier Verges for suggestion and preliminary code.
2008.02.14 [1.8.1] added backward-compatibility for use of wikifyPlainText() in TW2.1.3 and earlier
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 [1.8.0] added support for key="X" syntax to specify custom access key definitions
2007.12.15 [1.7.0] autogenerate URI encoded HREF on links for onclick scripts.  Drag links to browser toolbar to create bookmarklets.  IMPORTANT NOTE: place is NOT defined when scripts are used as bookmarklets.  In addition, double-quotes will cause syntax errors.  Thanks to PaulReiber for debugging and brainstorming.
2007.11.26 [1.6.2] when converting "document.write()" function calls in inline code, allow whitespace between "write" and "(" so that "document.write ( foobar )" is properly converted.
2007.11.16 [1.6.1] when rendering "onclick scripts", pass label text through wikifyPlainText() to parse any embedded wiki-syntax to enable use of HTML entities or even TW macros to generate dynamic label text.
2007.02.19 [1.6.0] added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
2006.10.16 [1.5.2] add newline before closing '}' in 'function out_' wrapper.  Fixes error caused when last line of script is a comment.
2006.06.01 [1.5.1] when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
2006.04.19 [1.5.0] added 'show' parameter to force display of javascript source code in tiddler output
2006.01.05 [1.4.0] added support 'onclick' scripts.  When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked.  'place' value is set to match the clicked button/link element.
2005.12.13 [1.3.1] when catching eval error in IE, e.description contains the error text, instead of e.toString().  Fixed error reporting so IE shows the correct response text.  Based on a suggestion by UdoBorkowski
2005.11.09 [1.3.0] for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content.  Based on a suggestion by BradleyMeck
2005.11.08 [1.2.0] handle loading of javascript from an external URL via src="..." syntax
2005.11.08 [1.1.0] pass 'place' param into scripts to provide direct DOM access 
2005.11.08 [1.0.0] initial release
<<<
A wiki for the brainstorming of the creation of [[Slumberland]]

Note that not everything here is likely to be self-consistent, or make sense. It's ideas hobbled together as I discover or think of them. Sometimes they make sense only with additional information from my BRAIN, sometimes they will contradict other ideas elsewhere on this site. Over time I do aim to clarify and smooth out all data here however. 
from "Little Nemo in Slumberland". It's a name I've long held in mind as the name for my first place by myself, and/or first place I own. 

I've decided that that's an "and", since my first rental place of my own I've called Slumberland, but I feel the name suits sufficiently to be the name of this more permanent house also. 
I have no timeline for when in the future this may happen. At one point (2011ish) I still had the aspirational hopes of youth that it could be done by the end of that decade... 
Decking ([[wheelchair accessible|accessibility]]) would surround most of the house, with a major deck around the [[Kitchen]] and [[Lounge]] area, but extending down to the [[Games Room]] and [[Master Bedroom]]. 

The [[Library]] may have smaller private decks
I visited a house that had been designed to be wheelchair accessible. It was fantastic and seemed much friendlier for able-bodied humans also. It's more or less a [[Feng Shui]] thing. 

Here are some points to consider. I'm sure there are plenty of professional resources out there with more complete considerations
!!! General
* Wide doorways
* No sharp turns
!!! [[Verandah]]
* Decking nailed from underneath ensures nails do not pop up that would puncture tyres
!!! [[Kitchen]] / [[Bathroom]] / [[Laundry]]
* non-slip surfaces
* All fittings at appropriate heights
* Nothing that must be stepped over (eg: shower space)
!!! Library
* I'm not sure that my current library ideas lend themselves to this principle, the central library level should at least be nominally wheelchair accessible. Perhaps a platform-on-a-pully could be rigged up for access to the other levels! ;)
> I  want to talk about Feng Shui, which is something I know very little about, but there's been a lot of talk about it recently in terms of figuring out how a building should be designed, built, situated, decorated and so on. Apparently, we need to think about the building being inhabited by dragons and look at it in terms of how a dragon would move around it.
> (...)
> Go back to the issue of how you figure out how a room or a house should be designed and instead of going through all the business of trying to work out the angles and trying to digest which genuine architectural principles you may want to take out of what may be a passing architectural fad, just ask yourself, 'how would a dragon live here?' We are used to thinking in terms of organic creatures; an organic creature may consist of an enormous complexity of all sorts of different variables that are beyond our ability to resolve but we know how organic creatures live. We've never seen a dragon but we've all got an idea of what a dragon is like, so we can say, 'Well if a dragon went through here, he'd get stuck just here and a little bit cross over there because he couldn't see that and he'd wave his tail and knock that vase over'. You figure out how the dragon's going to be happy here and lo and behold! you've suddenly got a place that makes sense for other organic creatures, such as ourselves, to live in.
{{credit{ -- Douglas Adams - http://www.biota.org/people/douglasadams/ }}}
content that needs to be refactored into the rest of the wiki... likely from ThorxWiki

----

* http://www.baekdal.com/Design/Interior-Design/rock-cushions/
* http://www.designboom.com/ has interesting competitions 
* cutlery: plain simple shape, minimal decoration = cleanest. Also, handles should be flat for haptic orientation. Handles which are ROUND, suck. 
* http://www.bogenriefstudios.com/home.html - amazing glassword. dome lights for eg. wow!
* http://www.duncanmeerding.com.au/ - organic designed furniture
* http://www.chictip.com/furniture/modern-furniture-libro-by-busnelli - fantastic library chair looks like a book
* http://www.inventables.com/technologies/temperature-sensitive-glass - temperature sensitive glass

----

!! HouseDesign

!!! Random Extra Notes
* Wall-of-glass? Large Round Windows? Stained glass windows?
* Roof angled (ie, rotated, or indeed a different shape) relative to the main structure. Why? For environmental controls through shadow casting at different times of the year. This would need modelling.
* Basement area to maximise space whilst minimising above-ground volume
*** This being the case, can such heat pumps be valved for one-way heat transfer as nescessary?
* Handles on walls/corners/ceilings so as to act as a jungle-gym! (or in case the house experiences a localised gravity failure)
* exterior doorknobs with small rings of light to guide the key safe in. (like cars)

* If I move towards circular designs, investigate yurts? http://site.yurtworks.com.au/gallery.htm


!!! Bookmarks 
* Fireplace idea: http://www.worldarchitecturenews.com/index.php?fuseaction=wanappln.projectview&upload_id=12504
* http://www.onionhousehawaii.com/ - this is a cool idea 
* http://arstechnica.com/gadgets/news/2009/11/the-next-wireless-frontier-low-power-low-bandwidth.ars - low bandwidth and power for remote controls! :)
* http://www.joeydevilla.com/2007/05/31/staircase-drawers/ - storage in stairs
* http://www.preservationnation.org/main-street/main-street-news/2009/04/greening-MS-buildings.html - notes on greening buildings and historical green design elements


http://brisbanetimes.domain.com.au/blogs/talking-property/dreaming-of-the-future-20110503-1e5rr.html


<<sectionTOC>>
http://wiki.thorx.net/
!! What is Mr Screen?

The circular light fixture from Pink Floyd shows, used both for lighting directly, and also as a screen onto which can be projected short animations and clips to accompany various songs. 

By the P.U.L.S.E tour it consists of 36 intelligent lights (up from 28 in the Delicate Sound of Thunder tour) around the rim, and it was moveable from vertical (circular screen behind stage) to horizontal (halo over Gilmour). 

It is perhaps 10m diameter?

<<<
A large circular projection panel dubbed "Mr Screen" first made an appearance during performances of Dark Side of the Moon in 1974 and became a staple thereafter. Specially recorded films and animations were projected onto it, and for 1977 "In the Flesh" and 1980-1981 "The Wall Live" tours, coloured spotlights were fixed around the rim, an effect which reached its zenith with the dancing patterns of multi-coloured lights in the A Momentary Lapse of Reason and Division Bell tours. In the latter, the screen could be retracted behind the stage when not required, and was tilted with its peripheral lights focused onto the stage into a single spotlight during the final guitar solo in "Comfortably Numb"
<<<
{{credit{ -- wikipedia:Pink_Floyd_live_performances#The_light_show}}}

!! What is the Stargate?
http://en.wikipedia.org/wiki/Stargate_(device%29
The circular portal that creates an artificial wormhole to another planet. Eponymous to a Movie and TV series. The Stargate is stone/metal in appearance, with a diameter of 6.7m, and 9 chevrons surrounding. The chevrons glow red when active, whilst an active wormhole has a shimmering 'water' effect across it's a sortace. 

!! So, could we make one for a HomeTheatre?
ie, it be a very specific [[wikipedia:Batten (theater)]]?
* 36 mini [[wiki:intelligent lighting]] 
** How small can intelli-light systems get?
* Initially at least, let's say we'd want no more than about 400watts of lighting? For the sake of numbers, let's call it 360watts = 10watts per light.
** USB conrolled? This should be controllable through USB right (still need seperate power though: note: USB at full-power/no-data mode is still only 9W) 
** How about bluetooth controlled? Saves cabling (which needs to be rolled out for power anyway... but may be added complexity?)
* With a diameter of 3metres (scale 44% of a Stargate) for a home theatre, that is a perimeter of 9.4metres - which gives us 26cm of circumference per light. To keep the proportions more or less sensible, each light should be no bigger than a fist (or magic 8-ball, or stack of iPhones - however you want to imagine it :)
* With a diameter of 2.23metres (exactly ⅓ stargate - and perhaps more "actual home realistic"?), we have a perimeter of 7metres - which works out to approx 20cm per light. 
** A 'standard' german wheel size is 2.15m... = approx 18cm/light
** Make it the same diameter as the height of the fireplace on the other side? (9' = 274cm)

!! Lighting effects possible
* all beams point out - looking into a cone
* all beams point to a point behind you - looking out of a cone
* cone beams, weaved (beams alternate a clockwise/anticlockwise rotation)
* all beams point to central point - in various colours
* all beams point around perimeter to generate a halo
* 'mood' or even night lighting by only using a fraction of the lights. 
* a clock:
** second hand: 1⅔ seconds per light to traverse in a minute
** minute hand: 100 seconds per light to traverse in an hour
** hour hand: 432 seconds (7m12s) per light to traverse in 12 hours
** each light could spend that time swinging in an arc and fading into the next to give greater illusion of smoothness

* with 36 lights, we can allocate some lights to some of these tasks, and others to others. eg, every third light points to center with a colour, whilst the remaining 24 make a 'looking into cone' weave
** remember, 36 is a good number because it factors all the way down into 2,2,3,3, so we can have groups of 2, 3, 4, 6, 9, 12 or 18 :) 

!!! Object tracking
If there is a way that an objects location in 3d space within the room can be identified, then the lights should be able to also track that object. bluetooth probably wont cut it, but maybe something similar to a wiimote hack (google for Johnny Cheung)

!! The lights
We need lights with controls for: heading, azimuth, focus, colour and intensity. Also, assuming both heading and azimuth can be set as a delta OR as an absolute, it'd be sweet to specify the speed of change (for each). ie, how FAST to move into the new position. This moves the smarts "out" of the master controller, and into the light. This should allow for smoother transitions.

Also, would it be worth installing laser pointers in each light as additional effect, or is that when I've jumped the shark?

!! Usage
Since in a home it's unlikely to be used for actual GIGS very often (though not impossible), then what is the point? Well, let's call the two orientations 'stargate' (ie, vertically flat against the wall), and 'halo' (ie, above head, horizontally)

;Stargate position
:Feature wall:So many feature walls are just uninteresting and static expanses of a colour, or simple design. This is a dynamic feature wall now. 
:* With the right lighting, could a stargate wormhole even be simulated? (I think so, since we can have the 9 "chevrons" in faint red pointing out, and a remaining 27 blue/white lights pointing in and moving randomly. perhaps with an oil-filled [[wikipedia:Gobo_(lighting)|gobo]]?)). 
:**Note that the Stargate in-show is approx 22foot (6.7m) in diameter. I am proposing less than half that size (3m diametre = 44%)
:* What about an Eye of Sauron? I think with red/orange/yellow lights pointing in, and leaving the right 'eye' shape in the middle, there is potential
:* Also, ala Pink Floyd - a regular projector from the ceiling could project movies onto the screen. (with a gobo to make the result circular :)  
;Halo position
:Light fixture:On the ceiling, it can act like regular room lighting, providing mood/night lighting options as required. Think of it as a very wide, shallow chandelier. In this position, the projector/wall can be used for "regular" projector usage. 

I'd expect that most usage would be in halo mode as a variation of a regular room light. With a built in light sensor, it could adjust to attempt to maintain the same level of lighting whenever it is "on". If natural lighting is sufficient, then it would do nothing, but would ramp up intensity as required into the evening :) 

!! Links
* See here some of the visual effects it can do (as well as referring to concert footage, of course)
** http://dorseyland.blogsome.com/2007/04/19/lightning-on-the-dark-side-thunder-on-the-sun
** http://www.youtube.com/watch?v=zfNxjyQcEig - Some actual concert video
* Some info about 1995 tour lighting rig from the company that supplied them
** http://www.martin.com/casestory/casestory.asp?id=151
* LEDs can be BRIGHT: http://hackaday.com/2009/10/22/unreasonably-bright-bike-light-apparently-hunts-deer/
* LEDs can be a range of colours in a small device: http://www.thinkgeek.com/gadgets/lights/8db4/

* Lighting trusses
** http://gzlmele.en.alibaba.com/product/565076249-212636782/High_quality_curve_truss.html
** http://www.alibaba.com/product-gs/495526738/_250_250_Aluminum_truss_Curved.html
** http://www.alibaba.com/product-gs/730202319/The_cheapest_roof_truss_aluminum_truss.html
** https://www.google.com/search?q=truss+lighting
It plays sounds. It may have a MrScreen linked for real-time visualisations too
My idea is to have a hyperbolic paraboloid roof, with peaks at the front, back, and each side - with four grounding points. 
http://www.fundamentalform.com/html/saddle-curve_structures.html

Here is a simpler saddle curve... 
[img[http://upload.wikimedia.org/wikipedia/en/0/0f/Saddle_rectangle_example.png]]
— http://en.wikipedia.org/wiki/File:Saddle_rectangle_example.png

* Aerodynamic consideration: would this capture airflow along the roof line? If so, would that allow for useful venting of interior hot air through a vent at the center of the roof? (being one of the _lowest_ points!)

Otoh, should the center portion be raised - maintain the shape just extruded. This could allow airflow to clear upper air, and also provide windows for interior lighting

* Latex concrete as [[material]]? ...as per instructable: http://www.instructables.com/id/Latex-Concrete-Roof/

Skylights in general?

!!! Some curvy roofs of note... 
* Servo in California: "Vintage Orbit"
http://maps.google.com/maps?q=4716+Auburn+Blvd,+Sacramento,+Ca&hl=en&ll=38.653956,-121.353835&spn=0.00056,0.000669&sll=38.717846,-121.248937&sspn=0.012573,0.021393&vpsrc=6&t=h&z=21
The fireplace (just one?) is intended as the core heating system for the house in the bitterly cold (sic) Brisbane winters!

Position? As the dividing wall between the [[Lounge]] and [[Great Hall]]. Facing the lounge would be a monolithic (see [[Pop Culture]] pyrex (quartz glass?) wall, while the Great Hall side would be the door to feed it. As tempting as it is to have an open fireplace, a slow combustion makes more sense.

It would also act as a woodfired oven, with a door on the kitchen side edge, making it in effect, part of the kitchen. 

!! As monolith
The 2001 monoliths were of proportions of 1:4:9 (or: 1²:2²:3²), and size approx 1.2':4.8':11' (11' = 335cm)
But in 2001 it's stated it can be as big as needed. So how about? 25cm:100cm:225cm
* Or just the original metric in feet: 1':4':9' (9' = 274cm)

!! Ideas
* 'heatsink/radiator' like fins inside to distribute warmth through house (esp to tiled/wooden floors?) 
** could this act as a cooler in summer too, if there was equivalent piping to distribute heat from ceilings out to the ground? (compare with passive ground based heating as mentioned in GrandDesigns S01E02)
Basically, the fireplace heats pipes to heat the floors (and heat then rises, for the rooms), whilst the ceilings collect heat and pump it out to the outside ground as a cooling measure)

See: http://en.wikipedia.org/wiki/Rumford_fireplace
And this made me think about novelty chimney pots... http://www.brisbanetimes.com.au/opinion/politics/when-the-bad-guys-lose-20111227-1pbit.html
<!--{{{-->
<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>
  <div class='headerForeground'>
    <span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
    <span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
  </div>
</div>

<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>

<div id='displayArea'>
  <div id='messageArea'></div>
  <div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
cctiddly <<version>>
/***
|''Name''|MediaWikiTableFormatterPlugin|
|''Description''|Allows MediaWiki style tables in TiddlyWiki|
|''Author''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''Contributors''|FND|
|''Version''|0.1.2|
|''Status''|stable|
|''Source''|http://devpad.tiddlyspot.com/#MediaWikiTableFormatterPlugin|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/formatters/MediaWikiTableFormatterPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.1.0|
!Description
Enables [[MediaWiki|http://www.mediawiki.org]]'s table markup in TiddlyWiki, allowing for multi-line contents within table cells.
(Note that all TiddlyWiki markup still applies.)
!Usage
Detailed documentation available at [[MediaWiki.org|http://www.mediawiki.org/wiki/Help:Tables]].
!!Examples
{{{
{|
! Heading 1
! Heading 2
! Heading 3
|-
| row 1, column 1
| row 1, column 2
| row 1, column 3
|-
| row 2, column 1
| row 2, column 2
| row 2, column 3
|}
}}}
{|
! Heading 1
! Heading 2
! Heading 3
|-
| row 1, column 1
| row 1, column 2
| row 1, column 3
|-
| row 2, column 1
| row 2, column 2
| row 2, column 3
|}
!Revision History
!!v0.1 (2008-10-31)
* initial release
!!v0.1.2 (2008-11-05)
* removed unnecessary code
!Code
***/
//{{{
if(!version.extensions.MediaWikiTableFormatterPlugin) { //# ensure that the plugin is only installed once
version.extensions.MediaWikiTableFormatterPlugin = {installed:true};

if(version.major < 2 || (version.major == 2 && version.minor < 1)) {
	alertAndThrow('MediaWikiTableFormatterPlugin requires TiddlyWiki 2.1 or later.');
}

config.formatters.push({
	name: 'enhancedTable',
	match: '^\\{\\|',
	handler: function(w) {
		var pair = MediaWikiTemplate.findTableBracePair(w.source,w.matchStart);
		if(pair.start==w.matchStart) {
			w.nextMatch = w.matchStart;
			var table = MediaWikiTemplate.createElement(w.output,'table');
			var tbody = MediaWikiTemplate.createElement(table,'tbody'); // required for IE
			var mwt = new MediaWikiTemplate();
			mwt.wikifyTable(tbody,w,pair);
		}
	}
});


MediaWikiTemplate = function()
{
	this.stack = [];
	this.error = false;
	this.tiddler = null;
};

MediaWikiTemplate.createElement = function(parent,element)
{
	return parent.appendChild(document.createElement(element));
}

MediaWikiTemplate.setAttributesFromParams = function(e,p)
{
	var re = /\s*(.*?)=(?:(?:"(.*?)")|(?:'(.*?)')|((?:\w|%|#)*))/mg;
	var match = re.exec(p);
	while(match) {
		var s = match[1].unDash();
		if(s == 'bgcolor') {
			s = 'backgroundColor';
		}
		try {
			if(match[2]) {
				e.setAttribute(s,match[2]);
			} else if(match[3]) {
				e.setAttribute(s,match[3]);
			} else {
				e.setAttribute(s,match[4]);
			}
		}
		catch(ex) {}
		match = re.exec(p);
	}
};

MediaWikiTemplate.findRawDelimiter = function(delimiter,text,start)
//# find a delimiter that is not enclosed by [[..]]
{
	var d = text.indexOf(delimiter,start);
	if(d==-1)
		return -1;
	var b = {start:-1,end:-1};
	var bs = text.indexOf('[[',start);
	if(bs==-1 || bs >d)
		return d;
	var s1 = -1;
	if(bs!=-1 && bs <d) {
		var be = text.indexOf(']]',bs);
		if(be!=-1) {
			b.start = bs;
			b.end = be;
		}
	}
	if(b.start!=-1 && d>b.start)
		s1 = b.end+2;
	return s1==-1 ? d : MediaWikiTemplate.findRawDelimiter(delimiter,text,s1);
};

MediaWikiTemplate.findTableBracePair = function(text,start)
{
	var ret = {start:-1,end:-1};
	var s = text.indexOf('{|',start);
	if(s==-1)
		return ret;
	var e = text.indexOf('\n|}',s+2);
	if(e==-1)
		return ret;
	e++;
	var s2 = text.indexOf('{|',s+2);
	if(s2==-1 || s2 > e)
		return {start:s,end:e};
	var tp = MediaWikiTemplate.findTableBracePair(text,s+2);
	while(tp.end!=-1 && e>tp.start && e<=tp.end) {
		//# intervening table brace pair, so skip over
		e = tp.end+2;
		tp = MediaWikiTemplate.findTableBracePair(text,e);
		e = text.indexOf('\n|}',e);
		if(e==-1)
			return ret;
		e++;
	}
	return {start:s,end:e};
};

MediaWikiTemplate.prototype.wikifyTable = function(table,w,pair)
{
	function lineEnd(w) {
		var r = w.source.indexOf('\n',w.nextMatch);
		while(r!=-1) {
			var n = w.source.substr(r+1,1);
			if(n=='|' || n=='!' || (n=='{' && w.source.substr(r+2,1)=='|'))
				break;
			r = w.source.indexOf('\n',r+1);
		}
		return r;
	}
	function subWikifyText(e,w,text) {
			var oldSource = w.source; var oldMatch = w.nextMatch;
			w.source = text; w.nextMatch = 0;
			w.subWikifyUnterm(e);
			w.source = oldSource; w.nextMatch = oldMatch;
	}
	//# skip over {|
	w.nextMatch += 2;
	var i = lineEnd(w);
	if(i>w.nextMatch) {
		MediaWikiTemplate.setAttributesFromParams(table.parentNode,w.source.substring(w.nextMatch,i));
		w.nextMatch = i;
	}
	w.nextMatch++;
	if(w.source.substr(w.nextMatch,2)=='|+') {
		var caption = MediaWikiTemplate.createElement(table,'caption');
		w.nextMatch += 2;
		i = lineEnd(w);
		var d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);
		if(d!=-1 && d<i) {
			MediaWikiTemplate.setAttributesFromParams(caption,w.source.substring(w.nextMatch,d));
			w.nextMatch = d+1;
		}
		w.subWikifyTerm(caption,/(\n)/mg);
	}
	var tr = MediaWikiTemplate.createElement(table,'tr');
	if(w.source.substr(w.nextMatch,2)=='|-') {
		w.nextMatch += 2;
		i = lineEnd(w);
		if(i>w.nextMatch) {
			MediaWikiTemplate.setAttributesFromParams(tr,w.source.substring(w.nextMatch,i));
			w.nextMatch = i;
		}
		w.nextMatch++;
	}
	var x = w.source.substr(w.nextMatch,2);
	while(x!='|}') {
		if(x=='{|') {
			//# nested table
			var pair2 = MediaWikiTemplate.findTableBracePair(w.source,w.nextMatch);
			if(pair2.start==w.nextMatch) {
				var table2 = MediaWikiTemplate.createElement(cell,'table');
				this.wikifyTable(table2,w,pair2);
			}
		} else if(x=='|-') {
			//# new row
			tr = MediaWikiTemplate.createElement(table,'tr');
			w.nextMatch += 2;
			i = lineEnd(w);
			if(i==-1)
				break;
			if(i>w.nextMatch) {
				MediaWikiTemplate.setAttributesFromParams(tr,w.source.substring(w.nextMatch,i));
				w.nextMatch = i;
			}
			w.nextMatch++;
		} else if(x.substr(0,1)=='!') {
			//# header cell
			w.nextMatch++;
			i = lineEnd(w);
			if(i==-1)
				break;
			var cell = MediaWikiTemplate.createElement(tr,'th');
			var c = w.source.indexOf('!!',w.nextMatch);
			while(c!=-1 && c<i) {
				d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);
				if(d!=-1 && d<c) {
					MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));
					w.nextMatch = d+1;
				}
				while(w.source.substr(w.nextMatch,1)==' ') {
					w.nextMatch++;
				}
				w.subWikifyTerm(cell,/(\!\!)/mg);
				cell = MediaWikiTemplate.createElement(tr,'th');
				c = w.source.indexOf('!!',w.nextMatch);
			}
			d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);
			if(d!=-1 && d<i) {
				MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));
				w.nextMatch = d+1;
			}
			while(w.source.substr(w.nextMatch,1)==' ') {
				w.nextMatch++;
			}
			subWikifyText(cell,w,w.source.substring(w.nextMatch,i));
			w.nextMatch = i+1;
		} else if(x.substr(0,1)=='|') {
			//# cell
			w.nextMatch++;
			i = lineEnd(w);
			if(i==-1)
				break;
			cell = MediaWikiTemplate.createElement(tr,'td');
			c = w.source.indexOf('||',w.nextMatch);
			while(c!=-1 && c<i) {
				d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);
				if(d!=-1 && d<c) {
					MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));
					w.nextMatch = d+1;
				}
				while(w.source.substr(w.nextMatch,1)==' ') {
					w.nextMatch++;
				}
				w.subWikifyTerm(cell,/(\|\|)/mg);
				cell = MediaWikiTemplate.createElement(tr,'td');
				c = w.source.indexOf('||',w.nextMatch);
			}
			d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);
			if(d!=-1 && d<i) {
				MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));
				w.nextMatch = d+1;
			}
			while(w.source.substr(w.nextMatch,1)==' ') {
				w.nextMatch++;
			}
			subWikifyText(cell,w,w.source.substring(w.nextMatch,i));
			w.nextMatch = i+1;
		}
		x = w.source.substr(w.nextMatch,2);
	}
	w.nextMatch = pair.end + 3;
	return;
};

} //# end of 'install only once'
//}}}
As part of my plan for an [[Entertainment Unit]], I envisage a need to store CDs and DVDs.

This is a design idea to satisfy such a need.

Using slides such as [[these at Argent|http://www.argent.com.au/Slides/Slide5040.html]], a shelf would be constructed, with shallow depressions so as to hold in place rows of CDs. 

Here is a Gimp sketch of a top-view of the design:
http://www.cheeky.house.cx/~nemo/albums/incoming/cdrackgimpsketch2a.png

And very roughly, here is an isometricish view of the top board in ascii:

{{{
          43 cm across
 +---------------------------------+                 .
 |\   ________  ________  ________  \                .
 \ \  \______|\ \______|\ \______|\  \               .
  \ \  \     \ \ \     \ \ \     \ \  \              .
   \ \  \     \ \ \     \ \ \     \ \  \             .
    \ \  \     \ \ \     \ \ \     \ \  \   58 cm deep
     \ \  \     \ \ \     \ \ \     \ \  \           .
      \ \  \     \ \ \     \ \ \     \ \  \          .
       \ \  \_______\ \_______\ \_______\  \         .
        \ \   ____________________________  \        . 
         \ \  \__________________________|\  \       .
          \ \  \                         \ \  \      .
           \ \__\                         \ \__\     .
            \|__|                          \|__|     .
                           41cm CD slot
}}}

Crunch Comments:
A possible way of doing the shelf would be to get (50mm wide * 20mm thick * required length) lengths of pine / prefered timber and join them forming the pattern described above. 
A way of making it look cleaner would be to make the Depth of the trays to be that of the depth of a CD.  
Increasing the depth of the shelf would remove the need to have the bolts on the end of the trays to support the CDs,  AND would improve containment of the shelf if anything "unfortunate" were to happen to the tray.

Another idea is that the CDs be stacked as expected on a shelf, with multiple such "shelves" deep. Each one slides to the side on rails to expose the one behind, before all compacting back into the rack
Portals to rooms..., but also [[security]]

* A musical door based on an African tongue drum:
** http://cubeme.com/blog/2009/04/02/melody-door-by-dominic-muren/
** http://www.designboom.com/contest/view.php?contest_pk=7&item_pk=4044&p=1

Some other doors from the same competition "[[a door to paradise|http://www.designboom.com/contest/winner.php?contest_pk=7]]" are interesting: 
* Luna: http://www.designboom.com/contest/view.php?contest_pk=7&item_pk=4107&p=1 - though it does have an unfortunate resemblance to a pet carry box with air holes... 
* Bubble door: http://www.designboom.com/contest/view.php?contest_pk=7&item_pk=3331&p=1
* door.mate: http://www.designboom.com/contest/view.php?contest_pk=7&item_pk=3441&p=1


This door has LEDs in the handle: http://hackaday.com/2011/08/10/color-changing-door-handles/ 
...that could be very neat for a subtle nightlight!
!!What would I use to make it?
Some notes...

* Timber frame? (eco friendly is based from local managed forests of native wood - do we have any of those?) See GrandDesigns. 
** Stumps on timber?
** Settlement - http://en.wikipedia.org/wiki/Settlement_%28structural%29
** Fire risk? (Oak meets modern UK building standards for fires)
** As oak frame dries, shrinks and is as strong as tensioned steel
** Wooden pegged - advantages?
** ...how does all this compare to various Eucalypt options in .au?
* Pyrex [[fireplace]]
* window glass
** Pilkington Grey - a glass used in a Grand Designs episode for passive solar (they wanted to keep heat IN), and flexible for use in a timber frame house. 
* Shipping Containers as frame? Stacked to become [[Library]]?
** 2.4metres wide, from 2.4 to 2.9metres height and from 2.5 to 17m long. http://en.wikipedia.org/wiki/Intermodal_container
*** European containers 2inches wider. Australian RACE containers also slightly wider
* Latex concrete for [[roof]]?
Combining a base for TV, shelves/drawers for media and game devices and content, and speakers. 

The key element is: 
''Rack rails to hold in equipment (or just shelves)''

!! Premise
* People make variable-sized cabinets to hold their entertainment system.
* People make standard-cabinets to hold their computer equipment (aka: Racks)
* Computer equipment is becoming more an entertainment system every day.

!! Solution?
* Use computer rack standards as the basis for entertainment system cabinet.

!! Basic Layout
* Cabinet with a '''square footprint''' with rails spaced as a [[Wikipedia:19-inch_rack|19 inch rack]] along '''all faces'''. 
** ie, cabinets are not designed with an explicit 'front'
** Advantage of square footprint is that rack-mount shelves can be mounted to face '''outwards''' from the sides (for use as speaker stands or random cabinet trinkets shelving, etc)
* Two cabinets roughly 2metres high (42 RU?) for speakers and storage. 
* Two cabinets roughly 60cm high (12RU?) to make a base for TV. This should be suitable height and proportion for a LARGE modern flatscreen TV. 
* For remote control access through doors, an IR-retransmitter may be required. Alternatively, bluetooth remotes

!! Style
On the industrial side of tastes (see [[design]])
* metal and wood. Metal with welds and rivets, but not much (any) victorian frill. Heat scoring on the bare metal is a plus 
* Doors as aged-wooden doors of a similar style/
ie, this should look like a vintage welded iron+wood table, which has decided to be a rack for a while. 

* Side doors should be simple wooden doors of similar style. 
** Note that conjoined racks do not need door panels, neither are panels needed for the rear

!! Additional notes
* [[CD Rackshelf]] a design for rack-mounted CD storage?
Some things may need to be custom designed?
* http://en.wikipedia.org/wiki/19-inch_rack

!!!links
* http://www.racktechnologies.com.au/default2.asp?id=1,43,108,180 - rails...
* these, for eg, are 600mm depth. can also be 450mm depth...?
** http://www.altronics.com.au/index.asp?area=item&id=H5412A - 12RU frame
** http://www.altronics.com.au/index.asp?area=item&id=H5438A - 38RU frame

* this UK mob do custom: http://www.studioracks.co.uk/custom.html as per: http://www.avforums.com/forums/av-stands-cabinets-seating-furniture/914359-my-custom-built-19-av-rack.html

<<sectionTOC>>
<<timeline "modified" "60">>
/***
|Name|ImageSizePlugin|
|Source|http://www.TiddlyTools.com/#ImageSizePlugin|
|Version|1.2.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|adds support for resizing images|
This plugin adds optional syntax to scale an image to a specified width and height and/or interactively resize the image with the mouse.
!!!!!Usage
<<<
The extended image syntax is:
{{{
[img(w+,h+)[...][...]]
}}}
where ''(w,h)'' indicates the desired width and height (in CSS units, e.g., px, em, cm, in, or %). Use ''auto'' (or a blank value) for either dimension to scale that dimension proportionally (i.e., maintain the aspect ratio). You can also calculate a CSS value 'on-the-fly' by using a //javascript expression// enclosed between """{{""" and """}}""". Appending a plus sign (+) to a dimension enables interactive resizing in that dimension (by dragging the mouse inside the image). Use ~SHIFT-click to show the full-sized (un-scaled) image. Use ~CTRL-click to restore the starting size (either scaled or full-sized).
<<<
!!!!!Examples
<<<
{{{
[img(100px+,75px+)[images/meow2.jpg]]
}}}
[img(100px+,75px+)[images/meow2.jpg]]
{{{
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img(  1%+,+)[images/meow.gif]]
}}}
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img(  1%+,+)[images/meow.gif]]
{{tagClear{
}}}
<<<
!!!!!Revisions
<<<
2009.02.24 [1.2.1] cleanup width/height regexp, use '+' suffix for resizing
2009.02.22 [1.2.0] added stretchable images
2008.01.19 [1.1.0] added evaluated width/height values
2008.01.18 [1.0.1] regexp for "(width,height)" now passes all CSS values to browser for validation
2008.01.17 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageSizePlugin= {major: 1, minor: 2, revision: 1, date: new Date(2009,2,24)};
//}}}
//{{{
var f=config.formatters[config.formatters.findByField("name","image")];
f.match="\\[[<>]?[Ii][Mm][Gg](?:\\([^,]*,[^\\)]*\\))?\\[";
f.lookaheadRegExp=/\[([<]?)(>?)[Ii][Mm][Gg](?:\(([^,]*),([^\)]*)\))?\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg;
f.handler=function(w) {
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var floatLeft=lookaheadMatch[1];
		var floatRight=lookaheadMatch[2];
		var width=lookaheadMatch[3];
		var height=lookaheadMatch[4];
		var tooltip=lookaheadMatch[5];
		var src=lookaheadMatch[6];
		var link=lookaheadMatch[7];

		// Simple bracketted link
		var e = w.output;
		if(link) { // LINKED IMAGE
			if (config.formatterHelpers.isExternalLink(link)) {
				if (config.macros.attach && config.macros.attach.isAttachment(link)) {
					// see [[AttachFilePluginFormatters]]
					e = createExternalLink(w.output,link);
					e.href=config.macros.attach.getAttachment(link);
					e.title = config.macros.attach.linkTooltip + link;
				} else
					e = createExternalLink(w.output,link);
			} else 
				e = createTiddlyLink(w.output,link,false,null,w.isStatic);
			addClass(e,"imageLink");
		}

		var img = createTiddlyElement(e,"img");
		if(floatLeft) img.align="left"; else if(floatRight) img.align="right";
		if(width||height) {
			var x=width.trim(); var y=height.trim();
			var stretchW=(x.substr(x.length-1,1)=='+'); if (stretchW) x=x.substr(0,x.length-1);
			var stretchH=(y.substr(y.length-1,1)=='+'); if (stretchH) y=y.substr(0,y.length-1);
			if (x.substr(0,2)=="{{")
				{ try{x=eval(x.substr(2,x.length-4))} catch(e){displayMessage(e.description||e.toString())} }
			if (y.substr(0,2)=="{{")
				{ try{y=eval(y.substr(2,y.length-4))} catch(e){displayMessage(e.description||e.toString())} }
			img.style.width=x.trim(); img.style.height=y.trim();
			config.formatterHelpers.addStretchHandlers(img,stretchW,stretchH);
		}
		if(tooltip) img.title = tooltip;

		// GET IMAGE SOURCE
		if (config.macros.attach && config.macros.attach.isAttachment(src))
			src=config.macros.attach.getAttachment(src); // see [[AttachFilePluginFormatters]]
		else if (config.formatterHelpers.resolvePath) { // see [[ImagePathPlugin]]
			if (config.browser.isIE || config.browser.isSafari) {
				img.onerror=(function(){
					this.src=config.formatterHelpers.resolvePath(this.src,false);
					return false;
				});
			} else
				src=config.formatterHelpers.resolvePath(src,true);
		}
		img.src=src;
		w.nextMatch = this.lookaheadRegExp.lastIndex;
	}
}

config.formatterHelpers.addStretchHandlers=function(e,stretchW,stretchH) {
	e.title=((stretchW||stretchH)?'DRAG=stretch/shrink, ':'')
		+'SHIFT-CLICK=show full size, CTRL-CLICK=restore initial size';
	e.statusMsg='width=%0, height=%1';
	e.style.cursor='move';
	e.originalW=e.style.width;
	e.originalH=e.style.height;
	e.minW=Math.max(e.offsetWidth/20,10);
	e.minH=Math.max(e.offsetHeight/20,10);
	e.stretchW=stretchW;
	e.stretchH=stretchH;
	e.onmousedown=function(ev) { var ev=ev||window.event;
		this.sizing=true;
		this.startX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
		this.startY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
		this.startW=this.offsetWidth;
		this.startH=this.offsetHeight;
		return false;
	};
	e.onmousemove=function(ev) { var ev=ev||window.event;
		if (this.sizing) {
			var s=this.style;
			var currX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
			var currY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
			var newW=(currX-this.offsetLeft)/(this.startX-this.offsetLeft)*this.startW;
			var newH=(currY-this.offsetTop )/(this.startY-this.offsetTop )*this.startH;
			if (this.stretchW) s.width =Math.floor(Math.max(newW,this.minW))+'px';
			if (this.stretchH) s.height=Math.floor(Math.max(newH,this.minH))+'px';
			clearMessage(); displayMessage(this.statusMsg.format([s.width,s.height]));
		}
		return false;
	};
	e.onmouseup=function(ev) { var ev=ev||window.event;
		if (ev.shiftKey) { this.style.width=this.style.height=''; }
		if (ev.ctrlKey)  { this.style.width=this.originalW; this.style.height=this.originalH; }
		this.sizing=false;
		clearMessage();
		return false;
	};
	e.onmouseout=function(ev) { var ev=ev||window.event;
		this.sizing=false;
		clearMessage();
		return false;
	};
}
//}}}
!! Stained Glass and leadlighting
with gold painted glass, these can purify the air! ([http://esciencenews.com/articles/2008/08/21/air.purifying.church.windows.early.nanotechnology])
* MC Escher designs?
** Especially regular division of the plane, or limits... 
*** Angels and Devils would suit perfectly, being traditional stained glass subject matter too... 
[img(45%,)[http://www.mcescher.com/Gallery/recogn-bmp/LW436.jpg]]
(though it would also suit as a dome illustration!)

!! Star Wars windows
ie, portals with that distinctive spiderwebbing 
[img(45%,)[http://nerdreactor.com/wp-content/uploads/2010/07/Star-Wars-Emperors-Throne.jpg]][img(30%,)[http://i739.photobucket.com/albums/xx39/William_Mayers_III/Star%20Wars%20Textures/DSwin001.jpg]]


!! other ideas
* Double-glazed stained glass - if designed right on both faces, the parallax could possibly allow for interesting 3d effects (or at the minimum, [[wikipedia:Moire|moire]] effects)
* The "focus" door would be better as a window? http://www.designboom.com/contest/view.php?contest_pk=7&item_pk=1820&p=1
<<timeline>>
<<tabs chkTimeline "Recent" "Recent history only" TabTimelineLimited60 "All" "All of history" TabTimelineAll>>
An under-house water tank - pretty common now. Grey water for yard and - toilets? Pool? Whatever runoff water is considered acceptable for using it for. 

Also, might be usable as a temperature regulator (ie, appropriate heat exchange between the tank and underfloor/in-wall piping?
I'd like to have a pool outside the house, though perhaps, if close, then semi-under as well? 

I pretty stock rectangular pool, with a decent deep end that one can dive into (approx 2metres)
The tag for things that are outside the house. This includes external skin of the house, and interfaces between inside and outside (doors and windows)
I do have a love of these things, and I still wonder if they might have a use in the house. 

Pneumatic, magnetic, or other?

* How big?
* From where/to where?

http://www.capsu.org/capsule/
The humble letterbox... 

How should it be designed?

!! Why redesign? 
Many letterboxes are still designed from a mid 20th century perspective, when postcards and smaller enveloped were common. In the early 21st century, most mail is now bills or similar. Usually in a tri-folded A4 or similar size. Also common are magazines and so on - usually A4 size. Older letterboxes cannot handle some or all of these. 
!! New design
* floor area sufficient to lay a [[C4 envelope|http://www.wikipedia.org/wiki/Envelope_size]] (or ~MacBook Air, which is the same size to within 2mm) flat
* 'mouth' sufficient width to eat said C4 envelope. Approx 3cm high. 
* entire box should be approx 10cm high to prevent regurgitation theft
* top and sides of mouth should have overhang (lips!) to protect from weather. 
!! Security 
* Box should be lockable, and internal mail not be reachable through the mouth or other openings. 
* Box should be securely bolted down to prevent theft of entire box
!! Placement 
* Between approx 100 and 150cm from ground level (keyed from height of mouth), and no further than 50cm back from the path (ie, postie reach)
[[SlumberWiki]]
[[Slumberland]]
[[Login]]
Different rooms will require different floorings. 

!!!Some notes...
* [[Kitchen]]: needs to be moppable. I'm thinking tiles or polished wood
* [[Great Hall]] and [[Lounge]] - Polished wood - though I'd likely put rugs down, esp in the Lounge
* Bedrooms - carpet?
* [[Games Room]] - carpet?
* [[Library]] - Carpet!
* [[Carspace]] - concrete?
* [[Laundry]] - tiles
* [[Workshop]] - concrete/tiles
!!!Other considerations?
Underfloor heating. This should be available in all rooms, imho. Possibly linked to a heat pump connected to the outsides  (See GrandDesigns) or to the [[fireplace]]
!!! Links 
* http://www.bambooandtimber.com.au/
* http://www.crikeybamboo.com.au/more-info
> BTW, this particular company users formaldahde free adhesives and lacquers so thats where the attraction is. not wish to poison self when installing own flooring
An outdoors garden in which you can cook. 

A mix of tiled cooking area (with some shade cover) and lawn

Tiles can be repurposed to lawn Scrabble™, Go, Chess, Snakes and Ladders, etc, with judicious use of rocks (some would need special preparation) and chalk :) 

What makes a garden a ''Cooking'' garden?

!! Preparation Bench
Storage bays below, including thermoelectric esky.
Marble topped? 
!! Saj
Provides the BBQ - gas powered...
Designed with a concave section (I am all with the [[saddle curves|roof]]!) so as to handle sausages that may roll, and eggs... 
* http://en.wikipedia.org/wiki/Saj_%28utensil%29
* http://www.google.com/search?q=saj+food&um=1&ie=UTF-8&tbm=isch&source=og&sa=N&hl=en&tab=wi&biw=1330&bih=782
!! Wood fired oven (aka: Cob oven, or Masonry Oven)
* http://en.wikipedia.org/wiki/Masonry_oven
!! Hāngi
http://en.wikipedia.org/wiki/H%C4%81ngi
Can be used as either the hāngi pit oven, or just a fire for marshmallows
(and a spit?!)
!! Tables and bench
All mobile
Table with a wine-bucket style ice bin within it
benches for sitting... park bench style? Maybe in the 'haus' (at SLQ) style?

!! Tiled area
Pavers with gaps (2-5cm?) within which can be grown creeping herbs (thyme?). The intent here is not to pick them, but to allow them to scent the air as one walks over them

Or How about a circular social fire pit area?
http://www.instructables.com/id/How-to-make-a-Stone-Patio-Fire-Pit/


!! Other
Should something like this be nearby/outside?
http://cubeme.com/blog/2011/10/03/m-velope-shelter-by-michael-jantzen/

A cast-iron bed frame makes a great skeleton to construct a BBQ inside. (as seen at 2013 Spiegeltent)

I thought dimple locks were cool, but turns out they're easily lockpickable apparently. Abloy looks interesting and are rated as high security. Also, you can have keys that are 'lock only' and 'unlock only'.

Magnetic keys perhaps?

I'd rather not go for fully computerised car-style remote key systems however

http://vision.ucsd.edu/~blaxton/sneakey.html
http://en.wikipedia.org/wiki/Key_%28lock%29

A small amphitheatre in the garden would be neat. Not huge, and based more or less on natural curves of the land... part garden feature, part picnic hill, part performance space... the mini amph in Canberra as a model perhaps? 

Approx 10 metres diameter total?
!! Series 1 (1999)
# Clifftop kit house 
** ex-railway sleepers for decking
# The new "old english barn" - custom designed oak frame building. 
** Sustainability of wood from local ''managed'' forests of native wood - about as eco friendly as you can get?
** 40 oaks for their rather large barn/house. All pieces cut before first and final assembly on-site
** Glass suitable for oak settlement
** under-floor heat pump - using heat from ground (a solar energy method in fact). Keeps floors to about 26°C
** aquarium built into wall - creates lovely shadows of fish! :)
# The co-op
** A build-it-yourself flexible design based on the work of Walter Segal.
*** http://en.wikipedia.org/wiki/Walter_Segal
** Designed to simply rest on foundation blocks - not bolted down. Not good for wind storms!
** "Green" paint that uses latex as the binding agent. Very smooth apparently!
** Shower room
** Kitchen drawers that are (frosted) glass fronted
# The Water Tower
** Fast-track style construction based on a big-project style build. Pre-fab concrete beam and block floor. Site manager. 
** Polystyrene mould for walls = 2 days to build vs 10 for brickwork, and has 2x insulation layer
** Gabion (http://en.wikipedia.org/wiki/Gabion) retaining wall for grass mound, with "tarram"(?) layer to stop topsoil falling through, and then soil erosion matting on top to create grass layer
** Three human cornerstones to a "grand design"
### focused architect
### focused client
### focused project/site manager
# The ~Eco-House
** Swedish are world leaders in eco-friendly houses. Specifically in regards to insulation and keeping out the cold, however. 
** Concrete is extremely polluting as a building material (to manufacture). By comparison, wood = excellent
** Swedish wood - dense, plus novel construction = light and very very strong!
** low flush self-composting toilets - with rocks and reed bed filtration system
# The Chapel
** Renovation rebuild is HARD. Inevitably things that weren't accounted for. 
** Communication and trust between Architect, clients, and on-site builders
** Have a contingency fund for the unexpected
** Interesting asymmetrical windows :)
** Review architects previous work... and speak to the clients of those works!
** Project Manager = Interface between:
*** Architect "that's what I want it to look like"
*** Client "that's what I can afford to build"
*** Builder "that's what physically can be done"
# The House of Straw
** Gabion surrounds of the stumps of the house. 
** Don't make it up as you go along. Have solid targets, not shifting ones that require making-it-up on-site
** Straw = cosy and noise absorbant. A very viable material
** Experimentation on a small, not large scale
** Sandbag walls and steel spring base = good insulation from nearby train noise
** A home reflects the passions, interests and foibles of it's owners (and designers). Not normal = good :)
# The ~Glass-House
** Planning consultant to assist with convincing local council to accept an unusual design
** A house with unusual angles (not square) = headache
** Glass that can be almost structural - sans even frames - sits flush with the next pane
How should the house be powered? 

I've gotto admit I have a vague fondness for European style plugs!

Realistically, local plugs makes most sense for AC. There should be sufficient plugs (whatever that means) for each room. 

Also, DC power is increasingly useful to have around too, and USB seems to have become the emerging standard that you can have wired into standard power points. This could be useful, for example, in powering the [[lighting]] internal to wardrobes, for eg. 


Well-lit and well indicated breaker box. Where 'well lit and indicated' includes 'can navigate in the dark'. ie, UPS or solar+battery powered light to illuminate switches, and/or glow in the dark indicators. 
These come in several sizes, but I am aiming for a US "tournament" table size of 9 foot ...though obviously 8.5' or 8' would be fine :)

<<<
{{{
            Room Size               Table Size
            16' 8" x 13' 3"         3.5' x 7'  (bar size)
            17' 4" x 13' 8"         4' x 8'  (home size)
            17' 9" x 13' 10"        4.25' x 8.5'  (commercial size)
            18' 4" x 14' 2"         4.5' x 9'  (tournament size)
}}}
-- http://www.billiardpro.com/table_size.html
<<<

Other sites suggest another 6" per dimension for tables, making a 9' table require 18'10" and 14'8"

* http://www.kwlonline.com/room-size-pool-table.htm
* http://www.alcocks.com.au/roomsi.html

6m x 4.5m (19'8" x 14'9")  seems a pretty decent target then! (and a nice set of round numbers, to boot! :)
There is a "the golden ratio is the most beautiful, and used in architecture" meme. 

I think it's bollocks. 

I also think it's a much uglier rectangle than the Lichtenberg ratio used for iso216 paper sizes. 

As such, I'd much rather make nods towards the silver, than the gold. 


(golden ratio is approx 1:1.6, Lichtenberg ratio is approx 1:1.4)
!! Grand Designs Indoors (2001)
# The Former Electricity ~Sub-Station
** Moroccan/North African inspired decore and renovations.
*** Islamic patterns
*** Day beds - storage space under
** Comissioned spiral staircase from local artist
** Custom glass block windows and door as well. All very nice
** Strong Moroccan colours (red/orange/yellow ochres) that look vibrant/good in strong bright sunlight
** Tiled "Sunken Bath" in the [[Bathroom]]
# The Barbican Flat
** A hybrid of 60s "pop" and Zen minimalism. 
** "Wet" bathroom - the whole room is the shower
** low voltage, low-glare spotlights with dimmers
# The Dilapidated Georgian House
** Fixing up a 200 yr old home as cheap as possible
** museum staircase (21:30 in) is great with windows along base
** gorgeous doorknobs
** mix of Georgian, edwardian, through to 50s and modern - and it works!
** greek-inspired roundels
# The ~Half-Timbered Cottage
** Exposed copper piping can look really cool!
** A gorgeous open fireplace that is ultra simplistic as an opened cone
# The Shaker Style Summer House and Thames Houseboat
** Shaker home wares - designed with simplicity, but also both inner and outer "perfection"
** Deeply inset windows give a feeling of luxury (ie, "thick walls")
** Peg rails - a shaker design thing to let ANYTHING be hung up and out of the way (to sweep the floors!)
# The Regency Home
** Vaulted ceilings look cool
** LED inside the door lock as a key guide. Change colour depending on lock status!
** Bed lighting with colour wheel
** glass bricks as steps with lighting underneath
** suspended ceiling with hidden lights, in the bedroom
test