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

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

.tiddlerPopupButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::PrimaryPale]]; border: 1px solid [[ColorPalette::PrimaryLight]];}
.tiddlerPopupButton:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
.tiddlerPopupButton:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]];}
.tiddlerPopupButton.highlight {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.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]];}

.viewDetails {border-left:2px solid [[ColorPalette::TertiaryPale]];}
.viewDetails table {border:none;}
.viewDetails th, .viewDetails thead td {background:[[ColorPalette::TertiaryLight]]; color:[[ColorPalette::Background]]; border:1px solid [[ColorPalette::Background]];}
.viewDetails td, .viewDetails tr {background-color:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::Background]];}

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

table {border:2px solid [[ColorPalette::TertiaryDark]];}
th, thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
td, 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)';}
.backstageDecal a {border:none; background:[[ColorPalette::TertiaryMid]]; color:[[ColorPalette::Background]];}
.backstageDecal a:hover {border:none; background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]];}
.backstageDecal a:active {border:none; background:[[ColorPalette::TertiaryLight]]; color:[[ColorPalette::Foreground]];}
/*}}}*/
/*{{{*/
* 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;}
.externalLink:after {content:" ⇢";}

.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:absolute; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:200;}
*[id='messageArea'] {position:fixed !important; z-index:200;}
.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;}
.tiddlerPopupButton:after {content:" ↓";}
.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;}

.viewDetails {padding:0.5em 0em 0.5em 0em;}
.viewDetails {font-size:0.9em;}
.detailsMessage {margin:0.8em 1.0em;}

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

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

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

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

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

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

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

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:50; position:absolute; width:100%; height:100px;}
.backstageDecal {display:none; font-size:9pt; margin:0.4em 0.4em 0.4em 0.4em;}
.backstageDecal a {display:inline !important; padding:0.2em 0.4em 0.2em 0.4em !important;}
.backstageVisible .backstageDecal {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 use a logographic writing system and 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;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar {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='storyDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>) <span macro='viewDetails'></span></div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser

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

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

----
Also see AdvancedOptions
<<option chkGenerateAnRssFeed>> GenerateAnRssFeed
<<option chkOpenInNewWindow>> OpenLinksInNewWindow
<<option chkSaveEmptyTemplate>> SaveEmptyTemplate
<<option chkToggleLinks>> Clicking on links to tiddlers that are already open causes them to close
^^(override with Control or other modifier key)^^
<<option chkHttpReadOnly>> HideEditingFeatures when viewed over HTTP
<<option chkForceMinorUpdate>> Treat edits as MinorChanges by preserving date and time
^^(override with Shift key when clicking 'done' or by pressing Ctrl-Shift-Enter^^
<<option chkConfirmDelete>> ConfirmBeforeDeleting
Maximum number of lines in a tiddler edit box: <<option txtMaxEditRows>>
Folder name for backup files: <<option txtBackupFolder>>
<<option chkInsertTabs>> Use tab key to insert tab characters instead of jumping to next field
<<option txtFileSystemCharSet>> Character set to use for saving (Firefox/Mozilla only)
<<option chkGenerateAnRssFeed>> 產生 RssFeed
<<option chkOpenInNewWindow>> 連結開啟於新視窗
<<option chkSaveEmptyTemplate>> 儲存範本
<<option chkToggleLinks>> 點擊文章使已開啟者關閉
<<option chkHttpReadOnly>> 隱藏編輯功能 ({{{http:}}})
<<option chkForceMinorUpdate>> 修改文章不變更日期時間
^^(確認修改同時按 Shift 鍵,或只按 Ctrl-Shift-Enter)^^
<<option chkConfirmDelete>> 刪除文章前確認
編輯模式中顯示列數: <<option txtMaxEditRows>>
存放備份檔案的資料夾: <<option txtBackupFolder>>
<<option chkInsertTabs>> 使用 tab 鍵插入定位字元,而非跳至下一個欄位
檔案系統編碼:<<option txtFileSystemCharSet>>
<<<
^^使用Gecko based的瀏覽器(如:Firefox)時,
指定正確系統環境編碼(BIG5、GBK、SHIFT-JIS、EUC-KR....等),
可支援儲存文件於非 ASCII 路徑及檔名。^^
<<<
/***
''Name:'' Calendar plugin
''Version:'' 0.5
''Author:'' SteveRumsby

''Syntax:'' 
{{{<<calendar>>}}} or {{{<<calendar year>>}}} or {{{<<calendar year month>>}}} or {{{<<calendar thismonth>>}}}

''Description:'' 
The first form produces an full-year calendar for the current year. The second produces a full-year calendar for the given year. The third produces a single month calendar for the given month and year. The fourth form produces a single month calendar for the current month.
Weekends and holidays are highlighted (see below for how to specify holdays).

''Configuration:''
Modify this section to change the text displayed for the month and day names, to a different language for example. You can also change the format of the tiddler names linked to from each date, and the colours used.

''Changes by ELS 2005.10.30:''
config.macros.calendar.handler()
^^use "tbody" element for IE compatibility^^
^^IE returns 2005 for current year, FF returns 105... fix year adjustment accordingly^^
createCalendarDays()
^^use showDate() function (if defined) to render autostyled date with linked popup^^
calendar stylesheet definition
^^use .calendar class-specific selectors, add text centering and margin settings^^
***/
//{{{
config.macros.calendar = {};

config.macros.calendar.monthnames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
config.macros.calendar.daynames = ["M", "T", "W", "T", "F", "S", "S"];
config.macros.calendar.firstday = 6; 
config.macros.calendar.firstweekend = 5;

config.macros.calendar.weekendbg = "#eeeebb";
config.macros.calendar.monthbg = "#770000";
config.macros.calendar.holidaybg = "#ffc0c0";
//}}}
/***
!Code section:
***/
// (you should not need to alter anything below here)//
//{{{
config.macros.calendar.tiddlerformat = "0DD/0MM/YYYY"; // This used to be changeable - for now, it isn't// <<smiley :-(>> 

version.extensions.calendar = { major: 0, minor: 5, revision: 0, date: new Date(2006, 0, 11)};
config.macros.calendar.monthdays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

config.macros.calendar.holidays = [ ]; // Not sure this is required anymore - use reminders instead
//}}}

// //Is the given date a holiday?
//{{{
function calendarIsHoliday(date)
{
 var longHoliday = date.formatString("0DD/0MM/YYYY");
 var shortHoliday = date.formatString("0DD/0MM");

 for(var i = 0; i < config.macros.calendar.holidays.length; i++) {
 if(config.macros.calendar.holidays[i] == longHoliday || config.macros.calendar.holidays[i] == shortHoliday) {
 return true;
 }
 }
 return false;
}
//}}}

// //The main entry point - the macro handler.
// //Decide what sort of calendar we are creating (month or year, and which month or year)
// // Create the main calendar container and pass that to sub-ordinate functions to create the structure.
// ELS 2005.10.30: added creation and use of "tbody" for IE compatibility and fixup for year >1900//
// ELS 2005.10.30: fix year calculation for IE's getYear() function (which returns '2005' instead of '105')//
//{{{
config.macros.calendar.handler = function(place,macroName,params)
{
 var calendar = createTiddlyElement(place, "table", null, "calendar", null);
 var tbody = createTiddlyElement(calendar, "tbody", null, null, null);
 var today = new Date();
 var year = today.getYear();
 if (year<1900) year+=1900;
 if (params[0] == "thismonth")
 createCalendarOneMonth(tbody, year, today.getMonth());
 else if (params[0] == "lastmonth") {
 var month = today.getMonth()-1; if (month==-1) { month=11; year--; }
 createCalendarOneMonth(tbody, year, month);
 }
 else if (params[0] == "nextmonth") {
 var month = today.getMonth()+1; if (month>11) { month=0; year++; }
 createCalendarOneMonth(tbody, year, month);
 }
 else {
 if (params[0]) year = params[0];
 if(params[1])
 createCalendarOneMonth(tbody, year, params[1]-1);
 else
 createCalendarYear(tbody, year);
 }
}
//}}}

//{{{
function createCalendarOneMonth(calendar, year, mon)
{
 var row = createTiddlyElement(calendar, "tr", null, "calenderMonthTitle", null);
 createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon] + " " + year, true, year, mon);
 row = createTiddlyElement(calendar, "tr", null, "calendarDaysOfWeek", null);
 createCalendarDayHeader(row, 1);
 createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}

//{{{
function createCalendarMonth(calendar, year, mon)
{
 var row = createTiddlyElement(calendar, "tr", null, null, null);
 createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon] + " " + year, false, year, mon);
 row = createTiddlyElement(calendar, "tr", null, null, null);
 createCalendarDayHeader(row, 1);
 createCalendarDayRowsSingle(calendar, year, mon);
}
//}}}

//{{{
function createCalendarYear(calendar, year)
{
 var row;
 row = createTiddlyElement(calendar, "tr", null, null, null);
 var back = createTiddlyElement(row, "td", null, null, null);
 var backHandler = function() {
 removeChildren(calendar);
 createCalendarYear(calendar, year-1);
 };
 createTiddlyButton(back, "<", "Back", backHandler);
 back.align = "center";

 var yearHeader = createTiddlyElement(row, "td", null, "calendarYear", year);
 yearHeader.align = "center";
 yearHeader.setAttribute("colSpan", 19);

 var fwd = createTiddlyElement(row, "td", null, null, null);
 var fwdHandler = function() {
 removeChildren(calendar);
 createCalendarYear(calendar, year+1);
 };
 createTiddlyButton(fwd, ">", "Fwd", fwdHandler);
 fwd.align = "center";

 createCalendarMonthRow(calendar, year, 0);
 createCalendarMonthRow(calendar, year, 3);
 createCalendarMonthRow(calendar, year, 6);
 createCalendarMonthRow(calendar, year, 9);
}
//}}}

//{{{
function createCalendarMonthRow(cal, year, mon)
{
 var row = createTiddlyElement(cal, "tr", null, null, null);
 createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon], false, year, mon);
 createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+1], false, year, mon);
 createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+2], false, year, mon);
 row = createTiddlyElement(cal, "tr", null, null, null);
 createCalendarDayHeader(row, 3);
 createCalendarDayRows(cal, year, mon);
}
//}}}

//{{{
function createCalendarMonthHeader(cal, row, name, nav, year, mon)
{
 var month;
 if(nav) {
 var back = createTiddlyElement(row, "td", null, null, null);
 var backHandler = function() {
 var newyear = year;
 var newmon = mon-1;
 if(newmon == -1) { newmon = 11; newyear = newyear-1;}
 removeChildren(cal);
 createCalendarOneMonth(cal, newyear, newmon);
 };
 createTiddlyButton(back, "<", "Back", backHandler);
 back.align = "center";
 back.style.background = config.macros.calendar.monthbg; 
 month = createTiddlyElement(row, "td", null, "calendarMonthname", name)
 month.setAttribute("colSpan", 5);
 var fwd = createTiddlyElement(row, "td", null, null, null);
 var fwdHandler = function() {
 var newyear = year;
 var newmon = mon+1;
 if(newmon == 12) { newmon = 0; newyear = newyear+1;}
 removeChildren(cal);
 createCalendarOneMonth(cal, newyear, newmon);
 };
 createTiddlyButton(fwd, ">", "Fwd", fwdHandler);
 fwd.align = "center";
 fwd.style.background = config.macros.calendar.monthbg; 
 } else {
 month = createTiddlyElement(row, "td", null, "calendarMonthname", name)
 month.setAttribute("colSpan", 7);
 }
 month.align = "center";
 month.style.background = config.macros.calendar.monthbg;
}
//}}}

//{{{
function createCalendarDayHeader(row, num)
{
 var cell;
 for(var i = 0; i < num; i++) {
 for(var j = 0; j < 7; j++) {
 var d = j + config.macros.calendar.firstday;
 if(d > 6) d = d - 7;
 cell = createTiddlyElement(row, "td", null, null, config.macros.calendar.daynames[d]);

 if(d == config.macros.calendar.firstweekend || d == config.macros.calendar.firstweekend+1)
 cell.className = "calendarWeekend";
 }
 }
}
//}}}

//{{{
function createCalendarDays(row, col, first, max, year, mon)
{
 var i;
 for(i = 0; i < col; i++) {
 createTiddlyElement(row, "td", null, null, null);
 }
 var day = first;
 for(i = col; i < 7; i++) {
 var d = i + config.macros.calendar.firstday;
 if(d > 6) d = d - 7;
 var daycell = createTiddlyElement(row, "td", null, null, null);
 var isaWeekend = ((d == config.macros.calendar.firstweekend || d == (config.macros.calendar.firstweekend+1))? true:false);

 if(day > 0 && day <= max) {
 var celldate = new Date(year, mon, day);
 // ELS 2005.10.30: use <<date>> macro's showDate() function to create popup
 if (window.showDate) {
 showDate(daycell,celldate,"popup","DD","DD-MMM-YYYY",true, isaWeekend); 
 } else {
 if(isaWeekend) daycell.style.background = config.macros.calendar.weekendbg;
 var title = celldate.formatString(config.macros.calendar.tiddlerformat);
 if(calendarIsHoliday(celldate)) {
 daycell.style.background = config.macros.calendar.holidaybg;
 }
 if(window.findTiddlersWithReminders == null) {
 var link = createTiddlyLink(daycell, title, false);
 link.appendChild(document.createTextNode(day));
 } else {
 var button = createTiddlyButton(daycell, day, title, onClickCalendarDate);
 }
 }
 }
 day++;
 }
}
//}}}

// //We've clicked on a day in a calendar - create a suitable pop-up of options.
// //The pop-up should contain:
// // * a link to create a new entry for that date
// // * a link to create a new reminder for that date
// // * an <hr>
// // * the list of reminders for that date
//{{{
function onClickCalendarDate(e)
{
 var button = this;
 var date = button.getAttribute("title");
 var dat = new Date(date.substr(6,4), date.substr(3,2)-1, date.substr(0, 2));

 date = dat.formatString(config.macros.calendar.tiddlerformat);
 var popup = createTiddlerPopup(this);
 popup.appendChild(document.createTextNode(date));
 var newReminder = function() {
 var t = store.getTiddlers(date);
 displayTiddler(null, date, 2, null, null, false, false);
 if(t) {
 document.getElementById("editorBody" + date).value += "\n<<reminder day:" + dat.getDate() +
 " month:" + (dat.getMonth()+1) +
 " year:" + (dat.getYear()+1900) + " title: >>";
 } else {
 document.getElementById("editorBody" + date).value = "<<reminder day:" + dat.getDate() +
 " month:" + (dat.getMonth()+1) +
 " year:" + (dat.getYear()+1900) + " title: >>";
 }
 };
 var link = createTiddlyButton(popup, "New reminder", null, newReminder); 
 popup.appendChild(document.createElement("hr"));

 var t = findTiddlersWithReminders(dat, 0, null, null);
 for(var i = 0; i < t.length; i++) {
 link = createTiddlyLink(popup, t[i].tiddler, false);
 link.appendChild(document.createTextNode(t[i].tiddler));
 }
}
//}}}

//{{{
function calendarMaxDays(year, mon)
{
 var max = config.macros.calendar.monthdays[mon];
 if(mon == 1 && (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0)) {
 max++;
 }
 return max;
}
//}}}

//{{{
function createCalendarDayRows(cal, year, mon)
{
 var row = createTiddlyElement(cal, "tr", null, null, null);

 var first1 = (new Date(year, mon, 1)).getDay() -1 - config.macros.calendar.firstday;
 if(first1 < 0) first1 = first1 + 7;
 var day1 = -first1 + 1;
 var first2 = (new Date(year, mon+1, 1)).getDay() -1 - config.macros.calendar.firstday;
 if(first2 < 0) first2 = first2 + 7;
 var day2 = -first2 + 1;
 var first3 = (new Date(year, mon+2, 1)).getDay() -1 - config.macros.calendar.firstday;
 if(first3 < 0) first3 = first3 + 7;
 var day3 = -first3 + 1;

 var max1 = calendarMaxDays(year, mon);
 var max2 = calendarMaxDays(year, mon+1);
 var max3 = calendarMaxDays(year, mon+2);

 while(day1 <= max1 || day2 <= max2 || day3 <= max3) {
 row = createTiddlyElement(cal, "tr", null, null, null);
 createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
 createCalendarDays(row, 0, day2, max2, year, mon+1); day2 += 7;
 createCalendarDays(row, 0, day3, max3, year, mon+2); day3 += 7;
 }
}
//}}}

//{{{
function createCalendarDayRowsSingle(cal, year, mon)
{
 var row = createTiddlyElement(cal, "tr", null, null, null);

 var first1 = (new Date(year, mon, 1)).getDay() -1 - config.macros.calendar.firstday;
 if(first1 < 0) first1 = first1+ 7;
 var day1 = -first1 + 1;
 var max1 = calendarMaxDays(year, mon);

 while(day1 <= max1) {
 row = createTiddlyElement(cal, "tr", null, null, null);
 createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;
 }
}
//}}}

// //ELS 2005.10.30: added styles
//{{{
setStylesheet(".calendar, .calendar table, .calendar th, .calendar tr, .calendar td { font-size:10pt; text-align:center; } .calendar { margin:0px !important; }", "calendarStyles");
//}}}
/***
!TiddlyWiki Classic Color Scheme
Designed by Jeremy Ruston
http://tiddlystyles.com/#theme:Classic

To use this color scheme copy the [[ClassicTiddlyWiki]] contents into a tiddler and name it 'StyleSheet' also grab the [[ClassicTemplate]] and copy its contents into a tiddler named 'PageTemplate'.

!Colors Used
*@@bgcolor(#630):color(#fff): #630@@
*@@bgcolor(#930): #930@@
*@@bgcolor(#996633): #963@@
*@@bgcolor(#c90): #c90@@
*@@bgcolor(#cf6): #cf6@@
*@@bgcolor(#cc9): #cc9@@
*@@bgcolor(#ba9): #ba9@@
*@@bgcolor(#996): #996@@
*@@bgcolor(#300):color(#fff): #300@@
*@@bgcolor(#000000):color(#fff): #000@@
*@@bgcolor(#666): #666@@
*@@bgcolor(#888): #888@@
*@@bgcolor(#aaa): #aaa@@
*@@bgcolor(#ddd): #ddd@@
*@@bgcolor(#eee): #eee@@
*@@bgcolor(#ffffff): #fff@@
*@@bgcolor(#f00): #f00@@
*@@bgcolor(#ff3): #ff3@@
!Generic Rules /%==============================================%/
***/
/*{{{*/
body {
 background: #fff;
 color: #000;
}

a{
 color: #963;
}

a:hover{
 background: #963;
 color: #fff;
}

a img{
 border: 0;
}

h1,h2,h3,h4,h5 {
 background: #cc9;
}
/*}}}*/
/***
!Header /%==================================================%/
***/
/*{{{*/
.header{
 background: #300;
}

.titleLine {
 color: #fff;
 padding: 5em 0em 1em .5em;
}

.titleLine a {
 color: #cf6;
}

.titleLine a:hover {
 background: transparent;
}
/*}}}*/
/***
!Main Menu /%=================================================%/
***/
/*{{{*/
#mainMenu .button {
 color: #930;
}

#mainMenu .button:hover {
 color: #cf6;
 background: #930;
}

#mainMenu li{
 list-style: none;
}
/*}}}*/
/***
!Sidebar options /%=================================================%/
~TiddlyLinks and buttons are treated identically in the sidebar and slider panel
***/
/*{{{*/
#sidebar {
 background: #c90;
 right: 0;
}

#sidebarOptions a{
 color: #930;
 border: 0;
 margin: 0;
 padding: .25em .5em;
}

#sidebarOptions a:hover {
 color: #cf6;
 background: #930;
}

#sidebarOptions a:active {
 color: #930;
 background: #cf6;
}

#sidebarOptions .sliderPanel {
 background: #eea;
 margin: 0;
}

#sidebarOptions .sliderPanel a {
 color: #930;
}

#sidebarOptions .sliderPanel a:hover {
 color: #cf6;
 background: #930;
}

#sidebarOptions .sliderPanel a:active {
 color: #930;
 background: #cf6;
}
/*}}}*/
/***
!Sidebar tabs /%=================================================%/
***/
/*{{{*/
.tabSelected,.tabContents {
 background: #eea;
 border: 0;
}

.tabUnselected {
 background: #c90;
}

#sidebarTabs {
 background: #c90;
}

#sidebarTabs .tabSelected{
 color: #cf6;
 background: #963;
}

#sidebarTabs .tabUnselected {
 color: #cf6;
 background: #930;
}

#sidebarTabs .tabContents{
 background: #963;
}

#sidebarTabs .txtMoreTab .tabSelected,
#sidebarTabs .txtMoreTab .tabSelected:hover{
 background: #930;
 color: #cf6;
}

#sidebarTabs .txtMoreTab .tabUnselected,
#sidebarTabs .txtMoreTab .tabUnselected:hover{
 background: #300;
 color: #cf6;
}

#sidebarTabs .txtMoreTab .tabContents {
 background: #930;
}

#sidebarTabs .tabContents a {
 color: #cf6;
 border: 0;
}

#sidebarTabs .button.highlight,
#sidebarTabs .tabContents a:hover {
 background: #cf6;
 color: #300;
}
/*}}}*/
/***
!Message Area /%=================================================%/
***/
/*{{{*/
#messageArea {
 background: #930;
 color: #fff;
}

#messageArea a:link, #messageArea a:visited {
 color: #c90;
}

#messageArea a:hover {
 color: #963;
 background: transparent;
}

#messageArea a:active {
 color: #fff;
}
/*}}}*/
/***
!Popup /%=================================================%/
***/
/*{{{*/
.popup {
 background: #eea;
 border: 1px solid #930;
}

.popup hr {
 color: #963;
 background: #963;
 border-bottom: 1px;
}

.popup li.disabled {
 color: #ba9;
}

.popup li a, .popup li a:visited {
 color: #300;
}

.popup li a:hover {
 background: #930;
 color: #eea;
}
/*}}}*/
/***
!Tiddler Display /%=================================================%/
***/
/*{{{*/
.tiddler .button {
 color: #930;
}

.tiddler .button:hover {
 color: #cf6;
 background: #930;
}

.tiddler .button:active {
 color: #fff;
 background: #c90;
}

.shadow .title {
 color: #888;
}

.title {
 color: #422;
}

.subtitle {
 color: #866;
}

.toolbar {
 color: #aaa;
}

.toolbar a,
.toolbar a:hover{
 border: 0;
}

.tagging, .tagged {
 border: 1px solid #fff;
 background-color: #ffc;
}

.selected .tagging, .selected .tagged {
 border: 1px solid #aa6;
 background-color: #ffc;
}

.tagging .listTitle, .tagged .listTitle {
color: #999999;
}

.footer {
 color: #ddd;
}

.selected .footer {
 color: #888;
}

.sparkline {
 background: #eea;
 border: 0;
}

.sparktick {
 background: #930;
}

.errorButton {
 color: #ff0;
 background: #f00;
}

.zoomer {
 color: #963;
 border: 1px solid #963;
}
/*}}}*/
/***
''The viewer is where the tiddler content is displayed'' /%------------------------------------------------%/
***/
/*{{{*/
.viewer .button {
 background: #c90;
 color: #300;
 border-right: 1px solid #300;
 border-bottom: 1px solid #300;
}

.viewer .button:hover {
 background: #eea;
 color: #c90;
}

.viewer .imageLink{
 background: transparent;
}

.viewer blockquote {
 border-left: 3px solid #666;
}

.viewer table {
 border: 2px solid #303030;
}

.viewer th, thead td {
 background: #996;
 border: 1px solid #606060;
 color: #fff;
}

.viewer td, .viewer tr {
 border: 1px solid #606060;
}

.viewer pre {
 border: 1px solid #963;
 background: #eea;
}

.viewer code {
 color: #630;
}

.viewer hr {
 border: 0;
 border-top: dashed 1px #606060;
 color: #666;
}

.highlight, .marked {
 background: #ff3;
}
/*}}}*/
/***
''The editor replaces the viewer in the tiddler'' /%------------------------------------------------%/
***/
/*{{{*/
.editor input {
 border: 1px solid #000;
}

.editor textarea {
 border: 1px solid #000;
 width: 100%;
}

.editorFooter {
 color: #aaa;
}

.editorFooter a {
 color: #930;
}

.editorFooter a:hover {
 color: #cf6;
 background: #930;
}

.editorFooter a:active {
 color: #fff;
 background: #c90;
}
/*}}}*/
/***
http://tiddlystyles.com/#theme:DevFire
***/

/*{{{*/
body {
background: #000;
}
/*}}}*/
/***
!Link styles /% ============================================================= %/
***/
/*{{{*/
a,
a.button,
#mainMenu a.button,
#sidebarOptions .sliderPanel a{
 color: #ffbf00;
 border: 0;
 background: transparent;
}

a:hover,
a.button:hover,
#mainMenu a.button:hover,
#sidebarOptions .sliderPanel a:hover
#sidebarOptions .sliderPanel a:active{
 color: #ff7f00;
 border: 0;
 border-bottom: #ff7f00 1px dashed;
 background: transparent;
 text-decoration: none;
}

#displayArea .button.highlight{
 color: #ffbf00;
 background: #4c4c4c;
}
/*}}}*/
/***
!Header styles /% ============================================================= %/
***/
/*{{{*/
.header{
 border-bottom: 2px solid #ffbf00;
 color: #fff;
}

.headerForeground a {
 color: #fff;
}

.header a:hover {
 border-bottom: 1px dashed #fff;
}
/*}}}*/
/***
!Main menu styles /% ============================================================= %/
***/
/*{{{*/
#mainMenu {color: #fff;}
#mainMenu h1{
 font-size: 1.1em;
}
#mainMenu li,#mainMenu ul{
 list-style: none;
 margin: 0;
 padding: 0;
}
/*}}}*/
/***
!Sidebar styles /% ============================================================= %/
***/
/*{{{*/
#sidebar {
 right: 0;
 color: #fff;
 border: 2px solid #ffbf00;
 border-width: 0 0 2px 2px;
}
#sidebarOptions {
 background-color: #4c4c4c;
 padding: 0;
}

#sidebarOptions a{
 margin: 0;
 color: #ffbf00;
 border: 0;
}
#sidebarOptions a:hover {
 color: #4c4c4c;
 background-color: #ffbf00;

}

#sidebarOptions a:active {
 color: #ffbf00;
 background-color: transparent;
}

#sidebarOptions .sliderPanel {
 background-color: #333;
 margin: 0;
}

#sidebarTabs {background-color: #4c4c4c;}
#sidebarTabs .tabSelected {
 padding: 3px 3px;
 cursor: default;
 color: #ffbf00;
 background-color: #666;
}
#sidebarTabs .tabUnselected {
 color: #ffbf00;
 background-color: #5f5f5f;
 padding: 0 4px;
}

#sidebarTabs .tabUnselected:hover,
#sidebarTabs .tabContents {
 background-color: #666;
}

.listTitle{color: #FFF;}
#sidebarTabs .tabContents a{
 color: #ffbf00;
}

#sidebarTabs .tabContents a:hover{
 color: #ff7f00;
 background: transparent;
}

#sidebarTabs .txtMoreTab .tabSelected,
#sidebarTabs .txtMoreTab .tab:hover,
#sidebarTabs .txtMoreTab .tabContents{
 color: #ffbf00;
 background: #4c4c4c;
}

#sidebarTabs .txtMoreTab .tabUnselected {
 color: #ffbf00;
 background: #5f5f5f;
}

.tab.tabSelected, .tab.tabSelected:hover{color: #ffbf00; border: 0; background-color: #4c4c4c;cursor:default;}
.tab.tabUnselected {background-color: #666;}
.tab.tabUnselected:hover{color:#ffbf00; border: 0;background-color: #4c4c4c;}
.tabContents {
 background-color: #4c4c4c;
 border: 0;
}
.tabContents .tabContents{background: #666;}
.tabContents .tabSelected{background: #666;}
.tabContents .tabUnselected{background: #5f5f5f;}
.tabContents .tab:hover{background: #666;}
/*}}}*/
/***
!Message area styles /% ============================================================= %/
***/
/*{{{*/
#messageArea {background-color: #666; color: #fff; border: 2px solid #ffbf00;}
#messageArea a:link, #messageArea a:visited {color: #ffbf00; text-decoration:none;}
#messageArea a:hover {color: #ff7f00;}
#messageArea a:active {color: #ff7f00;}
#messageArea .messageToolbar a{
 border: 1px solid #ffbf00;
 background: #4c4c4c;
}
/*}}}*/
/***
!Popup styles /% ============================================================= %/
***/
/*{{{*/
.popup {color: #fff; background-color: #4c4c4c; border: 1px solid #ffbf00;}
.popup li.disabled{color: #fff;}
.popup a {color: #ffbf00; }
.popup a:hover { background: transparent; color: #ff7f00; border: 0;}
.popup hr {color: #ffbf00; background: #ffbf00;}
/*}}}*/
/***
!Tiddler Display styles /% ============================================================= %/
***/
/*{{{*/
.title{color: #fff;}
h1, h2, h3, h4, h5 {
 color: #fff;
 background-color: transparent;
 border-bottom: 1px solid #333;
}

.subtitle{
 color: #666;
}

.viewer {color: #fff; }

.viewer table{background: #666; color: #fff;}

.viewer th {background-color: #996; color: #fff;}

.viewer pre, .viewer code {color: #ddd; background-color: #4c4c4c; border: 1px solid #ffbf00;}

.viewer hr {color: #666;}

.tiddler .button {color: #4c4c4c;}
.tiddler .button:hover { color: #ffbf00; background-color: #4c4c4c;}
.tiddler .button:active {color: #ffbf00; background-color: #4c4c4c;}

.toolbar {
 color: #4c4c4c;
}

.toolbar a.button,
.toolbar a.button:hover,
.toolbar a.button:active,
.editorFooter a{
 border: 0;
}

.footer {
 color: #ddd;
}

.selected .footer {
 color: #888;
}

.highlight, .marked {
 color: #000;
 background-color: #ffe72f;
}
.editorFooter {
 color: #aaa;
}

.tab{
-moz-border-radius-topleft: 3px;
-moz-border-radius-topright: 3px;
}

.tagging,
.tagged{
 background: #4c4c4c;
 border: 1px solid #4c4c4c; 
}

.selected .tagging,
.selected .tagged{
 background-color: #333;
 border: 1px solid #ffbf00;
}

.tagging .listTitle,
.tagged .listTitle{
 color: #fff;
}

.tagging .button,
.tagged .button{
 color: #ffbf00;
 border: 0;
 padding: 0;
}

.tagging .button:hover,
.tagged .button:hover{
background: transparent;
}

.selected .isTag .tagging.simple,
.selected .tagged.simple,
.isTag .tagging.simple,
.tagged.simple {
 float: none;
 display: inline;
 border: 0;
 background: transparent;
 color: #fff;
 margin: 0;
}

.cascade {
 background: #4c4c4c;
 color: #ddd;
 border: 1px solid #ffbf00;
}
/*}}}*/
[[GoodFlickr]]
/***
!Sidebars /%====================================================================================%/
***/
/*{{{*/
#mainMenu{
 position: static;
 text-align: left;
 width: 17em;
}

#mainMenu h1,#mainMenu h2,#mainMenu h3{
 color: #ff0084;
 font-weight: bold;
 padding: 2px 0px;
 font-size: 1.1em;
 letter-spacing: .1em;
 border-bottom: dotted 1px #ccc;
 background-color: transparent;
}

#sidebar{
 width: 20em;
}

#sidebar ul,
#sidebar li{
 padding: 0;
 margin: 0;
 list-style: none;
}

#sidebar .tabContents{
 width: 18em;
}

#sidebar .sliderPanel{
 border: 2px dashed #ccc;
 background: transparent;
 margin: 0;
}

#sidebar .sliderPanel a{
 display:block;
}

#sidebar .sliderPanel .sliderPanel a{
 display:inline;
}


















/* TIDDLER DISPLAY/EDIT SPACE ========================================================== */

#contentWrapper .tiddler {
 margin: 0 0 10px 0;
 padding: 0 15px !important;
 border: dotted 1px #fff;
 color: #666;
}

.tiddler .title {
 background-color: #e9e9e9;
}

.selected {
 border: dotted 1px #ccc;
 margin: -1px;
}

.selected .viewer {
 color: #000 !important; 
}

.selected .viewer * {
 color: #000;
}

.selected .viewer h2, .selected .viewer h4, .selected .viewer h6, .selected .viewer h3, .selected .viewer h5 {
 color: #0063dc;
}

.selected .viewer pre,.selected .viewer li{
 color: #000 !important;
}

.selected .title {
 color: #ff0084;
 background-color: #e9e9e9;
}

#contentWrapper .selected .viewer a {
 color: #0063dc;
 background-color: transparent;
}

#contentWrapper .selected .viewer a:hover {
 color: #ff0084;
 
}

#messageArea {
 font-size: 13px;
 font-weight: bold;
 padding: 5px;
 margin: 10px 20px;
 color: #ff0084;
 border: dotted 1px #ccc;
 text-align: center;
 background: #fff;
}

#messageArea a {
 color: #0063dc !important;
}

#messageArea a:hover {
 color: #ff0084 !important;
}

#displayArea .tiddlyLinkExisting {
 font-weight: bold;
 text-decoration: none;
}

#displayArea .tiddlyLinkNonExisting {
 font-style: italic;
 text-decoration: none;
}

#displayArea .externalLink {
 text-decoration: underline;
}

.title {
 font-size: 1.3em;
 padding: 0 0 0 0;
 font-weight: bold;
 display: block;
 color: #0063dc;
}

.toolbar {
 font-weight: normal;
 font-size: 11px;
 visibility: hidden;
 text-align: right;
 padding: 0 0 5px 0;
 margin: 0;
}

.toolbar a.button {
 padding: 1px 5px;
 color: #fff;
 text-decoration: none;
 border: 1px outset #0063dc;
 background: #0063dc;
 margin: 1px;
}

.toolbar a.button:hover {
 color: #fff;
 background: #ff0084;
 border: 1px outset #ff0084;
}

.toolbar a.button:active {
 color: #fff;
 background: #ff0084;
 border: 1px inset #ff0084;
}

.tagLinks {
 padding-top: 5px;
 margin-top: 10px;
 border-top: 1px dotted #ccc;
 color: #aaa;
}

.tagLinks a {
 color: #aaa;
}

.selected .tagLinks a {
 color: #0063dc;
}

.tagLinks a:hover {
 color: #ff0084;
}


#contentWrapper .viewer {
 line-height: 140%;
 color: #666;
}

#contentWrapper .viewer a{
 font-weight: bold;
 color: #666;
 text-decoration: none;
 background-color: transparent;
}

#contentWrapper .viewer h1, #contentWrapper .viewer h2, #contentWrapper .viewer h3, #contentWrapper .viewer h4, #contentWrapper .viewer h5, #contentWrapper .viewer h6{
 background-color: transparent;
 border-bottom: 1px dotted #666;
 margin-bottom: .25em;
}

.viewer blockquote {
 border-left: 3px solid #777;
 margin: 5px;
 padding: 5px;
}

.viewer ul {
 padding-left: 30px;
}

.viewer ol {
 padding-left: 30px;
}

ol
{
 list-style-type: decimal;
}

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

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

.viewer ul, .viewer ol, .viewer p {
 margin: 5px 0 12px 0;
}

.viewer li {
 margin: 3px 0;
}

.viewer pre{
 font-family: monspace;
}

#contentWrapper .viewer *{
 color: #666;
}


.viewer h2 {
 font-size: 1.2em;
}

.viewer h3 {
 font-size: 1.1em;
 font-style: italic;
}

.viewer h4 {
 font-size: 1em;
}

.viewer h5 {
 font-size: .9em;
 font-style: italic;
}

.viewer h6 {
 font-size: .8em;
}

.viewer table {
 border-collapse: collapse;
 border: 2px solid #303030;
 font-size: 11px;
 margin: 10px 0;
}

.viewer th {
 background: #eee;
 border: 1px solid #aaa;
 padding: 3px;
}

.viewer td {
 border: 1px solid #aaa;
 padding: 3px;
}

.viewer caption {
 padding: 3px;
}

.viewer hr {
 border: none;
 border-top: dotted 1px #777;
 height: 1px;
 color: #fff;
 margin: 7px 0;
}

.body {
 margin: 5px 0 0px 0;
 padding: 5px 0;
}

.highlight {
 color: #000;
 background: #ffe72f;
}

.editor {
 font-size: 8pt;
 color: #402c74;
 font-weight: normal;
 padding: 10px 0;
}

.editor input, .editor textarea {
 display: block;
 font: 13px/130% "Andale Mono", "Monaco", "Lucida Console", "Courier New", monospace;
 margin: 0;
 border: 1px inset #333;
 padding: 2px 0;
}

.footer a.button,.editorFooter a.button{
 color: #e6e6e6;
}

.selected .footer a.button,
.selected .editorFooter a.button{
 color: #0063dc;
}

.selected .footer a.button:hover,
.selected .editorFooter a.button:hover{
 color: #ff0084;
 background-color: transparent;
}

input:focus, textarea:focus {
 background: #ffe;
 border: 1px solid #000 !important;
}
/*}}}*/


/***
!GTD Style
http://tiddlystyles.com/#theme:GTD

!Generic rules /%==================================================================== %/
***/
/*{{{*/
body {
 background: #464646 url('http://shared.snapgrid.com/images/tiddlywiki/bodygradient.png') repeat-x top fixed;
 color: #000;
 font: .82em/1.25em "Bitstream Vera Sans", Verdana, Helvetica, Arial, sans-serif;
/*"Lucida Sans Unicode", "Lucida Grande","Trebuchet MS", */
}
/*}}}*/
/***
!Header rules /%====================================================================== %/
***/
/*{{{*/
#contentWrapper
{
 margin: 0 auto;
width: 59em;
position: relative;
}

#header
{
 color: #fff;
 padding: 1.5em 1em .6em 0;
}

#siteTitle {

 font-size: 2.3em;
 margin: 0;
}

#siteSubtitle {
 font-size: 1em;
 padding-left: .8em;;
}

#titleLine{
 background: transparent;
 padding: 0;
}

#titleLine a {
 color: #cf6;
}

#titleLine a:hover {
 background: transparent;
}
/*}}}*/
/***
!Sidebar rules /%====================================================================== %/
***/
/*{{{*/
#sidebar{
 left: 0;
width: 18em;
 margin: .9em .9em 0 0;
 color: #000;
 background: transparent;
}
/*}}}*/
/***
!Main menu rules /%=================================================================== %/
***/
/*{{{*/
#mainMenu{
 position: static;
 width: auto;

 background: #600;
 border-right: 3px solid #500;
padding: 0;
 text-align: left;
 font-size: 1em;
}

#mainMenu h1{
 padding: 5px;
 margin: 0;
 font-size: 1em;
 font-weight: bold;
 background: transparent;
 color: #fff;
}

#mainMenu ul{
 padding: 0;
 margin: 0;
 list-style: none;
}

#mainMenu h1 a,
#mainMenu li a,
#mainMenu li a.button{
 display: block;
 padding: 0 5px 0 10px;
border: 0;
 border-bottom: 1px solid #500;
 border-top: 1px solid #900;
margin: 0;
}

#mainMenu a,
#mainMenu a.button{
 height: 22px;
height: 1.83em;
 line-height: 22px;
 color: #fff;
 background: #700;
margin-left: 1em;
}

#mainMenu a:hover,
#mainMenu a.button:hover {
 background: #b00;
 color: #fff;
}
/*}}}*/
/***
!Sidebar options rules /%============================================================ %/
***/
/*{{{*/
#sidebarOptions {
 background: #eeb;
 border-right: 3px solid #bb8;
 color: #B4C675;
 padding: .5em 0;
}

#sidebarOptions a {
 color: #700;
 margin: .2em .8em;
 padding: 0;
 border: 0;
}

#sidebarOptions a:hover, #sidebarOptions a:active {
 color: #fff;
 background: #700;
 border: 0;
}

#sidebarOptions input{
 margin: 2px 10px;
 border: 1px inset #333;
padding: 0;
}

#sidebarOptions .sliderPanel {
 background: #fff;
 color: #000;
 padding: 5px 10px;
 font-size: .9em;
}

#sidebarOptions .sliderPanel a{
 font-weight: normal;
 margin: 0;
}

#sidebarOptions .sliderPanel a:link,#sidebarOptions .sliderPanel a:visited {
 color: #700;
}

#sidebarOptions .sliderPanel a:hover,#sidebarOptions .sliderPanel a:active {
 color: #fff;
 background: #700;
}
/*}}}*/
/***
!Sidebar tabs rules /%===================================================================== %/
***/
/*{{{*/
#sidebarTabs {
 background: transparent;
 border-right: 3px solid #740;
 border-bottom: 3px solid #520;
 border: 0;
 padding: 0;
}

#contentWrapper #sidebarTabs a,
#contentWrapper #displayArea .tabContents a{
 color: #fff;
}

#contentWrapper #sidebarTabs a:hover,
#contentWrapper #displayArea .tabContents a:hover {
 background: #000;
 color: #fff;
}

#contentWrapper #sidebarTabs a:active,
#contentWrapper #displayArea .tabContents a:active{
 color: #000;
}



#contentWrapper .tabSelected {
 background: #960;
}

#contentWrapper .tabUnselected{
 background: #660;
}

#contentWrapper #sidebar .tabset{
 background: #eeb;
 border-right: 3px solid #bb8;
 padding: 0 0 0 .75em;
}

#contentWrapper .tabContents{
font-size: .95em;
background: #960;
border:0;
 border-right: 3px solid #740;
 border-bottom: 3px solid #520;
 padding: .75em;
}

#contentWrapper .tabContents{
 width: auto;
}

#contentWrapper #sidebarTabs .tabContents .tabset,
#contentWrapper .tabContents .tabset{
 border: 0;
 padding: 0;
 background: transparent;
}

#contentWrapper .tabContents .tabSelected,
#contentWrapper .tabContents .tabContents {
 background: #700;
 border: 0;
}

#contentWrapper .tabContents .tabUnselected {
 background: #440;
}

#contentWrapper .tabset a {
 color: #fff;
 padding: .2em .7em;
 margin: 0 .17em 0 0;
 height: 2em;
position: static;
}

#contentWrapper .tabset a:hover {
 background: #000;
 color: #fff;
}

#contentWrapper .tabset a:active {
 color: #000;
}

#contentWrapper .tabContents ul{
 margin: 0;
 padding: 0;
 list-style: none;
}

#contentWrapper .tabContents .tabContents ul{
 color: #eeb;
}

.tabContents ul a,
.tabContents ul .button{
 color: #fff;
 display: block;
 padding: .1em 0 .1em .7em;
 background: transparent;
 border: 0;
}

.tabContents ul a:hover {
 color: #fff;
 background: #000;
}
/*}}}*/
/***
!License panel rules /%==================================================================== %/
***/
/*{{{*/
#licensePanel {
 padding: 0px 1em;
 font-size: .9em;
}

#licensePanel a {
 color: #960;
 display: block;
 margin-top: .9em;
}

#licensePanel a:hover {
 color: #fff;
 background: transparent;
}
/*}}}*/
/***
!Popup rules /%================================================================= %/
***/
/*{{{*/
.popup {
 font-size: .8em;
 padding: 0em;
 background: #333;
 border: 1px solid #000;
}

.popup hr {
 margin: 1px 0 0 0;
 visibility: hidden;
}

.popup li.disabled {
 color: #666;
}

.popup li a,
.popup li a:visited{
 color: #000;
 border: .1em outset #cf6;
 background: #cf6;
}

.popup li a:hover {
border: .1em outset #cf6;
 background: #ef9;
 color: #000;
}
/*}}}*/
/***
!Message area rules /%================================================================= %/
***/
/*{{{*/
#messageArea{
 font-size: .9em;
 padding: .4em;
 background: #FFE72F;
 border-right: .25em solid #da1;
 border-bottom: .25em solid #a80;

position: fixed;
 top: 10px;
 right: 10px;
 color: #000;
}

#contentWrapper #messageArea a{
 color: #00e;
 text-decoration: none;
}

#contentWrapper #messageArea a:hover{
 color: #00e;
 text-decoration: underline;
 background: transparent;
}

#contentWrapper #messageArea .messageToolbar a.button{
 border: 1px solid #da1;
}

#contentWrapper #messageArea .messageToolbar a.button:hover{
 color: #00e;
 text-decoration: none;
 border: 1px solid #000;
 background: #fff;
}



/*}}}*/
/***
!Tiddler display rules /%================================================================== %/
***/
/*{{{*/
#displayArea {
 width: 39.75em;
 margin: 0 0 0 17em;
}

.tiddler {
 margin: 0 0 .9em 0;
 padding: 0 1em;
 border-right: .25em solid #aaa;
 border-bottom: .25em solid #555;
 background: #fff;
}

.title {
 font-size: 1.5em;
 font-weight: bold;
 color: #900;
}

.toolbar {
 font-size: .8em;
 padding: .5em 0;
}

.toolbar .button{
 padding: .1em .3em;
 color: #000;

 border: .1em outset #cf6;
 background: #cf6;
margin: .1em;
}

.toolbar .button:hover {
 background: #ef9;
 color: #000;
}

.toolbar .button:active {
 background: #ff0;
}

/*}}}*/
/***
!Viewer rules /% ------------------------------------------------------------------------------------------ %/
***/
/*{{{*/
.viewer {
 line-height: 1.4em;
 font-size: 1em;
}

.viewer a:link, .viewer a:visited {
 color: #15b;
}

.viewer a:hover {
 color: #fff;
 background: #000;
}

.viewer .button{
 background: transparent;
 border-top: 1px solid #eee;
 border-left: 1px solid #eee;
 border-bottom: 1px solid #000;
 border-right: 1px solid #000;
}

.viewer .button:hover{
 background: #eee;
 color: #000;
}

.viewer .button:active{
 background: #ccc;
 border-bottom: 1px solid #eee;
 border-right: 1px solid #eee;
 border-top: 1px solid #111;
 border-left: 1px solid #111;
}


.viewer blockquote {
 border-left: 3px solid #777;
 margin: .3em;
 padding: .3em;
}

.viewer pre{
 background: #fefefe;
 border: 1px solid #f1f1f1;
}

.viewer pre, .viewer code{
 color: #000;
}

.viewer ul {
 padding-left: 30px;
}

.viewer ol {
 padding-left: 30px;
}
ul{
list-style-type: asquare;
}
ol{ 
 list-style-type: decimal;
}

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

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

.viewer ul, .viewer ol, .viewer p {
 margin: .0;
}

.viewer li {
 margin: .2em 0;
}

h1,h2,h3,h4,h5,h6 {
 color: #000;
 font-weight: bold;
 background: #eee;
 padding: 2px 10px;
 margin: 5px 0;
}

.viewer h1 {font-size: 1.3em;}
.viewer h2 {font-size: 1.2em;}
.viewer h3 {font-size: 1.1em;}
.viewer h4 {font-size: 1em;}
.viewer h5 { font-size: .9em;}
.viewer h6 { font-size: .8em;}

.viewer table {
 border: 2px solid #303030;
 font-size: 11px;
 margin: 10px 0;
}

.viewer th, .viewer thead td{
 color: #000;
 background: #eee;
 border: 1px solid #aaa;
 padding: 0 3px;
}

.viewer td {
 border: 1px solid #aaa;
 padding: 0 3px;
}

.viewer caption {
 padding: 3px;
}

.viewer hr {
 border: none;
 border-top: dotted 1px #777;
 height: 1px;
 color: #777;
 margin: 7px 0;
}

.viewer
{
 margin: .5em 0 0 0;
 padding: .5em 0;
 border-top: 1px solid #ccc;
}

.highlight {
 color: #000;
 background: #ffe72f;
}
/*}}}*/
/***
!Editor rules /% ----------------------------------------------------------------------------------------- %/
***/
/*{{{*/
.editor {
 font-size: .8em;
 color: #402C74;
 padding: .3em 0;
}

.editor input, .editor textarea {
 font: 1.1em/130% "Andale Mono", "Monaco", "Lucida Console", "Courier New", monospace;
 margin: 0;
 border: 1px inset #333;
 padding: 2px 0;
}

.editor textarea {
 height: 42em;
 width: 100%;
}

input:focus, textarea:focus
{
 background: #ffe;
 border: 1px solid #000;
}
.footer
{
 padding: .5em 0;
 margin: .5em 0;
 border-top: 1px solid #ddd;
 color: #555;
 text-align: center; 
}
/*}}}*/
/***
!IE Display hacks /% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%/
***/
/*{{{*/
body{
 _text-align: center;
}

#contentWrapper
{
/* _width: 770px; CSS UNDERSCORE HACK FOR PROPER WIN/IE DISPLAY */
 _text-align: left; /* CSS UNDERSCORE HACK FOR PROPER WIN/IE DISPLAY */ 
}

#messageArea{
 _position: absolute;
}
/*}}}*/
使用此 TiddlyWiki 的空白範本之前,請先修改以下預設文章:
* SiteTitle 及 SiteSubtitle:網站的標題和副標題,顯示於頁面上方<br />(在儲存變更後,將顯示於瀏覽器視窗的標題列)。
* MainMenu:主選單(通常在頁面左測)。
* DefaultTiddlers:內含一些文章的標題,可於載入TiddlyWiki 後的預設開啟。
請輸入您的大名,作為所建立/ 編輯的文章署名:<<option txtUserName>>
[[Haloscan|http://www.haloscan.com/]] provides a comment and trackback hosting service.  This service seems like the perfect thing for providing the back-end support for these features in a TiddlyWiki.
/***
|Name|HaloscanMacro|
|Created by|JimSpeth|
|Location|http://end.com/~speth/HaloscanMacro.html|
|Version|1.1.0|
|Requires|~TW2.x|

!Description
Comment and trackback support for TiddlyWiki (via Haloscan).

!History
* 16-Feb-06, version 1.1.0, drastic changes, now uses settings from haloscan account config
* 31-Jan-06, version 1.0.1, fixed display of counts for default tiddlers
* 30-Jan-06, version 1.0, initial release

!Examples
|!Source|!Output|h
|{{{<<haloscan comments>>}}}|<<haloscan comments>>|
|{{{<<haloscan trackbacks>>}}}|<<haloscan trackbacks>>|

!Installation
Register for a [[Haloscan|http://www.haloscan.com]] account.  It's free and painless.
Install the HaloscanMacro in a new tiddler with a tag of systemConfig (save and reload to activate).
In the macro configuration code (below), change //YourName// to your Haloscan account name.
Use the macro somewhere in a tiddler (see ViewTemplate for an example).

!Settings
You can adjust various options for your account in the member configuration area of Haloscan's web site.  The macro will use these settings when formatting the links.

!Code
***/
//{{{

/* change "YourName" to your Haloscan account name */
config.macros.haloscan = {account: "ahwii", baseURL: "http://www.haloscan.com/load/"};

var haloscanLoaded = 0;
config.macros.haloscan.load = function ()
{
    if (haloscanLoaded == 1)
        return;
    
    account = config.macros.haloscan.account;
    if (!account || (account == "ahwii"))
        account = store.getTiddlerText("SiteTitle");
    
    var el = document.createElement('script');
    el.language = 'JavaScript'; 
    el.type = 'text/javascript'; 
    el.src = config.macros.haloscan.baseURL + account;
    document.documentElement.childNodes[0].appendChild(el);
    
    haloscanLoaded = 1;
}
config.macros.haloscan.load();

/* this totally clobbers document.write, i hope that's ok */
var safeWrite = function(s)
{
    document.written = s;
    return s;
};
document.write = safeWrite;

config.macros.haloscan.refreshDefaultTiddlers = function ()
{
    var start = store.getTiddlerText("DefaultTiddlers");
    if (start)
    {
        var titles = start.readBracketedList();
        for (var t=titles.length-1; t>=0; t--)
            story.refreshTiddler(titles[t], DEFAULT_VIEW_TEMPLATE, 1);
    }
}

var haloscanRefreshed = 0;
config.macros.haloscan.handler = function (place, macroName, params, wikifier, paramString, tiddler)
{
    if (typeof HaloScan == 'undefined')
    {
        if (haloscanRefreshed == 0)
        {
            setTimeout("config.macros.haloscan.refreshDefaultTiddlers()", 1);
            haloscanRefreshed = 1;
        }
        return;
    }
    
    var id = story.findContainingTiddler(place).id.substr(7);
    var hs_search = new RegExp('\\W','gi');
    id = id.replace(hs_search,"_");
    
    account = config.macros.haloscan.account;
    if (!account || (account == "ahwii"))
        account = store.getTiddlerText("SiteTitle");
    
    var haloscanError = function (msg)
    {
        createTiddlyError(place, config.messages.macroError.format(["HaloscanMacro"]), config.messages.macroErrorDetails.format(["HaloscanMacro", msg]));
    }
    
    if (params.length == 1)
    {
        if (params[0] == "comments")
        {
            postCount(id);
            commentsLabel = document.written;
            commentsPrompt = "Comments on this tiddler";
            var commentsHandler = function(e) { HaloScan(id); return false; };
            var commentsButton = createTiddlyButton(place, commentsLabel, commentsPrompt, commentsHandler);
        }
        else if (params[0] == "trackbacks")
        {
            postCountTB(id);
            trackbacksLabel = document.written;
            trackbacksPrompt = "Trackbacks for this tiddler";
            var trackbacksHandler = function(e) { HaloScanTB(id); return false; };
            var trackbackButton = createTiddlyButton(place, trackbacksLabel, trackbacksPrompt, trackbacksHandler);
        }
        else
            haloscanError("unknown parameter: " + params[0]);
    }
    else if (params.length == 0)
        haloscanError("missing parameter");
    else
        haloscanError("bad parameter count");
}

//}}}
/***
http://tiddlystyles.com/#theme:Kubrick

!General Rules
***/
/*{{{*/
a,
.button{
 color: #06c;
 text-decoration: none;
 background: transparent;
}

a:hover,
.button:hover{
 background: transparent;
 text-decoration: underline;
 color: #147;
}

body {
 font-size: 62.5%; /* Resets 1em to 10px */
 font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
 background-color: #d5d6d7;
 color: #666;
 background: #e7e7e7;
 margin: 0 auto;
}

#contentWrapper{
 background: transparent url("kubrickbg.jpg") repeat-y 0px 0px;
 border: 0;
 margin: 0 auto;
 width: 760px;
}

/*}}}*/
/***
!Header Rules
***/
/*{{{*/
.titleLine{
 margin: 80px auto 0em;
 padding: 0;
 width: 745px;
 text-align: center;
 color: #fff;
}

.siteTitle{
 font-weight: bold;
}

.siteTitle a, .siteSubtitle a{
 color: #fff;
}

.siteTitle a:hover, .siteSubtitle a:hover{
 text-decoration: underline;
}

.siteSubtitle{
 display: block;
 margin: .5em auto 1em;
}

.header {
 background: url("kubrickheader.jpg") no-repeat bottom center; 
 margin: 0;
 padding: 1px;
 height: 198px;
 width: 758px;

}
/*}}}*/
/***
!Footer Styles
***/
/*{{{*/
#contentFooter {
 text-align: center;
 clear: both;
 background: url("kubrickfooter.jpg") no-repeat bottom;
 border: none;
 padding: 2em;
 height: 3em;
}
/*}}}*/


/***
!Sidebar styles /% ============================================== %/
***/
/*{{{*/
#sidebar{
 margin: 1em 2em 0 0;
 position: static;
 float: right;
}

#sidebar a,
#sidebar a:hover{
 border: 0;
}

#sidebar h1{
 font-size: 1.4em;
 font-weight: bold;
 margin: 0;
 background: transparent;
 color: #000;
}

#sidebar ul{
 padding: 0;
 margin: 0 0 0 1em;
}

#sidebar li{
 list-style: none;
}

#sidebar li:before{
 color: #000;
 content: "\00BB \0020";
}

#sidebar, #mainMenu, #sideBarOptions{
 width: 200px;
 text-align: left;
}

#mainMenu{
 position: static;
}
/*}}}*/
/***
!Sidebar search styles /% ======================================== %/
***/
/*{{{*/
#sidebarSearch{
 margin: 0 0 0 10px;
 width: 145px;
}

#sidebarSearch input{
 font-size: .9em;
 width: 100px;
}

#sidebarSearch .button{
 float: right;
 margin-top: 1px;
}
/*}}}*/
/***
!Sidebar option styles
***/
/*{{{*/
#sidebarOptions{
 margin-left: .75em;
}

#sidebarOptions h1{
 font-size: 1.3em;
}

#sidebarOptions a{
 display: inline;
 border: 0;
}

#sidebarOptions .sliderPanel{
 background-color: transparent;
 font-size: 1em;
 margin: 0;
}

#sidebarOptions .sliderPanel a:before,
#sidebarTabs li:before{
 content: "";
}
/*}}}*/
/***
!Sidebar tab styles
***/
/*{{{*/

#sidebarTabs .tab,
#sidebarTabs .tab:hover{
 border: 1px solid #ccc;
 text-decoration: none;
}

#sidebarTabs .tabSelected{
 background: #ccc;
 color: #333;
}

#sidebarTabs .tabUnselected{
 background: #e6e6e6;
 color: #333;
}

#sidebarTabs .tabContents{
 background: #ccc;
 color: #333;
 border: 1px solid #ccc;
 width: 95%;
}

#sidebarTabs .tabContents a{
 color: #06c;
}

#sidebarTabs .tabContents a:hover{
 color: #147;

}

#sidebarTabs a.tabSelected:hover{
 cursor: default;
}

#sidebarTabs .txtMoreTab .tab{
 border: 1px solid #aaa;
 color: #333;
}

#sidebarTabs .txtMoreTab .tabSelected{
 background: #aaa;
 color: #333;
}

#sidebarTabs .txtMoreTab .tabSelected:hover{
 background: #aaa;
 color: #333
}

#sidebarTabs .txtMoreTab .tabUnselected{
 background: #ccc;
 color: #333;
}

#contentWrapper #sidebar .txtMoreTab .tabUnselected:hover,#contentWrapper #displayArea .txtMoreTab .tabUnselected:hover{
 color: #333;
}

#contentWrapper .txtMoreTab .tabContents{
 background: #aaa;
 color: #333;
 border: 1px solid #aaa;
}
/*}}}*/
/***
!Message area styles /% ========================================== %/
***/
/*{{{*/
#messageArea {
background-color: #eee;
 border: 1px solid #ccc;
 color: #bbb;
 margin: 0 1em;
 font-size: .8em;
}

#messageArea a:link{
 color: #aaa;
}
#messageArea a:hover{
 color: #06c;
}

#messageArea .messageToolbar .button{
 border: 1px solid #ccc;
 color: #aaa;
 text-decoration: none;
}
#messageArea .messageToolbar .button:hover{
 border: 1px solid #777;
 color: #777;
}
/*}}}*/
/***
!Popup styles /% ================================================ %/
***/
/*{{{*/
#popup{
 padding: 0;
 background: #eee;
 border: 1px solid #ccc;
 color: #333;
}

#popup a{
 color: #06c;
 font-weight: normal;
}

#popup a:hover{
 color: #fff;
 background: #aaa;
 text-decoration: none;
}
/*}}}*/
/***
!Tiddler display styles /% ====================================== %/
***/
/*{{{*/
#displayArea{
 margin: 1em 18em 1em 1em;
 text-align: left;
 font-size: 1.2em;
}

h1, h2, h3, h4, h5, .title{
 font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
color: #333;
padding: 0;
}

.viewer h1,.viewer h2,.viewer h3,.viewer h4,.viewer h5,.viewer h6{
 background: transparent;
 border-bottom: 1px dotted #ccc;
}

.title{
 font-size: 1.6em; 
}

.subtitle{
 color: #777;
 font-size: .9em;
}

.toolbar{
 font-size: .8em;
}

.toolbar a:link,.toolbar a:visited{
 background: #e6e6e6;
 border: 1px solid #ccc;
 color: #aaa;
 padding: 1px 3px;
 margin: 0 .5em 0 0;
}

.toolbar a.button:hover{
 background: #ccc;
 border-color: #bbb;
 color: #06c;
 text-decoration: none;
}

.viewer a.tiddlyLinkNonExisting:link{
 color: #b85b5a;
 font-style: normal;
}

.viewer a.tiddlyLinkNonExisting:hover{
 text-decoration: underline; 
}

.viewer a.tiddlyLinkExisting:link,#displayArea .viewer a.externalLink{
 font-weight: normal;
 color: #06c;
}

.viewer a.tiddlyLinkExisting:hover,.viewer a.externalLink:hover{
 color: #147;
 text-decoration: underline; 
}

.viewer .button{
 border: 0;
}

.editor {
 font-size: 8pt;
 color: #402c74;
 font-weight: normal;
}

.editor input, .editor textarea {
 display: block;
 font: 11px/110% "Andale Mono", "Monaco", "Lucida Console", "Courier New", monospace;
 margin: 0 0 10px 0;
 border: 1px inset #333;
 padding: 2px 0;
}

.footer, .footer a.button,.editorFooter, .footer a.button{
 color: #aaa;
}

.selected .footer,.selected .footer a{
 color: #777;
}

.selected .footer a.button,.selected .editorFooter a.button{
 color: #06c;
}

.footer a.button:hover,.editorFooter a.button:hover{
 color: #147;
 background: transparent;
} 

.tagClear{
 clear: none; 
}
/*}}}*/
[[歡迎使用|Welcome to Tiddlyspot]]
{{accordionEffect{
<<slider TiddlyWiki重要網站 TiddlyWiki重要網站 TiddlyWiki重要網站 >>
<<slider TiddlyWiki文章 TiddlyWiki文章 TiddlyWiki文章 >>
<<slider 帳號登入 帳號登入 帳號登入>>}}}
這些設定將暫存於瀏覽器
請簽名<<option txtUserName>>
 (範例:WikiWord)

 <<option chkSaveBackups>> 儲存備份
 <<option chkAutoSave>> 自動儲存
 <<option chkRegExpSearch>> 正規式搜尋
 <<option chkCaseSensitiveSearch>> 區分大小寫搜尋
 <<option chkAnimate>> 使用動畫顯示
----
 [[進階選項|AdvancedOptions]]
/***
/%[[StyleSheetLayout]]
[[StyleSheetColors]]%/
!Rin (Beta!!!!) for TiddlyWiki 2.0
inspired by Broken Kode and implemented by Clint Checketts
http://tiddlystyles.com/#theme:Rin

!General Styles /% ============================================================ %/
***/
/*{{{*/
a,
a.tiddlyLink,
a.button,
a.externalLink{
 color: #005d93;
 text-decoration: none;
 background: transparent;
 border: 0;
}

a:hover,
a.tiddlyLink:hover,
a.button:hover,
a.externalLink:hover{
 border: 0;
 color: #900;
 text-decoration: underline;
}

body {
 background-color: #fff;
 font-family: Verdana, Arial, Helvetica, sans-serif;
}

#contentWrapper{
 border: 0;
 margin: .5em 1em;

}

/*}}}*/
/***
!Header Styles /% ============================================================ %/
***/
/*{{{*/
.header {
 height: 150px;
 background: url('rinback.jpg') repeat-x bottom left;
 position: relative;
}

.titleLine{
 background: #ccc url('ringradient.jpg') repeat-x top center;
 padding: 0 5px;
}

.siteTitle, .siteSubtitle{
 display: inline;
 font-size: 11px;
 line-height: 25px;
 font-weight: bold;
 color: #000;
}

.siteTitle a{
 color: #000;
}

.siteTitle a:hover, .siteSubtitle a:hover,.header .headerOptions a:hover{
 color: #cdcecf;
 text-decoration: none;
 background: transparent;
}

.siteSubtitle, #siteSubtitle a{
 font-weight: normal;
 color: #8b9198;
}

.headerOptions{
 position: absolute;
 z-index: 10;
 top: 4px;
 right: 17px;
 text-align: right;
 font-size: .9em;
}

.headerOptions a{
 position: relative;
 top: -2px;
 color: #8b9190;
}

.headerOptions .sliderPanel{
 color: #000;
 background: #fff;
 border-right: 2px solid #999;
 border-bottom: 2px solid #999;
 border-left: 1px solid #ccc;
 font-size: 10px;
 text-align: left;
 line-height: 1.2em;
 padding: .5em 1em;
 margin: -3px -2px 0 0;
 width: 180px; 
}

.headerOptions input{
 margin: 0em 1em 0 .5em;
 font-size: 9px;
}
/*}}}*/
/***
!Top menu styles /% =========================================================== %/
***/
/*{{{*/
#rinTopMenu{
 position: absolute;
 bottom: 0;
 left: 0;
 width: auto;
 padding: 0;
 margin: 0;
 color: #fff;
}
#rinTopMenu br{
 display: none;
}

#rinTopMenu a{
color: #e6e6e6;
}

#rinTopMenu ul{
 margin: 0 0 2px 2px;
 padding: 0;
}

#rinTopMenu li{
 display: inline;

}

#rinTopMenu li a.tiddlyLink,#rinTopMenu li a.button,#rinTopMenu li a.externalLink{
 padding: 2px 10px;
 color: #e6e6e6;
 text-decoration: none;
}

#rinTopMenu li a.tiddlyLink:hover,#rinTopMenu li a.button:hover,#rinTopMenu li a.externalLink:hover{
 background: #97ced5;
 color: #19729e;
}
/*}}}*/
/***
!Sidebar styles /% =========================================================== %/
***/
/*{{{*/
#rinSidebar{
 float: left;
 margin: 9px 0 0 15px;
 width: 220px;
}

#sidebarOptions a.button{
 display: inline;
}

.sidebarBlock{
 display: block;
 margin: 0 0 .5em 0;
 background: #fff;
 padding-bottom: 5px;
}

.sidebarBlock h1, .sidebarBlock h2, .sidebarBlock h3, .sidebarBlock .tabset{
 background: #ccc url('ringradient.jpg') repeat-x top left;
 font-size: 11px;
 line-height: 23px;
 font-weight: bold;
 color: #000; 
 padding-left: 5px ;
}

.sidebarBlock .tabset{
 padding: 0;
}

#rinSidebar .sidebarBlock .tabContents,
#displayArea .sidebarBlock .tabContents .tabContents, 
#displayArea .viewer .tabUnselected,
#displayArea .viewer .tabContents .tabSelected{
 background: #fff;
 border: 0;
 width: 205px;
}


#sidebar .sidebarBlock .tabContents .tabContents,
#displayArea .sidebarBlock .tabContents,
#displayArea .viewer .tabSelected,
#displayArea .viewer .tabContents .tabUnselected{
 background: #f5f6f7;
}

#sidebar .sidebarBlock .tabContents .tab{
 background: #f5f6f8;
}


#sidebar .sidebarBlock .tabContents .tabUnselected{
 background: #f0f0f0;
}

#sidebar .sidebarBlock .tabContents .tabUnselected:hover{
 text-decoration: underline;
}


#contentWrapper .tab{
 position: relative;
 padding-bottom: 2px;
 font-weight: normal;
 top: 3px;
 background: #f5f6f8;
 color: #000;
 text-decoration: none;
}

#contentWrapper .tabSelected{
 border: 0;
 top: 1px;
 padding-bottom: 4px !important;
 background: #fff;
 font-weight: bold;
 cursor: default;
}

#sidebarTabs .tabContents li.listTitle,#sidebarTabs .tabContents li.listTitle:hover{
 padding: 0 0 0 .5em;
 margin: 0;
 background: transparent;
}

#sidebarTabs .tabContents li.listLink{
 margin-left: 1em; 
}

#sidebarTabs .sidebarBlock li{
 list-style: none;
 margin-left: 1em;
 padding: 1px 0 1px 1.5em;
 background: transparent url('rinbulletOver.gif') no-repeat left center;
}

#sidebarTabs .sidebarBlock li:hover{
 background: transparent url('rinbullet.gif') no-repeat left center;
}

#contentWrapper .tabContents a.tiddlyLink,#contentWrapper .tabContents a.button{
 display: block;
 color: #005d93;
 border: 0;
}

#contentWrapper .tabContents a.tiddlyLink:hover,#contentWrapper .tabContents a.button:hover{
 color: #900;
 background: #f0f0f0;
 text-decoration: none;
}

#rinSidebar ul,
#rinSidebar li{
 list-style: none;
 padding: 0;
 margin: 0;
}

#rinSidebar li a{
 display: block;
 margin: 0 0 0 .5em;
 padding: 0 0 0 1.5em;
 background: transparent url('rinbullet.gif') no-repeat 5px -22px;
}

#rinSidebar li a:hover,
#rinSidebar #sidebarTabs li a:hover{
 background: transparent url('rinbullet.gif') no-repeat 5px 0;
 text-decoration: underline;
}

#rinSidebar #sidebarTabs li{
 margin: 0;
 padding: 0;
}

/*}}}*/
/***
!Message area styles /% =========================================================== %/
***/
/*{{{*/
#messageArea{
 background: #cdced2 url('ringradient.jpg') repeat-x left top;
 color: #000;
 position: absolute;
 top: 135px;
 right: 10px;
}

#messageArea a:link{
 color: #000;
}

#messageArea a:hover{
 text-decoration: none;
}
/*}}}*/
/***
!Display styles /% =========================================================== %/
***/
/*{{{*/
#bodyWrapper{
 border: 1px solid #d5d7db;
 border-width: 15px 1px 3px 1px;
 margin: 10px 0;
 background: #f5f6f7;
}



#displayArea{
 margin: 0 0 0 20em;
}

#contentFooter{
 clear: both;
 background: #d5d7db;
 text-align: center;
}

#contentFooter p{
 margin: 0;
}

.tiddler{
 background: #fff;
 margin: 10px 0;
}

.tiddler .toolbar a.button,.tiddler .footer a.button,.tiddler .editorFooter a.button{
 padding: 2px 5px;
 color: #19729e;
 text-decoration: none;
}

.tiddler .toolbar a.button:hover,.tiddler .footer a.button:hover,.tiddler .editorFooter a.button:hover{
 background: #97ced5;
 color: #19729e;
}

.title{
 font-size: 16px;
}

.tagClear{
 clear: none;
}

.viewer h1,
.viewer h2,
.viewer h3,
.viewer h4,
.viewer h5,
.viewer h6{
 background: transparent;
}

.viewer h1{
 border-bottom: 1px dotted #97ced5;
}

.viewer th,
.viewer thead td{
 background: #2b7ea6
}

#popup{
 color: #000;
 background: #d5d7db;
}

#popup hr{
 color: #999;
 border-top: 1px solid #999;
 width: 96%;
}

#popup a{
 display: block;
 color: #005d93;
}

#popup a:hover{
 color: #900;
 background: #f0f0f0;
 text-decoration: none;
 }
/*}}}*/
/***
|Name|SelectStylesheetPlugin|
|Source|http://www.TiddlyTools.com/#SelectStylesheetPlugin|
|Version|4.4.0|
|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||
|Description|Select alternative TiddlyWiki template/stylesheet 'themes' from a droplist|

!!!!!Usage
<<<
This plugin defines a macro that creates a stylesheet link or selection listbox/droplist that can be added to the content of any tiddler (such as the OptionsPanel or MainMenu tiddlers).

First, create (or import) a custom style sheet tiddler (i.e, a tiddler containing CSS definitions) and tag it with <<tag stylesheets>> so it can be included in the selection list.  Then, add the {{{<<selectStylesheet>>}}} macro to the desired tiddler to display the stylesheet list.  (note: to create a link to apply a specific stylesheet, include the stylesheet tiddlername as a parameter.  See below for more details).

Select your desired stylesheet from the droplist:
** ''[system]'' uses the built-in CSS definitions
** ''[default]'' uses "StyleSheet" tiddler (if present)
** //tiddlername// uses any named stylesheet
The currently selected stylesheet is indicated by a '>' symbol.

//Note: If a selected stylesheet tiddler no longer exists (i.e, the tiddler was deleted or renamed after it had been selected for use), the [default] CSS tiddler ("StyleSheet") will be used as a fallback.  If this tiddler does not exist either, then the built-in CSS definitions are used.//
<<<
!!!!!Parameters
<<<
The selectStylesheet macro accepts parameters to control various features and functions. //Note: while each parameter is optional and may be omitted from the macro, the parameters (when present) must appear in the order shown below.//
* ''size:nnn''
Determines the number of lines to display in the stylesheet list.  If this parameter is omitted or "size:1" is specified, a single-line droplist is created.  When a size > 1 is provided, a standard, fixed-size scrollable listbox is created.  You can use "size:0" or "size:auto" to display a varible-height listbox that automatically adjusts to fit the current list contents without scrolling.
* ''width:nnn[cm|px|em|%]''
Controls the width of the stylesheet list.  Overrides the built-in CSS width declaration (=100%).  Use standard CSS width units (cm=centimeters, px=pixels, em=M-space, %=proportional to containing area).  You can also use a ".selectStylesheet" custom CSS class definition to override the built-in CSS declarations for the stylesheet list.
* ''label:text'' and ''prompt:text''
when used in conjunction with a specific named stylesheet to create a stylesheet link (see //tiddlername// param, below), these two parameters define the link text the 'tooltip' text that appears near the mouse pointer when placed over the link, respectively.
* ''//tiddlername//''
If you include a stylesheet //tiddlername// parameter in the macro (e.g., {{{<<selectStylesheet [[Woodshop]]>>}}} then a link will be created instead of a listbox/droplist.  Selecting this link applies the specified stylesheet.  You may use the special keywords ''[system]'' to use the built-in CSS definitions, or ''[none]'' to bypass all stylesheet tiddlers (sometimes useful during CSS debugging).

<<<
!!!!!Nested Stylesheets
<<<
The CSS definitions for TiddlyWiki are fairly substantial, and stylesheet tiddlers can include hundreds of lines of CSS statements.  Often, these stylesheets will use the exact same CSS for the bulk of their definitions plus several changes or additions to create a difference in appearance.  This results in lots of duplicated CSS definitions that can become difficult to keep 'in sync' with each other.

To make this problem much easier to manage, you can move the common CSS definitions into separate stylesheet tiddlers.  Then, embed {{{[[tiddlertitle]]}}} references in the original stylesheet tiddlers to re-combine the CSS definitions into a single stylesheet 'theme' to be applied.

With some clever division of CSS into separate tiddlers, you can quite easily construct dozens of stylesheet combinations.  You can also mark the common CSS tiddlers with tags and use them as overlay stylesheets so you can mix-and-match their styles to create even more 'on-the-fly' stylesheet combinations.

Note: Normally, when rendering tiddler content for display, the {{{[[tiddlertitle]]}}} syntax means "insert a link to this tiddler".  However, when applying stylesheets, this syntax means "insert the content of this tiddler"
<<<
!!!!!Bypassing default shadow styles (for 'CSS gurus')
<<<
Normally, TiddlyWiki documents automatically use CSS definitions contained in ''shadow tiddlers:'' StyleSheetLayout, StyleSheetColors, and StyleSheetPrint.  Custom stylesheet definitions are then ''overlayed'' on top of these default styles, allowing you to modify and extend the CSS definitions to suit your desired look-and-feel, by just adding a few lines of CSS, instead of directly modifying the shadow tiddlers (which, while it is allowed, is not recommended).

Prior to version 4.3.0 (2006 August 27), the plugin behavior always bypassed the shadow stylesheets when applying a selected custom stylesheet.  As a result, the custom stylesheet definitions had to contain this syntax: {{{[[StyleSheetLayout]] [[StyleSheetColors]] [[StyleSheetPrint]]}}} to make use of the default CSS definitions.  Unfortunately, this made it awkward to import and use 'standard' StyleSheet tiddlers defined for use without the SelectStylesheetPlugin, as they didn't necessarily contain the needed references to the shadow defaults.

''As of version 4.3.0, SelectStylesheetPlugin no longer bypasses the default shadow stylesheets, so that the {{{[[...]]}}} references to the shadows are not required to include the default styles.''

However, if overriding a CSS definition in a custom StyleSheet is simply not sufficient for your needs, you can still ''completely bypass the built-in shadow styles'' by entering
{{{
config.options.chkBypassShadowStyles=true
}}}
into a tiddler tagged with<<tag systemConfig>> (e.g., "ConfigTweaks").  This ''internal system value'' causes the plugin to revert to the pre-4.3.0 behavior so that it skips the shadow styles when applying a selected stylesheet.  Note that this setting is not a user-level preference, so it is not presented as a checkbox option nor stored in a cookie, as it is intended to only be set by the //author// of the document.
<<<
!!!!!Changing templates or invoking custom javascript from a stylesheet
<<<
In addition to CSS definitions, some TiddlyWiki look-and-feel designs also make adjustments to the TiddlyWiki document structure so that certain document features can be moved, hidden, or otherwise redefined.  The default set of templates that control the document structure are called PageTemplate, ViewTemplate, and EditTemplate.  To select an alternative set of templates, you can include the special psuedo-macro ''{{{<<template prefix>>}}}'' in your stylesheet.  This adds the indicated prefix to the standard template names, and automatically switches to using those templates whenever the stylesheet is selected and applied.

Whenever a document is being viewed in read-only mode (i.e., via http: protocol), an implied template prefix of "Web" is also used, and is inserted between any custom template prefix and the standard template name.  For example, ''{{{<<template Custom>>}}}'' will use {{{CustomWebViewTemplate}}} when the document is in read-only mode.  You can specify an alternative for this implied prefix by including a second prefix parameter in the pseudo-macro.  For example, ''{{{<<template Custom ReadOnly>>}}}'' will use {{{CustomReadOnlyViewTemplate}}}.  Note: if a template tiddler with the indicated combination of custom and read-only prefixes is not available, a suitable fallback template is chosen, first by omitting the custom prefix, then by omitting the read-only prefix, and finally by omitting both, and reverting to the appropriate default template.

In addition to selecting alternative templates, a stylesheet can also include the psuedo-macro ''{{{<<init tiddlertitle>>}}}'' to execute custom javascript that can access TiddlyWiki internal data and 'core' functions or perform direct manipulation of the currently-rendered DOM elements of the document.  First, place the desired javascript code into one or more tiddlers (note: //although these tiddlers will contain javascript, ''do NOT tag them as 'systemConfig', since this will cause the javascript to be executed every time TW starts'', rather than only when a specific stylesheet has been selected//).  Then, add the ''{{{<<init tiddlertitle>>}}}'' pseudo-macro to your stylesheet so the javascript will be executed when that specific stylesheet is selected and applied.

Of course, when another stylesheet is subsequently selected, other custom javascript functions may be needed to reset whatever TW internal data changes or DOM manipulations were performed by any {{{<<init>>}}} scripts.  You can define tiddlers containing these ''reset'' scripts by embedding ''{{{<<reset tiddlertitle>>}}}'' in your stylesheet definition.  Unlike {{{<<init>>}}} scripts, any tiddlers declared in this way will NOT be executed when the stylesheet is applied, but will be remembered and automatically executed before applying another stylesheet.

Note: These special-purpose psuedo-macros are only executed when the stylesheet containing them is actually in use.  When these macros are rendered as part of the tiddler content (such as when //viewing// a stylesheet definition), the macros simply report their values without performing any actions.
<<<
!!!!!Examples
<<<
single auto-sized listbox
{{{<<selectStylesheet size:auto width:60%>>}}}
<<selectStylesheet size:auto width:60%>>

droplist for stylesheets
{{{<<selectStylesheet size:1 width:30%>>}}}
<<selectStylesheet size:1 width:30%>>

inline links to set specific stylesheets
{{{<<selectStylesheet Woodshop>> or <<selectStylesheet [[Edge of Night]]>> or <<selectStylesheet [default]>>  or <<selectStylesheet [none]>> or <<selectStylesheet label:TiddlyWiki "prompt:The standard TW stylesheet" [system]>>
}}}
<<selectStylesheet Woodshop>> or <<selectStylesheet [[Edge of Night]]>> or <<selectStylesheet [default]>>  or <<selectStylesheet [none]>> or <<selectStylesheet label:TiddlyWiki "prompt:The standard TW stylesheet" [system]>>

stylesheet definitions (tagged with "stylesheets"):
<<tag stylesheets>>
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''SelectStylesheetPlugin'' (tagged with <<tag systemConfig>>)

create/edit ''OptionsPanel'':
Add "{{{<<selectStylesheet [size:nnn|auto] [width:nnn[cm|px|em|%]>>}}}" macro.
<<<
!!!!!Revision History
<<<
''2007.01.13'' [4.4.0] in applyStylesheets(), when readOnly, automatically use "Web" prefix for StyleSheet (and Layout/Colors/Print shadows), with fallback to regular stylesheets if custom Web stylesheets are not defined. (similar to handling for templates in switchTemplates())
|please see [[SelectStylesheetPluginHistory]] for additional revision details|
''2005.07.20 [1.0.0]'' Initial Release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].  Thanks to David Jaquith for testing and bug reports and SteveRumsby for feature suggestions.
<<<
!!!!!Code
***/
//{{{
version.extensions.selectStylesheet = {major: 4, minor: 4, revision: 0, date: new Date(2007,01,13)};

// IE needs explicit global scoping for functions/vars called from browser events
window.refreshSelectStylesheet=refreshSelectStylesheet;
window.applyStylesheets=applyStylesheets;

if (!config.options.txtStyleSheet) config.options.txtStyleSheet="StyleSheet";
//}}}

//{{{
// define macro rendering handler
config.macros.selectStylesheet = { };
config.macros.selectStylesheet.reset = [];
config.macros.selectStylesheet.handler = function(place,macroName,params) {
	setStylesheet(".selectStylesheet {width:100%;font-size:8pt;margin:0em}","selectStylesheetPlugin");
	var autosize=1;
	if (params[0] && (params[0]=="size:auto"))
		{ autosize=0; params.shift(); }
	if (params[0] && (params[0].substr(0,5)=="size:"))
		autosize=(params.shift()).substr(5);
	if (params[0] && (params[0].substr(0,6)=="width:"))
		var width=(params.shift()).substr(6);
	if (params[0] && (params[0].substr(0,6)=="label:"))
		var label=(params.shift()).substr(6);
	if (params[0] && (params[0].substr(0,7)=="prompt:"))
		var prompt=(params.shift()).substr(7);
	if (params[0] && params[0].trim().length) // create a link that sets a specific stylesheet
		createTiddlyButton(place,label?label:params[0],prompt?prompt:params[0], function(){config.macros.selectStylesheet.set(params[0]); return false;});
	else { // create a select list of available stylesheets
		var theList=createTiddlyElement(place,"select",null,"selectStylesheet",null);
		theList.onkeydown=function() // track keystrokes for listbox only
			{ if (this.size>1 && !this.keydown) { this.keydown=true; this.previousIndex=this.selectedIndex; } return true; };
		theList.onkeyup=function()
			{ if (this.keydown) { this.keydown=false; if (this.selectedIndex!=this.previousIndex) config.macros.selectStylesheet.set(this.value); } return true; };
		theList.onchange=function()
			{ if (!this.keydown) config.macros.selectStylesheet.set(this.value); return true; };
		theList.size=1;
		theList.autosize=autosize;
		if (width) theList.style.width=width;
		store.addNotification(null,refreshSelectStylesheet);
		refreshSelectStylesheet();
	}
}
config.macros.selectStylesheet.set = function(theSheet,nocookie) {
	if (!theSheet || !theSheet.trim().length) return;
	var allStyleLists=getElementsByClass("selectStylesheet");
	for (var k=0; k<allStyleLists.length; k++) {
		var theList=allStyleLists[k];
		for (var t=0; t<theList.options.length; t++)	 {
			if (theList.options[t].text.substr(0,1)==">")
				theList.options[t].text=String.fromCharCode(160)+String.fromCharCode(160)+theList.options[t].text.substr(1);
			if ((theList.options[t].value==theSheet) || (theSheet=="[default]" && theList.options[t].value=="StyleSheet"))
				{ theList.options[t].text=">"+theList.options[t].text.substr(2); theList.selectedIndex=t; }
		}
	}
	config.options.txtStyleSheet=theSheet;
	if (!nocookie) saveOptionCookie("txtStyleSheet");
	applyStylesheets();
	return;
}
if (config.paramifiers) config.paramifiers.style = { onstart: function(theSheet) { config.macros.selectStylesheet.set(theSheet,true); } };

// set to TRUE to enable debugging status messages when stylesheets are applied
config.macros.selectStylesheet.verbose = false;

// hijack existing notifications for refreshStyles() and refreshPageTemplate() handlers
initSelectStylesheetNotification();
function initSelectStylesheetNotification() {
	for (var i=0; i<store.namedNotifications.length; i++) {
		if (store.namedNotifications[i].notify==window.refreshStyles)
			store.namedNotifications[i].notify=applyStylesheets;
		if (store.namedNotifications[i].notify==window.refreshPageTemplate)
			store.namedNotifications[i].notify=applyPageTemplate;
	}
}

// hijack refreshStyles() handler
config.macros.selectStylesheet.coreRefreshStyles = window.refreshStyles;
window.refreshStyles=applyStylesheets;

// hijack refreshPageTemplate() handler
config.macros.selectStylesheet.coreRefreshPageTemplate = window.refreshPageTemplate;
window.refreshPageTemplate=applyPageTemplate;

function getElementsByClass(classname)
{
	var arr=new Array();
	var count=0;
	var all=document.all? document.all : document.getElementsByTagName("*");
	for (var i=0; i<all.length; i++)
		if (all[i].className==classname)
			arr[count++]=all[i];
	return arr;
}

function refreshSelectStylesheet()
{
	var indent = String.fromCharCode(160)+String.fromCharCode(160)+String.fromCharCode(160);
	// for all instances of the selectStylesheet control
	var allStyleLists=getElementsByClass("selectStylesheet");
	for (var k=0; k<allStyleLists.length; k++) {
		var theList=allStyleLists[k];
		// clear current list contents
		while (theList.length > 0) { theList.options[0] = null; }
		theList.selectedIndex=-1;
		// fill the stylesheet list
		var count=0;
		// prompt text
		theList.options[count++] = new Option("select a stylesheet:","",false,false);
		// option: none (built-in hard-coded CSS only)
		theList.options[count++] = new Option(indent+"[none]","[none]",false,false);
		// option: default (built-in plus shadow stylesheets)
		theList.options[count++] = new Option(indent+"[system]","[system]",false,false);
		// option: StyleSheet tiddler, if present
		if (store.getTiddler("StyleSheet")!=undefined)
			theList.options[count++] = new Option(indent+"[default]","StyleSheet",false,false);
		// options: CSS tiddlers tagged with "stylesheets" or "stylesheet"
		var theSheets=store.getTaggedTiddlers("stylesheets").concat(store.getTaggedTiddlers("stylesheet"));
		for (var i=0; i<theSheets.length; i++) {
			var theTitle=theSheets[i].title;
			if (theTitle=="StyleSheet") continue;
			theList.options[count++] = new Option(indent+theTitle,theTitle,false,false);
		}
		// make sure the requested stylesheet exists, fallback if not...
		var theSheet=config.options.txtStyleSheet;
		if (theSheet!="[none]" && theSheet!="[system]" && !store.getTiddler(theSheet)) theSheet="StyleSheet";
		if (!store.getTiddler(theSheet)) theSheet="[system]";
		// set the listbox selection to current stylesheet
		theList.selectedIndex=0;	// default to first item
		for (var t=0; t<theList.options.length; t++)	
			if (theList.options[t].value==theSheet)
				{ theList.selectedIndex=t; break; }
		theList.options[t].text=">"+theList.options[t].text.substr(2);
		// autosize as appropriate
		theList.size=(theList.autosize<1)?theList.options.length:theList.autosize;
	} // end of "for all instances"
}
//}}}

//{{{
config.macros.selectStylesheet.templates = { };
function switchTemplates(which,readOnlyPrefix)
{
	// remember original templates (init only)
	if (!config.macros.selectStylesheet.templates.originalpage)
		config.macros.selectStylesheet.templates.originalpage = "PageTemplate";
	if (!config.macros.selectStylesheet.templates.originalview)
		config.macros.selectStylesheet.templates.originalview = config.tiddlerTemplates[1];
	if (!config.macros.selectStylesheet.templates.originaledit)
		config.macros.selectStylesheet.templates.originaledit = config.tiddlerTemplates[2];
	if (!config.macros.selectStylesheet.altTemplate)
		config.macros.selectStylesheet.altTemplate="";

	// define shorthand variables just for code readability 
	var page=config.macros.selectStylesheet.templates.originalpage;
	var view=config.macros.selectStylesheet.templates.originalview;
	var edit=config.macros.selectStylesheet.templates.originaledit;

	// get 'readOnly' mode... set by TW core, but not until after the plugin is loaded, so we need to do this here as well...
	var loc = document.location.href;
	if (readOnly==undefined)
		var readOnly = (loc.substr(0,4) == "http" || loc.substr(0,3) == "ftp") ? config.options.chkHttpReadOnly : false;

	// get prefix defaults
	if (!which) var which="";
	if (!readOnlyPrefix) var readOnlyPrefix = "Web";
	if (!readOnly) readOnlyPrefix="";
	var alt = which+readOnlyPrefix;

	var msg="current template prefix: '%0', requested template prefix '%1'";
	if (config.macros.selectStylesheet.verbose) alert(msg.format([config.macros.selectStylesheet.altTemplate,alt]));

	// only switch if really changing templates
	if (alt == config.macros.selectStylesheet.altTemplate) return;

	// remember which templates are being used
	config.macros.selectStylesheet.altTemplate = alt;

	// set page template, with fallbacks for missing combinations
	var pageTemplate=alt+page;
	if (!store.getTiddlerText(pageTemplate)) pageTemplate=which+page;
	if (!store.getTiddlerText(pageTemplate)) pageTemplate=readOnlyPrefix+page;
	if (!store.getTiddlerText(pageTemplate)) pageTemplate=page;
	config.macros.selectStylesheet.templates.currentpage = pageTemplate;

	// set view template, with fallbacks for missing combinations
	var viewTemplate=alt+view;
	if (!store.getTiddlerText(viewTemplate)) viewTemplate=which+view;
	if (!store.getTiddlerText(viewTemplate)) viewTemplate=readOnlyPrefix+view;
	if (!store.getTiddlerText(viewTemplate)) viewTemplate=view;
	config.tiddlerTemplates[1] = config.macros.selectStylesheet.templates.currentview = viewTemplate;

	// set edit template, with fallbacks for missing combinations
	var editTemplate=alt+edit;
	if (!store.getTiddlerText(editTemplate)) editTemplate=which+edit;
	if (!store.getTiddlerText(editTemplate)) editTemplate=readOnlyPrefix+edit;
	if (!store.getTiddlerText(editTemplate)) editTemplate=edit;
	config.tiddlerTemplates[2] = config.macros.selectStylesheet.templates.currentedit = editTemplate;

	var msg="switching to templates: %0, %1, %2";
	if (config.macros.selectStylesheet.verbose) alert(msg.format([pageTemplate,viewTemplate,editTemplate]));

	// apply page template
	window.applyPageTemplate();
	// apply view/edit templates
	story.forEachTiddler(function(title,element) { this.refreshTiddler(title,null,true);});

}
// Hijack refreshPageTemplate to force alternative template to be used (if any)
function applyPageTemplate(template)
{
	var cw=document.getElementById("contentWrapper");
	cw.style.display="none";
	if (!template) var template=config.macros.selectStylesheet.templates.currentpage;
	if (config.macros.selectStylesheet.verbose) alert("Apply PageTemplate: %0".format([template]));
	config.macros.selectStylesheet.coreRefreshPageTemplate(template);
	cw.style.display="block";
}
//}}}

//{{{
function applyStylesheets()
{
	// define pattern to match executable <<tiddlername>> references embedded in CSS text
	var setTiddlerRegExp = new RegExp("(?:<<(?:init )([^>]+)>>)","mg");
	var resetTiddlerRegExp = new RegExp("(?:<<reset ([^>]+)>>)","mg");
	var templateRegExp = new RegExp("(?:<<template ([^\s>]+)( [^>]+)?>>)","mg");

	// get 'readOnly' mode... set by TW core, but not until after the plugin is loaded, so we need to do this here as well...
	var loc = document.location.href;
	if (readOnly==undefined)
		var readOnly = (loc.substr(0,4) == "http" || loc.substr(0,3) == "ftp") ? config.options.chkHttpReadOnly : false;

	// make sure the requested stylesheets exist, fallback if not...
	var prefix=readOnly?"Web":"";
	switch (config.options.txtStyleSheet) {
		case "[none]":
		case "[system]":
			var theSheet=config.options.txtStyleSheet;
			break;
		default:
			var theSheet=prefix+config.options.txtStyleSheet;
			if (!store.tiddlerExists(theSheet)) theSheet=config.options.txtStyleSheet;
			if (!store.tiddlerExists(theSheet)) theSheet="StyleSheet";
			if (!store.tiddlerExists(theSheet)) theSheet="[system]";
			break;
	}
	var layoutID="StyleSheetLayout";
	if (store.tiddlerExists(prefix+layoutID)) layoutID=prefix+layoutID;
	var colorsID="StyleSheetColors";
	if (store.tiddlerExists(prefix+colorsID)) colorsID=prefix+colorsID;
	var printID="StyleSheetPrint";
	if (store.tiddlerExists(prefix+printID)) printID=prefix+printID;

	// When store.NotifyAll() is invoked, it can trigger multiple calls to applyStylesheets(),
	// even though only one is needed to set the styles and render things properly.  The extra calls
	// add unnecessary processing overhead by performing multiple re-rendering of entire TW display,
	// often resulting in "slow script" warnings.  To avoid this, we can track the last stylesheet that
	// was applied and only apply the current requested sheet if it is really a different sheet, OR
	// if the TW contents have actually changed (which might include changes to the current stylesheet)
	if (theSheet==config.macros.selectStylesheet.current && !store.dirty) return;
	config.macros.selectStylesheet.current=theSheet;

	// get the primary stylesheet CSS
	var msg="stylesheet: '%0'";
	if (config.macros.selectStylesheet.verbose) alert(msg.format([theSheet]));
	var theCSS = (theSheet.substr(0,1)=='[')?"":store.getRecursiveTiddlerText(theSheet,"",10);
	if (theSheet.substr(0,1)!='[') store.addNotification(theSheet,refreshStyles);

	// execute any saved stylesheet 'reset' code tiddlers
	while (config.macros.selectStylesheet.reset.length) {
		var tiddler=config.macros.selectStylesheet.reset.shift();
		var msg="stylesheet reset macro: '%0'";
		if (config.macros.selectStylesheet.verbose) alert(msg.format([tiddler]));
		var msg="error in '%0': %1";
		try { eval(store.getTiddlerText(tiddler)); }
		catch(e) { displayMessage(msg.format([tiddler,e.toString()])); }
	}

	// if <<template>> reference is not specified, reset to standard template
	if (theCSS.indexOf("<<template")==-1) switchTemplates();

	// execute any embedded <<template>> references
	do {
		var match = templateRegExp.exec(theCSS);
		if(match && match[1]) switchTemplates(match[1],match[2]);
	} while(match);
	// filter out embedded <<template>> references
	theCSS = theCSS.replace(templateRegExp,"");

	// save embedded <<reset tiddlername>> references
	do {
		var match = resetTiddlerRegExp.exec(theCSS);
		if(match && match[1])
			config.macros.selectStylesheet.reset.push(match[1]);
	} while(match);
	// filter out embedded <<reset tiddlername>> references
	theCSS = theCSS.replace(resetTiddlerRegExp,"");

	// execute any embedded <<init tiddlername>> references
	do {
		var match = setTiddlerRegExp.exec(theCSS);
		if(match && match[1]) {
			var msg="stylesheet macro: '%0'";
			if (config.macros.selectStylesheet.verbose) alert(msg.format([match[1]]));
			var msg="error in '%0': %1";
			try { eval(store.getTiddlerText(match[1])); }
			catch(e) { displayMessage(msg.format([match[1],e.toString()])); }
		}
	} while(match);
	// filter out embedded <<set tiddlername>> references
	theCSS = theCSS.replace(setTiddlerRegExp,"");

	// finally, apply the styles
	switch (theSheet) {
		case "[none]": // no styles
			setStylesheet("/*bypass*/","StyleSheetColors");
			setStylesheet("/*bypass*/","StyleSheetLayout");
			setStylesheet("/*bypass*/","StyleSheetPrint");
			setStylesheet("/*bypass*/","StyleSheet");
			break;
		case "[system]": // default styles only
			setStylesheet(store.getRecursiveTiddlerText(layoutID,"",10),"StyleSheetLayout");
			setStylesheet(store.getRecursiveTiddlerText(colorsID,"",10),"StyleSheetColors");
			setStylesheet(store.getRecursiveTiddlerText(printID,"",10),"StyleSheetPrint");
			setStylesheet("","StyleSheet");
			break;
		default: // alternative stylesheet *replaces* default styles
			if (config.options.chkBypassShadowStyles) { // NOTE: hard-coded value, not saved as cookie, adjust in "ConfigTweaks"
				// stylesheet *replaces* default styles
				setStylesheet("/* overridden by [["+theSheet+"]] */","StyleSheetLayout");
				setStylesheet("/* overridden by [["+theSheet+"]] */","StyleSheetColors");
				setStylesheet("/* overridden by [["+theSheet+"]] */","StyleSheetPrint");
			}
			else {
				// stylesheet *overlays* default styles
				setStylesheet(store.getRecursiveTiddlerText(layoutID,"",10),"StyleSheetLayout");
				setStylesheet(store.getRecursiveTiddlerText(colorsID,"",10),"StyleSheetColors");
				setStylesheet(store.getRecursiveTiddlerText(printID,"",10),"StyleSheetPrint");
			}
			setStylesheet(theCSS,"StyleSheet");
			break;
	}
}

config.macros.init = { };
config.macros.init.handler = function(place,macroName,params)
	{ var out="init: [[%0]]"; wikify(out.format(params),place); }
config.macros.reset = { };
config.macros.reset.handler = function(place,macroName,params)
	{ var out="reset: [[%0]]"; wikify(out.format(params),place); }
config.macros.template = { };
config.macros.template.handler = function(place,macroName,params)
	{ var out="use template prefix: ''%0 %1''"; wikify(out.format(params),place); }

//}}}
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal " YYYY年0MM月0DD日">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel  "偏好設定 »" "變更 TiddlyWiki 選項">><<upload http://ahwii.tiddlyspot.com/store.cgi index.html . .  ahwii>> [[下載|http://ahwii.tiddlyspot.com/download]]  樣式選擇
<<selectStylesheet width:50%>>
感激、歡愉、分享的園地
Ahwii的一畝田
[[StyleSheetLocale]]
/*
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/

* {
	margin: 0;
	padding: 0;
}

body {
	background: #FBE8E8 url(images/img01.jpg);
	text-align: justify;
}

body, input, textarea, select {
	font: normal small Georgia, "Times New Roman", Times, serif;
	color: #662C14;
}

h1, h2, h3 {
	margin-bottom: 1em;
	font-weight: normal;
}

h1 {
	font-size: 2.2em;
}

h2 {
	font-size: 1.7em;
}

h3 {
	font-size: 1.3em;
}

p, blockquote, ul, ol, form {
	margin-bottom: 1.5em;
}

blockquote, ul, ol {
	margin-left: 3em;
}

blockquote {
	margin-right: 3em;
	font-style: italic;
}

ul {
	list-style-type: square;
}

a {
	color: #662C14;
}

a:hover {
	text-decoration: none;
}

hr {
	display: none;
}

.hr {
}

img.left {
	float: left;
	margin: 0 15px 15px 0;
}

img.right {
	float: right;
	margin: 0 0 15px 15px;
}

/* Wrapper */

#wrapper {
	padding: 20px 0;
	background: url(images/img02.jpg) repeat-x;
}

/* Header */

#header {
	width: 700px;
	height: 160px;
	margin: 0 auto;
	background: url(images/img03.gif) no-repeat;
}

#header h1, #header h2 {
	margin: 0;
}

#header h1 {
	padding-top: 40px;
	text-align: center;
	font-size: 4em;
}

#header h2 {
	text-align: center;
	font-size: 1em;
	font-style: italic;
}

#header a {
	text-decoration: none;
}

/* Content */

#content {
	width: 700px;
	margin: 0 auto;
	background: #FBE8E8 url(images/img04.gif) repeat-y;
}

/* Blog */

#blog {
	float: right;
	width: 424px;
	padding: 50px 20px 0px 16px;
	background: url(images/img06.gif) no-repeat;
}

/* Post */

.post {
	margin-bottom: 20px;
	padding-bottom: 20px;
	background: url(images/img08.gif) no-repeat center bottom;
}

.post .title {
	margin-bottom: 15px;
	padding-left: 15px;
	border-bottom: 1px solid #D3B6AF;
	text-transform: uppercase;
	font-size: small;
	font-weight: bold;
}

.post .title a {
	text-decoration: none;
}

.post .title a:hover {
	text-decoration: underline;
}

.post .date {
	margin-top: -30px;
	padding-right: 15px;
	text-align: right;
	font-size: x-small;
}

.post .entry {
	padding: 20px 15px 10px 15px;
	line-height: 1.8em;
}

.post .meta {
	margin-bottom: 2em;
	padding: 0 15px;
	text-align: right;
	font-size: x-small;
}

/* Sidebar */

#sidebar {
	float: left;
	width: 204px;
	padding: 50px 16px 0px 20px;
	background: url(images/img05.gif) no-repeat;
}

#sidebar ul {
	margin: 0;
	list-style: none;
}

#sidebar li {
	margin-bottom: 20px;
}

#sidebar li ul {
	padding-left: 5px;
	line-height: 1.4em;
}

#sidebar li li {
	margin: 0;
	padding-left: 12px;
	background: url(images/img07.gif) no-repeat left center;
}

#sidebar h2 {
	margin-bottom: 15px;
	padding-left: 5px;
	border-bottom: 1px solid #D3B6AF;
	text-transform: uppercase;
	font-size: small;
	font-weight: bold;
}

#sidebar a {
	text-decoration: none;
}

#sidebar a:hover {
	text-decoration: underline;
}

/* Search */

#search {
}

#search h2 {
}

#search form {
}

#search #inputtext1 {
}

#search #inputsubmit1 {
}

/* Archives */

#archives {
}

/* Categories */

#categories {
}

/* Blogroll */

#blogroll {
}

/* Meta */

#meta {
}

/* Footer */

#footer {
	width: 700px;
	margin: 0 auto;
	padding-top: 43px;
	background: url(images/img09.gif) no-repeat;
}

#footer p {
	margin: 0;
	padding: 20px 0;
	text-align: center;
	font-size: x-small;
	color: #FFFFFF;
}

#footer a {
	color: #FFFFFF;
}
/***
http://tiddlystyles.com/#theme:TiddlyPedia
***/

/*{{{*/
body{
 background: #f9f9f9 url(headbg.jpg) no-repeat top left;
}

#titleLine{
 display: block;
 background: transparent url(wiki.png) no-repeat 18px -7px;
 _background: transparent;
 height: 120px;
 _height: 135px;
 width: 150px;
 color: #000;
 border: 1px;
 padding: 0;
 margin: 0;
}

* html #titleLine{
 filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='wiki.png',sizingMethod='scale');
}

#contentWrapper #siteTitle a{
 display: inline;
 font-weight: bold;
 color: #000;
 font-size: 13px;
}

#siteSubtitle{
 padding: 0;
}

#siteTitle, #mainMenu{
 position: static;
}

#contentWrapper #sidebar{
 top: 0;
 left: 0;
}

#displayArea {
 margin: 0 0 0 15em;
}

#messageArea{
 position: fixed;
 top: 0;
 right: 0;
 font-size: 10px;
 border: 1px solid #aaa;
 background: #fff;
 z-index: 25;
}

#messageArea a:link{
 color: #002bb8;
 text-decoration: none;
}

#messageArea a:hover{
 text-decoration: underline;
}

.viewer{
 background: #fff;
 border: 1px solid #aaa;
 padding: 1em;
margin: 0;
}

.body{
 padding: 1px;
}

.title{
 background: #fff;
 border: 1px solid #aaa;
 display: inline;
 margin-left: .5em;
 padding: 2px .5em;
 border-bottom: 0;
 font-weight: bold;
 color: #000;
 font-size: 1.2em;
}

.toolbar{
 visibility: visible;
 display: inline;
 padding: 0;
 font-family: sans-serif;
}

.toolbar a.button:link,.toolbar a.button:visited{
 background: #fff;
 border: 1px solid #aaa;
 color:#002bb8;
 font-size: 11px;
 padding-bottom: 0;
 margin-right: .25em;
}

/* TiddlyPedia was Created by Clinton Checketts based on the Monobook skin of Wikipedia */

#contentWrapper .toolbar .button:hover{
 border-bottom: 1px solid #fff;
 background: #fff;
 color:#002bb8;
}

.toolbar a.button:hover{
 border-bottom: 1px solid #fff;
 background: #fff;
 color:#000;
}

#displayArea .viewer a,a.button:link,a.button:visited,
a.tiddlyLink:link,a.tiddlyLink:visited,
#sidebarOptions .sliderPanel a{
 color:#002bb8;
 background: transparent;
 border: 0;
}

.viewer a:hover,a.button:hover,a.button:active,
a.tiddlyLink:hover,a.tiddlyLink:active,
.viewer a.button:hover,
#sidebarOptions .sliderPanel a:hover{
 color:#002bb8;
 background: transparent;
 text-decoration: underline;
}

#mainMenu{
 font-family: sans-serif;
 text-align: left;
 font-size: x-small;
 width: 100%;
 margin: 0;
 padding: 0;
}

#mainMenu h1{
 font-size: 11px;
 font-weight: normal;
 padding: 0;
 margin: 0;
 background: transparent;
}

#mainMenu ul{
 font-size: 11px;
 border: 1px solid #aaa;
 padding: .25em 0;
 margin: 0;
 list-style-type: square;
 list-style-image: url(bullet.gif);
 background: #fff;
 width: 100%;
}

#mainMenu li{
 margin: 0 0 0 2em;
 padding: 0;
}

#contentWrapper #mainMenu a:link,#contentWrapper #mainMenu a:visited{
 color:#002bb8;
 padding: 0;
 margin: 0;
 background: transparent;
}

#mainMenu .externalLink {
 text-decoration: none;
}

#mainMenu .externalLink:hover {
 text-decoration: underline;
}

#sidebar{
 padding: .5em;
 font-family: sans-serif;
}

#sidebarOptions{
 border: 1px solid #aaa;
 background: #fff;
 margin-top: .5em;
 width: 100%;
}

#sidebar .sliderPanel{
 margin: 0;
}

#contentWrapper #sidebarOptions .button,#contentWrapper #sidebarOptions .button:hover{
 color:#002bb8;
 padding: .1em 0 .1em 2em;
 background: transparent url(bullet.gif) 10px -2px no-repeat;
}

#sidebarOptions input{
 width: 80%;
 margin: 0 .5em;
}

#sidebarTabs{
 background: #fff;
 margin-top: .5em;
 width: 100%;
}

#sidebarTabs .tabContents,#sidebarTabs .tabContents .tabContents{
 border: 1px solid #aaa;
 background: #fff;
}

#sidebarTabs .tabSelected,#sidebarTabs .tabcontents .tabSelected {
 background: #fff;
 border: 1px solid #aaa;
 border-bottom: 0;
 cursor: default;
 padding-bottom: 3px;
 color: #000;
}

#sidebarTabs .tabUnselected,#sidebarTabs .tabContents .tabUnselected{
 background: #aaa;
 padding-bottom: 0;
 color: #000; 
}

#contentWrapper #sidebarTabs .tiddlyLink,#contentWrapper #sidebarTabs .button,
#contentWrapper #sidebarTabs a.tiddlyLink:hover,#contentWrapper #sidebarTabs a.button:hover{
 background: transparent;
 color: #002bb8;
}

.footer{
 margin: -1em 0 1em 0; 
}

.footer .button:hover,.editorFooter .button:hover{
background: transparent;
 color: #002bb8;
 border-bottom: 1px solid #002bb8;
}

#popup{
 background: #e9e9e9;
 color: #000;
}

#popup hr{
 border-color: #aaa;
 background-color: #aaa;
}

#popup a{
 color: #000;
}

#popup a:hover,#contentWrapper #sidebarTabs #popup a:hover{
 background: #666;
 color: #fff;
 text-decoration: none;
}

#displayArea .tiddler a.tiddlyLinkNonExisting{
 color: #ba0000;
}

#displayArea .tiddler a.externalLink{
 text-decoration: none;
 color:#002bb8;
 padding-right: 1em;
 background: transparent url(external.png) 100% 50% no-repeat;
}

#displayArea .tiddler a.externalLink:hover{
 text-decoration: underline;
}

.viewer pre{
 background: #e9e9e9;
 border: 1px solid #666;
}

.viewer h1, .viewer h2, .viewer h3, .viewer h4, .viewer h5, .viewer h6{
 background: transparent;
 border-bottom: .2em solid #aaa;
}

#sidebar .sliderPanel{
 background: #e9e9e9;
}

#sidebar .sliderPanel input{width: auto;}

.tagged, .tagging, .listTitle{
 float: none;
 display: inline;
}

.tagged li, .tagging li,
.tagged ul, .tagging ul{
 display: inline;
}

/*}}}*/
/***
!TiddlySinister 
desgined by Clint Checketts (http://www.checkettsweb.com) and inspired from Minz Meyer (http://www.minzweb.de)
http://tiddlystyles.com/#theme:TiddlySinister

!Sections in this Tiddler:
*Generic rules
**Links styles
**Link Exceptions
*Header
*Main menu
*Sidebar
**Sidebar options
**Sidebar tabs
*Message area
*Popup
*Tabs
*Tiddler display
**Viewer
**Editor
*Misc. rules

!Generic Layout Rules /% ============================================================= %/
***/
/*{{{*/
body{
 position: static;
 background: #000;
}

#contentWrapper{
 margin: 0 10px;
 background: #321c10;
 border: 1px solid #613725;
 position: relative;
}

h1, h2, h3, h4, h5, h6{
 background: transparent;
}

#contentWrapper a.button{
 border: 0;
}
/*}}}*/
/***
!Link Styles /% ============================================================= %/
***/
/*{{{*/
#sidebarOptions .tiddlyLink{
 padding: .5em 0 .5em 1em;
 display: block;
 font-weight: normal;
}

#sidebarOptions .sliderPanel .tiddlyLink{
 display:inline;
 padding: 0;
}

#contentWrapper #mainMenu a, 
#messageArea a, 
#contentWrapper #sidebar a{
 color: #fb9950;
 text-decoration: none;
}

#messageArea a:link{
font-weight: bold;
}

#contentWrapper #mainMenu a:hover,
#messageArea a:hover,
#contentWrapper #sidebar a:hover{
 background: transparent;
 text-decoration: underline;
}

a, a.button{
 color: #fb9950;
 background: transparent;
 border: 0;
}

a:hover,#contentWrapper a:active,
.tiddler .button:hover,.tiddler .button:active {
 color: #c17135;
 background: transparent;
 text-decoration: underline;
}

/*}}}*/
/***
!Header styles /% ============================================================= %/
***/
/*{{{*/
#titleLine{
 color: #94532d;
 background: #000;
 border-bottom: 1px solid #613725;
 padding: 1em 0;
}

#titleLine a{
 color: #fb9950;
}

#siteTitle{
 font-size: 2.3em;
 font-weight: bold;
}
/*}}}*/
/***
!Main menu styles /% ============================================================= %/
***/
/*{{{*/
#mainMenu{
 float: left;
 font-size: 12px;
 text-align: left;
 background: #321c10;
 color: #c5886b;
 width: 15em;
 padding: .2em .5em .2em 0;
}

#mainMenu h1{
 font-size: 13px;
 font-weight: normal;
 margin: 0 0 0 2px;
 color: #c5886b;
}

#mainMenu li, #mainMenu ul{
 padding: 0;
 margin: 0;
 list-style: none;
}

#mainMenu ul, #messageArea{
 display: block;
 border: 1px solid #905437;
 padding: 0 0 0 1em;
 background: #522d1e;
 margin: 0 0 1em 0;
}

#messageArea{
 color: #c5886b;
 padding: 1em;
}
/*}}}*/
/***
!Sidebar styles /% ============================================================= %/
***/
/*{{{*/
#sidebar{
 padding: 10px;
 background: #000;
 right: 0;
}



#sidebar .sliderPanel{
 background: #000;
 color: #94532d;
 margin: 0;
}

#sidebar, #sidebarOptions, #sidebarTabs{
 background: transparent;
}

#sidebarTabs .tabSelected{
 background: #522d1e;
 border: 1px solid #905437;
 border-bottom: 0;
 padding-bottom: 3px;
 cursor: default;
 color: #fb9950;
 font-weight: bold;
}

#sidebarTabs .tabUnselected,#sidebarTabs .tabcontents .tabSelected{
 background: #2a170d;
 border: 1px solid #542e21;
 border-bottom: 0;
 padding-bottom: 0px;
 color: #fb9950;
}

#sidebarTabs .tabUnselected:hover{
 color: #c17135
}

#sidebarTabs .tabcontents .tabSelected{
 padding-bottom: 3px;
 border: 1px solid #905437;
 border-bottom: 0;
}

#sidebarTabs .tabcontents .tabUnselected{
background: #522d1e;
 border: 1px solid #613725;
 border-bottom: 0;
 padding-bottom: 0;
}

#sidebarTabs .tabContents{
 background: #522d1e;
 border: 1px solid #905437;
 border-width: 1px 0;
}

#sidebarTabs .tabContents .tabContents{
background: #2a170d;
 border: 1px solid #905437;
}

#sidebarTabs .tabContents li.listTitle{
 color: #c5886b;
}
/*}}}*/
/***
!Popup styles /% ============================================================= %/
***/
/*{{{*/
#popup{
 background: #522d1e;
 border: 1px solid #905437;
 margin-left: -10px;
}

#popup hr{
 border-top: 1px solid #905437;
}

#popup a{
 color: #fb9950
}

#popup a:hover{
 color: #c17135;
 background: transparent;
 text-decoration: underline;
}

.popup li.disabled{color: #c5886b;}

#popup .currentlySelected,
#popup .currentlySelected:hover{
 background: #2a170d;
}
/*}}}*/
/***
!Tiddler display styles /% ============================================================= %/
***/
/*{{{*/
#displayArea{
 margin: 0 15em 0em 15.5em;
 padding: 1em 2em 0 2em;
 background: #33180a;
 border: 1px solid #613725;
 min-height: 400px;
 _position: static;
}

.tiddler{
 background: #2a170d;
 border: 1px solid #542e21;
 margin: 0 0 2em 0;
 position: relative;
 _position; static;
padding: 0;
}

.title{
 color: #fb9950;
 font-size: 14px;
 font-weight: normal;
 line-height: 23px;
 _position: static;
}

/*}}}*/
/***
''Viewer styles'' /% -------------------------------------------------------------------- %/
***/
/*{{{*/
.viewer table {
 border: 1px solid #905437;
}

.viewer td {
 color: #c5886b;
 background: #522d1e;
 border: 1px solid #905437;
}

.viewer, .editer, .editorFooter{
 color: #c5886b;
}

.viewer pre{
 background: #522d1e;
 border: 1px solid #905437;
}

.toolbar{
 float: none;
 background: #000;
 padding: .5em 0;
 visibility: visible;
}

#contentWrapper .toolbar a.button{
 visibility: hidden;
}

#contentWrapper .selected .toolbar a.button{
 visibility: visible;
}

.selected .isTag .tagging,
.selected .tagged,
.isTag .tagging,
.tagged {
 float: none;
 display: inline;
 border: 0;
 background: transparent;
 color: #fb9950;
 margin: 0;
}

.tagged li, .tagging li,
.tagged ul, .tagging ul{
 display: inline;
}


.tiddler .tagging .listTitle,
.tiddler .tagged .listTitle{
 color: #c5886b;
}

.tiddler .tagging a.button,
.tiddler .tagged a.button{
 margin: 0;
 padding: 0;
}

/*}}}*/
/***
''Editor styles''/% -------------------------------------------------- %/
***/
/*{{{*/
.editor textarea,#contentWrapper input{
 max-height: 35em;
 background: #c5886b;
 border: 2px inset #613725;
}

.editor textarea:focus, input:focus{
 background: #ddb9a8;
}

#contentWrapper input.chkOptionInput{
 background: transparent;
}
/*}}}*/
[[值得注意的TiddlyWiki新發展|http://b-oo-k.net/blog/blog.php/2007/177]]
[[如果你有時候常常會自己用notepad或是ultraedit用純文字的方式記錄一些日誌|http://blog.markbowbow.com/2005/09/tiddlywiki.html]]
[[TiddlyWiki 與我的中譯|http://takol.tw/data/37460b7c1ebec1c.html]]
[[有趣的 GTD TiddlyWiki|http://nettrace.blogspirit.com/archive/2005/05/11/%E6%9C%89%E8%B6%A3%E7%9A%84_gtd_tiddlywiki.html]]
[[MonkeyGTD: TiddlyWiki 自定义版本|http://www.wangtam.com/50226711/monkeygtd_tiddlywiki_eaec_34908.php]]
[[MonkeyGTD-又一个基于TiddlyWiki的单网页GTD系统|http://www.lifebang.com/archives/161]]
[[关于Tiddly.wiki的模板修改问题|http://my.opera.com/wolfan.enator/blog/show.dml/457063]]
[[用TiddlyWiki制作个人网站|http://www.acesolo.cn/articles/38.html]]
[[TiddlyWiki-实用高效的个人笔记本|http://www.dancemoon.net/archives/67]]
[[ 华丽与实用兼备的TiddlyWiki|http://www.park17.com/archives/start-using-tiddlywiki]]
[[Tiddly Wiki 開門五件事word 檔|http://163.22.103.133/ntsu/archives/tiddlywiki%205%20tips.doc]]
[[TiddlyWiki真好玩-2|http://www.nooz.com/story/GStj8Z-IhTJ1apPp]]
[[TiddlyWiki真好玩|http://www.nooz.com/story/PKYuzl79uGXHHMeC/]]
[[TiddlyWiki:一个非线性阅读的个人数字记事本|http://bbs.chinahtml.com/showthread.php?p=427825]]
[[不需要数据库的个人版的本地 Wiki系统|http://www.zuola.com/weblog/?p=343]]
[[找到Wiki的新天地了……TiddlyWiki!|http://linshi.twbbs.org/blog/MilchFlasche/52256]]
[[LEWCID一些套件|http://tw.lewcid.org/]]
[[MonkeyGTD的使用笔记|http://yankchina-gbk.blogspot.com/2007/01/monkeygtd.html]]





!以下
是有關於TiddlyWiki''相關的教學及主題網站'',TiddlyWiki的//語法解釋//可在@@color(#00ff00):這些網站@@找到,__文章的編排__可^^直接輸入^^或~~利用剛剛匯入~~的WikiBar功能。

[[TiddlyWiki|http://www.tiddlywiki.com/]]
[[繁體中文|http://ptw.sourceforge.net/index-zh_TW.html]]
[[使用教學中文版|http://web.nlhs.tyc.edu.tw/~lss/wiki/TiddlyWikiTutorialTW.html]]
[[ccTiddlyWiki說明|http://milchflasche.byethost31.com/index.php?config=TiddlyZiddly]]
[[中文論壇|http://groups.google.com/group/PrinceTiddlyWiki]]
[[TiddlyWiki之美|http://linshi.twbbs.org/usr/m/milchflasche/TiddlyWiki.html]]
[[Tiddyspot網路版|http://tiddlyspot.com/]]
[[MonkeyGTD|http://monkeygtd.tiddlyspot.com/]]
[[MPTW|http://mptw.tiddlyspot.com/]]
[[Themes|http://tiddlythemes.com/#Home]]
[[一些工具|http://www.tiddlytools.com/]]
[[MakeMePocketMod|http://ccahua.googlepages.com/monkeygtd2pocketmod.html]]
[[推荐TiddlyWiki|http://jjwsoft.blogspot.com/2007/03/tiddlywiki.html]]
[[ZiddlyWiki|http://trac.tiddlywiki.org/tiddlywiki/wiki/ZiddlyWiki]]
/***
Name: TspotSetupPlugin
Source: 
Required by Tiddlyspot
***/
//{{{

config.options.chkHttpReadOnly = false; // make it so you can by default see edit controls via http

if (window.location.protocol != "file:")
	config.options.chkGTDLazyAutoSave = false; // disable autosave in d3

config.tiddlyspotSiteId = 'ahwii';

// probably will need to redo this for TW 2.2
with (config.shadowTiddlers) {
	SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
	SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
	OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
	DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[Welcome to Tiddlyspot]] ");
	MainMenu = MainMenu.replace(/^/,"[[Welcome to Tiddlyspot]] ");
}

merge(config.shadowTiddlers,{

'Welcome to Tiddlyspot':[
 "This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
 "<<tiddler TspotControls>>",
 "See also GettingStarted.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help.  If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),

'TspotControls':[
 "| tiddlyspot password:|<<option pasUploadPassword>>|",
 "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<<br>>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
 "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[announcements|http://announce.tiddlyspot.com/]], [[blog|http://tiddlyspot.com/blog/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),

'TspotSidebar':[
 "<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n"),

'TspotOptions':[
 "tiddlyspot password:",
 "<<option pasUploadPassword>>",
 ""
].join("\n")

});
//}}}
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 2/4/2007 22:5:7 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.php|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/store.php]] |  | index.html |  |
| 2/4/2007 22:12:1 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.php|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/store.php]] |  | index.html |  |
| 3/4/2007 0:4:0 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.php|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/store.php]] |  | index.html |  |
| 3/4/2007 0:5:57 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.php|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/store.php]] |  | index.html |  |
| 3/4/2007 0:12:30 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.php|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/store.php]] |  | index.html |  |
| 3/4/2007 0:19:6 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 3/4/2007 0:48:17 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.php|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/store.php]] |  | index.html |  |
| 3/4/2007 0:48:31 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 3/4/2007 1:19:38 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 3/4/2007 11:57:6 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 3/4/2007 12:5:11 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 3/4/2007 16:30:15 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 3/4/2007 16:34:37 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 3/4/2007 16:42:39 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |
| 6/4/2007 16:34:9 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 6/4/2007 16:34:11 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 21:53:57 | ahwii | [[index.html|file:///D:/Documents%20and%20Settings/And/My%20Documents/TiddlyWiki/index.html]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 22:7:53 | ahwii | [[/|http://ahwii.tiddlyspot.com/]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 22:17:6 | ahwii | [[/|http://ahwii.tiddlyspot.com/#HaloscanMacro%20GettingStarted]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
| 10/4/2007 22:30:25 | ahwii | [[/|http://ahwii.tiddlyspot.com/#HaloscanMacro%20GettingStarted]] | [[store.cgi|http://ahwii.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|3.4.5|
|''Date:''|Oct 15, 2006|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|
|''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.0.0|
|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|
|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|
|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 3, minor: 4, revision: 5, 
	date: new Date(2006,9,15),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',
	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.0.0',
	browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'
};
//}}}

////+++!![config.lib.file]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.file) config.lib.file= {
	author: 'BidiX',
	version: {major: 0, minor: 1, revision: 0}, 
	date: new Date(2006,3,9)
};
config.lib.file.dirname = function (filePath) {
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(0, lastpos);
	} else {
		return filePath.substring(0, filePath.lastIndexOf("\\"));
	}
};
config.lib.file.basename = function (filePath) {
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("#")) != -1) 
		filePath = filePath.substring(0, lastpos);
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(lastpos + 1);
	} else
		return filePath.substring(filePath.lastIndexOf("\\")+1);
};
window.basename = function() {return "@@deprecated@@";};
//}}}
////===

////+++!![config.lib.log]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.log) config.lib.log= {
	author: 'BidiX',
	version: {major: 0, minor: 1, revision: 1}, 
	date: new Date(2006,8,19)
};
config.lib.Log = function(tiddlerTitle, logHeader) {
	if (version.major < 2)
		this.tiddler = store.tiddlers[tiddlerTitle];
	else
		this.tiddler = store.getTiddler(tiddlerTitle);
	if (!this.tiddler) {
		this.tiddler = new Tiddler();
		this.tiddler.title = tiddlerTitle;
		this.tiddler.text = "| !date | !user | !location |" + logHeader;
		this.tiddler.created = new Date();
		this.tiddler.modifier = config.options.txtUserName;
		this.tiddler.modified = new Date();
	if (version.major < 2)
		store.tiddlers[tiddlerTitle] = this.tiddler;
	else
		store.addTiddler(this.tiddler);
	}
	return this;
};

config.lib.Log.prototype.newLine = function (line) {
	var now = new Date();
	var newText = "| ";
	newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";
	newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";
	newText += config.options.txtUserName + " | ";
	var location = document.location.toString();
	var filename = config.lib.file.basename(location);
	if (!filename) filename = '/';
	newText += "[["+filename+"|"+location + "]] |";
	this.tiddler.text = this.tiddler.text + "\n" + newText;
	this.addToLine(line);
};

config.lib.Log.prototype.addToLine = function (text) {
	this.tiddler.text = this.tiddler.text + text;
	this.tiddler.modifier = config.options.txtUserName;
	this.tiddler.modified = new Date();
	if (version.major < 2)
	store.tiddlers[this.tiddler.tittle] = this.tiddler;
	else {
		store.addTiddler(this.tiddler);
		story.refreshTiddler(this.tiddler.title);
		store.notify(this.tiddler.title, true);
	}
	if (version.major < 2)
		store.notifyAll(); 
};
//}}}
////===

////+++!![config.lib.options]

//{{{
if (!config.lib) config.lib = {};
if (!config.lib.options) config.lib.options = {
	author: 'BidiX',
	version: {major: 0, minor: 1, revision: 0}, 
	date: new Date(2006,3,9)
};

config.lib.options.init = function (name, defaultValue) {
	if (!config.options[name]) {
		config.options[name] = defaultValue;
		saveOptionCookie(name);
	}
};
//}}}
////===

////+++!![PasswordTweak]

//{{{
version.extensions.PasswordTweak = {
	major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),
	type: 'tweak',
	source: 'http://tiddlywiki.bidix.info/#PasswordTweak'
};
//}}}
/***
!!config.macros.option
***/
//{{{
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordType = "password"; // password | text

config.macros.option.onChangeOption = function(e)
{
	var opt = this.getAttribute("option");
	var elementType,valueField;
	if(opt) {
		switch(opt.substr(0,3)) {
			case "txt":
				elementType = "input";
				valueField = "value";
				break;
			case "pas":
				elementType = "input";
				valueField = "value";
				break;
			case "chk":
				elementType = "input";
				valueField = "checked";
				break;
		}
		config.options[opt] = this[valueField];
		saveOptionCookie(opt);
		var nodes = document.getElementsByTagName(elementType);
		for(var t=0; t<nodes.length; t++) 
			{
			var optNode = nodes[t].getAttribute("option");
			if (opt == optNode) 
				nodes[t][valueField] = this[valueField];
			}
		}
	return(true);
};

config.macros.option.handler = function(place,macroName,params)
{
    var opt = params[0];
    if(config.options[opt] === undefined) {
        return;}
    var c;
    switch(opt.substr(0,3)) {
		case "txt":
			c = document.createElement("input");
			c.onkeyup = this.onChangeOption;
			c.setAttribute ("option",opt);
			c.className = "txtOptionInput "+opt;
			place.appendChild(c);
			c.value = config.options[opt];
			break;
		case "pas":
			// input password
			c = document.createElement ("input");
			c.setAttribute("type",config.macros.option.passwordType);
			c.onkeyup = this.onChangeOption;
			c.setAttribute("option",opt);
			c.className = "pasOptionInput "+opt;
			place.appendChild(c);
			c.value = config.options[opt];
			// checkbox link with this password "save this password on this computer"
			c = document.createElement("input");
			c.setAttribute("type","checkbox");
			c.onclick = this.onChangeOption;
			c.setAttribute("option","chk"+opt);
			c.className = "chkOptionInput "+opt;
			place.appendChild(c);
			c.checked = config.options["chk"+opt];
			// text savePasswordCheckboxLabel
			place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
			break;
		case "chk":
			c = document.createElement("input");
			c.setAttribute("type","checkbox");
			c.onclick = this.onChangeOption;
			c.setAttribute("option",opt);
			c.className = "chkOptionInput "+opt;
			place.appendChild(c);
			c.checked = config.options[opt];
			break;
	}
};
//}}}
/***
!! Option cookie stuff
***/
//{{{
window.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;
window.loadOptionsCookie = function()
{
	var cookies = document.cookie.split(";");
	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();
			switch(name.substr(0,3)) {
				case "txt":
					config.options[name] = unescape(value);
					break;
				case "pas":
					config.options[name] = unescape(value);
					break;
				case "chk":
					config.options[name] = value == "true";
					break;
			}
		}
	}
};

window.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;
window.saveOptionCookie = function(name)
{
	var c = name + "=";
	switch(name.substr(0,3)) {
		case "txt":
			c += escape(config.options[name].toString());
			break;
		case "chk":
			c += config.options[name] ? "true" : "false";
			// is there an option link with this chk ?
			if (config.options[name.substr(3)]) {
				saveOptionCookie(name.substr(3));
			}
			break;
		case "pas":
			if (config.options["chk"+name]) {
				c += escape(config.options[name].toString());
			} else {
				c += "";
			}
			break;
	}
	c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";
	document.cookie = c;
};
//}}}
/***
!! Initializations
***/
//{{{
// define config.options.pasPassword
if (!config.options.pasPassword) {
	config.options.pasPassword = 'defaultPassword';
	window.saveOptionCookie('pasPassword');
}
// since loadCookies is first called befor password definition
// we need to reload cookies
window.loadOptionsCookie();
//}}}
////===

////+++!![config.macros.upload]

//{{{
config.macros.upload = {
	accessKey: "U",
	formName: "UploadPlugin",
	contentType: "text/html;charset=UTF-8",
	defaultStoreScript: "store.php"
};

// only this two configs need to be translated
config.macros.upload.messages = {
	aboutToUpload: "About to upload TiddlyWiki to %0",
	backupFileStored: "Previous file backuped in %0",
	crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",
	errorDownloading: "Error downloading",
	errorUploadingContent: "Error uploading content",
	fileLocked: "Files is locked: You are not allowed to Upload",
	fileNotFound: "file to upload not found",
	fileNotUploaded: "File %0 NOT uploaded",
	mainFileUploaded: "Main TiddlyWiki file uploaded to %0",
	passwordEmpty: "Unable to upload, your password is empty",
	urlParamMissing: "url param missing",
	rssFileNotUploaded: "RssFile %0 NOT uploaded",
	rssFileUploaded: "Rss File uploaded to %0"
};

config.macros.upload.label = {
	promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
	promptParamMacro: "Save and Upload this TiddlyWiki in %0",
	saveLabel: "save to web", 
	saveToDisk: "save to disk",
	uploadLabel: "upload"	
};

config.macros.upload.handler = function(place,macroName,params){
	// parameters initialization
	var storeUrl = params[0];
	var toFilename = params[1];
	var backupDir = params[2];
	var uploadDir = params[3];
	var username = params[4];
	var password; // for security reason no password as macro parameter
	var label;
	if (document.location.toString().substr(0,4) == "http")
		label = this.label.saveLabel;
	else
		label = this.label.uploadLabel;
	var prompt;
	if (storeUrl) {
		prompt = this.label.promptParamMacro.toString().format([this.toDirUrl(storeUrl, uploadDir, username)]);
	}
	else {
		prompt = this.label.promptOption;
	}
	createTiddlyButton(place, label, prompt, 
						function () {
							config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); 
							return false;}, 
						null, null, this.accessKey);
};
config.macros.upload.UploadLog = function() {
	return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );
};
config.macros.upload.UploadLog.prototype = config.lib.Log.prototype;
config.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir,  backupDir) {
	var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";
	line += uploadDir + " | " + toFilename + " | " + backupDir + " |";
	this.newLine(line);
};
config.macros.upload.UploadLog.prototype.endUpload = function() {
	this.addToLine(" Ok |");
};
config.macros.upload.basename = config.lib.file.basename;
config.macros.upload.dirname = config.lib.file.dirname;
config.macros.upload.toRootUrl = function (storeUrl, username)
{
	return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));
}
config.macros.upload.toDirUrl = function (storeUrl,  uploadDir, username)
{
	var root = this.toRootUrl(storeUrl, username);
	if (uploadDir && uploadDir != '.')
		root = root + '/' + uploadDir;
	return root;
}
config.macros.upload.toFileUrl = function (storeUrl, toFilename,  uploadDir, username)
{
	return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;
}
config.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)
{
	// parameters initialization
	storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);
	toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);
	backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);
	uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);
	username = (username ? username : config.options.txtUploadUserName);
	password = config.options.pasUploadPassword; // for security reason no password as macro parameter
	if (!password || password === '') {
		alert(config.macros.upload.messages.passwordEmpty);
		return;
	}
	if (storeUrl === '') {
		storeUrl = config.macros.upload.defaultStoreScript;
	}
	if (config.lib.file.dirname(storeUrl) === '') {
		storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;
	}
	if (toFilename === '') {
		toFilename = config.lib.file.basename(document.location.toString());
	}

	clearMessage();
	// only for forcing the message to display
	 if (version.major < 2)
		store.notifyAll();
	if (!storeUrl) {
		alert(config.macros.upload.messages.urlParamMissing);
		return;
	}
	// Check that file is not locked
	if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
		if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {
			alert(config.macros.upload.messages.fileLocked);
			return;
		}
	}
	
	var log = new this.UploadLog();
	log.startUpload(storeUrl, toFilename, uploadDir,  backupDir);
	if (document.location.toString().substr(0,5) == "file:") {
		saveChanges();
	}
	var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);
	displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);
	this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);
	if(config.options.chkGenerateAnRssFeed) {
		//var rssContent = convertUnicodeToUTF8(generateRss());
		var rssContent = generateRss();
		var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";
		this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, 
			function (responseText) {
				if (responseText.substring(0,1) != '0') {
					displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));
				}
				else {
					var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);
					displayMessage(config.macros.upload.messages.rssFileUploaded.format(
						[toFileUrl]), toFileUrl);
				}
				// for debugging store.php uncomment last line
				//DEBUG alert(responseText);
			});
	}
	return;
};

config.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, 
		username, password) {
	var original;
	if (document.location.toString().substr(0,4) == "http") {
		original =  this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);
		return;
	}
	else {
		// standard way : Local file
		
		original = loadFile(getLocalPath(document.location.toString()));
		if(window.Components) {
			// it's a mozilla browser
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
									.createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
				converter.charset = "UTF-8";
				original = converter.ConvertToUnicode(original);
			}
			catch(e) {
			}
		}
	}
	//DEBUG alert(original);
	this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, 
		username, password);
};

config.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, 
		username, password) {
	var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it
	var endSaveArea = '</d' + 'iv>';
	// Locate the storeArea div's
	var posOpeningDiv = original.indexOf(startSaveArea);
	var posClosingDiv = original.lastIndexOf(endSaveArea);
	if((posOpeningDiv == -1) || (posClosingDiv == -1))
		{
		alert(config.messages.invalidFileError.format([document.location.toString()]));
		return;
		}
	var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + 
				allTiddlersAsHtml() + "\n\t\t" +
				original.substr(posClosingDiv);
	var newSiteTitle;
	if(version.major < 2){
		newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();
	} else {
		newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();
	}

	revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
	revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\n" + store.getTiddlerText("MarkupPreHead","") + "\n");
	revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\n" + store.getTiddlerText("MarkupPostHead","") + "\n");
	revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\n" + store.getTiddlerText("MarkupPreBody","") + "\n");
	revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\n" + store.getTiddlerText("MarkupPostBody","") + "\n");

	var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, 
		username, password, function (responseText) {
					if (responseText.substring(0,1) != '0') {
						alert(responseText);
						displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));
					}
					else {
						if (uploadDir !== '') {
							toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);
						} else {
							toFilename = config.macros.upload.basename(toFilename);
						}
						var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);
						if (responseText.indexOf("destfile:") > 0) {
							var destfile = responseText.substring(responseText.indexOf("destfile:")+9, 
							responseText.indexOf("\n", responseText.indexOf("destfile:")));
							toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;
						}
						else {
							toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);
						}
						displayMessage(config.macros.upload.messages.mainFileUploaded.format(
							[toFileUrl]), toFileUrl);
						if (backupDir && responseText.indexOf("backupfile:") > 0) {
							var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, 
							responseText.indexOf("\n", responseText.indexOf("backupfile:")));
							toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;
							displayMessage(config.macros.upload.messages.backupFileStored.format(
								[toBackupUrl]), toBackupUrl);
						}
						var log = new config.macros.upload.UploadLog();
						log.endUpload();
						store.setDirty(false);
						// erase local lock
						if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
							BidiX.GroupAuthoring.lock.eraseLock();
							// change mtime with new mtime after upload
							var mtime = responseText.substr(responseText.indexOf("mtime:")+6);
							BidiX.GroupAuthoring.lock.mtime = mtime;
						}
						
						
					}
					// for debugging store.php uncomment last line
					//DEBUG alert(responseText);
				}
			);
};

config.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, 
		username, password, callbackFn) {
	var boundary = "---------------------------"+"AaB03x";		
	var request;
	try {
		request = new XMLHttpRequest();
		} 
	catch (e) { 
		request = new ActiveXObject("Msxml2.XMLHTTP"); 
		}
	if (window.netscape){
			try {
				if (document.location.toString().substr(0,4) != "http") {
					netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}
			}
			catch (e) {}
		}		
	//DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");
	// compose headers data
	var sheader = "";
	sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
	sheader += config.macros.upload.formName +"\"\r\n\r\n";
	sheader += "backupDir="+backupDir
				+";user=" + username 
				+";password=" + password
				+";uploaddir=" + uploadDir;
	// add lock attributes to sheader
	if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {
		var l = BidiX.GroupAuthoring.lock.myLock;
		sheader += ";lockuser=" + l.user
				+ ";mtime=" + l.mtime
				+ ";locktime=" + l.locktime;
	}
	sheader += ";;\r\n"; 
	sheader += "\r\n" + "--" + boundary + "\r\n";
	sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+toFilename+"\"\r\n";
	sheader += "Content-Type: " + config.macros.upload.contentType + "\r\n";
	sheader += "Content-Length: " + content.length + "\r\n\r\n";
	// compose trailer data
	var strailer = new String();
	strailer = "\r\n--" + boundary + "--\r\n";
	//strailer = "--" + boundary + "--\r\n";
	var data;
	data = sheader + content + strailer;
	//request.open("POST", storeUrl, true, username, password);
	try {
		request.open("POST", storeUrl, true);		
	}
	catch(e) {
		alert(config.macros.upload.messages.crossDomain + "\nError:" +e);
		exit;
	}
	request.onreadystatechange = function () {
				if (request.readyState == 4) {
				     if (request.status == 200)
						callbackFn(request.responseText);
					else
						alert(config.macros.upload.messages.errorUploadingContent + "\nStatus: "+request.status.statusText);
				}
		};
	request.setRequestHeader("Content-Length",data.length);
	request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);
	request.send(data); 
};


config.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, 
	username, password) {
	var request;
	try {
		request = new XMLHttpRequest();
	} 
	catch (e) { 
		request = new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	try {
		if (uploadUrl.substr(0,4) == "http") {
			netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
			}
		else {
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		}
	} catch (e) { }
	//request.open("GET", document.location.toString(), true, username, password);
	try {
		request.open("GET", document.location.toString(), true);
	}
	catch(e) {
		alert(config.macros.upload.messages.crossDomain + "\nError:" +e);
		exit;
	}
	
	request.onreadystatechange = function () {
		if (request.readyState == 4) {
			if(request.status == 200) {
				config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, 
					uploadToFilename, uploadDir, uploadBackupDir, username, password);
			}
			else
				alert(config.macros.upload.messages.errorDownloading.format(
					[document.location.toString()]) + "\nStatus: "+request.status.statusText);
		}
	};
	request.send(null);
};

//}}}
////===

////+++!![Initializations]

//{{{
config.lib.options.init('txtUploadStoreUrl','store.php');
config.lib.options.init('txtUploadFilename','');
config.lib.options.init('txtUploadDir','');
config.lib.options.init('txtUploadBackupDir','');
config.lib.options.init('txtUploadUserName',config.options.txtUserName);
config.lib.options.init('pasUploadPassword','');
setStylesheet(
	".pasOptionInput {width: 11em;}\n"+
	".txtOptionInput.txtUploadStoreUrl {width: 25em;}\n"+
	".txtOptionInput.txtUploadFilename {width: 25em;}\n"+
	".txtOptionInput.txtUploadDir {width: 25em;}\n"+
	".txtOptionInput.txtUploadBackupDir {width: 25em;}\n"+
	"",
	"UploadOptionsStyles");
if (document.location.toString().substr(0,4) == "http") {
	config.options.chkAutoSave = false; 
	saveOptionCookie('chkAutoSave');
}
config.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\n"; 

//}}}
////===

////+++!![Core Hijacking]

//{{{
config.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;
config.macros.saveChanges.label = config.macros.upload.label.saveToDisk;

config.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;

config.macros.saveChanges.handler = function(place)
{
	if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))
		createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);
};

//}}}
////===

<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>) <span macro='viewDetails'></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='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date [[DD MMM YYYY]]'></span> (created <span macro='view created date [[DD MMM YYYY]]'></span>) | <span class='comments' macro='haloscan comments'></span> | <span class='comments' macro='haloscan trackbacks'></span></div>
<!--}}}-->
This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.

@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://ahwii.tiddlyspot.com/controlpanel]] (your control panel username is //ahwii//).
<<tiddler TspotControls>>
See also GettingStarted.

@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the "save to web" button in the column on the right.

@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click "upload" and your ~TiddlyWiki will be saved back to tiddlyspot.com.

@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help.  If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].

@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions.
/***
|''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:#cef;}.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: 	'<html>',
  			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();
//}}}
/***
!Zeldman
http://tiddlystyles.com/#theme:Zeldman

!Colors used by this Theme
*@@background(#f79b60):#f79b60@@
*@@background(#c51):#c51@@
*@@background(#d16400):#d16400@@
*@@background(#be540b):#be540b@@
*@@background(#b44):#b44@@
*@@background(#930):#930@@
*@@background(#922):#922@@
*@@background(#f5d7b4):#f5d7b4@@
*@@background(#cf936c):#cf936c@@
*@@background(#c5886b):#c5886b@@
*@@background(#b8764c):#b8764c@@
*@@background(#867663):#867663@@ Used for MSG Area, Tiddler Title, text, and SubTitle

*@@background(#fff):#fff@@
*@@background(#ccc):#ccc@@
*@@background(#aaa):#aaa@@
*@@background(#888):#888@@
*@@background(#666):#666@@
*@@background(#333):#333@@
*@@background(#000):#000@@

!Popup styles /% =========================================================== %/
***/
/*{{{*/
#popup {
 border: 1px solid #aaa;
 padding: 0;
 background: #fff;
 color: #f79b60;
}

#popup a{
 color: #f79b60;
 font-weight: normal;
}

#popup a:hover {
 background: #f5d7b4;
 color: #930;
}

#popup hr {border-top: solid 1px #f5d7b48;}
#popup li.disabled{color: #cf936c;}

#popup .currentlySelected,
#popup .currentlySelected:hover{
 background: #f5d7b4;
}
/*}}}*/
/***
!Generic styles /% ===================================================== %/
***/
/*{{{*/
h1,h2,h3,h4,h5,h6 {
 background-color: transparent;
 margin: .25em 0;
}

h1 {
border-bottom: 2px dotted #ccc;
}

h2 {
border-bottom: 1px dotted #ccc;
}

a{
 color: #f79b60;
 color: #c51;
}

a.button:active,
a:hover{
 color: #f79b60;
 background: transparent;
}

a.button,
a.button:active{
 border: 0;
}
/*}}}*/
/***
!Header styles /% ================================================================== %/
***/
/*{{{*/
.header{
 position: static;
}

.titleLine {
 height: 7.5em;
 background: #c51;
 border-bottom: 8px solid #b8764c;
 color: #fff;
 left:0;
}

.titleLine a,
.titleLine a:link,
.titleLine a:hover{
 color: #fff;
}

.titleLine a:hover{
border-bottom: 2px dotted;
}

.headerLine{
 padding: 0;
 border-top: 5px solid #cf936c;
 border-bottom: 3px solid #f5d7b4;
}

.siteTitle {
 text-align: right;
 font-size: 4.5em;
 font-weight: bold;
 padding-right: .5em;
}

.siteSubtitle {
 text-align: right;
 font-size: 1.5em;
 font-family: georgia,times;
 padding-right: 1.5em;
}
/*}}}*/
/***
!Main menu styles /% ================================================================== %/
***/
/*{{{*/
#mainMenu {
 width: 12em;
 margin-top: .5em;
 left: .5em;
 padding: 0;
 border: 1px solid #f5d7b4;
 color: #666
}

#mainMenu ul,
#mainMenu li{
 list-style: none;
 margin: 0;
 padding: 0;
}

#mainMenu li strong a {
 color: #fff;
 background: #d16400;
}

#mainMenu li strong a:hover,#mainMenu li strong .button:hover{
 color: #f5d7b4;
 background: #930;
 text-decoration: none;
}

/* The bold has to be a block to contain the links <a>
because inline elements can't contain blocks */
#mainMenu li strong,
#mainMenu li span{
 display: block;
}

#mainMenu li a,
#mainMenu li a:link{
 display: block; 
width: 100%;
 text-decoration: none;
 padding-right: 5px;
 margin-right: 0;
 color: #f79b60;
 border: 0;
}

#mainMenu li a:hover, #mainMenu li .button:hover{
 background-color: #f5d7b4;
 text-decoration: none;
}

#mainMenu a:link{
 text-decoration: none;
 color: #f79b60;
 margin-right: 5px;
}

#mainMenu a:hover,#mainMenu .button:hover{
 text-decoration: underline;
 background: transparent;
 color: #930;
}
/*}}}*/

/***
!Message area styles /% ================================================================== %/
***/
/*{{{*/
#messageArea {
 background-color: #f5d7b4;
 color: #867663;
 padding: 0.5em;
 border: 1px solid #ccc;
}

#messageArea a:link, #messageArea a:visited {
 color: #c51;
}

#messageArea a:hover {
 color: #f79b60;
}

#messageArea a:active {
 color: #fff;
}
/*}}}*/
/***
!Sidebar styles /% ================================================================== %/
***/
/*{{{*/
#sidebar {
 width: 14.5em;
 border-bottom:1px solid #aaa; 
 border-left: 1px solid #aaa;
}

#sidebarOptions{
 background-color: #fff;
}

#sidebarOptions a{
 color: #f79b60;
 background: transparent;
 text-decoration: none;
 border: 0;
}

#sidebarOptions a:hover{
 color: #c51;
 background: #fff;
 text-decoration: underline;
}

#sidebarOptions .sliderPanel{
 background: #f5d7b4;
 margin: 0;
}

#sidebarOptions .sliderPanel a{
 color: #922;
 font-weight:normal;
}

#sidebarOptions .sliderPanel a:hover{
 color: #b44;
 background: transparent;
}

#sidebarTabs {
 background-color: #fff;
}

#sidebarTabs a {
 background: transparent;
}

#sidebarTabs .tabContents a:hover {
 color: #922;
 text-decoration: underline;
 background-color: transparent;
}

.tab {
 margin: 0px 1px; 
 border:1px solid #aaa;
 border-bottom:none;
 color: #922;
}

.tab:hover {
 border-color: black;
 text-decoration: none;
}

#sidebarTabs .tabSelected {
 background: #f5d7b4;
 padding: 2px 4px;
 color: #922;
}

#sidebarTabs .tabUnselected {
 background: #c51;
 padding: 2px 4px 0px 4px;
 color: #fff;
}

#sidebarTabs .tabContents {
 background-color: #f5d7b4;
}

#sidebarTabs .tabContents a{
 color: #922;
}

#sidebarTabs .tabContents a:hover{
 color: #b44;
}

#sidebarTabs .txtMoreTab .tabSelected,
#sidebarTabs .txtMoreTab .tabSelected:hover{
 background: #cf936c ;
 color: #000 ;
 text-decoration: none;
}

#sidebarTabs .txtMoreTab .tabUnselected,
#sidebarTabs .txtMoreTab .tabUnselected:hover{
 background: #f5d7b4 ;
 color: #000 ;
 text-decoration: none;
}

#sidebarTabs .txtMoreTab .tabContents {
 color: #fff;
 background: #cf936c;
 border-bottom: solid #aaa 1px;
}
/*}}}*/
/***
!Tiddler display styles /% ================================================================== %/
***/
/*{{{*/
#displayArea {
 margin: 1em 15em 0em 15em;
}

.tiddler{
 padding: 0;
 border: 1px solid #ccc;
 padding: 5px;
}

.title {
 font-size: 1.5em;
 color: #867663;
 font-weight: bold;
}

.toolbar {
 font-size: .9em;
}

.toolbar a.button{
 color: #f79b60;
 border: 1px solid #fff;
}

.tiddler .toolbar a.button:hover,
.tiddler .toolbar a.button:active {
 color: #930;
 background: #f5d7b4;
 border: 1px solid #f79b60;
}

.toolbar a.button:active {
 color: #666;
}

.body {
 border-top:1px solid #ccc;
 padding-top: 0.5em;
 margin-top:0.3em;
}
/*}}}*/
/***
''Viewer styles'' /% --------------------------------------------------------------------------------------------- %/
***/
/*{{{*/
.tiddler a.button {
 color: #f79b60;
}

.tiddler a.button:hover {
 color: #be540b;
 background: transparent;
}

.subtitle,
.viewer {
 color: #867663;
}

.viewer .button{
 background: transparent;
 color: #888;
 border: 1px solid transparent;
}


.viewer a:link, .body a:visited{
 color: #be540b;
}

.viewer a:hover {
 background-color: transparent;
 text-decoration: underline;
}

.viewer blockquote {
 border-left: 1px solid #ccc;
}

.viewer table {
 border: 2px solid #333;
}


.viewer td, tr {
 border: 1px solid #666;
 padding: 3px;
}

.viewer hr {
 border-color: #666;
 color: #666;
}

.viewer pre {
 border: 1px solid #aaa;
 background: #f5d7b4;
 color: #333;
}

.viewer code {
 color: #922;
}

.selected .isTag .tagging,
.selected .tagged,
.isTag .tagging,
.tagged {
 float: none;
 display: inline;
 border: 0;
 background: transparent;
 color: #f79b60;
 margin: 0;
}

.tagged li, .tagging li,
.tagged ul, .tagging ul{
 display: inline;
}


.tiddler .tagging .listTitle,
.tiddler .tagged .listTitle{
 color: #ccc;
}

.tiddler .tagging a.button,
.tiddler .tagged a.button{
 margin: 0;
 padding: 0;
 color: #ccc;
}

.selected .tagging .listTitle,
.selected .tagged .listTitle,
.selected .tagging a.button,
.selected .tagged a.button{
 color: #333;
}
/*}}}*/
/***
''Editor styles'' /% --------------------------------------------------- %/
***/
/*{{{*/
.editor input,
.editor textarea {
 border: 1px solid black;
}

.editor textarea{
 font-size: .8em;
}
/*}}}*/
/***
|''Name:''|zh-HantTranslationPlugin|
|''Description:''|Translation of TiddlyWiki into Traditional Chinese|
|''Source:''|http://tiddlywiki-zh.googlecode.com/svn/trunk/|
|''Subversion:''|http://svn.tiddlywiki.org/Trunk/association/locales/core/zh-Hant/locale.zh-Hant.js|
|''Author:''|BramChen (bram.chen (at) gmail (dot) com)|
|''Version:''|1.1.0.2|
|''Date:''|Jan 13, 2007|
|''Comments:''|Please make comments at http://groups-beta.google.com/group/TiddlyWiki-zh/|
|''License:''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|''~CoreVersion:''|2.2.0|
***/

/*{{{*/
// --
// -- Translateable strings
// --

// Strings in "double quotes" should be translated; strings in 'single quotes' should be left alone

config.locale = "zh-Hant"; // W3C language tag

if (!config.options.txtUserName)
	config.options.txtUserName = "YourName";

merge(config.tasks,{
	save: {text: "儲存", tooltip: "儲存變更至此 TiddlyWiki", action: saveChanges},
	sync: {text: "同步", tooltip: "將你的資料內容與外部伺服器與檔案同步", content: '<<sync>>'},
	importTask: {text: "導入", tooltip: "自其他檔案或伺服器導入文章或套件", content: '<<importTiddlers>>'},
	tweak: {text: "選項", tooltip: "改變此 TiddlyWiki 的顯示與行為的設定", content: '<<options>>'},
	plugins: {text: "套件管理", tooltip: "管理已安裝的套件", content: '<<plugins>>'}
});

merge(config.optionsDesc,{
	txtUserName: "編輯文章所使用之作者署名",
	chkRegExpSearch: "啟用正規式搜尋",
	chkCaseSensitiveSearch: "搜尋時,區分大小寫",
	chkAnimate: "使用動畫顯示",
	chkSaveBackups: "儲存變更前,保留備份檔案",
	chkAutoSave: "自動儲存變更",
	chkGenerateAnRssFeed: "儲存變更時,也儲存 RSS feed",
	chkSaveEmptyTemplate: "儲存變更時,也儲存空白範本",
	chkOpenInNewWindow: "於新視窗開啟連結",
	chkToggleLinks: "點擊已開啟文章將其關閉",
	chkHttpReadOnly: "非本機瀏覽文件時,隱藏編輯功能",
	chkForceMinorUpdate: "修改文章時,不變更作者名稱與日期時間",
	chkConfirmDelete: "刪除文章前須確認",
	chkInsertTabs: "使用 tab 鍵插入定位字元,而非跳至下一個欄位",
	chkShowTiddlerDetails: "顯示文章詳細資訊",
	txtBackupFolder: "存放備份檔案的資料夾",
	txtMaxEditRows: "編輯模式中顯示列數",
	txtFileSystemCharSet: "指定儲存文件所在之檔案系統之字集"});

// Messages
merge(config.messages,{
	customConfigError: "套件載入發生錯誤,詳細請參考 PluginManager",
	pluginError: "發生錯誤: %0",
	pluginDisabled: "未執行,因標籤設為 'systemConfigDisable'",
	pluginForced: "已執行,因標籤設為 'systemConfigForce'",
	pluginVersionError: "未執行,套件需較新版本的 TiddlyWiki",
	nothingSelected: "尚未作任何選擇,至少需選擇一項",
	savedSnapshotError: "此 TiddlyWiki 未正確存檔,詳見 http://www.tiddlywiki.com/#DownloadSoftware",
	subtitleUnknown: "(未知)",
	undefinedTiddlerToolTip: "'%0' 尚無內容",
	shadowedTiddlerToolTip: "'%0' 尚無內容, 但已定義隱藏的預設值",
	tiddlerLinkTooltip: "%0 - %1, %2",
	externalLinkTooltip: "外部連結至 %0",
	noTags: "未設定標籤的文章",
	notFileUrlError: "須先將此 TiddlyWiki 存至檔案,才可儲存變更",
	cantSaveError: "無法儲存變更。可能的原因有:\n- 你的瀏覽器不支援此儲存功能(Firefox, Internet Explorer, Safari and Opera 經適當設定後可儲存變更)\n- 也可能是你的 TiddlyWiki 檔名包含不合法的字元所致。\n- 或是 TiddlyWiki 文件被改名或搬移。",
	invalidFileError: " '%0' 非有效之 TiddlyWiki 文件",
	backupSaved: "已儲存備份",
	backupFailed: "無法儲存備份",
	rssSaved: "RSS feed 已儲存",
	rssFailed: "無法儲存 RSS feed ",
	emptySaved: "已儲存範本",
	emptyFailed: "無法儲存範本",
	mainSaved: "主要的TiddlyWiki已儲存",
	mainFailed: "無法儲存主要 TiddlyWiki,所作的改變未儲存",
	macroError: "巨集 <<\%0>> 執行錯誤",
	macroErrorDetails: "執行巨集 <<\%0>> 時,發生錯誤 :\n%1",
	missingMacro: "無此巨集",
	overwriteWarning: "'%0' 已存在,[確定]覆寫之",
	unsavedChangesWarning: "注意! 尚未儲存變更\n\n[確定]存檔,或[取消]放棄存檔?",
	confirmExit: "--------------------------------\n\nTiddlyWiki 以更改內容尚未儲存,繼續的話將遺失這些更動\n\n--------------------------------",
	saveInstructions: "SaveChanges",
	unsupportedTWFormat: "未支援此 TiddlyWiki 格式:'%0'",
	tiddlerSaveError: "儲存文章 '%0' 時,發生錯誤。",
	tiddlerLoadError: "載入文章 '%0' 時,發生錯誤。",
	wrongSaveFormat: "無法使用格式 '%0' 儲存,請使用標准格式存放",
	invalidFieldName: "無效的欄位名稱:%0",
	fieldCannotBeChanged: "無法變更欄位:'%0'"});

merge(config.messages.messageClose,{
	text: "關閉",
	tooltip: "關閉此訊息"});

config.messages.backstage = {
	open: {text: "控制台", icon: "↩", iconIE: "←", tooltip: "開啟控制台執行編寫工作"},
	close: {text: "關閉", icon: "↪", iconIE: "→", tooltip: "關閉控制台"},
	prompt: "控制台:",
	decal: {
		edit: {text: "編輯", tooltip: "編輯此文"}
	}
};

config.messages.listView = {
	tiddlerTooltip: "檢視全文",
	previewUnavailable: "(無法預覽)"
};

config.messages.dates.months = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"];
config.messages.dates.days = ["日", "一","二", "三", "四", "五", "六"];
config.messages.dates.shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
config.messages.dates.shortDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
// suffixes for dates, eg "1st","2nd","3rd"..."30th","31st"
config.messages.dates.daySuffixes = ["st","nd","rd","th","th","th","th","th","th","th",
		"th","th","th","th","th","th","th","th","th","th",
		"st","nd","rd","th","th","th","th","th","th","th",
		"st"];
config.messages.dates.am = "上午";
config.messages.dates.pm = "下午";

merge(config.views.wikified.tag,{
	labelNoTags: "未設標籤",
	labelTags: "標籤: ",
	openTag: "開啟標籤 '%0'",
	tooltip: "顯示標籤為 '%0' 的文章",
	openAllText: "開啟以下所有文章",
	openAllTooltip: "開啟以下所有文章",
	popupNone: "僅此文標籤為 '%0'"});

merge(config.views.wikified,{
	defaultText: "",
	defaultModifier: "(未完成)",
	shadowModifier: "(預設)",
	dateFormat: "YYYY年0MM月0DD日",
	createdPrompt: "建立於"});

merge(config.views.editor,{
	tagPrompt: "設定標籤之間以空白區隔,[[標籤含空白時請使用雙中括弧]],或點選現有之標籤加入",
	defaultText: ""});

merge(config.views.editor.tagChooser,{
	text: "標籤",
	tooltip: "點選現有之標籤加至本文章",
	popupNone: "未設定標籤",
	tagTooltip: "加入標籤 '%0'"});

merge(config.messages,{
	sizeTemplates:
		[
		{unit: 1024*1024*1024, template: "%0\u00a0GB"},
		{unit: 1024*1024, template: "%0\u00a0MB"},
		{unit: 1024, template: "%0\u00a0KB"},
		{unit: 1, template: "%0\u00a0B"}
		]});

merge(config.macros.search,{
	label: " 尋找",
	prompt: "搜尋本 Wiki",
	accessKey: "F",
	successMsg: " %0 篇符合條件: %1",
	failureMsg: " 無符合條件: %0"});

merge(config.macros.tagging,{
	label: "引用標籤:",
	labelNotTag: "無引用標籤",
	tooltip: "列出標籤為 '%0' 的文章"});

merge(config.macros.timeline,{
	dateFormat: "YYYY年0MM月0DD日"});

merge(config.macros.allTags,{
	tooltip: "顯示文章- 標籤為'%0'",
	noTags: "沒有標籤"});

config.macros.list.all.prompt = "依字母排序";
config.macros.list.missing.prompt = "被引用且內容空白的文章";
config.macros.list.orphans.prompt = "未被引用的文章";
config.macros.list.shadowed.prompt = "這些隱藏的文章已預設內容";
config.macros.list.touched.prompt = "自下載或新增後被修改過的文章"; 

merge(config.macros.closeAll,{
	label: "全部關閉",
	prompt: "關閉所有開啟中的 tiddler (編輯中除外)"});

merge(config.macros.permaview,{
	label: "引用連結",
	prompt: "可存取現有開啟之文章的連結位址"});

merge(config.macros.saveChanges,{
	label: "儲存變更",
	prompt: "儲存所有文章,產生新的版本",
	accessKey: "S"});

merge(config.macros.newTiddler,{
	label: "新增文章",
	prompt: "新增 tiddler",
	title: "新增文章",
	accessKey: "N"});

merge(config.macros.newJournal,{
	label: "新增日誌",
	prompt: "新增 jounal",
	accessKey: "J"});

merge(config.macros.options,{
	wizardTitle: "增訂的進階選項",
	step1Title: "增訂的選項儲存於瀏覽器的 cookies",
	step1Html: "<input type='hidden' name='markList'></input><br><input type='checkbox' checked='false' name='chkHidden'>顯示被隱藏之選項</input>",
	unknownDescription: "//(隱藏)//",
	listViewTemplate: {
		columns: [
			{name: 'Option', field: 'option', title: "選項", type: 'String'},
			{name: 'Description', field: 'description', title: "說明", type: 'WikiText'},
			{name: 'Name', field: 'name', title: "名稱", type: 'String'}
			],
		rowClasses: [
			{className: 'lowlight', field: 'lowlight'} 
			]}
	});

merge(config.macros.plugins,{
	wizardTitle: "擴充套件管理",
	step1Title: "- 已載入之套件",
	step1Html: "<input type='hidden' name='markList'></input>", // DO NOT TRANSLATE
	skippedText: "(此套件因剛加入,故尚未執行)",
	noPluginText: "未安裝套件",
	confirmDeleteText: "確認是否刪除此文章:\n\n%0",
	removeLabel: "移除 systemConfig 標籤",
	removePrompt: "移除 systemConfig 標籤",
	deleteLabel: "刪除",
	deletePrompt: "永遠刪除所選",

	listViewTemplate : {
		columns: [
			{name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
			{name: 'Tiddler', field: 'tiddler', title: "套件", type: 'Tiddler'},
			{name: 'Size', field: 'size', tiddlerLink: 'size', title: "大小", type: 'Size'},
			{name: 'Forced', field: 'forced', title: "強制執行", tag: 'systemConfigForce', type: 'TagCheckbox'},
			{name: 'Disabled', field: 'disabled', title: "停用", tag: 'systemConfigDisable', type: 'TagCheckbox'},
			{name: 'Executed', field: 'executed', title: "已載入", type: "Boolean", trueText: "是", falseText: "否"},
			{name: 'Startup Time', field: 'startupTime', title: "載入時間", type: 'String'},
			{name: 'Error', field: 'error', title: "載入狀態", type: 'Boolean', trueText: "錯誤", falseText: "正常"},
			{name: 'Log', field: 'log', title: "紀錄", type: 'StringList'}
			],
		rowClasses: [
			{className: 'error', field: 'error'},
			{className: 'warning', field: 'warning'}
			]}
	});

merge(config.macros.toolbar,{
	moreLabel: "其他",
	morePrompt: "顯示更多工具命令"});
	
merge(config.macros.refreshDisplay,{
	label: "刷新",
	prompt: "刷新此 TiddlyWiki 顯示"
	});
	
merge(config.macros.importTiddlers,{
	readOnlyWarning: "TiddlyWiki 於唯讀模式下,不支援導入文章。請由本機(file://)開啟 TiddlyWiki 文件",
	wizardTitle: "自其他檔案或伺服器導入文章",
	step1Title: "步驟一:指定伺服器或來源文件",
	step1Html: "指定伺服器類型:<select name='selTypes'><option value=''>選取...</option></select><br>請輸入網址或路徑:<input type='text' size=50 name='txtPath'><br>...或選擇來源文件:<input type='file' size=50 name='txtBrowse'><br><hr>...或選擇指定的饋入來源:<select name='selFeeds'><option value=''>選取...</option></select>",
	openLabel: "開啟",
	openPrompt: "開啟檔案或",
	openError: "讀取來源文件時發生錯誤",
	statusOpenHost: "正與伺服器建立連線",
	statusGetWorkspaceList: "正在取得可用之文章清單",
	step2Title: "步驟二:選擇工作區",
	step2Html: "輸入工作區名稱:<input type='text' size=50 name='txtWorkspace'><br>...或選擇工作區:<select name='selWorkspace'><option value=''>選取...</option></select>",
	cancelLabel: "取消",
	cancelPrompt: "取消本次導入動作",
	statusOpenWorkspace: "正在開啟工作區",
	statusGetTiddlerList: "正在取得可用之文章清單",
	step3Title: "步驟三:選擇欲導入之文章",
	step3Html: "<input type='hidden' name='markList'></input><br><input type='checkbox' checked='true' name='chkSync'>保持這些文章與伺服器的連結,便於同步後續的變更。</input><br><input type='checkbox' name='chkSave'>儲存此伺服器的詳細資訊於標籤為 'systemServer' 的文章名為:</input> <input type='text' size=25 name='txtSaveTiddler'>", 
	importLabel: "導入",
	importPrompt: "導入所選文章",
	confirmOverwriteText: "確定要覆寫這些文章:\n\n%0",
	step4Title: "步驟四:正在導入%0 篇文章",
	step4Html: "<input type='hidden' name='markReport'></input>", // DO NOT TRANSLATE
	step5Title: "步驟五:導入完成",
	step5Html: "所選文章已導入",
	doneLabel: "完成",
	donePrompt: "關閉",
	systemServerNamePattern: "%2 位於 %1",
	systemServerNamePatternNoWorkspace: "%1",
	confirmOverwriteSaveTiddler: "此 tiddler '%0' 已經存在。點擊「確定」以伺服器上料覆寫之,或「取消」不變更後離開",
	serverSaveTemplate: "|''Type:''|%0|\n|''網址:''|%1|\n|''工作區:''|%2|\n\n此文為自動產生紀錄伺服器之相關資訊。",
	serverSaveModifier: "(系統)",

	listViewTemplate: {
		columns: [
			{name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'},
			{name: 'Tiddler', field: 'tiddler', title: "文章", type: 'Tiddler'},
			{name: 'Size', field: 'size', tiddlerLink: 'size', title: "大小", type: 'Size'},
			{name: 'Tags', field: 'tags', title: "標籤", type: 'Tags'}
			],
		rowClasses: [
			]}
	});

merge(config.macros.sync,{
	listViewTemplate: {
		columns: [
			{name: 'Selected', field: 'selected', rowName: 'title', type: 'Selector'},
			{name: 'Tiddler', field: 'tiddler', title: "文章", type: 'Tiddler'},
			{name: 'Server Type', field: 'serverType', title: "伺服器類型", type: 'String'},
			{name: 'Server Host', field: 'serverHost', title: "伺服器主機", type: 'String'},
			{name: 'Server Workspace', field: 'serverWorkspace', title: "伺服器工作區", type: 'String'},
			{name: 'Status', field: 'status', title: "同步情形", type: 'String'},
			{name: 'Server URL', field: 'serverUrl', title: "伺服器網址", text: "View", type: 'Link'}
			],
		rowClasses: [
			],
		buttons: [
			{caption: "同步更新這些文章", name: 'sync'}
			]},
	wizardTitle: "將你的資料內容與外部伺服器與檔案同步",
	step1Title: "選擇欲同步的文章",
	step1Html: '<input type="hidden" name="markList"></input>', // DO NOT TRANSLATE
	syncLabel: "同步",
	syncPrompt: "同步更新這些文章",
	hasChanged: "已更動",
	hasNotChanged: "未更動",
	syncStatusList: {
		none: {text: "...", color: "none"},
		changedServer: {text: "伺服器資料已更動", color: "#80ff80"},
		changedLocally: {text: "本機資料已更動", color: "#80ff80"},
		changedBoth: {text: "已同時更新本機與伺服器上的資料", color: "#ff8080"},
		notFound: {text: "伺服器無此資料", color: "#ffff80"},
		putToServer: {text: "已儲存更新資料至伺服器", color: "#ff80ff"},
		gotFromServer: {text: "已從伺服器擷取更新資料", color: "#80ffff"}
		}
	});

merge(config.macros.viewDetails,{
	label: "...",
	prompt: "顯示此文章之詳細資訊",
	hideLabel: "(隱藏詳細資訊)",
	hidePrompt: "隱藏此詳細資訊面板",
	emptyDetailsText: "此文章沒有擴充欄位",
	listViewTemplate: {
		columns: [
			{name: 'Field', field: 'field', title: "欄位", type: 'String'},
			{name: 'Value', field: 'value', title: "內容", type: 'String'}
			],
		rowClasses: [
			],
		buttons: [
			]}
	});

merge(config.macros.annotations,{
	});

merge(config.commands.closeTiddler,{
	text: "關閉",
	tooltip: "關閉本文"});

merge(config.commands.closeOthers,{
	text: "關閉其他",
	tooltip: "關閉其他文章"});

merge(config.commands.editTiddler,{
	text: "編輯",
	tooltip: "編輯本文",
	readOnlyText: "檢視",
	readOnlyTooltip: "檢視本文之原始內容"});

merge(config.commands.saveTiddler,{
	text: "完成",
	tooltip: "確定修改"});

merge(config.commands.cancelTiddler,{
	text: "取消",
	tooltip: "取消修改",
	warning: "確定取消對 '%0' 的修改嗎?",
	readOnlyText: "完成",
	readOnlyTooltip: "返回正常顯示模式"});

merge(config.commands.deleteTiddler,{
	text: "刪除",
	tooltip: "刪除文章",
	warning: "確定刪除 '%0'?"});

merge(config.commands.permalink,{
	text: "引用連結",
	tooltip: "本文引用連結"});

merge(config.commands.references,{
	text: "引用",
	tooltip: "引用本文的文章",
	popupNone: "本文未被引用"});

merge(config.commands.jump,{
	text: "捲頁",
	tooltip: "捲頁至其他已開啟的文章"});

merge(config.commands.syncing,{
	text: "同步",
	tooltip: "本文章與伺服器或其他外部檔案的同步資訊",
	currentlySyncing: "<div>同步類型:<span class='popupHighlight'>'%0'</span></div><div>伺服器:<span class='popupHighlight'>%1</span></div><div>工作區:<span class='popupHighlight'>%2</span></div>",
	notCurrentlySyncing: "無進行中的同步動作",
	captionUnSync: "停止同步此文章",
	chooseServer: "與其他伺服器同步此文章:",
	currServerMarker: "● ",
	notCurrServerMarker: "  "});

merge(config.shadowTiddlers,{
	DefaultTiddlers: "GettingStarted",
	MainMenu: "[[使用說明|GettingStarted]]",
	SiteTitle: "我的 TiddlyWiki",
	SiteSubtitle: "一個可重複使用的個人網頁式筆記本",
	SiteUrl: 'http://www.tiddlywiki.com/',
	SideBarOptions: '<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal " YYYY年0MM月0DD日">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel  "偏好設定 »" "變更 TiddlyWiki 選項">>',
	SideBarTabs: '<<tabs txtMainTab "最近更新" "依更新日期排序" TabTimeline "全部" "所有文章" TabAll "分類" "所有標籤" TabTags "更多" "其他" TabMore>>',
	TabTimeline: '<<timeline>>',
	TabAll: '<<list all>>',
	TabTags: '<<allTags excludeLists>>',
	TabMore: '<<tabs txtMoreTab "未完成" "內容空白的文章" TabMoreMissing "未引用" "未被引用的文章" TabMoreOrphans "預設文章" "已預設內容的隱藏文章" TabMoreShadowed>>',
	TabMoreMissing: '<<list missing>>',
	TabMoreOrphans: '<<list orphans>>',
	TabMoreShadowed: '<<list shadowed>>',
	PluginManager: '<<plugins>>', 
	ImportTiddlers: '<<importTiddlers>>'});

merge(config.annotations,{
	AdvancedOptions: "此預設文章可以存取一些進階選項。",
	ColorPalette: "此預設文章裡的設定值,將決定 ~TiddlyWiki 使用者介面的配色。",
	DefaultTiddlers: "當 ~TiddlyWiki 在瀏覽器中開啟時,此預設文章裡列出的文章,將被自動顯示。",
	EditTemplate: "此預設文章裡的 HTML template 將決定文章進入編輯模式時的顯示版面。",
	GettingStarted: "此預設文章提供基本的使用說明。",
	ImportTiddlers: "此預設文章提供存取導入中的文章。",
	MainMenu: "此預設文章的內容,為於螢幕左側主選單的內容",
	OptionsPanel: "此預設文章的內容,為於螢幕右側副選單中的選項面板裡的內容",
	PageTemplate: "此預設文章裡的 HTML template 決定的 ~TiddlyWiki 主要的版面配置",
	PluginManager: "此預設文章提供存取套件管理員",
	SideBarOptions: "此預設文章的內容,為於螢幕右側副選單中選項面板裡的內容",
	SideBarTabs: "此預設文章的內容,為於螢幕右側副選單中的頁籤面板裡的內容",
	SiteSubtitle: "此預設文章的內容為頁面的副標題",
	SiteTitle: "此預設文章的內容為頁面的主標題",
	SiteUrl: "此預設文章的內容須設定為文件發佈時的完整網址",
	StyleSheetColours: "此預設文章內含的 CSS 規則,為相關的頁面元素的配色",
	StyleSheet: "此預設文章內容可包含 CSS 規則",
	StyleSheetLayout: "此預設文章內含的 CSS 規則,為相關的頁面元素的版面配置",
	StyleSheetLocale: "此預設文章內含的 CSS 規則,可依翻譯語系做適當調整",
	StyleSheetPrint: "此預設文章內含的 CSS 規則,用於列印時的樣式",
	TabAll: "此預設文章的內容,為於螢幕右側副選單中的「全部」頁籤的內容",
	TabMore: "此預設文章的內容,為於螢幕右側副選單中的「更多」頁籤的內容",
	TabMoreMissing: "此預設文章的內容,為於螢幕右側副選單中的「未完成」頁籤的內容",
	TabMoreOrphans: "此預設文章的內容,為於螢幕右側副選單中的「未引用」頁籤的內容",
	TabMoreShadowed: "此預設文章的內容,為於螢幕右側副選單中的「預設文章」頁籤的內容",
	TabTags: "此預設文章的內容,為於螢幕右側副選單中的「分類」頁籤的內容",
	TabTimeline: "此預設文章的內容,為於螢幕右側副選單中的「最近更新」頁籤的內容",
	ViewTemplate: "此預設文章裡的 HTML template 決定文章顯示的樣子"
	});
/*}}}*/
帳號:<<option txtUserName>>
密碼:<<option pasUploadPassword>>