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]];}
.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)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}
body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}
h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}
hr {height:1px;}
a {text-decoration:none;}
dt {font-weight:bold;}
ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}
.txtOptionInput {width:11em;}
#contentWrapper .chkOptionInput {border:0;}
.externalLink {text-decoration:underline;}
.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}
.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}
/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}
#mainMenu .tiddlyLinkExisting,
#mainMenu .tiddlyLinkNonExisting,
#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}
.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}
.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}
#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}
#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}
.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}
#messageArea {position: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;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}
.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}
.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}
#contentWrapper {display:block;}
#splashScreen {display:none;}
#displayArea {margin:1em 17em 0em 14em;}
.toolbar {text-align:right; font-size:.9em;}
.tiddler {padding:1em 1em 0em 1em;}
.missing .viewer,.missing .title {font-style:italic;}
.title {font-size:1.6em; font-weight:bold;}
.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}
.tiddler .button {padding:0.2em 0.4em;}
.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}
.footer {font-size:.9em;}
.footer li {display:inline;}
.annotation {padding:0.5em; margin:0.5em;}
* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}
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;}
.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which 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>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<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 > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser
Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)
<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations
----
Also see AdvancedOptions
[[Summary]]
[[Links]]
[[Rationale]]
[[Use Cases]]
[[Scope]]
[[Design]]
[[Implementation]]
[[Unresolved Issues]]
/***
|''Name:''|GenerateRssHijack|
|''Description:''|Generate an RSSFeed with plaintext, html and TiddlyWiki content|
|''Version:''|0.1.4|
|''Date:''|Oct 23, 2006|
|''Source:''|http://tiddlywiki.bidix.info/#GenerateRssHijack|
|''Documentation:''|http://tiddlywiki.bidix.info/#GenerateRssHijackDoc|
|''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:''|none|
|''Require:''|none|
***/
//{{{
version.extensions.GenerateRssHijack= {
major: 0, minor: 1, revision: 3,
date: new Date(2006,9,29),
source: 'http://tiddlywiki.bidix.info/#GenerateRssHijack',
documentation: 'http://tiddlywiki.bidix.info/#GenerateRssHijackDoc',
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'
};
// Return the tiddlers as a sorted array
TiddlyWiki.prototype.getTiddlersTaggedWith = function(field,includeTag)
{
var results = [];
this.forEachTiddler(function(title,tiddler) {
if(tiddler.tags.find(includeTag) != null)
results.push(tiddler);
});
if(field)
results.sort(function (a,b) {if(a[field] == b[field]) return(0); else return (a[field] < b[field]) ? -1 : +1; });
return results;
}
// generate RSS file with tiddlers tagged with toRSS
window.generateRss_ori = window.generateRss;
window.generateRss = function ()
{
var s = [];
var d = new Date();
var u = store.getTiddlerText("SiteUrl",null);
// Assemble the header
s.push("<" + "?xml version=\"1.0\"" + " encoding='UTF-8'" + "?>");
s.push("<rss version=\"2.0\" xmlns:tiddlywiki=\"http://tiddlywiki.bidix.info/#TiddlyWikiNamespace\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">");
s.push("<channel>");
s.push("<title>" + wikifyPlain("SiteTitle").htmlEncode() + "</title>");
if(u)
s.push("<link>" + u.htmlEncode() + "</link>");
s.push("<description>" + wikifyPlain("SiteSubtitle").htmlEncode() + "</description>");
s.push("<language>en-us</language>");
s.push("<copyright>Copyright " + d.getFullYear() + " " + config.options.txtUserName.htmlEncode() + "</copyright>");
s.push("<pubDate>" + d.toGMTString() + "</pubDate>");
s.push("<lastBuildDate>" + d.toGMTString() + "</lastBuildDate>");
s.push("<docs>http://blogs.law.harvard.edu/tech/rss</docs>");
s.push("<generator>TiddlyWiki " + version.major + "." + version.minor + "." + version.revision + "</generator>");
// The body
var tiddlers = store.getTiddlersTaggedWith("modified","toRSS");
var n = config.numRssItems > tiddlers.length ? 0 : tiddlers.length-config.numRssItems;
for (var t=tiddlers.length-1; t>=n; t--)
s.push(tiddlers[t].saveToRss(u));
// And footer
s.push("</channel>");
s.push("</rss>");
// Save it all
return s.join("\n");
}
Tiddler.prototype.getAsInnerHTML = function() {
var wrapper = createTiddlyElement(document.body,"span",null,null);
wikify(this.text,wrapper ,null,this);
var text = wrapper.innerHTML;
wrapper.parentNode.removeChild(wrapper);
//replace tddlylink with externallink
var u = store.getTiddlerText("SiteUrl",null);
var pattern;
var substitution;
if ((version.major = 2) && (version.minor > 0)) {
pattern = /<a\s+tiddlylink="([^"]+)"\s+refresh="link"\s+class=\"([^"]+)\"\s+title=\"([^"]+)\"\s+href="([^"]+)"/mg;
substitution = "<a href=\""+u+"#[[$1]]\" class=\"$2\" title=\"$3\" tiddlylink=\"$1\" refresh=\"link\" ";
}
else {
pattern = /<a\s+tiddlylink="([^"]+)"\s+refresh="link"\s+title="([^"]+)"\s+href="([^"]+)"/mg;
substitution = "<a tiddlylink=\"$1\" refresh=\"link\" title=\"$2\" href=\""+u+"#[[$1]]\"";
}
text = text.replace(pattern, substitution);
return text;
};
Tiddler.prototype.saveToRss = function(url)
{
var s = [];
s.push("<item>");
s.push("<title>" + this.title.htmlEncode() + "</title>");
//plain text
s.push("<description>" + this.text.replace(regexpNewLine,"<br />").htmlEncode() + "</description>");
// html text
s.push("<content:encoded><![CDATA[ " + this.getAsInnerHTML() +"]]></content:encoded>");
// tiddler
s.push("<tiddlywiki:title>" + this.title.htmlEncode() + "</tiddlywiki:title>");
s.push("<tiddlywiki:wikitext>" + this.text.htmlEncode() + "</tiddlywiki:wikitext>");
s.push("<tiddlywiki:modifier>" + this.modifier.htmlEncode() + "</tiddlywiki:modifier>");
s.push("<tiddlywiki:modified>" + this.modified.convertToYYYYMMDDHHMM() + "</tiddlywiki:modified>");
s.push("<tiddlywiki:created>" + this.created.convertToYYYYMMDDHHMM() + "</tiddlywiki:created>");
//s.push("<tiddlywiki:links>" + this.text.htmlEncode() + "</tiddlywiki:links>");
s.push("<tiddlywiki:tags>" + this.getTags().htmlEncode() + "</tiddlywiki:tags>");
for(var t=0; t<this.tags.length; t++)
s.push("<category>" + this.tags[t] + "</category>");
s.push("<link>" + url + "#" + encodeURIComponent(String.encodeTiddlyLink(this.title)) + "</link>");
s.push("<pubDate>" + this.modified.toGMTString() + "</pubDate>");
s.push("</item>");
return(s.join("\n"));
}
//}}}
Implementation ''steps'' and ''considerations''.
Type the text for 'InterfaceOptions'
The list of ~URLs that do not yet exist. A specification must be associated to at least one URL. When the specification is implemented, bytes can be accessed with these URL and they are removed from this list.
The liste ~URLs of interest to the specifications, including email addresses of participants or irc channels.
[[Summary]]
[[Links]]
[[Rationale]]
[[Use Cases]]
[[Scope]]
[[Design]]
[[Implementation]]
[[Unresolved Issues]]
[[Scrapbook|scrapbook/tree]]
/***
|''Name:''|RSSReaderPlugin|
|''Description:''|This plugin provides a RSSReader for TiddlyWiki|
|''Version:''|0.3.0|
|''Date:''|Aug 24, 2006|
|''Source:''|http://tiddlywiki.bidix.info/#RSSReaderPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#RSSReaderPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''Credit:''|BramChen for RssNewsMacro|
|''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:''|none|
|''Require:''|none|
***/
//{{{
version.extensions.RSSReaderPlugin = {
major: 0, minor: 3, revision: 0,
date: new Date("Aug 24, 2006"),
author: "BidiX",
credit: "BramChen for RssNewsMacro",
source: "http://TiddlyWiki.bidix.info/#RSSReaderPlugin",
documentation : "http://TiddlyWiki.bidix.info/#RSSReaderPluginDoc",
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.macros.rssReader = {
dateFormat: "DDD, DD MMM YYYY",
itemStyle: "display: block;border: 1px solid black;padding: 5px;margin: 5px;", //useed '@@'+itemStyle+itemText+'@@'
msg:{
permissionDenied: "Permission to read preferences was denied.",
noRSSFeed: "No RSS Feed at this address %0",
urlNotAccessible: " Access to %0 is not allowed"
},
cache: [], // url => request
desc: "noDesc",
// feedURL: "",
place:"",
handler: function(place,macroName,params,wikifier,paramString,tiddler){
var desc = params[0];
var feedURL = params[1];
// var toFilter = (params[2] ? params[2] : false);
var toFilter = false;
var filterString;
if (params[2] != undefined) {
toFilter = true;
if (params[2].match(/\w+/))
filterString = params[2];
else
filterString = tiddler.title;
}
var place = createTiddlyElement(place, "div", "RSSReader");
wikify("^^<<rssFeedUpdate "+feedURL+" [[" + tiddler.title + "]]>>^^\n",place);
if (this.cache[feedURL]) {
this.processResponse(this.cache[feedURL], feedURL, place, desc, toFilter, filterString);
}
else {
this.asyncGet(feedURL, place, desc, toFilter, filterString);
}
},
asyncGet: function (feedURL, place, desc, toFilter, filterString){
var xmlhttp;
try {xmlhttp=new XMLHttpRequest();}
catch (e) {
try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {
try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) { displayMessage(e.description?e.description:e.toString());}
}
}
if (!xmlhttp){
return;
}
if (window.netscape){
try {
if (document.location.protocol.indexOf("http") == -1) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
}
}
catch (e) { displayMessage(e.description?e.description:e.toString()); }
}
xmlhttp.onreadystatechange=function (){
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200 || xmlhttp.status===0) {
config.macros.rssReader.processResponse(xmlhttp, feedURL, place, desc, toFilter, filterString);
}
else {
displayMessage("Problem retrieving XML data:" + xmlhttp.statusText);
}
}
};
try {
xmlhttp.open("GET",feedURL,true);
if (config.browser.isIE) {
xmlhttp.send();
}
else {
xmlhttp.send(null);
}
}
catch (e) {
wikify(e.toString()+this.urlNotAccessible.format([feedURL]), place);
}
},
processResponse: function(xmlhttp, feedURL, place, desc, toFilter, filterString){
if (window.netscape){
try {
if (document.location.protocol.indexOf("http") == -1) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
}
}
catch (e) { displayMessage(e.description?e.description:e.toString()); }
}
if (xmlhttp.responseXML){
this.cache[feedURL] = xmlhttp;
this.genRssNews(xmlhttp.responseXML, place, feedURL, desc, toFilter, filterString);
}
else {
var dom = (new DOMParser()).parseFromString(xmlhttp.responseText, "text/xml");
if (dom) {
this.cache[feedURL] = xmlhttp;
this.genRssNews(dom, place, feedURL, desc, toFilter, filterString);
}
else {
wikify("<html>"+xmlhttp.responseText+"</html>", place);
displayMessage(this.msg.noRSSFeed.format([feedURL]));
}
}
},
genRssNews: function(xml, place, feedURL, desc, toFilter, filterString){
// Channel
var chanelNode = xml.getElementsByTagName('channel').item(0);
var chanelTitleElement = (chanelNode ? chanelNode.getElementsByTagName('title').item(0) : null);
var chanelTitle = "";
if ((chanelTitleElement) && (chanelTitleElement.firstChild)) chanelTitle = chanelTitleElement.firstChild.nodeValue;
var chanelLinkElement = (chanelNode ? chanelNode.getElementsByTagName('link').item(0) : null);
var chanelLink = "";
if (chanelLinkElement) chanelLink = chanelLinkElement.firstChild.nodeValue;
var titleTxt = "!![["+chanelTitle+"|"+chanelLink+"]]\n";
var title = createTiddlyElement(place,"div",null,"ChanelTitle",null);
wikify(titleTxt,title);
// ItemList
var itemList = xml.getElementsByTagName('item');
var article = createTiddlyElement(place,"ul",null,null,null);
var lastDate;
var re;
if (toFilter)
re = new RegExp(filterString.escapeRegExp());
for (var i=0; i<itemList.length; i++){
var titleElm = itemList[i].getElementsByTagName('title').item(0);
var titleText = (titleElm ? titleElm.firstChild.nodeValue : '');
if (toFilter && ! titleText.match(re)) {
continue;
}
var descText = '';
var isWikitext = false;
var descElem = itemList[i].getElementsByTagName('wikitext').item(0);
if (descElem){
try{
isWikitext = true;
descText = "\n"+descElem.firstChild.nodeValue;}
catch(e){}
}
else {
descElem = itemList[i].getElementsByTagName('encoded').item(0);
if (descElem){
try{descText = descElem.firstChild.nodeValue;}
catch(e){}
descText = "<html>"+descText+"</html>";
}
else {
descElem = itemList[i].getElementsByTagName('description').item(0);
if (descElem){
try{descText = descElem.firstChild.nodeValue;}
catch(e){}
descText = descText.replace(/<br \/>/g,'\n');
if (desc == "asHtml")
descText = "<html>"+descText+"</html>";
}
}
}
var linkElm = itemList[i].getElementsByTagName("link").item(0);
var linkURL = linkElm.firstChild.nodeValue;
var pubElm = itemList[i].getElementsByTagName('pubDate').item(0);
var pubDate;
if (!pubElm) {
pubElm = itemList[i].getElementsByTagName('date').item(0); // for del.icio.us
if (pubElm) {
pubDate = pubElm.firstChild.nodeValue;
pubDate = this.formatDateString(this.dateFormat, pubDate);
}
else {
pubDate = '0';
}
}
else {
pubDate = (pubElm ? pubElm.firstChild.nodeValue : 0);
pubDate = this.formatString(this.dateFormat, pubDate);
}
titleText = titleText.replace(/\[|\]/g,'');
var rssText = '** '+'[[' + titleText + '|' + linkURL + ']]' + '\n' ;
if ((desc != "noDesc") && descText){
if (version.extensions.nestedSliders){
rssText = rssText.replace(/\n/g,' ');
descText = '+++[...]\n'
+(isWikitext ? '\n<<rssFeedImportTiddler '+ feedURL + ' [['+titleText+']]>>':'')
+'@@'+this.itemStyle+descText+'\n@@\n'
+'===';
}
rssText = rssText + descText + '\n\n';
}
var story;
if ((lastDate != pubDate) && ( pubDate != '0')) {
story = createTiddlyElement(article,"li",null,"RSSItem",pubDate);
lastDate = pubDate;
}
else {
lastDate = pubDate;
}
story = createTiddlyElement(article,"div",null,"RSSItem",null);
wikify(rssText,story);
}
},
formatString: function(template, theDate){
var dateString = new Date(theDate);
template = template.replace(/hh|mm|ss/g,'');
return dateString.formatString(template);
},
formatDateString: function(template, theDate){
var dateString = new Date(theDate.substr(0,4), theDate.substr(5,2) - 1, theDate.substr(8,2)
/*, theDate.substr(11,2), theDate.substr(14,2), theDate.substr(17,2)*/
);
return dateString.formatString(template);
}
};
//}}}
//{{{
config.macros.rssFeedUpdate = {
label: "Update",
prompt: "Clear the cache and redisplay this RssFeed",
handler: function(place,macroName,params) {
var feedURL = params[0];
var tiddlerTitle = params[1];
createTiddlyButton(place, this.label, this.prompt,
function () {
if (config.macros.rssReader.cache[feedURL]) {
config.macros.rssReader.cache[feedURL] = null;
//story.refreshTiddler(tiddlerTitle,null, true);
}
story.refreshTiddler(tiddlerTitle,null, true);
return false;});
}
};
//}}}
//{{{
config.macros.rssFeedImportTiddler = {
label: "Import",
prompt: "Import this tiddler in this TiddlyWiki",
askReplaceMsg: "Tiddler already exists, replace it ?",
handler: function(place,macroName,params) {
var feedUrl = params[0];
var tiddlerTitle = params[1];
createTiddlyButton(place, this.label, this.prompt,
function () {
if (feedUrl && config.macros.rssReader.cache[feedUrl]) {
var tiddler = config.macros.rssFeedImportTiddler.parseRssNews(config.macros.rssReader.cache[feedUrl].responseXML, tiddlerTitle);
if (tiddler && (! store.getTiddler(tiddlerTitle) || confirm(config.macros.rssFeedImportTiddler.askReplaceMsg))) {
store.addTiddler(tiddler);
store.notify(tiddler.title, true);
store.setDirty(true);
}
}
return false;});
},
// parse a RssFeed for retrieving a Tiddler with title
parseRssNews: function(xml, title) {
// ItemList
if (document.location.protocol.indexOf("http") == -1) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
}
var itemList = xml.getElementsByTagName('item');
for (var i=0; i<itemList.length; i++){
var titleElm = itemList[i].getElementsByTagName('title').item(0);
var titleText = titleElm.firstChild.nodeValue;
if (titleText == title) {
// <tiddlywiki:title>
// titleText
titleText = titleText.htmlDecode();
// <tiddlywiki:wikitext>
var elem = itemList[i].getElementsByTagName('wikitext').item(0);
var text = elem ? elem.firstChild.nodeValue.htmlDecode() : "";
// <tiddlywiki:modifier>
elem = itemList[i].getElementsByTagName('modifier').item(0);
var modifier = elem ? elem.firstChild.nodeValue : "";
// <tiddlywiki:modified>
elem = itemList[i].getElementsByTagName('modified').item(0);
var modified = elem ? Date.convertFromYYYYMMDDHHMM(elem.firstChild.nodeValue) : "";
// <tiddlywiki:created>
elem = itemList[i].getElementsByTagName('created').item(0);
var created = elem ? Date.convertFromYYYYMMDDHHMM(elem.firstChild.nodeValue) : "";
// <tiddlywiki:links>
// Links ?
// <tiddlywiki:tags>
elem = itemList[i].getElementsByTagName('tags').item(0);
var tags = elem ? elem.firstChild.nodeValue.htmlDecode() : "";
var tiddler = new Tiddler();
tiddler.assign(titleText,text,modifier,modified,tags,created);
return tiddler;
}
}
// not found
alert("Tiddler \[[" + title +"]] notFound.");
return null;
}
};
//}}}
''Why'' is this being defined?
''Limits'' of this spec application.
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
for poker-network backend
http://garden.dachary.org/empty.html
''What'' is being specified?
''Discuss'' problems and unresolved issues.
* texas hold'em style game
* 6 player positions (all Play)
* Hole cards are face up
* hand eval for each postion preflop
* hand eval for each position postflop
* hand eval for each position turn
* hand eval for each position river (should be one playe (100%)
/***
|''Name:''|WebDAVSavingPlugin|
|''Description:''|Saves on a WebDAV server without the need of any ServerSide script.<br>When TiddlyWiki is accessed over http, this plugin permits to save back to the server, using http PUT.|
|''Version:''|0.2.1|
|''Date:''|Apr 21, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#WebDAVSavingPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.WebDAVSavingPlugin = {
major: 0, minor: 2, revision: 1,
date: new Date("Apr 21, 2007"),
source: 'http://tiddlywiki.bidix.info/#WebDAVSavingPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
coreVersion: '2.2.0 (Beta 5)'
};
if (!window.bidix) window.bidix = {};
bidix.WebDAVSaving = {
orig_saveChanges: saveChanges,
defaultFilename: 'index.html',
messages: {
loadOriginalHttpDavError: "Original file can't be loaded",
optionsMethodError: "The OPTIONS method can't be used on this ressource : %0",
webDavNotEnabled: "WebDAV is not enabled on this ressource : %0",
notHTTPUrlError: "WebDAV saving can be used for http viewed TiddlyWiki only",
aboutToSaveOnHttpDav: 'About to save on %0 ...' ,
folderCreated: "Remote folder '%0' created"
}
};
// Save this tiddlywiki with the pending changes
saveChanges = function(onlyIfDirty,tiddlers)
{
var originalPath = document.location.toString();
if (originalPath.substr(0,5) == "file:")
return bidix.WebDAVSaving.orig_saveChanges(onlyIfDirty,tiddlers);
else
return bidix.WebDAVSaving.saveChanges(onlyIfDirty,tiddlers);
}
bidix.WebDAVSaving.saveChanges = function(onlyIfDirty,tiddlers)
{
var callback = function(status,params,original,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (!status)
displayMessage(bidix.WebDAVSaving.messages.optionsMethodError.format([url]));
else {
if (!xhr.getResponseHeader("DAV"))
alert(bidix.WebDAVSaving.messages.webDavNotEnabled.format([url]));
else
bidix.WebDAVSaving.doSaveChanges();
}
}
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
var originalPath = document.location.toString();
// Check we were loaded from a HTTP or HTTPS URL
if(originalPath.substr(0,4) != "http") {
alert(bidix.WebDAVSaving.messages.notHTTPUrlError);
return;
}
// is the server WebDAV enabled ?
var r = doHttp("OPTIONS",originalPath,null,null,null,null,callback,null,null);
if (typeof r == "string")
alert(r);
}
bidix.WebDAVSaving.doSaveChanges = function()
{
var callback = function(status,params,original,url,xhr) {
if (!status) {
alert(config.messages.loadOriginalHttpDavError);
return;
}
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.WebDAVSaving.mkbackupfolder(null,null,params,original,posDiv);
};
// get original
var originalPath = document.location.toString();
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + bidix.WebDAVSaving.defaultFilename;
displayMessage(bidix.WebDAVSaving.messages.aboutToSaveOnHttpDav.format([originalPath]));
doHttp("GET",originalPath,null,null,null,null,callback,originalPath,null);
};
bidix.WebDAVSaving.mkbackupfolder = function(root,dirs,url,original,posDiv) {
if (!root || !dirs) {
root = bidix.dirname(url);
if (config.options.txtBackupFolder == "")
dirs = null;
else
dirs = config.options.txtBackupFolder.split('/');
}
if (config.options.chkSaveBackups && dirs && (dirs.length > 0))
bidix.WebDAVSaving.mkdir(root,dirs.shift(),dirs,url,original,posDiv);
else
bidix.WebDAVSaving.saveBackup(url,original,posDiv);
};
bidix.WebDAVSaving.saveBackup = function(url,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if (!status) {
alert(config.messages.backupFailed);
return;
}
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
displayMessage(config.messages.backupSaved,url);
bidix.WebDAVSaving.saveRss(params[0],params[1],params[2]);
};
if(config.options.chkSaveBackups) {
var backupPath = getBackupPath(url);
bidix.httpPut(backupPath,original,callback,Array(url,original,posDiv));
} else {
bidix.WebDAVSaving.saveRss(url,original,posDiv);
}
}
bidix.WebDAVSaving.saveRss = function(url,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if (!status) {
alert(config.messages.rssFailed);
return;
}
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
displayMessage(config.messages.rssSaved,url);
bidix.WebDAVSaving.saveEmpty(params[0],params[1],params[2]);
};
if(config.options.chkGenerateAnRssFeed) {
var rssPath = url.substr(0,url.lastIndexOf(".")) + ".xml";
bidix.httpPut(rssPath,convertUnicodeToUTF8(generateRss()),callback,Array(url,original,posDiv));
} else {
bidix.WebDAVSaving.saveEmpty(url,original,posDiv);
}
}
bidix.WebDAVSaving.saveEmpty = function(url,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if (!status) {
alert(config.messages.emptyFailed);
return;
}
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
displayMessage(config.messages.emptySaved,url);
bidix.WebDAVSaving.saveMain(params[0],params[1],params[2]);
};
if(config.options.chkSaveEmptyTemplate) {
var emptyPath,p;
if((p = url.lastIndexOf("/")) != -1)
emptyPath = url.substr(0,p) + "/empty.html";
else
emptyPath = url + ".empty.html";
var empty = original.substr(0,posDiv[0] + startSaveArea.length) + original.substr(posDiv[1]);
bidix.httpPut(emptyPath,empty,callback,Array(url,original,posDiv));
} else {
bidix.WebDAVSaving.saveMain(url,original,posDiv);
}
}
bidix.WebDAVSaving.saveMain = function(url,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
displayMessage(config.messages.mainSaved,url);
store.setDirty(false);
} else
alert(config.messages.mainFailed);
};
// Save new file
var revised = updateOriginal(original,posDiv);
bidix.httpPut(url,revised,callback,null);
}
// asynchronous mkdir
bidix.WebDAVSaving.mkdir = function(root,dir,dirs,url,original,posDiv) {
var callback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (status == null) {
alert("Error in mkdir");
return;
}
if (xhr.status == httpStatus.ContentCreated) {
displayMessage(bidix.WebDAVSaving.messages.folderCreated.format([url]),url);
bidix.WebDAVSaving.mkbackupfolder(url,params[1],params[2],params[3],params[4]);
} else {
if (xhr.status == httpStatus.NotFound)
bidix.http('MKCOL',url,null,callback,params);
else
bidix.WebDAVSaving.mkbackupfolder(url,params[1],params[2],params[3],params[4]);
}
};
if (root.charAt(root.length) != '/')
root = root +'/';
bidix.http('HEAD',root+dir,null,callback,Array(root,dirs,url,original,posDiv));
}
bidix.httpPut = function(url,data,callback,params)
{
return bidix.http("PUT",url,data,callback,params);
}
bidix.http = function(type,url,data,callback,params)
{
var r = doHttp(type,url,data,null,null,null,callback,params,null);
if (typeof r == "string")
alert(r);
return r;
}
bidix.dirname = function (filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(0, lastpos);
} else {
return filePath.substring(0, filePath.lastIndexOf("\\"));
}
};
//}}}