Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
<<slider "" "ReadMe" "Read about the browser" "tooltip" >>
config.messages.backstage = {
open: {text: " ", tooltip: "Open the backstage tools."},
close: {text: " ", tooltip: "Close the backstage area"},
prompt: " ",
decal: {
edit: {text: "edit", tooltip: "Edit the tiddler '%0'"}
}
};
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>> BackstageCSS>>/%==================================================%/
***/
#backstageArea {background-color:#00a;font-size:8pt;}
#backstageArea a {background-color:#abf;color:#000; border:none;}
#backstageArea a:hover {background:#fff; color:#f00; }
#backstageArea a.backstageSelTab {background:#abf; color:#fff;}
#backstageButton {background:transparent; font-size:9pt;}
#backstageButton a {background:transparent; color:#000; border:none;}
#backstageButton a:hover {background:#fff;color:#f00; border:none;}
#backstagePanel {background:#abf; color:#000; border-color:#fcf ;width:50em;}
#backstagePanel a {color:#00f;}
#backstagePanel a:hover {background:#eee;color:#f00; border:#f00 solid 1px;}
.backstagePanelFooter .button {border:none; color:#fcf ;}
.backstagePanelFooter .button:hover {color:#0f0;}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.5; filter:'alpha(opacity:50)';}
#backstageArea { width:100%;display:none; position:relative; overflow: hidden; z-index:150; padding:0.2em 0.5em 0.2em 0.5em;margin-left:auto;margin-right:auto;}
#backstageToolbar {position:relative; width:60%;margin-left:0;margin-right:auto;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; margin-right:auto;margin-left:auto; padding:0.1em 0.5em 0.2em 0.5em;}
#backstageArea a {font-weight:normal; margin-left:0.5em; padding:0.2em 0.5em 0.2em 0.5em;}
#backstage {position:relative; width:100%;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 0.2em; 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;}
.contentWrapper {margin-top:0em;
}
.popup {position: absolute; z-index:0; font-size:.9em; padding:0; list-style-type: decimal; margin:-1.0em;}
!!!!!<<gradient horiz #fcb #fff>> [[BasicTabs]]>>
@@color:#C06;''» »'' @@ Tabs for basic Sidebar
----
{{systemcontents{
<script>
// get all tiddlers tagged with "basic"
var tids=store.getTaggedTiddlers("basic");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("basic")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
}}}
<<tiddler NextTiddler with: Browser '« « back'>>
<<miniBrowser>>
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>> ButtonStyle>>/%==================================================%/
***/
input.btn{
color:#000;
font-family:Trebuchet MS,aerial,helvetica,sans-serif;
font-size:100%;
font-weight:normal;
background:url("http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif") repeat-x top left;top left;
background-color:#eee;
border:1px solid;
border-top-color:#000;
border-left-color:#000;
border-right-color:#000;
border-bottom-color:#000;
-moz-border-radius : .25em 0.25em 0.25em 0.25em;
}
input.btnhov{
color:#a00;
background:#fff;
background:url("http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif") repeat-x top left;top left;
border-top-color:#c06;
border-left-color:#c06;
border-right-color:#c06;
border-bottom-color:#c06;
-moz-border-radius : .25em 0.25em 0.25em 0.25em;
}
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>> CustomCSS>>/%==================================================%/
***/
/***CustomCSS is a style sheet that contains the "custom class" CSS to customize special features in TW Help. It is placed in StyleSheet as a [[NestedStyleSheet|NestedStyleSheets]] and is an essential component.***/
/***There may be extra nested stylesheets at the end of this stylesheet***/
/***
!!!<<gradient horiz #FF8888 #ffffff >> ~CustomTable>>/%==================================================%/
***/
/*{{{*/
.liststyleimagenone {list-style-image: none; margin-left:0em;padding: 0em}
.viewer table {
border: 1px solid #008;
margin-left:0em;
}
#tiddlerFolderTree {color:#050;}
#tiddlerHistory .tabContents {color:#050; background:#eee;}
#tiddlerFolderTree .tabContents {color:#050;}
#tiddlerTimeline {color:#050;}
.scroll{overflow: scroll}
.scrollauto {overflow: auto}
.nowrap {white-space:nowrap;}
.wrap{wrap;}
#tiddlerDirectory {line-height: 1em;}
.systemcontents {
height: 450px;
width: auto;
position:relative;
overflow: auto;
margin:auto;
margin-left:0em;
}
.popup {
max-height:275px;
min-height:auto;
width: auto;
overflow: auto;
margin:auto;
-moz-border-radius : 0.65em 0.2em 0.2em 0.65em;
}
.doubleborder {
border: 4px double #fcf;
margin: 8px;
}
.tableright table {border:0 !important;td.vertical-align:top;margin-left:auto ; margin-right:0 auto !important; text-align:left; padding:0px;}
.tablecenter table{ border:1 !important;td.vertical-align:top;margin-left: auto; margin-right: auto; text-align:left; padding:0px;}
.tablecenterpad17 table { td.vertical-align:top;margin-left: auto; margin-right: auto; text-align:
left; padding:17px;}
.borderless, .borderless table, .borderless td, .borderless tr, .borderless th, .borderless tbody
{ border:0 !important; margin:0 !important; padding:3px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: auto !important;}
.borderless5px, .borderless5px table, .borderless5px td, .borderless5px tr, .borderless5px th, .borderless5px tbody { border:0 !important; margin:0 !important; padding:5px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: auto !important;}
.borderlessL, .borderlessL table, .borderlessL td, .borderlessL tr, .borderlessL th, .borderlessL tbody
{ border:0 !important; margin:0 !important; padding:7px !important; td.vertical-align:top !important;margin-left: 0 !important; margin-right: auto !important;}
.borderlessL0, .borderlessL 0table, .borderlessL0 td, .borderlessL0 tr, .borderlessL0 th, .borderlessL0 tbody
{ border:0 !important; margin:0 !important; padding:0px !important; td.vertical-align:top !important;margin-left: 0 !important; margin-right: auto !important;}
.borderlessR, .borderlessR table, .borderlessR td, .borderlessR tr, .borderlessR th, .borderlessR tbody
{ border:0 !important; margin:0 !important; padding:7px !important; td.vertical-align:top !important;margin-left: auto !important; margin-right: 0 !important;}
.viewer tr.oddRow { background-color: #eaeaea;}
.viewer tr.evenRow { background-color:#fff; }
/%row code for html%/
tr.d0 td {background-color: #ccc; color: black;}
tr.d1 td {background-color: #eaeaea; color: black;}
/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >> ~CustomText>>/%==================================================%/
***/
/*{{{*/
.c06 {color:#c06;}
.gray9 {color:#999;}
.fontsize40 {font-size:0.5em}
.fontsize80 {font-size:0.75em}
.textleft { display:block;text-align:left; }
.textleftM { display:block;text-align:left; margin:0;padding:0;border:0;margin-left:.95em; }
.textright { display:block;text-align:right; }
.textcenter { display:block;text-align:center; }
.textjustify { display:block;text-align:justify; }
.textindent05 { display:block;margin:0;padding:0;border:0;margin-left:0.5em; }
.textindent1 { display:block;margin:0;padding:0;border:0;margin-left:1em; }
.textindent2 { display:block;margin:0;padding:0;border:0;margin-left:2em; }
.wrap { white-space:normal; }
.nowrap { white-space:nowrap; }
.headingcolor{color:#FFF;background:#ff8888;}
.wrappingClass{padding: 0px 0.5em 0px 0.5em;color: #FFF; background: #06f;}
.firstletter{
display:block;
float:left;
width:1.0em;
font-size:400%;
font-family:times,courier;
line-height:80%;
}
.firstletterK{
display:block;
float:left;
width:0.75em;
font-size:400%;
font-family:times,courier;
line-height:80%;
}
.firstletterT{
display:block;
float:left;
width:0.65em;
font-size:300%;
font-family:times,courier;
line-height:95%;
}
.headline{
color:#c06;
font-size:180%;
font-family:times,arial;
line-height:60%;
}
/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >> Layout>>/%==================================================%/
***/
/*{{{*/
.twocolumns { display:block; -moz-column-count:2; -moz-column-gap:1em; -moz-column-
width:50%;}
.threecolumns { display:block; -moz-column-count:3; -moz-column-gap:1em; -moz-column-
width:33%}
.fourcolumns { display:block; -moz-column-count:4; -moz-column-gap:1em; -moz-column-
width:25%}
.doubleborder {
border: 4px double #fcf;
margin: 8px;
}
.floatboxright {
float: right;
width: 20em;
border: solid 1px;
padding:3px;
background-color:#fcf;
/* whatever other styling you want.. */
}
.floatboxleft {
float: left;
width: 20em;
border: solid 1px;
padding:3px;
background-color:#fcf;
/* whatever other styling you want.. */
}
.floatleft{ float:left; }
.floatright{ float:right; }
.moveovermainmenu{margin-left:7px;}
.textleftpad5{text-align:left;padding: 0px 5px 0px 5px;}
.textindent25 {text-indent:25px;}
.smallform{ white-space:nowrap; }
.imgfloatright{display:block;float:right;padding:1em;}
.imgfloatleft{display:block;float:left;padding:1em;}
.imgfloatcenter{display:block;margin-left: auto;margin-right: auto;padding:0.3em;}
.alt { background-color:#abf; }
.fdfbackground {background:#fdf;}
/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >> Links>>/%==================================================%/
***/
/*{{{*/
.boldLink a {font-weight:bold;}
.unboldLink a {font-weight:normal;}
.underlineLink a {font-weight:normal;text-decoration:underline;}
.bigLink a { font-size:10pt;font-weight:bold;}
.whiteLink a { color: #fff;font-weight:normal; }
.twLink a { color: #090;font-weight:normal; }
.locLink a { color: #c06;font-weight:normal; }
.remLink a { color: #c90;font-weight:normal; }
.blueLink a {color:#00f;}
.grayLink a {color:#ccc;}
.darkgrayLink a {color:#999;}
.editLink a {color:#ccc;font-size:0.01em}
.wrappingLinks{color: #000; background: #B3FFB3;}
.wrappingLinksAlt{color: #000; background: #C0FFFF;}
/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >> Specific Tiddler Custom CSSCSS>>/%=================================================%/
***/
/*{{{*/
{{{
For tiddler titles with spaces
#tiddlerNew\000020Tiddler a {color: #f00;}
}}}
#tiddlerSilverHeader a {color:#009;}
#tiddlerSilverHeader .button {color:#009;}
#tiddlerSilverHeader a:hover{
background: #FFF;
color: #F00;
}
#tiddlerFolderTree ul,ul {
list-style-type: square;
}
#tiddlerFolderTree ul,ul {
list-style-type: ▲
}
#tiddlerTimeline {
height: 350px;
width: 100%;
position:relative;
overflow: auto;
margin:auto;
}
#tiddlerSystemContents .tabContents {padding 0.5em;margin:auto;}
#tiddlerScience .firstletter{
float:left;
width:0.75em;
margin-right:0.2em;
font-size:400%;
font-family:times,arial;
line-height:70%;
}
#tiddlerEditTemplate .button {color: #000;text-decoration:none;}
#tiddlerTWHelp-SearchResults .viewer {
overflow: auto;
height: 350px;
width: 100%;
position:relative;
overflow: auto;
margin:auto;
margin-left:0em;
}
#tiddlerTranslate .viewer {
overflow: auto;
}
#tiddlerSideBarOptions {
color:#ffc;
background: transparent;
}
#tiddlerNewWelcome .viewer .tabContents {
background: transparent;
border-top: 1px solid #999;
border-right: 0px solid #999;
border-bottom: 0px solid #999;
border-left: 0px solid #999;
}
#tiddlerTWHelpSiteLinks ol { list-style-type: decimal }
#tiddlerBorderlessIframe .viewer {
background:#fff;
}
#mainMenu a:hover{
background: #FFF;
color: #F00;
}
#SilverHeader
#tiddlerMargin_Properties.viewer th{
border: 1px solid #000;
padding: 0px;
vertical-align:top;
}
#tiddlerFormattingPageIntro .viewer th, .viewer td, .viewer tr,.viewer caption{
border: 1px solid #F6F;
padding: 0px;
vertical-align:top;
}
#tiddlerTWHelp-SearchResults .viewer table, .viewer td{
border: 1px solid #F6F;
padding-left: 5px;
padding-right: 5px;
vertical-align:top;
td.vertical-align:top;
margin-left: auto;
margin-right: auto;
}
#tiddlerTables .viewer td.even{
background:#ccc;
}
#tiddlerTWHelp-SearchResults .viewer a {
color:#04b;
text-decoration:none;
}
#tiddlerAlpha .viewer tr.oddRow { background-color: #abf;}
#tiddlerAlpha .viewer tr.evenRow { background-color:#eaeaea; }
#tiddlerNewWelcome .viewer tr.oddRow { background-color: #eaeaea;}
#tiddlerNewWelcome .viewer tr.evenRow { background-color:#fff; }
#tiddlerImages img {
border: 5px double #999;
margin: 4px;
}
#searchBar {
float: right;
font-size: 0.9em;
padding-right: 1.5em;
padding-bottom: 0em;
}
#searchBar .button {
padding-right: 0.5em;
border: none;
}
.gotoBar {
float: right;
font-size: 0.9em;
padding-right: 1.5em;
padding-top: 1.0em;
}
/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >>Footer >>/%==================================================%/
***/
/*{{{*/
#contentFooter {
text-align: center;
clear: both;
color:#ccc;
background: transparent;
padding: 1em 2em;
font-weight:normal;
}
#contentFooter a {
color:#ccc;
}
/*}}}*/
/***
!!!<<gradient horiz #090 #fff>> @@color:#fff;End@@>>/%==================================================%/
***/
/*{{{*/
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div class="editLabel">.</div>
<div class='editor' macro='edit tags'></div><div class='editorFooter' style="padding-left:2em;"><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<div macro='annotations'></div>
<span macro='toolbar format slice'></span>
<div class='editor' macro='edit text'></div>
<!--}}}-->
/***
|Name|FontSizePlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FontSizePlugin|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Resize tiddler text on the fly. The text size is remembered between sessions by use of a cookie.
You can customize the maximum and minimum allowed sizes.
(only affects tiddler content text, not any other text)
Also, you can load a TW file with a font-size specified in the url.
Eg: http://tw.lewcid.org/#font:110
!Demo:
Try using the font-size buttons in the sidebar, or in the MainMenu above.
!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Then put {{{<<fontSize "font-size:">>}}} in your SideBarOptions tiddler, or anywhere else that you might like.
!Usage
{{{<<fontSize>>}}} results in <<fontSize>>
{{{<<fontSize font-size: >>}}} results in <<fontSize font-size:>>
!Customizing:
The buttons and prefix text are wrapped in a span with class fontResizer, for easy css styling.
To change the default font-size, and the maximum and minimum font-size allowed, edit the config.fontSize.settings section of the code below.
!Notes:
This plugin assumes that the initial font-size is 100% and then increases or decreases the size by 10%. This stepsize of 10% can also be customized.
!History:
*27-07-06, version 1.0 : prevented double clicks from triggering editing of containing tiddler.
*25-07-06, version 0.9
!Code
***/
//{{{
config.fontSize={};
//configuration settings
config.fontSize.settings =
{
defaultSize : 100, // all sizes in %
maxSize : 200,
minSize : 40,
stepSize : 5
};
//startup code
var fontSettings = config.fontSize.settings;
if (!config.options.txtFontSize)
{config.options.txtFontSize = fontSettings.defaultSize;
saveOptionCookie("txtFontSize");}
setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
setStylesheet("#contentWrapper .fontResizer .button {display:inline;font-size:105%; font-weight:bold; margin:0 1px; padding: 0 3px; text-align:center !important;}\n .fontResizer {margin:0 0.5em;}","fontResizerButtonStyles");
//macro
config.macros.fontSize={};
config.macros.fontSize.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
var sp = createTiddlyElement(place,"span",null,"fontResizer");
sp.ondblclick=this.onDblClick;
if (params[0])
createTiddlyText(sp,params[0]);
createTiddlyButton(sp,"+","increase font-size",this.incFont);
createTiddlyButton(sp,"=","reset font-size",this.resetFont);
createTiddlyButton(sp,"–","decrease font-size",this.decFont);
}
config.macros.fontSize.onDblClick = function (e)
{
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return false;
}
config.macros.fontSize.setFont = function ()
{
saveOptionCookie("txtFontSize");
setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
}
config.macros.fontSize.incFont=function()
{
if (config.options.txtFontSize < fontSettings.maxSize)
config.options.txtFontSize = (config.options.txtFontSize*1)+fontSettings.stepSize;
config.macros.fontSize.setFont();
}
config.macros.fontSize.decFont=function()
{
if (config.options.txtFontSize > fontSettings.minSize)
config.options.txtFontSize = (config.options.txtFontSize*1) - fontSettings.stepSize;
config.macros.fontSize.setFont();
}
config.macros.fontSize.resetFont=function()
{
config.options.txtFontSize=fontSettings.defaultSize;
config.macros.fontSize.setFont();
}
config.paramifiers.font =
{
onstart: function(v)
{
config.options.txtFontSize = v;
config.macros.fontSize.setFont();
}
};
//}}}
/***
|Name|GotoPlugin|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Documentation|http://www.TiddlyTools.com/#GotoPluginInfo|
|Version|1.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|view any tiddler by entering it's title - displays list of possible matches|
''View a tiddler by typing its title and pressing //enter//.'' As you type, a list of possible matches is displayed. You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press //escape// to close the listbox to resume typing. When the listbox is ''//not//'' being displayed, press //escape// to clear the current text input and start over.
!!!!!Documentation
>see [[GotoPluginInfo]]
!!!!!Revisions
<<<
2008.02.17 [1.5.0] ENTER key always displays tiddler based on current input regardless of whether input matches any existing tiddler
|please see [[GotoPluginInfo]] for additional revision details|
2006.05.05 [0.0.0] started
<<<
!!!!!Code
***/
//{{{
version.extensions.gotoTiddler = {major: 1, minor: 5, revision: 0, date: new Date(200,2,17)};
// automatically tweak shadow SideBarOptions to add <<gotoTiddler>> macro above <<search>>
config.shadowTiddlers.SideBarOptions=config.shadowTiddlers.SideBarOptions.replace(/<<search>>/,"{{button{goto}}}\n<<gotoTiddler>><<search>>");
config.macros.gotoTiddler= {
handler:
function(place,macroName,params) {
var quiet=(params[0] && params[0]=="quiet"); if (quiet) params.shift();
var insert=(params[0] && params[0]=="insert"); if (insert) params.shift();
var instyle=params.shift(); if (!instyle) instyle="";
var liststyle=params.shift(); if (!liststyle) liststyle="";
var keyevent=window.event?"onkeydown":"onkeypress";
createTiddlyElement(place,"span").innerHTML
=this.html.replace(/%keyevent%/g,keyevent).replace(/%insert%/g,insert).replace(/%quiet%/g,quiet).replace(/%instyle%/g,instyle).replace(/%liststyle%/g,liststyle);
},
html:
'<form onsubmit="return false" style="display:inline;margin:0;padding:0">\
<input name=gotoTiddler type=text autocomplete="off" accesskey="G" style="%instyle%"\
value="type tiddler name" title="enter a tiddler title"\
onclick="this.form.list.style.display=\'none\';"\
onfocus="this.select(); this.setAttribute(\'accesskey\',\'G\');"\
%keyevent%="return config.macros.gotoTiddler.inputEscKeyHandler(event,this,this.form.list);"\
onkeyup="return config.macros.gotoTiddler.inputKeyHandler(event,this,this.form.list,%quiet%,%insert%);">\
<select name=list style="%liststyle%;display:none;position:absolute"\
onchange="if (!this.selectedIndex) this.selectedIndex=1;"\
onblur="this.style.display=\'none\';"\
%keyevent%="return config.macros.gotoTiddler.selectKeyHandler(event,this,this.form.gotoTiddler,%insert%);"\
onclick="return config.macros.gotoTiddler.processItem(this.value,this.form.gotoTiddler,this,%insert%);">\
</select>\
</form>',
getItems:
function(val) {
if (!this.items.length || val.length<2) { // starting new search, refresh cached list of tiddlers/shadows/tags
this.items=new Array();
var tiddlers=store.getTiddlers("title","excludeLists");
for(var t=0; t<tiddlers.length; t++) this.items.push(tiddlers[t].title);
for (var t in config.shadowTiddlers) this.items.pushUnique(t);
var tags=store.getTags();
for(var t=0; t<tags.length; t++) this.items.pushUnique(tags[t][0]);
}
var found = [];
var match=val.toLowerCase();
for(var i=0; i<this.items.length; i++)
if (this.items[i].toLowerCase().indexOf(match)!=-1) found.push(this.items[i]);
return found;
},
items: [], // cached list of tiddlers/shadows/tags
getItemSuffix:
function(t) {
if (store.tiddlerExists(t)) return ""; // tiddler
if (store.isShadowTiddler(t)) return " (shadow)"; // shadow
return " (tag)"; // tag
},
keyProcessed:
function(ev) { // utility function: exits handler and prevents browser from processing the keystroke
ev.cancelBubble=true; // IE4+
try{event.keyCode=0;}catch(e){}; // IE5
if (window.event) ev.returnValue=false; // IE6
if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
if (ev.stopPropagation) ev.stopPropagation(); // all
return false;
},
inputEscKeyHandler:
function(event,here,list) {
var key=event.keyCode;
// escape... hide list (2nd esc=clears input)
if (key==27) {
if (list.style.display=="none")
here.value=here.defaultValue;
list.style.display="none";
return this.keyProcessed(event);
}
return true; // key bubbles up
},
inputKeyHandler:
function(event,here,list,quiet,insert) {
var key=event.keyCode;
// non-printing chars... bubble up, except: backspace=8, enter=13, space=32, down=40, delete=46
if (key<48) switch(key) { case 8: case 13: case 32: case 40: case 46: break; default: return true; }
// blank input... if down/enter... fall through (list all)... else, and hide list
if (!here.value.length && !(key==40 || key==13))
{ list.style.display="none"; return this.keyProcessed(event); }
// find matching items...
var found = this.getItems(here.value);
// non-blank input... enter key... show/create tiddler
if (key==13) return this.processItem(here.value,here,list,insert);
// make sure list is shown/hidden
list.style.display=(!quiet && found.length)?"block":"none";
// no matches, key bubbles up
if (!found.length) return true;
// down key... shows/moves to list...
if (key==40) { list.style.display="block"; list.focus(); }
// finally, if list is showing, fill it with found results...
if (list.style.display!="none") {
while (list.length > 0) list.options[0]=null; // clear list
found.sort(); // alpha by title
var hdr=this.listHeading.format([found.length,found.length==1?"":"s"]);
list.options[0]=new Option(hdr,"",false,false);
for (var t=0; t<found.length; t++) // fill list...
list.options[list.length]=new Option(found[t]+this.getItemSuffix(found[t]),found[t],false,false);
list.size=(found.length<this.listMaxSize?found.length:this.listMaxSize)+1; // resize list...
list.selectedIndex=(key==40 || key==13)?1:0;
}
return true; // key bubbles up
},
listMaxSize: 10,
listHeading: 'Found %0 matching title%1:',
selectKeyHandler:
function(event,list,editfield,insert) {
if (event.keyCode==27) // escape... hide list, move to edit field
{ editfield.focus(); list.style.display="none"; return this.keyProcessed(event); }
if (event.keyCode==13 && list.value.length) // enter... view selected item
{ this.processItem(list.value,editfield,list,insert); return this.keyProcessed(event); }
return true; // key bubbles up
},
processItem:
function(title,here,list,insert) {
if (!title.length) return; here.value=title; list.style.display='none';
if (insert) {
var tidElem=story.findContainingTiddler(here); if (!tidElem) { here.focus(); return false; }
var e=story.getTiddlerField(tidElem.getAttribute("tiddler"),"text");
if (!e||e.getAttribute("edit")!="text") return false;
var txt=prompt(this.askForText,title); if (!txt||!txt.length) { here.focus(); return false; }
e.focus(); // put focus on target field before setting selection
replaceSelection(e,"[["+txt+"|"+title+"]]"); // insert selected tiddler as a PrettyLink
}
else
story.displayTiddler(null,title); // show selected tiddler
return false;
},
askForText: "Enter the text to display for this link"
}
//}}}
/***
|Name|GotoPluginInfo|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Documentation|http://www.TiddlyTools.com/#GotoPluginInfo|
|Version|1.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for GotoPlugin|
''View a tiddler by typing its title and pressing //enter//.'' As you type, a list of possible matches is displayed. You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press //escape// to close the listbox to resume typing. When the listbox is ''//not//'' being displayed, press //escape// to clear the current text input and start over.
!!!!!Usage/Examples
<<<
| //IMPORTANT NOTE:// ''As of version 1.4.0 (2007.04.25),<br>to avoid conflict with javascript reserved keywords<br>the {{{<<goto>>}}} macro has been renamed to {{{<<gotoTiddler>>}}}'' |
syntax: {{{<<gotoTiddler quiet insert inputstyle liststyle>>}}}
All parameters are optional.
* ''quiet'' prevents //automatic// display of the list as each character is typed. To view the list when ''quiet'', use //down// or //enter//.
* ''insert'' causes the selected tiddler title to be inserted into the tiddler source currently being edited (use with EditTemplate)
* ''inputstyle'' and ''liststyle'' are CSS declarations that modify the default input and listbox styles. Note: styles containing spaces must be surrounded by ({{{"..."}}} or {{{'...'}}}) or ({{{[[...]]}}}).
{{{<<gotoTiddler>>}}}
<<gotoTiddler>>
{{{<<gotoTiddler quiet>>}}}
<<gotoTiddler quiet>>
{{{<<goto width:20em width:20em>>}}}
<<gotoTiddler width:20em width:20em>>
You can also invoke the macro with the "insert" keyword. When used in the [[EditTemplate]], like this:
{{{
<span macro="gotoTiddler insert"></span>
}}}
it allows you to type/select a tiddler title, and instantly insert a link to that title (e.g. {{{[[TiddlerName]]}}}) into the tiddler source being edited.
<<<
!!!!!Configuration
<<<
You can create a tiddler tagged with <<tag systemConfig>> to control the maximum height of the listbox of tiddlers/shadows/tags. //The default values are shown below://
//{{{
config.macros.gotoTiddler.listMaxSize=10;
//}}}
<<<
!!!!!Revisions
<<<
2008.02.17 [1.5.0] ENTER key always displays tiddler based on current input regardless of whether input matches any existing tiddler
2007.10.31 [1.4.3] removed extra trailing comma on last property of config.macros.gotoTiddler object. This fixes an error under InternetExplorer that was introduced 6 days ago... sure, I should have found it sooner, but... WHY DON'T PEOPLE TELL ME WHEN THINGS ARE BROKEN!!!!
2007.10.25 [1.4.2] added onclick handler for input field, so that clicking in field hides the listbox.
2007.10.25 [1.4.1] re-wrote getItems() to cache list of tiddlers/shadows/tags and use case-folded simple text match instead of regular expression to find matching tiddlers. This *vastly* reduces processing overhead between keystrokes, especially for documents with many (>1000) tiddlers. Also, removed local definition of replaceSelection(), now supported directly by the TW2.2+ core, as well as via backward-compatible plugin
2007.04.25 [1.4.0] renamed macro from "goto" to "gotoTiddler". This was necessary to avoid a fatal syntax error in Opera (and other browsers) that require strict adherence to ECMAScript 1.5 standards which defines the identifier "goto" as "reserved for FUTURE USE"... *sigh*
2007.04.21 [1.3.2] in html definition, removed DIV around droplist (see 1.2.6 below). It created more layout problems then it solved. :-(
2007.04.01 [1.3.1] in processItem(), ensure that correct textarea field is found by checking for edit=="text" attribute
2007.03.30 [1.3.0] tweak SideBarOptions shadow to automatically add {{{<<goto>>}}} when using default sidebar content
2007.03.30 [1.2.6] in html definition, added DIV around droplist to fix IE problem where list appears next to input field instead of below it.
2007.03.28 [1.2.5] in processItem(), set focus to text area before setting selection (needed for IE to get correct selection 'range')
2007.03.28 [1.2.4] added prompt for 'pretty text' when inserting a link into tiddler content
2007.03.28 [1.2.3] added local copy of core replaceSelection() and modified for different replace logic
2007.03.27 [1.2.2] in processItem(), use story.getTiddlerField() to retrieve textarea control
2007.03.26 [1.2.1] in html, use either 'onkeydown' (IE) or 'onkeypress' (Moz) event to process <esc> key sooner, to prevent <esc> from 'bubbling up' to the tiddler (which will close the current editor).
2007.03.26 [1.2.0] added support for optional "insert" keyword param. When used in [[EditTemplate]], (e.g. {{{<span macro="goto insert"></span>}}}) it triggers alternative processing: instead of displaying the selected tiddler, that tiddler's title is inserted into a tiddler's textarea edit field surrounded by {{{[[...]]}}}.
2006.05.10 [1.1.2] when filling listbox, set selection to 'heading' item... auto-select first tiddler title when down/enter moves focus into listbox
2006.05.08 [1.1.1] added accesskey ("G") to input field html (also set when field gets focus). Also, inputKeyHandler() skips non-printing/non-editing keys.
2006.05.08 [1.1.0] added heading to listbox for better feedback (also avoids problems with 1-line droplist)
2006.05.07 [1.0.0] list matches against tiddlers/shadows/tags. input field auto-completion... 1st enter=complete matching input (or show list)... 2nd enter=view tiddler. optional "quiet" param controls when listbox appears.
2006.05.06 [0.5.0] added handling for enter (13), escape(27), and down(40) keys. Change 'ondblclick' to 'onclick' for list handler to view tiddlers (suggested by Florian Cauvin - prevents unintended trigger of tiddler editor). shadow titles inserted into list instead of appended to the end.
2006.05.05 [0.0.0] started
<<<
/***
|Name|HTMLFormattingPlugin|
|Source|http://www.TiddlyTools.com/#HTMLFormattingPlugin|
|Documentation|http://www.TiddlyTools.com/#HTMLFormattingPluginInfo|
|Version|2.1.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|'HTML' formatter|
|Description|embed wiki syntax formatting inside of HTML content|
The ~HTMLFormatting plugin allows you to ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.
!!!!!Documentation
>see [[HTMLFormattingPluginInfo]]
!!!!!Revisions
<<<
2008.04.26 [*.*.*] plugin size reduction: more documentation moved to HTMLFormattingInfo
2008.01.08 [*.*.*] plugin size reduction: documentation moved to HTMLFormattingInfo
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.06.14 [2.1.5] in formatter, removed call to e.normalize(). Creates an INFINITE RECURSION error in Safari!!!!
| see [[HTMLFormattingPluginInfo]] for additional revision details |
2005.06.26 [1.0.0] Initial Release (as code adaptation - pre-dates TiddlyWiki plugin architecture!!)
<<<
!!!!!Code
***/
//{{{
version.extensions.HTMLFormatting = {major: 2, minor: 1, revision: 5, date: new Date(2007,6,14)};
// find the formatter for HTML and replace the handler
initHTMLFormatter();
function initHTMLFormatter()
{
for (var i=0; i<config.formatters.length && config.formatters[i].name!="html"; i++);
if (i<config.formatters.length) config.formatters[i].handler=function(w) {
if (!this.lookaheadRegExp) // fixup for TW2.0.x
this.lookaheadRegExp = new RegExp(this.lookahead,"mg");
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var html=lookaheadMatch[1];
// optionally suppress wiki-style literal handling of newlines
if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(/\n/g,' ');
// remove carriage returns (\r) added by IE textarea
html=html.replace(/\r/g,'');
// encode newlines (\n) and macro brackets (<< and >>)
html=html.replace(/\n/g,'\\n').replace(/<</g,'%%(').replace(/>>/g,')%%');
// create span to hold HTML
var e = createTiddlyElement(w.output,"span");
// let browser parse HTML
e.innerHTML=html;
// walk node tree and call wikify() on each text node
wikifyTextNodes(e);
// continue wiki parsing
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
}
// wikify text nodes remaining after HTML content is processed (pre-order recursion)
function wikifyTextNodes(theNode)
{
// textarea node doesn't get wikified, just decoded...
if (theNode.nodeName.toLowerCase()=='textarea')
theNode.value=theNode.value.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(/\\n/g,'\n');
else for (var i=0;i<theNode.childNodes.length;i++) {
var theChild=theNode.childNodes.item(i);
if (theChild.nodeName.toLowerCase()=='option') continue;
if (theChild.nodeName.toLowerCase()=='select') continue;
wikifyTextNodes(theChild);
if (theChild.nodeName=='#text') {
var txt=theChild.nodeValue;
// decode macro brackets and newlines
txt=txt.replace(/\%%\(/g,'<<').replace(/\)\%%/g,'>>').replace(/\\n/g,'\n');
// replace text node with wikified() span
var newNode=createTiddlyElement(null,"span");
theNode.replaceChild(newNode,theChild);
wikify(txt,newNode);
}
}
}
//}}}
<<tiddler Ahelp>>
<<tiddler TheMenu>>
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Version|1.6.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Usage
<<<
When installed, this plugin adds new wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be treated as embedded javascript and executed each time the tiddler is rendered.
''Deferred execution from an 'onClick' link''
By including a {{{label="..."}}} parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered. You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text
''External script source files:''
You can also load javascript from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}). This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins. The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.
''Display script source in tiddler output''
By including the keyword parameter "show", in the initial {{{<script>}}} marker, the plugin will include the script source code in the output that it displays in the tiddler.
''Defining javascript functions and libraries:''
Although the external javascript file is loaded while the tiddler content is being rendered, any functions it defines will not be available for use until //after// the rendering has been completed. Thus, you cannot load a library and //immediately// use it's functions within the same tiddler. However, once that tiddler has been loaded, the library functions can be freely used in any tiddler (even the one in which it was initially loaded).
To ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that will be rendered as soon as your TiddlyWiki document is opened. For example, you could put your {{{<script src="..."></script>}}} syntax into a tiddler called LoadScripts, and then add {{{<<tiddler LoadScripts>>}}} in your MainMenu tiddler.
Since the MainMenu is always rendered immediately upon opening your document, the library will always be loaded before any other tiddlers that rely upon the functions it defines. Loading an external javascript library does not produce any direct output in the tiddler, so these definitions should have no impact on the appearance of your MainMenu.
''Creating dynamic tiddler content''
An important difference between this implementation of embedded scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document:
* In a typical web document, you use the document.write() function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.
* However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and completely replaces the entire ~TiddlyWiki document in your browser window.
* To allow these scripts to work unmodified, the plugin automatically converts all occurences of document.write() so that the output is inserted into the tiddler content instead of replacing the entire ~TiddlyWiki document.
If your script does not use document.write() to create dynamically embedded content within a tiddler, your javascript can, as an alternative, explicitly return a text value that the plugin can then pass through the wikify() rendering engine to insert into the tiddler display. For example, using {{{return "thistext"}}} will produce the same output as {{{document.write("thistext")}}}.
//Note: your script code is automatically 'wrapped' inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler. To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.//
''Accessing the ~TiddlyWiki DOM''
The plugin provides one pre-defined variable, 'place', that is passed in to your javascript code so that it can have direct access to the containing DOM element into which the tiddler output is currently being rendered.
Access to this DOM element allows you to create scripts that can:
* vary their actions based upon the specific location in which they are embedded
* access 'tiddler-relative' information (use findContainingTiddler(place))
* perform direct DOM manipulations (when returning wikified text is not enough)
<<<
!!!!!Examples
<<<
an "alert" message box:
><script show>
alert('InlineJavascriptPlugin: this is a demonstration message');
</script>
dynamic output:
><script show>
return (new Date()).toString();
</script>
wikified dynamic output:
><script show>
return "link to current user: [["+config.options.txtUserName+"]]";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).id.substr(7);
return title+" is using "+store.getTiddlerText(title).length+" bytes";
</script>
creating an 'onclick' button/link that runs a script:
><script label="click here" title="clicking this link will show an 'alert' box" show>
if (!window.story) window.story=window;
alert("Hello World!\nlinktext='"+place.firstChild.data+"'\ntiddler='"+story.findContainingTiddler(place).id.substr(7)+"'");
</script>
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function demo() { alert('this output is from demo(), defined in demo.js') } }}}
>>{{{alert('InlineJavascriptPlugin: demo.js has been loaded'); }}}
><script src="demo.js" show>
return "loading demo.js..."
</script>
><script label="click to execute demo() function" show>
demo()
</script>
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''InlineJavascriptPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.02.19 [1.6.0]'' added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
''2006.10.16 [1.5.2]'' add newline before closing '}' in 'function out_' wrapper. Fixes error caused when last line of script is a comment.
''2006.06.01 [1.5.1]'' when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
''2006.04.19 [1.5.0]'' added 'show' parameter to force display of javascript source code in tiddler output
''2006.01.05 [1.4.0]'' added support 'onclick' scripts. When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked. 'place' value is set to match the clicked button/link element.
''2005.12.13 [1.3.1]'' when catching eval error in IE, e.description contains the error text, instead of e.toString(). Fixed error reporting so IE shows the correct response text. Based on a suggestion by UdoBorkowski
''2005.11.09 [1.3.0]'' for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content. Based on a suggestion by BradleyMeck
''2005.11.08 [1.2.0]'' handle loading of javascript from an external URL via src="..." syntax
''2005.11.08 [1.1.0]'' pass 'place' param into scripts to provide direct DOM access
''2005.11.08 [1.0.0]'' initial release
<<<
!!!!!Credits
<<<
This feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]
<<<
!!!!!Code
***/
//{{{
version.extensions.inlineJavascript= {major: 1, minor: 6, revision: 0, date: new Date(2007,2,19)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
if (lookaheadMatch[1]) { // load a script library
// make script tag, set src, add to body to execute, then remove for cleanup
var script = document.createElement("script"); script.src = lookaheadMatch[1];
document.body.appendChild(script); document.body.removeChild(script);
}
if (lookaheadMatch[5]) { // there is script code
if (lookaheadMatch[4]) // show inline script code in tiddler output
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (lookaheadMatch[2]) { // create a link to an 'onclick' script
// add a link, define click handler, save code in link (pass 'place'), set link attributes
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",lookaheadMatch[2]);
link.onclick=function(){try{return(eval(this.code))}catch(e){alert(e.description?e.description:e.toString())}}
link.code="function _out(place){"+lookaheadMatch[5]+"\n};_out(this);"
link.setAttribute("title",lookaheadMatch[3]?lookaheadMatch[3]:"");
link.setAttribute("href","javascript:;");
link.style.cursor="pointer";
}
else { // run inline script code
var code="function _out(place){"+lookaheadMatch[5]+"\n};_out(w.output);"
code=code.replace(/document.write\(/gi,'place.innerHTML+=(');
try { var out = eval(code); } catch(e) { out = e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
major: 1, minor: 1, revision: 0,
date: new Date("mar 17, 2007"),
source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};
if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};
bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){
url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
}
return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=3848391;
var sc_invisible=1;
var sc_partition=31;
var sc_click_stat=1;
var sc_security="8a8e781e";
</script>
<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter"><a href="http://www.statcounter.com/" target="_blank"><img class="statcounter" src="http://c32.statcounter.com/3848391/0/8a8e781e/1/" alt="web page hit counter" ></a></div></noscript>
<!-- End of StatCounter Code -->
DonationCoder
http://www.donationcoder.com/
----
Mouser's Software
http://www.donationcoder.com/Software/Mouser/index.html
----
Find and Run Robot
http://www.donationcoder.com/Software/Mouser/findrun/index.html
----
===TiddlyWiki===
----
TW Help
http://twhelp.tiddlyspot.com
----
Sidebar Plugin Vault
http://sidebarpluginvault.tiddlyspot.com
----
TiddlyWiki Group
http://groups.google.com/group/TiddlyWiki/
----
===Radio===
----
ABC Classic FM
http://www.abc.net.au/classic/
----
ABC Local Radio
http://www.abc.net.au/sydney/
----
ABC News Radio
http://www.abc.net.au/newsradio/
----
ABC Radio National
http://www.abc.net.au/rn/
----
ABC Radio Australia
http://www.radioaustralia.net.au/
----
===TV===
----
AllSydneyTV
http://www.yourtv.com.au/guide/?action=tonight®ion_id=73
----
ABC TV Guide
http://www.abc.net.au/tv/guide/
----
SBS TV Guide
http://www.sbs.com.au/schedule
----
ABC Subjects
http://www.abc.net.au/subjects.htm
----
ABC News
http://www.abc.net.au/news/default.htm
----
===Science===
----
Compass
http://abc.net.au/compass/
----
Catalyst
http://www.abc.net.au/catalyst/
----
Catapult
http://www.abc.net.au/catapult/
----
Health Report
http://www.abc.net.au/health/
----
Ockhams Razor
http://www.abc.net.au/rn/ockhamsrazor/default.htm
----
Science News
http://www.abc.net.au/science/news/
----
Science Show
http://www.abc.net.au/rn/scienceshow/
----
The Lab
http://abc.net.au/science/
----
Astronomy Picture of Today
http://antwrp.gsfc.nasa.gov/apod/
----
Indianapolis Star
http://www.indystar.com/apps/pbcs.dll/frontpage
----
/***
|Name|MiniBrowserPlugin|
|Source|http://www.TiddlyTools.com/#MiniBrowserPlugin|
|Version|1.2.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|PlayerPlugin (optional, recommended)|
|Overrides||
|Options|##Configuration|
|Description|embedded browser-in-browser with favorites lists and media support|
!!!!!Usage
<<<
{{{<<miniBrowser noplayer hidecontrols URL TiddlerName TiddlerName TiddlerName...>>}}}
* ''noplayer'' (optional)<br>disables support for embedded media player (using [[PlayerPlugin]], if installed)
* ''hidecontrols'' (optional)<br>hide initial display of minibrowser controls (except for 'show controls' checkbox)<br>//note: if no initial URL is specified, controls will be shown anyway//
* ''URL'' (optional)<br>specifies an initial URL to open when the mini browser is rendered
* ''TiddlerName'', ''TiddlerName''... (optional)<br>indicates one or more tiddlers containing "HR-separated" lists of favorites.<br>//notes: if no tiddler is specified, [[MiniBrowserList]] is used by default. In addition, when adding/deleting favorites, the plugin automatically updates [[MiniBrowserList]], regardless of any alternative lists of favorites stored in separate tiddlers. After changes to [[MiniBrowserList]] are made, you can then use cut/paste to manually move entries from that tiddler into other tiddlers.//
<<<
!!!!!Configuration
<<<
Default mini browser size:
width: <<option txtMiniBrowserWidth>> height: <<option txtMiniBrowserHeight>>
<<<
!!!!!Example
>{{{<<miniBrowser>>}}}<br>{{smallform small{<<miniBrowser>>}}}
>{{{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}<br>{{smallform small{<<miniBrowser hidecontrols http://www.TiddlyWiki.com>>}}}
!!!!!Revisions
<<<
2008.04.07 [1.2.1] added txtMiniBrowserWidth and txtMiniBrowserHeight. cleanup init handling (somewhat)
2008.04.06 [1.2.0] added support for specifying initial URL to view (suggested by Richard Berg). When opening a URL, select matching entry (if any) in bookmarks droplist. Added support for hiding minibrowser controls.
2008.01.19 [1.1.0] added support for optional extra favorites lists stored in separate tiddlers
2007.10.15 [1.0.0] combined MiniBrowser and MediaCenter inline scripts and converted to true plugin
2006.03.01 [0.0.0] inline script
<<<
!!!!!Code
***/
//{{{
version.extensions.MiniBrowser={major: 1, minor: 2, revision: 1, date: new Date(2008,4,6)};
//}}}
//{{{
config.shadowTiddlers.MiniBrowser="<<miniBrowser>>";
//}}}
//{{{
if (config.options.txtMiniBrowserWidth==undefined) config.options.txtMiniBrowserWidth="100%";
if (config.options.txtMiniBrowserHeight==undefined) config.options.txtMiniBrowserHeight="480";
//}}}
//{{{
config.macros.miniBrowser= {
favoritesList:
"MiniBrowserList",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var noPlayer=params[0]&¶ms[0].toLowerCase()=="noplayer"; if (noPlayer) params.shift();
if (!config.macros.player) noPlayer=true; // if PlayerPlugin not installed
var hideControls=params[0]&¶ms[0].toLowerCase()=="hidecontrols"; if (hideControls) params.shift();
var url=(params[0]&&!store.tiddlerExists(params[0]))?params.shift():"";
hideControls=hideControls&&url.length; // if no initial URL, then show controls anyway
var w=config.options.txtMiniBrowserWidth;
var h=config.options.txtMiniBrowserHeight;
// create form
var guid=new Date().getTime()+Math.random().toString(); // globally unique ID
var html=this.html;
html=html.replace(/%id%/g,guid);
html=html.replace(/%noplayer%/g,noPlayer?"true":"");
html=html.replace(/%hidecontrols%/g,hideControls?"none":"block");
html=html.replace(/%favorites%/g,params[0]||config.macros.miniBrowser.favoritesList);
createTiddlyElement(place,"span").innerHTML=html;
// init form
document.getElementById("minibrowser_controls_"+guid).style.display=hideControls?"none":"block";
document.getElementById("minibrowser_resize_"+guid).style.display=hideControls?"none":"block";
document.getElementById("minibrowser_togglecontrols_"+guid).checked=!hideControls;
document.getElementById("minibrowser_form_"+guid).url.value=url;
document.getElementById("minibrowser_form_"+guid).w.value=w;
document.getElementById("minibrowser_form_"+guid).h.value=h;
if (noPlayer) { // hide "type" list no PlayerPlugin
document.getElementById("minibrowser_type_"+guid).style.display="none";
document.getElementById("minibrowser_url_"+guid).style.width="36%";
}
// load bookmarks droplist from HR-separated tiddler contents
var b=document.getElementById("minibrowser_bookmarks_"+guid);
while (b.options[1]) b.options[1]=null; // clear list but leave 'prompt' item
var p; while (p=params.shift()) this.getFavorites(b,p); // load custom bookmarks
if (b.length<2) this.getFavorites(b,config.macros.miniBrowser.favoritesList); // default list
// load initial URL (if any)
var place=document.getElementById("minibrowser_player_"+guid);
this.load(place,guid,"","",w,h,true,noPlayer);
this.go(document.getElementById("minibrowser_form_"+guid));
},
getFavorites: function(list,tid) {
var txt=store.getTiddlerText(tid); if (!txt||!txt.trim().length) return;
var parts=txt.split("\n----\n");
for (var p=0; p<parts.length; p++) {
var lines=parts[p].split("\n");
var label=lines.shift()||""; // 1st line=display text
var value=lines.shift()||""; // 2nd line=item value
var indent=value&&value.length?"\xa0\xa0":"";
list.options[list.length]=new Option(indent+label,value,false,false);
}
},
load: function(place,id,type,url,w,h,showcontrols,noPlayer) {
if (noPlayer) {
if (!place) place=document.getElementById(id).parentNode;
place.innerHTML="<iframe name='"+id+"' id='"+id+"' \
src='"+url+"' width='"+w+"' height='"+h+"' \
style='background:#fff;border:1px solid'></iframe>"
} else
config.macros.player.loadURL(place,id,type,url,w,h,showcontrols);
},
go: function(f) {
var url=f.url.value.trim();
if (!url.length) url=f.url.value=f.bookmarks.value.trim();
if (!url.length) { this.done(f); return false; }
var id=f.playerID.value;
document.getElementById("minibrowser_player_"+id).style.display="block";
document.getElementById("minibrowser_controls2_"+id).style.display="block";
this.load(null,id,f.type.value,f.url.value,f.w.value,f.h.value,f.ctrls.checked,f.noPlayer.value=="true");
var matched=false; for (var i=0; i<f.bookmarks.options.length; i++) // select matching bookmark
if (f.bookmarks.options[i].value==url) { f.bookmarks.selectedIndex=i; matched=true; break; }
if (!matched) f.bookmarks.selectedIndex=0;
f.done.disabled=false;
return false;
},
done: function(f) {
var id=f.playerID.value;
this.load(null,id,null,null,f.w.value,0,f.ctrls.checked,f.noPlayer.value=="true");
document.getElementById("minibrowser_player_"+id).style.display="none";
document.getElementById("minibrowser_controls2_"+id).style.display="none";
f.done.disabled=true;
return false;
},
fit: function(place) {
var trim=89; // fudge factor to account for the other controls + padding + borders. ADJUST THIS VALUE TO FIT LAYOUT
var t=story.findContainingTiddler(place);
if (!t) { t=place; while (t && t.className!='floatingPanel') t=t.parentNode; } if (!t) return;
var w="100%"; // horizontal stretching via CSS works, but vertical stretching doesn't... so:
var h=t.offsetHeight-trim; // workaround: get containing panel/tiddler height and subtract "trim" height
var f=place.form;
this.load(null,f.playerID.value,f.type.value,f.url.value,w,h,f.ctrls.checked,f.noPlayer.value=="true"); // reload player with new size
place.form.w.value=w; place.form.h.value=h; // update width/height input fields
},
add: function(place,title) {
var v=place.value; if (!v.length) return;
var d=prompt("Please enter a description for\n"+place.value); if (!d || !d.length) return;
var who=config.options.txtUserName;
var when=new Date();
var tid=store.getTiddler(title);
var txt="%0\n%1\n----\n%2".format([d,v,tid?tid.text:""]);
store.saveTiddler(title,title,txt,who,when,tid?tid.tags:[],tid?tid.fields:{});
if (!tid) story.displayTiddler(story.findContainingTiddler(place),title);
else story.refreshTiddler(title,1,true);
var here=story.findContainingTiddler(place);
if (here) story.refreshTiddler(here.getAttribute("tiddler"),1,true);
},
del: function(place,title) {
var v=place.value; if (!v.length) return;
var d=place.options[place.selectedIndex].text; if (!d.length) return;
if (!confirm("Are you sure you want to remove this favorite?\n\n"+d+"\n"+v)) return;
var tid=store.getTiddler(title); if (!tid) return;
var who=config.options.txtUserName;
var when=new Date();
var pat='%0\n%1\n----\n'.format([d.replace(/\xa0/g,''),v]); var re=new RegExp(pat,"i");
var txt=tid.text.replace(re,"");
store.saveTiddler(title,title,txt,who,when,tid?tid.tags:[],tid?tid.fields:{});
story.refreshTiddler(title,1,true);
var here=story.findContainingTiddler(place);
if (here) story.refreshTiddler(here.getAttribute("tiddler"),1,true);
},
html: "<form id='minibrowser_form_%id%' style='display:block;margin:0;padding:0' onsubmit='return config.macros.miniBrowser.go(this);'><!-- \
--><nobr><input type='hidden' name='playerID' value='%id%'><input type='hidden' name='noPlayer' value='%noplayer%'><!-- \
--><div id='minibrowser_controls_%id%' style='display:%hidecontrols%'><!-- \
--><input type='button' value='<' title='back' style='font-size:8pt;width:3%' \
onclick='try{window.frames[\"player_%id%\"].history.go(-1)}catch(e){window.history.go(-1)}' ><!-- \
--><input type='button' value='>' title='forward' style='font-size:8pt;width:3%' \
onclick='try{window.frames[\"player_%id%\"].history.go(+1)}catch(e){window.history.go(+1)}'><!-- \
--><input type='button' value='+' title='refresh'style='font-size:8pt;width:3%' \
onclick='try{window.frames[\"player_%id%\"].location.reload()}catch(e){;}'><!-- \
--><input type='button' value='x' title='stop'style='font-size:8pt;width:3%' \
onclick='window.stop()'><!-- \
--><select name='bookmarks' id='minibrowser_bookmarks_%id%' size='1' style='font-size:8pt;width:20%' \
onchange='this.form.url.value=this.value; return config.macros.miniBrowser.go(this.form);'><!-- \
--><option value=''>Farr Browser...select</option><!-- \
--></select><!-- \
--><input type='button' value='add' title='add URL to the bookmarks' style='font-size:8pt;width:5%' \
favorites=\"%favorites%\" \
onclick='config.macros.miniBrowser.add(this.form.url,this.getAttribute(\"favorites\"));'><!-- \
--><input type='button' value='del' title='remove URL from the bookmarks' style='font-size:8pt;width:5%' \
favorites=\"%favorites%\" \
onclick='config.macros.miniBrowser.del(this.form.bookmarks,this.getAttribute(\"favorites\"));'><!-- \
--><input type='button' value='edit' title='edit the bookmarks list' style='font-size:8pt;width:5%' \
favorites=\"%favorites%\" \
onclick='story.displayTiddler(null,this.getAttribute(\"favorites\"),2)'><!-- \
--><input type='text' name='url' id='minibrowser_url_%id%' size='60' value='' style='font-size:8pt;width:23%' \
onfocus='this.select()'><!-- \
--><select name='type' id='minibrowser_type_%id%' size='1' style='font-size:8pt;width:13%'><!-- \
--><option value=''>media type...</option><!-- \
--><option value=''>auto-detect</option><!-- \
--><option value='iframe'>web page</option><!-- \
--><option value='windows'>windows media</option><!-- \
--><option value='realone'>real one</option><!-- \
--><option value='quicktime'>quicktime</option><!-- \
--><option value='flash'>flash</option><!-- \
--><option value='image'>jpg/gif/png</option><!-- \
--></select><!-- \
--><input type='submit' value='go' title='view URL in embedded player' style='font-size:8pt;width:4%'><!-- \
--><input type='button' value='open' title='view URL in a separate player' style='font-size:8pt;width:6%' \
onclick='if (this.form.url.value.length) window.open(this.form.url.value)'><!-- \
--><input type='button' value='done' name='done' disabled title='disconnect from URL' style='font-size:8pt;width:6%' \
onclick='return config.macros.miniBrowser.done(this.form);'><!-- \
--></div><!-- \
--><div id='minibrowser_player_%id%' style='display:none;text-align:center'></div><!-- \
--><span id='minibrowser_controls2_%id%' style='margin-top:2px;display:none;font-size:8pt;'><!-- \
--><div id='minibrowser_resize_%id%' style='display:%hidecontrols%;float:right;font-size:8pt'><!-- \
--> size: <input type='text' name='w' size='3' value='' style='font-size:8pt;' \
onfocus='this.select()'><!-- \
-->x<input type='text' name='h' size='3' value='' style='font-size:8pt;' \
onfocus='this.select()'><!-- \
--> <input type='submit' value='set' style='font-size:8pt;width:5%' \
onclick='var f=this.form; \
if(!f.w.value.trim().length) f.w.value=config.options.txtMiniBrowserWidth; \
if(!f.h.value.trim().length) f.h.value=config.options.txtMiniBrowserHeight; \
config.options.txtMiniBrowserWidth=f.w.value; config.options.txtMiniBrowserHeight=f.h.value; \
saveOptionCookie(\"txtMiniBrowserWidth\"); saveOptionCookie(\"txtMiniBrowserHeight\");'><!-- \
--><input type='submit' value='reset' style='font-size:8pt;width:5%' \
onclick='var f=this.form; f.ctrls.checked=true; f.w.value=\"100%\"; f.h.value=\"480\"; \
config.options.txtMiniBrowserWidth=f.w.value; config.options.txtMiniBrowserHeight=f.h.value; \
saveOptionCookie(\"txtMiniBrowserWidth\"); saveOptionCookie(\"txtMiniBrowserHeight\");'><!-- \
--><input type='button' value='fit' title='resize player to fit containing window' style='font-size:8pt;width:5%' \
onclick='config.macros.miniBrowser.fit(this)'><!-- \
--></div><!-- \
--> <input type='checkbox' name='ctrls' id='minibrowser_togglecontrols_%id%' title='toggle minibrowser controls' CHECKED \
onclick='document.getElementById(\"minibrowser_controls_%id%\").style.display=this.checked?\"block\":\"none\"; \
document.getElementById(\"minibrowser_resize_%id%\").style.display=this.checked?\"block\":\"none\";' \
><a href='' title='toggle minibrowser controls' \
onclick='this.previousSibling.click();return false;'>show controls</a><!-- \
--></span><!-- \
--></nobr></form> \
"
}
//}}}
/%
|Name|NextTiddler|
|Source|http://www.TiddlyTools.com/#NextTiddler|
|Version|0.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|insert a link that, when clicked, closes the current tiddler and opens another one in its place|
usage: <<tiddler NextTiddler with: NewTiddlerTitle linktext>>
%/<script label="$2">
var tiddler=story.findContainingTiddler(place);
story.displayTiddler(tiddler,"$1");
story.closeTiddler(tiddler.getAttribute("tiddler")); // close self
return false;
</script>
/***
!!!<<gradient horiz #fcb #fff >> PageCSS <<tiddler RefreshStyles>>>>/%==================================================%/
{{{
background:url("http://img261.imageshack.us/img261/8603/navbargrayhw1.png") repeat-x top left;top left;
http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif
background:url("http://img181.imageshack.us/img181/4080/headerredtv7.png") repeat-x top left;top left;
}}}
***/
#contentWrapper{
background: #fff;
border:0px solid #DDD;
margin: 0 0em;
padding-top: 0px;
}
body { background: url("http://img168.imageshack.us/img168/1254/leftbackdo6.gif"); background-repeat: repeat;
background: #abf;
}
#outer {
width:100%;
margin:auto;
}
#hdr {
height:100%;
background:url("http://img261.imageshack.us/img261/8603/navbargrayhw1.png") repeat-x top left;top left;
background-color:#eee;
color: #333333;
white-space:nowrap;
}
#hdr a:hover {
background: #FFF;
color: #F00;
}
#slantedmenu {
height:100%;
white-space:nowrap;
}
#bar {
height:100%;
}
#bodyblock {
position:relative;
background: #dcdcdc;
color: #333333;
width:650px;
padding:0;
}
#l-col {
float:left;
background:#dcdcdc;
color: #333333;
width:145px;
}
#cont {
width:100%;
background:#ffffff;
color: #333333;
text-align:left;
margin:auto;
}
#systemcontents {
height: 350px;
width: 100%;
position:relative;
overflow: auto;
margin:auto;
}
#ftr {
height:100%;
background:#fff;
color: #333333;
border:solid black;
border-width:1px 0 0 0;
margin-top:1em;
margin-bottom:1em;
}
/* Presentation Stylesheet */
h3, p {
margin:0;
padding:15px;
}
h4 {
margin:0;
padding: 5px 0;
}
p:first-letter {
font-size: 80%;
font-weight: bold;
color:blue;
}
<!--{{{-->
<div id="outer"><div id='hdr' align='left' refresh='content' tiddler='SilverHeader'></div><a name="top"></a>
<div id='slantedmenu' refresh='content' tiddler='SlantedMenu'></div><div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div><div id="cont">
<div id='displayArea'><div id='tiddlerDisplay'></div>
<div id='messageArea'></div>
</div><div id="ftr" align="center" refresh='content' tiddler='contentFooter'></div><div id='sidebar'></div></div></div
<!--}}}-->
/***
|Name|PlayerPlugin|
|Source|http://www.TiddlyTools.com/#PlayerPlugin|
|Version|1.1.4|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Options|##Configuration|
|Description|Embed a media player in a tiddler|
!!!!!Usage
<<<
{{{<<player [id=xxx] [type] [URL] [width] [height] [autoplay|true|false] [showcontrols|true|false] [extras]>>}}}
''id=xxx'' is optional, and specifies a unique identifier for each embedded player. note: this is required if you intend to display more than one player at the same time.
''type'' is optional, and is one of the following: ''windows'', ''realone'', ''quicktime'', ''flash'', ''image'' or ''iframe''. If the media type is not specified, the plugin automatically detects Windows, Real, QuickTime, Flash video or JPG/GIF images by matching known file extensions and/or specialized streaming-media transfer protocols (such as RTSP:). For unrecognized media types, the plugin displays an error message.
''URL'' is the location of the media content
''width'' and ''height'' are the dimensions of the video display area (in pixels)
''autoplay'' or ''true'' or ''false'' is optional, and specifies whether the media content should begin playing as soon as it is loaded, or wait for the user to press the "play" button. Default is //not// to autoplay.
''showcontrols'' or ''true'' or ''false'' is optional, and specifies whether the embedded media player should display its built-in control panel (e.g., play, pause, stop, rewind, etc), if any. Default is to display the player controls.
''extras'' are optional //pairs// of parameters that can be passed to the embedded player, using the {{{<param name=xxx value=yyy>}}} HTML syntax.
''If you use [[AttachFilePlugin]] to encode and store a media file within your document, you can play embedded media content by using the title of the //attachment tiddler//'' as a parameter in place of the usual reference to an external URL. When playing an attached media content, you should always explicitly specify the media type parameter, because the name used for the attachment tiddler may not contain a known file extension from which a default media type can be readily determined.
<<<
!!!!!Configuration
<<<
Default player size:
width: <<option txtPlayerDefaultWidth>> height: <<option txtPlayerDefaultHeight>>
<<<
!!!!!Examples
<<<
+++[Windows Media]...
Times Square Live Webcam
{{{<<player id=1 http://www.earthcam.com/usa/newyork/timessquare/asx/tsq_stream.asx>>}}}
<<player id=1 http://www.earthcam.com/usa/newyork/timessquare/asx/tsq_stream.asx>>
===
+++[RealOne]...
BBC London: Live and Recorded news
{{{<<player id=2 http://www.bbc.co.uk/london/realmedia/news/tvnews.ram>>}}}
<<player id=2 http://www.bbc.co.uk/london/realmedia/news/tvnews.ram>>
===
+++[Quicktime]...
America Free TV: Classic Comedy
{{{<<player id=3 http://www.americafree.tv/unicast_mov/AmericaFreeTVComedy.mov>>}}}
<<player id=3 http://www.americafree.tv/unicast_mov/AmericaFreeTVComedy.mov>>
===
+++[Flash]...
Asteroids arcade game
{{{<<player id=4 http://www.80smusiclyrics.com/games/asteroids/asteroids.swf 400 300>>}}}
<<player id=4 http://www.80smusiclyrics.com/games/asteroids/asteroids.swf 400 300>>
Google Video
{{{<<player id=5 flash http://video.google.com/googleplayer.swf?videoUrl=http%3A%2F%2Fvp.video.google.com%2Fvideodownload%3Fversion%3D0%26secureurl%3DoQAAAIVnUNP6GYRY8YnIRNPe4Uk5-j1q1MVpJIW4uyEFpq5Si0hcSDuig_JZcB9nNpAhbScm9W_8y_vDJQBw1DRdCVbXl-wwm5dyUiiStl_rXt0ATlstVzrUNC4fkgK_j7nmse7kxojRj1M3eo3jXKm2V8pQjWk97GcksMFFwg7BRAXmRSERexR210Amar5LYzlo9_k2AGUWPLyRhMJS4v5KtDSvNK0neL83ZjlHlSECYXyk%26sigh%3Dmpt2EOr86OAUNnPQ3b9Tr0wnDms%26begin%3D0%26len%3D429700%26docid%3D-914679554478687740&thumbnailUrl=http%3A%2F%2Fvideo.google.com%2FThumbnailServer%3Fcontentid%3De7e77162deb04c42%26second%3D5%26itag%3Dw320%26urlcreated%3D1144620753%26sigh%3DC3fqXPPS1tFiUqLzmkX3pdgYc2Y&playerId=-91467955447868774 400 326>>}}}
<<player id=5 flash http://video.google.com/googleplayer.swf?videoUrl=http%3A%2F%2Fvp.video.google.com%2Fvideodownload%3Fversion%3D0%26secureurl%3DoQAAAIVnUNP6GYRY8YnIRNPe4Uk5-j1q1MVpJIW4uyEFpq5Si0hcSDuig_JZcB9nNpAhbScm9W_8y_vDJQBw1DRdCVbXl-wwm5dyUiiStl_rXt0ATlstVzrUNC4fkgK_j7nmse7kxojRj1M3eo3jXKm2V8pQjWk97GcksMFFwg7BRAXmRSERexR210Amar5LYzlo9_k2AGUWPLyRhMJS4v5KtDSvNK0neL83ZjlHlSECYXyk%26sigh%3Dmpt2EOr86OAUNnPQ3b9Tr0wnDms%26begin%3D0%26len%3D429700%26docid%3D-914679554478687740&thumbnailUrl=http%3A%2F%2Fvideo.google.com%2FThumbnailServer%3Fcontentid%3De7e77162deb04c42%26second%3D5%26itag%3Dw320%26urlcreated%3D1144620753%26sigh%3DC3fqXPPS1tFiUqLzmkX3pdgYc2Y&playerId=-91467955447868774 400 326>>
YouTube Video
{{{<<player id=6 flash http://www.youtube.com/v/OdT9z-JjtJk 400 300>>}}}
<<player id=6 flash http://www.youtube.com/v/OdT9z-JjtJk 400 300>>
===
+++[Still Images]...
GIF (best for illustrations, animations, diagrams, etc.)
{{{<<player id=7 image images/meow.gif auto auto>>}}}
<<player id=7 image images/meow.gif auto auto>>
JPG (best for photographs, scanned images, etc.)
{{{<<player id=8 image images/meow2.jpg 200 150>>}}}
<<player id=8 image images/meow2.jpg 200 150>>
===
<<<
!!!!!Revisions
<<<
2008.05.10 [1.1.4] in handlers(), immediately return if no params (prevents error in macro). Also, refactored auto-detect code to make type mapping configurable.
2007.10.15 [1.1.3] in loadURL(), add recognition for .PNG (still image), fallback to iframe for unrecognized media types
2007.08.31 [1.1.2] added 'click-through' link for JPG/GIF images
2007.06.21 [1.1.1] changed "hidecontrols" param to "showcontrols" and recognize true/false values in addition to 'showcontrols', added "autoplay" param (also recognize true/false values), allow "auto" as value for type param
2007.05.22 [1.1.0] added support for type=="iframe" (displays src URL in an IFRAME)
2006.12.06 [1.0.1] in handler(), corrected check for config.macros.attach (instead of config.macros.attach.getAttachment) so that player plugin will work when AttachFilePlugin is NOT installed. (Thanks to Phillip Ehses for bug report)
2006.11.30 [1.0.0] support embedded media content using getAttachment() API defined by AttachFilePlugin or AttachFilePluginFormatters. Also added support for 'image' type to render JPG/GIF still images
2006.02.26 [0.7.0] major re-write. handles default params better. create/recreate player objects via loadURL() API for use with interactive forms and scripts.
2006.01.27 [0.6.0] added support for 'extra' macro params to pass through to object parameters
2006.01.19 [0.5.0] Initial ALPHA release
2005.12.23 [0.0.0] Started
<<<
!!!!!Code
***/
//{{{
version.extensions.player = {major: 1, minor: 1, revision: 4, date: new Date(2008,5,10)};
config.macros.player = {};
config.macros.player.html = {};
config.macros.player.handler= function(place,macroName,params) {
if (!params.length) return; // missing parameters - do nothing
var id=null;
if (params[0].substr(0,3)=="id=") id=params.shift().substr(3);
var type="";
if (!params.length) return; // missing parameters - do nothing
var p=params[0].toLowerCase();
if (p=="auto" || p=="windows" || p=="realone" || p=="quicktime" || p=="flash" || p=="image" || p=="iframe")
type=params.shift().toLowerCase();
var url=params.shift(); if (!url || !url.trim().length) url="";
if (url.length && config.macros.attach!=undefined) // if AttachFilePlugin is installed
if ((tid=store.getTiddler(url))!=null && tid.isTagged("attachment")) // if URL is attachment
url=config.macros.attach.getAttachment(url); // replace TiddlerTitle with URL
var width=params.shift();
var height=params.shift();
var autoplay=false;
if (params[0]=='autoplay'||params[0]=='true'||params[0]=='false')
autoplay=(params.shift()!='false');
var show=true;
if (params[0]=='showcontrols'||params[0]=='true'||params[0]=='false')
show=(params.shift()!='false');
var extras="";
while (params[0]!=undefined)
extras+="<param name='"+params.shift()+"' value='"+params.shift()+"'> ";
this.loadURL(place,id,type,url,width,height,autoplay,show,extras);
}
if (config.options.txtPlayerDefaultWidth==undefined) config.options.txtPlayerDefaultWidth="100%";
if (config.options.txtPlayerDefaultHeight==undefined) config.options.txtPlayerDefaultHeight="480"; // can't use "100%"... player height doesn't stretch right :-(
config.macros.player.typeMap={
windows: ['mms', '.asx', '.wvx', '.wmv', '.mp3'],
realone: ['rtsp', '.ram', '.rpm', '.rm', '.ra'],
quicktime: ['.mov', '.qt'],
flash: ['.swf', '.flv'],
image: ['.jpg', '.gif', '.png'],
iframe: ['.htm', '.html', '.shtml', '.php']
};
config.macros.player.loadURL=function(place,id,type,url,width,height,autoplay,show,extras) {
if (id==undefined) id="tiddlyPlayer";
if (!width) var width=config.options.txtPlayerDefaultWidth;
if (!height) var height=config.options.txtPlayerDefaultHeight;
if (url && (!type || !type.length || type=="auto")) { // determine type from URL
u=url.toLowerCase();
var map=config.macros.player.typeMap;
for (var t in map) for (var i=0; i<map[t].length; i++)
if (u.indexOf(map[t][i])!=-1) var type=t;
}
if (!type || !config.macros.player.html[type]) var type="none";
if (!url) var url="";
if (show===undefined) var show=true;
if (!extras) var extras="";
if (type=="none" && url.trim().length) type="iframe"; // fallback to iframe for unrecognized media types
// adjust parameter values for player-specific embedded HTML
switch (type) {
case "windows":
autoplay=autoplay?"1":"0"; // player-specific param value
show=show?"1":"0"; // player-specific param value
break;
case "realone":
autoplay=autoplay?"true":"false";
show=show?"block":"none";
height-=show?60:0; // leave room for controls
break;
case "quicktime":
autoplay=autoplay?"true":"false";
show=show?"true":"false";
break;
case "image":
show=show?"block":"none";
break;
case "iframe":
show=show?"block":"none";
break;
}
// create containing div for player HTML
// and add or replace player in TW DOM structure
var newplayer = document.createElement("div");
newplayer.playerType=type;
newplayer.setAttribute("id",id+"_div");
var existing = document.getElementById(id+"_div");
if (existing && !place) place=existing.parentNode;
if (!existing)
place.appendChild(newplayer);
else {
if (place==existing.parentNode) place.replaceChild(newplayer,existing)
else { existing.parentNode.removeChild(existing); place.appendChild(newplayer); }
}
var html=config.macros.player.html[type];
html=html.replace(/%i%/mg,id);
html=html.replace(/%w%/mg,width);
html=html.replace(/%h%/mg,height);
html=html.replace(/%u%/mg,url);
html=html.replace(/%a%/mg,autoplay);
html=html.replace(/%s%/mg,show);
html=html.replace(/%x%/mg,extras);
newplayer.innerHTML=html;
}
//}}}
// // Player-specific API functions: isReady(id), isPlaying(id), toggleControls(id), showControls(id,flag)
//{{{
// status values:
// Windows: 0=Undefined, 1=Stopped, 2=Paused, 3=Playing, 4=ScanForward, 5=ScanReverse
// 6=Buffering, 7=Waiting, 8=MediaEnded, 9=Transitioning, 10=Ready, 11=Reconnecting
// RealOne: 0=Stopped, 1=Contacting, 2=Buffering, 3=Playing, 4=Paused, 5=Seeking
// QuickTime: 'Waiting', 'Loading', 'Playable', 'Complete', 'Error:###'
// Flash: 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete
config.macros.player.isReady=function(id)
{
var d=document.getElementById(id+"_div"); if (!d) return false;
var p=document.getElementById(id); if (!p) return false;
if (d.playerType=='windows') return !((p.playState==0)||(p.playState==7)||(p.playState==9)||(p.playState==11));
if (d.playerType=='realone') return (p.GetPlayState()>1);
if (d.playerType=='quicktime') return !((p.getPluginStatus()=='Waiting')||(p.getPluginStatus()=='Loading'));
if (d.playerType=='flash') return (p.ReadyState>2);
return true;
}
config.macros.player.isPlaying=function(id)
{
var d=document.getElementById(id+"_div"); if (!d) return false;
var p=document.getElementById(id); if (!p) return false;
if (d.playerType=='windows') return (p.playState==3);
if (d.playerType=='realone') return (p.GetPlayState()==3);
if (d.playerType=='quicktime') return (p.getPluginStatus()=='Complete');
if (d.playerType=='flash') return (p.ReadyState<4);
return false;
}
config.macros.player.showControls=function(id,flag) {
var d=document.getElementById(id+"_div"); if (!d) return false;
var p=document.getElementById(id); if (!p) return false;
if (d.playerType=='windows') { p.ShowControls=flag; p.ShowStatusBar=flag; }
if (d.playerType=='realone') { alert('show/hide controls not available'); }
if (d.playerType=='quicktime') // if player not ready, retry in one second
{ if (this.isReady(id)) p.setControllerVisible(flag); else setTimeout('config.macros.player.showControls("'+id+'",'+flag+')',1000); }
if (d.playerType=='flash') { alert('show/hide controls not available'); }
}
config.macros.player.toggleControls=function(id) {
var d=document.getElementById(id+"_div"); if (!d) return false;
var p=document.getElementById(id); if (!p) return false;
if (d.playerType=='windows') var flag=!p.ShowControls;
if (d.playerType=='realone') var flag=true; // TBD
if (d.playerType=='quicktime') var flag=!p.getControllerVisible();
if (d.playerType=='flash') var flag=true; // TBD
this.showControls(id,flag);
}
config.macros.player.fullScreen=function(id) {
var d=document.getElementById(id+"_div"); if (!d) return false;
var p=document.getElementById(id); if (!p) return false;
if (d.playerType=='windows') p.DisplaySize=3;
if (d.playerType=='realone') p.SetFullScreen();
if (d.playerType=='quicktime') { alert('full screen not available'); }
if (d.playerType=='flash') { alert('full screen not available'); }
}
//}}}
// // Player HTML
//{{{
// placeholder (no player)
config.macros.player.html.none=' \
<table id="%i%" width="%w%" height="%h%" style="background-color:#111;border:0;margin:0;padding:0;"> \
<tr style="background-color:#111;border:0;margin:0;padding:0;"> \
<td width="%w%" height="%h%" style="background-color:#111;color:#ccc;border:0;margin:0;padding:0;text-align:center;"> \
\
%u% \
\
</td></tr></table>';
//}}}
//{{{
// JPG/GIF/PNG still images
config.macros.player.html.image='\
<a href="%u%" target="_blank"><img width="%w%" height="%h%" style="display:%s%;" src="%u%"></a>';
//}}}
//{{{
// IFRAME web page viewer
config.macros.player.html.iframe='\
<iframe id="%i%" width="%w%" height="%h%" style="display:%s%;background:#fff;" src="%u%"></iframe>';
//}}}
//{{{
// Windows Media Player
// v7.1 ID: classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6
// v9 ID: classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95
config.macros.player.html.windows=' \
<object id="%i%" width="%w%" height="%h%" style="margin:0;padding:0;width:%w%;height:%h%px;" \
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" \
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" \
align="baseline" border="0" \
standby="Loading Microsoft Windows Media Player components..." \
type="application/x-oleobject"> \
<param name="FileName" value="%u%"> <param name="ShowControls" value="%s%"> \
<param name="ShowPositionControls" value="1"> <param name="ShowAudioControls" value="1"> \
<param name="ShowTracker" value="1"> <param name="ShowDisplay" value="0"> \
<param name="ShowStatusBar" value="1"> <param name="AutoSize" value="1"> \
<param name="ShowGotoBar" value="0"> <param name="ShowCaptioning" value="0"> \
<param name="AutoStart" value="%a%"> <param name="AnimationAtStart" value="1"> \
<param name="TransparentAtStart" value="0"> <param name="AllowScan" value="1"> \
<param name="EnableContextMenu" value="1"> <param name="ClickToPlay" value="1"> \
<param name="InvokeURLs" value="1"> <param name="DefaultFrame" value="datawindow"> \
%x% \
<embed src="%u%" style="margin:0;padding:0;width:%w%;height:%h%px;" \
align="baseline" border="0" width="%w%" height="%h%" \
type="application/x-mplayer2" \
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/default.asp" \
name="%i%" showcontrols="%s%" showpositioncontrols="1" \
showaudiocontrols="1" showtracker="1" showdisplay="0" \
showstatusbar="%s%" autosize="1" showgotobar="0" showcaptioning="0" \
autostart="%a%" autorewind="0" animationatstart="1" transparentatstart="0" \
allowscan="1" enablecontextmenu="1" clicktoplay="0" invokeurls="1" \
defaultframe="datawindow"> \
</embed> \
</object>';
//}}}
//{{{
// RealNetworks' RealOne Player
config.macros.player.html.realone=' \
<table width="%w%" style="border:0;margin:0;padding:0;"><tr style="border:0;margin:0;padding:0;"><td style="border:0;margin:0;padding:0;"> \
<object id="%i%" width="%w%" height="%h%" style="margin:0;padding:0;" \
CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"> \
<PARAM NAME="CONSOLE" VALUE="player"> \
<PARAM NAME="CONTROLS" VALUE="ImageWindow"> \
<PARAM NAME="AUTOSTART" Value="%a%"> \
<PARAM NAME="MAINTAINASPECT" Value="true"> \
<PARAM NAME="NOLOGO" Value="true"> \
<PARAM name="BACKGROUNDCOLOR" VALUE="#333333"> \
<PARAM NAME="SRC" VALUE="%u%"> \
%x% \
<EMBED width="%w%" height="%h%" controls="ImageWindow" type="audio/x-pn-realaudio-plugin" style="margin:0;padding:0;" \
name="%i%" \
src="%u%" \
console=player \
maintainaspect=true \
nologo=true \
backgroundcolor=#333333 \
autostart=%a%> \
</OBJECT> \
</td></tr><tr style="border:0;margin:0;padding:0;"><td style="border:0;margin:0;padding:0;"> \
<object id="%i%_controls" width="%w%" height="60" style="margin:0;padding:0;display:%s%" \
CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"> \
<PARAM NAME="CONSOLE" VALUE="player"> \
<PARAM NAME="CONTROLS" VALUE="All"> \
<PARAM NAME="NOJAVA" Value="true"> \
<PARAM NAME="MAINTAINASPECT" Value="true"> \
<PARAM NAME="NOLOGO" Value="true"> \
<PARAM name="BACKGROUNDCOLOR" VALUE="#333333"> \
<PARAM NAME="SRC" VALUE="%u%"> \
%x% \
<EMBED WIDTH="%w%" HEIGHT="60" NOJAVA="true" type="audio/x-pn-realaudio-plugin" style="margin:0;padding:0;display:%s%" \
controls="All" \
name="%i%_controls" \
src="%u%" \
console=player \
maintainaspect=true \
nologo=true \
backgroundcolor=#333333> \
</OBJECT> \
</td></tr></table>';
//}}}
//{{{
// QuickTime Player
config.macros.player.html.quicktime=' \
<OBJECT ID="%i%" WIDTH="%w%" HEIGHT="%h%" style="margin:0;padding:0;" \
CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" \
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"> \
<PARAM name="SRC" VALUE="%u%"> \
<PARAM name="AUTOPLAY" VALUE="%a%"> \
<PARAM name="CONTROLLER" VALUE="%s%"> \
<PARAM name="BGCOLOR" VALUE="#333333"> \
<PARAM name="SCALE" VALUE="aspect"> \
<PARAM name="SAVEEMBEDTAGS" VALUE="true"> \
%x% \
<EMBED name="%i%" WIDTH="%w%" HEIGHT="%h%" style="margin:0;padding:0;" \
SRC="%u%" \
AUTOPLAY="%a%" \
SCALE="aspect" \
CONTROLLER="%s%" \
BGCOLOR="#333333" \
EnableJavaSript="true" \
PLUGINSPAGE="http://www.apple.com/quicktime/download/"> \
</EMBED> \
</OBJECT>';
//}}}
//{{{
// Flash Player
config.macros.player.html.flash='\
<object id="%i%" width="%w%" height="%h%" style="margin:0;padding:0;" \
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"> \
<param name="movie" value="%u%"> \
<param name="quality" value="high"> \
<param name="SCALE" value="exactfit"> \
<param name="bgcolor" value="333333"> \
%x% \
<embed name="%i%" src="%u%" style="margin:0;padding:0;" \
height="%h%" width="%w%" quality="high" \
pluginspage="http://www.macromedia.com/go/getflashplayer" \
type="application/x-shockwave-flash" scale="exactfit"> \
</embed> \
</object>';
//}}}
!!!!!<<gradient horiz #fcb #fff>> [[Plugins]]>>
@@color:#C06;''» »'' @@ Tabs containing programs (plugins) written in ~JavaScript (if tagged as systemConfig begin running at startup.)
----
<script>
// get all tiddlers tagged with "systemConfig"
var tids=store.getTaggedTiddlers("systemConfig");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("systemConfig")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
!!!!!Executing "A Browser To Farr"
<<<
ZIP Paths:
{{{"FindAndRunRobot\AliasGroups\Installed\TWHelp\Browser\farrbrowser.alias"}}}
{{{"FindAndRunRobot\MyLocalData\TiddlyWiki\btf\farrbrowser.html"}}}
<<<
<<<
This alias executes the ~TiddlyWiki "Browser to Farr"
To use this from FARR just type: ''btf '' then hit ''Enter''
<<<
!!!!!About the files
<<<
''NOTE:'' Your edits of farrbrowser.html and backup files are saved inside this folder:
''~FindAndRunRobot\~MyLocalData\~TiddlyWiki\btf\''
*A new backup file is created each time you modify and save farrbrowser.html. These can add up over time so you should delete them after their need is well past.
<<<
!!!!!Deleting the main file "farrbrowser.html" will delete all of your edits!!
<<<
You can restore from any one of the backup files by renaming it "farrbrowser.html".
There is a copy of the original file (less any edits you have done) in ~OriginalBlankFile
This version of farrbrowser.html is built from ~TiddlyWiki 2.4 core.
<<<
!!!!!About the browser
<<<
There is another browser link named "BrowserWithMediaPlayer" that contains a plugin to allow a dropdown selection of various media types.
The browser URL dropdown options are stored in a text file named "MiniBrowserList" and can be edited from the browser toolbar.
''Note:''Open the main menu by clicking on "Menu" next to the top banner (A Browser To Farr) to gain access to the toolbars. Clicking on the banner itself returns the page to the original opening state closing all open tiddlers and executing the DefaultTiddlers.
<<<
Morris Gray
tiddlywikihelp@yahoo.com.au
----
|>|!The Menu |
|bgcolor:#fcb;''« Load'' |@@color:#c06;loads this page into FF sidebar@@|
|bgcolor:#fcb;''Tabs'' |@@color:#c06;toggles the tabs to hidden@@|
|bgcolor:#fcb;''Edit'' |@@color:#c06;toggles the toolbars to visible@@|
|bgcolor:#fcb;''View'' |@@color:#c06;all tabs by category@@|
|bgcolor:#fcb;''Tools''|@@color:#c06; for saving-admin-@@|
|bgcolor:#fcb;''Options'' |@@color:#c06; Search titles text tags@@|
|bgcolor:#fcb;''Font Size''|@@color:#c06; (''+ = –'') changes size +/– times 15@@|
@@color:#C06;''» »'' @@ Both toggles ''Edit'' and ''Tabs'' can be set to default to either ''show'' or ''hide'' upon startup; in the SlantedMenu. Tabs can be put into edit mode by double-clicking on them and can be saved by clicking on the exclamation-mark (!) in the tab itself. See more on editing below.
@@color:#C06;''» »'' @@ When first clicking on a toggle it usually takes a second click to get it into synch. after that one click should suffice per session.
/***
|Name|SaveAsPlugin|
|Source|http://www.TiddlyTools.com/#SaveAsPlugin|
|Documentation|http://www.TiddlyTools.com/#SaveAsPlugin|
|Version|1.0.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Save current document to a different path/filename|
!!!!!Documentation
<<<
Syntax: {{{<<saveAs>>}}}
<<saveAs>>
<<<
!!!!!Revisions
<<<
2008.04.12 [1.0.1] automatically add "saveAs" to backstage commands
2008.04.12 [1.0.0] initial release - derived from [[NewDocumentPlugin]]
<<<
!!!!!Code
***/
//{{{
version.extensions.SaveAsPlugin= {major: 1, minor: 0, revision: 1, date: new Date(2008,4,12)};
config.macros.saveAs = {
label: "save as...",
prompt: "Save current document to a different path/file",
filePrompt: "Please select or enter a target path/filename",
defaultFilename: "new.html",
okmsg: "%0 tiddlers written to %1",
failmsg: "An error occurred while creating %0",
handler: function(place,macroName,params)
{ var btn=createTiddlyButton(place,this.label,this.prompt,this.go); },
go: function() {
// make sure we are local
if (window.location.protocol!="file:") {
alert(config.messages.notFileUrlError);
if (store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null,config.messages.saveInstructions);
return;
}
// get current saved file
var currPath=getLocalPath(window.location.href);
var original=loadFile(currPath);
if (!original) {
alert(config.messages.cantSaveError);
if (store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null,config.messages.saveInstructions);
return;
}
// get new target path/filename
var newPath=currPath;
var slashpos=newPath.lastIndexOf("/"); if (slashpos==-1) slashpos=newPath.lastIndexOf("\\");
if (slashpos!=-1) newPath=newPath.substr(0,slashpos+1); // trim filename
var newFile=currPath.substr(newPath.length); // trim path
if (!newFile.length) newFile=config.macros.saveAs.defaultFilename;
var target=config.macros.saveAs.ask(config.macros.saveAs.filePrompt,newPath,newFile);
if (!target) return; // cancelled by user
// if specified file does not include a path, assemble fully qualified path and filename
var slashpos=target.lastIndexOf("/"); if (slashpos==-1) slashpos=target.lastIndexOf("\\");
if (slashpos==-1) target=target+config.macros.saveAs.defaultFilename;
var link="file:///"+target.replace(/\\/g,'/'); // link for message text
// write target
if (saveFile(target,updateOriginal(original)))
var msg=config.macros.saveAs.okmsg.format([store.getTiddlers("title").length,target]);
else
var msg=config.macros.saveAs.failmsg.format([target]);
clearMessage(); displayMessage(msg,link);
},
ask: function(msg,path,file) {
if(window.Components) { // moz
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='html';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
}
catch(e) { alert('error during local file access: '+e.toString()) }
}
else { // IE
try { // XP/Vista only
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
s.FilterIndex=3; // default to HTML files;
s.InitialDir=path;
s.FileName=file;
if (s.showOpen()) var result=s.FileName;
}
catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
}
return result;
}
};
//}}}
//{{{
// automatically add saveAs to backstage
config.tasks.saveAs = {
text: "saveAs",
tooltip: config.macros.saveAs.prompt,
action: function(){ clearMessage(); config.macros.saveAs.go(); }
}
config.backstageTasks.splice(config.backstageTasks.indexOf("save")+1,0,"saveAs");
//}}}
!!!!!<<gradient horiz #fcb #fff>> Search Options>>
{{tablecenter table{
|bgcolor:#abf;@@color:#000;'' /enter search/ ''@@|
|bgcolor(#abf):<<search>>|
|<<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags|
|<<option chkHoldSearches>> Hold <<option chkCaseSensitiveSearch>> ~CaseSensitive|
}}}
{{tablecenter table{
|<<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags<<option chkHoldSearches>> Hold |
|>|@@color:#04b;font-weight:bold;goto ''» »'' @@<<gotoTiddler>>|
}}}
/***
|Name|SearchOptionsPlugin|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Documentation|http://www.TiddlyTools.com/#SearchOptionsPluginInfo|
|Version|2.7.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.search, TiddlyWiki.prototype.search, config.macros.search.onKeyPress|
|Options|##Configuration|
|Description|extend core search function with additional user-configurable options|
Extend core search function with additional user-configurable options including selecting which data items to search, enabling/disabling incremental key-by-key searches, and generating a ''list of matching tiddler'' instead of immediately displaying all matches. This plugin also adds syntax for rendering 'search links' within tiddler content to embed one-click searches using pre-defined 'hard-coded' search terms.
!!!!!Documentation
>see [[SearchOptionsPluginInfo]]
!!!!!Configuration
<<<
Search in:
<<option chkSearchTitles>> titles <<option chkSearchText>> text <<option chkSearchTags>> tags <<option chkSearchFields>> fields <<option chkSearchShadows>> shadows
<<option chkSearchList>> Show list of matches in [[SearchResults]]
<<option chkSearchIncremental>> Incremental (key-by-key) searching
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by date
<<<
!!!!!Revisions
<<<
2008.05.03 [2.7.1] in searchLink formatter handler(), use separate setAttribute() call instead of passing attribs to createTiddlyButton(). Avoids conflict with errant code in TiddlerNotesPlugin (v2.1 26/10/07)
|please see [[SearchOptionsPluginInfo]] for additional revision details|
2005.10.18 [1.0.0] Initial Release
<<<
!!!!!Code
***/
//{{{
version.extensions.searchOptions = {major: 2, minor: 7, revision: 1, date: new Date(2008,5,3)};
if (config.options.chkSearchTitles===undefined) config.options.chkSearchTitles=true;
if (config.options.chkSearchText===undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags===undefined) config.options.chkSearchTags=true;
if (config.options.chkSearchFields===undefined) config.options.chkSearchFields=true;
if (config.options.chkSearchTitlesFirst===undefined) config.options.chkSearchTitlesFirst=false;
if (config.options.chkSearchList===undefined) config.options.chkSearchList=false;
if (config.options.chkSearchByDate===undefined) config.options.chkSearchByDate=false;
if (config.options.chkSearchIncremental===undefined) config.options.chkSearchIncremental=true;
if (config.options.chkSearchShadows===undefined) config.options.chkSearchShadows=false;
if (config.macros.search.reportTitle==undefined)
config.macros.search.reportTitle="SearchResults"; // note: not a cookie!
//}}}
//{{{
// searchLink formatter:
// syntax: [search[text to find]] OR [search[text to display|text to find]]
config.formatters.push( {
name: "searchLink",
match: "\\[search\\[",
lookaheadRegExp: /\[search\[(.*?)(?:\|(.*?))?\]\]/mg,
prompt: "search for: '%0'",
handler: function(w)
{
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var label=lookaheadMatch[1];
var text=lookaheadMatch[2]||label;
var prompt=this.prompt.format([text]);
var btn=createTiddlyButton(w.output,label,prompt,
function(){story.search(this.getAttribute("searchText"))},"searchLink");
btn.setAttribute("searchText",text);
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
});
//}}}
//{{{
config.macros.search.searchOptions_onKeyPress = config.macros.search.onKeyPress;
config.macros.search.onKeyPress = function(e)
{
if(!e) var e = window.event;
if (config.options.chkSearchIncremental || e.keyCode==13 || e.keyCode==10 || e.keyCode==27)
config.macros.search.searchOptions_onKeyPress.apply(this,arguments);
}
//}}}
//{{{
Story.prototype.search = function(text,useCaseSensitive,useRegExp)
{
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack,config.options.chkSearchByDate?"modified":"title","excludeSearch");
if (config.options.chkSearchByDate) matches=matches.reverse(); // most recent changes first
var q = useRegExp ? "/" : "'";
clearMessage();
if (!matches.length) {
if (config.options.chkSearchList) discardSearchResults();
displayMessage(config.macros.search.failureMsg.format([q+text+q]));
} else {
if (config.options.chkSearchList)
reportSearchResults(text,matches);
else {
var titles = []; for(var t=0; t<matches.length; t++) titles.push(matches[t].title);
this.closeAllTiddlers(); story.displayTiddlers(null,titles);
displayMessage(config.macros.search.successMsg.format([matches.length, q+text+q]));
}
}
highlightHack = null;
}
//}}}
//{{{
TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)
{
var candidates = this.reverseLookup("tags",excludeTag,false,sortField);
// scan for matching titles first...
var results = [];
if (config.options.chkSearchTitles) {
for(var t=0; t<candidates.length; t++)
if(candidates[t].title.search(searchRegExp)!=-1)
results.push(candidates[t]);
if (config.options.chkSearchShadows)
for (var t in config.shadowTiddlers)
if ((t.search(searchRegExp)!=-1) && !store.tiddlerExists(t))
results.push((new Tiddler()).assign(t,config.shadowTiddlers[t]));
}
// then scan for matching text, tags, or field data
for(var t=0; t<candidates.length; t++) {
if (config.options.chkSearchText && candidates[t].text.search(searchRegExp)!=-1)
results.pushUnique(candidates[t]);
if (config.options.chkSearchTags && candidates[t].tags.join(" ").search(searchRegExp)!=-1)
results.pushUnique(candidates[t]);
if (config.options.chkSearchFields && store.forEachField!=undefined) // requires TW2.1 or above
store.forEachField(candidates[t],
function(tid,field,val) {
if (val.search(searchRegExp)!=-1) results.pushUnique(candidates[t]);
},
true); // extended fields only
}
// then check for matching text in shadows
if (config.options.chkSearchShadows)
for (var t in config.shadowTiddlers)
if ((config.shadowTiddlers[t].search(searchRegExp)!=-1) && !store.tiddlerExists(t))
results.pushUnique((new Tiddler()).assign(t,config.shadowTiddlers[t]));
// if not 'titles first', or sorting by modification date, re-sort results to so titles, text, tag and field matches are mixed together
if(!sortField) sortField = "title";
var bySortField=function (a,b) {if(a[sortField] == b[sortField]) return(0); else return (a[sortField] < b[sortField]) ? -1 : +1; }
if (!config.options.chkSearchTitlesFirst || config.options.chkSearchByDate) results.sort(bySortField);
return results;
}
//}}}
//{{{
// SearchResuls REPORT GENERATOR
if (!window.reportSearchResults) window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
var body="\n";
// summary: nn tiddlers found matching '...', options used
body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\n";
body+="^^//searched in:// ";
body+=(config.options.chkSearchTitles?"''titles'' ":"");
body+=(config.options.chkSearchText?"''text'' ":"");
body+=(config.options.chkSearchTags?"''tags'' ":"");
body+=(config.options.chkSearchFields?"''fields'' ":"");
body+=(config.options.chkSearchShadows?"''shadows'' ":"");
if (config.options.chkCaseSensitiveSearch||config.options.chkRegExpSearch) {
body+=" //with options:// ";
body+=(config.options.chkCaseSensitiveSearch?"''case sensitive'' ":"");
body+=(config.options.chkRegExpSearch?"''text patterns'' ":"");
}
body+="^^";
// numbered list of links to matching tiddlers
body+="\n<<<";
for(var t=0;t<matches.length;t++) {
var date=config.options.chkSearchByDate?(matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" "):"";
body+="\n# "+date+"[["+matches[t].title+"]]";
}
body+="\n<<<\n";
// open all matches button
body+="<html><input type=\"button\" href=\"javascript:;\" ";
body+="onclick=\"story.displayTiddlers(null,["
for(var t=0;t<matches.length;t++)
body+="'"+matches[t].title.replace(/\'/mg,"\\'")+"'"+((t<matches.length-1)?", ":"");
body+="],1);\" ";
body+="accesskey=\"O\" ";
body+="value=\"open all matching tiddlers\"></html> ";
// discard search results button
body+="<html><input type=\"button\" href=\"javascript:;\" ";
body+="onclick=\"discardSearchResults()\" value=\"discard "+title+"\"></html>";
// search again
body+="\n\n----\n";
body+="<<search \""+text+"\">>\n";
body+="<<option chkSearchTitles>>titles ";
body+="<<option chkSearchText>>text ";
body+="<<option chkSearchTags>>tags";
body+="<<option chkSearchFields>>fields";
body+="<<option chkSearchShadows>>shadows";
body+="<<option chkCaseSensitiveSearch>>case-sensitive ";
body+="<<option chkRegExpSearch>>text patterns";
body+="<<option chkSearchByDate>>sort by date";
// create/update the tiddler
var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch temporary");
store.addTiddler(tiddler); story.closeTiddler(title);
// use alternate "search again" label in <<search>> macro
var oldprompt=config.macros.search.label;
config.macros.search.label="search again";
// render/refresh tiddler
story.displayTiddler(null,title,1);
store.notify(title,true);
// restore standard search label
config.macros.search.label=oldprompt;
}
if (!window.discardSearchResults) window.discardSearchResults=function()
{
// remove the tiddler
story.closeTiddler(config.macros.search.reportTitle);
store.deleteTiddler(config.macros.search.reportTitle);
store.notify(config.macros.search.reportTitle,true);
}
//}}}
<html><span style="color:#009;font-variant:small-caps;line-height:1.9em;font-size:10pt;font-weight:normal;letter-spacing: 0.5em;padding-left:0.5em;"><a href="javascript:void(0)" onclick="story.closeAllTiddlers();story.displayTiddlers(null,store.getTiddlerText('DefaultTiddlers').readBracketedList())"><span title="Close all tiddlers and go Home" style="cursor:pointer">A Browser to Farr </span></span></a><span style='letter-spacing: 0.0em;font-size:7pt;'> [img[http://img408.imageshack.us/img408/5150/daquo3gq1.gif]] <<toggleslantedmenu "" "" hide>></span></span></html>
<<gradient vert #eee #eee #eee #eee #abf>><html><div id="slantedmenu" padding:top:2em;white-space:nowrap;><span style='font-weight:normal;float:center;'><ul><li><a href="javascript:void(0)" onclick="story.closeAllTiddlers();story.displayTiddlers(null,store.getTiddlerText('DefaultTiddlers').readBracketedList())"><span title="Close all tiddlers and go Home" style="cursor:pointer">Home</span></a></li><li><span style="float:center;padding-left:0em;" title="Load this page in sidebar" style="cursor:help"><a href="#" target="_search">« Load</a></span></li><li><<toggleToolyBars "" "" show>></li><li><<toggleTiddlersBar "" "" hide>></li><li><span title='Help on using SideSnips'>{{locLink{[[Help|Help]]}}}</span></li><br><li><<search>></li><li><span style='align-center;'><<slider " " "SearchOptions" "options" "choose from titles/text/tags or GoTo"'>></span></li><br><li><span title='view all tabs listed by category'>[[View|ViewTabs]]</span></li><li><<newTiddler>></li><li><<saveChanges>></li><li><<newJournal "YYYY.0MM.0DD 0hh:0mm:0ss" "journal">></li><li><span title='save changes, save as, upload/download'>[[Tools|MoreTools]]</span></li></div></html>>>
<html><hide linebreaks><div id="slantedmenu"><ul><li> <a href="javascript:void(0)" onclick="story.closeAllTiddlers();story.displayTiddlers(null,store.getTiddlerText('DefaultTiddlers').readBracketedList())"
><span title="Close all tiddlers and open Welcome" style="cursor:pointer">''Home''</span></a></li><li>[[OverView]]</li><li>[[Contents|Table of Contents]]</li><li>[[Glossary]]</li></li><li>[[Tutorial|MemorizePalette]]</li><li>[[Forum|http://groups.google.com/group/TiddlyWiki]]</li><li><<tiddler GoTo>></li></li></ul></div></html>
/***
!!!<<gradient horiz #fcb #fff >><<tiddler RefreshStyles>> SlantedStyle >>/%==================================================%/
***/
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
#slantedmenu{
font-size: 95%;
border-bottom: solid 0px #00a;
border-top: solid 1px #c06;
}
#slantedmenu:after{ /*Add margin between menu and rest of content in Firefox*/
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#slantedmenu ul{
text-indent: 10px;
padding: 7px 0;
margin: 0;
background:transparent;
background-color: ;
border: 0px solid #f6f;
text-align: center; /*set value to "center" for example to center items*/
}
#slantedmenu ul li{
display: inline;
}
#slantedmenu ul li a{
font-weight: bold;
color: #00a;
padding: 3px 0;
padding-right: 5px;
padding-left: 5px;
margin: 0;
text-decoration: none;
background: transparent url("") top right no-repeat;
}
#slantedmenu ul li a:hover{
color: #f00;
background:#fff;
}
/***
!!!<<gradient horiz #fcb #fff >> SlantedStyle2 <<tiddler RefreshStyles>> >>/%==================================================%/
***/
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
#slantedmenu2 {
font-size: 95%;
border-bottom: solid 1px #00a;
border-top: solid 1px #00a;
}
#slantedmenu2:after{ /*Add margin between menu and rest of content in Firefox*/
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#slantedmenu2 ul{
text-indent: 10px;
padding: 7px 0;
margin: 0;
background-color: #ccc;
border: 0px solid #f6f;
text-align: center; /*set value to "center" for example to center items*/
}
#slantedmenu2 ul li{
display: inline;
}
#slantedmenu2 ul li a{
font-weight: bold;
color: #00a;
padding: 3px 0;
padding-right: 5px;
padding-left: 5px;
margin: 0;
text-decoration: none;
background: transparent url("") top right no-repeat;
}
#slantedmenu2 ul li a:hover{
color: #f00;
background:#fff;
}
/***
!!!<<gradient horiz #FF8888 #ffffff >> ~StyleSheet>>/%==================================================%/
***/
/*{{{*/
#sidebarOptions .sliderPanel {color#c06;}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a, .popup li a:visited {color:#090; border: none;}
.popup li {list-style:none;}
body {background:#fff;
font-size:0.75em;
}
h1,h2,h3,h4,h5 {padding-bottom:1px; margin-top:0.3em;margin-bottom:0.3em;}
h1 {font-size:1.35em;background:#adf;}
h2 {font-size:1.25em;background:#adf;}
h3 {font-size:1.1em;background:#adf;}
h4 {font-size:1em;background:#adf;}
h5 {font-size:.9em;background:#adf;}
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;}
p.first-line
{
color: #ff0000;
font-variant: small-caps
}
.header {position:relative; height:60px;}
.header a:hover {background:transparent;}
/*.headerShadow {position: relative;padding: 0em 0em 0em 1em;left: 0px; top: 0px;}
.headerForeground {position:absolute;padding:0.0em 0em 1em 1em; left:0px; top:0px;}*/
.title {
color:#c06;
font-variant:small-caps;
font-size:1.4em;
font-weight:normal;
padding-top: 0em;
padding-left: 0.65em;
}
.editorFooter a {color:#f00;}
.editorFooter a:hover {color:#f00;background:#0cc;}
/*}}}*/
/***
!!!<<gradient horiz #FF8888 #ffffff >> Viewer>>/%==================================================%/
***/
/*{{{*/
.viewer {
padding-left: 0em;
padding-right: 0em;
padding-top: 0.0em;
}
.viewer a {
color:#04b;
background: transparent;
padding-left:2px;
padding-right:2px;
text-decoration:none;
}
.viewer a:hover {
background: #fff;
color: #f00;
}
.viewer hr {
border: 0px;
border-top: solid 1px #c06;
color: #c06;
}
.viewer .tabSelected {
background:url("http://img258.imageshack.us/img258/8210/selectedbuttonbggi0.gif") repeat-x top left;top left;
background-color:#fcb;
font-size:0.95em;
font-weight:bold;
color:#a00;
text-decoration:none;
border: 1px1px 0px 1px solid #999;
-moz-border-radius : 0.4em 0.4em 0 0;
}
.viewer .tabUnselected {
background:url("http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif") repeat-x top left;top left;
background-color:#eee;
font-size:0.95em;
font-weight:bold;
color:#008;
text-decoration:none;
border:#000;
border-left: 1px solid #999;
border-top: 1px solid #999;
border-right: 1px solid #999;
-moz-border-radius : 0.4em 0.4em 0 0;
}
.viewer .button {
border: 0px solid #009;
color:#009;
}
.button:active {color:#fff; background:transparent; border:0px solid #009;}
.header {background:[[ColorPalette::PrimaryMid]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:#0cc;}
.viewer blockquote {
border-left: 1px solid #c06;
}
.viewer tr.oddRow { background-color: #eaeaea;}
.viewer tr.evenRow { background-color:#fff; }
.viewer {
background:#fff;
padding-left: 0.5em;
padding-right: 0.5em;
padding-top: 0.5em;
}
.button {
border: 0px solid #fff;
}
.whiteLink a { color: #fff;
font-weight:normal; }
.unboldlink a {font-weight:normal;}
.twLink a { color: #090;
font-weight:normal; }
.locLink a { color: #c06;
font-weight:normal; }
.remLink a { color: #c90;
font-weight:normal; }
.floatleft{ float:left; }
.floatright{ float:right; }
.firstletter{ float:left; width:0.40em; font-size:400%; font-family:times,arial; line-height:90%; }
#tiddlerTheBath img {
border: 5px double #999;
margin: 4px;}
.toolbar {
color: #fff;
}
.selected .toolbar a {
color: #000;
}
.selected .toolbar a:hover {
background: #ffd /*#ef9*/;
color: #F00;
}
/***
!!!<<gradient horiz #FF8888 #ffffff >> Nested Style Sheets>>/%==================================================%/
***/
/*}}}*/
[[ButtonStyle]]
[[CustomCSS]]
[[SlantedStyle]]
[[BackstageCSS]]
[[StyleSheetTiddlersBar]]
[[WebStyleSheet]]
[[CenterBoxCSS]]
[[WebPageTLCF]]
[[PageCSS]]
[[PresentCSS]]
[[SDCSS]]
[[HTMLStructureTwoColumnCSS]]
/*{{{*/
/***
!!!<<gradient horiz #FF8888 #ffffff >> End Nested Style Sheets>>/%==================================================%/
***/
#messageArea {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryMid]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::SecondaryLight]]; background:[[ColorPalette::Secondarymid]]; border:none;}
#messageArea {
background-color: #509;
border-color: #fab;
color:#fff;
border-width: 4px;
border-style: dotted;
font-size: 90%;
padding: 0.5em;
margin-right:2em;
-moz-border-radius: 1em; }
#messageArea a {color:#ffc;}
#messageArea .button { color:#fff;text-decoration:none; font-weight:bold; background:transparent; border:0px; }
#messageArea .button:hover {background: #F00; }
#tiddlerDisplay {padding-right:0em; padding-left:0em;margin:auto;}
.header {display:none;}
#sidebar{display:none;}
#mainMenu{display:none;}
#contentWrapper {margin:0em 0em 0em 0em;padding:0em 0em 0em 0em;}
#displayArea {margin:0em 0em 0em -0.25em;padding:0em 0em 0em 0em;}
#tiddlerDisplay {margin:0em 0em 0em -0.25em;;padding:1em 0em 0em 0em;}
#tiddlersBar {margin:0em 0em 0em 0em;padding:0em 0em 0em 0em;}
.tiddler {margin:0em -2em 0em -2em;padding:0em 0em 0em 0em;}
.button {color: #009;}
.button:hover {color: #f00;background: #fff;}
.button:visited {color: #009;}
.button:active {color: #f00;}
a:visited {color: #009;}
{{{
.tabContents li.listLink { margin-left:0em;list-style:none;}
}}}
#tiddlerAllSnips tabContents{background:#fcf;}
/*}}}*/
.editor {margin-left:1.0em;}
/*{{{*/
* html .tiddler {height:1%;}
body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}
h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}
hr {height:1px;}
a {text-decoration:none;}
dt {font-weight:bold;}
ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}
.txtOptionInput {width:11em;}
#contentWrapper .chkOptionInput {border:0;}
.externalLink {text-decoration:underline;}
.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}
.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}
/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}
#mainMenu .tiddlyLinkExisting,
#mainMenu .tiddlyLinkNonExisting,
#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}
.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}
.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}
#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}
#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}
.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}
#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}
.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}
.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}
.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}
#contentWrapper {display:block;}
#splashScreen {display:none;}
#displayArea {margin:1em 17em 0em 14em;}
.toolbar {text-align:right; font-size:.9em;}
.tiddler {padding:1em 1em 0em 1em;}
.missing .viewer,.missing .title {font-style:italic;}
.title {font-size:1.6em; font-weight:bold;}
.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}
.tiddler .button {padding:0.2em 0.4em;}
.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}
.footer {font-size:.9em;}
.footer li {display:inline;}
.annotation {padding:0.5em; margin:0.5em;}
* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}
.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}
.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}
.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}
.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}
.sparkline {line-height:1em;}
.sparktick {outline:0;}
.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}
* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}
.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>> StyleSheetTiddlersBar>>/%==================================================%/
***/
#tiddlersBar .button {border:1px; color:#000;}
#tiddlersBar .tab {white-space:nowrap;}
#tiddlersBar {padding : 0.00em 0.5em 0.02em 1.0em;margin-left:0em;margin-right:0em}
#tiddlersBar {margin-bottom:0px;}
.tabSelected .button:hover {font-size:0.75em;font-weight:bold;color: #f00;background: #fff;padding : 0px 0px 0px 2px;}
.tabUnselected .button:hover {font-size:0.75em;color: #f00;background: #fff; padding : 0px 0px 0px 2px;}
.tabUnselected .button {font-size:0.75em;font-weight:bold;color: #066; padding : 0px 0px 0px 2px;}
.tabSelected .button {font-size:0.75em;font-weight:bold;color: #a00;padding : 0px 0px 0px 2px;}
.tabUnselected {
background:url("http://img520.imageshack.us/img520/8688/mainmenugray7ef.gif") repeat-x top left;top left;
background-color:#eee;
border:1px #eee solid; border-bottom:0px;font-size:0.95em; }
.tabSelected {
background:url("http://img258.imageshack.us/img258/8210/selectedbuttonbggi0.gif") repeat-x top left;top left;
background-color:#fcb;
color: #a00;border: 1px #c06 solid;border-bottom:0px; font-size:0.95em;}
.tabUnselected .tabButton {font-weight:bold;font-size:0.75em;color:#333;background:transparent; padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton {font-weight:bold;font-size:0.75em;color:#000;background:transparent;padding : 0px 2px 0px 2px; margin: 0 0 0 1px;}
.tabSelected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tabUnselected .tabButton:hover {font-weight:bold;color: #f00;background: #fff;}
.tiddler, .tabContents {border-top:0px #fa0 solid;margin-left:0.5em;margin-right:0.5em;}
#tiddlersBar .tab {-moz-border-radius : 0.4em 0.4em 0 0;}
#tiddlersBar {background:#abf;line-height: 1.45em;}
#tiddlersBar {background: url("http://img168.imageshack.us/img168/1254/leftbackdo6.gif"); background-repeat: repeat;line-height: 1.45em;}
.tiddlerDisplay {margin-top:2.0em;margin-right:1em;}
!!!!!<<gradient horiz #fcb #fff>> [[Styling]]>>
@@color:#C06;''» »'' @@ Tabs containing CSS styling code (controls layout and visual style)
----
<script>
// get all tiddlers tagged with "css"
var tids=store.getTaggedTiddlers("css");
// keep only tiddlers *also* tagged with New
var list=[];
for (var t=0; t<tids.length; t++)
if (tids[t].isTagged("css")) list.push(tids[t]);
// create output list of tiddler titles, one per line
var out="";
for (var t=0; t<list.length; t++) out+="#[["+list[t].title+"]]\n";
return out;
</script>
@@color:#C06;''» »'' @@ Tabs with reserved names (can be 'over-written' with Tabs of the same name making the originals silent; but, they remain unchanged in the core code)
----
[[nonotesViewTemplate]]
<<list shadowed>>
|>|bgcolor(#8af):@@color(#000080):''5 tiddlers found matching /{{{mini}}}/''@@|bgcolor(#8af): @@color(#A00000): SearchHelp@@ |
|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |
|bgcolor(#8af): |bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h
| 1|[[Browser]]| 8276|@@@@|
| 2|[[FontSizePlugin]]| 4113|@@systemConfig@@|
| 3|[[MiniBrowserList]]| 1546|@@@@|
| 4|[[MiniBrowserPlugin]]| 14485|@@systemConfig@@|
| 5|[[SlantedMenu]]| 1280|@@nonotes,basic@@|
<<slider "" "RealHelp" "Read about the menu" "tooltip" >>
/***
|''Name:''|TiddlerListMacro|
|''Version:''|2.3 (8-Jan-2008)|
|''Source''|http://jackparke.googlepages.com/jtw.html#TiddlerListMacro ([[del.icio.us|http://del.icio.us/post?url=http://jackparke.googlepages.com/jtw.html%23TiddlerListMacro]])|
|''Author:''|[[Jack]]|
|''Type:''|Macro|
|''Documentation:''|[[TiddlerListMacroDocumentation]]|
!Usage
{{{<<tiddlerList parameter1:"value1" parameter2:"value2" ...>>}}}
See TiddlerListMacroDocumentation and TiddlerListMacroExamples
!Code
***/
//{{{
version.extensions.tiddlerList = {major: 2, minor: 3, revision: 0, date: new Date("Jan 08, 2008")};
// template = [header, item, separator, group, footer]
config.macros.tiddlerList={
formats : {list:true, nlist:true, span:true, stack:true, csv:true, table:true},
templates : {
list : [ "%0\n", "* %0\n", "", "%group\n", "%0\n"],
nlist : [ "%0", "# %0\n", "", "%group\n", "%0\n"],
span : [ "%0", "%0", " ", "%group", "%0"],
stack : [ "%0", "%0", "\n", "%group", "%0"],
csv : [ "%0", "%0", ", ", "%0", "%0\n"],
table : ["|!%0|\n", "|%0|\n", "", "|%group|\n", "|%0|\n"]
},
dateFormat : "DD MMM YYYY"
}
if (typeof gCurrentTiddler == 'undefined')
var gCurrentTiddler;
config.macros.tiddlerList.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
// Some globals
var count=0, groupCount=0, theGroup="", lastGroup="", firstInGroup = false;
var currentTiddler = tiddler;
gCurrentTiddler = tiddler;
var listWikiText="";
var formats = this.formats;
// SQL-Like parameters
var parameters = paramString.parseParams("name",null,true);
var pTags = parameters[0]["tags"]?parameters[0]["tags"][0].split(","):[];
var pOrder = parameters[0]["order"]?parameters[0]["order"][0]:"title";
var pTop = parameters[0]["top"]?parameters[0]["top"][0]:-1;
var pText = parameters[0]["text"]?parameters[0]["text"][0]:"";
var pTitle = parameters[0]["title"]?parameters[0]["title"][0]:"";
var pSearch = parameters[0]["search"]?parameters[0]["search"][0]:"";
var pFilter = parameters[0]["filter"]?parameters[0]["filter"][0]:"";
var pHeader = parameters[0]["header"]?paramFormat(parameters[0]["header"][0]):"";
var pFooter = parameters[0]["footer"]?paramFormat(parameters[0]["footer"][0]):"";
var pGroup = parameters[0]["group"]?parameters[0]["group"][0]:"";
var pDateFormat = parameters[0]["dateFormat"]?parameters[0]["dateFormat"][0]:this.dateFormat;
var pCustomParameter = parameters[0]["customParameter"]?parameters[0]["customParameter"][0]:"";
var pFormat = parameters[0]["format"]?parameters[0]["format"][0]:"list";
pFormat = formats[pFormat]?pFormat:"list"
// Separator
var pSeparator = parameters[0]["separator"]?paramFormat(parameters[0]["separator"][0]):(parameters[0]["seperator"]?paramFormat(parameters[0]["seperator"][0]):this.templates[pFormat][2])
// Template for group
var pGroupTemplate = this.templates[pFormat][3];
if (parameters[0]["groupTemplate"])
pGroupTemplate = paramFormat(parameters[0]["groupTemplate"][0])
pGroupTemplate = pGroupTemplate.replace("$))", ">>")
// Template for group footer
var pGroupFooterTemplate = "";
if (parameters[0]["groupFooterTemplate"])
pGroupFooterTemplate = paramFormat(parameters[0]["groupFooterTemplate"][0])
pGroupFooterTemplate = pGroupFooterTemplate.replace("$))", ">>")
// Template for item
var pItemTemplate = this.templates[pFormat][1];
if (parameters[0]["itemTemplate"])
pItemTemplate = paramFormat(parameters[0]["itemTemplate"][0])
pItemTemplate = pItemTemplate.replace("$))", ">>").replace("%link", "%0").replace("%item", "%1").replace("%abstract", "%2").replace("%text", "%3").replace("%created", "%4").replace("%modified", "%5").replace("%modifier", "%6").replace("%group", "%7").replace("%title", "%8").replace("%tags", "%9").replace("%nolink", "%10").replace("%custom", "%11")
// Template for footer
var pFooterTemplate = this.templates[pFormat][4].replace("%count", "%1")
// Get all tiddlers
var tiddlers = store.reverseLookup("tags","excludeLists",false);
// Sorting
if(!pOrder)
pOrder = "title";
if (pOrder.match(/^\-/i)) {
pOrder = pOrder.substr(1)
var sortDesc = true;
}
// Sorting on a standard field
if (pOrder.match(/(title)|(text)|(modifier)|(modified)|(created)|(tags)/))
if (sortDesc)
tiddlers.sort(function (a,b) {if(a[pOrder] == b[pOrder]) return(0); else return (a[pOrder] > b[pOrder]) ? -1 : +1; });
else
tiddlers.sort(function (a,b) {if(a[pOrder] == b[pOrder]) return(0); else return (a[pOrder] < b[pOrder]) ? -1 : +1; });
else
if (sortDesc)
tiddlers.sort(function (a,b) {if(a.fields[pOrder] == b.fields[pOrder]) return(0); else return (a.fields[pOrder] > b.fields[pOrder]) ? -1 : +1; });
else
tiddlers.sort(function (a,b) {if(a.fields[pOrder] == b.fields[pOrder]) return(0); else return (a.fields[pOrder] < b.fields[pOrder]) ? -1 : +1; });
// Header
if (pHeader)
listWikiText += formatItem(this.templates[pFormat][0], [pHeader], pFormat)
for(var t=0; t<tiddlers.length; t++) {
tiddler = tiddlers[t];
if (pText!="" && tiddler.text=="") tiddler.text=store.getValue(tiddler, 'text')
if (pTop==-1 || count<pTop) {
if (pText=="" || tiddler.text.match(pText)) {
if (pTitle=="" || tiddler.title.match(pTitle)) {
if (pSearch=="" || (tiddler.title.match(pSearch) || tiddler.text.match(pSearch))) {
if (pFilter=="" || eval(pFilter)) {
if (pTags.length==0 || compareArrays(tiddler.tags, pTags, "all")) {
count++;
if (tiddler.text=="") tiddler.text=store.getValue(tiddler, 'text')
// Grouping
if (pGroup) {
theGroup = eval(pGroup);
if(theGroup != lastGroup) {
groupCount++;firstInGroup = true;
if (pGroupFooterTemplate && groupCount>1)
listWikiText += pGroupFooterTemplate.replace("%group", theGroup)
listWikiText += pGroupTemplate.replace("%group", theGroup)
lastGroup = theGroup;
} else
firstInGroup = false;
}
// Separators
if (count>1 && !firstInGroup) listWikiText += pSeparator;
//Plaintext title
var noLink = tiddler.title.match(config.textPrimitives.wikiLink)?"~" + tiddler.title:tiddler.title;
// Custom parameter
if (pCustomParameter)
var custom="";
try {
custom = eval(pCustomParameter)
} catch (e) {}
// List individual tiddler
var strItem = formatItem(pItemTemplate,["[[" + tiddler.title + "]]",count,tiddler.text.substr(0,150),tiddler.text,tiddler.created.formatString(pDateFormat),tiddler.modified.formatString(pDateFormat),tiddler.modifier,theGroup,tiddler.title,tiddler.tags.join(" "),noLink,custom], pFormat)
for (var fld in tiddler.fields) strItem = strItem.replace('%field.' + fld, tiddler.fields[fld]);
listWikiText += strItem
}
}
}
}
}
}
}
// Last group footer
if (pGroup && pGroupFooterTemplate && count>0)
listWikiText += pGroupFooterTemplate.replace("%group", theGroup)
// Footer
if (pFooter) {
pFooter = pFooter.replace("%count", count)
listWikiText += formatItem(pFooterTemplate, [pFooter], pFormat)
}
// Render result
if (!parameters[0]["debug"])
wikify(listWikiText,place, null, currentTiddler)
else
place.innerHTML = "<textarea style=\"width:100%;\" rows=100>" + listWikiText + "</textarea>"
// Local functions
function paramFormat(param) {
// Allow "\n" in non evalled parameters
return param.replace(/\\n/g, "\n");
}
function formatItem(template, values, format) {
// Fill template with values (depending on list format)
if (format.match(/table/) && values[0].match(/\|/))
return ("%0\n").format(values)
else
return template.format(values)
}
function compareArrays(array, values, logic) {
// Compare items in array with AND("all") or OR("any") logic
var matches=0;
for(var v=0; v<values.length; v++)
if(values[v].replace(/^\s+|\s+$/g,"").match(/^\-/) && !array.contains(values[v].replace(/^\s+|\s+$/g,"").substr(1)))
matches++;
else if (array.contains(values[v]))
matches++;
return ((logic=="all" && matches==values.length) || (logic!="all" && matches>0))
}
}
String.prototype.prettyTrim = function(len,prefix,postfix) {
var result = this.trim().replace(/\r\n/g,' ').replace(/\n/g,' ');
if (!prefix) prefix = '';
if (!postfix) postfix = '';
if (result.length > len - 3)
return prefix + result.substr(0,len) + '...' + postfix;
else if (result.length > 0)
return prefix + result + postfix;
else
return result;
}
//}}}
!Description
The TiddlerListMacro lists tiddlers with ~SQL-Like features:
* List tiddlers containing a word in the title or text (case-sensitive)
* List tiddlers tagged with given tags or exclude certain tags
* Ascending and descending sorting of single fields
* Limit number of tiddlers displayed
* Specify different HTML formats for the lists
* Grouping of items in a list
* Customizable wiki templates
* Numbering and totals
!Revision History
* Original by [[Jack]] 17-Apr-2006
* Added formatting (v2.0.1 18-Apr-2006)
* Added grouping (v2.0.2 18-Apr-2006)
* Added flexible filtering (v2.0.3 19-Apr-2006)
* Added custom item templates (v2.0.4 20-Apr-2006)
* Added custom templates (v2.0.5 21-Apr-2006)
* Allow evalled parameters (v2.0.7 23-Apr-2006)
* Allow groupFooterTemplate (v2.0.9 30-Apr-2006)
* Added the customParameter (v2.0.10 2-May-2006)
!To Do
* Case-insensitive searching
* Sorting on multiple fields
!Usage
{{{<<tiddlerList parameter1:"value1" parameter2:"value2" ...>>}}}
!Examples ([[TiddlerListMacroExamples]])
List all tiddlers tagged with "Plugin"
{{{<<tiddlerList tags:Plugin>>}}}
List newest 3 plugins which are not templates:
{{{<<tiddlerList tags:"Plugin,-Template" top:3 order:"-created">>}}}
List all tiddlers containing "Jack" in their title or text (last modified first):
{{{<<tiddlerList search:"Jack" order:"-modified">>}}}
List all tiddlers starting with "T" in a table:
{{{<<tiddlerList title:"^T" format:"table" header:"Tiddlers beginning with T" footer:"%count items listed">>}}}
Group tiddlers by first letter
{{{<<tiddlerList top:"15" group:"tiddler.title.substr(0,1)" groupTemplate:"''%group''">>}}}
Show a list of all tiddlers with creation date (overrides default item template)
{{{<<tiddlerList itemTemplate:"* %link (%created)\n">>}}}
Show all tiddlers that have the host's tiddler title in their tag list
{{{<<tiddlerList filter:"tiddler.tags.contains(currentTiddler.title)">>}}}
!Parameters
|!Parameter|!Type|!Meaning|!Example|
|top|Integer|Number of tiddlers to display|"10"|
|tags|String|List tiddlers with matching tags (AND Logic). Leading - to exclude.|"~ToDo,Urgent,-Done"|
|title|~RegEx|List tiddlers with matching title|"^[Pp]"|
|text|~RegEx|List tiddlers with matching text|"Searchtext"|
|search|~RegEx|List tiddlers with matching title OR text|"Problem"|
|filter*|~JavaScript|List tiddlers according to boolean expression)|"tiddler.title.length<4 && tiddler.tags.contains('Idea')"|
|format|String (fixed list)|HTML formatting of list. list (ul, default), nlist (ol), span, stack (div), csv, table.|"list"|
|order|String|Sort order of tiddlers. - is descending, + ascending|"-created"|
|group*|~JavaScript|Grouping field|tiddler.title.substr(0,1)|
|customParameter*|~JavaScript|Custom parameter to be evalled for use in the itemTemplate|tiddler.text.match(/Version: (.*)/)[1]|
|header|String|Top caption|"Tiddlers beginning with T"|
|footer|String|Bottom caption|"End of list"|
|itemTemplate|~WikiTemplate|~WikiText with %placeholders|"%link\n%abstract\n%modified"|
|groupTemplate|~WikiTemplate|~WikiText with %placeholders for the start of each group|"!!%group"|
|groupFooterTemplate|~WikiTemplate|~WikiText with %placeholders for the end of each group|"----\n"|
|dateFormat|String|Date formatting string when displaying dates|~YYYY-MM-DD|
|separator|String|Define a string or character to be inserted between items listed|" "|
|debug|Boolean|Set to 1 or true for debug mode where only wikitext will be output|debug:1|
{{{*}}} Parameter will be evalled (do not pass with {{{{{ }} }}} unless you want it evalled twice!)
!Template Placeholders
Placeholder values for itemTemplate parameter
|!Placeholder|!Field|
|%item|List item number|
|%link|Link to Tiddler {{{[[MyTiddler]]}}}|
|%title|Tiddler Name {{{MyTiddler}}}|
|%nolink|Unlinked Tiddler Title {{{~MyTiddler}}}|
|%abstract|First 300 chars of tiddler text|
|%text|All tiddler text|
|%tags|Tags separated by space|
|%created|Creation date|
|%modified|Modified date|
|%modifier|Last modifier|
|%group|Name of group field|
|%custom|The result of your evalled customParameter|
|%count|Number of items listed (footer only)|
!Variables
{{{{{currentTiddler}} }}}refers to the current (host) tiddler in function scope (i.e. within the filter or group parameters)
{{{{{gCurrentTiddler}} }}}refers to the current (host) tiddler in global scope (i.e. within{{{ {{}} }}}evalled parameters. Example:
{{{<<tiddlerList tags:{{gCurrentTiddler.title}}>>}}}
!Style
No styles are pre-assigned to the lists. Use {{{@@}}} notation to define custom styles in the header, footer, groupTemplate and itemTemplate parameters.
Source: [[Jack's TiddlyWiki - Plugins, Macros and Hacks|http://jackparke.googlepages.com/jtw.html#TiddlerListMacro]]
/***
|''Name:''|TiddlerNotesPlugin|
|''Description:''|Add notes to tiddlers without modifying the original content|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#TiddlerNotesPlugin|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.1|
|''Date:''|26/10/07|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.3|
!!Concept:
*The TiddlerNotesPlugin allows you to add notes to tiddlers, without needing to edit the original tiddler. This means that your original content will remain unaltered, and if you update it in the future, you won’t lose your notes. Notes are stored in separate tiddlers, but can be viewed and edited from within the original tiddler.
*For a tiddler titled "~MySlide", the notes are by default saved in a tiddler titled "~MySlide-Notes" and is given a tag of "Notes". The suffix and tags of the notes tiddlers are customizable. You can have one or multiple notes per tiddlers. So it is possible to have for example, teacher's notes and student's notes in the same file.
*Notes can be configured to start off blank, or pre-filled with the contents of the original tiddler.
!!Usage:
*{{{<<notes>>}}} is the simplest usage form.
* additional optional parameters include:
**{{{heading:}}} the heading to use for the notes box
**{{{tag:}}} the tag to be given to the notes tiddler
**{{{suffix:}}} the suffix to be used when naming the notes tiddler
* a full macro call could look like: {{{<<notes heading:"My Notes" tag:"NoteTiddlers" suffix:"Comments">>}}}
* To avoid adding {{{<<notes>>}}} to each tiddler you want notes for, you could add the macro call to the ViewTemplate
** below the line {{{<div class='viewer' macro='view text wikified'></div>}}} add the following line: <br> {{{<div class='viewer' macro='notes'></div>}}}
** Used in combination with the ~HideWhenPlugin or ~PublisherPlugin, you could have notes be shown only for tiddlers with specific tags. The ~PublisherPlugin would allow you for instance to only have the ~TeachersNotes visible to the teacher, and the ~StudentsNotes for the same tiddler visible to the Student.
!!Configuration
*<<option chkPrefillNotes>> Enable to pre-fill notes with the original tiddler's contents
!!Demo:
* [[MySlide]]
***/
// /%
//!BEGIN-PLUGIN-CODE
if (!config.options.chkPrefillNotes)
config.options.chkPrefillNotes = false;
function createTiddlyElement(theParent,theElement,theID,theClass,theText,attribs)
{
var e = document.createElement(theElement);
if(theClass != null)
e.className = theClass;
if(theID != null)
e.setAttribute("id",theID);
if(theText != null)
e.appendChild(document.createTextNode(theText));
if(attribs){
for(var n in attribs){
e.setAttribute(n,attribs[n]);
}
}
if(theParent != null)
theParent.appendChild(e);
return e;
}
function createTiddlyButton(theParent,theText,theTooltip,theAction,theClass,theId,theAccessKey,attribs)
{
var theButton = document.createElement("a");
if(theAction) {
theButton.onclick = theAction;
theButton.setAttribute("href","javascript:;");
}
if(theTooltip)
theButton.setAttribute("title",theTooltip);
if(theText)
theButton.appendChild(document.createTextNode(theText));
if(theClass)
theButton.className = theClass;
else
theButton.className = "button";
if(theId)
theButton.id = theId;
if(attribs){
for(var n in attribs){
e.setAttribute(n,attribs[n]);
}
}
if(theParent)
theParent.appendChild(theButton);
if(theAccessKey)
theButton.setAttribute("accessKey",theAccessKey);
return theButton;
}
config.macros.notes={
cancelWarning: "Are you sure you want to abandon changes to your notes for '%0'?",
editLabel: "edit notes",
editTitle: "double click to edit",
saveLabel: "save notes",
saveTitle: "double click to save",
cancelLabel: "cancel",
heading: "Notes",
suffix: "Notes",
tag: "Notes",
saveNotes: function(ev){
e = ev? ev : window.event;
var theTarget = resolveTarget(e);
if (theTarget.nodeName.toLowerCase() == "textarea")
return false;
var title = story.findContainingTiddler(theTarget).getAttribute("tiddler");
story.setDirty(title,false);
var box = document.getElementById("notesContainer"+title);
var textarea = document.getElementById("notesTextArea"+title);
if(textarea.getAttribute("oldText")!=textarea.value && !hasClass(theTarget,"cancelNotesButton")){
var suffix = box.getAttribute("suffix");
var t = store.getTiddler(title+"-"+suffix);
store.saveTiddler(title+"-"+suffix,title+"-"+suffix,textarea.value,config.options.txtUserName,new Date(),t?t.tags:box.getAttribute("tag"),t?t.fields:{});
}
story.refreshTiddler(title,1,true);
autoSaveChanges(true);
return false;
},
editNotes: function(box,tiddler){
removeChildren(box);
story.setDirty(tiddler,true);
box.title = this.saveTitle;
box.ondblclick = this.saveNotes;
createTiddlyButton(box,this.cancelLabel,this.cancelLabel,this.saveNotes,"cancelNotesButton");
createTiddlyButton(box,this.saveLabel,this.saveLabel,this.saveNotes,"saveNotesButton");
wikify("!!"+box.getAttribute("heading")+"\n",box);
addClass(box,"editor");
var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix");
var wrapper2 = createTiddlyElement(wrapper1,"div");
var e = createTiddlyElement(wrapper2,"textarea","notesTextArea"+tiddler);
var v = store.getValue(tiddler+"-"+box.getAttribute("suffix"),"text");
if(!v)
v = config.options.chkPrefillNotes? store.getValue(tiddler,"text"):'';
e.value = v;
e.setAttribute("oldText",v);
var rows = 10;
var lines = v.match(/\n/mg);
var maxLines = Math.max(parseInt(config.options.txtMaxEditRows),5);
if(lines != null && lines.length > rows)
rows = lines.length + 5;
rows = Math.min(rows,maxLines);
e.setAttribute("rows",rows);
box.appendChild(wrapper1);
},
editNotesButtonOnclick: function(e){
var title = story.findContainingTiddler(this).getAttribute("tiddler");
var box = document.getElementById("notesContainer"+title);
config.macros.notes.editNotes(box,title);
return false;
},
ondblclick : function(ev){
e = ev? ev : window.event;
var theTarget = resolveTarget(e);
var title = story.findContainingTiddler(theTarget).getAttribute("tiddler");
var box = document.getElementById("notesContainer"+title);
config.macros.notes.editNotes(box,title);
e.cancelBubble = true;
if(e.stopPropagation) e.stopPropagation();
return false;
},
handler : function(place,macroName,params,wikifier,paramString,tiddler){
params = paramString.parseParams("anon",null,true,false,false);
var heading = getParam(params,"heading",this.heading);
var tag = getParam(params,"tag",this.tag);
var suffix = getParam(params,"suffix",this.suffix);
var box = createTiddlyElement(place,"div","notesContainer"+tiddler.title,"TiddlerNotes",null,{"source":tiddler.title,params:paramString,heading:heading,tag:tag,suffix:suffix});
createTiddlyButton(box,this.editLabel,this.editLabel,this.editNotesButtonOnclick,"editNotesButton");
wikify("!!"+heading+"\n",box);
box.title=this.editTitle;
box.ondblclick = this.ondblclick;
wikify("<<tiddler [["+tiddler.title+"-"+suffix+"]]>>",box);
}
};
Story.prototype.old_notes_closeTiddler = Story.prototype.closeTiddler;
Story.prototype.closeTiddler = function(title,animate,unused){
if(story.isDirty(title)) {
if(!confirm(config.macros.notes.cancelWarning.format([title])))
return false;
}
return this.old_notes_closeTiddler.apply(this,arguments);
}
setStylesheet(".TiddlerNotes {\n"+ " background:#eee;\n"+ " border:1px solid #ccc;\n"+ " padding:10px;\n"+ " margin:15px;\n"+ "}\n"+ "\n"+ ".cancelNotesButton,.editNotesButton, .saveNotesButton {\n"+ " float:right;\n"+ " border:1px solid #ccc;\n"+ " padding:2px 5px;\n"+ "}\n"+ "\n"+ ".saveNotesButton{\n"+ " margin-right:0.5em;\n"+ "}\n"+ "\n"+ ".TiddlerNotes.editor textarea{\n"+ " border:1px solid #ccc;\n"+ "}","NotesPluginStyles");
//!END-PLUGIN-CODE
// %/
/***
|''Name:''|TiddlersBarPlugin|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed.
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab = config.options.chkHideTabsBarWhenSingleTab ? config.options.chkHideTabsBarWhenSingleTab : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : " ";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
tooltip : "see ",
tooltipClose : "click here to close this tab",
tooltipSave : "click here to save this tab",
promptRename : "Enter tiddler new name",
currentTiddler : "",
previousState : false,
previousKey : config.options.txtPreviousTabKey,
nextKey : config.options.txtNextTabKey,
tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
handler: function(place,macroName,params) {
var previous = null;
if (config.macros.tiddlersBar.isShown())
story.forEachTiddler(function(title,e){
if (title==config.macros.tiddlersBar.currentTiddler){
var d = createTiddlyElement(null,"span",null,"tab tabSelected");
config.macros.tiddlersBar.createActiveTabButton(d,title);
if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
previous = "active";
}
else {
var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
btn.setAttribute("tiddler", title);
if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
previous=btn;
}
var isDirty =story.isDirty(title);
var c = createTiddlyButton(d,isDirty ?"!":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
c.setAttribute("tiddler", title);
if (place.childNodes) {
place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
place.insertBefore(d,place.firstChild);
}
else place.appendChild(d);
})
},
refresh: function(place,params){
removeChildren(place);
config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
story.refreshAllTiddlers();
if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
}
},
isShown : function(){
if (config.options.chkDisableTabsBar) return false;
if (!config.options.chkHideTabsBarWhenSingleTab) return true;
var cpt=0;
story.forEachTiddler(function(){cpt++});
return (cpt>1);
},
selectNextTab : function(){ //used when the current tab is closed (to select another tab)
var previous="";
story.forEachTiddler(function(title){
if (!config.macros.tiddlersBar.currentTiddler) {
story.displayTiddler(null,title);
return;
}
if (title==config.macros.tiddlersBar.currentTiddler) {
if (previous) {
story.displayTiddler(null,previous);
return;
}
else config.macros.tiddlersBar.currentTiddler=""; // so next tab will be selected
}
else previous=title;
});
},
onSelectTab : function(e){
var t = this.getAttribute("tiddler");
if (t) story.displayTiddler(null,t);
return false;
},
onTabClose : function(e){
var t = this.getAttribute("tiddler");
if (t) {
if(story.hasChanges(t) && !readOnly) {
if(!confirm(config.commands.cancelTiddler.warning.format([t])))
return false;
}
story.closeTiddler(t);
}
return false;
},
onTabSave : function(e) {
var t = this.getAttribute("tiddler");
if (!e) e=window.event;
if (t) config.commands.saveTiddler.handler(e,null,t);
return false;
},
onSelectedTabButtonClick : function(event,src,title) {
var t = this.getAttribute("tiddler");
if (!event) event=window.event;
if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
return false;
},
onTiddlersBarAction: function(event) {
var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
},
createActiveTabButton : function(place,title) {
if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
btn.setAttribute("tiddler", title);
}
else
createTiddlyText(place,title);
}
}
story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;
story.closeTiddler = function(title,animate,unused) {
if (title==config.macros.tiddlersBar.currentTiddler)
config.macros.tiddlersBar.selectNextTab();
story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;
if (config.macros.tiddlersBar.isShown()) {
story.forEachTiddler(function(t,e){
if (t!=title) e.style.display="none";
else e.style.display="";
})
config.macros.tiddlersBar.currentTiddler=title;
}
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
coreRefreshPageTemplate(title);
if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}
ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)
config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles);
config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");
//}}}
{{liststyleimagenone unboldLink {
<<timeline modified>>
}}}
/***
|Name|ToggleToolyBarsMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/|
|Version|1.0|
|Requires|~TW2.x|
!Description:
{{c06{Modified by Morris Gray to toggle the tiddler Toolbars and Title hidden/visible.}}}
Provides a button for toggling visibility of the ToolyBars. You can choose whether the ToolyBars should initially be hidden or displayed.
!Demo
<<toggleToolyBars "Toggle Sidebar">>
!Usage:
{{{<<toggleToolyBars>>}}} <<toggleToolyBars>>
additional options:
{{{<<toggleToolyBars label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)
You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideToolyBarsButton {float:right;} }}}
!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour.
*20-07-06: version 0.11
*27-04-06: version 0.1: working.
!Code
***/
//{{{
config.macros.toggleToolyBars={};
config.macros.toggleToolyBars.settings={
styleHide : ".title, .toolbar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 0em !important;}}\n"+"",
styleShow : " ",
arrow1: "Edit ",
arrow2: "Editing"
};
config.macros.toggleToolyBars.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
var tooltip= params[1]||'toggle hidden toolbars and tiddler title';
var mode = (params[2] && params[2]=="hide")? "hide":"show";
var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
var label= (params[0]&¶ms[0]!='.')?params[0]+" "+arrow:arrow;
var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleToolyBars,"button HideToolyBarsButton");
if (mode == "hide")
{
(document.getElementById("sidebar")).setAttribute("toggle","hide");
setStylesheet(this.settings.styleHide,"ToggleToolyBarsStyles");
}
};
config.macros.toggleToolyBars.onToggleToolyBars = function(){
var sidebar = document.getElementById("sidebar");
var settings = config.macros.toggleToolyBars.settings;
if (sidebar.getAttribute("toggle")=='hide')
{
setStylesheet(settings.styleShow,"ToggleToolyBarsStyles");
sidebar.setAttribute("toggle","show");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
}
else
{
setStylesheet(settings.styleHide,"ToggleToolyBarsStyles");
sidebar.setAttribute("toggle","hide");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
}
return false;
}
setStylesheet(".HideToolyBarsButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleToolyBarsButtonStyles");
//}}}
/***
|Name|ToggleslantedmenuMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/|
|Version|1.0|
|Requires|~TW2.x|
!Description:
{{c06{Modified by Morris Gray to toggle the Menu/Search etc. hidden/visible}}}
Provides a button for toggling visibility of the slantedmenu. You can choose whether the slantedmenu should initially be hidden or displayed.
!Demo
<<toggleslantedmenu "Toggle Sidebar">>
!Usage:
{{{<<toggleslantedmenu>>}}} <<toggleslantedmenu>>
additional options:
{{{<<toggleslantedmenu label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)
You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideslantedmenuButton {float:right;} }}}
!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour.
*20-07-06: version 0.11
*27-04-06: version 0.1: working.
!Code
***/
//{{{
config.macros.toggleslantedmenu={};
config.macros.toggleslantedmenu.settings={
styleHide : ".title, .toolbar, #slantedmenu { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 0em !important;}}\n"+"",
styleShow : " ",
arrow1: "menu",
arrow2: "menu"
};
config.macros.toggleslantedmenu.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
var tooltip= params[1]||'toggle menu hidden/visible';
var mode = (params[2] && params[2]=="hide")? "hide":"show";
var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
var label= (params[0]&¶ms[0]!='.')?params[0]+" "+arrow:arrow;
var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleslantedmenu,"button HideslantedmenuButton");
if (mode == "hide")
{
(document.getElementById("sidebar")).setAttribute("toggle","hide");
setStylesheet(this.settings.styleHide,"ToggleslantedmenuStyles");
}
};
config.macros.toggleslantedmenu.onToggleslantedmenu = function(){
var sidebar = document.getElementById("sidebar");
var settings = config.macros.toggleslantedmenu.settings;
if (sidebar.getAttribute("toggle")=='hide')
{
setStylesheet(settings.styleShow,"ToggleslantedmenuStyles");
sidebar.setAttribute("toggle","show");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
}
else
{
setStylesheet(settings.styleHide,"ToggleslantedmenuStyles");
sidebar.setAttribute("toggle","hide");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
}
return false;
}
setStylesheet(".HideslantedmenuButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleslantedmenuButtonStyles");
//}}}
/***
|Name|ToggleTiddlersBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/|
|Version|1.0|
|Requires|~TW2.x|
!Description:
{{c06{Modified by Morris Gray to toggle the TiddlersBar}}}
Provides a button for toggling visibility of the Toolbars. You can choose whether the Toolbars should initially be hidden or displayed.
!Demo
<<toggleTiddlersBar "Toggle Sidebar">>
!Usage:
{{{<<toggleTiddlersBar>>}}} <<toggleTiddlersBar>>
additional options:
{{{<<toggleTiddlersBar label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)
You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideTiddlersBarButton {float:right;} }}}
!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour.
*20-07-06: version 0.11
*27-04-06: version 0.1: working.
!Code
***/
//{{{
config.macros.toggleTiddlersBar={};
config.macros.toggleTiddlersBar.settings={
styleHide : ".title, #tiddlersBar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 0em !important;}}\n"+"",
styleShow : " ",
arrow1: "Tabs ",
arrow2: "NoTabs"
};
config.macros.toggleTiddlersBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
var tooltip= params[1]||'toggle tabs hidden/visible';
var mode = (params[2] && params[2]=="hide")? "hide":"show";
var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
var label= (params[0]&¶ms[0]!='.')?params[0]+" "+arrow:arrow;
var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleTiddlersBar,"button HideTiddlersBarButton");
if (mode == "hide")
{
(document.getElementById("sidebar")).setAttribute("toggle","hide");
setStylesheet(this.settings.styleHide,"ToggleTiddlersBarStyles");
}
};
config.macros.toggleTiddlersBar.onToggleTiddlersBar = function(){
var sidebar = document.getElementById("sidebar");
var settings = config.macros.toggleTiddlersBar.settings;
if (sidebar.getAttribute("toggle")=='hide')
{
setStylesheet(settings.styleShow,"ToggleTiddlersBarStyles");
sidebar.setAttribute("toggle","show");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
}
else
{
setStylesheet(settings.styleHide,"ToggleTiddlersBarStyles");
sidebar.setAttribute("toggle","hide");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
}
return false;
}
setStylesheet(".HideTiddlersBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleTiddlersBarButtonStyles");
//}}}
<<tabs " " [[Save/Options ]] "" [[ToolTabsIntro]] [[Options ]] "" [[OptionsPanel]] [[AdvancedOptions ]] "" [[AdvancedOptions]] [[ConfigOptions ]] "" [[ConfigOptions]] [[TspotControls ]] "" [[TspotControls]] [[SideBarTabs ]] "" [[SideBarTabs]] [[TWRelatedLinks]] "" [[TWRelatedLinks]] >>
----
<<saveAs>>
<<saveChanges>>
<<closeAll>>
<<permaview>>
|bgcolor:#adf;<<tiddler TspotSidebar>>|
<html><td><input class="btn" type="button" value="Refresh Window" onClick="location.reload()" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/></td></html>
----
@@color:#C06;''» »'' @@ <<tiddler EditATiddler>>
/***
Contains the stuff you need to use Tiddlyspot
Note you must also have UploadPlugin installed
***/
//{{{
// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'farrbrowser';
// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)
window.showBackstage = true; // show backstage too
// disable autosave in d3
if (window.location.protocol != "file:")
config.options.chkGTDLazyAutoSave = false;
// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToTiddlyspot]] ");
MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}
// create some shadow tiddler content
merge(config.shadowTiddlers,{
'WelcomeToTiddlyspot':[
"This document is a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //What now?// @@ Before you can save any changes, you need to enter your password in the form below. Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
"<<tiddler TspotControls>>",
"See also GettingStarted.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working online// @@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// @@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Help!// @@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// @@ We hope you like using your tiddlyspot.com site. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),
'TspotControls':[
"| tiddlyspot password:|<<option pasUploadPassword>>|",
"| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
"| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),
'TspotSidebar':[
"<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n"),
'TspotOptions':[
"tiddlyspot password:",
"<<option pasUploadPassword>>",
""
].join("\n")
});
//}}}
/***
''TwHelpSearch'' for TiddlyWiki 2.0.x to 2.2.x
^^author: Morris S. Gray
source: http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
documentation: http://twhelp.tiddlyspot.com/#TWHelpSearchDoc
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^
|>|>|>|<<search>> |
|>|>| look for in |>|>|>|
| <<option chkSearchTitles>> | <<option chkSearchText>> | <<option chkSearchTags>> | <<option chkHoldSearches>> |
| titles | text | tags | hold |
''A Plugin Tweak for:'' SearchOptionsPlugin
!!!!!Description
<<<
This plugin defines an alternative format for the SearchResults tiddler that is generated by the SearchOptionsPlugin . It presents the search results in tabular form numbering the rows; and showing the tiddler title, the size in bytes, and the tags. It is ready to be used with the [[SortableGridPlugin|http://solo.dc3.com/tw/#SortableGridPlugin]] (check versions) so any column can be sorted; such as size in ascending or descending order.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your ~TiddlyWiki:
* http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
*SearchOptionsPlugin from http://www.tiddlytools.com/#SearchOptionsPlugin
* Get more documentation here [[TWHelpSearchDoc]] or here:
* http://twhelp.tiddlyspot.com/#TwHelpSearchDoc
<<<
!!!!!Revision History
<<<
''2007.09.12 [1.0.6]''
Added overflow scroll to TWHelp-SearchResults for long titles or tags.
''2006.02.03 [1.0.5]''
Added facility for holding the results of multiple searches with tick box on dashboard.
''2006.02.02 [1.0.4]''
Added several options, cleaned up design.Planning one version basic and one with added options this is the added options version.
''2006.01.27 [1.0.3''
Added a column for the size of the text in each tiddler, this does not include the size of the title or tags. Added overall TW statistics button requires TiddlerStatsPlugin.
''2006.01.23 [1.0.2 ]''
''a)''Changed function reportSearchResults(text,matches) to window.reportSearchResults=function(text,matches)
''b)''Added a line so that Incremental Search is automatically disabled config.options.chkSearchIncremental=false; turn off key-by-key searching
''c)''Removed space inside parens. bgcolor(#fe8 )" to "bgcolor(#fe8)". This
is what was causing IE to 'crap out' halfway through drawing the table
headings.
''d)''Added {{{config.options.chkSearchList=true;}}}
''2006.01.20 [1.0.1]''
ELS: reportSearchResults() definition moved to this Plugin Tweak tiddler and removed extranous code
''2006.01.19 [1.0.0]''
This is an adaptation of Eric Shulman's SearchOptionsPlugin. Adapted by MorrisGray to provide search results in table form. All the necessary controls for refining the search is provided within the table including slide-down access to AdvancedOptions.
<<<
!!!!!Code
***/
//{{{
if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
if (config.options.chkRegExpSearch==undefined) config.options.chkRegExpSearch=true;
if (config.options.chkSearchTitles==undefined) config.options.chkSearchTitles=false;
if (config.options.chkSearchText==undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags==undefined) config.options.chkSearchTags=false;
if (config.options.chkSearchTitlesFirst==undefined) config.options.chkSearchTitlesFirst=true;
if (config.options.chkSearchList==undefined) config.options.chkSearchList=true;
if (config.options.chkSearchIncremental==undefined) config.options.chkSearchIncremental=false;
if (config.options.chkToggleLinks==true) config.options.chkToggleLinks=false;
if (config.options.chkHoldSearches==undefined) config.options.chkHoldSearches=false;
if (config.options.chkSortTags==undefined) config.options.chkSortTags=false;
config.options.chkToggleLinks=false;
config.options.chkSinglePageMode=false;
config.options.chkHoldSearches=false;
config.options.chkSearchIncremental=false;
config.options.chkHttpReadOnly = false;
config.options.chkRegExpSearch=true;
config.options.chkSearchList=true;
config.options.chkToggleLinks=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkHoldSearches>> Hold search results";
//}}}
//{{{
// Give the report a custom name
config.macros.search.reportTitle="TWHelp-SearchResults";
// Override default SearchOptionsPlugin formatting for SearchResults tiddler
window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
config.macros.search.reportTitle;
var q = config.options.chkRegExpSearch ? "/" : "'";
if (!config.options.chkHoldSearches) body="";
body+="\n|>|bgcolor(#8af):@@color(#000080):''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''@@|bgcolor(#8af): @@color(#A00000): SearchHelp@@ "+"|"+"\n";
body+="|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |"+"\n";
body+="\n|bgcolor(#8af): |bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h";
for(var t=0;t<matches.length;t++)
body+="\n"+"| "+(t+1)+"|[["+matches[t].title+"]]| "+matches[t].text.length+"|"+"@@"+matches[t].tags+"@@"+"|";
body+="\n";
// create/update the tiddler
var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch killbookmark");
store.addTiddler(tiddler); story.closeTiddler(title);
// render tiddler
var oldprompt=config.macros.search.label;
config.macros.search.label="search again"; // use alternate "search again" label
story.displayTiddler(null,title,1); // force refresh
config.macros.search.label=oldprompt; // restore standard search label
}
//}}}
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''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.PasswordOptionPlugin = {
major: 1, minor: 0, revision: 2,
date: new Date("Apr 19, 2007"),
source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
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)'
};
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");
merge(config.macros.option.types, {
'pas': {
elementType: "input",
valueField: "value",
eventName: "onkeyup",
className: "pasOptionInput",
typeValue: config.macros.option.passwordInputType,
create: function(place,type,opt,className,desc) {
// password field
config.macros.option.genericCreate(place,'pas',opt,className,desc);
// checkbox linked with this password "save this password on this computer"
config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);
// text savePasswordCheckboxLabel
place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
},
onChange: config.macros.option.genericOnChange
}
});
merge(config.optionHandlers['chk'], {
get: function(name) {
// is there an option linked with this chk ?
var opt = name.substr(3);
if (config.options[opt])
saveOptionCookie(opt);
return config.options[name] ? "true" : "false";
}
});
merge(config.optionHandlers, {
'pas': {
get: function(name) {
if (config.options["chk"+name]) {
return encodeCookie(config.options[name].toString());
} else {
return "";
}
},
set: function(name,value) {config.options[name] = decodeCookie(value);}
}
});
// need to reload options to load passwordOptions
loadOptionsCookie();
/*
if (!config.options['pasPassword'])
config.options['pasPassword'] = '';
merge(config.optionsDesc,{
pasPassword: "Test password"
});
*/
//}}}
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.0|
|''Date:''|May 5, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''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 (#3125)|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
major: 4, minor: 1, revision: 0,
date: new Date("May 5, 2007"),
source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
coreVersion: '2.2.0 (#3125)'
};
//
// Environment
//
if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false; // true to activate both in Plugin and UploadService
//
// Upload Macro
//
config.macros.upload = {
// default values
defaultBackupDir: '', //no backup
defaultStoreScript: "store.php",
defaultToFilename: "index.html",
defaultUploadDir: ".",
authenticateUser: true // UploadService Authenticate User
};
config.macros.upload.label = {
promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
promptParamMacro: "Save and Upload this TiddlyWiki in %0",
saveLabel: "save to web",
saveToDisk: "save to disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "No store URL in parmeters or options",
usernameOrPasswordMissing: "Username or password missing"
};
config.macros.upload.handler = function(place,macroName,params) {
if (readOnly)
return;
var label;
if (document.location.toString().substr(0,4) == "http")
label = this.label.saveLabel;
else
label = this.label.uploadLabel;
var prompt;
if (params[0]) {
prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0],
(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
} else {
prompt = this.label.promptOption;
}
createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};
config.macros.upload.action = function(params)
{
// for missing macro parameter set value from options
var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
var username = params[4] ? params[4] : config.options.txtUploadUserName;
var password = config.options.pasUploadPassword; // for security reason no password as macro parameter
// for still missing parameter set default value
if ((!storeUrl) && (document.location.toString().substr(0,4) == "http"))
storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
if (storeUrl.substr(0,4) != "http")
storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
if (!toFilename)
toFilename = bidix.basename(window.location.toString());
if (!toFilename)
toFilename = config.macros.upload.defaultToFilename;
if (!uploadDir)
uploadDir = config.macros.upload.defaultUploadDir;
if (!backupDir)
backupDir = config.macros.upload.defaultBackupDir;
// report error if still missing
if (!storeUrl) {
alert(config.macros.upload.messages.noStoreUrl);
clearMessage();
return false;
}
if (config.macros.upload.authenticateUser && (!username || !password)) {
alert(config.macros.upload.messages.usernameOrPasswordMissing);
clearMessage();
return false;
}
bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password);
return false;
};
config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir)
{
if (!storeUrl)
return null;
var dest = bidix.dirname(storeUrl);
if (uploadDir && uploadDir != '.')
dest = dest + '/' + uploadDir;
dest = dest + '/' + toFilename;
return dest;
};
//
// uploadOptions Macro
//
config.macros.uploadOptions = {
handler: function(place,macroName,params) {
var wizard = new Wizard();
wizard.createWizard(place,this.wizardTitle);
wizard.addStep(this.step1Title,this.step1Html);
var markList = wizard.getElement("markList");
var listWrapper = document.createElement("div");
markList.parentNode.insertBefore(listWrapper,markList);
wizard.setValue("listWrapper",listWrapper);
this.refreshOptions(listWrapper,false);
var uploadCaption;
if (document.location.toString().substr(0,4) == "http")
uploadCaption = config.macros.upload.label.saveLabel;
else
uploadCaption = config.macros.upload.label.uploadLabel;
wizard.setButtons([
{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption,
onClick: config.macros.upload.action},
{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
]);
},
refreshOptions: function(listWrapper) {
var uploadOpts = [
"txtUploadUserName",
"pasUploadPassword",
"txtUploadStoreUrl",
"txtUploadDir",
"txtUploadFilename",
"txtUploadBackupDir",
"chkUploadLog",
"txtUploadLogMaxLine",
]
var opts = [];
for(i=0; i<uploadOpts.length; i++) {
var opt = {};
opts.push()
opt.option = "";
n = uploadOpts[i];
opt.name = n;
opt.lowlight = !config.optionsDesc[n];
opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
opts.push(opt);
}
var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
for(n=0; n<opts.length; n++) {
var type = opts[n].name.substr(0,3);
var h = config.macros.option.types[type];
if (h && h.create) {
h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
}
}
},
onCancel: function(e)
{
backstage.switchTab(null);
return false;
},
wizardTitle: "Upload with options",
step1Title: "These options are saved in cookies in your browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Cancel",
cancelButtonPrompt: "Cancel prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
}
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
backupSaved: "Backup saved",
backupFailed: "Failed to upload backup file",
rssSaved: "RSS feed uploaded",
rssFailed: "Failed to upload RSS feed file",
emptySaved: "Empty template uploaded",
emptyFailed: "Failed to upload empty template file",
mainSaved: "Main TiddlyWiki file uploaded",
mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
//specific upload
loadOriginalHttpPostError: "Can't get original file",
aboutToSaveOnHttpPost: 'About to upload on %0 ...',
storePhpNotFound: "The store script '%0' was not found."
};
bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
var callback = function(status,uploadParams,original,url,xhr) {
if (!status) {
displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
return;
}
if (bidix.debugMode)
alert(original.substr(0,500)+"\n...");
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.upload.uploadRss(uploadParams,original,posDiv);
};
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
// save on localdisk ?
if (document.location.toString().substr(0,4) == "file") {
var path = document.location.toString();
var localPath = getLocalPath(path);
saveChanges();
}
// get original
var uploadParams = Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
var originalPath = document.location.toString();
// If url is a directory : add index.html
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + "index.html";
var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
var log = new bidix.UploadLog();
log.startUpload(storeUrl, dest, uploadDir, backupDir);
displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
if (bidix.debugMode)
alert("about to execute Http - GET on "+originalPath);
var r = doHttp("GET",originalPath,null,null,null,null,callback,uploadParams,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
bidix.upload.uploadRss = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
bidix.upload.uploadMain(params[0],params[1],params[2]);
} else {
displayMessage(bidix.upload.messages.rssFailed);
}
};
// do uploadRss
if(config.options.chkGenerateAnRssFeed) {
var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
var rssUploadParams = Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
bidix.upload.httpUpload(rssUploadParams,convertUnicodeToUTF8(generateRss()),callback,Array(uploadParams,original,posDiv));
} else {
bidix.upload.uploadMain(uploadParams,original,posDiv);
}
};
bidix.upload.uploadMain = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
var log = new bidix.UploadLog();
if(status) {
// if backupDir specified
if ((params[3]) && (responseText.indexOf("backupfile:") > -1)) {
var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
}
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
store.setDirty(false);
log.endUpload("ok");
} else {
alert(bidix.upload.messages.mainFailed);
displayMessage(bidix.upload.messages.mainFailed);
log.endUpload("failed");
}
};
// do uploadMain
var revised = bidix.upload.updateOriginal(original,posDiv);
bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};
bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
var localCallback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (xhr.status == httpStatus.NotFound)
alert(bidix.upload.messages.storePhpNotFound.format([url]));
if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
alert(responseText);
if (responseText.indexOf("Debug mode") >= 0 )
responseText = responseText.substring(responseText.indexOf("\n\n")+2);
} else if (responseText.charAt(0) != '0')
alert(responseText);
if (responseText.charAt(0) != '0')
status = null;
callback(status,params,responseText,url,xhr);
};
// do httpUpload
var boundary = "---------------------------"+"AaB03x";
var uploadFormName = "UploadPlugin";
// compose headers data
var sheader = "";
sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
sheader += uploadFormName +"\"\r\n\r\n";
sheader += "backupDir="+uploadParams[3] +
";user=" + uploadParams[4] +
";password=" + uploadParams[5] +
";uploaddir=" + uploadParams[2];
if (bidix.debugMode)
sheader += ";debug=1";
sheader += ";;\r\n";
sheader += "\r\n" + "--" + boundary + "\r\n";
sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
sheader += "Content-Length: " + data.length + "\r\n\r\n";
// compose trailer data
var strailer = new String();
strailer = "\r\n--" + boundary + "--\r\n";
data = sheader + data + strailer;
if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
if (!posDiv)
posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
store.allTiddlersAsHtml() + "\n" +
original.substr(posDiv[1]);
var newSiteTitle = getPageTitle().htmlEncode();
revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
return revised;
};
//
// UploadLog
//
// config.options.chkUploadLog :
// false : no logging
// true : logging
// config.options.txtUploadLogMaxLine :
// -1 : no limit
// 0 : no Log lines but UploadLog is still in place
// n : the last n lines are only kept
// NaN : no limit (-1)
bidix.UploadLog = function() {
if (!config.options.chkUploadLog)
return; // this.tiddler = null
this.tiddler = store.getTiddler("UploadLog");
if (!this.tiddler) {
this.tiddler = new Tiddler();
this.tiddler.title = "UploadLog";
this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
this.tiddler.created = new Date();
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
}
return this;
};
bidix.UploadLog.prototype.addText = function(text) {
if (!this.tiddler)
return;
// retrieve maxLine when we need it
var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
if (isNaN(maxLine))
maxLine = -1;
// add text
if (maxLine != 0)
this.tiddler.text = this.tiddler.text + text;
// Trunck to maxLine
if (maxLine >= 0) {
var textArray = this.tiddler.text.split('\n');
if (textArray.length > maxLine + 1)
textArray.splice(1,textArray.length-1-maxLine);
this.tiddler.text = textArray.join('\n');
}
// update tiddler fields
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
// refresh and notifiy for immediate update
story.refreshTiddler(this.tiddler.title);
store.notify(this.tiddler.title, true);
};
bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
if (!this.tiddler)
return;
var now = new Date();
var text = "\n| ";
var filename = bidix.basename(document.location.toString());
if (!filename) filename = '/';
text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
text += config.options.txtUserName + " | ";
text += "[["+filename+"|"+location + "]] |";
text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
text += uploadDir + " | ";
text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
text += backupDir + " |";
this.addText(text);
};
bidix.UploadLog.prototype.endUpload = function(status) {
if (!this.tiddler)
return;
this.addText(" "+status+" |");
};
//
// Utilities
//
bidix.checkPlugin = function(plugin, major, minor, revision) {
var ext = version.extensions[plugin];
if (!
(ext &&
((ext.major > major) ||
((ext.major == major) && (ext.minor > minor)) ||
((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
// write error in PluginManager
if (pluginInfo)
pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
}
};
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("\\"));
}
};
bidix.basename = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("#")) != -1)
filePath = filePath.substring(0, lastpos);
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(lastpos + 1);
} else
return filePath.substring(filePath.lastIndexOf("\\")+1);
};
bidix.initOption = function(name,value) {
if (!config.options[name])
config.options[name] = value;
};
//
// Initializations
//
// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);
// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");
//optionsDesc
merge(config.optionsDesc,{
txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
txtUploadUserName: "Upload Username",
pasUploadPassword: "Upload Password",
chkUploadLog: "do Logging in UploadLog (default: true)",
txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});
// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');
/* don't want this for tiddlyspot sites
// Backstage
merge(config.tasks,{
uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
*/
//}}}
<<tabs "txtStayViewTabs" [[Intro ]] "" [[TabsIntro]] [[AllNotes ]] "" [[AllNotes]] [[AllSnips ]] " " [[AllSnips]] [[AllTabs ]] "" [[AllTabs]] [[BasicTabs ]] " " [[BasicTabs]] [[Directory ]] "" [[Directory]] [[Find]] "" [[Find]] [[History ]] "" [[Timeline]] [[Plugins ]] "" [[Plugins]] [[Shadowed ]] "" [[SystemTabs]] [[Styling ]] "" [[Styling]] [[SideBarOptions ]] "" [[SideBarOptions]] [[ExcludedFromSearches ]] "" [[ExcludedFromSearches]] [[ExcludedFromLists ]] "" [[ExcludedFromLists]] [[Script ]] "" [[Script]] [[SideBarTabs ]] "" [[SideBarTabs]]>>
<div class='toolbar' macro='toolbar -closeTiddler closeOthers closeAll +editTiddler permalink references newDocument '></div>
<div class='title' macro='view title'></div>
<div class='viewer' macro='view text wikified'></div></div>
/***
!!!<<gradient horiz #fc3 #fff >><<tiddler RefreshStyles>> WebStyleSheet>>/%==================================================%/
***/
.firstletter{
float:left;
width:0.75em;
font-size:400%;
font-family:times,courier;
line-height:80%;
}
div.container
{
height:100%;
width:100%;
margin:0px;
border:1px solid gray;
background:;
line-height:130%;
}
div.header
{
padding:0.5em;
color:white;
background-color:gray;
clear:left;
}
div.footer
{
padding:0.5em;
color:blue;
background-color:#fdf;
clear:left;
}
h1.header
{
padding:0;
margin:0;
}
div.left
{
background:#ddd;
float:left;
width:30%;
margin:0;
padding:1em;
}
div.content
{
background:#ccc;
margin-left:300px;
border-left:1px solid gray;
padding:1em;
}
!!!~EndWebPage /%==================================================%/
/%@@padding-top:1em;@@
{{textcenter gray9{
<<tiddler Version>> - <<version>>
Symbex Australasia Pty.Ltd. © 2008
@@color:#c06;This Sidebar Notes is at:@@ <script>var today=new Date();document.write('<font style="color:#090">'+'URL='+window.location+'</font>')</script>%/