Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}
h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}
.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}
.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}
.tabSelected{color:[[ColorPalette::PrimaryDark]];
background:[[ColorPalette::TertiaryPale]];
border-left:1px solid [[ColorPalette::TertiaryLight]];
border-top:1px solid [[ColorPalette::TertiaryLight]];
border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}
#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}
.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}
.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}
#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}
.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}
.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
.tiddler .defaultCommand {font-weight:bold;}
.shadow .title {color:[[ColorPalette::TertiaryDark]];}
.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}
.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}
.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}
.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}
.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}
.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}
.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}
.imageLink, #displayArea .imageLink {background:transparent;}
.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}
.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}
.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}
.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}
.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}
.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}
#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 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 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:0 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 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}
.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}
#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}
.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding: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 0;}
.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 0 0 0.5em;}
.tab {margin:0 0 0 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 0 14em;}
.toolbar {text-align:right; font-size:.9em;}
.tiddler {padding:1em 1em 0;}
.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:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}
.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}
.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}
.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}
.fieldsetFix {border:0; padding:0; margin: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;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}
.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<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='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser
Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])
<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]
----
Also see [[AdvancedOptions]]
/***
|''Name:''|SharedNotesPlugin|
|''Description:''|Share Tiddlers as a RSS feed|
|''Author:''|Osmosoft|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/SharedNotesPlugin/ |
|''Version:''|0.0.16|
|''Date:''|Nov 27, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.2.6|
!!Documentation
This plugin was developed for [[RippleRap|http://ripplerap.com]], and designed to be used in conjunction with the [[SharedNotesAdaptor]] and the [[SharedNotesFeedPlugin]] to share and exchange tiddlers across [[TiddlyWiki|TiddlyWikis]] using RSS.
!!Options
|<<option txtSharedNotesUserName>>|<<message config.optionsDesc.txtSharedNotesUserName>>|
|<<option chkSharedNotesPutEnabled>>|<<message config.optionsDesc.chkSharedNotesPutEnabled>>|
|<<option chkSharedNotesGetEnabled>>|<<message config.optionsDesc.chkSharedNotesGetEnabled>>|
!!Macros
<<PutNotes>>
<<PutNotes>>
<<GetNotes>>
<<GetNotes>>
<<PopulateNotes>>
<<PopulateNotes>>
<<KillMyNotes>>
<<KillMyNotes>>
!!Code
***/
//{{{
if(!version.extensions.SharedNotesPlugin){
version.extensions.SharedNotesPlugin = {installed:true};
config.optionsDesc.txtSharedNotesUserName = "UserName used on the server for shared notes";
config.options.txtSharedNotesUserName = "YourName";
config.optionsDesc.chkSharedNotesPutEnabled = "put shared note tiddlers to a server";
config.options.chkSharedNotesPutEnabled = true;
config.optionsDesc.chkSharedNotesGetEnabled = "get other people's shared note tiddlers";
config.options.chkSharedNotesGetEnabled = true;
config.macros.SharedNotes = {
tag: {
note: "notes", // notes made by this user
privated: "private", // notes made by this user not to be shared
discovered: "discovered_notes" // notes obtained from other users
},
busy: false,
messages: {
savingNotes: "saving notes on the server ..",
savingFailed: "unable to save notes on the server",
savedOK: "notes saved on the server",
putNotes: { button: "PUT NOTES", tip: 'Click here to post your shared notes' },
getNotes: { button: "GET NOTES", tip: 'Click here to download other people\'s shared notes' },
populateNotes: { button: "POPULATE NOTES", tip: 'Click here to find other people\'s notes' },
killMyNotes: { button: "KILL MY NOTES",
tip: 'Click here to delete all your notes from the file and on the server' }
},
help: {
missingUserName: 'SharedNotesUserName'
},
thistime: 0,
lasttime: 0,
adaptor: '',
session_prefix: '',
putNotes: function(){
var me = config.macros.SharedNotes;
if(!config.options.chkSharedNotesPutEnabled){
return false;
}
if(config.options.txtSharedNotesUserName=='YourName'){
if (me.help.missingUsername){
story.displayTiddler("top",me.help.missingUserName);
}
return false;
}
if(me.busy){
log("putNotes: busy");
return false;
}
me.busy = true;
me.thistime = new Date();
if (!me.putNotesCall()){
me.busy = false;
return false;
}
return false;
},
putNotesCall: function(){
log("putNotesCall");
var me = config.macros.SharedNotes;
var tiddlers = me.listSharedNoteTiddlers();
if (!tiddlers){
log("putNotesCall: no tiddlers to put");
return false;
}
var adaptor = config.adaptors[me.adaptor];
if (!adaptor){
log("putNotesCall: no adaptor for putting notes");
return false;
}
var callback = function(status,params,responseText,uri,xhr){
me.busy = false;
if(!status){
displayMessage(me.messages.savedFailed);
return;
}
displayMessage(me.messages.savedOK);
me.lasttime = me.thistime;
};
var text = config.macros.SharedNotesFeed.serialize(tiddlers,
{modifier:config.options.txtSharedNotesUserName,
session_prefix:me.session_prefix});
if (!adaptor.putRss(text,callback,me)){
return false;
}
displayMessage(me.messages.savingNotes);
return true;
},
listSharedNoteTiddlers: function(){
var me = config.macros.SharedNotes;
var putRequired = false;
var tiddlers = [];
store.forEachTiddler(function(title,t){
if((!t.isTagged(me.tag.privated))&&t.isTagged(me.tag.note)){
tiddlers.push(t);
log("testing:",t.title,t.created,t.modified,me.lasttime);
if(t.modified > me.lasttime){
putRequired = true;
}
}
});
if (!putRequired){
log("no tiddlers modified since last put ", me.lasttime);
return null;
}
log("tiddlers to put: " + tiddlers.length);
return tiddlers;
},
install: function(){
var me = config.macros.SharedNotes;
if(!me.feedListManager){
log('Installing feedlistmanager');
me.feedListManager = new FeedListManager();
}
},
populateNotes: function(){
log("config.macros.RippleRap.populateNotes");
var me = config.macros.SharedNotes;
if(!me.feedListManager) {
me.install();
}
me.feedListManager.populate(me.populateNotesCallback,me);
return false;
},
populateNotesCallback: function(me){
me.feedListManager.prioritise(config.options.txtSharedNotesUserName);
me.getNotes();
me.getNotes();
me.getNotes();
me.getNotes();
me.getNotes();
},
getNotes: function(){
log("config.macros.RippleRap.getNotes");
var me = config.macros.SharedNotes;
if(!me.feedListManager){
me.populateNotes();
return false;
}
var feed = me.feedListManager.nextUriObj();
if (feed){
me.getNotesByUri(feed.uri,feed.name);
}
return false;
},
getNotesByUri: function(uri,userName){
if(!config.options.chkSharedNotesGetEnabled){
return;
}
log("getNotesByUri:",uri,userName);
config.macros.importWorkspace.getTiddlers(uri,"sharednotes",null,null,
config.macros.SharedNotes.tagNoteAdaptorCallback,userName);
},
tagNoteAdaptorCallback: function(context,userParams){
log("tagNoteAdaptorCallback",context,userParams);
},
killMyNotes: function(){
var me = config.macros.SharedNotes;
me.busy = true;
var callback = function(status,params,responseText,uri,xhr){
me.busy = false;
if(!status){
displayMessage("unable to put empty feed");
return;
}
displayMessage("put empty feed");
me.lasttime = me.thistime;
};
var rss = me.serialize([],{});
var adaptor = config.adaptors[me.adaptor];
adaptor.putRss(rss,callback,me);
store.forEachTiddler(function(title,t){
if(t.isTagged(me.tag.note)){
store.deleteTiddler(t.title);
displayMessage("deleted "+t.title);
}
});
store.notifyAll();
refreshDisplay();
return false;
}
};
config.macros.PutNotes = {};
config.macros.PutNotes.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var me = config.macros.SharedNotes;
createTiddlyButton(place,me.messages.putNotes.button,me.messages.putNotes.tip,me.putNotes);
};
config.macros.GetNotes = {};
config.macros.GetNotes.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var me = config.macros.SharedNotes;
createTiddlyButton(place,me.messages.getNotes.button,me.messages.getNotes.tip,me.getNotes);
};
config.macros.PopulateNotes = {};
config.macros.PopulateNotes.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var me = config.macros.SharedNotes;
createTiddlyButton(place,me.messages.populateNotes.button,me.messages.populateNotes.tip,me.populateNotes);
};
config.macros.KillMyNotes = {};
config.macros.KillMyNotes.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var me = config.macros.SharedNotes;
createTiddlyButton(place,me.messages.killMyNotes.button,me.messages.killMyNotes.tip,me.killMyNotes);
};
} //# end of 'install only once'
//}}}
/***
|''Name:''|SharedNotesFeedPlugin|
|''Description:''|Generates RSS Feed from set of tiddlers|
|''Version:''|0.0.1|
|''Date:''|April 14, 2008|
|''Author:''|PaulDowney (psd (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/SharedNotesPlugin/ |
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
TBD: want to move to Atom, but RSS 2.0 is TiddlyWiki default and is now parsed by Confabb
***/
//{{{
if(!version.extensions.SharedNotesFeedPlugin){
version.extensions.SharedNotesFeedPlugin = {installed:true};
config.macros.SharedNotesFeed = {};
/*
* generate a RSS 2.0 feed from a list of tiddlers
*/
config.macros.SharedNotesFeed.serialize = function(tiddlers,options)
{
log("serialize", options);
var me = config.macros.SharedNotesFeed;
var s = [];
if(!options.now){
options.now = new Date();
}
if(!options.uri){
options.uri= store.getTiddlerText('SiteUrl');
}
s.push('<' + '?xml version="1.0"?' + '>');
s.push('<rss version="2.0" xmlns:tw="http://www.tiddlywiki.com/">');
s.push('<channel>');
s.push('<title' + '>' + wikifyPlain('SiteTitle').htmlEncode() + '</title' + '>');
s.push('<description>' + wikifyPlain('SiteSubtitle').htmlEncode() + '</description>');
s.push('<pubDate>' + options.now.toUTCString() + '</pubDate>');
s.push('<lastBuildDate>' + options.now.toUTCString() + '</lastBuildDate>');
s.push('<link>' + options.uri.htmlEncode() + '</link>');
s.push('<generator>TiddlyWiki ' + formatVersion() + ' (Notes)</generator>');
for (var i=0;i<tiddlers.length;i++) {
var t = tiddlers[i];
s.push(me.serializeTiddler(tiddlers[i],options));
}
s.push('</channel>');
s.push('</rss>');
return s.join('\n');
};
config.macros.SharedNotesFeed.serializeTiddler = function(tiddler,options)
{
var s = [];
var session_prefix = options.session_prefix || "";
s.push('<item>');
s.push('<title' + '>' + tiddler.title.htmlEncode() + '</title' + '>');
var modifier = options.modifier || tiddler.modifier;
s.push('<author>' + modifier + '</author>');
s.push('<description>' + wikifyStatic(tiddler.text).htmlEncode() + '</description>');
s.push('<tw:wikitext>' + tiddler.text.htmlEncode() + '</tw:wikitext>');
if(tiddler.fields['rr_session_id']){
s.push('<category>' + session_prefix + tiddler.fields['rr_session_id'].htmlEncode() + '</category>');
}
for(var i=0; i<tiddler.tags.length; i++)
s.push('<category>' + tiddler.tags[i].htmlEncode() + '</category>');
s.push('<pubDate>' + tiddler.modified.toUTCString() + '</pubDate>');
s.push('</item>');
return s.join('\n');
};
} //# end of 'install only once'
//}}}
/***
|''Name:''|SharedNotesAdaptor|
|''Description:''|Adaptor to parse SharedNotes RSS 2.0 feeds|
|''Author''|Paul Downey|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/SharedNotesPlugin/ |
|''Version:''|0.1.7|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.2.6|
***/
//{{{
if(!version.extensions.SharedNotesAdaptorPlugin) {
version.extensions.SharedNotesAdaptorPlugin = {installed:true};
function SharedNotesAdaptor()
{
this.host = null;
this.workspace = null;
return this;
}
/*
* parse SharedNotes RSS feed into tiddlers
*/
SharedNotesAdaptor.parse = function(responseText,modifier)
{
log("parsing RSS from ",modifier);
var tiddlers = [];
// hack to work around patchy support for namespaces
responseText = responseText.replace(/tw:wikitext/g,"wikitext");
var r = getXML(responseText);
if (!r){
log("no RSS XML to parse for ",modifier);
return tiddlers;
}
t = r.getElementsByTagName('item');
for(i=0;i<t.length;i++) {
var node = t[i];
var title = getFirstElementByTagNameValue(node, "title","");
var text = getFirstElementByTagNameValue(node, "wikitext","","http://tiddlywiki.com/");
//skip updating this tiddler is the user is currently editting.
var tid = story.getTiddler(title);
var editMode = false;
if(tid) {
template = tid.getAttribute('template');
editMode = template.indexOf('Edit') != -1;
}
if(editMode){
log("Move on to the next - we are editing");
continue;
}
// only create a tiddler if it will contain text
if(text && text.length > 0) {
if(!modifier){
modifier = getFirstElementByTagNameValue(node, "author",undefined);
}
var pubDate = getFirstElementByTagNameValue(node, "pubDate",undefined);
var tags = (modifier == config.options.txtSharedNotesUserName)?"notes":"discovered_notes";
// title is "{session_id} from {user}"
var fields = {};
fields.rr_session_id = title.replace(/ from.*$/,"");
fields.rr_user_profile = "http://confabb.com/users/profile/" + modifier;
fields.rr_user_tooltip = "click to see the user on Confabb";
var modified = new Date(pubDate);
var created = modified;
var tiddler = new Tiddler();
tiddler.assign(title,text,modifier,modified,tags,created,fields);
tiddlers.push(tiddler);
}
}
return tiddlers;
};
SharedNotesAdaptor.serverType = 'sharednotes';
SharedNotesAdaptor.serverParsingErrorMessage = "Error parsing result from server";
SharedNotesAdaptor.errorInFunctionMessage = "Error in function SharedNotesAdaptor.%0";
SharedNotesAdaptor.emptyFeed = "";
SharedNotesAdaptor.prototype.setContext = function(context,userParams,callback)
{
if(!context) context = {};
context.userParams = userParams;
if(callback) context.callback = callback;
context.adaptor = this;
if(!context.host)
context.host = this.host;
context.host = SharedNotesAdaptor.fullHostName(context.host);
if(!context.workspace)
context.workspace = this.workspace;
return context;
};
SharedNotesAdaptor.fullHostName = function(host)
{
if(!host)
return '';
if(!host.match(/:\/\//))
host = 'http://' + host;
return host;
};
SharedNotesAdaptor.minHostName = function(host)
{
return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : '';
};
SharedNotesAdaptor.prototype.openHost = function(host,context,userParams,callback)
{
this.host = host;
context = this.setContext(context,userParams,callback);
context.status = true;
if(callback)
window.setTimeout(function() {context.callback(context,userParams);},10);
return true;
};
SharedNotesAdaptor.loadTiddlyWikiCallback = function(status,context,responseText,url,xhr)
{
log("Context",context);
context.status = status;
context.count = 0;
if(!status) {
context.statusText = "Error getting notes file";
} else {
var tiddlers = SharedNotesAdaptor.parse(responseText,context.userCallbackParams);
context.adaptor.store = new TiddlyWiki();
for(var i=0;i<tiddlers.length;i++) {
context.adaptor.store.addTiddler(tiddlers[i]);
}
}
if (context.complete)
context.complete(context,context.userParams);
};
SharedNotesAdaptor.prototype.getWorkspaceList = function(context,userParams,callback)
{
context = this.setContext(context,userParams,callback);
context.workspaces = [{title:"(default)"}];
context.status = true;
if(callback)
window.setTimeout(function() {callback(context,userParams);},10);
return true;
};
SharedNotesAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback)
{
this.workspace = workspace;
context = this.setContext(context,userParams,callback);
context.status = true;
if(callback)
window.setTimeout(function() {callback(context,userParams);},10);
return true;
};
SharedNotesAdaptor.prototype.getTiddlerList = function(context,userParams,callback,filter)
{
context = this.setContext(context,userParams,callback);
if(!context.filter)
context.filter = filter;
context.complete = SharedNotesAdaptor.getTiddlerListComplete;
if(this.store) {
var ret = context.complete(context,context.userParams);
} else {
ret = doHttp('GET',context.host,null,null,null,null,SharedNotesAdaptor.loadTiddlyWikiCallback,context,{},true);
if(typeof ret != "string")
ret = true;
}
return ret;
};
SharedNotesAdaptor.getTiddlerListComplete = function(context,userParams)
{
if(context.status) {
if(context.filter) {
context.tiddlers = context.adaptor.store.filterTiddlers(context.filter);
} else {
context.tiddlers = [];
context.adaptor.store.forEachTiddler(function(title,tiddler) {context.tiddlers.push(tiddler);});
}
/*
for(var i=0; i<context.tiddlers.length; i++) {
}
*/
context.status = true;
}
if(context.callback) {
window.setTimeout(function() {context.callback(context,userParams);},10);
}
return true;
};
SharedNotesAdaptor.prototype.generateTiddlerInfo = function(tiddler)
{
var info = {};
info.uri = tiddler.fields['server.host'] + "#" + tiddler.title;
return info;
};
SharedNotesAdaptor.prototype.getTiddler = function(title,context,userParams,callback)
{
context = this.setContext(context,userParams,callback);
context.title = title;
context.complete = SharedNotesAdaptor.getTiddlerComplete;
return context.adaptor.store ?
context.complete(context,context.userParams) :
alert(context.host); //loadRemoteFile(context.host,SharedNotesAdaptor.loadTiddlyWikiCallback,context);
};
SharedNotesAdaptor.getTiddlerComplete = function(context,userParams)
{
var t = context.adaptor.store.fetchTiddler(context.title);
context.tiddler = t;
context.status = true;
if(context.allowSynchronous) {
context.isSynchronous = true;
context.callback(context,userParams);
} else {
window.setTimeout(function() {context.callback(context,userParams);},10);
}
return true;
};
SharedNotesAdaptor.prototype.close = function()
{
delete this.store;
this.store = null;
};
config.adaptors[SharedNotesAdaptor.serverType] = SharedNotesAdaptor;
} //# end of 'install only once'
//}}}
/***
|''Name:''|FeedListManagerPlugin|
|''Description:''|Manage a list of uris to be called in a round-robin stlye|
|''Author:''|PhilHawksworth|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PhilHawksworth/plugins/FeedListManagerPlugin.js |
|''Dependencies:''| [[TextToXMLDOMPlugin|http://svn.tiddlywiki.org/Trunk/contributors/PhilHawksworth/plugins/TextToXMLDOMPlugin.js ]]|
|''Version:''|0.2|
|''Date:''|April 08, 2008|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License:''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.3|
''Usage examples:''
Create a new feed list manager.
{{{
var feeds = new FeedListManager();
}}}
Add a uri to an existing feed list manager.
{{{
feeds.add(uri, [name], [type]);
}}}
Remove a uri from an existing feed list manager.
{{{
feeds.remove(uri);
}}}
Get a uri from an given position in an existing feed list manager.
{{{
uri = feeds.get(i);
}}}
Get the next uri in the queue of an existing feed list manager.
{{{
uri = feeds.next();
}}}
Discover the number of registered uris in an existing feed list manager.
{{{
i = feeds.count();
}}}
Discover if a given uri is registered in an existing feed list manager, and at what position.
{{{
i = feeds.registered(uri);
}}}
Repopulate the uri list in an existing feed list manager.
{{{
feeds.populate();
}}}
Clear out the list of registered uris.
{{{
feeds.purge();
}}}
Output some usage stats about the registered usage stats
{{{
feeds.stats([uri]);
}}}
***/
//{{{
if(!version.extensions.FeedListManagerPlugin) {
version.extensions.FeedListManagerPlugin = {installed:true};
function FeedListManager(){
this.uris = [];
this.currentPosition = 0;
this.lastIncrement = null;
this.busy = false;
this.requests = [];
this.flagCycle = false;
};
// logging function, for debug
// FeedListManager.log = function(x)
// {
// if(window.console) {
// console.log(x);
// }
// else {
// displayMessage(x);
// }
// };
// Add a uri to the list of those managed (no dupes).
// uri : the uri,
// [name] : friendly name. (defaults to 'anon')
// [type] : rss | opml (defaults to 'rss')
FeedListManager.prototype.add = function(uri, name, type) {
var exists = this.registered(uri);
if(exists != null) {
//log(uri + " already exisit on the manager");
return;
}
if(!type)
type = 'rss';
if(!name)
name = 'anon';
var uriObj = {'name':name, 'uri':uri, 'type':type, 'callCount':0, 'lastCall':null};
this.uris.push(uriObj);
// if(type == 'opml'|'include') {
// this.populate();
// }
};
// Remove a uri from the list of those currently managed.
FeedListManager.prototype.remove = function(uri) {
var pos = this.registered(uri);
if(pos != null)
this.uris.splice(pos,1);
};
// Add a uri to the list of those managed (no dupes).
FeedListManager.prototype.populate = function(callback,callbackParams) {
for(var u=0; u<this.uris.length; u++) {
resource = this.uris[u];
//log("populating. trying: ", resource.uri);
if(resource.type == 'opml') {
this.busy = true;
this.requests.push(resource.uri);
var params = {};
params.feedList = this;
if(callback) params.callback = callback;
if(callbackParams) params.callbackParams = callbackParams;
var req = doHttp("GET",resource.uri,null,null,null,null,FeedListManager.examineopml,params,null,true);
}
}
};
//examine an opml file to gather the feed links within.
FeedListManager.examineopml = function(status,params,responseText,url,xhr) {
var feedList = params.feedList;
// Remove the record of this request for tracking purposes.
var pos = feedList.requests.indexOf(url);
if(pos != -1)
feedList.requests.splice(pos,1);
// Stop if there is not a suitable response.
if(xhr.status != 200) {
log("Unable to get OPML");
return;
}
// transform the response into XMLDOM for parsing.
var xml = getXML(responseText);
var outlines = xml.getElementsByTagName("outline");
// Add any rss links found to the manager.
var xmlUrl, type, attr, xmlUrl, title = null;
for (var i=0; i < outlines.length; i++) {
type = outlines[i].getAttribute("type") || null;
xmlUrl = outlines[i].getAttribute("xmlUrl") || null;
title = outlines[i].getAttribute("title") || null;
if(type && xmlUrl)
feedList.add(xmlUrl, title, type);
};
//flag if all updates are complete.
if(feedList.requests.length < 1)
feedList.busy = false;
if(params.callback && params.callbackParams) {
window.setTimeout(function() { feedList[params.callback(params.callbackParams)]; }, 10);
}
};
// Return the number of uris currently managed.
FeedListManager.prototype.count = function() {
return this.uris.length;
};
// Determine if this uri is currently managed.
// returns its postion in the array if found, or null if not.
FeedListManager.prototype.registered = function(uri) {
for(var u=0; u<this.uris.length; u++) {
if(this.uris[u].uri == uri)
return u;
}
return null;
};
// Get the uri at a given postion in the list of those managed.
FeedListManager.prototype.getUriObj = function(i) {
if(i>=this.uris.length)
return null;
var uri = this.uris[i];
return uri;
};
FeedListManager.prototype.get = function(i) {
if(i>=this.uris.length)
return null;
return this.getUriObj(i).uri;
};
// Get the uri at by it's name.
FeedListManager.prototype.getUriObjByName = function(name) {
uriObjs = this.uris;
for (var ob=0; ob < uriObjs.length; ob++) {
if(uriObjs[ob].name == name)
return uriObjs[ob];
};
return null;
};
// Get the next uri from the list of those managed.
FeedListManager.prototype.next = function() {
if(this.busy) {
return null;
}
var feedlist = this;
if(feedlist.uris.length==0)
return null;
var thisPosition = feedlist.currentPosition;
var uri = feedlist.getUriObj(thisPosition);
while(uri && uri.type!='rss') {
feedlist.currentPosition++;
if(feedlist.currentPosition >= feedlist.uris.length)
feedlist.currentPosition = 0;
if(feedlist.currentPosition==thisPosition) {
// there are no rss feeds
return null;
}
uri = feedlist.getUriObj(feedlist.currentPosition);
}
feedlist.currentPosition++;
if(feedlist.currentPosition >= feedlist.uris.length)
feedlist.currentPosition = 0;
feedlist.lastIncrement = new Date().convertToYYYYMMDDHHMMSSMMM();
return uri.uri;
};
// Get the next uri from the list of those managed.
FeedListManager.prototype.nextUriObj = function() {
if(this.busy) {
return null;
}
var feedlist = this;
if(feedlist.uris.length==0)
return null;
var thisPosition = feedlist.currentPosition;
var uri = feedlist.getUriObj(thisPosition);
while(uri && uri.type!='rss') {
feedlist.currentPosition++;
if(feedlist.currentPosition >= feedlist.uris.length)
feedlist.currentPosition = 0;
if(feedlist.currentPosition==thisPosition) {
// there are no rss feeds
return null;
}
uri = feedlist.getUriObj(feedlist.currentPosition);
}
feedlist.currentPosition++;
if(feedlist.currentPosition >= feedlist.uris.length)
feedlist.currentPosition = 0;
feedlist.lastIncrement = new Date().convertToYYYYMMDDHHMMSSMMM();
return uri;
};
// Make a note of a call to a given uri
FeedListManager.prototype.logCall = function(uri) {
var p = this.registered(uri);
if(p == null)
return;
var u = this.uris[p];
var now = new Date();
now = now.convertToYYYYMMDDHHMMSSMMM();
this.lastIncrement = now;
u.lastCall = now;
u.callCount++;
};
// Promote all given items to the start of the array
FeedListManager.prototype.prioritise = function(name) {
//feedList = this.feedList;
feedList = this;
var uriObj;
for(var u=0; u<feedList.uris.length; u++) {
if(feedList.uris[u].name.toLowerCase() == name.toLowerCase()) {
uriObj = feedList.uris[u];
feedList.uris.splice(u,1);
feedList.uris.unshift(uriObj);
}
}
};
// Output usgae stats for the list of uris currently managed. (as wikitext)
FeedListManager.prototype.stats = function(uri) {
if(uri) {
var p = this.registered(uri);
if(p == null)
return;
var uris = [this.uris[p]];
}
else
var uris = this.uris;
var stats = null;
for(var u=0; u<uris.length; u++) {
/*
TODO Make the stats output to a tiddler rather than to the console.
*/
FeedListManager.log(uris[u].name + ", " + uris[u].uri + ", ("+ uris[u].type +"), called "+ uris[u].callCount + " times, last called at " + uris[u].lastCall);
}
};
// Purge the list of uris currently managed.
FeedListManager.prototype.purge = function() {
this.uris = [];
this.currentPosition = 0;
};
} //# end of 'install only once'
//}}}
/***
|''Name:''|TextToXMLDOMPlugin|
|''Description:''|Convert a chunk of text into XML DOM for traversing using standard XML DOM methods|
|''Author:''|PhilHawksworth |
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PhilHawksworth/plugins/TestToXMLDOMPlugin.js |
|''Version:''|0.2|
|''Date:''|April 8, 2008|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License:''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.3|
''Usage examples:''
{{{
// Create an XMLDOM object from some text
var xml = getXML(text);
// Use standars XML DOM methods to parse the object. For example:
// Get all of the 'thing' tag elements.
var things = xml.getElementsByTagName("thing");
// Get the uri attribute of the first 'thing' element.
var thingUri = things[0].getAttribute("uri");
}}}
***/
//{{{
if(!version.extensions.TextToXMLDOMPlugin) {
version.extensions.TextToXMLDOMPlugin = {installed:true};
function getXML(str) {
if(!str)
return null;
var errorMsg;
try {
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.async="false";
doc.loadXML(str);
}
catch(e) {
try {
var parser= new DOMParser();
var doc = parser.parseFromString(str,"text/xml");
}
catch(e) {
return e.message;
}
}
return doc;
};
} //# end of 'install only once'
//}}}
/***
|''Name:''|ImportWorkspacePlugin|
|''Description:''|Commands to access hosted TiddlyWiki data|
|''Author:''|Martin Budden (mjbudden (at) gmail (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/adaptors/ImportWorkspacePlugin.js |
|''Version:''|0.0.17|
|''Date:''|Aug 23, 2007|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]] |
|''~CoreVersion:''|2.2.0|
|''Feed for import''|<<option txtImportFeed>>|
|''Import workspace on startup''|<<option chkImportWorkspaceOnStartup>>|
***/
//{{{
if(!version.extensions.ImportWorkspacePlugin) {
version.extensions.ImportWorkspacePlugin = {installed:true};
if(config.options.txtImportFeed == undefined)
{config.options.txtImportFeed = '';}
if(config.options.chkImportWorkspaceOnStartup == undefined)
{config.options.chkImportWorkspaceOnStartup = false;}
config.messages.hostOpened = "Host '%0' opened";
config.messages.workspaceOpened = "Workspace '%0' opened";
config.messages.nothingToImport = "Nothing to import";
config.messages.workspaceTiddlers = "%0 tiddlers on host, importing...";
config.messages.tiddlerImported = "Tiddler: \"%0\" imported";
config.messages.importComplete = "Import complete";
// import all the tiddlers from a given workspace on a given host
config.macros.importWorkspace = {};
merge(config.macros.importWorkspace,{
label: "import workspace",
prompt: "Import tiddlers in workspace",
done: "Tiddlers imported",
usernamePrompt: "Username",
passwordPrompt: "Password"
});
config.macros.importWorkspace.init = function()
{
var customFields = config.defaultCustomFields;
//config.macros.importWorkspace.getCustomFieldsFromTiddler(config.options.txtImportFeed);
if(!customFields['server.type']) {
var title = config.options.txtImportFeed;
if(title=='') {
var tiddlers = store.getTaggedTiddlers('systemServer');
if(tiddlers.length>0)
title = tiddlers[0].title;
}
if(title) {
config.defaultCustomFields['server.type'] = store.getTiddlerSlice(title,'Type');
config.defaultCustomFields['server.host'] = store.getTiddlerSlice(title,'URL');
config.defaultCustomFields['server.workspace'] = store.getTiddlerSlice(title,'Workspace');
//config.defaultCustomFields.wikiformat = store.getTiddlerSlice(title,'WikiFormat');
}
}
if(config.options.chkImportWorkspaceOnStartup)
this.getTiddlersForAllFeeds();
};
config.macros.importWorkspace.getCustomFieldsFromTiddler = function(title)
{
if(!title) {
customFields = config.defaultCustomFields;
if(!customFields['server.type']) {
var tiddlers = store.getTaggedTiddlers('systemServer');
if(tiddlers.length>0)
title = tiddlers[0].title;
}
}
if(title) {
customFields = {};
customFields['server.type'] = store.getTiddlerSlice(title,'Type');
customFields['server.host'] = store.getTiddlerSlice(title,'URL');
customFields['server.workspace'] = store.getTiddlerSlice(title,'Workspace');
//config.defaultCustomFields.wikiformat = store.getTiddlerSlice(title,'WikiFormat');
}
return customFields;
};
config.macros.importWorkspace.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
params = paramString.parseParams('anon',null,false,false,false);
var customFields = getParam(params,'fields',false);
if(!customFields['server.type']) {
var title = getParam(params,'anon');
customFields = config.macros.importWorkspace.getCustomFieldsFromTiddler(title);
}
customFields = String.encodeHashMap(customFields);
var label = getParam(params,'label',this.label);
var btn = createTiddlyButton(place,label,this.prompt,this.onClick);
btn.setAttribute('customFields',customFields);
};
config.macros.importWorkspace.onClick = function(e)
{
clearMessage();
var customFields = this.getAttribute('customFields');
var fields = customFields ? customFields.decodeHashMap() : config.defaultCustomFields;
config.macros.importWorkspace.getTiddlersForContext(config.macros.importWorkspace.createContext(fields));
};
config.macros.importWorkspace.getTiddlersForAllFeeds = function()
{
var tiddlers = store.getTaggedTiddlers('systemServer');
for(var i=0;i<tiddlers.length;i++) {
config.macros.importWorkspace.getTiddlersForFeed(tiddlers[i].title);
}
};
config.macros.importWorkspace.getTiddlersForFeed = function(feed,userCallback,userCallbackParams)
{
config.macros.importWorkspace.getTiddlers(store.getTiddlerSlice(feed,'URL'),store.getTiddlerSlice(feed,'Type'),store.getTiddlerSlice(feed,'Workspace'),store.getTiddlerSlice(feed,'TiddlerFilter'),userCallback,userCallbackParams);
};
config.macros.importWorkspace.getTiddlers = function(uri,type,workspace,filter,userCallback,userCallbackParams)
{
var fields = {};
fields['server.host'] = uri;
fields['server.type'] = type;
fields['server.workspace'] = workspace;
config.macros.importWorkspace.getTiddlersForContext(config.macros.importWorkspace.createContext(fields,filter,userCallback,userCallbackParams));
};
config.macros.importWorkspace.getTiddlersForContext = function(context)
{
if(context) {
context.loginPromptFn = config.macros.importWorkspace.loginPromptFn;
context.adaptor.openHost(context.host,context);
context.adaptor.openWorkspace(context.workspace,context,context.userParams,config.macros.importWorkspace.openWorkspaceCallback);
return true;
}
return false;
};
config.macros.importWorkspace.createContext = function(fields,filter,userCallback,userCallbackParams)
{
var serverType = fields['server.type'];
if(!serverType)
serverType = fields['wikiformat'];
if(!serverType)
return false;
var adaptor = new config.adaptors[serverType]();
if(!adaptor)
return false;
if(adaptor) {
var context = {};
context.host = fields['server.host'];
context.workspace = fields['server.workspace'];
context.filter = filter;
context.userCallback = userCallback;
context.userCallbackParams = userCallbackParams;
context.adaptor = adaptor;
return context;
}
return false;
};
config.macros.importWorkspace.loginPromptFn = function(context)
{
if(typeof PasswordPrompt != 'undefined') {
if(context.loginPromptCallback)
PasswordPrompt.prompt(context.loginPromptCallback,context);
} else {
context.username = prompt(config.macros.importWorkspace.usernamePrompt,'');
context.password = prompt(config.macros.importWorkspace.passwordPrompt,'');
if(context.loginPromptCallback) {
context.loginPromptCallback(context);
}
}
};
config.macros.importWorkspace.openWorkspaceCallback = function(context,userParams)
{
if(context.status) {
context.adaptor.getTiddlerList(context,userParams,config.macros.importWorkspace.getTiddlerListCallback);
return true;
}
displayMessage(context.statusText);
return false;
};
config.macros.importWorkspace.getTiddlerListCallback = function(context,userParams)
{
if(context.status) {
var tiddlers = context.tiddlers;
var length = tiddlers.length;
if(userParams && userParams.maxCount && length > userParams.maxCount) {
length = userParams.maxCount;
var sortField = 'modified';
tiddlers.sort(function(a,b) {return a[sortField] < b[sortField] ? +1 : (a[sortField] == b[sortField] ? 0 : -1);});
}
context.adaptor.getTiddlerLength = 0;
for(var i=0; i<length; i++) {
if(!store.fetchTiddler(tiddlers[i].title)) {
++context.adaptor.getTiddlerLength;
}
}
if(config.messages.workspaceTiddlers)
displayMessage(context.adaptor.getTiddlerLength ? config.messages.workspaceTiddlers.format([tiddlers.length]) : config.messages.nothingToImport);
for(i=0; i<length; i++) {
tiddler = tiddlers[i];
var t = store.fetchTiddler(tiddler.title);
if(!t) {
var c = null;
if(context && context.userCallback)
c = {userCallback:context.userCallback,userCallbackParams:context.userCallbackParams};
context.adaptor.getTiddler(tiddler.title,c,null,config.macros.importWorkspace.getTiddlerCallback);
}
}
}
};
config.macros.importWorkspace.getTiddlerCallback = function(context,userParams)
{
if(context.status) {
var tiddler = context.tiddler;
store.suspendNotifications();
store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields,true,tiddler.created);
store.resumeNotifications();
} else {
displayMessage(context.statusText);
}
--context.adaptor.getTiddlerLength;
if(context.adaptor.getTiddlerLength==0) {
// have completed import of all tiddlers requested
store.notifyAll();
story.refreshAllTiddlers();
if(config.messages.importComplete && !context.userCallback) {
clearMessage();
displayMessage(config.messages.importComplete.format([tiddlers.length]));
}
}
if(context.userCallback)
context.userCallback(context,context.userCallbackParams);
};
} //# end of 'install only once'
//}}}
/***
|''Name:''|GetFirstElementValuePlugin|
|''Description:''|DOM helper functions to return node value with default |
|''Author:''|PaulDowney (psd (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/GetFirstElementValuePlugin |
|''Version:''|0.1|
|''License:''|[[BSD open source license]]|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''~CoreVersion:''|2.2|
***/
//{{{
if(!version.extensions.GetFirstElementValuePlugin) {
version.extensions.GetFirstElementValuePlugin = {installed:true};
getFirstElementByTagNameValue = function (node,tag,def,ns) {
if (node){
var e = node.getElementsByTagName(tag);
//var e = ns?node.getElementsByTagNameNS(ns,tag)
//:node.getElementsByTagName(tag);
if (e && e.length){
def = e[0].textContent || e[0].text || def;
}
}
return def;
};
} //# end of 'install only once'
//}}}
/***
|''Name:''|LogMessagePlugin|
|''Description:''|Browser independent message logging|
|''Author:''|PaulDowney (psd (at) osmosoft (dot) com)|
|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/contributors/PaulDowney/plugins/LogMessagePlugin/ |
|''Version:''|0.2|
|''License:''|[[BSD open source license]]|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''~CoreVersion:''|2.4.1|
!!Documentation
This plugin provides a log() function with the same semantics as the [[Firebug|http://getfirebug.com/]] [[console.log|http://getfirebug.com/console.html]] function. Calling console.log() is likely to fail in browsers without Firebug installed.
Depending upon the Options, the message will be sent to the Firebug console, as well as to an external popup window, and TiddlyWiki display message. As of TiddlyWiki release 2.4.1, the core provides a [[default log() function|http://trac.tiddlywiki.org/ticket/674]], so code containing log() calls will continue to function without generating errors, even without this plugin installed.
TiddlyWiki initializes plugin tiddlers in collation sequence order, so in order to make the log() function available for use in other plugins during initialization, the tiddler has been named _LogMessagePlugin.
An example TiddlyWiki containing the latest released version with a simple example is available from from http://whatfettle.com/2008/07/LogMessagePlugin/
!!Options
|<<option chkLogMessageEnabled>>|<<message config.optionsDesc.chkLogMessageEnabled>>|
|<<option chkLogMessageConsole>>|<<message config.optionsDesc.chkLogMessageConsole>>|
|<<option chkLogMessageWindow>>|<<message config.optionsDesc.chkLogMessageWindow>>|
|<<option chkLogMessageDisplayMessage>>|<<message config.optionsDesc.chkLogMessageDisplayMessage>>|
!!Code:
***/
//{{{
if(!version.extensions.LogMessagePlugin){
version.extensions.LogMessagePlugin = {installed:true};
config.optionsDesc.chkLogMessageEnabled = "logging of messages enabled";
config.options.chkLogMessageEnabled = false;
config.optionsDesc.chkLogMessageConsole = "log messages to the console, when available";
config.options.chkLogMessageConsole = false;
config.optionsDesc.chkLogMessageWindow = "log messages to an external window";
config.options.chkLogMessageWindow = false;
config.optionsDesc.chkLogMessageDisplayMessage = "log messages using displayMessage";
config.options.chkLogMessageDisplayMessage = false;
config.macros.LogMessage = {
log: function(){
if(!config.options.chkLogMessageEnabled){
return;
}
if(config.options.chkLogMessageConsole){
if (window.console){
console.log(arguments);
}
}
if(!(config.options.chkLogMessageWindow||config.options.chkLogMessageDisplayMessage)){
return;
}
var message = (function(a){var x=[]; for(var i=0; i<a.length; i++)
x.push(a[i]); return x.join(', ');})(arguments);
if(config.options.chkLogMessageWindow){
var me = config.macros.LogMessage;
me.logWindow(message);
}
if(config.options.chkLogMessageDisplayMessage){
displayMessage(message);
}
},
logWindow: function(message){
var me = config.macros.LogMessage;
try{
if(!me.window_ || me.window_.closed){
var win = window.open("", null, "width=400,height=200,scrollbars=yes,"+
"resizable=yes,status=no,location=no,menubar=no,toolbar=no");
if(!win)
return;
var doc = win.document;
doc.write("<html><head><title>Log</title></head><body></body></html>");
doc.close();
me.window_ = win;
}
var line = me.window_.document.createElement("div");
line.appendChild(me.window_.document.createTextNode(message));
me.window_.document.body.appendChild(line);
}catch(ex){
me.window_ = undefined;
if (!me.logToWindowErrorReported){
alert("Error logging to window: probably another document has been loaded");
me.logToWindowErrorReported = true;
}
}
},
handler: function(place,macroName,params,wikifier,paramString,tiddler){
var me = config.macros.LogMessage;
me.log(params);
}
};
log = config.macros.LogMessage.log;
} //# end of 'install only once'
//}}}
[[SharedNotesPlugin]]
[[SharedNotesFeedPlugin]]
[[SharedNotesAdaptor]]
http://whatfettle.com/2008/07/SharedNotesPlugin/